@yoast/ai-insights-client 1.4.12 → 1.4.14

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 Bx=Object.defineProperty;var wh=e=>{throw TypeError(e)};var qx=(e,t,n)=>t in e?Bx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var pe=(e,t,n)=>qx(e,typeof t!="symbol"?t+"":t,n),Vc=(e,t,n)=>t.has(e)||wh("Cannot "+n);var P=(e,t,n)=>(Vc(e,t,"read from private field"),n?n.call(e):t.get(e)),ie=(e,t,n)=>t.has(e)?wh("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Y=(e,t,n,r)=>(Vc(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Ae=(e,t,n)=>(Vc(e,t,"access private method"),n);var Va=(e,t,n,r)=>({set _(i){Y(e,t,i,n)},get _(){return P(e,t,r)}});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react/jsx-runtime"),A=require("@yoast/ui-library"),z=require("react"),zx=require("styled-components");function Hx(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=Hx(z);function Yp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var to={},Sh;function Kx(){if(Sh)return to;Sh=1,Object.defineProperty(to,"__esModule",{value:!0}),to.parse=o,to.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),C=w===-1?m:w;if(b>C){v=f.lastIndexOf(";",b-1)+1;continue}const x=a(f,v,b),k=l(f,b,x),S=f.slice(x,k);if(g[S]===void 0){let _=a(f,b+1,C),O=l(f,C,_);const E=p(f.slice(_,O));g[S]=E}v=C+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 to}Kx();/**
1
+ "use strict";var qx=Object.defineProperty;var wh=e=>{throw TypeError(e)};var zx=(e,t,n)=>t in e?qx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var me=(e,t,n)=>zx(e,typeof t!="symbol"?t+"":t,n),Wc=(e,t,n)=>t.has(e)||wh("Cannot "+n);var P=(e,t,n)=>(Wc(e,t,"read from private field"),n?n.call(e):t.get(e)),ie=(e,t,n)=>t.has(e)?wh("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),X=(e,t,n,r)=>(Wc(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Pe=(e,t,n)=>(Wc(e,t,"access private method"),n);var Wa=(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"),A=require("@yoast/ui-library"),z=require("react"),Hx=require("styled-components");function Kx(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 $=Kx(z);function Xp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var to={},Sh;function Ux(){if(Sh)return to;Sh=1,Object.defineProperty(to,"__esModule",{value:!0}),to.parse=o,to.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),C=w===-1?m:w;if(b>C){v=f.lastIndexOf(";",b-1)+1;continue}const x=a(f,v,b),k=l(f,b,x),S=f.slice(x,k);if(g[S]===void 0){let _=a(f,b+1,C),O=l(f,C,_);const E=p(f.slice(_,O));g[S]=E}v=C+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 to}Ux();/**
2
2
  * react-router v7.6.3
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
@@ -7,74 +7,75 @@
7
7
  * LICENSE.md file in the root directory of this source tree.
8
8
  *
9
9
  * @license MIT
10
- */function Ux(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=Wx(i?c().pathname:"/",h,g,m);return fn(p.pathname.charAt(0)==="/",`relative pathnames are not supported in memory history: ${JSON.stringify(h)}`),p}function d(h){return typeof h=="string"?h:$l(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"?Di(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 tt(e,t){if(e===!1||e===null||typeof e=="undefined")throw new Error(t)}function fn(e,t){if(!e){typeof console!="undefined"&&console.warn(t);try{throw new Error(t)}catch(n){}}}function Vx(){return Math.random().toString(36).substring(2,10)}function Wx(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Di(t):t,state:n,key:t&&t.key||r||Vx()}}function $l({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 Di(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 Xp(e,t,n="/"){return Gx(e,t,n,!1)}function Gx(e,t,n,r){let i=typeof t=="string"?Di(t):t,s=cr(i.pathname||"/",n);if(s==null)return null;let o=Jp(e);Qx(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let c=e0(s);a=iw(o[l],c,r)}return a}function Jp(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("/")&&(tt(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=sr([r,l.relativePath]),u=n.concat(l);s.children&&s.children.length>0&&(tt(s.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),Jp(s.children,t,u,c)),!(s.path==null&&!s.index)&&t.push({path:c,score:nw(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 Zp(s.path))i(s,o,l)}),t}function Zp(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=Zp(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 Qx(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:rw(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var Yx=/^:[\w-]+$/,Xx=3,Jx=2,Zx=1,ew=10,tw=-2,Ch=e=>e==="*";function nw(e,t){let n=e.split("/"),r=n.length;return n.some(Ch)&&(r+=tw),t&&(r+=Jx),n.filter(i=>!Ch(i)).reduce((i,s)=>i+(Yx.test(s)?Xx:s===""?Zx:ew),r)}function rw(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 iw(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=Ps({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},u),f=l.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Ps({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},u)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:sr([s,d.pathname]),pathnameBase:cw(sr([s,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(s=sr([s,d.pathnameBase]))}return o}function Ps(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=sw(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 sw(e,t=!1,n=!0){fn(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 e0(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return fn(!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 cr(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 ow(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Di(e):e;return{pathname:n?n.startsWith("/")?n:aw(n,t):t,search:uw(r),hash:dw(i)}}function aw(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 Wc(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 lw(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Yd(e){let t=lw(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Xd(e,t,n,r=!1){let i;typeof e=="string"?i=Di(e):(i={...e},tt(!i.pathname||!i.pathname.includes("?"),Wc("?","pathname","search",i)),tt(!i.pathname||!i.pathname.includes("#"),Wc("#","pathname","hash",i)),tt(!i.search||!i.search.includes("#"),Wc("#","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=ow(i,a),c=o&&o!=="/"&&o.endsWith("/"),u=(s||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}var sr=e=>e.join("/").replace(/\/\/+/g,"/"),cw=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),uw=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,dw=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function fw(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var t0=["POST","PUT","PATCH","DELETE"];new Set(t0);var hw=["GET",...t0];new Set(hw);var Ns=M.createContext(null);Ns.displayName="DataRouter";var uc=M.createContext(null);uc.displayName="DataRouterState";var n0=M.createContext({isTransitioning:!1});n0.displayName="ViewTransition";var gw=M.createContext(new Map);gw.displayName="Fetchers";var yw=M.createContext(null);yw.displayName="Await";var kn=M.createContext(null);kn.displayName="Navigation";var Aa=M.createContext(null);Aa.displayName="Location";var hn=M.createContext({outlet:null,matches:[],isDataRoute:!1});hn.displayName="Route";var Jd=M.createContext(null);Jd.displayName="RouteError";function mw(e,{relative:t}={}){tt(Li(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=M.useContext(kn),{hash:i,pathname:s,search:o}=Pa(e,{relative:t}),a=s;return n!=="/"&&(a=s==="/"?n:sr([n,s])),r.createHref({pathname:a,search:o,hash:i})}function Li(){return M.useContext(Aa)!=null}function Bt(){return tt(Li(),"useLocation() may be used only in the context of a <Router> component."),M.useContext(Aa).location}function Wa(e){tt(Li(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=Bt();return M.useMemo(()=>Ps(e,e0(t)),[t,e])}var r0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function i0(e){M.useContext(kn).static||M.useLayoutEffect(e)}function gn(){let{isDataRoute:e}=M.useContext(hn);return e?jw():pw()}function pw(){tt(Li(),"useNavigate() may be used only in the context of a <Router> component.");let e=M.useContext(Ns),{basename:t,navigator:n}=M.useContext(kn),{matches:r}=M.useContext(hn),{pathname:i}=Bt(),s=JSON.stringify(Yd(r)),o=M.useRef(!1);return i0(()=>{o.current=!0}),M.useCallback((l,c={})=>{if(fn(o.current,r0),!o.current)return;if(typeof l=="number"){n.go(l);return}let u=Xd(l,JSON.parse(s),i,c.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:sr([t,u.pathname])),(c.replace?n.replace:n.push)(u,c.state,c)},[t,n,s,i,e])}var vw=M.createContext(null);function bw(e){let t=M.useContext(hn).outlet;return t&&M.createElement(vw.Provider,{value:e},t)}function Zd(){let{matches:e}=M.useContext(hn),t=e[e.length-1];return t?t.params:{}}function Pa(e,{relative:t}={}){let{matches:n}=M.useContext(hn),{pathname:r}=Bt(),i=JSON.stringify(Yd(n));return M.useMemo(()=>Xd(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function xw(e,t){return s0(e,t)}function s0(e,t,n,r){var v;tt(Li(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=M.useContext(kn),{matches:s}=M.useContext(hn),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||"";o0(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 Wx(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=Gx(i?c().pathname:"/",h,g,m);return fn(p.pathname.charAt(0)==="/",`relative pathnames are not supported in memory history: ${JSON.stringify(h)}`),p}function d(h){return typeof h=="string"?h:Ml(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"?Di(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 nt(e,t){if(e===!1||e===null||typeof e=="undefined")throw new Error(t)}function fn(e,t){if(!e){typeof console!="undefined"&&console.warn(t);try{throw new Error(t)}catch(n){}}}function Vx(){return Math.random().toString(36).substring(2,10)}function Gx(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Di(t):t,state:n,key:t&&t.key||r||Vx()}}function Ml({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 Di(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 Jp(e,t,n="/"){return Qx(e,t,n,!1)}function Qx(e,t,n,r){let i=typeof t=="string"?Di(t):t,s=cr(i.pathname||"/",n);if(s==null)return null;let o=Zp(e);Yx(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let c=t0(s);a=sw(o[l],c,r)}return a}function Zp(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("/")&&(nt(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=sr([r,l.relativePath]),u=n.concat(l);s.children&&s.children.length>0&&(nt(s.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),Zp(s.children,t,u,c)),!(s.path==null&&!s.index)&&t.push({path:c,score:rw(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 e0(s.path))i(s,o,l)}),t}function e0(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=e0(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 Yx(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:iw(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var Xx=/^:[\w-]+$/,Jx=3,Zx=2,ew=1,tw=10,nw=-2,Ch=e=>e==="*";function rw(e,t){let n=e.split("/"),r=n.length;return n.some(Ch)&&(r+=nw),t&&(r+=Zx),n.filter(i=>!Ch(i)).reduce((i,s)=>i+(Xx.test(s)?Jx:s===""?ew:tw),r)}function iw(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 sw(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=Ps({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},u),f=l.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Ps({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},u)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:sr([s,d.pathname]),pathnameBase:uw(sr([s,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(s=sr([s,d.pathnameBase]))}return o}function Ps(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=ow(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 ow(e,t=!1,n=!0){fn(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 t0(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return fn(!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 cr(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 aw(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Di(e):e;return{pathname:n?n.startsWith("/")?n:lw(n,t):t,search:dw(r),hash:fw(i)}}function lw(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 Vc(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 cw(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Yd(e){let t=cw(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Xd(e,t,n,r=!1){let i;typeof e=="string"?i=Di(e):(i={...e},nt(!i.pathname||!i.pathname.includes("?"),Vc("?","pathname","search",i)),nt(!i.pathname||!i.pathname.includes("#"),Vc("#","pathname","hash",i)),nt(!i.search||!i.search.includes("#"),Vc("#","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=aw(i,a),c=o&&o!=="/"&&o.endsWith("/"),u=(s||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}var sr=e=>e.join("/").replace(/\/\/+/g,"/"),uw=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),dw=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,fw=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function hw(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var n0=["POST","PUT","PATCH","DELETE"];new Set(n0);var gw=["GET",...n0];new Set(gw);var Ns=$.createContext(null);Ns.displayName="DataRouter";var uc=$.createContext(null);uc.displayName="DataRouterState";var r0=$.createContext({isTransitioning:!1});r0.displayName="ViewTransition";var yw=$.createContext(new Map);yw.displayName="Fetchers";var mw=$.createContext(null);mw.displayName="Await";var kn=$.createContext(null);kn.displayName="Navigation";var Aa=$.createContext(null);Aa.displayName="Location";var hn=$.createContext({outlet:null,matches:[],isDataRoute:!1});hn.displayName="Route";var Jd=$.createContext(null);Jd.displayName="RouteError";function pw(e,{relative:t}={}){nt(Li(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=$.useContext(kn),{hash:i,pathname:s,search:o}=Pa(e,{relative:t}),a=s;return n!=="/"&&(a=s==="/"?n:sr([n,s])),r.createHref({pathname:a,search:o,hash:i})}function Li(){return $.useContext(Aa)!=null}function Bt(){return nt(Li(),"useLocation() may be used only in the context of a <Router> component."),$.useContext(Aa).location}function Va(e){nt(Li(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=Bt();return $.useMemo(()=>Ps(e,t0(t)),[t,e])}var i0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function s0(e){$.useContext(kn).static||$.useLayoutEffect(e)}function gn(){let{isDataRoute:e}=$.useContext(hn);return e?$w():vw()}function vw(){nt(Li(),"useNavigate() may be used only in the context of a <Router> component.");let e=$.useContext(Ns),{basename:t,navigator:n}=$.useContext(kn),{matches:r}=$.useContext(hn),{pathname:i}=Bt(),s=JSON.stringify(Yd(r)),o=$.useRef(!1);return s0(()=>{o.current=!0}),$.useCallback((l,c={})=>{if(fn(o.current,i0),!o.current)return;if(typeof l=="number"){n.go(l);return}let u=Xd(l,JSON.parse(s),i,c.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:sr([t,u.pathname])),(c.replace?n.replace:n.push)(u,c.state,c)},[t,n,s,i,e])}var bw=$.createContext(null);function xw(e){let t=$.useContext(hn).outlet;return t&&$.createElement(bw.Provider,{value:e},t)}function Zd(){let{matches:e}=$.useContext(hn),t=e[e.length-1];return t?t.params:{}}function Pa(e,{relative:t}={}){let{matches:n}=$.useContext(hn),{pathname:r}=Bt(),i=JSON.stringify(Yd(n));return $.useMemo(()=>Xd(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function ww(e,t){return o0(e,t)}function o0(e,t,n,r){var v;nt(Li(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=$.useContext(kn),{matches:s}=$.useContext(hn),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||"";a0(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=Bt(),f;if(t){let b=typeof t=="string"?Di(t):t;tt(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=Xp(e,{pathname:g});fn(u||m!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),fn(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=kw(m&&m.map(b=>Object.assign({},b,{params:Object.assign({},a,b.params),pathname:sr([c,i.encodeLocation?i.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?c:sr([c,i.encodeLocation?i.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),s,n,r);return t&&p?M.createElement(Aa.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...f},navigationType:"POP"}},p):p}function ww(){let e=Tw(),t=fw(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 Sw=M.createElement(ww,null),Cw=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(hn.Provider,{value:this.props.routeContext},M.createElement(Jd.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function _w({routeContext:e,match:t,children:n}){let r=M.useContext(Ns);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),M.createElement(hn.Provider,{value:e},n)}function kw(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);tt(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||Sw,o&&(a<0&&u===0?(o0("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(_w,{match:c,routeContext:{outlet:l,matches:m,isDataRoute:n!=null},children:v})};return n&&(c.route.ErrorBoundary||c.route.errorElement||u===0)?M.createElement(Cw,{location:n.location,revalidation:n.revalidation,component:h,error:d,children:p(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):p()},null)}function ef(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ow(e){let t=M.useContext(Ns);return tt(t,ef(e)),t}function Ew(e){let t=M.useContext(uc);return tt(t,ef(e)),t}function Aw(e){let t=M.useContext(hn);return tt(t,ef(e)),t}function tf(e){let t=Aw(e),n=t.matches[t.matches.length-1];return tt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Pw(){return tf("useRouteId")}function Tw(){var r;let e=M.useContext(Jd),t=Ew("useRouteError"),n=tf("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function jw(){let{router:e}=Ow("useNavigate"),t=tf("useNavigate"),n=M.useRef(!1);return i0(()=>{n.current=!0}),M.useCallback(async(i,s={})=>{fn(n.current,r0),n.current&&(typeof i=="number"?e.navigate(i):await e.navigate(i,{fromRouteId:t,...s}))},[e,t])}var _h={};function o0(e,t,n){!t&&!_h[e]&&(_h[e]=!0,fn(!1,n))}M.memo(Mw);function Mw({routes:e,future:t,state:n}){return s0(e,void 0,n,t)}function $w({basename:e,children:t,initialEntries:n,initialIndex:r}){let i=M.useRef();i.current==null&&(i.current=Ux({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(Dw,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:s})}function ai({to:e,replace:t,state:n,relative:r}){tt(Li(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=M.useContext(kn);fn(!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(hn),{pathname:o}=Bt(),a=gn(),l=Xd(e,Yd(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 Ts(e){return bw(e.context)}function bt(e){tt(!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 Dw({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:s=!1}){tt(!Li(),"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=Di(n));let{pathname:l="/",search:c="",hash:u="",state:d=null,key:f="default"}=n,h=M.useMemo(()=>{let g=cr(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 fn(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(kn.Provider,{value:a},M.createElement(Aa.Provider,{children:t,value:h}))}function Lw({children:e,location:t}){return xw(Iu(e),t)}function Iu(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,Iu(r.props.children,s));return}tt(r.type===bt,`[${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>`),tt(!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=Iu(r.props.children,s)),n.push(o)}),n}var wl="get",Sl="application/x-www-form-urlencoded";function dc(e){return e!=null&&typeof e.tagName=="string"}function Iw(e){return dc(e)&&e.tagName.toLowerCase()==="button"}function Rw(e){return dc(e)&&e.tagName.toLowerCase()==="form"}function Nw(e){return dc(e)&&e.tagName.toLowerCase()==="input"}function Fw(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Bw(e,t){return e.button===0&&(!t||t==="_self")&&!Fw(e)}var Ga=null;function qw(){if(Ga===null)try{new FormData(document.createElement("form"),0),Ga=!1}catch(e){Ga=!0}return Ga}var zw=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Gc(e){return e!=null&&!zw.has(e)?(fn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Sl}"`),null):e}function Hw(e,t){let n,r,i,s,o;if(Rw(e)){let a=e.getAttribute("action");r=a?cr(a,t):null,n=e.getAttribute("method")||wl,i=Gc(e.getAttribute("enctype"))||Sl,s=new FormData(e)}else if(Iw(e)||Nw(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?cr(l,t):null,n=e.getAttribute("formmethod")||a.getAttribute("method")||wl,i=Gc(e.getAttribute("formenctype"))||Gc(a.getAttribute("enctype"))||Sl,s=new FormData(a,e),!qw()){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(dc(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=wl,r=null,i=Sl,o=e}return s&&i==="text/plain"&&(o=s,s=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:s,body:o}}function nf(e,t){if(e===!1||e===null||typeof e=="undefined")throw new Error(t)}async function Kw(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 Uw(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 Vw(e,t,n){let r=await Promise.all(e.map(async i=>{let s=t.routes[i.route.id];if(s){let o=await Kw(s,n);return o.links?o.links():[]}return[]}));return Yw(r.flat(1).filter(Uw).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function kh(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 Ww(e,t,{includeHydrateFallback:n}={}){return Gw(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 Gw(e){return[...new Set(e)]}function Qw(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Yw(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let s=JSON.stringify(Qw(i));return n.has(s)||(n.add(s),r.push({key:s,link:i})),r},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Xw=new Set([100,101,204,205]);function Jw(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&&cr(n.pathname,t)==="/"?n.pathname=`${t.replace(/\/$/,"")}/_root.data`:n.pathname=`${n.pathname.replace(/\/$/,"")}.data`,n}function a0(){let e=M.useContext(Ns);return nf(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Zw(){let e=M.useContext(uc);return nf(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var rf=M.createContext(void 0);rf.displayName="FrameworkContext";function l0(){let e=M.useContext(rf);return nf(e,"You must render this element inside a <HydratedRouter> element"),e}function e2(e,t){let n=M.useContext(rf),[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:no(a,h),onBlur:no(l,g),onMouseEnter:no(c,h),onMouseLeave:no(u,g),onTouchStart:no(d,h)}]:[!1,f,{}]}function no(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function t2({page:e,...t}){let{router:n}=a0(),r=M.useMemo(()=>Xp(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?M.createElement(r2,{page:e,matches:r,...t}):null}function n2(e){let{manifest:t,routeModules:n}=l0(),[r,i]=M.useState([]);return M.useEffect(()=>{let s=!1;return Vw(e,t,n).then(o=>{s||i(o)}),()=>{s=!0}},[e,t,n]),r}function r2({page:e,matches:t,...n}){let r=Bt(),{manifest:i,routeModules:s}=l0(),{basename:o}=a0(),{loaderData:a,matches:l}=Zw(),c=M.useMemo(()=>kh(e,t,l,i,r,"data"),[e,t,l,i,r]),u=M.useMemo(()=>kh(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(C=>C.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=Jw(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(()=>Ww(u,i),[u,i]),h=n2(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 i2(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var c0=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined";try{c0&&(window.__reactRouterVersion="7.6.3")}catch(e){}var u0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Vr=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(kn),m=typeof c=="string"&&u0.test(c),p,v=!1;if(typeof c=="string"&&m&&(p=c,c0))try{let O=new URL(window.location.href),E=c.startsWith("//")?new URL(O.protocol+c):new URL(c),T=cr(E.pathname,g);E.origin===O.origin&&T!=null?c=T+E.search+E.hash:v=!0}catch(O){fn(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let b=mw(c,{relative:i}),[w,C,x]=e2(r,f),k=l2(c,{replace:o,state:a,target:l,preventScrollReset:u,relative:i,viewTransition:d});function S(O){t&&t(O),O.defaultPrevented||k(O)}let _=M.createElement("a",{...f,...x,href:p||b,onClick:v||s?t:S,ref:i2(h,C),target:l,"data-discover":!m&&n==="render"?"true":void 0});return w&&!m?M.createElement(M.Fragment,null,_,M.createElement(t2,{page:b})):_});Vr.displayName="Link";var s2=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=Pa(o,{relative:c.relative}),f=Bt(),h=M.useContext(uc),{navigator:g,basename:m}=M.useContext(kn),p=h!=null&&h2(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=cr(w,m)||w);const C=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let x=b===v||!i&&b.startsWith(v)&&b.charAt(C)==="/",k=w!=null&&(w===v||!i&&w.startsWith(v)&&w.charAt(v.length)==="/"),S={isActive:x,isPending:k,isTransitioning:p},_=x?t:void 0,O;typeof r=="function"?O=r(S):O=[r,x?"active":null,k?"pending":null,p?"transitioning":null].filter(Boolean).join(" ");let E=typeof s=="function"?s(S):s;return M.createElement(Vr,{...c,"aria-current":_,className:O,ref:u,style:E,to:o,viewTransition:a},typeof l=="function"?l(S):l)});s2.displayName="NavLink";var o2=M.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:s,method:o=wl,action:a,onSubmit:l,relative:c,preventScrollReset:u,viewTransition:d,...f},h)=>{let g=d2(),m=f2(a,{relative:c}),p=o.toLowerCase()==="get"?"get":"post",v=typeof a=="string"&&u0.test(a),b=w=>{if(l&&l(w),w.defaultPrevented)return;w.preventDefault();let C=w.nativeEvent.submitter,x=(C==null?void 0:C.getAttribute("formmethod"))||o;g(C||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})});o2.displayName="Form";function a2(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function d0(e){let t=M.useContext(Ns);return tt(t,a2(e)),t}function l2(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:s,viewTransition:o}={}){let a=gn(),l=Bt(),c=Pa(e,{relative:s});return M.useCallback(u=>{if(Bw(u,t)){u.preventDefault();let d=n!==void 0?n:$l(l)===$l(c);a(e,{replace:d,state:r,preventScrollReset:i,relative:s,viewTransition:o})}},[l,a,c,n,r,t,e,i,s,o])}var c2=0,u2=()=>`__${String(++c2)}__`;function d2(){let{router:e}=d0("useSubmit"),{basename:t}=M.useContext(kn),n=Pw();return M.useCallback(async(r,i={})=>{let{action:s,method:o,encType:a,formData:l,body:c}=Hw(r,t);if(i.navigate===!1){let u=i.fetcherKey||u2();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 f2(e,{relative:t}={}){let{basename:n}=M.useContext(kn),r=M.useContext(hn);tt(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),s={...Pa(e||".",{relative:t})},o=Bt();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:sr([n,s.pathname])),$l(s)}function h2(e,t={}){let n=M.useContext(n0);tt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=d0("useViewTransitionState"),i=Pa(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=cr(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=cr(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ps(i.pathname,o)!=null||Ps(i.pathname,s)!=null}[...Xw];var Fs=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(){}},ki=typeof window=="undefined"||"Deno"in globalThis;function Tt(){}function g2(e,t){return typeof e=="function"?e(t):e}function Ru(e){return typeof e=="number"&&e>=0&&e!==1/0}function f0(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Rr(e,t){return typeof e=="function"?e(t):e}function an(e,t){return typeof e=="function"?e(t):e}function Oh(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o){if(r){if(t.queryHash!==sf(o,t.options))return!1}else if(!Bo(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 Eh(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Oi(t.options.mutationKey)!==Oi(s))return!1}else if(!Bo(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function sf(e,t){return((t==null?void 0:t.queryKeyHashFn)||Oi)(e)}function Oi(e){return JSON.stringify(e,(t,n)=>Fu(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Bo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Bo(e[n],t[n])):!1}function Nu(e,t){if(e===t)return e;const n=Ah(e)&&Ah(t);if(n||Fu(e)&&Fu(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]=Nu(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&c++)}return i===o&&c===i?e:a}return t}function Dl(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 Ah(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Fu(e){if(!Ph(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Ph(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Ph(e){return Object.prototype.toString.call(e)==="[object Object]"}function y2(e){return new Promise(t=>{setTimeout(t,e)})}function Bu(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 Nu(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 Nu(e,t)}return t}function m2(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function p2(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Ll=Symbol();function h0(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 g0(e,t){return typeof e=="function"?e(...t):!!e}var di,Cr,ns,Np,v2=(Np=class extends Fs{constructor(){super();ie(this,di);ie(this,Cr);ie(this,ns);Y(this,ns,t=>{if(!ki&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){P(this,Cr)||this.setEventListener(P(this,ns))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,Cr))==null||t.call(this),Y(this,Cr,void 0))}setEventListener(t){var n;Y(this,ns,t),(n=P(this,Cr))==null||n.call(this),Y(this,Cr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){P(this,di)!==t&&(Y(this,di,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof P(this,di)=="boolean"?P(this,di):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},di=new WeakMap,Cr=new WeakMap,ns=new WeakMap,Np),of=new v2,rs,_r,is,Fp,b2=(Fp=class extends Fs{constructor(){super();ie(this,rs,!0);ie(this,_r);ie(this,is);Y(this,is,t=>{if(!ki&&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,_r)||this.setEventListener(P(this,is))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,_r))==null||t.call(this),Y(this,_r,void 0))}setEventListener(t){var n;Y(this,is,t),(n=P(this,_r))==null||n.call(this),Y(this,_r,t(this.setOnline.bind(this)))}setOnline(t){P(this,rs)!==t&&(Y(this,rs,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return P(this,rs)}},rs=new WeakMap,_r=new WeakMap,is=new WeakMap,Fp),js=new b2;function qu(){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 x2(e){return Math.min(1e3*2**e,3e4)}function y0(e){return(e!=null?e:"online")==="online"?js.isOnline():!0}var m0=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Qc(e){return e instanceof m0}function p0(e){let t=!1,n=0,r=!1,i;const s=qu(),o=m=>{var p;r||(f(new m0(m)),(p=e.abort)==null||p.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>of.isFocused()&&(e.networkMode==="always"||js.isOnline())&&e.canRun(),u=()=>y0(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 k,S,_;if(r)return;const b=(k=e.retry)!=null?k:ki?0:3,w=(S=e.retryDelay)!=null?S:x2,C=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),y2(C).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 w2=e=>setTimeout(e,0);function S2(){let e=[],t=0,n=a=>{a()},r=a=>{a()},i=w2;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 ut=S2(),fi,Bp,v0=(Bp=class{constructor(){ie(this,fi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ru(this.gcTime)&&Y(this,fi,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e!=null?e:ki?1/0:5*60*1e3)}clearGcTimeout(){P(this,fi)&&(clearTimeout(P(this,fi)),Y(this,fi,void 0))}},fi=new WeakMap,Bp),ss,hi,on,gi,xt,ga,yi,bn,Qn,qp,C2=(qp=class extends v0{constructor(t){var n;super();ie(this,bn);ie(this,ss);ie(this,hi);ie(this,on);ie(this,gi);ie(this,xt);ie(this,ga);ie(this,yi);Y(this,yi,!1),Y(this,ga,t.defaultOptions),this.setOptions(t.options),this.observers=[],Y(this,gi,t.client),Y(this,on,P(this,gi).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Y(this,ss,_2(this.options)),this.state=(n=t.state)!=null?n:P(this,ss),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=P(this,xt))==null?void 0:t.promise}setOptions(t){this.options={...P(this,ga),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&P(this,on).remove(this)}setData(t,n){const r=Bu(this.state.data,t,this.options);return Ae(this,bn,Qn).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Ae(this,bn,Qn).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=P(this,xt))==null?void 0:r.promise;return(i=P(this,xt))==null||i.cancel(t),n?n.then(Tt).catch(Tt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(P(this,ss))}isActive(){return this.observers.some(t=>an(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=>Rr(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:!f0(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=P(this,xt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=P(this,xt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),P(this,on).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,xt)&&(P(this,yi)?P(this,xt).cancel({revert:!0}):P(this,xt).cancelRetry()),this.scheduleGc()),P(this,on).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ae(this,bn,Qn).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,xt))return P(this,xt).continueRetry(),P(this,xt).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:()=>(Y(this,yi,!0),r.signal)})},s=()=>{const f=h0(this.options,n),g=(()=>{const m={client:P(this,gi),queryKey:this.queryKey,meta:this.meta};return i(m),m})();return Y(this,yi,!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,gi),state:this.state,fetchFn:s};return i(f),f})();(c=this.options.behavior)==null||c.onFetch(a,this),Y(this,hi,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=a.fetchOptions)==null?void 0:u.meta))&&Ae(this,bn,Qn).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta});const l=f=>{var h,g,m,p;Qc(f)&&f.silent||Ae(this,bn,Qn).call(this,{type:"error",error:f}),Qc(f)||((g=(h=P(this,on).config).onError)==null||g.call(h,f,this),(p=(m=P(this,on).config).onSettled)==null||p.call(m,this.state.data,f,this)),this.scheduleGc()};return Y(this,xt,p0({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,on).config).onSuccess)==null||g.call(h,f,this),(p=(m=P(this,on).config).onSettled)==null||p.call(m,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,h)=>{Ae(this,bn,Qn).call(this,{type:"failed",failureCount:f,error:h})},onPause:()=>{Ae(this,bn,Qn).call(this,{type:"pause"})},onContinue:()=>{Ae(this,bn,Qn).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),P(this,xt).start()}},ss=new WeakMap,hi=new WeakMap,on=new WeakMap,gi=new WeakMap,xt=new WeakMap,ga=new WeakMap,yi=new WeakMap,bn=new WeakSet,Qn=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,...b0(r.data,this.options),fetchMeta:(i=t.meta)!=null?i:null};case"success":return Y(this,hi,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 Qc(o)&&o.revert&&P(this,hi)?{...P(this,hi),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),ut.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),P(this,on).notify({query:this,type:"updated",action:t})})},qp);function b0(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:y0(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function _2(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 In,zp,k2=(zp=class extends Fs{constructor(t={}){super();ie(this,In);this.config=t,Y(this,In,new Map)}build(t,n,r){var a;const i=n.queryKey,s=(a=n.queryHash)!=null?a:sf(i,n);let o=this.get(s);return o||(o=new C2({client:t,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){P(this,In).has(t.queryHash)||(P(this,In).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=P(this,In).get(t.queryHash);n&&(t.destroy(),n===t&&P(this,In).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ut.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return P(this,In).get(t)}getAll(){return[...P(this,In).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Oh(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Oh(t,r)):n}notify(t){ut.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ut.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ut.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},In=new WeakMap,zp),Rn,At,mi,Nn,Sr,Hp,O2=(Hp=class extends v0{constructor(t){super();ie(this,Nn);ie(this,Rn);ie(this,At);ie(this,mi);this.mutationId=t.mutationId,Y(this,At,t.mutationCache),Y(this,Rn,[]),this.state=t.state||x0(),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,Rn).includes(t)||(P(this,Rn).push(t),this.clearGcTimeout(),P(this,At).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Y(this,Rn,P(this,Rn).filter(n=>n!==t)),this.scheduleGc(),P(this,At).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){P(this,Rn).length||(this.state.status==="pending"?this.scheduleGc():P(this,At).remove(this))}continue(){var t,n;return(n=(t=P(this,mi))==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,C,x,k,S,_,O;const n=()=>{Ae(this,Nn,Sr).call(this,{type:"continue"})};Y(this,mi,p0({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(E,T)=>{Ae(this,Nn,Sr).call(this,{type:"failed",failureCount:E,error:T})},onPause:()=>{Ae(this,Nn,Sr).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,At).canRun(this)}));const r=this.state.status==="pending",i=!P(this,mi).canStart();try{if(r)n();else{Ae(this,Nn,Sr).call(this,{type:"pending",variables:t,isPaused:i}),await((a=(o=P(this,At).config).onMutate)==null?void 0:a.call(o,t,this));const T=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));T!==this.state.context&&Ae(this,Nn,Sr).call(this,{type:"pending",context:T,variables:t,isPaused:i})}const E=await P(this,mi).start();return await((d=(u=P(this,At).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,At).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)),Ae(this,Nn,Sr).call(this,{type:"success",data:E}),E}catch(E){try{throw await((w=(b=P(this,At).config).onError)==null?void 0:w.call(b,E,t,this.state.context,this)),await((x=(C=this.options).onError)==null?void 0:x.call(C,E,t,this.state.context)),await((S=(k=P(this,At).config).onSettled)==null?void 0:S.call(k,void 0,E,this.state.variables,this.state.context,this)),await((O=(_=this.options).onSettled)==null?void 0:O.call(_,void 0,E,t,this.state.context)),E}finally{Ae(this,Nn,Sr).call(this,{type:"error",error:E})}}finally{P(this,At).runNext(this)}}},Rn=new WeakMap,At=new WeakMap,mi=new WeakMap,Nn=new WeakSet,Sr=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),ut.batch(()=>{P(this,Rn).forEach(r=>{r.onMutationUpdate(t)}),P(this,At).notify({mutation:this,type:"updated",action:t})})},Hp);function x0(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var er,xn,ya,Kp,E2=(Kp=class extends Fs{constructor(t={}){super();ie(this,er);ie(this,xn);ie(this,ya);this.config=t,Y(this,er,new Set),Y(this,xn,new Map),Y(this,ya,0)}build(t,n,r){const i=new O2({mutationCache:this,mutationId:++Va(this,ya)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){P(this,er).add(t);const n=Qa(t);if(typeof n=="string"){const r=P(this,xn).get(n);r?r.push(t):P(this,xn).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(P(this,er).delete(t)){const n=Qa(t);if(typeof n=="string"){const r=P(this,xn).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,xn).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Qa(t);if(typeof n=="string"){const r=P(this,xn).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=Qa(t);if(typeof n=="string"){const s=(r=P(this,xn).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(){ut.batch(()=>{P(this,er).forEach(t=>{this.notify({type:"removed",mutation:t})}),P(this,er).clear(),P(this,xn).clear()})}getAll(){return Array.from(P(this,er))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Eh(n,r))}findAll(t={}){return this.getAll().filter(n=>Eh(t,n))}notify(t){ut.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ut.batch(()=>Promise.all(t.map(n=>n.continue().catch(Tt))))}},er=new WeakMap,xn=new WeakMap,ya=new WeakMap,Kp);function Qa(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Th(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=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},v=h0(t.options,t.fetchOptions),b=async(C,x,k)=>{if(m)return Promise.reject();if(x==null&&C.pages.length)return Promise.resolve(C);const _=(()=>{const D={client:t.client,queryKey:t.queryKey,pageParam:x,direction:k?"backward":"forward",meta:t.options.meta};return p(D),D})(),O=await v(_),{maxPages:E}=t.options,T=k?p2:m2;return{pages:T(C.pages,O,E),pageParams:T(C.pageParams,x,E)}};if(i&&s.length){const C=i==="backward",x=C?A2:jh,k={pages:s,pageParams:o},S=x(r,k);a=await b(k,S,C)}else{const C=e!=null?e:s.length;do{const x=l===0?(w=o[0])!=null?w:r.initialPageParam:jh(r,a);if(l>0&&x==null)break;a=await b(a,x),l++}while(l<C)}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 jh(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 A2(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 ot,kr,Or,os,as,Er,ls,cs,Up,P2=(Up=class{constructor(e={}){ie(this,ot);ie(this,kr);ie(this,Or);ie(this,os);ie(this,as);ie(this,Er);ie(this,ls);ie(this,cs);Y(this,ot,e.queryCache||new k2),Y(this,kr,e.mutationCache||new E2),Y(this,Or,e.defaultOptions||{}),Y(this,os,new Map),Y(this,as,new Map),Y(this,Er,0)}mount(){Va(this,Er)._++,P(this,Er)===1&&(Y(this,ls,of.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,ot).onFocus())})),Y(this,cs,js.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,ot).onOnline())})))}unmount(){var e,t;Va(this,Er)._--,P(this,Er)===0&&((e=P(this,ls))==null||e.call(this),Y(this,ls,void 0),(t=P(this,cs))==null||t.call(this),Y(this,cs,void 0))}isFetching(e){return P(this,ot).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return P(this,kr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=P(this,ot).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=P(this,ot).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Rr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return P(this,ot).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,ot).get(r.queryHash),s=i==null?void 0:i.state.data,o=g2(t,s);if(o!==void 0)return P(this,ot).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return ut.batch(()=>P(this,ot).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,ot).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=P(this,ot);ut.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=P(this,ot);return ut.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ut.batch(()=>P(this,ot).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Tt).catch(Tt)}invalidateQueries(e,t={}){return ut.batch(()=>{var n,r;return P(this,ot).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=ut.batch(()=>P(this,ot).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch(Tt)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Tt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=P(this,ot).build(this,t);return n.isStaleByTime(Rr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Tt).catch(Tt)}fetchInfiniteQuery(e){return e.behavior=Th(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Tt).catch(Tt)}ensureInfiniteQueryData(e){return e.behavior=Th(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return js.isOnline()?P(this,kr).resumePausedMutations():Promise.resolve()}getQueryCache(){return P(this,ot)}getMutationCache(){return P(this,kr)}getDefaultOptions(){return P(this,Or)}setDefaultOptions(e){Y(this,Or,e)}setQueryDefaults(e,t){P(this,os).set(Oi(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...P(this,os).values()],n={};return t.forEach(r=>{Bo(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){P(this,as).set(Oi(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...P(this,as).values()],n={};return t.forEach(r=>{Bo(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...P(this,Or).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=sf(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,Or).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){P(this,ot).clear(),P(this,kr).clear()}},ot=new WeakMap,kr=new WeakMap,Or=new WeakMap,os=new WeakMap,as=new WeakMap,Er=new WeakMap,ls=new WeakMap,cs=new WeakMap,Up),Dt,Re,ma,Pt,pi,us,Ar,Pr,pa,ds,fs,vi,bi,Tr,hs,Ue,wo,zu,Hu,Ku,Uu,Vu,Wu,Gu,w0,Vp,T2=(Vp=class extends Fs{constructor(t,n){super();ie(this,Ue);ie(this,Dt);ie(this,Re);ie(this,ma);ie(this,Pt);ie(this,pi);ie(this,us);ie(this,Ar);ie(this,Pr);ie(this,pa);ie(this,ds);ie(this,fs);ie(this,vi);ie(this,bi);ie(this,Tr);ie(this,hs,new Set);this.options=n,Y(this,Dt,t),Y(this,Pr,null),Y(this,Ar,qu()),this.options.experimental_prefetchInRender||P(this,Ar).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,Re).addObserver(this),Mh(P(this,Re),this.options)?Ae(this,Ue,wo).call(this):this.updateResult(),Ae(this,Ue,Uu).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Qu(P(this,Re),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Qu(P(this,Re),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ae(this,Ue,Vu).call(this),Ae(this,Ue,Wu).call(this),P(this,Re).removeObserver(this)}setOptions(t){const n=this.options,r=P(this,Re);if(this.options=P(this,Dt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof an(this.options.enabled,P(this,Re))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ae(this,Ue,Gu).call(this),P(this,Re).setOptions(this.options),n._defaulted&&!Dl(this.options,n)&&P(this,Dt).getQueryCache().notify({type:"observerOptionsUpdated",query:P(this,Re),observer:this});const i=this.hasListeners();i&&$h(P(this,Re),r,this.options,n)&&Ae(this,Ue,wo).call(this),this.updateResult(),i&&(P(this,Re)!==r||an(this.options.enabled,P(this,Re))!==an(n.enabled,P(this,Re))||Rr(this.options.staleTime,P(this,Re))!==Rr(n.staleTime,P(this,Re)))&&Ae(this,Ue,zu).call(this);const s=Ae(this,Ue,Hu).call(this);i&&(P(this,Re)!==r||an(this.options.enabled,P(this,Re))!==an(n.enabled,P(this,Re))||s!==P(this,Tr))&&Ae(this,Ue,Ku).call(this,s)}getOptimisticResult(t){const n=P(this,Dt).getQueryCache().build(P(this,Dt),t),r=this.createResult(n,t);return M2(this,r)&&(Y(this,Pt,r),Y(this,us,this.options),Y(this,pi,P(this,Re).state)),r}getCurrentResult(){return P(this,Pt)}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,hs).add(t)}getCurrentQuery(){return P(this,Re)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=P(this,Dt).defaultQueryOptions(t),r=P(this,Dt).getQueryCache().build(P(this,Dt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){var n;return Ae(this,Ue,wo).call(this,{...t,cancelRefetch:(n=t.cancelRefetch)!=null?n:!0}).then(()=>(this.updateResult(),P(this,Pt)))}createResult(t,n){var O;const r=P(this,Re),i=this.options,s=P(this,Pt),o=P(this,pi),a=P(this,us),c=t!==r?t.state:P(this,ma),{state:u}=t;let d={...u},f=!1,h;if(n._optimisticResults){const E=this.hasListeners(),T=!E&&Mh(t,n),D=E&&$h(t,r,n,i);(T||D)&&(d={...d,...b0(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((O=P(this,fs))==null?void 0:O.state.data,P(this,fs)):n.placeholderData,E!==void 0&&(p="success",h=Bu(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,pa))h=P(this,ds);else try{Y(this,pa,n.select),h=n.select(h),h=Bu(s==null?void 0:s.data,h,n),Y(this,ds,h),Y(this,Pr,null)}catch(E){Y(this,Pr,E)}P(this,Pr)&&(g=P(this,Pr),h=P(this,ds),m=Date.now(),p="error");const b=d.fetchStatus==="fetching",w=p==="pending",C=p==="error",x=w&&b,k=h!==void 0,_={status:p,fetchStatus:d.fetchStatus,isPending:w,isSuccess:p==="success",isError:C,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:C&&!k,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:C&&k,isStale:af(t,n),refetch:this.refetch,promise:P(this,Ar),isEnabled:an(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const E=W=>{_.status==="error"?W.reject(_.error):_.data!==void 0&&W.resolve(_.data)},T=()=>{const W=Y(this,Ar,_.promise=qu());E(W)},D=P(this,Ar);switch(D.status){case"pending":t.queryHash===r.queryHash&&E(D);break;case"fulfilled":(_.status==="error"||_.data!==D.value)&&T();break;case"rejected":(_.status!=="error"||_.error!==D.reason)&&T();break}}return _}updateResult(){const t=P(this,Pt),n=this.createResult(P(this,Re),this.options);if(Y(this,pi,P(this,Re).state),Y(this,us,this.options),P(this,pi).data!==void 0&&Y(this,fs,P(this,Re)),Dl(n,t))return;Y(this,Pt,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!P(this,hs).size)return!0;const o=new Set(s!=null?s:P(this,hs));return this.options.throwOnError&&o.add("error"),Object.keys(P(this,Pt)).some(a=>{const l=a;return P(this,Pt)[l]!==t[l]&&o.has(l)})};Ae(this,Ue,w0).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ae(this,Ue,Uu).call(this)}},Dt=new WeakMap,Re=new WeakMap,ma=new WeakMap,Pt=new WeakMap,pi=new WeakMap,us=new WeakMap,Ar=new WeakMap,Pr=new WeakMap,pa=new WeakMap,ds=new WeakMap,fs=new WeakMap,vi=new WeakMap,bi=new WeakMap,Tr=new WeakMap,hs=new WeakMap,Ue=new WeakSet,wo=function(t){Ae(this,Ue,Gu).call(this);let n=P(this,Re).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Tt)),n},zu=function(){Ae(this,Ue,Vu).call(this);const t=Rr(this.options.staleTime,P(this,Re));if(ki||P(this,Pt).isStale||!Ru(t))return;const r=f0(P(this,Pt).dataUpdatedAt,t)+1;Y(this,vi,setTimeout(()=>{P(this,Pt).isStale||this.updateResult()},r))},Hu=function(){var t;return(t=typeof this.options.refetchInterval=="function"?this.options.refetchInterval(P(this,Re)):this.options.refetchInterval)!=null?t:!1},Ku=function(t){Ae(this,Ue,Wu).call(this),Y(this,Tr,t),!(ki||an(this.options.enabled,P(this,Re))===!1||!Ru(P(this,Tr))||P(this,Tr)===0)&&Y(this,bi,setInterval(()=>{(this.options.refetchIntervalInBackground||of.isFocused())&&Ae(this,Ue,wo).call(this)},P(this,Tr)))},Uu=function(){Ae(this,Ue,zu).call(this),Ae(this,Ue,Ku).call(this,Ae(this,Ue,Hu).call(this))},Vu=function(){P(this,vi)&&(clearTimeout(P(this,vi)),Y(this,vi,void 0))},Wu=function(){P(this,bi)&&(clearInterval(P(this,bi)),Y(this,bi,void 0))},Gu=function(){const t=P(this,Dt).getQueryCache().build(P(this,Dt),this.options);if(t===P(this,Re))return;const n=P(this,Re);Y(this,Re,t),Y(this,ma,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},w0=function(t){ut.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(P(this,Pt))}),P(this,Dt).getQueryCache().notify({query:P(this,Re),type:"observerResultsUpdated"})})},Vp);function j2(e,t){return an(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Mh(e,t){return j2(e,t)||e.state.data!==void 0&&Qu(e,t,t.refetchOnMount)}function Qu(e,t,n){if(an(t.enabled,e)!==!1&&Rr(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&af(e,t)}return!1}function $h(e,t,n,r){return(e!==t||an(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&af(e,n)}function af(e,t){return an(t.enabled,e)!==!1&&e.isStaleByTime(Rr(t.staleTime,e))}function M2(e,t){return!Dl(e.getCurrentResult(),t)}var jr,Mr,Lt,tr,lr,Cl,Yu,Wp,$2=(Wp=class extends Fs{constructor(n,r){super();ie(this,lr);ie(this,jr);ie(this,Mr);ie(this,Lt);ie(this,tr);Y(this,jr,n),this.setOptions(r),this.bindMethods(),Ae(this,lr,Cl).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,jr).defaultMutationOptions(n),Dl(this.options,r)||P(this,jr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:P(this,Lt),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Oi(r.mutationKey)!==Oi(this.options.mutationKey)?this.reset():((i=P(this,Lt))==null?void 0:i.state.status)==="pending"&&P(this,Lt).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=P(this,Lt))==null||n.removeObserver(this)}onMutationUpdate(n){Ae(this,lr,Cl).call(this),Ae(this,lr,Yu).call(this,n)}getCurrentResult(){return P(this,Mr)}reset(){var n;(n=P(this,Lt))==null||n.removeObserver(this),Y(this,Lt,void 0),Ae(this,lr,Cl).call(this),Ae(this,lr,Yu).call(this)}mutate(n,r){var i;return Y(this,tr,r),(i=P(this,Lt))==null||i.removeObserver(this),Y(this,Lt,P(this,jr).getMutationCache().build(P(this,jr),this.options)),P(this,Lt).addObserver(this),P(this,Lt).execute(n)}},jr=new WeakMap,Mr=new WeakMap,Lt=new WeakMap,tr=new WeakMap,lr=new WeakSet,Cl=function(){var r,i;const n=(i=(r=P(this,Lt))==null?void 0:r.state)!=null?i:x0();Y(this,Mr,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Yu=function(n){ut.batch(()=>{var r,i,s,o,a,l,c,u;if(P(this,tr)&&this.hasListeners()){const d=P(this,Mr).variables,f=P(this,Mr).context;(n==null?void 0:n.type)==="success"?((i=(r=P(this,tr)).onSuccess)==null||i.call(r,n.data,d,f),(o=(s=P(this,tr)).onSettled)==null||o.call(s,n.data,null,d,f)):(n==null?void 0:n.type)==="error"&&((l=(a=P(this,tr)).onError)==null||l.call(a,n.error,d,f),(u=(c=P(this,tr)).onSettled)==null||u.call(c,void 0,n.error,d,f))}this.listeners.forEach(d=>{d(P(this,Mr))})})},Wp),S0=M.createContext(void 0),qt=e=>{const t=M.useContext(S0);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},D2=({client:e,children:t})=>(M.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),y.jsx(S0.Provider,{value:e,children:t})),C0=M.createContext(!1),L2=()=>M.useContext(C0);C0.Provider;function I2(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var R2=M.createContext(I2()),N2=()=>M.useContext(R2),F2=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},B2=e=>{M.useEffect(()=>{e.clearReset()},[e])},q2=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||g0(n,[e.error,r])),z2=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))}},H2=(e,t)=>e.isLoading&&e.isFetching&&!t,K2=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Dh=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function U2(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=L2(),i=N2(),s=qt(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",z2(o),F2(o,i),B2(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(ut.batchCalls(p)):Tt;return l.updateResult(),v},[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),M.useEffect(()=>{l.setOptions(o)},[o,l]),K2(o,c))throw Dh(o,l,i);if(q2({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&&!ki&&H2(c,r)){const p=a?Dh(o,l,i):(m=s.getQueryCache().get(o.queryHash))==null?void 0:m.promise;p==null||p.catch(Tt).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?c:l.trackResult(c)}function hr(e,t){return U2(e,T2,t)}function Wr(e,t){const n=qt(t),[r]=M.useState(()=>new $2(n,e));M.useEffect(()=>{r.setOptions(e)},[r,e]);const i=M.useSyncExternalStore(M.useCallback(o=>r.subscribe(ut.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=M.useCallback((o,a)=>{r.mutate(o,a).catch(Tt)},[r]);if(i.error&&g0(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}var ke={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return Lh(this.context.count)},getNextContextId(){return Lh(this.context.count++)}};function Lh(e){const t=String(e),n=t.length-1;return ke.context.id+(n?String.fromCharCode(96+n):"")+t}function So(e){ke.context=e}var _0=!1,V2=(e,t)=>e===t,Il=Symbol("solid-proxy"),k0=typeof Proxy=="function",fc=Symbol("solid-track"),Rl={equals:V2},O0=M0,gr=1,Nl=2,E0={owned:null,cleanups:null,context:null,owner:null},Yc={},ze=null,Xc=null,W2=null,Ye=null,kt=null,or=null,hc=0;function ar(e,t){const n=Ye,r=ze,i=e.length===0,s=t===void 0?r:t,o=i?E0:{owned:null,cleanups:null,context:s?s.context:null,owner:s},a=i?e:()=>e(()=>st(()=>qo(o)));ze=o,Ye=null;try{return Bn(a,!0)}finally{Ye=n,ze=r}}function re(e,t){t=t?Object.assign({},Rl,t):Rl;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=i=>(typeof i=="function"&&(i=i(n.value)),j0(n,i));return[T0.bind(n),r]}function A0(e,t,n){const r=gc(e,t,!0,gr);Bs(r)}function be(e,t,n){const r=gc(e,t,!1,gr);Bs(r)}function xe(e,t,n){O0=iS;const r=gc(e,t,!1,gr);(!n||!n.render)&&(r.user=!0),or?or.push(r):Bs(r)}function H(e,t,n){n=n?Object.assign({},Rl,n):Rl;const r=gc(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Bs(r),T0.bind(r)}function G2(e){return e&&typeof e=="object"&&"then"in e}function Q2(e,t,n){let r,i,s;r=!0,i=e,s={};let o=null,a=Yc,l=null,c=!1,u="initialValue"in s,d=typeof r=="function"&&H(r);const f=new Set,[h,g]=(s.storage||re)(s.initialValue),[m,p]=re(void 0),[v,b]=re(void 0,{equals:!1}),[w,C]=re(u?"ready":"unresolved");ke.context&&(l=ke.getNextContextId(),s.ssrLoadFrom==="initial"?a=s.initialValue:ke.load&&ke.has(l)&&(a=ke.load(l)));function x(O,E,T,D){return o===O&&(o=null,D!==void 0&&(u=!0),(O===a||E===a)&&s.onHydrated&&queueMicrotask(()=>s.onHydrated(D,{value:E})),a=Yc,k(E,T)),E}function k(O,E){Bn(()=>{E===void 0&&g(()=>O),C(E!==void 0?"errored":u?"ready":"unresolved"),p(E);for(const T of f.keys())T.decrement();f.clear()},!1)}function S(){const O=tS,E=h(),T=m();if(T!==void 0&&!o)throw T;return Ye&&Ye.user,E}function _(O=!0){if(O!==!1&&c)return;c=!1;const E=d?d():r;if(E==null||E===!1){x(o,st(h));return}const T=a!==Yc?a:st(()=>i(E,{value:h(),refetching:O}));return G2(T)?(o=T,"value"in T?(T.status==="success"?x(o,T.value,void 0,E):x(o,void 0,Xu(T.value),E),T):(c=!0,queueMicrotask(()=>c=!1),Bn(()=>{C(u?"refreshing":"pending"),b()},!1),T.then(D=>x(T,D,void 0,E),D=>x(T,void 0,Xu(D),E)))):(x(o,T,void 0,E),T)}return Object.defineProperties(S,{state:{get:()=>w()},error:{get:()=>m()},loading:{get(){const O=w();return O==="pending"||O==="refreshing"}},latest:{get(){if(!u)return S();const O=m();if(O&&!o)throw O;return h()}}}),d?A0(()=>_(!1)):_(!1),[S,{refetch:_,mutate:g}]}function Y2(e){return Bn(e,!1)}function st(e){if(Ye===null)return e();const t=Ye;Ye=null;try{return e()}finally{Ye=t}}function ur(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=st(()=>t(a,i,o));return i=a,l}}function dr(e){xe(()=>st(e))}function Se(e){return ze===null||(ze.cleanups===null?ze.cleanups=[e]:ze.cleanups.push(e)),e}function Ih(){return ze}function X2(e,t){const n=ze,r=Ye;ze=e,Ye=null;try{return Bn(t,!0)}catch(i){lf(i)}finally{ze=n,Ye=r}}function J2(e){const t=Ye,n=ze;return Promise.resolve().then(()=>{Ye=t,ze=n;let r;return Bn(e,!1),Ye=ze=null,r?r.done:void 0})}var[Z2,xN]=re(!1);function eS(){return[Z2,J2]}function mt(e,t){const n=Symbol("context");return{id:n,Provider:sS(n),defaultValue:e}}function pt(e){let t;return ze&&ze.context&&(t=ze.context[e.id])!==void 0?t:e.defaultValue}function P0(e){const t=H(e),n=H(()=>Ju(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}var tS;function T0(){if(this.sources&&this.state)if(this.state===gr)Bs(this);else{const e=kt;kt=null,Bn(()=>Bl(this),!1),kt=e}if(Ye){const e=this.observers?this.observers.length:0;Ye.sources?(Ye.sources.push(this),Ye.sourceSlots.push(e)):(Ye.sources=[this],Ye.sourceSlots=[e]),this.observers?(this.observers.push(Ye),this.observerSlots.push(Ye.sources.length-1)):(this.observers=[Ye],this.observerSlots=[Ye.sources.length-1])}return this.value}function j0(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Bn(()=>{for(let i=0;i<e.observers.length;i+=1){const s=e.observers[i],o=Xc&&Xc.running;o&&Xc.disposed.has(s),(o?!s.tState:!s.state)&&(s.pure?kt.push(s):or.push(s),s.observers&&$0(s)),o||(s.state=gr)}if(kt.length>1e6)throw kt=[],new Error},!1)),t}function Bs(e){if(!e.fn)return;qo(e);const t=hc;nS(e,e.value,t)}function nS(e,t,n){let r;const i=ze,s=Ye;Ye=ze=e;try{r=e.fn(t)}catch(o){return e.pure&&(e.state=gr,e.owned&&e.owned.forEach(qo),e.owned=null),e.updatedAt=n+1,lf(o)}finally{Ye=s,ze=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?j0(e,r):e.value=r,e.updatedAt=n)}function gc(e,t,n,r=gr,i){const s={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:ze,context:ze?ze.context:null,pure:n};return ze===null||ze!==E0&&(ze.owned?ze.owned.push(s):ze.owned=[s]),s}function Fl(e){if(e.state===0)return;if(e.state===Nl)return Bl(e);if(e.suspense&&st(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<hc);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===gr)Bs(e);else if(e.state===Nl){const r=kt;kt=null,Bn(()=>Bl(e,t[0]),!1),kt=r}}function Bn(e,t){if(kt)return e();let n=!1;t||(kt=[]),or?n=!0:or=[],hc++;try{const r=e();return rS(n),r}catch(r){n||(or=null),kt=null,lf(r)}}function rS(e){if(kt&&(M0(kt),kt=null),e)return;const t=or;or=null,t.length&&Bn(()=>O0(t),!1)}function M0(e){for(let t=0;t<e.length;t++)Fl(e[t])}function iS(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Fl(r)}if(ke.context){if(ke.count){ke.effects||(ke.effects=[]),ke.effects.push(...e.slice(0,n));return}So()}for(ke.effects&&(ke.done||!ke.count)&&(e=[...ke.effects,...e],n+=ke.effects.length,delete ke.effects),t=0;t<n;t++)Fl(e[t])}function Bl(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===gr?r!==t&&(!r.updatedAt||r.updatedAt<hc)&&Fl(r):i===Nl&&Bl(r,t)}}}function $0(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=Nl,n.pure?kt.push(n):or.push(n),n.observers&&$0(n))}}function qo(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--)qo(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)qo(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 Xu(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function lf(e,t=ze){throw Xu(e)}function Ju(e){if(typeof e=="function"&&!e.length)return Ju(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=Ju(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function sS(e,t){return function(r){let i;return be(()=>i=st(()=>(ze.context={...ze.context,[e]:r.value},P0(()=>r.children))),void 0),i}}var Zu=Symbol("fallback");function ql(e){for(let t=0;t<e.length;t++)e[t]()}function oS(e,t,n={}){let r=[],i=[],s=[],o=0,a=t.length>1?[]:null;return Se(()=>ql(s)),()=>{let l=e()||[],c=l.length,u,d;return l[fc],st(()=>{let h,g,m,p,v,b,w,C,x;if(c===0)o!==0&&(ql(s),s=[],r=[],i=[],o=0,a&&(a=[])),n.fallback&&(r=[Zu],i[0]=ar(k=>(s[0]=k,n.fallback())),o=1);else if(o===0){for(i=new Array(c),d=0;d<c;d++)r[d]=l[d],i[d]=ar(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,C=c-1;w>=b&&C>=b&&r[w]===l[C];w--,C--)m[C]=i[w],p[C]=s[w],a&&(v[C]=a[w]);for(h=new Map,g=new Array(C+1),d=C;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]=ar(f);i=i.slice(0,o=c),r=l.slice(0)}return i});function f(h){if(s[d]=h,a){const[g,m]=re(d);return a[d]=m,t(l[d],g)}return t(l[d])}}}function aS(e,t,n={}){let r=[],i=[],s=[],o=[],a=0,l;return Se(()=>ql(s)),()=>{const c=e()||[],u=c.length;return c[fc],st(()=>{if(u===0)return a!==0&&(ql(s),s=[],r=[],i=[],a=0,o=[]),n.fallback&&(r=[Zu],i[0]=ar(f=>(s[0]=f,n.fallback())),a=1),i;for(r[0]===Zu&&(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]=ar(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]=re(c[l]);return o[l]=g,t(h,l)}}}function j(e,t){return st(()=>e(t||{}))}function Ya(){return!0}var ed={get(e,t,n){return t===Il?n:e.get(t)},has(e,t){return t===Il?!0:e.has(t)},set:Ya,deleteProperty:Ya,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Ya,deleteProperty:Ya}},ownKeys(e){return e.keys()}};function Jc(e){return(e=typeof e=="function"?e():e)?e:{}}function lS(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function Oe(...e){let t=!1;for(let o=0;o<e.length;o++){const a=e[o];t=t||!!a&&Il in a,e[o]=typeof a=="function"?(t=!0,H(a)):a}if(k0&&t)return new Proxy({get(o){for(let a=e.length-1;a>=0;a--){const l=Jc(e[a])[o];if(l!==void 0)return l}},has(o){for(let a=e.length-1;a>=0;a--)if(o in Jc(e[a]))return!0;return!1},keys(){const o=[];for(let a=0;a<e.length;a++)o.push(...Object.keys(Jc(e[a])));return[...new Set(o)]}},ed);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:lS.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 Ve(e,...t){if(k0&&Il 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)}},ed));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))}},ed)),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 D0(e){let t,n;const r=i=>{const s=ke.context;if(s){const[a,l]=re();ke.count||(ke.count=0),ke.count++,(n||(n=e())).then(c=>{!ke.done&&So(s),ke.count--,l(()=>c.default),So()}),t=a}else if(!t){const[a]=Q2(()=>(n||(n=e())).then(l=>l.default));t=a}let o;return H(()=>(o=t())?st(()=>{if(!s||ke.done)return o(i);const a=ke.context;So(s);const l=o(i);return So(a),l}):"")};return r.preload=()=>n||((n=e()).then(i=>t=()=>i.default),n),r}var cS=0;function yn(){return ke.context?ke.getNextContextId():`cl-${cS++}`}var L0=e=>`Stale read from <${e}>.`;function uS(e){const t="fallback"in e&&{fallback:()=>e.fallback};return H(oS(()=>e.each,e.children,t||void 0))}function dS(e){const t="fallback"in e&&{fallback:()=>e.fallback};return H(aS(()=>e.each,e.children,t||void 0))}function ve(e){const t=e.keyed,n=H(()=>e.when,void 0,void 0),r=t?n:H(n,void 0,{equals:(i,s)=>!i==!s});return H(()=>{const i=r();if(i){const s=e.children;return typeof s=="function"&&s.length>0?st(()=>s(t?i:()=>{if(!st(r))throw L0("Show");return n()})):s}return e.fallback},void 0,void 0)}function fS(e){const t=P0(()=>e.children),n=H(()=>{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=H(()=>c()?void 0:l.when,void 0,void 0),d=l.keyed?u:H(u,void 0,{equals:(f,h)=>!f==!h});s=()=>c()||(d()?[a,u,l]:void 0)}return s});return H(()=>{const r=n()();if(!r)return e.fallback;const[i,s,o]=r,a=o.children;return typeof a=="function"&&a.length>0?st(()=>a(o.keyed?s():()=>{var c;if(((c=st(n)())==null?void 0:c[0])!==i)throw L0("Match");return s()})):a},void 0,void 0)}function Zc(e){return e}var hS=["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"],gS=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...hS]),yS=new Set(["innerHTML","textContent","innerText","children"]),mS=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),pS=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 vS(e,t){const n=pS[e];return typeof n=="object"?n[t]?n.$:void 0:n}var bS=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),xS=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"]),wS={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function SS(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 $o="_$DX_DELEGATE";function I0(e,t,n,r={}){let i;return ar(s=>{i=s,t===document?e():U(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=""}}function le(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 yc(e,t=window.document){const n=t[$o]||(t[$o]=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,F0))}}function CS(e=window.document){if(e[$o]){for(let t of e[$o].keys())e.removeEventListener(t,F0);delete e[$o]}}function J(e,t,n){Ii(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function _S(e,t,n,r){Ii(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function kS(e,t,n){Ii(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function ee(e,t){Ii(e)||(t==null?e.removeAttribute("class"):e.className=t)}function R0(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 OS(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]||(Rh(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||(Rh(e,a,!0),n[a]=l)}return n}function ES(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 N0(e,t={},n,r){const i={};return r||be(()=>i.children=zo(e,t.children,i.children)),be(()=>typeof t.ref=="function"&&qs(t.ref,e)),be(()=>AS(e,t,n,!0,i,!0)),i}function qs(e,t,n){return st(()=>e(t,n))}function U(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return zo(e,t,r,n);be(i=>zo(e,t(),i,n),r)}function AS(e,t,n,r,i={},s=!1){t||(t={});for(const o in i)if(!(o in t)){if(o==="children")continue;i[o]=Nh(e,o,null,i[o],n,s,t)}for(const o in t){if(o==="children")continue;const a=t[o];i[o]=Nh(e,o,a,i[o],n,s,t)}}function PS(e){let t,n;return!Ii()||!(t=ke.registry.get(n=jS()))?e():(ke.completed&&ke.completed.add(t),ke.registry.delete(n),t)}function Ii(e){return!!ke.context&&!ke.done&&(!e||e.isConnected)}function TS(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Rh(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 Nh(e,t,n,r,i,s,o){let a,l,c,u,d;if(t==="style")return ES(e,n,r);if(t==="classList")return OS(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=bS.has(f);if(!h&&r){const g=Array.isArray(r)?r[0]:r;e.removeEventListener(f,g)}(h||n)&&(R0(e,f,n,h),h&&yc([f]))}else if(t.slice(0,5)==="attr:")J(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")kS(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(c=yS.has(t))||!i&&((u=vS(t,e.tagName))||(l=gS.has(t)))||(a=e.nodeName.includes("-")||"is"in o)){if(d)t=t.slice(5),l=!0;else if(Ii(e))return n;t==="class"||t==="className"?ee(e,n):a&&!l&&!c?e[TS(t)]=n:e[u||t]=n}else{const f=i&&t.indexOf(":")>-1&&wS[t.split(":")[0]];f?_S(e,f,t,n):J(e,mS[t]||t,n)}return n}function F0(e){if(ke.registry&&ke.events&&ke.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}}),ke.registry&&!ke.done&&(ke.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 zo(e,t,n,r,i){const s=Ii(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=zi(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=zi(e,n,r)}else{if(o==="function")return be(()=>{let l=t();for(;typeof l=="function";)l=l();n=zo(e,l,n,r)}),()=>n;if(Array.isArray(t)){const l=[],c=n&&Array.isArray(n);if(td(l,t,n,i))return be(()=>n=zo(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=zi(e,n,r),a)return n}else c?n.length===0?Fh(e,l,r):SS(e,n,l):(n&&zi(e),Fh(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=zi(e,n,r,t);zi(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function td(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=td(e,a,l)||i;else if(c==="function")if(r){for(;typeof a=="function";)a=a();i=td(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 Fh(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function zi(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 jS(){return ke.getNextContextId()}var MS="http://www.w3.org/2000/svg";function B0(e,t=!1){return t?document.createElementNS(MS,e):document.createElement(e)}function q0(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,i=Ih();let s,o=!!ke.context;return xe(()=>{o&&(Ih().user=o=!1),s||(s=X2(i,()=>H(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=re(!1),u=()=>c(!0);ar(d=>U(a,()=>l()?d():s(),null)),Se(u)}else{const l=B0(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}),U(c,s),a.appendChild(l),e.ref&&e.ref(l),Se(()=>a.removeChild(l))}},void 0,{render:!o}),n}function $S(e,t){const n=H(e);return H(()=>{const r=n();switch(typeof r){case"function":return st(()=>r(t));case"string":const i=xS.has(r),s=ke.context?PS():B0(r,i);return N0(s,t,i),s}})}function DS(e){const[,t]=Ve(e,["component"]);return $S(()=>e.component,t)}var LS=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()}},z0=class{constructor(t){this.generateIdentifier=t,this.kv=new LS}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)}},IS=class extends z0{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 RS(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 NS(e,t){const n=RS(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 Ms(e,t){Object.entries(e).forEach(([n,r])=>t(r,n))}function _l(e,t){return e.indexOf(t)!==-1}function Bh(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(t(r))return r}}var FS=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return NS(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}},BS=e=>Object.prototype.toString.call(e).slice(8,-1),H0=e=>typeof e=="undefined",qS=e=>e===null,Ho=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,nd=e=>Ho(e)&&Object.keys(e).length===0,qr=e=>Array.isArray(e),zS=e=>typeof e=="string",HS=e=>typeof e=="number"&&!isNaN(e),KS=e=>typeof e=="boolean",US=e=>e instanceof RegExp,Ko=e=>e instanceof Map,Uo=e=>e instanceof Set,K0=e=>BS(e)==="Symbol",VS=e=>e instanceof Date&&!isNaN(e.valueOf()),WS=e=>e instanceof Error,qh=e=>typeof e=="number"&&isNaN(e),GS=e=>KS(e)||qS(e)||H0(e)||HS(e)||zS(e)||K0(e),QS=e=>typeof e=="bigint",YS=e=>e===1/0||e===-1/0,XS=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),JS=e=>e instanceof URL,U0=e=>e.replace(/\./g,"\\."),eu=e=>e.map(String).map(U0).join("."),Do=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 An(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var V0=[An(H0,"undefined",()=>null,()=>{}),An(QS,"bigint",e=>e.toString(),e=>typeof BigInt!="undefined"?BigInt(e):e),An(VS,"Date",e=>e.toISOString(),e=>new Date(e)),An(WS,"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}),An(US,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),An(Uo,"set",e=>[...e.values()],e=>new Set(e)),An(Ko,"map",e=>[...e.entries()],e=>new Map(e)),An(e=>qh(e)||YS(e),"number",e=>qh(e)?"NaN":e>0?"Infinity":"-Infinity",Number),An(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),An(JS,"URL",e=>e.toString(),e=>new URL(e))];function mc(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var W0=mc((e,t)=>K0(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}),ZS=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),G0=mc(XS,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const n=ZS[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function Q0(e,t){return e!=null&&e.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var Y0=mc(Q0,(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)}),X0=mc((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)}),eC=[Y0,W0,X0,G0],zh=(e,t)=>{const n=Bh(eC,i=>i.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};const r=Bh(V0,i=>i.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation}},J0={};V0.forEach(e=>{J0[e.annotation]=e});var tC=(e,t,n)=>{if(qr(t))switch(t[0]){case"symbol":return W0.untransform(e,t,n);case"class":return Y0.untransform(e,t,n);case"custom":return X0.untransform(e,t,n);case"typed-array":return G0.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{const r=J0[t];if(!r)throw new Error("Unknown transformation: "+t);return r.untransform(e,n)}},Qi=(e,t)=>{const n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function Z0(e){if(_l(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(_l(e,"prototype"))throw new Error("prototype is not allowed as a property");if(_l(e,"constructor"))throw new Error("constructor is not allowed as a property")}var nC=(e,t)=>{Z0(t);for(let n=0;n<t.length;n++){const r=t[n];if(Uo(e))e=Qi(e,+r);else if(Ko(e)){const i=+r,s=+t[++n]==0?"key":"value",o=Qi(e,i);switch(s){case"key":e=o;break;case"value":e=e.get(o);break}}else e=e[r]}return e},rd=(e,t,n)=>{if(Z0(t),t.length===0)return n(e);let r=e;for(let s=0;s<t.length-1;s++){const o=t[s];if(qr(r)){const a=+o;r=r[a]}else if(Ho(r))r=r[o];else if(Uo(r)){const a=+o;r=Qi(r,a)}else if(Ko(r)){if(s===t.length-2)break;const l=+o,c=+t[++s]==0?"key":"value",u=Qi(r,l);switch(c){case"key":r=u;break;case"value":r=r.get(u);break}}}const i=t[t.length-1];if(qr(r)?r[+i]=n(r[+i]):Ho(r)&&(r[i]=n(r[i])),Uo(r)){const s=Qi(r,+i),o=n(s);s!==o&&(r.delete(s),r.add(o))}if(Ko(r)){const s=+t[t.length-2],o=Qi(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 id(e,t,n=[]){if(!e)return;if(!qr(e)){Ms(e,(s,o)=>id(s,t,[...n,...Do(o)]));return}const[r,i]=e;i&&Ms(i,(s,o)=>{id(s,t,[...n,...Do(o)])}),t(r,n)}function rC(e,t,n){return id(t,(r,i)=>{e=rd(e,i,s=>tC(s,r,n))}),e}function iC(e,t){function n(r,i){const s=nC(e,Do(i));r.map(Do).forEach(o=>{e=rd(e,o,()=>s)})}if(qr(t)){const[r,i]=t;r.forEach(s=>{e=rd(e,Do(s),()=>e)}),i&&Ms(i,n)}else Ms(t,n);return e}var sC=(e,t)=>Ho(e)||qr(e)||Ko(e)||Uo(e)||Q0(e,t);function oC(e,t,n){const r=n.get(e);r?r.push(t):n.set(e,[t])}function aC(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(eu):n[eu(s)]=o.map(eu)}),r?nd(n)?[r]:[r,n]:nd(n)?void 0:n}var ev=(e,t,n,r,i=[],s=[],o=new Map)=>{var h;const a=GS(e);if(!a){oC(e,i,t);const g=o.get(e);if(g)return r?{transformedValue:null}:g}if(!sC(e,n)){const g=zh(e,n),m=g?{transformedValue:g.value,annotations:[g.type]}:{transformedValue:e};return a||o.set(e,m),m}if(_l(s,e))return{transformedValue:null};const l=zh(e,n),c=(h=l==null?void 0:l.value)!=null?h:e,u=qr(c)?[]:{},d={};Ms(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=ev(g,t,n,r,[...i,m],[...s,e],o);u[m]=p.transformedValue,qr(p.annotations)?d[m]=p.annotations:Ho(p.annotations)&&Ms(p.annotations,(v,b)=>{d[U0(m)+"."+b]=v})});const f=nd(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 tv(e){return Object.prototype.toString.call(e).slice(8,-1)}function Hh(e){return tv(e)==="Array"}function lC(e){if(tv(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function cC(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 sd(e,t={}){if(Hh(e))return e.map(i=>sd(i,t));if(!lC(e))return e;const n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((i,s)=>{if(Hh(t.props)&&!t.props.includes(s))return i;const o=e[s],a=sd(o,t);return cC(i,s,a,e,t.nonenumerable),i},{})}var Xe=class{constructor({dedupe:e=!1}={}){this.classRegistry=new IS,this.symbolRegistry=new z0(t=>{var n;return(n=t.description)!=null?n:""}),this.customTransformerRegistry=new FS,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const t=new Map,n=ev(e,t,this,this.dedupe),r={json:n.transformedValue};n.annotations&&(r.meta={...r.meta,values:n.annotations});const i=aC(t,this.dedupe);return i&&(r.meta={...r.meta,referentialEqualities:i}),r}deserialize(e){const{json:t,meta:n}=e;let r=sd(t);return n!=null&&n.values&&(r=rC(r,n.values,this)),n!=null&&n.referentialEqualities&&(r=iC(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)}};Xe.defaultInstance=new Xe;Xe.serialize=Xe.defaultInstance.serialize.bind(Xe.defaultInstance);Xe.deserialize=Xe.defaultInstance.deserialize.bind(Xe.defaultInstance);Xe.stringify=Xe.defaultInstance.stringify.bind(Xe.defaultInstance);Xe.parse=Xe.defaultInstance.parse.bind(Xe.defaultInstance);Xe.registerClass=Xe.defaultInstance.registerClass.bind(Xe.defaultInstance);Xe.registerSymbol=Xe.defaultInstance.registerSymbol.bind(Xe.defaultInstance);Xe.registerCustom=Xe.defaultInstance.registerCustom.bind(Xe.defaultInstance);Xe.allowErrorProps=Xe.defaultInstance.allowErrorProps.bind(Xe.defaultInstance);var nv=Xe.serialize,uC=Xe.stringify;function Vi(e){return e.state.fetchStatus==="fetching"?"fetching":e.getObserversCount()?e.state.fetchStatus==="paused"?"paused":e.isStale()?"stale":"fresh":"inactive"}function dC(e,t){return`${e}${t.charAt(0).toUpperCase()+t.slice(1)}`}function fC({queryState:e,observerCount:t,isStale:n}){return e.fetchStatus==="fetching"?"blue":t?e.fetchStatus==="paused"?"purple":n?"yellow":"green":"gray"}function Yi({status:e,isPaused:t}){return t?"purple":e==="error"?"red":e==="pending"?"yellow":e==="success"?"green":"gray"}function hC(e){return e==="fresh"?"green":e==="stale"?"yellow":e==="paused"?"purple":e==="inactive"?"gray":"blue"}var zl=(e,t=!1)=>{const{json:n}=nv(e);return JSON.stringify(n,null,t?2:void 0)},Xa=e=>e.state.fetchStatus!=="idle"?0:e.getObserversCount()?e.isStale()?2:1:3,gC=(e,t)=>e.queryHash.localeCompare(t.queryHash),rv=(e,t)=>e.state.dataUpdatedAt<t.state.dataUpdatedAt?1:-1,yC=(e,t)=>Xa(e)===Xa(t)?rv(e,t):Xa(e)>Xa(t)?1:-1,od={status:yC,"query hash":gC,"last updated":rv},Ja=e=>e.state.isPaused?0:e.state.status==="error"?2:e.state.status==="pending"?1:3,iv=(e,t)=>e.state.submittedAt<t.state.submittedAt?1:-1,mC=(e,t)=>Ja(e)===Ja(t)?iv(e,t):Ja(e)>Ja(t)?1:-1,ad={status:mC,"last updated":iv},Kh=e=>e*parseFloat(getComputedStyle(document.documentElement).fontSize),sv=()=>{const[e,t]=re("dark");return dr(()=>{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},li=(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,li(r.get(i),s,n)),r}if(e instanceof Set){const r=li(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]=li(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]=li(r[i],s,n),r}return e},Co=(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,Co(n.get(r),i)),n}if(e instanceof Set){const n=Co(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]=Co(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]=Co(n[r],i),n}return e},ov=(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)},gs,va,ba,xa,xi,wa,ys,ms,ps,vs,bs,xs,Sa,Gp,pC=(Gp=class{constructor(e){ie(this,gs);ie(this,va);ie(this,ba);ie(this,xa);ie(this,xi,!1);ie(this,wa);ie(this,ys);ie(this,ms);ie(this,ps);ie(this,vs);ie(this,bs);ie(this,xs);ie(this,Sa);const{client:t,queryFlavor:n,version:r,onlineManager:i,buttonPosition:s,position:o,initialIsOpen:a,errorTypes:l,styleNonce:c,shadowDOMTarget:u}=e;Y(this,gs,re(t)),Y(this,ba,n),Y(this,xa,r),Y(this,va,i),Y(this,wa,c),Y(this,ys,u),Y(this,ms,re(s)),Y(this,ps,re(o)),Y(this,vs,re(a)),Y(this,bs,re(l))}setButtonPosition(e){P(this,ms)[1](e)}setPosition(e){P(this,ps)[1](e)}setInitialIsOpen(e){P(this,vs)[1](e)}setErrorTypes(e){P(this,bs)[1](e)}setClient(e){P(this,gs)[1](e)}mount(e){if(P(this,xi))throw new Error("Devtools is already mounted");const t=I0(()=>{const n=this,[r]=P(this,ms),[i]=P(this,ps),[s]=P(this,vs),[o]=P(this,bs),[a]=P(this,gs);let l;return P(this,xs)?l=P(this,xs):(l=D0(()=>Promise.resolve().then(()=>FI)),Y(this,xs,l)),ov(P(this,wa),P(this,ys)),j(l,Oe({get queryFlavor(){return P(n,ba)},get version(){return P(n,xa)},get onlineManager(){return P(n,va)},get shadowDOMTarget(){return P(n,ys)}},{get client(){return a()},get buttonPosition(){return r()},get position(){return i()},get initialIsOpen(){return s()},get errorTypes(){return o()}}))},e);Y(this,xi,!0),Y(this,Sa,t)}unmount(){var e;if(!P(this,xi))throw new Error("Devtools is not mounted");(e=P(this,Sa))==null||e.call(this),Y(this,xi,!1)}},gs=new WeakMap,va=new WeakMap,ba=new WeakMap,xa=new WeakMap,xi=new WeakMap,wa=new WeakMap,ys=new WeakMap,ms=new WeakMap,ps=new WeakMap,vs=new WeakMap,bs=new WeakMap,xs=new WeakMap,Sa=new WeakMap,Gp),ws,Ca,_a,ka,wi,Oa,Ss,Cs,_s,ks,Os,Es,As,Ea,Qp,vC=(Qp=class{constructor(e){ie(this,ws);ie(this,Ca);ie(this,_a);ie(this,ka);ie(this,wi,!1);ie(this,Oa);ie(this,Ss);ie(this,Cs);ie(this,_s);ie(this,ks);ie(this,Os);ie(this,Es);ie(this,As);ie(this,Ea);const{client:t,queryFlavor:n,version:r,onlineManager:i,buttonPosition:s,position:o,initialIsOpen:a,errorTypes:l,styleNonce:c,shadowDOMTarget:u,onClose:d}=e;Y(this,ws,re(t)),Y(this,_a,n),Y(this,ka,r),Y(this,Ca,i),Y(this,Oa,c),Y(this,Ss,u),Y(this,Cs,re(s)),Y(this,_s,re(o)),Y(this,ks,re(a)),Y(this,Os,re(l)),Y(this,Es,re(d))}setButtonPosition(e){P(this,Cs)[1](e)}setPosition(e){P(this,_s)[1](e)}setInitialIsOpen(e){P(this,ks)[1](e)}setErrorTypes(e){P(this,Os)[1](e)}setClient(e){P(this,ws)[1](e)}setOnClose(e){P(this,Es)[1](()=>e)}mount(e){if(P(this,wi))throw new Error("Devtools is already mounted");const t=I0(()=>{const n=this,[r]=P(this,Cs),[i]=P(this,_s),[s]=P(this,ks),[o]=P(this,Os),[a]=P(this,ws),[l]=P(this,Es);let c;return P(this,As)?c=P(this,As):(c=D0(()=>Promise.resolve().then(()=>zI)),Y(this,As,c)),ov(P(this,Oa),P(this,Ss)),j(c,Oe({get queryFlavor(){return P(n,_a)},get version(){return P(n,ka)},get onlineManager(){return P(n,Ca)},get shadowDOMTarget(){return P(n,Ss)}},{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);Y(this,wi,!0),Y(this,Ea,t)}unmount(){var e;if(!P(this,wi))throw new Error("Devtools is not mounted");(e=P(this,Ea))==null||e.call(this),Y(this,wi,!1)}},ws=new WeakMap,Ca=new WeakMap,_a=new WeakMap,ka=new WeakMap,wi=new WeakMap,Oa=new WeakMap,Ss=new WeakMap,Cs=new WeakMap,_s=new WeakMap,ks=new WeakMap,Os=new WeakMap,Es=new WeakMap,As=new WeakMap,Ea=new WeakMap,Qp);function bC(e){const t=qt(e.client),n=M.useRef(null),{buttonPosition:r,position:i,initialIsOpen:s,errorTypes:o,styleNonce:a,shadowDOMTarget:l}=e,[c]=M.useState(new pC({client:t,queryFlavor:"React Query",version:"5",onlineManager:js,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 xC(e){const t=qt(e.client),n=M.useRef(null),{errorTypes:r,styleNonce:i,shadowDOMTarget:s}=e,[o]=M.useState(new vC({client:t,queryFlavor:"React Query",version:"5",onlineManager:js,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 wC=process.env.NODE_ENV!=="development"?function(){return null}:bC;process.env.NODE_ENV;function av(e,t){return function(){return e.apply(t,arguments)}}const{toString:SC}=Object.prototype,{getPrototypeOf:cf}=Object,{iterator:pc,toStringTag:lv}=Symbol,vc=(e=>t=>{const n=SC.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),On=e=>(e=e.toLowerCase(),t=>vc(t)===e),bc=e=>t=>typeof t===e,{isArray:zs}=Array,Vo=bc("undefined");function CC(e){return e!==null&&!Vo(e)&&e.constructor!==null&&!Vo(e.constructor)&&Nt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const cv=On("ArrayBuffer");function _C(e){let t;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&cv(e.buffer),t}const kC=bc("string"),Nt=bc("function"),uv=bc("number"),xc=e=>e!==null&&typeof e=="object",OC=e=>e===!0||e===!1,kl=e=>{if(vc(e)!=="object")return!1;const t=cf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(lv in e)&&!(pc in e)},EC=On("Date"),AC=On("File"),PC=On("Blob"),TC=On("FileList"),jC=e=>xc(e)&&Nt(e.pipe),MC=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Nt(e.append)&&((t=vc(e))==="formdata"||t==="object"&&Nt(e.toString)&&e.toString()==="[object FormData]"))},$C=On("URLSearchParams"),[DC,LC,IC,RC]=["ReadableStream","Request","Response","Headers"].map(On),NC=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ta(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e=="undefined")return;let r,i;if(typeof e!="object"&&(e=[e]),zs(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 dv(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 ci=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:global,fv=e=>!Vo(e)&&e!==ci;function ld(){const{caseless:e}=fv(this)&&this||{},t={},n=(r,i)=>{const s=e&&dv(t,i)||i;kl(t[s])&&kl(r)?t[s]=ld(t[s],r):kl(r)?t[s]=ld({},r):zs(r)?t[s]=r.slice():t[s]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&Ta(arguments[r],n);return t}const FC=(e,t,n,{allOwnKeys:r}={})=>(Ta(t,(i,s)=>{n&&Nt(i)?e[s]=av(i,n):e[s]=i},{allOwnKeys:r}),e),BC=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),qC=(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)},zC=(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&&cf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},HC=(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},KC=e=>{if(!e)return null;if(zs(e))return e;let t=e.length;if(!uv(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},UC=(e=>t=>e&&t instanceof e)(typeof Uint8Array!="undefined"&&cf(Uint8Array)),VC=(e,t)=>{const r=(e&&e[pc]).call(e);let i;for(;(i=r.next())&&!i.done;){const s=i.value;t.call(e,s[0],s[1])}},WC=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},GC=On("HTMLFormElement"),QC=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),Uh=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),YC=On("RegExp"),hv=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Ta(n,(i,s)=>{let o;(o=t(i,s,e))!==!1&&(r[s]=o||i)}),Object.defineProperties(e,r)},XC=e=>{hv(e,(t,n)=>{if(Nt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Nt(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+"'")})}})},JC=(e,t)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return zs(e)?r(e):r(String(e).split(t)),n},ZC=()=>{},e_=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function t_(e){return!!(e&&Nt(e.append)&&e[lv]==="FormData"&&e[pc])}const n_=e=>{const t=new Array(10),n=(r,i)=>{if(xc(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const s=zs(r)?[]:{};return Ta(r,(o,a)=>{const l=n(o,i+1);!Vo(l)&&(s[a]=l)}),t[i]=void 0,s}}return r};return n(e,0)},r_=On("AsyncFunction"),i_=e=>e&&(xc(e)||Nt(e))&&Nt(e.then)&&Nt(e.catch),gv=((e,t)=>e?setImmediate:t?((n,r)=>(ci.addEventListener("message",({source:i,data:s})=>{i===ci&&s===n&&r.length&&r.shift()()},!1),i=>{r.push(i),ci.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Nt(ci.postMessage)),s_=typeof queueMicrotask!="undefined"?queueMicrotask.bind(ci):typeof process!="undefined"&&process.nextTick||gv,o_=e=>e!=null&&Nt(e[pc]),F={isArray:zs,isArrayBuffer:cv,isBuffer:CC,isFormData:MC,isArrayBufferView:_C,isString:kC,isNumber:uv,isBoolean:OC,isObject:xc,isPlainObject:kl,isReadableStream:DC,isRequest:LC,isResponse:IC,isHeaders:RC,isUndefined:Vo,isDate:EC,isFile:AC,isBlob:PC,isRegExp:YC,isFunction:Nt,isStream:jC,isURLSearchParams:$C,isTypedArray:UC,isFileList:TC,forEach:Ta,merge:ld,extend:FC,trim:NC,stripBOM:BC,inherits:qC,toFlatObject:zC,kindOf:vc,kindOfTest:On,endsWith:HC,toArray:KC,forEachEntry:VC,matchAll:WC,isHTMLForm:GC,hasOwnProperty:Uh,hasOwnProp:Uh,reduceDescriptors:hv,freezeMethods:XC,toObjectSet:JC,toCamelCase:QC,noop:ZC,toFiniteNumber:e_,findKey:dv,global:ci,isContextDefined:fv,isSpecCompliantForm:t_,toJSONObject:n_,isAsyncFn:r_,isThenable:i_,setImmediate:gv,asap:s_,isIterable:o_};function Ee(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)}F.inherits(Ee,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:F.toJSONObject(this.config),code:this.code,status:this.status}}});const yv=Ee.prototype,mv={};["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=>{mv[e]={value:e}});Object.defineProperties(Ee,mv);Object.defineProperty(yv,"isAxiosError",{value:!0});Ee.from=(e,t,n,r,i,s)=>{const o=Object.create(yv);return F.toFlatObject(e,o,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),Ee.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,s&&Object.assign(o,s),o};const a_=null;function cd(e){return F.isPlainObject(e)||F.isArray(e)}function pv(e){return F.endsWith(e,"[]")?e.slice(0,-2):e}function Vh(e,t,n){return e?e.concat(t).map(function(i,s){return i=pv(i),!n&&s?"["+i+"]":i}).join(n?".":""):t}function l_(e){return F.isArray(e)&&!e.some(cd)}const c_=F.toFlatObject(F,{},null,function(t){return/^is[A-Z]/.test(t)});function wc(e,t,n){if(!F.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=F.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,p){return!F.isUndefined(p[m])});const r=n.metaTokens,i=n.visitor||u,s=n.dots,o=n.indexes,l=(n.Blob||typeof Blob!="undefined"&&Blob)&&F.isSpecCompliantForm(t);if(!F.isFunction(i))throw new TypeError("visitor must be a function");function c(g){if(g===null)return"";if(F.isDate(g))return g.toISOString();if(F.isBoolean(g))return g.toString();if(!l&&F.isBlob(g))throw new Ee("Blob is not supported. Use a Buffer instead.");return F.isArrayBuffer(g)||F.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(F.endsWith(m,"{}"))m=r?m:m.slice(0,-2),g=JSON.stringify(g);else if(F.isArray(g)&&l_(g)||(F.isFileList(g)||F.endsWith(m,"[]"))&&(v=F.toArray(g)))return m=pv(m),v.forEach(function(w,C){!(F.isUndefined(w)||w===null)&&t.append(o===!0?Vh([m],C,s):o===null?m:m+"[]",c(w))}),!1}return cd(g)?!0:(t.append(Vh(p,m,s),c(g)),!1)}const d=[],f=Object.assign(c_,{defaultVisitor:u,convertValue:c,isVisitable:cd});function h(g,m){if(!F.isUndefined(g)){if(d.indexOf(g)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(g),F.forEach(g,function(v,b){(!(F.isUndefined(v)||v===null)&&i.call(t,v,F.isString(b)?b.trim():b,m,f))===!0&&h(v,m?m.concat(b):[b])}),d.pop()}}if(!F.isObject(e))throw new TypeError("data must be an object");return h(e),t}function Wh(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function uf(e,t){this._pairs=[],e&&wc(e,this,t)}const vv=uf.prototype;vv.append=function(t,n){this._pairs.push([t,n])};vv.toString=function(t){const n=t?function(r){return t.call(this,r,Wh)}:Wh;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function u_(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function bv(e,t,n){if(!t)return e;const r=n&&n.encode||u_;F.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let s;if(i?s=i(t,n):s=F.isURLSearchParams(t)?t.toString():new uf(t,n).toString(r),s){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class Gh{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){F.forEach(this.handlers,function(r){r!==null&&t(r)})}}const xv={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},d_=typeof URLSearchParams!="undefined"?URLSearchParams:uf,f_=typeof FormData!="undefined"?FormData:null,h_=typeof Blob!="undefined"?Blob:null,g_={isBrowser:!0,classes:{URLSearchParams:d_,FormData:f_,Blob:h_},protocols:["http","https","file","blob","url","data"]},df=typeof window!="undefined"&&typeof document!="undefined",ud=typeof navigator=="object"&&navigator||void 0,y_=df&&(!ud||["ReactNative","NativeScript","NS"].indexOf(ud.product)<0),m_=typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",p_=df&&window.location.href||"http://localhost",v_=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:df,hasStandardBrowserEnv:y_,hasStandardBrowserWebWorkerEnv:m_,navigator:ud,origin:p_},Symbol.toStringTag,{value:"Module"})),_t={...v_,...g_};function b_(e,t){return wc(e,new _t.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,s){return _t.isNode&&F.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function x_(e){return F.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function w_(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 wv(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&&F.isArray(i)?i.length:o,l?(F.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!a):((!i[o]||!F.isObject(i[o]))&&(i[o]=[]),t(n,r,i[o],s)&&F.isArray(i[o])&&(i[o]=w_(i[o])),!a)}if(F.isFormData(e)&&F.isFunction(e.entries)){const n={};return F.forEachEntry(e,(r,i)=>{t(x_(r),i,n,0)}),n}return null}function S_(e,t,n){if(F.isString(e))try{return(t||JSON.parse)(e),F.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const ja={transitional:xv,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=F.isObject(t);if(s&&F.isHTMLForm(t)&&(t=new FormData(t)),F.isFormData(t))return i?JSON.stringify(wv(t)):t;if(F.isArrayBuffer(t)||F.isBuffer(t)||F.isStream(t)||F.isFile(t)||F.isBlob(t)||F.isReadableStream(t))return t;if(F.isArrayBufferView(t))return t.buffer;if(F.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 b_(t,this.formSerializer).toString();if((a=F.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return wc(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),S_(t)):t}],transformResponse:[function(t){const n=this.transitional||ja.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(F.isResponse(t)||F.isReadableStream(t))return t;if(t&&F.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"?Ee.from(a,Ee.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:_t.classes.FormData,Blob:_t.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};F.forEach(["delete","get","head","post","put","patch"],e=>{ja.headers[e]={}});const C_=F.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"]),__=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]&&C_[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Qh=Symbol("internals");function ro(e){return e&&String(e).trim().toLowerCase()}function Ol(e){return e===!1||e==null?e:F.isArray(e)?e.map(Ol):String(e)}function k_(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 O_=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function tu(e,t,n,r,i){if(F.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!F.isString(t)){if(F.isString(r))return t.indexOf(r)!==-1;if(F.isRegExp(r))return r.test(t)}}function E_(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function A_(e,t){const n=F.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 Ft=class{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function s(a,l,c){const u=ro(l);if(!u)throw new Error("header name must be a non-empty string");const d=F.findKey(i,u);(!d||i[d]===void 0||c===!0||c===void 0&&i[d]!==!1)&&(i[d||l]=Ol(a))}const o=(a,l)=>F.forEach(a,(c,u)=>s(c,u,l));if(F.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(F.isString(t)&&(t=t.trim())&&!O_(t))o(__(t),n);else if(F.isObject(t)&&F.isIterable(t)){let a={},l,c;for(const u of t){if(!F.isArray(u))throw TypeError("Object iterator must return a key-value pair");a[c=u[0]]=(l=a[c])?F.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=ro(t),t){const r=F.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return k_(i);if(F.isFunction(n))return n.call(this,i,r);if(F.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=ro(t),t){const r=F.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||tu(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function s(o){if(o=ro(o),o){const a=F.findKey(r,o);a&&(!n||tu(r,r[a],a,n))&&(delete r[a],i=!0)}}return F.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||tu(this,this[s],s,t,!0))&&(delete this[s],i=!0)}return i}normalize(t){const n=this,r={};return F.forEach(this,(i,s)=>{const o=F.findKey(r,s);if(o){n[o]=Ol(i),delete n[s];return}const a=t?E_(s):String(s).trim();a!==s&&delete n[s],n[a]=Ol(i),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return F.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&F.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[Qh]=this[Qh]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=ro(o);r[a]||(A_(i,o),r[a]=!0)}return F.isArray(t)?t.forEach(s):s(t),this}};Ft.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);F.reduceDescriptors(Ft.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});F.freezeMethods(Ft);function nu(e,t){const n=this||ja,r=t||n,i=Ft.from(r.headers);let s=r.data;return F.forEach(e,function(a){s=a.call(n,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function Sv(e){return!!(e&&e.__CANCEL__)}function Hs(e,t,n){Ee.call(this,e==null?"canceled":e,Ee.ERR_CANCELED,t,n),this.name="CanceledError"}F.inherits(Hs,Ee,{__CANCEL__:!0});function Cv(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Ee("Request failed with status code "+n.status,[Ee.ERR_BAD_REQUEST,Ee.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function P_(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function T_(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 j_(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 Hl=(e,t,n=3)=>{let r=0;const i=T_(50,250);return j_(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)},Yh=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Xh=e=>(...t)=>F.asap(()=>e(...t)),M_=_t.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,_t.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(_t.origin),_t.navigator&&/(msie|trident)/i.test(_t.navigator.userAgent)):()=>!0,$_=_t.hasStandardBrowserEnv?{write(e,t,n,r,i,s){const o=[e+"="+encodeURIComponent(t)];F.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),F.isString(r)&&o.push("path="+r),F.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 D_(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function L_(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function _v(e,t,n){let r=!D_(t);return e&&(r||n==!1)?L_(e,t):t}const Jh=e=>e instanceof Ft?{...e}:e;function Ei(e,t){t=t||{};const n={};function r(c,u,d,f){return F.isPlainObject(c)&&F.isPlainObject(u)?F.merge.call({caseless:f},c,u):F.isPlainObject(u)?F.merge({},u):F.isArray(u)?u.slice():u}function i(c,u,d,f){if(F.isUndefined(u)){if(!F.isUndefined(c))return r(void 0,c,d,f)}else return r(c,u,d,f)}function s(c,u){if(!F.isUndefined(u))return r(void 0,u)}function o(c,u){if(F.isUndefined(u)){if(!F.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(Jh(c),Jh(u),d,!0)};return F.forEach(Object.keys(Object.assign({},e,t)),function(u){const d=l[u]||i,f=d(e[u],t[u],u);F.isUndefined(f)&&d!==a||(n[u]=f)}),n}const kv=e=>{const t=Ei({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:o,auth:a}=t;t.headers=o=Ft.from(o),t.url=bv(_v(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(F.isFormData(n)){if(_t.hasStandardBrowserEnv||_t.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(_t.hasStandardBrowserEnv&&(r&&F.isFunction(r)&&(r=r(t)),r||r!==!1&&M_(t.url))){const c=i&&s&&$_.read(s);c&&o.set(i,c)}return t},I_=typeof XMLHttpRequest!="undefined",R_=I_&&function(e){return new Promise(function(n,r){const i=kv(e);let s=i.data;const o=Ft.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=Ft.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};Cv(function(S){n(S),m()},function(S){r(S),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 Ee("Request aborted",Ee.ECONNABORTED,e,p)),p=null)},p.onerror=function(){r(new Ee("Network Error",Ee.ERR_NETWORK,e,p)),p=null},p.ontimeout=function(){let C=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const x=i.transitional||xv;i.timeoutErrorMessage&&(C=i.timeoutErrorMessage),r(new Ee(C,x.clarifyTimeoutError?Ee.ETIMEDOUT:Ee.ECONNABORTED,e,p)),p=null},s===void 0&&o.setContentType(null),"setRequestHeader"in p&&F.forEach(o.toJSON(),function(C,x){p.setRequestHeader(x,C)}),F.isUndefined(i.withCredentials)||(p.withCredentials=!!i.withCredentials),a&&a!=="json"&&(p.responseType=i.responseType),c&&([f,g]=Hl(c,!0),p.addEventListener("progress",f)),l&&p.upload&&([d,h]=Hl(l),p.upload.addEventListener("progress",d),p.upload.addEventListener("loadend",h)),(i.cancelToken||i.signal)&&(u=w=>{p&&(r(!w||w.type?new Hs(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=P_(i.url);if(b&&_t.protocols.indexOf(b)===-1){r(new Ee("Unsupported protocol "+b+":",Ee.ERR_BAD_REQUEST,e));return}p.send(s||null)})},N_=(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 Ee?u:new Hs(u instanceof Error?u.message:u))}};let o=t&&setTimeout(()=>{o=null,s(new Ee(`timeout ${t} of ms exceeded`,Ee.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=()=>F.asap(a),l}},F_=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},B_=async function*(e,t){for await(const n of q_(e))yield*F_(n,t)},q_=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()}},Zh=(e,t,n,r)=>{const i=B_(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})},Sc=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Ov=Sc&&typeof ReadableStream=="function",z_=Sc&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Ev=(e,...t)=>{try{return!!e(...t)}catch(n){return!1}},H_=Ov&&Ev(()=>{let e=!1;const t=new Request(_t.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),eg=64*1024,dd=Ov&&Ev(()=>F.isReadableStream(new Response("").body)),Kl={stream:dd&&(e=>e.body)};Sc&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Kl[t]&&(Kl[t]=F.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new Ee(`Response type '${t}' is not supported`,Ee.ERR_NOT_SUPPORT,r)})})})(new Response);const K_=async e=>{if(e==null)return 0;if(F.isBlob(e))return e.size;if(F.isSpecCompliantForm(e))return(await new Request(_t.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(F.isArrayBufferView(e)||F.isArrayBuffer(e))return e.byteLength;if(F.isURLSearchParams(e)&&(e=e+""),F.isString(e))return(await z_(e)).byteLength},U_=async(e,t)=>{const n=F.toFiniteNumber(e.getContentLength());return n==null?K_(t):n},V_=Sc&&(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}=kv(e);c=c?(c+"").toLowerCase():"text";let h=N_([i,s&&s.toAbortSignal()],o),g;const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let p;try{if(l&&H_&&n!=="get"&&n!=="head"&&(p=await U_(u,r))!==0){let x=new Request(t,{method:"POST",body:r,duplex:"half"}),k;if(F.isFormData(r)&&(k=x.headers.get("content-type"))&&u.setContentType(k),x.body){const[S,_]=Yh(p,Hl(Xh(l)));r=Zh(x.body,eg,S,_)}}F.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=dd&&(c==="stream"||c==="response");if(dd&&(a||w&&m)){const x={};["status","statusText","headers"].forEach(O=>{x[O]=b[O]});const k=F.toFiniteNumber(b.headers.get("content-length")),[S,_]=a&&Yh(k,Hl(Xh(a),!0))||[];b=new Response(Zh(b.body,eg,S,()=>{_&&_(),m&&m()}),x)}c=c||"text";let C=await Kl[F.findKey(Kl,c)||"text"](b,e);return!w&&m&&m(),await new Promise((x,k)=>{Cv(x,k,{data:C,headers:Ft.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 Ee("Network Error",Ee.ERR_NETWORK,e,g),{cause:v.cause||v}):Ee.from(v,v&&v.code,e,g)}}),fd={http:a_,xhr:R_,fetch:V_};F.forEach(fd,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(n){}Object.defineProperty(e,"adapterName",{value:t})}});const tg=e=>`- ${e}`,W_=e=>F.isFunction(e)||e===null||e===!1,Av={getAdapter:e=>{e=F.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,!W_(n)&&(r=fd[(o=String(n)).toLowerCase()],r===void 0))throw new Ee(`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 :
12
+ Please change the parent <Route path="${b}"> to <Route path="${b==="/"?"*":`${b}/*`}">.`)}let d=Bt(),f;if(t){let b=typeof t=="string"?Di(t):t;nt(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=Jp(e,{pathname:g});fn(u||m!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),fn(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=Ow(m&&m.map(b=>Object.assign({},b,{params:Object.assign({},a,b.params),pathname:sr([c,i.encodeLocation?i.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?c:sr([c,i.encodeLocation?i.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),s,n,r);return t&&p?$.createElement(Aa.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...f},navigationType:"POP"}},p):p}function Sw(){let e=jw(),t=hw(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 Cw=$.createElement(Sw,null),_w=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(hn.Provider,{value:this.props.routeContext},$.createElement(Jd.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function kw({routeContext:e,match:t,children:n}){let r=$.useContext(Ns);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),$.createElement(hn.Provider,{value:e},n)}function Ow(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);nt(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||Cw,o&&(a<0&&u===0?(a0("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(kw,{match:c,routeContext:{outlet:l,matches:m,isDataRoute:n!=null},children:v})};return n&&(c.route.ErrorBoundary||c.route.errorElement||u===0)?$.createElement(_w,{location:n.location,revalidation:n.revalidation,component:h,error:d,children:p(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):p()},null)}function ef(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ew(e){let t=$.useContext(Ns);return nt(t,ef(e)),t}function Aw(e){let t=$.useContext(uc);return nt(t,ef(e)),t}function Pw(e){let t=$.useContext(hn);return nt(t,ef(e)),t}function tf(e){let t=Pw(e),n=t.matches[t.matches.length-1];return nt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Tw(){return tf("useRouteId")}function jw(){var r;let e=$.useContext(Jd),t=Aw("useRouteError"),n=tf("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function $w(){let{router:e}=Ew("useNavigate"),t=tf("useNavigate"),n=$.useRef(!1);return s0(()=>{n.current=!0}),$.useCallback(async(i,s={})=>{fn(n.current,i0),n.current&&(typeof i=="number"?e.navigate(i):await e.navigate(i,{fromRouteId:t,...s}))},[e,t])}var _h={};function a0(e,t,n){!t&&!_h[e]&&(_h[e]=!0,fn(!1,n))}$.memo(Mw);function Mw({routes:e,future:t,state:n}){return o0(e,void 0,n,t)}function Dw({basename:e,children:t,initialEntries:n,initialIndex:r}){let i=$.useRef();i.current==null&&(i.current=Wx({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(Lw,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:s})}function ai({to:e,replace:t,state:n,relative:r}){nt(Li(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=$.useContext(kn);fn(!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(hn),{pathname:o}=Bt(),a=gn(),l=Xd(e,Yd(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 Ts(e){return xw(e.context)}function xt(e){nt(!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 Lw({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:s=!1}){nt(!Li(),"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=Di(n));let{pathname:l="/",search:c="",hash:u="",state:d=null,key:f="default"}=n,h=$.useMemo(()=>{let g=cr(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 fn(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(kn.Provider,{value:a},$.createElement(Aa.Provider,{children:t,value:h}))}function Iw({children:e,location:t}){return ww(Iu(e),t)}function Iu(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,Iu(r.props.children,s));return}nt(r.type===xt,`[${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>`),nt(!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=Iu(r.props.children,s)),n.push(o)}),n}var wl="get",Sl="application/x-www-form-urlencoded";function dc(e){return e!=null&&typeof e.tagName=="string"}function Rw(e){return dc(e)&&e.tagName.toLowerCase()==="button"}function Nw(e){return dc(e)&&e.tagName.toLowerCase()==="form"}function Fw(e){return dc(e)&&e.tagName.toLowerCase()==="input"}function Bw(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function qw(e,t){return e.button===0&&(!t||t==="_self")&&!Bw(e)}var Ga=null;function zw(){if(Ga===null)try{new FormData(document.createElement("form"),0),Ga=!1}catch(e){Ga=!0}return Ga}var Hw=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Gc(e){return e!=null&&!Hw.has(e)?(fn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Sl}"`),null):e}function Kw(e,t){let n,r,i,s,o;if(Nw(e)){let a=e.getAttribute("action");r=a?cr(a,t):null,n=e.getAttribute("method")||wl,i=Gc(e.getAttribute("enctype"))||Sl,s=new FormData(e)}else if(Rw(e)||Fw(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?cr(l,t):null,n=e.getAttribute("formmethod")||a.getAttribute("method")||wl,i=Gc(e.getAttribute("formenctype"))||Gc(a.getAttribute("enctype"))||Sl,s=new FormData(a,e),!zw()){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(dc(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=wl,r=null,i=Sl,o=e}return s&&i==="text/plain"&&(o=s,s=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:s,body:o}}function nf(e,t){if(e===!1||e===null||typeof e=="undefined")throw new Error(t)}async function Uw(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 Ww(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 Vw(e,t,n){let r=await Promise.all(e.map(async i=>{let s=t.routes[i.route.id];if(s){let o=await Uw(s,n);return o.links?o.links():[]}return[]}));return Xw(r.flat(1).filter(Ww).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function kh(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 Gw(e,t,{includeHydrateFallback:n}={}){return Qw(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 Qw(e){return[...new Set(e)]}function Yw(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Xw(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let s=JSON.stringify(Yw(i));return n.has(s)||(n.add(s),r.push({key:s,link:i})),r},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Jw=new Set([100,101,204,205]);function Zw(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&&cr(n.pathname,t)==="/"?n.pathname=`${t.replace(/\/$/,"")}/_root.data`:n.pathname=`${n.pathname.replace(/\/$/,"")}.data`,n}function l0(){let e=$.useContext(Ns);return nf(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function e2(){let e=$.useContext(uc);return nf(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var rf=$.createContext(void 0);rf.displayName="FrameworkContext";function c0(){let e=$.useContext(rf);return nf(e,"You must render this element inside a <HydratedRouter> element"),e}function t2(e,t){let n=$.useContext(rf),[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:no(a,h),onBlur:no(l,g),onMouseEnter:no(c,h),onMouseLeave:no(u,g),onTouchStart:no(d,h)}]:[!1,f,{}]}function no(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function n2({page:e,...t}){let{router:n}=l0(),r=$.useMemo(()=>Jp(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?$.createElement(i2,{page:e,matches:r,...t}):null}function r2(e){let{manifest:t,routeModules:n}=c0(),[r,i]=$.useState([]);return $.useEffect(()=>{let s=!1;return Vw(e,t,n).then(o=>{s||i(o)}),()=>{s=!0}},[e,t,n]),r}function i2({page:e,matches:t,...n}){let r=Bt(),{manifest:i,routeModules:s}=c0(),{basename:o}=l0(),{loaderData:a,matches:l}=e2(),c=$.useMemo(()=>kh(e,t,l,i,r,"data"),[e,t,l,i,r]),u=$.useMemo(()=>kh(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(C=>C.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=Zw(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(()=>Gw(u,i),[u,i]),h=r2(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 s2(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var u0=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined";try{u0&&(window.__reactRouterVersion="7.6.3")}catch(e){}var d0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Wr=$.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(kn),m=typeof c=="string"&&d0.test(c),p,v=!1;if(typeof c=="string"&&m&&(p=c,u0))try{let O=new URL(window.location.href),E=c.startsWith("//")?new URL(O.protocol+c):new URL(c),T=cr(E.pathname,g);E.origin===O.origin&&T!=null?c=T+E.search+E.hash:v=!0}catch(O){fn(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let b=pw(c,{relative:i}),[w,C,x]=t2(r,f),k=c2(c,{replace:o,state:a,target:l,preventScrollReset:u,relative:i,viewTransition:d});function S(O){t&&t(O),O.defaultPrevented||k(O)}let _=$.createElement("a",{...f,...x,href:p||b,onClick:v||s?t:S,ref:s2(h,C),target:l,"data-discover":!m&&n==="render"?"true":void 0});return w&&!m?$.createElement($.Fragment,null,_,$.createElement(n2,{page:b})):_});Wr.displayName="Link";var o2=$.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=Pa(o,{relative:c.relative}),f=Bt(),h=$.useContext(uc),{navigator:g,basename:m}=$.useContext(kn),p=h!=null&&g2(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=cr(w,m)||w);const C=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let x=b===v||!i&&b.startsWith(v)&&b.charAt(C)==="/",k=w!=null&&(w===v||!i&&w.startsWith(v)&&w.charAt(v.length)==="/"),S={isActive:x,isPending:k,isTransitioning:p},_=x?t:void 0,O;typeof r=="function"?O=r(S):O=[r,x?"active":null,k?"pending":null,p?"transitioning":null].filter(Boolean).join(" ");let E=typeof s=="function"?s(S):s;return $.createElement(Wr,{...c,"aria-current":_,className:O,ref:u,style:E,to:o,viewTransition:a},typeof l=="function"?l(S):l)});o2.displayName="NavLink";var a2=$.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:s,method:o=wl,action:a,onSubmit:l,relative:c,preventScrollReset:u,viewTransition:d,...f},h)=>{let g=f2(),m=h2(a,{relative:c}),p=o.toLowerCase()==="get"?"get":"post",v=typeof a=="string"&&d0.test(a),b=w=>{if(l&&l(w),w.defaultPrevented)return;w.preventDefault();let C=w.nativeEvent.submitter,x=(C==null?void 0:C.getAttribute("formmethod"))||o;g(C||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})});a2.displayName="Form";function l2(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function f0(e){let t=$.useContext(Ns);return nt(t,l2(e)),t}function c2(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:s,viewTransition:o}={}){let a=gn(),l=Bt(),c=Pa(e,{relative:s});return $.useCallback(u=>{if(qw(u,t)){u.preventDefault();let d=n!==void 0?n:Ml(l)===Ml(c);a(e,{replace:d,state:r,preventScrollReset:i,relative:s,viewTransition:o})}},[l,a,c,n,r,t,e,i,s,o])}var u2=0,d2=()=>`__${String(++u2)}__`;function f2(){let{router:e}=f0("useSubmit"),{basename:t}=$.useContext(kn),n=Tw();return $.useCallback(async(r,i={})=>{let{action:s,method:o,encType:a,formData:l,body:c}=Kw(r,t);if(i.navigate===!1){let u=i.fetcherKey||d2();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 h2(e,{relative:t}={}){let{basename:n}=$.useContext(kn),r=$.useContext(hn);nt(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),s={...Pa(e||".",{relative:t})},o=Bt();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:sr([n,s.pathname])),Ml(s)}function g2(e,t={}){let n=$.useContext(r0);nt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=f0("useViewTransitionState"),i=Pa(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=cr(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=cr(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ps(i.pathname,o)!=null||Ps(i.pathname,s)!=null}[...Jw];var Fs=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(){}},ki=typeof window=="undefined"||"Deno"in globalThis;function Tt(){}function y2(e,t){return typeof e=="function"?e(t):e}function Ru(e){return typeof e=="number"&&e>=0&&e!==1/0}function h0(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Rr(e,t){return typeof e=="function"?e(t):e}function an(e,t){return typeof e=="function"?e(t):e}function Oh(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o){if(r){if(t.queryHash!==sf(o,t.options))return!1}else if(!Bo(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 Eh(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Oi(t.options.mutationKey)!==Oi(s))return!1}else if(!Bo(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function sf(e,t){return((t==null?void 0:t.queryKeyHashFn)||Oi)(e)}function Oi(e){return JSON.stringify(e,(t,n)=>Fu(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Bo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Bo(e[n],t[n])):!1}function Nu(e,t){if(e===t)return e;const n=Ah(e)&&Ah(t);if(n||Fu(e)&&Fu(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]=Nu(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&c++)}return i===o&&c===i?e:a}return t}function Dl(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 Ah(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Fu(e){if(!Ph(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Ph(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Ph(e){return Object.prototype.toString.call(e)==="[object Object]"}function m2(e){return new Promise(t=>{setTimeout(t,e)})}function Bu(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 Nu(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 Nu(e,t)}return t}function p2(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function v2(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Ll=Symbol();function g0(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 y0(e,t){return typeof e=="function"?e(...t):!!e}var di,Cr,ns,Fp,b2=(Fp=class extends Fs{constructor(){super();ie(this,di);ie(this,Cr);ie(this,ns);X(this,ns,t=>{if(!ki&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){P(this,Cr)||this.setEventListener(P(this,ns))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,Cr))==null||t.call(this),X(this,Cr,void 0))}setEventListener(t){var n;X(this,ns,t),(n=P(this,Cr))==null||n.call(this),X(this,Cr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){P(this,di)!==t&&(X(this,di,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof P(this,di)=="boolean"?P(this,di):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},di=new WeakMap,Cr=new WeakMap,ns=new WeakMap,Fp),of=new b2,rs,_r,is,Bp,x2=(Bp=class extends Fs{constructor(){super();ie(this,rs,!0);ie(this,_r);ie(this,is);X(this,is,t=>{if(!ki&&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,_r)||this.setEventListener(P(this,is))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,_r))==null||t.call(this),X(this,_r,void 0))}setEventListener(t){var n;X(this,is,t),(n=P(this,_r))==null||n.call(this),X(this,_r,t(this.setOnline.bind(this)))}setOnline(t){P(this,rs)!==t&&(X(this,rs,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return P(this,rs)}},rs=new WeakMap,_r=new WeakMap,is=new WeakMap,Bp),js=new x2;function qu(){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 w2(e){return Math.min(1e3*2**e,3e4)}function m0(e){return(e!=null?e:"online")==="online"?js.isOnline():!0}var p0=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Qc(e){return e instanceof p0}function v0(e){let t=!1,n=0,r=!1,i;const s=qu(),o=m=>{var p;r||(f(new p0(m)),(p=e.abort)==null||p.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>of.isFocused()&&(e.networkMode==="always"||js.isOnline())&&e.canRun(),u=()=>m0(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 k,S,_;if(r)return;const b=(k=e.retry)!=null?k:ki?0:3,w=(S=e.retryDelay)!=null?S:w2,C=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),m2(C).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 S2=e=>setTimeout(e,0);function C2(){let e=[],t=0,n=a=>{a()},r=a=>{a()},i=S2;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 dt=C2(),fi,qp,b0=(qp=class{constructor(){ie(this,fi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ru(this.gcTime)&&X(this,fi,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e!=null?e:ki?1/0:5*60*1e3)}clearGcTimeout(){P(this,fi)&&(clearTimeout(P(this,fi)),X(this,fi,void 0))}},fi=new WeakMap,qp),ss,hi,on,gi,wt,ga,yi,bn,Qn,zp,_2=(zp=class extends b0{constructor(t){var n;super();ie(this,bn);ie(this,ss);ie(this,hi);ie(this,on);ie(this,gi);ie(this,wt);ie(this,ga);ie(this,yi);X(this,yi,!1),X(this,ga,t.defaultOptions),this.setOptions(t.options),this.observers=[],X(this,gi,t.client),X(this,on,P(this,gi).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,X(this,ss,k2(this.options)),this.state=(n=t.state)!=null?n:P(this,ss),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=P(this,wt))==null?void 0:t.promise}setOptions(t){this.options={...P(this,ga),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&P(this,on).remove(this)}setData(t,n){const r=Bu(this.state.data,t,this.options);return Pe(this,bn,Qn).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Pe(this,bn,Qn).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=P(this,wt))==null?void 0:r.promise;return(i=P(this,wt))==null||i.cancel(t),n?n.then(Tt).catch(Tt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(P(this,ss))}isActive(){return this.observers.some(t=>an(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=>Rr(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:!h0(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=P(this,wt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=P(this,wt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),P(this,on).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,wt)&&(P(this,yi)?P(this,wt).cancel({revert:!0}):P(this,wt).cancelRetry()),this.scheduleGc()),P(this,on).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Pe(this,bn,Qn).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,wt))return P(this,wt).continueRetry(),P(this,wt).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,yi,!0),r.signal)})},s=()=>{const f=g0(this.options,n),g=(()=>{const m={client:P(this,gi),queryKey:this.queryKey,meta:this.meta};return i(m),m})();return X(this,yi,!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,gi),state:this.state,fetchFn:s};return i(f),f})();(c=this.options.behavior)==null||c.onFetch(a,this),X(this,hi,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=a.fetchOptions)==null?void 0:u.meta))&&Pe(this,bn,Qn).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta});const l=f=>{var h,g,m,p;Qc(f)&&f.silent||Pe(this,bn,Qn).call(this,{type:"error",error:f}),Qc(f)||((g=(h=P(this,on).config).onError)==null||g.call(h,f,this),(p=(m=P(this,on).config).onSettled)==null||p.call(m,this.state.data,f,this)),this.scheduleGc()};return X(this,wt,v0({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,on).config).onSuccess)==null||g.call(h,f,this),(p=(m=P(this,on).config).onSettled)==null||p.call(m,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,h)=>{Pe(this,bn,Qn).call(this,{type:"failed",failureCount:f,error:h})},onPause:()=>{Pe(this,bn,Qn).call(this,{type:"pause"})},onContinue:()=>{Pe(this,bn,Qn).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),P(this,wt).start()}},ss=new WeakMap,hi=new WeakMap,on=new WeakMap,gi=new WeakMap,wt=new WeakMap,ga=new WeakMap,yi=new WeakMap,bn=new WeakSet,Qn=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,...x0(r.data,this.options),fetchMeta:(i=t.meta)!=null?i:null};case"success":return X(this,hi,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 Qc(o)&&o.revert&&P(this,hi)?{...P(this,hi),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),dt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),P(this,on).notify({query:this,type:"updated",action:t})})},zp);function x0(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:m0(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function k2(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 In,Hp,O2=(Hp=class extends Fs{constructor(t={}){super();ie(this,In);this.config=t,X(this,In,new Map)}build(t,n,r){var a;const i=n.queryKey,s=(a=n.queryHash)!=null?a:sf(i,n);let o=this.get(s);return o||(o=new _2({client:t,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){P(this,In).has(t.queryHash)||(P(this,In).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=P(this,In).get(t.queryHash);n&&(t.destroy(),n===t&&P(this,In).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){dt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return P(this,In).get(t)}getAll(){return[...P(this,In).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Oh(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Oh(t,r)):n}notify(t){dt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){dt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){dt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},In=new WeakMap,Hp),Rn,At,mi,Nn,Sr,Kp,E2=(Kp=class extends b0{constructor(t){super();ie(this,Nn);ie(this,Rn);ie(this,At);ie(this,mi);this.mutationId=t.mutationId,X(this,At,t.mutationCache),X(this,Rn,[]),this.state=t.state||w0(),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,Rn).includes(t)||(P(this,Rn).push(t),this.clearGcTimeout(),P(this,At).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){X(this,Rn,P(this,Rn).filter(n=>n!==t)),this.scheduleGc(),P(this,At).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){P(this,Rn).length||(this.state.status==="pending"?this.scheduleGc():P(this,At).remove(this))}continue(){var t,n;return(n=(t=P(this,mi))==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,C,x,k,S,_,O;const n=()=>{Pe(this,Nn,Sr).call(this,{type:"continue"})};X(this,mi,v0({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(E,T)=>{Pe(this,Nn,Sr).call(this,{type:"failed",failureCount:E,error:T})},onPause:()=>{Pe(this,Nn,Sr).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,At).canRun(this)}));const r=this.state.status==="pending",i=!P(this,mi).canStart();try{if(r)n();else{Pe(this,Nn,Sr).call(this,{type:"pending",variables:t,isPaused:i}),await((a=(o=P(this,At).config).onMutate)==null?void 0:a.call(o,t,this));const T=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));T!==this.state.context&&Pe(this,Nn,Sr).call(this,{type:"pending",context:T,variables:t,isPaused:i})}const E=await P(this,mi).start();return await((d=(u=P(this,At).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,At).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)),Pe(this,Nn,Sr).call(this,{type:"success",data:E}),E}catch(E){try{throw await((w=(b=P(this,At).config).onError)==null?void 0:w.call(b,E,t,this.state.context,this)),await((x=(C=this.options).onError)==null?void 0:x.call(C,E,t,this.state.context)),await((S=(k=P(this,At).config).onSettled)==null?void 0:S.call(k,void 0,E,this.state.variables,this.state.context,this)),await((O=(_=this.options).onSettled)==null?void 0:O.call(_,void 0,E,t,this.state.context)),E}finally{Pe(this,Nn,Sr).call(this,{type:"error",error:E})}}finally{P(this,At).runNext(this)}}},Rn=new WeakMap,At=new WeakMap,mi=new WeakMap,Nn=new WeakSet,Sr=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),dt.batch(()=>{P(this,Rn).forEach(r=>{r.onMutationUpdate(t)}),P(this,At).notify({mutation:this,type:"updated",action:t})})},Kp);function w0(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var er,xn,ya,Up,A2=(Up=class extends Fs{constructor(t={}){super();ie(this,er);ie(this,xn);ie(this,ya);this.config=t,X(this,er,new Set),X(this,xn,new Map),X(this,ya,0)}build(t,n,r){const i=new E2({mutationCache:this,mutationId:++Wa(this,ya)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){P(this,er).add(t);const n=Qa(t);if(typeof n=="string"){const r=P(this,xn).get(n);r?r.push(t):P(this,xn).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(P(this,er).delete(t)){const n=Qa(t);if(typeof n=="string"){const r=P(this,xn).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,xn).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Qa(t);if(typeof n=="string"){const r=P(this,xn).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=Qa(t);if(typeof n=="string"){const s=(r=P(this,xn).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(){dt.batch(()=>{P(this,er).forEach(t=>{this.notify({type:"removed",mutation:t})}),P(this,er).clear(),P(this,xn).clear()})}getAll(){return Array.from(P(this,er))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Eh(n,r))}findAll(t={}){return this.getAll().filter(n=>Eh(t,n))}notify(t){dt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return dt.batch(()=>Promise.all(t.map(n=>n.continue().catch(Tt))))}},er=new WeakMap,xn=new WeakMap,ya=new WeakMap,Up);function Qa(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Th(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=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},v=g0(t.options,t.fetchOptions),b=async(C,x,k)=>{if(m)return Promise.reject();if(x==null&&C.pages.length)return Promise.resolve(C);const _=(()=>{const D={client:t.client,queryKey:t.queryKey,pageParam:x,direction:k?"backward":"forward",meta:t.options.meta};return p(D),D})(),O=await v(_),{maxPages:E}=t.options,T=k?v2:p2;return{pages:T(C.pages,O,E),pageParams:T(C.pageParams,x,E)}};if(i&&s.length){const C=i==="backward",x=C?P2:jh,k={pages:s,pageParams:o},S=x(r,k);a=await b(k,S,C)}else{const C=e!=null?e:s.length;do{const x=l===0?(w=o[0])!=null?w:r.initialPageParam:jh(r,a);if(l>0&&x==null)break;a=await b(a,x),l++}while(l<C)}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 jh(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 P2(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 at,kr,Or,os,as,Er,ls,cs,Wp,T2=(Wp=class{constructor(e={}){ie(this,at);ie(this,kr);ie(this,Or);ie(this,os);ie(this,as);ie(this,Er);ie(this,ls);ie(this,cs);X(this,at,e.queryCache||new O2),X(this,kr,e.mutationCache||new A2),X(this,Or,e.defaultOptions||{}),X(this,os,new Map),X(this,as,new Map),X(this,Er,0)}mount(){Wa(this,Er)._++,P(this,Er)===1&&(X(this,ls,of.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,at).onFocus())})),X(this,cs,js.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,at).onOnline())})))}unmount(){var e,t;Wa(this,Er)._--,P(this,Er)===0&&((e=P(this,ls))==null||e.call(this),X(this,ls,void 0),(t=P(this,cs))==null||t.call(this),X(this,cs,void 0))}isFetching(e){return P(this,at).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return P(this,kr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=P(this,at).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=P(this,at).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Rr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return P(this,at).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,at).get(r.queryHash),s=i==null?void 0:i.state.data,o=y2(t,s);if(o!==void 0)return P(this,at).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return dt.batch(()=>P(this,at).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,at).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=P(this,at);dt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=P(this,at);return dt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=dt.batch(()=>P(this,at).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Tt).catch(Tt)}invalidateQueries(e,t={}){return dt.batch(()=>{var n,r;return P(this,at).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=dt.batch(()=>P(this,at).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch(Tt)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Tt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=P(this,at).build(this,t);return n.isStaleByTime(Rr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Tt).catch(Tt)}fetchInfiniteQuery(e){return e.behavior=Th(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Tt).catch(Tt)}ensureInfiniteQueryData(e){return e.behavior=Th(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return js.isOnline()?P(this,kr).resumePausedMutations():Promise.resolve()}getQueryCache(){return P(this,at)}getMutationCache(){return P(this,kr)}getDefaultOptions(){return P(this,Or)}setDefaultOptions(e){X(this,Or,e)}setQueryDefaults(e,t){P(this,os).set(Oi(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...P(this,os).values()],n={};return t.forEach(r=>{Bo(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){P(this,as).set(Oi(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...P(this,as).values()],n={};return t.forEach(r=>{Bo(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...P(this,Or).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=sf(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,Or).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){P(this,at).clear(),P(this,kr).clear()}},at=new WeakMap,kr=new WeakMap,Or=new WeakMap,os=new WeakMap,as=new WeakMap,Er=new WeakMap,ls=new WeakMap,cs=new WeakMap,Wp),Dt,De,ma,Pt,pi,us,Ar,Pr,pa,ds,fs,vi,bi,Tr,hs,We,wo,zu,Hu,Ku,Uu,Wu,Vu,Gu,S0,Vp,j2=(Vp=class extends Fs{constructor(t,n){super();ie(this,We);ie(this,Dt);ie(this,De);ie(this,ma);ie(this,Pt);ie(this,pi);ie(this,us);ie(this,Ar);ie(this,Pr);ie(this,pa);ie(this,ds);ie(this,fs);ie(this,vi);ie(this,bi);ie(this,Tr);ie(this,hs,new Set);this.options=n,X(this,Dt,t),X(this,Pr,null),X(this,Ar,qu()),this.options.experimental_prefetchInRender||P(this,Ar).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,De).addObserver(this),$h(P(this,De),this.options)?Pe(this,We,wo).call(this):this.updateResult(),Pe(this,We,Uu).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Qu(P(this,De),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Qu(P(this,De),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Pe(this,We,Wu).call(this),Pe(this,We,Vu).call(this),P(this,De).removeObserver(this)}setOptions(t){const n=this.options,r=P(this,De);if(this.options=P(this,Dt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof an(this.options.enabled,P(this,De))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Pe(this,We,Gu).call(this),P(this,De).setOptions(this.options),n._defaulted&&!Dl(this.options,n)&&P(this,Dt).getQueryCache().notify({type:"observerOptionsUpdated",query:P(this,De),observer:this});const i=this.hasListeners();i&&Mh(P(this,De),r,this.options,n)&&Pe(this,We,wo).call(this),this.updateResult(),i&&(P(this,De)!==r||an(this.options.enabled,P(this,De))!==an(n.enabled,P(this,De))||Rr(this.options.staleTime,P(this,De))!==Rr(n.staleTime,P(this,De)))&&Pe(this,We,zu).call(this);const s=Pe(this,We,Hu).call(this);i&&(P(this,De)!==r||an(this.options.enabled,P(this,De))!==an(n.enabled,P(this,De))||s!==P(this,Tr))&&Pe(this,We,Ku).call(this,s)}getOptimisticResult(t){const n=P(this,Dt).getQueryCache().build(P(this,Dt),t),r=this.createResult(n,t);return M2(this,r)&&(X(this,Pt,r),X(this,us,this.options),X(this,pi,P(this,De).state)),r}getCurrentResult(){return P(this,Pt)}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,hs).add(t)}getCurrentQuery(){return P(this,De)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=P(this,Dt).defaultQueryOptions(t),r=P(this,Dt).getQueryCache().build(P(this,Dt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){var n;return Pe(this,We,wo).call(this,{...t,cancelRefetch:(n=t.cancelRefetch)!=null?n:!0}).then(()=>(this.updateResult(),P(this,Pt)))}createResult(t,n){var O;const r=P(this,De),i=this.options,s=P(this,Pt),o=P(this,pi),a=P(this,us),c=t!==r?t.state:P(this,ma),{state:u}=t;let d={...u},f=!1,h;if(n._optimisticResults){const E=this.hasListeners(),T=!E&&$h(t,n),D=E&&Mh(t,r,n,i);(T||D)&&(d={...d,...x0(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((O=P(this,fs))==null?void 0:O.state.data,P(this,fs)):n.placeholderData,E!==void 0&&(p="success",h=Bu(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,pa))h=P(this,ds);else try{X(this,pa,n.select),h=n.select(h),h=Bu(s==null?void 0:s.data,h,n),X(this,ds,h),X(this,Pr,null)}catch(E){X(this,Pr,E)}P(this,Pr)&&(g=P(this,Pr),h=P(this,ds),m=Date.now(),p="error");const b=d.fetchStatus==="fetching",w=p==="pending",C=p==="error",x=w&&b,k=h!==void 0,_={status:p,fetchStatus:d.fetchStatus,isPending:w,isSuccess:p==="success",isError:C,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:C&&!k,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:C&&k,isStale:af(t,n),refetch:this.refetch,promise:P(this,Ar),isEnabled:an(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const E=G=>{_.status==="error"?G.reject(_.error):_.data!==void 0&&G.resolve(_.data)},T=()=>{const G=X(this,Ar,_.promise=qu());E(G)},D=P(this,Ar);switch(D.status){case"pending":t.queryHash===r.queryHash&&E(D);break;case"fulfilled":(_.status==="error"||_.data!==D.value)&&T();break;case"rejected":(_.status!=="error"||_.error!==D.reason)&&T();break}}return _}updateResult(){const t=P(this,Pt),n=this.createResult(P(this,De),this.options);if(X(this,pi,P(this,De).state),X(this,us,this.options),P(this,pi).data!==void 0&&X(this,fs,P(this,De)),Dl(n,t))return;X(this,Pt,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!P(this,hs).size)return!0;const o=new Set(s!=null?s:P(this,hs));return this.options.throwOnError&&o.add("error"),Object.keys(P(this,Pt)).some(a=>{const l=a;return P(this,Pt)[l]!==t[l]&&o.has(l)})};Pe(this,We,S0).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Pe(this,We,Uu).call(this)}},Dt=new WeakMap,De=new WeakMap,ma=new WeakMap,Pt=new WeakMap,pi=new WeakMap,us=new WeakMap,Ar=new WeakMap,Pr=new WeakMap,pa=new WeakMap,ds=new WeakMap,fs=new WeakMap,vi=new WeakMap,bi=new WeakMap,Tr=new WeakMap,hs=new WeakMap,We=new WeakSet,wo=function(t){Pe(this,We,Gu).call(this);let n=P(this,De).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Tt)),n},zu=function(){Pe(this,We,Wu).call(this);const t=Rr(this.options.staleTime,P(this,De));if(ki||P(this,Pt).isStale||!Ru(t))return;const r=h0(P(this,Pt).dataUpdatedAt,t)+1;X(this,vi,setTimeout(()=>{P(this,Pt).isStale||this.updateResult()},r))},Hu=function(){var t;return(t=typeof this.options.refetchInterval=="function"?this.options.refetchInterval(P(this,De)):this.options.refetchInterval)!=null?t:!1},Ku=function(t){Pe(this,We,Vu).call(this),X(this,Tr,t),!(ki||an(this.options.enabled,P(this,De))===!1||!Ru(P(this,Tr))||P(this,Tr)===0)&&X(this,bi,setInterval(()=>{(this.options.refetchIntervalInBackground||of.isFocused())&&Pe(this,We,wo).call(this)},P(this,Tr)))},Uu=function(){Pe(this,We,zu).call(this),Pe(this,We,Ku).call(this,Pe(this,We,Hu).call(this))},Wu=function(){P(this,vi)&&(clearTimeout(P(this,vi)),X(this,vi,void 0))},Vu=function(){P(this,bi)&&(clearInterval(P(this,bi)),X(this,bi,void 0))},Gu=function(){const t=P(this,Dt).getQueryCache().build(P(this,Dt),this.options);if(t===P(this,De))return;const n=P(this,De);X(this,De,t),X(this,ma,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},S0=function(t){dt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(P(this,Pt))}),P(this,Dt).getQueryCache().notify({query:P(this,De),type:"observerResultsUpdated"})})},Vp);function $2(e,t){return an(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function $h(e,t){return $2(e,t)||e.state.data!==void 0&&Qu(e,t,t.refetchOnMount)}function Qu(e,t,n){if(an(t.enabled,e)!==!1&&Rr(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&af(e,t)}return!1}function Mh(e,t,n,r){return(e!==t||an(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&af(e,n)}function af(e,t){return an(t.enabled,e)!==!1&&e.isStaleByTime(Rr(t.staleTime,e))}function M2(e,t){return!Dl(e.getCurrentResult(),t)}var jr,$r,Lt,tr,lr,Cl,Yu,Gp,D2=(Gp=class extends Fs{constructor(n,r){super();ie(this,lr);ie(this,jr);ie(this,$r);ie(this,Lt);ie(this,tr);X(this,jr,n),this.setOptions(r),this.bindMethods(),Pe(this,lr,Cl).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,jr).defaultMutationOptions(n),Dl(this.options,r)||P(this,jr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:P(this,Lt),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Oi(r.mutationKey)!==Oi(this.options.mutationKey)?this.reset():((i=P(this,Lt))==null?void 0:i.state.status)==="pending"&&P(this,Lt).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=P(this,Lt))==null||n.removeObserver(this)}onMutationUpdate(n){Pe(this,lr,Cl).call(this),Pe(this,lr,Yu).call(this,n)}getCurrentResult(){return P(this,$r)}reset(){var n;(n=P(this,Lt))==null||n.removeObserver(this),X(this,Lt,void 0),Pe(this,lr,Cl).call(this),Pe(this,lr,Yu).call(this)}mutate(n,r){var i;return X(this,tr,r),(i=P(this,Lt))==null||i.removeObserver(this),X(this,Lt,P(this,jr).getMutationCache().build(P(this,jr),this.options)),P(this,Lt).addObserver(this),P(this,Lt).execute(n)}},jr=new WeakMap,$r=new WeakMap,Lt=new WeakMap,tr=new WeakMap,lr=new WeakSet,Cl=function(){var r,i;const n=(i=(r=P(this,Lt))==null?void 0:r.state)!=null?i:w0();X(this,$r,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Yu=function(n){dt.batch(()=>{var r,i,s,o,a,l,c,u;if(P(this,tr)&&this.hasListeners()){const d=P(this,$r).variables,f=P(this,$r).context;(n==null?void 0:n.type)==="success"?((i=(r=P(this,tr)).onSuccess)==null||i.call(r,n.data,d,f),(o=(s=P(this,tr)).onSettled)==null||o.call(s,n.data,null,d,f)):(n==null?void 0:n.type)==="error"&&((l=(a=P(this,tr)).onError)==null||l.call(a,n.error,d,f),(u=(c=P(this,tr)).onSettled)==null||u.call(c,void 0,n.error,d,f))}this.listeners.forEach(d=>{d(P(this,$r))})})},Gp),C0=$.createContext(void 0),qt=e=>{const t=$.useContext(C0);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},L2=({client:e,children:t})=>($.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),y.jsx(C0.Provider,{value:e,children:t})),_0=$.createContext(!1),I2=()=>$.useContext(_0);_0.Provider;function R2(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var N2=$.createContext(R2()),F2=()=>$.useContext(N2),B2=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},q2=e=>{$.useEffect(()=>{e.clearReset()},[e])},z2=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||y0(n,[e.error,r])),H2=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))}},K2=(e,t)=>e.isLoading&&e.isFetching&&!t,U2=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Dh=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function W2(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=I2(),i=F2(),s=qt(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",H2(o),B2(o,i),q2(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(dt.batchCalls(p)):Tt;return l.updateResult(),v},[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),$.useEffect(()=>{l.setOptions(o)},[o,l]),U2(o,c))throw Dh(o,l,i);if(z2({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&&!ki&&K2(c,r)){const p=a?Dh(o,l,i):(m=s.getQueryCache().get(o.queryHash))==null?void 0:m.promise;p==null||p.catch(Tt).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?c:l.trackResult(c)}function hr(e,t){return W2(e,j2,t)}function Vr(e,t){const n=qt(t),[r]=$.useState(()=>new D2(n,e));$.useEffect(()=>{r.setOptions(e)},[r,e]);const i=$.useSyncExternalStore($.useCallback(o=>r.subscribe(dt.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=$.useCallback((o,a)=>{r.mutate(o,a).catch(Tt)},[r]);if(i.error&&y0(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}var ke={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return Lh(this.context.count)},getNextContextId(){return Lh(this.context.count++)}};function Lh(e){const t=String(e),n=t.length-1;return ke.context.id+(n?String.fromCharCode(96+n):"")+t}function So(e){ke.context=e}var k0=!1,V2=(e,t)=>e===t,Il=Symbol("solid-proxy"),O0=typeof Proxy=="function",fc=Symbol("solid-track"),Rl={equals:V2},E0=M0,gr=1,Nl=2,A0={owned:null,cleanups:null,context:null,owner:null},Yc={},qe=null,Xc=null,G2=null,Xe=null,Ot=null,or=null,hc=0;function ar(e,t){const n=Xe,r=qe,i=e.length===0,s=t===void 0?r:t,o=i?A0:{owned:null,cleanups:null,context:s?s.context:null,owner:s},a=i?e:()=>e(()=>ot(()=>qo(o)));qe=o,Xe=null;try{return Bn(a,!0)}finally{Xe=n,qe=r}}function re(e,t){t=t?Object.assign({},Rl,t):Rl;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[j0.bind(n),r]}function P0(e,t,n){const r=gc(e,t,!0,gr);Bs(r)}function ve(e,t,n){const r=gc(e,t,!1,gr);Bs(r)}function be(e,t,n){E0=sS;const r=gc(e,t,!1,gr);(!n||!n.render)&&(r.user=!0),or?or.push(r):Bs(r)}function H(e,t,n){n=n?Object.assign({},Rl,n):Rl;const r=gc(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Bs(r),j0.bind(r)}function Q2(e){return e&&typeof e=="object"&&"then"in e}function Y2(e,t,n){let r,i,s;r=!0,i=e,s={};let o=null,a=Yc,l=null,c=!1,u="initialValue"in s,d=typeof r=="function"&&H(r);const f=new Set,[h,g]=(s.storage||re)(s.initialValue),[m,p]=re(void 0),[v,b]=re(void 0,{equals:!1}),[w,C]=re(u?"ready":"unresolved");ke.context&&(l=ke.getNextContextId(),s.ssrLoadFrom==="initial"?a=s.initialValue:ke.load&&ke.has(l)&&(a=ke.load(l)));function x(O,E,T,D){return o===O&&(o=null,D!==void 0&&(u=!0),(O===a||E===a)&&s.onHydrated&&queueMicrotask(()=>s.onHydrated(D,{value:E})),a=Yc,k(E,T)),E}function k(O,E){Bn(()=>{E===void 0&&g(()=>O),C(E!==void 0?"errored":u?"ready":"unresolved"),p(E);for(const T of f.keys())T.decrement();f.clear()},!1)}function S(){const O=nS,E=h(),T=m();if(T!==void 0&&!o)throw T;return Xe&&Xe.user,E}function _(O=!0){if(O!==!1&&c)return;c=!1;const E=d?d():r;if(E==null||E===!1){x(o,ot(h));return}const T=a!==Yc?a:ot(()=>i(E,{value:h(),refetching:O}));return Q2(T)?(o=T,"value"in T?(T.status==="success"?x(o,T.value,void 0,E):x(o,void 0,Xu(T.value),E),T):(c=!0,queueMicrotask(()=>c=!1),Bn(()=>{C(u?"refreshing":"pending"),b()},!1),T.then(D=>x(T,D,void 0,E),D=>x(T,void 0,Xu(D),E)))):(x(o,T,void 0,E),T)}return Object.defineProperties(S,{state:{get:()=>w()},error:{get:()=>m()},loading:{get(){const O=w();return O==="pending"||O==="refreshing"}},latest:{get(){if(!u)return S();const O=m();if(O&&!o)throw O;return h()}}}),d?P0(()=>_(!1)):_(!1),[S,{refetch:_,mutate:g}]}function X2(e){return Bn(e,!1)}function ot(e){if(Xe===null)return e();const t=Xe;Xe=null;try{return e()}finally{Xe=t}}function ur(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=ot(()=>t(a,i,o));return i=a,l}}function dr(e){be(()=>ot(e))}function we(e){return qe===null||(qe.cleanups===null?qe.cleanups=[e]:qe.cleanups.push(e)),e}function Ih(){return qe}function J2(e,t){const n=qe,r=Xe;qe=e,Xe=null;try{return Bn(t,!0)}catch(i){lf(i)}finally{qe=n,Xe=r}}function Z2(e){const t=Xe,n=qe;return Promise.resolve().then(()=>{Xe=t,qe=n;let r;return Bn(e,!1),Xe=qe=null,r?r.done:void 0})}var[eS,ON]=re(!1);function tS(){return[eS,Z2]}function pt(e,t){const n=Symbol("context");return{id:n,Provider:oS(n),defaultValue:e}}function vt(e){let t;return qe&&qe.context&&(t=qe.context[e.id])!==void 0?t:e.defaultValue}function T0(e){const t=H(e),n=H(()=>Ju(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}var nS;function j0(){if(this.sources&&this.state)if(this.state===gr)Bs(this);else{const e=Ot;Ot=null,Bn(()=>Bl(this),!1),Ot=e}if(Xe){const e=this.observers?this.observers.length:0;Xe.sources?(Xe.sources.push(this),Xe.sourceSlots.push(e)):(Xe.sources=[this],Xe.sourceSlots=[e]),this.observers?(this.observers.push(Xe),this.observerSlots.push(Xe.sources.length-1)):(this.observers=[Xe],this.observerSlots=[Xe.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&&Bn(()=>{for(let i=0;i<e.observers.length;i+=1){const s=e.observers[i],o=Xc&&Xc.running;o&&Xc.disposed.has(s),(o?!s.tState:!s.state)&&(s.pure?Ot.push(s):or.push(s),s.observers&&D0(s)),o||(s.state=gr)}if(Ot.length>1e6)throw Ot=[],new Error},!1)),t}function Bs(e){if(!e.fn)return;qo(e);const t=hc;rS(e,e.value,t)}function rS(e,t,n){let r;const i=qe,s=Xe;Xe=qe=e;try{r=e.fn(t)}catch(o){return e.pure&&(e.state=gr,e.owned&&e.owned.forEach(qo),e.owned=null),e.updatedAt=n+1,lf(o)}finally{Xe=s,qe=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?$0(e,r):e.value=r,e.updatedAt=n)}function gc(e,t,n,r=gr,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!==A0&&(qe.owned?qe.owned.push(s):qe.owned=[s]),s}function Fl(e){if(e.state===0)return;if(e.state===Nl)return Bl(e);if(e.suspense&&ot(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<hc);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===gr)Bs(e);else if(e.state===Nl){const r=Ot;Ot=null,Bn(()=>Bl(e,t[0]),!1),Ot=r}}function Bn(e,t){if(Ot)return e();let n=!1;t||(Ot=[]),or?n=!0:or=[],hc++;try{const r=e();return iS(n),r}catch(r){n||(or=null),Ot=null,lf(r)}}function iS(e){if(Ot&&(M0(Ot),Ot=null),e)return;const t=or;or=null,t.length&&Bn(()=>E0(t),!1)}function M0(e){for(let t=0;t<e.length;t++)Fl(e[t])}function sS(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Fl(r)}if(ke.context){if(ke.count){ke.effects||(ke.effects=[]),ke.effects.push(...e.slice(0,n));return}So()}for(ke.effects&&(ke.done||!ke.count)&&(e=[...ke.effects,...e],n+=ke.effects.length,delete ke.effects),t=0;t<n;t++)Fl(e[t])}function Bl(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===gr?r!==t&&(!r.updatedAt||r.updatedAt<hc)&&Fl(r):i===Nl&&Bl(r,t)}}}function D0(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=Nl,n.pure?Ot.push(n):or.push(n),n.observers&&D0(n))}}function qo(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--)qo(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)qo(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 Xu(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function lf(e,t=qe){throw Xu(e)}function Ju(e){if(typeof e=="function"&&!e.length)return Ju(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=Ju(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function oS(e,t){return function(r){let i;return ve(()=>i=ot(()=>(qe.context={...qe.context,[e]:r.value},T0(()=>r.children))),void 0),i}}var Zu=Symbol("fallback");function ql(e){for(let t=0;t<e.length;t++)e[t]()}function aS(e,t,n={}){let r=[],i=[],s=[],o=0,a=t.length>1?[]:null;return we(()=>ql(s)),()=>{let l=e()||[],c=l.length,u,d;return l[fc],ot(()=>{let h,g,m,p,v,b,w,C,x;if(c===0)o!==0&&(ql(s),s=[],r=[],i=[],o=0,a&&(a=[])),n.fallback&&(r=[Zu],i[0]=ar(k=>(s[0]=k,n.fallback())),o=1);else if(o===0){for(i=new Array(c),d=0;d<c;d++)r[d]=l[d],i[d]=ar(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,C=c-1;w>=b&&C>=b&&r[w]===l[C];w--,C--)m[C]=i[w],p[C]=s[w],a&&(v[C]=a[w]);for(h=new Map,g=new Array(C+1),d=C;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]=ar(f);i=i.slice(0,o=c),r=l.slice(0)}return i});function f(h){if(s[d]=h,a){const[g,m]=re(d);return a[d]=m,t(l[d],g)}return t(l[d])}}}function lS(e,t,n={}){let r=[],i=[],s=[],o=[],a=0,l;return we(()=>ql(s)),()=>{const c=e()||[],u=c.length;return c[fc],ot(()=>{if(u===0)return a!==0&&(ql(s),s=[],r=[],i=[],a=0,o=[]),n.fallback&&(r=[Zu],i[0]=ar(f=>(s[0]=f,n.fallback())),a=1),i;for(r[0]===Zu&&(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]=ar(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]=re(c[l]);return o[l]=g,t(h,l)}}}function j(e,t){return ot(()=>e(t||{}))}function Ya(){return!0}var ed={get(e,t,n){return t===Il?n:e.get(t)},has(e,t){return t===Il?!0:e.has(t)},set:Ya,deleteProperty:Ya,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Ya,deleteProperty:Ya}},ownKeys(e){return e.keys()}};function Jc(e){return(e=typeof e=="function"?e():e)?e:{}}function cS(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function Oe(...e){let t=!1;for(let o=0;o<e.length;o++){const a=e[o];t=t||!!a&&Il in a,e[o]=typeof a=="function"?(t=!0,H(a)):a}if(O0&&t)return new Proxy({get(o){for(let a=e.length-1;a>=0;a--){const l=Jc(e[a])[o];if(l!==void 0)return l}},has(o){for(let a=e.length-1;a>=0;a--)if(o in Jc(e[a]))return!0;return!1},keys(){const o=[];for(let a=0;a<e.length;a++)o.push(...Object.keys(Jc(e[a])));return[...new Set(o)]}},ed);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:cS.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 Ve(e,...t){if(O0&&Il 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)}},ed));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))}},ed)),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=ke.context;if(s){const[a,l]=re();ke.count||(ke.count=0),ke.count++,(n||(n=e())).then(c=>{!ke.done&&So(s),ke.count--,l(()=>c.default),So()}),t=a}else if(!t){const[a]=Y2(()=>(n||(n=e())).then(l=>l.default));t=a}let o;return H(()=>(o=t())?ot(()=>{if(!s||ke.done)return o(i);const a=ke.context;So(s);const l=o(i);return So(a),l}):"")};return r.preload=()=>n||((n=e()).then(i=>t=()=>i.default),n),r}var uS=0;function yn(){return ke.context?ke.getNextContextId():`cl-${uS++}`}var I0=e=>`Stale read from <${e}>.`;function dS(e){const t="fallback"in e&&{fallback:()=>e.fallback};return H(aS(()=>e.each,e.children,t||void 0))}function fS(e){const t="fallback"in e&&{fallback:()=>e.fallback};return H(lS(()=>e.each,e.children,t||void 0))}function pe(e){const t=e.keyed,n=H(()=>e.when,void 0,void 0),r=t?n:H(n,void 0,{equals:(i,s)=>!i==!s});return H(()=>{const i=r();if(i){const s=e.children;return typeof s=="function"&&s.length>0?ot(()=>s(t?i:()=>{if(!ot(r))throw I0("Show");return n()})):s}return e.fallback},void 0,void 0)}function hS(e){const t=T0(()=>e.children),n=H(()=>{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=H(()=>c()?void 0:l.when,void 0,void 0),d=l.keyed?u:H(u,void 0,{equals:(f,h)=>!f==!h});s=()=>c()||(d()?[a,u,l]:void 0)}return s});return H(()=>{const r=n()();if(!r)return e.fallback;const[i,s,o]=r,a=o.children;return typeof a=="function"&&a.length>0?ot(()=>a(o.keyed?s():()=>{var c;if(((c=ot(n)())==null?void 0:c[0])!==i)throw I0("Match");return s()})):a},void 0,void 0)}function Zc(e){return e}var gS=["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"],yS=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...gS]),mS=new Set(["innerHTML","textContent","innerText","children"]),pS=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),vS=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 bS(e,t){const n=vS[e];return typeof n=="object"?n[t]?n.$:void 0:n}var xS=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),wS=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"]),SS={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function CS(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 Mo="_$DX_DELEGATE";function R0(e,t,n,r={}){let i;return ar(s=>{i=s,t===document?e():U(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=""}}function le(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 yc(e,t=window.document){const n=t[Mo]||(t[Mo]=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,B0))}}function _S(e=window.document){if(e[Mo]){for(let t of e[Mo].keys())e.removeEventListener(t,B0);delete e[Mo]}}function Z(e,t,n){Ii(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function kS(e,t,n,r){Ii(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function OS(e,t,n){Ii(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function ee(e,t){Ii(e)||(t==null?e.removeAttribute("class"):e.className=t)}function N0(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 ES(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]||(Rh(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||(Rh(e,a,!0),n[a]=l)}return n}function AS(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 F0(e,t={},n,r){const i={};return r||ve(()=>i.children=zo(e,t.children,i.children)),ve(()=>typeof t.ref=="function"&&qs(t.ref,e)),ve(()=>PS(e,t,n,!0,i,!0)),i}function qs(e,t,n){return ot(()=>e(t,n))}function U(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return zo(e,t,r,n);ve(i=>zo(e,t(),i,n),r)}function PS(e,t,n,r,i={},s=!1){t||(t={});for(const o in i)if(!(o in t)){if(o==="children")continue;i[o]=Nh(e,o,null,i[o],n,s,t)}for(const o in t){if(o==="children")continue;const a=t[o];i[o]=Nh(e,o,a,i[o],n,s,t)}}function TS(e){let t,n;return!Ii()||!(t=ke.registry.get(n=$S()))?e():(ke.completed&&ke.completed.add(t),ke.registry.delete(n),t)}function Ii(e){return!!ke.context&&!ke.done&&(!e||e.isConnected)}function jS(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Rh(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 Nh(e,t,n,r,i,s,o){let a,l,c,u,d;if(t==="style")return AS(e,n,r);if(t==="classList")return ES(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=xS.has(f);if(!h&&r){const g=Array.isArray(r)?r[0]:r;e.removeEventListener(f,g)}(h||n)&&(N0(e,f,n,h),h&&yc([f]))}else if(t.slice(0,5)==="attr:")Z(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")OS(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(c=mS.has(t))||!i&&((u=bS(t,e.tagName))||(l=yS.has(t)))||(a=e.nodeName.includes("-")||"is"in o)){if(d)t=t.slice(5),l=!0;else if(Ii(e))return n;t==="class"||t==="className"?ee(e,n):a&&!l&&!c?e[jS(t)]=n:e[u||t]=n}else{const f=i&&t.indexOf(":")>-1&&SS[t.split(":")[0]];f?kS(e,f,t,n):Z(e,pS[t]||t,n)}return n}function B0(e){if(ke.registry&&ke.events&&ke.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}}),ke.registry&&!ke.done&&(ke.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 zo(e,t,n,r,i){const s=Ii(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=zi(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=zi(e,n,r)}else{if(o==="function")return ve(()=>{let l=t();for(;typeof l=="function";)l=l();n=zo(e,l,n,r)}),()=>n;if(Array.isArray(t)){const l=[],c=n&&Array.isArray(n);if(td(l,t,n,i))return ve(()=>n=zo(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=zi(e,n,r),a)return n}else c?n.length===0?Fh(e,l,r):CS(e,n,l):(n&&zi(e),Fh(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=zi(e,n,r,t);zi(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function td(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=td(e,a,l)||i;else if(c==="function")if(r){for(;typeof a=="function";)a=a();i=td(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 Fh(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function zi(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 $S(){return ke.getNextContextId()}var MS="http://www.w3.org/2000/svg";function q0(e,t=!1){return t?document.createElementNS(MS,e):document.createElement(e)}function z0(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,i=Ih();let s,o=!!ke.context;return be(()=>{o&&(Ih().user=o=!1),s||(s=J2(i,()=>H(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=re(!1),u=()=>c(!0);ar(d=>U(a,()=>l()?d():s(),null)),we(u)}else{const l=q0(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}),U(c,s),a.appendChild(l),e.ref&&e.ref(l),we(()=>a.removeChild(l))}},void 0,{render:!o}),n}function DS(e,t){const n=H(e);return H(()=>{const r=n();switch(typeof r){case"function":return ot(()=>r(t));case"string":const i=wS.has(r),s=ke.context?TS():q0(r,i);return F0(s,t,i),s}})}function LS(e){const[,t]=Ve(e,["component"]);return DS(()=>e.component,t)}var IS=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()}},H0=class{constructor(t){this.generateIdentifier=t,this.kv=new IS}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)}},RS=class extends H0{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 NS(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 FS(e,t){const n=NS(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 $s(e,t){Object.entries(e).forEach(([n,r])=>t(r,n))}function _l(e,t){return e.indexOf(t)!==-1}function Bh(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(t(r))return r}}var BS=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return FS(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}},qS=e=>Object.prototype.toString.call(e).slice(8,-1),K0=e=>typeof e=="undefined",zS=e=>e===null,Ho=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,nd=e=>Ho(e)&&Object.keys(e).length===0,qr=e=>Array.isArray(e),HS=e=>typeof e=="string",KS=e=>typeof e=="number"&&!isNaN(e),US=e=>typeof e=="boolean",WS=e=>e instanceof RegExp,Ko=e=>e instanceof Map,Uo=e=>e instanceof Set,U0=e=>qS(e)==="Symbol",VS=e=>e instanceof Date&&!isNaN(e.valueOf()),GS=e=>e instanceof Error,qh=e=>typeof e=="number"&&isNaN(e),QS=e=>US(e)||zS(e)||K0(e)||KS(e)||HS(e)||U0(e),YS=e=>typeof e=="bigint",XS=e=>e===1/0||e===-1/0,JS=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),ZS=e=>e instanceof URL,W0=e=>e.replace(/\./g,"\\."),eu=e=>e.map(String).map(W0).join("."),Do=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 An(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var V0=[An(K0,"undefined",()=>null,()=>{}),An(YS,"bigint",e=>e.toString(),e=>typeof BigInt!="undefined"?BigInt(e):e),An(VS,"Date",e=>e.toISOString(),e=>new Date(e)),An(GS,"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}),An(WS,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),An(Uo,"set",e=>[...e.values()],e=>new Set(e)),An(Ko,"map",e=>[...e.entries()],e=>new Map(e)),An(e=>qh(e)||XS(e),"number",e=>qh(e)?"NaN":e>0?"Infinity":"-Infinity",Number),An(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),An(ZS,"URL",e=>e.toString(),e=>new URL(e))];function mc(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var G0=mc((e,t)=>U0(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}),eC=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),Q0=mc(JS,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const n=eC[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function Y0(e,t){return e!=null&&e.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var X0=mc(Y0,(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)}),J0=mc((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)}),tC=[X0,G0,J0,Q0],zh=(e,t)=>{const n=Bh(tC,i=>i.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};const r=Bh(V0,i=>i.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation}},Z0={};V0.forEach(e=>{Z0[e.annotation]=e});var nC=(e,t,n)=>{if(qr(t))switch(t[0]){case"symbol":return G0.untransform(e,t,n);case"class":return X0.untransform(e,t,n);case"custom":return J0.untransform(e,t,n);case"typed-array":return Q0.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{const r=Z0[t];if(!r)throw new Error("Unknown transformation: "+t);return r.untransform(e,n)}},Qi=(e,t)=>{const n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function ev(e){if(_l(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(_l(e,"prototype"))throw new Error("prototype is not allowed as a property");if(_l(e,"constructor"))throw new Error("constructor is not allowed as a property")}var rC=(e,t)=>{ev(t);for(let n=0;n<t.length;n++){const r=t[n];if(Uo(e))e=Qi(e,+r);else if(Ko(e)){const i=+r,s=+t[++n]==0?"key":"value",o=Qi(e,i);switch(s){case"key":e=o;break;case"value":e=e.get(o);break}}else e=e[r]}return e},rd=(e,t,n)=>{if(ev(t),t.length===0)return n(e);let r=e;for(let s=0;s<t.length-1;s++){const o=t[s];if(qr(r)){const a=+o;r=r[a]}else if(Ho(r))r=r[o];else if(Uo(r)){const a=+o;r=Qi(r,a)}else if(Ko(r)){if(s===t.length-2)break;const l=+o,c=+t[++s]==0?"key":"value",u=Qi(r,l);switch(c){case"key":r=u;break;case"value":r=r.get(u);break}}}const i=t[t.length-1];if(qr(r)?r[+i]=n(r[+i]):Ho(r)&&(r[i]=n(r[i])),Uo(r)){const s=Qi(r,+i),o=n(s);s!==o&&(r.delete(s),r.add(o))}if(Ko(r)){const s=+t[t.length-2],o=Qi(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 id(e,t,n=[]){if(!e)return;if(!qr(e)){$s(e,(s,o)=>id(s,t,[...n,...Do(o)]));return}const[r,i]=e;i&&$s(i,(s,o)=>{id(s,t,[...n,...Do(o)])}),t(r,n)}function iC(e,t,n){return id(t,(r,i)=>{e=rd(e,i,s=>nC(s,r,n))}),e}function sC(e,t){function n(r,i){const s=rC(e,Do(i));r.map(Do).forEach(o=>{e=rd(e,o,()=>s)})}if(qr(t)){const[r,i]=t;r.forEach(s=>{e=rd(e,Do(s),()=>e)}),i&&$s(i,n)}else $s(t,n);return e}var oC=(e,t)=>Ho(e)||qr(e)||Ko(e)||Uo(e)||Y0(e,t);function aC(e,t,n){const r=n.get(e);r?r.push(t):n.set(e,[t])}function lC(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(eu):n[eu(s)]=o.map(eu)}),r?nd(n)?[r]:[r,n]:nd(n)?void 0:n}var tv=(e,t,n,r,i=[],s=[],o=new Map)=>{var h;const a=QS(e);if(!a){aC(e,i,t);const g=o.get(e);if(g)return r?{transformedValue:null}:g}if(!oC(e,n)){const g=zh(e,n),m=g?{transformedValue:g.value,annotations:[g.type]}:{transformedValue:e};return a||o.set(e,m),m}if(_l(s,e))return{transformedValue:null};const l=zh(e,n),c=(h=l==null?void 0:l.value)!=null?h:e,u=qr(c)?[]:{},d={};$s(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=tv(g,t,n,r,[...i,m],[...s,e],o);u[m]=p.transformedValue,qr(p.annotations)?d[m]=p.annotations:Ho(p.annotations)&&$s(p.annotations,(v,b)=>{d[W0(m)+"."+b]=v})});const f=nd(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 nv(e){return Object.prototype.toString.call(e).slice(8,-1)}function Hh(e){return nv(e)==="Array"}function cC(e){if(nv(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function uC(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 sd(e,t={}){if(Hh(e))return e.map(i=>sd(i,t));if(!cC(e))return e;const n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((i,s)=>{if(Hh(t.props)&&!t.props.includes(s))return i;const o=e[s],a=sd(o,t);return uC(i,s,a,e,t.nonenumerable),i},{})}var Je=class{constructor({dedupe:e=!1}={}){this.classRegistry=new RS,this.symbolRegistry=new H0(t=>{var n;return(n=t.description)!=null?n:""}),this.customTransformerRegistry=new BS,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const t=new Map,n=tv(e,t,this,this.dedupe),r={json:n.transformedValue};n.annotations&&(r.meta={...r.meta,values:n.annotations});const i=lC(t,this.dedupe);return i&&(r.meta={...r.meta,referentialEqualities:i}),r}deserialize(e){const{json:t,meta:n}=e;let r=sd(t);return n!=null&&n.values&&(r=iC(r,n.values,this)),n!=null&&n.referentialEqualities&&(r=sC(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)}};Je.defaultInstance=new Je;Je.serialize=Je.defaultInstance.serialize.bind(Je.defaultInstance);Je.deserialize=Je.defaultInstance.deserialize.bind(Je.defaultInstance);Je.stringify=Je.defaultInstance.stringify.bind(Je.defaultInstance);Je.parse=Je.defaultInstance.parse.bind(Je.defaultInstance);Je.registerClass=Je.defaultInstance.registerClass.bind(Je.defaultInstance);Je.registerSymbol=Je.defaultInstance.registerSymbol.bind(Je.defaultInstance);Je.registerCustom=Je.defaultInstance.registerCustom.bind(Je.defaultInstance);Je.allowErrorProps=Je.defaultInstance.allowErrorProps.bind(Je.defaultInstance);var rv=Je.serialize,dC=Je.stringify;function Wi(e){return e.state.fetchStatus==="fetching"?"fetching":e.getObserversCount()?e.state.fetchStatus==="paused"?"paused":e.isStale()?"stale":"fresh":"inactive"}function fC(e,t){return`${e}${t.charAt(0).toUpperCase()+t.slice(1)}`}function hC({queryState:e,observerCount:t,isStale:n}){return e.fetchStatus==="fetching"?"blue":t?e.fetchStatus==="paused"?"purple":n?"yellow":"green":"gray"}function Yi({status:e,isPaused:t}){return t?"purple":e==="error"?"red":e==="pending"?"yellow":e==="success"?"green":"gray"}function gC(e){return e==="fresh"?"green":e==="stale"?"yellow":e==="paused"?"purple":e==="inactive"?"gray":"blue"}var zl=(e,t=!1)=>{const{json:n}=rv(e);return JSON.stringify(n,null,t?2:void 0)},Xa=e=>e.state.fetchStatus!=="idle"?0:e.getObserversCount()?e.isStale()?2:1:3,yC=(e,t)=>e.queryHash.localeCompare(t.queryHash),iv=(e,t)=>e.state.dataUpdatedAt<t.state.dataUpdatedAt?1:-1,mC=(e,t)=>Xa(e)===Xa(t)?iv(e,t):Xa(e)>Xa(t)?1:-1,od={status:mC,"query hash":yC,"last updated":iv},Ja=e=>e.state.isPaused?0:e.state.status==="error"?2:e.state.status==="pending"?1:3,sv=(e,t)=>e.state.submittedAt<t.state.submittedAt?1:-1,pC=(e,t)=>Ja(e)===Ja(t)?sv(e,t):Ja(e)>Ja(t)?1:-1,ad={status:pC,"last updated":sv},Kh=e=>e*parseFloat(getComputedStyle(document.documentElement).fontSize),ov=()=>{const[e,t]=re("dark");return dr(()=>{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),we(()=>n.removeEventListener("change",r))}),e},li=(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,li(r.get(i),s,n)),r}if(e instanceof Set){const r=li(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]=li(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]=li(r[i],s,n),r}return e},Co=(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,Co(n.get(r),i)),n}if(e instanceof Set){const n=Co(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]=Co(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]=Co(n[r],i),n}return e},av=(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)},gs,va,ba,xa,xi,wa,ys,ms,ps,vs,bs,xs,Sa,Qp,vC=(Qp=class{constructor(e){ie(this,gs);ie(this,va);ie(this,ba);ie(this,xa);ie(this,xi,!1);ie(this,wa);ie(this,ys);ie(this,ms);ie(this,ps);ie(this,vs);ie(this,bs);ie(this,xs);ie(this,Sa);const{client:t,queryFlavor:n,version:r,onlineManager:i,buttonPosition:s,position:o,initialIsOpen:a,errorTypes:l,styleNonce:c,shadowDOMTarget:u}=e;X(this,gs,re(t)),X(this,ba,n),X(this,xa,r),X(this,va,i),X(this,wa,c),X(this,ys,u),X(this,ms,re(s)),X(this,ps,re(o)),X(this,vs,re(a)),X(this,bs,re(l))}setButtonPosition(e){P(this,ms)[1](e)}setPosition(e){P(this,ps)[1](e)}setInitialIsOpen(e){P(this,vs)[1](e)}setErrorTypes(e){P(this,bs)[1](e)}setClient(e){P(this,gs)[1](e)}mount(e){if(P(this,xi))throw new Error("Devtools is already mounted");const t=R0(()=>{const n=this,[r]=P(this,ms),[i]=P(this,ps),[s]=P(this,vs),[o]=P(this,bs),[a]=P(this,gs);let l;return P(this,xs)?l=P(this,xs):(l=L0(()=>Promise.resolve().then(()=>UI)),X(this,xs,l)),av(P(this,wa),P(this,ys)),j(l,Oe({get queryFlavor(){return P(n,ba)},get version(){return P(n,xa)},get onlineManager(){return P(n,va)},get shadowDOMTarget(){return P(n,ys)}},{get client(){return a()},get buttonPosition(){return r()},get position(){return i()},get initialIsOpen(){return s()},get errorTypes(){return o()}}))},e);X(this,xi,!0),X(this,Sa,t)}unmount(){var e;if(!P(this,xi))throw new Error("Devtools is not mounted");(e=P(this,Sa))==null||e.call(this),X(this,xi,!1)}},gs=new WeakMap,va=new WeakMap,ba=new WeakMap,xa=new WeakMap,xi=new WeakMap,wa=new WeakMap,ys=new WeakMap,ms=new WeakMap,ps=new WeakMap,vs=new WeakMap,bs=new WeakMap,xs=new WeakMap,Sa=new WeakMap,Qp),ws,Ca,_a,ka,wi,Oa,Ss,Cs,_s,ks,Os,Es,As,Ea,Yp,bC=(Yp=class{constructor(e){ie(this,ws);ie(this,Ca);ie(this,_a);ie(this,ka);ie(this,wi,!1);ie(this,Oa);ie(this,Ss);ie(this,Cs);ie(this,_s);ie(this,ks);ie(this,Os);ie(this,Es);ie(this,As);ie(this,Ea);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,ws,re(t)),X(this,_a,n),X(this,ka,r),X(this,Ca,i),X(this,Oa,c),X(this,Ss,u),X(this,Cs,re(s)),X(this,_s,re(o)),X(this,ks,re(a)),X(this,Os,re(l)),X(this,Es,re(d))}setButtonPosition(e){P(this,Cs)[1](e)}setPosition(e){P(this,_s)[1](e)}setInitialIsOpen(e){P(this,ks)[1](e)}setErrorTypes(e){P(this,Os)[1](e)}setClient(e){P(this,ws)[1](e)}setOnClose(e){P(this,Es)[1](()=>e)}mount(e){if(P(this,wi))throw new Error("Devtools is already mounted");const t=R0(()=>{const n=this,[r]=P(this,Cs),[i]=P(this,_s),[s]=P(this,ks),[o]=P(this,Os),[a]=P(this,ws),[l]=P(this,Es);let c;return P(this,As)?c=P(this,As):(c=L0(()=>Promise.resolve().then(()=>GI)),X(this,As,c)),av(P(this,Oa),P(this,Ss)),j(c,Oe({get queryFlavor(){return P(n,_a)},get version(){return P(n,ka)},get onlineManager(){return P(n,Ca)},get shadowDOMTarget(){return P(n,Ss)}},{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,wi,!0),X(this,Ea,t)}unmount(){var e;if(!P(this,wi))throw new Error("Devtools is not mounted");(e=P(this,Ea))==null||e.call(this),X(this,wi,!1)}},ws=new WeakMap,Ca=new WeakMap,_a=new WeakMap,ka=new WeakMap,wi=new WeakMap,Oa=new WeakMap,Ss=new WeakMap,Cs=new WeakMap,_s=new WeakMap,ks=new WeakMap,Os=new WeakMap,Es=new WeakMap,As=new WeakMap,Ea=new WeakMap,Yp);function xC(e){const t=qt(e.client),n=$.useRef(null),{buttonPosition:r,position:i,initialIsOpen:s,errorTypes:o,styleNonce:a,shadowDOMTarget:l}=e,[c]=$.useState(new vC({client:t,queryFlavor:"React Query",version:"5",onlineManager:js,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 wC(e){const t=qt(e.client),n=$.useRef(null),{errorTypes:r,styleNonce:i,shadowDOMTarget:s}=e,[o]=$.useState(new bC({client:t,queryFlavor:"React Query",version:"5",onlineManager:js,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 SC=process.env.NODE_ENV!=="development"?function(){return null}:xC;process.env.NODE_ENV;function lv(e,t){return function(){return e.apply(t,arguments)}}const{toString:CC}=Object.prototype,{getPrototypeOf:cf}=Object,{iterator:pc,toStringTag:cv}=Symbol,vc=(e=>t=>{const n=CC.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),On=e=>(e=e.toLowerCase(),t=>vc(t)===e),bc=e=>t=>typeof t===e,{isArray:zs}=Array,Wo=bc("undefined");function _C(e){return e!==null&&!Wo(e)&&e.constructor!==null&&!Wo(e.constructor)&&Nt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const uv=On("ArrayBuffer");function kC(e){let t;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&uv(e.buffer),t}const OC=bc("string"),Nt=bc("function"),dv=bc("number"),xc=e=>e!==null&&typeof e=="object",EC=e=>e===!0||e===!1,kl=e=>{if(vc(e)!=="object")return!1;const t=cf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(cv in e)&&!(pc in e)},AC=On("Date"),PC=On("File"),TC=On("Blob"),jC=On("FileList"),$C=e=>xc(e)&&Nt(e.pipe),MC=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Nt(e.append)&&((t=vc(e))==="formdata"||t==="object"&&Nt(e.toString)&&e.toString()==="[object FormData]"))},DC=On("URLSearchParams"),[LC,IC,RC,NC]=["ReadableStream","Request","Response","Headers"].map(On),FC=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ta(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e=="undefined")return;let r,i;if(typeof e!="object"&&(e=[e]),zs(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 fv(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 ci=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:global,hv=e=>!Wo(e)&&e!==ci;function ld(){const{caseless:e}=hv(this)&&this||{},t={},n=(r,i)=>{const s=e&&fv(t,i)||i;kl(t[s])&&kl(r)?t[s]=ld(t[s],r):kl(r)?t[s]=ld({},r):zs(r)?t[s]=r.slice():t[s]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&Ta(arguments[r],n);return t}const BC=(e,t,n,{allOwnKeys:r}={})=>(Ta(t,(i,s)=>{n&&Nt(i)?e[s]=lv(i,n):e[s]=i},{allOwnKeys:r}),e),qC=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),zC=(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)},HC=(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&&cf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},KC=(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},UC=e=>{if(!e)return null;if(zs(e))return e;let t=e.length;if(!dv(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},WC=(e=>t=>e&&t instanceof e)(typeof Uint8Array!="undefined"&&cf(Uint8Array)),VC=(e,t)=>{const r=(e&&e[pc]).call(e);let i;for(;(i=r.next())&&!i.done;){const s=i.value;t.call(e,s[0],s[1])}},GC=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},QC=On("HTMLFormElement"),YC=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),Uh=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),XC=On("RegExp"),gv=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Ta(n,(i,s)=>{let o;(o=t(i,s,e))!==!1&&(r[s]=o||i)}),Object.defineProperties(e,r)},JC=e=>{gv(e,(t,n)=>{if(Nt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Nt(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+"'")})}})},ZC=(e,t)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return zs(e)?r(e):r(String(e).split(t)),n},e_=()=>{},t_=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function n_(e){return!!(e&&Nt(e.append)&&e[cv]==="FormData"&&e[pc])}const r_=e=>{const t=new Array(10),n=(r,i)=>{if(xc(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const s=zs(r)?[]:{};return Ta(r,(o,a)=>{const l=n(o,i+1);!Wo(l)&&(s[a]=l)}),t[i]=void 0,s}}return r};return n(e,0)},i_=On("AsyncFunction"),s_=e=>e&&(xc(e)||Nt(e))&&Nt(e.then)&&Nt(e.catch),yv=((e,t)=>e?setImmediate:t?((n,r)=>(ci.addEventListener("message",({source:i,data:s})=>{i===ci&&s===n&&r.length&&r.shift()()},!1),i=>{r.push(i),ci.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Nt(ci.postMessage)),o_=typeof queueMicrotask!="undefined"?queueMicrotask.bind(ci):typeof process!="undefined"&&process.nextTick||yv,a_=e=>e!=null&&Nt(e[pc]),F={isArray:zs,isArrayBuffer:uv,isBuffer:_C,isFormData:MC,isArrayBufferView:kC,isString:OC,isNumber:dv,isBoolean:EC,isObject:xc,isPlainObject:kl,isReadableStream:LC,isRequest:IC,isResponse:RC,isHeaders:NC,isUndefined:Wo,isDate:AC,isFile:PC,isBlob:TC,isRegExp:XC,isFunction:Nt,isStream:$C,isURLSearchParams:DC,isTypedArray:WC,isFileList:jC,forEach:Ta,merge:ld,extend:BC,trim:FC,stripBOM:qC,inherits:zC,toFlatObject:HC,kindOf:vc,kindOfTest:On,endsWith:KC,toArray:UC,forEachEntry:VC,matchAll:GC,isHTMLForm:QC,hasOwnProperty:Uh,hasOwnProp:Uh,reduceDescriptors:gv,freezeMethods:JC,toObjectSet:ZC,toCamelCase:YC,noop:e_,toFiniteNumber:t_,findKey:fv,global:ci,isContextDefined:hv,isSpecCompliantForm:n_,toJSONObject:r_,isAsyncFn:i_,isThenable:s_,setImmediate:yv,asap:o_,isIterable:a_};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)}F.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:F.toJSONObject(this.config),code:this.code,status:this.status}}});const mv=Ae.prototype,pv={};["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=>{pv[e]={value:e}});Object.defineProperties(Ae,pv);Object.defineProperty(mv,"isAxiosError",{value:!0});Ae.from=(e,t,n,r,i,s)=>{const o=Object.create(mv);return F.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 l_=null;function cd(e){return F.isPlainObject(e)||F.isArray(e)}function vv(e){return F.endsWith(e,"[]")?e.slice(0,-2):e}function Wh(e,t,n){return e?e.concat(t).map(function(i,s){return i=vv(i),!n&&s?"["+i+"]":i}).join(n?".":""):t}function c_(e){return F.isArray(e)&&!e.some(cd)}const u_=F.toFlatObject(F,{},null,function(t){return/^is[A-Z]/.test(t)});function wc(e,t,n){if(!F.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=F.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,p){return!F.isUndefined(p[m])});const r=n.metaTokens,i=n.visitor||u,s=n.dots,o=n.indexes,l=(n.Blob||typeof Blob!="undefined"&&Blob)&&F.isSpecCompliantForm(t);if(!F.isFunction(i))throw new TypeError("visitor must be a function");function c(g){if(g===null)return"";if(F.isDate(g))return g.toISOString();if(F.isBoolean(g))return g.toString();if(!l&&F.isBlob(g))throw new Ae("Blob is not supported. Use a Buffer instead.");return F.isArrayBuffer(g)||F.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(F.endsWith(m,"{}"))m=r?m:m.slice(0,-2),g=JSON.stringify(g);else if(F.isArray(g)&&c_(g)||(F.isFileList(g)||F.endsWith(m,"[]"))&&(v=F.toArray(g)))return m=vv(m),v.forEach(function(w,C){!(F.isUndefined(w)||w===null)&&t.append(o===!0?Wh([m],C,s):o===null?m:m+"[]",c(w))}),!1}return cd(g)?!0:(t.append(Wh(p,m,s),c(g)),!1)}const d=[],f=Object.assign(u_,{defaultVisitor:u,convertValue:c,isVisitable:cd});function h(g,m){if(!F.isUndefined(g)){if(d.indexOf(g)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(g),F.forEach(g,function(v,b){(!(F.isUndefined(v)||v===null)&&i.call(t,v,F.isString(b)?b.trim():b,m,f))===!0&&h(v,m?m.concat(b):[b])}),d.pop()}}if(!F.isObject(e))throw new TypeError("data must be an object");return h(e),t}function Vh(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function uf(e,t){this._pairs=[],e&&wc(e,this,t)}const bv=uf.prototype;bv.append=function(t,n){this._pairs.push([t,n])};bv.toString=function(t){const n=t?function(r){return t.call(this,r,Vh)}:Vh;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function d_(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function xv(e,t,n){if(!t)return e;const r=n&&n.encode||d_;F.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let s;if(i?s=i(t,n):s=F.isURLSearchParams(t)?t.toString():new uf(t,n).toString(r),s){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class Gh{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){F.forEach(this.handlers,function(r){r!==null&&t(r)})}}const wv={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},f_=typeof URLSearchParams!="undefined"?URLSearchParams:uf,h_=typeof FormData!="undefined"?FormData:null,g_=typeof Blob!="undefined"?Blob:null,y_={isBrowser:!0,classes:{URLSearchParams:f_,FormData:h_,Blob:g_},protocols:["http","https","file","blob","url","data"]},df=typeof window!="undefined"&&typeof document!="undefined",ud=typeof navigator=="object"&&navigator||void 0,m_=df&&(!ud||["ReactNative","NativeScript","NS"].indexOf(ud.product)<0),p_=typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",v_=df&&window.location.href||"http://localhost",b_=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:df,hasStandardBrowserEnv:m_,hasStandardBrowserWebWorkerEnv:p_,navigator:ud,origin:v_},Symbol.toStringTag,{value:"Module"})),kt={...b_,...y_};function x_(e,t){return wc(e,new kt.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,s){return kt.isNode&&F.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function w_(e){return F.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function S_(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 Sv(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&&F.isArray(i)?i.length:o,l?(F.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!a):((!i[o]||!F.isObject(i[o]))&&(i[o]=[]),t(n,r,i[o],s)&&F.isArray(i[o])&&(i[o]=S_(i[o])),!a)}if(F.isFormData(e)&&F.isFunction(e.entries)){const n={};return F.forEachEntry(e,(r,i)=>{t(w_(r),i,n,0)}),n}return null}function C_(e,t,n){if(F.isString(e))try{return(t||JSON.parse)(e),F.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const ja={transitional:wv,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=F.isObject(t);if(s&&F.isHTMLForm(t)&&(t=new FormData(t)),F.isFormData(t))return i?JSON.stringify(Sv(t)):t;if(F.isArrayBuffer(t)||F.isBuffer(t)||F.isStream(t)||F.isFile(t)||F.isBlob(t)||F.isReadableStream(t))return t;if(F.isArrayBufferView(t))return t.buffer;if(F.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 x_(t,this.formSerializer).toString();if((a=F.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return wc(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),C_(t)):t}],transformResponse:[function(t){const n=this.transitional||ja.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(F.isResponse(t)||F.isReadableStream(t))return t;if(t&&F.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:kt.classes.FormData,Blob:kt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};F.forEach(["delete","get","head","post","put","patch"],e=>{ja.headers[e]={}});const __=F.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"]),k_=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]&&__[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Qh=Symbol("internals");function ro(e){return e&&String(e).trim().toLowerCase()}function Ol(e){return e===!1||e==null?e:F.isArray(e)?e.map(Ol):String(e)}function O_(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 E_=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function tu(e,t,n,r,i){if(F.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!F.isString(t)){if(F.isString(r))return t.indexOf(r)!==-1;if(F.isRegExp(r))return r.test(t)}}function A_(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function P_(e,t){const n=F.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 Ft=class{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function s(a,l,c){const u=ro(l);if(!u)throw new Error("header name must be a non-empty string");const d=F.findKey(i,u);(!d||i[d]===void 0||c===!0||c===void 0&&i[d]!==!1)&&(i[d||l]=Ol(a))}const o=(a,l)=>F.forEach(a,(c,u)=>s(c,u,l));if(F.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(F.isString(t)&&(t=t.trim())&&!E_(t))o(k_(t),n);else if(F.isObject(t)&&F.isIterable(t)){let a={},l,c;for(const u of t){if(!F.isArray(u))throw TypeError("Object iterator must return a key-value pair");a[c=u[0]]=(l=a[c])?F.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=ro(t),t){const r=F.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return O_(i);if(F.isFunction(n))return n.call(this,i,r);if(F.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=ro(t),t){const r=F.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||tu(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function s(o){if(o=ro(o),o){const a=F.findKey(r,o);a&&(!n||tu(r,r[a],a,n))&&(delete r[a],i=!0)}}return F.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||tu(this,this[s],s,t,!0))&&(delete this[s],i=!0)}return i}normalize(t){const n=this,r={};return F.forEach(this,(i,s)=>{const o=F.findKey(r,s);if(o){n[o]=Ol(i),delete n[s];return}const a=t?A_(s):String(s).trim();a!==s&&delete n[s],n[a]=Ol(i),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return F.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&F.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[Qh]=this[Qh]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=ro(o);r[a]||(P_(i,o),r[a]=!0)}return F.isArray(t)?t.forEach(s):s(t),this}};Ft.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);F.reduceDescriptors(Ft.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});F.freezeMethods(Ft);function nu(e,t){const n=this||ja,r=t||n,i=Ft.from(r.headers);let s=r.data;return F.forEach(e,function(a){s=a.call(n,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function Cv(e){return!!(e&&e.__CANCEL__)}function Hs(e,t,n){Ae.call(this,e==null?"canceled":e,Ae.ERR_CANCELED,t,n),this.name="CanceledError"}F.inherits(Hs,Ae,{__CANCEL__:!0});function _v(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 T_(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function j_(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 $_(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 Hl=(e,t,n=3)=>{let r=0;const i=j_(50,250);return $_(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)},Yh=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Xh=e=>(...t)=>F.asap(()=>e(...t)),M_=kt.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,kt.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(kt.origin),kt.navigator&&/(msie|trident)/i.test(kt.navigator.userAgent)):()=>!0,D_=kt.hasStandardBrowserEnv?{write(e,t,n,r,i,s){const o=[e+"="+encodeURIComponent(t)];F.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),F.isString(r)&&o.push("path="+r),F.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 L_(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function I_(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function kv(e,t,n){let r=!L_(t);return e&&(r||n==!1)?I_(e,t):t}const Jh=e=>e instanceof Ft?{...e}:e;function Ei(e,t){t=t||{};const n={};function r(c,u,d,f){return F.isPlainObject(c)&&F.isPlainObject(u)?F.merge.call({caseless:f},c,u):F.isPlainObject(u)?F.merge({},u):F.isArray(u)?u.slice():u}function i(c,u,d,f){if(F.isUndefined(u)){if(!F.isUndefined(c))return r(void 0,c,d,f)}else return r(c,u,d,f)}function s(c,u){if(!F.isUndefined(u))return r(void 0,u)}function o(c,u){if(F.isUndefined(u)){if(!F.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(Jh(c),Jh(u),d,!0)};return F.forEach(Object.keys(Object.assign({},e,t)),function(u){const d=l[u]||i,f=d(e[u],t[u],u);F.isUndefined(f)&&d!==a||(n[u]=f)}),n}const Ov=e=>{const t=Ei({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:o,auth:a}=t;t.headers=o=Ft.from(o),t.url=xv(kv(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(F.isFormData(n)){if(kt.hasStandardBrowserEnv||kt.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(kt.hasStandardBrowserEnv&&(r&&F.isFunction(r)&&(r=r(t)),r||r!==!1&&M_(t.url))){const c=i&&s&&D_.read(s);c&&o.set(i,c)}return t},R_=typeof XMLHttpRequest!="undefined",N_=R_&&function(e){return new Promise(function(n,r){const i=Ov(e);let s=i.data;const o=Ft.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=Ft.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};_v(function(S){n(S),m()},function(S){r(S),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 C=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const x=i.transitional||wv;i.timeoutErrorMessage&&(C=i.timeoutErrorMessage),r(new Ae(C,x.clarifyTimeoutError?Ae.ETIMEDOUT:Ae.ECONNABORTED,e,p)),p=null},s===void 0&&o.setContentType(null),"setRequestHeader"in p&&F.forEach(o.toJSON(),function(C,x){p.setRequestHeader(x,C)}),F.isUndefined(i.withCredentials)||(p.withCredentials=!!i.withCredentials),a&&a!=="json"&&(p.responseType=i.responseType),c&&([f,g]=Hl(c,!0),p.addEventListener("progress",f)),l&&p.upload&&([d,h]=Hl(l),p.upload.addEventListener("progress",d),p.upload.addEventListener("loadend",h)),(i.cancelToken||i.signal)&&(u=w=>{p&&(r(!w||w.type?new Hs(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=T_(i.url);if(b&&kt.protocols.indexOf(b)===-1){r(new Ae("Unsupported protocol "+b+":",Ae.ERR_BAD_REQUEST,e));return}p.send(s||null)})},F_=(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 Hs(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=()=>F.asap(a),l}},B_=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},q_=async function*(e,t){for await(const n of z_(e))yield*B_(n,t)},z_=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()}},Zh=(e,t,n,r)=>{const i=q_(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})},Sc=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Ev=Sc&&typeof ReadableStream=="function",H_=Sc&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Av=(e,...t)=>{try{return!!e(...t)}catch(n){return!1}},K_=Ev&&Av(()=>{let e=!1;const t=new Request(kt.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),eg=64*1024,dd=Ev&&Av(()=>F.isReadableStream(new Response("").body)),Kl={stream:dd&&(e=>e.body)};Sc&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Kl[t]&&(Kl[t]=F.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 U_=async e=>{if(e==null)return 0;if(F.isBlob(e))return e.size;if(F.isSpecCompliantForm(e))return(await new Request(kt.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(F.isArrayBufferView(e)||F.isArrayBuffer(e))return e.byteLength;if(F.isURLSearchParams(e)&&(e=e+""),F.isString(e))return(await H_(e)).byteLength},W_=async(e,t)=>{const n=F.toFiniteNumber(e.getContentLength());return n==null?U_(t):n},V_=Sc&&(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}=Ov(e);c=c?(c+"").toLowerCase():"text";let h=F_([i,s&&s.toAbortSignal()],o),g;const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let p;try{if(l&&K_&&n!=="get"&&n!=="head"&&(p=await W_(u,r))!==0){let x=new Request(t,{method:"POST",body:r,duplex:"half"}),k;if(F.isFormData(r)&&(k=x.headers.get("content-type"))&&u.setContentType(k),x.body){const[S,_]=Yh(p,Hl(Xh(l)));r=Zh(x.body,eg,S,_)}}F.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=dd&&(c==="stream"||c==="response");if(dd&&(a||w&&m)){const x={};["status","statusText","headers"].forEach(O=>{x[O]=b[O]});const k=F.toFiniteNumber(b.headers.get("content-length")),[S,_]=a&&Yh(k,Hl(Xh(a),!0))||[];b=new Response(Zh(b.body,eg,S,()=>{_&&_(),m&&m()}),x)}c=c||"text";let C=await Kl[F.findKey(Kl,c)||"text"](b,e);return!w&&m&&m(),await new Promise((x,k)=>{_v(x,k,{data:C,headers:Ft.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)}}),fd={http:l_,xhr:N_,fetch:V_};F.forEach(fd,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(n){}Object.defineProperty(e,"adapterName",{value:t})}});const tg=e=>`- ${e}`,G_=e=>F.isFunction(e)||e===null||e===!1,Pv={getAdapter:e=>{e=F.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,!G_(n)&&(r=fd[(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
15
  `+s.map(tg).join(`
16
- `):" "+tg(s[0]):"as no adapter specified";throw new Ee("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:fd};function ru(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Hs(null,e)}function ng(e){return ru(e),e.headers=Ft.from(e.headers),e.data=nu.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Av.getAdapter(e.adapter||ja.adapter)(e).then(function(r){return ru(e),r.data=nu.call(e,e.transformResponse,r),r.headers=Ft.from(r.headers),r},function(r){return Sv(r)||(ru(e),r&&r.response&&(r.response.data=nu.call(e,e.transformResponse,r.response),r.response.headers=Ft.from(r.response.headers))),Promise.reject(r)})}const Pv="1.10.0",Cc={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Cc[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const rg={};Cc.transitional=function(t,n,r){function i(s,o){return"[Axios v"+Pv+"] Transitional option '"+s+"'"+o+(r?". "+r:"")}return(s,o,a)=>{if(t===!1)throw new Ee(i(o," has been removed"+(n?" in "+n:"")),Ee.ERR_DEPRECATED);return n&&!rg[o]&&(rg[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}};Cc.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function G_(e,t,n){if(typeof e!="object")throw new Ee("options must be an object",Ee.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 Ee("option "+s+" must be "+l,Ee.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Ee("Unknown option "+s,Ee.ERR_BAD_OPTION)}}const El={assertOptions:G_,validators:Cc},Pn=El.validators;let Si=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Gh,response:new Gh}}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=Ei(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&El.assertOptions(r,{silentJSONParsing:Pn.transitional(Pn.boolean),forcedJSONParsing:Pn.transitional(Pn.boolean),clarifyTimeoutError:Pn.transitional(Pn.boolean)},!1),i!=null&&(F.isFunction(i)?n.paramsSerializer={serialize:i}:El.assertOptions(i,{encode:Pn.function,serialize:Pn.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),El.assertOptions(n,{baseUrl:Pn.spelling("baseURL"),withXsrfToken:Pn.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&F.merge(s.common,s[n.method]);s&&F.forEach(["delete","get","head","post","put","patch","common"],g=>{delete s[g]}),n.headers=Ft.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=[ng.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=ng.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=Ei(this.defaults,t);const n=_v(t.baseURL,t.url,t.allowAbsoluteUrls);return bv(n,t.params,t.paramsSerializer)}};F.forEach(["delete","get","head","options"],function(t){Si.prototype[t]=function(n,r){return this.request(Ei(r||{},{method:t,url:n,data:(r||{}).data}))}});F.forEach(["post","put","patch"],function(t){function n(r){return function(s,o,a){return this.request(Ei(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}Si.prototype[t]=n(),Si.prototype[t+"Form"]=n(!0)});let Q_=class Tv{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 Hs(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 Tv(function(i){t=i}),cancel:t}}};function Y_(e){return function(n){return e.apply(null,n)}}function X_(e){return F.isObject(e)&&e.isAxiosError===!0}const hd={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(hd).forEach(([e,t])=>{hd[t]=e});function jv(e){const t=new Si(e),n=av(Si.prototype.request,t);return F.extend(n,Si.prototype,t,{allOwnKeys:!0}),F.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return jv(Ei(e,i))},n}const nt=jv(ja);nt.Axios=Si;nt.CanceledError=Hs;nt.CancelToken=Q_;nt.isCancel=Sv;nt.VERSION=Pv;nt.toFormData=wc;nt.AxiosError=Ee;nt.Cancel=nt.CanceledError;nt.all=function(t){return Promise.all(t)};nt.spread=Y_;nt.isAxiosError=X_;nt.mergeConfig=Ei;nt.AxiosHeaders=Ft;nt.formToJSON=e=>wv(F.isHTMLForm(e)?new FormData(e):e);nt.getAdapter=Av.getAdapter;nt.HttpStatusCode=hd;nt.default=nt;const{Axios:_N,AxiosError:kN,CanceledError:ON,isCancel:EN,CancelToken:AN,VERSION:PN,all:TN,Cancel:jN,isAxiosError:MN,spread:$N,toFormData:DN,AxiosHeaders:LN,HttpStatusCode:IN,formToJSON:RN,getAdapter:NN,mergeConfig:FN}=nt,J_={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function Wo(e){"@babel/helpers - typeof";return Wo=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},Wo(e)}function jt(){/*! 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 Kt(b,"_invoke",function(w,C,x){var k,S,_,O=0,E=x||[],T=!1,D={p:0,n:0,v:e,a:W,f:W.bind(e,4),d:function(L,$){return k=L,S=0,_=e,D.n=$,o}};function W(N,L){for(S=N,_=L,t=0;!T&&O&&!$&&t<E.length;t++){var $,I=E[t],oe=D.p,ue=I[2];N>3?($=ue===L)&&(_=I[(S=I[4])?5:(S=3,3)],I[4]=I[5]=e):I[0]<=oe&&(($=N<2&&oe<I[1])?(S=0,D.v=L,D.n=I[1]):oe<ue&&($=N<3||I[0]>L||L>ue)&&(I[4]=N,I[5]=L,D.n=ue,S=0))}if($||N>1)return o;throw T=!0,L}return function(N,L,$){if(O>1)throw TypeError("Generator is already running");for(T&&L===1&&W(L,$),S=L,_=$;(t=S<2?e:_)||!T;){k||(S?S<3?(S>1&&(D.n=-1),W(S,_)):D.n=_:D.v=_);try{if(O=2,k){if(S||(N="next"),t=k[N]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,S<2&&(S=0)}else S===1&&(t=k.return)&&t.call(k),S<2&&(_=TypeError("The iterator does not provide a '"+N+"' method"),S=1);k=e}else if((t=(T=D.n<0)?_:w.call(C,D))!==o)break}catch(I){k=e,S=1,_=I}finally{O=1}}return{value:t,done:T}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Kt(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,Kt(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=c,Kt(d,"constructor",c),Kt(c,"constructor",l),l.displayName="GeneratorFunction",Kt(c,i,"GeneratorFunction"),Kt(d),Kt(d,i,"Generator"),Kt(d,r,function(){return this}),Kt(d,"toString",function(){return"[object Generator]"}),(jt=function(){return{w:s,m:f}})()}function Kt(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Kt=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){Kt(o,f,function(g){return this._invoke(f,h,g)})};u("next",0),u("throw",1),u("return",2)}},Kt(e,t,n,r)}function ig(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 Ci(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ig(Object(n),!0).forEach(function(r){Z_(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ig(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Z_(e,t,n){return(t=ek(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ek(e){var t=tk(e,"string");return Wo(t)=="symbol"?t:t+""}function tk(e,t){if(Wo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Wo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sg(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 Ai(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){sg(s,r,i,o,a,"next",l)}function a(l){sg(s,r,i,o,a,"throw",l)}o(void 0)})}}var Mv=function(){var t;return((t=J_)===null||t===void 0?void 0:t.VITE_MYYOAST_ACCESS_TOKEN)||""};function og(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 nk="yst-insights-token",Ks=nt.create({withCredentials:!0});Ks.interceptors.request.use(function(){var e=Ai(jt().m(function t(n){var r,i;return jt().w(function(s){for(;;)switch(s.n){case 0:return s.n=1,ik();case 1:return r=s.v,s.n=2,Dv();case 2:return i=s.v,n.headers=Ci(Ci(Ci({},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});Ks.interceptors.response.use(function(e){return e},function(){var e=Ai(jt().m(function t(n){var r;return jt().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 vt(e){return gd.apply(this,arguments)}function gd(){return gd=Ai(jt().m(function e(t){var n;return jt().w(function(r){for(;;)switch(r.n){case 0:return n=Ci({},t),delete n.baseURL,r.a(2,Ks.request(Ci(Ci({},n),{},{withCredentials:!0})))}},e)})),gd.apply(this,arguments)}function $v(e){Ks.defaults.baseURL=e}function ag(){return Ks.defaults.baseURL}function rk(e){Mv=e}var io=null;function ik(){return yd.apply(this,arguments)}function yd(){return yd=Ai(jt().m(function e(){var t,n,r,i,s;return jt().w(function(o){for(;;)switch(o.p=o.n){case 0:if(t=Mv(),n=Ks.defaults.baseURL,r=sk(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(!io){o.n=5;break}return o.a(2,io);case 5:return io=Ai(jt().m(function a(){var l,c,u,d,f;return jt().w(function(h){for(;;)switch(h.p=h.n){case 0:return h.p=0,h.n=1,Dv();case 1:return l=h.v,h.n=2,nt.post(n+"/users/getToken",{},{headers:Ci({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,nt.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,io=null,h.f(5);case 6:return h.a(2,"")}},a,null,[[0,4,5,6]])}))(),o.a(2,io)}},e,null,[[1,3]])})),yd.apply(this,arguments)}function sk(e,t){var n=Array.from(e+t).reduce(function(r,i){return(r<<5)-r+i.charCodeAt(0)},0);return nk+":"+n}var so=null;function Dv(){return md.apply(this,arguments)}function md(){return md=Ai(jt().m(function e(){var t;return jt().w(function(n){for(;;)switch(n.n){case 0:if(window.location.hostname===new URL(ag()||window.location.href).hostname){n.n=1;break}return n.a(2,"");case 1:if(t=og("XSRF-TOKEN"),!t){n.n=2;break}return n.a(2,decodeURIComponent(t));case 2:if(!so){n.n=3;break}return n.a(2,so);case 3:return so=Ai(jt().m(function r(){var i;return jt().w(function(s){for(;;)switch(s.p=s.n){case 0:return s.p=0,s.n=1,nt.get(((i=ag())===null||i===void 0?void 0:i.replace("/api/v1",""))+"/sanctum/csrf-cookie",{withCredentials:!0});case 1:return s.a(2,decodeURIComponent(og("XSRF-TOKEN")||""));case 2:return s.p=2,so=null,s.f(2);case 3:return s.a(2)}},r,null,[[0,,2,3]])}))(),n.a(2,so)}},e)})),md.apply(this,arguments)}function Go(e){"@babel/helpers - typeof";return Go=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},Go(e)}function lg(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 Ce(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lg(Object(n),!0).forEach(function(r){ok(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ok(e,t,n){return(t=ak(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ak(e){var t=lk(e,"string");return Go(t)=="symbol"?t:t+""}function lk(e,t){if(Go(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Go(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ck=function(t,n){return vt({url:"/brands/".concat(t,"/analysis"),method:"GET",signal:n})},Lv=function(t){return["/brands/".concat(t,"/analysis")]},uk=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:Lv(t),a=function(c){var u=c.signal;return ck(t,u)};return Ce({queryKey:o,queryFn:a,enabled:!!t},s)};function Iv(e,t,n){var r=uk(e,t),i=hr(r,n);return i.queryKey=r.queryKey,i}var dk=function(t,n,r){return vt({url:"/brands/".concat(t,"/analysis/").concat(n),method:"GET",signal:r})},Rv=function(t,n){return["/brands/".concat(t,"/analysis/").concat(n)]},fk=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:Rv(t,n),l=function(u){var d=u.signal;return dk(t,n,d)};return Ce({queryKey:a,queryFn:l,enabled:!!(t&&n)},o)};function _c(e,t,n,r){var i=fk(e,t,n),s=hr(i,r);return s.queryKey=i.queryKey,s}var hk=function(t,n){return vt({url:"/brands/".concat(t,"/analysis/").concat(n),method:"DELETE"})},gk=function(t){var n=["deleteSingleAnalysis"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:Ce(Ce({},t),{},{mutation:Ce(Ce({},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 hk(c,u)};return Ce({mutationFn:s},i)},yk=function(t,n){var r=gk(t);return Wr(r,n)},mk=function(t,n,r){return vt({url:"/brands/".concat(t,"/analysis/").concat(n,"/status"),method:"GET",signal:r})},pk=function(t,n){return["/brands/".concat(t,"/analysis/").concat(n,"/status")]},vk=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:pk(t,n),l=function(u){var d=u.signal;return mk(t,n,d)};return Ce({queryKey:a,queryFn:l,enabled:!!(t&&n)},o)};function bk(e,t,n,r){var i=vk(e,t,n),s=hr(i,r);return s.queryKey=i.queryKey,s}var xk=function(t){return vt({url:"/users/logout",method:"POST",signal:t})},wk=function(t){var n=["logout"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:Ce(Ce({},t),{},{mutation:Ce(Ce({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(){return xk()};return Ce({mutationFn:s},i)},Sk=function(t,n){var r=wk(t);return Wr(r,n)},Ck=function(t,n){return vt({url:"/brands/".concat(t,"/associated-brands"),method:"GET",signal:n})},ff=function(t){return["/brands/".concat(t,"/associated-brands")]},_k=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:ff(t),a=function(c){var u=c.signal;return Ck(t,u)};return Ce({queryKey:o,queryFn:a,enabled:!!t},s)};function kk(e,t,n){var r=_k(e,t),i=hr(r,n);return i.queryKey=r.queryKey,i}var Ok=function(t,n,r){return vt({url:"/brands/".concat(t,"/associated-brand-groups"),method:"POST",headers:{"Content-Type":"application/json"},data:n,signal:r})},Ek=function(t){var n=["createBrandAssociationGroup"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:Ce(Ce({},t),{},{mutation:Ce(Ce({},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 Ok(c,u)};return Ce({mutationFn:s},i)},Nv=function(t,n){var r=Ek(t);return Wr(r,n)},Ak=function(t){return vt({url:"/brands",method:"GET",signal:t})},nr=function(){return["/brands"]},Pk=function(t){var n,r=t!=null?t:{},i=r.query,s=(n=i==null?void 0:i.queryKey)!==null&&n!==void 0?n:nr(),o=function(l){var c=l.signal;return Ak(c)};return Ce({queryKey:s,queryFn:o},i)};function Ri(e,t){var n=Pk(e),r=hr(n,t);return r.queryKey=n.queryKey,r}var Tk=function(t,n){return vt({url:"/brands",method:"POST",headers:{"Content-Type":"application/json"},data:t,signal:n})},jk=function(t){var n=["createBrand"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:Ce(Ce({},t),{},{mutation:Ce(Ce({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},c=l.data;return Tk(c)};return Ce({mutationFn:s},i)},Mk=function(t,n){var r=jk(t);return Wr(r,n)},$k=function(t,n){return vt({url:"/brands/".concat(t),method:"GET",signal:n})},hf=function(t){return["/brands/".concat(t)]},Dk=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:hf(t),a=function(c){var u=c.signal;return $k(t,u)};return Ce({queryKey:o,queryFn:a,enabled:!!t},s)};function Fv(e,t,n){var r=Dk(e,t),i=hr(r,n);return i.queryKey=r.queryKey,i}var Lk=function(t){return vt({url:"/brands/".concat(t),method:"DELETE"})},Ik=function(t){var n=["deleteBrand"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:Ce(Ce({},t),{},{mutation:Ce(Ce({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},c=l.brandId;return Lk(c)};return Ce({mutationFn:s},i)},Rk=function(t,n){var r=Ik(t);return Wr(r,n)},Nk=function(t,n){return vt({url:"/brands/".concat(t,"/settings"),method:"PATCH",headers:{"Content-Type":"application/json"},data:n})},Fk=function(t){var n=["updateBrandSettings"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:Ce(Ce({},t),{},{mutation:Ce(Ce({},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 Nk(c,u)};return Ce({mutationFn:s},i)},Bv=function(t,n){var r=Fk(t);return Wr(r,n)},Bk=function(t,n){return vt({url:"/brands/".concat(t,"/queries"),method:"GET",signal:n})},qk=function(t){return["/brands/".concat(t,"/queries")]},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:qk(t),a=function(c){var u=c.signal;return Bk(t,u)};return Ce({queryKey:o,queryFn:a,enabled:!!t},s)};function Hk(e,t,n){var r=zk(e,t),i=hr(r,n);return i.queryKey=r.queryKey,i}var Kk=function(t,n){return vt({url:"/brands/".concat(t,"/queries"),method:"PUT",headers:{"Content-Type":"application/json"},data:n})},Uk=function(t){var n=["updateBrandQueries"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:Ce(Ce({},t),{},{mutation:Ce(Ce({},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 Kk(c,u)};return Ce({mutationFn:s},i)},Vk=function(t,n){var r=Uk(t);return Wr(r,n)},Wk=function(t,n){return vt({url:"/brands/".concat(t,"/query-suggestions"),method:"GET",signal:n})},Gk=function(t){return["/brands/".concat(t,"/query-suggestions")]},Qk=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:Gk(t),a=function(c){var u=c.signal;return Wk(t,u)};return Ce({queryKey:o,queryFn:a,enabled:!!t},s)};function Yk(e,t,n){var r=Qk(e,t),i=hr(r,n);return i.queryKey=r.queryKey,i}var Xk=function(t){return vt({url:"/users/current",method:"GET",signal:t})},gf=function(){return["/users/current"]},Jk=function(t){var n,r=t!=null?t:{},i=r.query,s=(n=i==null?void 0:i.queryKey)!==null&&n!==void 0?n:gf(),o=function(l){var c=l.signal;return Xk(c)};return Ce({queryKey:s,queryFn:o},i)};function kc(e,t){var n=Jk(e),r=hr(n,t);return r.queryKey=n.queryKey,r}var Zk=function(){return vt({url:"/users/data",method:"DELETE"})},eO=function(t){var n=["deleteUserData"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:Ce(Ce({},t),{},{mutation:Ce(Ce({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(){return Zk()};return Ce({mutationFn:s},i)},tO=function(t,n){var r=eO(t);return Wr(r,n)},qv=z.createContext(void 0),nO=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=Wa("/brands/:brandId"),v=Wa("/brands/:brandId/*"),b=Wa("/brands/:brandId/analysis/:analysisId"),w=Wa("/brands/:brandId/analysis/:analysisId/*"),C=(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,k=z.useMemo(function(){return{brandId:C||d||"",analysisId:x||f||"latest",model:h||"openai",hostAppProps:m}},[C,d,x,f,h,m]),S=z.useMemo(function(){return{data:k}},[k]);return y.jsx(qv.Provider,{value:S,children:u})},zv=z.createContext(void 0),rO=function(t){var n=t.children,r=t.setBrandId,i=t.setAnalysisId,s=t.setModel,o=z.useCallback(function(d){r(d),i("latest")},[r,i]),a=z.useCallback(function(d){i(d)},[i]),l=z.useCallback(function(d){s(d)},[s]),c=z.useMemo(function(){return{setBrandId:o,setAnalysisId:a,setModel:l}},[o,a,l]),u=z.useMemo(function(){return{mutations:c}},[c]);return y.jsx(zv.Provider,{value:u,children:n})};function iu(e,t){return aO(e)||oO(e,t)||sO(e,t)||iO()}function iO(){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 sO(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 oO(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 aO(e){if(Array.isArray(e))return e}var lO=function(t){var n=t.children,r=t.hostAppProps,i=r===void 0?{}:r,s=z.useState(void 0),o=iu(s,2),a=o[0],l=o[1],c=z.useState("latest"),u=iu(c,2),d=u[0],f=u[1],h=z.useState(void 0),g=iu(h,2),m=g[0],p=g[1];return y.jsx(rO,{brandId:a,setBrandId:l,analysisId:d,setAnalysisId:f,model:m,setModel:p,children:y.jsx(nO,{brandId:a,analysisId:d,model:m,hostAppProps:i,children:n})})},En=function(){var t=z.useContext(qv);if(t===void 0)throw new Error("useBrandAnalysisData must be used within a BrandAnalysisDataProvider");return t.data},Oc=function(){var t=z.useContext(zv);if(t===void 0)throw new Error("useBrandAnalysisMutations must be used within a BrandAnalysisMutationsProvider");return t.mutations},su={exports:{}};/*!
16
+ `):" "+tg(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:fd};function ru(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Hs(null,e)}function ng(e){return ru(e),e.headers=Ft.from(e.headers),e.data=nu.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Pv.getAdapter(e.adapter||ja.adapter)(e).then(function(r){return ru(e),r.data=nu.call(e,e.transformResponse,r),r.headers=Ft.from(r.headers),r},function(r){return Cv(r)||(ru(e),r&&r.response&&(r.response.data=nu.call(e,e.transformResponse,r.response),r.response.headers=Ft.from(r.response.headers))),Promise.reject(r)})}const Tv="1.10.0",Cc={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Cc[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const rg={};Cc.transitional=function(t,n,r){function i(s,o){return"[Axios v"+Tv+"] 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&&!rg[o]&&(rg[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}};Cc.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Q_(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 El={assertOptions:Q_,validators:Cc},Pn=El.validators;let Si=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Gh,response:new Gh}}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=Ei(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&El.assertOptions(r,{silentJSONParsing:Pn.transitional(Pn.boolean),forcedJSONParsing:Pn.transitional(Pn.boolean),clarifyTimeoutError:Pn.transitional(Pn.boolean)},!1),i!=null&&(F.isFunction(i)?n.paramsSerializer={serialize:i}:El.assertOptions(i,{encode:Pn.function,serialize:Pn.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),El.assertOptions(n,{baseUrl:Pn.spelling("baseURL"),withXsrfToken:Pn.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&F.merge(s.common,s[n.method]);s&&F.forEach(["delete","get","head","post","put","patch","common"],g=>{delete s[g]}),n.headers=Ft.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=[ng.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=ng.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=Ei(this.defaults,t);const n=kv(t.baseURL,t.url,t.allowAbsoluteUrls);return xv(n,t.params,t.paramsSerializer)}};F.forEach(["delete","get","head","options"],function(t){Si.prototype[t]=function(n,r){return this.request(Ei(r||{},{method:t,url:n,data:(r||{}).data}))}});F.forEach(["post","put","patch"],function(t){function n(r){return function(s,o,a){return this.request(Ei(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}Si.prototype[t]=n(),Si.prototype[t+"Form"]=n(!0)});let Y_=class jv{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 Hs(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 jv(function(i){t=i}),cancel:t}}};function X_(e){return function(n){return e.apply(null,n)}}function J_(e){return F.isObject(e)&&e.isAxiosError===!0}const hd={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(hd).forEach(([e,t])=>{hd[t]=e});function $v(e){const t=new Si(e),n=lv(Si.prototype.request,t);return F.extend(n,Si.prototype,t,{allOwnKeys:!0}),F.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return $v(Ei(e,i))},n}const rt=$v(ja);rt.Axios=Si;rt.CanceledError=Hs;rt.CancelToken=Y_;rt.isCancel=Cv;rt.VERSION=Tv;rt.toFormData=wc;rt.AxiosError=Ae;rt.Cancel=rt.CanceledError;rt.all=function(t){return Promise.all(t)};rt.spread=X_;rt.isAxiosError=J_;rt.mergeConfig=Ei;rt.AxiosHeaders=Ft;rt.formToJSON=e=>Sv(F.isHTMLForm(e)?new FormData(e):e);rt.getAdapter=Pv.getAdapter;rt.HttpStatusCode=hd;rt.default=rt;const{Axios:TN,AxiosError:jN,CanceledError:$N,isCancel:MN,CancelToken:DN,VERSION:LN,all:IN,Cancel:RN,isAxiosError:NN,spread:FN,toFormData:BN,AxiosHeaders:qN,HttpStatusCode:zN,formToJSON:HN,getAdapter:KN,mergeConfig:UN}=rt,Z_={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function Vo(e){"@babel/helpers - typeof";return Vo=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},Vo(e)}function jt(){/*! 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 Kt(b,"_invoke",function(w,C,x){var k,S,_,O=0,E=x||[],T=!1,D={p:0,n:0,v:e,a:G,f:G.bind(e,4),d:function(L,M){return k=L,S=0,_=e,D.n=M,o}};function G(N,L){for(S=N,_=L,t=0;!T&&O&&!M&&t<E.length;t++){var M,I=E[t],oe=D.p,ue=I[2];N>3?(M=ue===L)&&(_=I[(S=I[4])?5:(S=3,3)],I[4]=I[5]=e):I[0]<=oe&&((M=N<2&&oe<I[1])?(S=0,D.v=L,D.n=I[1]):oe<ue&&(M=N<3||I[0]>L||L>ue)&&(I[4]=N,I[5]=L,D.n=ue,S=0))}if(M||N>1)return o;throw T=!0,L}return function(N,L,M){if(O>1)throw TypeError("Generator is already running");for(T&&L===1&&G(L,M),S=L,_=M;(t=S<2?e:_)||!T;){k||(S?S<3?(S>1&&(D.n=-1),G(S,_)):D.n=_:D.v=_);try{if(O=2,k){if(S||(N="next"),t=k[N]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,S<2&&(S=0)}else S===1&&(t=k.return)&&t.call(k),S<2&&(_=TypeError("The iterator does not provide a '"+N+"' method"),S=1);k=e}else if((t=(T=D.n<0)?_:w.call(C,D))!==o)break}catch(I){k=e,S=1,_=I}finally{O=1}}return{value:t,done:T}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Kt(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,Kt(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=c,Kt(d,"constructor",c),Kt(c,"constructor",l),l.displayName="GeneratorFunction",Kt(c,i,"GeneratorFunction"),Kt(d),Kt(d,i,"Generator"),Kt(d,r,function(){return this}),Kt(d,"toString",function(){return"[object Generator]"}),(jt=function(){return{w:s,m:f}})()}function Kt(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Kt=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){Kt(o,f,function(g){return this._invoke(f,h,g)})};u("next",0),u("throw",1),u("return",2)}},Kt(e,t,n,r)}function ig(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 Ci(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ig(Object(n),!0).forEach(function(r){ek(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ig(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ek(e,t,n){return(t=tk(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tk(e){var t=nk(e,"string");return Vo(t)=="symbol"?t:t+""}function nk(e,t){if(Vo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Vo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sg(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 Ai(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){sg(s,r,i,o,a,"next",l)}function a(l){sg(s,r,i,o,a,"throw",l)}o(void 0)})}}var Mv=function(){var t;return((t=Z_)===null||t===void 0?void 0:t.VITE_MYYOAST_ACCESS_TOKEN)||""};function og(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 rk="yst-insights-token",Ks=rt.create({withCredentials:!0});Ks.interceptors.request.use(function(){var e=Ai(jt().m(function t(n){var r,i;return jt().w(function(s){for(;;)switch(s.n){case 0:return s.n=1,sk();case 1:return r=s.v,s.n=2,Lv();case 2:return i=s.v,n.headers=Ci(Ci(Ci({},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});Ks.interceptors.response.use(function(e){return e},function(){var e=Ai(jt().m(function t(n){var r;return jt().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 gd.apply(this,arguments)}function gd(){return gd=Ai(jt().m(function e(t){var n;return jt().w(function(r){for(;;)switch(r.n){case 0:return n=Ci({},t),delete n.baseURL,r.a(2,Ks.request(Ci(Ci({},n),{},{withCredentials:!0})))}},e)})),gd.apply(this,arguments)}function Dv(e){Ks.defaults.baseURL=e}function ag(){return Ks.defaults.baseURL}function ik(e){Mv=e}var io=null;function sk(){return yd.apply(this,arguments)}function yd(){return yd=Ai(jt().m(function e(){var t,n,r,i,s;return jt().w(function(o){for(;;)switch(o.p=o.n){case 0:if(t=Mv(),n=Ks.defaults.baseURL,r=ok(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(!io){o.n=5;break}return o.a(2,io);case 5:return io=Ai(jt().m(function a(){var l,c,u,d,f;return jt().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,rt.post(n+"/users/getToken",{},{headers:Ci({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,rt.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,io=null,h.f(5);case 6:return h.a(2,"")}},a,null,[[0,4,5,6]])}))(),o.a(2,io)}},e,null,[[1,3]])})),yd.apply(this,arguments)}function ok(e,t){var n=Array.from(e+t).reduce(function(r,i){return(r<<5)-r+i.charCodeAt(0)},0);return rk+":"+n}var so=null;function Lv(){return md.apply(this,arguments)}function md(){return md=Ai(jt().m(function e(){var t;return jt().w(function(n){for(;;)switch(n.n){case 0:if(window.location.hostname===new URL(ag()||window.location.href).hostname){n.n=1;break}return n.a(2,"");case 1:if(t=og("XSRF-TOKEN"),!t){n.n=2;break}return n.a(2,decodeURIComponent(t));case 2:if(!so){n.n=3;break}return n.a(2,so);case 3:return so=Ai(jt().m(function r(){var i;return jt().w(function(s){for(;;)switch(s.p=s.n){case 0:return s.p=0,s.n=1,rt.get(((i=ag())===null||i===void 0?void 0:i.replace("/api/v1",""))+"/sanctum/csrf-cookie",{withCredentials:!0});case 1:return s.a(2,decodeURIComponent(og("XSRF-TOKEN")||""));case 2:return s.p=2,so=null,s.f(2);case 3:return s.a(2)}},r,null,[[0,,2,3]])}))(),n.a(2,so)}},e)})),md.apply(this,arguments)}function Go(e){"@babel/helpers - typeof";return Go=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},Go(e)}function lg(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 Se(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lg(Object(n),!0).forEach(function(r){ak(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ak(e,t,n){return(t=lk(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lk(e){var t=ck(e,"string");return Go(t)=="symbol"?t:t+""}function ck(e,t){if(Go(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Go(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var uk=function(t,n){return bt({url:"/brands/".concat(t,"/analysis"),method:"GET",signal:n})},Iv=function(t){return["/brands/".concat(t,"/analysis")]},dk=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:Iv(t),a=function(c){var u=c.signal;return uk(t,u)};return Se({queryKey:o,queryFn:a,enabled:!!t},s)};function Rv(e,t,n){var r=dk(e,t),i=hr(r,n);return i.queryKey=r.queryKey,i}var fk=function(t,n,r){return bt({url:"/brands/".concat(t,"/analysis/").concat(n),method:"GET",signal:r})},Nv=function(t,n){return["/brands/".concat(t,"/analysis/").concat(n)]},hk=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:Nv(t,n),l=function(u){var d=u.signal;return fk(t,n,d)};return Se({queryKey:a,queryFn:l,enabled:!!(t&&n)},o)};function _c(e,t,n,r){var i=hk(e,t,n),s=hr(i,r);return s.queryKey=i.queryKey,s}var gk=function(t,n){return bt({url:"/brands/".concat(t,"/analysis/").concat(n),method:"DELETE"})},yk=function(t){var n=["deleteSingleAnalysis"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:Se(Se({},t),{},{mutation:Se(Se({},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 gk(c,u)};return Se({mutationFn:s},i)},mk=function(t,n){var r=yk(t);return Vr(r,n)},pk=function(t,n,r){return bt({url:"/brands/".concat(t,"/analysis/").concat(n,"/status"),method:"GET",signal:r})},vk=function(t,n){return["/brands/".concat(t,"/analysis/").concat(n,"/status")]},bk=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:vk(t,n),l=function(u){var d=u.signal;return pk(t,n,d)};return Se({queryKey:a,queryFn:l,enabled:!!(t&&n)},o)};function xk(e,t,n,r){var i=bk(e,t,n),s=hr(i,r);return s.queryKey=i.queryKey,s}var wk=function(t){return bt({url:"/users/logout",method:"POST",signal:t})},Sk=function(t){var n=["logout"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:Se(Se({},t),{},{mutation:Se(Se({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(){return wk()};return Se({mutationFn:s},i)},Ck=function(t,n){var r=Sk(t);return Vr(r,n)},_k=function(t,n){return bt({url:"/brands/".concat(t,"/associated-brands"),method:"GET",signal:n})},ff=function(t){return["/brands/".concat(t,"/associated-brands")]},kk=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:ff(t),a=function(c){var u=c.signal;return _k(t,u)};return Se({queryKey:o,queryFn:a,enabled:!!t},s)};function Ok(e,t,n){var r=kk(e,t),i=hr(r,n);return i.queryKey=r.queryKey,i}var Ek=function(t,n,r){return bt({url:"/brands/".concat(t,"/associated-brand-groups"),method:"POST",headers:{"Content-Type":"application/json"},data:n,signal:r})},Ak=function(t){var n=["createBrandAssociationGroup"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:Se(Se({},t),{},{mutation:Se(Se({},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 Ek(c,u)};return Se({mutationFn:s},i)},Fv=function(t,n){var r=Ak(t);return Vr(r,n)},Pk=function(t){return bt({url:"/brands",method:"GET",signal:t})},nr=function(){return["/brands"]},Tk=function(t){var n,r=t!=null?t:{},i=r.query,s=(n=i==null?void 0:i.queryKey)!==null&&n!==void 0?n:nr(),o=function(l){var c=l.signal;return Pk(c)};return Se({queryKey:s,queryFn:o},i)};function Ri(e,t){var n=Tk(e),r=hr(n,t);return r.queryKey=n.queryKey,r}var jk=function(t,n){return bt({url:"/brands",method:"POST",headers:{"Content-Type":"application/json"},data:t,signal:n})},$k=function(t){var n=["createBrand"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:Se(Se({},t),{},{mutation:Se(Se({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},c=l.data;return jk(c)};return Se({mutationFn:s},i)},Mk=function(t,n){var r=$k(t);return Vr(r,n)},Dk=function(t,n){return bt({url:"/brands/".concat(t),method:"GET",signal:n})},hf=function(t){return["/brands/".concat(t)]},Lk=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:hf(t),a=function(c){var u=c.signal;return Dk(t,u)};return Se({queryKey:o,queryFn:a,enabled:!!t},s)};function Bv(e,t,n){var r=Lk(e,t),i=hr(r,n);return i.queryKey=r.queryKey,i}var Ik=function(t){return bt({url:"/brands/".concat(t),method:"DELETE"})},Rk=function(t){var n=["deleteBrand"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:Se(Se({},t),{},{mutation:Se(Se({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},c=l.brandId;return Ik(c)};return Se({mutationFn:s},i)},Nk=function(t,n){var r=Rk(t);return Vr(r,n)},Fk=function(t,n){return bt({url:"/brands/".concat(t,"/settings"),method:"PATCH",headers:{"Content-Type":"application/json"},data:n})},Bk=function(t){var n=["updateBrandSettings"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:Se(Se({},t),{},{mutation:Se(Se({},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 Fk(c,u)};return Se({mutationFn:s},i)},qv=function(t,n){var r=Bk(t);return Vr(r,n)},qk=function(t,n){return bt({url:"/brands/".concat(t,"/queries"),method:"GET",signal:n})},zk=function(t){return["/brands/".concat(t,"/queries")]},Hk=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:zk(t),a=function(c){var u=c.signal;return qk(t,u)};return Se({queryKey:o,queryFn:a,enabled:!!t},s)};function Kk(e,t,n){var r=Hk(e,t),i=hr(r,n);return i.queryKey=r.queryKey,i}var Uk=function(t,n){return bt({url:"/brands/".concat(t,"/queries"),method:"PUT",headers:{"Content-Type":"application/json"},data:n})},Wk=function(t){var n=["updateBrandQueries"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:Se(Se({},t),{},{mutation:Se(Se({},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 Uk(c,u)};return Se({mutationFn:s},i)},Vk=function(t,n){var r=Wk(t);return Vr(r,n)},Gk=function(t,n){return bt({url:"/brands/".concat(t,"/query-suggestions"),method:"GET",signal:n})},Qk=function(t){return["/brands/".concat(t,"/query-suggestions")]},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 Se({queryKey:o,queryFn:a,enabled:!!t},s)};function Xk(e,t,n){var r=Yk(e,t),i=hr(r,n);return i.queryKey=r.queryKey,i}var Jk=function(t){return bt({url:"/users/current",method:"GET",signal:t})},gf=function(){return["/users/current"]},Zk=function(t){var n,r=t!=null?t:{},i=r.query,s=(n=i==null?void 0:i.queryKey)!==null&&n!==void 0?n:gf(),o=function(l){var c=l.signal;return Jk(c)};return Se({queryKey:s,queryFn:o},i)};function kc(e,t){var n=Zk(e),r=hr(n,t);return r.queryKey=n.queryKey,r}var eO=function(){return bt({url:"/users/data",method:"DELETE"})},tO=function(t){var n=["deleteUserData"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:Se(Se({},t),{},{mutation:Se(Se({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(){return eO()};return Se({mutationFn:s},i)},nO=function(t,n){var r=tO(t);return Vr(r,n)},zv=z.createContext(void 0),rO=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=Va("/brands/:brandId"),v=Va("/brands/:brandId/*"),b=Va("/brands/:brandId/analysis/:analysisId"),w=Va("/brands/:brandId/analysis/:analysisId/*"),C=(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,k=z.useMemo(function(){return{brandId:C||d||"",analysisId:x||f||"latest",model:h||"openai",hostAppProps:m}},[C,d,x,f,h,m]),S=z.useMemo(function(){return{data:k}},[k]);return y.jsx(zv.Provider,{value:S,children:u})},Hv=z.createContext(void 0),iO=function(t){var n=t.children,r=t.setBrandId,i=t.setAnalysisId,s=t.setModel,o=z.useCallback(function(d){r(d),i("latest")},[r,i]),a=z.useCallback(function(d){i(d)},[i]),l=z.useCallback(function(d){s(d)},[s]),c=z.useMemo(function(){return{setBrandId:o,setAnalysisId:a,setModel:l}},[o,a,l]),u=z.useMemo(function(){return{mutations:c}},[c]);return y.jsx(Hv.Provider,{value:u,children:n})};function iu(e,t){return lO(e)||aO(e,t)||oO(e,t)||sO()}function sO(){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 oO(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 aO(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 lO(e){if(Array.isArray(e))return e}var cO=function(t){var n=t.children,r=t.hostAppProps,i=r===void 0?{}:r,s=z.useState(void 0),o=iu(s,2),a=o[0],l=o[1],c=z.useState("latest"),u=iu(c,2),d=u[0],f=u[1],h=z.useState(void 0),g=iu(h,2),m=g[0],p=g[1];return y.jsx(iO,{brandId:a,setBrandId:l,analysisId:d,setAnalysisId:f,model:m,setModel:p,children:y.jsx(rO,{brandId:a,analysisId:d,model:m,hostAppProps:i,children:n})})},En=function(){var t=z.useContext(zv);if(t===void 0)throw new Error("useBrandAnalysisData must be used within a BrandAnalysisDataProvider");return t.data},Oc=function(){var t=z.useContext(Hv);if(t===void 0)throw new Error("useBrandAnalysisMutations must be used within a BrandAnalysisMutationsProvider");return t.mutations},su={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 ug;function cO(){return ug||(ug=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})()}(su)),su.exports}var uO=cO();const _e=Yp(uO);var dO=function(t){return Sk({mutation:{onSettled:function(){t&&t()}}})};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:"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 hO=M.forwardRef(fO);function gO(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 yO=M.forwardRef(gO);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:"M15 19l-7-7 7-7"}))}const pO=M.forwardRef(mO);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:"M9 5l7 7-7 7"}))}const bO=M.forwardRef(vO);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:"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 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:"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 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:"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 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:"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 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:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 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.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 Hv=M.forwardRef(TO);function jO(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 Kv=M.forwardRef(jO);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:"M7 12l3-3 3 3 4-4M8 21l4-4 4 4M3 4h18M4 4h16v12a1 1 0 01-1 1H5a1 1 0 01-1-1V4z"}))}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:"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 LO=M.forwardRef(DO);function IO(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 RO=M.forwardRef(IO);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:"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 yf=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:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"}))}const BO=M.forwardRef(FO);var qO=function(){return[{label:"Brand analysis",href:"/",Icon:$O,isActive:function(n){return n.startsWith("/setup")||n==="/"},showInMenu:!0},{label:"Settings",href:"/settings",Icon:wO,isActive:function(n){return n.startsWith("/settings")},showInMenu:!0}]},dg;function zO(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var fg=function(t){var n=t.className,r=Bt(),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:Vr,label:y.jsxs(y.Fragment,{children:[y.jsx(o.Icon,{className:_e(dg||(dg=zO(["yst-sidebar-navigation__icon yst-h-6 yst-w-6"])))}),o.label]})},o.label)})})})})};const HO="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 KO(e,t){return GO(e)||WO(e,t)||VO(e,t)||UO()}function UO(){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 VO(e,t){if(e){if(typeof e=="string")return hg(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)?hg(e,t):void 0}}function hg(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 WO(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 GO(e){if(Array.isArray(e))return e}var QO=function(t){var n=t.className,r=Bt(),i=r.pathname,s=En(),o=s.hostAppProps,a=o.onLogout,l=z.useState(!1),c=KO(l,2),u=c[0],d=c[1],f=kc({query:{select:function(C){var x=C.data;return x==null?void 0:x.data}}}),h=f.data,g=f.isLoading,m=dO(a),p=m.mutate,v=m.isPending,b=function(C){if(C.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(A.SidebarNavigation,{activePath:i,children:y.jsx(A.SidebarNavigation.Mobile,{closeButtonScreenReaderText:"Close sidebar",openButtonScreenReaderText:"Open sidebar",children:y.jsx(fg,{})})})}),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(A.Title,{children:y.jsx(Vr,{className:_e("yst-outline-none"),to:"/",children:y.jsx("img",{src:HO,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(A.SkeletonLoader,{children:"Display name"})})}),y.jsx("div",{children:(h==null?void 0:h.email)||y.jsx(A.SkeletonLoader,{children:"loading-email@address.com"})}),y.jsx("div",{children:y.jsx(A.Link,{variant:"primary",className:"yst-no-underline",onClick:b,children:g?y.jsxs(A.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(A.SidebarNavigation,{activePath:i,children:y.jsx(fg,{className:n})})})]})},Uv=zx.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);}"]);Uv.defaultProps={href:"#content"};function ou(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(Uv,{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(QO,{}),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 pd(){/*! 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 Ut(b,"_invoke",function(w,C,x){var k,S,_,O=0,E=x||[],T=!1,D={p:0,n:0,v:e,a:W,f:W.bind(e,4),d:function(L,$){return k=L,S=0,_=e,D.n=$,o}};function W(N,L){for(S=N,_=L,t=0;!T&&O&&!$&&t<E.length;t++){var $,I=E[t],oe=D.p,ue=I[2];N>3?($=ue===L)&&(_=I[(S=I[4])?5:(S=3,3)],I[4]=I[5]=e):I[0]<=oe&&(($=N<2&&oe<I[1])?(S=0,D.v=L,D.n=I[1]):oe<ue&&($=N<3||I[0]>L||L>ue)&&(I[4]=N,I[5]=L,D.n=ue,S=0))}if($||N>1)return o;throw T=!0,L}return function(N,L,$){if(O>1)throw TypeError("Generator is already running");for(T&&L===1&&W(L,$),S=L,_=$;(t=S<2?e:_)||!T;){k||(S?S<3?(S>1&&(D.n=-1),W(S,_)):D.n=_:D.v=_);try{if(O=2,k){if(S||(N="next"),t=k[N]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,S<2&&(S=0)}else S===1&&(t=k.return)&&t.call(k),S<2&&(_=TypeError("The iterator does not provide a '"+N+"' method"),S=1);k=e}else if((t=(T=D.n<0)?_:w.call(C,D))!==o)break}catch(I){k=e,S=1,_=I}finally{O=1}}return{value:t,done:T}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Ut(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,Ut(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=c,Ut(d,"constructor",c),Ut(c,"constructor",l),l.displayName="GeneratorFunction",Ut(c,i,"GeneratorFunction"),Ut(d),Ut(d,i,"Generator"),Ut(d,r,function(){return this}),Ut(d,"toString",function(){return"[object Generator]"}),(pd=function(){return{w:s,m:f}})()}function Ut(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Ut=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){Ut(o,f,function(g){return this._invoke(f,h,g)})};u("next",0),u("throw",1),u("return",2)}},Ut(e,t,n,r)}function gg(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 YO(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){gg(s,r,i,o,a,"next",l)}function a(l){gg(s,r,i,o,a,"throw",l)}o(void 0)})}}function XO(e,t){return tE(e)||eE(e,t)||ZO(e,t)||JO()}function JO(){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 ZO(e,t){if(e){if(typeof e=="string")return yg(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)?yg(e,t):void 0}}function yg(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 eE(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 tE(e){if(Array.isArray(e))return e}var nE=function(t){var n,r,i=t.className,s=qt(),o=gn(),a=z.useState(!1),l=XO(a,2),c=l[0],u=l[1],d=Ri({query:{select:function(k){var S=k.data;return S==null?void 0:S.brands}}}),f=d.data,h=Bv({mutation:{onSettled:function(){s.invalidateQueries({queryKey:[nr()]})}}}),g=h.mutateAsync,m=h.isPending,p=(n=f==null?void 0:f.filter(function(x){var k;return((k=x.settings)===null||k===void 0?void 0:k.showAutomaticAnalysisDisabledNotification)===!0}))!==null&&n!==void 0?n:[],v=function(){u(!1)},b=function(){var x=YO(pd().m(function k(){var S;return pd().w(function(_){for(;;)switch(_.n){case 0:if(p.length!==0){_.n=1;break}return _.a(2);case 1:return S=p.map(function(O){return g({brandId:String(O.id),data:{showAutomaticAnalysisDisabledNotification:!1}})}),_.n=2,Promise.all(S);case 2:o("/settings"),v();case 3:return _.a(2)}},k)}));return function(){return x.apply(this,arguments)}}();z.useEffect(function(){f&&f.some(function(x){var k;return((k=x.settings)===null||k===void 0?void 0:k.showAutomaticAnalysisDisabledNotification)===!0})&&u(!0)},[f]);var w=p.length===1?"One brand has been deactivated":"Multiple brands have been deactivated",C=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:v,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:C})]})}),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:v,children:"Close"}),y.jsx(A.Button,{variant:"primary",onClick:b,isLoading:m,disabled:p.length===0,children:"Go to settings"})]})]})}):null};function mf(e){var t=e.children,n=e.description,r=e.title;return y.jsxs(A.Paper.Header,{children:[r&&y.jsx(A.Title,{className:_e({"yst-mb-3":n||t}),children:r}),n&&(typeof n=="string"?y.jsx("p",{children:n}):n),t]})}var rE={HOME:"/"},iE=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=Bt(),l=gn(),c={disable:s,hideNav:r},u=En(),d=u.brandId,f=Oc(),h=f.setBrandId,g=Ri({query:{refetchOnReconnect:!1,refetchOnWindowFocus:!1,select:function(_){var O;return _==null||(O=_.data)===null||O===void 0?void 0:O.brands}}}),m=g.data,p=g.isLoading,v=g.error,b=g.refetch,w=z.useRef(!1),C=z.useMemo(function(){return m==null?void 0:m.find(function(S){return S.id===d})},[m,d]);z.useEffect(function(){var S;if(!(m===void 0||d)){var _=(S=m[0])===null||S===void 0?void 0:S.id;_&&h(_)}},[m,d,h,l,a.pathname]),z.useEffect(function(){!d||w.current||(w.current=!0)},[C,d,l,a.pathname,m]);var x=z.useCallback(function(){b()},[b]),k=["Loading your brands...","Preparing your dashboard...","Checking analysis status...","Almost ready!"];return a.pathname!==rE.HOME&&p?y.jsx(ou,{...c,children:y.jsxs(A.Paper,{className:"yst-mx-auto yst-max-w-2xl",children:[y.jsx(mf,{title:y.jsx(A.SkeletonLoader,{className:"yst-h-12 yst-w-36"}),description:y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-3/4"})}),y.jsx(A.Paper.Content,{children:y.jsx("div",{className:"yst-flex yst-min-h-screen yst-items-start yst-justify-center",children:y.jsx("div",{className:"yst-w-full yst-space-y-4",children:y.jsx("div",{className:"yst-space-y-4",children:k.map(function(S,_){return y.jsx(A.SkeletonLoader,{children:S},_)})})})})})]})}):v?y.jsx(ou,{...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(ou,{DebugInfo:o,...c,children:[y.jsx(Ts,{}),y.jsx(nE,{})]})},Vv=function(){return y.jsx(A.Paper,{children: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"})]})})})},sE=function(){var t=Zd(),n=t.brandId,r=t.analysisId,i=Iv(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(Vv,{});if(a)return console.error("Error fetching analyses for validation:",a),y.jsx(ai,{to:"/brands/".concat(n),replace:!0});if(!r||r.trim()==="")return y.jsx(ai,{to:"/brands/".concat(n),replace:!0});if(r==="latest")return y.jsx(Ts,{});var l=parseInt(r,10);if(isNaN(l))return y.jsx(ai,{to:"/brands/".concat(n),replace:!0});var c=s==null?void 0:s.some(function(u){return u.id===l});return c?y.jsx(Ts,{}):y.jsx(ai,{to:"/brands/".concat(n),replace:!0})},mg=function(){var t=Zd(),n=t.brandId,r=Ri({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(Vv,{});if(o)return y.jsx(ai,{to:"/",replace:!0});if(!n||n.trim()==="")return y.jsx(ai,{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(ai,{to:"/",replace:!0}):y.jsx(Ts,{})},Jr={pending:"pending",processing:"processing",completed:"completed",failed:"failed",cancelled:"cancelled"};function oE(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 aE(e,t){var n=oE(e);return n!==void 0&&n>t*60*1e3}function lE(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)}function cE(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 Wv=M.forwardRef(cE);function uE(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 dE=M.forwardRef(uE);function fE(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 Gv=M.forwardRef(fE);function hE(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 Qv=M.forwardRef(hE);function gE(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 yE=M.forwardRef(gE);function mE(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 pE=M.forwardRef(mE);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",{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 pg=M.forwardRef(vE);function bE(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 xE=M.forwardRef(bE);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:"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 SE=M.forwardRef(wE);function CE(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 _E=M.forwardRef(CE);function Qo(e){"@babel/helpers - typeof";return Qo=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},Qo(e)}var kE=["children","as","startColor","endColor","angle","disabled","style","className"];function vg(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 bg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vg(Object(n),!0).forEach(function(r){OE(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function OE(e,t,n){return(t=EE(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EE(e){var t=AE(e,"string");return Qo(t)=="symbol"?t:t+""}function AE(e,t){if(Qo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Qo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function PE(e,t){if(e==null)return{};var n,r,i=TE(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 TE(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 Ec=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=PE(t,kE),b=bg(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 pf(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 jE=function(){var t=gn();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(Ec,{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 and Perplexity."]}),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",{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(pf,{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(dE,{})]})})]})})};function Yo(e){return typeof e!="number"?{}:{"yst-text-green-600":e>0,"yst-text-red-600":e<0,"yst-text-gray-400":e===0}}function Ma(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",Yo(c)),children:[c>-1&&"+",c,d==="percentage"&&"%"," ",f]})]})}var ME=["Icon","className","children","position","id"];function $E(e,t){return RE(e)||IE(e,t)||LE(e,t)||DE()}function DE(){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 LE(e,t){if(e){if(typeof e=="string")return xg(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)?xg(e,t):void 0}}function xg(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 IE(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 RE(e){if(Array.isArray(e))return e}function NE(e,t){if(e==null)return{};var n,r,i=FE(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 FE(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 vf(e){var t=e.Icon,n=t===void 0?PO: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=NE(e,ME),d=z.useState(!1),f=$E(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(A.Tooltip,{position:a,id:c||"tooltip-button",children:s})]}):null}var $a=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(A.Title,{size:s,children:n}),y.jsx(vf,{id:c,children:r})]})},wg=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(A.Badge,{className:r,children:i},s)})})},Yv=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(A.Card,{className:"yst-overflow-visible",children:y.jsxs(A.Card.Content,{className:"yst-space-y-8",children:[y.jsx($a,{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(A.SkeletonLoader,{className:"yst-h-6 yst-w-20"})}),y.jsxs("div",{children:[y.jsx("div",{className:"yst-inline-flex",children:y.jsx(Ma,{className:"yst-mb-1.5",score:f,scoreFormat:"percentage",suffix:"positive",delta:h})}),y.jsx(A.ProgressBar,{max:100,min:0,progress:f||0,className:_e({"yst-bg-red-500":f},"[&>*]:yst-bg-green-500")})]})]})}),p&&y.jsx(A.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(A.Title,{as:"h5",size:"5",children:"Positive keywords"}),y.jsx(wg,{keywords:g,badgeClassName:"yst-bg-green-100 yst-text-green-800"})]}),!!m&&y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(A.Title,{as:"h5",size:"5",children:"Negative keywords"}),y.jsx(wg,{keywords:m,badgeClassName:"yst-bg-red-100 yst-text-red-800"})]})]})})};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)}var BE=["data"];function Sg(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?Sg(Object(n),!0).forEach(function(r){zE(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zE(e,t,n){return(t=HE(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HE(e){var t=KE(e,"string");return Xo(t)=="symbol"?t:t+""}function KE(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)}function UE(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}var Us=function(t,n,r){var i=En(),s=i.brandId,o=i.analysisId,a=i.model,l=s,c=o,u=a,d=_c(l,c,{query:{enabled:!!l&&!!c,select:function(p){var v=p.data;return v==null?void 0:v.analysis}}}),f=d.data,h=UE(d,BE),g=z.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 WE(){var e,t=Us(),n=t.data;return y.jsx(Yv,{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 GE=["children","as","className"];function QE(e,t){if(e==null)return{};var n,r,i=YE(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 YE(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 Da=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=QE(o,GE);return y.jsx(c,{className:_e(String(s).trim(),d),...f,children:a})}},au=[{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"}],Cg=function(t){if(!t)return au[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)%au.length;return au[s]};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 _g;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 Og(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){XE(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 XE(e,t,n){return(t=JE(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JE(e){var t=ZE(e,"string");return Jo(t)=="symbol"?t:t+""}function ZE(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 eA(e){return rA(e)||nA(e)||Xv(e)||tA()}function tA(){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 nA(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function rA(e){if(Array.isArray(e))return vd(e)}function Eg(e,t){return oA(e)||sA(e,t)||Xv(e,t)||iA()}function iA(){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 Xv(e,t){if(e){if(typeof e=="string")return vd(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)?vd(e,t):void 0}}function vd(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 sA(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 oA(e){if(Array.isArray(e))return e}function aA(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var oo=Da(_g||(_g=aA(["md:yst-hidden yst-mr-2 yst-font-medium yst-text-slate-400 yst-inline-flex yst-w-20"]))),Ag=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(A.Table.Cell,{className:"yst-ml-2 yst-py-1 md:yst-ml-0 md:yst-p-2",children:[y.jsx(oo,{as:"span",children:"Rank:"}),l?y.jsx(A.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(A.Table.Cell,{className:"yst-ml-2 yst-py-1 md:yst-ml-0 md:yst-p-2",children:l?y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-full"}):y.jsx("div",{className:"yst-flex yst-items-center yst-gap-2",children:y.jsxs(A.Link,{className:"yst-flex yst-items-center yst-gap-1 yst-font-medium",href:d||"#",rel:"nofollow noreferrer",children:[y.jsx("span",{children:d!=null?d:"—"})," ",y.jsx(xE,{})]})})}),y.jsxs(A.Table.Cell,{className:"yst-ml-2 yst-py-1 yst-font-medium md:yst-ml-0 md:yst-p-2",children:[y.jsx(oo,{as:"span",children:"Domain:"}),l?y.jsx(A.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(A.Table.Cell,{className:"yst-ml-2 yst-py-1 md:yst-ml-0 md:yst-p-2",children:[y.jsx(oo,{as:"span",children:"Category:"}),l?y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-16"}):y.jsx(A.Badge,{className:_e(Cg(h||"").bg,Cg(h||"").text),children:h!=null?h:"—"})]}),y.jsxs(A.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(oo,{as:"span",children:"Impact:"}),l?y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-12"}):g!=null?g:"—"]}),y.jsxs(A.Table.Cell,{className:"yst-ml-2 yst-pt-1 md:yst-ml-0 md:yst-p-2 md:yst-text-right",children:[y.jsx(oo,{as:"span",children:"Mentions:"}),l?y.jsx(A.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",Yo(b)),children:[b>-1&&"+",b]})]}):"—"]})]},l?void 0:d)},lA=function(){var t,n,r,i,s,o=z.useState("all"),a=Eg(o,2),l=a[0],c=a[1],u=z.useState(1),d=Eg(u,2),f=d[0],h=d[1],g=Us(),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)||{},C=Object.hasOwn(w,"previous"),x=b==null||(n=b.list)===null||n===void 0?void 0:n.filter(function(D){return l==="all"?!0:D.category===l}),k=10,S=(x==null?void 0:x.length)||0,_=Math.ceil(S/k),O=(f-1)*k,E=O+k,T=x==null?void 0:x.slice(O,E);return z.useEffect(function(){f>_&&_>0&&h(1)},[_,f,h,l]),y.jsx(A.Card,{className:"yst-overflow-visible md:yst-col-span-2",children:y.jsxs(A.Card.Content,{className:"yst-flex yst-flex-col yst-gap-6",children:[y.jsxs("div",{className:"yst-space-y-4",children:[y.jsx($a,{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(Ma,{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(A.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(A.Select,{className:"yst-mb-4 md:yst-max-w-sm",label:"Filter categories",value:l,onChange:function(D){c(D)},id:"citation-category-filter",options:[{value:"all",label:"All categories"}].concat(eA(b!=null&&b.categories?b.categories.map(function(D){return{value:D,label:D}}):[]))}),y.jsxs(A.Table,{variant:"minimal",children:[y.jsx(A.Table.Head,{className:"yst-font-semibold",children:y.jsxs(A.Table.Row,{children:[y.jsx(A.Table.Cell,{className:"yst-hidden yst-text-slate-900 md:yst-table-cell md:yst-pl-2",children:"#"}),y.jsx(A.Table.Cell,{className:"yst yst-hidden yst-text-slate-900 md:yst-table-cell md:yst-px-2",children:"URL"}),y.jsx(A.Table.Cell,{className:"yst-hidden yst-text-slate-900 md:yst-table-cell md:yst-px-2",children:"Root domain"}),y.jsx(A.Table.Cell,{className:"yst-hidden yst-text-slate-900 md:yst-table-cell",children:"Category"}),y.jsx(A.Table.Cell,{className:"yst-hidden yst-text-slate-900 md:yst-table-cell md:yst-px-2",children:"Impact"}),y.jsx(A.Table.Cell,{className:"yst-hidden yst-text-right yst-text-slate-900 md:yst-table-cell",children:"Mentions"})]})}),y.jsx(A.Table.Body,{children:p||v?Array.from({length:5}).map(function(D,W){return y.jsx(Ag,{isLoading:!0},"skeleton-".concat(W))}):T&&T.length>0?T.map(function(D,W){return y.jsx(Ag,{data:Og(Og({},D),{},{rank:O+W+1}),totalQueries:m==null?void 0:m.numberOfQueries,isFirstScan:!C},"citation-table-row-".concat(D.url,"-").concat(W))}):y.jsx(A.Table.Row,{children:y.jsxs(A.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(A.Link,{onClick:function(){return c("all")},children:"Show all categories."})]})},"no-results")})]})]}),x&&x.length>k&&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 ",O+1," to"," ",E>S?S:E," of"," ",S," results"]}),y.jsx(A.Pagination,{variant:"text",className:"yst-flex-row yst-gap-0",current:f,total:_,onNavigate:h,screenReaderTextPrevious:"Previous page",screenReaderTextNext:"Next page"})]})]})]})})};function cA(e,t){return hA(e)||fA(e,t)||dA(e,t)||uA()}function uA(){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 dA(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 fA(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 hA(e){if(Array.isArray(e))return e}var Tg=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(A.Table.Row,{children:[y.jsx(A.Table.Cell,{children:c?y.jsx(A.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",Yo(h&&typeof g=="number"?g:0)),children:h&&typeof g=="number"?y.jsxs(y.Fragment,{children:[Math.abs(g),g>0?y.jsx(pE,{className:"yst-h-4 yst-w-4"}):y.jsx(yE,{className:"yst-h-4 yst-w-4"})]}):y.jsx(pg,{className:"yst-mx-1 yst-h-4 yst-w-4"})})]})}),y.jsx(A.Table.Cell,{children:c?y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-24"}):y.jsx("span",{className:"yst-font-medium",children:f!=null&&f.isSelf?y.jsx(Ec,{children:f==null?void 0:f.name}):(n=f==null?void 0:f.name)!==null&&n!==void 0?n:"—"})}),y.jsx(A.Table.Cell,{children:c?y.jsx(A.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",Yo(p&&typeof v=="number"?v:0)),children:p&&typeof v=="number"?y.jsxs(y.Fragment,{children:[v>-1&&"+",v]}):y.jsx(pg,{className:"yst-h-4 yst-w-4"})})]})})]},c||d==null?void 0:d.value)},gA=function(t){var n,r,i=t.className,s=z.useRef(null),o=z.useState(1),a=cA(o,2),l=a[0],c=a[1],u=Us(),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),C=(l-1)*v,x=C+v,k=g==null?void 0:g.slice(C,x);return z.useEffect(function(){l>w&&w>0&&c(1)},[w,l,c]),y.jsx(A.Card,{ref:s,className:_e("yst-overflow-visible",i),children:y.jsxs(A.Card.Content,{className:"yst-mt-0 yst-space-y-6",children:[y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx($a,{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(A.Alert,{variant:"info",children:"The selected AI model returned no brands for your queries. This can happen with some queries or models."}):y.jsxs(A.Table,{variant:"minimal",children:[y.jsx(A.Table.Head,{children:y.jsxs(A.Table.Row,{children:[y.jsx(A.Table.Cell,{className:"yst-w-20 yst-font-semibold",children:"Rank"}),y.jsx(A.Table.Cell,{className:"yst-font-semibold",children:"Brand"}),y.jsx(A.Table.Cell,{className:"yst-w-20 yst-text-right yst-font-semibold",children:"Mentions"})]})}),y.jsx(A.Table.Body,{children:k&&Array.isArray(k)&&k.length>0?k.map(function(S){var _;return y.jsx(Tg,{data:S,totalQueries:d==null?void 0:d.numberOfQueries,isFirstScan:!p},"rank-row-".concat((_=S.rank)===null||_===void 0?void 0:_.value))}):f||h?Array.from({length:v}).map(function(S,_){return y.jsx(Tg,{isLoading:!0},"skeleton-".concat(_))}):null})]}),!f&&!h&&g&&g.length>v&&y.jsx(A.Pagination,{current:l,total:w,className:"yst-flex-row",onNavigate:c,screenReaderTextNext:"Next",screenReaderTextPrevious:"Previous",variant:"text"})]})})},yA=function(){var t,n=Us(),r=n.data,i=r==null||(t=r.sentiment)===null||t===void 0?void 0:t.topCompetitor;return y.jsx(Yv,{title:"Competitor sentiment",data:i,tooltip:"Percentage of positive versus negative keywords in your query results related to your competitor's brand."})},mA=function(t){var n=t.brand,r=gn(),i=Oc(),s=i.setBrandId;return(n==null?void 0:n.setupStatus)==="pendingQuerySelection"?y.jsx(A.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(A.Link,{onClick:function(){n.id?(s(n.id),r("/setup/".concat(n.id,"/queries"))):console.error("Brand ID is missing.")},children:"Review queries"})})]})}):null},bf=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(A.Modal,{isOpen:n,onClose:r,position:"center",as:"div",className:m,children:y.jsxs(A.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(EO,{className:"yst-h-6 yst-w-6 yst-text-red-600"})})}),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:a})}),y.jsx(A.Modal.Container.Content,{className:"yst-mb-4 yst-space-y-3",children:typeof l=="string"?y.jsx("p",{children:l}):l})]})]}),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:r,children:g}),y.jsx(A.Button,{variant:"error",onClick:i,isLoading:o,disabled:u,children:f})]})]})})},Za={exports:{}},el={exports:{}},He={};/** @license React v16.13.1
22
+ */var ug;function uO(){return ug||(ug=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})()}(su)),su.exports}var dO=uO();const Ce=Xp(dO);var fO=function(t){return Ck({mutation:{onSettled:function(){t&&t()}}})};function hO(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 gO=$.forwardRef(hO);function yO(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 mO=$.forwardRef(yO);function pO(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 vO=$.forwardRef(pO);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:"M9 5l7 7-7 7"}))}const xO=$.forwardRef(bO);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:"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 SO=$.forwardRef(wO);function CO(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 _O=$.forwardRef(CO);function kO(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 OO=$.forwardRef(kO);function EO(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 AO=$.forwardRef(EO);function PO(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 TO=$.forwardRef(PO);function jO(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 Kv=$.forwardRef(jO);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:"M12 4v16m8-8H4"}))}const Uv=$.forwardRef($O);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:"M7 12l3-3 3 3 4-4M8 21l4-4 4 4M3 4h18M4 4h16v12a1 1 0 01-1 1H5a1 1 0 01-1-1V4z"}))}const DO=$.forwardRef(MO);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:"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 IO=$.forwardRef(LO);function RO(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 NO=$.forwardRef(RO);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:"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 yf=$.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:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"}))}const qO=$.forwardRef(BO);var zO=function(){return[{label:"Brand analysis",href:"/",Icon:DO,isActive:function(n){return n.startsWith("/setup")||n==="/"},showInMenu:!0},{label:"Settings",href:"/settings",Icon:SO,isActive:function(n){return n.startsWith("/settings")},showInMenu:!0}]},dg;function HO(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var fg=function(t){var n=t.className,r=Bt(),i=r.pathname,s=zO();return y.jsx("div",{className:Ce("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:Ce("yst-flex yst-gap-x-3",{"yst-sidebar-navigation__item--active":a}),href:o.href,to:o.href,as:Wr,label:y.jsxs(y.Fragment,{children:[y.jsx(o.Icon,{className:Ce(dg||(dg=HO(["yst-sidebar-navigation__icon yst-h-6 yst-w-6"])))}),o.label]})},o.label)})})})})};const KO="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 UO(e,t){return QO(e)||GO(e,t)||VO(e,t)||WO()}function WO(){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 VO(e,t){if(e){if(typeof e=="string")return hg(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)?hg(e,t):void 0}}function hg(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 QO(e){if(Array.isArray(e))return e}var YO=function(t){var n=t.className,r=Bt(),i=r.pathname,s=En(),o=s.hostAppProps,a=o.onLogout,l=z.useState(!1),c=UO(l,2),u=c[0],d=c[1],f=kc({query:{select:function(C){var x=C.data;return x==null?void 0:x.data}}}),h=f.data,g=f.isLoading,m=fO(a),p=m.mutate,v=m.isPending,b=function(C){if(C.preventDefault(),d(!0),!v)return p()};return y.jsxs("div",{className:Ce("ystaii-sidemenu"),children:[y.jsx("div",{className:"ystaii-mobile-menu lg:yst-hidden",children:y.jsx(A.SidebarNavigation,{activePath:i,children:y.jsx(A.SidebarNavigation.Mobile,{closeButtonScreenReaderText:"Close sidebar",openButtonScreenReaderText:"Open sidebar",children:y.jsx(fg,{})})})}),y.jsxs("div",{className:Ce("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(A.Title,{children:y.jsx(Wr,{className:Ce("yst-outline-none"),to:"/",children:y.jsx("img",{src:KO,alt:"Yoast",className:"yst-inline-block yst-h-8"})})}),y.jsxs("div",{className:Ce("ystaii-userInfoContainer","yst-flex yst-flex-col"),children:[y.jsx("div",{children:y.jsx("b",{children:(h==null?void 0:h.displayName)||y.jsx(A.SkeletonLoader,{children:"Display name"})})}),y.jsx("div",{children:(h==null?void 0:h.email)||y.jsx(A.SkeletonLoader,{children:"loading-email@address.com"})}),y.jsx("div",{children:y.jsx(A.Link,{variant:"primary",className:"yst-no-underline",onClick:b,children:g?y.jsxs(A.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:Ce("ystaii-desktopMenu","yst-hidden","lg:yst-mb-0 lg:yst-block lg:yst-w-full lg:yst-shrink-0"),children:y.jsx(A.SidebarNavigation,{activePath:i,children:y.jsx(fg,{className:n})})})]})},Wv=Hx.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);}"]);Wv.defaultProps={href:"#content"};function ou(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:Ce("ystaii-layout","yst-block","lg:yst-flex lg:yst-min-h-full lg:yst-overflow-visible"),children:[y.jsx(Wv,{children:"Skip to main content"}),!s&&y.jsxs("div",{className:Ce("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(YO,{}),o&&y.jsx(o,{})]}),y.jsx("main",{className:Ce("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:Ce("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 pd(){/*! 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 Ut(b,"_invoke",function(w,C,x){var k,S,_,O=0,E=x||[],T=!1,D={p:0,n:0,v:e,a:G,f:G.bind(e,4),d:function(L,M){return k=L,S=0,_=e,D.n=M,o}};function G(N,L){for(S=N,_=L,t=0;!T&&O&&!M&&t<E.length;t++){var M,I=E[t],oe=D.p,ue=I[2];N>3?(M=ue===L)&&(_=I[(S=I[4])?5:(S=3,3)],I[4]=I[5]=e):I[0]<=oe&&((M=N<2&&oe<I[1])?(S=0,D.v=L,D.n=I[1]):oe<ue&&(M=N<3||I[0]>L||L>ue)&&(I[4]=N,I[5]=L,D.n=ue,S=0))}if(M||N>1)return o;throw T=!0,L}return function(N,L,M){if(O>1)throw TypeError("Generator is already running");for(T&&L===1&&G(L,M),S=L,_=M;(t=S<2?e:_)||!T;){k||(S?S<3?(S>1&&(D.n=-1),G(S,_)):D.n=_:D.v=_);try{if(O=2,k){if(S||(N="next"),t=k[N]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,S<2&&(S=0)}else S===1&&(t=k.return)&&t.call(k),S<2&&(_=TypeError("The iterator does not provide a '"+N+"' method"),S=1);k=e}else if((t=(T=D.n<0)?_:w.call(C,D))!==o)break}catch(I){k=e,S=1,_=I}finally{O=1}}return{value:t,done:T}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Ut(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,Ut(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=c,Ut(d,"constructor",c),Ut(c,"constructor",l),l.displayName="GeneratorFunction",Ut(c,i,"GeneratorFunction"),Ut(d),Ut(d,i,"Generator"),Ut(d,r,function(){return this}),Ut(d,"toString",function(){return"[object Generator]"}),(pd=function(){return{w:s,m:f}})()}function Ut(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Ut=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){Ut(o,f,function(g){return this._invoke(f,h,g)})};u("next",0),u("throw",1),u("return",2)}},Ut(e,t,n,r)}function gg(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 XO(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){gg(s,r,i,o,a,"next",l)}function a(l){gg(s,r,i,o,a,"throw",l)}o(void 0)})}}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.
24
+ 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 yg(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)?yg(e,t):void 0}}function yg(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,r,i=t.className,s=qt(),o=gn(),a=z.useState(!1),l=JO(a,2),c=l[0],u=l[1],d=Ri({query:{select:function(k){var S=k.data;return S==null?void 0:S.brands}}}),f=d.data,h=qv({mutation:{onSettled:function(){s.invalidateQueries({queryKey:[nr()]})}}}),g=h.mutateAsync,m=h.isPending,p=(n=f==null?void 0:f.filter(function(x){var k;return((k=x.settings)===null||k===void 0?void 0:k.showAutomaticAnalysisDisabledNotification)===!0}))!==null&&n!==void 0?n:[],v=function(){u(!1)},b=function(){var x=XO(pd().m(function k(){var S;return pd().w(function(_){for(;;)switch(_.n){case 0:if(p.length!==0){_.n=1;break}return _.a(2);case 1:return S=p.map(function(O){return g({brandId:String(O.id),data:{showAutomaticAnalysisDisabledNotification:!1}})}),_.n=2,Promise.all(S);case 2:o("/settings"),v();case 3:return _.a(2)}},k)}));return function(){return x.apply(this,arguments)}}();z.useEffect(function(){f&&f.some(function(x){var k;return((k=x.settings)===null||k===void 0?void 0:k.showAutomaticAnalysisDisabledNotification)===!0})&&u(!0)},[f]);var w=p.length===1?"One brand has been deactivated":"Multiple brands have been deactivated",C=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:v,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:C})]})}),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:v,children:"Close"}),y.jsx(A.Button,{variant:"primary",onClick:b,isLoading:m,disabled:p.length===0,children:"Go to settings"})]})]})}):null};function mf(e){var t=e.children,n=e.description,r=e.title;return y.jsxs(A.Paper.Header,{children:[r&&y.jsx(A.Title,{className:Ce({"yst-mb-3":n||t}),children:r}),n&&(typeof n=="string"?y.jsx("p",{children:n}):n),t]})}var iE={HOME:"/"},sE=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=Bt(),l=gn(),c={disable:s,hideNav:r},u=En(),d=u.brandId,f=Oc(),h=f.setBrandId,g=Ri({query:{refetchOnReconnect:!1,refetchOnWindowFocus:!1,select:function(_){var O;return _==null||(O=_.data)===null||O===void 0?void 0:O.brands}}}),m=g.data,p=g.isLoading,v=g.error,b=g.refetch,w=z.useRef(!1),C=z.useMemo(function(){return m==null?void 0:m.find(function(S){return S.id===d})},[m,d]);z.useEffect(function(){var S;if(!(m===void 0||d)){var _=(S=m[0])===null||S===void 0?void 0:S.id;_&&h(_)}},[m,d,h,l,a.pathname]),z.useEffect(function(){!d||w.current||(w.current=!0)},[C,d,l,a.pathname,m]);var x=z.useCallback(function(){b()},[b]),k=["Loading your brands...","Preparing your dashboard...","Checking analysis status...","Almost ready!"];return a.pathname!==iE.HOME&&p?y.jsx(ou,{...c,children:y.jsxs(A.Paper,{className:"yst-mx-auto yst-max-w-2xl",children:[y.jsx(mf,{title:y.jsx(A.SkeletonLoader,{className:"yst-h-12 yst-w-36"}),description:y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-3/4"})}),y.jsx(A.Paper.Content,{children:y.jsx("div",{className:"yst-flex yst-min-h-screen yst-items-start yst-justify-center",children:y.jsx("div",{className:"yst-w-full yst-space-y-4",children:y.jsx("div",{className:"yst-space-y-4",children:k.map(function(S,_){return y.jsx(A.SkeletonLoader,{children:S},_)})})})})})]})}):v?y.jsx(ou,{...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(ou,{DebugInfo:o,...c,children:[y.jsx(Ts,{}),y.jsx(rE,{})]})},Vv=function(){return y.jsx(A.Paper,{children: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"})]})})})},oE=function(){var t=Zd(),n=t.brandId,r=t.analysisId,i=Rv(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(Vv,{});if(a)return console.error("Error fetching analyses for validation:",a),y.jsx(ai,{to:"/brands/".concat(n),replace:!0});if(!r||r.trim()==="")return y.jsx(ai,{to:"/brands/".concat(n),replace:!0});if(r==="latest")return y.jsx(Ts,{});var l=parseInt(r,10);if(isNaN(l))return y.jsx(ai,{to:"/brands/".concat(n),replace:!0});var c=s==null?void 0:s.some(function(u){return u.id===l});return c?y.jsx(Ts,{}):y.jsx(ai,{to:"/brands/".concat(n),replace:!0})},mg=function(){var t=Zd(),n=t.brandId,r=Ri({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(Vv,{});if(o)return y.jsx(ai,{to:"/",replace:!0});if(!n||n.trim()==="")return y.jsx(ai,{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(ai,{to:"/",replace:!0}):y.jsx(Ts,{})},Jr={pending:"pending",processing:"processing",completed:"completed",failed:"failed",cancelled:"cancelled"};function aE(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 lE(e,t){var n=aE(e);return n!==void 0&&n>t*60*1e3}function cE(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)}function uE(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 Gv=$.forwardRef(uE);function dE(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 fE=$.forwardRef(dE);function hE(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 Qv=$.forwardRef(hE);function gE(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 Yv=$.forwardRef(gE);function yE(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 mE=$.forwardRef(yE);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.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 vE=$.forwardRef(pE);function bE(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 pg=$.forwardRef(bE);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",{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 wE=$.forwardRef(xE);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:"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 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:"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 kE=$.forwardRef(_E);function Qo(e){"@babel/helpers - typeof";return Qo=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},Qo(e)}var OE=["children","as","startColor","endColor","angle","disabled","style","className"];function vg(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 bg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vg(Object(n),!0).forEach(function(r){EE(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function EE(e,t,n){return(t=AE(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AE(e){var t=PE(e,"string");return Qo(t)=="symbol"?t:t+""}function PE(e,t){if(Qo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Qo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function TE(e,t){if(e==null)return{};var n,r,i=jE(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 jE(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 Ec=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=TE(t,OE),b=bg(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 pf(e){var t=e.children,n=e.nestedInPaperContent,r=n===void 0?!1:n,i=e.className;return y.jsx("div",{className:Ce("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 $E=function(){var t=gn();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(Ec,{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 and Perplexity."]}),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",{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(pf,{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(fE,{})]})})]})})};function Yo(e){return typeof e!="number"?{}:{"yst-text-green-600":e>0,"yst-text-red-600":e<0,"yst-text-gray-400":e===0}}function $a(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:Ce(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:Ce("yst-ml-2",Yo(c)),children:[c>-1&&"+",c,d==="percentage"&&"%"," ",f]})]})}var ME=["Icon","className","children","position","id"];function DE(e,t){return NE(e)||RE(e,t)||IE(e,t)||LE()}function LE(){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 IE(e,t){if(e){if(typeof e=="string")return xg(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)?xg(e,t):void 0}}function xg(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 RE(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}function FE(e,t){if(e==null)return{};var n,r,i=BE(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 BE(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 vf(e){var t=e.Icon,n=t===void 0?TO: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=FE(e,ME),d=z.useState(!1),f=DE(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(A.Tooltip,{position:a,id:c||"tooltip-button",children:s})]}):null}var Ma=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(A.Title,{size:s,children:n}),y.jsx(vf,{id:c,children:r})]})},wg=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(A.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(A.Card,{className:"yst-overflow-visible",children:y.jsxs(A.Card.Content,{className:"yst-space-y-8",children:[y.jsx(Ma,{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(A.SkeletonLoader,{className:"yst-h-6 yst-w-20"})}),y.jsxs("div",{children:[y.jsx("div",{className:"yst-inline-flex",children:y.jsx($a,{className:"yst-mb-1.5",score:f,scoreFormat:"percentage",suffix:"positive",delta:h})}),y.jsx(A.ProgressBar,{max:100,min:0,progress:f||0,className:Ce({"yst-bg-red-500":f},"[&>*]:yst-bg-green-500")})]})]})}),p&&y.jsx(A.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(A.Title,{as:"h5",size:"5",children:"Positive keywords"}),y.jsx(wg,{keywords:g,badgeClassName:"yst-bg-green-100 yst-text-green-800"})]}),!!m&&y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(A.Title,{as:"h5",size:"5",children:"Negative keywords"}),y.jsx(wg,{keywords:m,badgeClassName:"yst-bg-red-100 yst-text-red-800"})]})]})})};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)}var qE=["data"];function Sg(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 zE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Sg(Object(n),!0).forEach(function(r){HE(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function HE(e,t,n){return(t=KE(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KE(e){var t=UE(e,"string");return Xo(t)=="symbol"?t:t+""}function UE(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)}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}var Us=function(t,n,r){var i=En(),s=i.brandId,o=i.analysisId,a=i.model,l=s,c=o,u=a,d=_c(l,c,{query:{enabled:!!l&&!!c,select:function(p){var v=p.data;return v==null?void 0:v.analysis}}}),f=d.data,h=WE(d,qE),g=z.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 zE({data:g},h)};function GE(){var e,t=Us(),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 QE=["children","as","className"];function YE(e,t){if(e==null)return{};var n,r,i=XE(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 XE(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 Da=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=YE(o,QE);return y.jsx(c,{className:Ce(String(s).trim(),d),...f,children:a})}},au=[{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"}],Cg=function(t){if(!t)return au[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)%au.length;return au[s]};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 _g;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 Og(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){JE(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 JE(e,t,n){return(t=ZE(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZE(e){var t=eA(e,"string");return Jo(t)=="symbol"?t:t+""}function eA(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 tA(e){return iA(e)||rA(e)||Jv(e)||nA()}function nA(){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 rA(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function iA(e){if(Array.isArray(e))return vd(e)}function Eg(e,t){return aA(e)||oA(e,t)||Jv(e,t)||sA()}function sA(){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 vd(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)?vd(e,t):void 0}}function vd(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 oA(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 aA(e){if(Array.isArray(e))return e}function lA(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var oo=Da(_g||(_g=lA(["md:yst-hidden yst-mr-2 yst-font-medium yst-text-slate-400 yst-inline-flex yst-w-20"]))),Ag=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(A.Table.Cell,{className:"yst-ml-2 yst-py-1 md:yst-ml-0 md:yst-p-2",children:[y.jsx(oo,{as:"span",children:"Rank:"}),l?y.jsx(A.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(A.Table.Cell,{className:"yst-ml-2 yst-py-1 md:yst-ml-0 md:yst-p-2",children:l?y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-full"}):y.jsx("div",{className:"yst-flex yst-items-center yst-gap-2",children:y.jsxs(A.Link,{className:"yst-flex yst-items-center yst-gap-1 yst-font-medium",href:d||"#",rel:"nofollow noreferrer",children:[y.jsx("span",{children:d!=null?d:"—"})," ",y.jsx(wE,{})]})})}),y.jsxs(A.Table.Cell,{className:"yst-ml-2 yst-py-1 yst-font-medium md:yst-ml-0 md:yst-p-2",children:[y.jsx(oo,{as:"span",children:"Domain:"}),l?y.jsx(A.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(A.Table.Cell,{className:"yst-ml-2 yst-py-1 md:yst-ml-0 md:yst-p-2",children:[y.jsx(oo,{as:"span",children:"Category:"}),l?y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-16"}):y.jsx(A.Badge,{className:Ce(Cg(h||"").bg,Cg(h||"").text),children:h!=null?h:"—"})]}),y.jsxs(A.Table.Cell,{className:Ce("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(oo,{as:"span",children:"Impact:"}),l?y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-12"}):g!=null?g:"—"]}),y.jsxs(A.Table.Cell,{className:"yst-ml-2 yst-pt-1 md:yst-ml-0 md:yst-p-2 md:yst-text-right",children:[y.jsx(oo,{as:"span",children:"Mentions:"}),l?y.jsx(A.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:Ce("yst-ml-auto",Yo(b)),children:[b>-1&&"+",b]})]}):"—"]})]},l?void 0:d)},cA=function(){var t,n,r,i,s,o=z.useState("all"),a=Eg(o,2),l=a[0],c=a[1],u=z.useState(1),d=Eg(u,2),f=d[0],h=d[1],g=Us(),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)||{},C=Object.hasOwn(w,"previous"),x=b==null||(n=b.list)===null||n===void 0?void 0:n.filter(function(D){return l==="all"?!0:D.category===l}),k=10,S=(x==null?void 0:x.length)||0,_=Math.ceil(S/k),O=(f-1)*k,E=O+k,T=x==null?void 0:x.slice(O,E);return z.useEffect(function(){f>_&&_>0&&h(1)},[_,f,h,l]),y.jsx(A.Card,{className:"yst-overflow-visible md:yst-col-span-2",children:y.jsxs(A.Card.Content,{className:"yst-flex yst-flex-col yst-gap-6",children:[y.jsxs("div",{className:"yst-space-y-4",children:[y.jsx(Ma,{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($a,{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(A.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(A.Select,{className:"yst-mb-4 md:yst-max-w-sm",label:"Filter categories",value:l,onChange:function(D){c(D)},id:"citation-category-filter",options:[{value:"all",label:"All categories"}].concat(tA(b!=null&&b.categories?b.categories.map(function(D){return{value:D,label:D}}):[]))}),y.jsxs(A.Table,{variant:"minimal",children:[y.jsx(A.Table.Head,{className:"yst-font-semibold",children:y.jsxs(A.Table.Row,{children:[y.jsx(A.Table.Cell,{className:"yst-hidden yst-text-slate-900 md:yst-table-cell md:yst-pl-2",children:"#"}),y.jsx(A.Table.Cell,{className:"yst yst-hidden yst-text-slate-900 md:yst-table-cell md:yst-px-2",children:"URL"}),y.jsx(A.Table.Cell,{className:"yst-hidden yst-text-slate-900 md:yst-table-cell md:yst-px-2",children:"Root domain"}),y.jsx(A.Table.Cell,{className:"yst-hidden yst-text-slate-900 md:yst-table-cell",children:"Category"}),y.jsx(A.Table.Cell,{className:"yst-hidden yst-text-slate-900 md:yst-table-cell md:yst-px-2",children:"Impact"}),y.jsx(A.Table.Cell,{className:"yst-hidden yst-text-right yst-text-slate-900 md:yst-table-cell",children:"Mentions"})]})}),y.jsx(A.Table.Body,{children:p||v?Array.from({length:5}).map(function(D,G){return y.jsx(Ag,{isLoading:!0},"skeleton-".concat(G))}):T&&T.length>0?T.map(function(D,G){return y.jsx(Ag,{data:Og(Og({},D),{},{rank:O+G+1}),totalQueries:m==null?void 0:m.numberOfQueries,isFirstScan:!C},"citation-table-row-".concat(D.url,"-").concat(G))}):y.jsx(A.Table.Row,{children:y.jsxs(A.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(A.Link,{onClick:function(){return c("all")},children:"Show all categories."})]})},"no-results")})]})]}),x&&x.length>k&&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 ",O+1," to"," ",E>S?S:E," of"," ",S," results"]}),y.jsx(A.Pagination,{variant:"text",className:"yst-flex-row yst-gap-0",current:f,total:_,onNavigate:h,screenReaderTextPrevious:"Previous page",screenReaderTextNext:"Next page"})]})]})]})})};function uA(e,t){return gA(e)||hA(e,t)||fA(e,t)||dA()}function dA(){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 fA(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 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}var Tg=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(A.Table.Row,{children:[y.jsx(A.Table.Cell,{children:c?y.jsx(A.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:Ce("yst-inline-flex yst-items-center yst-justify-end",Yo(h&&typeof g=="number"?g:0)),children:h&&typeof g=="number"?y.jsxs(y.Fragment,{children:[Math.abs(g),g>0?y.jsx(vE,{className:"yst-h-4 yst-w-4"}):y.jsx(mE,{className:"yst-h-4 yst-w-4"})]}):y.jsx(pg,{className:"yst-mx-1 yst-h-4 yst-w-4"})})]})}),y.jsx(A.Table.Cell,{children:c?y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-24"}):y.jsx("span",{className:"yst-font-medium",children:f!=null&&f.isSelf?y.jsx(Ec,{children:f==null?void 0:f.name}):(n=f==null?void 0:f.name)!==null&&n!==void 0?n:"—"})}),y.jsx(A.Table.Cell,{children:c?y.jsx(A.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:Ce("yst-ml-auto",Yo(p&&typeof v=="number"?v:0)),children:p&&typeof v=="number"?y.jsxs(y.Fragment,{children:[v>-1&&"+",v]}):y.jsx(pg,{className:"yst-h-4 yst-w-4"})})]})})]},c||d==null?void 0:d.value)},yA=function(t){var n,r,i=t.className,s=z.useRef(null),o=z.useState(1),a=uA(o,2),l=a[0],c=a[1],u=Us(),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),C=(l-1)*v,x=C+v,k=g==null?void 0:g.slice(C,x);return z.useEffect(function(){l>w&&w>0&&c(1)},[w,l,c]),y.jsx(A.Card,{ref:s,className:Ce("yst-overflow-visible",i),children:y.jsxs(A.Card.Content,{className:"yst-mt-0 yst-space-y-6",children:[y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(Ma,{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(A.Alert,{variant:"info",children:"The selected AI model returned no brands for your queries. This can happen with some queries or models."}):y.jsxs(A.Table,{variant:"minimal",children:[y.jsx(A.Table.Head,{children:y.jsxs(A.Table.Row,{children:[y.jsx(A.Table.Cell,{className:"yst-w-20 yst-font-semibold",children:"Rank"}),y.jsx(A.Table.Cell,{className:"yst-font-semibold",children:"Brand"}),y.jsx(A.Table.Cell,{className:"yst-w-20 yst-text-right yst-font-semibold",children:"Mentions"})]})}),y.jsx(A.Table.Body,{children:k&&Array.isArray(k)&&k.length>0?k.map(function(S){var _;return y.jsx(Tg,{data:S,totalQueries:d==null?void 0:d.numberOfQueries,isFirstScan:!p},"rank-row-".concat((_=S.rank)===null||_===void 0?void 0:_.value))}):f||h?Array.from({length:v}).map(function(S,_){return y.jsx(Tg,{isLoading:!0},"skeleton-".concat(_))}):null})]}),!f&&!h&&g&&g.length>v&&y.jsx(A.Pagination,{current:l,total:w,className:"yst-flex-row",onNavigate:c,screenReaderTextNext:"Next",screenReaderTextPrevious:"Previous",variant:"text"})]})})},mA=function(){var t,n=Us(),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."})},pA=function(t){var n=t.brand,r=gn(),i=Oc(),s=i.setBrandId;return(n==null?void 0:n.setupStatus)==="pendingQuerySelection"?y.jsx(A.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(A.Link,{onClick:function(){n.id?(s(n.id),r("/setup/".concat(n.id,"/queries"))):console.error("Brand ID is missing.")},children:"Review queries"})})]})}):null},bf=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(A.Modal,{isOpen:n,onClose:r,position:"center",as:"div",className:m,children:y.jsxs(A.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(AO,{className:"yst-h-6 yst-w-6 yst-text-red-600"})})}),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:a})}),y.jsx(A.Modal.Container.Content,{className:"yst-mb-4 yst-space-y-3",children:typeof l=="string"?y.jsx("p",{children:l}):l})]})]}),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:r,children:g}),y.jsx(A.Button,{variant:"error",onClick:i,isLoading:o,disabled:u,children:f})]})]})})},Za={exports:{}},el={exports:{}},Ke={};/** @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 jg;function pA(){if(jg)return He;jg=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 k=x.$$typeof;switch(k){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 k}}case n:return k}}}function C(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 C(x)||w(x)===l},He.isConcurrentMode=C,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 Ke={};/** @license React v16.13.1
35
+ */var jg;function vA(){if(jg)return Ke;jg=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 k=x.$$typeof;switch(k){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 k}}case n:return k}}}function C(x){return w(x)===c}return Ke.AsyncMode=l,Ke.ConcurrentMode=c,Ke.ContextConsumer=a,Ke.ContextProvider=o,Ke.Element=t,Ke.ForwardRef=u,Ke.Fragment=r,Ke.Lazy=g,Ke.Memo=h,Ke.Portal=n,Ke.Profiler=s,Ke.StrictMode=i,Ke.Suspense=d,Ke.isAsyncMode=function(x){return C(x)||w(x)===l},Ke.isConcurrentMode=C,Ke.isContextConsumer=function(x){return w(x)===a},Ke.isContextProvider=function(x){return w(x)===o},Ke.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===t},Ke.isForwardRef=function(x){return w(x)===u},Ke.isFragment=function(x){return w(x)===r},Ke.isLazy=function(x){return w(x)===g},Ke.isMemo=function(x){return w(x)===h},Ke.isPortal=function(x){return w(x)===n},Ke.isProfiler=function(x){return w(x)===s},Ke.isStrictMode=function(x){return w(x)===i},Ke.isSuspense=function(x){return w(x)===d},Ke.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)},Ke.typeOf=w,Ke}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 Mg;function vA(){return Mg||(Mg=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(te){return typeof te=="string"||typeof te=="function"||te===r||te===c||te===s||te===i||te===d||te===f||typeof te=="object"&&te!==null&&(te.$$typeof===g||te.$$typeof===h||te.$$typeof===o||te.$$typeof===a||te.$$typeof===u||te.$$typeof===p||te.$$typeof===v||te.$$typeof===b||te.$$typeof===m)}function C(te){if(typeof te=="object"&&te!==null){var De=te.$$typeof;switch(De){case t:var me=te.type;switch(me){case l:case c:case r:case s:case i:case d:return me;default:var Te=me&&me.$$typeof;switch(Te){case a:case u:case g:case h:case o:return Te;default:return De}}case n:return De}}}var x=l,k=c,S=a,_=o,O=t,E=u,T=r,D=g,W=h,N=n,L=s,$=i,I=d,oe=!1;function ue(te){return oe||(oe=!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.")),B(te)||C(te)===l}function B(te){return C(te)===c}function X(te){return C(te)===a}function ae(te){return C(te)===o}function ne(te){return typeof te=="object"&&te!==null&&te.$$typeof===t}function R(te){return C(te)===u}function G(te){return C(te)===r}function q(te){return C(te)===g}function ce(te){return C(te)===h}function V(te){return C(te)===n}function de(te){return C(te)===s}function fe(te){return C(te)===i}function Ne(te){return C(te)===d}Ke.AsyncMode=x,Ke.ConcurrentMode=k,Ke.ContextConsumer=S,Ke.ContextProvider=_,Ke.Element=O,Ke.ForwardRef=E,Ke.Fragment=T,Ke.Lazy=D,Ke.Memo=W,Ke.Portal=N,Ke.Profiler=L,Ke.StrictMode=$,Ke.Suspense=I,Ke.isAsyncMode=ue,Ke.isConcurrentMode=B,Ke.isContextConsumer=X,Ke.isContextProvider=ae,Ke.isElement=ne,Ke.isForwardRef=R,Ke.isFragment=G,Ke.isLazy=q,Ke.isMemo=ce,Ke.isPortal=V,Ke.isProfiler=de,Ke.isStrictMode=fe,Ke.isSuspense=Ne,Ke.isValidElementType=w,Ke.typeOf=C}()),Ke}var $g;function Jv(){return $g||($g=1,process.env.NODE_ENV==="production"?el.exports=pA():el.exports=vA()),el.exports}/*
42
+ */var $g;function bA(){return $g||($g=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(te){return typeof te=="string"||typeof te=="function"||te===r||te===c||te===s||te===i||te===d||te===f||typeof te=="object"&&te!==null&&(te.$$typeof===g||te.$$typeof===h||te.$$typeof===o||te.$$typeof===a||te.$$typeof===u||te.$$typeof===p||te.$$typeof===v||te.$$typeof===b||te.$$typeof===m)}function C(te){if(typeof te=="object"&&te!==null){var et=te.$$typeof;switch(et){case t:var _e=te.type;switch(_e){case l:case c:case r:case s:case i:case d:return _e;default:var Ie=_e&&_e.$$typeof;switch(Ie){case a:case u:case g:case h:case o:return Ie;default:return et}}case n:return et}}}var x=l,k=c,S=a,_=o,O=t,E=u,T=r,D=g,G=h,N=n,L=s,M=i,I=d,oe=!1;function ue(te){return oe||(oe=!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.")),B(te)||C(te)===l}function B(te){return C(te)===c}function J(te){return C(te)===a}function ae(te){return C(te)===o}function ne(te){return typeof te=="object"&&te!==null&&te.$$typeof===t}function R(te){return C(te)===u}function Q(te){return C(te)===r}function q(te){return C(te)===g}function ce(te){return C(te)===h}function W(te){return C(te)===n}function de(te){return C(te)===s}function fe(te){return C(te)===i}function Le(te){return C(te)===d}Ue.AsyncMode=x,Ue.ConcurrentMode=k,Ue.ContextConsumer=S,Ue.ContextProvider=_,Ue.Element=O,Ue.ForwardRef=E,Ue.Fragment=T,Ue.Lazy=D,Ue.Memo=G,Ue.Portal=N,Ue.Profiler=L,Ue.StrictMode=M,Ue.Suspense=I,Ue.isAsyncMode=ue,Ue.isConcurrentMode=B,Ue.isContextConsumer=J,Ue.isContextProvider=ae,Ue.isElement=ne,Ue.isForwardRef=R,Ue.isFragment=Q,Ue.isLazy=q,Ue.isMemo=ce,Ue.isPortal=W,Ue.isProfiler=de,Ue.isStrictMode=fe,Ue.isSuspense=Le,Ue.isValidElementType=w,Ue.typeOf=C}()),Ue}var Mg;function Zv(){return Mg||(Mg=1,process.env.NODE_ENV==="production"?el.exports=vA():el.exports=bA()),el.exports}/*
43
43
  object-assign
44
44
  (c) Sindre Sorhus
45
45
  @license MIT
46
- */var lu,Dg;function bA(){if(Dg)return lu;Dg=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 lu=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},lu}var cu,Lg;function xf(){if(Lg)return cu;Lg=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return cu=e,cu}var uu,Ig;function Zv(){return Ig||(Ig=1,uu=Function.call.bind(Object.prototype.hasOwnProperty)),uu}var du,Rg;function xA(){if(Rg)return du;Rg=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=xf(),n={},r=Zv();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={})},du=i,du}var fu,Ng;function wA(){if(Ng)return fu;Ng=1;var e=Jv(),t=bA(),n=xf(),r=Zv(),i=xA(),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 fu=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d(B){var X=B&&(c&&B[c]||B[u]);if(typeof X=="function")return X}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:C(),elementType:x(),instanceOf:k,node:E(),objectOf:_,oneOf:S,oneOfType:O,shape:D,exact:W};function g(B,X){return B===X?B!==0||1/B===1/X:B!==B&&X!==X}function m(B,X){this.message=B,this.data=X&&typeof X=="object"?X:{},this.stack=""}m.prototype=Error.prototype;function p(B){if(process.env.NODE_ENV!=="production")var X={},ae=0;function ne(G,q,ce,V,de,fe,Ne){if(V=V||f,fe=fe||ce,Ne!==n){if(l){var te=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 te.name="Invariant Violation",te}else if(process.env.NODE_ENV!=="production"&&typeof console!="undefined"){var De=V+":"+ce;!X[De]&&ae<3&&(s("You are manually calling a React.PropTypes validation function for the `"+fe+"` prop on `"+V+"`. 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."),X[De]=!0,ae++)}}return q[ce]==null?G?q[ce]===null?new m("The "+de+" `"+fe+"` is marked as required "+("in `"+V+"`, but its value is `null`.")):new m("The "+de+" `"+fe+"` is marked as required in "+("`"+V+"`, but its value is `undefined`.")):null:B(q,ce,V,de,fe)}var R=ne.bind(null,!1);return R.isRequired=ne.bind(null,!0),R}function v(B){function X(ae,ne,R,G,q,ce){var V=ae[ne],de=$(V);if(de!==B){var fe=I(V);return new m("Invalid "+G+" `"+q+"` of type "+("`"+fe+"` supplied to `"+R+"`, expected ")+("`"+B+"`."),{expectedType:B})}return null}return p(X)}function b(){return p(o)}function w(B){function X(ae,ne,R,G,q){if(typeof B!="function")return new m("Property `"+q+"` of component `"+R+"` has invalid PropType notation inside arrayOf.");var ce=ae[ne];if(!Array.isArray(ce)){var V=$(ce);return new m("Invalid "+G+" `"+q+"` of type "+("`"+V+"` supplied to `"+R+"`, expected an array."))}for(var de=0;de<ce.length;de++){var fe=B(ce,de,R,G,q+"["+de+"]",n);if(fe instanceof Error)return fe}return null}return p(X)}function C(){function B(X,ae,ne,R,G){var q=X[ae];if(!a(q)){var ce=$(q);return new m("Invalid "+R+" `"+G+"` of type "+("`"+ce+"` supplied to `"+ne+"`, expected a single ReactElement."))}return null}return p(B)}function x(){function B(X,ae,ne,R,G){var q=X[ae];if(!e.isValidElementType(q)){var ce=$(q);return new m("Invalid "+R+" `"+G+"` of type "+("`"+ce+"` supplied to `"+ne+"`, expected a single ReactElement type."))}return null}return p(B)}function k(B){function X(ae,ne,R,G,q){if(!(ae[ne]instanceof B)){var ce=B.name||f,V=ue(ae[ne]);return new m("Invalid "+G+" `"+q+"` of type "+("`"+V+"` supplied to `"+R+"`, expected ")+("instance of `"+ce+"`."))}return null}return p(X)}function S(B){if(!Array.isArray(B))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 X(ae,ne,R,G,q){for(var ce=ae[ne],V=0;V<B.length;V++)if(g(ce,B[V]))return null;var de=JSON.stringify(B,function(Ne,te){var De=I(te);return De==="symbol"?String(te):te});return new m("Invalid "+G+" `"+q+"` of value `"+String(ce)+"` "+("supplied to `"+R+"`, expected one of "+de+"."))}return p(X)}function _(B){function X(ae,ne,R,G,q){if(typeof B!="function")return new m("Property `"+q+"` of component `"+R+"` has invalid PropType notation inside objectOf.");var ce=ae[ne],V=$(ce);if(V!=="object")return new m("Invalid "+G+" `"+q+"` of type "+("`"+V+"` supplied to `"+R+"`, expected an object."));for(var de in ce)if(r(ce,de)){var fe=B(ce,de,R,G,q+"."+de,n);if(fe instanceof Error)return fe}return null}return p(X)}function O(B){if(!Array.isArray(B))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var X=0;X<B.length;X++){var ae=B[X];if(typeof ae!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+oe(ae)+" at index "+X+"."),o}function ne(R,G,q,ce,V){for(var de=[],fe=0;fe<B.length;fe++){var Ne=B[fe],te=Ne(R,G,q,ce,V,n);if(te==null)return null;te.data&&r(te.data,"expectedType")&&de.push(te.data.expectedType)}var De=de.length>0?", expected one of type ["+de.join(", ")+"]":"";return new m("Invalid "+ce+" `"+V+"` supplied to "+("`"+q+"`"+De+"."))}return p(ne)}function E(){function B(X,ae,ne,R,G){return N(X[ae])?null:new m("Invalid "+R+" `"+G+"` supplied to "+("`"+ne+"`, expected a ReactNode."))}return p(B)}function T(B,X,ae,ne,R){return new m((B||"React class")+": "+X+" type `"+ae+"."+ne+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+R+"`.")}function D(B){function X(ae,ne,R,G,q){var ce=ae[ne],V=$(ce);if(V!=="object")return new m("Invalid "+G+" `"+q+"` of type `"+V+"` "+("supplied to `"+R+"`, expected `object`."));for(var de in B){var fe=B[de];if(typeof fe!="function")return T(R,G,q,de,I(fe));var Ne=fe(ce,de,R,G,q+"."+de,n);if(Ne)return Ne}return null}return p(X)}function W(B){function X(ae,ne,R,G,q){var ce=ae[ne],V=$(ce);if(V!=="object")return new m("Invalid "+G+" `"+q+"` of type `"+V+"` "+("supplied to `"+R+"`, expected `object`."));var de=t({},ae[ne],B);for(var fe in de){var Ne=B[fe];if(r(B,fe)&&typeof Ne!="function")return T(R,G,q,fe,I(Ne));if(!Ne)return new m("Invalid "+G+" `"+q+"` key `"+fe+"` supplied to `"+R+"`.\nBad object: "+JSON.stringify(ae[ne],null," ")+`
47
- Valid keys: `+JSON.stringify(Object.keys(B),null," "));var te=Ne(ce,fe,R,G,q+"."+fe,n);if(te)return te}return null}return p(X)}function N(B){switch(typeof B){case"number":case"string":case"undefined":return!0;case"boolean":return!B;case"object":if(Array.isArray(B))return B.every(N);if(B===null||a(B))return!0;var X=d(B);if(X){var ae=X.call(B),ne;if(X!==B.entries){for(;!(ne=ae.next()).done;)if(!N(ne.value))return!1}else for(;!(ne=ae.next()).done;){var R=ne.value;if(R&&!N(R[1]))return!1}}else return!1;return!0;default:return!1}}function L(B,X){return B==="symbol"?!0:X?X["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&X instanceof Symbol:!1}function $(B){var X=typeof B;return Array.isArray(B)?"array":B instanceof RegExp?"object":L(X,B)?"symbol":X}function I(B){if(typeof B=="undefined"||B===null)return""+B;var X=$(B);if(X==="object"){if(B instanceof Date)return"date";if(B instanceof RegExp)return"regexp"}return X}function oe(B){var X=I(B);switch(X){case"array":case"object":return"an "+X;case"boolean":case"date":case"regexp":return"a "+X;default:return X}}function ue(B){return!B.constructor||!B.constructor.name?f:B.constructor.name}return h.checkPropTypes=i,h.resetWarningCache=i.resetWarningCache,h.PropTypes=h,h},fu}var hu,Fg;function SA(){if(Fg)return hu;Fg=1;var e=xf();function t(){}function n(){}return n.resetWarningCache=t,hu=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},hu}var Bg;function CA(){if(Bg)return Za.exports;if(Bg=1,process.env.NODE_ENV!=="production"){var e=Jv(),t=!0;Za.exports=wA()(e.isElement,t)}else Za.exports=SA()();return Za.exports}var _A=CA();const bd=Yp(_A);var La=function(t){var n=t.className,r=n===void 0?"":n;return y.jsx("hr",{className:_e("yst-my-6",r)})};La.propTypes={className:bd.string};const eb=6048e5,kA=864e5,qg=Symbol.for("constructDateFrom");function en(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&qg in e?e[qg](t):e instanceof Date?new e.constructor(t):new Date(t)}function zt(e,t){return en(t||e,e)}function tb(e,t,n){const r=zt(e,n==null?void 0:n.in);if(isNaN(t))return en(e,NaN);if(!t)return r;const i=r.getDate(),s=en(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 OA={};function Ac(){return OA}function Zo(e,t){var a,l,c,u,d,f,h,g;const n=Ac(),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=zt(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 Ul(e,t){return Zo(e,{...t,weekStartsOn:1})}function nb(e,t){const n=zt(e,t==null?void 0:t.in),r=n.getFullYear(),i=en(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const s=Ul(i),o=en(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const a=Ul(o);return n.getTime()>=s.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function zg(e){const t=zt(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 Pc(e,...t){const n=en.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Vl(e,t){const n=zt(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function EA(e,t,n){const[r,i]=Pc(n==null?void 0:n.in,e,t),s=Vl(r),o=Vl(i),a=+s-zg(s),l=+o-zg(o);return Math.round((a-l)/kA)}function AA(e,t){const n=nb(e,t),r=en(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Ul(r)}function PA(e){return en(e,Date.now())}function TA(e,t,n){const[r,i]=Pc(n==null?void 0:n.in,e,t);return+Vl(r)==+Vl(i)}function jA(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function MA(e){return!(!jA(e)&&typeof e!="number"||isNaN(+zt(e)))}function $A(e,t){const n=zt(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 DA(e,t){const[n,r]=Pc(e,t.start,t.end);return{start:n,end:r}}function LA(e,t){const{start:n,end:r}=DA(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(en(n,o)),o.setDate(o.getDate()+a),o.setHours(0,0,0,0);return i?l.reverse():l}function IA(e,t){const n=zt(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function RA(e,t){const n=zt(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const NA={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"}},FA=(e,t,n)=>{let r;const i=NA[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 gu(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const BA={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"},zA={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},HA={date:gu({formats:BA,defaultWidth:"full"}),time:gu({formats:qA,defaultWidth:"full"}),dateTime:gu({formats:zA,defaultWidth:"full"})},KA={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},UA=(e,t,n,r)=>KA[e];function ao(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 VA={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},WA={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},GA={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"]},QA={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"]},YA={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"}},XA={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"}},JA=(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"},ZA={ordinalNumber:JA,era:ao({values:VA,defaultWidth:"wide"}),quarter:ao({values:WA,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ao({values:GA,defaultWidth:"wide"}),day:ao({values:QA,defaultWidth:"wide"}),dayPeriod:ao({values:YA,defaultWidth:"wide",formattingValues:XA,defaultFormattingWidth:"wide"})};function lo(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)?t3(a,d=>d.test(o)):e3(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 e3(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function t3(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function n3(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 r3=/^(\d+)(th|st|nd|rd)?/i,i3=/\d+/i,s3={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},o3={any:[/^b/i,/^(a|c)/i]},a3={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},l3={any:[/1/i,/2/i,/3/i,/4/i]},c3={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},u3={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]},d3={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},f3={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]},h3={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},g3={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}},y3={ordinalNumber:n3({matchPattern:r3,parsePattern:i3,valueCallback:e=>parseInt(e,10)}),era:lo({matchPatterns:s3,defaultMatchWidth:"wide",parsePatterns:o3,defaultParseWidth:"any"}),quarter:lo({matchPatterns:a3,defaultMatchWidth:"wide",parsePatterns:l3,defaultParseWidth:"any",valueCallback:e=>e+1}),month:lo({matchPatterns:c3,defaultMatchWidth:"wide",parsePatterns:u3,defaultParseWidth:"any"}),day:lo({matchPatterns:d3,defaultMatchWidth:"wide",parsePatterns:f3,defaultParseWidth:"any"}),dayPeriod:lo({matchPatterns:h3,defaultMatchWidth:"any",parsePatterns:g3,defaultParseWidth:"any"})},m3={code:"en-US",formatDistance:FA,formatLong:HA,formatRelative:UA,localize:ZA,match:y3,options:{weekStartsOn:0,firstWeekContainsDate:1}};function p3(e,t){const n=zt(e,t==null?void 0:t.in);return EA(n,RA(n))+1}function v3(e,t){const n=zt(e,t==null?void 0:t.in),r=+Ul(n)-+AA(n);return Math.round(r/eb)+1}function rb(e,t){var u,d,f,h,g,m,p,v;const n=zt(e,t==null?void 0:t.in),r=n.getFullYear(),i=Ac(),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=en((t==null?void 0:t.in)||e,0);o.setFullYear(r+1,0,s),o.setHours(0,0,0,0);const a=Zo(o,t),l=en((t==null?void 0:t.in)||e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const c=Zo(l,t);return+n>=+a?r+1:+n>=+c?r:r-1}function b3(e,t){var a,l,c,u,d,f,h,g;const n=Ac(),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=en((t==null?void 0:t.in)||e,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),Zo(s,t)}function x3(e,t){const n=zt(e,t==null?void 0:t.in),r=+Zo(n,t)-+b3(n,t);return Math.round(r/eb)+1}function We(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const vr={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return We(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):We(n+1,2)},d(e,t){return We(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 We(e.getHours()%12||12,t.length)},H(e,t){return We(e.getHours(),t.length)},m(e,t){return We(e.getMinutes(),t.length)},s(e,t){return We(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return We(i,t.length)}},Hi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Hg={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 vr.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 We(o,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):We(s,t.length)},R:function(e,t){const n=nb(e);return We(n,t.length)},u:function(e,t){const n=e.getFullYear();return We(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 We(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 We(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 vr.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 We(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=x3(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):We(i,t.length)},I:function(e,t,n){const r=v3(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):We(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):vr.d(e,t)},D:function(e,t,n){const r=p3(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):We(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 We(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 We(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 We(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=Hi.noon:r===0?i=Hi.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=Hi.evening:r>=12?i=Hi.afternoon:r>=4?i=Hi.morning:i=Hi.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 vr.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):vr.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):We(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):We(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):vr.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):vr.s(e,t)},S:function(e,t){return vr.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Ug(r);case"XXXX":case"XX":return ri(r);case"XXXXX":case"XXX":default:return ri(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Ug(r);case"xxxx":case"xx":return ri(r);case"xxxxx":case"xxx":default:return ri(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Kg(r,":");case"OOOO":default:return"GMT"+ri(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Kg(r,":");case"zzzz":default:return"GMT"+ri(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return We(r,t.length)},T:function(e,t,n){return We(+e,t.length)}};function Kg(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+We(s,2)}function Ug(e,t){return e%60===0?(e>0?"-":"+")+We(Math.abs(e)/60,2):ri(e,t)}function ri(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=We(Math.trunc(r/60),2),s=We(r%60,2);return n+i+t+s}const Vg=(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"})}},w3=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Vg(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}}",Vg(r,t)).replace("{{time}}",ib(i,t))},S3={p:ib,P:w3},C3=/^D+$/,_3=/^Y+$/,k3=["D","DD","YY","YYYY"];function O3(e){return C3.test(e)}function E3(e){return _3.test(e)}function A3(e,t,n){const r=P3(e,t,n);if(console.warn(r),k3.includes(e))throw new RangeError(r)}function P3(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 T3=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,j3=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,M3=/^'([^]*?)'?$/,$3=/''/g,D3=/[a-zA-Z]/;function _o(e,t,n){var u,d,f,h,g,m,p,v,b;const r=Ac(),i=(u=r.locale)!=null?u:m3,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=zt(e,n==null?void 0:n.in);if(!MA(a))throw new RangeError("Invalid time value");let l=t.match(j3).map(w=>{const C=w[0];if(C==="p"||C==="P"){const x=S3[C];return x(w,i.formatLong)}return w}).join("").match(T3).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const C=w[0];if(C==="'")return{isToken:!1,value:L3(w)};if(Hg[C])return{isToken:!0,value:w};if(C.match(D3))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");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 C=w.value;(E3(C)||O3(C))&&A3(C,t,String(e));const x=Hg[C[0]];return x(a,C,i.localize,c)}).join("")}function L3(e){const t=e.match(M3);return t?t[1].replace($3,"'"):e}function Wg(e,t,n){const[r,i]=Pc(n==null?void 0:n.in,e,t);return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()}function I3(e,t){return TA(en(e,e),PA(e))}function R3(e,t,n){return tb(e,-1,n)}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)}function yu(e,t,n){return(t=N3(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N3(e){var t=F3(e,"string");return ea(t)=="symbol"?t:t+""}function F3(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 Gg(e,t){return H3(e)||z3(e,t)||q3(e,t)||B3()}function B3(){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 Qg(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)?Qg(e,t):void 0}}function Qg(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 z3(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 H3(e){if(Array.isArray(e))return e}var Tn={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"}},K3=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=z.useState(new Date),d=Gg(u,2),f=d[0],h=d[1],g=function(_){if(!_)return null;var O=_.slice(0,10),E=O.split("-"),T=Gg(E,3),D=T[0],W=T[1],N=T[2],L=Number(D),$=Number(W),I=Number(N);return Number.isNaN(L)||Number.isNaN($)||Number.isNaN(I)||$<1||$>12||I<1||I>31?null:new Date(L,$-1,I)},m=z.useMemo(function(){var S=new Map;return n.forEach(function(_){var O=g(_.createdAt),E=O?_o(O,"yyyy-MM-dd"):"";E&&(S.has(E)||S.set(E,[]),S.get(E).push(_))}),S},[n]);z.useEffect(function(){if(l&&r){var S=n.find(function(T){return T.id===r});if(S){var _=g(S.createdAt);_&&h(_)}}else if(l&&n.length>0){var O=n.reduce(function(T,D){return new Date(D.createdAt)>new Date(T.createdAt)?D:T}),E=g(O.createdAt);E&&h(E)}},[l,r,n]);var p=z.useMemo(function(){return n.length===0?null:n.reduce(function(S,_){return new Date(_.createdAt)>new Date(S.createdAt)?_:S})},[n]),v=function(){if(p){var _=g(p.createdAt);_&&h(_)}},b=z.useMemo(function(){if(!p)return!1;var S=g(p.createdAt);return S?Wg(S,f):!1},[p,f]),w=z.useMemo(function(){var S=IA(f),_=$A(f),O=new Date(S),E=O.getDay(),T=E===0?6:E-1;O.setDate(O.getDate()-T);var D=new Date(_),W=D.getDay(),N=W===0?0:7-W;return D.setDate(D.getDate()+N),LA({start:O,end:D}).map(function(L){var $=_o(L,"yyyy-MM-dd"),I=m.get($)||[],oe=I.find(function(ue){return String(ue.id)===String(r)});return{date:$,dateObj:L,isCurrentMonth:Wg(L,f),isToday:I3(L),isSelected:!!oe,hasAnalyses:I.length>0,analyses:I}})},[f,m,r]),C=function(){h(function(_){return R3(_)})},x=function(){h(function(_){return tb(_,1)})},k=function(_){if(_.hasAnalyses){if(_.analyses.length===1)i(_.analyses[0].id);else{var O=_.analyses.reduce(function(E,T){return new Date(T.createdAt)>new Date(E.createdAt)?T:E});i(O.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:C,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(pO,{className:"yst-h-5 yst-w-5"})]}),y.jsx("h2",{className:"yst-text-sm yst-font-semibold yst-text-slate-900",children:_o(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(bO,{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(S,_){return y.jsx("div",{className:"yst-py-2 yst-text-center yst-text-xs yst-font-medium yst-text-slate-500",children:S},"".concat(S,"-").concat(_))})}),y.jsx("div",{className:"yst-grid yst-grid-cols-7 yst-gap-x-1",children:w.map(function(S){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 k(S)},disabled:!S.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":S.isCurrentMonth,"yst-text-slate-400":!S.isCurrentMonth},{"focus:yst-outline-none focus:yst-ring-2 focus:yst-ring-blue-500":S.hasAnalyses,"yst-cursor-not-allowed":!S.hasAnalyses,"yst-cursor-pointer":S.hasAnalyses},yu({},"".concat(Tn.selected.background," ").concat(Tn.selected.text," ").concat(Tn.selected.hover),S.isSelected),yu({},"".concat(Tn.hasAnalysis.border," ").concat(Tn.hasAnalysis.text," ").concat(Tn.hasAnalysis.hover),S.hasAnalyses&&!S.isSelected)),children:[y.jsx("span",{className:_e("yst-relative yst-z-10 yst-w-4",yu({},Tn.today.underline,S.isToday&&!S.isSelected)),children:_o(S.dateObj,"d")}),S.hasAnalyses&&S.analyses.length>1&&!S.isSelected&&y.jsx("span",{className:_e("yst-absolute yst-right-1 yst-top-1 yst-h-2 yst-w-2 yst-rounded-full",Tn.indicator.default)})]})},S.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(Tn.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(Tn.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(A.Button,{onClick:v,className:"yst-w-full",disabled:b,children:"Show latest analysis"})})]}):null};function mu(e,t){return G3(e)||W3(e,t)||V3(e,t)||U3()}function U3(){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 V3(e,t){if(e){if(typeof e=="string")return Yg(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)?Yg(e,t):void 0}}function Yg(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 W3(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 G3(e){if(Array.isArray(e))return e}var Q3=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=z.useState(!1),f=mu(d,2),h=f[0],g=f[1],m=z.useState("latest"),p=mu(m,2),v=p[0],b=p[1],w=z.useRef(null),C=function(L){if(!L)return null;var $=L.slice(0,10),I=$.split("-"),oe=mu(I,3),ue=oe[0],B=oe[1],X=oe[2],ae=Number(ue),ne=Number(B),R=Number(X);return Number.isNaN(ae)||Number.isNaN(ne)||Number.isNaN(R)||ne<1||ne>12||R<1||R>31?null:new Date(ae,ne-1,R)},x=function(L){var $=C(L.createdAt);return $?$.getTime():-1/0};z.useEffect(function(){if((r==="latest"||!r)&&n.length>0&&!o){var N=n.reduce(function(L,$){return x($)>x(L)?$:L});i(N.id)}},[n,r,i,o]);var k=z.useMemo(function(){if(r==="latest"||!r){if(n.length>0){var N=n.reduce(function(L,$){return x($)>x(L)?$:L});return N.id}return"latest"}return r},[r,n,x]);z.useEffect(function(){b(k)},[k]);var S=n.find(function(N){return String(N.id)===String(v)}),_=n.length>0?String(n.reduce(function(N,L){return x(L)>x(N)?L:N}).id):"",O=function(){if(S){var N=C(S.createdAt),L=N?_o(N,"MMMM d, yyyy"):S.createdAt?S.createdAt.slice(0,10):"Unknown date",$=String(S.id)===_?"(latest)":"(older)";return"".concat(L," ").concat($)}return n.length>0?"Select date...":"No analyses available"}();z.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 E=function(){!l&&!o&&g(!h)},T=function(L){b(L),i(L),g(!1)},D=function(){g(!1)},W=function(L){L.key==="Enter"||L.key===" "?(L.preventDefault(),E()):L.key==="Escape"&&g(!1)};return y.jsxs("div",{ref:w,className:"yst-relative",children:[y.jsxs("div",{className:"yst-relative",children:[y.jsx(A.TextInput,{id:u,onClick:E,onKeyDown:W,onChange:function(){},disabled:l||o,value:O,"aria-expanded":h,"aria-haspopup":"true","aria-label":"Select analysis date",className:_e("yst-pr-10",{"yst-cursor-default":!l&&!o})}),y.jsx(hO,{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(K3,{analyses:n,selectedAnalysisId:v,onAnalysisSelect:T,isLoading:o,isOpen:h,onClose:D})]})},Xg;function Jg(e,t){return Z3(e)||J3(e,t)||X3(e,t)||Y3()}function Y3(){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 X3(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 J3(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 Z3(e){if(Array.isArray(e))return e}function xd(){/*! 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 Vt(b,"_invoke",function(w,C,x){var k,S,_,O=0,E=x||[],T=!1,D={p:0,n:0,v:e,a:W,f:W.bind(e,4),d:function(L,$){return k=L,S=0,_=e,D.n=$,o}};function W(N,L){for(S=N,_=L,t=0;!T&&O&&!$&&t<E.length;t++){var $,I=E[t],oe=D.p,ue=I[2];N>3?($=ue===L)&&(_=I[(S=I[4])?5:(S=3,3)],I[4]=I[5]=e):I[0]<=oe&&(($=N<2&&oe<I[1])?(S=0,D.v=L,D.n=I[1]):oe<ue&&($=N<3||I[0]>L||L>ue)&&(I[4]=N,I[5]=L,D.n=ue,S=0))}if($||N>1)return o;throw T=!0,L}return function(N,L,$){if(O>1)throw TypeError("Generator is already running");for(T&&L===1&&W(L,$),S=L,_=$;(t=S<2?e:_)||!T;){k||(S?S<3?(S>1&&(D.n=-1),W(S,_)):D.n=_:D.v=_);try{if(O=2,k){if(S||(N="next"),t=k[N]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,S<2&&(S=0)}else S===1&&(t=k.return)&&t.call(k),S<2&&(_=TypeError("The iterator does not provide a '"+N+"' method"),S=1);k=e}else if((t=(T=D.n<0)?_:w.call(C,D))!==o)break}catch(I){k=e,S=1,_=I}finally{O=1}}return{value:t,done:T}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Vt(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,Vt(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=c,Vt(d,"constructor",c),Vt(c,"constructor",l),l.displayName="GeneratorFunction",Vt(c,i,"GeneratorFunction"),Vt(d),Vt(d,i,"Generator"),Vt(d,r,function(){return this}),Vt(d,"toString",function(){return"[object Generator]"}),(xd=function(){return{w:s,m:f}})()}function Vt(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Vt=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){Vt(o,f,function(g){return this._invoke(f,h,g)})};u("next",0),u("throw",1),u("return",2)}},Vt(e,t,n,r)}function ey(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){ey(s,r,i,o,a,"next",l)}function a(l){ey(s,r,i,o,a,"throw",l)}o(void 0)})}}function tP(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var pu=Da(Xg||(Xg=tP(["yst-flex-1 yst-space-y-2"]))),nP=function(t){var n,r,i=t.className,s=En(),o=s.brandId,a=s.analysisId,l=s.model,c=Oc(),u=c.setModel,d=c.setAnalysisId,f=qt(),h=gn(),g=kc({query:{select:function(Te){var je=Te.data;return je==null?void 0:je.data}}}),m=g.data,p=g.isLoading,v=m==null?void 0:m.displayName,b=Ri({query:{select:function(Te){var je=Te.data;return je==null?void 0:je.brands}}}),w=b.data,C=b.isLoading,x=Iv(o,{query:{enabled:!!o,select:function(Te){var je=Te.data;return je==null?void 0:je.analyses}}}),k=x.data,S=x.isLoading,_=_c(o,a,{query:{enabled:!!o&&!!a,select:function(Te){var je=Te.data;return je}}}),O=_.data,E=_.isLoading,T=Hk(o,{query:{enabled:!!o,select:function(Te){var je=Te.data;return je}}}),D=T.data,W=T.isLoading,N=yk({mutation:{onSuccess:function(){var me=eP(xd().m(function je(){var Et,Z;return xd().w(function(Me){for(;;)switch(Me.n){case 0:return Me.n=1,Promise.all([f.invalidateQueries({queryKey:Lv(o)}),f.invalidateQueries({queryKey:Rv(o,a)}),f.invalidateQueries({queryKey:hf(o)})]);case 1:Et=(k==null?void 0:k.filter(function(Je){return String(Je.id)!==String(a)}))||[],Et.length>0?(Z=Et.reduce(function(Je,Le){var Ie=Je.createdAt?new Date(Je.createdAt).getTime():0,he=Le.createdAt?new Date(Le.createdAt).getTime():0;return he>Ie?Le:Je}),d(Z.id),h("/brands/".concat(o,"/analysis/").concat(Z.id))):(d("latest"),h("/brands/".concat(o))),B(!1);case 2:return Me.a(2)}},je)}));function Te(){return me.apply(this,arguments)}return Te}()}}),L=N.mutate,$=N.isPending;z.useEffect(function(){!W&&!E&&o&&w&&(w==null?void 0:w.length)<2&&(!D||Array.isArray(D)&&D.length===0)&&(k==null?void 0:k.length)===0&&h("/setup/".concat(o,"/queries"))},[W,E,D,o,h,w,k==null?void 0:k.length]);var I=z.useState(!1),oe=Jg(I,2),ue=oe[0],B=oe[1],X=function(){B(!1)},ae=w==null?void 0:w.find(function(me){return String(me.id)===String(o)}),ne=O==null||(n=O.analysis)===null||n===void 0?void 0:n.id,R=o!=null&&typeof ne=="number"&&!isNaN(ne),G=z.useState(!1),q=Jg(G,2),ce=q[0],V=q[1];z.useEffect(function(){if(R){var me="yst_legal_alert_dismissed_".concat(o,"_").concat(ne);V(window.localStorage.getItem(me)===null)}},[o,ne,R]);var de=function(Te){if(Te.preventDefault(),!!R){var je="yst_legal_alert_dismissed_".concat(o,"_").concat(ne);window.localStorage.setItem(je,"true"),V(!1)}},fe=function(Te){switch(Te){case"openai":return"OpenAI";case"perplexity":return"Perplexity";case"anthropic":return"Anthropic";default:return Te||"Unknown"}},Ne=(O==null||(r=O.analysis)===null||r===void 0||(r=r.scans)===null||r===void 0?void 0:r.map(function(me){return{value:me.aiProvider,label:fe(me.aiProvider)}}))||[{value:"",label:"Default model"}],te=k!=null&&k.some(function(me){return String(me.id)===String(a)})?a:k&&k.length>0?k[0].id:"latest",De=!S&&(k==null?void 0:k.length)===0;return y.jsxs(y.Fragment,{children:[y.jsx(bf,{isOpen:ue,onClose:X,onConfirm:function(){o&&a&&L({brandId:o,analysisId:a})},isLoading:$,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",i),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:[p||!v?y.jsx(A.SkeletonLoader,{className:"yst-inline-block yst-h-8 yst-w-64"}):y.jsxs(y.Fragment,{children:["Hi ",v,", "]})," "]})}),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",children:[y.jsxs(A.Button,{variant:"primary",className:"yst-gap-1.5",onClick:function(){return h("/setup")},disabled:S||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:S||C||w&&(w==null?void 0:w.length)<1,children:y.jsx(kO,{})}),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 B(!0)},disabled:S||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(yf,{className:"yst-h-4 yst-w-4"}),"Delete analysis"]})})]})})]})]}),y.jsx(La,{}),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(pu,{children:[y.jsx(A.Label,{htmlFor:"brand-name",children:"Brand"}),y.jsx(A.Select,{onChange:function(me){h("/brands/".concat(me.toString()))},id:"brand-name",value:o?Number(o):"loading",options:w&&w.length>0?w.map(function(me){return{value:me.id,label:me.name}}):[{value:"loading",label:"Loading..."}],disabled:C||!w||w.length<2||!o})]}),y.jsxs(pu,{children:[y.jsx(A.Label,{htmlFor:"analysis-date",children:"Analysis date"}),y.jsx(Q3,{analyses:k||[],selectedAnalysisId:te,onAnalysisSelect:function(me){h("/brands/".concat(o,"/analysis/").concat(String(me)))},isLoading:S,disabled:S||!k||k.length<1,id:"analysis-date"})]}),y.jsxs(pu,{children:[y.jsx(A.Label,{htmlFor:"ai-tool",children:"AI model"}),y.jsx(A.Select,{onChange:function(me){u(me)},id:"ai-tool",value:l,options:E||S?[{value:l,label:"Loading..."}]:Ne,disabled:E||S||[{}].length<2})]})]})]})}),y.jsx("div",{className:"ystaii-alerts yst-space-y-4",children:R&&ce&&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 below) and may contain errors. Please review before acting on it."})}),y.jsx("div",{className:"yst-ml-auto",children:y.jsx(A.Link,{onClick:de,variant:"default",children:y.jsx(_E,{})})})]})})}),De&&y.jsx(A.Alert,{variant:"warning",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-font-medium yst-text-amber-800 yst-mb-2",children:"No analyses available"}),y.jsx("p",{className:"yst-text-amber-700 yst-mb-0",children:"There are currently no analyses for this brand."})]})})}),ae&&y.jsx(mA,{brand:ae},ae.id)]})},rP=function(){var t,n,r,i=Us(),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($a,{title:"Mentions",tooltip:"The queries where your brand was mentioned."}),y.jsx(Ma,{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(yO,{className:"yst-text-green-500"}):y.jsx(BO,{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 lu,Dg;function xA(){if(Dg)return lu;Dg=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 lu=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},lu}var cu,Lg;function xf(){if(Lg)return cu;Lg=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return cu=e,cu}var uu,Ig;function eb(){return Ig||(Ig=1,uu=Function.call.bind(Object.prototype.hasOwnProperty)),uu}var du,Rg;function wA(){if(Rg)return du;Rg=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=xf(),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={})},du=i,du}var fu,Ng;function SA(){if(Ng)return fu;Ng=1;var e=Zv(),t=xA(),n=xf(),r=eb(),i=wA(),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 fu=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d(B){var J=B&&(c&&B[c]||B[u]);if(typeof J=="function")return J}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:C(),elementType:x(),instanceOf:k,node:E(),objectOf:_,oneOf:S,oneOfType:O,shape:D,exact:G};function g(B,J){return B===J?B!==0||1/B===1/J:B!==B&&J!==J}function m(B,J){this.message=B,this.data=J&&typeof J=="object"?J:{},this.stack=""}m.prototype=Error.prototype;function p(B){if(process.env.NODE_ENV!=="production")var J={},ae=0;function ne(Q,q,ce,W,de,fe,Le){if(W=W||f,fe=fe||ce,Le!==n){if(l){var te=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 te.name="Invariant Violation",te}else if(process.env.NODE_ENV!=="production"&&typeof console!="undefined"){var et=W+":"+ce;!J[et]&&ae<3&&(s("You are manually calling a React.PropTypes validation function for the `"+fe+"` prop on `"+W+"`. 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."),J[et]=!0,ae++)}}return q[ce]==null?Q?q[ce]===null?new m("The "+de+" `"+fe+"` is marked as required "+("in `"+W+"`, but its value is `null`.")):new m("The "+de+" `"+fe+"` is marked as required in "+("`"+W+"`, but its value is `undefined`.")):null:B(q,ce,W,de,fe)}var R=ne.bind(null,!1);return R.isRequired=ne.bind(null,!0),R}function v(B){function J(ae,ne,R,Q,q,ce){var W=ae[ne],de=M(W);if(de!==B){var fe=I(W);return new m("Invalid "+Q+" `"+q+"` of type "+("`"+fe+"` supplied to `"+R+"`, expected ")+("`"+B+"`."),{expectedType:B})}return null}return p(J)}function b(){return p(o)}function w(B){function J(ae,ne,R,Q,q){if(typeof B!="function")return new m("Property `"+q+"` of component `"+R+"` has invalid PropType notation inside arrayOf.");var ce=ae[ne];if(!Array.isArray(ce)){var W=M(ce);return new m("Invalid "+Q+" `"+q+"` of type "+("`"+W+"` supplied to `"+R+"`, expected an array."))}for(var de=0;de<ce.length;de++){var fe=B(ce,de,R,Q,q+"["+de+"]",n);if(fe instanceof Error)return fe}return null}return p(J)}function C(){function B(J,ae,ne,R,Q){var q=J[ae];if(!a(q)){var ce=M(q);return new m("Invalid "+R+" `"+Q+"` of type "+("`"+ce+"` supplied to `"+ne+"`, expected a single ReactElement."))}return null}return p(B)}function x(){function B(J,ae,ne,R,Q){var q=J[ae];if(!e.isValidElementType(q)){var ce=M(q);return new m("Invalid "+R+" `"+Q+"` of type "+("`"+ce+"` supplied to `"+ne+"`, expected a single ReactElement type."))}return null}return p(B)}function k(B){function J(ae,ne,R,Q,q){if(!(ae[ne]instanceof B)){var ce=B.name||f,W=ue(ae[ne]);return new m("Invalid "+Q+" `"+q+"` of type "+("`"+W+"` supplied to `"+R+"`, expected ")+("instance of `"+ce+"`."))}return null}return p(J)}function S(B){if(!Array.isArray(B))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 J(ae,ne,R,Q,q){for(var ce=ae[ne],W=0;W<B.length;W++)if(g(ce,B[W]))return null;var de=JSON.stringify(B,function(Le,te){var et=I(te);return et==="symbol"?String(te):te});return new m("Invalid "+Q+" `"+q+"` of value `"+String(ce)+"` "+("supplied to `"+R+"`, expected one of "+de+"."))}return p(J)}function _(B){function J(ae,ne,R,Q,q){if(typeof B!="function")return new m("Property `"+q+"` of component `"+R+"` has invalid PropType notation inside objectOf.");var ce=ae[ne],W=M(ce);if(W!=="object")return new m("Invalid "+Q+" `"+q+"` of type "+("`"+W+"` supplied to `"+R+"`, expected an object."));for(var de in ce)if(r(ce,de)){var fe=B(ce,de,R,Q,q+"."+de,n);if(fe instanceof Error)return fe}return null}return p(J)}function O(B){if(!Array.isArray(B))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var J=0;J<B.length;J++){var ae=B[J];if(typeof ae!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+oe(ae)+" at index "+J+"."),o}function ne(R,Q,q,ce,W){for(var de=[],fe=0;fe<B.length;fe++){var Le=B[fe],te=Le(R,Q,q,ce,W,n);if(te==null)return null;te.data&&r(te.data,"expectedType")&&de.push(te.data.expectedType)}var et=de.length>0?", expected one of type ["+de.join(", ")+"]":"";return new m("Invalid "+ce+" `"+W+"` supplied to "+("`"+q+"`"+et+"."))}return p(ne)}function E(){function B(J,ae,ne,R,Q){return N(J[ae])?null:new m("Invalid "+R+" `"+Q+"` supplied to "+("`"+ne+"`, expected a ReactNode."))}return p(B)}function T(B,J,ae,ne,R){return new m((B||"React class")+": "+J+" type `"+ae+"."+ne+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+R+"`.")}function D(B){function J(ae,ne,R,Q,q){var ce=ae[ne],W=M(ce);if(W!=="object")return new m("Invalid "+Q+" `"+q+"` of type `"+W+"` "+("supplied to `"+R+"`, expected `object`."));for(var de in B){var fe=B[de];if(typeof fe!="function")return T(R,Q,q,de,I(fe));var Le=fe(ce,de,R,Q,q+"."+de,n);if(Le)return Le}return null}return p(J)}function G(B){function J(ae,ne,R,Q,q){var ce=ae[ne],W=M(ce);if(W!=="object")return new m("Invalid "+Q+" `"+q+"` of type `"+W+"` "+("supplied to `"+R+"`, expected `object`."));var de=t({},ae[ne],B);for(var fe in de){var Le=B[fe];if(r(B,fe)&&typeof Le!="function")return T(R,Q,q,fe,I(Le));if(!Le)return new m("Invalid "+Q+" `"+q+"` key `"+fe+"` supplied to `"+R+"`.\nBad object: "+JSON.stringify(ae[ne],null," ")+`
47
+ Valid keys: `+JSON.stringify(Object.keys(B),null," "));var te=Le(ce,fe,R,Q,q+"."+fe,n);if(te)return te}return null}return p(J)}function N(B){switch(typeof B){case"number":case"string":case"undefined":return!0;case"boolean":return!B;case"object":if(Array.isArray(B))return B.every(N);if(B===null||a(B))return!0;var J=d(B);if(J){var ae=J.call(B),ne;if(J!==B.entries){for(;!(ne=ae.next()).done;)if(!N(ne.value))return!1}else for(;!(ne=ae.next()).done;){var R=ne.value;if(R&&!N(R[1]))return!1}}else return!1;return!0;default:return!1}}function L(B,J){return B==="symbol"?!0:J?J["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&J instanceof Symbol:!1}function M(B){var J=typeof B;return Array.isArray(B)?"array":B instanceof RegExp?"object":L(J,B)?"symbol":J}function I(B){if(typeof B=="undefined"||B===null)return""+B;var J=M(B);if(J==="object"){if(B instanceof Date)return"date";if(B instanceof RegExp)return"regexp"}return J}function oe(B){var J=I(B);switch(J){case"array":case"object":return"an "+J;case"boolean":case"date":case"regexp":return"a "+J;default:return J}}function ue(B){return!B.constructor||!B.constructor.name?f:B.constructor.name}return h.checkPropTypes=i,h.resetWarningCache=i.resetWarningCache,h.PropTypes=h,h},fu}var hu,Fg;function CA(){if(Fg)return hu;Fg=1;var e=xf();function t(){}function n(){}return n.resetWarningCache=t,hu=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},hu}var Bg;function _A(){if(Bg)return Za.exports;if(Bg=1,process.env.NODE_ENV!=="production"){var e=Zv(),t=!0;Za.exports=SA()(e.isElement,t)}else Za.exports=CA()();return Za.exports}var kA=_A();const bd=Xp(kA);var La=function(t){var n=t.className,r=n===void 0?"":n;return y.jsx("hr",{className:Ce("yst-my-6",r)})};La.propTypes={className:bd.string};const tb=6048e5,OA=864e5,qg=Symbol.for("constructDateFrom");function en(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&qg in e?e[qg](t):e instanceof Date?new e.constructor(t):new Date(t)}function zt(e,t){return en(t||e,e)}function nb(e,t,n){const r=zt(e,n==null?void 0:n.in);if(isNaN(t))return en(e,NaN);if(!t)return r;const i=r.getDate(),s=en(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 EA={};function Ac(){return EA}function Zo(e,t){var a,l,c,u,d,f,h,g;const n=Ac(),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=zt(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 Ul(e,t){return Zo(e,{...t,weekStartsOn:1})}function rb(e,t){const n=zt(e,t==null?void 0:t.in),r=n.getFullYear(),i=en(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const s=Ul(i),o=en(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const a=Ul(o);return n.getTime()>=s.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function zg(e){const t=zt(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 Pc(e,...t){const n=en.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Wl(e,t){const n=zt(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function AA(e,t,n){const[r,i]=Pc(n==null?void 0:n.in,e,t),s=Wl(r),o=Wl(i),a=+s-zg(s),l=+o-zg(o);return Math.round((a-l)/OA)}function PA(e,t){const n=rb(e,t),r=en(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Ul(r)}function TA(e){return en(e,Date.now())}function jA(e,t,n){const[r,i]=Pc(n==null?void 0:n.in,e,t);return+Wl(r)==+Wl(i)}function $A(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function MA(e){return!(!$A(e)&&typeof e!="number"||isNaN(+zt(e)))}function DA(e,t){const n=zt(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 LA(e,t){const[n,r]=Pc(e,t.start,t.end);return{start:n,end:r}}function IA(e,t){const{start:n,end:r}=LA(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(en(n,o)),o.setDate(o.getDate()+a),o.setHours(0,0,0,0);return i?l.reverse():l}function RA(e,t){const n=zt(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function NA(e,t){const n=zt(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const FA={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"}},BA=(e,t,n)=>{let r;const i=FA[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 gu(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const qA={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},zA={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},HA={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},KA={date:gu({formats:qA,defaultWidth:"full"}),time:gu({formats:zA,defaultWidth:"full"}),dateTime:gu({formats:HA,defaultWidth:"full"})},UA={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},WA=(e,t,n,r)=>UA[e];function ao(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 VA={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},GA={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},QA={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"]},YA={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"]},XA={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"}},JA={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"}},ZA=(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"},e3={ordinalNumber:ZA,era:ao({values:VA,defaultWidth:"wide"}),quarter:ao({values:GA,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ao({values:QA,defaultWidth:"wide"}),day:ao({values:YA,defaultWidth:"wide"}),dayPeriod:ao({values:XA,defaultWidth:"wide",formattingValues:JA,defaultFormattingWidth:"wide"})};function lo(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)?n3(a,d=>d.test(o)):t3(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 t3(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function n3(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function r3(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 i3=/^(\d+)(th|st|nd|rd)?/i,s3=/\d+/i,o3={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},a3={any:[/^b/i,/^(a|c)/i]},l3={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},c3={any:[/1/i,/2/i,/3/i,/4/i]},u3={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},d3={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]},f3={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},h3={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]},g3={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},y3={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}},m3={ordinalNumber:r3({matchPattern:i3,parsePattern:s3,valueCallback:e=>parseInt(e,10)}),era:lo({matchPatterns:o3,defaultMatchWidth:"wide",parsePatterns:a3,defaultParseWidth:"any"}),quarter:lo({matchPatterns:l3,defaultMatchWidth:"wide",parsePatterns:c3,defaultParseWidth:"any",valueCallback:e=>e+1}),month:lo({matchPatterns:u3,defaultMatchWidth:"wide",parsePatterns:d3,defaultParseWidth:"any"}),day:lo({matchPatterns:f3,defaultMatchWidth:"wide",parsePatterns:h3,defaultParseWidth:"any"}),dayPeriod:lo({matchPatterns:g3,defaultMatchWidth:"any",parsePatterns:y3,defaultParseWidth:"any"})},p3={code:"en-US",formatDistance:BA,formatLong:KA,formatRelative:WA,localize:e3,match:m3,options:{weekStartsOn:0,firstWeekContainsDate:1}};function v3(e,t){const n=zt(e,t==null?void 0:t.in);return AA(n,NA(n))+1}function b3(e,t){const n=zt(e,t==null?void 0:t.in),r=+Ul(n)-+PA(n);return Math.round(r/tb)+1}function ib(e,t){var u,d,f,h,g,m,p,v;const n=zt(e,t==null?void 0:t.in),r=n.getFullYear(),i=Ac(),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=en((t==null?void 0:t.in)||e,0);o.setFullYear(r+1,0,s),o.setHours(0,0,0,0);const a=Zo(o,t),l=en((t==null?void 0:t.in)||e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const c=Zo(l,t);return+n>=+a?r+1:+n>=+c?r:r-1}function x3(e,t){var a,l,c,u,d,f,h,g;const n=Ac(),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=en((t==null?void 0:t.in)||e,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),Zo(s,t)}function w3(e,t){const n=zt(e,t==null?void 0:t.in),r=+Zo(n,t)-+x3(n,t);return Math.round(r/tb)+1}function Ge(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const vr={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Ge(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Ge(n+1,2)},d(e,t){return Ge(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 Ge(e.getHours()%12||12,t.length)},H(e,t){return Ge(e.getHours(),t.length)},m(e,t){return Ge(e.getMinutes(),t.length)},s(e,t){return Ge(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Ge(i,t.length)}},Hi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Hg={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 vr.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 Ge(o,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Ge(s,t.length)},R:function(e,t){const n=rb(e);return Ge(n,t.length)},u:function(e,t){const n=e.getFullYear();return Ge(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 Ge(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 Ge(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 vr.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 Ge(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=w3(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):Ge(i,t.length)},I:function(e,t,n){const r=b3(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Ge(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):vr.d(e,t)},D:function(e,t,n){const r=v3(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Ge(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 Ge(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 Ge(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 Ge(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=Hi.noon:r===0?i=Hi.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=Hi.evening:r>=12?i=Hi.afternoon:r>=4?i=Hi.morning:i=Hi.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 vr.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):vr.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Ge(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Ge(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):vr.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):vr.s(e,t)},S:function(e,t){return vr.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Ug(r);case"XXXX":case"XX":return ri(r);case"XXXXX":case"XXX":default:return ri(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Ug(r);case"xxxx":case"xx":return ri(r);case"xxxxx":case"xxx":default:return ri(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Kg(r,":");case"OOOO":default:return"GMT"+ri(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Kg(r,":");case"zzzz":default:return"GMT"+ri(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Ge(r,t.length)},T:function(e,t,n){return Ge(+e,t.length)}};function Kg(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+Ge(s,2)}function Ug(e,t){return e%60===0?(e>0?"-":"+")+Ge(Math.abs(e)/60,2):ri(e,t)}function ri(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Ge(Math.trunc(r/60),2),s=Ge(r%60,2);return n+i+t+s}const Wg=(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"})}},S3=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Wg(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}}",Wg(r,t)).replace("{{time}}",sb(i,t))},C3={p:sb,P:S3},_3=/^D+$/,k3=/^Y+$/,O3=["D","DD","YY","YYYY"];function E3(e){return _3.test(e)}function A3(e){return k3.test(e)}function P3(e,t,n){const r=T3(e,t,n);if(console.warn(r),O3.includes(e))throw new RangeError(r)}function T3(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 j3=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,$3=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,M3=/^'([^]*?)'?$/,D3=/''/g,L3=/[a-zA-Z]/;function _o(e,t,n){var u,d,f,h,g,m,p,v,b;const r=Ac(),i=(u=r.locale)!=null?u:p3,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=zt(e,n==null?void 0:n.in);if(!MA(a))throw new RangeError("Invalid time value");let l=t.match($3).map(w=>{const C=w[0];if(C==="p"||C==="P"){const x=C3[C];return x(w,i.formatLong)}return w}).join("").match(j3).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const C=w[0];if(C==="'")return{isToken:!1,value:I3(w)};if(Hg[C])return{isToken:!0,value:w};if(C.match(L3))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");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 C=w.value;(A3(C)||E3(C))&&P3(C,t,String(e));const x=Hg[C[0]];return x(a,C,i.localize,c)}).join("")}function I3(e){const t=e.match(M3);return t?t[1].replace(D3,"'"):e}function Vg(e,t,n){const[r,i]=Pc(n==null?void 0:n.in,e,t);return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()}function R3(e,t){return jA(en(e,e),TA(e))}function N3(e,t,n){return nb(e,-1,n)}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)}function yu(e,t,n){return(t=F3(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F3(e){var t=B3(e,"string");return ea(t)=="symbol"?t:t+""}function B3(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 Gg(e,t){return K3(e)||H3(e,t)||z3(e,t)||q3()}function q3(){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 z3(e,t){if(e){if(typeof e=="string")return Qg(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)?Qg(e,t):void 0}}function Qg(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 H3(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 K3(e){if(Array.isArray(e))return e}var Tn={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"}},U3=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=z.useState(new Date),d=Gg(u,2),f=d[0],h=d[1],g=function(_){if(!_)return null;var O=_.slice(0,10),E=O.split("-"),T=Gg(E,3),D=T[0],G=T[1],N=T[2],L=Number(D),M=Number(G),I=Number(N);return Number.isNaN(L)||Number.isNaN(M)||Number.isNaN(I)||M<1||M>12||I<1||I>31?null:new Date(L,M-1,I)},m=z.useMemo(function(){var S=new Map;return n.forEach(function(_){var O=g(_.createdAt),E=O?_o(O,"yyyy-MM-dd"):"";E&&(S.has(E)||S.set(E,[]),S.get(E).push(_))}),S},[n]);z.useEffect(function(){if(l&&r){var S=n.find(function(T){return T.id===r});if(S){var _=g(S.createdAt);_&&h(_)}}else if(l&&n.length>0){var O=n.reduce(function(T,D){return new Date(D.createdAt)>new Date(T.createdAt)?D:T}),E=g(O.createdAt);E&&h(E)}},[l,r,n]);var p=z.useMemo(function(){return n.length===0?null:n.reduce(function(S,_){return new Date(_.createdAt)>new Date(S.createdAt)?_:S})},[n]),v=function(){if(p){var _=g(p.createdAt);_&&h(_)}},b=z.useMemo(function(){if(!p)return!1;var S=g(p.createdAt);return S?Vg(S,f):!1},[p,f]),w=z.useMemo(function(){var S=RA(f),_=DA(f),O=new Date(S),E=O.getDay(),T=E===0?6:E-1;O.setDate(O.getDate()-T);var D=new Date(_),G=D.getDay(),N=G===0?0:7-G;return D.setDate(D.getDate()+N),IA({start:O,end:D}).map(function(L){var M=_o(L,"yyyy-MM-dd"),I=m.get(M)||[],oe=I.find(function(ue){return String(ue.id)===String(r)});return{date:M,dateObj:L,isCurrentMonth:Vg(L,f),isToday:R3(L),isSelected:!!oe,hasAnalyses:I.length>0,analyses:I}})},[f,m,r]),C=function(){h(function(_){return N3(_)})},x=function(){h(function(_){return nb(_,1)})},k=function(_){if(_.hasAnalyses){if(_.analyses.length===1)i(_.analyses[0].id);else{var O=_.analyses.reduce(function(E,T){return new Date(T.createdAt)>new Date(E.createdAt)?T:E});i(O.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:C,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(vO,{className:"yst-h-5 yst-w-5"})]}),y.jsx("h2",{className:"yst-text-sm yst-font-semibold yst-text-slate-900",children:_o(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(xO,{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(S,_){return y.jsx("div",{className:"yst-py-2 yst-text-center yst-text-xs yst-font-medium yst-text-slate-500",children:S},"".concat(S,"-").concat(_))})}),y.jsx("div",{className:"yst-grid yst-grid-cols-7 yst-gap-x-1",children:w.map(function(S){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 k(S)},disabled:!S.hasAnalyses,className:Ce("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":S.isCurrentMonth,"yst-text-slate-400":!S.isCurrentMonth},{"focus:yst-outline-none focus:yst-ring-2 focus:yst-ring-blue-500":S.hasAnalyses,"yst-cursor-not-allowed":!S.hasAnalyses,"yst-cursor-pointer":S.hasAnalyses},yu({},"".concat(Tn.selected.background," ").concat(Tn.selected.text," ").concat(Tn.selected.hover),S.isSelected),yu({},"".concat(Tn.hasAnalysis.border," ").concat(Tn.hasAnalysis.text," ").concat(Tn.hasAnalysis.hover),S.hasAnalyses&&!S.isSelected)),children:[y.jsx("span",{className:Ce("yst-relative yst-z-10 yst-w-4",yu({},Tn.today.underline,S.isToday&&!S.isSelected)),children:_o(S.dateObj,"d")}),S.hasAnalyses&&S.analyses.length>1&&!S.isSelected&&y.jsx("span",{className:Ce("yst-absolute yst-right-1 yst-top-1 yst-h-2 yst-w-2 yst-rounded-full",Tn.indicator.default)})]})},S.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(Tn.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(Tn.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(A.Button,{onClick:v,className:"yst-w-full",disabled:b,children:"Show latest analysis"})})]}):null};function mu(e,t){return Q3(e)||G3(e,t)||V3(e,t)||W3()}function W3(){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 V3(e,t){if(e){if(typeof e=="string")return Yg(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)?Yg(e,t):void 0}}function Yg(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 G3(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 Q3(e){if(Array.isArray(e))return e}var Y3=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=z.useState(!1),f=mu(d,2),h=f[0],g=f[1],m=z.useState("latest"),p=mu(m,2),v=p[0],b=p[1],w=z.useRef(null),C=function(L){if(!L)return null;var M=L.slice(0,10),I=M.split("-"),oe=mu(I,3),ue=oe[0],B=oe[1],J=oe[2],ae=Number(ue),ne=Number(B),R=Number(J);return Number.isNaN(ae)||Number.isNaN(ne)||Number.isNaN(R)||ne<1||ne>12||R<1||R>31?null:new Date(ae,ne-1,R)},x=function(L){var M=C(L.createdAt);return M?M.getTime():-1/0};z.useEffect(function(){if((r==="latest"||!r)&&n.length>0&&!o){var N=n.reduce(function(L,M){return x(M)>x(L)?M:L});i(N.id)}},[n,r,i,o]);var k=z.useMemo(function(){if(r==="latest"||!r){if(n.length>0){var N=n.reduce(function(L,M){return x(M)>x(L)?M:L});return N.id}return"latest"}return r},[r,n,x]);z.useEffect(function(){b(k)},[k]);var S=n.find(function(N){return String(N.id)===String(v)}),_=n.length>0?String(n.reduce(function(N,L){return x(L)>x(N)?L:N}).id):"",O=function(){if(S){var N=C(S.createdAt),L=N?_o(N,"MMMM d, yyyy"):S.createdAt?S.createdAt.slice(0,10):"Unknown date",M=String(S.id)===_?"(latest)":"(older)";return"".concat(L," ").concat(M)}return n.length>0?"Select date...":"No analyses available"}();z.useEffect(function(){var N=function(M){w.current&&!w.current.contains(M.target)&&g(!1)};return h&&document.addEventListener("mousedown",N),function(){document.removeEventListener("mousedown",N)}},[h]);var E=function(){!l&&!o&&g(!h)},T=function(L){b(L),i(L),g(!1)},D=function(){g(!1)},G=function(L){L.key==="Enter"||L.key===" "?(L.preventDefault(),E()):L.key==="Escape"&&g(!1)};return y.jsxs("div",{ref:w,className:"yst-relative",children:[y.jsxs("div",{className:"yst-relative",children:[y.jsx(A.TextInput,{id:u,onClick:E,onKeyDown:G,onChange:function(){},disabled:l||o,value:O,"aria-expanded":h,"aria-haspopup":"true","aria-label":"Select analysis date",className:Ce("yst-pr-10",{"yst-cursor-default":!l&&!o})}),y.jsx(gO,{className:Ce("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(U3,{analyses:n,selectedAnalysisId:v,onAnalysisSelect:T,isLoading:o,isOpen:h,onClose:D})]})},Xg;function Jg(e,t){return eP(e)||Z3(e,t)||J3(e,t)||X3()}function X3(){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 J3(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 Z3(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 eP(e){if(Array.isArray(e))return e}function xd(){/*! 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 Wt(b,"_invoke",function(w,C,x){var k,S,_,O=0,E=x||[],T=!1,D={p:0,n:0,v:e,a:G,f:G.bind(e,4),d:function(L,M){return k=L,S=0,_=e,D.n=M,o}};function G(N,L){for(S=N,_=L,t=0;!T&&O&&!M&&t<E.length;t++){var M,I=E[t],oe=D.p,ue=I[2];N>3?(M=ue===L)&&(_=I[(S=I[4])?5:(S=3,3)],I[4]=I[5]=e):I[0]<=oe&&((M=N<2&&oe<I[1])?(S=0,D.v=L,D.n=I[1]):oe<ue&&(M=N<3||I[0]>L||L>ue)&&(I[4]=N,I[5]=L,D.n=ue,S=0))}if(M||N>1)return o;throw T=!0,L}return function(N,L,M){if(O>1)throw TypeError("Generator is already running");for(T&&L===1&&G(L,M),S=L,_=M;(t=S<2?e:_)||!T;){k||(S?S<3?(S>1&&(D.n=-1),G(S,_)):D.n=_:D.v=_);try{if(O=2,k){if(S||(N="next"),t=k[N]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,S<2&&(S=0)}else S===1&&(t=k.return)&&t.call(k),S<2&&(_=TypeError("The iterator does not provide a '"+N+"' method"),S=1);k=e}else if((t=(T=D.n<0)?_:w.call(C,D))!==o)break}catch(I){k=e,S=1,_=I}finally{O=1}}return{value:t,done:T}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Wt(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,Wt(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=c,Wt(d,"constructor",c),Wt(c,"constructor",l),l.displayName="GeneratorFunction",Wt(c,i,"GeneratorFunction"),Wt(d),Wt(d,i,"Generator"),Wt(d,r,function(){return this}),Wt(d,"toString",function(){return"[object Generator]"}),(xd=function(){return{w:s,m:f}})()}function Wt(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Wt=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){Wt(o,f,function(g){return this._invoke(f,h,g)})};u("next",0),u("throw",1),u("return",2)}},Wt(e,t,n,r)}function ey(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 tP(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){ey(s,r,i,o,a,"next",l)}function a(l){ey(s,r,i,o,a,"throw",l)}o(void 0)})}}function nP(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var pu=Da(Xg||(Xg=nP(["yst-flex-1 yst-space-y-2"]))),rP=function(t){var n,r,i=t.className,s=En(),o=s.brandId,a=s.analysisId,l=s.model,c=Oc(),u=c.setModel,d=c.setAnalysisId,f=qt(),h=gn(),g=kc({query:{select:function(Ie){var Re=Ie.data;return Re==null?void 0:Re.data}}}),m=g.data,p=g.isLoading,v=m==null?void 0:m.displayName,b=Ri({query:{select:function(Ie){var Re=Ie.data;return Re==null?void 0:Re.brands}}}),w=b.data,C=b.isLoading,x=Rv(o,{query:{enabled:!!o,select:function(Ie){var Re=Ie.data;return Re==null?void 0:Re.analyses}}}),k=x.data,S=x.isLoading,_=_c(o,a,{query:{enabled:!!o&&!!a,select:function(Ie){var Re=Ie.data;return Re}}}),O=_.data,E=_.isLoading,T=Kk(o,{query:{enabled:!!o,select:function(Ie){var Re=Ie.data;return Re}}}),D=T.data,G=T.isLoading,N=mk({mutation:{onSuccess:function(){var _e=tP(xd().m(function Re(){var ze,V;return xd().w(function(Ee){for(;;)switch(Ee.n){case 0:return Ee.n=1,Promise.all([f.invalidateQueries({queryKey:Iv(o)}),f.invalidateQueries({queryKey:Nv(o,a)}),f.invalidateQueries({queryKey:hf(o)})]);case 1:ze=(k==null?void 0:k.filter(function(He){return String(He.id)!==String(a)}))||[],ze.length>0?(V=ze.reduce(function(He,$e){var Me=He.createdAt?new Date(He.createdAt).getTime():0,he=$e.createdAt?new Date($e.createdAt).getTime():0;return he>Me?$e:He}),d(V.id),h("/brands/".concat(o,"/analysis/").concat(V.id))):(d("latest"),h("/brands/".concat(o))),B(!1);case 2:return Ee.a(2)}},Re)}));function Ie(){return _e.apply(this,arguments)}return Ie}()}}),L=N.mutate,M=N.isPending;z.useEffect(function(){!G&&!E&&o&&w&&(w==null?void 0:w.length)<2&&(!D||Array.isArray(D)&&D.length===0)&&(k==null?void 0:k.length)===0&&h("/setup/".concat(o,"/queries"))},[G,E,D,o,h,w,k==null?void 0:k.length]);var I=z.useState(!1),oe=Jg(I,2),ue=oe[0],B=oe[1],J=function(){B(!1)},ae=w==null?void 0:w.find(function(_e){return String(_e.id)===String(o)}),ne=O==null||(n=O.analysis)===null||n===void 0?void 0:n.id,R=o!=null&&typeof ne=="number"&&!isNaN(ne),Q=z.useState(!1),q=Jg(Q,2),ce=q[0],W=q[1];z.useEffect(function(){if(R){var _e="yst_legal_alert_dismissed_".concat(o,"_").concat(ne);W(window.localStorage.getItem(_e)===null)}},[o,ne,R]);var de=function(Ie){if(Ie.preventDefault(),!!R){var Re="yst_legal_alert_dismissed_".concat(o,"_").concat(ne);window.localStorage.setItem(Re,"true"),W(!1)}},fe=function(Ie){switch(Ie){case"openai":return"OpenAI";case"perplexity":return"Perplexity";case"anthropic":return"Anthropic";default:return Ie||"Unknown"}},Le=(O==null||(r=O.analysis)===null||r===void 0||(r=r.scans)===null||r===void 0?void 0:r.map(function(_e){return{value:_e.aiProvider,label:fe(_e.aiProvider)}}))||[{value:"",label:"Default model"}],te=k!=null&&k.some(function(_e){return String(_e.id)===String(a)})?a:k&&k.length>0?k[0].id:"latest",et=!S&&(k==null?void 0:k.length)===0;return y.jsxs(y.Fragment,{children:[y.jsx(bf,{isOpen:ue,onClose:J,onConfirm:function(){o&&a&&L({brandId:o,analysisId:a})},isLoading:M,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:Ce("yst-relative yst-overflow-visible",i),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:[p||!v?y.jsx(A.SkeletonLoader,{className:"yst-inline-block yst-h-8 yst-w-64"}):y.jsxs(y.Fragment,{children:["Hi ",v,", "]})," "]})}),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",children:[y.jsxs(A.Button,{variant:"primary",className:"yst-gap-1.5",onClick:function(){return h("/setup")},disabled:S||C,children:[y.jsx(Uv,{})," 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:S||C||w&&(w==null?void 0:w.length)<1,children:y.jsx(OO,{})}),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 B(!0)},disabled:S||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(yf,{className:"yst-h-4 yst-w-4"}),"Delete analysis"]})})]})})]})]}),y.jsx(La,{}),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(pu,{children:[y.jsx(A.Label,{htmlFor:"brand-name",children:"Brand"}),y.jsx(A.Select,{onChange:function(_e){h("/brands/".concat(_e.toString()))},id:"brand-name",value:o?Number(o):"loading",options:w&&w.length>0?w.map(function(_e){return{value:_e.id,label:_e.name}}):[{value:"loading",label:"Loading..."}],disabled:C||!w||w.length<2||!o})]}),y.jsxs(pu,{children:[y.jsx(A.Label,{htmlFor:"analysis-date",children:"Analysis date"}),y.jsx(Y3,{analyses:k||[],selectedAnalysisId:te,onAnalysisSelect:function(_e){h("/brands/".concat(o,"/analysis/").concat(String(_e)))},isLoading:S,disabled:S||!k||k.length<1,id:"analysis-date"})]}),y.jsxs(pu,{children:[y.jsx(A.Label,{htmlFor:"ai-tool",children:"AI model"}),y.jsx(A.Select,{onChange:function(_e){u(_e)},id:"ai-tool",value:l,options:E||S?[{value:l,label:"Loading..."}]:Le,disabled:E||S||[{}].length<2})]})]})]})}),y.jsx("div",{className:"ystaii-alerts yst-space-y-4",children:R&&ce&&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 below) and may contain errors. Please review before acting on it."})}),y.jsx("div",{className:"yst-ml-auto",children:y.jsx(A.Link,{onClick:de,variant:"default",children:y.jsx(kE,{})})})]})})}),et&&y.jsx(A.Alert,{variant:"warning",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-font-medium yst-text-amber-800 yst-mb-2",children:"No analyses available"}),y.jsx("p",{className:"yst-text-amber-700 yst-mb-0",children:"There are currently no analyses for this brand."})]})})}),ae&&y.jsx(pA,{brand:ae},ae.id)]})},iP=function(){var t,n,r,i=Us(),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(Ma,{title:"Mentions",tooltip:"The queries where your brand was mentioned."}),y.jsx($a,{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:Ce("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(mO,{className:"yst-text-green-500"}):y.jsx(qO,{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"})]})})};/*!
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 Ia(e){return e+.5|0}const $r=(e,t,n)=>Math.max(Math.min(e,n),t);function ko(e){return $r(Ia(e*2.55),0,255)}function Nr(e){return $r(Ia(e*255),0,255)}function Jn(e){return $r(Ia(e/2.55)/100,0,1)}function ty(e){return $r(Ia(e*100),0,100)}const tn={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},wd=[..."0123456789ABCDEF"],iP=e=>wd[e&15],sP=e=>wd[(e&240)>>4]+wd[e&15],tl=e=>(e&240)>>4===(e&15),oP=e=>tl(e.r)&&tl(e.g)&&tl(e.b)&&tl(e.a);function aP(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&tn[e[1]]*17,g:255&tn[e[2]]*17,b:255&tn[e[3]]*17,a:t===5?tn[e[4]]*17:255}:(t===7||t===9)&&(n={r:tn[e[1]]<<4|tn[e[2]],g:tn[e[3]]<<4|tn[e[4]],b:tn[e[5]]<<4|tn[e[6]],a:t===9?tn[e[7]]<<4|tn[e[8]]:255})),n}const lP=(e,t)=>e<255?t(e):"";function cP(e){var t=oP(e)?iP:sP;return e?"#"+t(e.r)+t(e.g)+t(e.b)+lP(e.a,t):void 0}const uP=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function sb(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 dP(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 fP(e,t,n){const r=sb(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 hP(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 wf(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=hP(n,r,i,u,s),l=l*60+.5),[l|0,c||0,a]}function Sf(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(Nr)}function Cf(e,t,n){return Sf(sb,e,t,n)}function gP(e,t,n){return Sf(fP,e,t,n)}function yP(e,t,n){return Sf(dP,e,t,n)}function ob(e){return(e%360+360)%360}function mP(e){const t=uP.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?ko(+t[5]):Nr(+t[5]));const i=ob(+t[2]),s=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?r=gP(i,s,o):t[1]==="hsv"?r=yP(i,s,o):r=Cf(i,s,o),{r:r[0],g:r[1],b:r[2],a:n}}function pP(e,t){var n=wf(e);n[0]=ob(n[0]+t),n=Cf(n),e.r=n[0],e.g=n[1],e.b=n[2]}function vP(e){if(!e)return;const t=wf(e),n=t[0],r=ty(t[1]),i=ty(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${i}%, ${Jn(e.a)})`:`hsl(${n}, ${r}%, ${i}%)`}const ny={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"},ry={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 bP(){const e={},t=Object.keys(ry),n=Object.keys(ny);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,ny[s]);s=parseInt(ry[o],16),e[a]=[s>>16&255,s>>8&255,s&255]}return e}let nl;function xP(e){nl||(nl=bP(),nl.transparent=[0,0,0,0]);const t=nl[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const wP=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function SP(e){const t=wP.exec(e);let n=255,r,i,s;if(t){if(t[7]!==r){const o=+t[7];n=t[8]?ko(o):$r(o*255,0,255)}return r=+t[1],i=+t[3],s=+t[5],r=255&(t[2]?ko(r):$r(r,0,255)),i=255&(t[4]?ko(i):$r(i,0,255)),s=255&(t[6]?ko(s):$r(s,0,255)),{r,g:i,b:s,a:n}}}function CP(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Jn(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const vu=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Ki=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function _P(e,t,n){const r=Ki(Jn(e.r)),i=Ki(Jn(e.g)),s=Ki(Jn(e.b));return{r:Nr(vu(r+n*(Ki(Jn(t.r))-r))),g:Nr(vu(i+n*(Ki(Jn(t.g))-i))),b:Nr(vu(s+n*(Ki(Jn(t.b))-s))),a:e.a+n*(t.a-e.a)}}function rl(e,t,n){if(e){let r=wf(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=Cf(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function ab(e,t){return e&&Object.assign(t||{},e)}function iy(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=Nr(e[3]))):(t=ab(e,{r:0,g:0,b:0,a:1}),t.a=Nr(t.a)),t}function kP(e){return e.charAt(0)==="r"?SP(e):mP(e)}class ta{constructor(t){if(t instanceof ta)return t;const n=typeof t;let r;n==="object"?r=iy(t):n==="string"&&(r=aP(t)||xP(t)||kP(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=ab(this._rgb);return t&&(t.a=Jn(t.a)),t}set rgb(t){this._rgb=iy(t)}rgbString(){return this._valid?CP(this._rgb):void 0}hexString(){return this._valid?cP(this._rgb):void 0}hslString(){return this._valid?vP(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=_P(this._rgb,t._rgb,n)),this}clone(){return new ta(this.rgb)}alpha(t){return this._rgb.a=Nr(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Ia(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 rl(this._rgb,2,t),this}darken(t){return rl(this._rgb,2,-t),this}saturate(t){return rl(this._rgb,1,t),this}desaturate(t){return rl(this._rgb,1,-t),this}rotate(t){return pP(this._rgb,t),this}}/*!
55
+ */function Ia(e){return e+.5|0}const Mr=(e,t,n)=>Math.max(Math.min(e,n),t);function ko(e){return Mr(Ia(e*2.55),0,255)}function Nr(e){return Mr(Ia(e*255),0,255)}function Jn(e){return Mr(Ia(e/2.55)/100,0,1)}function ty(e){return Mr(Ia(e*100),0,100)}const tn={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},wd=[..."0123456789ABCDEF"],sP=e=>wd[e&15],oP=e=>wd[(e&240)>>4]+wd[e&15],tl=e=>(e&240)>>4===(e&15),aP=e=>tl(e.r)&&tl(e.g)&&tl(e.b)&&tl(e.a);function lP(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&tn[e[1]]*17,g:255&tn[e[2]]*17,b:255&tn[e[3]]*17,a:t===5?tn[e[4]]*17:255}:(t===7||t===9)&&(n={r:tn[e[1]]<<4|tn[e[2]],g:tn[e[3]]<<4|tn[e[4]],b:tn[e[5]]<<4|tn[e[6]],a:t===9?tn[e[7]]<<4|tn[e[8]]:255})),n}const cP=(e,t)=>e<255?t(e):"";function uP(e){var t=aP(e)?sP:oP;return e?"#"+t(e.r)+t(e.g)+t(e.b)+cP(e.a,t):void 0}const dP=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ob(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 fP(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 hP(e,t,n){const r=ob(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 gP(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 wf(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=gP(n,r,i,u,s),l=l*60+.5),[l|0,c||0,a]}function Sf(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(Nr)}function Cf(e,t,n){return Sf(ob,e,t,n)}function yP(e,t,n){return Sf(hP,e,t,n)}function mP(e,t,n){return Sf(fP,e,t,n)}function ab(e){return(e%360+360)%360}function pP(e){const t=dP.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?ko(+t[5]):Nr(+t[5]));const i=ab(+t[2]),s=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?r=yP(i,s,o):t[1]==="hsv"?r=mP(i,s,o):r=Cf(i,s,o),{r:r[0],g:r[1],b:r[2],a:n}}function vP(e,t){var n=wf(e);n[0]=ab(n[0]+t),n=Cf(n),e.r=n[0],e.g=n[1],e.b=n[2]}function bP(e){if(!e)return;const t=wf(e),n=t[0],r=ty(t[1]),i=ty(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${i}%, ${Jn(e.a)})`:`hsl(${n}, ${r}%, ${i}%)`}const ny={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"},ry={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 xP(){const e={},t=Object.keys(ry),n=Object.keys(ny);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,ny[s]);s=parseInt(ry[o],16),e[a]=[s>>16&255,s>>8&255,s&255]}return e}let nl;function wP(e){nl||(nl=xP(),nl.transparent=[0,0,0,0]);const t=nl[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const SP=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function CP(e){const t=SP.exec(e);let n=255,r,i,s;if(t){if(t[7]!==r){const o=+t[7];n=t[8]?ko(o):Mr(o*255,0,255)}return r=+t[1],i=+t[3],s=+t[5],r=255&(t[2]?ko(r):Mr(r,0,255)),i=255&(t[4]?ko(i):Mr(i,0,255)),s=255&(t[6]?ko(s):Mr(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}, ${Jn(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const vu=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Ki=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function kP(e,t,n){const r=Ki(Jn(e.r)),i=Ki(Jn(e.g)),s=Ki(Jn(e.b));return{r:Nr(vu(r+n*(Ki(Jn(t.r))-r))),g:Nr(vu(i+n*(Ki(Jn(t.g))-i))),b:Nr(vu(s+n*(Ki(Jn(t.b))-s))),a:e.a+n*(t.a-e.a)}}function rl(e,t,n){if(e){let r=wf(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=Cf(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function lb(e,t){return e&&Object.assign(t||{},e)}function iy(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=Nr(e[3]))):(t=lb(e,{r:0,g:0,b:0,a:1}),t.a=Nr(t.a)),t}function OP(e){return e.charAt(0)==="r"?CP(e):pP(e)}class ta{constructor(t){if(t instanceof ta)return t;const n=typeof t;let r;n==="object"?r=iy(t):n==="string"&&(r=lP(t)||wP(t)||OP(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=lb(this._rgb);return t&&(t.a=Jn(t.a)),t}set rgb(t){this._rgb=iy(t)}rgbString(){return this._valid?_P(this._rgb):void 0}hexString(){return this._valid?uP(this._rgb):void 0}hslString(){return this._valid?bP(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=kP(this._rgb,t._rgb,n)),this}clone(){return new ta(this.rgb)}alpha(t){return this._rgb.a=Nr(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Ia(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 rl(this._rgb,2,t),this}darken(t){return rl(this._rgb,2,-t),this}saturate(t){return rl(this._rgb,1,t),this}desaturate(t){return rl(this._rgb,1,-t),this}rotate(t){return vP(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 Wn(){}const OP=(()=>{let e=0;return()=>e++})();function Qe(e){return e==null}function it(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 gt(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function jn(e,t){return gt(e)?e:t}function $e(e,t){return typeof e=="undefined"?t:e}const EP=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Ze(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Ge(e,t,n,r){let i,s,o;if(it(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 Wl(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 Gl(e){if(it(e))return e.map(Gl);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]]=Gl(e[n[i]]);return t}return e}function lb(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function AP(e,t,n,r){if(!lb(e))return;const i=t[e],s=n[e];Fe(i)&&Fe(s)?na(i,s,r):t[e]=Gl(s)}function na(e,t,n){const r=it(t)?t:[t],i=r.length;if(!Fe(e))return e;n=n||{};const s=n.merger||AP;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 Lo(e,t){return na(e,t,{merger:PP})}function PP(e,t,n){if(!lb(e))return;const r=t[e],i=n[e];Fe(r)&&Fe(i)?Lo(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Gl(i))}const sy={"":e=>e,x:e=>e.x,y:e=>e.y};function TP(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 jP(e){const t=TP(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function ra(e,t){return(sy[t]||(sy[t]=jP(t)))(e)}function _f(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Ql=e=>typeof e!="undefined",zr=e=>typeof e=="function",oy=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function MP(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const ct=Math.PI,Jt=2*ct,$P=Jt+ct,Yl=Number.POSITIVE_INFINITY,DP=ct/180,Xt=ct/2,Zr=ct/4,ay=ct*2/3,cb=Math.log10,$s=Math.sign;function Io(e,t,n){return Math.abs(e-t)<n}function ly(e){const t=Math.round(e);e=Io(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(cb(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function LP(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 IP(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function ia(e){return!IP(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function RP(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function NP(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 Dr(e){return e*(ct/180)}function kf(e){return e*(180/ct)}function cy(e){if(!gt(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function FP(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*ct&&(s+=Jt),{angle:s,distance:i}}function Sd(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function BP(e,t){return(e-t+$P)%Jt-ct}function Gt(e){return(e%Jt+Jt)%Jt}function ub(e,t,n,r){const i=Gt(e),s=Gt(t),o=Gt(n),a=Gt(s-i),l=Gt(o-i),c=Gt(i-s),u=Gt(i-o);return i===s||i===o||r&&s===o||a>l&&c<u}function ln(e,t,n){return Math.max(t,Math.min(n,e))}function qP(e){return ln(e,-32768,32767)}function Xi(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function Of(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 ui=(e,t,n,r)=>Of(e,n,r?i=>{const s=e[i][t];return s<n||s===n&&e[i+1][t]===n}:i=>e[i][t]<n),zP=(e,t,n)=>Of(e,n,r=>e[r][t]>=n);function HP(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 db=["push","pop","shift","splice","unshift"];function KP(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),db.forEach(n=>{const r="_onData"+_f(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 uy(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)&&(db.forEach(s=>{delete e[s]}),delete e._chartjs)}function UP(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const fb=function(){return typeof window=="undefined"?function(e){return e()}:window.requestAnimationFrame}();function hb(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,fb.call(window,()=>{r=!1,e.apply(t,n)}))}}function VP(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const Ef=e=>e==="start"?"left":e==="end"?"right":"center",wt=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,WP=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function GP(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(ui(l,u,d).lo,n?r:ui(t,u,o.getPixelForValue(d)).lo),c){const m=l.slice(0,i+1).reverse().findIndex(p=>!Qe(p[a.axis]));i-=Math.max(0,m)}i=ln(i,0,r-1)}if(g){let m=Math.max(ui(l,o.axis,f,!0).hi+1,n?0:ui(t,u,o.getPixelForValue(f),!0).hi+1);if(c){const p=l.slice(m-1).findIndex(v=>!Qe(v[a.axis]));m+=Math.max(0,p)}s=ln(m,i,r)-i}else s=r-i}return{start:i,count:s}}function QP(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 il=e=>e===0||e===1,dy=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Jt/n)),fy=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Jt/n)+1,Ro={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*Xt)+1,easeOutSine:e=>Math.sin(e*Xt),easeInOutSine:e=>-.5*(Math.cos(ct*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=>il(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=>il(e)?e:dy(e,.075,.3),easeOutElastic:e=>il(e)?e:fy(e,.075,.3),easeInOutElastic(e){return il(e)?e:e<.5?.5*dy(e*2,.1125,.45):.5+.5*fy(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-Ro.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?Ro.easeInBounce(e*2)*.5:Ro.easeOutBounce(e*2-1)*.5+.5};function Af(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function hy(e){return Af(e)?e:new ta(e)}function bu(e){return Af(e)?e:new ta(e).saturate(.5).darken(.1).hexString()}const YP=["x","y","borderWidth","radius","tension"],XP=["color","borderColor","backgroundColor"];function JP(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:XP},numbers:{type:"number",properties:YP}}),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 ZP(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const gy=new Map;function eT(e,t){t=t||{};const n=e+JSON.stringify(t);let r=gy.get(n);return r||(r=new Intl.NumberFormat(e,t),gy.set(n,r)),r}function gb(e,t,n){return eT(t,n).format(e)}const tT={values(e){return it(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=nT(e,n)}const o=cb(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),gb(e,r,l)}};function nT(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 Pf={formatters:tT};function rT(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:Pf.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 Pi=Object.create(null),Cd=Object.create(null);function No(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 xu(e,t,n){return typeof t=="string"?na(No(e,t),n):na(No(e,""),t)}class iT{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)=>bu(i.backgroundColor),this.hoverBorderColor=(r,i)=>bu(i.borderColor),this.hoverColor=(r,i)=>bu(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 xu(this,t,n)}get(t){return No(this,t)}describe(t,n){return xu(Cd,t,n)}override(t,n){return xu(Pi,t,n)}route(t,n,r,i){const s=No(this,t),o=No(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):$e(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var at=new iT({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[JP,ZP,rT]);function sT(e){return!e||Qe(e.size)||Qe(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Xl(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 oT(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&&!it(d))o=Xl(e,i,s,o,d);else if(it(d))for(c=0,u=d.length;c<u;c++)f=d[c],f!=null&&!it(f)&&(o=Xl(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 ei(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 yy(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function _d(e,t,n,r){yb(e,t,n,r,null)}function yb(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)*DP;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,Jt):e.arc(n,r,m,0,Jt),e.closePath();break;case"triangle":u=i?i/2:m,e.moveTo(n+Math.sin(p)*u,r-Math.cos(p)*m),p+=ay,e.lineTo(n+Math.sin(p)*u,r-Math.cos(p)*m),p+=ay,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+Zr)*l,d=Math.cos(p+Zr)*(i?i/2-c:l),a=Math.sin(p+Zr)*l,f=Math.sin(p+Zr)*(i?i/2-c:l),e.arc(n-d,r-a,c,p-ct,p-Xt),e.arc(n+f,r-o,c,p-Xt,p),e.arc(n+d,r+a,c,p,p+Xt),e.arc(n-f,r+o,c,p+Xt,p+ct),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+=Zr;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+=Zr;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+=Zr,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 ir(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 Tc(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function jc(e){e.restore()}function aT(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 lT(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 cT(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),Qe(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 uT(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 dT(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Ti(e,t,n,r,i,s={}){const o=it(t)?t:[t],a=s.strokeWidth>0&&s.strokeColor!=="";let l,c;for(e.save(),e.font=i.string,cT(e,s),l=0;l<o.length;++l)c=o[l],s.backdrop&&dT(e,s.backdrop),a&&(s.strokeColor&&(e.strokeStyle=s.strokeColor),Qe(s.strokeWidth)||(e.lineWidth=s.strokeWidth),e.strokeText(c,n,r,s.maxWidth)),e.fillText(c,n,r,s.maxWidth),uT(e,n,r,c,s),r+=Number(i.lineHeight);e.restore()}function Jl(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*ct,ct,!0),e.lineTo(n,r+s-o.bottomLeft),e.arc(n+o.bottomLeft,r+s-o.bottomLeft,o.bottomLeft,ct,Xt,!0),e.lineTo(n+i-o.bottomRight,r+s),e.arc(n+i-o.bottomRight,r+s-o.bottomRight,o.bottomRight,Xt,0,!0),e.lineTo(n+i,r+o.topRight),e.arc(n+i-o.topRight,r+o.topRight,o.topRight,0,-Xt,!0),e.lineTo(n+o.topLeft,r)}const fT=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,hT=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function gT(e,t){const n=(""+e).match(fT);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 yT=e=>+e||0;function mb(e,t){const n={},r=Fe(t),i=r?Object.keys(t):t,s=Fe(e)?r?o=>$e(e[o],e[t[o]]):o=>e[o]:()=>e;for(const o of i)n[o]=yT(s(o));return n}function mT(e){return mb(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Ji(e){return mb(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Ot(e){const t=mT(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function dt(e,t){e=e||{},t=t||at.font;let n=$e(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=$e(e.style,t.style);r&&!(""+r).match(hT)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:$e(e.family,t.family),lineHeight:gT($e(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:$e(e.weight,t.weight),string:""};return i.string=sT(i),i}function sl(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 pT(e,t,n){const{min:r,max:i}=e,s=EP(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 Gr(e,t){return Object.assign(Object.create(e),t)}function Tf(e,t=[""],n,r,i=()=>e[0]){const s=n||e;typeof r=="undefined"&&(r=xb("_fallback",e));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:s,_fallback:r,_getTarget:i,override:a=>Tf([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 vb(a,l,()=>kT(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return py(a).includes(l)},ownKeys(a){return py(a)},set(a,l,c){const u=a._storage||(a._storage=i());return a[l]=u[l]=c,delete a._keys,!0}})}function Ds(e,t,n,r){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:pb(e,r),setContext:s=>Ds(e,s,n,r),override:s=>Ds(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 vb(s,o,()=>bT(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 pb(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:zr(n)?n:()=>n,isIndexable:zr(r)?r:()=>r}}const vT=(e,t)=>e?e+_f(t):t,jf=(e,t)=>Fe(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function vb(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function bT(e,t,n){const{_proxy:r,_context:i,_subProxy:s,_descriptors:o}=e;let a=r[t];return zr(a)&&o.isScriptable(t)&&(a=xT(t,a,e,n)),it(a)&&a.length&&(a=wT(t,a,e,o.isIndexable)),jf(t,a)&&(a=Ds(a,i,s&&s[t],o)),a}function xT(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),jf(e,l)&&(l=Mf(i._scopes,i,e,l)),l}function wT(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=Mf(c,i,e,u);t.push(Ds(d,s,o&&o[e],a))}}return t}function bb(e,t,n){return zr(e)?e(t,n):e}const ST=(e,t)=>e===!0?t:typeof e=="string"?ra(t,e):void 0;function CT(e,t,n,r,i){for(const s of t){const o=ST(n,s);if(o){e.add(o);const a=bb(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 Mf(e,t,n,r){const i=t._rootScopes,s=bb(t._fallback,n,r),o=[...e,...i],a=new Set;a.add(r);let l=my(a,o,n,s||n,r);return l===null||typeof s!="undefined"&&s!==n&&(l=my(a,o,s,l,r),l===null)?!1:Tf(Array.from(a),[""],i,s,()=>_T(t,n,r))}function my(e,t,n,r,i){for(;n;)n=CT(e,t,n,r,i);return n}function _T(e,t,n){const r=e._getTarget();t in r||(r[t]={});const i=r[t];return it(i)&&Fe(n)?n:i||{}}function kT(e,t,n,r){let i;for(const s of t)if(i=xb(vT(s,e),n),typeof i!="undefined")return jf(e,i)?Mf(n,r,e,i):i}function xb(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r!="undefined")return r}}function py(e){let t=e._keys;return t||(t=e._keys=OT(e._scopes)),t}function OT(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 ET(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(ra(u,s),c)};return o}const AT=Number.EPSILON||1e-14,Ls=(e,t)=>t<e.length&&!e[t].skip&&e[t],wb=e=>e==="x"?"y":"x";function PT(e,t,n,r){const i=e.skip?t:e,s=t,o=n.skip?t:n,a=Sd(s,i),l=Sd(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 TT(e,t,n){const r=e.length;let i,s,o,a,l,c=Ls(e,0);for(let u=0;u<r-1;++u)if(l=c,c=Ls(e,u+1),!(!l||!c)){if(Io(t[u],0,AT)){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 jT(e,t,n="x"){const r=wb(n),i=e.length;let s,o,a,l=Ls(e,0);for(let c=0;c<i;++c){if(o=a,a=l,l=Ls(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 MT(e,t="x"){const n=wb(t),r=e.length,i=Array(r).fill(0),s=Array(r);let o,a,l,c=Ls(e,0);for(o=0;o<r;++o)if(a=l,l=c,c=Ls(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?$s(i[o-1])!==$s(i[o])?0:(i[o-1]+i[o])/2:i[o-1]:i[o]}TT(e,i,s),jT(e,s,t)}function ol(e,t,n){return Math.max(Math.min(e,n),t)}function $T(e,t){let n,r,i,s,o,a=ir(e[0],t);for(n=0,r=e.length;n<r;++n)o=s,s=a,a=n<r-1&&ir(e[n+1],t),s&&(i=e[n],o&&(i.cp1x=ol(i.cp1x,t.left,t.right),i.cp1y=ol(i.cp1y,t.top,t.bottom)),a&&(i.cp2x=ol(i.cp2x,t.left,t.right),i.cp2y=ol(i.cp2y,t.top,t.bottom)))}function DT(e,t,n,r,i){let s,o,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")MT(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=PT(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&&$T(e,n)}function $f(){return typeof window!="undefined"&&typeof document!="undefined"}function Df(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Zl(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 Mc=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function LT(e,t){return Mc(e).getPropertyValue(t)}const IT=["top","right","bottom","left"];function _i(e,t,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const s=IT[i];r[s]=parseFloat(e[t+"-"+s+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const RT=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function NT(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:s}=r;let o=!1,a,l;if(RT(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 ii(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,i=Mc(n),s=i.boxSizing==="border-box",o=_i(i,"padding"),a=_i(i,"border","width"),{x:l,y:c,box:u}=NT(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 FT(e,t,n){let r,i;if(t===void 0||n===void 0){const s=e&&Df(e);if(!s)t=e.clientWidth,n=e.clientHeight;else{const o=s.getBoundingClientRect(),a=Mc(s),l=_i(a,"border","width"),c=_i(a,"padding");t=o.width-c.width-l.width,n=o.height-c.height-l.height,r=Zl(a.maxWidth,s,"clientWidth"),i=Zl(a.maxHeight,s,"clientHeight")}}return{width:t,height:n,maxWidth:r||Yl,maxHeight:i||Yl}}const al=e=>Math.round(e*10)/10;function BT(e,t,n,r){const i=Mc(e),s=_i(i,"margin"),o=Zl(i.maxWidth,e,"clientWidth")||Yl,a=Zl(i.maxHeight,e,"clientHeight")||Yl,l=FT(e,t,n);let{width:c,height:u}=l;if(i.boxSizing==="content-box"){const f=_i(i,"border","width"),h=_i(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=al(Math.min(c,o,l.maxWidth)),u=al(Math.min(u,a,l.maxHeight)),c&&!u&&(u=al(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=al(Math.floor(u*r))),{width:c,height:u}}function vy(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 qT=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};$f()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch(t){}return e}();function by(e,t){const n=LT(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function si(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function zT(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 HT(e,t,n,r){const i={x:e.cp2x,y:e.cp2y},s={x:t.cp1x,y:t.cp1y},o=si(e,i,n),a=si(i,s,n),l=si(s,t,n),c=si(o,a,n),u=si(a,l,n);return si(c,u,n)}const KT=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}}},UT=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Zi(e,t,n){return e?KT(t,n):UT()}function Sb(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 Cb(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function _b(e){return e==="angle"?{between:ub,compare:BP,normalize:Gt}:{between:Xi,compare:(t,n)=>t-n,normalize:t=>t}}function xy({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 VT(e,t,n){const{property:r,start:i,end:s}=n,{between:o,normalize:a}=_b(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 kb(e,t,n){if(!n)return[e];const{property:r,start:i,end:s}=n,o=t.length,{compare:a,between:l,normalize:c}=_b(r),{start:u,end:d,loop:f,style:h}=VT(e,t,n),g=[];let m=!1,p=null,v,b,w;const C=()=>l(i,w,v)&&a(i,w)!==0,x=()=>a(s,v)===0||l(s,w,v),k=()=>m||C(),S=()=>!m||x();for(let _=u,O=u;_<=d;++_)b=t[_%o],!b.skip&&(v=c(b[r]),v!==w&&(m=l(v,i,s),p===null&&k()&&(p=a(v,i)===0?_:O),p!==null&&S()&&(g.push(xy({start:p,end:_,loop:f,count:o,style:h})),p=null),O=_,w=v));return p!==null&&g.push(xy({start:p,end:d,loop:f,count:o,style:h})),g}function Ob(e,t){const n=[],r=e.segments;for(let i=0;i<r.length;i++){const s=kb(r[i],e.points,t);s.length&&n.push(...s)}return n}function WT(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 GT(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 QT(e,t){const n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];const s=!!e._loop,{start:o,end:a}=WT(n,i,s,r);if(r===!0)return wy(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 wy(e,GT(n,o,l,c),n,t)}function wy(e,t,n,r){return!r||!r.setContext||!n?t:YT(e,t,n,r)}function YT(e,t,n,r){const i=e._chart.getContext(),s=Sy(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=Sy(r.setContext(Gr(i,{type:"segment",p0:m,p1:v,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:o}))),XT(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 Sy(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function XT(e,t){if(!t)return!1;const n=[],r=function(i,s){return Af(s)?(n.includes(s)||n.push(s),n.indexOf(s)):s};return JSON.stringify(e,r)!==JSON.stringify(t,r)}function ll(e,t,n){return e.options.clip?e[n]:t[n]}function JT(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:ll(n,t,"left"),right:ll(n,t,"right"),top:ll(r,t,"top"),bottom:ll(r,t,"bottom")}:t}function Eb(e,t){const n=t._clip;if(n.disabled)return!1;const r=JT(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 Vn(){}const EP=(()=>{let e=0;return()=>e++})();function Ye(e){return e==null}function st(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 Ne(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function yt(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function jn(e,t){return yt(e)?e:t}function je(e,t){return typeof e=="undefined"?t:e}const AP=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Ze(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Qe(e,t,n,r){let i,s,o;if(st(e))for(s=e.length,i=0;i<s;i++)t.call(n,e[i],i);else if(Ne(e))for(o=Object.keys(e),s=o.length,i=0;i<s;i++)t.call(n,e[o[i]],o[i])}function Vl(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 Gl(e){if(st(e))return e.map(Gl);if(Ne(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let i=0;for(;i<r;++i)t[n[i]]=Gl(e[n[i]]);return t}return e}function cb(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function PP(e,t,n,r){if(!cb(e))return;const i=t[e],s=n[e];Ne(i)&&Ne(s)?na(i,s,r):t[e]=Gl(s)}function na(e,t,n){const r=st(t)?t:[t],i=r.length;if(!Ne(e))return e;n=n||{};const s=n.merger||PP;let o;for(let a=0;a<i;++a){if(o=r[a],!Ne(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 Lo(e,t){return na(e,t,{merger:TP})}function TP(e,t,n){if(!cb(e))return;const r=t[e],i=n[e];Ne(r)&&Ne(i)?Lo(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Gl(i))}const sy={"":e=>e,x:e=>e.x,y:e=>e.y};function jP(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 $P(e){const t=jP(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function ra(e,t){return(sy[t]||(sy[t]=$P(t)))(e)}function _f(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Ql=e=>typeof e!="undefined",zr=e=>typeof e=="function",oy=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function MP(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const ut=Math.PI,Jt=2*ut,DP=Jt+ut,Yl=Number.POSITIVE_INFINITY,LP=ut/180,Xt=ut/2,Zr=ut/4,ay=ut*2/3,ub=Math.log10,Ms=Math.sign;function Io(e,t,n){return Math.abs(e-t)<n}function ly(e){const t=Math.round(e);e=Io(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(ub(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function IP(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 RP(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function ia(e){return!RP(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function NP(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function FP(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 Dr(e){return e*(ut/180)}function kf(e){return e*(180/ut)}function cy(e){if(!yt(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function BP(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*ut&&(s+=Jt),{angle:s,distance:i}}function Sd(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function qP(e,t){return(e-t+DP)%Jt-ut}function Gt(e){return(e%Jt+Jt)%Jt}function db(e,t,n,r){const i=Gt(e),s=Gt(t),o=Gt(n),a=Gt(s-i),l=Gt(o-i),c=Gt(i-s),u=Gt(i-o);return i===s||i===o||r&&s===o||a>l&&c<u}function ln(e,t,n){return Math.max(t,Math.min(n,e))}function zP(e){return ln(e,-32768,32767)}function Xi(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function Of(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 ui=(e,t,n,r)=>Of(e,n,r?i=>{const s=e[i][t];return s<n||s===n&&e[i+1][t]===n}:i=>e[i][t]<n),HP=(e,t,n)=>Of(e,n,r=>e[r][t]>=n);function KP(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 fb=["push","pop","shift","splice","unshift"];function UP(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),fb.forEach(n=>{const r="_onData"+_f(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 uy(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)&&(fb.forEach(s=>{delete e[s]}),delete e._chartjs)}function WP(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const hb=function(){return typeof window=="undefined"?function(e){return e()}:window.requestAnimationFrame}();function gb(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,hb.call(window,()=>{r=!1,e.apply(t,n)}))}}function VP(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const Ef=e=>e==="start"?"left":e==="end"?"right":"center",St=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,GP=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function QP(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(ui(l,u,d).lo,n?r:ui(t,u,o.getPixelForValue(d)).lo),c){const m=l.slice(0,i+1).reverse().findIndex(p=>!Ye(p[a.axis]));i-=Math.max(0,m)}i=ln(i,0,r-1)}if(g){let m=Math.max(ui(l,o.axis,f,!0).hi+1,n?0:ui(t,u,o.getPixelForValue(f),!0).hi+1);if(c){const p=l.slice(m-1).findIndex(v=>!Ye(v[a.axis]));m+=Math.max(0,p)}s=ln(m,i,r)-i}else s=r-i}return{start:i,count:s}}function YP(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 il=e=>e===0||e===1,dy=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Jt/n)),fy=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Jt/n)+1,Ro={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*Xt)+1,easeOutSine:e=>Math.sin(e*Xt),easeInOutSine:e=>-.5*(Math.cos(ut*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=>il(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=>il(e)?e:dy(e,.075,.3),easeOutElastic:e=>il(e)?e:fy(e,.075,.3),easeInOutElastic(e){return il(e)?e:e<.5?.5*dy(e*2,.1125,.45):.5+.5*fy(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-Ro.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?Ro.easeInBounce(e*2)*.5:Ro.easeOutBounce(e*2-1)*.5+.5};function Af(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function hy(e){return Af(e)?e:new ta(e)}function bu(e){return Af(e)?e:new ta(e).saturate(.5).darken(.1).hexString()}const XP=["x","y","borderWidth","radius","tension"],JP=["color","borderColor","backgroundColor"];function ZP(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:JP},numbers:{type:"number",properties:XP}}),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 eT(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const gy=new Map;function tT(e,t){t=t||{};const n=e+JSON.stringify(t);let r=gy.get(n);return r||(r=new Intl.NumberFormat(e,t),gy.set(n,r)),r}function yb(e,t,n){return tT(t,n).format(e)}const nT={values(e){return st(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=rT(e,n)}const o=ub(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),yb(e,r,l)}};function rT(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 Pf={formatters:nT};function iT(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:Pf.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 Pi=Object.create(null),Cd=Object.create(null);function No(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 xu(e,t,n){return typeof t=="string"?na(No(e,t),n):na(No(e,""),t)}class sT{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)=>bu(i.backgroundColor),this.hoverBorderColor=(r,i)=>bu(i.borderColor),this.hoverColor=(r,i)=>bu(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 xu(this,t,n)}get(t){return No(this,t)}describe(t,n){return xu(Cd,t,n)}override(t,n){return xu(Pi,t,n)}route(t,n,r,i){const s=No(this,t),o=No(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 Ne(l)?Object.assign({},c,l):je(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var lt=new sT({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[ZP,eT,iT]);function oT(e){return!e||Ye(e.size)||Ye(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Xl(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 aT(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&&!st(d))o=Xl(e,i,s,o,d);else if(st(d))for(c=0,u=d.length;c<u;c++)f=d[c],f!=null&&!st(f)&&(o=Xl(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 ei(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 yy(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function _d(e,t,n,r){mb(e,t,n,r,null)}function mb(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)*LP;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,Jt):e.arc(n,r,m,0,Jt),e.closePath();break;case"triangle":u=i?i/2:m,e.moveTo(n+Math.sin(p)*u,r-Math.cos(p)*m),p+=ay,e.lineTo(n+Math.sin(p)*u,r-Math.cos(p)*m),p+=ay,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+Zr)*l,d=Math.cos(p+Zr)*(i?i/2-c:l),a=Math.sin(p+Zr)*l,f=Math.sin(p+Zr)*(i?i/2-c:l),e.arc(n-d,r-a,c,p-ut,p-Xt),e.arc(n+f,r-o,c,p-Xt,p),e.arc(n+d,r+a,c,p,p+Xt),e.arc(n-f,r+o,c,p+Xt,p+ut),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+=Zr;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+=Zr;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+=Zr,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 ir(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 Tc(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function jc(e){e.restore()}function lT(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 cT(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 uT(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),Ye(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function dT(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 fT(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Ti(e,t,n,r,i,s={}){const o=st(t)?t:[t],a=s.strokeWidth>0&&s.strokeColor!=="";let l,c;for(e.save(),e.font=i.string,uT(e,s),l=0;l<o.length;++l)c=o[l],s.backdrop&&fT(e,s.backdrop),a&&(s.strokeColor&&(e.strokeStyle=s.strokeColor),Ye(s.strokeWidth)||(e.lineWidth=s.strokeWidth),e.strokeText(c,n,r,s.maxWidth)),e.fillText(c,n,r,s.maxWidth),dT(e,n,r,c,s),r+=Number(i.lineHeight);e.restore()}function Jl(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*ut,ut,!0),e.lineTo(n,r+s-o.bottomLeft),e.arc(n+o.bottomLeft,r+s-o.bottomLeft,o.bottomLeft,ut,Xt,!0),e.lineTo(n+i-o.bottomRight,r+s),e.arc(n+i-o.bottomRight,r+s-o.bottomRight,o.bottomRight,Xt,0,!0),e.lineTo(n+i,r+o.topRight),e.arc(n+i-o.topRight,r+o.topRight,o.topRight,0,-Xt,!0),e.lineTo(n+o.topLeft,r)}const hT=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,gT=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function yT(e,t){const n=(""+e).match(hT);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 mT=e=>+e||0;function pb(e,t){const n={},r=Ne(t),i=r?Object.keys(t):t,s=Ne(e)?r?o=>je(e[o],e[t[o]]):o=>e[o]:()=>e;for(const o of i)n[o]=mT(s(o));return n}function pT(e){return pb(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Ji(e){return pb(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Et(e){const t=pT(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ft(e,t){e=e||{},t=t||lt.font;let n=je(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=je(e.style,t.style);r&&!(""+r).match(gT)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:je(e.family,t.family),lineHeight:yT(je(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:je(e.weight,t.weight),string:""};return i.string=oT(i),i}function sl(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 vT(e,t,n){const{min:r,max:i}=e,s=AP(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 Gr(e,t){return Object.assign(Object.create(e),t)}function Tf(e,t=[""],n,r,i=()=>e[0]){const s=n||e;typeof r=="undefined"&&(r=wb("_fallback",e));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:s,_fallback:r,_getTarget:i,override:a=>Tf([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 bb(a,l,()=>OT(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return py(a).includes(l)},ownKeys(a){return py(a)},set(a,l,c){const u=a._storage||(a._storage=i());return a[l]=u[l]=c,delete a._keys,!0}})}function Ds(e,t,n,r){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:vb(e,r),setContext:s=>Ds(e,s,n,r),override:s=>Ds(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 bb(s,o,()=>xT(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 vb(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:zr(n)?n:()=>n,isIndexable:zr(r)?r:()=>r}}const bT=(e,t)=>e?e+_f(t):t,jf=(e,t)=>Ne(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function bb(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function xT(e,t,n){const{_proxy:r,_context:i,_subProxy:s,_descriptors:o}=e;let a=r[t];return zr(a)&&o.isScriptable(t)&&(a=wT(t,a,e,n)),st(a)&&a.length&&(a=ST(t,a,e,o.isIndexable)),jf(t,a)&&(a=Ds(a,i,s&&s[t],o)),a}function wT(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),jf(e,l)&&(l=$f(i._scopes,i,e,l)),l}function ST(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(Ne(t[0])){const l=t,c=i._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=$f(c,i,e,u);t.push(Ds(d,s,o&&o[e],a))}}return t}function xb(e,t,n){return zr(e)?e(t,n):e}const CT=(e,t)=>e===!0?t:typeof e=="string"?ra(t,e):void 0;function _T(e,t,n,r,i){for(const s of t){const o=CT(n,s);if(o){e.add(o);const a=xb(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 $f(e,t,n,r){const i=t._rootScopes,s=xb(t._fallback,n,r),o=[...e,...i],a=new Set;a.add(r);let l=my(a,o,n,s||n,r);return l===null||typeof s!="undefined"&&s!==n&&(l=my(a,o,s,l,r),l===null)?!1:Tf(Array.from(a),[""],i,s,()=>kT(t,n,r))}function my(e,t,n,r,i){for(;n;)n=_T(e,t,n,r,i);return n}function kT(e,t,n){const r=e._getTarget();t in r||(r[t]={});const i=r[t];return st(i)&&Ne(n)?n:i||{}}function OT(e,t,n,r){let i;for(const s of t)if(i=wb(bT(s,e),n),typeof i!="undefined")return jf(e,i)?$f(n,r,e,i):i}function wb(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r!="undefined")return r}}function py(e){let t=e._keys;return t||(t=e._keys=ET(e._scopes)),t}function ET(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 AT(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(ra(u,s),c)};return o}const PT=Number.EPSILON||1e-14,Ls=(e,t)=>t<e.length&&!e[t].skip&&e[t],Sb=e=>e==="x"?"y":"x";function TT(e,t,n,r){const i=e.skip?t:e,s=t,o=n.skip?t:n,a=Sd(s,i),l=Sd(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 jT(e,t,n){const r=e.length;let i,s,o,a,l,c=Ls(e,0);for(let u=0;u<r-1;++u)if(l=c,c=Ls(e,u+1),!(!l||!c)){if(Io(t[u],0,PT)){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 $T(e,t,n="x"){const r=Sb(n),i=e.length;let s,o,a,l=Ls(e,0);for(let c=0;c<i;++c){if(o=a,a=l,l=Ls(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 MT(e,t="x"){const n=Sb(t),r=e.length,i=Array(r).fill(0),s=Array(r);let o,a,l,c=Ls(e,0);for(o=0;o<r;++o)if(a=l,l=c,c=Ls(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?Ms(i[o-1])!==Ms(i[o])?0:(i[o-1]+i[o])/2:i[o-1]:i[o]}jT(e,i,s),$T(e,s,t)}function ol(e,t,n){return Math.max(Math.min(e,n),t)}function DT(e,t){let n,r,i,s,o,a=ir(e[0],t);for(n=0,r=e.length;n<r;++n)o=s,s=a,a=n<r-1&&ir(e[n+1],t),s&&(i=e[n],o&&(i.cp1x=ol(i.cp1x,t.left,t.right),i.cp1y=ol(i.cp1y,t.top,t.bottom)),a&&(i.cp2x=ol(i.cp2x,t.left,t.right),i.cp2y=ol(i.cp2y,t.top,t.bottom)))}function LT(e,t,n,r,i){let s,o,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")MT(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=TT(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&&DT(e,n)}function Mf(){return typeof window!="undefined"&&typeof document!="undefined"}function Df(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Zl(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 $c=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function IT(e,t){return $c(e).getPropertyValue(t)}const RT=["top","right","bottom","left"];function _i(e,t,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const s=RT[i];r[s]=parseFloat(e[t+"-"+s+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const NT=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function FT(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:s}=r;let o=!1,a,l;if(NT(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 ii(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,i=$c(n),s=i.boxSizing==="border-box",o=_i(i,"padding"),a=_i(i,"border","width"),{x:l,y:c,box:u}=FT(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 BT(e,t,n){let r,i;if(t===void 0||n===void 0){const s=e&&Df(e);if(!s)t=e.clientWidth,n=e.clientHeight;else{const o=s.getBoundingClientRect(),a=$c(s),l=_i(a,"border","width"),c=_i(a,"padding");t=o.width-c.width-l.width,n=o.height-c.height-l.height,r=Zl(a.maxWidth,s,"clientWidth"),i=Zl(a.maxHeight,s,"clientHeight")}}return{width:t,height:n,maxWidth:r||Yl,maxHeight:i||Yl}}const al=e=>Math.round(e*10)/10;function qT(e,t,n,r){const i=$c(e),s=_i(i,"margin"),o=Zl(i.maxWidth,e,"clientWidth")||Yl,a=Zl(i.maxHeight,e,"clientHeight")||Yl,l=BT(e,t,n);let{width:c,height:u}=l;if(i.boxSizing==="content-box"){const f=_i(i,"border","width"),h=_i(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=al(Math.min(c,o,l.maxWidth)),u=al(Math.min(u,a,l.maxHeight)),c&&!u&&(u=al(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=al(Math.floor(u*r))),{width:c,height:u}}function vy(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 zT=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};Mf()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch(t){}return e}();function by(e,t){const n=IT(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function si(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function HT(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 KT(e,t,n,r){const i={x:e.cp2x,y:e.cp2y},s={x:t.cp1x,y:t.cp1y},o=si(e,i,n),a=si(i,s,n),l=si(s,t,n),c=si(o,a,n),u=si(a,l,n);return si(c,u,n)}const UT=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}}},WT=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Zi(e,t,n){return e?UT(t,n):WT()}function Cb(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 _b(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function kb(e){return e==="angle"?{between:db,compare:qP,normalize:Gt}:{between:Xi,compare:(t,n)=>t-n,normalize:t=>t}}function xy({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 VT(e,t,n){const{property:r,start:i,end:s}=n,{between:o,normalize:a}=kb(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 Ob(e,t,n){if(!n)return[e];const{property:r,start:i,end:s}=n,o=t.length,{compare:a,between:l,normalize:c}=kb(r),{start:u,end:d,loop:f,style:h}=VT(e,t,n),g=[];let m=!1,p=null,v,b,w;const C=()=>l(i,w,v)&&a(i,w)!==0,x=()=>a(s,v)===0||l(s,w,v),k=()=>m||C(),S=()=>!m||x();for(let _=u,O=u;_<=d;++_)b=t[_%o],!b.skip&&(v=c(b[r]),v!==w&&(m=l(v,i,s),p===null&&k()&&(p=a(v,i)===0?_:O),p!==null&&S()&&(g.push(xy({start:p,end:_,loop:f,count:o,style:h})),p=null),O=_,w=v));return p!==null&&g.push(xy({start:p,end:d,loop:f,count:o,style:h})),g}function Eb(e,t){const n=[],r=e.segments;for(let i=0;i<r.length;i++){const s=Ob(r[i],e.points,t);s.length&&n.push(...s)}return n}function GT(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 QT(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 YT(e,t){const n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];const s=!!e._loop,{start:o,end:a}=GT(n,i,s,r);if(r===!0)return wy(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 wy(e,QT(n,o,l,c),n,t)}function wy(e,t,n,r){return!r||!r.setContext||!n?t:XT(e,t,n,r)}function XT(e,t,n,r){const i=e._chart.getContext(),s=Sy(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=Sy(r.setContext(Gr(i,{type:"segment",p0:m,p1:v,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:o}))),JT(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 Sy(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function JT(e,t){if(!t)return!1;const n=[],r=function(i,s){return Af(s)?(n.includes(s)||n.push(s),n.indexOf(s)):s};return JSON.stringify(e,r)!==JSON.stringify(t,r)}function ll(e,t,n){return e.options.clip?e[n]:t[n]}function ZT(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:ll(n,t,"left"),right:ll(n,t,"right"),top:ll(r,t,"top"),bottom:ll(r,t,"bottom")}:t}function Ab(e,t){const n=t._clip;if(n.disabled)return!1;const r=ZT(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 ZT{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=fb.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 Yn=new ZT;const Cy="transparent",e5={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=hy(e||Cy),i=r.valid&&hy(t||Cy);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class t5{constructor(t,n,r,i){const s=n[r];i=sl([t.to,i,s,t.from]);const o=sl([t.from,s,i]);this._active=!0,this._fn=t.fn||e5[t.type||typeof o],this._easing=Ro[t.easing]||Ro.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=sl([t.to,n,i,t.from]),this._from=sl([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 Ab{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Fe(t))return;const n=Object.keys(at.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];(it(s.properties)&&s.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,o)})})}_animateOptions(t,n){const r=n.options,i=r5(t,r);if(!i)return[];const s=this._createAnimations(i,r);return r.$shared&&n5(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 t5(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 Yn.add(this._chart,r),!0}}function n5(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 r5(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 _y(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 i5(e,t,n){if(n===!1)return!1;const r=_y(e,n),i=_y(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function s5(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 Pb(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 ky(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],gt(c)&&(s||t===0||$s(t)===$s(c))&&(t+=c)}return!u&&!r.all?0:t}function o5(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 wu(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function a5(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function l5(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 c5(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Oy(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 Ey(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=a5(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]=c5(i,u,m),f[a]=p,f._top=Oy(f,o,!0,r.type),f._bottom=Oy(f,o,!1,r.type);const b=f._visualValues||(f._visualValues={});b[a]=p}}function Su(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function u5(e,t){return Gr(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function d5(e,t,n){return Gr(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function co(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 Cu=e=>e==="reset"||e==="none",Ay=(e,t)=>t?e:Object.assign({},e),f5=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Pb(n,!0),values:null};class es{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=wu(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&&co(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=$e(r.xAxisID,Su(t,"x")),o=n.yAxisID=$e(r.yAxisID,Su(t,"y")),a=n.rAxisID=$e(r.rAxisID,Su(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&&uy(this._data,this),t._stacked&&co(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Fe(n)){const i=this._cachedMeta;this._data=o5(n,i)}else if(r!==n){if(r){uy(r,this);const i=this._cachedMeta;co(i),i._parsed=[]}n&&Object.isExtensible(n)&&KP(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=wu(n.vScale,n),n.stack!==r.stack&&(i=!0,co(n),n.stack=r.stack),this._resyncElements(t),(i||s!==n._stacked)&&(Ey(this,n._parsed),n._stacked=wu(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{it(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&&Ey(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(ra(h,a),f),y:o.parse(ra(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:Pb(i,!0),values:n._stacks[t.axis]._visualValues};return ky(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=ky(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=f5(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=l5(a);let f,h;function g(){h=i[f];const m=h[a.axis];return!gt(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],gt(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=s5($e(this.options.clip,i5(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=d5(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=u5(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&&Ql(r);if(a)return Ay(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(at.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(Ay(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 Ab(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||Cu(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){Cu(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!Cu(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&&co(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])}}pe(es,"defaults",{}),pe(es,"datasetElementType",null),pe(es,"dataElementType",null);class Al extends es{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}=GP(n,i,o);this._drawStart=a,this._drawCount=l,QP(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=ia(g)?g:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||s||i==="none",b=n+r,w=t.length;let C=n>0&&this.getParsed(n-1);for(let x=0;x<w;++x){const k=t[x],S=v?k:{};if(x<n||x>=b){S.skip=!0;continue}const _=this.getParsed(x),O=Qe(_[h]),E=S[f]=o.getPixelForValue(_[f],x),T=S[h]=s||O?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,_,l):_[h],x);S.skip=isNaN(E)||isNaN(T)||O,S.stop=x>0&&Math.abs(_[f]-C[f])>p,m&&(S.parsed=_,S.raw=c.data[x]),d&&(S.options=u||this.resolveDataElementOptions(x,k.active?"active":i)),v||this.updateElement(k,x,S,i),C=_}}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()}}pe(Al,"id","line"),pe(Al,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),pe(Al,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Pl extends es{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 ET.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)}}}pe(Pl,"id","radar"),pe(Pl,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),pe(Pl,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});function ti(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Lf{constructor(t){pe(this,"options");this.options=t||{}}static override(t){Object.assign(Lf.prototype,t)}init(){}formats(){return ti()}parse(){return ti()}format(){return ti()}add(){return ti()}diff(){return ti()}startOf(){return ti()}endOf(){return ti()}}var h5={_date:Lf};function g5(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?zP:ui;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=>!Qe(m[d.axis]));u.lo-=Math.max(0,h);const g=f.slice(u.hi).findIndex(m=>!Qe(m[d.axis]));u.hi+=Math.max(0,g)}return u}}return{lo:0,hi:s.length-1}}function $c(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}=g5(s[a],t,o,i);for(let h=d;h<=f;++h){const g=u[h];g.skip||r(g,c,h)}}}function y5(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 _u(e,t,n,r,i){const s=[];return!i&&!e.isPointInArea(t)||$c(e,n,t,function(a,l,c){!i&&!ir(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&s.push({element:a,datasetIndex:l,index:c})},!0),s}function m5(e,t,n,r){let i=[];function s(o,a,l){const{startAngle:c,endAngle:u}=o.getProps(["startAngle","endAngle"],r),{angle:d}=FP(o,{x:t.x,y:t.y});ub(d,c,u)&&i.push({element:o,datasetIndex:a,index:l})}return $c(e,n,t,s),i}function p5(e,t,n,r,i,s){let o=[];const a=y5(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 $c(e,n,t,c),o}function ku(e,t,n,r,i,s){return!s&&!e.isPointInArea(t)?[]:n==="r"&&!r?m5(e,t,n,i):p5(e,t,n,r,i,s)}function Py(e,t,n,r,i){const s=[],o=n==="x"?"inXRange":"inYRange";let a=!1;return $c(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 v5={modes:{index(e,t,n,r){const i=ii(t,e),s=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?_u(e,i,s,r,o):ku(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=ii(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?_u(e,i,s,r,o):ku(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=ii(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return _u(e,i,s,r,o)},nearest(e,t,n,r){const i=ii(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return ku(e,i,s,n.intersect,r,o)},x(e,t,n,r){const i=ii(t,e);return Py(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=ii(t,e);return Py(e,i,"y",n.intersect,r)}}};const Tb=["left","top","right","bottom"];function uo(e,t){return e.filter(n=>n.pos===t)}function Ty(e,t){return e.filter(n=>Tb.indexOf(n.pos)===-1&&n.box.axis===t)}function fo(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 b5(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 x5(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:s}=n;if(!r||!Tb.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 w5(e,t){const n=x5(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 S5(e){const t=b5(e),n=fo(t.filter(c=>c.box.fullSize),!0),r=fo(uo(t,"left"),!0),i=fo(uo(t,"right")),s=fo(uo(t,"top"),!0),o=fo(uo(t,"bottom")),a=Ty(t,"x"),l=Ty(t,"y");return{fullSize:n,leftAndTop:r.concat(s),rightAndBottom:i.concat(l).concat(o).concat(a),chartArea:uo(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:s.concat(o).concat(a)}}function jy(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function jb(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 C5(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&&jb(o,s.getPadding());const a=Math.max(0,t.outerWidth-jy(o,e,"left","right")),l=Math.max(0,t.outerHeight-jy(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 _5(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 k5(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 Oo(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,k5(a.horizontal,t));const{same:d,other:f}=C5(t,n,a,r);c|=d&&i.length,u=u||f,l.fullSize||i.push(a)}return c&&Oo(i,t,n,r)||u}function cl(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 My(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;Ql(c.start)&&(o=c.start),l.fullSize?cl(l,i.left,o,n.outerWidth-i.right-i.left,f):cl(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;Ql(c.start)&&(s=c.start),l.fullSize?cl(l,s,i.top,f,n.outerHeight-i.bottom-i.top):cl(l,s,t.top+c.placed,f,d),c.start=s,c.placed+=d,s=l.right}}t.x=s,t.y=o}var cn={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=Ot(e.options.layout.padding),s=Math.max(t-i.width,0),o=Math.max(n-i.height,0),a=S5(e.boxes),l=a.vertical,c=a.horizontal;Ge(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);jb(f,Ot(r));const h=Object.assign({maxPadding:f,w:s,h:o,x:i.left,y:i.top},i),g=w5(l.concat(c),d);Oo(a.fullSize,h,d,g),Oo(l,h,d,g),Oo(c,h,d,g)&&Oo(l,h,d,g),_5(h),My(a.leftAndTop,h,d,g),h.x+=h.w,h.y+=h.h,My(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},Ge(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 Mb{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 O5 extends Mb{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Tl="$chartjs",E5={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},$y=e=>e===null||e==="";function A5(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[Tl]={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",$y(i)){const s=by(e,"width");s!==void 0&&(e.width=s)}if($y(r))if(e.style.height==="")e.height=e.width/(t||2);else{const s=by(e,"height");s!==void 0&&(e.height=s)}return e}const $b=qT?{passive:!0}:!1;function P5(e,t,n){e&&e.addEventListener(t,n,$b)}function T5(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,$b)}function j5(e,t){const n=E5[e.type]||e.type,{x:r,y:i}=ii(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function ec(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function M5(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||ec(a.addedNodes,r),o=o&&!ec(a.removedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function $5(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||ec(a.removedNodes,r),o=o&&!ec(a.addedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const sa=new Map;let Dy=0;function Db(){const e=window.devicePixelRatio;e!==Dy&&(Dy=e,sa.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function D5(e,t){sa.size||window.addEventListener("resize",Db),sa.set(e,t)}function L5(e){sa.delete(e),sa.size||window.removeEventListener("resize",Db)}function I5(e,t,n){const r=e.canvas,i=r&&Df(r);if(!i)return;const s=hb((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),D5(e,s),o}function Ou(e,t,n){n&&n.disconnect(),t==="resize"&&L5(e)}function R5(e,t,n){const r=e.canvas,i=hb(s=>{e.ctx!==null&&n(j5(s,e))},e);return P5(r,t,i),i}class N5 extends Mb{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(A5(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Tl])return!1;const r=n[Tl].initial;["height","width"].forEach(s=>{const o=r[s];Qe(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[Tl],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),o={attach:M5,detach:$5,resize:I5}[n]||R5;i[n]=o(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:Ou,detach:Ou,resize:Ou}[n]||T5)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return BT(t,n,r,i)}isAttached(t){const n=t&&Df(t);return!!(n&&n.isConnected)}}function F5(e){return!$f()||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas?O5:N5}var xl;let Ni=(xl=class{constructor(){pe(this,"x");pe(this,"y");pe(this,"active",!1);pe(this,"options");pe(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return ia(this.x)&&ia(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}},pe(xl,"defaults",{}),pe(xl,"defaultRoutes"),xl);function B5(e,t){const n=e.options.ticks,r=q5(e),i=Math.min(n.maxTicksLimit||r,r),s=n.major.enabled?H5(t):[],o=s.length,a=s[0],l=s[o-1],c=[];if(o>i)return K5(t,c,s,o/i),c;const u=z5(s,t,i);if(o>0){let d,f;const h=o>1?Math.round((l-a)/(o-1)):null;for(ul(t,c,u,Qe(h)?0:a-h,a),d=0,f=o-1;d<f;d++)ul(t,c,u,s[d],s[d+1]);return ul(t,c,u,l,Qe(h)?t.length:l+h),c}return ul(t,c,u),c}function q5(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 z5(e,t,n){const r=U5(e),i=t.length/n;if(!r)return Math.max(i,1);const s=LP(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 H5(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function K5(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 ul(e,t,n,r,i){const s=$e(r,0),o=Math.min($e(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 U5(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 V5=e=>e==="left"?"right":e==="right"?"left":e,Ly=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Iy=(e,t)=>Math.min(t||e,e);function Ry(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 W5(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 G5(e,t){Ge(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 ho(e){return e.drawTicks?e.tickLength:0}function Ny(e,t){if(!e.display)return 0;const n=dt(e.font,t),r=Ot(e.padding);return(it(e.text)?e.text.length:1)*n.lineHeight+r.height}function Q5(e,t){return Gr(e,{scale:t,type:"scale"})}function Y5(e,t,n){return Gr(e,{tick:n,index:t,type:"tick"})}function X5(e,t,n){let r=Ef(e);return(n&&t!=="right"||!n&&t==="right")&&(r=V5(r)),r}function J5(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=wt(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=Ly(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=Ly(e,n,t);g=wt(r,o,i),d=n==="left"?-Xt:Xt}return{titleX:h,titleY:g,maxWidth:f,rotation:d}}class Vs extends Ni{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=jn(t,Number.POSITIVE_INFINITY),n=jn(n,Number.NEGATIVE_INFINITY),r=jn(r,Number.POSITIVE_INFINITY),i=jn(i,Number.NEGATIVE_INFINITY),{min:jn(t,r),max:jn(n,i),minDefined:gt(t),maxDefined:gt(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:jn(n,jn(r,n)),max:jn(r,jn(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(){Ze(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=pT(this,s,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Ry(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=B5(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(){Ze(this.options.afterUpdate,[this])}beforeSetDimensions(){Ze(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(){Ze(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Ze(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Ze(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=Ze(n.callback,[s.value,r,t],this)}afterTickToLabelConversion(){Ze(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Ze(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=Iy(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=ln(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-ho(t.grid)-n.padding-Ny(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),o=kf(Math.min(Math.asin(ln((u.highest.height+6)/a,-1,1)),Math.asin(ln(l/c,-1,1))-Math.asin(ln(f/c,-1,1)))),o=Math.max(i,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){Ze(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Ze(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=Ny(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=ho(s)+l):(t.height=this.maxHeight,t.width=ho(s)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),h=r.padding*2,g=Dr(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(){Ze(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++)Qe(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=Ry(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/Iy(n,r));let c=0,u=0,d,f,h,g,m,p,v,b,w,C,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=C=0,!Qe(g)&&!it(g))w=Xl(i,v.data,v.gc,w,g),C=b;else if(it(g))for(f=0,h=g.length;f<h;++f)x=g[f],!Qe(x)&&!it(x)&&(w=Xl(i,v.data,v.gc,w,x),C+=b);o.push(w),a.push(C),c=Math.max(w,c),u=Math.max(C,u)}G5(s,n);const k=o.indexOf(c),S=a.indexOf(u),_=O=>({width:o[O]||0,height:a[O]||0});return{first:_(0),last:_(n-1),widest:_(k),highest:_(S),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 qP(this._alignToPixels?ei(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=Y5(this.getContext(),t,r))}return this.$context||(this.$context=Q5(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Dr(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=ho(s),h=[],g=a.setContext(this.getContext()),m=g.display?g.width:0,p=m/2,v=function($){return ei(r,$,m)};let b,w,C,x,k,S,_,O,E,T,D,W;if(o==="top")b=v(this.bottom),S=this.bottom-f,O=b-p,T=v(t.top)+p,W=t.bottom;else if(o==="bottom")b=v(this.top),T=t.top,W=v(t.bottom)-p,S=b+p,O=this.top+f;else if(o==="left")b=v(this.right),k=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,k=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 $=Object.keys(o)[0],I=o[$];b=v(this.chart.scales[$].getPixelForValue(I))}T=t.top,W=t.bottom,S=b+p,O=S+f}else if(n==="y"){if(o==="center")b=v((t.left+t.right)/2);else if(Fe(o)){const $=Object.keys(o)[0],I=o[$];b=v(this.chart.scales[$].getPixelForValue(I))}k=b-p,_=k-f,E=t.left,D=t.right}const N=$e(i.ticks.maxTicksLimit,d),L=Math.max(1,Math.ceil(d/N));for(w=0;w<d;w+=L){const $=this.getContext(w),I=s.setContext($),oe=a.setContext($),ue=I.lineWidth,B=I.color,X=oe.dash||[],ae=oe.dashOffset,ne=I.tickWidth,R=I.tickColor,G=I.tickBorderDash||[],q=I.tickBorderDashOffset;C=W5(this,w,l),C!==void 0&&(x=ei(r,C,ue),c?k=_=E=D=x:S=O=T=W=x,h.push({tx1:k,ty1:S,tx2:_,ty2:O,x1:E,y1:T,x2:D,y2:W,width:ue,color:B,borderDash:X,borderDashOffset:ae,tickWidth:ne,tickColor:R,tickBorderDash:G,tickBorderDashOffset:q}))}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=ho(r.grid),h=f+u,g=d?-u:h,m=-Dr(this.labelRotation),p=[];let v,b,w,C,x,k,S,_,O,E,T,D,W="middle";if(i==="top")k=this.bottom-g,S=this._getXAxisLabelAlignment();else if(i==="bottom")k=this.top+g,S=this._getXAxisLabelAlignment();else if(i==="left"){const L=this._getYAxisLabelAlignment(f);S=L.textAlign,x=L.x}else if(i==="right"){const L=this._getYAxisLabelAlignment(f);S=L.textAlign,x=L.x}else if(n==="x"){if(i==="center")k=(t.top+t.bottom)/2+h;else if(Fe(i)){const L=Object.keys(i)[0],$=i[L];k=this.chart.scales[L].getPixelForValue($)+h}S=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")x=(t.left+t.right)/2-h;else if(Fe(i)){const L=Object.keys(i)[0],$=i[L];x=this.chart.scales[L].getPixelForValue($)}S=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?W="top":l==="end"&&(W="bottom"));const N=this._getLabelSizes();for(v=0,b=a.length;v<b;++v){w=a[v],C=w.label;const L=s.setContext(this.getContext(v));_=this.getPixelForTick(v)+s.labelOffset,O=this._resolveTickFontOptions(v),E=O.lineHeight,T=it(C)?C.length:1;const $=T/2,I=L.color,oe=L.textStrokeColor,ue=L.textStrokeWidth;let B=S;o?(x=_,S==="inner"&&(v===b-1?B=this.options.reverse?"left":"right":v===0?B=this.options.reverse?"right":"left":B="center"),i==="top"?c==="near"||m!==0?D=-T*E+E/2:c==="center"?D=-N.highest.height/2-$*E+E:D=-N.highest.height+E/2:c==="near"||m!==0?D=E/2:c==="center"?D=N.highest.height/2-$*E:D=N.highest.height-T*E,d&&(D*=-1),m!==0&&!L.showLabelBackdrop&&(x+=E/2*Math.sin(m))):(k=_,D=(1-T)*E/2);let X;if(L.showLabelBackdrop){const ae=Ot(L.backdropPadding),ne=N.heights[v],R=N.widths[v];let G=D-ae.top,q=0-ae.left;switch(W){case"middle":G-=ne/2;break;case"bottom":G-=ne;break}switch(S){case"center":q-=R/2;break;case"right":q-=R;break;case"inner":v===b-1?q-=R:v>0&&(q-=R/2);break}X={left:q,top:G,width:R+ae.width,height:ne+ae.height,color:L.backdropColor}}p.push({label:C,font:O,textOffset:D,options:{rotation:m,color:I,strokeColor:oe,strokeWidth:ue,textAlign:B,textBaseline:W,translation:[x,k],backdrop:X}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Dr(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=ei(t,this.left,o)-o/2,u=ei(t,this.right,a)+a/2,d=f=l):(d=ei(t,this.top,o)-o/2,f=ei(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&&Tc(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;Ti(r,c,0,u,l,a)}i&&jc(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const s=dt(r.font),o=Ot(r.padding),a=r.align;let l=s.lineHeight/2;n==="bottom"||n==="center"||Fe(n)?(l+=o.bottom,it(r.text)&&(l+=s.lineHeight*(r.text.length-1))):l+=o.top;const{titleX:c,titleY:u,maxWidth:d,rotation:f}=J5(this,l,n,a);Ti(t,r.text,0,0,s,{color:r.color,maxWidth:d,rotation:f,textAlign:X5(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=$e(t.grid&&t.grid.z,-1),i=$e(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Vs.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 dt(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class dl{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;tj(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,Z5(t,o,r),this.override&&at.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 at[i]&&(delete at[i][r],this.override&&delete Pi[r])}}function Z5(e,t,n){const r=na(Object.create(null),[n?at.get(n):{},at.get(t),e.defaults]);at.set(t,r),e.defaultRoutes&&ej(t,e.defaultRoutes),e.descriptors&&at.describe(t,e.descriptors)}function ej(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(".");at.route(s,i,l,a)})}function tj(e){return"id"in e&&"defaults"in e}class nj{constructor(){this.controllers=new dl(es,"datasets",!0),this.elements=new dl(Ni,"elements"),this.plugins=new dl(Object,"plugins"),this.scales=new dl(Vs,"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):Ge(i,o=>{const a=r||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,n,r){const i=_f(t);Ze(r["before"+i],[],r),n[t](r),Ze(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 Dn=new nj;class rj{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(Ze(a,l,o)===!1&&i.cancelable)return!1}return!0}invalidate(){Qe(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=$e(r.options&&r.options.plugins,{}),s=ij(r);return i===!1&&!n?[]:oj(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 ij(e){const t={},n=[],r=Object.keys(Dn.plugins.items);for(let s=0;s<r.length;s++)n.push(Dn.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 sj(e,t){return!t&&e===!1?null:e===!0?{}:e}function oj(e,{plugins:t,localIds:n},r,i){const s=[],o=e.getContext();for(const a of t){const l=a.id,c=sj(r[l],i);c!==null&&s.push({plugin:a,options:aj(e.config,{plugin:a,local:n[l]},c,o)})}return s}function aj(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 kd(e,t){const n=at.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function lj(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function cj(e,t){return e===t?"_index_":"_value_"}function Fy(e){if(e==="x"||e==="y"||e==="r")return e}function uj(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Od(e,...t){if(Fy(e))return e;for(const n of t){const r=n.axis||uj(n.position)||e.length>1&&Fy(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function By(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function dj(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 By(e,"x",n[0])||By(e,"y",n[0])}return{}}function fj(e,t){const n=Pi[e.type]||{scales:{}},r=t.scales||{},i=kd(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=Od(o,a,dj(o,e),at.scales[a.type]),c=cj(l,i),u=n.scales||{};s[o]=Lo(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(o=>{const a=o.type||e.type,l=o.indexAxis||kd(a,t),u=(Pi[a]||{}).scales||{};Object.keys(u).forEach(d=>{const f=lj(d,l),h=o[f+"AxisID"]||f;s[h]=s[h]||Object.create(null),Lo(s[h],[{axis:f},r[h],u[d]])})}),Object.keys(s).forEach(o=>{const a=s[o];Lo(a,[at.scales[a.type],at.scale])}),s}function Lb(e){const t=e.options||(e.options={});t.plugins=$e(t.plugins,{}),t.scales=fj(e,t)}function Ib(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function hj(e){return e=e||{},e.data=Ib(e.data),Lb(e),e}const qy=new Map,Rb=new Set;function fl(e,t){let n=qy.get(e);return n||(n=t(),qy.set(e,n),Rb.add(n)),n}const go=(e,t,n)=>{const r=ra(t,n);r!==void 0&&e.add(r)};class gj{constructor(t){this._config=hj(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=Ib(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(),Lb(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return fl(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return fl(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return fl(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return fl(`${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=>go(l,t,d))),u.forEach(d=>go(l,i,d)),u.forEach(d=>go(l,Pi[s]||{},d)),u.forEach(d=>go(l,at,d)),u.forEach(d=>go(l,Cd,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Rb.has(n)&&o.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Pi[n]||{},at.datasets[n]||{},{type:n},at,Cd]}resolveNamedOptions(t,n,r,i=[""]){const s={$shared:!0},{resolver:o,subPrefixes:a}=zy(this._resolverCache,t,i);let l=o;if(mj(o,n)){s.$shared=!1,r=zr(r)?r():r;const c=this.createResolver(t,r,a);l=Ds(o,r,c)}for(const c of n)s[c]=l[c];return s}createResolver(t,n,r=[""],i){const{resolver:s}=zy(this._resolverCache,t,r);return Fe(n)?Ds(s,n,void 0,i):s}}function zy(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:Tf(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,s)),s}const yj=e=>Fe(e)&&Object.getOwnPropertyNames(e).some(t=>zr(e[t]));function mj(e,t){const{isScriptable:n,isIndexable:r}=pb(e);for(const i of t){const s=n(i),o=r(i),a=(o||s)&&e[i];if(s&&(zr(a)||yj(a))||o&&it(a))return!0}return!1}var pj="4.5.0";const vj=["top","bottom","left","right","chartArea"];function Hy(e,t){return e==="top"||e==="bottom"||vj.indexOf(e)===-1&&t==="x"}function Ky(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Uy(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Ze(n&&n.onComplete,[e],t)}function bj(e){const t=e.chart,n=t.options.animation;Ze(n&&n.onProgress,[e],t)}function Nb(e){return $f()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const jl={},Vy=e=>{const t=Nb(e);return Object.values(jl).filter(n=>n.canvas===t).pop()};function xj(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 wj(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}var wr;let Dc=(wr=class{static register(...t){Dn.add(...t),Wy()}static unregister(...t){Dn.remove(...t),Wy()}constructor(t,n){const r=this.config=new gj(n),i=Nb(t),s=Vy(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||F5(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=OP(),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 rj,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=VP(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],jl[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Yn.listen(this,"complete",Uy),Yn.listen(this,"progress",bj),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:s}=this;return Qe(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 Dn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():vy(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return yy(this.canvas,this.ctx),this}stop(){return Yn.stop(this),this}resize(t,n){Yn.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,vy(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),Ze(r.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Ge(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=Od(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Ge(s,o=>{const a=o.options,l=a.id,c=Od(l,a),u=$e(a.type,o.dtype);(a.position===void 0||Hy(a.position,c)!==Hy(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=Dn.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,t)}),Ge(i,(o,a)=>{o||delete r[a]}),Ge(r,o=>{cn.configure(this,o,o.options),cn.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(Ky("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||kd(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=Dn.getController(a),{datasetElementType:c,dataElementType:u}=at.datasets[a];Object.assign(l,{dataElementType:Dn.getElement(u),datasetElementType:c&&Dn.getElement(c)}),o.controller=new l(this,r),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){Ge(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||Ge(s,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Ky("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Ge(this.scales,t=>{cn.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!oy(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;xj(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(!oy(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;cn.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Ge(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,zr(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&&(Yn.has(this)?this.attached&&!Yn.running(this)&&Yn.start(this):(this.draw(),Uy({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=Eb(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(i&&Tc(n,i),t.controller.draw(),i&&jc(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return ir(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const s=v5.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=Gr(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);Ql(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(),Yn.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(),yy(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete jl[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)};Ge(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(){Ge(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Ge(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}});!Wl(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=MP(t),c=wj(t,this._lastEvent,r,l);r&&(this._lastEvent=null,Ze(s.onHover,[t,a,this],this),l&&Ze(s.onClick,[t,a,this],this));const u=!Wl(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)}},pe(wr,"defaults",at),pe(wr,"instances",jl),pe(wr,"overrides",Pi),pe(wr,"registry",Dn),pe(wr,"version",pj),pe(wr,"getChart",Vy),wr);function Wy(){return Ge(Dc.instances,e=>e._plugins.invalidate())}function Fb(e,t,n=t){e.lineCap=$e(n.borderCapStyle,t.borderCapStyle),e.setLineDash($e(n.borderDash,t.borderDash)),e.lineDashOffset=$e(n.borderDashOffset,t.borderDashOffset),e.lineJoin=$e(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=$e(n.borderWidth,t.borderWidth),e.strokeStyle=$e(n.borderColor,t.borderColor)}function Sj(e,t,n){e.lineTo(n.x,n.y)}function Cj(e){return e.stepped?aT:e.tension||e.cubicInterpolationMode==="monotone"?lT:Sj}function Bb(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 _j(e,t,n,r){const{points:i,options:s}=t,{count:o,start:a,loop:l,ilen:c}=Bb(i,n,r),u=Cj(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 kj(e,t,n,r){const i=t.points,{count:s,start:o,ilen:a}=Bb(i,n,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,f,h,g,m,p,v;const b=C=>(o+(c?a-C:C))%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 C=h.x,x=h.y,k=C|0;k===g?(x<m?m=x:x>p&&(p=x),u=(d*u+C)/++d):(w(),e.lineTo(C,x),g=k,d=0,m=p=x),v=x}w()}function Ed(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?kj:_j}function Oj(e){return e.stepped?zT:e.tension||e.cubicInterpolationMode==="monotone"?HT:si}function Ej(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),Fb(e,t.options),e.stroke(i)}function Aj(e,t,n,r){const{segments:i,options:s}=t,o=Ed(t);for(const a of i)Fb(e,s,a.style),e.beginPath(),o(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const Pj=typeof Path2D=="function";function Tj(e,t,n,r){Pj&&!t.options.segment?Ej(e,t,n,r):Aj(e,t,n,r)}class Lr extends Ni{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;DT(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=QT(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=Ob(this,{property:n,start:i,end:i});if(!o.length)return;const a=[],l=Oj(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 Ed(this)(t,this,n,r)}path(t,n,r){const i=this.segments,s=Ed(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(),Tj(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}pe(Lr,"id","line"),pe(Lr,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),pe(Lr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),pe(Lr,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Gy(e,t,n,r){const i=e.options,{[n]:s}=e.getProps([n],r);return Math.abs(t-s)<i.radius+i.hitRadius}class Ml extends Ni{constructor(n){super();pe(this,"parsed");pe(this,"skip");pe(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 Gy(this,n,"x",r)}inYRange(n,r){return Gy(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||!ir(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,_d(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}pe(Ml,"id","point"),pe(Ml,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),pe(Ml,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function jj(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=Lc(l,c,i);const u=Ad(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=Ob(t,u);for(const f of d){const h=Ad(n,s[f.start],s[f.end],f.loop),g=kb(a,i,h);for(const m of g)o.push({source:m,target:f,start:{[n]:Qy(u,h,"start",Math.max)},end:{[n]:Qy(u,h,"end",Math.min)}})}}return o}function Ad(e,t,n,r){if(r)return;let i=t[e],s=n[e];return e==="angle"&&(i=Gt(i),s=Gt(s)),{property:e,start:i,end:s}}function Mj(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,s=[];return t.segments.forEach(({start:o,end:a})=>{a=Lc(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 Lc(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function Qy(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function qb(e,t){let n=[],r=!1;return it(e)?(r=!0,n=e):n=Mj(e,t),n.length?new Lr({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function Yy(e){return e&&e.fill!==!1}function $j(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(!gt(i))return i;if(o=e[i],!o)return!1;if(o.visible)return i;s.push(i),i=o.fill}return!1}function Dj(e,t,n){const r=Nj(e);if(Fe(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return gt(i)&&Math.floor(i)===i?Lj(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function Lj(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function Ij(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 Rj(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 Nj(e){const t=e.options,n=t.fill;let r=$e(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function Fj(e){const{scale:t,index:n,line:r}=e,i=[],s=r.segments,o=r.points,a=Bj(t,n);a.push(qb({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++)qj(i,o[u],a)}return new Lr({points:i,options:{}})}function Bj(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 qj(e,t,n){const r=[];for(let i=0;i<n.length;i++){const s=n[i],{first:o,last:a,point:l}=zj(s,t,"x");if(!(!l||o&&a)){if(o)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function zj(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(Xi(i,d,f)){a=i===d,l=i===f;break}}return{first:a,last:l,point:r}}class zb{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:Jt},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 Hj(e){const{chart:t,fill:n,line:r}=e;if(gt(n))return Kj(t,n);if(n==="stack")return Fj(e);if(n==="shape")return!0;const i=Uj(e);return i instanceof zb?i:qb(i,r)}function Kj(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function Uj(e){return(e.scale||{}).getPointPositionForValue?Wj(e):Vj(e)}function Vj(e){const{scale:t={},fill:n}=e,r=Ij(n,t);if(gt(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function Wj(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,s=r.reverse?t.max:t.min,o=Rj(n,t,s),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,s);return new zb({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 Eu(e,t,n){const r=Hj(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=Eb(i,g);r&&o.points.length&&(Tc(e,n),Gj(e,{line:o,target:r,above:f,below:h,area:n,scale:a,axis:l,clip:m}),jc(e))}function Gj(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"?(Xy(e,r,o.top),Au(e,{line:n,target:r,color:i,scale:a,property:c,clip:l}),e.restore(),e.save(),Xy(e,r,o.bottom)):c==="y"&&(Jy(e,r,o.left),Au(e,{line:n,target:r,color:s,scale:a,property:c,clip:l}),e.restore(),e.save(),Jy(e,r,o.right),u=i)),Au(e,{line:n,target:r,color:u,scale:a,property:c,clip:l}),e.restore()}function Xy(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[Lc(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 Jy(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[Lc(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 Au(e,t){const{line:n,target:r,property:i,color:s,scale:o,clip:a}=t,l=jj(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,Qj(e,o,a,g&&Ad(i,d,f)),e.beginPath();const m=!!n.pathSegment(e,c);let p;if(g){m?e.closePath():Zy(e,r,f,i);const v=!!r.pathSegment(e,u,{move:m,reverse:!0});p=m&&v,p||Zy(e,r,d,i)}e.closePath(),e.fill(p?"evenodd":"nonzero"),e.restore()}}function Qj(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 Zy(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var Yj={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 Lr&&(l={visible:e.isDatasetVisible(o),index:o,fill:Dj(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=$j(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&&Eu(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;Yy(s)&&Eu(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!Yy(r)||n.drawTime!=="beforeDatasetDraw"||Eu(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const em=(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)}},Xj=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class tm extends Ni{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=Ze(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=dt(r.font),s=i.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=em(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}=Jj(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=Zi(s,this.left,this.width);if(this.isHorizontal()){let a=0,l=wt(r,this.left+i,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=wt(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=wt(r,this.top+t+i,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=wt(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;Tc(t,this),this._draw(),jc(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:s,labels:o}=t,a=at.color,l=Zi(t.rtl,this.left,this.width),c=dt(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}=em(o,d),v=function(k,S,_){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;i.save();const O=$e(_.lineWidth,1);if(i.fillStyle=$e(_.fillStyle,a),i.lineCap=$e(_.lineCap,"butt"),i.lineDashOffset=$e(_.lineDashOffset,0),i.lineJoin=$e(_.lineJoin,"miter"),i.lineWidth=O,i.strokeStyle=$e(_.strokeStyle,a),i.setLineDash($e(_.lineDash,[])),o.usePointStyle){const E={radius:m*Math.SQRT2/2,pointStyle:_.pointStyle,rotation:_.rotation,borderWidth:O},T=l.xPlus(k,g/2),D=S+f;yb(i,E,T,D,o.pointStyleWidth&&g)}else{const E=S+Math.max((d-m)/2,0),T=l.leftForLtr(k,g),D=Ji(_.borderRadius);i.beginPath(),Object.values(D).some(W=>W!==0)?Jl(i,{x:T,y:E,w:g,h:m,radius:D}):i.rect(T,E,g,m),i.fill(),O!==0&&i.stroke()}i.restore()},b=function(k,S,_){Ti(i,_.text,k,S+p/2,c,{strikethrough:_.hidden,textAlign:l.textAlign(_.textAlign)})},w=this.isHorizontal(),C=this._computeTitleHeight();w?h={x:wt(s,this.left+u,this.right-r[0]),y:this.top+u+C,line:0}:h={x:this.left+u,y:wt(s,this.top+C+u,this.bottom-n[0].height),line:0},Sb(this.ctx,t.textDirection);const x=p+u;this.legendItems.forEach((k,S)=>{i.strokeStyle=k.fontColor,i.fillStyle=k.fontColor;const _=i.measureText(k.text).width,O=l.textAlign(k.textAlign||(k.textAlign=o.textAlign)),E=g+f+_;let T=h.x,D=h.y;l.setWidth(this.width),w?S>0&&T+E+u>this.right&&(D=h.y+=x,h.line++,T=h.x=wt(s,this.left+u,this.right-r[h.line])):S>0&&D+x>this.bottom&&(T=h.x=T+n[h.line].width+u,h.line++,D=h.y=wt(s,this.top+C+u,this.bottom-n[h.line].height));const W=l.x(T);if(v(W,D,k),T=WP(O,T+g+f,w?T+E:this.right,t.rtl),b(l.x(T),D,k),w)h.x+=E+u;else if(typeof k.text!="string"){const N=c.lineHeight;h.y+=Hb(k,N)+u}else h.y+=x}),Cb(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=dt(n.font),i=Ot(n.padding);if(!n.display)return;const s=Zi(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=wt(t.align,d,this.right-f);else{const g=this.columnSizes.reduce((m,p)=>Math.max(m,p.height),0);u=c+wt(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const h=wt(a,d,d+f);o.textAlign=s.textAlign(Ef(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=r.string,Ti(o,n.text,h,u,r)}_computeTitleHeight(){const t=this.options.title,n=dt(t.font),r=Ot(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,s;if(Xi(t,this.left,this.right)&&Xi(n,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(i=s[r],Xi(t,i.left,i.left+i.width)&&Xi(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!tM(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,s=Xj(i,r);i&&!s&&Ze(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!s&&Ze(n.onHover,[t,r,this],this)}else r&&Ze(n.onClick,[t,r,this],this)}}function Jj(e,t,n,r,i){const s=Zj(r,e,t,n),o=eM(i,r,t.lineHeight);return{itemWidth:s,itemHeight:o}}function Zj(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 eM(e,t,n){let r=e;return typeof t.text!="string"&&(r=Hb(t,n)),r}function Hb(e,t){const n=e.text?e.text.length:0;return t*n}function tM(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var nM={id:"legend",_element:tm,start(e,t,n){const r=e.legend=new tm({ctx:e.ctx,options:n,chart:e});cn.configure(e,r,n),cn.addBox(e,r)},stop(e){cn.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;cn.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=Ot(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 Kb extends Ni{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=it(r.text)?r.text.length:1;this._padding=Ot(r.padding);const s=i*dt(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=wt(a,r,s),d=n+t,c=s-r):(o.position==="left"?(u=r+t,d=wt(a,i,n),l=ct*-.5):(u=s-t,d=wt(a,n,i),l=ct*.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=dt(n.font),s=r.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(s);Ti(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:Ef(n.align),textBaseline:"middle",translation:[o,a]})}}function rM(e,t){const n=new Kb({ctx:e.ctx,options:t,chart:e});cn.configure(e,n,t),cn.addBox(e,n),e.titleBlock=n}var iM={id:"title",_element:Kb,start(e,t,n){rM(e,n)},stop(e){const t=e.titleBlock;cn.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;cn.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 Eo={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=Sd(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 $n(e,t){return t&&(it(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Xn(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
65
+ */class e5{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=hb.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 Yn=new e5;const Cy="transparent",t5={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=hy(e||Cy),i=r.valid&&hy(t||Cy);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class n5{constructor(t,n,r,i){const s=n[r];i=sl([t.to,i,s,t.from]);const o=sl([t.from,s,i]);this._active=!0,this._fn=t.fn||t5[t.type||typeof o],this._easing=Ro[t.easing]||Ro.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=sl([t.to,n,i,t.from]),this._from=sl([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 Pb{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Ne(t))return;const n=Object.keys(lt.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const s=t[i];if(!Ne(s))return;const o={};for(const a of n)o[a]=s[a];(st(s.properties)&&s.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,o)})})}_animateOptions(t,n){const r=n.options,i=i5(t,r);if(!i)return[];const s=this._createAnimations(i,r);return r.$shared&&r5(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 n5(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 Yn.add(this._chart,r),!0}}function r5(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 i5(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 _y(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 s5(e,t,n){if(n===!1)return!1;const r=_y(e,n),i=_y(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function o5(e){let t,n,r,i;return Ne(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 Tb(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 ky(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],yt(c)&&(s||t===0||Ms(t)===Ms(c))&&(t+=c)}return!u&&!r.all?0:t}function a5(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 wu(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function l5(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function c5(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 u5(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Oy(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 Ey(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=l5(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]=u5(i,u,m),f[a]=p,f._top=Oy(f,o,!0,r.type),f._bottom=Oy(f,o,!1,r.type);const b=f._visualValues||(f._visualValues={});b[a]=p}}function Su(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function d5(e,t){return Gr(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function f5(e,t,n){return Gr(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function co(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 Cu=e=>e==="reset"||e==="none",Ay=(e,t)=>t?e:Object.assign({},e),h5=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Tb(n,!0),values:null};class es{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=wu(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&&co(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=je(r.xAxisID,Su(t,"x")),o=n.yAxisID=je(r.yAxisID,Su(t,"y")),a=n.rAxisID=je(r.rAxisID,Su(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&&uy(this._data,this),t._stacked&&co(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Ne(n)){const i=this._cachedMeta;this._data=a5(n,i)}else if(r!==n){if(r){uy(r,this);const i=this._cachedMeta;co(i),i._parsed=[]}n&&Object.isExtensible(n)&&UP(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=wu(n.vScale,n),n.stack!==r.stack&&(i=!0,co(n),n.stack=r.stack),this._resyncElements(t),(i||s!==n._stacked)&&(Ey(this,n._parsed),n._stacked=wu(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{st(i[t])?f=this.parseArrayData(r,i,t,n):Ne(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&&Ey(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(ra(h,a),f),y:o.parse(ra(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:Tb(i,!0),values:n._stacks[t.axis]._visualValues};return ky(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=ky(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=h5(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=c5(a);let f,h;function g(){h=i[f];const m=h[a.axis];return!yt(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],yt(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=o5(je(this.options.clip,s5(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=f5(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=d5(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&&Ql(r);if(a)return Ay(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(lt.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(Ay(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 Pb(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||Cu(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){Cu(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!Cu(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&&co(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(es,"defaults",{}),me(es,"datasetElementType",null),me(es,"dataElementType",null);class Al extends es{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}=QP(n,i,o);this._drawStart=a,this._drawCount=l,YP(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=ia(g)?g:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||s||i==="none",b=n+r,w=t.length;let C=n>0&&this.getParsed(n-1);for(let x=0;x<w;++x){const k=t[x],S=v?k:{};if(x<n||x>=b){S.skip=!0;continue}const _=this.getParsed(x),O=Ye(_[h]),E=S[f]=o.getPixelForValue(_[f],x),T=S[h]=s||O?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,_,l):_[h],x);S.skip=isNaN(E)||isNaN(T)||O,S.stop=x>0&&Math.abs(_[f]-C[f])>p,m&&(S.parsed=_,S.raw=c.data[x]),d&&(S.options=u||this.resolveDataElementOptions(x,k.active?"active":i)),v||this.updateElement(k,x,S,i),C=_}}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(Al,"id","line"),me(Al,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),me(Al,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Pl extends es{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 AT.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(Pl,"id","radar"),me(Pl,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),me(Pl,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});function ti(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Lf{constructor(t){me(this,"options");this.options=t||{}}static override(t){Object.assign(Lf.prototype,t)}init(){}formats(){return ti()}parse(){return ti()}format(){return ti()}add(){return ti()}diff(){return ti()}startOf(){return ti()}endOf(){return ti()}}var g5={_date:Lf};function y5(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?HP:ui;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=>!Ye(m[d.axis]));u.lo-=Math.max(0,h);const g=f.slice(u.hi).findIndex(m=>!Ye(m[d.axis]));u.hi+=Math.max(0,g)}return u}}return{lo:0,hi:s.length-1}}function Mc(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}=y5(s[a],t,o,i);for(let h=d;h<=f;++h){const g=u[h];g.skip||r(g,c,h)}}}function m5(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 _u(e,t,n,r,i){const s=[];return!i&&!e.isPointInArea(t)||Mc(e,n,t,function(a,l,c){!i&&!ir(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&s.push({element:a,datasetIndex:l,index:c})},!0),s}function p5(e,t,n,r){let i=[];function s(o,a,l){const{startAngle:c,endAngle:u}=o.getProps(["startAngle","endAngle"],r),{angle:d}=BP(o,{x:t.x,y:t.y});db(d,c,u)&&i.push({element:o,datasetIndex:a,index:l})}return Mc(e,n,t,s),i}function v5(e,t,n,r,i,s){let o=[];const a=m5(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 Mc(e,n,t,c),o}function ku(e,t,n,r,i,s){return!s&&!e.isPointInArea(t)?[]:n==="r"&&!r?p5(e,t,n,i):v5(e,t,n,r,i,s)}function Py(e,t,n,r,i){const s=[],o=n==="x"?"inXRange":"inYRange";let a=!1;return Mc(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 b5={modes:{index(e,t,n,r){const i=ii(t,e),s=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?_u(e,i,s,r,o):ku(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=ii(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?_u(e,i,s,r,o):ku(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=ii(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return _u(e,i,s,r,o)},nearest(e,t,n,r){const i=ii(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return ku(e,i,s,n.intersect,r,o)},x(e,t,n,r){const i=ii(t,e);return Py(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=ii(t,e);return Py(e,i,"y",n.intersect,r)}}};const jb=["left","top","right","bottom"];function uo(e,t){return e.filter(n=>n.pos===t)}function Ty(e,t){return e.filter(n=>jb.indexOf(n.pos)===-1&&n.box.axis===t)}function fo(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 x5(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 w5(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:s}=n;if(!r||!jb.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 S5(e,t){const n=w5(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 C5(e){const t=x5(e),n=fo(t.filter(c=>c.box.fullSize),!0),r=fo(uo(t,"left"),!0),i=fo(uo(t,"right")),s=fo(uo(t,"top"),!0),o=fo(uo(t,"bottom")),a=Ty(t,"x"),l=Ty(t,"y");return{fullSize:n,leftAndTop:r.concat(s),rightAndBottom:i.concat(l).concat(o).concat(a),chartArea:uo(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:s.concat(o).concat(a)}}function jy(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function $b(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(!Ne(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&&$b(o,s.getPadding());const a=Math.max(0,t.outerWidth-jy(o,e,"left","right")),l=Math.max(0,t.outerHeight-jy(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 k5(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 O5(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 Oo(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,O5(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&&Oo(i,t,n,r)||u}function cl(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 $y(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;Ql(c.start)&&(o=c.start),l.fullSize?cl(l,i.left,o,n.outerWidth-i.right-i.left,f):cl(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;Ql(c.start)&&(s=c.start),l.fullSize?cl(l,s,i.top,f,n.outerHeight-i.bottom-i.top):cl(l,s,t.top+c.placed,f,d),c.start=s,c.placed+=d,s=l.right}}t.x=s,t.y=o}var cn={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=Et(e.options.layout.padding),s=Math.max(t-i.width,0),o=Math.max(n-i.height,0),a=C5(e.boxes),l=a.vertical,c=a.horizontal;Qe(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);$b(f,Et(r));const h=Object.assign({maxPadding:f,w:s,h:o,x:i.left,y:i.top},i),g=S5(l.concat(c),d);Oo(a.fullSize,h,d,g),Oo(l,h,d,g),Oo(c,h,d,g)&&Oo(l,h,d,g),k5(h),$y(a.leftAndTop,h,d,g),h.x+=h.w,h.y+=h.h,$y(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},Qe(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 Mb{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 E5 extends Mb{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Tl="$chartjs",A5={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},My=e=>e===null||e==="";function P5(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[Tl]={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",My(i)){const s=by(e,"width");s!==void 0&&(e.width=s)}if(My(r))if(e.style.height==="")e.height=e.width/(t||2);else{const s=by(e,"height");s!==void 0&&(e.height=s)}return e}const Db=zT?{passive:!0}:!1;function T5(e,t,n){e&&e.addEventListener(t,n,Db)}function j5(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,Db)}function $5(e,t){const n=A5[e.type]||e.type,{x:r,y:i}=ii(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function ec(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function M5(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||ec(a.addedNodes,r),o=o&&!ec(a.removedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function D5(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||ec(a.removedNodes,r),o=o&&!ec(a.addedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const sa=new Map;let Dy=0;function Lb(){const e=window.devicePixelRatio;e!==Dy&&(Dy=e,sa.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function L5(e,t){sa.size||window.addEventListener("resize",Lb),sa.set(e,t)}function I5(e){sa.delete(e),sa.size||window.removeEventListener("resize",Lb)}function R5(e,t,n){const r=e.canvas,i=r&&Df(r);if(!i)return;const s=gb((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),L5(e,s),o}function Ou(e,t,n){n&&n.disconnect(),t==="resize"&&I5(e)}function N5(e,t,n){const r=e.canvas,i=gb(s=>{e.ctx!==null&&n($5(s,e))},e);return T5(r,t,i),i}class F5 extends Mb{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(P5(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Tl])return!1;const r=n[Tl].initial;["height","width"].forEach(s=>{const o=r[s];Ye(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[Tl],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),o={attach:M5,detach:D5,resize:R5}[n]||N5;i[n]=o(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:Ou,detach:Ou,resize:Ou}[n]||j5)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return qT(t,n,r,i)}isAttached(t){const n=t&&Df(t);return!!(n&&n.isConnected)}}function B5(e){return!Mf()||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas?E5:F5}var xl;let Ni=(xl=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 ia(this.x)&&ia(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(xl,"defaults",{}),me(xl,"defaultRoutes"),xl);function q5(e,t){const n=e.options.ticks,r=z5(e),i=Math.min(n.maxTicksLimit||r,r),s=n.major.enabled?K5(t):[],o=s.length,a=s[0],l=s[o-1],c=[];if(o>i)return U5(t,c,s,o/i),c;const u=H5(s,t,i);if(o>0){let d,f;const h=o>1?Math.round((l-a)/(o-1)):null;for(ul(t,c,u,Ye(h)?0:a-h,a),d=0,f=o-1;d<f;d++)ul(t,c,u,s[d],s[d+1]);return ul(t,c,u,l,Ye(h)?t.length:l+h),c}return ul(t,c,u),c}function z5(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 H5(e,t,n){const r=W5(e),i=t.length/n;if(!r)return Math.max(i,1);const s=IP(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 K5(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function U5(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 ul(e,t,n,r,i){const s=je(r,0),o=Math.min(je(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 W5(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 V5=e=>e==="left"?"right":e==="right"?"left":e,Ly=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Iy=(e,t)=>Math.min(t||e,e);function Ry(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 G5(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 Q5(e,t){Qe(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 ho(e){return e.drawTicks?e.tickLength:0}function Ny(e,t){if(!e.display)return 0;const n=ft(e.font,t),r=Et(e.padding);return(st(e.text)?e.text.length:1)*n.lineHeight+r.height}function Y5(e,t){return Gr(e,{scale:t,type:"scale"})}function X5(e,t,n){return Gr(e,{tick:n,index:t,type:"tick"})}function J5(e,t,n){let r=Ef(e);return(n&&t!=="right"||!n&&t==="right")&&(r=V5(r)),r}function Z5(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=St(r,s,a),Ne(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=Ly(e,n,t);f=a-s}else{if(Ne(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=Ly(e,n,t);g=St(r,o,i),d=n==="left"?-Xt:Xt}return{titleX:h,titleY:g,maxWidth:f,rotation:d}}class Ws extends Ni{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=jn(t,Number.POSITIVE_INFINITY),n=jn(n,Number.NEGATIVE_INFINITY),r=jn(r,Number.POSITIVE_INFINITY),i=jn(i,Number.NEGATIVE_INFINITY),{min:jn(t,r),max:jn(n,i),minDefined:yt(t),maxDefined:yt(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:jn(n,jn(r,n)),max:jn(r,jn(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(){Ze(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=vT(this,s,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Ry(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=q5(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(){Ze(this.options.afterUpdate,[this])}beforeSetDimensions(){Ze(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(){Ze(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Ze(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Ze(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=Ze(n.callback,[s.value,r,t],this)}afterTickToLabelConversion(){Ze(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Ze(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=Iy(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=ln(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-ho(t.grid)-n.padding-Ny(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),o=kf(Math.min(Math.asin(ln((u.highest.height+6)/a,-1,1)),Math.asin(ln(l/c,-1,1))-Math.asin(ln(f/c,-1,1)))),o=Math.max(i,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){Ze(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Ze(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=Ny(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=ho(s)+l):(t.height=this.maxHeight,t.width=ho(s)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),h=r.padding*2,g=Dr(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(){Ze(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)Ye(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=Ry(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/Iy(n,r));let c=0,u=0,d,f,h,g,m,p,v,b,w,C,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=C=0,!Ye(g)&&!st(g))w=Xl(i,v.data,v.gc,w,g),C=b;else if(st(g))for(f=0,h=g.length;f<h;++f)x=g[f],!Ye(x)&&!st(x)&&(w=Xl(i,v.data,v.gc,w,x),C+=b);o.push(w),a.push(C),c=Math.max(w,c),u=Math.max(C,u)}Q5(s,n);const k=o.indexOf(c),S=a.indexOf(u),_=O=>({width:o[O]||0,height:a[O]||0});return{first:_(0),last:_(n-1),widest:_(k),highest:_(S),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 zP(this._alignToPixels?ei(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=X5(this.getContext(),t,r))}return this.$context||(this.$context=Y5(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Dr(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=ho(s),h=[],g=a.setContext(this.getContext()),m=g.display?g.width:0,p=m/2,v=function(M){return ei(r,M,m)};let b,w,C,x,k,S,_,O,E,T,D,G;if(o==="top")b=v(this.bottom),S=this.bottom-f,O=b-p,T=v(t.top)+p,G=t.bottom;else if(o==="bottom")b=v(this.top),T=t.top,G=v(t.bottom)-p,S=b+p,O=this.top+f;else if(o==="left")b=v(this.right),k=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,k=b+p,_=this.left+f;else if(n==="x"){if(o==="center")b=v((t.top+t.bottom)/2+.5);else if(Ne(o)){const M=Object.keys(o)[0],I=o[M];b=v(this.chart.scales[M].getPixelForValue(I))}T=t.top,G=t.bottom,S=b+p,O=S+f}else if(n==="y"){if(o==="center")b=v((t.left+t.right)/2);else if(Ne(o)){const M=Object.keys(o)[0],I=o[M];b=v(this.chart.scales[M].getPixelForValue(I))}k=b-p,_=k-f,E=t.left,D=t.right}const N=je(i.ticks.maxTicksLimit,d),L=Math.max(1,Math.ceil(d/N));for(w=0;w<d;w+=L){const M=this.getContext(w),I=s.setContext(M),oe=a.setContext(M),ue=I.lineWidth,B=I.color,J=oe.dash||[],ae=oe.dashOffset,ne=I.tickWidth,R=I.tickColor,Q=I.tickBorderDash||[],q=I.tickBorderDashOffset;C=G5(this,w,l),C!==void 0&&(x=ei(r,C,ue),c?k=_=E=D=x:S=O=T=G=x,h.push({tx1:k,ty1:S,tx2:_,ty2:O,x1:E,y1:T,x2:D,y2:G,width:ue,color:B,borderDash:J,borderDashOffset:ae,tickWidth:ne,tickColor:R,tickBorderDash:Q,tickBorderDashOffset:q}))}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=ho(r.grid),h=f+u,g=d?-u:h,m=-Dr(this.labelRotation),p=[];let v,b,w,C,x,k,S,_,O,E,T,D,G="middle";if(i==="top")k=this.bottom-g,S=this._getXAxisLabelAlignment();else if(i==="bottom")k=this.top+g,S=this._getXAxisLabelAlignment();else if(i==="left"){const L=this._getYAxisLabelAlignment(f);S=L.textAlign,x=L.x}else if(i==="right"){const L=this._getYAxisLabelAlignment(f);S=L.textAlign,x=L.x}else if(n==="x"){if(i==="center")k=(t.top+t.bottom)/2+h;else if(Ne(i)){const L=Object.keys(i)[0],M=i[L];k=this.chart.scales[L].getPixelForValue(M)+h}S=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")x=(t.left+t.right)/2-h;else if(Ne(i)){const L=Object.keys(i)[0],M=i[L];x=this.chart.scales[L].getPixelForValue(M)}S=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?G="top":l==="end"&&(G="bottom"));const N=this._getLabelSizes();for(v=0,b=a.length;v<b;++v){w=a[v],C=w.label;const L=s.setContext(this.getContext(v));_=this.getPixelForTick(v)+s.labelOffset,O=this._resolveTickFontOptions(v),E=O.lineHeight,T=st(C)?C.length:1;const M=T/2,I=L.color,oe=L.textStrokeColor,ue=L.textStrokeWidth;let B=S;o?(x=_,S==="inner"&&(v===b-1?B=this.options.reverse?"left":"right":v===0?B=this.options.reverse?"right":"left":B="center"),i==="top"?c==="near"||m!==0?D=-T*E+E/2:c==="center"?D=-N.highest.height/2-M*E+E:D=-N.highest.height+E/2:c==="near"||m!==0?D=E/2:c==="center"?D=N.highest.height/2-M*E:D=N.highest.height-T*E,d&&(D*=-1),m!==0&&!L.showLabelBackdrop&&(x+=E/2*Math.sin(m))):(k=_,D=(1-T)*E/2);let J;if(L.showLabelBackdrop){const ae=Et(L.backdropPadding),ne=N.heights[v],R=N.widths[v];let Q=D-ae.top,q=0-ae.left;switch(G){case"middle":Q-=ne/2;break;case"bottom":Q-=ne;break}switch(S){case"center":q-=R/2;break;case"right":q-=R;break;case"inner":v===b-1?q-=R:v>0&&(q-=R/2);break}J={left:q,top:Q,width:R+ae.width,height:ne+ae.height,color:L.backdropColor}}p.push({label:C,font:O,textOffset:D,options:{rotation:m,color:I,strokeColor:oe,strokeWidth:ue,textAlign:B,textBaseline:G,translation:[x,k],backdrop:J}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Dr(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=ei(t,this.left,o)-o/2,u=ei(t,this.right,a)+a/2,d=f=l):(d=ei(t,this.top,o)-o/2,f=ei(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&&Tc(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;Ti(r,c,0,u,l,a)}i&&jc(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const s=ft(r.font),o=Et(r.padding),a=r.align;let l=s.lineHeight/2;n==="bottom"||n==="center"||Ne(n)?(l+=o.bottom,st(r.text)&&(l+=s.lineHeight*(r.text.length-1))):l+=o.top;const{titleX:c,titleY:u,maxWidth:d,rotation:f}=Z5(this,l,n,a);Ti(t,r.text,0,0,s,{color:r.color,maxWidth:d,rotation:f,textAlign:J5(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=je(t.grid&&t.grid.z,-1),i=je(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Ws.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 ft(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class dl{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;nj(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,ej(t,o,r),this.override&&lt.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 lt[i]&&(delete lt[i][r],this.override&&delete Pi[r])}}function ej(e,t,n){const r=na(Object.create(null),[n?lt.get(n):{},lt.get(t),e.defaults]);lt.set(t,r),e.defaultRoutes&&tj(t,e.defaultRoutes),e.descriptors&&lt.describe(t,e.descriptors)}function tj(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(".");lt.route(s,i,l,a)})}function nj(e){return"id"in e&&"defaults"in e}class rj{constructor(){this.controllers=new dl(es,"datasets",!0),this.elements=new dl(Ni,"elements"),this.plugins=new dl(Object,"plugins"),this.scales=new dl(Ws,"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):Qe(i,o=>{const a=r||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,n,r){const i=_f(t);Ze(r["before"+i],[],r),n[t](r),Ze(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 Dn=new rj;class ij{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(Ze(a,l,o)===!1&&i.cancelable)return!1}return!0}invalidate(){Ye(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,i=je(r.options&&r.options.plugins,{}),s=sj(r);return i===!1&&!n?[]:aj(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 sj(e){const t={},n=[],r=Object.keys(Dn.plugins.items);for(let s=0;s<r.length;s++)n.push(Dn.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 oj(e,t){return!t&&e===!1?null:e===!0?{}:e}function aj(e,{plugins:t,localIds:n},r,i){const s=[],o=e.getContext();for(const a of t){const l=a.id,c=oj(r[l],i);c!==null&&s.push({plugin:a,options:lj(e.config,{plugin:a,local:n[l]},c,o)})}return s}function lj(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 kd(e,t){const n=lt.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function cj(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function uj(e,t){return e===t?"_index_":"_value_"}function Fy(e){if(e==="x"||e==="y"||e==="r")return e}function dj(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Od(e,...t){if(Fy(e))return e;for(const n of t){const r=n.axis||dj(n.position)||e.length>1&&Fy(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function By(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function fj(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 By(e,"x",n[0])||By(e,"y",n[0])}return{}}function hj(e,t){const n=Pi[e.type]||{scales:{}},r=t.scales||{},i=kd(e.type,t),s=Object.create(null);return Object.keys(r).forEach(o=>{const a=r[o];if(!Ne(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=Od(o,a,fj(o,e),lt.scales[a.type]),c=uj(l,i),u=n.scales||{};s[o]=Lo(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(o=>{const a=o.type||e.type,l=o.indexAxis||kd(a,t),u=(Pi[a]||{}).scales||{};Object.keys(u).forEach(d=>{const f=cj(d,l),h=o[f+"AxisID"]||f;s[h]=s[h]||Object.create(null),Lo(s[h],[{axis:f},r[h],u[d]])})}),Object.keys(s).forEach(o=>{const a=s[o];Lo(a,[lt.scales[a.type],lt.scale])}),s}function Ib(e){const t=e.options||(e.options={});t.plugins=je(t.plugins,{}),t.scales=hj(e,t)}function Rb(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function gj(e){return e=e||{},e.data=Rb(e.data),Ib(e),e}const qy=new Map,Nb=new Set;function fl(e,t){let n=qy.get(e);return n||(n=t(),qy.set(e,n),Nb.add(n)),n}const go=(e,t,n)=>{const r=ra(t,n);r!==void 0&&e.add(r)};class yj{constructor(t){this._config=gj(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=Rb(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(),Ib(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return fl(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return fl(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return fl(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return fl(`${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=>go(l,t,d))),u.forEach(d=>go(l,i,d)),u.forEach(d=>go(l,Pi[s]||{},d)),u.forEach(d=>go(l,lt,d)),u.forEach(d=>go(l,Cd,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Nb.has(n)&&o.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Pi[n]||{},lt.datasets[n]||{},{type:n},lt,Cd]}resolveNamedOptions(t,n,r,i=[""]){const s={$shared:!0},{resolver:o,subPrefixes:a}=zy(this._resolverCache,t,i);let l=o;if(pj(o,n)){s.$shared=!1,r=zr(r)?r():r;const c=this.createResolver(t,r,a);l=Ds(o,r,c)}for(const c of n)s[c]=l[c];return s}createResolver(t,n,r=[""],i){const{resolver:s}=zy(this._resolverCache,t,r);return Ne(n)?Ds(s,n,void 0,i):s}}function zy(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:Tf(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,s)),s}const mj=e=>Ne(e)&&Object.getOwnPropertyNames(e).some(t=>zr(e[t]));function pj(e,t){const{isScriptable:n,isIndexable:r}=vb(e);for(const i of t){const s=n(i),o=r(i),a=(o||s)&&e[i];if(s&&(zr(a)||mj(a))||o&&st(a))return!0}return!1}var vj="4.5.0";const bj=["top","bottom","left","right","chartArea"];function Hy(e,t){return e==="top"||e==="bottom"||bj.indexOf(e)===-1&&t==="x"}function Ky(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Uy(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Ze(n&&n.onComplete,[e],t)}function xj(e){const t=e.chart,n=t.options.animation;Ze(n&&n.onProgress,[e],t)}function Fb(e){return Mf()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const jl={},Wy=e=>{const t=Fb(e);return Object.values(jl).filter(n=>n.canvas===t).pop()};function wj(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 Sj(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}var wr;let Dc=(wr=class{static register(...t){Dn.add(...t),Vy()}static unregister(...t){Dn.remove(...t),Vy()}constructor(t,n){const r=this.config=new yj(n),i=Fb(t),s=Wy(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||B5(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=EP(),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 ij,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=VP(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],jl[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Yn.listen(this,"complete",Uy),Yn.listen(this,"progress",xj),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:s}=this;return Ye(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 Dn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():vy(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return yy(this.canvas,this.ctx),this}stop(){return Yn.stop(this),this}resize(t,n){Yn.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,vy(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),Ze(r.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Qe(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=Od(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Qe(s,o=>{const a=o.options,l=a.id,c=Od(l,a),u=je(a.type,o.dtype);(a.position===void 0||Hy(a.position,c)!==Hy(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=Dn.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,t)}),Qe(i,(o,a)=>{o||delete r[a]}),Qe(r,o=>{cn.configure(this,o,o.options),cn.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(Ky("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||kd(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=Dn.getController(a),{datasetElementType:c,dataElementType:u}=lt.datasets[a];Object.assign(l,{dataElementType:Dn.getElement(u),datasetElementType:c&&Dn.getElement(c)}),o.controller=new l(this,r),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){Qe(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||Qe(s,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Ky("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Qe(this.scales,t=>{cn.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!oy(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;wj(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(!oy(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;cn.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Qe(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,zr(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&&(Yn.has(this)?this.attached&&!Yn.running(this)&&Yn.start(this):(this.draw(),Uy({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=Ab(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(i&&Tc(n,i),t.controller.draw(),i&&jc(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return ir(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const s=b5.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=Gr(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);Ql(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(),Yn.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(),yy(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete jl[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)};Qe(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(){Qe(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Qe(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}});!Vl(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=MP(t),c=Sj(t,this._lastEvent,r,l);r&&(this._lastEvent=null,Ze(s.onHover,[t,a,this],this),l&&Ze(s.onClick,[t,a,this],this));const u=!Vl(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(wr,"defaults",lt),me(wr,"instances",jl),me(wr,"overrides",Pi),me(wr,"registry",Dn),me(wr,"version",vj),me(wr,"getChart",Wy),wr);function Vy(){return Qe(Dc.instances,e=>e._plugins.invalidate())}function Bb(e,t,n=t){e.lineCap=je(n.borderCapStyle,t.borderCapStyle),e.setLineDash(je(n.borderDash,t.borderDash)),e.lineDashOffset=je(n.borderDashOffset,t.borderDashOffset),e.lineJoin=je(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=je(n.borderWidth,t.borderWidth),e.strokeStyle=je(n.borderColor,t.borderColor)}function Cj(e,t,n){e.lineTo(n.x,n.y)}function _j(e){return e.stepped?lT:e.tension||e.cubicInterpolationMode==="monotone"?cT:Cj}function qb(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 kj(e,t,n,r){const{points:i,options:s}=t,{count:o,start:a,loop:l,ilen:c}=qb(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 Oj(e,t,n,r){const i=t.points,{count:s,start:o,ilen:a}=qb(i,n,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,f,h,g,m,p,v;const b=C=>(o+(c?a-C:C))%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 C=h.x,x=h.y,k=C|0;k===g?(x<m?m=x:x>p&&(p=x),u=(d*u+C)/++d):(w(),e.lineTo(C,x),g=k,d=0,m=p=x),v=x}w()}function Ed(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?Oj:kj}function Ej(e){return e.stepped?HT:e.tension||e.cubicInterpolationMode==="monotone"?KT:si}function Aj(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),Bb(e,t.options),e.stroke(i)}function Pj(e,t,n,r){const{segments:i,options:s}=t,o=Ed(t);for(const a of i)Bb(e,s,a.style),e.beginPath(),o(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const Tj=typeof Path2D=="function";function jj(e,t,n,r){Tj&&!t.options.segment?Aj(e,t,n,r):Pj(e,t,n,r)}class Lr extends Ni{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;LT(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=YT(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=Eb(this,{property:n,start:i,end:i});if(!o.length)return;const a=[],l=Ej(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 Ed(this)(t,this,n,r)}path(t,n,r){const i=this.segments,s=Ed(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(),jj(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}me(Lr,"id","line"),me(Lr,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),me(Lr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),me(Lr,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Gy(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 Ni{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 Gy(this,n,"x",r)}inYRange(n,r){return Gy(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||!ir(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,_d(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 $j(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=Lc(l,c,i);const u=Ad(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=Eb(t,u);for(const f of d){const h=Ad(n,s[f.start],s[f.end],f.loop),g=Ob(a,i,h);for(const m of g)o.push({source:m,target:f,start:{[n]:Qy(u,h,"start",Math.max)},end:{[n]:Qy(u,h,"end",Math.min)}})}}return o}function Ad(e,t,n,r){if(r)return;let i=t[e],s=n[e];return e==="angle"&&(i=Gt(i),s=Gt(s)),{property:e,start:i,end:s}}function Mj(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,s=[];return t.segments.forEach(({start:o,end:a})=>{a=Lc(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 Lc(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function Qy(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function zb(e,t){let n=[],r=!1;return st(e)?(r=!0,n=e):n=Mj(e,t),n.length?new Lr({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function Yy(e){return e&&e.fill!==!1}function Dj(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(!yt(i))return i;if(o=e[i],!o)return!1;if(o.visible)return i;s.push(i),i=o.fill}return!1}function Lj(e,t,n){const r=Fj(e);if(Ne(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return yt(i)&&Math.floor(i)===i?Ij(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function Ij(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function Rj(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:Ne(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function Nj(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:Ne(e)?r=e.value:r=t.getBaseValue(),r}function Fj(e){const t=e.options,n=t.fill;let r=je(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function Bj(e){const{scale:t,index:n,line:r}=e,i=[],s=r.segments,o=r.points,a=qj(t,n);a.push(zb({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++)zj(i,o[u],a)}return new Lr({points:i,options:{}})}function qj(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 zj(e,t,n){const r=[];for(let i=0;i<n.length;i++){const s=n[i],{first:o,last:a,point:l}=Hj(s,t,"x");if(!(!l||o&&a)){if(o)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function Hj(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(Xi(i,d,f)){a=i===d,l=i===f;break}}return{first:a,last:l,point:r}}class Hb{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:Jt},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 Kj(e){const{chart:t,fill:n,line:r}=e;if(yt(n))return Uj(t,n);if(n==="stack")return Bj(e);if(n==="shape")return!0;const i=Wj(e);return i instanceof Hb?i:zb(i,r)}function Uj(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function Wj(e){return(e.scale||{}).getPointPositionForValue?Gj(e):Vj(e)}function Vj(e){const{scale:t={},fill:n}=e,r=Rj(n,t);if(yt(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function Gj(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,s=r.reverse?t.max:t.min,o=Nj(n,t,s),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,s);return new Hb({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 Eu(e,t,n){const r=Kj(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=Ab(i,g);r&&o.points.length&&(Tc(e,n),Qj(e,{line:o,target:r,above:f,below:h,area:n,scale:a,axis:l,clip:m}),jc(e))}function Qj(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"?(Xy(e,r,o.top),Au(e,{line:n,target:r,color:i,scale:a,property:c,clip:l}),e.restore(),e.save(),Xy(e,r,o.bottom)):c==="y"&&(Jy(e,r,o.left),Au(e,{line:n,target:r,color:s,scale:a,property:c,clip:l}),e.restore(),e.save(),Jy(e,r,o.right),u=i)),Au(e,{line:n,target:r,color:u,scale:a,property:c,clip:l}),e.restore()}function Xy(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[Lc(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 Jy(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[Lc(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 Au(e,t){const{line:n,target:r,property:i,color:s,scale:o,clip:a}=t,l=$j(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,Yj(e,o,a,g&&Ad(i,d,f)),e.beginPath();const m=!!n.pathSegment(e,c);let p;if(g){m?e.closePath():Zy(e,r,f,i);const v=!!r.pathSegment(e,u,{move:m,reverse:!0});p=m&&v,p||Zy(e,r,d,i)}e.closePath(),e.fill(p?"evenodd":"nonzero"),e.restore()}}function Yj(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 Zy(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var Xj={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 Lr&&(l={visible:e.isDatasetVisible(o),index:o,fill:Lj(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=Dj(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&&Eu(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;Yy(s)&&Eu(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!Yy(r)||n.drawTime!=="beforeDatasetDraw"||Eu(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const em=(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)}},Jj=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class tm extends Ni{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=Ze(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=ft(r.font),s=i.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=em(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}=Zj(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=Zi(s,this.left,this.width);if(this.isHorizontal()){let a=0,l=St(r,this.left+i,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=St(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=St(r,this.top+t+i,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=St(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;Tc(t,this),this._draw(),jc(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:s,labels:o}=t,a=lt.color,l=Zi(t.rtl,this.left,this.width),c=ft(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}=em(o,d),v=function(k,S,_){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;i.save();const O=je(_.lineWidth,1);if(i.fillStyle=je(_.fillStyle,a),i.lineCap=je(_.lineCap,"butt"),i.lineDashOffset=je(_.lineDashOffset,0),i.lineJoin=je(_.lineJoin,"miter"),i.lineWidth=O,i.strokeStyle=je(_.strokeStyle,a),i.setLineDash(je(_.lineDash,[])),o.usePointStyle){const E={radius:m*Math.SQRT2/2,pointStyle:_.pointStyle,rotation:_.rotation,borderWidth:O},T=l.xPlus(k,g/2),D=S+f;mb(i,E,T,D,o.pointStyleWidth&&g)}else{const E=S+Math.max((d-m)/2,0),T=l.leftForLtr(k,g),D=Ji(_.borderRadius);i.beginPath(),Object.values(D).some(G=>G!==0)?Jl(i,{x:T,y:E,w:g,h:m,radius:D}):i.rect(T,E,g,m),i.fill(),O!==0&&i.stroke()}i.restore()},b=function(k,S,_){Ti(i,_.text,k,S+p/2,c,{strikethrough:_.hidden,textAlign:l.textAlign(_.textAlign)})},w=this.isHorizontal(),C=this._computeTitleHeight();w?h={x:St(s,this.left+u,this.right-r[0]),y:this.top+u+C,line:0}:h={x:this.left+u,y:St(s,this.top+C+u,this.bottom-n[0].height),line:0},Cb(this.ctx,t.textDirection);const x=p+u;this.legendItems.forEach((k,S)=>{i.strokeStyle=k.fontColor,i.fillStyle=k.fontColor;const _=i.measureText(k.text).width,O=l.textAlign(k.textAlign||(k.textAlign=o.textAlign)),E=g+f+_;let T=h.x,D=h.y;l.setWidth(this.width),w?S>0&&T+E+u>this.right&&(D=h.y+=x,h.line++,T=h.x=St(s,this.left+u,this.right-r[h.line])):S>0&&D+x>this.bottom&&(T=h.x=T+n[h.line].width+u,h.line++,D=h.y=St(s,this.top+C+u,this.bottom-n[h.line].height));const G=l.x(T);if(v(G,D,k),T=GP(O,T+g+f,w?T+E:this.right,t.rtl),b(l.x(T),D,k),w)h.x+=E+u;else if(typeof k.text!="string"){const N=c.lineHeight;h.y+=Kb(k,N)+u}else h.y+=x}),_b(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=ft(n.font),i=Et(n.padding);if(!n.display)return;const s=Zi(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=St(t.align,d,this.right-f);else{const g=this.columnSizes.reduce((m,p)=>Math.max(m,p.height),0);u=c+St(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const h=St(a,d,d+f);o.textAlign=s.textAlign(Ef(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=r.string,Ti(o,n.text,h,u,r)}_computeTitleHeight(){const t=this.options.title,n=ft(t.font),r=Et(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,s;if(Xi(t,this.left,this.right)&&Xi(n,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(i=s[r],Xi(t,i.left,i.left+i.width)&&Xi(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!n$(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,s=Jj(i,r);i&&!s&&Ze(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!s&&Ze(n.onHover,[t,r,this],this)}else r&&Ze(n.onClick,[t,r,this],this)}}function Zj(e,t,n,r,i){const s=e$(r,e,t,n),o=t$(i,r,t.lineHeight);return{itemWidth:s,itemHeight:o}}function e$(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 t$(e,t,n){let r=e;return typeof t.text!="string"&&(r=Kb(t,n)),r}function Kb(e,t){const n=e.text?e.text.length:0;return t*n}function n$(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var r$={id:"legend",_element:tm,start(e,t,n){const r=e.legend=new tm({ctx:e.ctx,options:n,chart:e});cn.configure(e,r,n),cn.addBox(e,r)},stop(e){cn.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;cn.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=Et(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 Ub extends Ni{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=st(r.text)?r.text.length:1;this._padding=Et(r.padding);const s=i*ft(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=St(a,r,s),d=n+t,c=s-r):(o.position==="left"?(u=r+t,d=St(a,i,n),l=ut*-.5):(u=s-t,d=St(a,n,i),l=ut*.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=ft(n.font),s=r.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(s);Ti(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:Ef(n.align),textBaseline:"middle",translation:[o,a]})}}function i$(e,t){const n=new Ub({ctx:e.ctx,options:t,chart:e});cn.configure(e,n,t),cn.addBox(e,n),e.titleBlock=n}var s$={id:"title",_element:Ub,start(e,t,n){i$(e,n)},stop(e){const t=e.titleBlock;cn.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;cn.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 Eo={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=Sd(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 Mn(e,t){return t&&(st(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Xn(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
66
66
  `)>-1?e.split(`
67
- `):e}function sM(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 nm(e,t){const n=e.chart.ctx,{body:r,footer:i,title:s}=e,{boxWidth:o,boxHeight:a}=t,l=dt(t.bodyFont),c=dt(t.titleFont),u=dt(t.footerFont),d=s.length,f=i.length,h=r.length,g=Ot(t.padding);let m=g.height,p=0,v=r.reduce((C,x)=>C+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 C=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=h*C+(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(C){p=Math.max(p,n.measureText(C).width+b)};return n.save(),n.font=c.string,Ge(e.title,w),n.font=l.string,Ge(e.beforeBody.concat(e.afterBody),w),b=t.displayColors?o+2+t.boxPadding:0,Ge(r,C=>{Ge(C.before,w),Ge(C.lines,w),Ge(C.after,w)}),b=0,n.font=u.string,Ge(e.footer,w),n.restore(),p+=g.width,{width:p,height:m}}function oM(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function aM(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 lM(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"),aM(c,e,t,n)&&(c="center"),c}function rm(e,t,n){const r=n.yAlign||t.yAlign||oM(e,n);return{xAlign:n.xAlign||t.xAlign||lM(e,t,n,r),yAlign:r}}function cM(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function uM(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function im(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}=Ji(o);let g=cM(t,a);const m=uM(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:ln(g,0,r.width-t.width),y:ln(m,0,r.height-t.height)}}function hl(e,t,n){const r=Ot(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function sm(e){return $n([],Xn(e))}function dM(e,t,n){return Gr(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function om(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Ub={beforeTitle:Wn,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:Wn,beforeBody:Wn,beforeLabel:Wn,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 Qe(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:Wn,afterBody:Wn,beforeFooter:Wn,footer:Wn,afterFooter:Wn};function $t(e,t,n,r){const i=e[t].call(n,r);return typeof i=="undefined"?Ub[t].call(n,r):i}class Pd extends Ni{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 Ab(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=dM(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=$t(r,"beforeTitle",this,t),s=$t(r,"title",this,t),o=$t(r,"afterTitle",this,t);let a=[];return a=$n(a,Xn(i)),a=$n(a,Xn(s)),a=$n(a,Xn(o)),a}getBeforeBody(t,n){return sm($t(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return Ge(t,s=>{const o={before:[],lines:[],after:[]},a=om(r,s);$n(o.before,Xn($t(a,"beforeLabel",this,s))),$n(o.lines,$t(a,"label",this,s)),$n(o.after,Xn($t(a,"afterLabel",this,s))),i.push(o)}),i}getAfterBody(t,n){return sm($t(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=$t(r,"beforeFooter",this,t),s=$t(r,"footer",this,t),o=$t(r,"afterFooter",this,t);let a=[];return a=$n(a,Xn(i)),a=$n(a,Xn(s)),a=$n(a,Xn(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(sM(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))),Ge(a,u=>{const d=om(t.callbacks,u);i.push($t(d,"labelColor",this,u)),s.push($t(d,"labelPointStyle",this,u)),o.push($t(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=Eo[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=nm(this,r),c=Object.assign({},a,l),u=rm(this.chart,r,c),d=im(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}=Ji(a),{x:f,y:h}=t,{width:g,height:m}=n;let p,v,b,w,C,x;return s==="center"?(C=h+m/2,i==="left"?(p=f,v=p-o,w=C+o,x=C-o):(p=f+g,v=p+o,w=C-o,x=C+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,C=w-o,p=v-o,b=v+o):(w=h+m,C=w+o,p=v+o,b=v-o),x=w),{x1:p,x2:v,x3:b,y1:w,y2:C,y3:x}}drawTitle(t,n,r){const i=this.title,s=i.length;let o,a,l;if(s){const c=Zi(r.rtl,this.x,this.width);for(t.x=hl(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",o=dt(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=dt(s.bodyFont),d=hl(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,_d(t,m,p,v),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,_d(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=Ji(o.borderRadius);Object.values(v).some(b=>b!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,Jl(t,{x:m,y:g,w:c,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Jl(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=dt(r.bodyFont);let f=d.lineHeight,h=0;const g=Zi(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,C,x,k,S;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=hl(this,p,r),n.fillStyle=r.bodyColor,Ge(this.beforeBody,m),h=a&&p!=="right"?o==="center"?c/2+u:c+2+u:0,C=0,k=i.length;C<k;++C){for(v=i[C],b=this.labelTextColors[C],n.fillStyle=b,Ge(v.before,m),w=v.lines,a&&w.length&&(this._drawColorBox(n,t,C,g,r),f=Math.max(d.lineHeight,l)),x=0,S=w.length;x<S;++x)m(w[x]),f=d.lineHeight;Ge(v.after,m)}h=0,f=d.lineHeight,Ge(this.afterBody,m),t.y-=s}drawFooter(t,n,r){const i=this.footer,s=i.length;let o,a;if(s){const l=Zi(r.rtl,this.x,this.width);for(t.x=hl(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",o=dt(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}=Ji(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=Eo[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=nm(this,t),l=Object.assign({},o,this._size),c=rm(n,t,l),u=im(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=Ot(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),Sb(t,n.textDirection),s.y+=o.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),Cb(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=!Wl(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||!Wl(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=Eo[s.position].call(this,t,n);return o!==!1&&(r!==o.x||i!==o.y)}}pe(Pd,"positioners",Eo);var fM={id:"tooltip",_element:Pd,positioners:Eo,afterInit(e,t,n){n&&(e.tooltip=new Pd({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:Ub},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 hM=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function gM(e,t,n,r){const i=e.indexOf(t);if(i===-1)return hM(e,t,n,r);const s=e.lastIndexOf(t);return i!==s?n:i}const yM=(e,t)=>e===null?null:ln(Math.round(e),0,t);function am(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Td extends Vs{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(Qe(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:gM(r,t,$e(n,t),this._addedLabels),yM(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 am.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}}pe(Td,"id","category"),pe(Td,"defaults",{ticks:{callback:am}});function mM(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=!Qe(o),b=!Qe(a),w=!Qe(c),C=(p-m)/(d+1);let x=ly((p-m)/g/h)*h,k,S,_,O;if(x<1e-14&&!v&&!b)return[{value:m},{value:p}];O=Math.ceil(p/x)-Math.floor(m/x),O>g&&(x=ly(O*x/g/h)*h),Qe(l)||(k=Math.pow(10,l),x=Math.ceil(x*k)/k),i==="ticks"?(S=Math.floor(m/x)*x,_=Math.ceil(p/x)*x):(S=m,_=p),v&&b&&s&&RP((a-o)/s,x/1e3)?(O=Math.round(Math.min((a-o)/x,u)),x=(a-o)/O,S=o,_=a):w?(S=v?o:S,_=b?a:_,O=c-1,x=(_-S)/O):(O=(_-S)/x,Io(O,Math.round(O),x/1e3)?O=Math.round(O):O=Math.ceil(O));const E=Math.max(cy(x),cy(S));k=Math.pow(10,Qe(l)?E:l),S=Math.round(S*k)/k,_=Math.round(_*k)/k;let T=0;for(v&&(f&&S!==o?(n.push({value:o}),S<o&&T++,Io(Math.round((S+T*x)*k)/k,o,lm(o,C,e))&&T++):S<o&&T++);T<O;++T){const D=Math.round((S+T*x)*k)/k;if(b&&D>a)break;n.push({value:D})}return b&&f&&_!==a?n.length&&Io(n[n.length-1].value,a,lm(a,C,e))?n[n.length-1].value=a:n.push({value:a}):(!b||_===a)&&n.push({value:_}),n}function lm(e,t,{horizontal:n,minRotation:r}){const i=Dr(r),s=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(""+e).length;return Math.min(t/s,o)}class jd extends Vs{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 Qe(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=$s(i),c=$s(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=mM(i,s);return t.bounds==="ticks"&&NP(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 gb(t,this.chart.options.locale,this.options.ticks.format)}}class Md extends jd{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=gt(t)?t:0,this.max=gt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Dr(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}}pe(Md,"id","linear"),pe(Md,"defaults",{ticks:{callback:Pf.formatters.numeric}});function $d(e){const t=e.ticks;if(t.display&&e.display){const n=Ot(t.backdropPadding);return $e(t.font&&t.font.size,at.font.size)+n.height}return 0}function pM(e,t,n){return n=it(n)?n:[n],{w:oT(e,t.string,n),h:n.length*t.lineHeight}}function cm(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 vM(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?ct/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=dt(c.font),f=pM(e.ctx,d,e._pointLabels[l]);r[l]=f;const h=Gt(e.getIndexAngle(l)+a),g=Math.round(kf(h)),m=cm(g,u.x,f.w,0,180),p=cm(g,u.y,f.h,90,270);bM(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=SM(e,r,i)}function bM(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 xM(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(kf(Gt(l.angle+Xt))),u=kM(l.y,a.h,c),d=CM(c),f=_M(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 wM(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:s}=e;return!(ir({x:n,y:r},t)||ir({x:n,y:s},t)||ir({x:i,y:r},t)||ir({x:i,y:s},t))}function SM(e,t,n){const r=[],i=e._pointLabels.length,s=e.options,{centerPointLabels:o,display:a}=s.pointLabels,l={extra:$d(s)/2,additionalAngle:o?ct/i:0};let c;for(let u=0;u<i;u++){l.padding=n[u],l.size=t[u];const d=xM(e,u,l);r.push(d),a==="auto"&&(d.visible=wM(d,c),d.visible&&(c=d))}return r}function CM(e){return e===0||e===180?"center":e<180?"left":"right"}function _M(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function kM(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function OM(e,t,n){const{left:r,top:i,right:s,bottom:o}=n,{backdropColor:a}=t;if(!Qe(a)){const l=Ji(t.borderRadius),c=Ot(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(),Jl(e,{x:u,y:d,w:f,h,radius:l}),e.fill()):e.fillRect(u,d,f,h)}}function EM(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));OM(n,o,s);const a=dt(o.font),{x:l,y:c,textAlign:u}=s;Ti(n,e._pointLabels[i],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function Vb(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,Jt);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 AM(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(),Vb(e,n,o,r),s.closePath(),s.stroke(),s.restore())}function PM(e,t,n){return Gr(e,{label:n,index:t,type:"pointLabel"})}class Ao extends jd{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=Ot($d(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=gt(t)&&!isNaN(t)?t:0,this.max=gt(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/$d(this.options))}generateTickLabels(t){jd.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const i=Ze(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?vM(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=Jt/(this._pointLabels.length||1),r=this.options.startAngle||0;return Gt(t*n+Dr(r))}getDistanceFromCenterForValue(t){if(Qe(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(Qe(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 PM(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const i=this.getIndexAngle(t)-Xt+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(),Vb(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&&EM(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);AM(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=dt(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=Ot(c.backdropPadding);t.fillRect(-o/2-d.left,-s-u.size/2-d.top,o+d.width,u.size+d.height)}Ti(t,a.label,0,-s,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}pe(Ao,"id","radialLinear"),pe(Ao,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Pf.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),pe(Ao,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),pe(Ao,"descriptors",{angleLines:{_fallback:"grid"}});const Ic={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}},Rt=Object.keys(Ic);function um(e,t){return e-t}function dm(e,t){if(Qe(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)),gt(o)||(o=typeof r=="string"?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i==="week"&&(ia(s)||s===!0)?n.startOf(o,"isoWeek",s):n.startOf(o,i)),+o)}function fm(e,t,n,r){const i=Rt.length;for(let s=Rt.indexOf(e);s<i-1;++s){const o=Ic[Rt[s]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-t)/(a*o.size))<=r)return Rt[s]}return Rt[i-1]}function TM(e,t,n,r,i){for(let s=Rt.length-1;s>=Rt.indexOf(n);s--){const o=Rt[s];if(Ic[o].common&&e._adapter.diff(i,r,o)>=t-1)return o}return Rt[n?Rt.indexOf(n):0]}function jM(e){for(let t=Rt.indexOf(e)+1,n=Rt.length;t<n;++t)if(Ic[Rt[t]].common)return Rt[t]}function hm(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=Of(n,t),s=n[r]>=t?n[r]:n[i];e[s]=!0}}function MM(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 gm(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:MM(e,r,i,n)}class tc extends Vs{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 h5._date(t.adapters.date);i.init(n),Lo(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:dm(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=gt(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),s=gt(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=HP(i,s,o);return this._unit=n.unit||(r.autoSkip?fm(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):TM(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:jM(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),gm(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=ln(n,0,o),r=ln(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||fm(s.minUnit,n,r,this._getLabelCapacity(n)),a=$e(i.ticks.stepSize,1),l=o==="week"?s.isoWeekday:!1,c=ia(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++)hm(u,f,g);return(f===r||i.bounds==="ticks"||h===1)&&hm(u,f,g),Object.keys(u).sort(um).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 Ze(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=Dr(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,gm(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(dm(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return UP(t.sort(um))}}pe(tc,"id","time"),pe(tc,"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 gl(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}=ui(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}=ui(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 ym extends tc{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=gl(n,this.min),this._tableRange=gl(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(gl(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return gl(this._table,r*this._tableRange+this._minPos,!0)}}pe(ym,"id","timeseries"),pe(ym,"defaults",tc.defaults);const Wb="label";function mm(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function $M(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function Gb(e,t){e.labels=t}function Qb(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Wb;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 DM(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Wb;const n={labels:[],datasets:[]};return Gb(n,e.labels),Qb(n,e.datasets,t),n}function LM(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=z.useRef(null),g=z.useRef(null),m=()=>{h.current&&(g.current=new Dc(h.current,{type:o,data:DM(a,s),options:l&&{...l},plugins:c}),mm(t,g.current))},p=()=>{mm(t,null),g.current&&(g.current.destroy(),g.current=null)};return z.useEffect(()=>{!i&&g.current&&l&&$M(g.current,l)},[i,l]),z.useEffect(()=>{!i&&g.current&&Gb(g.current.config.data,a.labels)},[i,a.labels]),z.useEffect(()=>{!i&&g.current&&a.datasets&&Qb(g.current.config.data,a.datasets,s)},[i,a.datasets]),z.useEffect(()=>{g.current&&(i?(p(),setTimeout(m)):g.current.update(d))},[i,l,a.labels,a.datasets,d]),z.useEffect(()=>{g.current&&(p(),setTimeout(m))},[o]),z.useEffect(()=>(m(),()=>p()),[]),z.createElement("canvas",{ref:h,role:"img",height:n,width:r,...f},u)}const IM=z.forwardRef(LM);function Yb(e,t){return Dc.register(t),z.forwardRef((n,r)=>z.createElement(IM,{...n,ref:r,type:e}))}const RM=Yb("line",Al),NM=Yb("radar",Pl);Dc.register(Td,Md,Ao,Lr,Ml,Yj,iM,fM,nM);var Dd={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}},FM=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 pm(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 vm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pm(Object(n),!0).forEach(function(r){BM(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pm(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function BM(e,t,n){return(t=qM(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qM(e){var t=zM(e,"string");return Is(t)=="symbol"?t:t+""}function zM(e,t){if(Is(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Is(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Is(e){"@babel/helpers - typeof";return Is=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},Is(e)}function HM(e){var t=new Date(e);return isNaN(t.getTime())?String(e):t.toLocaleString("en-US",{month:"short",day:"numeric"})}var KM=function(){var t,n,r,i,s=Us(),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&&Is(d.labels)==="object"?Object.values(d.labels):[],h=f.map(function(v){return HM(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=vm(vm({},Dd),{},{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($a,{title:"Mentions progress",tooltip:"Tracks how your brand mentions have changed over time across the same query set."}),y.jsx(Ma,{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:"Needs multiple analyses before info can be shown."}):y.jsx("div",{className:"yst-h-72",children:y.jsx(RM,{data:function(){var v={labels:h,datasets:[d==null?void 0:d.datasets]};return v}(),options:p})})]})})};function yl(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",Yo(u)),children:[u>0?y.jsx(Gv,{}):u<0?y.jsx(Wv,{}):null,u>-1e-6&&"+",u]}),i&&y.jsx(vf,{id:"tooltip-".concat(r.replace(/\s+/g,"-").toLowerCase()),className:"yst-absolute yst-right-2 yst-top-2",position:f,children:i})]})}function UM(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 VM(e){return e>0?"yst-text-green-600":e<0?"yst-text-red-600":"yst-text-slate-500"}function WM(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",VM(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(Wv,{className:"yst-w-4 yst-h-4"}),a]})}function oa(e){"@babel/helpers - typeof";return oa=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},oa(e)}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 ml(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){GM(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 GM(e,t,n){return(t=QM(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QM(e){var t=YM(e,"string");return oa(t)=="symbol"?t:t+""}function YM(e,t){if(oa(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(oa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function XM(){var e,t,n,r,i,s,o,a,l,c,u,d,f,h,g,m,p,v,b,w,C,x,k,S,_,O=En(),E=O.brandId,T=O.analysisId,D=_c(E,T,{query:{select:function(me){var Te=me.data;return Te},enabled:!!E&&!!T}}),W=D.data,N=D.isLoading,L=W==null||(e=W.analysis)===null||e===void 0?void 0:e.scans,$=Array.isArray(L)&&L.length>0?L.reduce(function(De,me){if(!De)return me;if(!(me!=null&&me.finishedAt)||!(De!=null&&De.finishedAt))return De;var Te=new Date(me.finishedAt),je=new Date(De.finishedAt);return Te>je?me:De},void 0):void 0;$==null||(t=$.scores)===null||t===void 0||t.raw;var I=$==null||(n=$.scores)===null||n===void 0?void 0:n.standardized,oe=(r=$==null||(i=$.mentions)===null||i===void 0||(i=i.mentionedInNumberOfQueries)===null||i===void 0?void 0:i.value)!==null&&r!==void 0?r:0,ue=$==null||(s=$.mentions)===null||s===void 0||(s=s.mentionedInNumberOfQueries)===null||s===void 0||(s=s.previous)===null||s===void 0?void 0:s.difference,B=(o=$==null||(a=$.scores)===null||a===void 0||(a=a.standardized)===null||a===void 0||(a=a.citations)===null||a===void 0?void 0:a.value)!==null&&o!==void 0?o:0,X=(l=$==null||(c=$.citations)===null||c===void 0||(c=c.total)===null||c===void 0?void 0:c.value)!==null&&l!==void 0?l:0,ae=$==null||(u=$.citations)===null||u===void 0||(u=u.total)===null||u===void 0||(u=u.previous)===null||u===void 0?void 0:u.difference,ne=$==null||(d=$.rankings)===null||d===void 0||(d=d.list)===null||d===void 0?void 0:d.find(function(De){var me;return((me=De.brand)===null||me===void 0?void 0:me.isSelf)===!0}),R=(f=ne==null||(h=ne.rank)===null||h===void 0?void 0:h.value)!==null&&f!==void 0?f:null,G=ne==null||(g=ne.rank)===null||g===void 0||(g=g.previous)===null||g===void 0?void 0:g.difference;G&&(G=G*-1);var q=(m=I==null||(p=I.visibility)===null||p===void 0?void 0:p.value)!==null&&m!==void 0?m:0,ce=I==null||(v=I.visibility)===null||v===void 0||(v=v.previous)===null||v===void 0?void 0:v.value,V=(b=I==null||(w=I.ranking)===null||w===void 0?void 0:w.value)!==null&&b!==void 0?b:0,de=(C=I==null||(x=I.sentiment)===null||x===void 0?void 0:x.value)!==null&&C!==void 0?C:0,fe=(k=I==null||(S=I.mentions)===null||S===void 0?void 0:S.value)!==null&&k!==void 0?k:0,Ne={labels:["Mentions","Ranking","Citations","Sentiment"],datasets:[{data:[fe,V,B,de],backgroundColor:FM,pointBackgroundColor:"rgba(166, 30, 105, 1)"}]},te=ml(ml({},Dd),{},{plugins:ml(ml({},Dd.plugins),{},{tooltip:{mode:"point",intersect:!0,callbacks:{label:function(me){var Te=me.label||"",je=me.parsed.r||0;return"".concat(Te,": ").concat(je,"%")}}}}),interaction:{mode:"point",intersect:!0},scales:{r:{beginAtZero:!0,min:0,max:100,ticks:{stepSize:20}}}});return 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(Ma,{score:q,total:100,isLoading:N}),y.jsx(WM,{current:q,previous:ce,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(NM,{data:Ne,options:te}),y.jsx(vf,{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(UM,{children:[y.jsx(yl,{value:oe,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:ue}),y.jsx(yl,{value:R&&y.jsxs(y.Fragment,{children:[R,R===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:G}),y.jsx(yl,{value:X,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:ae}),y.jsx(yl,{value:de?"".concat(de,"%"):"—%",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:$==null||(_=$.scores)===null||_===void 0||(_=_.standardized)===null||_===void 0||(_=_.sentiment)===null||_===void 0||(_=_.previous)===null||_===void 0?void 0:_.difference})]})})]})]})})}var Pu=function(){var t=En(),n=t.brandId,r=t.analysisId,i=Ri({query:{select:function(S){var _=S.data;return _==null?void 0:_.brands}}}),s=i.data,o=i.isLoading,a=Fv(n,{query:{enabled:!!n,select:function(S){var _=S.data;return _}}}),l=a.data,c=a.isLoading,u=_c(n,r,{query:{enabled:!!n&&!!r&&r!=="latest"&&typeof r=="string"&&r.length>0,select:function(S){var _=S.data;return _==null?void 0:_.analysis}}}),d=u.data,f=u.isLoading,h=(l==null?void 0:l.name)||"your brand",g=lE(l==null?void 0:l.nextScheduledAnalysis),m=d==null?void 0:d.status,p=function(){switch(m){case Jr.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:h}),". The analysis is scheduled to run on"," ",y.jsx("b",{className:"yst-font-medium",children:g}),". You'll see the results here once it's ready, and we'll also notify you by email."]})]}),alertVariant:"info"};case Jr.processing:return{alertContent:y.jsxs(y.Fragment,{children:["You've completed the setup for ",h,". The analysis is now processing. You'll see the results here once it's ready, and we'll also notify you by email."]}),alertVariant:"info"};case Jr.failed:return{alertContent:y.jsx(y.Fragment,{children:"Analysis failed. Try restarting the analysis or contact support if the issue persists."}),alertVariant:"danger"};case Jr.cancelled:return{alertContent:y.jsx(y.Fragment,{children:"Analysis was cancelled. You can restart the analysis when ready."}),alertVariant:"warning"};case Jr.completed:return{alertContent:null};default:return{alertContent:null,alertVariant:"info"}}}(),v=p.alertContent,b=p.alertVariant,w=o||c||f,C=s&&(s==null?void 0:s.length)>0,x=!w&&d&&m===Jr.completed;return C?y.jsxs("div",{className:"yst-space-y-8",children:[y.jsx(nP,{}),m!==Jr.completed&&v&&y.jsx(A.Alert,{className:"md:yst-col-span-2",variant:b,children:v}),x&&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:Vr,variant:"secondary",to:"/brands/".concat(n,"/brand-list"),className:_e("yst-gap-1.5"),disabled:!n,children:[y.jsx(Hv,{})," Edit brand list"]})]}),y.jsxs("div",{className:"yst-grid yst-grid-cols-1 yst-gap-4 md:yst-grid-cols-2",children:[y.jsx(XM,{}),y.jsx(rP,{}),y.jsx(KM,{}),y.jsx(gA,{}),y.jsx(lA,{}),y.jsx(WE,{}),y.jsx(yA,{})]})]})]}):y.jsx(jE,{})};function Xb(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 JM=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"})]})]})]})]})})},ZM=function(){return y.jsxs(A.Card,{children:[y.jsx(Xb,{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(JM,{},t)})]})})]})},e$=z.lazy(function(){return Promise.resolve().then(()=>cR)}),t$=z.lazy(function(){return Promise.resolve().then(()=>IR)}),n$=z.lazy(function(){return Promise.resolve().then(()=>FR)}),r$=z.lazy(function(){return Promise.resolve().then(()=>JR)}),i$=z.lazy(function(){return Promise.resolve().then(()=>gN)}),s$=z.lazy(function(){return Promise.resolve().then(()=>pN)}),o$=new P2({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1,staleTime:1e3*60*5},mutations:{retry:!1}}}),ni=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"})]})})},a$=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(Lw,{children:y.jsxs(bt,{element:y.jsx(iE,{hideNav:r,disableLayout:s,DebugInfo:o}),children:[y.jsxs(bt,{path:"/",element:y.jsx(Ts,{}),children:[y.jsx(bt,{index:!0,element:y.jsx(Pu,{})}),y.jsxs(bt,{path:"brands/:brandId",element:y.jsx(mg,{}),children:[y.jsx(bt,{index:!0,element:y.jsx(Pu,{})}),y.jsx(bt,{path:"brand-list",element:y.jsx(z.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(e$,{})})}),y.jsx(bt,{path:"analysis/:analysisId",element:y.jsx(sE,{}),children:y.jsx(bt,{index:!0,element:y.jsx(Pu,{})})})]}),y.jsxs(bt,{path:"/setup",element:y.jsx(z.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(n$,{})}),children:[y.jsx(bt,{index:!0,element:y.jsx(z.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(r$,{})})}),y.jsxs(bt,{path:":brandId",element:y.jsx(mg,{}),children:[y.jsx(bt,{path:"queries",element:y.jsx(z.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(i$,{})})}),y.jsx(bt,{path:"analysis",element:y.jsx(z.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(s$,{})})})]})]})]}),y.jsx(bt,{path:"/settings",element:y.jsx(z.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(t$,{})})}),y.jsx(bt,{path:"/query-history",element:y.jsx(z.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(ZM,{})})})]})})},l$=function(t){var n=t.DebugInfo,r=t.hostAppProps;return y.jsxs(D2,{client:o$,children:[y.jsx(lO,{hostAppProps:r,children:y.jsx(a$,{DebugInfo:n})}),y.jsx(wC,{initialIsOpen:!1})]})};function c$(e){var t=e.subpath,n=t===void 0?"/":t,r=e.onNavigate,i=gn(),s=Bt(),o=z.useRef(n),a=z.useRef(null),l=z.useRef(!1),c="".concat(s.pathname).concat(s.search).concat(s.hash),u=z.useCallback(r,[r]);return z.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]),z.useEffect(function(){l.current||c!==n&&c!==a.current&&(a.current=c,u(c))},[c,n,u]),null}function u$(e,t){return g$(e)||h$(e,t)||f$(e,t)||d$()}function d$(){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 f$(e,t){if(e){if(typeof e=="string")return xm(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)?xm(e,t):void 0}}function xm(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 h$(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 g$(e){if(Array.isArray(e))return e}var y$=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=z.useState(!!(a||l)),w=u$(b,2),C=w[0],x=w[1],k={onAddSubscription:v,onLogout:m,onNavigate:h,DebugInfo:c,subpath:d};return z.useEffect(function(){l&&$v(l),rk(typeof a!="function"?function(){return a}:a),x(!1)},[l,a]),C?y.jsx("div",{className:i,style:s,children:y.jsx(A.Spinner,{})}):y.jsx("div",{className:i,style:s,children:y.jsxs($w,{initialEntries:[d||"/"],children:[y.jsx(c$,{subpath:d,onNavigate:h}),y.jsx(A.Root,{context:{isRtl:r},children:y.jsx(l$,{DebugInfo:c,hostAppProps:k})})]})})},m$=e=>e!=null,p$=e=>e.filter(m$);function v$(e){return(...t)=>{for(const n of e)n&&n(...t)}}var Q=e=>typeof e=="function"&&!e.length?e():e,Ld=e=>Array.isArray(e)?e:e?[e]:[];function b$(e,...t){return typeof e=="function"?e(...t):e}var x$=Se;function w$(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 S$(e){const[t,n]=re(),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=re(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&&dr(()=>{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 Jb=S$,C$=e=>(typeof e.clear=="function"||(e.clear=()=>{let t;for(;t=e.key(0);)e.removeItem(t)}),e),wm=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},nn=C$({_cookies:[globalThis.document,"cookie"],getItem:e=>{var t,n;return(n=(t=nn._cookies[0][nn._cookies[1]].match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)"))==null?void 0:t.pop())!=null?n:null},setItem:(e,t,n)=>{const r=nn.getItem(e);nn._cookies[0][nn._cookies[1]]=`${e}=${t}${wm(n)}`;const i=Object.assign(new Event("storage"),{key:e,oldValue:r,newValue:t,url:globalThis.document.URL,storageArea:nn});window.dispatchEvent(i)},removeItem:e=>{nn._cookies[0][nn._cookies[1]]=`${e}=deleted${wm({expires:new Date(0)})}`},key:e=>{let t=null,n=0;return nn._cookies[0][nn._cookies[1]].replace(/(?:^|;)\s*(.+?)\s*=\s*[^;]+/g,(r,i)=>(!t&&i&&n++===e&&(t=i),"")),t},get length(){let e=0;return nn._cookies[0][nn._cookies[1]].replace(/(?:^|;)\s*.+?\s*=\s*[^;]+/g,t=>(e+=t?1:0,"")),e}}),_$=1024,ji=796,If=700,k$="bottom-right",Id="bottom",Zb="system",O$=!1,e1=500,E$=500,t1=500,A$=Object.keys(od)[0],Sm=1,P$=Object.keys(ad)[0],Rf=mt({client:void 0,onlineManager:void 0,queryFlavor:"",version:"",shadowDOMTarget:void 0});function ye(){return pt(Rf)}var n1=mt(void 0),r1=e=>{const[t,n]=re(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="",CS(l.document),l.document.title="TanStack Query Devtools",l.document.body.style.margin="0",l.addEventListener("pagehide",()=>{e.setLocalStore("pip_open","false"),n(null)}),[...(ye().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)}}),yc(["focusin","focusout","pointermove","keydown","pointerdown","pointerup","click","mousedown","input"],l.document),e.setLocalStore("pip_open","true"),n(l)};xe(()=>{var a;((a=e.localStore.pip_open)!=null?a:"false")==="true"&&!e.disabled&&i(Number(window.innerWidth),Number(e.localStore.height||E$))}),xe(()=>{const o=(ye().shadowDOMTarget||document).querySelector("#_goober"),a=t();if(o&&a){const l=new MutationObserver(()=>{const c=(ye().shadowDOMTarget||a.document).querySelector("#_goober");c&&(c.textContent=o.textContent)});l.observe(o,{childList:!0,subtree:!0,characterDataOldValue:!0}),Se(()=>{l.disconnect()})}});const s=H(()=>{var o;return{pipWindow:t(),requestPipWindow:i,closePipWindow:r,disabled:(o=e.disabled)!=null?o:!1}});return j(n1.Provider,{value:s,get children(){return e.children}})},Nf=()=>H(()=>{const t=pt(n1);if(!t)throw new Error("usePiPWindow must be used within a PiPProvider");return t()}),Ff=mt(()=>"dark");function yt(){return pt(Ff)}var i1={À:"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"},T$=Object.keys(i1).join("|"),j$=new RegExp(T$,"g");function M$(e){return e.replace(j$,t=>i1[t])}var It={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function Cm(e,t,n){var r;if(n=n||{},n.threshold=(r=n.threshold)!=null?r:It.MATCHES,!n.accessors){const o=_m(e,t,n);return{rankedValue:e,rank:o,accessorIndex:-1,accessorThreshold:n.threshold,passed:o>=n.threshold}}const i=I$(e,n.accessors),s={rankedValue:e,rank:It.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let o=0;o<i.length;o++){const a=i[o];let l=_m(a.itemValue,t,n);const{minRanking:c,maxRanking:u,threshold:d=n.threshold}=a.attributes;l<c&&l>=It.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 _m(e,t,n){return e=km(e,n),t=km(t,n),t.length>e.length?It.NO_MATCH:e===t?It.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?It.EQUAL:e.startsWith(t)?It.STARTS_WITH:e.includes(` ${t}`)?It.WORD_STARTS_WITH:e.includes(t)?It.CONTAINS:t.length===1?It.NO_MATCH:$$(e).includes(t)?It.ACRONYM:D$(e,t))}function $$(e){let t="";return e.split(" ").forEach(r=>{r.split("-").forEach(s=>{t+=s.substr(0,1)})}),t}function D$(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 It.MATCHES+u*c}const o=i(t[0],e,0);if(o<0)return It.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 It.NO_MATCH}const a=r-o;return s(a)}function km(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=M$(e)),e}function L$(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 I$(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const s=t[r],o=R$(s),a=L$(e,s);for(let l=0,c=a.length;l<c;l++)n.push({itemValue:a[l],attributes:o})}return n}var Om={maxRanking:1/0,minRanking:-1/0};function R$(e){return typeof e=="function"?Om:{...Om,...e}}var N$={data:""},F$=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||N$,B$=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,q$=/\/\*[^]*?\*\/| +/g,Em=/\n+/g,oi=(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"?oi(o,s):s+"{"+oi(o,s[1]=="k"?"":t)+"}":typeof o=="object"?r+=oi(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+=oi.p?oi.p(s,o):s+":"+o+";")}return n+(t&&i?t+"{"+i+"}":i)+r},Gn={},s1=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+s1(e[n]);return t}return e},z$=(e,t,n,r,i)=>{let s=s1(e),o=Gn[s]||(Gn[s]=(l=>{let c=0,u=11;for(;c<l.length;)u=101*u+l.charCodeAt(c++)>>>0;return"go"+u})(s));if(!Gn[o]){let l=s!==e?e:(c=>{let u,d,f=[{}];for(;u=B$.exec(c.replace(q$,""));)u[4]?f.shift():u[3]?(d=u[3].replace(Em," ").trim(),f.unshift(f[0][d]=f[0][d]||{})):f[0][u[1]]=u[2].replace(Em," ").trim();return f[0]})(e);Gn[o]=oi(i?{["@keyframes "+o]:l}:l,n?"":"."+o)}let a=n&&Gn.g?Gn.g:null;return n&&(Gn.g=Gn[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)})(Gn[o],t,r,a),o},H$=(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?"":oi(a,""):a===!1?"":a}return r+i+(o==null?"":o)},"");function Pe(e){let t=this||{},n=e.call?e(t.p):e;return z$(n.unshift?n.raw?H$(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,F$(t.target),t.g,t.o,t.k)}Pe.bind({g:1});Pe.bind({k:1});function o1(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=o1(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function se(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=o1(e))&&(r&&(r+=" "),r+=t);return r}function K$(e,t){const n=st(e),{onChange:r}=t;let i=new Set(t.appear?void 0:n);const s=new WeakSet,[o,a]=re([],{equals:!1}),[l]=eS(),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 H(d=>{const f=o(),h=e();if(h[fc],st(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 st(()=>{const g=new Set(h),m=h.slice(),p=[],v=[],b=[];for(const C of h)(i.has(C)?b:p).push(C);let w=!p.length;for(let C=0;C<d.length;C++){const x=d[C];g.has(x)||(s.has(x)||(v.push(x),s.add(x)),u(m,x,C)),w&&x!==m[C]&&(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 Mt(...e){return v$(e)}var Am=e=>e instanceof Element;function Rd(e,t){if(t(e))return e;if(typeof e=="function"&&!e.length)return Rd(e(),t);if(Array.isArray(e)){const n=[];for(const r of e){const i=Rd(r,t);i&&(Array.isArray(i)?n.push.apply(n,i):n.push(i))}return n.length?n:null}return null}function U$(e,t=Am,n=Am){const r=H(e),i=H(()=>Rd(r(),t));return i.toArray=()=>{const s=i();return Array.isArray(s)?s:s?[s]:[]},i}function V$(e){return H(()=>{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 a1(e){requestAnimationFrame(()=>requestAnimationFrame(e))}function W$(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())}),a1(()=>{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 G$(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()),a1(()=>{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 Pm=e=>{const t=V$(e);return K$(U$(()=>e.children).toArray,{appear:e.appear,onChange({added:n,removed:r,finishRemoved:i,list:s}){const o=t();for(const l of n)W$(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)G$(o,e,l,()=>i([l]))}})},Tu=Symbol("fallback");function Tm(e){for(const t of e)t.dispose()}function Q$(e,t,n,r={}){const i=new Map;return Se(()=>Tm(i.values())),()=>{const o=e()||[];return o[fc],st(()=>{var u,d;if(!o.length)return Tm(i.values()),i.clear(),r.fallback?[ar(h=>(i.set(Tu,{dispose:h}),r.fallback()))]:[];const a=new Array(o.length),l=i.get(Tu);if(!i.size||l){l==null||l.dispose(),i.delete(Tu);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){ar(u=>{const[d,f]=re(a),h={setItem:f,dispose:u};if(n.length>1){const[g,m]=re(l);h.setIndex=m,h.mapped=n(d,g)}else h.mapped=n(d);i.set(c,h),o[l]=h.mapped})}}function nc(e){const{by:t}=e;return H(Q$(()=>e.each,typeof t=="function"?t:n=>n[t],e.children,"fallback"in e?{fallback:()=>e.fallback}:void 0))}function Y$(e,t,n,r){return e.addEventListener(t,n,r),x$(e.removeEventListener.bind(e,t,n,r))}function X$(e,t,n,r){const i=()=>{Ld(Q(e)).forEach(s=>{s&&Ld(Q(t)).forEach(o=>Y$(s,o,n,r))})};typeof e=="function"?xe(i):be(i)}function J$(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 l1(e,t,n){const r=new WeakMap,{observe:i,unobserve:s}=J$(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);xe(o=>{const a=p$(Ld(Q(e)));return w$(a,o,i,s),a},[])}var Z$=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function jm(e){const t={};let n;for(;n=Z$.exec(e);)t[n[1]]=n[2];return t}function Rc(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=jm(e)}else typeof t=="string"&&(t=jm(t));return{...e,...t}}function e4(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function Nd(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function t4(e){return typeof e=="number"}function Wi(e){return Object.prototype.toString.call(e)==="[object String]"}function n4(e){return typeof e=="function"}function Ra(e){return t=>`${e()}-${t}`}function un(e,t){return e?e===t||e.contains(t):!1}function Po(e,t=!1){const{activeElement:n}=qn(e);if(!(n!=null&&n.nodeName))return null;if(c1(n)&&n.contentDocument)return Po(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const i=qn(n).getElementById(r);if(i)return i}}return n}function r4(e){return qn(e).defaultView||window}function qn(e){return e?e.ownerDocument||e:document}function c1(e){return e.tagName==="IFRAME"}var Bf=(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))(Bf||{});function qf(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 Nc(){return qf(/^Mac/i)}function i4(){return qf(/^iPhone/i)}function s4(){return qf(/^iPad/i)||Nc()&&navigator.maxTouchPoints>1}function o4(){return i4()||s4()}function a4(){return Nc()||o4()}function et(e,t){return t&&(n4(t)?t(e):t[0](t[1],e)),e==null?void 0:e.defaultPrevented}function ht(e){return t=>{for(const n of e)et(t,n)}}function l4(e){return Nc()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function Ct(e){if(e)if(c4())e.focus({preventScroll:!0});else{const t=u4(e);e.focus(),d4(t)}}var pl=null;function c4(){if(pl==null){pl=!1;try{document.createElement("div").focus({get preventScroll(){return pl=!0,!0}})}catch(e){}}return pl}function u4(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 d4(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var u1=["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'])"],f4=[...u1,'[tabindex]:not([tabindex="-1"]):not([disabled])'],zf=u1.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",h4=f4.join(':not([hidden]):not([tabindex="-1"]),');function d1(e,t){const r=Array.from(e.querySelectorAll(zf)).filter(Mm);return t&&Mm(e)&&r.unshift(e),r.forEach((i,s)=>{if(c1(i)&&i.contentDocument){const o=i.contentDocument.body,a=d1(o,!1);r.splice(s,1,...a)}}),r}function Mm(e){return f1(e)&&!g4(e)}function f1(e){return e.matches(zf)&&Hf(e)}function g4(e){return parseInt(e.getAttribute("tabindex")||"0",10)<0}function Hf(e,t){return e.nodeName!=="#comment"&&y4(e)&&m4(e,t)&&(!e.parentElement||Hf(e.parentElement,e))}function y4(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 m4(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function p4(e,t,n){const r=t!=null&&t.tabbable?h4:zf,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)&&Hf(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 $m(e){for(;e&&!v4(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function v4(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function b4(){}function x4(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 Oe(e,t)}var yo=new Map,Dm=new Set;function Lm(){if(typeof window=="undefined")return;const e=n=>{if(!n.target)return;let r=yo.get(n.target);r||(r=new Set,yo.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=yo.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),yo.delete(n.target)),yo.size===0)){for(const i of Dm)i();Dm.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document!="undefined"&&(document.readyState!=="loading"?Lm():document.addEventListener("DOMContentLoaded",Lm));function Fd(e,t){const n=Im(e,t,"left"),r=Im(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 Im(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 w4(e,t){var n,r;if(document.contains(e)){const i=document.scrollingElement||document.documentElement;if(window.getComputedStyle(i).overflow==="hidden"){let o=$m(e);for(;e&&o&&e!==i&&o!==i;)Fd(o,e),e=o,o=$m(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 h1={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 dn(e){return t=>(e(t),()=>e(void 0))}function Fc(e,t){const[n,r]=re(Rm(t==null?void 0:t()));return xe(()=>{var i;r(((i=e())==null?void 0:i.tagName.toLowerCase())||Rm(t==null?void 0:t()))}),n}function Rm(e){return Wi(e)?e:void 0}function rt(e){const[t,n]=Ve(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return j(DS,Oe(n,{get component(){return t.as}}))}var S4=["id","name","validationState","required","disabled","readOnly"];function C4(e){const t=`form-control-${yn()}`,n=Be({id:t},e),[r,i]=re(),[s,o]=re(),[a,l]=re(),[c,u]=re(),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=H(()=>({"data-valid":Q(n.validationState)==="valid"?"":void 0,"data-invalid":Q(n.validationState)==="invalid"?"":void 0,"data-required":Q(n.required)?"":void 0,"data-disabled":Q(n.disabled)?"":void 0,"data-readonly":Q(n.readOnly)?"":void 0}));return{formControlContext:{name:()=>{var m;return(m=Q(n.name))!=null?m:Q(n.id)},dataset:h,validationState:()=>Q(n.validationState),isRequired:()=>Q(n.required),isDisabled:()=>Q(n.disabled),isReadOnly:()=>Q(n.readOnly),labelId:r,fieldId:s,descriptionId:a,errorMessageId:c,getAriaLabelledBy:d,getAriaDescribedBy:f,generateId:Ra(()=>Q(n.id)),registerLabel:dn(i),registerField:dn(o),registerDescription:dn(l),registerErrorMessage:dn(u)}}}var g1=mt();function Na(){const e=pt(g1);if(e===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function y1(e){const t=Na(),n=Be({id:t.generateId("description")},e);return xe(()=>Se(t.registerDescription(n.id))),j(rt,Oe({as:"div"},()=>t.dataset(),n))}function m1(e){const t=Na(),n=Be({id:t.generateId("error-message")},e),[r,i]=Ve(n,["forceMount"]),s=()=>t.validationState()==="invalid";return xe(()=>{s()&&Se(t.registerErrorMessage(i.id))}),j(ve,{get when(){return r.forceMount||s()},get children(){return j(rt,Oe({as:"div"},()=>t.dataset(),i))}})}function _4(e){let t;const n=Na(),r=Be({id:n.generateId("label")},e),[i,s]=Ve(r,["ref"]),o=Fc(()=>t,()=>"label");return xe(()=>Se(n.registerLabel(s.id))),j(rt,Oe({as:"label",ref(a){const l=Mt(c=>t=c,i.ref);typeof l=="function"&&l(a)},get for(){return H(()=>o()==="label")()?n.fieldId():void 0}},()=>n.dataset(),s))}function k4(e,t){xe(ur(e,n=>{if(n==null)return;const r=O4(n);r!=null&&(r.addEventListener("reset",t,{passive:!0}),Se(()=>{r.removeEventListener("reset",t)}))}))}function O4(e){return E4(e)?e.form:e.closest("form")}function E4(e){return e.matches("textarea, input, select, button")}function Fa(e){var o;const[t,n]=re((o=e.defaultValue)==null?void 0:o.call(e)),r=H(()=>{var a;return((a=e.value)==null?void 0:a.call(e))!==void 0}),i=H(()=>{var a;return r()?(a=e.value)==null?void 0:a.call(e):t()});return[i,a=>{st(()=>{var c;const l=b$(a,i());return Object.is(l,i())||(r()||n(l),(c=e.onChange)==null||c.call(e,l)),l})}]}function p1(e){const[t,n]=Fa(e);return[()=>{var i;return(i=t())!=null?i:!1},n]}function A4(e){const[t,n]=Fa(e);return[()=>{var i;return(i=t())!=null?i:[]},n]}function P4(e={}){const[t,n]=p1({value:()=>Q(e.isSelected),defaultValue:()=>!!Q(e.defaultIsSelected),onChange:s=>{var o;return(o=e.onSelectedChange)==null?void 0:o.call(e,s)}});return{isSelected:t,setIsSelected:s=>{!Q(e.isReadOnly)&&!Q(e.isDisabled)&&n(s)},toggle:()=>{!Q(e.isReadOnly)&&!Q(e.isDisabled)&&n(!t())}}}var T4=Object.defineProperty,Bc=(e,t)=>{for(var n in t)T4(e,n,{get:t[n],enumerable:!0})},v1=mt();function b1(){return pt(v1)}function j4(){const e=b1();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function x1(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function M4(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&&x1(s,n))return r+1}return 0}function $4(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:x1(a,l)?(r>s&&(n=!0),-1):(r<s&&(n=!0),1)}),n?t.map(([r,i])=>i):e}function w1(e,t){const n=$4(e);e!==n&&t(n)}function D4(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 qn(r).body}function L4(e,t){xe(()=>{const n=setTimeout(()=>{w1(e(),t)});Se(()=>clearTimeout(n))})}function I4(e,t){if(typeof IntersectionObserver!="function"){L4(e,t);return}let n=[];xe(()=>{const r=()=>{const o=!!n.length;n=e(),o&&w1(e(),t)},i=D4(e()),s=new IntersectionObserver(r,{root:i});for(const o of e()){const a=o.ref();a&&s.observe(a)}Se(()=>s.disconnect())})}function R4(e={}){const[t,n]=A4({value:()=>Q(e.items),onChange:s=>{var o;return(o=e.onItemsChange)==null?void 0:o.call(e,s)}});I4(t,n);const r=s=>(n(o=>{const a=M4(o,s);return e4(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(v1.Provider,{value:{registerItem:r},get children(){return s.children}})}}function N4(e){const t=j4(),n=Be({shouldRegisterItem:!0},e);xe(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());Se(r)})}function S1(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=Wi(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=Wi(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=Wi(f)?d[f]:f(d))!=null?g:!1},a=d=>{var f;if(d!=null)return Wi(e.getSectionChildren)?d[e.getSectionChildren]:(f=e.getSectionChildren)==null?void 0:f.call(e,d)};for(const d of e.dataSource){if(Wi(d)||t4(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=S1({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 F4(e,t=[]){return H(()=>{const n=S1({dataSource:Q(e.dataSource),getKey:Q(e.getKey),getTextValue:Q(e.getTextValue),getDisabled:Q(e.getDisabled),getSectionChildren:Q(e.getSectionChildren)});for(let r=0;r<t.length;r++)t[r]();return e.factory(n)})}var B4=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),q4=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function z4(e){var n;if(Intl.Locale){const r=(n=new Intl.Locale(e).maximize().script)!=null?n:"";return B4.has(r)}const t=e.split("-")[0];return q4.has(t)}function H4(e){return z4(e)?"rtl":"ltr"}function C1(){let e=typeof navigator!="undefined"&&(navigator.language||navigator.userLanguage)||"en-US";return{locale:e,direction:H4(e)}}var Bd=C1(),To=new Set;function Nm(){Bd=C1();for(const e of To)e(Bd)}function K4(){const[e,t]=re(Bd),n=H(()=>e());return dr(()=>{To.size===0&&window.addEventListener("languagechange",Nm),To.add(t),Se(()=>{To.delete(t),To.size===0&&window.removeEventListener("languagechange",Nm)})}),{locale:()=>n().locale,direction:()=>n().direction}}var U4=mt();function Qr(){const e=K4();return pt(U4)||e}var ju=new Map;function V4(e){const{locale:t}=Qr(),n=H(()=>t()+(e?Object.entries(e).sort((r,i)=>r[0]<i[0]?-1:1).join():""));return H(()=>{const r=n();let i;return ju.has(r)&&(i=ju.get(r)),i||(i=new Intl.Collator(t(),e),ju.set(r,i)),i})}var Zn=class _1 extends Set{constructor(n,r,i){super(n);pe(this,"anchorKey");pe(this,"currentKey");n instanceof _1?(this.anchorKey=r||n.anchorKey,this.currentKey=i||n.currentKey):(this.anchorKey=r,this.currentKey=i)}};function W4(e){const[t,n]=Fa(e);return[()=>{var i;return(i=t())!=null?i:new Zn},n]}function k1(e){return a4()?e.altKey:e.ctrlKey}function Gi(e){return Nc()?e.metaKey:e.ctrlKey}function Fm(e){return new Zn(e)}function G4(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Q4(e){const t=Be({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=re(!1),[i,s]=re(),o=H(()=>{const m=Q(t.selectedKeys);return m!=null?Fm(m):m}),a=H(()=>{const m=Q(t.defaultSelectedKeys);return m!=null?Fm(m):new Zn}),[l,c]=W4({value:o,defaultValue:a,onChange:m=>{var p;return(p=t.onSelectionChange)==null?void 0:p.call(t,m)}}),[u,d]=re(Q(t.selectionBehavior)),f=()=>Q(t.selectionMode),h=()=>{var m;return(m=Q(t.disallowEmptySelection))!=null?m:!1},g=m=>{(Q(t.allowDuplicateSelectionEvents)||!G4(m,l()))&&c(m)};return xe(()=>{const m=l();Q(t.selectionBehavior)==="replace"&&u()==="toggle"&&typeof m=="object"&&m.size===0&&d("replace")}),xe(()=>{var m;d((m=Q(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 Y4(e){const[t,n]=re(""),[r,i]=re(-1);return{typeSelectHandlers:{onKeyDown:o=>{var f,h,g;if(Q(e.isDisabled))return;const a=Q(e.keyboardDelegate),l=Q(e.selectionManager);if(!a.getKeyForSearch)return;const c=X4(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&&J4(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 X4(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function J4(e){return e.split("").every(t=>t===e[0])}function Z4(e,t,n){const i=Oe({selectOnFocus:()=>Q(e.selectionManager).selectionBehavior()==="replace"},e),s=()=>t(),{direction:o}=Qr();let a={top:0,left:0};X$(()=>Q(i.isVirtualized)?void 0:s(),"scroll",()=>{const p=s();p&&(a={top:p.scrollTop,left:p.scrollLeft})});const{typeSelectHandlers:l}=Y4({isDisabled:()=>Q(i.disallowTypeAhead),keyboardDelegate:()=>Q(i.keyboardDelegate),selectionManager:()=>Q(i.selectionManager)}),c=()=>{var p;return(p=Q(i.orientation))!=null?p:"vertical"},u=p=>{var _,O,E,T,D,W,N,L;et(p,l.onKeyDown),p.altKey&&p.key==="Tab"&&p.preventDefault();const v=t();if(!(v!=null&&v.contains(p.target)))return;const b=Q(i.selectionManager),w=Q(i.selectOnFocus),C=$=>{$!=null&&(b.setFocusedKey($),p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection($):w&&!k1(p)&&b.replaceSelection($))},x=Q(i.keyboardDelegate),k=Q(i.shouldFocusWrap),S=b.focusedKey();switch(p.key){case(c()==="vertical"?"ArrowDown":"ArrowRight"):{if(x.getKeyBelow){p.preventDefault();let $;S!=null?$=x.getKeyBelow(S):$=(_=x.getFirstKey)==null?void 0:_.call(x),$==null&&k&&($=(O=x.getFirstKey)==null?void 0:O.call(x,S)),C($)}break}case(c()==="vertical"?"ArrowUp":"ArrowLeft"):{if(x.getKeyAbove){p.preventDefault();let $;S!=null?$=x.getKeyAbove(S):$=(E=x.getLastKey)==null?void 0:E.call(x),$==null&&k&&($=(T=x.getLastKey)==null?void 0:T.call(x,S)),C($)}break}case(c()==="vertical"?"ArrowLeft":"ArrowUp"):{if(x.getKeyLeftOf){p.preventDefault();const $=o()==="rtl";let I;S!=null?I=x.getKeyLeftOf(S):I=$?(D=x.getFirstKey)==null?void 0:D.call(x):(W=x.getLastKey)==null?void 0:W.call(x),C(I)}break}case(c()==="vertical"?"ArrowRight":"ArrowDown"):{if(x.getKeyRightOf){p.preventDefault();const $=o()==="rtl";let I;S!=null?I=x.getKeyRightOf(S):I=$?(N=x.getLastKey)==null?void 0:N.call(x):(L=x.getFirstKey)==null?void 0:L.call(x),C(I)}break}case"Home":if(x.getFirstKey){p.preventDefault();const $=x.getFirstKey(S,Gi(p));$!=null&&(b.setFocusedKey($),Gi(p)&&p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection($):w&&b.replaceSelection($))}break;case"End":if(x.getLastKey){p.preventDefault();const $=x.getLastKey(S,Gi(p));$!=null&&(b.setFocusedKey($),Gi(p)&&p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection($):w&&b.replaceSelection($))}break;case"PageDown":if(x.getKeyPageBelow&&S!=null){p.preventDefault();const $=x.getKeyPageBelow(S);C($)}break;case"PageUp":if(x.getKeyPageAbove&&S!=null){p.preventDefault();const $=x.getKeyPageAbove(S);C($)}break;case"a":Gi(p)&&b.selectionMode()==="multiple"&&Q(i.disallowSelectAll)!==!0&&(p.preventDefault(),b.selectAll());break;case"Escape":p.defaultPrevented||(p.preventDefault(),Q(i.disallowEmptySelection)||b.clearSelection());break;case"Tab":if(!Q(i.allowsTabNavigation)){if(p.shiftKey)v.focus();else{const $=p4(v,{tabbable:!0});let I,oe;do oe=$.lastChild(),oe&&(I=oe);while(oe);I&&!I.contains(document.activeElement)&&Ct(I)}break}}},d=p=>{var C,x,k,S;const v=Q(i.selectionManager),b=Q(i.keyboardDelegate),w=Q(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))},O=p.relatedTarget;O&&p.currentTarget.compareDocumentPosition(O)&Node.DOCUMENT_POSITION_FOLLOWING?_((x=v.lastSelectedKey())!=null?x:(C=b.getLastKey)==null?void 0:C.call(b)):_((S=v.firstSelectedKey())!=null?S:(k=b.getFirstKey)==null?void 0:k.call(b))}else if(!Q(i.isVirtualized)){const _=s();if(_){_.scrollTop=a.top,_.scrollLeft=a.left;const O=_.querySelector(`[data-key="${v.focusedKey()}"]`);O&&(Ct(O),Fd(_,O))}}}},f=p=>{const v=Q(i.selectionManager);p.currentTarget.contains(p.relatedTarget)||v.setFocused(!1)},h=p=>{s()===p.target&&p.preventDefault()},g=()=>{var k,S;const p=Q(i.autoFocus);if(!p)return;const v=Q(i.selectionManager),b=Q(i.keyboardDelegate);let w;p==="first"&&(w=(k=b.getFirstKey)==null?void 0:k.call(b)),p==="last"&&(w=(S=b.getLastKey)==null?void 0:S.call(b));const C=v.selectedKeys();C.size&&(w=C.values().next().value),v.setFocused(!0),v.setFocusedKey(w);const x=t();x&&w==null&&!Q(i.shouldUseVirtualFocus)&&Ct(x)};return dr(()=>{i.deferAutoFocus?setTimeout(g,0):g()}),xe(ur([s,()=>Q(i.isVirtualized),()=>Q(i.selectionManager).focusedKey()],p=>{var C;const[v,b,w]=p;if(b)w&&((C=i.scrollToKey)==null||C.call(i,w));else if(w&&v){const x=v.querySelector(`[data-key="${w}"]`);x&&Fd(v,x)}})),{tabIndex:H(()=>{if(!Q(i.shouldUseVirtualFocus))return Q(i.selectionManager).focusedKey()==null?0:-1}),onKeyDown:u,onMouseDown:h,onFocusIn:d,onFocusOut:f}}function O1(e,t){const n=()=>Q(e.selectionManager),r=()=>Q(e.key),i=()=>Q(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"||Gi(b)||"pointerType"in b&&b.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},o=()=>n().isSelected(r()),a=()=>Q(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&&!Q(e.shouldSelectOnPressUp)&&s(b))},d=b=>{l()&&b.pointerType==="mouse"&&b.button===0&&Q(e.shouldSelectOnPressUp)&&Q(e.allowsDifferentPressOrigin)&&s(b)},f=b=>{l()&&(Q(e.shouldSelectOnPressUp)&&!Q(e.allowsDifferentPressOrigin)||c!=="mouse")&&s(b)},h=b=>{!l()||!["Enter"," "].includes(b.key)||(k1(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=H(()=>{if(!(i()||a()))return r()===n().focusedKey()?0:-1}),v=H(()=>Q(e.virtualized)?void 0:r());return xe(ur([t,r,i,()=>n().focusedKey(),()=>n().isFocused()],([b,w,C,x,k])=>{b&&w===x&&k&&!C&&document.activeElement!==b&&(e.focus?e.focus():Ct(b))})),{isSelected:o,isDisabled:a,allowsSelection:l,tabIndex:p,dataKey:v,onPointerDown:u,onPointerUp:d,onClick:f,onKeyDown:h,onMouseDown:g,onFocus:m}}var eD=class{constructor(e,t){pe(this,"collection");pe(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 Zn(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 Zn(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 Zn([t],t,t):new Zn;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode()==="none")return;const t=new Zn;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 Zn)}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}},Bm=class{constructor(e){pe(this,"keyMap",new Map);pe(this,"iterable");pe(this,"firstKey");pe(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 tD(e){const t=Q4(e),r=F4({dataSource:()=>Q(e.dataSource),getKey:()=>Q(e.getKey),getTextValue:()=>Q(e.getTextValue),getDisabled:()=>Q(e.getDisabled),getSectionChildren:()=>Q(e.getSectionChildren),factory:s=>e.filter?new Bm(e.filter(s)):new Bm(s)},[()=>e.filter]),i=new eD(r,t);return A0(()=>{const s=t.focusedKey();s!=null&&!r().getItem(s)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>i}}var St=e=>typeof e=="function"?e():e,nD=e=>{const t=H(()=>{const o=St(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]=re(St(e.show)?"present":"hidden");let s="none";return xe(o=>{const a=St(e.show);return st(()=>{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}),xe(()=>{const o=St(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}},rD=nD,E1=rD,rc="data-kb-top-layer",A1,qd=!1,fr=[];function aa(e){return fr.findIndex(t=>t.node===e)}function iD(e){return fr[aa(e)]}function sD(e){return fr[fr.length-1].node===e}function P1(){return fr.filter(e=>e.isPointerBlocking)}function oD(){return[...P1()].slice(-1)[0]}function Kf(){return P1().length>0}function T1(e){var n;const t=aa((n=oD())==null?void 0:n.node);return aa(e)<t}function aD(e){fr.push(e)}function lD(e){const t=aa(e);t<0||fr.splice(t,1)}function cD(){for(const{node:e}of fr)e.style.pointerEvents=T1(e)?"none":"auto"}function uD(e){if(Kf()&&!qd){const t=qn(e);A1=document.body.style.pointerEvents,t.body.style.pointerEvents="none",qd=!0}}function dD(e){if(Kf())return;const t=qn(e);t.body.style.pointerEvents=A1,t.body.style.length===0&&t.body.removeAttribute("style"),qd=!1}var Ht={layers:fr,isTopMostLayer:sD,hasPointerBlockingLayer:Kf,isBelowPointerBlockingLayer:T1,addLayer:aD,removeLayer:lD,indexOf:aa,find:iD,assignPointerEventToLayers:cD,disableBodyPointerEvents:uD,restoreBodyPointerEvents:dD},fD={};Bc(fD,{Button:()=>yD,Root:()=>Uf});var hD=["button","color","file","image","reset","submit"];function gD(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?hD.indexOf(e.type)!==-1:!1}function Uf(e){let t;const n=Be({type:"button"},e),[r,i]=Ve(n,["ref","type","disabled"]),s=Fc(()=>t,()=>"button"),o=H(()=>{const c=s();return c==null?!1:gD({tagName:c,type:r.type})}),a=H(()=>s()==="input"),l=H(()=>s()==="a"&&(t==null?void 0:t.getAttribute("href"))!=null);return j(rt,Oe({as:"button",ref(c){const u=Mt(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 yD=Uf,mD=["top","right","bottom","left"],Fn=Math.min,Yt=Math.max,ic=Math.round,vl=Math.floor,Hr=e=>({x:e,y:e}),pD={left:"right",right:"left",bottom:"top",top:"bottom"},vD={start:"end",end:"start"};function zd(e,t,n){return Yt(e,Fn(t,n))}function Fi(e,t){return typeof e=="function"?e(t):e}function Kr(e){return e.split("-")[0]}function Ws(e){return e.split("-")[1]}function j1(e){return e==="x"?"y":"x"}function Vf(e){return e==="y"?"height":"width"}function Mi(e){return["top","bottom"].includes(Kr(e))?"y":"x"}function Wf(e){return j1(Mi(e))}function bD(e,t,n){n===void 0&&(n=!1);const r=Ws(e),i=Wf(e),s=Vf(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=sc(o)),[o,sc(o)]}function xD(e){const t=sc(e);return[Hd(e),t,Hd(t)]}function Hd(e){return e.replace(/start|end/g,t=>vD[t])}function wD(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 SD(e,t,n,r){const i=Ws(e);let s=wD(Kr(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(Hd)))),s}function sc(e){return e.replace(/left|right|bottom|top/g,t=>pD[t])}function CD(e){return{top:0,right:0,bottom:0,left:0,...e}}function M1(e){return typeof e!="number"?CD(e):{top:e,right:e,bottom:e,left:e}}function oc(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 qm(e,t,n){let{reference:r,floating:i}=e;const s=Mi(t),o=Wf(t),a=Vf(o),l=Kr(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(Ws(t)){case"start":h[o]-=f*(n&&c?-1:1);break;case"end":h[o]+=f*(n&&c?-1:1);break}return h}var _D=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}=qm(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:C,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],...C}},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}=qm(c,f,l)),m=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:h}};async function la(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}=Fi(t,e),g=M1(h),p=a[f?d==="floating"?"reference":"floating":d],v=oc(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)),C=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=oc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:w,strategy:l}):b);return{top:(v.top-x.top+g.top)/C.y,bottom:(x.bottom-v.bottom+g.bottom)/C.y,left:(v.left-x.left+g.left)/C.x,right:(x.right-v.right+g.right)/C.x}}var kD=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}=Fi(e,t)||{};if(c==null)return{};const d=M1(u),f={x:n,y:r},h=Wf(i),g=Vf(h),m=await o.getDimensions(c),p=h==="y",v=p?"top":"left",b=p?"bottom":"right",w=p?"clientHeight":"clientWidth",C=s.reference[g]+s.reference[h]-f[h]-s.floating[g],x=f[h]-s.reference[h],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let S=k?k[w]:0;(!S||!await(o.isElement==null?void 0:o.isElement(k)))&&(S=a.floating[w]||s.floating[g]);const _=C/2-x/2,O=S/2-m[g]/2-1,E=Fn(d[v],O),T=Fn(d[b],O),D=E,W=S-m[g]-T,N=S/2-m[g]/2+_,L=zd(D,N,W),$=!l.arrow&&Ws(i)!=null&&N!==L&&s.reference[g]/2-(N<D?E:T)-m[g]/2<0,I=$?N<D?N-D:N-W:0;return{[h]:f[h]+I,data:{[h]:L,centerOffset:N-L-I,...$&&{alignmentOffset:I}},reset:$}}}),OD=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}=Fi(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=Kr(i),b=Mi(a),w=Kr(a)===a,C=await(l.isRTL==null?void 0:l.isRTL(c.floating)),x=f||(w||!m?[sc(a)]:xD(a)),k=g!=="none";!f&&k&&x.push(...SD(a,m,g,C));const S=[a,...x],_=await la(t,p),O=[];let E=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&O.push(_[v]),d){const N=bD(i,o,C);O.push(_[N[0]],_[N[1]])}if(E=[...E,{placement:i,overflows:O}],!O.every(N=>N<=0)){var T,D;const N=(((T=s.flip)==null?void 0:T.index)||0)+1,L=S[N];if(L)return{data:{index:N,overflows:E},reset:{placement:L}};let $=(D=E.filter(I=>I.overflows[0]<=0).sort((I,oe)=>I.overflows[1]-oe.overflows[1])[0])==null?void 0:D.placement;if(!$)switch(h){case"bestFit":{var W;const I=(W=E.filter(oe=>{if(k){const ue=Mi(oe.placement);return ue===b||ue==="y"}return!0}).map(oe=>[oe.placement,oe.overflows.filter(ue=>ue>0).reduce((ue,B)=>ue+B,0)]).sort((oe,ue)=>oe[1]-ue[1])[0])==null?void 0:W[0];I&&($=I);break}case"initialPlacement":$=a;break}if(i!==$)return{reset:{placement:$}}}return{}}}};function zm(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Hm(e){return mD.some(t=>e[t]>=0)}var ED=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Fi(e,t);switch(r){case"referenceHidden":{const s=await la(t,{...i,elementContext:"reference"}),o=zm(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Hm(o)}}}case"escaped":{const s=await la(t,{...i,altBoundary:!0}),o=zm(s,n.floating);return{data:{escapedOffsets:o,escaped:Hm(o)}}}default:return{}}}}};async function AD(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Kr(n),a=Ws(n),l=Mi(n)==="y",c=["left","top"].includes(o)?-1:1,u=s&&l?-1:1,d=Fi(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 PD=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 AD(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}}}}},TD=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}=Fi(e,t),c={x:n,y:r},u=await la(t,l),d=Mi(Kr(i)),f=j1(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=zd(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=zd(b,g,w)}const m=a.fn({...t,[f]:h,[d]:g});return{...m,data:{x:m.x-n,y:m.y-r}}}}},jD=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}=Fi(e,t),l=await la(t,a),c=Kr(n),u=Ws(n),d=Mi(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=Fn(h-l[g],p),w=Fn(f-l[m],v),C=!t.middlewareData.shift;let x=b,k=w;if(d?k=u||C?Fn(w,v):v:x=u||C?Fn(b,p):p,C&&!u){const _=Yt(l.left,0),O=Yt(l.right,0),E=Yt(l.top,0),T=Yt(l.bottom,0);d?k=f-2*(_!==0||O!==0?_+O:Yt(l.left,l.right)):x=h-2*(E!==0||T!==0?E+T:Yt(l.top,l.bottom))}await o({...t,availableWidth:k,availableHeight:x});const S=await i.getDimensions(s.floating);return f!==S.width||h!==S.height?{reset:{rects:!0}}:{}}}};function Gs(e){return $1(e)?(e.nodeName||"").toLowerCase():"#document"}function Zt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yr(e){var t;return(t=($1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function $1(e){return e instanceof Node||e instanceof Zt(e).Node}function Cn(e){return e instanceof Element||e instanceof Zt(e).Element}function zn(e){return e instanceof HTMLElement||e instanceof Zt(e).HTMLElement}function Km(e){return typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof Zt(e).ShadowRoot}function Ba(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=_n(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function MD(e){return["table","td","th"].includes(Gs(e))}function qc(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(n){return!1}})}function Gf(e){const t=Qf(),n=Cn(e)?_n(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 $D(e){let t=Ur(e);for(;zn(t)&&!Rs(t);){if(Gf(t))return t;if(qc(t))return null;t=Ur(t)}return null}function Qf(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Rs(e){return["html","body","#document"].includes(Gs(e))}function _n(e){return Zt(e).getComputedStyle(e)}function zc(e){return Cn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ur(e){if(Gs(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Km(e)&&e.host||yr(e);return Km(t)?t.host:t}function D1(e){const t=Ur(e);return Rs(t)?e.ownerDocument?e.ownerDocument.body:e.body:zn(t)&&Ba(t)?t:D1(t)}function ca(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=D1(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=Zt(i);return s?t.concat(o,o.visualViewport||[],Ba(i)?i:[],o.frameElement&&n?ca(o.frameElement):[]):t.concat(i,ca(i,[],n))}function L1(e){const t=_n(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=zn(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,a=ic(n)!==s||ic(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function Yf(e){return Cn(e)?e:e.contextElement}function ts(e){const t=Yf(e);if(!zn(t))return Hr(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=L1(t);let o=(s?ic(n.width):n.width)/r,a=(s?ic(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}var DD=Hr(0);function I1(e){const t=Zt(e);return!Qf()||!t.visualViewport?DD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function LD(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Zt(e)?!1:t}function $i(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=Yf(e);let o=Hr(1);t&&(r?Cn(r)&&(o=ts(r)):o=ts(e));const a=LD(s,n,r)?I1(s):Hr(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=Zt(s),h=r&&Cn(r)?Zt(r):r;let g=f,m=g.frameElement;for(;m&&r&&h!==g;){const p=ts(m),v=m.getBoundingClientRect(),b=_n(m),w=v.left+(m.clientLeft+parseFloat(b.paddingLeft))*p.x,C=v.top+(m.clientTop+parseFloat(b.paddingTop))*p.y;l*=p.x,c*=p.y,u*=p.x,d*=p.y,l+=w,c+=C,g=Zt(m),m=g.frameElement}}return oc({width:u,height:d,x:l,y:c})}function ID(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",o=yr(r),a=t?qc(t.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=Hr(1);const u=Hr(0),d=zn(r);if((d||!d&&!s)&&((Gs(r)!=="body"||Ba(o))&&(l=zc(r)),zn(r))){const f=$i(r);c=ts(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 RD(e){return Array.from(e.getClientRects())}function R1(e){return $i(yr(e)).left+zc(e).scrollLeft}function ND(e){const t=yr(e),n=zc(e),r=e.ownerDocument.body,i=Yt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Yt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+R1(e);const a=-n.scrollTop;return _n(r).direction==="rtl"&&(o+=Yt(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function FD(e,t){const n=Zt(e),r=yr(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=Qf();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function BD(e,t){const n=$i(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=zn(e)?ts(e):Hr(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 Um(e,t,n){let r;if(t==="viewport")r=FD(e,n);else if(t==="document")r=ND(yr(e));else if(Cn(t))r=BD(t,n);else{const i=I1(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return oc(r)}function N1(e,t){const n=Ur(e);return n===t||!Cn(n)||Rs(n)?!1:_n(n).position==="fixed"||N1(n,t)}function qD(e,t){const n=t.get(e);if(n)return n;let r=ca(e,[],!1).filter(a=>Cn(a)&&Gs(a)!=="body"),i=null;const s=_n(e).position==="fixed";let o=s?Ur(e):e;for(;Cn(o)&&!Rs(o);){const a=_n(o),l=Gf(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Ba(o)&&!l&&N1(e,o))?r=r.filter(u=>u!==o):i=a,o=Ur(o)}return t.set(e,r),r}function zD(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?qc(t)?[]:qD(t,this._c):[].concat(n),r],a=o[0],l=o.reduce((c,u)=>{const d=Um(t,u,i);return c.top=Yt(d.top,c.top),c.right=Fn(d.right,c.right),c.bottom=Fn(d.bottom,c.bottom),c.left=Yt(d.left,c.left),c},Um(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function HD(e){const{width:t,height:n}=L1(e);return{width:t,height:n}}function KD(e,t,n){const r=zn(t),i=yr(t),s=n==="fixed",o=$i(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=Hr(0);if(r||!r&&!s)if((Gs(t)!=="body"||Ba(i))&&(a=zc(t)),r){const d=$i(t,!0,s,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&(l.x=R1(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 Mu(e){return _n(e).position==="static"}function Vm(e,t){return!zn(e)||_n(e).position==="fixed"?null:t?t(e):e.offsetParent}function F1(e,t){const n=Zt(e);if(qc(e))return n;if(!zn(e)){let i=Ur(e);for(;i&&!Rs(i);){if(Cn(i)&&!Mu(i))return i;i=Ur(i)}return n}let r=Vm(e,t);for(;r&&MD(r)&&Mu(r);)r=Vm(r,t);return r&&Rs(r)&&Mu(r)&&!Gf(r)?n:r||$D(e)||n}var UD=async function(e){const t=this.getOffsetParent||F1,n=this.getDimensions,r=await n(e.floating);return{reference:KD(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function VD(e){return _n(e).direction==="rtl"}var B1={convertOffsetParentRelativeRectToViewportRelativeRect:ID,getDocumentElement:yr,getClippingRect:zD,getOffsetParent:F1,getElementRects:UD,getClientRects:RD,getDimensions:HD,getScale:ts,isElement:Cn,isRTL:VD};function WD(e,t){let n=null,r;const i=yr(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=vl(u),g=vl(i.clientWidth-(c+d)),m=vl(i.clientHeight-(u+f)),p=vl(c),b={rootMargin:-h+"px "+-g+"px "+-m+"px "+-p+"px",threshold:Yt(0,Fn(1,l))||1};let w=!0;function C(x){const k=x[0].intersectionRatio;if(k!==l){if(!w)return o();k?o(!1,k):r=setTimeout(()=>{o(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(C,{...b,root:i.ownerDocument})}catch(x){n=new IntersectionObserver(C,b)}n.observe(e)}return o(!0),s}function GD(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=Yf(e),u=i||s?[...c?ca(c):[],...ca(t)]:[];u.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const d=c&&a?WD(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?$i(e):null;l&&p();function p(){const v=$i(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 QD=PD,YD=TD,XD=OD,JD=jD,ZD=ED,e6=kD,t6=(e,t,n)=>{const r=new Map,i={platform:B1,...n},s={...i.platform,_c:r};return _D(e,t,{...i,platform:s})},Xf=mt();function Jf(){const e=pt(Xf);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var n6=le('<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">'),Kd=30,Wm=Kd/2,r6={top:180,right:-90,bottom:0,left:90};function Zf(e){const t=Jf(),n=Be({size:Kd},e),[r,i]=Ve(n,["ref","style","size"]),s=()=>t.currentPlacement().split("-")[0],o=i6(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*(Kd/r.size),d=()=>`rotate(${r6[s()]} ${Wm} ${Wm}) translate(0 2)`;return j(rt,Oe({as:"div",ref(f){const h=Mt(t.setArrowRef,r.ref);typeof h=="function"&&h(f)},"aria-hidden":"true",get style(){return Rc({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=n6(),h=f.firstChild;return be(()=>J(h,"transform",d())),f}}))}function i6(e){const[t,n]=re();return xe(()=>{const r=e();r&&n(r4(r).getComputedStyle(r))}),t}function s6(e){const t=Jf(),[n,r]=Ve(e,["ref","style"]);return j(rt,Oe({as:"div",ref(i){const s=Mt(t.setPositionerRef,n.ref);typeof s=="function"&&s(i)},"data-popper-positioner":"",get style(){return Rc({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}function Gm(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 o6(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?Gm(r):e?e.getBoundingClientRect():Gm()}}}function a6(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var l6={top:"bottom",right:"left",bottom:"top",left:"right"};function c6(e,t){const[n,r]=e.split("-"),i=l6[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 u6(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]=re(),[i,s]=re(),[o,a]=re(t.placement),l=()=>{var f;return o6((f=t.anchorRef)==null?void 0:f.call(t),t.getAnchorRect)},{direction:c}=Qr();async function u(){var k,S,_;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:(k=t.gutter)!=null?k:m;h.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),f.getBoundingClientRect();const v=[QD(({placement:O})=>{const E=!!O.split("-")[1];return{mainAxis:p,crossAxis:E?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const O=typeof t.flip=="string"?t.flip.split(" "):void 0;if(O!==void 0&&!O.every(a6))throw new Error("`flip` expects a spaced-delimited list of placements");v.push(XD({padding:t.overflowPadding,fallbackPlacements:O}))}(t.slide||t.overlap)&&v.push(YD({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),v.push(JD({padding:t.overflowPadding,apply({availableWidth:O,availableHeight:E,rects:T}){const D=Math.round(T.reference.width);O=Math.floor(O),E=Math.floor(E),h.style.setProperty("--kb-popper-anchor-width",`${D}px`),h.style.setProperty("--kb-popper-content-available-width",`${O}px`),h.style.setProperty("--kb-popper-content-available-height",`${E}px`),t.sameWidth&&(h.style.width=`${D}px`),t.fitViewport&&(h.style.maxWidth=`${O}px`,h.style.maxHeight=`${E}px`)}})),t.hideWhenDetached&&v.push(ZD({padding:t.detachedPadding})),g&&v.push(e6({element:g,padding:t.arrowPadding}));const b=await t6(f,h,{placement:t.placement,strategy:"absolute",middleware:v,platform:{...B1,isRTL:()=>c()==="rtl"}});if(a(b.placement),(S=t.onCurrentPlacementChange)==null||S.call(t,b.placement),!h)return;h.style.setProperty("--kb-popper-content-transform-origin",c6(b.placement,c()));const w=Math.round(b.x),C=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, ${C}px, 0)`,visibility:x}),g&&b.middlewareData.arrow){const{x:O,y:E}=b.middlewareData.arrow,T=b.placement.split("-")[0];Object.assign(g.style,{left:O!=null?`${O}px`:"",top:E!=null?`${E}px`:"",[T]:"100%"})}}xe(()=>{const f=l(),h=n();if(!f||!h)return;const g=GD(f,h,u,{elementResize:typeof ResizeObserver=="function"});Se(g)}),xe(()=>{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(Xf.Provider,{value:d,get children(){return t.children}})}var q1=Object.assign(u6,{Arrow:Zf,Context:Xf,usePopperContext:Jf,Positioner:s6});function d6(e){const t=n=>{var r;n.key===Bf.Escape&&((r=e.onEscapeKeyDown)==null||r.call(e,n))};xe(()=>{var r,i;if(Q(e.isDisabled))return;const n=(i=(r=e.ownerDocument)==null?void 0:r.call(e))!=null?i:qn();n.addEventListener("keydown",t),Se(()=>{n.removeEventListener("keydown",t)})})}var Qm="interactOutside.pointerDownOutside",Ym="interactOutside.focusOutside";function f6(e,t){let n,r=b4;const i=()=>qn(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(`[${rc}]`)||!un(i(),f)||un(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=ht([s,a]);g.addEventListener(Qm,m,{once:!0});const p=new CustomEvent(Qm,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||l4(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=ht([o,a]);h.addEventListener(Ym,g,{once:!0});const m=new CustomEvent(Ym,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});h.dispatchEvent(m)};xe(()=>{Q(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 z1=mt();function h6(){return pt(z1)}function g6(e){let t;const n=h6(),[r,i]=Ve(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()}};f6({shouldExcludeElement:d=>{var f;return t?((f=r.excludedElements)==null?void 0:f.some(h=>un(h(),d)))||[...s].some(h=>un(h,d)):!1},onPointerDownOutside:d=>{var f,h,g;!t||Ht.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!Ht.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),d6({ownerDocument:()=>qn(t),onEscapeKeyDown:d=>{var f;!t||!Ht.isTopMostLayer(t)||((f=r.onEscapeKeyDown)==null||f.call(r,d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),dr(()=>{if(!t)return;Ht.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n==null?void 0:n.registerNestedLayer(t);Ht.assignPointerEventToLayers(),Ht.disableBodyPointerEvents(t),Se(()=>{t&&(Ht.removeLayer(t),d==null||d(),Ht.assignPointerEventToLayers(),Ht.restoreBodyPointerEvents(t))})}),xe(ur([()=>t,()=>r.disableOutsidePointerEvents],([d,f])=>{if(!d)return;const h=Ht.find(d);h&&h.isPointerBlocking!==f&&(h.isPointerBlocking=f,Ht.assignPointerEventToLayers()),f&&Ht.disableBodyPointerEvents(d),Se(()=>{Ht.restoreBodyPointerEvents(d)})},{defer:!0}));const u={registerNestedLayer:o};return j(z1.Provider,{value:u,get children(){return j(rt,Oe({as:"div",ref(d){const f=Mt(h=>t=h,r.ref);typeof f=="function"&&f(d)}},i))}})}function H1(e={}){const[t,n]=p1({value:()=>Q(e.open),defaultValue:()=>!!Q(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 sn={};Bc(sn,{Description:()=>y1,ErrorMessage:()=>m1,Item:()=>W1,ItemControl:()=>G1,ItemDescription:()=>Q1,ItemIndicator:()=>Y1,ItemInput:()=>X1,ItemLabel:()=>J1,Label:()=>Z1,RadioGroup:()=>y6,Root:()=>ex});var K1=mt();function U1(){const e=pt(K1);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupContext` must be used within a `RadioGroup` component");return e}var V1=mt();function qa(){const e=pt(V1);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupItemContext` must be used within a `RadioGroup.Item` component");return e}function W1(e){const t=Na(),n=U1(),r=`${t.generateId("item")}-${yn()}`,i=Be({id:r},e),[s,o]=Ve(i,["value","disabled","onPointerDown"]),[a,l]=re(),[c,u]=re(),[d,f]=re(),[h,g]=re(),[m,p]=re(!1),v=H(()=>n.isSelectedValue(s.value)),b=H(()=>s.disabled||t.isDisabled()||!1),w=k=>{et(k,s.onPointerDown),m()&&k.preventDefault()},C=H(()=>({...t.dataset(),"data-disabled":b()?"":void 0,"data-checked":v()?"":void 0})),x={value:()=>s.value,dataset:C,isSelected:v,isDisabled:b,inputId:a,labelId:c,descriptionId:d,inputRef:h,select:()=>n.setSelectedValue(s.value),generateId:Ra(()=>o.id),registerInput:dn(l),registerLabel:dn(u),registerDescription:dn(f),setIsFocused:p,setInputRef:g};return j(V1.Provider,{value:x,get children(){return j(rt,Oe({as:"div",role:"group",onPointerDown:w},C,o))}})}function G1(e){const t=qa(),n=Be({id:t.generateId("control")},e),[r,i]=Ve(n,["onClick","onKeyDown"]);return j(rt,Oe({as:"div",onClick:a=>{var l;et(a,r.onClick),t.select(),(l=t.inputRef())==null||l.focus()},onKeyDown:a=>{var l;et(a,r.onKeyDown),a.key===Bf.Space&&(t.select(),(l=t.inputRef())==null||l.focus())}},()=>t.dataset(),i))}function Q1(e){const t=qa(),n=Be({id:t.generateId("description")},e);return xe(()=>Se(t.registerDescription(n.id))),j(rt,Oe({as:"div"},()=>t.dataset(),n))}function Y1(e){const t=qa(),n=Be({id:t.generateId("indicator")},e),[r,i]=Ve(n,["ref","forceMount"]),[s,o]=re(),{present:a}=E1({show:()=>r.forceMount||t.isSelected(),element:()=>{var l;return(l=s())!=null?l:null}});return j(ve,{get when(){return a()},get children(){return j(rt,Oe({as:"div",ref(l){const c=Mt(o,r.ref);typeof c=="function"&&c(l)}},()=>t.dataset(),i))}})}function X1(e){const t=Na(),n=U1(),r=qa(),i=Be({id:r.generateId("input")},e),[s,o]=Ve(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]=re(!1),d=g=>{if(et(g,s.onChange),g.stopPropagation(),!c()){n.setSelectedValue(r.value());const m=g.target;m.checked=r.isSelected()}u(!1)},f=g=>{et(g,s.onFocus),r.setIsFocused(!0)},h=g=>{et(g,s.onBlur),r.setIsFocused(!1)};return xe(ur([()=>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})),xe(()=>Se(r.registerInput(o.id))),j(rt,Oe({as:"input",ref(g){const m=Mt(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 Rc({...h1},s.style)},get"aria-labelledby"(){return a()},get"aria-describedby"(){return l()},onChange:d,onFocus:f,onBlur:h},()=>r.dataset(),o))}function J1(e){const t=qa(),n=Be({id:t.generateId("label")},e);return xe(()=>Se(t.registerLabel(n.id))),j(rt,Oe({as:"label",get for(){return t.inputId()}},()=>t.dataset(),n))}function Z1(e){return j(_4,Oe({as:"span"},e))}function ex(e){let t;const n=`radiogroup-${yn()}`,r=Be({id:n,orientation:"vertical"},e),[i,s,o]=Ve(r,["ref","value","defaultValue","onChange","orientation","aria-labelledby","aria-describedby"],S4),[a,l]=Fa({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:g=>{var m;return(m=i.onChange)==null?void 0:m.call(i,g)}}),{formControlContext:c}=C4(s);k4(()=>t,()=>{var g;return l((g=i.defaultValue)!=null?g:"")});const u=()=>c.getAriaLabelledBy(Q(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(g1.Provider,{value:c,get children(){return j(K1.Provider,{value:h,get children(){return j(rt,Oe({as:"div",ref(g){const m=Mt(p=>t=p,i.ref);typeof m=="function"&&m(g)},role:"radiogroup",get id(){return Q(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 y6=Object.assign(ex,{Description:y1,ErrorMessage:m1,Item:W1,ItemControl:G1,ItemDescription:Q1,ItemIndicator:Y1,ItemInput:X1,ItemLabel:J1,Label:Z1}),m6=class{constructor(e,t,n){pe(this,"collection");pe(this,"ref");pe(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 p6(e,t,n){const r=V4({usage:"search",sensitivity:"base"}),i=H(()=>{const s=Q(e.keyboardDelegate);return s||new m6(e.collection,t,r)});return Z4({selectionManager:()=>Q(e.selectionManager),keyboardDelegate:i,autoFocus:()=>Q(e.autoFocus),deferAutoFocus:()=>Q(e.deferAutoFocus),shouldFocusWrap:()=>Q(e.shouldFocusWrap),disallowEmptySelection:()=>Q(e.disallowEmptySelection),selectOnFocus:()=>Q(e.selectOnFocus),disallowTypeAhead:()=>Q(e.disallowTypeAhead),shouldUseVirtualFocus:()=>Q(e.shouldUseVirtualFocus),allowsTabNavigation:()=>Q(e.allowsTabNavigation),isVirtualized:()=>Q(e.isVirtualized),scrollToKey:s=>{var o;return(o=Q(e.scrollToKey))==null?void 0:o(s)},orientation:()=>Q(e.orientation)},t)}var $u="focusScope.autoFocusOnMount",Du="focusScope.autoFocusOnUnmount",Xm={bubbles:!1,cancelable:!0},Jm={stack:[],active(){return this.stack[0]},add(e){var t;e!==this.active()&&((t=this.active())==null||t.pause()),this.stack=Nd(this.stack,e),this.stack.unshift(e)},remove(e){var t;this.stack=Nd(this.stack,e),(t=this.active())==null||t.resume()}};function v6(e,t){const[n,r]=re(!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=()=>qn(t()),c=()=>{const g=l().createElement("span");return g.setAttribute("data-focus-trap",""),g.tabIndex=0,Object.assign(g.style,h1),g},u=()=>{const g=t();return g?d1(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=Po(g);return!m||un(g,m)?!1:f1(m)};xe(()=>{const g=t();if(!g)return;Jm.add(i);const m=Po(g);if(!un(g,m)){const v=new CustomEvent($u,Xm);g.addEventListener($u,o),g.dispatchEvent(v),v.defaultPrevented||setTimeout(()=>{Ct(d()),Po(g)===m&&Ct(g)},0)}Se(()=>{g.removeEventListener($u,o),setTimeout(()=>{const v=new CustomEvent(Du,Xm);h()&&v.preventDefault(),g.addEventListener(Du,a),g.dispatchEvent(v),v.defaultPrevented||Ct(m!=null?m:l().body),g.removeEventListener(Du,a),Jm.remove(i)},0)})}),xe(()=>{const g=t();if(!g||!Q(e.trapFocus)||n())return;const m=v=>{const b=v.target;b!=null&&b.closest(`[${rc}]`)||(un(g,b)?s=b:Ct(s))},p=v=>{const b=v.relatedTarget,w=b!=null?b:Po(g);w!=null&&w.closest(`[${rc}]`)||un(g,w)||Ct(s)};l().addEventListener("focusin",m),l().addEventListener("focusout",p),Se(()=>{l().removeEventListener("focusin",m),l().removeEventListener("focusout",p)})}),xe(()=>{const g=t();if(!g||!Q(e.trapFocus)||n())return;const m=c();g.insertAdjacentElement("afterbegin",m);const p=c();g.insertAdjacentElement("beforeend",p);function v(w){const C=d(),x=f();w.relatedTarget===C?Ct(x):Ct(C)}m.addEventListener("focusin",v),p.addEventListener("focusin",v);const b=new MutationObserver(w=>{for(const C of w)C.previousSibling===p&&(p.remove(),g.insertAdjacentElement("beforeend",p)),C.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 b6="data-live-announcer";function x6(e){xe(()=>{Q(e.isDisabled)||Se(w6(Q(e.targets),Q(e.root)))})}var mo=new WeakMap,rn=[];function w6(e,t=document.body){const n=new Set(e),r=new Set,i=l=>{for(const f of l.querySelectorAll(`[${b6}], [${rc}]`))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=mo.get(l))!=null?u:0;l.getAttribute("aria-hidden")==="true"&&c===0||(c===0&&l.setAttribute("aria-hidden","true"),r.add(l),mo.set(l,c+1))};rn.length&&rn[rn.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 rn.push(a),()=>{o.disconnect();for(const l of r){const c=mo.get(l);if(c==null)return;c===1?(l.removeAttribute("aria-hidden"),mo.delete(l)):mo.set(l,c-1)}a===rn[rn.length-1]?(rn.pop(),rn.length&&rn[rn.length-1].observe()):rn.splice(rn.indexOf(a),1)}}var bl=new Map,S6=e=>{xe(()=>{var s,o;const t=(s=St(e.style))!=null?s:{},n=(o=St(e.properties))!=null?o:[],r={};for(const a in t)r[a]=e.element.style[a];const i=bl.get(e.key);i?i.activeCount++:bl.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=bl.get(e.key);if(a){if(a.activeCount!==1){a.activeCount--;return}bl.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)}})})},Zm=S6,C6=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},_6=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},k6=(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]=C6(i,t),f=d-c-r*u;(u!==0||f!==0)&&_6(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]},[ep,tp]=re([]),O6=e=>ep().indexOf(e)===ep().length-1,E6=e=>{const t=Oe({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=yn();let r=[0,0],i=null,s=null;xe(()=>{St(t.enabled)&&(tp(c=>[...c,n]),Se(()=>{tp(c=>c.filter(u=>u!==n))}))}),xe(()=>{if(!St(t.enabled)||!St(t.hideScrollbar))return;const{body:c}=document,u=window.innerWidth-c.offsetWidth;if(St(t.preventScrollbarShift)){const d={overflow:"hidden"},f=[];u>0&&(St(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;Zm({key:"prevent-scroll",element:c,style:d,properties:f,cleanup:()=>{St(t.restoreScrollPosition)&&u>0&&window.scrollTo(g,h)}})}else Zm({key:"prevent-scroll",element:c,style:{overflow:"hidden"}})}),xe(()=>{!O6(n)||!St(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=np(c),i=null,s=null},a=c=>{const u=c.target,d=St(t.element),f=A6(c),h=Math.abs(f[0])>Math.abs(f[1])?"x":"y",g=h==="x"?f[0]:f[1],m=rp(u,h,g,d);let p;d&&Ud(d,u)?p=!m:p=!0,p&&c.cancelable&&c.preventDefault()},l=c=>{const u=St(t.element),d=c.target;let f;if(c.touches.length===2)f=!St(t.allowPinchZoom);else{if(i==null||s===null){const h=np(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=rp(d,i,s,u);u&&Ud(u,d)?f=!h:f=!0}}f&&c.cancelable&&c.preventDefault()}},A6=e=>[e.deltaX,e.deltaY],np=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],rp=(e,t,n,r)=>{const i=r!==null&&Ud(r,e),[s,o]=k6(e,t,i?r:void 0);return!(n>0&&Math.abs(s)<=1||n<0&&Math.abs(o)<1)},Ud=(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},P6=E6,T6=P6,tx=mt();function nx(){return pt(tx)}function mr(){const e=nx();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var rx=mt();function eh(){const e=pt(rx);if(e===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var ix=mt();function Hn(){const e=pt(ix);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function th(e){let t;const n=Hn(),r=mr(),i=Be({id:n.generateId(`item-${yn()}`)},e),[s,o]=Ve(i,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=re(),[c,u]=re(),[d,f]=re(),h=()=>r.listState().selectionManager(),g=()=>o.id,m=()=>h().focusedKey()===g(),p=()=>{var O;(O=s.onSelect)==null||O.call(s),s.closeOnSelect&&setTimeout(()=>{r.close(!0)})};N4({getItem:()=>{var O,E,T,D,W;return{ref:()=>t,type:"item",key:g(),textValue:(D=(T=(E=s.textValue)!=null?E:(O=d())==null?void 0:O.textContent)!=null?T:t==null?void 0:t.textContent)!=null?D:"",disabled:(W=s.disabled)!=null?W:!1}}});const v=O1({key:g,selectionManager:h,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),b=O=>{et(O,s.onPointerMove),O.pointerType==="mouse"&&(s.disabled?r.onItemLeave(O):(r.onItemEnter(O),O.defaultPrevented||(Ct(O.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(g()))))},w=O=>{et(O,s.onPointerLeave),O.pointerType==="mouse"&&r.onItemLeave(O)},C=O=>{et(O,s.onPointerUp),!s.disabled&&O.button===0&&p()},x=O=>{if(et(O,s.onKeyDown),!O.repeat&&!s.disabled)switch(O.key){case"Enter":case" ":p();break}},k=H(()=>{if(s.indeterminate)return"mixed";if(s.checked!=null)return s.checked}),S=H(()=>({"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:S,setLabelRef:f,generateId:Ra(()=>o.id),registerLabel:dn(l),registerDescription:dn(u)};return j(rx.Provider,{value:_,get children(){return j(rt,Oe({as:"div",ref(O){const E=Mt(T=>t=T,s.ref);typeof E=="function"&&E(O)},get tabIndex(){return v.tabIndex()},get"aria-checked"(){return k()},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 ht([s.onPointerDown,v.onPointerDown])},get onPointerUp(){return ht([C,v.onPointerUp])},get onClick(){return ht([s.onClick,v.onClick])},get onKeyDown(){return ht([x,v.onKeyDown])},get onMouseDown(){return ht([s.onMouseDown,v.onMouseDown])},get onFocus(){return ht([s.onFocus,v.onFocus])},onPointerMove:b,onPointerLeave:w},S,o))}})}function sx(e){const t=Be({closeOnSelect:!1},e),[n,r]=Ve(t,["checked","defaultChecked","onChange","onSelect"]),i=P4({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(th,Oe({role:"menuitemcheckbox",get checked(){return i.isSelected()},onSelect:()=>{var o;(o=n.onSelect)==null||o.call(n),i.toggle()}},r))}var j6=mt();function Hc(){return pt(j6)}var ua={next:(e,t)=>e==="ltr"?t==="horizontal"?"ArrowRight":"ArrowDown":t==="horizontal"?"ArrowLeft":"ArrowUp",previous:(e,t)=>ua.next(e==="ltr"?"rtl":"ltr",t)},ip={first:e=>e==="horizontal"?"ArrowDown":"ArrowRight",last:e=>e==="horizontal"?"ArrowUp":"ArrowLeft"};function ox(e){const t=Hn(),n=mr(),r=Hc(),{direction:i}=Qr(),s=Be({id:t.generateId("trigger")},e),[o,a]=Ve(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=Fc(()=>n.triggerRef(),()=>"button"),u=H(()=>{var v;return c()==="a"&&((v=n.triggerRef())==null?void 0:v.getAttribute("href"))!=null});xe(ur(()=>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=>{et(v,o.onPointerDown),v.currentTarget.dataset.pointerType=v.pointerType,!o.disabled&&v.pointerType!=="touch"&&v.button===0&&d()},h=v=>{et(v,o.onClick),o.disabled||v.currentTarget.dataset.pointerType==="touch"&&d()},g=v=>{if(et(v,o.onKeyDown),!o.disabled){if(u())switch(v.key){case"Enter":case" ":return}switch(v.key){case"Enter":case" ":case ip.first(t.orientation()):v.stopPropagation(),v.preventDefault(),w4(v.currentTarget),n.open("first"),r==null||r.setAutoFocusMenu(!0),r==null||r.setValue(l);break;case ip.last(t.orientation()):v.stopPropagation(),v.preventDefault(),n.open("last");break;case ua.next(i(),t.orientation()):if(r===void 0)break;v.stopPropagation(),v.preventDefault(),r.nextMenu();break;case ua.previous(i(),t.orientation()):if(r===void 0)break;v.stopPropagation(),v.preventDefault(),r.previousMenu();break}}},m=v=>{var b;et(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=>{et(v,o.onFocus),r!==void 0&&v.currentTarget.dataset.pointerType!=="touch"&&r.setValue(l)};return xe(()=>Se(n.registerTriggerId(o.id))),j(Uf,Oe({ref(v){const b=Mt(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 H(()=>!!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 M6=mt();function ax(){return pt(M6)}function lx(e){let t;const n=Hn(),r=mr(),i=Hc(),s=ax(),{direction:o}=Qr(),a=Be({id:n.generateId(`content-${yn()}`)},e),[l,c]=Ve(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=p6({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);v6({trapFocus:()=>d()&&r.isOpen(),onMountAutoFocus:w=>{var C;i===void 0&&((C=l.onOpenAutoFocus)==null||C.call(l,w))},onUnmountAutoFocus:l.onCloseAutoFocus},()=>t);const h=w=>{if(un(w.currentTarget,w.target)&&(w.key==="Tab"&&r.isOpen()&&w.preventDefault(),i!==void 0&&w.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(w.key){case ua.next(o(),n.orientation()):w.stopPropagation(),w.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.nextMenu();break;case ua.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 C;(C=l.onEscapeKeyDown)==null||C.call(l,w),i==null||i.setAutoFocusMenu(!1),r.close(!0)},m=w=>{var C;(C=l.onFocusOutside)==null||C.call(l,w),n.isModal()&&w.preventDefault()},p=w=>{var C,x;et(w,l.onPointerEnter),r.isOpen()&&((C=r.parentMenuContext())==null||C.listState().selectionManager().setFocused(!1),(x=r.parentMenuContext())==null||x.listState().selectionManager().setFocusedKey(void 0))},v=w=>{if(et(w,l.onPointerMove),w.pointerType!=="mouse")return;const C=w.target,x=u!==w.clientX;un(w.currentTarget,C)&&x&&(r.setPointerDir(w.clientX>u?"right":"left"),u=w.clientX)};xe(()=>Se(r.registerContentId(l.id)));const b={ref:Mt(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:ht([l.onKeyDown,f.onKeyDown,h]),onMouseDown:ht([l.onMouseDown,f.onMouseDown]),onFocusIn:ht([l.onFocusIn,f.onFocusIn]),onFocusOut:ht([l.onFocusOut,f.onFocusOut]),onPointerEnter:p,onPointerMove:v,get"data-orientation"(){return n.orientation()}};return j(ve,{get when(){return r.contentPresent()},get children(){return j(ve,{get when(){return s===void 0||r.parentMenuContext()!=null},get fallback(){return j(rt,Oe({as:"div"},()=>r.dataset(),b,c))},get children(){return j(q1.Positioner,{get children(){return j(g6,Oe({get disableOutsidePointerEvents(){return H(()=>!!d())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return Rc({"--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 $6(e){let t;const n=Hn(),r=mr(),[i,s]=Ve(e,["ref"]);return T6({element:()=>t!=null?t:null,enabled:()=>r.contentPresent()&&n.preventScroll()}),j(lx,Oe({ref(o){const a=Mt(l=>{t=l},i.ref);typeof a=="function"&&a(o)}},s))}var cx=mt();function D6(){const e=pt(cx);if(e===void 0)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}function nh(e){const t=Hn(),n=Be({id:t.generateId(`group-${yn()}`)},e),[r,i]=re(),s={generateId:Ra(()=>n.id),registerLabelId:dn(i)};return j(cx.Provider,{value:s,get children(){return j(rt,Oe({as:"div",role:"group",get"aria-labelledby"(){return r()}},n))}})}function ux(e){const t=D6(),n=Be({id:t.generateId("label")},e),[r,i]=Ve(n,["id"]);return xe(()=>Se(t.registerLabelId(r.id))),j(rt,Oe({as:"span",get id(){return r.id},"aria-hidden":"true"},i))}function dx(e){const t=mr(),n=Be({children:"▼"},e);return j(rt,Oe({as:"span","aria-hidden":"true"},()=>t.dataset(),n))}function fx(e){return j(th,Oe({role:"menuitem",closeOnSelect:!0},e))}function hx(e){const t=eh(),n=Be({id:t.generateId("description")},e),[r,i]=Ve(n,["id"]);return xe(()=>Se(t.registerDescription(r.id))),j(rt,Oe({as:"div",get id(){return r.id}},()=>t.dataset(),i))}function gx(e){const t=eh(),n=Be({id:t.generateId("indicator")},e),[r,i]=Ve(n,["forceMount"]);return j(ve,{get when(){return r.forceMount||t.isChecked()},get children(){return j(rt,Oe({as:"div"},()=>t.dataset(),i))}})}function yx(e){const t=eh(),n=Be({id:t.generateId("label")},e),[r,i]=Ve(n,["ref","id"]);return xe(()=>Se(t.registerLabel(r.id))),j(rt,Oe({as:"div",ref(s){const o=Mt(t.setLabelRef,r.ref);typeof o=="function"&&o(s)},get id(){return r.id}},()=>t.dataset(),i))}function mx(e){const t=mr();return j(ve,{get when(){return t.contentPresent()},get children(){return j(q0,e)}})}var px=mt();function L6(){const e=pt(px);if(e===void 0)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}function vx(e){const n=Hn().generateId(`radiogroup-${yn()}`),r=Be({id:n},e),[i,s]=Ve(r,["value","defaultValue","onChange","disabled"]),[o,a]=Fa({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(px.Provider,{value:l,get children(){return j(nh,s)}})}function bx(e){const t=L6(),n=Be({closeOnSelect:!1},e),[r,i]=Ve(n,["value","onSelect"]);return j(th,Oe({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 I6(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 R6(e,t){return t?x4([e.clientX,e.clientY],t):!1}function xx(e){const t=Hn(),n=b1(),r=nx(),i=Hc(),s=ax(),o=Be({placement:t.orientation()==="horizontal"?"bottom-start":"right-start"},e),[a,l]=Ve(o,["open","defaultOpen","onOpenChange"]);let c=0,u=null,d="right";const[f,h]=re(),[g,m]=re(),[p,v]=re(),[b,w]=re(),[C,x]=re(!0),[k,S]=re(l.placement),[_,O]=re([]),[E,T]=re([]),{DomCollectionProvider:D}=R4({items:E,onItemsChange:T}),W=H1({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:V=>{var de;return(de=a.onOpenChange)==null?void 0:de.call(a,V)}}),{present:N}=E1({show:()=>t.forceMount()||W.isOpen(),element:()=>{var V;return(V=b())!=null?V:null}}),L=tD({selectionMode:"none",dataSource:E}),$=V=>{x(V),W.open()},I=(V=!1)=>{W.close(),V&&r&&r.close(!0)},oe=V=>{x(V),W.toggle()},ue=()=>{const V=b();V&&(Ct(V),L.selectionManager().setFocused(!0),L.selectionManager().setFocusedKey(void 0))},B=()=>{s!=null?setTimeout(()=>ue()):ue()},X=V=>{O(fe=>[...fe,V]);const de=r==null?void 0:r.registerNestedMenu(V);return()=>{O(fe=>Nd(fe,V)),de==null||de()}},ae=V=>d===(u==null?void 0:u.side)&&R6(V,u==null?void 0:u.area),ne=V=>{ae(V)&&V.preventDefault()},R=V=>{ae(V)||B()},G=V=>{ae(V)&&V.preventDefault()};x6({isDisabled:()=>!(r==null&&W.isOpen()&&t.isModal()),targets:()=>[b(),..._()].filter(Boolean)}),xe(()=>{const V=b();if(!V||!r)return;const de=r.registerNestedMenu(V);Se(()=>{de()})}),xe(()=>{r===void 0&&(i==null||i.registerMenu(t.value(),[b(),..._()]))}),xe(()=>{var V;r!==void 0||i===void 0||(i.value()===t.value()?((V=p())==null||V.focus(),i.autoFocusMenu()&&$(!0)):I())}),xe(()=>{r!==void 0||i===void 0||W.isOpen()&&i.setValue(t.value())}),Se(()=>{r===void 0&&(i==null||i.unregisterMenu(t.value()))});const ce={dataset:H(()=>({"data-expanded":W.isOpen()?"":void 0,"data-closed":W.isOpen()?void 0:""})),isOpen:W.isOpen,contentPresent:N,nestedMenus:_,currentPlacement:k,pointerGraceTimeoutId:()=>c,autoFocus:C,listState:()=>L,parentMenuContext:()=>r,triggerRef:p,contentRef:b,triggerId:f,contentId:g,setTriggerRef:v,setContentRef:w,open:$,close:I,toggle:oe,focusContent:B,onItemEnter:ne,onItemLeave:R,onTriggerLeave:G,setPointerDir:V=>d=V,setPointerGraceTimeoutId:V=>c=V,setPointerGraceIntent:V=>u=V,registerNestedMenu:X,registerItemToParentDomCollection:n==null?void 0:n.registerItem,registerTriggerId:dn(h),registerContentId:dn(m)};return j(D,{get children(){return j(tx.Provider,{value:ce,get children(){return j(ve,{when:s===void 0,get fallback(){return l.children},get children(){return j(q1,Oe({anchorRef:p,contentRef:b,onCurrentPlacementChange:S},l))}})}})}})}function wx(e){const{direction:t}=Qr();return j(xx,Oe({get placement(){return t()==="rtl"?"left-start":"right-start"},flip:!0},e))}var N6={close:(e,t)=>e==="ltr"?[t==="horizontal"?"ArrowLeft":"ArrowUp"]:[t==="horizontal"?"ArrowRight":"ArrowDown"]};function Sx(e){const t=mr(),n=Hn(),[r,i]=Ve(e,["onFocusOutside","onKeyDown"]),{direction:s}=Qr();return j(lx,Oe({onOpenAutoFocus:u=>{u.preventDefault()},onCloseAutoFocus:u=>{u.preventDefault()},onFocusOutside:u=>{var f;(f=r.onFocusOutside)==null||f.call(r,u);const d=u.target;un(t.triggerRef(),d)||t.close()},onKeyDown:u=>{et(u,r.onKeyDown);const d=un(u.currentTarget,u.target),f=N6.close(s(),n.orientation()).includes(u.key),h=t.parentMenuContext()!=null;d&&f&&h&&(t.close(),Ct(t.triggerRef()))}},i))}var sp=["Enter"," "],F6={open:(e,t)=>e==="ltr"?[...sp,t==="horizontal"?"ArrowRight":"ArrowDown"]:[...sp,t==="horizontal"?"ArrowLeft":"ArrowUp"]};function Cx(e){let t;const n=Hn(),r=mr(),i=Be({id:n.generateId(`sub-trigger-${yn()}`)},e),[s,o]=Ve(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}=Qr(),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=O1({key:u,selectionManager:d,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),m=w=>{et(w,s.onClick),!r.isOpen()&&!s.disabled&&r.open(!0)},p=w=>{var x;if(et(w,s.onPointerMove),w.pointerType!=="mouse")return;const C=r.parentMenuContext();if(C==null||C.onItemEnter(w),!w.defaultPrevented){if(s.disabled){C==null||C.onItemLeave(w);return}!r.isOpen()&&!a&&((x=r.parentMenuContext())==null||x.setPointerGraceIntent(null),a=window.setTimeout(()=>{r.open(!1),l()},100)),C==null||C.onItemEnter(w),w.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),Ct(w.currentTarget),C==null||C.listState().selectionManager().setFocused(!0),C==null||C.listState().selectionManager().setFocusedKey(u()))}},v=w=>{if(et(w,s.onPointerLeave),w.pointerType!=="mouse")return;l();const C=r.parentMenuContext(),x=r.contentRef();if(x){C==null||C.setPointerGraceIntent({area:I6(r.currentPlacement(),w,x),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(C==null?void 0:C.pointerGraceTimeoutId());const k=window.setTimeout(()=>{C==null||C.setPointerGraceIntent(null)},300);C==null||C.setPointerGraceTimeoutId(k)}else{if(C==null||C.onTriggerLeave(w),w.defaultPrevented)return;C==null||C.setPointerGraceIntent(null)}C==null||C.onItemLeave(w)},b=w=>{et(w,s.onKeyDown),!w.repeat&&(s.disabled||F6.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 xe(()=>{var C,x,k;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=(C=s.textValue)!=null?C:t==null?void 0:t.textContent)!=null?x:"",disabled:(k=s.disabled)!=null?k:!1});Se(w)}),xe(ur(()=>{var w;return(w=r.parentMenuContext())==null?void 0:w.pointerGraceTimeoutId()},w=>{Se(()=>{var C;window.clearTimeout(w),(C=r.parentMenuContext())==null||C.setPointerGraceIntent(null)})})),xe(()=>Se(r.registerTriggerId(s.id))),Se(()=>{l()}),j(rt,Oe({as:"div",ref(w){const C=Mt(x=>{r.setTriggerRef(x),t=x},s.ref);typeof C=="function"&&C(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 H(()=>!!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 ht([s.onPointerDown,g.onPointerDown])},get onPointerUp(){return ht([s.onPointerUp,g.onPointerUp])},get onClick(){return ht([m,g.onClick])},get onKeyDown(){return ht([b,g.onKeyDown])},get onMouseDown(){return ht([s.onMouseDown,g.onMouseDown])},get onFocus(){return ht([s.onFocus,g.onFocus])},onPointerMove:p,onPointerLeave:v},()=>r.dataset(),o))}function B6(e){const t=Hc(),n=`menu-${yn()}`,r=Be({id:n,modal:!0},e),[i,s]=Ve(r,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),o=H1({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:Ra(()=>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(ix.Provider,{value:a,get children(){return j(xx,Oe({get open(){return o.isOpen()},get onOpenChange(){return o.setIsOpen}},s))}})}var q6={};Bc(q6,{Root:()=>Kc,Separator:()=>z6});function Kc(e){let t;const n=Be({orientation:"horizontal"},e),[r,i]=Ve(n,["ref","orientation"]),s=Fc(()=>t,()=>"hr");return j(rt,Oe({as:"hr",ref(o){const a=Mt(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 z6=Kc,lt={};Bc(lt,{Arrow:()=>Zf,CheckboxItem:()=>sx,Content:()=>_x,DropdownMenu:()=>H6,Group:()=>nh,GroupLabel:()=>ux,Icon:()=>dx,Item:()=>fx,ItemDescription:()=>hx,ItemIndicator:()=>gx,ItemLabel:()=>yx,Portal:()=>mx,RadioGroup:()=>vx,RadioItem:()=>bx,Root:()=>kx,Separator:()=>Kc,Sub:()=>wx,SubContent:()=>Sx,SubTrigger:()=>Cx,Trigger:()=>ox});function _x(e){const t=Hn(),n=mr(),[r,i]=Ve(e,["onCloseAutoFocus","onInteractOutside"]);let s=!1;return j($6,Oe({onCloseAutoFocus:l=>{var c;(c=r.onCloseAutoFocus)==null||c.call(r,l),s||Ct(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 kx(e){const t=`dropdownmenu-${yn()}`,n=Be({id:t},e);return j(B6,n)}var H6=Object.assign(kx,{Arrow:Zf,CheckboxItem:sx,Content:_x,Group:nh,GroupLabel:ux,Icon:dx,Item:fx,ItemDescription:hx,ItemIndicator:gx,ItemLabel:yx,Portal:mx,RadioGroup:vx,RadioItem:bx,Separator:Kc,Sub:wx,SubContent:Sx,SubTrigger:Cx,Trigger:ox}),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"}},K6=le('<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>'),U6=le('<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>'),V6=le('<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>'),W6=le('<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>'),rh=le('<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>'),G6=le('<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>'),Q6=le('<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>'),Y6=le('<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>'),X6=le('<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">'),J6=le('<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">'),Z6=le('<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>'),eL=le('<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>'),tL=le('<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>'),nL=le('<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>'),Ox=le('<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>'),rL=le('<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>'),iL=le('<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>'),sL=le('<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>'),oL=le('<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>'),aL=le('<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>'),lL=le('<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>'),cL=le('<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>'),uL=le('<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 dL(){return K6()}function Ex(){return U6()}function Fo(){return V6()}function op(){return W6()}function ap(){return rh()}function fL(){return(()=>{var e=rh();return e.style.setProperty("transform","rotate(90deg)"),e})()}function hL(){return(()=>{var e=rh();return e.style.setProperty("transform","rotate(-90deg)"),e})()}function gL(){return G6()}function yL(){return Q6()}function mL(){return Y6()}function pL(){return X6()}function vL(){return J6()}function bL(){return Z6()}function xL(){return eL()}function wL(){return tL()}function SL(){return nL()}function CL(e){return(()=>{var t=Ox(),n=t.firstChild;return be(()=>J(n,"stroke",e.theme==="dark"?"#12B76A":"#027A48")),t})()}function _L(){return rL()}function kL(){return iL()}function OL(e){return[j(ve,{get when(){return e.checked},get children(){var t=Ox(),n=t.firstChild;return be(()=>J(n,"stroke",e.theme==="dark"?"#9B8AFB":"#6938EF")),t}}),j(ve,{get when(){return!e.checked},get children(){var t=sL(),n=t.firstChild;return be(()=>J(n,"stroke",e.theme==="dark"?"#9B8AFB":"#6938EF")),t}})]}function EL(){return oL()}function AL(){return aL()}function PL(){return lL()}function TL(){return cL()}function lp(){const e=yn();return(()=>{var t=uL(),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,C=w.firstChild,x=w.nextSibling,k=x.firstChild,S=x.nextSibling,_=S.nextSibling,O=_.firstChild,E=_.nextSibling,T=E.firstChild,D=E.nextSibling,W=D.nextSibling,N=W.firstChild,L=W.nextSibling,$=L.firstChild,I=L.nextSibling,oe=I.nextSibling,ue=oe.firstChild,B=oe.nextSibling,X=B.firstChild,ae=B.nextSibling,ne=ae.firstChild,R=ne.nextSibling,G=R.nextSibling,q=G.nextSibling,ce=q.nextSibling,V=ae.nextSibling,de=V.firstChild,fe=V.nextSibling,Ne=fe.firstChild,te=fe.nextSibling,De=te.firstChild,me=De.nextSibling,Te=me.nextSibling,je=Te.firstChild,Et=je.nextSibling,Z=Et.nextSibling,Me=Z.nextSibling,Je=Me.nextSibling,Le=Je.nextSibling,Ie=Le.nextSibling,he=Ie.nextSibling,we=he.nextSibling,ge=we.nextSibling,qe=ge.nextSibling,Kn=qe.nextSibling,vn=te.nextSibling,Yr=vn.firstChild,Un=vn.nextSibling,Xr=Un.firstChild,Vn=Un.nextSibling,pr=Vn.firstChild,Ha=pr.nextSibling,Xs=Vn.nextSibling,Ka=Xs.firstChild,Bi=Xs.nextSibling,Ua=Bi.firstChild,Js=Bi.nextSibling,Zs=Js.firstChild,eo=Zs.nextSibling,qi=eo.nextSibling,ah=qi.nextSibling,lh=ah.nextSibling,ch=lh.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,Fx=xh.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(C,"id",`ai-${e}`),J(x,"id",`i-${e}`),J(k,"filter",`url(#ai-${e})`),J(S,"mask",`url(#i-${e})`),J(O,"id",`aj-${e}`),J(E,"id",`h-${e}`),J(T,"filter",`url(#aj-${e})`),J(D,"mask",`url(#h-${e})`),J(N,"id",`ag-${e}`),J(L,"id",`g-${e}`),J($,"filter",`url(#ag-${e})`),J(I,"mask",`url(#g-${e})`),J(ue,"id",`af-${e}`),J(B,"id",`f-${e}`),J(X,"filter",`url(#af-${e})`),J(ae,"mask",`url(#f-${e})`),J(q,"id",`m-${e}`),J(ce,"fill",`url(#m-${e})`),J(de,"id",`ak-${e}`),J(fe,"id",`e-${e}`),J(Ne,"filter",`url(#ak-${e})`),J(te,"mask",`url(#e-${e})`),J(De,"id",`n-${e}`),J(me,"fill",`url(#n-${e})`),J(je,"id",`r-${e}`),J(Et,"fill",`url(#r-${e})`),J(Z,"id",`s-${e}`),J(Me,"fill",`url(#s-${e})`),J(Je,"id",`q-${e}`),J(Le,"fill",`url(#q-${e})`),J(Ie,"id",`p-${e}`),J(he,"fill",`url(#p-${e})`),J(we,"id",`o-${e}`),J(ge,"fill",`url(#o-${e})`),J(qe,"id",`l-${e}`),J(Kn,"fill",`url(#l-${e})`),J(Yr,"id",`al-${e}`),J(Un,"id",`d-${e}`),J(Xr,"filter",`url(#al-${e})`),J(Vn,"mask",`url(#d-${e})`),J(pr,"id",`u-${e}`),J(Ha,"fill",`url(#u-${e})`),J(Ka,"id",`ad-${e}`),J(Bi,"id",`c-${e}`),J(Ua,"filter",`url(#ad-${e})`),J(Js,"mask",`url(#c-${e})`),J(Zs,"id",`t-${e}`),J(eo,"fill",`url(#t-${e})`),J(qi,"id",`v-${e}`),J(ah,"stroke",`url(#v-${e})`),J(lh,"id",`aa-${e}`),J(ch,"stroke",`url(#aa-${e})`),J(uh,"id",`w-${e}`),J(dh,"stroke",`url(#w-${e})`),J(fh,"id",`ac-${e}`),J(hh,"stroke",`url(#ac-${e})`),J(gh,"id",`ab-${e}`),J(yh,"stroke",`url(#ab-${e})`),J(mh,"id",`y-${e}`),J(ph,"stroke",`url(#y-${e})`),J(vh,"id",`x-${e}`),J(bh,"stroke",`url(#x-${e})`),J(xh,"id",`z-${e}`),J(Fx,"stroke",`url(#z-${e})`),t})()}var jL=le('<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>'),ML=le('<button title="Copy object to clipboard">'),$L=le('<button title="Remove all items"aria-label="Remove all items">'),DL=le('<button title="Delete item"aria-label="Delete item">'),LL=le('<button title="Toggle value"aria-label="Toggle value">'),IL=le('<button title="Bulk Edit Data"aria-label="Bulk Edit Data">'),po=le("<div>"),RL=le("<div><button> <span></span> <span> "),NL=le("<input>"),cp=le("<span>"),FL=le("<div><span>:"),BL=le("<div><div><button> [<!>...<!>]");function qL(e,t){let n=0;const r=[];for(;n<e.length;)r.push(e.slice(n,n+t)),n=n+t;return r}var up=e=>{const t=yt(),n=ye().shadowDOMTarget?Pe.bind({target:ye().shadowDOMTarget}):Pe,r=H(()=>t()==="dark"?Ys(n):Qs(n));return(()=>{var i=jL();return be(()=>ee(i,se(r().expander,n`
67
+ `):e}function o$(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 nm(e,t){const n=e.chart.ctx,{body:r,footer:i,title:s}=e,{boxWidth:o,boxHeight:a}=t,l=ft(t.bodyFont),c=ft(t.titleFont),u=ft(t.footerFont),d=s.length,f=i.length,h=r.length,g=Et(t.padding);let m=g.height,p=0,v=r.reduce((C,x)=>C+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 C=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=h*C+(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(C){p=Math.max(p,n.measureText(C).width+b)};return n.save(),n.font=c.string,Qe(e.title,w),n.font=l.string,Qe(e.beforeBody.concat(e.afterBody),w),b=t.displayColors?o+2+t.boxPadding:0,Qe(r,C=>{Qe(C.before,w),Qe(C.lines,w),Qe(C.after,w)}),b=0,n.font=u.string,Qe(e.footer,w),n.restore(),p+=g.width,{width:p,height:m}}function a$(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function l$(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 c$(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"),l$(c,e,t,n)&&(c="center"),c}function rm(e,t,n){const r=n.yAlign||t.yAlign||a$(e,n);return{xAlign:n.xAlign||t.xAlign||c$(e,t,n,r),yAlign:r}}function u$(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function d$(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function im(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}=Ji(o);let g=u$(t,a);const m=d$(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:ln(g,0,r.width-t.width),y:ln(m,0,r.height-t.height)}}function hl(e,t,n){const r=Et(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function sm(e){return Mn([],Xn(e))}function f$(e,t,n){return Gr(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function om(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Wb={beforeTitle:Vn,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:Vn,beforeBody:Vn,beforeLabel:Vn,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return Ye(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Vn,afterBody:Vn,beforeFooter:Vn,footer:Vn,afterFooter:Vn};function Mt(e,t,n,r){const i=e[t].call(n,r);return typeof i=="undefined"?Wb[t].call(n,r):i}class Pd extends Ni{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 Pb(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=f$(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=Mt(r,"beforeTitle",this,t),s=Mt(r,"title",this,t),o=Mt(r,"afterTitle",this,t);let a=[];return a=Mn(a,Xn(i)),a=Mn(a,Xn(s)),a=Mn(a,Xn(o)),a}getBeforeBody(t,n){return sm(Mt(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return Qe(t,s=>{const o={before:[],lines:[],after:[]},a=om(r,s);Mn(o.before,Xn(Mt(a,"beforeLabel",this,s))),Mn(o.lines,Mt(a,"label",this,s)),Mn(o.after,Xn(Mt(a,"afterLabel",this,s))),i.push(o)}),i}getAfterBody(t,n){return sm(Mt(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=Mt(r,"beforeFooter",this,t),s=Mt(r,"footer",this,t),o=Mt(r,"afterFooter",this,t);let a=[];return a=Mn(a,Xn(i)),a=Mn(a,Xn(s)),a=Mn(a,Xn(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(o$(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))),Qe(a,u=>{const d=om(t.callbacks,u);i.push(Mt(d,"labelColor",this,u)),s.push(Mt(d,"labelPointStyle",this,u)),o.push(Mt(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=Eo[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=nm(this,r),c=Object.assign({},a,l),u=rm(this.chart,r,c),d=im(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}=Ji(a),{x:f,y:h}=t,{width:g,height:m}=n;let p,v,b,w,C,x;return s==="center"?(C=h+m/2,i==="left"?(p=f,v=p-o,w=C+o,x=C-o):(p=f+g,v=p+o,w=C-o,x=C+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,C=w-o,p=v-o,b=v+o):(w=h+m,C=w+o,p=v+o,b=v-o),x=w),{x1:p,x2:v,x3:b,y1:w,y2:C,y3:x}}drawTitle(t,n,r){const i=this.title,s=i.length;let o,a,l;if(s){const c=Zi(r.rtl,this.x,this.width);for(t.x=hl(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",o=ft(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=ft(s.bodyFont),d=hl(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,_d(t,m,p,v),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,_d(t,m,p,v)}else{t.lineWidth=Ne(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=Ji(o.borderRadius);Object.values(v).some(b=>b!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,Jl(t,{x:m,y:g,w:c,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Jl(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=ft(r.bodyFont);let f=d.lineHeight,h=0;const g=Zi(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,C,x,k,S;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=hl(this,p,r),n.fillStyle=r.bodyColor,Qe(this.beforeBody,m),h=a&&p!=="right"?o==="center"?c/2+u:c+2+u:0,C=0,k=i.length;C<k;++C){for(v=i[C],b=this.labelTextColors[C],n.fillStyle=b,Qe(v.before,m),w=v.lines,a&&w.length&&(this._drawColorBox(n,t,C,g,r),f=Math.max(d.lineHeight,l)),x=0,S=w.length;x<S;++x)m(w[x]),f=d.lineHeight;Qe(v.after,m)}h=0,f=d.lineHeight,Qe(this.afterBody,m),t.y-=s}drawFooter(t,n,r){const i=this.footer,s=i.length;let o,a;if(s){const l=Zi(r.rtl,this.x,this.width);for(t.x=hl(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",o=ft(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}=Ji(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=Eo[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=nm(this,t),l=Object.assign({},o,this._size),c=rm(n,t,l),u=im(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=Et(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),Cb(t,n.textDirection),s.y+=o.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),_b(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=!Vl(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||!Vl(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=Eo[s.position].call(this,t,n);return o!==!1&&(r!==o.x||i!==o.y)}}me(Pd,"positioners",Eo);var h$={id:"tooltip",_element:Pd,positioners:Eo,afterInit(e,t,n){n&&(e.tooltip=new Pd({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:Wb},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 g$=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function y$(e,t,n,r){const i=e.indexOf(t);if(i===-1)return g$(e,t,n,r);const s=e.lastIndexOf(t);return i!==s?n:i}const m$=(e,t)=>e===null?null:ln(Math.round(e),0,t);function am(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Td extends Ws{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(Ye(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:y$(r,t,je(n,t),this._addedLabels),m$(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 am.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(Td,"id","category"),me(Td,"defaults",{ticks:{callback:am}});function p$(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=!Ye(o),b=!Ye(a),w=!Ye(c),C=(p-m)/(d+1);let x=ly((p-m)/g/h)*h,k,S,_,O;if(x<1e-14&&!v&&!b)return[{value:m},{value:p}];O=Math.ceil(p/x)-Math.floor(m/x),O>g&&(x=ly(O*x/g/h)*h),Ye(l)||(k=Math.pow(10,l),x=Math.ceil(x*k)/k),i==="ticks"?(S=Math.floor(m/x)*x,_=Math.ceil(p/x)*x):(S=m,_=p),v&&b&&s&&NP((a-o)/s,x/1e3)?(O=Math.round(Math.min((a-o)/x,u)),x=(a-o)/O,S=o,_=a):w?(S=v?o:S,_=b?a:_,O=c-1,x=(_-S)/O):(O=(_-S)/x,Io(O,Math.round(O),x/1e3)?O=Math.round(O):O=Math.ceil(O));const E=Math.max(cy(x),cy(S));k=Math.pow(10,Ye(l)?E:l),S=Math.round(S*k)/k,_=Math.round(_*k)/k;let T=0;for(v&&(f&&S!==o?(n.push({value:o}),S<o&&T++,Io(Math.round((S+T*x)*k)/k,o,lm(o,C,e))&&T++):S<o&&T++);T<O;++T){const D=Math.round((S+T*x)*k)/k;if(b&&D>a)break;n.push({value:D})}return b&&f&&_!==a?n.length&&Io(n[n.length-1].value,a,lm(a,C,e))?n[n.length-1].value=a:n.push({value:a}):(!b||_===a)&&n.push({value:_}),n}function lm(e,t,{horizontal:n,minRotation:r}){const i=Dr(r),s=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(""+e).length;return Math.min(t/s,o)}class jd extends Ws{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return Ye(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:s}=this;const o=l=>i=n?i:l,a=l=>s=r?s:l;if(t){const l=Ms(i),c=Ms(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=p$(i,s);return t.bounds==="ticks"&&FP(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 yb(t,this.chart.options.locale,this.options.ticks.format)}}class $d extends jd{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=yt(t)?t:0,this.max=yt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Dr(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($d,"id","linear"),me($d,"defaults",{ticks:{callback:Pf.formatters.numeric}});function Md(e){const t=e.ticks;if(t.display&&e.display){const n=Et(t.backdropPadding);return je(t.font&&t.font.size,lt.font.size)+n.height}return 0}function v$(e,t,n){return n=st(n)?n:[n],{w:aT(e,t.string,n),h:n.length*t.lineHeight}}function cm(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 b$(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?ut/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=ft(c.font),f=v$(e.ctx,d,e._pointLabels[l]);r[l]=f;const h=Gt(e.getIndexAngle(l)+a),g=Math.round(kf(h)),m=cm(g,u.x,f.w,0,180),p=cm(g,u.y,f.h,90,270);x$(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=C$(e,r,i)}function x$(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 w$(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(kf(Gt(l.angle+Xt))),u=O$(l.y,a.h,c),d=_$(c),f=k$(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 S$(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:s}=e;return!(ir({x:n,y:r},t)||ir({x:n,y:s},t)||ir({x:i,y:r},t)||ir({x:i,y:s},t))}function C$(e,t,n){const r=[],i=e._pointLabels.length,s=e.options,{centerPointLabels:o,display:a}=s.pointLabels,l={extra:Md(s)/2,additionalAngle:o?ut/i:0};let c;for(let u=0;u<i;u++){l.padding=n[u],l.size=t[u];const d=w$(e,u,l);r.push(d),a==="auto"&&(d.visible=S$(d,c),d.visible&&(c=d))}return r}function _$(e){return e===0||e===180?"center":e<180?"left":"right"}function k$(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function O$(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function E$(e,t,n){const{left:r,top:i,right:s,bottom:o}=n,{backdropColor:a}=t;if(!Ye(a)){const l=Ji(t.borderRadius),c=Et(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(),Jl(e,{x:u,y:d,w:f,h,radius:l}),e.fill()):e.fillRect(u,d,f,h)}}function A$(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));E$(n,o,s);const a=ft(o.font),{x:l,y:c,textAlign:u}=s;Ti(n,e._pointLabels[i],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function Vb(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,Jt);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 P$(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(),Vb(e,n,o,r),s.closePath(),s.stroke(),s.restore())}function T$(e,t,n){return Gr(e,{label:n,index:t,type:"pointLabel"})}class Ao extends jd{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=Et(Md(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=yt(t)&&!isNaN(t)?t:0,this.max=yt(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Md(this.options))}generateTickLabels(t){jd.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const i=Ze(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?b$(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=Jt/(this._pointLabels.length||1),r=this.options.startAngle||0;return Gt(t*n+Dr(r))}getDistanceFromCenterForValue(t){if(Ye(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(Ye(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const r=n[t];return T$(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const i=this.getIndexAngle(t)-Xt+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(),Vb(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&&A$(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);P$(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=ft(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=Et(c.backdropPadding);t.fillRect(-o/2-d.left,-s-u.size/2-d.top,o+d.width,u.size+d.height)}Ti(t,a.label,0,-s,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}me(Ao,"id","radialLinear"),me(Ao,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Pf.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),me(Ao,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),me(Ao,"descriptors",{angleLines:{_fallback:"grid"}});const Ic={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}},Rt=Object.keys(Ic);function um(e,t){return e-t}function dm(e,t){if(Ye(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)),yt(o)||(o=typeof r=="string"?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i==="week"&&(ia(s)||s===!0)?n.startOf(o,"isoWeek",s):n.startOf(o,i)),+o)}function fm(e,t,n,r){const i=Rt.length;for(let s=Rt.indexOf(e);s<i-1;++s){const o=Ic[Rt[s]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-t)/(a*o.size))<=r)return Rt[s]}return Rt[i-1]}function j$(e,t,n,r,i){for(let s=Rt.length-1;s>=Rt.indexOf(n);s--){const o=Rt[s];if(Ic[o].common&&e._adapter.diff(i,r,o)>=t-1)return o}return Rt[n?Rt.indexOf(n):0]}function $$(e){for(let t=Rt.indexOf(e)+1,n=Rt.length;t<n;++t)if(Ic[Rt[t]].common)return Rt[t]}function hm(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=Of(n,t),s=n[r]>=t?n[r]:n[i];e[s]=!0}}function M$(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 gm(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:M$(e,r,i,n)}class tc extends Ws{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 g5._date(t.adapters.date);i.init(n),Lo(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:dm(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=yt(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),s=yt(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=KP(i,s,o);return this._unit=n.unit||(r.autoSkip?fm(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):j$(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:$$(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),gm(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=ln(n,0,o),r=ln(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||fm(s.minUnit,n,r,this._getLabelCapacity(n)),a=je(i.ticks.stepSize,1),l=o==="week"?s.isoWeekday:!1,c=ia(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++)hm(u,f,g);return(f===r||i.bounds==="ticks"||h===1)&&hm(u,f,g),Object.keys(u).sort(um).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 Ze(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=Dr(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,gm(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(dm(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return WP(t.sort(um))}}me(tc,"id","time"),me(tc,"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 gl(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}=ui(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}=ui(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 ym extends tc{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=gl(n,this.min),this._tableRange=gl(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(gl(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return gl(this._table,r*this._tableRange+this._minPos,!0)}}me(ym,"id","timeseries"),me(ym,"defaults",tc.defaults);const Gb="label";function mm(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function D$(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function Qb(e,t){e.labels=t}function Yb(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Gb;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 L$(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Gb;const n={labels:[],datasets:[]};return Qb(n,e.labels),Yb(n,e.datasets,t),n}function I$(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=z.useRef(null),g=z.useRef(null),m=()=>{h.current&&(g.current=new Dc(h.current,{type:o,data:L$(a,s),options:l&&{...l},plugins:c}),mm(t,g.current))},p=()=>{mm(t,null),g.current&&(g.current.destroy(),g.current=null)};return z.useEffect(()=>{!i&&g.current&&l&&D$(g.current,l)},[i,l]),z.useEffect(()=>{!i&&g.current&&Qb(g.current.config.data,a.labels)},[i,a.labels]),z.useEffect(()=>{!i&&g.current&&a.datasets&&Yb(g.current.config.data,a.datasets,s)},[i,a.datasets]),z.useEffect(()=>{g.current&&(i?(p(),setTimeout(m)):g.current.update(d))},[i,l,a.labels,a.datasets,d]),z.useEffect(()=>{g.current&&(p(),setTimeout(m))},[o]),z.useEffect(()=>(m(),()=>p()),[]),z.createElement("canvas",{ref:h,role:"img",height:n,width:r,...f},u)}const R$=z.forwardRef(I$);function Xb(e,t){return Dc.register(t),z.forwardRef((n,r)=>z.createElement(R$,{...n,ref:r,type:e}))}const N$=Xb("line",Al),F$=Xb("radar",Pl);Dc.register(Td,$d,Ao,Lr,$l,Xj,s$,h$,r$);var Dd={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}},B$=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 pm(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 vm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pm(Object(n),!0).forEach(function(r){q$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pm(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function q$(e,t,n){return(t=z$(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z$(e){var t=H$(e,"string");return Is(t)=="symbol"?t:t+""}function H$(e,t){if(Is(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Is(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Is(e){"@babel/helpers - typeof";return Is=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},Is(e)}function K$(e){var t=new Date(e);return isNaN(t.getTime())?String(e):t.toLocaleString("en-US",{month:"short",day:"numeric"})}var U$=function(){var t,n,r,i,s=Us(),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&&Is(d.labels)==="object"?Object.values(d.labels):[],h=f.map(function(v){return K$(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=vm(vm({},Dd),{},{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(Ma,{title:"Mentions progress",tooltip:"Tracks how your brand mentions have changed over time across the same query set."}),y.jsx($a,{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:"Needs multiple analyses before info can be shown."}):y.jsx("div",{className:"yst-h-72",children:y.jsx(N$,{data:function(){var v={labels:h,datasets:[d==null?void 0:d.datasets]};return v}(),options:p})})]})})};function yl(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:Ce("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:Ce("yst-flex yst-items-center yst-gap-1 yst-text-tiny yst-font-bold",Yo(u)),children:[u>0?y.jsx(Qv,{}):u<0?y.jsx(Gv,{}):null,u>-1e-6&&"+",u]}),i&&y.jsx(vf,{id:"tooltip-".concat(r.replace(/\s+/g,"-").toLowerCase()),className:"yst-absolute yst-right-2 yst-top-2",position:f,children:i})]})}function W$(e){var t=e.children,n=e.className;return y.jsx("div",{className:Ce("yst-grid yst-w-full yst-grid-cols-2 yst-gap-0 yst-rounded-lg",n),children:t})}function V$(e){return e>0?"yst-text-green-600":e<0?"yst-text-red-600":"yst-text-slate-500"}function G$(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:Ce("yst-flex yst-items-center yst-gap-1 yst-text-tiny yst-font-bold",V$(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 oa(e){"@babel/helpers - typeof";return oa=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},oa(e)}function Q$(e,t){return Z$(e)||J$(e,t)||X$(e,t)||Y$()}function Y$(){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 X$(e,t){if(e){if(typeof e=="string")return bm(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)?bm(e,t):void 0}}function bm(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 J$(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 Z$(e){if(Array.isArray(e))return e}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 ml(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){eM(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 eM(e,t,n){return(t=tM(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tM(e){var t=nM(e,"string");return oa(t)=="symbol"?t:t+""}function nM(e,t){if(oa(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(oa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rM(){var e,t,n,r,i,s,o,a,l,c,u,d,f,h,g,m,p,v,b,w,C,x,k,S,_,O=En(),E=O.brandId,T=O.analysisId,D=_c(E,T,{query:{select:function(V){var Ee=V.data;return Ee},enabled:!!E&&!!T}}),G=D.data,N=D.isLoading,L=G==null||(e=G.analysis)===null||e===void 0?void 0:e.scans,M=Array.isArray(L)&&L.length>0?L.reduce(function(ze,V){if(!ze)return V;if(!(V!=null&&V.finishedAt)||!(ze!=null&&ze.finishedAt))return ze;var Ee=new Date(V.finishedAt),He=new Date(ze.finishedAt);return Ee>He?V:ze},void 0):void 0;M==null||(t=M.scores)===null||t===void 0||t.raw;var I=M==null||(n=M.scores)===null||n===void 0?void 0:n.standardized,oe=(r=M==null||(i=M.mentions)===null||i===void 0||(i=i.mentionedInNumberOfQueries)===null||i===void 0?void 0:i.value)!==null&&r!==void 0?r:0,ue=M==null||(s=M.mentions)===null||s===void 0||(s=s.mentionedInNumberOfQueries)===null||s===void 0||(s=s.previous)===null||s===void 0?void 0:s.difference,B=(o=M==null||(a=M.scores)===null||a===void 0||(a=a.standardized)===null||a===void 0||(a=a.citations)===null||a===void 0?void 0:a.value)!==null&&o!==void 0?o:0,J=(l=M==null||(c=M.citations)===null||c===void 0||(c=c.total)===null||c===void 0?void 0:c.value)!==null&&l!==void 0?l:0,ae=M==null||(u=M.citations)===null||u===void 0||(u=u.total)===null||u===void 0||(u=u.previous)===null||u===void 0?void 0:u.difference,ne=M==null||(d=M.rankings)===null||d===void 0||(d=d.list)===null||d===void 0?void 0:d.find(function(ze){var V;return((V=ze.brand)===null||V===void 0?void 0:V.isSelf)===!0}),R=(f=ne==null||(h=ne.rank)===null||h===void 0?void 0:h.value)!==null&&f!==void 0?f:null,Q=ne==null||(g=ne.rank)===null||g===void 0||(g=g.previous)===null||g===void 0?void 0:g.difference;Q&&(Q=Q*-1);var q=(m=I==null||(p=I.visibility)===null||p===void 0?void 0:p.value)!==null&&m!==void 0?m:0,ce=I==null||(v=I.visibility)===null||v===void 0||(v=v.previous)===null||v===void 0?void 0:v.value,W=(b=I==null||(w=I.ranking)===null||w===void 0?void 0:w.value)!==null&&b!==void 0?b:0,de=(C=I==null||(x=I.sentiment)===null||x===void 0?void 0:x.value)!==null&&C!==void 0?C:0,fe=(k=I==null||(S=I.mentions)===null||S===void 0?void 0:S.value)!==null&&k!==void 0?k:0,Le={labels:["Mentions","Ranking","Citations","Sentiment"],datasets:[{data:[fe,W,B,de],backgroundColor:B$,pointBackgroundColor:"rgba(166, 30, 105, 1)"}]},te=ml(ml({},Dd),{},{plugins:ml(ml({},Dd.plugins),{},{tooltip:{mode:"point",intersect:!0,callbacks:{label:function(V){var Ee=V.label||"",He=V.parsed.r||0;return"".concat(Ee,": ").concat(He,"%")}}}}),interaction:{mode:"point",intersect:!0},scales:{r:{beginAtZero:!0,min:0,max:100,ticks:{stepSize:20}}}}),et=z.useState(typeof window!="undefined"&&window.innerWidth<800?"top":"left"),_e=Q$(et,2),Ie=_e[0],Re=_e[1];return z.useEffect(function(){function ze(){Re(window.innerWidth<800?"top":"left")}return window.addEventListener("resize",ze),function(){return window.removeEventListener("resize",ze)}},[]),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($a,{score:q,total:100,isLoading:N}),y.jsx(G$,{current:q,previous:ce,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(F$,{data:Le,options:te}),y.jsx(vf,{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(W$,{children:[y.jsx(yl,{value:oe,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:ue,tooltipPosition:Ie}),y.jsx(yl,{value:R&&y.jsxs(y.Fragment,{children:[R,R===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:Q}),y.jsx(yl,{value:J,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:ae,tooltipPosition:Ie}),y.jsx(yl,{value:de?"".concat(de,"%"):"—%",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||(_=M.scores)===null||_===void 0||(_=_.standardized)===null||_===void 0||(_=_.sentiment)===null||_===void 0||(_=_.previous)===null||_===void 0?void 0:_.difference})]})})]})]})})}var Pu=function(){var t=En(),n=t.brandId,r=t.analysisId,i=Ri({query:{select:function(S){var _=S.data;return _==null?void 0:_.brands}}}),s=i.data,o=i.isLoading,a=Bv(n,{query:{enabled:!!n,select:function(S){var _=S.data;return _}}}),l=a.data,c=a.isLoading,u=_c(n,r,{query:{enabled:!!n&&!!r&&r!=="latest"&&typeof r=="string"&&r.length>0,select:function(S){var _=S.data;return _==null?void 0:_.analysis}}}),d=u.data,f=u.isLoading,h=(l==null?void 0:l.name)||"your brand",g=cE(l==null?void 0:l.nextScheduledAnalysis),m=d==null?void 0:d.status,p=function(){switch(m){case Jr.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:h}),". The analysis is scheduled to run on"," ",y.jsx("b",{className:"yst-font-medium",children:g}),". You'll see the results here once it's ready, and we'll also notify you by email."]})]}),alertVariant:"info"};case Jr.processing:return{alertContent:y.jsxs(y.Fragment,{children:["You've completed the setup for ",h,". The analysis is now processing. You'll see the results here once it's ready, and we'll also notify you by email."]}),alertVariant:"info"};case Jr.failed:return{alertContent:y.jsx(y.Fragment,{children:"Analysis failed. Try restarting the analysis or contact support if the issue persists."}),alertVariant:"danger"};case Jr.cancelled:return{alertContent:y.jsx(y.Fragment,{children:"Analysis was cancelled. You can restart the analysis when ready."}),alertVariant:"warning"};case Jr.completed:return{alertContent:null};default:return{alertContent:null,alertVariant:"info"}}}(),v=p.alertContent,b=p.alertVariant,w=o||c||f,C=s&&(s==null?void 0:s.length)>0,x=!w&&d&&m===Jr.completed;return C?y.jsxs("div",{className:"yst-space-y-8",children:[y.jsx(rP,{}),m!==Jr.completed&&v&&y.jsx(A.Alert,{className:"md:yst-col-span-2",variant:b,children:v}),x&&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:Wr,variant:"secondary",to:"/brands/".concat(n,"/brand-list"),className:Ce("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(rM,{}),y.jsx(iP,{}),y.jsx(U$,{}),y.jsx(yA,{}),y.jsx(cA,{}),y.jsx(GE,{}),y.jsx(mA,{})]})]})]}):y.jsx($E,{})};function Jb(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:Ce({"yst-mb-3":n||t}),children:r}),n&&y.jsx("p",{children:n}),t]})}var iM=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"})]})]})]})]})})},sM=function(){return y.jsxs(A.Card,{children:[y.jsx(Jb,{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(iM,{},t)})]})})]})},oM=z.lazy(function(){return Promise.resolve().then(()=>yR)}),aM=z.lazy(function(){return Promise.resolve().then(()=>zR)}),lM=z.lazy(function(){return Promise.resolve().then(()=>UR)}),cM=z.lazy(function(){return Promise.resolve().then(()=>iN)}),uM=z.lazy(function(){return Promise.resolve().then(()=>xN)}),dM=z.lazy(function(){return Promise.resolve().then(()=>CN)}),fM=new T2({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1,staleTime:1e3*60*5},mutations:{retry:!1}}}),ni=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"})]})})},hM=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(Iw,{children:y.jsxs(xt,{element:y.jsx(sE,{hideNav:r,disableLayout:s,DebugInfo:o}),children:[y.jsxs(xt,{path:"/",element:y.jsx(Ts,{}),children:[y.jsx(xt,{index:!0,element:y.jsx(Pu,{})}),y.jsxs(xt,{path:"brands/:brandId",element:y.jsx(mg,{}),children:[y.jsx(xt,{index:!0,element:y.jsx(Pu,{})}),y.jsx(xt,{path:"brand-list",element:y.jsx(z.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(oM,{})})}),y.jsx(xt,{path:"analysis/:analysisId",element:y.jsx(oE,{}),children:y.jsx(xt,{index:!0,element:y.jsx(Pu,{})})})]}),y.jsxs(xt,{path:"/setup",element:y.jsx(z.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(lM,{})}),children:[y.jsx(xt,{index:!0,element:y.jsx(z.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(cM,{})})}),y.jsxs(xt,{path:":brandId",element:y.jsx(mg,{}),children:[y.jsx(xt,{path:"queries",element:y.jsx(z.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(uM,{})})}),y.jsx(xt,{path:"analysis",element:y.jsx(z.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(dM,{})})})]})]})]}),y.jsx(xt,{path:"/settings",element:y.jsx(z.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(aM,{})})}),y.jsx(xt,{path:"/query-history",element:y.jsx(z.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(sM,{})})})]})})},gM=function(t){var n=t.DebugInfo,r=t.hostAppProps;return y.jsxs(L2,{client:fM,children:[y.jsx(cO,{hostAppProps:r,children:y.jsx(hM,{DebugInfo:n})}),y.jsx(SC,{initialIsOpen:!1})]})};function yM(e){var t=e.subpath,n=t===void 0?"/":t,r=e.onNavigate,i=gn(),s=Bt(),o=z.useRef(n),a=z.useRef(null),l=z.useRef(!1),c="".concat(s.pathname).concat(s.search).concat(s.hash),u=z.useCallback(r,[r]);return z.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]),z.useEffect(function(){l.current||c!==n&&c!==a.current&&(a.current=c,u(c))},[c,n,u]),null}function mM(e,t){return xM(e)||bM(e,t)||vM(e,t)||pM()}function pM(){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 vM(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 bM(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 xM(e){if(Array.isArray(e))return e}var wM=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=z.useState(!!(a||l)),w=mM(b,2),C=w[0],x=w[1],k={onAddSubscription:v,onLogout:m,onNavigate:h,DebugInfo:c,subpath:d};return z.useEffect(function(){l&&Dv(l),ik(typeof a!="function"?function(){return a}:a),x(!1)},[l,a]),C?y.jsx("div",{className:i,style:s,children:y.jsx(A.Spinner,{})}):y.jsx("div",{className:i,style:s,children:y.jsxs(Dw,{initialEntries:[d||"/"],children:[y.jsx(yM,{subpath:d,onNavigate:h}),y.jsx(A.Root,{context:{isRtl:r},children:y.jsx(gM,{DebugInfo:c,hostAppProps:k})})]})})},SM=e=>e!=null,CM=e=>e.filter(SM);function _M(e){return(...t)=>{for(const n of e)n&&n(...t)}}var Y=e=>typeof e=="function"&&!e.length?e():e,Ld=e=>Array.isArray(e)?e:e?[e]:[];function kM(e,...t){return typeof e=="function"?e(...t):e}var OM=we;function EM(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 AM(e){const[t,n]=re(),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=re(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&&dr(()=>{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),we(()=>globalThis.removeEventListener("storage",f))):(i.forEach(h=>{var g;return(g=h.addEventListener)==null?void 0:g.call(h,"storage",f)}),we(()=>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 Zb=AM,PM=e=>(typeof e.clear=="function"||(e.clear=()=>{let t;for(;t=e.key(0);)e.removeItem(t)}),e),Sm=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},nn=PM({_cookies:[globalThis.document,"cookie"],getItem:e=>{var t,n;return(n=(t=nn._cookies[0][nn._cookies[1]].match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)"))==null?void 0:t.pop())!=null?n:null},setItem:(e,t,n)=>{const r=nn.getItem(e);nn._cookies[0][nn._cookies[1]]=`${e}=${t}${Sm(n)}`;const i=Object.assign(new Event("storage"),{key:e,oldValue:r,newValue:t,url:globalThis.document.URL,storageArea:nn});window.dispatchEvent(i)},removeItem:e=>{nn._cookies[0][nn._cookies[1]]=`${e}=deleted${Sm({expires:new Date(0)})}`},key:e=>{let t=null,n=0;return nn._cookies[0][nn._cookies[1]].replace(/(?:^|;)\s*(.+?)\s*=\s*[^;]+/g,(r,i)=>(!t&&i&&n++===e&&(t=i),"")),t},get length(){let e=0;return nn._cookies[0][nn._cookies[1]].replace(/(?:^|;)\s*.+?\s*=\s*[^;]+/g,t=>(e+=t?1:0,"")),e}}),TM=1024,ji=796,If=700,jM="bottom-right",Id="bottom",e1="system",$M=!1,t1=500,MM=500,n1=500,DM=Object.keys(od)[0],Cm=1,LM=Object.keys(ad)[0],Rf=pt({client:void 0,onlineManager:void 0,queryFlavor:"",version:"",shadowDOMTarget:void 0});function ye(){return vt(Rf)}var r1=pt(void 0),i1=e=>{const[t,n]=re(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="",_S(l.document),l.document.title="TanStack Query Devtools",l.document.body.style.margin="0",l.addEventListener("pagehide",()=>{e.setLocalStore("pip_open","false"),n(null)}),[...(ye().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)}}),yc(["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||MM))}),be(()=>{const o=(ye().shadowDOMTarget||document).querySelector("#_goober"),a=t();if(o&&a){const l=new MutationObserver(()=>{const c=(ye().shadowDOMTarget||a.document).querySelector("#_goober");c&&(c.textContent=o.textContent)});l.observe(o,{childList:!0,subtree:!0,characterDataOldValue:!0}),we(()=>{l.disconnect()})}});const s=H(()=>{var o;return{pipWindow:t(),requestPipWindow:i,closePipWindow:r,disabled:(o=e.disabled)!=null?o:!1}});return j(r1.Provider,{value:s,get children(){return e.children}})},Nf=()=>H(()=>{const t=vt(r1);if(!t)throw new Error("usePiPWindow must be used within a PiPProvider");return t()}),Ff=pt(()=>"dark");function mt(){return vt(Ff)}var s1={À:"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"},IM=Object.keys(s1).join("|"),RM=new RegExp(IM,"g");function NM(e){return e.replace(RM,t=>s1[t])}var It={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function _m(e,t,n){var r;if(n=n||{},n.threshold=(r=n.threshold)!=null?r:It.MATCHES,!n.accessors){const o=km(e,t,n);return{rankedValue:e,rank:o,accessorIndex:-1,accessorThreshold:n.threshold,passed:o>=n.threshold}}const i=zM(e,n.accessors),s={rankedValue:e,rank:It.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let o=0;o<i.length;o++){const a=i[o];let l=km(a.itemValue,t,n);const{minRanking:c,maxRanking:u,threshold:d=n.threshold}=a.attributes;l<c&&l>=It.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 km(e,t,n){return e=Om(e,n),t=Om(t,n),t.length>e.length?It.NO_MATCH:e===t?It.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?It.EQUAL:e.startsWith(t)?It.STARTS_WITH:e.includes(` ${t}`)?It.WORD_STARTS_WITH:e.includes(t)?It.CONTAINS:t.length===1?It.NO_MATCH:FM(e).includes(t)?It.ACRONYM:BM(e,t))}function FM(e){let t="";return e.split(" ").forEach(r=>{r.split("-").forEach(s=>{t+=s.substr(0,1)})}),t}function BM(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 It.MATCHES+u*c}const o=i(t[0],e,0);if(o<0)return It.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 It.NO_MATCH}const a=r-o;return s(a)}function Om(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=NM(e)),e}function qM(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 zM(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const s=t[r],o=HM(s),a=qM(e,s);for(let l=0,c=a.length;l<c;l++)n.push({itemValue:a[l],attributes:o})}return n}var Em={maxRanking:1/0,minRanking:-1/0};function HM(e){return typeof e=="function"?Em:{...Em,...e}}var KM={data:""},UM=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||KM,WM=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,VM=/\/\*[^]*?\*\/| +/g,Am=/\n+/g,oi=(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"?oi(o,s):s+"{"+oi(o,s[1]=="k"?"":t)+"}":typeof o=="object"?r+=oi(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+=oi.p?oi.p(s,o):s+":"+o+";")}return n+(t&&i?t+"{"+i+"}":i)+r},Gn={},o1=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+o1(e[n]);return t}return e},GM=(e,t,n,r,i)=>{let s=o1(e),o=Gn[s]||(Gn[s]=(l=>{let c=0,u=11;for(;c<l.length;)u=101*u+l.charCodeAt(c++)>>>0;return"go"+u})(s));if(!Gn[o]){let l=s!==e?e:(c=>{let u,d,f=[{}];for(;u=WM.exec(c.replace(VM,""));)u[4]?f.shift():u[3]?(d=u[3].replace(Am," ").trim(),f.unshift(f[0][d]=f[0][d]||{})):f[0][u[1]]=u[2].replace(Am," ").trim();return f[0]})(e);Gn[o]=oi(i?{["@keyframes "+o]:l}:l,n?"":"."+o)}let a=n&&Gn.g?Gn.g:null;return n&&(Gn.g=Gn[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)})(Gn[o],t,r,a),o},QM=(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?"":oi(a,""):a===!1?"":a}return r+i+(o==null?"":o)},"");function Te(e){let t=this||{},n=e.call?e(t.p):e;return GM(n.unshift?n.raw?QM(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,UM(t.target),t.g,t.o,t.k)}Te.bind({g:1});Te.bind({k:1});function a1(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=a1(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function se(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=a1(e))&&(r&&(r+=" "),r+=t);return r}function YM(e,t){const n=ot(e),{onChange:r}=t;let i=new Set(t.appear?void 0:n);const s=new WeakSet,[o,a]=re([],{equals:!1}),[l]=tS(),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 H(d=>{const f=o(),h=e();if(h[fc],ot(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 ot(()=>{const g=new Set(h),m=h.slice(),p=[],v=[],b=[];for(const C of h)(i.has(C)?b:p).push(C);let w=!p.length;for(let C=0;C<d.length;C++){const x=d[C];g.has(x)||(s.has(x)||(v.push(x),s.add(x)),u(m,x,C)),w&&x!==m[C]&&(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 $t(...e){return _M(e)}var Pm=e=>e instanceof Element;function Rd(e,t){if(t(e))return e;if(typeof e=="function"&&!e.length)return Rd(e(),t);if(Array.isArray(e)){const n=[];for(const r of e){const i=Rd(r,t);i&&(Array.isArray(i)?n.push.apply(n,i):n.push(i))}return n.length?n:null}return null}function XM(e,t=Pm,n=Pm){const r=H(e),i=H(()=>Rd(r(),t));return i.toArray=()=>{const s=i();return Array.isArray(s)?s:s?[s]:[]},i}function JM(e){return H(()=>{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 l1(e){requestAnimationFrame(()=>requestAnimationFrame(e))}function ZM(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())}),l1(()=>{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 e4(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()),l1(()=>{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 Tm=e=>{const t=JM(e);return YM(XM(()=>e.children).toArray,{appear:e.appear,onChange({added:n,removed:r,finishRemoved:i,list:s}){const o=t();for(const l of n)ZM(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)e4(o,e,l,()=>i([l]))}})},Tu=Symbol("fallback");function jm(e){for(const t of e)t.dispose()}function t4(e,t,n,r={}){const i=new Map;return we(()=>jm(i.values())),()=>{const o=e()||[];return o[fc],ot(()=>{var u,d;if(!o.length)return jm(i.values()),i.clear(),r.fallback?[ar(h=>(i.set(Tu,{dispose:h}),r.fallback()))]:[];const a=new Array(o.length),l=i.get(Tu);if(!i.size||l){l==null||l.dispose(),i.delete(Tu);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){ar(u=>{const[d,f]=re(a),h={setItem:f,dispose:u};if(n.length>1){const[g,m]=re(l);h.setIndex=m,h.mapped=n(d,g)}else h.mapped=n(d);i.set(c,h),o[l]=h.mapped})}}function nc(e){const{by:t}=e;return H(t4(()=>e.each,typeof t=="function"?t:n=>n[t],e.children,"fallback"in e?{fallback:()=>e.fallback}:void 0))}function n4(e,t,n,r){return e.addEventListener(t,n,r),OM(e.removeEventListener.bind(e,t,n,r))}function r4(e,t,n,r){const i=()=>{Ld(Y(e)).forEach(s=>{s&&Ld(Y(t)).forEach(o=>n4(s,o,n,r))})};typeof e=="function"?be(i):ve(i)}function i4(e,t){const n=new ResizeObserver(e);return we(n.disconnect.bind(n)),{observe:r=>n.observe(r,t),unobserve:n.unobserve.bind(n)}}function c1(e,t,n){const r=new WeakMap,{observe:i,unobserve:s}=i4(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=CM(Ld(Y(e)));return EM(a,o,i,s),a},[])}var s4=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function $m(e){const t={};let n;for(;n=s4.exec(e);)t[n[1]]=n[2];return t}function Rc(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=$m(e)}else typeof t=="string"&&(t=$m(t));return{...e,...t}}function o4(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function Nd(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function a4(e){return typeof e=="number"}function Vi(e){return Object.prototype.toString.call(e)==="[object String]"}function l4(e){return typeof e=="function"}function Ra(e){return t=>`${e()}-${t}`}function un(e,t){return e?e===t||e.contains(t):!1}function Po(e,t=!1){const{activeElement:n}=qn(e);if(!(n!=null&&n.nodeName))return null;if(u1(n)&&n.contentDocument)return Po(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const i=qn(n).getElementById(r);if(i)return i}}return n}function c4(e){return qn(e).defaultView||window}function qn(e){return e?e.ownerDocument||e:document}function u1(e){return e.tagName==="IFRAME"}var Bf=(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))(Bf||{});function qf(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 Nc(){return qf(/^Mac/i)}function u4(){return qf(/^iPhone/i)}function d4(){return qf(/^iPad/i)||Nc()&&navigator.maxTouchPoints>1}function f4(){return u4()||d4()}function h4(){return Nc()||f4()}function tt(e,t){return t&&(l4(t)?t(e):t[0](t[1],e)),e==null?void 0:e.defaultPrevented}function gt(e){return t=>{for(const n of e)tt(t,n)}}function g4(e){return Nc()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function _t(e){if(e)if(y4())e.focus({preventScroll:!0});else{const t=m4(e);e.focus(),p4(t)}}var pl=null;function y4(){if(pl==null){pl=!1;try{document.createElement("div").focus({get preventScroll(){return pl=!0,!0}})}catch(e){}}return pl}function m4(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 p4(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var d1=["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'])"],v4=[...d1,'[tabindex]:not([tabindex="-1"]):not([disabled])'],zf=d1.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",b4=v4.join(':not([hidden]):not([tabindex="-1"]),');function f1(e,t){const r=Array.from(e.querySelectorAll(zf)).filter(Mm);return t&&Mm(e)&&r.unshift(e),r.forEach((i,s)=>{if(u1(i)&&i.contentDocument){const o=i.contentDocument.body,a=f1(o,!1);r.splice(s,1,...a)}}),r}function Mm(e){return h1(e)&&!x4(e)}function h1(e){return e.matches(zf)&&Hf(e)}function x4(e){return parseInt(e.getAttribute("tabindex")||"0",10)<0}function Hf(e,t){return e.nodeName!=="#comment"&&w4(e)&&S4(e,t)&&(!e.parentElement||Hf(e.parentElement,e))}function w4(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 S4(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function C4(e,t,n){const r=t!=null&&t.tabbable?b4:zf,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)&&Hf(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 Dm(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 k4(){}function O4(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 Fe(e,t){return Oe(e,t)}var yo=new Map,Lm=new Set;function Im(){if(typeof window=="undefined")return;const e=n=>{if(!n.target)return;let r=yo.get(n.target);r||(r=new Set,yo.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=yo.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),yo.delete(n.target)),yo.size===0)){for(const i of Lm)i();Lm.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document!="undefined"&&(document.readyState!=="loading"?Im():document.addEventListener("DOMContentLoaded",Im));function Fd(e,t){const n=Rm(e,t,"left"),r=Rm(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 Rm(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 E4(e,t){var n,r;if(document.contains(e)){const i=document.scrollingElement||document.documentElement;if(window.getComputedStyle(i).overflow==="hidden"){let o=Dm(e);for(;e&&o&&e!==i&&o!==i;)Fd(o,e),e=o,o=Dm(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 g1={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 dn(e){return t=>(e(t),()=>e(void 0))}function Fc(e,t){const[n,r]=re(Nm(t==null?void 0:t()));return be(()=>{var i;r(((i=e())==null?void 0:i.tagName.toLowerCase())||Nm(t==null?void 0:t()))}),n}function Nm(e){return Vi(e)?e:void 0}function it(e){const[t,n]=Ve(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return j(LS,Oe(n,{get component(){return t.as}}))}var A4=["id","name","validationState","required","disabled","readOnly"];function P4(e){const t=`form-control-${yn()}`,n=Fe({id:t},e),[r,i]=re(),[s,o]=re(),[a,l]=re(),[c,u]=re(),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=H(()=>({"data-valid":Y(n.validationState)==="valid"?"":void 0,"data-invalid":Y(n.validationState)==="invalid"?"":void 0,"data-required":Y(n.required)?"":void 0,"data-disabled":Y(n.disabled)?"":void 0,"data-readonly":Y(n.readOnly)?"":void 0}));return{formControlContext:{name:()=>{var m;return(m=Y(n.name))!=null?m:Y(n.id)},dataset:h,validationState:()=>Y(n.validationState),isRequired:()=>Y(n.required),isDisabled:()=>Y(n.disabled),isReadOnly:()=>Y(n.readOnly),labelId:r,fieldId:s,descriptionId:a,errorMessageId:c,getAriaLabelledBy:d,getAriaDescribedBy:f,generateId:Ra(()=>Y(n.id)),registerLabel:dn(i),registerField:dn(o),registerDescription:dn(l),registerErrorMessage:dn(u)}}}var y1=pt();function Na(){const e=vt(y1);if(e===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function m1(e){const t=Na(),n=Fe({id:t.generateId("description")},e);return be(()=>we(t.registerDescription(n.id))),j(it,Oe({as:"div"},()=>t.dataset(),n))}function p1(e){const t=Na(),n=Fe({id:t.generateId("error-message")},e),[r,i]=Ve(n,["forceMount"]),s=()=>t.validationState()==="invalid";return be(()=>{s()&&we(t.registerErrorMessage(i.id))}),j(pe,{get when(){return r.forceMount||s()},get children(){return j(it,Oe({as:"div"},()=>t.dataset(),i))}})}function T4(e){let t;const n=Na(),r=Fe({id:n.generateId("label")},e),[i,s]=Ve(r,["ref"]),o=Fc(()=>t,()=>"label");return be(()=>we(n.registerLabel(s.id))),j(it,Oe({as:"label",ref(a){const l=$t(c=>t=c,i.ref);typeof l=="function"&&l(a)},get for(){return H(()=>o()==="label")()?n.fieldId():void 0}},()=>n.dataset(),s))}function j4(e,t){be(ur(e,n=>{if(n==null)return;const r=$4(n);r!=null&&(r.addEventListener("reset",t,{passive:!0}),we(()=>{r.removeEventListener("reset",t)}))}))}function $4(e){return M4(e)?e.form:e.closest("form")}function M4(e){return e.matches("textarea, input, select, button")}function Fa(e){var o;const[t,n]=re((o=e.defaultValue)==null?void 0:o.call(e)),r=H(()=>{var a;return((a=e.value)==null?void 0:a.call(e))!==void 0}),i=H(()=>{var a;return r()?(a=e.value)==null?void 0:a.call(e):t()});return[i,a=>{ot(()=>{var c;const l=kM(a,i());return Object.is(l,i())||(r()||n(l),(c=e.onChange)==null||c.call(e,l)),l})}]}function v1(e){const[t,n]=Fa(e);return[()=>{var i;return(i=t())!=null?i:!1},n]}function D4(e){const[t,n]=Fa(e);return[()=>{var i;return(i=t())!=null?i:[]},n]}function L4(e={}){const[t,n]=v1({value:()=>Y(e.isSelected),defaultValue:()=>!!Y(e.defaultIsSelected),onChange:s=>{var o;return(o=e.onSelectedChange)==null?void 0:o.call(e,s)}});return{isSelected:t,setIsSelected:s=>{!Y(e.isReadOnly)&&!Y(e.isDisabled)&&n(s)},toggle:()=>{!Y(e.isReadOnly)&&!Y(e.isDisabled)&&n(!t())}}}var I4=Object.defineProperty,Bc=(e,t)=>{for(var n in t)I4(e,n,{get:t[n],enumerable:!0})},b1=pt();function x1(){return vt(b1)}function R4(){const e=x1();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function w1(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function N4(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&&w1(s,n))return r+1}return 0}function F4(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:w1(a,l)?(r>s&&(n=!0),-1):(r<s&&(n=!0),1)}),n?t.map(([r,i])=>i):e}function S1(e,t){const n=F4(e);e!==n&&t(n)}function B4(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 qn(r).body}function q4(e,t){be(()=>{const n=setTimeout(()=>{S1(e(),t)});we(()=>clearTimeout(n))})}function z4(e,t){if(typeof IntersectionObserver!="function"){q4(e,t);return}let n=[];be(()=>{const r=()=>{const o=!!n.length;n=e(),o&&S1(e(),t)},i=B4(e()),s=new IntersectionObserver(r,{root:i});for(const o of e()){const a=o.ref();a&&s.observe(a)}we(()=>s.disconnect())})}function H4(e={}){const[t,n]=D4({value:()=>Y(e.items),onChange:s=>{var o;return(o=e.onItemsChange)==null?void 0:o.call(e,s)}});z4(t,n);const r=s=>(n(o=>{const a=N4(o,s);return o4(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(b1.Provider,{value:{registerItem:r},get children(){return s.children}})}}function K4(e){const t=R4(),n=Fe({shouldRegisterItem:!0},e);be(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());we(r)})}function C1(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=Vi(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=Vi(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=Vi(f)?d[f]:f(d))!=null?g:!1},a=d=>{var f;if(d!=null)return Vi(e.getSectionChildren)?d[e.getSectionChildren]:(f=e.getSectionChildren)==null?void 0:f.call(e,d)};for(const d of e.dataSource){if(Vi(d)||a4(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=C1({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 U4(e,t=[]){return H(()=>{const n=C1({dataSource:Y(e.dataSource),getKey:Y(e.getKey),getTextValue:Y(e.getTextValue),getDisabled:Y(e.getDisabled),getSectionChildren:Y(e.getSectionChildren)});for(let r=0;r<t.length;r++)t[r]();return e.factory(n)})}var W4=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),V4=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function G4(e){var n;if(Intl.Locale){const r=(n=new Intl.Locale(e).maximize().script)!=null?n:"";return W4.has(r)}const t=e.split("-")[0];return V4.has(t)}function Q4(e){return G4(e)?"rtl":"ltr"}function _1(){let e=typeof navigator!="undefined"&&(navigator.language||navigator.userLanguage)||"en-US";return{locale:e,direction:Q4(e)}}var Bd=_1(),To=new Set;function Fm(){Bd=_1();for(const e of To)e(Bd)}function Y4(){const[e,t]=re(Bd),n=H(()=>e());return dr(()=>{To.size===0&&window.addEventListener("languagechange",Fm),To.add(t),we(()=>{To.delete(t),To.size===0&&window.removeEventListener("languagechange",Fm)})}),{locale:()=>n().locale,direction:()=>n().direction}}var X4=pt();function Qr(){const e=Y4();return vt(X4)||e}var ju=new Map;function J4(e){const{locale:t}=Qr(),n=H(()=>t()+(e?Object.entries(e).sort((r,i)=>r[0]<i[0]?-1:1).join():""));return H(()=>{const r=n();let i;return ju.has(r)&&(i=ju.get(r)),i||(i=new Intl.Collator(t(),e),ju.set(r,i)),i})}var Zn=class k1 extends Set{constructor(n,r,i){super(n);me(this,"anchorKey");me(this,"currentKey");n instanceof k1?(this.anchorKey=r||n.anchorKey,this.currentKey=i||n.currentKey):(this.anchorKey=r,this.currentKey=i)}};function Z4(e){const[t,n]=Fa(e);return[()=>{var i;return(i=t())!=null?i:new Zn},n]}function O1(e){return h4()?e.altKey:e.ctrlKey}function Gi(e){return Nc()?e.metaKey:e.ctrlKey}function Bm(e){return new Zn(e)}function eD(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function tD(e){const t=Fe({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=re(!1),[i,s]=re(),o=H(()=>{const m=Y(t.selectedKeys);return m!=null?Bm(m):m}),a=H(()=>{const m=Y(t.defaultSelectedKeys);return m!=null?Bm(m):new Zn}),[l,c]=Z4({value:o,defaultValue:a,onChange:m=>{var p;return(p=t.onSelectionChange)==null?void 0:p.call(t,m)}}),[u,d]=re(Y(t.selectionBehavior)),f=()=>Y(t.selectionMode),h=()=>{var m;return(m=Y(t.disallowEmptySelection))!=null?m:!1},g=m=>{(Y(t.allowDuplicateSelectionEvents)||!eD(m,l()))&&c(m)};return be(()=>{const m=l();Y(t.selectionBehavior)==="replace"&&u()==="toggle"&&typeof m=="object"&&m.size===0&&d("replace")}),be(()=>{var m;d((m=Y(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 nD(e){const[t,n]=re(""),[r,i]=re(-1);return{typeSelectHandlers:{onKeyDown:o=>{var f,h,g;if(Y(e.isDisabled))return;const a=Y(e.keyboardDelegate),l=Y(e.selectionManager);if(!a.getKeyForSearch)return;const c=rD(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&&iD(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 rD(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function iD(e){return e.split("").every(t=>t===e[0])}function sD(e,t,n){const i=Oe({selectOnFocus:()=>Y(e.selectionManager).selectionBehavior()==="replace"},e),s=()=>t(),{direction:o}=Qr();let a={top:0,left:0};r4(()=>Y(i.isVirtualized)?void 0:s(),"scroll",()=>{const p=s();p&&(a={top:p.scrollTop,left:p.scrollLeft})});const{typeSelectHandlers:l}=nD({isDisabled:()=>Y(i.disallowTypeAhead),keyboardDelegate:()=>Y(i.keyboardDelegate),selectionManager:()=>Y(i.selectionManager)}),c=()=>{var p;return(p=Y(i.orientation))!=null?p:"vertical"},u=p=>{var _,O,E,T,D,G,N,L;tt(p,l.onKeyDown),p.altKey&&p.key==="Tab"&&p.preventDefault();const v=t();if(!(v!=null&&v.contains(p.target)))return;const b=Y(i.selectionManager),w=Y(i.selectOnFocus),C=M=>{M!=null&&(b.setFocusedKey(M),p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(M):w&&!O1(p)&&b.replaceSelection(M))},x=Y(i.keyboardDelegate),k=Y(i.shouldFocusWrap),S=b.focusedKey();switch(p.key){case(c()==="vertical"?"ArrowDown":"ArrowRight"):{if(x.getKeyBelow){p.preventDefault();let M;S!=null?M=x.getKeyBelow(S):M=(_=x.getFirstKey)==null?void 0:_.call(x),M==null&&k&&(M=(O=x.getFirstKey)==null?void 0:O.call(x,S)),C(M)}break}case(c()==="vertical"?"ArrowUp":"ArrowLeft"):{if(x.getKeyAbove){p.preventDefault();let M;S!=null?M=x.getKeyAbove(S):M=(E=x.getLastKey)==null?void 0:E.call(x),M==null&&k&&(M=(T=x.getLastKey)==null?void 0:T.call(x,S)),C(M)}break}case(c()==="vertical"?"ArrowLeft":"ArrowUp"):{if(x.getKeyLeftOf){p.preventDefault();const M=o()==="rtl";let I;S!=null?I=x.getKeyLeftOf(S):I=M?(D=x.getFirstKey)==null?void 0:D.call(x):(G=x.getLastKey)==null?void 0:G.call(x),C(I)}break}case(c()==="vertical"?"ArrowRight":"ArrowDown"):{if(x.getKeyRightOf){p.preventDefault();const M=o()==="rtl";let I;S!=null?I=x.getKeyRightOf(S):I=M?(N=x.getLastKey)==null?void 0:N.call(x):(L=x.getFirstKey)==null?void 0:L.call(x),C(I)}break}case"Home":if(x.getFirstKey){p.preventDefault();const M=x.getFirstKey(S,Gi(p));M!=null&&(b.setFocusedKey(M),Gi(p)&&p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(M):w&&b.replaceSelection(M))}break;case"End":if(x.getLastKey){p.preventDefault();const M=x.getLastKey(S,Gi(p));M!=null&&(b.setFocusedKey(M),Gi(p)&&p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(M):w&&b.replaceSelection(M))}break;case"PageDown":if(x.getKeyPageBelow&&S!=null){p.preventDefault();const M=x.getKeyPageBelow(S);C(M)}break;case"PageUp":if(x.getKeyPageAbove&&S!=null){p.preventDefault();const M=x.getKeyPageAbove(S);C(M)}break;case"a":Gi(p)&&b.selectionMode()==="multiple"&&Y(i.disallowSelectAll)!==!0&&(p.preventDefault(),b.selectAll());break;case"Escape":p.defaultPrevented||(p.preventDefault(),Y(i.disallowEmptySelection)||b.clearSelection());break;case"Tab":if(!Y(i.allowsTabNavigation)){if(p.shiftKey)v.focus();else{const M=C4(v,{tabbable:!0});let I,oe;do oe=M.lastChild(),oe&&(I=oe);while(oe);I&&!I.contains(document.activeElement)&&_t(I)}break}}},d=p=>{var C,x,k,S;const v=Y(i.selectionManager),b=Y(i.keyboardDelegate),w=Y(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))},O=p.relatedTarget;O&&p.currentTarget.compareDocumentPosition(O)&Node.DOCUMENT_POSITION_FOLLOWING?_((x=v.lastSelectedKey())!=null?x:(C=b.getLastKey)==null?void 0:C.call(b)):_((S=v.firstSelectedKey())!=null?S:(k=b.getFirstKey)==null?void 0:k.call(b))}else if(!Y(i.isVirtualized)){const _=s();if(_){_.scrollTop=a.top,_.scrollLeft=a.left;const O=_.querySelector(`[data-key="${v.focusedKey()}"]`);O&&(_t(O),Fd(_,O))}}}},f=p=>{const v=Y(i.selectionManager);p.currentTarget.contains(p.relatedTarget)||v.setFocused(!1)},h=p=>{s()===p.target&&p.preventDefault()},g=()=>{var k,S;const p=Y(i.autoFocus);if(!p)return;const v=Y(i.selectionManager),b=Y(i.keyboardDelegate);let w;p==="first"&&(w=(k=b.getFirstKey)==null?void 0:k.call(b)),p==="last"&&(w=(S=b.getLastKey)==null?void 0:S.call(b));const C=v.selectedKeys();C.size&&(w=C.values().next().value),v.setFocused(!0),v.setFocusedKey(w);const x=t();x&&w==null&&!Y(i.shouldUseVirtualFocus)&&_t(x)};return dr(()=>{i.deferAutoFocus?setTimeout(g,0):g()}),be(ur([s,()=>Y(i.isVirtualized),()=>Y(i.selectionManager).focusedKey()],p=>{var C;const[v,b,w]=p;if(b)w&&((C=i.scrollToKey)==null||C.call(i,w));else if(w&&v){const x=v.querySelector(`[data-key="${w}"]`);x&&Fd(v,x)}})),{tabIndex:H(()=>{if(!Y(i.shouldUseVirtualFocus))return Y(i.selectionManager).focusedKey()==null?0:-1}),onKeyDown:u,onMouseDown:h,onFocusIn:d,onFocusOut:f}}function E1(e,t){const n=()=>Y(e.selectionManager),r=()=>Y(e.key),i=()=>Y(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"||Gi(b)||"pointerType"in b&&b.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},o=()=>n().isSelected(r()),a=()=>Y(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&&!Y(e.shouldSelectOnPressUp)&&s(b))},d=b=>{l()&&b.pointerType==="mouse"&&b.button===0&&Y(e.shouldSelectOnPressUp)&&Y(e.allowsDifferentPressOrigin)&&s(b)},f=b=>{l()&&(Y(e.shouldSelectOnPressUp)&&!Y(e.allowsDifferentPressOrigin)||c!=="mouse")&&s(b)},h=b=>{!l()||!["Enter"," "].includes(b.key)||(O1(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=H(()=>{if(!(i()||a()))return r()===n().focusedKey()?0:-1}),v=H(()=>Y(e.virtualized)?void 0:r());return be(ur([t,r,i,()=>n().focusedKey(),()=>n().isFocused()],([b,w,C,x,k])=>{b&&w===x&&k&&!C&&document.activeElement!==b&&(e.focus?e.focus():_t(b))})),{isSelected:o,isDisabled:a,allowsSelection:l,tabIndex:p,dataKey:v,onPointerDown:u,onPointerUp:d,onClick:f,onKeyDown:h,onMouseDown:g,onFocus:m}}var oD=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 Zn(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 Zn(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 Zn([t],t,t):new Zn;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode()==="none")return;const t=new Zn;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 Zn)}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}},qm=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 aD(e){const t=tD(e),r=U4({dataSource:()=>Y(e.dataSource),getKey:()=>Y(e.getKey),getTextValue:()=>Y(e.getTextValue),getDisabled:()=>Y(e.getDisabled),getSectionChildren:()=>Y(e.getSectionChildren),factory:s=>e.filter?new qm(e.filter(s)):new qm(s)},[()=>e.filter]),i=new oD(r,t);return P0(()=>{const s=t.focusedKey();s!=null&&!r().getItem(s)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>i}}var Ct=e=>typeof e=="function"?e():e,lD=e=>{const t=H(()=>{const o=Ct(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]=re(Ct(e.show)?"present":"hidden");let s="none";return be(o=>{const a=Ct(e.show);return ot(()=>{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=Ct(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),we(()=>{o.removeEventListener("animationstart",a),o.removeEventListener("animationcancel",l),o.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r}},cD=lD,A1=cD,rc="data-kb-top-layer",P1,qd=!1,fr=[];function aa(e){return fr.findIndex(t=>t.node===e)}function uD(e){return fr[aa(e)]}function dD(e){return fr[fr.length-1].node===e}function T1(){return fr.filter(e=>e.isPointerBlocking)}function fD(){return[...T1()].slice(-1)[0]}function Kf(){return T1().length>0}function j1(e){var n;const t=aa((n=fD())==null?void 0:n.node);return aa(e)<t}function hD(e){fr.push(e)}function gD(e){const t=aa(e);t<0||fr.splice(t,1)}function yD(){for(const{node:e}of fr)e.style.pointerEvents=j1(e)?"none":"auto"}function mD(e){if(Kf()&&!qd){const t=qn(e);P1=document.body.style.pointerEvents,t.body.style.pointerEvents="none",qd=!0}}function pD(e){if(Kf())return;const t=qn(e);t.body.style.pointerEvents=P1,t.body.style.length===0&&t.body.removeAttribute("style"),qd=!1}var Ht={layers:fr,isTopMostLayer:dD,hasPointerBlockingLayer:Kf,isBelowPointerBlockingLayer:j1,addLayer:hD,removeLayer:gD,indexOf:aa,find:uD,assignPointerEventToLayers:yD,disableBodyPointerEvents:mD,restoreBodyPointerEvents:pD},vD={};Bc(vD,{Button:()=>wD,Root:()=>Uf});var bD=["button","color","file","image","reset","submit"];function xD(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?bD.indexOf(e.type)!==-1:!1}function Uf(e){let t;const n=Fe({type:"button"},e),[r,i]=Ve(n,["ref","type","disabled"]),s=Fc(()=>t,()=>"button"),o=H(()=>{const c=s();return c==null?!1:xD({tagName:c,type:r.type})}),a=H(()=>s()==="input"),l=H(()=>s()==="a"&&(t==null?void 0:t.getAttribute("href"))!=null);return j(it,Oe({as:"button",ref(c){const u=$t(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 wD=Uf,SD=["top","right","bottom","left"],Fn=Math.min,Yt=Math.max,ic=Math.round,vl=Math.floor,Hr=e=>({x:e,y:e}),CD={left:"right",right:"left",bottom:"top",top:"bottom"},_D={start:"end",end:"start"};function zd(e,t,n){return Yt(e,Fn(t,n))}function Fi(e,t){return typeof e=="function"?e(t):e}function Kr(e){return e.split("-")[0]}function Vs(e){return e.split("-")[1]}function $1(e){return e==="x"?"y":"x"}function Wf(e){return e==="y"?"height":"width"}function $i(e){return["top","bottom"].includes(Kr(e))?"y":"x"}function Vf(e){return $1($i(e))}function kD(e,t,n){n===void 0&&(n=!1);const r=Vs(e),i=Vf(e),s=Wf(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=sc(o)),[o,sc(o)]}function OD(e){const t=sc(e);return[Hd(e),t,Hd(t)]}function Hd(e){return e.replace(/start|end/g,t=>_D[t])}function ED(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 AD(e,t,n,r){const i=Vs(e);let s=ED(Kr(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(Hd)))),s}function sc(e){return e.replace(/left|right|bottom|top/g,t=>CD[t])}function PD(e){return{top:0,right:0,bottom:0,left:0,...e}}function M1(e){return typeof e!="number"?PD(e):{top:e,right:e,bottom:e,left:e}}function oc(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 zm(e,t,n){let{reference:r,floating:i}=e;const s=$i(t),o=Vf(t),a=Wf(o),l=Kr(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(Vs(t)){case"start":h[o]-=f*(n&&c?-1:1);break;case"end":h[o]+=f*(n&&c?-1:1);break}return h}var TD=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}=zm(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:C,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],...C}},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}=zm(c,f,l)),m=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:h}};async function la(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}=Fi(t,e),g=M1(h),p=a[f?d==="floating"?"reference":"floating":d],v=oc(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)),C=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=oc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:w,strategy:l}):b);return{top:(v.top-x.top+g.top)/C.y,bottom:(x.bottom-v.bottom+g.bottom)/C.y,left:(v.left-x.left+g.left)/C.x,right:(x.right-v.right+g.right)/C.x}}var jD=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}=Fi(e,t)||{};if(c==null)return{};const d=M1(u),f={x:n,y:r},h=Vf(i),g=Wf(h),m=await o.getDimensions(c),p=h==="y",v=p?"top":"left",b=p?"bottom":"right",w=p?"clientHeight":"clientWidth",C=s.reference[g]+s.reference[h]-f[h]-s.floating[g],x=f[h]-s.reference[h],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let S=k?k[w]:0;(!S||!await(o.isElement==null?void 0:o.isElement(k)))&&(S=a.floating[w]||s.floating[g]);const _=C/2-x/2,O=S/2-m[g]/2-1,E=Fn(d[v],O),T=Fn(d[b],O),D=E,G=S-m[g]-T,N=S/2-m[g]/2+_,L=zd(D,N,G),M=!l.arrow&&Vs(i)!=null&&N!==L&&s.reference[g]/2-(N<D?E:T)-m[g]/2<0,I=M?N<D?N-D:N-G:0;return{[h]:f[h]+I,data:{[h]:L,centerOffset:N-L-I,...M&&{alignmentOffset:I}},reset:M}}}),$D=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}=Fi(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=Kr(i),b=$i(a),w=Kr(a)===a,C=await(l.isRTL==null?void 0:l.isRTL(c.floating)),x=f||(w||!m?[sc(a)]:OD(a)),k=g!=="none";!f&&k&&x.push(...AD(a,m,g,C));const S=[a,...x],_=await la(t,p),O=[];let E=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&O.push(_[v]),d){const N=kD(i,o,C);O.push(_[N[0]],_[N[1]])}if(E=[...E,{placement:i,overflows:O}],!O.every(N=>N<=0)){var T,D;const N=(((T=s.flip)==null?void 0:T.index)||0)+1,L=S[N];if(L)return{data:{index:N,overflows:E},reset:{placement:L}};let M=(D=E.filter(I=>I.overflows[0]<=0).sort((I,oe)=>I.overflows[1]-oe.overflows[1])[0])==null?void 0:D.placement;if(!M)switch(h){case"bestFit":{var G;const I=(G=E.filter(oe=>{if(k){const ue=$i(oe.placement);return ue===b||ue==="y"}return!0}).map(oe=>[oe.placement,oe.overflows.filter(ue=>ue>0).reduce((ue,B)=>ue+B,0)]).sort((oe,ue)=>oe[1]-ue[1])[0])==null?void 0:G[0];I&&(M=I);break}case"initialPlacement":M=a;break}if(i!==M)return{reset:{placement:M}}}return{}}}};function Hm(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Km(e){return SD.some(t=>e[t]>=0)}var MD=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Fi(e,t);switch(r){case"referenceHidden":{const s=await la(t,{...i,elementContext:"reference"}),o=Hm(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Km(o)}}}case"escaped":{const s=await la(t,{...i,altBoundary:!0}),o=Hm(s,n.floating);return{data:{escapedOffsets:o,escaped:Km(o)}}}default:return{}}}}};async function DD(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Kr(n),a=Vs(n),l=$i(n)==="y",c=["left","top"].includes(o)?-1:1,u=s&&l?-1:1,d=Fi(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 LD=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 DD(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}}}}},ID=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}=Fi(e,t),c={x:n,y:r},u=await la(t,l),d=$i(Kr(i)),f=$1(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=zd(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=zd(b,g,w)}const m=a.fn({...t,[f]:h,[d]:g});return{...m,data:{x:m.x-n,y:m.y-r}}}}},RD=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}=Fi(e,t),l=await la(t,a),c=Kr(n),u=Vs(n),d=$i(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=Fn(h-l[g],p),w=Fn(f-l[m],v),C=!t.middlewareData.shift;let x=b,k=w;if(d?k=u||C?Fn(w,v):v:x=u||C?Fn(b,p):p,C&&!u){const _=Yt(l.left,0),O=Yt(l.right,0),E=Yt(l.top,0),T=Yt(l.bottom,0);d?k=f-2*(_!==0||O!==0?_+O:Yt(l.left,l.right)):x=h-2*(E!==0||T!==0?E+T:Yt(l.top,l.bottom))}await o({...t,availableWidth:k,availableHeight:x});const S=await i.getDimensions(s.floating);return f!==S.width||h!==S.height?{reset:{rects:!0}}:{}}}};function Gs(e){return D1(e)?(e.nodeName||"").toLowerCase():"#document"}function Zt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yr(e){var t;return(t=(D1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function D1(e){return e instanceof Node||e instanceof Zt(e).Node}function Cn(e){return e instanceof Element||e instanceof Zt(e).Element}function zn(e){return e instanceof HTMLElement||e instanceof Zt(e).HTMLElement}function Um(e){return typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof Zt(e).ShadowRoot}function Ba(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=_n(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function ND(e){return["table","td","th"].includes(Gs(e))}function qc(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(n){return!1}})}function Gf(e){const t=Qf(),n=Cn(e)?_n(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 FD(e){let t=Ur(e);for(;zn(t)&&!Rs(t);){if(Gf(t))return t;if(qc(t))return null;t=Ur(t)}return null}function Qf(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Rs(e){return["html","body","#document"].includes(Gs(e))}function _n(e){return Zt(e).getComputedStyle(e)}function zc(e){return Cn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ur(e){if(Gs(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Um(e)&&e.host||yr(e);return Um(t)?t.host:t}function L1(e){const t=Ur(e);return Rs(t)?e.ownerDocument?e.ownerDocument.body:e.body:zn(t)&&Ba(t)?t:L1(t)}function ca(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=L1(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=Zt(i);return s?t.concat(o,o.visualViewport||[],Ba(i)?i:[],o.frameElement&&n?ca(o.frameElement):[]):t.concat(i,ca(i,[],n))}function I1(e){const t=_n(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=zn(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,a=ic(n)!==s||ic(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function Yf(e){return Cn(e)?e:e.contextElement}function ts(e){const t=Yf(e);if(!zn(t))return Hr(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=I1(t);let o=(s?ic(n.width):n.width)/r,a=(s?ic(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}var BD=Hr(0);function R1(e){const t=Zt(e);return!Qf()||!t.visualViewport?BD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function qD(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Zt(e)?!1:t}function Mi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=Yf(e);let o=Hr(1);t&&(r?Cn(r)&&(o=ts(r)):o=ts(e));const a=qD(s,n,r)?R1(s):Hr(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=Zt(s),h=r&&Cn(r)?Zt(r):r;let g=f,m=g.frameElement;for(;m&&r&&h!==g;){const p=ts(m),v=m.getBoundingClientRect(),b=_n(m),w=v.left+(m.clientLeft+parseFloat(b.paddingLeft))*p.x,C=v.top+(m.clientTop+parseFloat(b.paddingTop))*p.y;l*=p.x,c*=p.y,u*=p.x,d*=p.y,l+=w,c+=C,g=Zt(m),m=g.frameElement}}return oc({width:u,height:d,x:l,y:c})}function zD(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",o=yr(r),a=t?qc(t.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=Hr(1);const u=Hr(0),d=zn(r);if((d||!d&&!s)&&((Gs(r)!=="body"||Ba(o))&&(l=zc(r)),zn(r))){const f=Mi(r);c=ts(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 HD(e){return Array.from(e.getClientRects())}function N1(e){return Mi(yr(e)).left+zc(e).scrollLeft}function KD(e){const t=yr(e),n=zc(e),r=e.ownerDocument.body,i=Yt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Yt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+N1(e);const a=-n.scrollTop;return _n(r).direction==="rtl"&&(o+=Yt(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function UD(e,t){const n=Zt(e),r=yr(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=Qf();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function WD(e,t){const n=Mi(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=zn(e)?ts(e):Hr(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 Wm(e,t,n){let r;if(t==="viewport")r=UD(e,n);else if(t==="document")r=KD(yr(e));else if(Cn(t))r=WD(t,n);else{const i=R1(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return oc(r)}function F1(e,t){const n=Ur(e);return n===t||!Cn(n)||Rs(n)?!1:_n(n).position==="fixed"||F1(n,t)}function VD(e,t){const n=t.get(e);if(n)return n;let r=ca(e,[],!1).filter(a=>Cn(a)&&Gs(a)!=="body"),i=null;const s=_n(e).position==="fixed";let o=s?Ur(e):e;for(;Cn(o)&&!Rs(o);){const a=_n(o),l=Gf(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Ba(o)&&!l&&F1(e,o))?r=r.filter(u=>u!==o):i=a,o=Ur(o)}return t.set(e,r),r}function GD(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?qc(t)?[]:VD(t,this._c):[].concat(n),r],a=o[0],l=o.reduce((c,u)=>{const d=Wm(t,u,i);return c.top=Yt(d.top,c.top),c.right=Fn(d.right,c.right),c.bottom=Fn(d.bottom,c.bottom),c.left=Yt(d.left,c.left),c},Wm(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function QD(e){const{width:t,height:n}=I1(e);return{width:t,height:n}}function YD(e,t,n){const r=zn(t),i=yr(t),s=n==="fixed",o=Mi(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=Hr(0);if(r||!r&&!s)if((Gs(t)!=="body"||Ba(i))&&(a=zc(t)),r){const d=Mi(t,!0,s,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&(l.x=N1(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 $u(e){return _n(e).position==="static"}function Vm(e,t){return!zn(e)||_n(e).position==="fixed"?null:t?t(e):e.offsetParent}function B1(e,t){const n=Zt(e);if(qc(e))return n;if(!zn(e)){let i=Ur(e);for(;i&&!Rs(i);){if(Cn(i)&&!$u(i))return i;i=Ur(i)}return n}let r=Vm(e,t);for(;r&&ND(r)&&$u(r);)r=Vm(r,t);return r&&Rs(r)&&$u(r)&&!Gf(r)?n:r||FD(e)||n}var XD=async function(e){const t=this.getOffsetParent||B1,n=this.getDimensions,r=await n(e.floating);return{reference:YD(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function JD(e){return _n(e).direction==="rtl"}var q1={convertOffsetParentRelativeRectToViewportRelativeRect:zD,getDocumentElement:yr,getClippingRect:GD,getOffsetParent:B1,getElementRects:XD,getClientRects:HD,getDimensions:QD,getScale:ts,isElement:Cn,isRTL:JD};function ZD(e,t){let n=null,r;const i=yr(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=vl(u),g=vl(i.clientWidth-(c+d)),m=vl(i.clientHeight-(u+f)),p=vl(c),b={rootMargin:-h+"px "+-g+"px "+-m+"px "+-p+"px",threshold:Yt(0,Fn(1,l))||1};let w=!0;function C(x){const k=x[0].intersectionRatio;if(k!==l){if(!w)return o();k?o(!1,k):r=setTimeout(()=>{o(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(C,{...b,root:i.ownerDocument})}catch(x){n=new IntersectionObserver(C,b)}n.observe(e)}return o(!0),s}function e6(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=Yf(e),u=i||s?[...c?ca(c):[],...ca(t)]:[];u.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const d=c&&a?ZD(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?Mi(e):null;l&&p();function p(){const v=Mi(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 t6=LD,n6=ID,r6=$D,i6=RD,s6=MD,o6=jD,a6=(e,t,n)=>{const r=new Map,i={platform:q1,...n},s={...i.platform,_c:r};return TD(e,t,{...i,platform:s})},Xf=pt();function Jf(){const e=vt(Xf);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var l6=le('<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">'),Kd=30,Gm=Kd/2,c6={top:180,right:-90,bottom:0,left:90};function Zf(e){const t=Jf(),n=Fe({size:Kd},e),[r,i]=Ve(n,["ref","style","size"]),s=()=>t.currentPlacement().split("-")[0],o=u6(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*(Kd/r.size),d=()=>`rotate(${c6[s()]} ${Gm} ${Gm}) translate(0 2)`;return j(it,Oe({as:"div",ref(f){const h=$t(t.setArrowRef,r.ref);typeof h=="function"&&h(f)},"aria-hidden":"true",get style(){return Rc({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=l6(),h=f.firstChild;return ve(()=>Z(h,"transform",d())),f}}))}function u6(e){const[t,n]=re();return be(()=>{const r=e();r&&n(c4(r).getComputedStyle(r))}),t}function d6(e){const t=Jf(),[n,r]=Ve(e,["ref","style"]);return j(it,Oe({as:"div",ref(i){const s=$t(t.setPositionerRef,n.ref);typeof s=="function"&&s(i)},"data-popper-positioner":"",get style(){return Rc({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}function Qm(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 f6(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?Qm(r):e?e.getBoundingClientRect():Qm()}}}function h6(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var g6={top:"bottom",right:"left",bottom:"top",left:"right"};function y6(e,t){const[n,r]=e.split("-"),i=g6[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 m6(e){const t=Fe({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]=re(),[i,s]=re(),[o,a]=re(t.placement),l=()=>{var f;return f6((f=t.anchorRef)==null?void 0:f.call(t),t.getAnchorRect)},{direction:c}=Qr();async function u(){var k,S,_;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:(k=t.gutter)!=null?k:m;h.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),f.getBoundingClientRect();const v=[t6(({placement:O})=>{const E=!!O.split("-")[1];return{mainAxis:p,crossAxis:E?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const O=typeof t.flip=="string"?t.flip.split(" "):void 0;if(O!==void 0&&!O.every(h6))throw new Error("`flip` expects a spaced-delimited list of placements");v.push(r6({padding:t.overflowPadding,fallbackPlacements:O}))}(t.slide||t.overlap)&&v.push(n6({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),v.push(i6({padding:t.overflowPadding,apply({availableWidth:O,availableHeight:E,rects:T}){const D=Math.round(T.reference.width);O=Math.floor(O),E=Math.floor(E),h.style.setProperty("--kb-popper-anchor-width",`${D}px`),h.style.setProperty("--kb-popper-content-available-width",`${O}px`),h.style.setProperty("--kb-popper-content-available-height",`${E}px`),t.sameWidth&&(h.style.width=`${D}px`),t.fitViewport&&(h.style.maxWidth=`${O}px`,h.style.maxHeight=`${E}px`)}})),t.hideWhenDetached&&v.push(s6({padding:t.detachedPadding})),g&&v.push(o6({element:g,padding:t.arrowPadding}));const b=await a6(f,h,{placement:t.placement,strategy:"absolute",middleware:v,platform:{...q1,isRTL:()=>c()==="rtl"}});if(a(b.placement),(S=t.onCurrentPlacementChange)==null||S.call(t,b.placement),!h)return;h.style.setProperty("--kb-popper-content-transform-origin",y6(b.placement,c()));const w=Math.round(b.x),C=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, ${C}px, 0)`,visibility:x}),g&&b.middlewareData.arrow){const{x:O,y:E}=b.middlewareData.arrow,T=b.placement.split("-")[0];Object.assign(g.style,{left:O!=null?`${O}px`:"",top:E!=null?`${E}px`:"",[T]:"100%"})}}be(()=>{const f=l(),h=n();if(!f||!h)return;const g=e6(f,h,u,{elementResize:typeof ResizeObserver=="function"});we(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(Xf.Provider,{value:d,get children(){return t.children}})}var z1=Object.assign(m6,{Arrow:Zf,Context:Xf,usePopperContext:Jf,Positioner:d6});function p6(e){const t=n=>{var r;n.key===Bf.Escape&&((r=e.onEscapeKeyDown)==null||r.call(e,n))};be(()=>{var r,i;if(Y(e.isDisabled))return;const n=(i=(r=e.ownerDocument)==null?void 0:r.call(e))!=null?i:qn();n.addEventListener("keydown",t),we(()=>{n.removeEventListener("keydown",t)})})}var Ym="interactOutside.pointerDownOutside",Xm="interactOutside.focusOutside";function v6(e,t){let n,r=k4;const i=()=>qn(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(`[${rc}]`)||!un(i(),f)||un(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=gt([s,a]);g.addEventListener(Ym,m,{once:!0});const p=new CustomEvent(Ym,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||g4(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=gt([o,a]);h.addEventListener(Xm,g,{once:!0});const m=new CustomEvent(Xm,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});h.dispatchEvent(m)};be(()=>{Y(e.isDisabled)||(n=window.setTimeout(()=>{i().addEventListener("pointerdown",c,!0)},0),i().addEventListener("focusin",u,!0),we(()=>{window.clearTimeout(n),i().removeEventListener("click",r),i().removeEventListener("pointerdown",c,!0),i().removeEventListener("focusin",u,!0)}))})}var H1=pt();function b6(){return vt(H1)}function x6(e){let t;const n=b6(),[r,i]=Ve(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()}};v6({shouldExcludeElement:d=>{var f;return t?((f=r.excludedElements)==null?void 0:f.some(h=>un(h(),d)))||[...s].some(h=>un(h,d)):!1},onPointerDownOutside:d=>{var f,h,g;!t||Ht.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!Ht.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),p6({ownerDocument:()=>qn(t),onEscapeKeyDown:d=>{var f;!t||!Ht.isTopMostLayer(t)||((f=r.onEscapeKeyDown)==null||f.call(r,d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),dr(()=>{if(!t)return;Ht.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n==null?void 0:n.registerNestedLayer(t);Ht.assignPointerEventToLayers(),Ht.disableBodyPointerEvents(t),we(()=>{t&&(Ht.removeLayer(t),d==null||d(),Ht.assignPointerEventToLayers(),Ht.restoreBodyPointerEvents(t))})}),be(ur([()=>t,()=>r.disableOutsidePointerEvents],([d,f])=>{if(!d)return;const h=Ht.find(d);h&&h.isPointerBlocking!==f&&(h.isPointerBlocking=f,Ht.assignPointerEventToLayers()),f&&Ht.disableBodyPointerEvents(d),we(()=>{Ht.restoreBodyPointerEvents(d)})},{defer:!0}));const u={registerNestedLayer:o};return j(H1.Provider,{value:u,get children(){return j(it,Oe({as:"div",ref(d){const f=$t(h=>t=h,r.ref);typeof f=="function"&&f(d)}},i))}})}function K1(e={}){const[t,n]=v1({value:()=>Y(e.open),defaultValue:()=>!!Y(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 sn={};Bc(sn,{Description:()=>m1,ErrorMessage:()=>p1,Item:()=>G1,ItemControl:()=>Q1,ItemDescription:()=>Y1,ItemIndicator:()=>X1,ItemInput:()=>J1,ItemLabel:()=>Z1,Label:()=>ex,RadioGroup:()=>w6,Root:()=>tx});var U1=pt();function W1(){const e=vt(U1);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupContext` must be used within a `RadioGroup` component");return e}var V1=pt();function qa(){const e=vt(V1);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupItemContext` must be used within a `RadioGroup.Item` component");return e}function G1(e){const t=Na(),n=W1(),r=`${t.generateId("item")}-${yn()}`,i=Fe({id:r},e),[s,o]=Ve(i,["value","disabled","onPointerDown"]),[a,l]=re(),[c,u]=re(),[d,f]=re(),[h,g]=re(),[m,p]=re(!1),v=H(()=>n.isSelectedValue(s.value)),b=H(()=>s.disabled||t.isDisabled()||!1),w=k=>{tt(k,s.onPointerDown),m()&&k.preventDefault()},C=H(()=>({...t.dataset(),"data-disabled":b()?"":void 0,"data-checked":v()?"":void 0})),x={value:()=>s.value,dataset:C,isSelected:v,isDisabled:b,inputId:a,labelId:c,descriptionId:d,inputRef:h,select:()=>n.setSelectedValue(s.value),generateId:Ra(()=>o.id),registerInput:dn(l),registerLabel:dn(u),registerDescription:dn(f),setIsFocused:p,setInputRef:g};return j(V1.Provider,{value:x,get children(){return j(it,Oe({as:"div",role:"group",onPointerDown:w},C,o))}})}function Q1(e){const t=qa(),n=Fe({id:t.generateId("control")},e),[r,i]=Ve(n,["onClick","onKeyDown"]);return j(it,Oe({as:"div",onClick:a=>{var l;tt(a,r.onClick),t.select(),(l=t.inputRef())==null||l.focus()},onKeyDown:a=>{var l;tt(a,r.onKeyDown),a.key===Bf.Space&&(t.select(),(l=t.inputRef())==null||l.focus())}},()=>t.dataset(),i))}function Y1(e){const t=qa(),n=Fe({id:t.generateId("description")},e);return be(()=>we(t.registerDescription(n.id))),j(it,Oe({as:"div"},()=>t.dataset(),n))}function X1(e){const t=qa(),n=Fe({id:t.generateId("indicator")},e),[r,i]=Ve(n,["ref","forceMount"]),[s,o]=re(),{present:a}=A1({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(it,Oe({as:"div",ref(l){const c=$t(o,r.ref);typeof c=="function"&&c(l)}},()=>t.dataset(),i))}})}function J1(e){const t=Na(),n=W1(),r=qa(),i=Fe({id:r.generateId("input")},e),[s,o]=Ve(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]=re(!1),d=g=>{if(tt(g,s.onChange),g.stopPropagation(),!c()){n.setSelectedValue(r.value());const m=g.target;m.checked=r.isSelected()}u(!1)},f=g=>{tt(g,s.onFocus),r.setIsFocused(!0)},h=g=>{tt(g,s.onBlur),r.setIsFocused(!1)};return be(ur([()=>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(()=>we(r.registerInput(o.id))),j(it,Oe({as:"input",ref(g){const m=$t(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 Rc({...g1},s.style)},get"aria-labelledby"(){return a()},get"aria-describedby"(){return l()},onChange:d,onFocus:f,onBlur:h},()=>r.dataset(),o))}function Z1(e){const t=qa(),n=Fe({id:t.generateId("label")},e);return be(()=>we(t.registerLabel(n.id))),j(it,Oe({as:"label",get for(){return t.inputId()}},()=>t.dataset(),n))}function ex(e){return j(T4,Oe({as:"span"},e))}function tx(e){let t;const n=`radiogroup-${yn()}`,r=Fe({id:n,orientation:"vertical"},e),[i,s,o]=Ve(r,["ref","value","defaultValue","onChange","orientation","aria-labelledby","aria-describedby"],A4),[a,l]=Fa({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:g=>{var m;return(m=i.onChange)==null?void 0:m.call(i,g)}}),{formControlContext:c}=P4(s);j4(()=>t,()=>{var g;return l((g=i.defaultValue)!=null?g:"")});const u=()=>c.getAriaLabelledBy(Y(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(y1.Provider,{value:c,get children(){return j(U1.Provider,{value:h,get children(){return j(it,Oe({as:"div",ref(g){const m=$t(p=>t=p,i.ref);typeof m=="function"&&m(g)},role:"radiogroup",get id(){return Y(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 w6=Object.assign(tx,{Description:m1,ErrorMessage:p1,Item:G1,ItemControl:Q1,ItemDescription:Y1,ItemIndicator:X1,ItemInput:J1,ItemLabel:Z1,Label:ex}),S6=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 C6(e,t,n){const r=J4({usage:"search",sensitivity:"base"}),i=H(()=>{const s=Y(e.keyboardDelegate);return s||new S6(e.collection,t,r)});return sD({selectionManager:()=>Y(e.selectionManager),keyboardDelegate:i,autoFocus:()=>Y(e.autoFocus),deferAutoFocus:()=>Y(e.deferAutoFocus),shouldFocusWrap:()=>Y(e.shouldFocusWrap),disallowEmptySelection:()=>Y(e.disallowEmptySelection),selectOnFocus:()=>Y(e.selectOnFocus),disallowTypeAhead:()=>Y(e.disallowTypeAhead),shouldUseVirtualFocus:()=>Y(e.shouldUseVirtualFocus),allowsTabNavigation:()=>Y(e.allowsTabNavigation),isVirtualized:()=>Y(e.isVirtualized),scrollToKey:s=>{var o;return(o=Y(e.scrollToKey))==null?void 0:o(s)},orientation:()=>Y(e.orientation)},t)}var Mu="focusScope.autoFocusOnMount",Du="focusScope.autoFocusOnUnmount",Jm={bubbles:!1,cancelable:!0},Zm={stack:[],active(){return this.stack[0]},add(e){var t;e!==this.active()&&((t=this.active())==null||t.pause()),this.stack=Nd(this.stack,e),this.stack.unshift(e)},remove(e){var t;this.stack=Nd(this.stack,e),(t=this.active())==null||t.resume()}};function _6(e,t){const[n,r]=re(!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=()=>qn(t()),c=()=>{const g=l().createElement("span");return g.setAttribute("data-focus-trap",""),g.tabIndex=0,Object.assign(g.style,g1),g},u=()=>{const g=t();return g?f1(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=Po(g);return!m||un(g,m)?!1:h1(m)};be(()=>{const g=t();if(!g)return;Zm.add(i);const m=Po(g);if(!un(g,m)){const v=new CustomEvent(Mu,Jm);g.addEventListener(Mu,o),g.dispatchEvent(v),v.defaultPrevented||setTimeout(()=>{_t(d()),Po(g)===m&&_t(g)},0)}we(()=>{g.removeEventListener(Mu,o),setTimeout(()=>{const v=new CustomEvent(Du,Jm);h()&&v.preventDefault(),g.addEventListener(Du,a),g.dispatchEvent(v),v.defaultPrevented||_t(m!=null?m:l().body),g.removeEventListener(Du,a),Zm.remove(i)},0)})}),be(()=>{const g=t();if(!g||!Y(e.trapFocus)||n())return;const m=v=>{const b=v.target;b!=null&&b.closest(`[${rc}]`)||(un(g,b)?s=b:_t(s))},p=v=>{const b=v.relatedTarget,w=b!=null?b:Po(g);w!=null&&w.closest(`[${rc}]`)||un(g,w)||_t(s)};l().addEventListener("focusin",m),l().addEventListener("focusout",p),we(()=>{l().removeEventListener("focusin",m),l().removeEventListener("focusout",p)})}),be(()=>{const g=t();if(!g||!Y(e.trapFocus)||n())return;const m=c();g.insertAdjacentElement("afterbegin",m);const p=c();g.insertAdjacentElement("beforeend",p);function v(w){const C=d(),x=f();w.relatedTarget===C?_t(x):_t(C)}m.addEventListener("focusin",v),p.addEventListener("focusin",v);const b=new MutationObserver(w=>{for(const C of w)C.previousSibling===p&&(p.remove(),g.insertAdjacentElement("beforeend",p)),C.nextSibling===m&&(m.remove(),g.insertAdjacentElement("afterbegin",m))});b.observe(g,{childList:!0,subtree:!1}),we(()=>{m.removeEventListener("focusin",v),p.removeEventListener("focusin",v),m.remove(),p.remove(),b.disconnect()})})}var k6="data-live-announcer";function O6(e){be(()=>{Y(e.isDisabled)||we(E6(Y(e.targets),Y(e.root)))})}var mo=new WeakMap,rn=[];function E6(e,t=document.body){const n=new Set(e),r=new Set,i=l=>{for(const f of l.querySelectorAll(`[${k6}], [${rc}]`))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=mo.get(l))!=null?u:0;l.getAttribute("aria-hidden")==="true"&&c===0||(c===0&&l.setAttribute("aria-hidden","true"),r.add(l),mo.set(l,c+1))};rn.length&&rn[rn.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 rn.push(a),()=>{o.disconnect();for(const l of r){const c=mo.get(l);if(c==null)return;c===1?(l.removeAttribute("aria-hidden"),mo.delete(l)):mo.set(l,c-1)}a===rn[rn.length-1]?(rn.pop(),rn.length&&rn[rn.length-1].observe()):rn.splice(rn.indexOf(a),1)}}var bl=new Map,A6=e=>{be(()=>{var s,o;const t=(s=Ct(e.style))!=null?s:{},n=(o=Ct(e.properties))!=null?o:[],r={};for(const a in t)r[a]=e.element.style[a];const i=bl.get(e.key);i?i.activeCount++:bl.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);we(()=>{var l;const a=bl.get(e.key);if(a){if(a.activeCount!==1){a.activeCount--;return}bl.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)}})})},ep=A6,P6=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},T6=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},j6=(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]=P6(i,t),f=d-c-r*u;(u!==0||f!==0)&&T6(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]},[tp,np]=re([]),$6=e=>tp().indexOf(e)===tp().length-1,M6=e=>{const t=Oe({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=yn();let r=[0,0],i=null,s=null;be(()=>{Ct(t.enabled)&&(np(c=>[...c,n]),we(()=>{np(c=>c.filter(u=>u!==n))}))}),be(()=>{if(!Ct(t.enabled)||!Ct(t.hideScrollbar))return;const{body:c}=document,u=window.innerWidth-c.offsetWidth;if(Ct(t.preventScrollbarShift)){const d={overflow:"hidden"},f=[];u>0&&(Ct(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;ep({key:"prevent-scroll",element:c,style:d,properties:f,cleanup:()=>{Ct(t.restoreScrollPosition)&&u>0&&window.scrollTo(g,h)}})}else ep({key:"prevent-scroll",element:c,style:{overflow:"hidden"}})}),be(()=>{!$6(n)||!Ct(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",o,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),we(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",o),document.removeEventListener("touchmove",l)}))});const o=c=>{r=rp(c),i=null,s=null},a=c=>{const u=c.target,d=Ct(t.element),f=D6(c),h=Math.abs(f[0])>Math.abs(f[1])?"x":"y",g=h==="x"?f[0]:f[1],m=ip(u,h,g,d);let p;d&&Ud(d,u)?p=!m:p=!0,p&&c.cancelable&&c.preventDefault()},l=c=>{const u=Ct(t.element),d=c.target;let f;if(c.touches.length===2)f=!Ct(t.allowPinchZoom);else{if(i==null||s===null){const h=rp(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=ip(d,i,s,u);u&&Ud(u,d)?f=!h:f=!0}}f&&c.cancelable&&c.preventDefault()}},D6=e=>[e.deltaX,e.deltaY],rp=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],ip=(e,t,n,r)=>{const i=r!==null&&Ud(r,e),[s,o]=j6(e,t,i?r:void 0);return!(n>0&&Math.abs(s)<=1||n<0&&Math.abs(o)<1)},Ud=(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},L6=M6,I6=L6,nx=pt();function rx(){return vt(nx)}function mr(){const e=rx();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var ix=pt();function eh(){const e=vt(ix);if(e===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var sx=pt();function Hn(){const e=vt(sx);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function th(e){let t;const n=Hn(),r=mr(),i=Fe({id:n.generateId(`item-${yn()}`)},e),[s,o]=Ve(i,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=re(),[c,u]=re(),[d,f]=re(),h=()=>r.listState().selectionManager(),g=()=>o.id,m=()=>h().focusedKey()===g(),p=()=>{var O;(O=s.onSelect)==null||O.call(s),s.closeOnSelect&&setTimeout(()=>{r.close(!0)})};K4({getItem:()=>{var O,E,T,D,G;return{ref:()=>t,type:"item",key:g(),textValue:(D=(T=(E=s.textValue)!=null?E:(O=d())==null?void 0:O.textContent)!=null?T:t==null?void 0:t.textContent)!=null?D:"",disabled:(G=s.disabled)!=null?G:!1}}});const v=E1({key:g,selectionManager:h,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),b=O=>{tt(O,s.onPointerMove),O.pointerType==="mouse"&&(s.disabled?r.onItemLeave(O):(r.onItemEnter(O),O.defaultPrevented||(_t(O.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(g()))))},w=O=>{tt(O,s.onPointerLeave),O.pointerType==="mouse"&&r.onItemLeave(O)},C=O=>{tt(O,s.onPointerUp),!s.disabled&&O.button===0&&p()},x=O=>{if(tt(O,s.onKeyDown),!O.repeat&&!s.disabled)switch(O.key){case"Enter":case" ":p();break}},k=H(()=>{if(s.indeterminate)return"mixed";if(s.checked!=null)return s.checked}),S=H(()=>({"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:S,setLabelRef:f,generateId:Ra(()=>o.id),registerLabel:dn(l),registerDescription:dn(u)};return j(ix.Provider,{value:_,get children(){return j(it,Oe({as:"div",ref(O){const E=$t(T=>t=T,s.ref);typeof E=="function"&&E(O)},get tabIndex(){return v.tabIndex()},get"aria-checked"(){return k()},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 gt([s.onPointerDown,v.onPointerDown])},get onPointerUp(){return gt([C,v.onPointerUp])},get onClick(){return gt([s.onClick,v.onClick])},get onKeyDown(){return gt([x,v.onKeyDown])},get onMouseDown(){return gt([s.onMouseDown,v.onMouseDown])},get onFocus(){return gt([s.onFocus,v.onFocus])},onPointerMove:b,onPointerLeave:w},S,o))}})}function ox(e){const t=Fe({closeOnSelect:!1},e),[n,r]=Ve(t,["checked","defaultChecked","onChange","onSelect"]),i=L4({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(th,Oe({role:"menuitemcheckbox",get checked(){return i.isSelected()},onSelect:()=>{var o;(o=n.onSelect)==null||o.call(n),i.toggle()}},r))}var R6=pt();function Hc(){return vt(R6)}var ua={next:(e,t)=>e==="ltr"?t==="horizontal"?"ArrowRight":"ArrowDown":t==="horizontal"?"ArrowLeft":"ArrowUp",previous:(e,t)=>ua.next(e==="ltr"?"rtl":"ltr",t)},sp={first:e=>e==="horizontal"?"ArrowDown":"ArrowRight",last:e=>e==="horizontal"?"ArrowUp":"ArrowLeft"};function ax(e){const t=Hn(),n=mr(),r=Hc(),{direction:i}=Qr(),s=Fe({id:t.generateId("trigger")},e),[o,a]=Ve(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=Fc(()=>n.triggerRef(),()=>"button"),u=H(()=>{var v;return c()==="a"&&((v=n.triggerRef())==null?void 0:v.getAttribute("href"))!=null});be(ur(()=>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=>{tt(v,o.onPointerDown),v.currentTarget.dataset.pointerType=v.pointerType,!o.disabled&&v.pointerType!=="touch"&&v.button===0&&d()},h=v=>{tt(v,o.onClick),o.disabled||v.currentTarget.dataset.pointerType==="touch"&&d()},g=v=>{if(tt(v,o.onKeyDown),!o.disabled){if(u())switch(v.key){case"Enter":case" ":return}switch(v.key){case"Enter":case" ":case sp.first(t.orientation()):v.stopPropagation(),v.preventDefault(),E4(v.currentTarget),n.open("first"),r==null||r.setAutoFocusMenu(!0),r==null||r.setValue(l);break;case sp.last(t.orientation()):v.stopPropagation(),v.preventDefault(),n.open("last");break;case ua.next(i(),t.orientation()):if(r===void 0)break;v.stopPropagation(),v.preventDefault(),r.nextMenu();break;case ua.previous(i(),t.orientation()):if(r===void 0)break;v.stopPropagation(),v.preventDefault(),r.previousMenu();break}}},m=v=>{var b;tt(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=>{tt(v,o.onFocus),r!==void 0&&v.currentTarget.dataset.pointerType!=="touch"&&r.setValue(l)};return be(()=>we(n.registerTriggerId(o.id))),j(Uf,Oe({ref(v){const b=$t(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 H(()=>!!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 N6=pt();function lx(){return vt(N6)}function cx(e){let t;const n=Hn(),r=mr(),i=Hc(),s=lx(),{direction:o}=Qr(),a=Fe({id:n.generateId(`content-${yn()}`)},e),[l,c]=Ve(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=C6({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 C;i===void 0&&((C=l.onOpenAutoFocus)==null||C.call(l,w))},onUnmountAutoFocus:l.onCloseAutoFocus},()=>t);const h=w=>{if(un(w.currentTarget,w.target)&&(w.key==="Tab"&&r.isOpen()&&w.preventDefault(),i!==void 0&&w.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(w.key){case ua.next(o(),n.orientation()):w.stopPropagation(),w.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.nextMenu();break;case ua.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 C;(C=l.onEscapeKeyDown)==null||C.call(l,w),i==null||i.setAutoFocusMenu(!1),r.close(!0)},m=w=>{var C;(C=l.onFocusOutside)==null||C.call(l,w),n.isModal()&&w.preventDefault()},p=w=>{var C,x;tt(w,l.onPointerEnter),r.isOpen()&&((C=r.parentMenuContext())==null||C.listState().selectionManager().setFocused(!1),(x=r.parentMenuContext())==null||x.listState().selectionManager().setFocusedKey(void 0))},v=w=>{if(tt(w,l.onPointerMove),w.pointerType!=="mouse")return;const C=w.target,x=u!==w.clientX;un(w.currentTarget,C)&&x&&(r.setPointerDir(w.clientX>u?"right":"left"),u=w.clientX)};be(()=>we(r.registerContentId(l.id)));const b={ref:$t(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:gt([l.onKeyDown,f.onKeyDown,h]),onMouseDown:gt([l.onMouseDown,f.onMouseDown]),onFocusIn:gt([l.onFocusIn,f.onFocusIn]),onFocusOut:gt([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(it,Oe({as:"div"},()=>r.dataset(),b,c))},get children(){return j(z1.Positioner,{get children(){return j(x6,Oe({get disableOutsidePointerEvents(){return H(()=>!!d())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return Rc({"--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 F6(e){let t;const n=Hn(),r=mr(),[i,s]=Ve(e,["ref"]);return I6({element:()=>t!=null?t:null,enabled:()=>r.contentPresent()&&n.preventScroll()}),j(cx,Oe({ref(o){const a=$t(l=>{t=l},i.ref);typeof a=="function"&&a(o)}},s))}var ux=pt();function B6(){const e=vt(ux);if(e===void 0)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}function nh(e){const t=Hn(),n=Fe({id:t.generateId(`group-${yn()}`)},e),[r,i]=re(),s={generateId:Ra(()=>n.id),registerLabelId:dn(i)};return j(ux.Provider,{value:s,get children(){return j(it,Oe({as:"div",role:"group",get"aria-labelledby"(){return r()}},n))}})}function dx(e){const t=B6(),n=Fe({id:t.generateId("label")},e),[r,i]=Ve(n,["id"]);return be(()=>we(t.registerLabelId(r.id))),j(it,Oe({as:"span",get id(){return r.id},"aria-hidden":"true"},i))}function fx(e){const t=mr(),n=Fe({children:"▼"},e);return j(it,Oe({as:"span","aria-hidden":"true"},()=>t.dataset(),n))}function hx(e){return j(th,Oe({role:"menuitem",closeOnSelect:!0},e))}function gx(e){const t=eh(),n=Fe({id:t.generateId("description")},e),[r,i]=Ve(n,["id"]);return be(()=>we(t.registerDescription(r.id))),j(it,Oe({as:"div",get id(){return r.id}},()=>t.dataset(),i))}function yx(e){const t=eh(),n=Fe({id:t.generateId("indicator")},e),[r,i]=Ve(n,["forceMount"]);return j(pe,{get when(){return r.forceMount||t.isChecked()},get children(){return j(it,Oe({as:"div"},()=>t.dataset(),i))}})}function mx(e){const t=eh(),n=Fe({id:t.generateId("label")},e),[r,i]=Ve(n,["ref","id"]);return be(()=>we(t.registerLabel(r.id))),j(it,Oe({as:"div",ref(s){const o=$t(t.setLabelRef,r.ref);typeof o=="function"&&o(s)},get id(){return r.id}},()=>t.dataset(),i))}function px(e){const t=mr();return j(pe,{get when(){return t.contentPresent()},get children(){return j(z0,e)}})}var vx=pt();function q6(){const e=vt(vx);if(e===void 0)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}function bx(e){const n=Hn().generateId(`radiogroup-${yn()}`),r=Fe({id:n},e),[i,s]=Ve(r,["value","defaultValue","onChange","disabled"]),[o,a]=Fa({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(vx.Provider,{value:l,get children(){return j(nh,s)}})}function xx(e){const t=q6(),n=Fe({closeOnSelect:!1},e),[r,i]=Ve(n,["value","onSelect"]);return j(th,Oe({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 z6(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 H6(e,t){return t?O4([e.clientX,e.clientY],t):!1}function wx(e){const t=Hn(),n=x1(),r=rx(),i=Hc(),s=lx(),o=Fe({placement:t.orientation()==="horizontal"?"bottom-start":"right-start"},e),[a,l]=Ve(o,["open","defaultOpen","onOpenChange"]);let c=0,u=null,d="right";const[f,h]=re(),[g,m]=re(),[p,v]=re(),[b,w]=re(),[C,x]=re(!0),[k,S]=re(l.placement),[_,O]=re([]),[E,T]=re([]),{DomCollectionProvider:D}=H4({items:E,onItemsChange:T}),G=K1({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:W=>{var de;return(de=a.onOpenChange)==null?void 0:de.call(a,W)}}),{present:N}=A1({show:()=>t.forceMount()||G.isOpen(),element:()=>{var W;return(W=b())!=null?W:null}}),L=aD({selectionMode:"none",dataSource:E}),M=W=>{x(W),G.open()},I=(W=!1)=>{G.close(),W&&r&&r.close(!0)},oe=W=>{x(W),G.toggle()},ue=()=>{const W=b();W&&(_t(W),L.selectionManager().setFocused(!0),L.selectionManager().setFocusedKey(void 0))},B=()=>{s!=null?setTimeout(()=>ue()):ue()},J=W=>{O(fe=>[...fe,W]);const de=r==null?void 0:r.registerNestedMenu(W);return()=>{O(fe=>Nd(fe,W)),de==null||de()}},ae=W=>d===(u==null?void 0:u.side)&&H6(W,u==null?void 0:u.area),ne=W=>{ae(W)&&W.preventDefault()},R=W=>{ae(W)||B()},Q=W=>{ae(W)&&W.preventDefault()};O6({isDisabled:()=>!(r==null&&G.isOpen()&&t.isModal()),targets:()=>[b(),..._()].filter(Boolean)}),be(()=>{const W=b();if(!W||!r)return;const de=r.registerNestedMenu(W);we(()=>{de()})}),be(()=>{r===void 0&&(i==null||i.registerMenu(t.value(),[b(),..._()]))}),be(()=>{var W;r!==void 0||i===void 0||(i.value()===t.value()?((W=p())==null||W.focus(),i.autoFocusMenu()&&M(!0)):I())}),be(()=>{r!==void 0||i===void 0||G.isOpen()&&i.setValue(t.value())}),we(()=>{r===void 0&&(i==null||i.unregisterMenu(t.value()))});const ce={dataset:H(()=>({"data-expanded":G.isOpen()?"":void 0,"data-closed":G.isOpen()?void 0:""})),isOpen:G.isOpen,contentPresent:N,nestedMenus:_,currentPlacement:k,pointerGraceTimeoutId:()=>c,autoFocus:C,listState:()=>L,parentMenuContext:()=>r,triggerRef:p,contentRef:b,triggerId:f,contentId:g,setTriggerRef:v,setContentRef:w,open:M,close:I,toggle:oe,focusContent:B,onItemEnter:ne,onItemLeave:R,onTriggerLeave:Q,setPointerDir:W=>d=W,setPointerGraceTimeoutId:W=>c=W,setPointerGraceIntent:W=>u=W,registerNestedMenu:J,registerItemToParentDomCollection:n==null?void 0:n.registerItem,registerTriggerId:dn(h),registerContentId:dn(m)};return j(D,{get children(){return j(nx.Provider,{value:ce,get children(){return j(pe,{when:s===void 0,get fallback(){return l.children},get children(){return j(z1,Oe({anchorRef:p,contentRef:b,onCurrentPlacementChange:S},l))}})}})}})}function Sx(e){const{direction:t}=Qr();return j(wx,Oe({get placement(){return t()==="rtl"?"left-start":"right-start"},flip:!0},e))}var K6={close:(e,t)=>e==="ltr"?[t==="horizontal"?"ArrowLeft":"ArrowUp"]:[t==="horizontal"?"ArrowRight":"ArrowDown"]};function Cx(e){const t=mr(),n=Hn(),[r,i]=Ve(e,["onFocusOutside","onKeyDown"]),{direction:s}=Qr();return j(cx,Oe({onOpenAutoFocus:u=>{u.preventDefault()},onCloseAutoFocus:u=>{u.preventDefault()},onFocusOutside:u=>{var f;(f=r.onFocusOutside)==null||f.call(r,u);const d=u.target;un(t.triggerRef(),d)||t.close()},onKeyDown:u=>{tt(u,r.onKeyDown);const d=un(u.currentTarget,u.target),f=K6.close(s(),n.orientation()).includes(u.key),h=t.parentMenuContext()!=null;d&&f&&h&&(t.close(),_t(t.triggerRef()))}},i))}var op=["Enter"," "],U6={open:(e,t)=>e==="ltr"?[...op,t==="horizontal"?"ArrowRight":"ArrowDown"]:[...op,t==="horizontal"?"ArrowLeft":"ArrowUp"]};function _x(e){let t;const n=Hn(),r=mr(),i=Fe({id:n.generateId(`sub-trigger-${yn()}`)},e),[s,o]=Ve(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}=Qr(),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=E1({key:u,selectionManager:d,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),m=w=>{tt(w,s.onClick),!r.isOpen()&&!s.disabled&&r.open(!0)},p=w=>{var x;if(tt(w,s.onPointerMove),w.pointerType!=="mouse")return;const C=r.parentMenuContext();if(C==null||C.onItemEnter(w),!w.defaultPrevented){if(s.disabled){C==null||C.onItemLeave(w);return}!r.isOpen()&&!a&&((x=r.parentMenuContext())==null||x.setPointerGraceIntent(null),a=window.setTimeout(()=>{r.open(!1),l()},100)),C==null||C.onItemEnter(w),w.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),_t(w.currentTarget),C==null||C.listState().selectionManager().setFocused(!0),C==null||C.listState().selectionManager().setFocusedKey(u()))}},v=w=>{if(tt(w,s.onPointerLeave),w.pointerType!=="mouse")return;l();const C=r.parentMenuContext(),x=r.contentRef();if(x){C==null||C.setPointerGraceIntent({area:z6(r.currentPlacement(),w,x),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(C==null?void 0:C.pointerGraceTimeoutId());const k=window.setTimeout(()=>{C==null||C.setPointerGraceIntent(null)},300);C==null||C.setPointerGraceTimeoutId(k)}else{if(C==null||C.onTriggerLeave(w),w.defaultPrevented)return;C==null||C.setPointerGraceIntent(null)}C==null||C.onItemLeave(w)},b=w=>{tt(w,s.onKeyDown),!w.repeat&&(s.disabled||U6.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 C,x,k;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=(C=s.textValue)!=null?C:t==null?void 0:t.textContent)!=null?x:"",disabled:(k=s.disabled)!=null?k:!1});we(w)}),be(ur(()=>{var w;return(w=r.parentMenuContext())==null?void 0:w.pointerGraceTimeoutId()},w=>{we(()=>{var C;window.clearTimeout(w),(C=r.parentMenuContext())==null||C.setPointerGraceIntent(null)})})),be(()=>we(r.registerTriggerId(s.id))),we(()=>{l()}),j(it,Oe({as:"div",ref(w){const C=$t(x=>{r.setTriggerRef(x),t=x},s.ref);typeof C=="function"&&C(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 H(()=>!!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 gt([s.onPointerDown,g.onPointerDown])},get onPointerUp(){return gt([s.onPointerUp,g.onPointerUp])},get onClick(){return gt([m,g.onClick])},get onKeyDown(){return gt([b,g.onKeyDown])},get onMouseDown(){return gt([s.onMouseDown,g.onMouseDown])},get onFocus(){return gt([s.onFocus,g.onFocus])},onPointerMove:p,onPointerLeave:v},()=>r.dataset(),o))}function W6(e){const t=Hc(),n=`menu-${yn()}`,r=Fe({id:n,modal:!0},e),[i,s]=Ve(r,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),o=K1({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:Ra(()=>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(sx.Provider,{value:a,get children(){return j(wx,Oe({get open(){return o.isOpen()},get onOpenChange(){return o.setIsOpen}},s))}})}var V6={};Bc(V6,{Root:()=>Kc,Separator:()=>G6});function Kc(e){let t;const n=Fe({orientation:"horizontal"},e),[r,i]=Ve(n,["ref","orientation"]),s=Fc(()=>t,()=>"hr");return j(it,Oe({as:"hr",ref(o){const a=$t(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 G6=Kc,ct={};Bc(ct,{Arrow:()=>Zf,CheckboxItem:()=>ox,Content:()=>kx,DropdownMenu:()=>Q6,Group:()=>nh,GroupLabel:()=>dx,Icon:()=>fx,Item:()=>hx,ItemDescription:()=>gx,ItemIndicator:()=>yx,ItemLabel:()=>mx,Portal:()=>px,RadioGroup:()=>bx,RadioItem:()=>xx,Root:()=>Ox,Separator:()=>Kc,Sub:()=>Sx,SubContent:()=>Cx,SubTrigger:()=>_x,Trigger:()=>ax});function kx(e){const t=Hn(),n=mr(),[r,i]=Ve(e,["onCloseAutoFocus","onInteractOutside"]);let s=!1;return j(F6,Oe({onCloseAutoFocus:l=>{var c;(c=r.onCloseAutoFocus)==null||c.call(r,l),s||_t(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 Ox(e){const t=`dropdownmenu-${yn()}`,n=Fe({id:t},e);return j(W6,n)}var Q6=Object.assign(Ox,{Arrow:Zf,CheckboxItem:ox,Content:kx,Group:nh,GroupLabel:dx,Icon:fx,Item:hx,ItemDescription:gx,ItemIndicator:yx,ItemLabel:mx,Portal:px,RadioGroup:bx,RadioItem:xx,Separator:Kc,Sub:Sx,SubContent:Cx,SubTrigger:_x,Trigger:ax}),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"}},Y6=le('<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>'),X6=le('<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>'),J6=le('<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>'),Z6=le('<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>'),rh=le('<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>'),eL=le('<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>'),tL=le('<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>'),nL=le('<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>'),rL=le('<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">'),iL=le('<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">'),sL=le('<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>'),oL=le('<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>'),aL=le('<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>'),lL=le('<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>'),Ex=le('<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>'),cL=le('<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>'),uL=le('<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>'),dL=le('<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>'),fL=le('<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>'),hL=le('<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>'),gL=le('<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>'),yL=le('<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>'),mL=le('<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 pL(){return Y6()}function Ax(){return X6()}function Fo(){return J6()}function ap(){return Z6()}function lp(){return rh()}function vL(){return(()=>{var e=rh();return e.style.setProperty("transform","rotate(90deg)"),e})()}function bL(){return(()=>{var e=rh();return e.style.setProperty("transform","rotate(-90deg)"),e})()}function xL(){return eL()}function wL(){return tL()}function SL(){return nL()}function CL(){return rL()}function _L(){return iL()}function kL(){return sL()}function OL(){return oL()}function EL(){return aL()}function AL(){return lL()}function PL(e){return(()=>{var t=Ex(),n=t.firstChild;return ve(()=>Z(n,"stroke",e.theme==="dark"?"#12B76A":"#027A48")),t})()}function TL(){return cL()}function jL(){return uL()}function $L(e){return[j(pe,{get when(){return e.checked},get children(){var t=Ex(),n=t.firstChild;return ve(()=>Z(n,"stroke",e.theme==="dark"?"#9B8AFB":"#6938EF")),t}}),j(pe,{get when(){return!e.checked},get children(){var t=dL(),n=t.firstChild;return ve(()=>Z(n,"stroke",e.theme==="dark"?"#9B8AFB":"#6938EF")),t}})]}function ML(){return fL()}function DL(){return hL()}function LL(){return gL()}function IL(){return yL()}function cp(){const e=yn();return(()=>{var t=mL(),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,C=w.firstChild,x=w.nextSibling,k=x.firstChild,S=x.nextSibling,_=S.nextSibling,O=_.firstChild,E=_.nextSibling,T=E.firstChild,D=E.nextSibling,G=D.nextSibling,N=G.firstChild,L=G.nextSibling,M=L.firstChild,I=L.nextSibling,oe=I.nextSibling,ue=oe.firstChild,B=oe.nextSibling,J=B.firstChild,ae=B.nextSibling,ne=ae.firstChild,R=ne.nextSibling,Q=R.nextSibling,q=Q.nextSibling,ce=q.nextSibling,W=ae.nextSibling,de=W.firstChild,fe=W.nextSibling,Le=fe.firstChild,te=fe.nextSibling,et=te.firstChild,_e=et.nextSibling,Ie=_e.nextSibling,Re=Ie.firstChild,ze=Re.nextSibling,V=ze.nextSibling,Ee=V.nextSibling,He=Ee.nextSibling,$e=He.nextSibling,Me=$e.nextSibling,he=Me.nextSibling,xe=he.nextSibling,ge=xe.nextSibling,Be=ge.nextSibling,Kn=Be.nextSibling,vn=te.nextSibling,Yr=vn.firstChild,Un=vn.nextSibling,Xr=Un.firstChild,Wn=Un.nextSibling,pr=Wn.firstChild,Ha=pr.nextSibling,Xs=Wn.nextSibling,Ka=Xs.firstChild,Bi=Xs.nextSibling,Ua=Bi.firstChild,Js=Bi.nextSibling,Zs=Js.firstChild,eo=Zs.nextSibling,qi=eo.nextSibling,ah=qi.nextSibling,lh=ah.nextSibling,ch=lh.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,Bx=xh.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(C,"id",`ai-${e}`),Z(x,"id",`i-${e}`),Z(k,"filter",`url(#ai-${e})`),Z(S,"mask",`url(#i-${e})`),Z(O,"id",`aj-${e}`),Z(E,"id",`h-${e}`),Z(T,"filter",`url(#aj-${e})`),Z(D,"mask",`url(#h-${e})`),Z(N,"id",`ag-${e}`),Z(L,"id",`g-${e}`),Z(M,"filter",`url(#ag-${e})`),Z(I,"mask",`url(#g-${e})`),Z(ue,"id",`af-${e}`),Z(B,"id",`f-${e}`),Z(J,"filter",`url(#af-${e})`),Z(ae,"mask",`url(#f-${e})`),Z(q,"id",`m-${e}`),Z(ce,"fill",`url(#m-${e})`),Z(de,"id",`ak-${e}`),Z(fe,"id",`e-${e}`),Z(Le,"filter",`url(#ak-${e})`),Z(te,"mask",`url(#e-${e})`),Z(et,"id",`n-${e}`),Z(_e,"fill",`url(#n-${e})`),Z(Re,"id",`r-${e}`),Z(ze,"fill",`url(#r-${e})`),Z(V,"id",`s-${e}`),Z(Ee,"fill",`url(#s-${e})`),Z(He,"id",`q-${e}`),Z($e,"fill",`url(#q-${e})`),Z(Me,"id",`p-${e}`),Z(he,"fill",`url(#p-${e})`),Z(xe,"id",`o-${e}`),Z(ge,"fill",`url(#o-${e})`),Z(Be,"id",`l-${e}`),Z(Kn,"fill",`url(#l-${e})`),Z(Yr,"id",`al-${e}`),Z(Un,"id",`d-${e}`),Z(Xr,"filter",`url(#al-${e})`),Z(Wn,"mask",`url(#d-${e})`),Z(pr,"id",`u-${e}`),Z(Ha,"fill",`url(#u-${e})`),Z(Ka,"id",`ad-${e}`),Z(Bi,"id",`c-${e}`),Z(Ua,"filter",`url(#ad-${e})`),Z(Js,"mask",`url(#c-${e})`),Z(Zs,"id",`t-${e}`),Z(eo,"fill",`url(#t-${e})`),Z(qi,"id",`v-${e}`),Z(ah,"stroke",`url(#v-${e})`),Z(lh,"id",`aa-${e}`),Z(ch,"stroke",`url(#aa-${e})`),Z(uh,"id",`w-${e}`),Z(dh,"stroke",`url(#w-${e})`),Z(fh,"id",`ac-${e}`),Z(hh,"stroke",`url(#ac-${e})`),Z(gh,"id",`ab-${e}`),Z(yh,"stroke",`url(#ab-${e})`),Z(mh,"id",`y-${e}`),Z(ph,"stroke",`url(#y-${e})`),Z(vh,"id",`x-${e}`),Z(bh,"stroke",`url(#x-${e})`),Z(xh,"id",`z-${e}`),Z(Bx,"stroke",`url(#z-${e})`),t})()}var RL=le('<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>'),NL=le('<button title="Copy object to clipboard">'),FL=le('<button title="Remove all items"aria-label="Remove all items">'),BL=le('<button title="Delete item"aria-label="Delete item">'),qL=le('<button title="Toggle value"aria-label="Toggle value">'),zL=le('<button title="Bulk Edit Data"aria-label="Bulk Edit Data">'),po=le("<div>"),HL=le("<div><button> <span></span> <span> "),KL=le("<input>"),up=le("<span>"),UL=le("<div><span>:"),WL=le("<div><div><button> [<!>...<!>]");function VL(e,t){let n=0;const r=[];for(;n<e.length;)r.push(e.slice(n,n+t)),n=n+t;return r}var dp=e=>{const t=mt(),n=ye().shadowDOMTarget?Te.bind({target:ye().shadowDOMTarget}):Te,r=H(()=>t()==="dark"?Ys(n):Qs(n));return(()=>{var i=RL();return ve(()=>ee(i,se(r().expander,n`
69
70
  transform: rotate(${e.expanded?90:0}deg);
70
71
  `,e.expanded&&n`
71
72
  & svg {
72
73
  top: -1px;
73
74
  }
74
- `))),i})()},zL=e=>{const t=yt(),n=ye().shadowDOMTarget?Pe.bind({target:ye().shadowDOMTarget}):Pe,r=H(()=>t()==="dark"?Ys(n):Qs(n)),[i,s]=re("NoCopy");return(()=>{var o=ML();return R0(o,"click",i()==="NoCopy"?()=>{navigator.clipboard.writeText(uC(e.value)).then(()=>{s("SuccessCopy"),setTimeout(()=>{s("NoCopy")},1500)},a=>{s("ErrorCopy"),setTimeout(()=>{s("NoCopy")},1500)})}:void 0,!0),U(o,j(fS,{get children(){return[j(Zc,{get when(){return i()==="NoCopy"},get children(){return j(wL,{})}}),j(Zc,{get when(){return i()==="SuccessCopy"},get children(){return j(CL,{get theme(){return t()}})}}),j(Zc,{get when(){return i()==="ErrorCopy"},get children(){return j(_L,{})}})]}})),be(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&&ee(o,a.e=l),c!==a.t&&J(o,"aria-label",a.t=c),a},{e:void 0,t:void 0}),o})()},HL=e=>{const t=yt(),n=ye().shadowDOMTarget?Pe.bind({target:ye().shadowDOMTarget}):Pe,r=H(()=>t()==="dark"?Ys(n):Qs(n)),i=ye().client;return(()=>{var s=$L();return s.$$click=()=>{const o=e.activeQuery.state.data,a=li(o,e.dataPath,[]);i.setQueryData(e.activeQuery.queryKey,a)},U(s,j(kL,{})),be(()=>ee(s,r().actionButton)),s})()},dp=e=>{const t=yt(),n=ye().shadowDOMTarget?Pe.bind({target:ye().shadowDOMTarget}):Pe,r=H(()=>t()==="dark"?Ys(n):Qs(n)),i=ye().client;return(()=>{var s=DL();return s.$$click=()=>{const o=e.activeQuery.state.data,a=Co(o,e.dataPath);i.setQueryData(e.activeQuery.queryKey,a)},U(s,j(Ex,{})),be(()=>ee(s,se(r().actionButton))),s})()},KL=e=>{const t=yt(),n=ye().shadowDOMTarget?Pe.bind({target:ye().shadowDOMTarget}):Pe,r=H(()=>t()==="dark"?Ys(n):Qs(n)),i=ye().client;return(()=>{var s=LL();return s.$$click=()=>{const o=e.activeQuery.state.data,a=li(o,e.dataPath,!e.value);i.setQueryData(e.activeQuery.queryKey,a)},U(s,j(OL,{get theme(){return t()},get checked(){return e.value}})),be(()=>ee(s,se(r().actionButton,n`
75
+ `))),i})()},GL=e=>{const t=mt(),n=ye().shadowDOMTarget?Te.bind({target:ye().shadowDOMTarget}):Te,r=H(()=>t()==="dark"?Ys(n):Qs(n)),[i,s]=re("NoCopy");return(()=>{var o=NL();return N0(o,"click",i()==="NoCopy"?()=>{navigator.clipboard.writeText(dC(e.value)).then(()=>{s("SuccessCopy"),setTimeout(()=>{s("NoCopy")},1500)},a=>{s("ErrorCopy"),setTimeout(()=>{s("NoCopy")},1500)})}:void 0,!0),U(o,j(hS,{get children(){return[j(Zc,{get when(){return i()==="NoCopy"},get children(){return j(EL,{})}}),j(Zc,{get when(){return i()==="SuccessCopy"},get children(){return j(PL,{get theme(){return t()}})}}),j(Zc,{get when(){return i()==="ErrorCopy"},get children(){return j(TL,{})}})]}})),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&&ee(o,a.e=l),c!==a.t&&Z(o,"aria-label",a.t=c),a},{e:void 0,t:void 0}),o})()},QL=e=>{const t=mt(),n=ye().shadowDOMTarget?Te.bind({target:ye().shadowDOMTarget}):Te,r=H(()=>t()==="dark"?Ys(n):Qs(n)),i=ye().client;return(()=>{var s=FL();return s.$$click=()=>{const o=e.activeQuery.state.data,a=li(o,e.dataPath,[]);i.setQueryData(e.activeQuery.queryKey,a)},U(s,j(jL,{})),ve(()=>ee(s,r().actionButton)),s})()},fp=e=>{const t=mt(),n=ye().shadowDOMTarget?Te.bind({target:ye().shadowDOMTarget}):Te,r=H(()=>t()==="dark"?Ys(n):Qs(n)),i=ye().client;return(()=>{var s=BL();return s.$$click=()=>{const o=e.activeQuery.state.data,a=Co(o,e.dataPath);i.setQueryData(e.activeQuery.queryKey,a)},U(s,j(Ax,{})),ve(()=>ee(s,se(r().actionButton))),s})()},YL=e=>{const t=mt(),n=ye().shadowDOMTarget?Te.bind({target:ye().shadowDOMTarget}):Te,r=H(()=>t()==="dark"?Ys(n):Qs(n)),i=ye().client;return(()=>{var s=qL();return s.$$click=()=>{const o=e.activeQuery.state.data,a=li(o,e.dataPath,!e.value);i.setQueryData(e.activeQuery.queryKey,a)},U(s,j($L,{get theme(){return t()},get checked(){return e.value}})),ve(()=>ee(s,se(r().actionButton,n`
75
76
  width: ${K.size[3.5]};
76
77
  height: ${K.size[3.5]};
77
- `))),s})()};function fp(e){return Symbol.iterator in e}function Ir(e){var g;const t=yt(),n=ye().shadowDOMTarget?Pe.bind({target:ye().shadowDOMTarget}):Pe,r=H(()=>t()==="dark"?Ys(n):Qs(n)),i=ye().client,[s,o]=re((e.defaultExpanded||[]).includes(e.label)),a=()=>o(m=>!m),[l,c]=re([]),u=H(()=>Array.isArray(e.value)?e.value.map((m,p)=>({label:p.toString(),value:m})):e.value!==null&&typeof e.value=="object"&&fp(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=H(()=>Array.isArray(e.value)?"array":e.value!==null&&typeof e.value=="object"&&fp(e.value)&&typeof e.value[Symbol.iterator]=="function"?"Iterable":typeof e.value=="object"&&e.value!==null?"object":typeof e.value),f=H(()=>qL(u(),100)),h=(g=e.dataPath)!=null?g:[];return(()=>{var m=po();return U(m,j(ve,{get when(){return f().length},get children(){return[(()=>{var p=RL(),v=p.firstChild,b=v.firstChild,w=b.nextSibling,C=w.nextSibling,x=C.nextSibling,k=x.firstChild;return v.$$click=()=>a(),U(v,j(up,{get expanded(){return s()}}),b),U(w,()=>e.label),U(x,()=>String(d()).toLowerCase()==="iterable"?"(Iterable) ":"",k),U(x,()=>u().length,k),U(x,()=>u().length>1?"items":"item",null),U(p,j(ve,{get when(){return e.editable},get children(){var S=po();return U(S,j(zL,{get value(){return e.value}}),null),U(S,j(ve,{get when(){return e.itemsDeletable&&e.activeQuery!==void 0},get children(){return j(dp,{get activeQuery(){return e.activeQuery},dataPath:h})}}),null),U(S,j(ve,{get when(){return d()==="array"&&e.activeQuery!==void 0},get children(){return j(HL,{get activeQuery(){return e.activeQuery},dataPath:h})}}),null),U(S,j(ve,{get when(){return H(()=>!!e.onEdit)()&&!nv(e.value).meta},get children(){var _=IL();return _.$$click=()=>{var O;(O=e.onEdit)==null||O.call(e)},U(_,j(SL,{})),be(()=>ee(_,r().actionButton)),_}}),null),be(()=>ee(S,r().actions)),S}}),null),be(S=>{var _=r().expanderButtonContainer,O=r().expanderButton,E=r().info;return _!==S.e&&ee(p,S.e=_),O!==S.t&&ee(v,S.t=O),E!==S.a&&ee(x,S.a=E),S},{e:void 0,t:void 0,a:void 0}),p})(),j(ve,{get when(){return s()},get children(){return[j(ve,{get when(){return f().length===1},get children(){var p=po();return U(p,j(nc,{get each(){return u()},by:v=>v.label,children:v=>j(Ir,{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"}})})),be(()=>ee(p,r().subEntry)),p}}),j(ve,{get when(){return f().length>1},get children(){var p=po();return U(p,j(dS,{get each(){return f()},children:(v,b)=>(()=>{var w=BL(),C=w.firstChild,x=C.firstChild,k=x.firstChild,S=k.nextSibling,_=S.nextSibling,O=_.nextSibling;return O.nextSibling,x.$$click=()=>c(E=>E.includes(b)?E.filter(T=>T!==b):[...E,b]),U(x,j(up,{get expanded(){return l().includes(b)}}),k),U(x,b*100,S),U(x,b*100+100-1,O),U(C,j(ve,{get when(){return l().includes(b)},get children(){var E=po();return U(E,j(nc,{get each(){return v()},by:T=>T.label,children:T=>j(Ir,{get defaultExpanded(){return e.defaultExpanded},get label(){return T().label},get value(){return T().value},get editable(){return e.editable},get dataPath(){return[...h,T().label]},get activeQuery(){return e.activeQuery}})})),be(()=>ee(E,r().subEntry)),E}}),null),be(E=>{var T=r().entry,D=r().expanderButton;return T!==E.e&&ee(C,E.e=T),D!==E.t&&ee(x,E.t=D),E},{e:void 0,t:void 0}),w})()})),be(()=>ee(p,r().subEntry)),p}})]}})]}}),null),U(m,j(ve,{get when(){return f().length===0},get children(){var p=FL(),v=p.firstChild,b=v.firstChild;return U(v,()=>e.label,b),U(p,j(ve,{get when(){return H(()=>!!(e.editable&&e.activeQuery!==void 0))()&&(d()==="string"||d()==="number"||d()==="boolean")},get fallback(){return(()=>{var w=cp();return U(w,()=>zl(e.value)),be(()=>ee(w,r().value)),w})()},get children(){return[j(ve,{get when(){return H(()=>!!(e.editable&&e.activeQuery!==void 0))()&&(d()==="string"||d()==="number")},get children(){var w=NL();return w.addEventListener("change",C=>{const x=e.activeQuery.state.data,k=li(x,h,d()==="number"?C.target.valueAsNumber:C.target.value);i.setQueryData(e.activeQuery.queryKey,k)}),be(C=>{var x=d()==="number"?"number":"text",k=se(r().value,r().editableInput);return x!==C.e&&J(w,"type",C.e=x),k!==C.t&&ee(w,C.t=k),C},{e:void 0,t:void 0}),be(()=>w.value=e.value),w}}),j(ve,{get when(){return d()==="boolean"},get children(){var w=cp();return U(w,j(KL,{get activeQuery(){return e.activeQuery},dataPath:h,get value(){return e.value}}),null),U(w,()=>zl(e.value),null),be(()=>ee(w,se(r().value,r().actions,r().editableInput))),w}})]}}),null),U(p,j(ve,{get when(){return e.editable&&e.itemsDeletable&&e.activeQuery!==void 0},get children(){return j(dp,{get activeQuery(){return e.activeQuery},dataPath:h})}}),null),be(w=>{var C=r().row,x=r().label;return C!==w.e&&ee(p,w.e=C),x!==w.t&&ee(v,w.t=x),w},{e:void 0,t:void 0}),p}}),null),be(()=>ee(m,r().entry)),m})()}var Ax=(e,t)=>{const{colors:n,font:r,size:i,border:s}=K,o=(a,l)=>e==="light"?a:l;return{entry:t`
78
+ `))),s})()};function hp(e){return Symbol.iterator in e}function Ir(e){var g;const t=mt(),n=ye().shadowDOMTarget?Te.bind({target:ye().shadowDOMTarget}):Te,r=H(()=>t()==="dark"?Ys(n):Qs(n)),i=ye().client,[s,o]=re((e.defaultExpanded||[]).includes(e.label)),a=()=>o(m=>!m),[l,c]=re([]),u=H(()=>Array.isArray(e.value)?e.value.map((m,p)=>({label:p.toString(),value:m})):e.value!==null&&typeof e.value=="object"&&hp(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=H(()=>Array.isArray(e.value)?"array":e.value!==null&&typeof e.value=="object"&&hp(e.value)&&typeof e.value[Symbol.iterator]=="function"?"Iterable":typeof e.value=="object"&&e.value!==null?"object":typeof e.value),f=H(()=>VL(u(),100)),h=(g=e.dataPath)!=null?g:[];return(()=>{var m=po();return U(m,j(pe,{get when(){return f().length},get children(){return[(()=>{var p=HL(),v=p.firstChild,b=v.firstChild,w=b.nextSibling,C=w.nextSibling,x=C.nextSibling,k=x.firstChild;return v.$$click=()=>a(),U(v,j(dp,{get expanded(){return s()}}),b),U(w,()=>e.label),U(x,()=>String(d()).toLowerCase()==="iterable"?"(Iterable) ":"",k),U(x,()=>u().length,k),U(x,()=>u().length>1?"items":"item",null),U(p,j(pe,{get when(){return e.editable},get children(){var S=po();return U(S,j(GL,{get value(){return e.value}}),null),U(S,j(pe,{get when(){return e.itemsDeletable&&e.activeQuery!==void 0},get children(){return j(fp,{get activeQuery(){return e.activeQuery},dataPath:h})}}),null),U(S,j(pe,{get when(){return d()==="array"&&e.activeQuery!==void 0},get children(){return j(QL,{get activeQuery(){return e.activeQuery},dataPath:h})}}),null),U(S,j(pe,{get when(){return H(()=>!!e.onEdit)()&&!rv(e.value).meta},get children(){var _=zL();return _.$$click=()=>{var O;(O=e.onEdit)==null||O.call(e)},U(_,j(AL,{})),ve(()=>ee(_,r().actionButton)),_}}),null),ve(()=>ee(S,r().actions)),S}}),null),ve(S=>{var _=r().expanderButtonContainer,O=r().expanderButton,E=r().info;return _!==S.e&&ee(p,S.e=_),O!==S.t&&ee(v,S.t=O),E!==S.a&&ee(x,S.a=E),S},{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=po();return U(p,j(nc,{get each(){return u()},by:v=>v.label,children:v=>j(Ir,{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(()=>ee(p,r().subEntry)),p}}),j(pe,{get when(){return f().length>1},get children(){var p=po();return U(p,j(fS,{get each(){return f()},children:(v,b)=>(()=>{var w=WL(),C=w.firstChild,x=C.firstChild,k=x.firstChild,S=k.nextSibling,_=S.nextSibling,O=_.nextSibling;return O.nextSibling,x.$$click=()=>c(E=>E.includes(b)?E.filter(T=>T!==b):[...E,b]),U(x,j(dp,{get expanded(){return l().includes(b)}}),k),U(x,b*100,S),U(x,b*100+100-1,O),U(C,j(pe,{get when(){return l().includes(b)},get children(){var E=po();return U(E,j(nc,{get each(){return v()},by:T=>T.label,children:T=>j(Ir,{get defaultExpanded(){return e.defaultExpanded},get label(){return T().label},get value(){return T().value},get editable(){return e.editable},get dataPath(){return[...h,T().label]},get activeQuery(){return e.activeQuery}})})),ve(()=>ee(E,r().subEntry)),E}}),null),ve(E=>{var T=r().entry,D=r().expanderButton;return T!==E.e&&ee(C,E.e=T),D!==E.t&&ee(x,E.t=D),E},{e:void 0,t:void 0}),w})()})),ve(()=>ee(p,r().subEntry)),p}})]}})]}}),null),U(m,j(pe,{get when(){return f().length===0},get children(){var p=UL(),v=p.firstChild,b=v.firstChild;return U(v,()=>e.label,b),U(p,j(pe,{get when(){return H(()=>!!(e.editable&&e.activeQuery!==void 0))()&&(d()==="string"||d()==="number"||d()==="boolean")},get fallback(){return(()=>{var w=up();return U(w,()=>zl(e.value)),ve(()=>ee(w,r().value)),w})()},get children(){return[j(pe,{get when(){return H(()=>!!(e.editable&&e.activeQuery!==void 0))()&&(d()==="string"||d()==="number")},get children(){var w=KL();return w.addEventListener("change",C=>{const x=e.activeQuery.state.data,k=li(x,h,d()==="number"?C.target.valueAsNumber:C.target.value);i.setQueryData(e.activeQuery.queryKey,k)}),ve(C=>{var x=d()==="number"?"number":"text",k=se(r().value,r().editableInput);return x!==C.e&&Z(w,"type",C.e=x),k!==C.t&&ee(w,C.t=k),C},{e:void 0,t:void 0}),ve(()=>w.value=e.value),w}}),j(pe,{get when(){return d()==="boolean"},get children(){var w=up();return U(w,j(YL,{get activeQuery(){return e.activeQuery},dataPath:h,get value(){return e.value}}),null),U(w,()=>zl(e.value),null),ve(()=>ee(w,se(r().value,r().actions,r().editableInput))),w}})]}}),null),U(p,j(pe,{get when(){return e.editable&&e.itemsDeletable&&e.activeQuery!==void 0},get children(){return j(fp,{get activeQuery(){return e.activeQuery},dataPath:h})}}),null),ve(w=>{var C=r().row,x=r().label;return C!==w.e&&ee(p,w.e=C),x!==w.t&&ee(v,w.t=x),w},{e:void 0,t:void 0}),p}}),null),ve(()=>ee(m,r().entry)),m})()}var Px=(e,t)=>{const{colors:n,font:r,size:i,border:s}=K,o=(a,l)=>e==="light"?a:l;return{entry:t`
78
79
  & * {
79
80
  font-size: ${r.size.xs};
80
81
  font-family:
@@ -186,7 +187,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
186
187
  outline: 2px solid ${n.blue[800]};
187
188
  outline-offset: 2px;
188
189
  }
189
- `}},Qs=e=>Ax("light",e),Ys=e=>Ax("dark",e);yc(["click"]);var UL=le('<div><div aria-hidden=true></div><button type=button aria-label="Open Tanstack query devtools"class=tsqd-open-btn>'),za=le("<div>"),VL=le('<aside aria-label="Tanstack query devtools"><div></div><button aria-label="Close tanstack query devtools">'),WL=le("<select name=tsqd-queries-filter-sort>"),GL=le("<select name=tsqd-mutations-filter-sort>"),QL=le("<span>Asc"),YL=le("<span>Desc"),XL=le('<button aria-label="Open in picture-in-picture mode"title="Open in picture-in-picture mode">'),JL=le("<div>Settings"),ZL=le("<span>Position"),eI=le("<span>Top"),tI=le("<span>Bottom"),nI=le("<span>Left"),rI=le("<span>Right"),iI=le("<span>Theme"),sI=le("<span>Light"),oI=le("<span>Dark"),aI=le("<span>System"),lI=le("<div><div class=tsqd-queries-container>"),cI=le("<div><div class=tsqd-mutations-container>"),uI=le('<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>'),hp=le("<option>Sort by "),dI=le("<div class=tsqd-query-disabled-indicator>disabled"),fI=le("<div class=tsqd-query-static-indicator>static"),Px=le("<button><div></div><code class=tsqd-query-hash>"),hI=le("<div role=tooltip id=tsqd-status-tooltip>"),gI=le("<span>"),yI=le("<button><span></span><span>"),mI=le("<button><span></span> Error"),pI=le('<div><span></span>Trigger Error<select><option value=""disabled selected>'),vI=le('<div class="tsqd-query-details-explorer-container tsqd-query-details-data-explorer">'),bI=le("<form><textarea name=data></textarea><div><span></span><div><button type=button>Cancel</button><button>Save"),xI=le('<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">'),wI=le("<option>"),SI=le('<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">'),[Qt,Uc]=re(null),[Fr,Tx]=re(null),[Sn,ih]=re(0),[vo,CI]=re(!1),_I=e=>{const t=yt(),n=ye().shadowDOMTarget?Pe.bind({target:ye().shadowDOMTarget}):Pe,r=H(()=>t()==="dark"?pn(n):mn(n)),i=H(()=>ye().onlineManager);dr(()=>{const d=i().subscribe(f=>{CI(!f)});Se(()=>{d()})});const s=Nf(),o=H(()=>ye().buttonPosition||k$),a=H(()=>e.localStore.open==="true"?!0:e.localStore.open==="false"?!1:ye().initialIsOpen||O$),l=H(()=>e.localStore.position||ye().position||Id);let c;xe(()=>{const d=c.parentElement,f=e.localStore.height||e1,h=e.localStore.width||t1,g=l();d.style.setProperty("--tsqd-panel-height",`${g==="top"?"-":""}${f}px`),d.style.setProperty("--tsqd-panel-width",`${g==="left"?"-":""}${h}px`)}),dr(()=>{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=H(()=>{var d;return(d=e.localStore.pip_open)!=null?d:"false"});return[j(ve,{get when(){return H(()=>!!s().pipWindow)()&&u()=="true"},get children(){return j(q0,{get mount(){var d;return(d=s().pipWindow)==null?void 0:d.document.body},get children(){return j(kI,{get children(){return j(sh,e)}})}})}}),(()=>{var d=za(),f=c;return typeof f=="function"?qs(f,d):c=d,U(d,j(Pm,{name:"tsqd-panel-transition",get children(){return j(ve,{get when(){return H(()=>!!(a()&&!s().pipWindow))()&&u()=="false"},get children(){return j(EI,{get localStore(){return e.localStore},get setLocalStore(){return e.setLocalStore}})}})}}),null),U(d,j(Pm,{name:"tsqd-button-transition",get children(){return j(ve,{get when(){return!a()},get children(){var h=UL(),g=h.firstChild,m=g.nextSibling;return U(g,j(lp,{})),m.$$click=()=>e.setLocalStore("open","true"),U(m,j(lp,{})),be(()=>ee(h,se(r().devtoolsBtn,r()[`devtoolsBtn-position-${o()}`],"tsqd-open-btn-container"))),h}})}}),null),be(()=>ee(d,se(n`
190
+ `}},Qs=e=>Px("light",e),Ys=e=>Px("dark",e);yc(["click"]);var XL=le('<div><div aria-hidden=true></div><button type=button aria-label="Open Tanstack query devtools"class=tsqd-open-btn>'),za=le("<div>"),JL=le('<aside aria-label="Tanstack query devtools"><div></div><button aria-label="Close tanstack query devtools">'),ZL=le("<select name=tsqd-queries-filter-sort>"),eI=le("<select name=tsqd-mutations-filter-sort>"),tI=le("<span>Asc"),nI=le("<span>Desc"),rI=le('<button aria-label="Open in picture-in-picture mode"title="Open in picture-in-picture mode">'),iI=le("<div>Settings"),sI=le("<span>Position"),oI=le("<span>Top"),aI=le("<span>Bottom"),lI=le("<span>Left"),cI=le("<span>Right"),uI=le("<span>Theme"),dI=le("<span>Light"),fI=le("<span>Dark"),hI=le("<span>System"),gI=le("<div><div class=tsqd-queries-container>"),yI=le("<div><div class=tsqd-mutations-container>"),mI=le('<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>'),gp=le("<option>Sort by "),pI=le("<div class=tsqd-query-disabled-indicator>disabled"),vI=le("<div class=tsqd-query-static-indicator>static"),Tx=le("<button><div></div><code class=tsqd-query-hash>"),bI=le("<div role=tooltip id=tsqd-status-tooltip>"),xI=le("<span>"),wI=le("<button><span></span><span>"),SI=le("<button><span></span> Error"),CI=le('<div><span></span>Trigger Error<select><option value=""disabled selected>'),_I=le('<div class="tsqd-query-details-explorer-container tsqd-query-details-data-explorer">'),kI=le("<form><textarea name=data></textarea><div><span></span><div><button type=button>Cancel</button><button>Save"),OI=le('<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">'),EI=le("<option>"),AI=le('<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">'),[Qt,Uc]=re(null),[Fr,jx]=re(null),[Sn,ih]=re(0),[vo,PI]=re(!1),TI=e=>{const t=mt(),n=ye().shadowDOMTarget?Te.bind({target:ye().shadowDOMTarget}):Te,r=H(()=>t()==="dark"?pn(n):mn(n)),i=H(()=>ye().onlineManager);dr(()=>{const d=i().subscribe(f=>{PI(!f)});we(()=>{d()})});const s=Nf(),o=H(()=>ye().buttonPosition||jM),a=H(()=>e.localStore.open==="true"?!0:e.localStore.open==="false"?!1:ye().initialIsOpen||$M),l=H(()=>e.localStore.position||ye().position||Id);let c;be(()=>{const d=c.parentElement,f=e.localStore.height||t1,h=e.localStore.width||n1,g=l();d.style.setProperty("--tsqd-panel-height",`${g==="top"?"-":""}${f}px`),d.style.setProperty("--tsqd-panel-width",`${g==="left"?"-":""}${h}px`)}),dr(()=>{const d=()=>{const f=c.parentElement,h=getComputedStyle(f).fontSize;f.style.setProperty("--tsqd-font-size",h)};d(),window.addEventListener("focus",d),we(()=>{window.removeEventListener("focus",d)})});const u=H(()=>{var d;return(d=e.localStore.pip_open)!=null?d:"false"});return[j(pe,{get when(){return H(()=>!!s().pipWindow)()&&u()=="true"},get children(){return j(z0,{get mount(){var d;return(d=s().pipWindow)==null?void 0:d.document.body},get children(){return j(jI,{get children(){return j(sh,e)}})}})}}),(()=>{var d=za(),f=c;return typeof f=="function"?qs(f,d):c=d,U(d,j(Tm,{name:"tsqd-panel-transition",get children(){return j(pe,{get when(){return H(()=>!!(a()&&!s().pipWindow))()&&u()=="false"},get children(){return j(MI,{get localStore(){return e.localStore},get setLocalStore(){return e.setLocalStore}})}})}}),null),U(d,j(Tm,{name:"tsqd-button-transition",get children(){return j(pe,{get when(){return!a()},get children(){var h=XL(),g=h.firstChild,m=g.nextSibling;return U(g,j(cp,{})),m.$$click=()=>e.setLocalStore("open","true"),U(m,j(cp,{})),ve(()=>ee(h,se(r().devtoolsBtn,r()[`devtoolsBtn-position-${o()}`],"tsqd-open-btn-container"))),h}})}}),null),ve(()=>ee(d,se(n`
190
191
  & .tsqd-panel-transition-exit-active,
191
192
  & .tsqd-panel-transition-enter-active {
192
193
  transition:
@@ -212,54 +213,54 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
212
213
  transform: ${o()==="relative"?"none;":o()==="top-left"?"translateX(-72px);":o()==="top-right"?"translateX(72px);":"translateY(72px);"};
213
214
  opacity: 0;
214
215
  }
215
- `,"tsqd-transitions-container"))),d})()]},kI=e=>{const t=Nf(),n=yt(),r=ye().shadowDOMTarget?Pe.bind({target:ye().shadowDOMTarget}):Pe,i=H(()=>n()==="dark"?pn(r):mn(r)),s=()=>{const{colors:o}=K,a=(l,c)=>n()==="dark"?c:l;return Sn()<ji?r`
216
+ `,"tsqd-transitions-container"))),d})()]},jI=e=>{const t=Nf(),n=mt(),r=ye().shadowDOMTarget?Te.bind({target:ye().shadowDOMTarget}):Te,i=H(()=>n()==="dark"?pn(r):mn(r)),s=()=>{const{colors:o}=K,a=(l,c)=>n()==="dark"?c:l;return Sn()<ji?r`
216
217
  flex-direction: column;
217
218
  background-color: ${a(o.gray[300],o.gray[600])};
218
219
  `:r`
219
220
  flex-direction: row;
220
221
  background-color: ${a(o.gray[200],o.darkGray[900])};
221
- `};return xe(()=>{const o=t().pipWindow,a=()=>{o&&ih(o.innerWidth)};o&&(o.addEventListener("resize",a),a()),Se(()=>{o&&o.removeEventListener("resize",a)})}),(()=>{var o=za();return o.style.setProperty("--tsqd-font-size","16px"),o.style.setProperty("max-height","100vh"),o.style.setProperty("height","100vh"),o.style.setProperty("width","100vw"),U(o,()=>e.children),be(()=>ee(o,se(i().panel,s(),{[r`
222
+ `};return be(()=>{const o=t().pipWindow,a=()=>{o&&ih(o.innerWidth)};o&&(o.addEventListener("resize",a),a()),we(()=>{o&&o.removeEventListener("resize",a)})}),(()=>{var o=za();return o.style.setProperty("--tsqd-font-size","16px"),o.style.setProperty("max-height","100vh"),o.style.setProperty("height","100vh"),o.style.setProperty("width","100vw"),U(o,()=>e.children),ve(()=>ee(o,se(i().panel,s(),{[r`
222
223
  min-width: min-content;
223
- `]:Sn()<If},"tsqd-main-panel"))),o})()},OI=e=>{const t=yt(),n=ye().shadowDOMTarget?Pe.bind({target:ye().shadowDOMTarget}):Pe,r=H(()=>t()==="dark"?pn(n):mn(n));let i;dr(()=>{l1(i,({width:o},a)=>{a===i&&ih(o)})});const s=()=>{const{colors:o}=K,a=(l,c)=>t()==="dark"?c:l;return Sn()<ji?n`
224
+ `]:Sn()<If},"tsqd-main-panel"))),o})()},$I=e=>{const t=mt(),n=ye().shadowDOMTarget?Te.bind({target:ye().shadowDOMTarget}):Te,r=H(()=>t()==="dark"?pn(n):mn(n));let i;dr(()=>{c1(i,({width:o},a)=>{a===i&&ih(o)})});const s=()=>{const{colors:o}=K,a=(l,c)=>t()==="dark"?c:l;return Sn()<ji?n`
224
225
  flex-direction: column;
225
226
  background-color: ${a(o.gray[300],o.gray[600])};
226
227
  `:n`
227
228
  flex-direction: row;
228
229
  background-color: ${a(o.gray[200],o.darkGray[900])};
229
- `};return(()=>{var o=za(),a=i;return typeof a=="function"?qs(a,o):i=o,o.style.setProperty("--tsqd-font-size","16px"),U(o,()=>e.children),be(()=>ee(o,se(r().parentPanel,s(),{[n`
230
+ `};return(()=>{var o=za(),a=i;return typeof a=="function"?qs(a,o):i=o,o.style.setProperty("--tsqd-font-size","16px"),U(o,()=>e.children),ve(()=>ee(o,se(r().parentPanel,s(),{[n`
230
231
  min-width: min-content;
231
- `]:Sn()<If},"tsqd-main-panel"))),o})()},EI=e=>{const t=yt(),n=ye().shadowDOMTarget?Pe.bind({target:ye().shadowDOMTarget}):Pe,r=H(()=>t()==="dark"?pn(n):mn(n)),[i,s]=re(!1),o=H(()=>e.localStore.position||ye().position||Id),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=Kh(3.5),b=Kh(12),w=x=>{if(x.preventDefault(),o()==="left"||o()==="right"){const k=o()==="right"?g-x.clientX:x.clientX-g;p=Math.round(h+k),p<b&&(p=b),e.setLocalStore("width",String(Math.round(p)));const S=d.getBoundingClientRect().width;Number(e.localStore.width)<S&&e.setLocalStore("width",String(S))}else{const k=o()==="bottom"?m-x.clientY:x.clientY-m;p=Math.round(f+k),p<v&&(p=v,Uc(null)),e.setLocalStore("height",String(Math.round(p)))}},C=()=>{i()&&s(!1),document.removeEventListener("mousemove",w,!1),document.removeEventListener("mouseUp",C,!1)};document.addEventListener("mousemove",w,!1),document.addEventListener("mouseup",C,!1)};let l;dr(()=>{l1(l,({width:u},d)=>{d===l&&ih(u)})}),xe(()=>{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||Id,f=dC("padding",d),h=e.localStore.position==="left"||e.localStore.position==="right",g=(({padding:v,paddingTop:b,paddingBottom:w,paddingLeft:C,paddingRight:x})=>({padding:v,paddingTop:b,paddingBottom:w,paddingLeft:C,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 Sn()<ji?n`
232
+ `]:Sn()<If},"tsqd-main-panel"))),o})()},MI=e=>{const t=mt(),n=ye().shadowDOMTarget?Te.bind({target:ye().shadowDOMTarget}):Te,r=H(()=>t()==="dark"?pn(n):mn(n)),[i,s]=re(!1),o=H(()=>e.localStore.position||ye().position||Id),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=Kh(3.5),b=Kh(12),w=x=>{if(x.preventDefault(),o()==="left"||o()==="right"){const k=o()==="right"?g-x.clientX:x.clientX-g;p=Math.round(h+k),p<b&&(p=b),e.setLocalStore("width",String(Math.round(p)));const S=d.getBoundingClientRect().width;Number(e.localStore.width)<S&&e.setLocalStore("width",String(S))}else{const k=o()==="bottom"?m-x.clientY:x.clientY-m;p=Math.round(f+k),p<v&&(p=v,Uc(null)),e.setLocalStore("height",String(Math.round(p)))}},C=()=>{i()&&s(!1),document.removeEventListener("mousemove",w,!1),document.removeEventListener("mouseUp",C,!1)};document.addEventListener("mousemove",w,!1),document.addEventListener("mouseup",C,!1)};let l;dr(()=>{c1(l,({width:u},d)=>{d===l&&ih(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||Id,f=fC("padding",d),h=e.localStore.position==="left"||e.localStore.position==="right",g=(({padding:v,paddingTop:b,paddingBottom:w,paddingLeft:C,paddingRight:x})=>({padding:v,paddingTop:b,paddingBottom:w,paddingLeft:C,paddingRight:x}))(u.style);u.style[f]=`${h?e.localStore.width:e.localStore.height}px`,we(()=>{Object.entries(g).forEach(([v,b])=>{u.style[v]=b})})});const c=()=>{const{colors:u}=K,d=(f,h)=>t()==="dark"?h:f;return Sn()<ji?n`
232
233
  flex-direction: column;
233
234
  background-color: ${d(u.gray[300],u.gray[600])};
234
235
  `:n`
235
236
  flex-direction: row;
236
237
  background-color: ${d(u.gray[200],u.darkGray[900])};
237
- `};return(()=>{var u=VL(),d=u.firstChild,f=d.nextSibling,h=l;return typeof h=="function"?qs(h,u):l=u,d.$$mousedown=a,f.$$click=()=>e.setLocalStore("open","false"),U(f,j(Fo,{})),U(u,j(sh,e),null),be(g=>{var m=se(r().panel,r()[`panel-position-${o()}`],c(),{[n`
238
+ `};return(()=>{var u=JL(),d=u.firstChild,f=d.nextSibling,h=l;return typeof h=="function"?qs(h,u):l=u,d.$$mousedown=a,f.$$click=()=>e.setLocalStore("open","false"),U(f,j(Fo,{})),U(u,j(sh,e),null),ve(g=>{var m=se(r().panel,r()[`panel-position-${o()}`],c(),{[n`
238
239
  min-width: min-content;
239
- `]:Sn()<If&&(o()==="right"||o()==="left")},"tsqd-main-panel"),p=o()==="bottom"||o()==="top"?`${e.localStore.height||e1}px`:"auto",v=o()==="right"||o()==="left"?`${e.localStore.width||t1}px`:"auto",b=se(r().dragHandle,r()[`dragHandle-position-${o()}`],"tsqd-drag-handle"),w=se(r().closeBtn,r()[`closeBtn-position-${o()}`],"tsqd-minimize-btn");return m!==g.e&&ee(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&&ee(d,g.o=b),w!==g.i&&ee(f,g.i=w),g},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),u})()},sh=e=>{DI(),LI();let t;const n=yt(),r=ye().shadowDOMTarget?Pe.bind({target:ye().shadowDOMTarget}):Pe,i=H(()=>n()==="dark"?pn(r):mn(r)),s=Nf(),[o,a]=re("queries"),l=H(()=>e.localStore.sort||A$),c=H(()=>Number(e.localStore.sortOrder)||Sm),u=H(()=>e.localStore.mutationSort||P$),d=H(()=>Number(e.localStore.mutationSortOrder)||Sm),f=H(()=>od[l()]),h=H(()=>ad[u()]),g=H(()=>ye().onlineManager),m=H(()=>ye().client.getQueryCache()),p=H(()=>ye().client.getMutationCache()),v=ft(S=>S().getAll().length,!1),b=H(ur(()=>[v(),e.localStore.filter,l(),c()],()=>{const S=m().getAll(),_=e.localStore.filter?S.filter(E=>Cm(E.queryHash,e.localStore.filter||"").passed):[...S];return f()?_.sort((E,T)=>f()(E,T)*c()):_})),w=wn(S=>S().getAll().length,!1),C=H(ur(()=>[w(),e.localStore.mutationFilter,u(),d()],()=>{const S=p().getAll(),_=e.localStore.mutationFilter?S.filter(E=>{const T=`${E.options.mutationKey?JSON.stringify(E.options.mutationKey)+" - ":""}${new Date(E.state.submittedAt).toLocaleString()}`;return Cm(T,e.localStore.mutationFilter||"").passed}):[...S];return h()?_.sort((E,T)=>h()(E,T)*d()):_})),x=S=>{e.setLocalStore("position",S)},k=S=>{const O=getComputedStyle(t).getPropertyValue("--tsqd-font-size");S.style.setProperty("--tsqd-font-size",O)};return[(()=>{var S=uI(),_=S.firstChild,O=_.firstChild,E=O.firstChild,T=E.firstChild,D=T.nextSibling,W=D.firstChild,N=_.nextSibling,L=N.firstChild,$=L.firstChild,I=$.firstChild,oe=$.nextSibling,ue=oe.nextSibling,B=L.nextSibling,X=B.firstChild,ae=X.nextSibling,ne=t;return typeof ne=="function"?qs(ne,S):t=S,E.$$click=()=>{if(!s().pipWindow&&!e.showPanelViewOnly){e.setLocalStore("open","false");return}e.onClose&&e.onClose()},U(D,()=>ye().queryFlavor,W),U(D,()=>ye().version,null),U(O,j(sn.Root,{get class(){return se(i().viewToggle)},get value(){return o()},onChange:R=>{a(R),Uc(null),Tx(null)},get children(){return[j(sn.Item,{value:"queries",class:"tsqd-radio-toggle",get children(){return[j(sn.ItemInput,{}),j(sn.ItemControl,{get children(){return j(sn.ItemIndicator,{})}}),j(sn.ItemLabel,{title:"Toggle Queries View",children:"Queries"})]}}),j(sn.Item,{value:"mutations",class:"tsqd-radio-toggle",get children(){return[j(sn.ItemInput,{}),j(sn.ItemControl,{get children(){return j(sn.ItemIndicator,{})}}),j(sn.ItemLabel,{title:"Toggle Mutations View",children:"Mutations"})]}})]}}),null),U(_,j(ve,{get when(){return o()==="queries"},get children(){return j(TI,{})}}),null),U(_,j(ve,{get when(){return o()==="mutations"},get children(){return j(jI,{})}}),null),U($,j(dL,{}),I),I.$$input=R=>{o()==="queries"?e.setLocalStore("filter",R.currentTarget.value):e.setLocalStore("mutationFilter",R.currentTarget.value)},U(oe,j(ve,{get when(){return o()==="queries"},get children(){var R=WL();return R.addEventListener("change",G=>{e.setLocalStore("sort",G.currentTarget.value)}),U(R,()=>Object.keys(od).map(G=>(()=>{var q=hp();return q.firstChild,q.value=G,U(q,G,null),q})())),be(()=>R.value=l()),R}}),null),U(oe,j(ve,{get when(){return o()==="mutations"},get children(){var R=GL();return R.addEventListener("change",G=>{e.setLocalStore("mutationSort",G.currentTarget.value)}),U(R,()=>Object.keys(ad).map(G=>(()=>{var q=hp();return q.firstChild,q.value=G,U(q,G,null),q})())),be(()=>R.value=u()),R}}),null),U(oe,j(Fo,{}),null),ue.$$click=()=>{o()==="queries"?e.setLocalStore("sortOrder",String(c()*-1)):e.setLocalStore("mutationSortOrder",String(d()*-1))},U(ue,j(ve,{get when(){return(o()==="queries"?c():d())===1},get children(){return[QL(),j(op,{})]}}),null),U(ue,j(ve,{get when(){return(o()==="queries"?c():d())===-1},get children(){return[YL(),j(ap,{})]}}),null),X.$$click=()=>{o()==="queries"?(Ln({type:"CLEAR_QUERY_CACHE"}),m().clear()):(Ln({type:"CLEAR_MUTATION_CACHE"}),p().clear())},U(X,j(Ex,{})),ae.$$click=()=>{g().setOnline(!g().isOnline())},U(ae,(()=>{var R=H(()=>!!vo());return()=>R()?j(vL,{}):j(pL,{})})()),U(B,j(ve,{get when(){return H(()=>!s().pipWindow)()&&!s().disabled},get children(){var R=XL();return R.$$click=()=>{var G;s().requestPipWindow(Number(window.innerWidth),Number((G=e.localStore.height)!=null?G:500))},U(R,j(xL,{})),be(()=>ee(R,se(i().actionsBtn,"tsqd-actions-btn","tsqd-action-open-pip"))),R}}),null),U(B,j(lt.Root,{gutter:4,get children(){return[j(lt.Trigger,{get class(){return se(i().actionsBtn,"tsqd-actions-btn","tsqd-action-settings")},get children(){return j(bL,{})}}),j(lt.Portal,{ref:R=>k(R),get mount(){return H(()=>!!s().pipWindow)()?s().pipWindow.document.body:document.body},get children(){return j(lt.Content,{get class(){return se(i().settingsMenu,"tsqd-settings-menu")},get children(){return[(()=>{var R=JL();return be(()=>ee(R,se(i().settingsMenuHeader,"tsqd-settings-menu-header"))),R})(),j(ve,{get when(){return!e.showPanelViewOnly},get children(){return j(lt.Sub,{overlap:!0,gutter:8,shift:-4,get children(){return[j(lt.SubTrigger,{get class(){return se(i().settingsSubTrigger,"tsqd-settings-menu-sub-trigger","tsqd-settings-menu-sub-trigger-position")},get children(){return[ZL(),j(Fo,{})]}}),j(lt.Portal,{ref:R=>k(R),get mount(){return H(()=>!!s().pipWindow)()?s().pipWindow.document.body:document.body},get children(){return j(lt.SubContent,{get class(){return se(i().settingsMenu,"tsqd-settings-submenu")},get children(){return[j(lt.Item,{onSelect:()=>{x("top")},as:"button",get class(){return se(i().settingsSubButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-top")},get children(){return[eI(),j(op,{})]}}),j(lt.Item,{onSelect:()=>{x("bottom")},as:"button",get class(){return se(i().settingsSubButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-bottom")},get children(){return[tI(),j(ap,{})]}}),j(lt.Item,{onSelect:()=>{x("left")},as:"button",get class(){return se(i().settingsSubButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-left")},get children(){return[nI(),j(fL,{})]}}),j(lt.Item,{onSelect:()=>{x("right")},as:"button",get class(){return se(i().settingsSubButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-right")},get children(){return[rI(),j(hL,{})]}})]}})}})]}})}}),j(lt.Sub,{overlap:!0,gutter:8,shift:-4,get children(){return[j(lt.SubTrigger,{get class(){return se(i().settingsSubTrigger,"tsqd-settings-menu-sub-trigger","tsqd-settings-menu-sub-trigger-position")},get children(){return[iI(),j(Fo,{})]}}),j(lt.Portal,{ref:R=>k(R),get mount(){return H(()=>!!s().pipWindow)()?s().pipWindow.document.body:document.body},get children(){return j(lt.SubContent,{get class(){return se(i().settingsMenu,"tsqd-settings-submenu")},get children(){return[j(lt.Item,{onSelect:()=>{e.setLocalStore("theme_preference","light")},as:"button",get class(){return se(i().settingsSubButton,e.localStore.theme_preference==="light"&&i().themeSelectedButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-top")},get children(){return[sI(),j(gL,{})]}}),j(lt.Item,{onSelect:()=>{e.setLocalStore("theme_preference","dark")},as:"button",get class(){return se(i().settingsSubButton,e.localStore.theme_preference==="dark"&&i().themeSelectedButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-bottom")},get children(){return[oI(),j(yL,{})]}}),j(lt.Item,{onSelect:()=>{e.setLocalStore("theme_preference","system")},as:"button",get class(){return se(i().settingsSubButton,e.localStore.theme_preference==="system"&&i().themeSelectedButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-left")},get children(){return[aI(),j(mL,{})]}})]}})}})]}})]}})}})]}}),null),U(S,j(ve,{get when(){return o()==="queries"},get children(){var R=lI(),G=R.firstChild;return U(G,j(nc,{by:q=>q.queryHash,get each(){return b()},children:q=>j(AI,{get query(){return q()}})})),be(()=>ee(R,se(i().overflowQueryContainer,"tsqd-queries-overflow-container"))),R}}),null),U(S,j(ve,{get when(){return o()==="mutations"},get children(){var R=cI(),G=R.firstChild;return U(G,j(nc,{by:q=>q.mutationId,get each(){return C()},children:q=>j(PI,{get mutation(){return q()}})})),be(()=>ee(R,se(i().overflowQueryContainer,"tsqd-mutations-overflow-container"))),R}}),null),be(R=>{var G=se(i().queriesContainer,Sn()<ji&&(Qt()||Fr())&&r`
240
+ `]:Sn()<If&&(o()==="right"||o()==="left")},"tsqd-main-panel"),p=o()==="bottom"||o()==="top"?`${e.localStore.height||t1}px`:"auto",v=o()==="right"||o()==="left"?`${e.localStore.width||n1}px`:"auto",b=se(r().dragHandle,r()[`dragHandle-position-${o()}`],"tsqd-drag-handle"),w=se(r().closeBtn,r()[`closeBtn-position-${o()}`],"tsqd-minimize-btn");return m!==g.e&&ee(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&&ee(d,g.o=b),w!==g.i&&ee(f,g.i=w),g},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),u})()},sh=e=>{BI(),qI();let t;const n=mt(),r=ye().shadowDOMTarget?Te.bind({target:ye().shadowDOMTarget}):Te,i=H(()=>n()==="dark"?pn(r):mn(r)),s=Nf(),[o,a]=re("queries"),l=H(()=>e.localStore.sort||DM),c=H(()=>Number(e.localStore.sortOrder)||Cm),u=H(()=>e.localStore.mutationSort||LM),d=H(()=>Number(e.localStore.mutationSortOrder)||Cm),f=H(()=>od[l()]),h=H(()=>ad[u()]),g=H(()=>ye().onlineManager),m=H(()=>ye().client.getQueryCache()),p=H(()=>ye().client.getMutationCache()),v=ht(S=>S().getAll().length,!1),b=H(ur(()=>[v(),e.localStore.filter,l(),c()],()=>{const S=m().getAll(),_=e.localStore.filter?S.filter(E=>_m(E.queryHash,e.localStore.filter||"").passed):[...S];return f()?_.sort((E,T)=>f()(E,T)*c()):_})),w=wn(S=>S().getAll().length,!1),C=H(ur(()=>[w(),e.localStore.mutationFilter,u(),d()],()=>{const S=p().getAll(),_=e.localStore.mutationFilter?S.filter(E=>{const T=`${E.options.mutationKey?JSON.stringify(E.options.mutationKey)+" - ":""}${new Date(E.state.submittedAt).toLocaleString()}`;return _m(T,e.localStore.mutationFilter||"").passed}):[...S];return h()?_.sort((E,T)=>h()(E,T)*d()):_})),x=S=>{e.setLocalStore("position",S)},k=S=>{const O=getComputedStyle(t).getPropertyValue("--tsqd-font-size");S.style.setProperty("--tsqd-font-size",O)};return[(()=>{var S=mI(),_=S.firstChild,O=_.firstChild,E=O.firstChild,T=E.firstChild,D=T.nextSibling,G=D.firstChild,N=_.nextSibling,L=N.firstChild,M=L.firstChild,I=M.firstChild,oe=M.nextSibling,ue=oe.nextSibling,B=L.nextSibling,J=B.firstChild,ae=J.nextSibling,ne=t;return typeof ne=="function"?qs(ne,S):t=S,E.$$click=()=>{if(!s().pipWindow&&!e.showPanelViewOnly){e.setLocalStore("open","false");return}e.onClose&&e.onClose()},U(D,()=>ye().queryFlavor,G),U(D,()=>ye().version,null),U(O,j(sn.Root,{get class(){return se(i().viewToggle)},get value(){return o()},onChange:R=>{a(R),Uc(null),jx(null)},get children(){return[j(sn.Item,{value:"queries",class:"tsqd-radio-toggle",get children(){return[j(sn.ItemInput,{}),j(sn.ItemControl,{get children(){return j(sn.ItemIndicator,{})}}),j(sn.ItemLabel,{title:"Toggle Queries View",children:"Queries"})]}}),j(sn.Item,{value:"mutations",class:"tsqd-radio-toggle",get children(){return[j(sn.ItemInput,{}),j(sn.ItemControl,{get children(){return j(sn.ItemIndicator,{})}}),j(sn.ItemLabel,{title:"Toggle Mutations View",children:"Mutations"})]}})]}}),null),U(_,j(pe,{get when(){return o()==="queries"},get children(){return j(II,{})}}),null),U(_,j(pe,{get when(){return o()==="mutations"},get children(){return j(RI,{})}}),null),U(M,j(pL,{}),I),I.$$input=R=>{o()==="queries"?e.setLocalStore("filter",R.currentTarget.value):e.setLocalStore("mutationFilter",R.currentTarget.value)},U(oe,j(pe,{get when(){return o()==="queries"},get children(){var R=ZL();return R.addEventListener("change",Q=>{e.setLocalStore("sort",Q.currentTarget.value)}),U(R,()=>Object.keys(od).map(Q=>(()=>{var q=gp();return q.firstChild,q.value=Q,U(q,Q,null),q})())),ve(()=>R.value=l()),R}}),null),U(oe,j(pe,{get when(){return o()==="mutations"},get children(){var R=eI();return R.addEventListener("change",Q=>{e.setLocalStore("mutationSort",Q.currentTarget.value)}),U(R,()=>Object.keys(ad).map(Q=>(()=>{var q=gp();return q.firstChild,q.value=Q,U(q,Q,null),q})())),ve(()=>R.value=u()),R}}),null),U(oe,j(Fo,{}),null),ue.$$click=()=>{o()==="queries"?e.setLocalStore("sortOrder",String(c()*-1)):e.setLocalStore("mutationSortOrder",String(d()*-1))},U(ue,j(pe,{get when(){return(o()==="queries"?c():d())===1},get children(){return[tI(),j(ap,{})]}}),null),U(ue,j(pe,{get when(){return(o()==="queries"?c():d())===-1},get children(){return[nI(),j(lp,{})]}}),null),J.$$click=()=>{o()==="queries"?(Ln({type:"CLEAR_QUERY_CACHE"}),m().clear()):(Ln({type:"CLEAR_MUTATION_CACHE"}),p().clear())},U(J,j(Ax,{})),ae.$$click=()=>{g().setOnline(!g().isOnline())},U(ae,(()=>{var R=H(()=>!!vo());return()=>R()?j(_L,{}):j(CL,{})})()),U(B,j(pe,{get when(){return H(()=>!s().pipWindow)()&&!s().disabled},get children(){var R=rI();return R.$$click=()=>{var Q;s().requestPipWindow(Number(window.innerWidth),Number((Q=e.localStore.height)!=null?Q:500))},U(R,j(OL,{})),ve(()=>ee(R,se(i().actionsBtn,"tsqd-actions-btn","tsqd-action-open-pip"))),R}}),null),U(B,j(ct.Root,{gutter:4,get children(){return[j(ct.Trigger,{get class(){return se(i().actionsBtn,"tsqd-actions-btn","tsqd-action-settings")},get children(){return j(kL,{})}}),j(ct.Portal,{ref:R=>k(R),get mount(){return H(()=>!!s().pipWindow)()?s().pipWindow.document.body:document.body},get children(){return j(ct.Content,{get class(){return se(i().settingsMenu,"tsqd-settings-menu")},get children(){return[(()=>{var R=iI();return ve(()=>ee(R,se(i().settingsMenuHeader,"tsqd-settings-menu-header"))),R})(),j(pe,{get when(){return!e.showPanelViewOnly},get children(){return j(ct.Sub,{overlap:!0,gutter:8,shift:-4,get children(){return[j(ct.SubTrigger,{get class(){return se(i().settingsSubTrigger,"tsqd-settings-menu-sub-trigger","tsqd-settings-menu-sub-trigger-position")},get children(){return[sI(),j(Fo,{})]}}),j(ct.Portal,{ref:R=>k(R),get mount(){return H(()=>!!s().pipWindow)()?s().pipWindow.document.body:document.body},get children(){return j(ct.SubContent,{get class(){return se(i().settingsMenu,"tsqd-settings-submenu")},get children(){return[j(ct.Item,{onSelect:()=>{x("top")},as:"button",get class(){return se(i().settingsSubButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-top")},get children(){return[oI(),j(ap,{})]}}),j(ct.Item,{onSelect:()=>{x("bottom")},as:"button",get class(){return se(i().settingsSubButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-bottom")},get children(){return[aI(),j(lp,{})]}}),j(ct.Item,{onSelect:()=>{x("left")},as:"button",get class(){return se(i().settingsSubButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-left")},get children(){return[lI(),j(vL,{})]}}),j(ct.Item,{onSelect:()=>{x("right")},as:"button",get class(){return se(i().settingsSubButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-right")},get children(){return[cI(),j(bL,{})]}})]}})}})]}})}}),j(ct.Sub,{overlap:!0,gutter:8,shift:-4,get children(){return[j(ct.SubTrigger,{get class(){return se(i().settingsSubTrigger,"tsqd-settings-menu-sub-trigger","tsqd-settings-menu-sub-trigger-position")},get children(){return[uI(),j(Fo,{})]}}),j(ct.Portal,{ref:R=>k(R),get mount(){return H(()=>!!s().pipWindow)()?s().pipWindow.document.body:document.body},get children(){return j(ct.SubContent,{get class(){return se(i().settingsMenu,"tsqd-settings-submenu")},get children(){return[j(ct.Item,{onSelect:()=>{e.setLocalStore("theme_preference","light")},as:"button",get class(){return se(i().settingsSubButton,e.localStore.theme_preference==="light"&&i().themeSelectedButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-top")},get children(){return[dI(),j(xL,{})]}}),j(ct.Item,{onSelect:()=>{e.setLocalStore("theme_preference","dark")},as:"button",get class(){return se(i().settingsSubButton,e.localStore.theme_preference==="dark"&&i().themeSelectedButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-bottom")},get children(){return[fI(),j(wL,{})]}}),j(ct.Item,{onSelect:()=>{e.setLocalStore("theme_preference","system")},as:"button",get class(){return se(i().settingsSubButton,e.localStore.theme_preference==="system"&&i().themeSelectedButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-left")},get children(){return[hI(),j(SL,{})]}})]}})}})]}})]}})}})]}}),null),U(S,j(pe,{get when(){return o()==="queries"},get children(){var R=gI(),Q=R.firstChild;return U(Q,j(nc,{by:q=>q.queryHash,get each(){return b()},children:q=>j(DI,{get query(){return q()}})})),ve(()=>ee(R,se(i().overflowQueryContainer,"tsqd-queries-overflow-container"))),R}}),null),U(S,j(pe,{get when(){return o()==="mutations"},get children(){var R=yI(),Q=R.firstChild;return U(Q,j(nc,{by:q=>q.mutationId,get each(){return C()},children:q=>j(LI,{get mutation(){return q()}})})),ve(()=>ee(R,se(i().overflowQueryContainer,"tsqd-mutations-overflow-container"))),R}}),null),ve(R=>{var Q=se(i().queriesContainer,Sn()<ji&&(Qt()||Fr())&&r`
240
241
  height: 50%;
241
242
  max-height: 50%;
242
243
  `,Sn()<ji&&!(Qt()||Fr())&&r`
243
244
  height: 100%;
244
245
  max-height: 100%;
245
- `,"tsqd-queries-container"),q=se(i().row,"tsqd-header"),ce=i().logoAndToggleContainer,V=se(i().logo,"tsqd-text-logo-container"),de=se(i().tanstackLogo,"tsqd-text-logo-tanstack"),fe=se(i().queryFlavorLogo,"tsqd-text-logo-query-flavor"),Ne=se(i().row,"tsqd-filters-actions-container"),te=se(i().filtersContainer,"tsqd-filters-container"),De=se(i().filterInput,"tsqd-query-filter-textfield-container"),me=se("tsqd-query-filter-textfield"),Te=se(i().filterSelect,"tsqd-query-filter-sort-container"),je=`Sort order ${(o()==="queries"?c():d())===-1?"descending":"ascending"}`,Et=(o()==="queries"?c():d())===-1,Z=se(i().actionsContainer,"tsqd-actions-container"),Me=se(i().actionsBtn,"tsqd-actions-btn","tsqd-action-clear-cache"),Je=`Clear ${o()} cache`,Le=se(i().actionsBtn,vo()&&i().actionsBtnOffline,"tsqd-actions-btn","tsqd-action-mock-offline-behavior"),Ie=`${vo()?"Unset offline mocking behavior":"Mock offline behavior"}`,he=vo(),we=`${vo()?"Unset offline mocking behavior":"Mock offline behavior"}`;return G!==R.e&&ee(S,R.e=G),q!==R.t&&ee(_,R.t=q),ce!==R.a&&ee(O,R.a=ce),V!==R.o&&ee(E,R.o=V),de!==R.i&&ee(T,R.i=de),fe!==R.n&&ee(D,R.n=fe),Ne!==R.s&&ee(N,R.s=Ne),te!==R.h&&ee(L,R.h=te),De!==R.r&&ee($,R.r=De),me!==R.d&&ee(I,R.d=me),Te!==R.l&&ee(oe,R.l=Te),je!==R.u&&J(ue,"aria-label",R.u=je),Et!==R.c&&J(ue,"aria-pressed",R.c=Et),Z!==R.w&&ee(B,R.w=Z),Me!==R.m&&ee(X,R.m=Me),Je!==R.f&&J(X,"title",R.f=Je),Le!==R.y&&ee(ae,R.y=Le),Ie!==R.g&&J(ae,"aria-label",R.g=Ie),he!==R.p&&J(ae,"aria-pressed",R.p=he),we!==R.b&&J(ae,"title",R.b=we),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}),be(()=>I.value=o()==="queries"?e.localStore.filter||"":e.localStore.mutationFilter||""),S})(),j(ve,{get when(){return H(()=>o()==="queries")()&&Qt()},get children(){return j(MI,{})}}),j(ve,{get when(){return H(()=>o()==="mutations")()&&Fr()},get children(){return j($I,{})}})]},AI=e=>{const t=yt(),n=ye().shadowDOMTarget?Pe.bind({target:ye().shadowDOMTarget}):Pe,r=H(()=>t()==="dark"?pn(n):mn(n)),{colors:i,alpha:s}=K,o=(g,m)=>t()==="dark"?m:g,a=ft(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=ft(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=ft(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=ft(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=ft(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=H(()=>fC({queryState:a(),observerCount:d(),isStale:u()})),h=()=>f()==="gray"?n`
246
+ `,"tsqd-queries-container"),q=se(i().row,"tsqd-header"),ce=i().logoAndToggleContainer,W=se(i().logo,"tsqd-text-logo-container"),de=se(i().tanstackLogo,"tsqd-text-logo-tanstack"),fe=se(i().queryFlavorLogo,"tsqd-text-logo-query-flavor"),Le=se(i().row,"tsqd-filters-actions-container"),te=se(i().filtersContainer,"tsqd-filters-container"),et=se(i().filterInput,"tsqd-query-filter-textfield-container"),_e=se("tsqd-query-filter-textfield"),Ie=se(i().filterSelect,"tsqd-query-filter-sort-container"),Re=`Sort order ${(o()==="queries"?c():d())===-1?"descending":"ascending"}`,ze=(o()==="queries"?c():d())===-1,V=se(i().actionsContainer,"tsqd-actions-container"),Ee=se(i().actionsBtn,"tsqd-actions-btn","tsqd-action-clear-cache"),He=`Clear ${o()} cache`,$e=se(i().actionsBtn,vo()&&i().actionsBtnOffline,"tsqd-actions-btn","tsqd-action-mock-offline-behavior"),Me=`${vo()?"Unset offline mocking behavior":"Mock offline behavior"}`,he=vo(),xe=`${vo()?"Unset offline mocking behavior":"Mock offline behavior"}`;return Q!==R.e&&ee(S,R.e=Q),q!==R.t&&ee(_,R.t=q),ce!==R.a&&ee(O,R.a=ce),W!==R.o&&ee(E,R.o=W),de!==R.i&&ee(T,R.i=de),fe!==R.n&&ee(D,R.n=fe),Le!==R.s&&ee(N,R.s=Le),te!==R.h&&ee(L,R.h=te),et!==R.r&&ee(M,R.r=et),_e!==R.d&&ee(I,R.d=_e),Ie!==R.l&&ee(oe,R.l=Ie),Re!==R.u&&Z(ue,"aria-label",R.u=Re),ze!==R.c&&Z(ue,"aria-pressed",R.c=ze),V!==R.w&&ee(B,R.w=V),Ee!==R.m&&ee(J,R.m=Ee),He!==R.f&&Z(J,"title",R.f=He),$e!==R.y&&ee(ae,R.y=$e),Me!==R.g&&Z(ae,"aria-label",R.g=Me),he!==R.p&&Z(ae,"aria-pressed",R.p=he),xe!==R.b&&Z(ae,"title",R.b=xe),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(()=>I.value=o()==="queries"?e.localStore.filter||"":e.localStore.mutationFilter||""),S})(),j(pe,{get when(){return H(()=>o()==="queries")()&&Qt()},get children(){return j(NI,{})}}),j(pe,{get when(){return H(()=>o()==="mutations")()&&Fr()},get children(){return j(FI,{})}})]},DI=e=>{const t=mt(),n=ye().shadowDOMTarget?Te.bind({target:ye().shadowDOMTarget}):Te,r=H(()=>t()==="dark"?pn(n):mn(n)),{colors:i,alpha:s}=K,o=(g,m)=>t()==="dark"?m:g,a=ht(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=ht(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=ht(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=ht(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=ht(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=H(()=>hC({queryState:a(),observerCount:d(),isStale:u()})),h=()=>f()==="gray"?n`
246
247
  background-color: ${o(i[f()][200],i[f()][700])};
247
248
  color: ${o(i[f()][700],i[f()][300])};
248
249
  `:n`
249
250
  background-color: ${o(i[f()][200]+s[80],i[f()][900])};
250
251
  color: ${o(i[f()][800],i[f()][300])};
251
- `;return j(ve,{get when(){return a()},get children(){var g=Px(),m=g.firstChild,p=m.nextSibling;return g.$$click=()=>Uc(e.query.queryHash===Qt()?null:e.query.queryHash),U(m,d),U(p,()=>e.query.queryHash),U(g,j(ve,{get when(){return l()},get children(){return dI()}}),null),U(g,j(ve,{get when(){return c()},get children(){return fI()}}),null),be(v=>{var b=se(r().queryRow,Qt()===e.query.queryHash&&r().selectedQueryRow,"tsqd-query-row"),w=`Query key ${e.query.queryHash}`,C=se(h(),"tsqd-query-observer-count");return b!==v.e&&ee(g,v.e=b),w!==v.t&&J(g,"aria-label",v.t=w),C!==v.a&&ee(m,v.a=C),v},{e:void 0,t:void 0,a:void 0}),g}})},PI=e=>{const t=yt(),n=ye().shadowDOMTarget?Pe.bind({target:ye().shadowDOMTarget}):Pe,r=H(()=>t()==="dark"?pn(n):mn(n)),{colors:i,alpha:s}=K,o=(f,h)=>t()==="dark"?h:f,a=wn(f=>{const g=f().getAll().find(m=>m.mutationId===e.mutation.mutationId);return g==null?void 0:g.state}),l=wn(f=>{const g=f().getAll().find(m=>m.mutationId===e.mutation.mutationId);return g?g.state.isPaused:!1}),c=wn(f=>{const g=f().getAll().find(m=>m.mutationId===e.mutation.mutationId);return g?g.state.status:"idle"}),u=H(()=>Yi({isPaused:l(),status:c()})),d=()=>u()==="gray"?n`
252
+ `;return j(pe,{get when(){return a()},get children(){var g=Tx(),m=g.firstChild,p=m.nextSibling;return g.$$click=()=>Uc(e.query.queryHash===Qt()?null:e.query.queryHash),U(m,d),U(p,()=>e.query.queryHash),U(g,j(pe,{get when(){return l()},get children(){return pI()}}),null),U(g,j(pe,{get when(){return c()},get children(){return vI()}}),null),ve(v=>{var b=se(r().queryRow,Qt()===e.query.queryHash&&r().selectedQueryRow,"tsqd-query-row"),w=`Query key ${e.query.queryHash}`,C=se(h(),"tsqd-query-observer-count");return b!==v.e&&ee(g,v.e=b),w!==v.t&&Z(g,"aria-label",v.t=w),C!==v.a&&ee(m,v.a=C),v},{e:void 0,t:void 0,a:void 0}),g}})},LI=e=>{const t=mt(),n=ye().shadowDOMTarget?Te.bind({target:ye().shadowDOMTarget}):Te,r=H(()=>t()==="dark"?pn(n):mn(n)),{colors:i,alpha:s}=K,o=(f,h)=>t()==="dark"?h:f,a=wn(f=>{const g=f().getAll().find(m=>m.mutationId===e.mutation.mutationId);return g==null?void 0:g.state}),l=wn(f=>{const g=f().getAll().find(m=>m.mutationId===e.mutation.mutationId);return g?g.state.isPaused:!1}),c=wn(f=>{const g=f().getAll().find(m=>m.mutationId===e.mutation.mutationId);return g?g.state.status:"idle"}),u=H(()=>Yi({isPaused:l(),status:c()})),d=()=>u()==="gray"?n`
252
253
  background-color: ${o(i[u()][200],i[u()][700])};
253
254
  color: ${o(i[u()][700],i[u()][300])};
254
255
  `:n`
255
256
  background-color: ${o(i[u()][200]+s[80],i[u()][900])};
256
257
  color: ${o(i[u()][800],i[u()][300])};
257
- `;return j(ve,{get when(){return a()},get children(){var f=Px(),h=f.firstChild,g=h.nextSibling;return f.$$click=()=>{Tx(e.mutation.mutationId===Fr()?null:e.mutation.mutationId)},U(h,j(ve,{get when(){return u()==="purple"},get children(){return j(TL,{})}}),null),U(h,j(ve,{get when(){return u()==="green"},get children(){return j(EL,{})}}),null),U(h,j(ve,{get when(){return u()==="red"},get children(){return j(PL,{})}}),null),U(h,j(ve,{get when(){return u()==="yellow"},get children(){return j(AL,{})}}),null),U(g,j(ve,{get when(){return e.mutation.options.mutationKey},get children(){return[H(()=>JSON.stringify(e.mutation.options.mutationKey))," -"," "]}}),null),U(g,()=>new Date(e.mutation.state.submittedAt).toLocaleString(),null),be(m=>{var p=se(r().queryRow,Fr()===e.mutation.mutationId&&r().selectedQueryRow,"tsqd-query-row"),v=`Mutation submitted at ${new Date(e.mutation.state.submittedAt).toLocaleString()}`,b=se(d(),"tsqd-query-observer-count");return p!==m.e&&ee(f,m.e=p),v!==m.t&&J(f,"aria-label",m.t=v),b!==m.a&&ee(h,m.a=b),m},{e:void 0,t:void 0,a:void 0}),f}})},TI=()=>{const e=ft(l=>l().getAll().filter(c=>Vi(c)==="stale").length),t=ft(l=>l().getAll().filter(c=>Vi(c)==="fresh").length),n=ft(l=>l().getAll().filter(c=>Vi(c)==="fetching").length),r=ft(l=>l().getAll().filter(c=>Vi(c)==="paused").length),i=ft(l=>l().getAll().filter(c=>Vi(c)==="inactive").length),s=yt(),o=ye().shadowDOMTarget?Pe.bind({target:ye().shadowDOMTarget}):Pe,a=H(()=>s()==="dark"?pn(o):mn(o));return(()=>{var l=za();return U(l,j(rr,{label:"Fresh",color:"green",get count(){return t()}}),null),U(l,j(rr,{label:"Fetching",color:"blue",get count(){return n()}}),null),U(l,j(rr,{label:"Paused",color:"purple",get count(){return r()}}),null),U(l,j(rr,{label:"Stale",color:"yellow",get count(){return e()}}),null),U(l,j(rr,{label:"Inactive",color:"gray",get count(){return i()}}),null),be(()=>ee(l,se(a().queryStatusContainer,"tsqd-query-status-container"))),l})()},jI=()=>{const e=wn(a=>a().getAll().filter(l=>Yi({isPaused:l.state.isPaused,status:l.state.status})==="green").length),t=wn(a=>a().getAll().filter(l=>Yi({isPaused:l.state.isPaused,status:l.state.status})==="yellow").length),n=wn(a=>a().getAll().filter(l=>Yi({isPaused:l.state.isPaused,status:l.state.status})==="purple").length),r=wn(a=>a().getAll().filter(l=>Yi({isPaused:l.state.isPaused,status:l.state.status})==="red").length),i=yt(),s=ye().shadowDOMTarget?Pe.bind({target:ye().shadowDOMTarget}):Pe,o=H(()=>i()==="dark"?pn(s):mn(s));return(()=>{var a=za();return U(a,j(rr,{label:"Paused",color:"purple",get count(){return n()}}),null),U(a,j(rr,{label:"Pending",color:"yellow",get count(){return t()}}),null),U(a,j(rr,{label:"Success",color:"green",get count(){return e()}}),null),U(a,j(rr,{label:"Error",color:"red",get count(){return r()}}),null),be(()=>ee(a,se(o().queryStatusContainer,"tsqd-query-status-container"))),a})()},rr=e=>{const t=yt(),n=ye().shadowDOMTarget?Pe.bind({target:ye().shadowDOMTarget}):Pe,r=H(()=>t()==="dark"?pn(n):mn(n)),{colors:i,alpha:s}=K,o=(h,g)=>t()==="dark"?g:h;let a;const[l,c]=re(!1),[u,d]=re(!1),f=H(()=>!(Qt()&&Sn()<_$&&Sn()>ji||Sn()<ji));return(()=>{var h=yI(),g=h.firstChild,m=g.nextSibling,p=a;return typeof p=="function"?qs(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)),N0(h,Oe({get disabled(){return f()},get class(){return se(r().queryStatusTag,!f()&&n`
258
+ `;return j(pe,{get when(){return a()},get children(){var f=Tx(),h=f.firstChild,g=h.nextSibling;return f.$$click=()=>{jx(e.mutation.mutationId===Fr()?null:e.mutation.mutationId)},U(h,j(pe,{get when(){return u()==="purple"},get children(){return j(IL,{})}}),null),U(h,j(pe,{get when(){return u()==="green"},get children(){return j(ML,{})}}),null),U(h,j(pe,{get when(){return u()==="red"},get children(){return j(LL,{})}}),null),U(h,j(pe,{get when(){return u()==="yellow"},get children(){return j(DL,{})}}),null),U(g,j(pe,{get when(){return e.mutation.options.mutationKey},get children(){return[H(()=>JSON.stringify(e.mutation.options.mutationKey))," -"," "]}}),null),U(g,()=>new Date(e.mutation.state.submittedAt).toLocaleString(),null),ve(m=>{var p=se(r().queryRow,Fr()===e.mutation.mutationId&&r().selectedQueryRow,"tsqd-query-row"),v=`Mutation submitted at ${new Date(e.mutation.state.submittedAt).toLocaleString()}`,b=se(d(),"tsqd-query-observer-count");return p!==m.e&&ee(f,m.e=p),v!==m.t&&Z(f,"aria-label",m.t=v),b!==m.a&&ee(h,m.a=b),m},{e:void 0,t:void 0,a:void 0}),f}})},II=()=>{const e=ht(l=>l().getAll().filter(c=>Wi(c)==="stale").length),t=ht(l=>l().getAll().filter(c=>Wi(c)==="fresh").length),n=ht(l=>l().getAll().filter(c=>Wi(c)==="fetching").length),r=ht(l=>l().getAll().filter(c=>Wi(c)==="paused").length),i=ht(l=>l().getAll().filter(c=>Wi(c)==="inactive").length),s=mt(),o=ye().shadowDOMTarget?Te.bind({target:ye().shadowDOMTarget}):Te,a=H(()=>s()==="dark"?pn(o):mn(o));return(()=>{var l=za();return U(l,j(rr,{label:"Fresh",color:"green",get count(){return t()}}),null),U(l,j(rr,{label:"Fetching",color:"blue",get count(){return n()}}),null),U(l,j(rr,{label:"Paused",color:"purple",get count(){return r()}}),null),U(l,j(rr,{label:"Stale",color:"yellow",get count(){return e()}}),null),U(l,j(rr,{label:"Inactive",color:"gray",get count(){return i()}}),null),ve(()=>ee(l,se(a().queryStatusContainer,"tsqd-query-status-container"))),l})()},RI=()=>{const e=wn(a=>a().getAll().filter(l=>Yi({isPaused:l.state.isPaused,status:l.state.status})==="green").length),t=wn(a=>a().getAll().filter(l=>Yi({isPaused:l.state.isPaused,status:l.state.status})==="yellow").length),n=wn(a=>a().getAll().filter(l=>Yi({isPaused:l.state.isPaused,status:l.state.status})==="purple").length),r=wn(a=>a().getAll().filter(l=>Yi({isPaused:l.state.isPaused,status:l.state.status})==="red").length),i=mt(),s=ye().shadowDOMTarget?Te.bind({target:ye().shadowDOMTarget}):Te,o=H(()=>i()==="dark"?pn(s):mn(s));return(()=>{var a=za();return U(a,j(rr,{label:"Paused",color:"purple",get count(){return n()}}),null),U(a,j(rr,{label:"Pending",color:"yellow",get count(){return t()}}),null),U(a,j(rr,{label:"Success",color:"green",get count(){return e()}}),null),U(a,j(rr,{label:"Error",color:"red",get count(){return r()}}),null),ve(()=>ee(a,se(o().queryStatusContainer,"tsqd-query-status-container"))),a})()},rr=e=>{const t=mt(),n=ye().shadowDOMTarget?Te.bind({target:ye().shadowDOMTarget}):Te,r=H(()=>t()==="dark"?pn(n):mn(n)),{colors:i,alpha:s}=K,o=(h,g)=>t()==="dark"?g:h;let a;const[l,c]=re(!1),[u,d]=re(!1),f=H(()=>!(Qt()&&Sn()<TM&&Sn()>ji||Sn()<ji));return(()=>{var h=wI(),g=h.firstChild,m=g.nextSibling,p=a;return typeof p=="function"?qs(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)),F0(h,Oe({get disabled(){return f()},get class(){return se(r().queryStatusTag,!f()&&n`
258
259
  cursor: pointer;
259
260
  &:hover {
260
261
  background: ${o(i.gray[200],i.darkGray[400])}${s[80]};
261
262
  }
262
- `,"tsqd-query-status-tag",`tsqd-query-status-tag-${e.label.toLowerCase()}`)}},()=>l()||u()?{"aria-describedby":"tsqd-status-tooltip"}:{}),!1,!0),U(h,j(ve,{get when(){return H(()=>!f())()&&(l()||u())},get children(){var v=hI();return U(v,()=>e.label),be(()=>ee(v,se(r().statusTooltip,"tsqd-query-status-tooltip"))),v}}),g),U(h,j(ve,{get when(){return f()},get children(){var v=gI();return U(v,()=>e.label),be(()=>ee(v,se(r().queryStatusTagLabel,"tsqd-query-status-tag-label"))),v}}),m),U(m,()=>e.count),be(v=>{var b=se(n`
263
+ `,"tsqd-query-status-tag",`tsqd-query-status-tag-${e.label.toLowerCase()}`)}},()=>l()||u()?{"aria-describedby":"tsqd-status-tooltip"}:{}),!1,!0),U(h,j(pe,{get when(){return H(()=>!f())()&&(l()||u())},get children(){var v=bI();return U(v,()=>e.label),ve(()=>ee(v,se(r().statusTooltip,"tsqd-query-status-tooltip"))),v}}),g),U(h,j(pe,{get when(){return f()},get children(){var v=xI();return U(v,()=>e.label),ve(()=>ee(v,se(r().queryStatusTagLabel,"tsqd-query-status-tag-label"))),v}}),m),U(m,()=>e.count),ve(v=>{var b=se(n`
263
264
  width: ${K.size[1.5]};
264
265
  height: ${K.size[1.5]};
265
266
  border-radius: ${K.border.radius.full};
@@ -267,7 +268,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
267
268
  `,"tsqd-query-status-tag-dot"),w=se(r().queryStatusCount,e.count>0&&e.color!=="gray"&&n`
268
269
  background-color: ${o(i[e.color][100],i[e.color][900])};
269
270
  color: ${o(i[e.color][700],i[e.color][300])};
270
- `,"tsqd-query-status-tag-count");return b!==v.e&&ee(g,v.e=b),w!==v.t&&ee(m,v.t=w),v},{e:void 0,t:void 0}),h})()},MI=()=>{const e=yt(),t=ye().shadowDOMTarget?Pe.bind({target:ye().shadowDOMTarget}):Pe,n=H(()=>e()==="dark"?pn(t):mn(t)),{colors:r}=K,i=(O,E)=>e()==="dark"?E:O,s=ye().client,[o,a]=re(!1),[l,c]=re("view"),[u,d]=re(!1),f=H(()=>ye().errorTypes||[]),h=ft(O=>O().getAll().find(E=>E.queryHash===Qt()),!1),g=ft(O=>O().getAll().find(E=>E.queryHash===Qt()),!1),m=ft(O=>{var E;return(E=O().getAll().find(T=>T.queryHash===Qt()))==null?void 0:E.state},!1),p=ft(O=>{var E;return(E=O().getAll().find(T=>T.queryHash===Qt()))==null?void 0:E.state.data},!1),v=ft(O=>{const E=O().getAll().find(T=>T.queryHash===Qt());return E?Vi(E):"inactive"}),b=ft(O=>{const E=O().getAll().find(T=>T.queryHash===Qt());return E?E.state.status:"pending"}),w=ft(O=>{var E,T;return(T=(E=O().getAll().find(D=>D.queryHash===Qt()))==null?void 0:E.getObserversCount())!=null?T:0}),C=H(()=>hC(v())),x=()=>{var E,T;Ln({type:"REFETCH",queryHash:(E=h())==null?void 0:E.queryHash});const O=(T=h())==null?void 0:T.fetch();O==null||O.catch(()=>{})},k=O=>{var W;const E=h();if(!E)return;Ln({type:"TRIGGER_ERROR",queryHash:E.queryHash,metadata:{error:O==null?void 0:O.name}});const T=(W=O==null?void 0:O.initializer(E))!=null?W:new Error("Unknown error from devtools"),D=E.options;E.setState({status:"error",error:T,fetchMeta:{...E.state.fetchMeta,__previousQueryOptions:D}})},S=()=>{const O=h();if(!O)return;Ln({type:"RESTORE_LOADING",queryHash:O.queryHash});const E=O.state,T=O.state.fetchMeta?O.state.fetchMeta.__previousQueryOptions:null;O.cancel({silent:!0}),O.setState({...E,fetchStatus:"idle",fetchMeta:null}),T&&O.fetch(T)};xe(()=>{v()!=="fetching"&&a(!1)});const _=()=>C()==="gray"?t`
271
+ `,"tsqd-query-status-tag-count");return b!==v.e&&ee(g,v.e=b),w!==v.t&&ee(m,v.t=w),v},{e:void 0,t:void 0}),h})()},NI=()=>{const e=mt(),t=ye().shadowDOMTarget?Te.bind({target:ye().shadowDOMTarget}):Te,n=H(()=>e()==="dark"?pn(t):mn(t)),{colors:r}=K,i=(O,E)=>e()==="dark"?E:O,s=ye().client,[o,a]=re(!1),[l,c]=re("view"),[u,d]=re(!1),f=H(()=>ye().errorTypes||[]),h=ht(O=>O().getAll().find(E=>E.queryHash===Qt()),!1),g=ht(O=>O().getAll().find(E=>E.queryHash===Qt()),!1),m=ht(O=>{var E;return(E=O().getAll().find(T=>T.queryHash===Qt()))==null?void 0:E.state},!1),p=ht(O=>{var E;return(E=O().getAll().find(T=>T.queryHash===Qt()))==null?void 0:E.state.data},!1),v=ht(O=>{const E=O().getAll().find(T=>T.queryHash===Qt());return E?Wi(E):"inactive"}),b=ht(O=>{const E=O().getAll().find(T=>T.queryHash===Qt());return E?E.state.status:"pending"}),w=ht(O=>{var E,T;return(T=(E=O().getAll().find(D=>D.queryHash===Qt()))==null?void 0:E.getObserversCount())!=null?T:0}),C=H(()=>gC(v())),x=()=>{var E,T;Ln({type:"REFETCH",queryHash:(E=h())==null?void 0:E.queryHash});const O=(T=h())==null?void 0:T.fetch();O==null||O.catch(()=>{})},k=O=>{var G;const E=h();if(!E)return;Ln({type:"TRIGGER_ERROR",queryHash:E.queryHash,metadata:{error:O==null?void 0:O.name}});const T=(G=O==null?void 0:O.initializer(E))!=null?G:new Error("Unknown error from devtools"),D=E.options;E.setState({status:"error",error:T,fetchMeta:{...E.state.fetchMeta,__previousQueryOptions:D}})},S=()=>{const O=h();if(!O)return;Ln({type:"RESTORE_LOADING",queryHash:O.queryHash});const E=O.state,T=O.state.fetchMeta?O.state.fetchMeta.__previousQueryOptions:null;O.cancel({silent:!0}),O.setState({...E,fetchStatus:"idle",fetchMeta:null}),T&&O.fetch(T)};be(()=>{v()!=="fetching"&&a(!1)});const _=()=>C()==="gray"?t`
271
272
  background-color: ${i(r[C()][200],r[C()][700])};
272
273
  color: ${i(r[C()][700],r[C()][300])};
273
274
  border-color: ${i(r[C()][400],r[C()][600])};
@@ -275,19 +276,19 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
275
276
  background-color: ${i(r[C()][100],r[C()][900])};
276
277
  color: ${i(r[C()][700],r[C()][300])};
277
278
  border-color: ${i(r[C()][400],r[C()][600])};
278
- `;return j(ve,{get when(){return H(()=>!!h())()&&m()},get children(){var O=xI(),E=O.firstChild,T=E.nextSibling,D=T.firstChild,W=D.firstChild,N=W.firstChild,L=W.nextSibling,$=D.nextSibling,I=$.firstChild,oe=I.nextSibling,ue=$.nextSibling,B=ue.firstChild,X=B.nextSibling,ae=T.nextSibling,ne=ae.nextSibling,R=ne.firstChild,G=R.firstChild,q=R.nextSibling,ce=q.firstChild,V=q.nextSibling,de=V.firstChild,fe=V.nextSibling,Ne=fe.firstChild,te=fe.nextSibling,De=te.firstChild,me=De.nextSibling,Te=ne.nextSibling;Te.firstChild;var je=Te.nextSibling,Et=je.nextSibling;return U(N,()=>zl(h().queryKey,!0)),U(L,v),U(oe,w),U(X,()=>new Date(m().dataUpdatedAt).toLocaleTimeString()),R.$$click=x,q.$$click=()=>{var Z;Ln({type:"INVALIDATE",queryHash:(Z=h())==null?void 0:Z.queryHash}),s.invalidateQueries(h())},V.$$click=()=>{var Z;Ln({type:"RESET",queryHash:(Z=h())==null?void 0:Z.queryHash}),s.resetQueries(h())},fe.$$click=()=>{var Z;Ln({type:"REMOVE",queryHash:(Z=h())==null?void 0:Z.queryHash}),s.removeQueries(h()),Uc(null)},te.$$click=()=>{var Z;if(((Z=h())==null?void 0:Z.state.data)===void 0)a(!0),S();else{const Me=h();if(!Me)return;Ln({type:"TRIGGER_LOADING",queryHash:Me.queryHash});const Je=Me.options;Me.fetch({...Je,queryFn:()=>new Promise(()=>{}),gcTime:-1}),Me.setState({data:void 0,status:"pending",fetchMeta:{...Me.state.fetchMeta,__previousQueryOptions:Je}})}},U(te,()=>b()==="pending"?"Restore":"Trigger",me),U(ne,j(ve,{get when(){return f().length===0||b()==="error"},get children(){var Z=mI(),Me=Z.firstChild,Je=Me.nextSibling;return Z.$$click=()=>{var Le;h().state.error?(Ln({type:"RESTORE_ERROR",queryHash:(Le=h())==null?void 0:Le.queryHash}),s.resetQueries(h())):k()},U(Z,()=>b()==="error"?"Restore":"Trigger",Je),be(Le=>{var Ie=se(t`
279
+ `;return j(pe,{get when(){return H(()=>!!h())()&&m()},get children(){var O=OI(),E=O.firstChild,T=E.nextSibling,D=T.firstChild,G=D.firstChild,N=G.firstChild,L=G.nextSibling,M=D.nextSibling,I=M.firstChild,oe=I.nextSibling,ue=M.nextSibling,B=ue.firstChild,J=B.nextSibling,ae=T.nextSibling,ne=ae.nextSibling,R=ne.firstChild,Q=R.firstChild,q=R.nextSibling,ce=q.firstChild,W=q.nextSibling,de=W.firstChild,fe=W.nextSibling,Le=fe.firstChild,te=fe.nextSibling,et=te.firstChild,_e=et.nextSibling,Ie=ne.nextSibling;Ie.firstChild;var Re=Ie.nextSibling,ze=Re.nextSibling;return U(N,()=>zl(h().queryKey,!0)),U(L,v),U(oe,w),U(J,()=>new Date(m().dataUpdatedAt).toLocaleTimeString()),R.$$click=x,q.$$click=()=>{var V;Ln({type:"INVALIDATE",queryHash:(V=h())==null?void 0:V.queryHash}),s.invalidateQueries(h())},W.$$click=()=>{var V;Ln({type:"RESET",queryHash:(V=h())==null?void 0:V.queryHash}),s.resetQueries(h())},fe.$$click=()=>{var V;Ln({type:"REMOVE",queryHash:(V=h())==null?void 0:V.queryHash}),s.removeQueries(h()),Uc(null)},te.$$click=()=>{var V;if(((V=h())==null?void 0:V.state.data)===void 0)a(!0),S();else{const Ee=h();if(!Ee)return;Ln({type:"TRIGGER_LOADING",queryHash:Ee.queryHash});const He=Ee.options;Ee.fetch({...He,queryFn:()=>new Promise(()=>{}),gcTime:-1}),Ee.setState({data:void 0,status:"pending",fetchMeta:{...Ee.state.fetchMeta,__previousQueryOptions:He}})}},U(te,()=>b()==="pending"?"Restore":"Trigger",_e),U(ne,j(pe,{get when(){return f().length===0||b()==="error"},get children(){var V=SI(),Ee=V.firstChild,He=Ee.nextSibling;return V.$$click=()=>{var $e;h().state.error?(Ln({type:"RESTORE_ERROR",queryHash:($e=h())==null?void 0:$e.queryHash}),s.resetQueries(h())):k()},U(V,()=>b()==="error"?"Restore":"Trigger",He),ve($e=>{var Me=se(t`
279
280
  color: ${i(r.red[500],r.red[400])};
280
- `,"tsqd-query-details-actions-btn","tsqd-query-details-action-error"),he=b()==="pending",we=t`
281
+ `,"tsqd-query-details-actions-btn","tsqd-query-details-action-error"),he=b()==="pending",xe=t`
281
282
  background-color: ${i(r.red[500],r.red[400])};
282
- `;return Ie!==Le.e&&ee(Z,Le.e=Ie),he!==Le.t&&(Z.disabled=Le.t=he),we!==Le.a&&ee(Me,Le.a=we),Le},{e:void 0,t:void 0,a:void 0}),Z}}),null),U(ne,j(ve,{get when(){return!(f().length===0||b()==="error")},get children(){var Z=pI(),Me=Z.firstChild,Je=Me.nextSibling,Le=Je.nextSibling;return Le.firstChild,Le.addEventListener("change",Ie=>{const he=f().find(we=>we.name===Ie.currentTarget.value);k(he)}),U(Le,j(uS,{get each(){return f()},children:Ie=>(()=>{var he=wI();return U(he,()=>Ie.name),be(()=>he.value=Ie.name),he})()}),null),U(Z,j(Fo,{}),null),be(Ie=>{var he=se(n().actionsSelect,"tsqd-query-details-actions-btn","tsqd-query-details-action-error-multiple"),we=t`
283
+ `;return Me!==$e.e&&ee(V,$e.e=Me),he!==$e.t&&(V.disabled=$e.t=he),xe!==$e.a&&ee(Ee,$e.a=xe),$e},{e:void 0,t:void 0,a:void 0}),V}}),null),U(ne,j(pe,{get when(){return!(f().length===0||b()==="error")},get children(){var V=CI(),Ee=V.firstChild,He=Ee.nextSibling,$e=He.nextSibling;return $e.firstChild,$e.addEventListener("change",Me=>{const he=f().find(xe=>xe.name===Me.currentTarget.value);k(he)}),U($e,j(dS,{get each(){return f()},children:Me=>(()=>{var he=EI();return U(he,()=>Me.name),ve(()=>he.value=Me.name),he})()}),null),U(V,j(Fo,{}),null),ve(Me=>{var he=se(n().actionsSelect,"tsqd-query-details-actions-btn","tsqd-query-details-action-error-multiple"),xe=t`
283
284
  background-color: ${K.colors.red[400]};
284
- `,ge=b()==="pending";return he!==Ie.e&&ee(Z,Ie.e=he),we!==Ie.t&&ee(Me,Ie.t=we),ge!==Ie.a&&(Le.disabled=Ie.a=ge),Ie},{e:void 0,t:void 0,a:void 0}),Z}}),null),U(Te,()=>l()==="view"?"Explorer":"Editor",null),U(O,j(ve,{get when(){return l()==="view"},get children(){var Z=vI();return U(Z,j(Ir,{label:"Data",defaultExpanded:["Data"],get value(){return p()},editable:!0,onEdit:()=>c("edit"),get activeQuery(){return h()}})),be(Me=>(Me=K.size[2])!=null?Z.style.setProperty("padding",Me):Z.style.removeProperty("padding")),Z}}),je),U(O,j(ve,{get when(){return l()==="edit"},get children(){var Z=bI(),Me=Z.firstChild,Je=Me.nextSibling,Le=Je.firstChild,Ie=Le.nextSibling,he=Ie.firstChild,we=he.nextSibling;return Z.addEventListener("submit",ge=>{ge.preventDefault();const Kn=new FormData(ge.currentTarget).get("data");try{const vn=JSON.parse(Kn);h().setState({...h().state,data:vn}),c("view")}catch(vn){d(!0)}}),Me.addEventListener("focus",()=>d(!1)),U(Le,()=>u()?"Invalid Value":""),he.$$click=()=>c("view"),be(ge=>{var qe=se(n().devtoolsEditForm,"tsqd-query-details-data-editor"),Kn=n().devtoolsEditTextarea,vn=u(),Yr=n().devtoolsEditFormActions,Un=n().devtoolsEditFormError,Xr=n().devtoolsEditFormActionContainer,Vn=se(n().devtoolsEditFormAction,t`
285
+ `,ge=b()==="pending";return he!==Me.e&&ee(V,Me.e=he),xe!==Me.t&&ee(Ee,Me.t=xe),ge!==Me.a&&($e.disabled=Me.a=ge),Me},{e:void 0,t:void 0,a:void 0}),V}}),null),U(Ie,()=>l()==="view"?"Explorer":"Editor",null),U(O,j(pe,{get when(){return l()==="view"},get children(){var V=_I();return U(V,j(Ir,{label:"Data",defaultExpanded:["Data"],get value(){return p()},editable:!0,onEdit:()=>c("edit"),get activeQuery(){return h()}})),ve(Ee=>(Ee=K.size[2])!=null?V.style.setProperty("padding",Ee):V.style.removeProperty("padding")),V}}),Re),U(O,j(pe,{get when(){return l()==="edit"},get children(){var V=kI(),Ee=V.firstChild,He=Ee.nextSibling,$e=He.firstChild,Me=$e.nextSibling,he=Me.firstChild,xe=he.nextSibling;return V.addEventListener("submit",ge=>{ge.preventDefault();const Kn=new FormData(ge.currentTarget).get("data");try{const vn=JSON.parse(Kn);h().setState({...h().state,data:vn}),c("view")}catch(vn){d(!0)}}),Ee.addEventListener("focus",()=>d(!1)),U($e,()=>u()?"Invalid Value":""),he.$$click=()=>c("view"),ve(ge=>{var Be=se(n().devtoolsEditForm,"tsqd-query-details-data-editor"),Kn=n().devtoolsEditTextarea,vn=u(),Yr=n().devtoolsEditFormActions,Un=n().devtoolsEditFormError,Xr=n().devtoolsEditFormActionContainer,Wn=se(n().devtoolsEditFormAction,t`
285
286
  color: ${i(r.gray[600],r.gray[300])};
286
287
  `),pr=se(n().devtoolsEditFormAction,t`
287
288
  color: ${i(r.blue[600],r.blue[400])};
288
- `);return qe!==ge.e&&ee(Z,ge.e=qe),Kn!==ge.t&&ee(Me,ge.t=Kn),vn!==ge.a&&J(Me,"data-error",ge.a=vn),Yr!==ge.o&&ee(Je,ge.o=Yr),Un!==ge.i&&ee(Le,ge.i=Un),Xr!==ge.n&&ee(Ie,ge.n=Xr),Vn!==ge.s&&ee(he,ge.s=Vn),pr!==ge.h&&ee(we,ge.h=pr),ge},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0}),be(()=>Me.value=JSON.stringify(p(),null,2)),Z}}),je),U(Et,j(Ir,{label:"Query",defaultExpanded:["Query","queryKey"],get value(){return g()}})),be(Z=>{var Me=se(n().detailsContainer,"tsqd-query-details-container"),Je=se(n().detailsHeader,"tsqd-query-details-header"),Le=se(n().detailsBody,"tsqd-query-details-summary-container"),Ie=se(n().queryDetailsStatus,_()),he=se(n().detailsHeader,"tsqd-query-details-header"),we=se(n().actionsBody,"tsqd-query-details-actions-container"),ge=se(t`
289
+ `);return Be!==ge.e&&ee(V,ge.e=Be),Kn!==ge.t&&ee(Ee,ge.t=Kn),vn!==ge.a&&Z(Ee,"data-error",ge.a=vn),Yr!==ge.o&&ee(He,ge.o=Yr),Un!==ge.i&&ee($e,ge.i=Un),Xr!==ge.n&&ee(Me,ge.n=Xr),Wn!==ge.s&&ee(he,ge.s=Wn),pr!==ge.h&&ee(xe,ge.h=pr),ge},{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(()=>Ee.value=JSON.stringify(p(),null,2)),V}}),Re),U(ze,j(Ir,{label:"Query",defaultExpanded:["Query","queryKey"],get value(){return g()}})),ve(V=>{var Ee=se(n().detailsContainer,"tsqd-query-details-container"),He=se(n().detailsHeader,"tsqd-query-details-header"),$e=se(n().detailsBody,"tsqd-query-details-summary-container"),Me=se(n().queryDetailsStatus,_()),he=se(n().detailsHeader,"tsqd-query-details-header"),xe=se(n().actionsBody,"tsqd-query-details-actions-container"),ge=se(t`
289
290
  color: ${i(r.blue[600],r.blue[400])};
290
- `,"tsqd-query-details-actions-btn","tsqd-query-details-action-refetch"),qe=v()==="fetching",Kn=t`
291
+ `,"tsqd-query-details-actions-btn","tsqd-query-details-action-refetch"),Be=v()==="fetching",Kn=t`
291
292
  background-color: ${i(r.blue[600],r.blue[400])};
292
293
  `,vn=se(t`
293
294
  color: ${i(r.yellow[600],r.yellow[400])};
@@ -295,7 +296,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
295
296
  background-color: ${i(r.yellow[600],r.yellow[400])};
296
297
  `,Xr=se(t`
297
298
  color: ${i(r.gray[600],r.gray[300])};
298
- `,"tsqd-query-details-actions-btn","tsqd-query-details-action-reset"),Vn=b()==="pending",pr=t`
299
+ `,"tsqd-query-details-actions-btn","tsqd-query-details-action-reset"),Wn=b()==="pending",pr=t`
299
300
  background-color: ${i(r.gray[600],r.gray[400])};
300
301
  `,Ha=se(t`
301
302
  color: ${i(r.pink[500],r.pink[400])};
@@ -305,7 +306,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
305
306
  color: ${i(r.cyan[500],r.cyan[400])};
306
307
  `,"tsqd-query-details-actions-btn","tsqd-query-details-action-loading"),Ua=o(),Js=t`
307
308
  background-color: ${i(r.cyan[500],r.cyan[400])};
308
- `,Zs=se(n().detailsHeader,"tsqd-query-details-header"),eo=se(n().detailsHeader,"tsqd-query-details-header"),qi=K.size[2];return Me!==Z.e&&ee(O,Z.e=Me),Je!==Z.t&&ee(E,Z.t=Je),Le!==Z.a&&ee(T,Z.a=Le),Ie!==Z.o&&ee(L,Z.o=Ie),he!==Z.i&&ee(ae,Z.i=he),we!==Z.n&&ee(ne,Z.n=we),ge!==Z.s&&ee(R,Z.s=ge),qe!==Z.h&&(R.disabled=Z.h=qe),Kn!==Z.r&&ee(G,Z.r=Kn),vn!==Z.d&&ee(q,Z.d=vn),Yr!==Z.l&&(q.disabled=Z.l=Yr),Un!==Z.u&&ee(ce,Z.u=Un),Xr!==Z.c&&ee(V,Z.c=Xr),Vn!==Z.w&&(V.disabled=Z.w=Vn),pr!==Z.m&&ee(de,Z.m=pr),Ha!==Z.f&&ee(fe,Z.f=Ha),Xs!==Z.y&&(fe.disabled=Z.y=Xs),Ka!==Z.g&&ee(Ne,Z.g=Ka),Bi!==Z.p&&ee(te,Z.p=Bi),Ua!==Z.b&&(te.disabled=Z.b=Ua),Js!==Z.T&&ee(De,Z.T=Js),Zs!==Z.A&&ee(Te,Z.A=Zs),eo!==Z.O&&ee(je,Z.O=eo),qi!==Z.I&&((Z.I=qi)!=null?Et.style.setProperty("padding",qi):Et.style.removeProperty("padding")),Z},{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}),O}})},$I=()=>{const e=yt(),t=ye().shadowDOMTarget?Pe.bind({target:ye().shadowDOMTarget}):Pe,n=H(()=>e()==="dark"?pn(t):mn(t)),{colors:r}=K,i=(u,d)=>e()==="dark"?d:u,s=wn(u=>{const f=u().getAll().find(h=>h.mutationId===Fr());return f?f.state.isPaused:!1}),o=wn(u=>{const f=u().getAll().find(h=>h.mutationId===Fr());return f?f.state.status:"idle"}),a=H(()=>Yi({isPaused:s(),status:o()})),l=wn(u=>u().getAll().find(d=>d.mutationId===Fr()),!1),c=()=>a()==="gray"?t`
309
+ `,Zs=se(n().detailsHeader,"tsqd-query-details-header"),eo=se(n().detailsHeader,"tsqd-query-details-header"),qi=K.size[2];return Ee!==V.e&&ee(O,V.e=Ee),He!==V.t&&ee(E,V.t=He),$e!==V.a&&ee(T,V.a=$e),Me!==V.o&&ee(L,V.o=Me),he!==V.i&&ee(ae,V.i=he),xe!==V.n&&ee(ne,V.n=xe),ge!==V.s&&ee(R,V.s=ge),Be!==V.h&&(R.disabled=V.h=Be),Kn!==V.r&&ee(Q,V.r=Kn),vn!==V.d&&ee(q,V.d=vn),Yr!==V.l&&(q.disabled=V.l=Yr),Un!==V.u&&ee(ce,V.u=Un),Xr!==V.c&&ee(W,V.c=Xr),Wn!==V.w&&(W.disabled=V.w=Wn),pr!==V.m&&ee(de,V.m=pr),Ha!==V.f&&ee(fe,V.f=Ha),Xs!==V.y&&(fe.disabled=V.y=Xs),Ka!==V.g&&ee(Le,V.g=Ka),Bi!==V.p&&ee(te,V.p=Bi),Ua!==V.b&&(te.disabled=V.b=Ua),Js!==V.T&&ee(et,V.T=Js),Zs!==V.A&&ee(Ie,V.A=Zs),eo!==V.O&&ee(Re,V.O=eo),qi!==V.I&&((V.I=qi)!=null?ze.style.setProperty("padding",qi):ze.style.removeProperty("padding")),V},{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}),O}})},FI=()=>{const e=mt(),t=ye().shadowDOMTarget?Te.bind({target:ye().shadowDOMTarget}):Te,n=H(()=>e()==="dark"?pn(t):mn(t)),{colors:r}=K,i=(u,d)=>e()==="dark"?d:u,s=wn(u=>{const f=u().getAll().find(h=>h.mutationId===Fr());return f?f.state.isPaused:!1}),o=wn(u=>{const f=u().getAll().find(h=>h.mutationId===Fr());return f?f.state.status:"idle"}),a=H(()=>Yi({isPaused:s(),status:o()})),l=wn(u=>u().getAll().find(d=>d.mutationId===Fr()),!1),c=()=>a()==="gray"?t`
309
310
  background-color: ${i(r[a()][200],r[a()][700])};
310
311
  color: ${i(r[a()][700],r[a()][300])};
311
312
  border-color: ${i(r[a()][400],r[a()][600])};
@@ -313,7 +314,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
313
314
  background-color: ${i(r[a()][100],r[a()][900])};
314
315
  color: ${i(r[a()][700],r[a()][300])};
315
316
  border-color: ${i(r[a()][400],r[a()][600])};
316
- `;return j(ve,{get when(){return l()},get children(){var u=SI(),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,C=f.nextSibling,x=C.nextSibling,k=x.nextSibling,S=k.nextSibling,_=S.nextSibling,O=_.nextSibling,E=O.nextSibling,T=E.nextSibling;return U(m,j(ve,{get when(){return l().options.mutationKey},fallback:"No mutationKey found",get children(){return zl(l().options.mutationKey,!0)}})),U(p,j(ve,{get when(){return a()==="purple"},children:"pending"}),null),U(p,j(ve,{get when(){return a()!=="purple"},get children(){return o()}}),null),U(w,()=>new Date(l().state.submittedAt).toLocaleTimeString()),U(x,j(Ir,{label:"Variables",defaultExpanded:["Variables"],get value(){return l().state.variables}})),U(S,j(Ir,{label:"Context",defaultExpanded:["Context"],get value(){return l().state.context}})),U(O,j(Ir,{label:"Data",defaultExpanded:["Data"],get value(){return l().state.data}})),U(T,j(Ir,{label:"Mutation",defaultExpanded:["Mutation"],get value(){return l()}})),be(D=>{var W=se(n().detailsContainer,"tsqd-query-details-container"),N=se(n().detailsHeader,"tsqd-query-details-header"),L=se(n().detailsBody,"tsqd-query-details-summary-container"),$=se(n().queryDetailsStatus,c()),I=se(n().detailsHeader,"tsqd-query-details-header"),oe=K.size[2],ue=se(n().detailsHeader,"tsqd-query-details-header"),B=K.size[2],X=se(n().detailsHeader,"tsqd-query-details-header"),ae=K.size[2],ne=se(n().detailsHeader,"tsqd-query-details-header"),R=K.size[2];return W!==D.e&&ee(u,D.e=W),N!==D.t&&ee(d,D.t=N),L!==D.a&&ee(f,D.a=L),$!==D.o&&ee(p,D.o=$),I!==D.i&&ee(C,D.i=I),oe!==D.n&&((D.n=oe)!=null?x.style.setProperty("padding",oe):x.style.removeProperty("padding")),ue!==D.s&&ee(k,D.s=ue),B!==D.h&&((D.h=B)!=null?S.style.setProperty("padding",B):S.style.removeProperty("padding")),X!==D.r&&ee(_,D.r=X),ae!==D.d&&((D.d=ae)!=null?O.style.setProperty("padding",ae):O.style.removeProperty("padding")),ne!==D.l&&ee(E,D.l=ne),R!==D.u&&((D.u=R)!=null?T.style.setProperty("padding",R):T.style.removeProperty("padding")),D},{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}})},ac=new Map,DI=()=>{const e=H(()=>ye().client.getQueryCache()),t=e().subscribe(n=>{Y2(()=>{for(const[r,i]of ac.entries())i.shouldUpdate(n)&&i.setter(r(e))})});return Se(()=>{ac.clear(),t()}),t},ft=(e,t=!0,n=()=>!0)=>{const r=H(()=>ye().client.getQueryCache()),[i,s]=re(e(r),t?void 0:{equals:!1});return xe(()=>{s(e(r))}),ac.set(e,{setter:s,shouldUpdate:n}),Se(()=>{ac.delete(e)}),i},lc=new Map,LI=()=>{const e=H(()=>ye().client.getMutationCache()),t=e().subscribe(()=>{for(const[n,r]of lc.entries())queueMicrotask(()=>{r(n(e))})});return Se(()=>{lc.clear(),t()}),t},wn=(e,t=!0)=>{const n=H(()=>ye().client.getMutationCache()),[r,i]=re(e(n),t?void 0:{equals:!1});return xe(()=>{i(e(n))}),lc.set(e,i),Se(()=>{lc.delete(e)}),r},II="@tanstack/query-devtools-event",Ln=({type:e,queryHash:t,metadata:n})=>{const r=new CustomEvent(II,{detail:{type:e,queryHash:t,metadata:n},bubbles:!0,cancelable:!0});window.dispatchEvent(r)},jx=(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`
317
+ `;return j(pe,{get when(){return l()},get children(){var u=AI(),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,C=f.nextSibling,x=C.nextSibling,k=x.nextSibling,S=k.nextSibling,_=S.nextSibling,O=_.nextSibling,E=O.nextSibling,T=E.nextSibling;return U(m,j(pe,{get when(){return l().options.mutationKey},fallback:"No mutationKey found",get children(){return zl(l().options.mutationKey,!0)}})),U(p,j(pe,{get when(){return a()==="purple"},children:"pending"}),null),U(p,j(pe,{get when(){return a()!=="purple"},get children(){return o()}}),null),U(w,()=>new Date(l().state.submittedAt).toLocaleTimeString()),U(x,j(Ir,{label:"Variables",defaultExpanded:["Variables"],get value(){return l().state.variables}})),U(S,j(Ir,{label:"Context",defaultExpanded:["Context"],get value(){return l().state.context}})),U(O,j(Ir,{label:"Data",defaultExpanded:["Data"],get value(){return l().state.data}})),U(T,j(Ir,{label:"Mutation",defaultExpanded:["Mutation"],get value(){return l()}})),ve(D=>{var G=se(n().detailsContainer,"tsqd-query-details-container"),N=se(n().detailsHeader,"tsqd-query-details-header"),L=se(n().detailsBody,"tsqd-query-details-summary-container"),M=se(n().queryDetailsStatus,c()),I=se(n().detailsHeader,"tsqd-query-details-header"),oe=K.size[2],ue=se(n().detailsHeader,"tsqd-query-details-header"),B=K.size[2],J=se(n().detailsHeader,"tsqd-query-details-header"),ae=K.size[2],ne=se(n().detailsHeader,"tsqd-query-details-header"),R=K.size[2];return G!==D.e&&ee(u,D.e=G),N!==D.t&&ee(d,D.t=N),L!==D.a&&ee(f,D.a=L),M!==D.o&&ee(p,D.o=M),I!==D.i&&ee(C,D.i=I),oe!==D.n&&((D.n=oe)!=null?x.style.setProperty("padding",oe):x.style.removeProperty("padding")),ue!==D.s&&ee(k,D.s=ue),B!==D.h&&((D.h=B)!=null?S.style.setProperty("padding",B):S.style.removeProperty("padding")),J!==D.r&&ee(_,D.r=J),ae!==D.d&&((D.d=ae)!=null?O.style.setProperty("padding",ae):O.style.removeProperty("padding")),ne!==D.l&&ee(E,D.l=ne),R!==D.u&&((D.u=R)!=null?T.style.setProperty("padding",R):T.style.removeProperty("padding")),D},{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}})},ac=new Map,BI=()=>{const e=H(()=>ye().client.getQueryCache()),t=e().subscribe(n=>{X2(()=>{for(const[r,i]of ac.entries())i.shouldUpdate(n)&&i.setter(r(e))})});return we(()=>{ac.clear(),t()}),t},ht=(e,t=!0,n=()=>!0)=>{const r=H(()=>ye().client.getQueryCache()),[i,s]=re(e(r),t?void 0:{equals:!1});return be(()=>{s(e(r))}),ac.set(e,{setter:s,shouldUpdate:n}),we(()=>{ac.delete(e)}),i},lc=new Map,qI=()=>{const e=H(()=>ye().client.getMutationCache()),t=e().subscribe(()=>{for(const[n,r]of lc.entries())queueMicrotask(()=>{r(n(e))})});return we(()=>{lc.clear(),t()}),t},wn=(e,t=!0)=>{const n=H(()=>ye().client.getMutationCache()),[r,i]=re(e(n),t?void 0:{equals:!1});return be(()=>{i(e(n))}),lc.set(e,i),we(()=>{lc.delete(e)}),r},zI="@tanstack/query-devtools-event",Ln=({type:e,queryHash:t,metadata:n})=>{const r=new CustomEvent(zI,{detail:{type:e,queryHash:t,metadata:n},bubbles:!0,cancelable:!0});window.dispatchEvent(r)},$x=(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`
317
318
  z-index: 100000;
318
319
  position: fixed;
319
320
  padding: 4px;
@@ -1278,17 +1279,17 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1278
1279
  opacity: 0.6;
1279
1280
  cursor: not-allowed;
1280
1281
  }
1281
- `}},mn=e=>jx("light",e),pn=e=>jx("dark",e);yc(["click","mousedown","input"]);var RI=e=>{const[t,n]=Jb({prefix:"TanstackQueryDevtools"}),r=sv(),i=H(()=>{const s=t.theme_preference||Zb;return s!=="system"?s:r()});return j(Rf.Provider,{value:e,get children(){return j(r1,{localStore:t,setLocalStore:n,get children(){return j(Ff.Provider,{value:i,get children(){return j(_I,{localStore:t,setLocalStore:n})}})}})}})},NI=RI;const FI=Object.freeze(Object.defineProperty({__proto__:null,default:NI},Symbol.toStringTag,{value:"Module"}));var BI=e=>{const[t,n]=Jb({prefix:"TanstackQueryDevtools"}),r=sv(),i=H(()=>{const s=t.theme_preference||Zb;return s!=="system"?s:r()});return j(Rf.Provider,{value:e,get children(){return j(r1,{disabled:!0,localStore:t,setLocalStore:n,get children(){return j(Ff.Provider,{value:i,get children(){return j(OI,{get children(){return j(sh,{localStore:t,setLocalStore:n,get onClose(){return e.onClose},showPanelViewOnly:!0})}})}})}})}})},qI=BI;const zI=Object.freeze(Object.defineProperty({__proto__:null,default:qI},Symbol.toStringTag,{value:"Module"}));function gp(e,t){return VI(e)||UI(e,t)||KI(e,t)||HI()}function HI(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1282
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function KI(e,t){if(e){if(typeof e=="string")return yp(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)?yp(e,t):void 0}}function yp(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 UI(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 VI(e){if(Array.isArray(e))return e}var WI=function(t){var n=t.isOpen,r=t.onClose,i=t.groupToEdit,s=t.allBrands,o=En(),a=o.brandId,l=z.useState(""),c=gp(l,2),u=c[0],d=c[1],f=z.useState([]),h=gp(f,2),g=h[0],m=h[1],p=qt();z.useEffect(function(){if(n&&i&&i.type==="group"){var S;d(String(i.name||""));var _=((S=i.groupedBrands)===null||S===void 0?void 0:S.map(function(O){return String(O.id||"")}))||[];m(_)}},[n,i]);var v=Nv({mutation:{onSuccess:function(){p.invalidateQueries({queryKey:ff(a)}),x()},onError:function(_){console.error("Error creating brand group:",_)}}}),b=v.mutate,w=v.isPending,C=function(){!u.trim()||!(i!=null&&i.id)||b({brandId:a,data:{groupName:u.trim(),brandIds:g.map(function(_){return Number(_)})}})},x=function(){d(""),m([]),r()},k=function(){return g.map(function(_){if(i&&i.type==="group"){var O,E=(O=i.groupedBrands)===null||O===void 0?void 0:O.find(function(D){return String(D.id)===_});if(E)return E.name||""}var T=s.find(function(D){return String(D.id)===_});return T?T.type==="group"?"Group: ".concat(T.name):T.name||"":""}).filter(Boolean)};return!i||i.type!=="group"?null:y.jsx(A.Modal,{isOpen:n,onClose:x,children:y.jsx(A.Modal.Panel,{children:y.jsxs(A.Modal.Container,{children:[y.jsx(A.Modal.Container.Header,{className:"yst-mb-4",children:y.jsx(A.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Edit brand group"})}),y.jsxs(A.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(A.TextInput,{id:"editGroupName",value:u,onChange:function(S){return d(S.target.value)},placeholder:"Enter group name",className:"yst-w-full"})]}),y.jsxs("div",{children:[y.jsx(A.TagField,{id:"editGroupedBrands",label:"Grouped brands",tags:k(),onRemoveTag:function(S){m(function(_){return _.filter(function(O,E){return E!==S})})},onAddTag:function(){}}),g.length===0&&y.jsx("p",{className:"yst-mt-2 yst-text-sm yst-italic yst-text-gray-500",children:"No brands in this group"})]})]}),y.jsx(A.Modal.Container.Footer,{children:y.jsxs("div",{className:"yst-flex yst-justify-end yst-gap-2",children:[y.jsx(A.Button,{variant:"secondary",onClick:x,children:"Cancel"}),y.jsx(A.Button,{variant:"primary",onClick:C,disabled:!u.trim()||w,isLoading:w,children:w?"Saving...":"Save changes"})]})})]})})})};function mp(e,t){return XI(e)||YI(e,t)||QI(e,t)||GI()}function GI(){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 QI(e,t){if(e){if(typeof e=="string")return pp(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)?pp(e,t):void 0}}function pp(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 YI(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 XI(e){if(Array.isArray(e))return e}var JI=function(t){var n=t.isOpen,r=t.onClose,i=t.brandId,s=t.brandsToGroup,o=t.onGroupCreated,a=qt(),l=z.useState(""),c=mp(l,2),u=c[0],d=c[1],f=z.useState([]),h=mp(f,2),g=h[0],m=h[1];z.useEffect(function(){if(n&&s.length>0){var k,S=(k=s[0])===null||k===void 0?void 0:k.name;d(String(S||"New Group")),m(s.map(function(_){var O;return String((O=_.id)!==null&&O!==void 0?O:"")}))}},[n,s]);var p=Nv({mutation:{onSuccess:function(){a.invalidateQueries({queryKey:ff(i)}),o==null||o(),w()},onError:function(S){console.error("Error creating group:",S)}}}),v=p.mutate,b=p.isPending,w=function(){d(""),m([]),r()},C=function(){if(!(!u.trim()||g.length===0)){var S=g.flatMap(function(_){var O=s.find(function(E){return String(E.id)===_});return O&&O.type==="group"&&Array.isArray(O.groupedBrands)?O.groupedBrands.map(function(E){return String(E.id)}):_});v({brandId:i,data:{groupName:u.trim(),brandIds:S.filter(function(_){return _!==""}).map(function(_){return Number(_)})}})}},x=function(S){m(function(_){return _.filter(function(O){return O!==S})})};return y.jsx(A.Modal,{isOpen:n,onClose:w,children:y.jsx(A.Modal.Panel,{children:y.jsxs(A.Modal.Container,{children:[y.jsx(A.Modal.Container.Header,{children:y.jsx(A.Modal.Title,{children:"Edit brand group"})}),y.jsxs(A.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(A.TextInput,{id:"groupName",value:u,onChange:function(k){return d(k.target.value)},placeholder:"Enter group name",className:"yst-w-full"})]}),y.jsxs("div",{children:[y.jsx(A.TagField,{id:"groupedBrands",label:"Brands in group (".concat(g.length,")"),tags:g.map(function(k){var S=s.find(function(_){return String(_.id)===k});return S?S.type==="group"?"Group: ".concat(S.name):S.name||"":""}).filter(Boolean),onRemoveTag:function(k){var S=g.find(function(_){var O=s.find(function(T){return String(T.id)===_});if(!O)return!1;var E=O.type==="group"?"Group: ".concat(O.name):O.name||"";return E===k});S&&x(S)},onAddTag:function(){}}),g.length===0&&y.jsx("p",{className:"yst-text-sm yst-italic yst-text-gray-500",children:"No brands selected"})]})]}),y.jsx(A.Modal.Container.Footer,{children:y.jsxs("div",{className:"yst-flex yst-justify-end yst-gap-2",children:[y.jsx(A.Button,{variant:"secondary",onClick:w,disabled:b,children:"Cancel"}),y.jsx(A.Button,{variant:"primary",onClick:C,disabled:!u.trim()||g.length===0||b,children:b?"Saving...":"Save group"})]})})]})})})};function da(e){"@babel/helpers - typeof";return da=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},da(e)}function vp(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 bp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vp(Object(n),!0).forEach(function(r){Mx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vp(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mx(e,t,n){return(t=ZI(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZI(e){var t=eR(e,"string");return da(t)=="symbol"?t:t+""}function eR(e,t){if(da(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(da(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tR(e){return iR(e)||rR(e)||$x(e)||nR()}function nR(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1284
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rR(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function iR(e){if(Array.isArray(e))return Vd(e)}function Mn(e,t){return aR(e)||oR(e,t)||$x(e,t)||sR()}function sR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1285
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $x(e,t){if(e){if(typeof e=="string")return Vd(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)?Vd(e,t):void 0}}function Vd(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){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 aR(e){if(Array.isArray(e))return e}var lR=function(){var t,n=gn(),r=z.useState(!1),i=Mn(r,2),s=i[0],o=i[1],a=z.useState({}),l=Mn(a,2),c=l[0],u=l[1],d=z.useState(""),f=Mn(d,2),h=f[0],g=f[1],m=z.useState(1),p=Mn(m,2),v=p[0],b=p[1],w=z.useState({}),C=Mn(w,2),x=C[0],k=C[1],S=z.useState(!1),_=Mn(S,2),O=_[0],E=_[1],T=z.useState(!1),D=Mn(T,2),W=D[0],N=D[1],L=z.useState(null),$=Mn(L,2),I=$[0],oe=$[1],ue=En(),B=ue.brandId;function X(he){return String(he.id)}var ae=kk(B,{query:{enabled:!!B}}),ne=ae.data,R=ae.isLoading,G=10,q=(ne==null||(t=ne.data)===null||t===void 0?void 0:t.associatedBrands.filter(function(he){var we,ge;return h?((we=(ge=he.name)===null||ge===void 0?void 0:ge.toLowerCase())!==null&&we!==void 0?we:"").includes(h.toLowerCase()):!0}))||[],ce=Math.ceil(q.length/G),V=(v-1)*G,de=tR(q).sort(function(he,we){return he.type==="group"&&we.type!=="group"?-1:he.type!=="group"&&we.type==="group"?1:0}),fe=de.slice(V,V+G),Ne=function(we){var ge=q.find(function(qe){return X(qe)===we});ge&&ge.type==="group"?(oe(ge),N(!0)):console.log("Individual brand edit not implemented yet")},te=Object.entries(x).filter(function(he){var we=Mn(he,2),ge=we[1];return ge}).map(function(he){var we=Mn(he,1),ge=we[0];return ge}),De=function(){console.log("Group brands:",te),E(!0)},me=function(we){g(we.target.value),b(1)},Te=function(we){k(function(ge){return bp(bp({},ge),{},Mx({},we,!ge[we]))})},je=function(){n("/")},Et=function(){k({}),u({}),o(!1)},Z=function(){E(!1)},Me=function(){k({}),b(1),g("")},Je=function(){N(!1),oe(null)},Le=function(we,ge){return we in c?!!c[we]:!ge.isHidden},Ie=[{Header:"Brand name",accessor:"name",Cell:function(we){var ge=we.value,qe=we.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(A.Checkbox,{id:"brand-checkbox-".concat(qe.id),checked:!!x[X(qe)],onChange:function(){return Te(X(qe))},value:X(qe),label:qe.isSelf?y.jsx(Ec,{children:ge}):ge,name:"brand-checkbox-".concat(qe.id),disabled:!Le(X(qe),qe)}),qe.type==="group"&&y.jsx(SE,{className:"yst-h-4 yst-w-4 yst-text-slate-400"})]})})},LoadingComponent:function(we){var ge=we.id,qe=ge===void 0?"":ge;return y.jsxs("div",{className:"yst-flex",children:[y.jsx(A.Checkbox,{id:"loading-row-checkbox-".concat(qe),value:"loading...",label:"Loading...",disabled:!0,name:"brand-checkbox-".concat(qe)})," ",y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-32",id:"loading-row-skeleton-".concat(qe)})]})}},{Header:"Actions",accessor:"id",Cell:function(we){var ge=we.value,qe=we.row;return y.jsx(y.Fragment,{children:qe.type==="group"?y.jsxs(A.Button,{variant:"tertiary",size:"small",onClick:function(){return Ne(String(ge!=null?ge:""))},className:"yst-gap-1.5 yst-px-0",disabled:!Le(X(qe),qe),children:[y.jsx(Hv,{className:"yst-h-4 yst-w-4"}),"Edit group"]}):void 0})},LoadingComponent:function(){return y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-24"})}}];return y.jsxs(A.Paper,{className:"yst-mx-auto yst-max-w-2xl",children:[y.jsx(mf,{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(A.Paper.Content,{children:[y.jsx("div",{className:"yst-mb-6",children:y.jsx(A.TextInput,{id:"brand-search",label:"Search brands",placeholder:"Search brands",value:h,onChange:me})}),y.jsx("div",{className:"yst-mb-6",children:y.jsxs(A.Table,{columns:Ie,className:"yst-w-full",variant:"minimal",children:[y.jsx(A.Table.Head,{children:y.jsx(A.Table.Row,{children:Ie.map(function(he){return y.jsx(A.Table.Header,{children:he.Header},he.accessor)})})}),y.jsx(A.Table.Body,{children:R?[1,2,3].map(function(he,we){return y.jsx(A.Table.Row,{children:Ie.map(function(ge,qe){return y.jsx(A.Table.Cell,{children:y.jsx(ge.LoadingComponent,{id:"skeleton-".concat(we,"-").concat(qe)},ge.accessor)},"cell-".concat(qe))})},we)}):fe.length===0?y.jsx(A.Table.Row,{children:y.jsx(A.Table.Cell,{colSpan:Ie.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(A.Button,{variant:"secondary",size:"small",onClick:function(){g(""),b(1)},className:"yst-mt-4",children:"Clear search"})]})})}):fe.map(function(he){return y.jsx(A.Table.Row,{children:Ie.map(function(we){return y.jsx(A.Table.Cell,{children:we.Cell?we.Cell({value:he[we.accessor],row:he}):he[we.accessor]},we.accessor)})},he.id)})})]})}),y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-between",children:[y.jsxs(A.Button,{variant:"secondary",onClick:De,className:"yst-mb-0 yst-gap-2",disabled:te.length<2,children:[y.jsx(LO,{})," Group brands"]}),y.jsx(A.Pagination,{variant:"text",current:v,total:ce,onNavigate:b,className:"yst-flex-row",screenReaderTextPrevious:"Previous page",screenReaderTextNext:"Next page"})]})]}),y.jsx(pf,{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(A.Button,{variant:"secondary",className:"yst-mb-0",onClick:Et,children:"Discard changes"}),y.jsx(A.Button,{variant:"primary",className:"yst-mb-0",onClick:je,children:"Save changes"})]}):y.jsx(A.Button,{as:Vr,to:"/brands/".concat(B),variant:"primary",className:"yst-mb-0",children:"Show analysis →"})})}),y.jsx(JI,{isOpen:O,onClose:Z,brandId:B,brandsToGroup:q.filter(function(he){return te.includes(X(he))}),onGroupCreated:Me}),y.jsx(WI,{isOpen:W,onClose:Je,groupToEdit:I,allBrands:q})]})};const cR=Object.freeze(Object.defineProperty({__proto__:null,default:lR},Symbol.toStringTag,{value:"Module"}));function uR(e,t){return gR(e)||hR(e,t)||fR(e,t)||dR()}function dR(){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 fR(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 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 gR(e){if(Array.isArray(e))return e}var yR=function(t){var n=t.isOpen,r=t.onClose,i=qt(),s=z.useState(""),o=uR(s,2),a=o[0],l=o[1],c=tO({mutation:{onSuccess:function(){i.clear(),r()}}}),u=c.mutate,d=c.isPending;return z.useEffect(function(){n&&l("")},[n]),y.jsx(bf,{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(A.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 mR(e,t){return xR(e)||bR(e,t)||vR(e,t)||pR()}function pR(){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 vR(e,t){if(e){if(typeof e=="string")return wp(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)?wp(e,t):void 0}}function wp(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 bR(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 xR(e){if(Array.isArray(e))return e}var wR=function(t){var n=t.isOpen,r=t.brandId,i=t.onClose,s=t.brandName,o=qt(),a=z.useState(""),l=mR(a,2),c=l[0],u=l[1],d=Rk({mutation:{onSuccess:function(){o.invalidateQueries({queryKey:nr()}),console.log("Brand data deleted"),i()}}}),f=d.mutate,h=d.isPending;return z.useEffect(function(){n&&u("")},[n]),y.jsx(bf,{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(A.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 fa(e){"@babel/helpers - typeof";return fa=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},fa(e)}function jo(){/*! 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 Wt(b,"_invoke",function(w,C,x){var k,S,_,O=0,E=x||[],T=!1,D={p:0,n:0,v:e,a:W,f:W.bind(e,4),d:function(L,$){return k=L,S=0,_=e,D.n=$,o}};function W(N,L){for(S=N,_=L,t=0;!T&&O&&!$&&t<E.length;t++){var $,I=E[t],oe=D.p,ue=I[2];N>3?($=ue===L)&&(_=I[(S=I[4])?5:(S=3,3)],I[4]=I[5]=e):I[0]<=oe&&(($=N<2&&oe<I[1])?(S=0,D.v=L,D.n=I[1]):oe<ue&&($=N<3||I[0]>L||L>ue)&&(I[4]=N,I[5]=L,D.n=ue,S=0))}if($||N>1)return o;throw T=!0,L}return function(N,L,$){if(O>1)throw TypeError("Generator is already running");for(T&&L===1&&W(L,$),S=L,_=$;(t=S<2?e:_)||!T;){k||(S?S<3?(S>1&&(D.n=-1),W(S,_)):D.n=_:D.v=_);try{if(O=2,k){if(S||(N="next"),t=k[N]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,S<2&&(S=0)}else S===1&&(t=k.return)&&t.call(k),S<2&&(_=TypeError("The iterator does not provide a '"+N+"' method"),S=1);k=e}else if((t=(T=D.n<0)?_:w.call(C,D))!==o)break}catch(I){k=e,S=1,_=I}finally{O=1}}return{value:t,done:T}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Wt(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,Wt(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=c,Wt(d,"constructor",c),Wt(c,"constructor",l),l.displayName="GeneratorFunction",Wt(c,i,"GeneratorFunction"),Wt(d),Wt(d,i,"Generator"),Wt(d,r,function(){return this}),Wt(d,"toString",function(){return"[object Generator]"}),(jo=function(){return{w:s,m:f}})()}function Wt(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Wt=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){Wt(o,f,function(g){return this._invoke(f,h,g)})};u("next",0),u("throw",1),u("return",2)}},Wt(e,t,n,r)}function Sp(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 br(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Sp(Object(n),!0).forEach(function(r){SR(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sp(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function SR(e,t,n){return(t=CR(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CR(e){var t=_R(e,"string");return fa(t)=="symbol"?t:t+""}function _R(e,t){if(fa(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(fa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Cp(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 _p(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){Cp(s,r,i,o,a,"next",l)}function a(l){Cp(s,r,i,o,a,"throw",l)}o(void 0)})}}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.
1288
- 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 kp(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)?kp(e,t):void 0}}function kp(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,r=t.brand,i=t.isLast,s=t.onDelete,o=r.id,a=En(),l=a.hostAppProps,c=l.onAddSubscription,u=z.useState(!1),d=kR(u,2),f=d[0],h=d[1],g=qt(),m=kc({query:{select:function(S){var _=S.data;return _}}}),p=m.data,v=Bv({mutation:{onMutate:function(){var k=_p(jo().m(function _(O){var E,T,D;return jo().w(function(W){for(;;)switch(W.n){case 0:return E=O.brandId,T=O.data,W.n=1,g.cancelQueries({queryKey:nr()});case 1:return D=g.getQueryData(nr()),g.setQueryData(nr(),function(N){var L,$;return N&&br(br({},N),{},{data:br(br({},N.data),{},{brands:((L=($=N.data)===null||$===void 0?void 0:$.brands)!==null&&L!==void 0?L:[]).map(function(I){return I.id===E?br(br({},I),{},{settings:br(br({},I.settings),{},{enableAutomaticAnalysis:T.enableAutomaticAnalysis})}):I})})})}),W.a(2,{previous:D})}},_)}));function S(_){return k.apply(this,arguments)}return S}(),onError:function(S,_,O){O!=null&&O.previous&&g.setQueryData(nr(),O.previous)},onSettled:function(){var k=_p(jo().m(function _(){return jo().w(function(O){for(;;)switch(O.n){case 0:return O.n=1,Promise.all([g.invalidateQueries({queryKey:nr()}),g.invalidateQueries({queryKey:gf()})]);case 1:return O.a(2)}},_)}));function S(){return k.apply(this,arguments)}return S}()}}),b=v.mutate,w=function(S){b({brandId:o,data:{enableAutomaticAnalysis:S}})},C=function(S){S?h(!0):w(!1)},x=(p==null?void 0:p.maxNumberOfActiveBrands)&&(p==null?void 0:p.maxNumberOfActiveBrands)-(p==null?void 0:p.numberOfActiveBrands)>0;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(A.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:C}),y.jsx("div",{className:"yst-font-medium",children:(r==null?void 0:r.id)==="loading"?y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-32"}):r==null?void 0:r.name}),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(A.SkeletonLoader,{className:"yst-h-6 yst-w-24"}):y.jsxs(A.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(yf,{})," Delete brand"]})})]}),y.jsx(A.Modal,{isOpen:f,onClose:function(){return h(!1)},position:"center",as:"div",className:_e({"yst-mx-auto yst-max-w-xl":x}),children:x?y.jsxs(A.Modal.Panel,{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:"Start brand analysis now?"})}),y.jsxs(A.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(A.Modal.Container.Footer,{className:"yst-mt-3 yst-flex yst-justify-end yst-gap-2",children:[y.jsx(A.Button,{variant:"secondary",onClick:function(){return h(!1)},children:"Cancel"}),y.jsx(A.Button,{variant:"primary",onClick:function(){w(!0),h(!1)},children:"Yes, start analysis"})]})]}):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-center yst-text-lg yst-font-medium",children:"You've reached your active brand limit"})}),y.jsx(A.Modal.Container.Content,{className:"yst-mb-8 yst-space-y-3",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(A.Modal.Container.Footer,{children:y.jsxs("div",{className:"yst-flex yst-flex-col yst-justify-stretch yst-gap-2",children:[c&&y.jsxs(A.Button,{variant:"upsell",className:"yst-flex yst-gap-1",onClick:c,children:[y.jsx(Kv,{}),"Add a subscription"]}),y.jsx(A.Button,{variant:"tertiary",className:"",onClick:function(){return h(!1)},children:"Deactivate an existing brand"})]})})]})})]})},Op,Ep,Ap;function Lu(e,t){return DR(e)||$R(e,t)||MR(e,t)||jR()}function jR(){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 MR(e,t){if(e){if(typeof e=="string")return Pp(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)?Pp(e,t):void 0}}function Pp(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 $R(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 DR(e){if(Array.isArray(e))return e}function oh(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Tp=Da(Op||(Op=oh(["xl:yst-w-1/3"]))),jp=Da(Ep||(Ep=oh(["xl:yst-w-2/3"]))),Mp=Da(Ap||(Ap=oh(["yst-flex yst-flex-col yst-gap-8 xl:yst-flex-row"]))),LR=function(){var t,n,r,i,s=z.useState(!1),o=Lu(s,2),a=o[0],l=o[1],c=z.useState(!1),u=Lu(c,2),d=u[0],f=u[1],h=z.useState(null),g=Lu(h,2),m=g[0],p=g[1],v=kc({query:{select:function(S){var _=S.data;return _}}}),b=v.data,w=Ri({query:{select:function(S){var _=S.data;return _==null?void 0:_.brands}}}),C=w.data,x=C==null?void 0:C.find(function(k){return k.id===m});return y.jsxs("form",{children:[y.jsxs(A.Card,{children:[y.jsx(Xb,{title:"Settings",description:"Manage your brand settings and data. You can update analysis preferences or delete brands from your account."}),y.jsxs(A.Card.Content,{children:[y.jsxs(Mp,{children:[y.jsxs(Tp,{className:"yst-space-y-2",children:[y.jsx(A.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(jp,{children:[C&&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:"—"]}),C&&C.length===0&&y.jsxs("p",{className:"yst-mt-4 yst-text-slate-500",children:["No brands found. Please"," ",y.jsx(A.Link,{as:Vr,to:"/setup",children:"add a brand"})," ","to start analyzing."]}),(C!=null?C:[{id:"loading",name:"Loading..."}]).map(function(k,S,_){return y.jsx(TR,{brand:k,isLast:S===_.length-1,onDelete:function(O){p(O),l(!0)}},k.id)})]})]}),y.jsx(La,{}),y.jsxs(Mp,{children:[y.jsxs(Tp,{className:"yst-space-y-2",children:[y.jsx(A.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(jp,{className:"yst-space-y-4",children:[y.jsxs(A.Button,{variant:"error",onClick:function(){f(!0)},children:[y.jsx(yf,{})," 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(wR,{isOpen:a,onClose:function(){l(!1),p(null)},brandId:m||"",brandName:x==null?void 0:x.name}),y.jsx(yR,{isOpen:d,onClose:function(){f(!1)}})]})};const IR=Object.freeze(Object.defineProperty({__proto__:null,default:LR},Symbol.toStringTag,{value:"Module"}));function cc(e){"@babel/helpers - typeof";return cc=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},cc(e)}var Wd=[{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 and Perplexity. 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 and Perplexity. This process should take around 5 minutes."}],RR=function(t){return Wd.find(function(n){return!!Ps(n.path,t)})||Wd[0]};function NR(){var e=Bt(),t=RR(e.pathname);return y.jsxs(A.Paper,{className:"yst-mx-auto yst-max-w-2xl",children:[y.jsx(mf,{title:y.jsx(Dx,{currentStep:t,steps:Wd}),description:t.description}),y.jsx(A.Paper.Content,{children:y.jsx(Ts,{})})]})}var Dx=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:cc(r)==="object"?r.id:r}),"/",Array.isArray(i)?i.length:i]}),y.jsx("span",{children:cc(r)==="object"?r.title:n||"Step ".concat(r)})]})};const FR=Object.freeze(Object.defineProperty({__proto__:null,SetupPaperTitle:Dx,default:NR},Symbol.toStringTag,{value:"Module"}));var Lx=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(pf,{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(A.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(A.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(RO,{}),s]})})]})})},BR=[{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"}],qR=[{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"}],$p=[].concat(BR,qR,[{value:"OTHER",label:"Other"}]),zR=[{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"}],HR=[{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"}],KR=[].concat(zR,HR);function Br(e){"@babel/helpers - typeof";return Br=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},Br(e)}function Dp(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 Lp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Dp(Object(n),!0).forEach(function(r){Ix(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dp(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ix(e,t,n){return(t=UR(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UR(e){var t=VR(e,"string");return Br(t)=="symbol"?t:t+""}function VR(e,t){if(Br(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Br(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bo(e,t){return YR(e)||QR(e,t)||GR(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 GR(e,t){if(e){if(typeof e=="string")return Ip(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)?Ip(e,t):void 0}}function Ip(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 QR(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 YR(e){if(Array.isArray(e))return e}var XR=function(){var t,n=gn(),r=Oc(),i=qt(),s=z.useState(),o=bo(s,2),a=o[0],l=o[1],c=z.useState(!1),u=bo(c,2),d=u[0],f=u[1],h=z.useState({name:"",url:"",industry:"",language:"en",isLocal:!1,country:"",region:""}),g=bo(h,2),m=g[0],p=g[1],v=z.useState(null),b=bo(v,2),w=b[0],C=b[1],x=Mk({mutation:{onSuccess:function($){var I=$.data.id;i.invalidateQueries({queryKey:[gf(),nr()]}),I&&r.setBrandId(I),$!=null&&$.status&&$.status>=200&&$.status<300&&I&&(r.setBrandId(I),l(I))},onError:function(){f(!1)}}}),k=x.mutate,S=x.isPending,_=x.error,O=Ri({query:{enabled:!!a,select:function($){var I=$.data;return I==null?void 0:I.brands},refetchInterval:function($){var I;return(($==null||(I=$.state)===null||I===void 0||(I=I.data)===null||I===void 0||(I=I.data)===null||I===void 0?void 0:I.brands)||[]).find(function(oe){return oe.id===a})?!1:2*1e3}}}),E=O.data;z.useEffect(function(){a&&E!==null&&E!==void 0&&E.find(function(L){return L.id===a})&&n("/setup/".concat(a,"/queries"),{replace:!0})},[a,E,n]);var T=function($,I){p(function(oe){return Lp(Lp({},oe),{},Ix({},$,I))})},D=function($){if($.preventDefault(),C(null),m.industry.length>200){C("Industry must be 200 characters or less."),f(!1);return}f(!0);var I=m.url;I&&!/^https?:\/\//i.test(I)&&(I="https://".concat(I)),k({data:{name:m.name,url:I,industry:m.industry,focusLanguage:m.language,country:m.country,regionOrCity:m.region}})};function W(L){return Br(L)==="object"&&L!==null&&"response"in L&&Br(L.response)==="object"&&L.response!==void 0&&"data"in L.response}var N=W(_)?_.response.data.errors:void 0;return y.jsxs("form",{onSubmit:D,children:[y.jsxs("div",{className:"yst-space-y-6",children:[y.jsx(A.Title,{size:"2",children:"Brand info"}),!!_&&y.jsx(A.Alert,{variant:"error",title:"Error",isVisible:!!_,children:y.jsx("ul",{children:N&&Br(N)==="object"?Object.entries(N).flatMap(function(L){var $=bo(L,2),I=$[0],oe=$[1];return Array.isArray(oe)?oe.map(function(ue,B){return y.jsx("li",{children:ue},"".concat(I,"-").concat(B))}):null}):"There was an error creating the brand."})}),w&&y.jsx(A.Alert,{variant:"error",title:"Error",isVisible:!!w,children:y.jsx("ul",{children:y.jsx("li",{children:"Industry must be 200 characters or less."})})}),y.jsx(A.TextField,{id:"name",label:"Brand name",value:m.name,onChange:function(L){return T("name",L.target.value)}}),y.jsx(A.TextField,{id:"url",label:"Website URL (optional)",placeholder:"Example: https://yourwebsite.com",value:m.url,onChange:function(L){return T("url",L.target.value)}}),y.jsxs("div",{children:[y.jsx(A.TextField,{id:"industry",label:"Industry (max 200 characters)",value:m.industry,onChange:function(L){var $=L.target.value;T("industry",$),$.length>200?C("Industry must be 200 characters or less."):C(null)},placeholder:"Give a short description of your industry"}),y.jsxs("div",{className:"yst-text-right yst-text-xs yst-text-slate-500 yst-mt-1",children:[m.industry.length,"/200"]})]}),y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(A.Select,{className:"yst-max-w-sm",id:"language-select",label:"Target language",value:m.language,onChange:function(L){return T("language",L)},options:KR.map(function(L){return{label:L.label,value:L.value}})}),y.jsx("p",{children:"The main language your brand uses to communicate or create content."})]})]}),y.jsx(La,{}),y.jsxs("div",{className:"yst-space-y-6",children:[y.jsx(A.Title,{size:"2",children:"Location info"}),y.jsx("p",{children:"You can specify a location to help focus the analysis."}),y.jsx(A.Autocomplete,{className:"yst-max-w-sm",id:"country-select",label:"Target country (optional)",value:m.country,nullable:!0,placeholder:"Select...",onChange:function(L){return T("country",L)},onQueryChange:function(){},selectedLabel:((t=$p.find(function(L){return L.value===m.country}))===null||t===void 0?void 0:t.label)||"",children:$p.map(function(L){return y.jsx(A.Autocomplete.Option,{value:L.value,children:L.label},L.value)})}),m.country&&y.jsx(A.TextField,{id:"region",label:"Target city, state, or region (optional)",value:m.region,onChange:function(L){return T("region",L.target.value)},description:`Enter a city, state, or region to narrow down the analysis. For
1291
- example: California, Bavaria, or Paris.`})]}),y.jsx(Lx,{onBack:function(){return n(-1)},buttonText:"Generate queries",isButtonDisabled:S||!!a||d,isLoading:S||!!a})]})};const JR=Object.freeze(Object.defineProperty({__proto__:null,default:XR},Symbol.toStringTag,{value:"Module"})),ZR=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 ha(e){"@babel/helpers - typeof";return ha=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},ha(e)}function eN(e){return rN(e)||nN(e)||Rx(e)||tN()}function tN(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1292
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nN(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function rN(e){if(Array.isArray(e))return Gd(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 xr(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){iN(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 iN(e,t,n){return(t=sN(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sN(e){var t=oN(e,"string");return ha(t)=="symbol"?t:t+""}function oN(e,t){if(ha(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ha(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xo(e,t){return cN(e)||lN(e,t)||Rx(e,t)||aN()}function aN(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1293
- 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 Gd(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)?Gd(e,t):void 0}}function Gd(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 lN(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 cN(e){if(Array.isArray(e))return e}var Mo=5,Qd="Generating...",uN="Re-generating...",dN=["******************************","***********************","*******************************************************","***********************************************","***************************************************************","*******************************************************","*******************************************************","***********************************************"],fN=Array.from({length:Mo},function(e,t){return{id:"query-".concat(t),text:Qd,isRegenerating:!0}}),hN=function(){var t=En(),n=t.brandId,r="/setup/".concat(n,"/analysis"),i=gn(),s=qt(),o=z.useState(fN),a=xo(o,2),l=a[0],c=a[1],u=z.useState(!1),d=xo(u,2),f=d[0],h=d[1],g=z.useState([]),m=xo(g,2),p=m[0],v=m[1],b=z.useState([]),w=xo(b,2),C=w[0],x=w[1],k=z.useState(!1),S=xo(k,2),_=S[0],O=S[1],E=Yk(n,{query:{enabled:!!n}}),T=E.data,D=E.isRefetching,W=E.refetch,N=Vk({mutation:{onSuccess:function(q){q!=null&&q.status&&q.status>=200&&q.status<300&&(s.invalidateQueries({queryKey:[hf(n)]}),i(r))},onError:function(q){i(r,{replace:!0}),console.error("Error saving queries:",q)}}}),L=N.mutate,$=N.isPending;z.useEffect(function(){var G;if(T!=null&&(G=T.data)!==null&&G!==void 0&&G.queries&&Array.isArray(T.data.queries)){var q=T.data.queries.slice(0,Mo);c(q.map(function(ce,V){return{id:"query-".concat(V),text:ce,isRegenerating:!1}})),x(T.data.queries.slice(Mo))}},[T]),z.useEffect(function(){var G;if(_&&T!==null&&T!==void 0&&(G=T.data)!==null&&G!==void 0&&G.queries&&Array.isArray(T.data.queries)&&!D){var q=T.data.queries.slice(0,Mo),ce=p.map(Number);c(function(V){return V.map(function(de,fe){var Ne=ce.indexOf(fe);return xr(xr({},de),{},{text:Ne>=0&&q[Ne]?q[Ne]:de.text,isRegenerating:!1})})}),O(!1),v([])}},[T,D,_,p]);var I=z.useCallback(function(G,q){var ce=new Set(q);return C.filter(function(V){return!ce.has(V)}).slice(0,G)},[C]),oe=z.useMemo(function(){return D||l.length===0||l.some(function(G){return G.isRegenerating||G.text===Qd})||f},[D,l,f]),ue=D||l.some(function(G){return G.text===Qd}),B=z.useCallback(function(G){var q=G.toString();v(function(ce){return ce.includes(q)?ce.filter(function(V){return V!==q}):[].concat(eN(ce),[q])})},[]),X=z.useCallback(function(G,q){c(function(ce){return ce.map(function(V,de){return de===G?xr(xr({},V),{},{text:q}):V})})},[]),ae=function(){h(!f),v([])},ne=z.useCallback(function(){if(!(D||p.length===0)){c(function(V){return V.map(function(de,fe){return xr(xr({},de),{},{isRegenerating:p.includes(fe.toString())})})});var G=l.map(function(V){return V.text}),q=p.length,ce=I(q,G);ce.length===q?(c(function(V){return V.map(function(de,fe){var Ne=p.indexOf(fe.toString());return Ne>=0?xr(xr({},de),{},{text:ce[Ne],isRegenerating:!1}):de})}),x(function(V){var de=new Set(ce);return V.filter(function(fe){return!de.has(fe)})}),v([])):(O(!0),W())}},[D,p,W,l,I]),R=z.useCallback(function(G){G.preventDefault(),n&&L({brandId:n,data:{queries:l.map(function(q){return q.text})}})},[n,l,L]);return y.jsxs("form",{onSubmit:R,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:ae,children:"Done"}),y.jsxs(A.Button,{variant:"secondary",size:"small",onClick:ne,className:"yst-gap-1",isLoading:D,disabled:D||p.length===0,children:[y.jsx(ZR,{"aria-hidden":"true"}),"Regenerate selected queries"]})]}):y.jsxs(A.Button,{size:"small",variant:"secondary",onClick:ae,className:"yst-gap-1.5",disabled:ue,children:[y.jsx(CO,{}),"Select queries to regenerate"]})})]})]}),y.jsx("div",{className:"yst-mb-8",children:l.length===0?dN.map(function(G,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:G||"Example placeholder query for demonstration purposes."})},"placeholder-query-".concat(q))}):l.slice(0,Mo).map(function(G,q){var ce=G.isRegenerating?uN:G.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 B(q)},disabled:D})}),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(V){G.isRegenerating||X(q,V.target.value)},placeholder:"Enter your query...",className:"yst-w-full",disabled:G.isRegenerating,required:!0})]})]})},G.id)})}),y.jsx(Lx,{buttonText:"Run analysis (~ 5 minutes)",isButtonDisabled:oe,isLoading:$})]})};const gN=Object.freeze(Object.defineProperty({__proto__:null,default:hN},Symbol.toStringTag,{value:"Module"}));var Ui=[{labelAbove:"Running queries...",label:"Running queries",threshold:99},{labelAbove:"Done!",label:"Building analysis",threshold:100}],Nx=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<Ui.length;c++)if(r<=Ui[c].threshold)return Ui[c];return Ui[Ui.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(A.ProgressBar,{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:Ui.map(function(l){return y.jsx("span",{children:y.jsx(Ec,{disabled:a.label!==l.label,children:l.label})},l.label)})})]})};Nx.propTypes={progress:bd.number,className:bd.string};var yN=function(t){switch(t){case"pending":case"processing":return 2*1e3;case"completed":return!1;default:return 10*1e3}},mN=function(){var t,n,r,i=gn(),s=qt(),o=Zd(),a=En(),l=a.brandId,c=o.brandId||l,u=Fv(c,{query:{enabled:!!c,select:function(C){var x=C.data;return x}}}),d=u.data,f=bk(c,"latest",{query:{enabled:!!c,select:function(C){var x=C.data;return x},refetchInterval:function(C){var x,k=C==null||(x=C.state)===null||x===void 0||(x=x.data)===null||x===void 0?void 0:x.data;return yN(k==null?void 0:k.status)}}}),h=f.data;z.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&&aE(d.nextScheduledAnalysis,5)&&!w&&i("/brands/".concat(c),{replace:!0})},[d==null?void 0:d.nextScheduledAnalysis,c,i,h==null?void 0:h.status]);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,C=v*w;return(h==null?void 0:h.status)==="completed"?100:Math.round(Math.min(C,80))}return 0}();return y.jsxs("div",{children:[y.jsxs("div",{className:"yst-space-y-8",children:[y.jsx(Nx,{progress:b}),y.jsx(La,{}),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 C,x=w.id,k=w.query,S=x&&(h==null||(C=h.completedQueries)===null||C===void 0?void 0:C.includes(x));return y.jsxs("div",{className:_e("yst-flex yst-items-center yst-justify-between yst-gap-3"),children:[S===!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:k})]},"result-item-".concat(k))})})]}),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:Vr,to:m,onClick:function(){return s.clear()},children:b===100?"Continue →":"Skip for now"})})]})};const pN=Object.freeze(Object.defineProperty({__proto__:null,default:mN},Symbol.toStringTag,{value:"Module"}));exports.AIInsightsClient=y$;exports.setApiBaseUrl=$v;
1282
+ `}},mn=e=>$x("light",e),pn=e=>$x("dark",e);yc(["click","mousedown","input"]);var HI=e=>{const[t,n]=Zb({prefix:"TanstackQueryDevtools"}),r=ov(),i=H(()=>{const s=t.theme_preference||e1;return s!=="system"?s:r()});return j(Rf.Provider,{value:e,get children(){return j(i1,{localStore:t,setLocalStore:n,get children(){return j(Ff.Provider,{value:i,get children(){return j(TI,{localStore:t,setLocalStore:n})}})}})}})},KI=HI;const UI=Object.freeze(Object.defineProperty({__proto__:null,default:KI},Symbol.toStringTag,{value:"Module"}));var WI=e=>{const[t,n]=Zb({prefix:"TanstackQueryDevtools"}),r=ov(),i=H(()=>{const s=t.theme_preference||e1;return s!=="system"?s:r()});return j(Rf.Provider,{value:e,get children(){return j(i1,{disabled:!0,localStore:t,setLocalStore:n,get children(){return j(Ff.Provider,{value:i,get children(){return j($I,{get children(){return j(sh,{localStore:t,setLocalStore:n,get onClose(){return e.onClose},showPanelViewOnly:!0})}})}})}})}})},VI=WI;const GI=Object.freeze(Object.defineProperty({__proto__:null,default:VI},Symbol.toStringTag,{value:"Module"}));function yp(e,t){return JI(e)||XI(e,t)||YI(e,t)||QI()}function QI(){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 YI(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 XI(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 JI(e){if(Array.isArray(e))return e}var ZI=function(t){var n=t.isOpen,r=t.onClose,i=t.groupToEdit,s=t.allBrands,o=En(),a=o.brandId,l=z.useState(""),c=yp(l,2),u=c[0],d=c[1],f=z.useState([]),h=yp(f,2),g=h[0],m=h[1],p=qt();z.useEffect(function(){if(n&&i&&i.type==="group"){var S;d(String(i.name||""));var _=((S=i.groupedBrands)===null||S===void 0?void 0:S.map(function(O){return String(O.id||"")}))||[];m(_)}},[n,i]);var v=Fv({mutation:{onSuccess:function(){p.invalidateQueries({queryKey:ff(a)}),x()},onError:function(_){console.error("Error creating brand group:",_)}}}),b=v.mutate,w=v.isPending,C=function(){!u.trim()||!(i!=null&&i.id)||b({brandId:a,data:{groupName:u.trim(),brandIds:g.map(function(_){return Number(_)})}})},x=function(){d(""),m([]),r()},k=function(){return g.map(function(_){if(i&&i.type==="group"){var O,E=(O=i.groupedBrands)===null||O===void 0?void 0:O.find(function(D){return String(D.id)===_});if(E)return E.name||""}var T=s.find(function(D){return String(D.id)===_});return T?T.type==="group"?"Group: ".concat(T.name):T.name||"":""}).filter(Boolean)};return!i||i.type!=="group"?null:y.jsx(A.Modal,{isOpen:n,onClose:x,children:y.jsx(A.Modal.Panel,{children:y.jsxs(A.Modal.Container,{children:[y.jsx(A.Modal.Container.Header,{className:"yst-mb-4",children:y.jsx(A.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Edit brand group"})}),y.jsxs(A.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(A.TextInput,{id:"editGroupName",value:u,onChange:function(S){return d(S.target.value)},placeholder:"Enter group name",className:"yst-w-full"})]}),y.jsxs("div",{children:[y.jsx(A.TagField,{id:"editGroupedBrands",label:"Grouped brands",tags:k(),onRemoveTag:function(S){m(function(_){return _.filter(function(O,E){return E!==S})})},onAddTag:function(){}}),g.length===0&&y.jsx("p",{className:"yst-mt-2 yst-text-sm yst-italic yst-text-gray-500",children:"No brands in this group"})]})]}),y.jsx(A.Modal.Container.Footer,{children:y.jsxs("div",{className:"yst-flex yst-justify-end yst-gap-2",children:[y.jsx(A.Button,{variant:"secondary",onClick:x,children:"Cancel"}),y.jsx(A.Button,{variant:"primary",onClick:C,disabled:!u.trim()||w,isLoading:w,children:w?"Saving...":"Save changes"})]})})]})})})};function pp(e,t){return rR(e)||nR(e,t)||tR(e,t)||eR()}function eR(){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 tR(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 nR(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 rR(e){if(Array.isArray(e))return e}var iR=function(t){var n=t.isOpen,r=t.onClose,i=t.brandId,s=t.brandsToGroup,o=t.onGroupCreated,a=qt(),l=z.useState(""),c=pp(l,2),u=c[0],d=c[1],f=z.useState([]),h=pp(f,2),g=h[0],m=h[1];z.useEffect(function(){if(n&&s.length>0){var k,S=(k=s[0])===null||k===void 0?void 0:k.name;d(String(S||"New Group")),m(s.map(function(_){var O;return String((O=_.id)!==null&&O!==void 0?O:"")}))}},[n,s]);var p=Fv({mutation:{onSuccess:function(){a.invalidateQueries({queryKey:ff(i)}),o==null||o(),w()},onError:function(S){console.error("Error creating group:",S)}}}),v=p.mutate,b=p.isPending,w=function(){d(""),m([]),r()},C=function(){if(!(!u.trim()||g.length===0)){var S=g.flatMap(function(_){var O=s.find(function(E){return String(E.id)===_});return O&&O.type==="group"&&Array.isArray(O.groupedBrands)?O.groupedBrands.map(function(E){return String(E.id)}):_});v({brandId:i,data:{groupName:u.trim(),brandIds:S.filter(function(_){return _!==""}).map(function(_){return Number(_)})}})}},x=function(S){m(function(_){return _.filter(function(O){return O!==S})})};return y.jsx(A.Modal,{isOpen:n,onClose:w,children:y.jsx(A.Modal.Panel,{children:y.jsxs(A.Modal.Container,{children:[y.jsx(A.Modal.Container.Header,{children:y.jsx(A.Modal.Title,{children:"Edit brand group"})}),y.jsxs(A.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(A.TextInput,{id:"groupName",value:u,onChange:function(k){return d(k.target.value)},placeholder:"Enter group name",className:"yst-w-full"})]}),y.jsxs("div",{children:[y.jsx(A.TagField,{id:"groupedBrands",label:"Brands in group (".concat(g.length,")"),tags:g.map(function(k){var S=s.find(function(_){return String(_.id)===k});return S?S.type==="group"?"Group: ".concat(S.name):S.name||"":""}).filter(Boolean),onRemoveTag:function(k){var S=g.find(function(_){var O=s.find(function(T){return String(T.id)===_});if(!O)return!1;var E=O.type==="group"?"Group: ".concat(O.name):O.name||"";return E===k});S&&x(S)},onAddTag:function(){}}),g.length===0&&y.jsx("p",{className:"yst-text-sm yst-italic yst-text-gray-500",children:"No brands selected"})]})]}),y.jsx(A.Modal.Container.Footer,{children:y.jsxs("div",{className:"yst-flex yst-justify-end yst-gap-2",children:[y.jsx(A.Button,{variant:"secondary",onClick:w,disabled:b,children:"Cancel"}),y.jsx(A.Button,{variant:"primary",onClick:C,disabled:!u.trim()||g.length===0||b,children:b?"Saving...":"Save group"})]})})]})})})};function da(e){"@babel/helpers - typeof";return da=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},da(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 xp(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){Mx(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 Mx(e,t,n){return(t=sR(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sR(e){var t=oR(e,"string");return da(t)=="symbol"?t:t+""}function oR(e,t){if(da(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(da(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function aR(e){return uR(e)||cR(e)||Dx(e)||lR()}function lR(){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 cR(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function uR(e){if(Array.isArray(e))return Wd(e)}function $n(e,t){return hR(e)||fR(e,t)||Dx(e,t)||dR()}function dR(){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 Dx(e,t){if(e){if(typeof e=="string")return Wd(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)?Wd(e,t):void 0}}function Wd(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 fR(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 hR(e){if(Array.isArray(e))return e}var gR=function(){var t,n=gn(),r=z.useState(!1),i=$n(r,2),s=i[0],o=i[1],a=z.useState({}),l=$n(a,2),c=l[0],u=l[1],d=z.useState(""),f=$n(d,2),h=f[0],g=f[1],m=z.useState(1),p=$n(m,2),v=p[0],b=p[1],w=z.useState({}),C=$n(w,2),x=C[0],k=C[1],S=z.useState(!1),_=$n(S,2),O=_[0],E=_[1],T=z.useState(!1),D=$n(T,2),G=D[0],N=D[1],L=z.useState(null),M=$n(L,2),I=M[0],oe=M[1],ue=En(),B=ue.brandId;function J(he){return String(he.id)}var ae=Ok(B,{query:{enabled:!!B}}),ne=ae.data,R=ae.isLoading,Q=10,q=(ne==null||(t=ne.data)===null||t===void 0?void 0:t.associatedBrands.filter(function(he){var xe,ge;return h?((xe=(ge=he.name)===null||ge===void 0?void 0:ge.toLowerCase())!==null&&xe!==void 0?xe:"").includes(h.toLowerCase()):!0}))||[],ce=Math.ceil(q.length/Q),W=(v-1)*Q,de=aR(q).sort(function(he,xe){return he.type==="group"&&xe.type!=="group"?-1:he.type!=="group"&&xe.type==="group"?1:0}),fe=de.slice(W,W+Q),Le=function(xe){var ge=q.find(function(Be){return J(Be)===xe});ge&&ge.type==="group"?(oe(ge),N(!0)):console.log("Individual brand edit not implemented yet")},te=Object.entries(x).filter(function(he){var xe=$n(he,2),ge=xe[1];return ge}).map(function(he){var xe=$n(he,1),ge=xe[0];return ge}),et=function(){console.log("Group brands:",te),E(!0)},_e=function(xe){g(xe.target.value),b(1)},Ie=function(xe){k(function(ge){return xp(xp({},ge),{},Mx({},xe,!ge[xe]))})},Re=function(){n("/")},ze=function(){k({}),u({}),o(!1)},V=function(){E(!1)},Ee=function(){k({}),b(1),g("")},He=function(){N(!1),oe(null)},$e=function(xe,ge){return xe in c?!!c[xe]:!ge.isHidden},Me=[{Header:"Brand name",accessor:"name",Cell:function(xe){var ge=xe.value,Be=xe.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(A.Checkbox,{id:"brand-checkbox-".concat(Be.id),checked:!!x[J(Be)],onChange:function(){return Ie(J(Be))},value:J(Be),label:Be.isSelf?y.jsx(Ec,{children:ge}):ge,name:"brand-checkbox-".concat(Be.id),disabled:!$e(J(Be),Be)}),Be.type==="group"&&y.jsx(CE,{className:"yst-h-4 yst-w-4 yst-text-slate-400"})]})})},LoadingComponent:function(xe){var ge=xe.id,Be=ge===void 0?"":ge;return y.jsxs("div",{className:"yst-flex",children:[y.jsx(A.Checkbox,{id:"loading-row-checkbox-".concat(Be),value:"loading...",label:"Loading...",disabled:!0,name:"brand-checkbox-".concat(Be)})," ",y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-32",id:"loading-row-skeleton-".concat(Be)})]})}},{Header:"Actions",accessor:"id",Cell:function(xe){var ge=xe.value,Be=xe.row;return y.jsx(y.Fragment,{children:Be.type==="group"?y.jsxs(A.Button,{variant:"tertiary",size:"small",onClick:function(){return Le(String(ge!=null?ge:""))},className:"yst-gap-1.5 yst-px-0",disabled:!$e(J(Be),Be),children:[y.jsx(Kv,{className:"yst-h-4 yst-w-4"}),"Edit group"]}):void 0})},LoadingComponent:function(){return y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-24"})}}];return y.jsxs(A.Paper,{className:"yst-mx-auto yst-max-w-2xl",children:[y.jsx(mf,{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(A.Paper.Content,{children:[y.jsx("div",{className:"yst-mb-6",children:y.jsx(A.TextInput,{id:"brand-search",label:"Search brands",placeholder:"Search brands",value:h,onChange:_e})}),y.jsx("div",{className:"yst-mb-6",children:y.jsxs(A.Table,{columns:Me,className:"yst-w-full",variant:"minimal",children:[y.jsx(A.Table.Head,{children:y.jsx(A.Table.Row,{children:Me.map(function(he){return y.jsx(A.Table.Header,{children:he.Header},he.accessor)})})}),y.jsx(A.Table.Body,{children:R?[1,2,3].map(function(he,xe){return y.jsx(A.Table.Row,{children:Me.map(function(ge,Be){return y.jsx(A.Table.Cell,{children:y.jsx(ge.LoadingComponent,{id:"skeleton-".concat(xe,"-").concat(Be)},ge.accessor)},"cell-".concat(Be))})},xe)}):fe.length===0?y.jsx(A.Table.Row,{children:y.jsx(A.Table.Cell,{colSpan:Me.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(A.Button,{variant:"secondary",size:"small",onClick:function(){g(""),b(1)},className:"yst-mt-4",children:"Clear search"})]})})}):fe.map(function(he){return y.jsx(A.Table.Row,{children:Me.map(function(xe){return y.jsx(A.Table.Cell,{children:xe.Cell?xe.Cell({value:he[xe.accessor],row:he}):he[xe.accessor]},xe.accessor)})},he.id)})})]})}),y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-between",children:[y.jsxs(A.Button,{variant:"secondary",onClick:et,className:"yst-mb-0 yst-gap-2",disabled:te.length<2,children:[y.jsx(IO,{})," Group brands"]}),y.jsx(A.Pagination,{variant:"text",current:v,total:ce,onNavigate:b,className:"yst-flex-row",screenReaderTextPrevious:"Previous page",screenReaderTextNext:"Next page"})]})]}),y.jsx(pf,{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(A.Button,{variant:"secondary",className:"yst-mb-0",onClick:ze,children:"Discard changes"}),y.jsx(A.Button,{variant:"primary",className:"yst-mb-0",onClick:Re,children:"Save changes"})]}):y.jsx(A.Button,{as:Wr,to:"/brands/".concat(B),variant:"primary",className:"yst-mb-0",children:"Show analysis →"})})}),y.jsx(iR,{isOpen:O,onClose:V,brandId:B,brandsToGroup:q.filter(function(he){return te.includes(J(he))}),onGroupCreated:Ee}),y.jsx(ZI,{isOpen:G,onClose:He,groupToEdit:I,allBrands:q})]})};const yR=Object.freeze(Object.defineProperty({__proto__:null,default:gR},Symbol.toStringTag,{value:"Module"}));function mR(e,t){return xR(e)||bR(e,t)||vR(e,t)||pR()}function pR(){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 vR(e,t){if(e){if(typeof e=="string")return wp(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)?wp(e,t):void 0}}function wp(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 bR(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 xR(e){if(Array.isArray(e))return e}var wR=function(t){var n=t.isOpen,r=t.onClose,i=qt(),s=z.useState(""),o=mR(s,2),a=o[0],l=o[1],c=nO({mutation:{onSuccess:function(){i.clear(),r()}}}),u=c.mutate,d=c.isPending;return z.useEffect(function(){n&&l("")},[n]),y.jsx(bf,{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(A.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 SR(e,t){return OR(e)||kR(e,t)||_R(e,t)||CR()}function CR(){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 Sp(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)?Sp(e,t):void 0}}function Sp(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 kR(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 OR(e){if(Array.isArray(e))return e}var ER=function(t){var n=t.isOpen,r=t.brandId,i=t.onClose,s=t.brandName,o=qt(),a=z.useState(""),l=SR(a,2),c=l[0],u=l[1],d=Nk({mutation:{onSuccess:function(){o.invalidateQueries({queryKey:nr()}),console.log("Brand data deleted"),i()}}}),f=d.mutate,h=d.isPending;return z.useEffect(function(){n&&u("")},[n]),y.jsx(bf,{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(A.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 fa(e){"@babel/helpers - typeof";return fa=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},fa(e)}function jo(){/*! 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 Vt(b,"_invoke",function(w,C,x){var k,S,_,O=0,E=x||[],T=!1,D={p:0,n:0,v:e,a:G,f:G.bind(e,4),d:function(L,M){return k=L,S=0,_=e,D.n=M,o}};function G(N,L){for(S=N,_=L,t=0;!T&&O&&!M&&t<E.length;t++){var M,I=E[t],oe=D.p,ue=I[2];N>3?(M=ue===L)&&(_=I[(S=I[4])?5:(S=3,3)],I[4]=I[5]=e):I[0]<=oe&&((M=N<2&&oe<I[1])?(S=0,D.v=L,D.n=I[1]):oe<ue&&(M=N<3||I[0]>L||L>ue)&&(I[4]=N,I[5]=L,D.n=ue,S=0))}if(M||N>1)return o;throw T=!0,L}return function(N,L,M){if(O>1)throw TypeError("Generator is already running");for(T&&L===1&&G(L,M),S=L,_=M;(t=S<2?e:_)||!T;){k||(S?S<3?(S>1&&(D.n=-1),G(S,_)):D.n=_:D.v=_);try{if(O=2,k){if(S||(N="next"),t=k[N]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,S<2&&(S=0)}else S===1&&(t=k.return)&&t.call(k),S<2&&(_=TypeError("The iterator does not provide a '"+N+"' method"),S=1);k=e}else if((t=(T=D.n<0)?_:w.call(C,D))!==o)break}catch(I){k=e,S=1,_=I}finally{O=1}}return{value:t,done:T}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Vt(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,Vt(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=c,Vt(d,"constructor",c),Vt(c,"constructor",l),l.displayName="GeneratorFunction",Vt(c,i,"GeneratorFunction"),Vt(d),Vt(d,i,"Generator"),Vt(d,r,function(){return this}),Vt(d,"toString",function(){return"[object Generator]"}),(jo=function(){return{w:s,m:f}})()}function Vt(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Vt=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){Vt(o,f,function(g){return this._invoke(f,h,g)})};u("next",0),u("throw",1),u("return",2)}},Vt(e,t,n,r)}function Cp(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 br(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Cp(Object(n),!0).forEach(function(r){AR(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cp(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function AR(e,t,n){return(t=PR(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PR(e){var t=TR(e,"string");return fa(t)=="symbol"?t:t+""}function TR(e,t){if(fa(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(fa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _p(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 kp(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){_p(s,r,i,o,a,"next",l)}function a(l){_p(s,r,i,o,a,"throw",l)}o(void 0)})}}function jR(e,t){return LR(e)||DR(e,t)||MR(e,t)||$R()}function $R(){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 MR(e,t){if(e){if(typeof e=="string")return Op(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)?Op(e,t):void 0}}function Op(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 LR(e){if(Array.isArray(e))return e}var IR=function(t){var n,r=t.brand,i=t.isLast,s=t.onDelete,o=r.id,a=En(),l=a.hostAppProps,c=l.onAddSubscription,u=z.useState(!1),d=jR(u,2),f=d[0],h=d[1],g=qt(),m=kc({query:{select:function(S){var _=S.data;return _}}}),p=m.data,v=qv({mutation:{onMutate:function(){var k=kp(jo().m(function _(O){var E,T,D;return jo().w(function(G){for(;;)switch(G.n){case 0:return E=O.brandId,T=O.data,G.n=1,g.cancelQueries({queryKey:nr()});case 1:return D=g.getQueryData(nr()),g.setQueryData(nr(),function(N){var L,M;return N&&br(br({},N),{},{data:br(br({},N.data),{},{brands:((L=(M=N.data)===null||M===void 0?void 0:M.brands)!==null&&L!==void 0?L:[]).map(function(I){return I.id===E?br(br({},I),{},{settings:br(br({},I.settings),{},{enableAutomaticAnalysis:T.enableAutomaticAnalysis})}):I})})})}),G.a(2,{previous:D})}},_)}));function S(_){return k.apply(this,arguments)}return S}(),onError:function(S,_,O){O!=null&&O.previous&&g.setQueryData(nr(),O.previous)},onSettled:function(){var k=kp(jo().m(function _(){return jo().w(function(O){for(;;)switch(O.n){case 0:return O.n=1,Promise.all([g.invalidateQueries({queryKey:nr()}),g.invalidateQueries({queryKey:gf()})]);case 1:return O.a(2)}},_)}));function S(){return k.apply(this,arguments)}return S}()}}),b=v.mutate,w=function(S){b({brandId:o,data:{enableAutomaticAnalysis:S}})},C=function(S){S?h(!0):w(!1)},x=(p==null?void 0:p.maxNumberOfActiveBrands)&&(p==null?void 0:p.maxNumberOfActiveBrands)-(p==null?void 0:p.numberOfActiveBrands)>0;return y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:Ce("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(A.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:C}),y.jsx("div",{className:"yst-font-medium",children:(r==null?void 0:r.id)==="loading"?y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-32"}):r==null?void 0:r.name}),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(A.SkeletonLoader,{className:"yst-h-6 yst-w-24"}):y.jsxs(A.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(yf,{})," Delete brand"]})})]}),y.jsx(A.Modal,{isOpen:f,onClose:function(){return h(!1)},position:"center",as:"div",className:Ce({"yst-mx-auto yst-max-w-xl":x}),children:x?y.jsxs(A.Modal.Panel,{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:"Start brand analysis now?"})}),y.jsxs(A.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(A.Modal.Container.Footer,{className:"yst-mt-3 yst-flex yst-justify-end yst-gap-2",children:[y.jsx(A.Button,{variant:"secondary",onClick:function(){return h(!1)},children:"Cancel"}),y.jsx(A.Button,{variant:"primary",onClick:function(){w(!0),h(!1)},children:"Yes, start analysis"})]})]}):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-center yst-text-lg yst-font-medium",children:"You've reached your active brand limit"})}),y.jsx(A.Modal.Container.Content,{className:"yst-mb-8 yst-space-y-3",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(A.Modal.Container.Footer,{children:y.jsxs("div",{className:"yst-flex yst-flex-col yst-justify-stretch yst-gap-2",children:[c&&y.jsxs(A.Button,{variant:"upsell",className:"yst-flex yst-gap-1",onClick:c,children:[y.jsx(Uv,{}),"Add a subscription"]}),y.jsx(A.Button,{variant:"tertiary",className:"",onClick:function(){return h(!1)},children:"Deactivate an existing brand"})]})})]})})]})},Ep,Ap,Pp;function Lu(e,t){return BR(e)||FR(e,t)||NR(e,t)||RR()}function RR(){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 NR(e,t){if(e){if(typeof e=="string")return Tp(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)?Tp(e,t):void 0}}function Tp(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 FR(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 BR(e){if(Array.isArray(e))return e}function oh(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var jp=Da(Ep||(Ep=oh(["xl:yst-w-1/3"]))),$p=Da(Ap||(Ap=oh(["xl:yst-w-2/3"]))),Mp=Da(Pp||(Pp=oh(["yst-flex yst-flex-col yst-gap-8 xl:yst-flex-row"]))),qR=function(){var t,n,r,i,s=z.useState(!1),o=Lu(s,2),a=o[0],l=o[1],c=z.useState(!1),u=Lu(c,2),d=u[0],f=u[1],h=z.useState(null),g=Lu(h,2),m=g[0],p=g[1],v=kc({query:{select:function(S){var _=S.data;return _}}}),b=v.data,w=Ri({query:{select:function(S){var _=S.data;return _==null?void 0:_.brands}}}),C=w.data,x=C==null?void 0:C.find(function(k){return k.id===m});return y.jsxs("form",{children:[y.jsxs(A.Card,{children:[y.jsx(Jb,{title:"Settings",description:"Manage your brand settings and data. You can update analysis preferences or delete brands from your account."}),y.jsxs(A.Card.Content,{children:[y.jsxs(Mp,{children:[y.jsxs(jp,{className:"yst-space-y-2",children:[y.jsx(A.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($p,{children:[C&&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:"—"]}),C&&C.length===0&&y.jsxs("p",{className:"yst-mt-4 yst-text-slate-500",children:["No brands found. Please"," ",y.jsx(A.Link,{as:Wr,to:"/setup",children:"add a brand"})," ","to start analyzing."]}),(C!=null?C:[{id:"loading",name:"Loading..."}]).map(function(k,S,_){return y.jsx(IR,{brand:k,isLast:S===_.length-1,onDelete:function(O){p(O),l(!0)}},k.id)})]})]}),y.jsx(La,{}),y.jsxs(Mp,{children:[y.jsxs(jp,{className:"yst-space-y-2",children:[y.jsx(A.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($p,{className:"yst-space-y-4",children:[y.jsxs(A.Button,{variant:"error",onClick:function(){f(!0)},children:[y.jsx(yf,{})," 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(ER,{isOpen:a,onClose:function(){l(!1),p(null)},brandId:m||"",brandName:x==null?void 0:x.name}),y.jsx(wR,{isOpen:d,onClose:function(){f(!1)}})]})};const zR=Object.freeze(Object.defineProperty({__proto__:null,default:qR},Symbol.toStringTag,{value:"Module"}));function cc(e){"@babel/helpers - typeof";return cc=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},cc(e)}var Vd=[{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 and Perplexity. 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 and Perplexity. This process should take around 5 minutes."}],HR=function(t){return Vd.find(function(n){return!!Ps(n.path,t)})||Vd[0]};function KR(){var e=Bt(),t=HR(e.pathname);return y.jsxs(A.Paper,{className:"yst-mx-auto yst-max-w-2xl",children:[y.jsx(mf,{title:y.jsx(Lx,{currentStep:t,steps:Vd}),description:t.description}),y.jsx(A.Paper.Content,{children:y.jsx(Ts,{})})]})}var Lx=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:cc(r)==="object"?r.id:r}),"/",Array.isArray(i)?i.length:i]}),y.jsx("span",{children:cc(r)==="object"?r.title:n||"Step ".concat(r)})]})};const UR=Object.freeze(Object.defineProperty({__proto__:null,SetupPaperTitle:Lx,default:KR},Symbol.toStringTag,{value:"Module"}));var Ix=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(pf,{nestedInPaperContent:!0,children:y.jsxs("div",{className:Ce({"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(A.Button,{variant:"tertiary",onClick:n,className:"yst-no-underline",children:"← Back"}),y.jsx("div",{className:Ce("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(A.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(NO,{}),s]})})]})})},WR=[{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"}],VR=[{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"}],Dp=[].concat(WR,VR,[{value:"OTHER",label:"Other"}]),GR=[{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"}],QR=[{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"}],YR=[].concat(GR,QR);function Br(e){"@babel/helpers - typeof";return Br=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},Br(e)}function Lp(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 Ip(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Lp(Object(n),!0).forEach(function(r){Rx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lp(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rx(e,t,n){return(t=XR(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XR(e){var t=JR(e,"string");return Br(t)=="symbol"?t:t+""}function JR(e,t){if(Br(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Br(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bo(e,t){return nN(e)||tN(e,t)||eN(e,t)||ZR()}function ZR(){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 eN(e,t){if(e){if(typeof e=="string")return Rp(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)?Rp(e,t):void 0}}function Rp(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 tN(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 nN(e){if(Array.isArray(e))return e}var rN=function(){var t,n=gn(),r=Oc(),i=qt(),s=z.useState(),o=bo(s,2),a=o[0],l=o[1],c=z.useState(!1),u=bo(c,2),d=u[0],f=u[1],h=z.useState({name:"",url:"",industry:"",language:"en",isLocal:!1,country:"",region:""}),g=bo(h,2),m=g[0],p=g[1],v=z.useState(null),b=bo(v,2),w=b[0],C=b[1],x=Mk({mutation:{onSuccess:function(M){var I=M.data.id;i.invalidateQueries({queryKey:[gf(),nr()]}),I&&r.setBrandId(I),M!=null&&M.status&&M.status>=200&&M.status<300&&I&&(r.setBrandId(I),l(I))},onError:function(){f(!1)}}}),k=x.mutate,S=x.isPending,_=x.error,O=Ri({query:{enabled:!!a,select:function(M){var I=M.data;return I==null?void 0:I.brands},refetchInterval:function(M){var I;return((M==null||(I=M.state)===null||I===void 0||(I=I.data)===null||I===void 0||(I=I.data)===null||I===void 0?void 0:I.brands)||[]).find(function(oe){return oe.id===a})?!1:2*1e3}}}),E=O.data;z.useEffect(function(){a&&E!==null&&E!==void 0&&E.find(function(L){return L.id===a})&&n("/setup/".concat(a,"/queries"),{replace:!0})},[a,E,n]);var T=function(M,I){p(function(oe){return Ip(Ip({},oe),{},Rx({},M,I))})},D=function(M){if(M.preventDefault(),C(null),m.industry.length>250){C("Your brand description is too long. Please keep it within the 250-character limit."),f(!1);return}f(!0);var I=m.url;I&&!/^https?:\/\//i.test(I)&&(I="https://".concat(I)),k({data:{name:m.name,url:I,industry:m.industry,focusLanguage:m.language,country:m.country,regionOrCity:m.region}})};function G(L){return Br(L)==="object"&&L!==null&&"response"in L&&Br(L.response)==="object"&&L.response!==void 0&&"data"in L.response}var N=G(_)?_.response.data.errors:void 0;return y.jsxs("form",{onSubmit:D,children:[y.jsxs("div",{className:"yst-space-y-6",children:[y.jsx(A.Title,{size:"2",children:"Brand info"}),!!_&&y.jsx(A.Alert,{variant:"error",title:"Error",isVisible:!!_,children:y.jsx("ul",{children:N&&Br(N)==="object"?Object.entries(N).flatMap(function(L){var M=bo(L,2),I=M[0],oe=M[1];return Array.isArray(oe)?oe.map(function(ue,B){return y.jsx("li",{children:ue},"".concat(I,"-").concat(B))}):null}):"There was an error creating the brand."})}),w&&y.jsx(A.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(A.TextField,{id:"name",label:"Brand name",value:m.name,onChange:function(L){return T("name",L.target.value)}}),y.jsx(A.TextField,{id:"url",label:"Website URL (optional)",placeholder:"Example: https://yourwebsite.com",value:m.url,onChange:function(L){return T("url",L.target.value)}}),y.jsxs("div",{id:"industry-textarea",children:[y.jsx(A.TextareaField,{id:"industry",label:"Brand description",value:m.industry,onChange:function(L){var M=L.target.value;T("industry",M)},...m.industry.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.industry.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:Ce("yst-text-xs yst-mt-[-4px] yst-ml-6",{"yst-text-slate-500":m.industry.length<=250,"yst-text-red-500":m.industry.length>250}),children:[m.industry.length,"/250"]})]})]}),y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(A.Select,{className:"yst-max-w-sm",id:"language-select",label:"Target language",value:m.language,onChange:function(L){return T("language",L)},options:YR.map(function(L){return{label:L.label,value:L.value}})}),y.jsx("p",{children:"The main language your brand uses to communicate or create content."})]})]}),y.jsx(La,{}),y.jsxs("div",{className:"yst-space-y-6",children:[y.jsx(A.Title,{size:"2",children:"Location info"}),y.jsx("p",{children:"Specify a location to enhance the accuracy of the analysis."}),y.jsx(A.Autocomplete,{className:"yst-max-w-sm",id:"country-select",label:"Target country (optional)",value:m.country,nullable:!0,placeholder:"Select...",onChange:function(L){return T("country",L)},onQueryChange:function(){},selectedLabel:((t=Dp.find(function(L){return L.value===m.country}))===null||t===void 0?void 0:t.label)||"",children:Dp.map(function(L){return y.jsx(A.Autocomplete.Option,{value:L.value,children:L.label},L.value)})}),m.country&&y.jsx(A.TextField,{id:"region",label:"Target city, state, or region (optional)",value:m.region,onChange:function(L){return T("region",L.target.value)},description:`Enter a city, state, or region to narrow down the analysis. For
1292
+ example: California, Bavaria, or Paris.`})]}),y.jsx(Ix,{onBack:function(){return n(-1)},buttonText:"Generate queries",isButtonDisabled:S||!!a||d,isLoading:S||!!a})]})};const iN=Object.freeze(Object.defineProperty({__proto__:null,default:rN},Symbol.toStringTag,{value:"Module"})),sN=e=>$.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},$.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"}),$.createElement("defs",null,$.createElement("linearGradient",{id:"paint0_linear_3891_2757",x1:1.99951,y1:2,x2:15.3308,y2:3.72773,gradientUnits:"userSpaceOnUse"},$.createElement("stop",{stopColor:"#A61E69"}),$.createElement("stop",{offset:1,stopColor:"#6366F1"}))));function ha(e){"@babel/helpers - typeof";return ha=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},ha(e)}function oN(e){return cN(e)||lN(e)||Nx(e)||aN()}function aN(){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 lN(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function cN(e){if(Array.isArray(e))return Gd(e)}function Np(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 xr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Np(Object(n),!0).forEach(function(r){uN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Np(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uN(e,t,n){return(t=dN(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dN(e){var t=fN(e,"string");return ha(t)=="symbol"?t:t+""}function fN(e,t){if(ha(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ha(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xo(e,t){return yN(e)||gN(e,t)||Nx(e,t)||hN()}function hN(){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 Nx(e,t){if(e){if(typeof e=="string")return Gd(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)?Gd(e,t):void 0}}function Gd(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 gN(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 yN(e){if(Array.isArray(e))return e}var $o=5,Qd="Generating...",mN="Re-generating...",pN=["******************************","***********************","*******************************************************","***********************************************","***************************************************************","*******************************************************","*******************************************************","***********************************************"],vN=Array.from({length:$o},function(e,t){return{id:"query-".concat(t),text:Qd,isRegenerating:!0}}),bN=function(){var t=En(),n=t.brandId,r="/setup/".concat(n,"/analysis"),i=gn(),s=qt(),o=z.useState(vN),a=xo(o,2),l=a[0],c=a[1],u=z.useState(!1),d=xo(u,2),f=d[0],h=d[1],g=z.useState([]),m=xo(g,2),p=m[0],v=m[1],b=z.useState([]),w=xo(b,2),C=w[0],x=w[1],k=z.useState(!1),S=xo(k,2),_=S[0],O=S[1],E=Xk(n,{query:{enabled:!!n}}),T=E.data,D=E.isRefetching,G=E.refetch,N=Vk({mutation:{onSuccess:function(q){q!=null&&q.status&&q.status>=200&&q.status<300&&(s.invalidateQueries({queryKey:[hf(n)]}),i(r))},onError:function(q){i(r,{replace:!0}),console.error("Error saving queries:",q)}}}),L=N.mutate,M=N.isPending;z.useEffect(function(){var Q;if(T!=null&&(Q=T.data)!==null&&Q!==void 0&&Q.queries&&Array.isArray(T.data.queries)){var q=T.data.queries.slice(0,$o);c(q.map(function(ce,W){return{id:"query-".concat(W),text:ce,isRegenerating:!1}})),x(T.data.queries.slice($o))}},[T]),z.useEffect(function(){var Q;if(_&&T!==null&&T!==void 0&&(Q=T.data)!==null&&Q!==void 0&&Q.queries&&Array.isArray(T.data.queries)&&!D){var q=T.data.queries.slice(0,$o),ce=p.map(Number);c(function(W){return W.map(function(de,fe){var Le=ce.indexOf(fe);return xr(xr({},de),{},{text:Le>=0&&q[Le]?q[Le]:de.text,isRegenerating:!1})})}),O(!1),v([])}},[T,D,_,p]);var I=z.useCallback(function(Q,q){var ce=new Set(q);return C.filter(function(W){return!ce.has(W)}).slice(0,Q)},[C]),oe=z.useMemo(function(){return D||l.length===0||l.some(function(Q){return Q.isRegenerating||Q.text===Qd})||f},[D,l,f]),ue=D||l.some(function(Q){return Q.text===Qd}),B=z.useCallback(function(Q){var q=Q.toString();v(function(ce){return ce.includes(q)?ce.filter(function(W){return W!==q}):[].concat(oN(ce),[q])})},[]),J=z.useCallback(function(Q,q){c(function(ce){return ce.map(function(W,de){return de===Q?xr(xr({},W),{},{text:q}):W})})},[]),ae=function(){h(!f),v([])},ne=z.useCallback(function(){if(!(D||p.length===0)){c(function(W){return W.map(function(de,fe){return xr(xr({},de),{},{isRegenerating:p.includes(fe.toString())})})});var Q=l.map(function(W){return W.text}),q=p.length,ce=I(q,Q);ce.length===q?(c(function(W){return W.map(function(de,fe){var Le=p.indexOf(fe.toString());return Le>=0?xr(xr({},de),{},{text:ce[Le],isRegenerating:!1}):de})}),x(function(W){var de=new Set(ce);return W.filter(function(fe){return!de.has(fe)})}),v([])):(O(!0),G())}},[D,p,G,l,I]),R=z.useCallback(function(Q){Q.preventDefault(),n&&L({brandId:n,data:{queries:l.map(function(q){return q.text})}})},[n,l,L]);return y.jsxs("form",{onSubmit:R,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:Ce("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:ae,children:"Done"}),y.jsxs(A.Button,{variant:"secondary",size:"small",onClick:ne,className:"yst-gap-1",isLoading:D,disabled:D||p.length===0,children:[y.jsx(sN,{"aria-hidden":"true"}),"Regenerate selected queries"]})]}):y.jsxs(A.Button,{size:"small",variant:"secondary",onClick:ae,className:"yst-gap-1.5",disabled:ue,children:[y.jsx(_O,{}),"Select queries to regenerate"]})})]})]}),y.jsx("div",{className:"yst-mb-8",children:l.length===0?pN.map(function(Q,q){return y.jsx("div",{className:Ce("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:Q||"Example placeholder query for demonstration purposes."})},"placeholder-query-".concat(q))}):l.slice(0,$o).map(function(Q,q){var ce=Q.isRegenerating?mN:Q.text;return y.jsx("div",{className:Ce("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 B(q)},disabled:D})}),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(W){Q.isRegenerating||J(q,W.target.value)},placeholder:"Enter your query...",className:"yst-w-full",disabled:Q.isRegenerating,required:!0})]})]})},Q.id)})}),y.jsx(Ix,{buttonText:"Run analysis (~ 5 minutes)",isButtonDisabled:oe,isLoading:M})]})};const xN=Object.freeze(Object.defineProperty({__proto__:null,default:bN},Symbol.toStringTag,{value:"Module"}));var Ui=[{labelAbove:"Running queries...",label:"Running queries",threshold:99},{labelAbove:"Done!",label:"Building analysis",threshold:100}],Fx=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<Ui.length;c++)if(r<=Ui[c].threshold)return Ui[c];return Ui[Ui.length-1]},a=o();return y.jsxs("div",{className:Ce("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(Yv,{className:"yst-text-green-400"}),y.jsx("span",{className:"yst-text-sm yst-font-medium yst-italic",children:a.labelAbove})]}),y.jsx(A.ProgressBar,{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:Ui.map(function(l){return y.jsx("span",{children:y.jsx(Ec,{disabled:a.label!==l.label,children:l.label})},l.label)})})]})};Fx.propTypes={progress:bd.number,className:bd.string};var wN=function(t){switch(t){case"pending":case"processing":return 2*1e3;case"completed":return!1;default:return 10*1e3}},SN=function(){var t,n,r,i=gn(),s=qt(),o=Zd(),a=En(),l=a.brandId,c=o.brandId||l,u=Bv(c,{query:{enabled:!!c,select:function(C){var x=C.data;return x}}}),d=u.data,f=xk(c,"latest",{query:{enabled:!!c,select:function(C){var x=C.data;return x},refetchInterval:function(C){var x,k=C==null||(x=C.state)===null||x===void 0||(x=x.data)===null||x===void 0?void 0:x.data;return wN(k==null?void 0:k.status)}}}),h=f.data;z.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&&lE(d.nextScheduledAnalysis,5)&&!w&&i("/brands/".concat(c),{replace:!0})},[d==null?void 0:d.nextScheduledAnalysis,c,i,h==null?void 0:h.status]);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,C=v*w;return(h==null?void 0:h.status)==="completed"?100:Math.round(Math.min(C,80))}return 0}();return y.jsxs("div",{children:[y.jsxs("div",{className:"yst-space-y-8",children:[y.jsx(Fx,{progress:b}),y.jsx(La,{}),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 C,x=w.id,k=w.query,S=x&&(h==null||(C=h.completedQueries)===null||C===void 0?void 0:C.includes(x));return y.jsxs("div",{className:Ce("yst-flex yst-items-center yst-justify-between yst-gap-3"),children:[S===!0?y.jsx(Yv,{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:k})]},"result-item-".concat(k))})})]}),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:Wr,to:m,onClick:function(){return s.clear()},children:b===100?"Continue →":"Skip for now"})})]})};const CN=Object.freeze(Object.defineProperty({__proto__:null,default:SN},Symbol.toStringTag,{value:"Module"}));exports.AIInsightsClient=wM;exports.setApiBaseUrl=Dv;
1294
1295
  //# sourceMappingURL=ai-insights-client.cjs.js.map