@yoast/ai-insights-client 1.4.43 → 1.4.45

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 ux=Object.defineProperty;var Dh=e=>{throw TypeError(e)};var cx=(e,t,n)=>t in e?ux(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var pe=(e,t,n)=>cx(e,typeof t!="symbol"?t+"":t,n),ic=(e,t,n)=>t.has(e)||Dh("Cannot "+n);var $=(e,t,n)=>(ic(e,t,"read from private field"),n?n.call(e):t.get(e)),de=(e,t,n)=>t.has(e)?Dh("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Z=(e,t,n,r)=>(ic(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),je=(e,t,n)=>(ic(e,t,"access private method"),n);var Za=(e,t,n,r)=>({set _(i){Z(e,t,i,n)},get _(){return $(e,t,r)}});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react/jsx-runtime"),T=require("@yoast/ui-library"),z=require("react"),dx=require("styled-components"),fx=require("react-dom");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 I=hx(z);function mp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var uo={},Ih;function gx(){if(Ih)return uo;Ih=1,Object.defineProperty(uo,"__esModule",{value:!0}),uo.parse=o,uo.serialize=u;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)||c;let v=0;do{const b=f.indexOf("=",v);if(b===-1)break;const S=f.indexOf(";",v),C=S===-1?m:S;if(b>C){v=f.lastIndexOf(";",b-1)+1;continue}const w=a(f,v,b),O=l(f,b,w),x=f.slice(w,O);if(g[x]===void 0){let _=a(f,b+1,C),k=l(f,C,_);const E=p(f.slice(_,k));g[x]=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 u(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 c(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 uo}gx();/**
1
+ "use strict";var hx=Object.defineProperty;var Rh=e=>{throw TypeError(e)};var gx=(e,t,n)=>t in e?hx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var pe=(e,t,n)=>gx(e,typeof t!="symbol"?t+"":t,n),ac=(e,t,n)=>t.has(e)||Rh("Cannot "+n);var $=(e,t,n)=>(ac(e,t,"read from private field"),n?n.call(e):t.get(e)),de=(e,t,n)=>t.has(e)?Rh("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Z=(e,t,n,r)=>(ac(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),je=(e,t,n)=>(ac(e,t,"access private method"),n);var nl=(e,t,n,r)=>({set _(i){Z(e,t,i,n)},get _(){return $(e,t,r)}});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react/jsx-runtime"),T=require("@yoast/ui-library"),z=require("react"),yx=require("styled-components"),mx=require("react-dom");function px(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 I=px(z);function xp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ho={},Nh;function vx(){if(Nh)return ho;Nh=1,Object.defineProperty(ho,"__esModule",{value:!0}),ho.parse=o,ho.serialize=u;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)||c;let v=0;do{const b=f.indexOf("=",v);if(b===-1)break;const S=f.indexOf(";",v),C=S===-1?m:S;if(b>C){v=f.lastIndexOf(";",b-1)+1;continue}const w=a(f,v,b),O=l(f,b,w),x=f.slice(w,O);if(g[x]===void 0){let _=a(f,b+1,C),k=l(f,C,_);const E=p(f.slice(_,k));g[x]=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 u(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 c(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 ho}vx();/**
2
2
  * react-router v7.6.3
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
@@ -7,76 +7,76 @@
7
7
  * LICENSE.md file in the root directory of this source tree.
8
8
  *
9
9
  * @license MIT
10
- */function yx(e={}){let{initialEntries:t=["/"],initialIndex:n,v5Compat:r=!1}=e,i;i=t.map((h,g)=>c(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 u(){return i[s]}function c(h,g=null,m){let p=px(i?u().pathname:"/",h,g,m);return Cn(p.pathname.charAt(0)==="/",`relative pathnames are not supported in memory history: ${JSON.stringify(h)}`),p}function d(h){return typeof h=="string"?h:Fl(h)}return{get index(){return s},get action(){return o},get location(){return u()},createHref:d,createURL(h){return new URL(d(h),"http://localhost")},encodeLocation(h){let g=typeof h=="string"?Hi(h):h;return{pathname:g.pathname||"",search:g.search||"",hash:g.hash||""}},push(h,g){o="PUSH";let m=c(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=c(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 rt(e,t){if(e===!1||e===null||typeof e=="undefined")throw new Error(t)}function Cn(e,t){if(!e){typeof console!="undefined"&&console.warn(t);try{throw new Error(t)}catch(n){}}}function mx(){return Math.random().toString(36).substring(2,10)}function px(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Hi(t):t,state:n,key:t&&t.key||r||mx()}}function Fl({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 Hi(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 pp(e,t,n="/"){return vx(e,t,n,!1)}function vx(e,t,n,r){let i=typeof t=="string"?Hi(t):t,s=vr(i.pathname||"/",n);if(s==null)return null;let o=vp(e);bx(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let u=xp(s);a=Ax(o[l],u,r)}return a}function vp(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("/")&&(rt(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 u=gr([r,l.relativePath]),c=n.concat(l);s.children&&s.children.length>0&&(rt(s.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),vp(s.children,t,c,u)),!(s.path==null&&!s.index)&&t.push({path:u,score:Ox(u,s.index),routesMeta:c})};return e.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let l of bp(s.path))i(s,o,l)}),t}function bp(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=bp(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 bx(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Ex(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var xx=/^:[\w-]+$/,wx=3,Sx=2,Cx=1,_x=10,kx=-2,Rh=e=>e==="*";function Ox(e,t){let n=e.split("/"),r=n.length;return n.some(Rh)&&(r+=kx),t&&(r+=Sx),n.filter(i=>!Rh(i)).reduce((i,s)=>i+(xx.test(s)?wx:s===""?Cx:_x),r)}function Ex(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 Ax(e,t,n=!1){let{routesMeta:r}=e,i={},s="/",o=[];for(let a=0;a<r.length;++a){let l=r[a],u=a===r.length-1,c=s==="/"?t:t.slice(s.length)||"/",d=Fs({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},c),f=l.route;if(!d&&u&&n&&!r[r.length-1].route.index&&(d=Fs({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},c)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:gr([s,d.pathname]),pathnameBase:$x(gr([s,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(s=gr([s,d.pathnameBase]))}return o}function Fs(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Tx(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((u,{paramName:c,isOptional:d},f)=>{if(c==="*"){let g=a[f]||"";o=s.slice(0,s.length-g.length).replace(/(.)\/+$/,"$1")}const h=a[f];return d&&!h?u[c]=void 0:u[c]=(h||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:o,pattern:e}}function Tx(e,t=!1,n=!0){Cn(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 xp(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Cn(!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 vr(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 Px(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Hi(e):e;return{pathname:n?n.startsWith("/")?n:jx(n,t):t,search:Lx(r),hash:Dx(i)}}function jx(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 sc(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 Mx(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function yf(e){let t=Mx(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function mf(e,t,n,r=!1){let i;typeof e=="string"?i=Hi(e):(i={...e},rt(!i.pathname||!i.pathname.includes("?"),sc("?","pathname","search",i)),rt(!i.pathname||!i.pathname.includes("#"),sc("#","pathname","hash",i)),rt(!i.search||!i.search.includes("#"),sc("#","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=Px(i,a),u=o&&o!=="/"&&o.endsWith("/"),c=(s||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}var gr=e=>e.join("/").replace(/\/\/+/g,"/"),$x=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Lx=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Dx=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Ix(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var wp=["POST","PUT","PATCH","DELETE"];new Set(wp);var Rx=["GET",...wp];new Set(Rx);var Ws=I.createContext(null);Ws.displayName="DataRouter";var bu=I.createContext(null);bu.displayName="DataRouterState";var Sp=I.createContext({isTransitioning:!1});Sp.displayName="ViewTransition";var Nx=I.createContext(new Map);Nx.displayName="Fetchers";var Fx=I.createContext(null);Fx.displayName="Await";var Dn=I.createContext(null);Dn.displayName="Navigation";var Da=I.createContext(null);Da.displayName="Location";var _n=I.createContext({outlet:null,matches:[],isDataRoute:!1});_n.displayName="Route";var pf=I.createContext(null);pf.displayName="RouteError";function Bx(e,{relative:t}={}){rt(Ui(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=I.useContext(Dn),{hash:i,pathname:s,search:o}=Ia(e,{relative:t}),a=s;return n!=="/"&&(a=s==="/"?n:gr([n,s])),r.createHref({pathname:a,search:o,hash:i})}function Ui(){return I.useContext(Da)!=null}function Ut(){return rt(Ui(),"useLocation() may be used only in the context of a <Router> component."),I.useContext(Da).location}function Ja(e){rt(Ui(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=Ut();return I.useMemo(()=>Fs(e,xp(t)),[t,e])}var Cp="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function _p(e){I.useContext(Dn).static||I.useLayoutEffect(e)}function dn(){let{isDataRoute:e}=I.useContext(_n);return e?tw():qx()}function qx(){rt(Ui(),"useNavigate() may be used only in the context of a <Router> component.");let e=I.useContext(Ws),{basename:t,navigator:n}=I.useContext(Dn),{matches:r}=I.useContext(_n),{pathname:i}=Ut(),s=JSON.stringify(yf(r)),o=I.useRef(!1);return _p(()=>{o.current=!0}),I.useCallback((l,u={})=>{if(Cn(o.current,Cp),!o.current)return;if(typeof l=="number"){n.go(l);return}let c=mf(l,JSON.parse(s),i,u.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:gr([t,c.pathname])),(u.replace?n.replace:n.push)(c,u.state,u)},[t,n,s,i,e])}var zx=I.createContext(null);function Hx(e){let t=I.useContext(_n).outlet;return t&&I.createElement(zx.Provider,{value:e},t)}function xu(){let{matches:e}=I.useContext(_n),t=e[e.length-1];return t?t.params:{}}function Ia(e,{relative:t}={}){let{matches:n}=I.useContext(_n),{pathname:r}=Ut(),i=JSON.stringify(yf(n));return I.useMemo(()=>mf(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function Ux(e,t){return kp(e,t)}function kp(e,t,n,r){var v;rt(Ui(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=I.useContext(Dn),{matches:s}=I.useContext(_n),o=s[s.length-1],a=o?o.params:{},l=o?o.pathname:"/",u=o?o.pathnameBase:"/",c=o&&o.route;{let b=c&&c.path||"";Op(l,!c||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 bx(e={}){let{initialEntries:t=["/"],initialIndex:n,v5Compat:r=!1}=e,i;i=t.map((h,g)=>c(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 u(){return i[s]}function c(h,g=null,m){let p=wx(i?u().pathname:"/",h,g,m);return _n(p.pathname.charAt(0)==="/",`relative pathnames are not supported in memory history: ${JSON.stringify(h)}`),p}function d(h){return typeof h=="string"?h:Hl(h)}return{get index(){return s},get action(){return o},get location(){return u()},createHref:d,createURL(h){return new URL(d(h),"http://localhost")},encodeLocation(h){let g=typeof h=="string"?Ki(h):h;return{pathname:g.pathname||"",search:g.search||"",hash:g.hash||""}},push(h,g){o="PUSH";let m=c(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=c(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 rt(e,t){if(e===!1||e===null||typeof e=="undefined")throw new Error(t)}function _n(e,t){if(!e){typeof console!="undefined"&&console.warn(t);try{throw new Error(t)}catch(n){}}}function xx(){return Math.random().toString(36).substring(2,10)}function wx(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ki(t):t,state:n,key:t&&t.key||r||xx()}}function Hl({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 Ki(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 wp(e,t,n="/"){return Sx(e,t,n,!1)}function Sx(e,t,n,r){let i=typeof t=="string"?Ki(t):t,s=wr(i.pathname||"/",n);if(s==null)return null;let o=Sp(e);Cx(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let u=_p(s);a=Mx(o[l],u,r)}return a}function Sp(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("/")&&(rt(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 u=pr([r,l.relativePath]),c=n.concat(l);s.children&&s.children.length>0&&(rt(s.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),Sp(s.children,t,c,u)),!(s.path==null&&!s.index)&&t.push({path:u,score:Px(u,s.index),routesMeta:c})};return e.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let l of Cp(s.path))i(s,o,l)}),t}function Cp(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=Cp(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 Cx(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:jx(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var _x=/^:[\w-]+$/,kx=3,Ox=2,Ex=1,Ax=10,Tx=-2,Fh=e=>e==="*";function Px(e,t){let n=e.split("/"),r=n.length;return n.some(Fh)&&(r+=Tx),t&&(r+=Ox),n.filter(i=>!Fh(i)).reduce((i,s)=>i+(_x.test(s)?kx:s===""?Ex:Ax),r)}function jx(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 Mx(e,t,n=!1){let{routesMeta:r}=e,i={},s="/",o=[];for(let a=0;a<r.length;++a){let l=r[a],u=a===r.length-1,c=s==="/"?t:t.slice(s.length)||"/",d=zs({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},c),f=l.route;if(!d&&u&&n&&!r[r.length-1].route.index&&(d=zs({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},c)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:pr([s,d.pathname]),pathnameBase:Rx(pr([s,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(s=pr([s,d.pathnameBase]))}return o}function zs(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=$x(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((u,{paramName:c,isOptional:d},f)=>{if(c==="*"){let g=a[f]||"";o=s.slice(0,s.length-g.length).replace(/(.)\/+$/,"$1")}const h=a[f];return d&&!h?u[c]=void 0:u[c]=(h||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:o,pattern:e}}function $x(e,t=!1,n=!0){_n(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 _p(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return _n(!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 wr(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 Lx(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Ki(e):e;return{pathname:n?n.startsWith("/")?n:Dx(n,t):t,search:Nx(r),hash:Fx(i)}}function Dx(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 lc(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 Ix(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function pf(e){let t=Ix(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function vf(e,t,n,r=!1){let i;typeof e=="string"?i=Ki(e):(i={...e},rt(!i.pathname||!i.pathname.includes("?"),lc("?","pathname","search",i)),rt(!i.pathname||!i.pathname.includes("#"),lc("#","pathname","hash",i)),rt(!i.search||!i.search.includes("#"),lc("#","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=Lx(i,a),u=o&&o!=="/"&&o.endsWith("/"),c=(s||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}var pr=e=>e.join("/").replace(/\/\/+/g,"/"),Rx=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Nx=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Fx=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Bx(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var kp=["POST","PUT","PATCH","DELETE"];new Set(kp);var qx=["GET",...kp];new Set(qx);var Xs=I.createContext(null);Xs.displayName="DataRouter";var Su=I.createContext(null);Su.displayName="DataRouterState";var Op=I.createContext({isTransitioning:!1});Op.displayName="ViewTransition";var zx=I.createContext(new Map);zx.displayName="Fetchers";var Hx=I.createContext(null);Hx.displayName="Await";var In=I.createContext(null);In.displayName="Navigation";var Fa=I.createContext(null);Fa.displayName="Location";var kn=I.createContext({outlet:null,matches:[],isDataRoute:!1});kn.displayName="Route";var bf=I.createContext(null);bf.displayName="RouteError";function Ux(e,{relative:t}={}){rt(Vi(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=I.useContext(In),{hash:i,pathname:s,search:o}=Ba(e,{relative:t}),a=s;return n!=="/"&&(a=s==="/"?n:pr([n,s])),r.createHref({pathname:a,search:o,hash:i})}function Vi(){return I.useContext(Fa)!=null}function Ut(){return rt(Vi(),"useLocation() may be used only in the context of a <Router> component."),I.useContext(Fa).location}function rl(e){rt(Vi(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=Ut();return I.useMemo(()=>zs(e,_p(t)),[t,e])}var Ep="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ap(e){I.useContext(In).static||I.useLayoutEffect(e)}function fn(){let{isDataRoute:e}=I.useContext(kn);return e?sw():Gx()}function Gx(){rt(Vi(),"useNavigate() may be used only in the context of a <Router> component.");let e=I.useContext(Xs),{basename:t,navigator:n}=I.useContext(In),{matches:r}=I.useContext(kn),{pathname:i}=Ut(),s=JSON.stringify(pf(r)),o=I.useRef(!1);return Ap(()=>{o.current=!0}),I.useCallback((l,u={})=>{if(_n(o.current,Ep),!o.current)return;if(typeof l=="number"){n.go(l);return}let c=vf(l,JSON.parse(s),i,u.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:pr([t,c.pathname])),(u.replace?n.replace:n.push)(c,u.state,u)},[t,n,s,i,e])}var Kx=I.createContext(null);function Vx(e){let t=I.useContext(kn).outlet;return t&&I.createElement(Kx.Provider,{value:e},t)}function Cu(){let{matches:e}=I.useContext(kn),t=e[e.length-1];return t?t.params:{}}function Ba(e,{relative:t}={}){let{matches:n}=I.useContext(kn),{pathname:r}=Ut(),i=JSON.stringify(pf(n));return I.useMemo(()=>vf(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function Wx(e,t){return Tp(e,t)}function Tp(e,t,n,r){var v;rt(Vi(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=I.useContext(In),{matches:s}=I.useContext(kn),o=s[s.length-1],a=o?o.params:{},l=o?o.pathname:"/",u=o?o.pathnameBase:"/",c=o&&o.route;{let b=c&&c.path||"";Pp(l,!c||b.endsWith("*")||b.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${b}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
11
11
 
12
- Please change the parent <Route path="${b}"> to <Route path="${b==="/"?"*":`${b}/*`}">.`)}let d=Ut(),f;if(t){let b=typeof t=="string"?Hi(t):t;rt(u==="/"||((v=b.pathname)==null?void 0:v.startsWith(u)),`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 "${u}" but pathname "${b.pathname}" was given in the \`location\` prop.`),f=b}else f=d;let h=f.pathname||"/",g=h;if(u!=="/"){let b=u.replace(/^\//,"").split("/");g="/"+h.replace(/^\//,"").split("/").slice(b.length).join("/")}let m=pp(e,{pathname:g});Cn(c||m!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),Cn(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=Qx(m&&m.map(b=>Object.assign({},b,{params:Object.assign({},a,b.params),pathname:gr([u,i.encodeLocation?i.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?u:gr([u,i.encodeLocation?i.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),s,n,r);return t&&p?I.createElement(Da.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...f},navigationType:"POP"}},p):p}function Gx(){let e=ew(),t=Ix(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=I.createElement(I.Fragment,null,I.createElement("p",null,"💿 Hey developer 👋"),I.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",I.createElement("code",{style:s},"ErrorBoundary")," or"," ",I.createElement("code",{style:s},"errorElement")," prop on your route.")),I.createElement(I.Fragment,null,I.createElement("h2",null,"Unexpected Application Error!"),I.createElement("h3",{style:{fontStyle:"italic"}},t),n?I.createElement("pre",{style:i},n):null,o)}var Vx=I.createElement(Gx,null),Kx=class extends I.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?I.createElement(_n.Provider,{value:this.props.routeContext},I.createElement(pf.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Wx({routeContext:e,match:t,children:n}){let r=I.useContext(Ws);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),I.createElement(_n.Provider,{value:e},n)}function Qx(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(u=>u.route.id&&(s==null?void 0:s[u.route.id])!==void 0);rt(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 u=i[l];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(a=l),u.route.id){let{loaderData:c,errors:d}=n,f=u.route.loader&&!c.hasOwnProperty(u.route.id)&&(!d||d[u.route.id]===void 0);if(u.route.lazy||f){o=!0,a>=0?i=i.slice(0,a+1):i=[i[0]];break}}}return i.reduceRight((l,u,c)=>{let d,f=!1,h=null,g=null;n&&(d=s&&u.route.id?s[u.route.id]:void 0,h=u.route.errorElement||Vx,o&&(a<0&&c===0?(Op("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,g=null):a===c&&(f=!0,g=u.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),p=()=>{let v;return d?v=h:f?v=g:u.route.Component?v=I.createElement(u.route.Component,null):u.route.element?v=u.route.element:v=l,I.createElement(Wx,{match:u,routeContext:{outlet:l,matches:m,isDataRoute:n!=null},children:v})};return n&&(u.route.ErrorBoundary||u.route.errorElement||c===0)?I.createElement(Kx,{location:n.location,revalidation:n.revalidation,component:h,error:d,children:p(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):p()},null)}function vf(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Yx(e){let t=I.useContext(Ws);return rt(t,vf(e)),t}function Xx(e){let t=I.useContext(bu);return rt(t,vf(e)),t}function Zx(e){let t=I.useContext(_n);return rt(t,vf(e)),t}function bf(e){let t=Zx(e),n=t.matches[t.matches.length-1];return rt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Jx(){return bf("useRouteId")}function ew(){var r;let e=I.useContext(pf),t=Xx("useRouteError"),n=bf("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function tw(){let{router:e}=Yx("useNavigate"),t=bf("useNavigate"),n=I.useRef(!1);return _p(()=>{n.current=!0}),I.useCallback(async(i,s={})=>{Cn(n.current,Cp),n.current&&(typeof i=="number"?e.navigate(i):await e.navigate(i,{fromRouteId:t,...s}))},[e,t])}var Nh={};function Op(e,t,n){!t&&!Nh[e]&&(Nh[e]=!0,Cn(!1,n))}I.memo(nw);function nw({routes:e,future:t,state:n}){return kp(e,void 0,n,t)}function rw({basename:e,children:t,initialEntries:n,initialIndex:r}){let i=I.useRef();i.current==null&&(i.current=yx({initialEntries:n,initialIndex:r,v5Compat:!0}));let s=i.current,[o,a]=I.useState({action:s.action,location:s.location}),l=I.useCallback(u=>{I.startTransition(()=>a(u))},[a]);return I.useLayoutEffect(()=>s.listen(l),[s,l]),I.createElement(iw,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:s})}function mi({to:e,replace:t,state:n,relative:r}){rt(Ui(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=I.useContext(Dn);Cn(!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}=I.useContext(_n),{pathname:o}=Ut(),a=dn(),l=mf(e,yf(s),o,r==="path"),u=JSON.stringify(l);return I.useEffect(()=>{a(JSON.parse(u),{replace:t,state:n,relative:r})},[a,u,r,t,n]),null}function Bs(e){return Hx(e.context)}function _t(e){rt(!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 iw({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:s=!1}){rt(!Ui(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let o=e.replace(/^\/*/,"/"),a=I.useMemo(()=>({basename:o,navigator:i,static:s,future:{}}),[o,i,s]);typeof n=="string"&&(n=Hi(n));let{pathname:l="/",search:u="",hash:c="",state:d=null,key:f="default"}=n,h=I.useMemo(()=>{let g=vr(l,o);return g==null?null:{location:{pathname:g,search:u,hash:c,state:d,key:f},navigationType:r}},[o,l,u,c,d,f,r]);return Cn(h!=null,`<Router basename="${o}"> is not able to match the URL "${l}${u}${c}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:I.createElement(Dn.Provider,{value:a},I.createElement(Da.Provider,{children:t,value:h}))}function sw({children:e,location:t}){return Ux(Qc(e),t)}function Qc(e,t=[]){let n=[];return I.Children.forEach(e,(r,i)=>{if(!I.isValidElement(r))return;let s=[...t,i];if(r.type===I.Fragment){n.push.apply(n,Qc(r.props.children,s));return}rt(r.type===_t,`[${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>`),rt(!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=Qc(r.props.children,s)),n.push(o)}),n}var El="get",Al="application/x-www-form-urlencoded";function wu(e){return e!=null&&typeof e.tagName=="string"}function ow(e){return wu(e)&&e.tagName.toLowerCase()==="button"}function aw(e){return wu(e)&&e.tagName.toLowerCase()==="form"}function lw(e){return wu(e)&&e.tagName.toLowerCase()==="input"}function uw(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function cw(e,t){return e.button===0&&(!t||t==="_self")&&!uw(e)}var el=null;function dw(){if(el===null)try{new FormData(document.createElement("form"),0),el=!1}catch(e){el=!0}return el}var fw=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function oc(e){return e!=null&&!fw.has(e)?(Cn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Al}"`),null):e}function hw(e,t){let n,r,i,s,o;if(aw(e)){let a=e.getAttribute("action");r=a?vr(a,t):null,n=e.getAttribute("method")||El,i=oc(e.getAttribute("enctype"))||Al,s=new FormData(e)}else if(ow(e)||lw(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?vr(l,t):null,n=e.getAttribute("formmethod")||a.getAttribute("method")||El,i=oc(e.getAttribute("formenctype"))||oc(a.getAttribute("enctype"))||Al,s=new FormData(a,e),!dw()){let{name:u,type:c,value:d}=e;if(c==="image"){let f=u?`${u}.`:"";s.append(`${f}x`,"0"),s.append(`${f}y`,"0")}else u&&s.append(u,d)}}else{if(wu(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=El,r=null,i=Al,o=e}return s&&i==="text/plain"&&(o=s,s=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:s,body:o}}function xf(e,t){if(e===!1||e===null||typeof e=="undefined")throw new Error(t)}async function gw(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function yw(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function mw(e,t,n){let r=await Promise.all(e.map(async i=>{let s=t.routes[i.route.id];if(s){let o=await gw(s,n);return o.links?o.links():[]}return[]}));return xw(r.flat(1).filter(yw).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function Fh(e,t,n,r,i,s){let o=(l,u)=>n[u]?l.route.id!==n[u].route.id:!0,a=(l,u)=>{var c;return n[u].pathname!==l.pathname||((c=n[u].route.path)==null?void 0:c.endsWith("*"))&&n[u].params["*"]!==l.params["*"]};return s==="assets"?t.filter((l,u)=>o(l,u)||a(l,u)):s==="data"?t.filter((l,u)=>{var d;let c=r.routes[l.route.id];if(!c||!c.hasLoader)return!1;if(o(l,u)||a(l,u))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 pw(e,t,{includeHydrateFallback:n}={}){return vw(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 vw(e){return[...new Set(e)]}function bw(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(bw(i));return n.has(s)||(n.add(s),r.push({key:s,link:i})),r},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var ww=new Set([100,101,204,205]);function Sw(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&&vr(n.pathname,t)==="/"?n.pathname=`${t.replace(/\/$/,"")}/_root.data`:n.pathname=`${n.pathname.replace(/\/$/,"")}.data`,n}function Ep(){let e=I.useContext(Ws);return xf(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Cw(){let e=I.useContext(bu);return xf(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var wf=I.createContext(void 0);wf.displayName="FrameworkContext";function Ap(){let e=I.useContext(wf);return xf(e,"You must render this element inside a <HydratedRouter> element"),e}function _w(e,t){let n=I.useContext(wf),[r,i]=I.useState(!1),[s,o]=I.useState(!1),{onFocus:a,onBlur:l,onMouseEnter:u,onMouseLeave:c,onTouchStart:d}=t,f=I.useRef(null);I.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]),I.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:co(a,h),onBlur:co(l,g),onMouseEnter:co(u,h),onMouseLeave:co(c,g),onTouchStart:co(d,h)}]:[!1,f,{}]}function co(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function kw({page:e,...t}){let{router:n}=Ep(),r=I.useMemo(()=>pp(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?I.createElement(Ew,{page:e,matches:r,...t}):null}function Ow(e){let{manifest:t,routeModules:n}=Ap(),[r,i]=I.useState([]);return I.useEffect(()=>{let s=!1;return mw(e,t,n).then(o=>{s||i(o)}),()=>{s=!0}},[e,t,n]),r}function Ew({page:e,matches:t,...n}){let r=Ut(),{manifest:i,routeModules:s}=Ap(),{basename:o}=Ep(),{loaderData:a,matches:l}=Cw(),u=I.useMemo(()=>Fh(e,t,l,i,r,"data"),[e,t,l,i,r]),c=I.useMemo(()=>Fh(e,t,l,i,r,"assets"),[e,t,l,i,r]),d=I.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let g=new Set,m=!1;if(t.forEach(v=>{var S;let b=i.routes[v.route.id];!b||!b.hasLoader||(!u.some(C=>C.route.id===v.route.id)&&v.route.id in a&&((S=s[v.route.id])!=null&&S.shouldRevalidate)||b.hasClientLoader?m=!0:g.add(v.route.id))}),g.size===0)return[];let p=Sw(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,u,t,e,s]),f=I.useMemo(()=>pw(c,i),[c,i]),h=Ow(c);return I.createElement(I.Fragment,null,d.map(g=>I.createElement("link",{key:g,rel:"prefetch",as:"fetch",href:g,...n})),f.map(g=>I.createElement("link",{key:g,rel:"modulepreload",href:g,...n})),h.map(({key:g,link:m})=>I.createElement("link",{key:g,...m})))}function Aw(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var Tp=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined";try{Tp&&(window.__reactRouterVersion="7.6.3")}catch(e){}var Pp=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ti=I.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:s,replace:o,state:a,target:l,to:u,preventScrollReset:c,viewTransition:d,...f},h){let{basename:g}=I.useContext(Dn),m=typeof u=="string"&&Pp.test(u),p,v=!1;if(typeof u=="string"&&m&&(p=u,Tp))try{let k=new URL(window.location.href),E=u.startsWith("//")?new URL(k.protocol+u):new URL(u),P=vr(E.pathname,g);E.origin===k.origin&&P!=null?u=P+E.search+E.hash:v=!0}catch(k){Cn(!1,`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let b=Bx(u,{relative:i}),[S,C,w]=_w(r,f),O=Mw(u,{replace:o,state:a,target:l,preventScrollReset:c,relative:i,viewTransition:d});function x(k){t&&t(k),k.defaultPrevented||O(k)}let _=I.createElement("a",{...f,...w,href:p||b,onClick:v||s?t:x,ref:Aw(h,C),target:l,"data-discover":!m&&n==="render"?"true":void 0});return S&&!m?I.createElement(I.Fragment,null,_,I.createElement(kw,{page:b})):_});ti.displayName="Link";var Tw=I.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:s,to:o,viewTransition:a,children:l,...u},c){let d=Ia(o,{relative:u.relative}),f=Ut(),h=I.useContext(bu),{navigator:g,basename:m}=I.useContext(Dn),p=h!=null&&Rw(d)&&a===!0,v=g.encodeLocation?g.encodeLocation(d).pathname:d.pathname,b=f.pathname,S=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;n||(b=b.toLowerCase(),S=S?S.toLowerCase():null,v=v.toLowerCase()),S&&m&&(S=vr(S,m)||S);const C=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let w=b===v||!i&&b.startsWith(v)&&b.charAt(C)==="/",O=S!=null&&(S===v||!i&&S.startsWith(v)&&S.charAt(v.length)==="/"),x={isActive:w,isPending:O,isTransitioning:p},_=w?t:void 0,k;typeof r=="function"?k=r(x):k=[r,w?"active":null,O?"pending":null,p?"transitioning":null].filter(Boolean).join(" ");let E=typeof s=="function"?s(x):s;return I.createElement(ti,{...u,"aria-current":_,className:k,ref:c,style:E,to:o,viewTransition:a},typeof l=="function"?l(x):l)});Tw.displayName="NavLink";var Pw=I.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:s,method:o=El,action:a,onSubmit:l,relative:u,preventScrollReset:c,viewTransition:d,...f},h)=>{let g=Dw(),m=Iw(a,{relative:u}),p=o.toLowerCase()==="get"?"get":"post",v=typeof a=="string"&&Pp.test(a),b=S=>{if(l&&l(S),S.defaultPrevented)return;S.preventDefault();let C=S.nativeEvent.submitter,w=(C==null?void 0:C.getAttribute("formmethod"))||o;g(C||S.currentTarget,{fetcherKey:t,method:w,navigate:n,replace:i,state:s,relative:u,preventScrollReset:c,viewTransition:d})};return I.createElement("form",{ref:h,method:p,action:m,onSubmit:r?l:b,...f,"data-discover":!v&&e==="render"?"true":void 0})});Pw.displayName="Form";function jw(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function jp(e){let t=I.useContext(Ws);return rt(t,jw(e)),t}function Mw(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:s,viewTransition:o}={}){let a=dn(),l=Ut(),u=Ia(e,{relative:s});return I.useCallback(c=>{if(cw(c,t)){c.preventDefault();let d=n!==void 0?n:Fl(l)===Fl(u);a(e,{replace:d,state:r,preventScrollReset:i,relative:s,viewTransition:o})}},[l,a,u,n,r,t,e,i,s,o])}var $w=0,Lw=()=>`__${String(++$w)}__`;function Dw(){let{router:e}=jp("useSubmit"),{basename:t}=I.useContext(Dn),n=Jx();return I.useCallback(async(r,i={})=>{let{action:s,method:o,encType:a,formData:l,body:u}=hw(r,t);if(i.navigate===!1){let c=i.fetcherKey||Lw();await e.fetch(c,n,i.action||s,{preventScrollReset:i.preventScrollReset,formData:l,body:u,formMethod:i.method||o,formEncType:i.encType||a,flushSync:i.flushSync})}else await e.navigate(i.action||s,{preventScrollReset:i.preventScrollReset,formData:l,body:u,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 Iw(e,{relative:t}={}){let{basename:n}=I.useContext(Dn),r=I.useContext(_n);rt(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),s={...Ia(e||".",{relative:t})},o=Ut();if(e==null){s.search=o.search;let a=new URLSearchParams(s.search),l=a.getAll("index");if(l.some(c=>c==="")){a.delete("index"),l.filter(d=>d).forEach(d=>a.append("index",d));let c=a.toString();s.search=c?`?${c}`:""}}return(!e||e===".")&&i.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:gr([n,s.pathname])),Fl(s)}function Rw(e,t={}){let n=I.useContext(Sp);rt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=jp("useViewTransitionState"),i=Ia(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=vr(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=vr(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Fs(i.pathname,o)!=null||Fs(i.pathname,s)!=null}[...ww];var Qs=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(){}},Li=typeof window=="undefined"||"Deno"in globalThis;function Lt(){}function Nw(e,t){return typeof e=="function"?e(t):e}function Yc(e){return typeof e=="number"&&e>=0&&e!==1/0}function Mp(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Vr(e,t){return typeof e=="function"?e(t):e}function vn(e,t){return typeof e=="function"?e(t):e}function Bh(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(!Ko(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 qh(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Di(t.options.mutationKey)!==Di(s))return!1}else if(!Ko(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)||Di)(e)}function Di(e){return JSON.stringify(e,(t,n)=>Zc(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Ko(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Ko(e[n],t[n])):!1}function Xc(e,t){if(e===t)return e;const n=zh(e)&&zh(t);if(n||Zc(e)&&Zc(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 u=0;for(let c=0;c<o;c++){const d=n?c:s[c];(!n&&l.has(d)||n)&&e[d]===void 0&&t[d]===void 0?(a[d]=void 0,u++):(a[d]=Xc(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&u++)}return i===o&&u===i?e:a}return t}function Bl(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 zh(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Zc(e){if(!Hh(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Hh(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Hh(e){return Object.prototype.toString.call(e)==="[object Object]"}function Fw(e){return new Promise(t=>{setTimeout(t,e)})}function Jc(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 Xc(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 Xc(e,t)}return t}function Bw(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function qw(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ql=Symbol();function $p(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===ql&&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===ql?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Lp(e,t){return typeof e=="function"?e(...t):!!e}var xi,Mr,fs,ip,zw=(ip=class extends Qs{constructor(){super();de(this,xi);de(this,Mr);de(this,fs);Z(this,fs,t=>{if(!Li&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){$(this,Mr)||this.setEventListener($(this,fs))}onUnsubscribe(){var t;this.hasListeners()||((t=$(this,Mr))==null||t.call(this),Z(this,Mr,void 0))}setEventListener(t){var n;Z(this,fs,t),(n=$(this,Mr))==null||n.call(this),Z(this,Mr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){$(this,xi)!==t&&(Z(this,xi,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof $(this,xi)=="boolean"?$(this,xi):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},xi=new WeakMap,Mr=new WeakMap,fs=new WeakMap,ip),Cf=new zw,hs,$r,gs,sp,Hw=(sp=class extends Qs{constructor(){super();de(this,hs,!0);de(this,$r);de(this,gs);Z(this,gs,t=>{if(!Li&&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(){$(this,$r)||this.setEventListener($(this,gs))}onUnsubscribe(){var t;this.hasListeners()||((t=$(this,$r))==null||t.call(this),Z(this,$r,void 0))}setEventListener(t){var n;Z(this,gs,t),(n=$(this,$r))==null||n.call(this),Z(this,$r,t(this.setOnline.bind(this)))}setOnline(t){$(this,hs)!==t&&(Z(this,hs,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return $(this,hs)}},hs=new WeakMap,$r=new WeakMap,gs=new WeakMap,sp),qs=new Hw;function ed(){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 Uw(e){return Math.min(1e3*2**e,3e4)}function Dp(e){return(e!=null?e:"online")==="online"?qs.isOnline():!0}var Ip=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function ac(e){return e instanceof Ip}function Rp(e){let t=!1,n=0,r=!1,i;const s=ed(),o=m=>{var p;r||(f(new Ip(m)),(p=e.abort)==null||p.call(e))},a=()=>{t=!0},l=()=>{t=!1},u=()=>Cf.isFocused()&&(e.networkMode==="always"||qs.isOnline())&&e.canRun(),c=()=>Dp(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||u())&&m(v)},(p=e.onPause)==null||p.call(e)}).then(()=>{var m;i=void 0,r||(m=e.onContinue)==null||m.call(e)}),g=()=>{if(r)return;let m;const p=n===0?e.initialPromise:void 0;try{m=p!=null?p:e.fn()}catch(v){m=Promise.reject(v)}Promise.resolve(m).then(d).catch(v=>{var O,x,_;if(r)return;const b=(O=e.retry)!=null?O:Li?0:3,S=(x=e.retryDelay)!=null?x:Uw,C=typeof S=="function"?S(n,v):S,w=b===!0||typeof b=="number"&&n<b||typeof b=="function"&&b(n,v);if(t||!w){f(v);return}n++,(_=e.onFail)==null||_.call(e,n,v),Fw(C).then(()=>u()?void 0:h()).then(()=>{t?f(v):g()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:a,continueRetry:l,canStart:c,start:()=>(c()?g():h().then(g),s)}}var Gw=e=>setTimeout(e,0);function Vw(){let e=[],t=0,n=a=>{a()},r=a=>{a()},i=Gw;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 yt=Vw(),wi,op,Np=(op=class{constructor(){de(this,wi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Yc(this.gcTime)&&Z(this,wi,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e!=null?e:Li?1/0:5*60*1e3)}clearGcTimeout(){$(this,wi)&&(clearTimeout($(this,wi)),Z(this,wi,void 0))}},wi=new WeakMap,op),ys,Si,pn,Ci,kt,wa,_i,Tn,sr,ap,Kw=(ap=class extends Np{constructor(t){var n;super();de(this,Tn);de(this,ys);de(this,Si);de(this,pn);de(this,Ci);de(this,kt);de(this,wa);de(this,_i);Z(this,_i,!1),Z(this,wa,t.defaultOptions),this.setOptions(t.options),this.observers=[],Z(this,Ci,t.client),Z(this,pn,$(this,Ci).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Z(this,ys,Ww(this.options)),this.state=(n=t.state)!=null?n:$(this,ys),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=$(this,kt))==null?void 0:t.promise}setOptions(t){this.options={...$(this,wa),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&$(this,pn).remove(this)}setData(t,n){const r=Jc(this.state.data,t,this.options);return je(this,Tn,sr).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){je(this,Tn,sr).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=$(this,kt))==null?void 0:r.promise;return(i=$(this,kt))==null||i.cancel(t),n?n.then(Lt).catch(Lt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState($(this,ys))}isActive(){return this.observers.some(t=>vn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ql||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Vr(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:!Mp(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=$(this,kt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=$(this,kt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),$(this,pn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||($(this,kt)&&($(this,_i)?$(this,kt).cancel({revert:!0}):$(this,kt).cancelRetry()),this.scheduleGc()),$(this,pn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||je(this,Tn,sr).call(this,{type:"invalidate"})}fetch(t,n){var u,c,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if($(this,kt))return $(this,kt).continueRetry(),$(this,kt).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:()=>(Z(this,_i,!0),r.signal)})},s=()=>{const f=$p(this.options,n),g=(()=>{const m={client:$(this,Ci),queryKey:this.queryKey,meta:this.meta};return i(m),m})();return Z(this,_i,!1),this.options.persister?this.options.persister(f,g,this):f(g)},a=(()=>{const f={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:$(this,Ci),state:this.state,fetchFn:s};return i(f),f})();(u=this.options.behavior)==null||u.onFetch(a,this),Z(this,Si,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&je(this,Tn,sr).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta});const l=f=>{var h,g,m,p;ac(f)&&f.silent||je(this,Tn,sr).call(this,{type:"error",error:f}),ac(f)||((g=(h=$(this,pn).config).onError)==null||g.call(h,f,this),(p=(m=$(this,pn).config).onSettled)==null||p.call(m,this.state.data,f,this)),this.scheduleGc()};return Z(this,kt,Rp({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=$(this,pn).config).onSuccess)==null||g.call(h,f,this),(p=(m=$(this,pn).config).onSettled)==null||p.call(m,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,h)=>{je(this,Tn,sr).call(this,{type:"failed",failureCount:f,error:h})},onPause:()=>{je(this,Tn,sr).call(this,{type:"pause"})},onContinue:()=>{je(this,Tn,sr).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),$(this,kt).start()}},ys=new WeakMap,Si=new WeakMap,pn=new WeakMap,Ci=new WeakMap,kt=new WeakMap,wa=new WeakMap,_i=new WeakMap,Tn=new WeakSet,sr=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,...Fp(r.data,this.options),fetchMeta:(i=t.meta)!=null?i:null};case"success":return Z(this,Si,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 ac(o)&&o.revert&&$(this,Si)?{...$(this,Si),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),yt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),$(this,pn).notify({query:this,type:"updated",action:t})})},ap);function Fp(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Dp(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Ww(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 Kn,lp,Qw=(lp=class extends Qs{constructor(t={}){super();de(this,Kn);this.config=t,Z(this,Kn,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 Kw({client:t,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){$(this,Kn).has(t.queryHash)||($(this,Kn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=$(this,Kn).get(t.queryHash);n&&(t.destroy(),n===t&&$(this,Kn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){yt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return $(this,Kn).get(t)}getAll(){return[...$(this,Kn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Bh(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Bh(t,r)):n}notify(t){yt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){yt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){yt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Kn=new WeakMap,lp),Wn,Mt,ki,Qn,jr,up,Yw=(up=class extends Np{constructor(t){super();de(this,Qn);de(this,Wn);de(this,Mt);de(this,ki);this.mutationId=t.mutationId,Z(this,Mt,t.mutationCache),Z(this,Wn,[]),this.state=t.state||Bp(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){$(this,Wn).includes(t)||($(this,Wn).push(t),this.clearGcTimeout(),$(this,Mt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Z(this,Wn,$(this,Wn).filter(n=>n!==t)),this.scheduleGc(),$(this,Mt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){$(this,Wn).length||(this.state.status==="pending"?this.scheduleGc():$(this,Mt).remove(this))}continue(){var t,n;return(n=(t=$(this,ki))==null?void 0:t.continue())!=null?n:this.execute(this.state.variables)}async execute(t){var s,o,a,l,u,c,d,f,h,g,m,p,v,b,S,C,w,O,x,_,k;const n=()=>{je(this,Qn,jr).call(this,{type:"continue"})};Z(this,ki,Rp({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(E,P)=>{je(this,Qn,jr).call(this,{type:"failed",failureCount:E,error:P})},onPause:()=>{je(this,Qn,jr).call(this,{type:"pause"})},onContinue:n,retry:(s=this.options.retry)!=null?s:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>$(this,Mt).canRun(this)}));const r=this.state.status==="pending",i=!$(this,ki).canStart();try{if(r)n();else{je(this,Qn,jr).call(this,{type:"pending",variables:t,isPaused:i}),await((a=(o=$(this,Mt).config).onMutate)==null?void 0:a.call(o,t,this));const P=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,t));P!==this.state.context&&je(this,Qn,jr).call(this,{type:"pending",context:P,variables:t,isPaused:i})}const E=await $(this,ki).start();return await((d=(c=$(this,Mt).config).onSuccess)==null?void 0:d.call(c,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=$(this,Mt).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)),je(this,Qn,jr).call(this,{type:"success",data:E}),E}catch(E){try{throw await((S=(b=$(this,Mt).config).onError)==null?void 0:S.call(b,E,t,this.state.context,this)),await((w=(C=this.options).onError)==null?void 0:w.call(C,E,t,this.state.context)),await((x=(O=$(this,Mt).config).onSettled)==null?void 0:x.call(O,void 0,E,this.state.variables,this.state.context,this)),await((k=(_=this.options).onSettled)==null?void 0:k.call(_,void 0,E,t,this.state.context)),E}finally{je(this,Qn,jr).call(this,{type:"error",error:E})}}finally{$(this,Mt).runNext(this)}}},Wn=new WeakMap,Mt=new WeakMap,ki=new WeakMap,Qn=new WeakSet,jr=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),yt.batch(()=>{$(this,Wn).forEach(r=>{r.onMutationUpdate(t)}),$(this,Mt).notify({mutation:this,type:"updated",action:t})})},up);function Bp(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var cr,Pn,Sa,cp,Xw=(cp=class extends Qs{constructor(t={}){super();de(this,cr);de(this,Pn);de(this,Sa);this.config=t,Z(this,cr,new Set),Z(this,Pn,new Map),Z(this,Sa,0)}build(t,n,r){const i=new Yw({mutationCache:this,mutationId:++Za(this,Sa)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){$(this,cr).add(t);const n=tl(t);if(typeof n=="string"){const r=$(this,Pn).get(n);r?r.push(t):$(this,Pn).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if($(this,cr).delete(t)){const n=tl(t);if(typeof n=="string"){const r=$(this,Pn).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&$(this,Pn).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=tl(t);if(typeof n=="string"){const r=$(this,Pn).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=tl(t);if(typeof n=="string"){const s=(r=$(this,Pn).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(){yt.batch(()=>{$(this,cr).forEach(t=>{this.notify({type:"removed",mutation:t})}),$(this,cr).clear(),$(this,Pn).clear()})}getAll(){return Array.from($(this,cr))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>qh(n,r))}findAll(t={}){return this.getAll().filter(n=>qh(t,n))}notify(t){yt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return yt.batch(()=>Promise.all(t.map(n=>n.continue().catch(Lt))))}},cr=new WeakMap,Pn=new WeakMap,Sa=new WeakMap,cp);function tl(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Uh(e){return{onFetch:(t,n)=>{var c,d,f,h,g;const r=t.options,i=(f=(d=(c=t.fetchOptions)==null?void 0:c.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 u=async()=>{var S;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=$p(t.options,t.fetchOptions),b=async(C,w,O)=>{if(m)return Promise.reject();if(w==null&&C.pages.length)return Promise.resolve(C);const _=(()=>{const M={client:t.client,queryKey:t.queryKey,pageParam:w,direction:O?"backward":"forward",meta:t.options.meta};return p(M),M})(),k=await v(_),{maxPages:E}=t.options,P=O?qw:Bw;return{pages:P(C.pages,k,E),pageParams:P(C.pageParams,w,E)}};if(i&&s.length){const C=i==="backward",w=C?Zw:Gh,O={pages:s,pageParams:o},x=w(r,O);a=await b(O,x,C)}else{const C=e!=null?e:s.length;do{const w=l===0?(S=o[0])!=null?S:r.initialPageParam:Gh(r,a);if(l>0&&w==null)break;a=await b(a,w),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,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function Gh(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 Zw(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var ut,Lr,Dr,ms,ps,Ir,vs,bs,dp,Jw=(dp=class{constructor(e={}){de(this,ut);de(this,Lr);de(this,Dr);de(this,ms);de(this,ps);de(this,Ir);de(this,vs);de(this,bs);Z(this,ut,e.queryCache||new Qw),Z(this,Lr,e.mutationCache||new Xw),Z(this,Dr,e.defaultOptions||{}),Z(this,ms,new Map),Z(this,ps,new Map),Z(this,Ir,0)}mount(){Za(this,Ir)._++,$(this,Ir)===1&&(Z(this,vs,Cf.subscribe(async e=>{e&&(await this.resumePausedMutations(),$(this,ut).onFocus())})),Z(this,bs,qs.subscribe(async e=>{e&&(await this.resumePausedMutations(),$(this,ut).onOnline())})))}unmount(){var e,t;Za(this,Ir)._--,$(this,Ir)===0&&((e=$(this,vs))==null||e.call(this),Z(this,vs,void 0),(t=$(this,bs))==null||t.call(this),Z(this,bs,void 0))}isFetching(e){return $(this,ut).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return $(this,Lr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=$(this,ut).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=$(this,ut).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Vr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return $(this,ut).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=$(this,ut).get(r.queryHash),s=i==null?void 0:i.state.data,o=Nw(t,s);if(o!==void 0)return $(this,ut).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return yt.batch(()=>$(this,ut).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=$(this,ut).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=$(this,ut);yt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=$(this,ut);return yt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=yt.batch(()=>$(this,ut).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Lt).catch(Lt)}invalidateQueries(e,t={}){return yt.batch(()=>{var n,r;return $(this,ut).findAll(e).forEach(i=>{i.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(r=(n=e==null?void 0:e.refetchType)!=null?n:e==null?void 0:e.type)!=null?r:"active"},t)})}refetchQueries(e,t={}){var i;const n={...t,cancelRefetch:(i=t.cancelRefetch)!=null?i:!0},r=yt.batch(()=>$(this,ut).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch(Lt)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Lt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=$(this,ut).build(this,t);return n.isStaleByTime(Vr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Lt).catch(Lt)}fetchInfiniteQuery(e){return e.behavior=Uh(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Lt).catch(Lt)}ensureInfiniteQueryData(e){return e.behavior=Uh(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return qs.isOnline()?$(this,Lr).resumePausedMutations():Promise.resolve()}getQueryCache(){return $(this,ut)}getMutationCache(){return $(this,Lr)}getDefaultOptions(){return $(this,Dr)}setDefaultOptions(e){Z(this,Dr,e)}setQueryDefaults(e,t){$(this,ms).set(Di(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...$(this,ms).values()],n={};return t.forEach(r=>{Ko(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){$(this,ps).set(Di(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...$(this,ps).values()],n={};return t.forEach(r=>{Ko(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...$(this,Dr).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===ql&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...$(this,Dr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){$(this,ut).clear(),$(this,Lr).clear()}},ut=new WeakMap,Lr=new WeakMap,Dr=new WeakMap,ms=new WeakMap,ps=new WeakMap,Ir=new WeakMap,vs=new WeakMap,bs=new WeakMap,dp),Nt,De,Ca,$t,Oi,xs,Rr,Nr,_a,ws,Ss,Ei,Ai,Fr,Cs,Ve,Ao,td,nd,rd,id,sd,od,ad,qp,fp,e3=(fp=class extends Qs{constructor(t,n){super();de(this,Ve);de(this,Nt);de(this,De);de(this,Ca);de(this,$t);de(this,Oi);de(this,xs);de(this,Rr);de(this,Nr);de(this,_a);de(this,ws);de(this,Ss);de(this,Ei);de(this,Ai);de(this,Fr);de(this,Cs,new Set);this.options=n,Z(this,Nt,t),Z(this,Nr,null),Z(this,Rr,ed()),this.options.experimental_prefetchInRender||$(this,Rr).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&&($(this,De).addObserver(this),Vh($(this,De),this.options)?je(this,Ve,Ao).call(this):this.updateResult(),je(this,Ve,id).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ld($(this,De),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ld($(this,De),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,je(this,Ve,sd).call(this),je(this,Ve,od).call(this),$(this,De).removeObserver(this)}setOptions(t){const n=this.options,r=$(this,De);if(this.options=$(this,Nt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof vn(this.options.enabled,$(this,De))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");je(this,Ve,ad).call(this),$(this,De).setOptions(this.options),n._defaulted&&!Bl(this.options,n)&&$(this,Nt).getQueryCache().notify({type:"observerOptionsUpdated",query:$(this,De),observer:this});const i=this.hasListeners();i&&Kh($(this,De),r,this.options,n)&&je(this,Ve,Ao).call(this),this.updateResult(),i&&($(this,De)!==r||vn(this.options.enabled,$(this,De))!==vn(n.enabled,$(this,De))||Vr(this.options.staleTime,$(this,De))!==Vr(n.staleTime,$(this,De)))&&je(this,Ve,td).call(this);const s=je(this,Ve,nd).call(this);i&&($(this,De)!==r||vn(this.options.enabled,$(this,De))!==vn(n.enabled,$(this,De))||s!==$(this,Fr))&&je(this,Ve,rd).call(this,s)}getOptimisticResult(t){const n=$(this,Nt).getQueryCache().build($(this,Nt),t),r=this.createResult(n,t);return n3(this,r)&&(Z(this,$t,r),Z(this,xs,this.options),Z(this,Oi,$(this,De).state)),r}getCurrentResult(){return $(this,$t)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),Reflect.get(r,i))})}trackProp(t){$(this,Cs).add(t)}getCurrentQuery(){return $(this,De)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=$(this,Nt).defaultQueryOptions(t),r=$(this,Nt).getQueryCache().build($(this,Nt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){var n;return je(this,Ve,Ao).call(this,{...t,cancelRefetch:(n=t.cancelRefetch)!=null?n:!0}).then(()=>(this.updateResult(),$(this,$t)))}createResult(t,n){var k;const r=$(this,De),i=this.options,s=$(this,$t),o=$(this,Oi),a=$(this,xs),u=t!==r?t.state:$(this,Ca),{state:c}=t;let d={...c},f=!1,h;if(n._optimisticResults){const E=this.hasListeners(),P=!E&&Vh(t,n),M=E&&Kh(t,r,n,i);(P||M)&&(d={...d,...Fp(c.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:g,errorUpdatedAt:m,status:p}=d;h=d.data;let v=!1;if(n.placeholderData!==void 0&&h===void 0&&p==="pending"){let E;s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(E=s.data,v=!0):E=typeof n.placeholderData=="function"?n.placeholderData((k=$(this,Ss))==null?void 0:k.state.data,$(this,Ss)):n.placeholderData,E!==void 0&&(p="success",h=Jc(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===$(this,_a))h=$(this,ws);else try{Z(this,_a,n.select),h=n.select(h),h=Jc(s==null?void 0:s.data,h,n),Z(this,ws,h),Z(this,Nr,null)}catch(E){Z(this,Nr,E)}$(this,Nr)&&(g=$(this,Nr),h=$(this,ws),m=Date.now(),p="error");const b=d.fetchStatus==="fetching",S=p==="pending",C=p==="error",w=S&&b,O=h!==void 0,_={status:p,fetchStatus:d.fetchStatus,isPending:S,isSuccess:p==="success",isError:C,isInitialLoading:w,isLoading:w,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>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:b,isRefetching:b&&!S,isLoadingError:C&&!O,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:C&&O,isStale:_f(t,n),refetch:this.refetch,promise:$(this,Rr),isEnabled:vn(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const E=B=>{_.status==="error"?B.reject(_.error):_.data!==void 0&&B.resolve(_.data)},P=()=>{const B=Z(this,Rr,_.promise=ed());E(B)},M=$(this,Rr);switch(M.status){case"pending":t.queryHash===r.queryHash&&E(M);break;case"fulfilled":(_.status==="error"||_.data!==M.value)&&P();break;case"rejected":(_.status!=="error"||_.error!==M.reason)&&P();break}}return _}updateResult(){const t=$(this,$t),n=this.createResult($(this,De),this.options);if(Z(this,Oi,$(this,De).state),Z(this,xs,this.options),$(this,Oi).data!==void 0&&Z(this,Ss,$(this,De)),Bl(n,t))return;Z(this,$t,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!$(this,Cs).size)return!0;const o=new Set(s!=null?s:$(this,Cs));return this.options.throwOnError&&o.add("error"),Object.keys($(this,$t)).some(a=>{const l=a;return $(this,$t)[l]!==t[l]&&o.has(l)})};je(this,Ve,qp).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&je(this,Ve,id).call(this)}},Nt=new WeakMap,De=new WeakMap,Ca=new WeakMap,$t=new WeakMap,Oi=new WeakMap,xs=new WeakMap,Rr=new WeakMap,Nr=new WeakMap,_a=new WeakMap,ws=new WeakMap,Ss=new WeakMap,Ei=new WeakMap,Ai=new WeakMap,Fr=new WeakMap,Cs=new WeakMap,Ve=new WeakSet,Ao=function(t){je(this,Ve,ad).call(this);let n=$(this,De).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Lt)),n},td=function(){je(this,Ve,sd).call(this);const t=Vr(this.options.staleTime,$(this,De));if(Li||$(this,$t).isStale||!Yc(t))return;const r=Mp($(this,$t).dataUpdatedAt,t)+1;Z(this,Ei,setTimeout(()=>{$(this,$t).isStale||this.updateResult()},r))},nd=function(){var t;return(t=typeof this.options.refetchInterval=="function"?this.options.refetchInterval($(this,De)):this.options.refetchInterval)!=null?t:!1},rd=function(t){je(this,Ve,od).call(this),Z(this,Fr,t),!(Li||vn(this.options.enabled,$(this,De))===!1||!Yc($(this,Fr))||$(this,Fr)===0)&&Z(this,Ai,setInterval(()=>{(this.options.refetchIntervalInBackground||Cf.isFocused())&&je(this,Ve,Ao).call(this)},$(this,Fr)))},id=function(){je(this,Ve,td).call(this),je(this,Ve,rd).call(this,je(this,Ve,nd).call(this))},sd=function(){$(this,Ei)&&(clearTimeout($(this,Ei)),Z(this,Ei,void 0))},od=function(){$(this,Ai)&&(clearInterval($(this,Ai)),Z(this,Ai,void 0))},ad=function(){const t=$(this,Nt).getQueryCache().build($(this,Nt),this.options);if(t===$(this,De))return;const n=$(this,De);Z(this,De,t),Z(this,Ca,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},qp=function(t){yt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n($(this,$t))}),$(this,Nt).getQueryCache().notify({query:$(this,De),type:"observerResultsUpdated"})})},fp);function t3(e,t){return vn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Vh(e,t){return t3(e,t)||e.state.data!==void 0&&ld(e,t,t.refetchOnMount)}function ld(e,t,n){if(vn(t.enabled,e)!==!1&&Vr(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&_f(e,t)}return!1}function Kh(e,t,n,r){return(e!==t||vn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&_f(e,n)}function _f(e,t){return vn(t.enabled,e)!==!1&&e.isStaleByTime(Vr(t.staleTime,e))}function n3(e,t){return!Bl(e.getCurrentResult(),t)}var Br,qr,Ft,dr,pr,Tl,ud,hp,r3=(hp=class extends Qs{constructor(n,r){super();de(this,pr);de(this,Br);de(this,qr);de(this,Ft);de(this,dr);Z(this,Br,n),this.setOptions(r),this.bindMethods(),je(this,pr,Tl).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=$(this,Br).defaultMutationOptions(n),Bl(this.options,r)||$(this,Br).getMutationCache().notify({type:"observerOptionsUpdated",mutation:$(this,Ft),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Di(r.mutationKey)!==Di(this.options.mutationKey)?this.reset():((i=$(this,Ft))==null?void 0:i.state.status)==="pending"&&$(this,Ft).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=$(this,Ft))==null||n.removeObserver(this)}onMutationUpdate(n){je(this,pr,Tl).call(this),je(this,pr,ud).call(this,n)}getCurrentResult(){return $(this,qr)}reset(){var n;(n=$(this,Ft))==null||n.removeObserver(this),Z(this,Ft,void 0),je(this,pr,Tl).call(this),je(this,pr,ud).call(this)}mutate(n,r){var i;return Z(this,dr,r),(i=$(this,Ft))==null||i.removeObserver(this),Z(this,Ft,$(this,Br).getMutationCache().build($(this,Br),this.options)),$(this,Ft).addObserver(this),$(this,Ft).execute(n)}},Br=new WeakMap,qr=new WeakMap,Ft=new WeakMap,dr=new WeakMap,pr=new WeakSet,Tl=function(){var r,i;const n=(i=(r=$(this,Ft))==null?void 0:r.state)!=null?i:Bp();Z(this,qr,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},ud=function(n){yt.batch(()=>{var r,i,s,o,a,l,u,c;if($(this,dr)&&this.hasListeners()){const d=$(this,qr).variables,f=$(this,qr).context;(n==null?void 0:n.type)==="success"?((i=(r=$(this,dr)).onSuccess)==null||i.call(r,n.data,d,f),(o=(s=$(this,dr)).onSettled)==null||o.call(s,n.data,null,d,f)):(n==null?void 0:n.type)==="error"&&((l=(a=$(this,dr)).onError)==null||l.call(a,n.error,d,f),(c=(u=$(this,dr)).onSettled)==null||c.call(u,void 0,n.error,d,f))}this.listeners.forEach(d=>{d($(this,qr))})})},hp),zp=I.createContext(void 0),Gt=e=>{const t=I.useContext(zp);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},i3=({client:e,children:t})=>(I.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),y.jsx(zp.Provider,{value:e,children:t})),Hp=I.createContext(!1),s3=()=>I.useContext(Hp);Hp.Provider;function o3(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var a3=I.createContext(o3()),l3=()=>I.useContext(a3),u3=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},c3=e=>{I.useEffect(()=>{e.clearReset()},[e])},d3=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Lp(n,[e.error,r])),f3=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))}},h3=(e,t)=>e.isLoading&&e.isFetching&&!t,g3=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Wh=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function y3(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=s3(),i=l3(),s=Gt(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",f3(o),u3(o,i),c3(i);const a=!s.getQueryCache().get(o.queryHash),[l]=I.useState(()=>new t(s,o)),u=l.getOptimisticResult(o),c=!r&&e.subscribed!==!1;if(I.useSyncExternalStore(I.useCallback(p=>{const v=c?l.subscribe(yt.batchCalls(p)):Lt;return l.updateResult(),v},[l,c]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),I.useEffect(()=>{l.setOptions(o)},[o,l]),g3(o,u))throw Wh(o,l,i);if(d3({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw u.error;if((g=(h=s.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||g.call(h,o,u),o.experimental_prefetchInRender&&!Li&&h3(u,r)){const p=a?Wh(o,l,i):(m=s.getQueryCache().get(o.queryHash))==null?void 0:m.promise;p==null||p.catch(Lt).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?u:l.trackResult(u)}function ni(e,t){return y3(e,e3,t)}function Sr(e,t){const n=Gt(t),[r]=I.useState(()=>new r3(n,e));I.useEffect(()=>{r.setOptions(e)},[r,e]);const i=I.useSyncExternalStore(I.useCallback(o=>r.subscribe(yt.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=I.useCallback((o,a)=>{r.mutate(o,a).catch(Lt)},[r]);if(i.error&&Lp(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}var Ee={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return Qh(this.context.count)},getNextContextId(){return Qh(this.context.count++)}};function Qh(e){const t=String(e),n=t.length-1;return Ee.context.id+(n?String.fromCharCode(96+n):"")+t}function To(e){Ee.context=e}var Up=!1,m3=(e,t)=>e===t,zl=Symbol("solid-proxy"),Gp=typeof Proxy=="function",Su=Symbol("solid-track"),Hl={equals:m3},Vp=Zp,Cr=1,Ul=2,Kp={owned:null,cleanups:null,context:null,owner:null},lc={},qe=null,uc=null,p3=null,Xe=null,Pt=null,yr=null,Cu=0;function mr(e,t){const n=Xe,r=qe,i=e.length===0,s=t===void 0?r:t,o=i?Kp:{owned:null,cleanups:null,context:s?s.context:null,owner:s},a=i?e:()=>e(()=>at(()=>Wo(o)));qe=o,Xe=null;try{return Zn(a,!0)}finally{Xe=n,qe=r}}function ce(e,t){t=t?Object.assign({},Hl,t):Hl;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=i=>(typeof i=="function"&&(i=i(n.value)),Xp(n,i));return[Yp.bind(n),r]}function Wp(e,t,n){const r=_u(e,t,!0,Cr);Ys(r)}function be(e,t,n){const r=_u(e,t,!1,Cr);Ys(r)}function xe(e,t,n){Vp=A3;const r=_u(e,t,!1,Cr);(!n||!n.render)&&(r.user=!0),yr?yr.push(r):Ys(r)}function U(e,t,n){n=n?Object.assign({},Hl,n):Hl;const r=_u(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Ys(r),Yp.bind(r)}function v3(e){return e&&typeof e=="object"&&"then"in e}function b3(e,t,n){let r,i,s;r=!0,i=e,s={};let o=null,a=lc,l=null,u=!1,c="initialValue"in s,d=typeof r=="function"&&U(r);const f=new Set,[h,g]=(s.storage||ce)(s.initialValue),[m,p]=ce(void 0),[v,b]=ce(void 0,{equals:!1}),[S,C]=ce(c?"ready":"unresolved");Ee.context&&(l=Ee.getNextContextId(),s.ssrLoadFrom==="initial"?a=s.initialValue:Ee.load&&Ee.has(l)&&(a=Ee.load(l)));function w(k,E,P,M){return o===k&&(o=null,M!==void 0&&(c=!0),(k===a||E===a)&&s.onHydrated&&queueMicrotask(()=>s.onHydrated(M,{value:E})),a=lc,O(E,P)),E}function O(k,E){Zn(()=>{E===void 0&&g(()=>k),C(E!==void 0?"errored":c?"ready":"unresolved"),p(E);for(const P of f.keys())P.decrement();f.clear()},!1)}function x(){const k=k3,E=h(),P=m();if(P!==void 0&&!o)throw P;return Xe&&Xe.user,E}function _(k=!0){if(k!==!1&&u)return;u=!1;const E=d?d():r;if(E==null||E===!1){w(o,at(h));return}const P=a!==lc?a:at(()=>i(E,{value:h(),refetching:k}));return v3(P)?(o=P,"value"in P?(P.status==="success"?w(o,P.value,void 0,E):w(o,void 0,cd(P.value),E),P):(u=!0,queueMicrotask(()=>u=!1),Zn(()=>{C(c?"refreshing":"pending"),b()},!1),P.then(M=>w(P,M,void 0,E),M=>w(P,void 0,cd(M),E)))):(w(o,P,void 0,E),P)}return Object.defineProperties(x,{state:{get:()=>S()},error:{get:()=>m()},loading:{get(){const k=S();return k==="pending"||k==="refreshing"}},latest:{get(){if(!c)return x();const k=m();if(k&&!o)throw k;return h()}}}),d?Wp(()=>_(!1)):_(!1),[x,{refetch:_,mutate:g}]}function x3(e){return Zn(e,!1)}function at(e){if(Xe===null)return e();const t=Xe;Xe=null;try{return e()}finally{Xe=t}}function br(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 u=0;u<e.length;u++)a[u]=e[u]()}else a=e();if(s)return s=!1,o;const l=at(()=>t(a,i,o));return i=a,l}}function xr(e){xe(()=>at(e))}function _e(e){return qe===null||(qe.cleanups===null?qe.cleanups=[e]:qe.cleanups.push(e)),e}function Yh(){return qe}function w3(e,t){const n=qe,r=Xe;qe=e,Xe=null;try{return Zn(t,!0)}catch(i){kf(i)}finally{qe=n,Xe=r}}function S3(e){const t=Xe,n=qe;return Promise.resolve().then(()=>{Xe=t,qe=n;let r;return Zn(e,!1),Xe=qe=null,r?r.done:void 0})}var[C3,oI]=ce(!1);function _3(){return[C3,S3]}function wt(e,t){const n=Symbol("context");return{id:n,Provider:T3(n),defaultValue:e}}function St(e){let t;return qe&&qe.context&&(t=qe.context[e.id])!==void 0?t:e.defaultValue}function Qp(e){const t=U(e),n=U(()=>dd(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}var k3;function Yp(){if(this.sources&&this.state)if(this.state===Cr)Ys(this);else{const e=Pt;Pt=null,Zn(()=>Vl(this),!1),Pt=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 Xp(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Zn(()=>{for(let i=0;i<e.observers.length;i+=1){const s=e.observers[i],o=uc&&uc.running;o&&uc.disposed.has(s),(o?!s.tState:!s.state)&&(s.pure?Pt.push(s):yr.push(s),s.observers&&Jp(s)),o||(s.state=Cr)}if(Pt.length>1e6)throw Pt=[],new Error},!1)),t}function Ys(e){if(!e.fn)return;Wo(e);const t=Cu;O3(e,e.value,t)}function O3(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=Cr,e.owned&&e.owned.forEach(Wo),e.owned=null),e.updatedAt=n+1,kf(o)}finally{Xe=s,qe=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Xp(e,r):e.value=r,e.updatedAt=n)}function _u(e,t,n,r=Cr,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!==Kp&&(qe.owned?qe.owned.push(s):qe.owned=[s]),s}function Gl(e){if(e.state===0)return;if(e.state===Ul)return Vl(e);if(e.suspense&&at(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Cu);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===Cr)Ys(e);else if(e.state===Ul){const r=Pt;Pt=null,Zn(()=>Vl(e,t[0]),!1),Pt=r}}function Zn(e,t){if(Pt)return e();let n=!1;t||(Pt=[]),yr?n=!0:yr=[],Cu++;try{const r=e();return E3(n),r}catch(r){n||(yr=null),Pt=null,kf(r)}}function E3(e){if(Pt&&(Zp(Pt),Pt=null),e)return;const t=yr;yr=null,t.length&&Zn(()=>Vp(t),!1)}function Zp(e){for(let t=0;t<e.length;t++)Gl(e[t])}function A3(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Gl(r)}if(Ee.context){if(Ee.count){Ee.effects||(Ee.effects=[]),Ee.effects.push(...e.slice(0,n));return}To()}for(Ee.effects&&(Ee.done||!Ee.count)&&(e=[...Ee.effects,...e],n+=Ee.effects.length,delete Ee.effects),t=0;t<n;t++)Gl(e[t])}function Vl(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===Cr?r!==t&&(!r.updatedAt||r.updatedAt<Cu)&&Gl(r):i===Ul&&Vl(r,t)}}}function Jp(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=Ul,n.pure?Pt.push(n):yr.push(n),n.observers&&Jp(n))}}function Wo(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--)Wo(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Wo(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 cd(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function kf(e,t=qe){throw cd(e)}function dd(e){if(typeof e=="function"&&!e.length)return dd(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=dd(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function T3(e,t){return function(r){let i;return be(()=>i=at(()=>(qe.context={...qe.context,[e]:r.value},Qp(()=>r.children))),void 0),i}}var fd=Symbol("fallback");function Kl(e){for(let t=0;t<e.length;t++)e[t]()}function P3(e,t,n={}){let r=[],i=[],s=[],o=0,a=t.length>1?[]:null;return _e(()=>Kl(s)),()=>{let l=e()||[],u=l.length,c,d;return l[Su],at(()=>{let h,g,m,p,v,b,S,C,w;if(u===0)o!==0&&(Kl(s),s=[],r=[],i=[],o=0,a&&(a=[])),n.fallback&&(r=[fd],i[0]=mr(O=>(s[0]=O,n.fallback())),o=1);else if(o===0){for(i=new Array(u),d=0;d<u;d++)r[d]=l[d],i[d]=mr(f);o=u}else{for(m=new Array(u),p=new Array(u),a&&(v=new Array(u)),b=0,S=Math.min(o,u);b<S&&r[b]===l[b];b++);for(S=o-1,C=u-1;S>=b&&C>=b&&r[S]===l[C];S--,C--)m[C]=i[S],p[C]=s[S],a&&(v[C]=a[S]);for(h=new Map,g=new Array(C+1),d=C;d>=b;d--)w=l[d],c=h.get(w),g[d]=c===void 0?-1:c,h.set(w,d);for(c=b;c<=S;c++)w=r[c],d=h.get(w),d!==void 0&&d!==-1?(m[d]=i[c],p[d]=s[c],a&&(v[d]=a[c]),d=g[d],h.set(w,d)):s[c]();for(d=b;d<u;d++)d in m?(i[d]=m[d],s[d]=p[d],a&&(a[d]=v[d],a[d](d))):i[d]=mr(f);i=i.slice(0,o=u),r=l.slice(0)}return i});function f(h){if(s[d]=h,a){const[g,m]=ce(d);return a[d]=m,t(l[d],g)}return t(l[d])}}}function j3(e,t,n={}){let r=[],i=[],s=[],o=[],a=0,l;return _e(()=>Kl(s)),()=>{const u=e()||[],c=u.length;return u[Su],at(()=>{if(c===0)return a!==0&&(Kl(s),s=[],r=[],i=[],a=0,o=[]),n.fallback&&(r=[fd],i[0]=mr(f=>(s[0]=f,n.fallback())),a=1),i;for(r[0]===fd&&(s[0](),s=[],r=[],i=[],a=0),l=0;l<c;l++)l<r.length&&r[l]!==u[l]?o[l](()=>u[l]):l>=r.length&&(i[l]=mr(d));for(;l<r.length;l++)s[l]();return a=o.length=s.length=c,r=u.slice(0),i=i.slice(0,a)});function d(f){s[l]=f;const[h,g]=ce(u[l]);return o[l]=g,t(h,l)}}}function D(e,t){return at(()=>e(t||{}))}function nl(){return!0}var hd={get(e,t,n){return t===zl?n:e.get(t)},has(e,t){return t===zl?!0:e.has(t)},set:nl,deleteProperty:nl,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:nl,deleteProperty:nl}},ownKeys(e){return e.keys()}};function cc(e){return(e=typeof e=="function"?e():e)?e:{}}function M3(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function Ae(...e){let t=!1;for(let o=0;o<e.length;o++){const a=e[o];t=t||!!a&&zl in a,e[o]=typeof a=="function"?(t=!0,U(a)):a}if(Gp&&t)return new Proxy({get(o){for(let a=e.length-1;a>=0;a--){const l=cc(e[a])[o];if(l!==void 0)return l}},has(o){for(let a=e.length-1;a>=0;a--)if(o in cc(e[a]))return!0;return!1},keys(){const o=[];for(let a=0;a<e.length;a++)o.push(...Object.keys(cc(e[a])));return[...new Set(o)]}},hd);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 u=l.length-1;u>=0;u--){const c=l[u];if(c==="__proto__"||c==="constructor")continue;const d=Object.getOwnPropertyDescriptor(a,c);if(!r[c])r[c]=d.get?{enumerable:!0,configurable:!0,get:M3.bind(n[c]=[d.get.bind(a)])}:d.value!==void 0?d:void 0;else{const f=n[c];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 Ke(e,...t){if(Gp&&zl 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)}},hd));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))}},hd)),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 u of t)u.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 ev(e){let t,n;const r=i=>{const s=Ee.context;if(s){const[a,l]=ce();Ee.count||(Ee.count=0),Ee.count++,(n||(n=e())).then(u=>{!Ee.done&&To(s),Ee.count--,l(()=>u.default),To()}),t=a}else if(!t){const[a]=b3(()=>(n||(n=e())).then(l=>l.default));t=a}let o;return U(()=>(o=t())?at(()=>{if(!s||Ee.done)return o(i);const a=Ee.context;To(s);const l=o(i);return To(a),l}):"")};return r.preload=()=>n||((n=e()).then(i=>t=()=>i.default),n),r}var $3=0;function kn(){return Ee.context?Ee.getNextContextId():`cl-${$3++}`}var tv=e=>`Stale read from <${e}>.`;function L3(e){const t="fallback"in e&&{fallback:()=>e.fallback};return U(P3(()=>e.each,e.children,t||void 0))}function D3(e){const t="fallback"in e&&{fallback:()=>e.fallback};return U(j3(()=>e.each,e.children,t||void 0))}function ve(e){const t=e.keyed,n=U(()=>e.when,void 0,void 0),r=t?n:U(n,void 0,{equals:(i,s)=>!i==!s});return U(()=>{const i=r();if(i){const s=e.children;return typeof s=="function"&&s.length>0?at(()=>s(t?i:()=>{if(!at(r))throw tv("Show");return n()})):s}return e.fallback},void 0,void 0)}function I3(e){const t=Qp(()=>e.children),n=U(()=>{const r=t(),i=Array.isArray(r)?r:[r];let s=()=>{};for(let o=0;o<i.length;o++){const a=o,l=i[o],u=s,c=U(()=>u()?void 0:l.when,void 0,void 0),d=l.keyed?c:U(c,void 0,{equals:(f,h)=>!f==!h});s=()=>u()||(d()?[a,c,l]:void 0)}return s});return U(()=>{const r=n()();if(!r)return e.fallback;const[i,s,o]=r,a=o.children;return typeof a=="function"&&a.length>0?at(()=>a(o.keyed?s():()=>{var u;if(((u=at(n)())==null?void 0:u[0])!==i)throw tv("Match");return s()})):a},void 0,void 0)}function dc(e){return e}var R3=["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"],N3=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...R3]),F3=new Set(["innerHTML","textContent","innerText","children"]),B3=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),q3=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 z3(e,t){const n=q3[e];return typeof n=="object"?n[t]?n.$:void 0:n}var H3=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),U3=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"]),G3={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function V3(e,t,n){let r=n.length,i=t.length,s=r,o=0,a=0,l=t[i-1].nextSibling,u=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 c=s<r?a?n[a-1].nextSibling:n[s-a]:l;for(;a<s;)e.insertBefore(n[a++],c)}else if(s===a)for(;o<i;)(!u||!u.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[s-1]&&n[a]===t[i-1]){const c=t[--i].nextSibling;e.insertBefore(n[a++],t[o++].nextSibling),e.insertBefore(n[--s],c),t[i]=n[s]}else{if(!u){u=new Map;let d=a;for(;d<s;)u.set(n[d],d++)}const c=u.get(t[o]);if(c!=null)if(a<c&&c<s){let d=o,f=1,h;for(;++d<i&&d<s&&!((h=u.get(t[d]))==null||h!==c+f);)f++;if(f>c-a){const g=t[o];for(;a<c;)e.insertBefore(n[a++],g)}else e.replaceChild(n[a++],t[o++])}else o++;else t[o++].remove()}}}var Bo="_$DX_DELEGATE";function nv(e,t,n,r={}){let i;return mr(s=>{i=s,t===document?e():K(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=""}}function he(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 ku(e,t=window.document){const n=t[Bo]||(t[Bo]=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,sv))}}function K3(e=window.document){if(e[Bo]){for(let t of e[Bo].keys())e.removeEventListener(t,sv);delete e[Bo]}}function re(e,t,n){Gi(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function W3(e,t,n,r){Gi(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function Q3(e,t,n){Gi(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function se(e,t){Gi(e)||(t==null?e.removeAttribute("class"):e.className=t)}function rv(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 Y3(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]||(Xh(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||(Xh(e,a,!0),n[a]=l)}return n}function X3(e,t,n){if(!t)return n?re(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 iv(e,t={},n,r){const i={};return r||be(()=>i.children=Qo(e,t.children,i.children)),be(()=>typeof t.ref=="function"&&Xs(t.ref,e)),be(()=>Z3(e,t,n,!0,i,!0)),i}function Xs(e,t,n){return at(()=>e(t,n))}function K(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Qo(e,t,r,n);be(i=>Qo(e,t(),i,n),r)}function Z3(e,t,n,r,i={},s=!1){t||(t={});for(const o in i)if(!(o in t)){if(o==="children")continue;i[o]=Zh(e,o,null,i[o],n,s,t)}for(const o in t){if(o==="children")continue;const a=t[o];i[o]=Zh(e,o,a,i[o],n,s,t)}}function J3(e){let t,n;return!Gi()||!(t=Ee.registry.get(n=tS()))?e():(Ee.completed&&Ee.completed.add(t),Ee.registry.delete(n),t)}function Gi(e){return!!Ee.context&&!Ee.done&&(!e||e.isConnected)}function eS(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Xh(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 Zh(e,t,n,r,i,s,o){let a,l,u,c,d;if(t==="style")return X3(e,n,r);if(t==="classList")return Y3(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=H3.has(f);if(!h&&r){const g=Array.isArray(r)?r[0]:r;e.removeEventListener(f,g)}(h||n)&&(rv(e,f,n,h),h&&ku([f]))}else if(t.slice(0,5)==="attr:")re(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")Q3(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(u=F3.has(t))||!i&&((c=z3(t,e.tagName))||(l=N3.has(t)))||(a=e.nodeName.includes("-")||"is"in o)){if(d)t=t.slice(5),l=!0;else if(Gi(e))return n;t==="class"||t==="className"?se(e,n):a&&!l&&!u?e[eS(t)]=n:e[c||t]=n}else{const f=i&&t.indexOf(":")>-1&&G3[t.split(":")[0]];f?W3(e,f,t,n):re(e,B3[t]||t,n)}return n}function sv(e){if(Ee.registry&&Ee.events&&Ee.events.find(([l,u])=>u===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 u=t[`${n}Data`];if(u!==void 0?l.call(t,u,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}}),Ee.registry&&!Ee.done&&(Ee.done=_$HY.done=!0),e.composedPath){const l=e.composedPath();s(l[0]);for(let u=0;u<l.length-2&&(t=l[u],!!o());u++){if(t._$host){t=t._$host,a();break}if(t.parentNode===i)break}}else a();s(r)}function Qo(e,t,n,r,i){const s=Gi(e);if(s){!n&&(n=[...e.childNodes]);let l=[];for(let u=0;u<n.length;u++){const c=n[u];c.nodeType===8&&c.data.slice(0,2)==="!$"?c.remove():l.push(c)}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=Xi(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=Xi(e,n,r)}else{if(o==="function")return be(()=>{let l=t();for(;typeof l=="function";)l=l();n=Qo(e,l,n,r)}),()=>n;if(Array.isArray(t)){const l=[],u=n&&Array.isArray(n);if(gd(l,t,n,i))return be(()=>n=Qo(e,l,n,r,!0)),()=>n;if(s){if(!l.length)return n;if(r===void 0)return n=[...e.childNodes];let c=l[0];if(c.parentNode!==e)return n;const d=[c];for(;(c=c.nextSibling)!==r;)d.push(c);return n=d}if(l.length===0){if(n=Xi(e,n,r),a)return n}else u?n.length===0?Jh(e,l,r):V3(e,n,l):(n&&Xi(e),Jh(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=Xi(e,n,r,t);Xi(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function gd(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],u;if(!(a==null||a===!0||a===!1))if((u=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))i=gd(e,a,l)||i;else if(u==="function")if(r){for(;typeof a=="function";)a=a();i=gd(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||i}else e.push(a),i=!0;else{const c=String(a);l&&l.nodeType===3&&l.data===c?e.push(l):e.push(document.createTextNode(c))}}return i}function Jh(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function Xi(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 tS(){return Ee.getNextContextId()}var nS="http://www.w3.org/2000/svg";function ov(e,t=!1){return t?document.createElementNS(nS,e):document.createElement(e)}function av(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,i=Yh();let s,o=!!Ee.context;return xe(()=>{o&&(Yh().user=o=!1),s||(s=w3(i,()=>U(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,u]=ce(!1),c=()=>u(!0);mr(d=>K(a,()=>l()?d():s(),null)),_e(c)}else{const l=ov(e.isSVG?"g":"div",e.isSVG),u=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),K(u,s),a.appendChild(l),e.ref&&e.ref(l),_e(()=>a.removeChild(l))}},void 0,{render:!o}),n}function rS(e,t){const n=U(e);return U(()=>{const r=n();switch(typeof r){case"function":return at(()=>r(t));case"string":const i=U3.has(r),s=Ee.context?J3():ov(r,i);return iv(s,t,i),s}})}function iS(e){const[,t]=Ke(e,["component"]);return rS(()=>e.component,t)}var sS=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()}},lv=class{constructor(t){this.generateIdentifier=t,this.kv=new sS}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)}},oS=class extends lv{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 aS(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 lS(e,t){const n=aS(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 zs(e,t){Object.entries(e).forEach(([n,r])=>t(r,n))}function Pl(e,t){return e.indexOf(t)!==-1}function e0(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(t(r))return r}}var uS=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return lS(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}},cS=e=>Object.prototype.toString.call(e).slice(8,-1),uv=e=>typeof e=="undefined",dS=e=>e===null,Yo=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,yd=e=>Yo(e)&&Object.keys(e).length===0,Yr=e=>Array.isArray(e),fS=e=>typeof e=="string",hS=e=>typeof e=="number"&&!isNaN(e),gS=e=>typeof e=="boolean",yS=e=>e instanceof RegExp,Xo=e=>e instanceof Map,Zo=e=>e instanceof Set,cv=e=>cS(e)==="Symbol",mS=e=>e instanceof Date&&!isNaN(e.valueOf()),pS=e=>e instanceof Error,t0=e=>typeof e=="number"&&isNaN(e),vS=e=>gS(e)||dS(e)||uv(e)||hS(e)||fS(e)||cv(e),bS=e=>typeof e=="bigint",xS=e=>e===1/0||e===-1/0,wS=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),SS=e=>e instanceof URL,dv=e=>e.replace(/\./g,"\\."),fc=e=>e.map(String).map(dv).join("."),qo=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 Fn(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var fv=[Fn(uv,"undefined",()=>null,()=>{}),Fn(bS,"bigint",e=>e.toString(),e=>typeof BigInt!="undefined"?BigInt(e):e),Fn(mS,"Date",e=>e.toISOString(),e=>new Date(e)),Fn(pS,"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}),Fn(yS,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),Fn(Zo,"set",e=>[...e.values()],e=>new Set(e)),Fn(Xo,"map",e=>[...e.entries()],e=>new Map(e)),Fn(e=>t0(e)||xS(e),"number",e=>t0(e)?"NaN":e>0?"Infinity":"-Infinity",Number),Fn(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),Fn(SS,"URL",e=>e.toString(),e=>new URL(e))];function Ou(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var hv=Ou((e,t)=>cv(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}),CS=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),gv=Ou(wS,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const n=CS[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function yv(e,t){return e!=null&&e.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var mv=Ou(yv,(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)}),pv=Ou((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)}),_S=[mv,hv,pv,gv],n0=(e,t)=>{const n=e0(_S,i=>i.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};const r=e0(fv,i=>i.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation}},vv={};fv.forEach(e=>{vv[e.annotation]=e});var kS=(e,t,n)=>{if(Yr(t))switch(t[0]){case"symbol":return hv.untransform(e,t,n);case"class":return mv.untransform(e,t,n);case"custom":return pv.untransform(e,t,n);case"typed-array":return gv.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{const r=vv[t];if(!r)throw new Error("Unknown transformation: "+t);return r.untransform(e,n)}},ss=(e,t)=>{const n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function bv(e){if(Pl(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(Pl(e,"prototype"))throw new Error("prototype is not allowed as a property");if(Pl(e,"constructor"))throw new Error("constructor is not allowed as a property")}var OS=(e,t)=>{bv(t);for(let n=0;n<t.length;n++){const r=t[n];if(Zo(e))e=ss(e,+r);else if(Xo(e)){const i=+r,s=+t[++n]==0?"key":"value",o=ss(e,i);switch(s){case"key":e=o;break;case"value":e=e.get(o);break}}else e=e[r]}return e},md=(e,t,n)=>{if(bv(t),t.length===0)return n(e);let r=e;for(let s=0;s<t.length-1;s++){const o=t[s];if(Yr(r)){const a=+o;r=r[a]}else if(Yo(r))r=r[o];else if(Zo(r)){const a=+o;r=ss(r,a)}else if(Xo(r)){if(s===t.length-2)break;const l=+o,u=+t[++s]==0?"key":"value",c=ss(r,l);switch(u){case"key":r=c;break;case"value":r=r.get(c);break}}}const i=t[t.length-1];if(Yr(r)?r[+i]=n(r[+i]):Yo(r)&&(r[i]=n(r[i])),Zo(r)){const s=ss(r,+i),o=n(s);s!==o&&(r.delete(s),r.add(o))}if(Xo(r)){const s=+t[t.length-2],o=ss(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 pd(e,t,n=[]){if(!e)return;if(!Yr(e)){zs(e,(s,o)=>pd(s,t,[...n,...qo(o)]));return}const[r,i]=e;i&&zs(i,(s,o)=>{pd(s,t,[...n,...qo(o)])}),t(r,n)}function ES(e,t,n){return pd(t,(r,i)=>{e=md(e,i,s=>kS(s,r,n))}),e}function AS(e,t){function n(r,i){const s=OS(e,qo(i));r.map(qo).forEach(o=>{e=md(e,o,()=>s)})}if(Yr(t)){const[r,i]=t;r.forEach(s=>{e=md(e,qo(s),()=>e)}),i&&zs(i,n)}else zs(t,n);return e}var TS=(e,t)=>Yo(e)||Yr(e)||Xo(e)||Zo(e)||yv(e,t);function PS(e,t,n){const r=n.get(e);r?r.push(t):n.set(e,[t])}function jS(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(fc):n[fc(s)]=o.map(fc)}),r?yd(n)?[r]:[r,n]:yd(n)?void 0:n}var xv=(e,t,n,r,i=[],s=[],o=new Map)=>{var h;const a=vS(e);if(!a){PS(e,i,t);const g=o.get(e);if(g)return r?{transformedValue:null}:g}if(!TS(e,n)){const g=n0(e,n),m=g?{transformedValue:g.value,annotations:[g.type]}:{transformedValue:e};return a||o.set(e,m),m}if(Pl(s,e))return{transformedValue:null};const l=n0(e,n),u=(h=l==null?void 0:l.value)!=null?h:e,c=Yr(u)?[]:{},d={};zs(u,(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=xv(g,t,n,r,[...i,m],[...s,e],o);c[m]=p.transformedValue,Yr(p.annotations)?d[m]=p.annotations:Yo(p.annotations)&&zs(p.annotations,(v,b)=>{d[dv(m)+"."+b]=v})});const f=yd(d)?{transformedValue:c,annotations:l?[l.type]:void 0}:{transformedValue:c,annotations:l?[l.type,d]:d};return a||o.set(e,f),f};function wv(e){return Object.prototype.toString.call(e).slice(8,-1)}function r0(e){return wv(e)==="Array"}function MS(e){if(wv(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function $S(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 vd(e,t={}){if(r0(e))return e.map(i=>vd(i,t));if(!MS(e))return e;const n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((i,s)=>{if(r0(t.props)&&!t.props.includes(s))return i;const o=e[s],a=vd(o,t);return $S(i,s,a,e,t.nonenumerable),i},{})}var Ze=class{constructor({dedupe:e=!1}={}){this.classRegistry=new oS,this.symbolRegistry=new lv(t=>{var n;return(n=t.description)!=null?n:""}),this.customTransformerRegistry=new uS,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const t=new Map,n=xv(e,t,this,this.dedupe),r={json:n.transformedValue};n.annotations&&(r.meta={...r.meta,values:n.annotations});const i=jS(t,this.dedupe);return i&&(r.meta={...r.meta,referentialEqualities:i}),r}deserialize(e){const{json:t,meta:n}=e;let r=vd(t);return n!=null&&n.values&&(r=ES(r,n.values,this)),n!=null&&n.referentialEqualities&&(r=AS(r,n.referentialEqualities)),r}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e))}registerClass(e,t){this.classRegistry.register(e,t)}registerSymbol(e,t){this.symbolRegistry.register(e,t)}registerCustom(e,t){this.customTransformerRegistry.register({name:t,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}};Ze.defaultInstance=new Ze;Ze.serialize=Ze.defaultInstance.serialize.bind(Ze.defaultInstance);Ze.deserialize=Ze.defaultInstance.deserialize.bind(Ze.defaultInstance);Ze.stringify=Ze.defaultInstance.stringify.bind(Ze.defaultInstance);Ze.parse=Ze.defaultInstance.parse.bind(Ze.defaultInstance);Ze.registerClass=Ze.defaultInstance.registerClass.bind(Ze.defaultInstance);Ze.registerSymbol=Ze.defaultInstance.registerSymbol.bind(Ze.defaultInstance);Ze.registerCustom=Ze.defaultInstance.registerCustom.bind(Ze.defaultInstance);Ze.allowErrorProps=Ze.defaultInstance.allowErrorProps.bind(Ze.defaultInstance);var Sv=Ze.serialize,LS=Ze.stringify;function ts(e){return e.state.fetchStatus==="fetching"?"fetching":e.getObserversCount()?e.state.fetchStatus==="paused"?"paused":e.isStale()?"stale":"fresh":"inactive"}function DS(e,t){return`${e}${t.charAt(0).toUpperCase()+t.slice(1)}`}function IS({queryState:e,observerCount:t,isStale:n}){return e.fetchStatus==="fetching"?"blue":t?e.fetchStatus==="paused"?"purple":n?"yellow":"green":"gray"}function os({status:e,isPaused:t}){return t?"purple":e==="error"?"red":e==="pending"?"yellow":e==="success"?"green":"gray"}function RS(e){return e==="fresh"?"green":e==="stale"?"yellow":e==="paused"?"purple":e==="inactive"?"gray":"blue"}var Wl=(e,t=!1)=>{const{json:n}=Sv(e);return JSON.stringify(n,null,t?2:void 0)},rl=e=>e.state.fetchStatus!=="idle"?0:e.getObserversCount()?e.isStale()?2:1:3,NS=(e,t)=>e.queryHash.localeCompare(t.queryHash),Cv=(e,t)=>e.state.dataUpdatedAt<t.state.dataUpdatedAt?1:-1,FS=(e,t)=>rl(e)===rl(t)?Cv(e,t):rl(e)>rl(t)?1:-1,bd={status:FS,"query hash":NS,"last updated":Cv},il=e=>e.state.isPaused?0:e.state.status==="error"?2:e.state.status==="pending"?1:3,_v=(e,t)=>e.state.submittedAt<t.state.submittedAt?1:-1,BS=(e,t)=>il(e)===il(t)?_v(e,t):il(e)>il(t)?1:-1,xd={status:BS,"last updated":_v},i0=e=>e*parseFloat(getComputedStyle(document.documentElement).fontSize),kv=()=>{const[e,t]=ce("dark");return xr(()=>{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),_e(()=>n.removeEventListener("change",r))}),e},pi=(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,pi(r.get(i),s,n)),r}if(e instanceof Set){const r=pi(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]=pi(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]=pi(r[i],s,n),r}return e},Po=(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,Po(n.get(r),i)),n}if(e instanceof Set){const n=Po(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]=Po(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]=Po(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)},_s,ka,Oa,Ea,Ti,Aa,ks,Os,Es,As,Ts,Ps,Ta,gp,qS=(gp=class{constructor(e){de(this,_s);de(this,ka);de(this,Oa);de(this,Ea);de(this,Ti,!1);de(this,Aa);de(this,ks);de(this,Os);de(this,Es);de(this,As);de(this,Ts);de(this,Ps);de(this,Ta);const{client:t,queryFlavor:n,version:r,onlineManager:i,buttonPosition:s,position:o,initialIsOpen:a,errorTypes:l,styleNonce:u,shadowDOMTarget:c}=e;Z(this,_s,ce(t)),Z(this,Oa,n),Z(this,Ea,r),Z(this,ka,i),Z(this,Aa,u),Z(this,ks,c),Z(this,Os,ce(s)),Z(this,Es,ce(o)),Z(this,As,ce(a)),Z(this,Ts,ce(l))}setButtonPosition(e){$(this,Os)[1](e)}setPosition(e){$(this,Es)[1](e)}setInitialIsOpen(e){$(this,As)[1](e)}setErrorTypes(e){$(this,Ts)[1](e)}setClient(e){$(this,_s)[1](e)}mount(e){if($(this,Ti))throw new Error("Devtools is already mounted");const t=nv(()=>{const n=this,[r]=$(this,Os),[i]=$(this,Es),[s]=$(this,As),[o]=$(this,Ts),[a]=$(this,_s);let l;return $(this,Ps)?l=$(this,Ps):(l=ev(()=>Promise.resolve().then(()=>vL)),Z(this,Ps,l)),Ov($(this,Aa),$(this,ks)),D(l,Ae({get queryFlavor(){return $(n,Oa)},get version(){return $(n,Ea)},get onlineManager(){return $(n,ka)},get shadowDOMTarget(){return $(n,ks)}},{get client(){return a()},get buttonPosition(){return r()},get position(){return i()},get initialIsOpen(){return s()},get errorTypes(){return o()}}))},e);Z(this,Ti,!0),Z(this,Ta,t)}unmount(){var e;if(!$(this,Ti))throw new Error("Devtools is not mounted");(e=$(this,Ta))==null||e.call(this),Z(this,Ti,!1)}},_s=new WeakMap,ka=new WeakMap,Oa=new WeakMap,Ea=new WeakMap,Ti=new WeakMap,Aa=new WeakMap,ks=new WeakMap,Os=new WeakMap,Es=new WeakMap,As=new WeakMap,Ts=new WeakMap,Ps=new WeakMap,Ta=new WeakMap,gp),js,Pa,ja,Ma,Pi,$a,Ms,$s,Ls,Ds,Is,Rs,Ns,La,yp,zS=(yp=class{constructor(e){de(this,js);de(this,Pa);de(this,ja);de(this,Ma);de(this,Pi,!1);de(this,$a);de(this,Ms);de(this,$s);de(this,Ls);de(this,Ds);de(this,Is);de(this,Rs);de(this,Ns);de(this,La);const{client:t,queryFlavor:n,version:r,onlineManager:i,buttonPosition:s,position:o,initialIsOpen:a,errorTypes:l,styleNonce:u,shadowDOMTarget:c,onClose:d}=e;Z(this,js,ce(t)),Z(this,ja,n),Z(this,Ma,r),Z(this,Pa,i),Z(this,$a,u),Z(this,Ms,c),Z(this,$s,ce(s)),Z(this,Ls,ce(o)),Z(this,Ds,ce(a)),Z(this,Is,ce(l)),Z(this,Rs,ce(d))}setButtonPosition(e){$(this,$s)[1](e)}setPosition(e){$(this,Ls)[1](e)}setInitialIsOpen(e){$(this,Ds)[1](e)}setErrorTypes(e){$(this,Is)[1](e)}setClient(e){$(this,js)[1](e)}setOnClose(e){$(this,Rs)[1](()=>e)}mount(e){if($(this,Pi))throw new Error("Devtools is already mounted");const t=nv(()=>{const n=this,[r]=$(this,$s),[i]=$(this,Ls),[s]=$(this,Ds),[o]=$(this,Is),[a]=$(this,js),[l]=$(this,Rs);let u;return $(this,Ns)?u=$(this,Ns):(u=ev(()=>Promise.resolve().then(()=>wL)),Z(this,Ns,u)),Ov($(this,$a),$(this,Ms)),D(u,Ae({get queryFlavor(){return $(n,ja)},get version(){return $(n,Ma)},get onlineManager(){return $(n,Pa)},get shadowDOMTarget(){return $(n,Ms)}},{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);Z(this,Pi,!0),Z(this,La,t)}unmount(){var e;if(!$(this,Pi))throw new Error("Devtools is not mounted");(e=$(this,La))==null||e.call(this),Z(this,Pi,!1)}},js=new WeakMap,Pa=new WeakMap,ja=new WeakMap,Ma=new WeakMap,Pi=new WeakMap,$a=new WeakMap,Ms=new WeakMap,$s=new WeakMap,Ls=new WeakMap,Ds=new WeakMap,Is=new WeakMap,Rs=new WeakMap,Ns=new WeakMap,La=new WeakMap,yp);function HS(e){const t=Gt(e.client),n=I.useRef(null),{buttonPosition:r,position:i,initialIsOpen:s,errorTypes:o,styleNonce:a,shadowDOMTarget:l}=e,[u]=I.useState(new qS({client:t,queryFlavor:"React Query",version:"5",onlineManager:qs,buttonPosition:r,position:i,initialIsOpen:s,errorTypes:o,styleNonce:a,shadowDOMTarget:l}));return I.useEffect(()=>{u.setClient(t)},[t,u]),I.useEffect(()=>{r&&u.setButtonPosition(r)},[r,u]),I.useEffect(()=>{i&&u.setPosition(i)},[i,u]),I.useEffect(()=>{u.setInitialIsOpen(s||!1)},[s,u]),I.useEffect(()=>{u.setErrorTypes(o||[])},[o,u]),I.useEffect(()=>(n.current&&u.mount(n.current),()=>{u.unmount()}),[u]),y.jsx("div",{dir:"ltr",className:"tsqd-parent-container",ref:n})}function US(e){const t=Gt(e.client),n=I.useRef(null),{errorTypes:r,styleNonce:i,shadowDOMTarget:s}=e,[o]=I.useState(new zS({client:t,queryFlavor:"React Query",version:"5",onlineManager:qs,buttonPosition:"bottom-left",position:"bottom",initialIsOpen:!0,errorTypes:r,styleNonce:i,shadowDOMTarget:s,onClose:e.onClose}));return I.useEffect(()=>{o.setClient(t)},[t,o]),I.useEffect(()=>{var a;o.setOnClose((a=e.onClose)!=null?a:()=>{})},[e.onClose,o]),I.useEffect(()=>{o.setErrorTypes(r||[])},[r,o]),I.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 GS=process.env.NODE_ENV!=="development"?function(){return null}:HS;process.env.NODE_ENV;function Ev(e,t){return function(){return e.apply(t,arguments)}}const{toString:VS}=Object.prototype,{getPrototypeOf:Of}=Object,{iterator:Eu,toStringTag:Av}=Symbol,Au=(e=>t=>{const n=VS.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),In=e=>(e=e.toLowerCase(),t=>Au(t)===e),Tu=e=>t=>typeof t===e,{isArray:Zs}=Array,Jo=Tu("undefined");function KS(e){return e!==null&&!Jo(e)&&e.constructor!==null&&!Jo(e.constructor)&&zt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Tv=In("ArrayBuffer");function WS(e){let t;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Tv(e.buffer),t}const QS=Tu("string"),zt=Tu("function"),Pv=Tu("number"),Pu=e=>e!==null&&typeof e=="object",YS=e=>e===!0||e===!1,jl=e=>{if(Au(e)!=="object")return!1;const t=Of(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Av in e)&&!(Eu in e)},XS=In("Date"),ZS=In("File"),JS=In("Blob"),eC=In("FileList"),tC=e=>Pu(e)&&zt(e.pipe),nC=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||zt(e.append)&&((t=Au(e))==="formdata"||t==="object"&&zt(e.toString)&&e.toString()==="[object FormData]"))},rC=In("URLSearchParams"),[iC,sC,oC,aC]=["ReadableStream","Request","Response","Headers"].map(In),lC=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ra(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 jv(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 vi=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:global,Mv=e=>!Jo(e)&&e!==vi;function wd(){const{caseless:e}=Mv(this)&&this||{},t={},n=(r,i)=>{const s=e&&jv(t,i)||i;jl(t[s])&&jl(r)?t[s]=wd(t[s],r):jl(r)?t[s]=wd({},r):Zs(r)?t[s]=r.slice():t[s]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&Ra(arguments[r],n);return t}const uC=(e,t,n,{allOwnKeys:r}={})=>(Ra(t,(i,s)=>{n&&zt(i)?e[s]=Ev(i,n):e[s]=i},{allOwnKeys:r}),e),cC=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),dC=(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)},fC=(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&&Of(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},gC=e=>{if(!e)return null;if(Zs(e))return e;let t=e.length;if(!Pv(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},yC=(e=>t=>e&&t instanceof e)(typeof Uint8Array!="undefined"&&Of(Uint8Array)),mC=(e,t)=>{const r=(e&&e[Eu]).call(e);let i;for(;(i=r.next())&&!i.done;){const s=i.value;t.call(e,s[0],s[1])}},pC=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},vC=In("HTMLFormElement"),bC=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),s0=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),xC=In("RegExp"),$v=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Ra(n,(i,s)=>{let o;(o=t(i,s,e))!==!1&&(r[s]=o||i)}),Object.defineProperties(e,r)},wC=e=>{$v(e,(t,n)=>{if(zt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(zt(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},SC=(e,t)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return Zs(e)?r(e):r(String(e).split(t)),n},CC=()=>{},_C=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function kC(e){return!!(e&&zt(e.append)&&e[Av]==="FormData"&&e[Eu])}const OC=e=>{const t=new Array(10),n=(r,i)=>{if(Pu(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const s=Zs(r)?[]:{};return Ra(r,(o,a)=>{const l=n(o,i+1);!Jo(l)&&(s[a]=l)}),t[i]=void 0,s}}return r};return n(e,0)},EC=In("AsyncFunction"),AC=e=>e&&(Pu(e)||zt(e))&&zt(e.then)&&zt(e.catch),Lv=((e,t)=>e?setImmediate:t?((n,r)=>(vi.addEventListener("message",({source:i,data:s})=>{i===vi&&s===n&&r.length&&r.shift()()},!1),i=>{r.push(i),vi.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",zt(vi.postMessage)),TC=typeof queueMicrotask!="undefined"?queueMicrotask.bind(vi):typeof process!="undefined"&&process.nextTick||Lv,PC=e=>e!=null&&zt(e[Eu]),q={isArray:Zs,isArrayBuffer:Tv,isBuffer:KS,isFormData:nC,isArrayBufferView:WS,isString:QS,isNumber:Pv,isBoolean:YS,isObject:Pu,isPlainObject:jl,isReadableStream:iC,isRequest:sC,isResponse:oC,isHeaders:aC,isUndefined:Jo,isDate:XS,isFile:ZS,isBlob:JS,isRegExp:xC,isFunction:zt,isStream:tC,isURLSearchParams:rC,isTypedArray:yC,isFileList:eC,forEach:Ra,merge:wd,extend:uC,trim:lC,stripBOM:cC,inherits:dC,toFlatObject:fC,kindOf:Au,kindOfTest:In,endsWith:hC,toArray:gC,forEachEntry:mC,matchAll:pC,isHTMLForm:vC,hasOwnProperty:s0,hasOwnProp:s0,reduceDescriptors:$v,freezeMethods:wC,toObjectSet:SC,toCamelCase:bC,noop:CC,toFiniteNumber:_C,findKey:jv,global:vi,isContextDefined:Mv,isSpecCompliantForm:kC,toJSONObject:OC,isAsyncFn:EC,isThenable:AC,setImmediate:Lv,asap:TC,isIterable:PC};function Pe(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)}q.inherits(Pe,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:q.toJSONObject(this.config),code:this.code,status:this.status}}});const Dv=Pe.prototype,Iv={};["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=>{Iv[e]={value:e}});Object.defineProperties(Pe,Iv);Object.defineProperty(Dv,"isAxiosError",{value:!0});Pe.from=(e,t,n,r,i,s)=>{const o=Object.create(Dv);return q.toFlatObject(e,o,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),Pe.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,s&&Object.assign(o,s),o};const jC=null;function Sd(e){return q.isPlainObject(e)||q.isArray(e)}function Rv(e){return q.endsWith(e,"[]")?e.slice(0,-2):e}function o0(e,t,n){return e?e.concat(t).map(function(i,s){return i=Rv(i),!n&&s?"["+i+"]":i}).join(n?".":""):t}function MC(e){return q.isArray(e)&&!e.some(Sd)}const $C=q.toFlatObject(q,{},null,function(t){return/^is[A-Z]/.test(t)});function ju(e,t,n){if(!q.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=q.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,p){return!q.isUndefined(p[m])});const r=n.metaTokens,i=n.visitor||c,s=n.dots,o=n.indexes,l=(n.Blob||typeof Blob!="undefined"&&Blob)&&q.isSpecCompliantForm(t);if(!q.isFunction(i))throw new TypeError("visitor must be a function");function u(g){if(g===null)return"";if(q.isDate(g))return g.toISOString();if(q.isBoolean(g))return g.toString();if(!l&&q.isBlob(g))throw new Pe("Blob is not supported. Use a Buffer instead.");return q.isArrayBuffer(g)||q.isTypedArray(g)?l&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function c(g,m,p){let v=g;if(g&&!p&&typeof g=="object"){if(q.endsWith(m,"{}"))m=r?m:m.slice(0,-2),g=JSON.stringify(g);else if(q.isArray(g)&&MC(g)||(q.isFileList(g)||q.endsWith(m,"[]"))&&(v=q.toArray(g)))return m=Rv(m),v.forEach(function(S,C){!(q.isUndefined(S)||S===null)&&t.append(o===!0?o0([m],C,s):o===null?m:m+"[]",u(S))}),!1}return Sd(g)?!0:(t.append(o0(p,m,s),u(g)),!1)}const d=[],f=Object.assign($C,{defaultVisitor:c,convertValue:u,isVisitable:Sd});function h(g,m){if(!q.isUndefined(g)){if(d.indexOf(g)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(g),q.forEach(g,function(v,b){(!(q.isUndefined(v)||v===null)&&i.call(t,v,q.isString(b)?b.trim():b,m,f))===!0&&h(v,m?m.concat(b):[b])}),d.pop()}}if(!q.isObject(e))throw new TypeError("data must be an object");return h(e),t}function a0(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Ef(e,t){this._pairs=[],e&&ju(e,this,t)}const Nv=Ef.prototype;Nv.append=function(t,n){this._pairs.push([t,n])};Nv.toString=function(t){const n=t?function(r){return t.call(this,r,a0)}:a0;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function LC(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Fv(e,t,n){if(!t)return e;const r=n&&n.encode||LC;q.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let s;if(i?s=i(t,n):s=q.isURLSearchParams(t)?t.toString():new Ef(t,n).toString(r),s){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class l0{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){q.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Bv={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},DC=typeof URLSearchParams!="undefined"?URLSearchParams:Ef,IC=typeof FormData!="undefined"?FormData:null,RC=typeof Blob!="undefined"?Blob:null,NC={isBrowser:!0,classes:{URLSearchParams:DC,FormData:IC,Blob:RC},protocols:["http","https","file","blob","url","data"]},Af=typeof window!="undefined"&&typeof document!="undefined",Cd=typeof navigator=="object"&&navigator||void 0,FC=Af&&(!Cd||["ReactNative","NativeScript","NS"].indexOf(Cd.product)<0),BC=typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",qC=Af&&window.location.href||"http://localhost",zC=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Af,hasStandardBrowserEnv:FC,hasStandardBrowserWebWorkerEnv:BC,navigator:Cd,origin:qC},Symbol.toStringTag,{value:"Module"})),Tt={...zC,...NC};function HC(e,t){return ju(e,new Tt.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,s){return Tt.isNode&&q.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function UC(e){return q.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function GC(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 qv(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&&q.isArray(i)?i.length:o,l?(q.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!a):((!i[o]||!q.isObject(i[o]))&&(i[o]=[]),t(n,r,i[o],s)&&q.isArray(i[o])&&(i[o]=GC(i[o])),!a)}if(q.isFormData(e)&&q.isFunction(e.entries)){const n={};return q.forEachEntry(e,(r,i)=>{t(UC(r),i,n,0)}),n}return null}function VC(e,t,n){if(q.isString(e))try{return(t||JSON.parse)(e),q.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Na={transitional:Bv,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=q.isObject(t);if(s&&q.isHTMLForm(t)&&(t=new FormData(t)),q.isFormData(t))return i?JSON.stringify(qv(t)):t;if(q.isArrayBuffer(t)||q.isBuffer(t)||q.isStream(t)||q.isFile(t)||q.isBlob(t)||q.isReadableStream(t))return t;if(q.isArrayBufferView(t))return t.buffer;if(q.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 HC(t,this.formSerializer).toString();if((a=q.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return ju(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),VC(t)):t}],transformResponse:[function(t){const n=this.transitional||Na.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(q.isResponse(t)||q.isReadableStream(t))return t;if(t&&q.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"?Pe.from(a,Pe.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:Tt.classes.FormData,Blob:Tt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};q.forEach(["delete","get","head","post","put","patch"],e=>{Na.headers[e]={}});const KC=q.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"]),WC=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]&&KC[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},u0=Symbol("internals");function fo(e){return e&&String(e).trim().toLowerCase()}function Ml(e){return e===!1||e==null?e:q.isArray(e)?e.map(Ml):String(e)}function QC(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 YC=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function hc(e,t,n,r,i){if(q.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!q.isString(t)){if(q.isString(r))return t.indexOf(r)!==-1;if(q.isRegExp(r))return r.test(t)}}function XC(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function ZC(e,t){const n=q.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,s,o){return this[r].call(this,t,i,s,o)},configurable:!0})})}let Ht=class{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function s(a,l,u){const c=fo(l);if(!c)throw new Error("header name must be a non-empty string");const d=q.findKey(i,c);(!d||i[d]===void 0||u===!0||u===void 0&&i[d]!==!1)&&(i[d||l]=Ml(a))}const o=(a,l)=>q.forEach(a,(u,c)=>s(u,c,l));if(q.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(q.isString(t)&&(t=t.trim())&&!YC(t))o(WC(t),n);else if(q.isObject(t)&&q.isIterable(t)){let a={},l,u;for(const c of t){if(!q.isArray(c))throw TypeError("Object iterator must return a key-value pair");a[u=c[0]]=(l=a[u])?q.isArray(l)?[...l,c[1]]:[l,c[1]]:c[1]}o(a,n)}else t!=null&&s(n,t,r);return this}get(t,n){if(t=fo(t),t){const r=q.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return QC(i);if(q.isFunction(n))return n.call(this,i,r);if(q.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=fo(t),t){const r=q.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||hc(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function s(o){if(o=fo(o),o){const a=q.findKey(r,o);a&&(!n||hc(r,r[a],a,n))&&(delete r[a],i=!0)}}return q.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||hc(this,this[s],s,t,!0))&&(delete this[s],i=!0)}return i}normalize(t){const n=this,r={};return q.forEach(this,(i,s)=>{const o=q.findKey(r,s);if(o){n[o]=Ml(i),delete n[s];return}const a=t?XC(s):String(s).trim();a!==s&&delete n[s],n[a]=Ml(i),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return q.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&q.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[u0]=this[u0]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=fo(o);r[a]||(ZC(i,o),r[a]=!0)}return q.isArray(t)?t.forEach(s):s(t),this}};Ht.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);q.reduceDescriptors(Ht.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});q.freezeMethods(Ht);function gc(e,t){const n=this||Na,r=t||n,i=Ht.from(r.headers);let s=r.data;return q.forEach(e,function(a){s=a.call(n,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function zv(e){return!!(e&&e.__CANCEL__)}function Js(e,t,n){Pe.call(this,e==null?"canceled":e,Pe.ERR_CANCELED,t,n),this.name="CanceledError"}q.inherits(Js,Pe,{__CANCEL__:!0});function Hv(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Pe("Request failed with status code "+n.status,[Pe.ERR_BAD_REQUEST,Pe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function JC(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function e5(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 u=Date.now(),c=r[s];o||(o=u),n[i]=l,r[i]=u;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),u-o<t)return;const h=c&&u-c;return h?Math.round(f*1e3/h):void 0}}function t5(e,t){let n=0,r=1e3/t,i,s;const o=(u,c=Date.now())=>{n=c,i=null,s&&(clearTimeout(s),s=null),e.apply(null,u)};return[(...u)=>{const c=Date.now(),d=c-n;d>=r?o(u,c):(i=u,s||(s=setTimeout(()=>{s=null,o(i)},r-d)))},()=>i&&o(i)]}const Ql=(e,t,n=3)=>{let r=0;const i=e5(50,250);return t5(s=>{const o=s.loaded,a=s.lengthComputable?s.total:void 0,l=o-r,u=i(l),c=o<=a;r=o;const d={loaded:o,total:a,progress:a?o/a:void 0,bytes:l,rate:u||void 0,estimated:u&&a&&c?(a-o)/u:void 0,event:s,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},c0=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},d0=e=>(...t)=>q.asap(()=>e(...t)),n5=Tt.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Tt.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Tt.origin),Tt.navigator&&/(msie|trident)/i.test(Tt.navigator.userAgent)):()=>!0,r5=Tt.hasStandardBrowserEnv?{write(e,t,n,r,i,s){const o=[e+"="+encodeURIComponent(t)];q.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),q.isString(r)&&o.push("path="+r),q.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 i5(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function s5(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Uv(e,t,n){let r=!i5(t);return e&&(r||n==!1)?s5(e,t):t}const f0=e=>e instanceof Ht?{...e}:e;function Ii(e,t){t=t||{};const n={};function r(u,c,d,f){return q.isPlainObject(u)&&q.isPlainObject(c)?q.merge.call({caseless:f},u,c):q.isPlainObject(c)?q.merge({},c):q.isArray(c)?c.slice():c}function i(u,c,d,f){if(q.isUndefined(c)){if(!q.isUndefined(u))return r(void 0,u,d,f)}else return r(u,c,d,f)}function s(u,c){if(!q.isUndefined(c))return r(void 0,c)}function o(u,c){if(q.isUndefined(c)){if(!q.isUndefined(u))return r(void 0,u)}else return r(void 0,c)}function a(u,c,d){if(d in t)return r(u,c);if(d in e)return r(void 0,u)}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:(u,c,d)=>i(f0(u),f0(c),d,!0)};return q.forEach(Object.keys(Object.assign({},e,t)),function(c){const d=l[c]||i,f=d(e[c],t[c],c);q.isUndefined(f)&&d!==a||(n[c]=f)}),n}const Gv=e=>{const t=Ii({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:o,auth:a}=t;t.headers=o=Ht.from(o),t.url=Fv(Uv(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(q.isFormData(n)){if(Tt.hasStandardBrowserEnv||Tt.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((l=o.getContentType())!==!1){const[u,...c]=l?l.split(";").map(d=>d.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...c].join("; "))}}if(Tt.hasStandardBrowserEnv&&(r&&q.isFunction(r)&&(r=r(t)),r||r!==!1&&n5(t.url))){const u=i&&s&&r5.read(s);u&&o.set(i,u)}return t},o5=typeof XMLHttpRequest!="undefined",a5=o5&&function(e){return new Promise(function(n,r){const i=Gv(e);let s=i.data;const o=Ht.from(i.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:u}=i,c,d,f,h,g;function m(){h&&h(),g&&g(),i.cancelToken&&i.cancelToken.unsubscribe(c),i.signal&&i.signal.removeEventListener("abort",c)}let p=new XMLHttpRequest;p.open(i.method.toUpperCase(),i.url,!0),p.timeout=i.timeout;function v(){if(!p)return;const S=Ht.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),w={data:!a||a==="text"||a==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:S,config:e,request:p};Hv(function(x){n(x),m()},function(x){r(x),m()},w),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 Pe("Request aborted",Pe.ECONNABORTED,e,p)),p=null)},p.onerror=function(){r(new Pe("Network Error",Pe.ERR_NETWORK,e,p)),p=null},p.ontimeout=function(){let C=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const w=i.transitional||Bv;i.timeoutErrorMessage&&(C=i.timeoutErrorMessage),r(new Pe(C,w.clarifyTimeoutError?Pe.ETIMEDOUT:Pe.ECONNABORTED,e,p)),p=null},s===void 0&&o.setContentType(null),"setRequestHeader"in p&&q.forEach(o.toJSON(),function(C,w){p.setRequestHeader(w,C)}),q.isUndefined(i.withCredentials)||(p.withCredentials=!!i.withCredentials),a&&a!=="json"&&(p.responseType=i.responseType),u&&([f,g]=Ql(u,!0),p.addEventListener("progress",f)),l&&p.upload&&([d,h]=Ql(l),p.upload.addEventListener("progress",d),p.upload.addEventListener("loadend",h)),(i.cancelToken||i.signal)&&(c=S=>{p&&(r(!S||S.type?new Js(null,e,p):S),p.abort(),p=null)},i.cancelToken&&i.cancelToken.subscribe(c),i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c)));const b=JC(i.url);if(b&&Tt.protocols.indexOf(b)===-1){r(new Pe("Unsupported protocol "+b+":",Pe.ERR_BAD_REQUEST,e));return}p.send(s||null)})},l5=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const s=function(u){if(!i){i=!0,a();const c=u instanceof Error?u:this.reason;r.abort(c instanceof Pe?c:new Js(c instanceof Error?c.message:c))}};let o=t&&setTimeout(()=>{o=null,s(new Pe(`timeout ${t} of ms exceeded`,Pe.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(s):u.removeEventListener("abort",s)}),e=null)};e.forEach(u=>u.addEventListener("abort",s));const{signal:l}=r;return l.unsubscribe=()=>q.asap(a),l}},u5=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},c5=async function*(e,t){for await(const n of d5(e))yield*u5(n,t)},d5=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()}},h0=(e,t,n,r)=>{const i=c5(e,t);let s=0,o,a=l=>{o||(o=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:u,value:c}=await i.next();if(u){a(),l.close();return}let d=c.byteLength;if(n){let f=s+=d;n(f)}l.enqueue(new Uint8Array(c))}catch(u){throw a(u),u}},cancel(l){return a(l),i.return()}},{highWaterMark:2})},Mu=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Vv=Mu&&typeof ReadableStream=="function",f5=Mu&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Kv=(e,...t)=>{try{return!!e(...t)}catch(n){return!1}},h5=Vv&&Kv(()=>{let e=!1;const t=new Request(Tt.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),g0=64*1024,_d=Vv&&Kv(()=>q.isReadableStream(new Response("").body)),Yl={stream:_d&&(e=>e.body)};Mu&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Yl[t]&&(Yl[t]=q.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new Pe(`Response type '${t}' is not supported`,Pe.ERR_NOT_SUPPORT,r)})})})(new Response);const g5=async e=>{if(e==null)return 0;if(q.isBlob(e))return e.size;if(q.isSpecCompliantForm(e))return(await new Request(Tt.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(q.isArrayBufferView(e)||q.isArrayBuffer(e))return e.byteLength;if(q.isURLSearchParams(e)&&(e=e+""),q.isString(e))return(await f5(e)).byteLength},y5=async(e,t)=>{const n=q.toFiniteNumber(e.getContentLength());return n==null?g5(t):n},m5=Mu&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:s,timeout:o,onDownloadProgress:a,onUploadProgress:l,responseType:u,headers:c,withCredentials:d="same-origin",fetchOptions:f}=Gv(e);u=u?(u+"").toLowerCase():"text";let h=l5([i,s&&s.toAbortSignal()],o),g;const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let p;try{if(l&&h5&&n!=="get"&&n!=="head"&&(p=await y5(c,r))!==0){let w=new Request(t,{method:"POST",body:r,duplex:"half"}),O;if(q.isFormData(r)&&(O=w.headers.get("content-type"))&&c.setContentType(O),w.body){const[x,_]=c0(p,Ql(d0(l)));r=h0(w.body,g0,x,_)}}q.isString(d)||(d=d?"include":"omit");const v="credentials"in Request.prototype;g=new Request(t,{...f,signal:h,method:n.toUpperCase(),headers:c.normalize().toJSON(),body:r,duplex:"half",credentials:v?d:void 0});let b=await fetch(g,f);const S=_d&&(u==="stream"||u==="response");if(_d&&(a||S&&m)){const w={};["status","statusText","headers"].forEach(k=>{w[k]=b[k]});const O=q.toFiniteNumber(b.headers.get("content-length")),[x,_]=a&&c0(O,Ql(d0(a),!0))||[];b=new Response(h0(b.body,g0,x,()=>{_&&_(),m&&m()}),w)}u=u||"text";let C=await Yl[q.findKey(Yl,u)||"text"](b,e);return!S&&m&&m(),await new Promise((w,O)=>{Hv(w,O,{data:C,headers:Ht.from(b.headers),status:b.status,statusText:b.statusText,config:e,request:g})})}catch(v){throw m&&m(),v&&v.name==="TypeError"&&/Load failed|fetch/i.test(v.message)?Object.assign(new Pe("Network Error",Pe.ERR_NETWORK,e,g),{cause:v.cause||v}):Pe.from(v,v&&v.code,e,g)}}),kd={http:jC,xhr:a5,fetch:m5};q.forEach(kd,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(n){}Object.defineProperty(e,"adapterName",{value:t})}});const y0=e=>`- ${e}`,p5=e=>q.isFunction(e)||e===null||e===!1,Wv={getAdapter:e=>{e=q.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,!p5(n)&&(r=kd[(o=String(n)).toLowerCase()],r===void 0))throw new Pe(`Unknown adapter '${o}'`);if(r)break;i[o||"#"+s]=r}if(!r){const s=Object.entries(i).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=t?s.length>1?`since :
15
- `+s.map(y0).join(`
16
- `):" "+y0(s[0]):"as no adapter specified";throw new Pe("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:kd};function yc(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Js(null,e)}function m0(e){return yc(e),e.headers=Ht.from(e.headers),e.data=gc.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Wv.getAdapter(e.adapter||Na.adapter)(e).then(function(r){return yc(e),r.data=gc.call(e,e.transformResponse,r),r.headers=Ht.from(r.headers),r},function(r){return zv(r)||(yc(e),r&&r.response&&(r.response.data=gc.call(e,e.transformResponse,r.response),r.response.headers=Ht.from(r.response.headers))),Promise.reject(r)})}const Qv="1.10.0",$u={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{$u[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const p0={};$u.transitional=function(t,n,r){function i(s,o){return"[Axios v"+Qv+"] Transitional option '"+s+"'"+o+(r?". "+r:"")}return(s,o,a)=>{if(t===!1)throw new Pe(i(o," has been removed"+(n?" in "+n:"")),Pe.ERR_DEPRECATED);return n&&!p0[o]&&(p0[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}};$u.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function v5(e,t,n){if(typeof e!="object")throw new Pe("options must be an object",Pe.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 Pe("option "+s+" must be "+l,Pe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Pe("Unknown option "+s,Pe.ERR_BAD_OPTION)}}const $l={assertOptions:v5,validators:$u},Bn=$l.validators;let ji=class{constructor(t){this.defaults=t||{},this.interceptors={request:new l0,response:new l0}}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=Ii(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&$l.assertOptions(r,{silentJSONParsing:Bn.transitional(Bn.boolean),forcedJSONParsing:Bn.transitional(Bn.boolean),clarifyTimeoutError:Bn.transitional(Bn.boolean)},!1),i!=null&&(q.isFunction(i)?n.paramsSerializer={serialize:i}:$l.assertOptions(i,{encode:Bn.function,serialize:Bn.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),$l.assertOptions(n,{baseUrl:Bn.spelling("baseURL"),withXsrfToken:Bn.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&q.merge(s.common,s[n.method]);s&&q.forEach(["delete","get","head","post","put","patch","common"],g=>{delete s[g]}),n.headers=Ht.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let c,d=0,f;if(!l){const g=[m0.bind(this),void 0];for(g.unshift.apply(g,a),g.push.apply(g,u),f=g.length,c=Promise.resolve(n);d<f;)c=c.then(g[d++],g[d++]);return c}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{c=m0.call(this,h)}catch(g){return Promise.reject(g)}for(d=0,f=u.length;d<f;)c=c.then(u[d++],u[d++]);return c}getUri(t){t=Ii(this.defaults,t);const n=Uv(t.baseURL,t.url,t.allowAbsoluteUrls);return Fv(n,t.params,t.paramsSerializer)}};q.forEach(["delete","get","head","options"],function(t){ji.prototype[t]=function(n,r){return this.request(Ii(r||{},{method:t,url:n,data:(r||{}).data}))}});q.forEach(["post","put","patch"],function(t){function n(r){return function(s,o,a){return this.request(Ii(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}ji.prototype[t]=n(),ji.prototype[t+"Form"]=n(!0)});let b5=class Yv{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 Js(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 Yv(function(i){t=i}),cancel:t}}};function x5(e){return function(n){return e.apply(null,n)}}function w5(e){return q.isObject(e)&&e.isAxiosError===!0}const Od={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(Od).forEach(([e,t])=>{Od[t]=e});function Xv(e){const t=new ji(e),n=Ev(ji.prototype.request,t);return q.extend(n,ji.prototype,t,{allOwnKeys:!0}),q.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return Xv(Ii(e,i))},n}const it=Xv(Na);it.Axios=ji;it.CanceledError=Js;it.CancelToken=b5;it.isCancel=zv;it.VERSION=Qv;it.toFormData=ju;it.AxiosError=Pe;it.Cancel=it.CanceledError;it.all=function(t){return Promise.all(t)};it.spread=x5;it.isAxiosError=w5;it.mergeConfig=Ii;it.AxiosHeaders=Ht;it.formToJSON=e=>qv(q.isHTMLForm(e)?new FormData(e):e);it.getAdapter=Wv.getAdapter;it.HttpStatusCode=Od;it.default=it;const{Axios:cI,AxiosError:dI,CanceledError:fI,isCancel:hI,CancelToken:gI,VERSION:yI,all:mI,Cancel:pI,isAxiosError:vI,spread:bI,toFormData:xI,AxiosHeaders:wI,HttpStatusCode:SI,formToJSON:CI,getAdapter:_I,mergeConfig:kI}=it,S5={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};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 Dt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,g,m,p){var v=g&&g.prototype instanceof a?g:a,b=Object.create(v.prototype);return Qt(b,"_invoke",function(S,C,w){var O,x,_,k=0,E=w||[],P=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(A,j){return O=A,x=0,_=e,M.n=j,o}};function B(R,A){for(x=R,_=A,t=0;!P&&k&&!j&&t<E.length;t++){var j,L=E[t],H=M.p,Q=L[2];R>3?(j=Q===A)&&(_=L[(x=L[4])?5:(x=3,3)],L[4]=L[5]=e):L[0]<=H&&((j=R<2&&H<L[1])?(x=0,M.v=A,M.n=L[1]):H<Q&&(j=R<3||L[0]>A||A>Q)&&(L[4]=R,L[5]=A,M.n=Q,x=0))}if(j||R>1)return o;throw P=!0,A}return function(R,A,j){if(k>1)throw TypeError("Generator is already running");for(P&&A===1&&B(A,j),x=A,_=j;(t=x<2?e:_)||!P;){O||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(k=2,O){if(x||(R="next"),t=O[R]){if(!(t=t.call(O,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=O.return)&&t.call(O),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);O=e}else if((t=(P=M.n<0)?_:S.call(C,M))!==o)break}catch(L){O=e,x=1,_=L}finally{k=1}}return{value:t,done:P}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(Qt(t={},r,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,Qt(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,Qt(d,"constructor",u),Qt(u,"constructor",l),l.displayName="GeneratorFunction",Qt(u,i,"GeneratorFunction"),Qt(d),Qt(d,i,"Generator"),Qt(d,r,function(){return this}),Qt(d,"toString",function(){return"[object Generator]"}),(Dt=function(){return{w:s,m:f}})()}function Qt(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Qt=function(o,a,l,u){if(a)i?i(o,a,{value:l,enumerable:!u,configurable:!u,writable:!u}):o[a]=l;else{var c=function(f,h){Qt(o,f,function(g){return this._invoke(f,h,g)})};c("next",0),c("throw",1),c("return",2)}},Qt(e,t,n,r)}function v0(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 Mi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?v0(Object(n),!0).forEach(function(r){C5(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function C5(e,t,n){return(t=_5(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _5(e){var t=k5(e,"string");return ea(t)=="symbol"?t:t+""}function k5(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 b0(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function Ri(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){b0(s,r,i,o,a,"next",l)}function a(l){b0(s,r,i,o,a,"throw",l)}o(void 0)})}}var Zv=function(){var t;return((t=S5)===null||t===void 0?void 0:t.VITE_MYYOAST_ACCESS_TOKEN)||""};function x0(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 O5="yst-insights-token",eo=it.create({withCredentials:!0});eo.interceptors.request.use(function(){var e=Ri(Dt().m(function t(n){var r,i;return Dt().w(function(s){for(;;)switch(s.n){case 0:return s.n=1,A5();case 1:return r=s.v,s.n=2,e2();case 2:return i=s.v,n.headers=Mi(Mi(Mi({},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});eo.interceptors.response.use(function(e){return e},function(){var e=Ri(Dt().m(function t(n){var r;return Dt().w(function(i){for(;;)switch(i.n){case 0:return n==null||(r=n.response)===null||r===void 0||r.status,i.a(2,Promise.reject(n))}},t)}));return function(t){return e.apply(this,arguments)}}());function Ct(e){return Ed.apply(this,arguments)}function Ed(){return Ed=Ri(Dt().m(function e(t){var n;return Dt().w(function(r){for(;;)switch(r.n){case 0:return n=Mi({},t),delete n.baseURL,r.a(2,eo.request(Mi(Mi({},n),{},{withCredentials:!0})))}},e)})),Ed.apply(this,arguments)}function Jv(e){eo.defaults.baseURL=e}function w0(){return eo.defaults.baseURL}function E5(e){Zv=e}var ho=null;function A5(){return Ad.apply(this,arguments)}function Ad(){return Ad=Ri(Dt().m(function e(){var t,n,r,i,s;return Dt().w(function(o){for(;;)switch(o.p=o.n){case 0:if(t=Zv(),n=eo.defaults.baseURL,r=T5(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(!ho){o.n=5;break}return o.a(2,ho);case 5:return ho=Ri(Dt().m(function a(){var l,u,c,d,f;return Dt().w(function(h){for(;;)switch(h.p=h.n){case 0:return h.p=0,h.n=1,e2();case 1:return l=h.v,h.n=2,it.post(n+"/users/getToken",{},{headers:Mi({Authorization:"Bearer "+t},l?{"X-XSRF-TOKEN":l}:{}),withCredentials:!0});case 2:if(u=h.v,c=u.data,!(c!=null&&c.plainTextToken)){h.n=3;break}return sessionStorage.setItem(r,JSON.stringify({value:c.plainTextToken,validUntil:Date.parse(((d=c.accessToken)===null||d===void 0?void 0:d.expires_at)||"")||Date.now()+15*60*1e3})),h.a(2,c.plainTextToken);case 3:h.n=5;break;case 4:h.p=4,f=h.v,it.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,ho=null,h.f(5);case 6:return h.a(2,"")}},a,null,[[0,4,5,6]])}))(),o.a(2,ho)}},e,null,[[1,3]])})),Ad.apply(this,arguments)}function T5(e,t){var n=Array.from(e+t).reduce(function(r,i){return(r<<5)-r+i.charCodeAt(0)},0);return O5+":"+n}var go=null;function e2(){return Td.apply(this,arguments)}function Td(){return Td=Ri(Dt().m(function e(){var t;return Dt().w(function(n){for(;;)switch(n.n){case 0:if(window.location.hostname===new URL(w0()||window.location.href).hostname){n.n=1;break}return n.a(2,"");case 1:if(t=x0("XSRF-TOKEN"),!t){n.n=2;break}return n.a(2,decodeURIComponent(t));case 2:if(!go){n.n=3;break}return n.a(2,go);case 3:return go=Ri(Dt().m(function r(){var i;return Dt().w(function(s){for(;;)switch(s.p=s.n){case 0:return s.p=0,s.n=1,it.get(((i=w0())===null||i===void 0?void 0:i.replace("/api/v1",""))+"/sanctum/csrf-cookie",{withCredentials:!0});case 1:return s.a(2,decodeURIComponent(x0("XSRF-TOKEN")||""));case 2:return s.p=2,go=null,s.f(2);case 3:return s.a(2)}},r,null,[[0,,2,3]])}))(),n.a(2,go)}},e)})),Td.apply(this,arguments)}function ta(e){"@babel/helpers - typeof";return ta=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ta(e)}function S0(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 ke(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?S0(Object(n),!0).forEach(function(r){P5(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function P5(e,t,n){return(t=j5(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j5(e){var t=M5(e,"string");return ta(t)=="symbol"?t:t+""}function M5(e,t){if(ta(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ta(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $5=function(t,n){return Ct({url:"/brands/".concat(t,"/analysis"),method:"GET",signal:n})},Tf=function(t){return["/brands/".concat(t,"/analysis")]},L5=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:Tf(t),a=function(u){var c=u.signal;return $5(t,c)};return ke({queryKey:o,queryFn:a,enabled:!!t},s)};function t2(e,t,n){var r=L5(e,t),i=ni(r,n);return i.queryKey=r.queryKey,i}var D5=function(t,n,r){return Ct({url:"/brands/".concat(t,"/analysis/").concat(n),method:"GET",signal:r})},Xl=function(t,n){return["/brands/".concat(t,"/analysis/").concat(n)]},I5=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:Xl(t,n),l=function(c){var d=c.signal;return D5(t,n,d)};return ke({queryKey:a,queryFn:l,enabled:!!(t&&n)},o)};function Lu(e,t,n,r){var i=I5(e,t,n),s=ni(i,r);return s.queryKey=i.queryKey,s}var R5=function(t,n){return Ct({url:"/brands/".concat(t,"/analysis/").concat(n),method:"DELETE"})},N5=function(t){var n=["deleteSingleAnalysis"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:ke(ke({},t),{},{mutation:ke(ke({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},u=l.brandId,c=l.analysisId;return R5(u,c)};return ke({mutationFn:s},i)},F5=function(t,n){var r=N5(t);return Sr(r,n)},B5=function(t,n,r){return Ct({url:"/brands/".concat(t,"/analysis/").concat(n,"/status"),method:"GET",signal:r})},Pd=function(t,n){return["/brands/".concat(t,"/analysis/").concat(n,"/status")]},q5=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:Pd(t,n),l=function(c){var d=c.signal;return B5(t,n,d)};return ke({queryKey:a,queryFn:l,enabled:!!(t&&n)},o)};function z5(e,t,n,r){var i=q5(e,t,n),s=ni(i,r);return s.queryKey=i.queryKey,s}var H5=function(t){return Ct({url:"/users/logout",method:"POST",signal:t})},U5=function(t){var n=["logout"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:ke(ke({},t),{},{mutation:ke(ke({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(){return H5()};return ke({mutationFn:s},i)},G5=function(t,n){var r=U5(t);return Sr(r,n)},V5=function(t,n){return Ct({url:"/brands/".concat(t,"/associated-brands"),method:"GET",signal:n})},Zl=function(t){return["/brands/".concat(t,"/associated-brands")]},K5=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:Zl(t),a=function(u){var c=u.signal;return V5(t,c)};return ke({queryKey:o,queryFn:a,enabled:!!t},s)};function W5(e,t,n){var r=K5(e,t),i=ni(r,n);return i.queryKey=r.queryKey,i}var Q5=function(t,n,r){return Ct({url:"/brands/".concat(t,"/associated-brand-groups"),method:"POST",headers:{"Content-Type":"application/json"},data:n,signal:r})},Y5=function(t){var n=["createBrandAssociationGroup"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:ke(ke({},t),{},{mutation:ke(ke({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},u=l.brandId,c=l.data;return Q5(u,c)};return ke({mutationFn:s},i)},n2=function(t,n){var r=Y5(t);return Sr(r,n)},X5=function(t,n){return Ct({url:"/brands/".concat(t,"/associated-brand-groups/").concat(n),method:"DELETE"})},Z5=function(t){var n=["deleteBrandAssociationGroup"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:ke(ke({},t),{},{mutation:ke(ke({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},u=l.brandId,c=l.brandGroupId;return X5(u,c)};return ke({mutationFn:s},i)},J5=function(t,n){var r=Z5(t);return Sr(r,n)},e4=function(t){return Ct({url:"/brands",method:"GET",signal:t})},Yn=function(){return["/brands"]},t4=function(t){var n,r=t!=null?t:{},i=r.query,s=(n=i==null?void 0:i.queryKey)!==null&&n!==void 0?n:Yn(),o=function(l){var u=l.signal;return e4(u)};return ke({queryKey:s,queryFn:o},i)};function Vi(e,t){var n=t4(e),r=ni(n,t);return r.queryKey=n.queryKey,r}var n4=function(t,n){return Ct({url:"/brands",method:"POST",headers:{"Content-Type":"application/json"},data:t,signal:n})},r4=function(t){var n=["createBrand"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:ke(ke({},t),{},{mutation:ke(ke({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},u=l.data;return n4(u)};return ke({mutationFn:s},i)},i4=function(t,n){var r=r4(t);return Sr(r,n)},s4=function(t,n){return Ct({url:"/brands/".concat(t),method:"GET",signal:n})},Pf=function(t){return["/brands/".concat(t)]},o4=function(t,n){var r,i=n!=null?n:{},s=i.query,o=(r=s==null?void 0:s.queryKey)!==null&&r!==void 0?r:Pf(t),a=function(u){var c=u.signal;return s4(t,c)};return ke({queryKey:o,queryFn:a,enabled:!!t},s)};function Jl(e,t,n){var r=o4(e,t),i=ni(r,n);return i.queryKey=r.queryKey,i}var a4=function(t){return Ct({url:"/brands/".concat(t),method:"DELETE"})},l4=function(t){var n=["deleteBrand"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:ke(ke({},t),{},{mutation:ke(ke({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},u=l.brandId;return a4(u)};return ke({mutationFn:s},i)},u4=function(t,n){var r=l4(t);return Sr(r,n)},c4=function(t,n){return Ct({url:"/brands/".concat(t,"/settings"),method:"PATCH",headers:{"Content-Type":"application/json"},data:n})},d4=function(t){var n=["updateBrandSettings"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:ke(ke({},t),{},{mutation:ke(ke({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},u=l.brandId,c=l.data;return c4(u,c)};return ke({mutationFn:s},i)},r2=function(t,n){var r=d4(t);return Sr(r,n)},f4=function(t,n){return Ct({url:"/brands/".concat(t,"/queries"),method:"PUT",headers:{"Content-Type":"application/json"},data:n})},h4=function(t){var n=["updateBrandQueries"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:ke(ke({},t),{},{mutation:ke(ke({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},u=l.brandId,c=l.data;return f4(u,c)};return ke({mutationFn:s},i)},g4=function(t,n){var r=h4(t);return Sr(r,n)},y4=function(t,n){return Ct({url:"/brands/".concat(t,"/query-suggestions"),method:"GET",signal:n})},m4=function(t){return["/brands/".concat(t,"/query-suggestions")]},p4=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:m4(t),a=function(u){var c=u.signal;return y4(t,c)};return ke({queryKey:o,queryFn:a,enabled:!!t},s)};function v4(e,t,n){var r=p4(e,t),i=ni(r,n);return i.queryKey=r.queryKey,i}var b4=function(t){return Ct({url:"/users/current",method:"GET",signal:t})},Du=function(){return["/users/current"]},x4=function(t){var n,r=t!=null?t:{},i=r.query,s=(n=i==null?void 0:i.queryKey)!==null&&n!==void 0?n:Du(),o=function(l){var u=l.signal;return b4(u)};return ke({queryKey:s,queryFn:o},i)};function Iu(e,t){var n=x4(e),r=ni(n,t);return r.queryKey=n.queryKey,r}var w4=function(){return Ct({url:"/users/data",method:"DELETE"})},S4=function(t){var n=["deleteUserData"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:ke(ke({},t),{},{mutation:ke(ke({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(){return w4()};return ke({mutationFn:s},i)},C4=function(t,n){var r=S4(t);return Sr(r,n)},i2=z.createContext(void 0),_4=function(t){var n,r,i,s,o,a,l,u,c=t.children,d=t.brandId,f=t.analysisId,h=t.model,g=t.hostAppProps,m=g===void 0?{}:g,p=Ja("/brands/:brandId"),v=Ja("/brands/:brandId/*"),b=Ja("/brands/:brandId/analysis/:analysisId"),S=Ja("/brands/:brandId/analysis/:analysisId/*"),C=(b==null||(n=b.params)===null||n===void 0?void 0:n.brandId)||(S==null||(r=S.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),w=b!=null&&(o=b.params)!==null&&o!==void 0&&o.analysisId||S!=null&&(a=S.params)!==null&&a!==void 0&&a.analysisId?Number((b==null||(l=b.params)===null||l===void 0?void 0:l.analysisId)||(S==null||(u=S.params)===null||u===void 0?void 0:u.analysisId)):void 0,O=z.useMemo(function(){return{brandId:C||d||"",analysisId:w||f||"latest",model:h||"openai",hostAppProps:m}},[C,d,w,f,h,m]),x=z.useMemo(function(){return{data:O}},[O]);return y.jsx(i2.Provider,{value:x,children:c})},s2=z.createContext(void 0),k4=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]),u=z.useMemo(function(){return{setBrandId:o,setAnalysisId:a,setModel:l}},[o,a,l]),c=z.useMemo(function(){return{mutations:u}},[u]);return y.jsx(s2.Provider,{value:c,children:n})};function mc(e,t){return T4(e)||A4(e,t)||E4(e,t)||O4()}function O4(){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 E4(e,t){if(e){if(typeof e=="string")return C0(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)?C0(e,t):void 0}}function C0(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 A4(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function T4(e){if(Array.isArray(e))return e}var P4=function(t){var n=t.children,r=t.hostAppProps,i=r===void 0?{}:r,s=z.useState(void 0),o=mc(s,2),a=o[0],l=o[1],u=z.useState("latest"),c=mc(u,2),d=c[0],f=c[1],h=z.useState(void 0),g=mc(h,2),m=g[0],p=g[1];return y.jsx(k4,{brandId:a,setBrandId:l,analysisId:d,setAnalysisId:f,model:m,setModel:p,children:y.jsx(_4,{brandId:a,analysisId:d,model:m,hostAppProps:i,children:n})})},Rn=function(){var t=z.useContext(i2);if(t===void 0)throw new Error("useBrandAnalysisData must be used within a BrandAnalysisDataProvider");return t.data},Fa=function(){var t=z.useContext(s2);if(t===void 0)throw new Error("useBrandAnalysisMutations must be used within a BrandAnalysisMutationsProvider");return t.mutations},pc={exports:{}};/*!
12
+ Please change the parent <Route path="${b}"> to <Route path="${b==="/"?"*":`${b}/*`}">.`)}let d=Ut(),f;if(t){let b=typeof t=="string"?Ki(t):t;rt(u==="/"||((v=b.pathname)==null?void 0:v.startsWith(u)),`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 "${u}" but pathname "${b.pathname}" was given in the \`location\` prop.`),f=b}else f=d;let h=f.pathname||"/",g=h;if(u!=="/"){let b=u.replace(/^\//,"").split("/");g="/"+h.replace(/^\//,"").split("/").slice(b.length).join("/")}let m=wp(e,{pathname:g});_n(c||m!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),_n(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=Jx(m&&m.map(b=>Object.assign({},b,{params:Object.assign({},a,b.params),pathname:pr([u,i.encodeLocation?i.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?u:pr([u,i.encodeLocation?i.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),s,n,r);return t&&p?I.createElement(Fa.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...f},navigationType:"POP"}},p):p}function Qx(){let e=iw(),t=Bx(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=I.createElement(I.Fragment,null,I.createElement("p",null,"💿 Hey developer 👋"),I.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",I.createElement("code",{style:s},"ErrorBoundary")," or"," ",I.createElement("code",{style:s},"errorElement")," prop on your route.")),I.createElement(I.Fragment,null,I.createElement("h2",null,"Unexpected Application Error!"),I.createElement("h3",{style:{fontStyle:"italic"}},t),n?I.createElement("pre",{style:i},n):null,o)}var Yx=I.createElement(Qx,null),Xx=class extends I.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?I.createElement(kn.Provider,{value:this.props.routeContext},I.createElement(bf.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Zx({routeContext:e,match:t,children:n}){let r=I.useContext(Xs);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),I.createElement(kn.Provider,{value:e},n)}function Jx(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(u=>u.route.id&&(s==null?void 0:s[u.route.id])!==void 0);rt(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 u=i[l];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(a=l),u.route.id){let{loaderData:c,errors:d}=n,f=u.route.loader&&!c.hasOwnProperty(u.route.id)&&(!d||d[u.route.id]===void 0);if(u.route.lazy||f){o=!0,a>=0?i=i.slice(0,a+1):i=[i[0]];break}}}return i.reduceRight((l,u,c)=>{let d,f=!1,h=null,g=null;n&&(d=s&&u.route.id?s[u.route.id]:void 0,h=u.route.errorElement||Yx,o&&(a<0&&c===0?(Pp("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,g=null):a===c&&(f=!0,g=u.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),p=()=>{let v;return d?v=h:f?v=g:u.route.Component?v=I.createElement(u.route.Component,null):u.route.element?v=u.route.element:v=l,I.createElement(Zx,{match:u,routeContext:{outlet:l,matches:m,isDataRoute:n!=null},children:v})};return n&&(u.route.ErrorBoundary||u.route.errorElement||c===0)?I.createElement(Xx,{location:n.location,revalidation:n.revalidation,component:h,error:d,children:p(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):p()},null)}function xf(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=I.useContext(Xs);return rt(t,xf(e)),t}function tw(e){let t=I.useContext(Su);return rt(t,xf(e)),t}function nw(e){let t=I.useContext(kn);return rt(t,xf(e)),t}function wf(e){let t=nw(e),n=t.matches[t.matches.length-1];return rt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function rw(){return wf("useRouteId")}function iw(){var r;let e=I.useContext(bf),t=tw("useRouteError"),n=wf("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function sw(){let{router:e}=ew("useNavigate"),t=wf("useNavigate"),n=I.useRef(!1);return Ap(()=>{n.current=!0}),I.useCallback(async(i,s={})=>{_n(n.current,Ep),n.current&&(typeof i=="number"?e.navigate(i):await e.navigate(i,{fromRouteId:t,...s}))},[e,t])}var Bh={};function Pp(e,t,n){!t&&!Bh[e]&&(Bh[e]=!0,_n(!1,n))}I.memo(ow);function ow({routes:e,future:t,state:n}){return Tp(e,void 0,n,t)}function aw({basename:e,children:t,initialEntries:n,initialIndex:r}){let i=I.useRef();i.current==null&&(i.current=bx({initialEntries:n,initialIndex:r,v5Compat:!0}));let s=i.current,[o,a]=I.useState({action:s.action,location:s.location}),l=I.useCallback(u=>{I.startTransition(()=>a(u))},[a]);return I.useLayoutEffect(()=>s.listen(l),[s,l]),I.createElement(lw,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:s})}function bi({to:e,replace:t,state:n,relative:r}){rt(Vi(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=I.useContext(In);_n(!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}=I.useContext(kn),{pathname:o}=Ut(),a=fn(),l=vf(e,pf(s),o,r==="path"),u=JSON.stringify(l);return I.useEffect(()=>{a(JSON.parse(u),{replace:t,state:n,relative:r})},[a,u,r,t,n]),null}function Hs(e){return Vx(e.context)}function _t(e){rt(!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}){rt(!Vi(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let o=e.replace(/^\/*/,"/"),a=I.useMemo(()=>({basename:o,navigator:i,static:s,future:{}}),[o,i,s]);typeof n=="string"&&(n=Ki(n));let{pathname:l="/",search:u="",hash:c="",state:d=null,key:f="default"}=n,h=I.useMemo(()=>{let g=wr(l,o);return g==null?null:{location:{pathname:g,search:u,hash:c,state:d,key:f},navigationType:r}},[o,l,u,c,d,f,r]);return _n(h!=null,`<Router basename="${o}"> is not able to match the URL "${l}${u}${c}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:I.createElement(In.Provider,{value:a},I.createElement(Fa.Provider,{children:t,value:h}))}function uw({children:e,location:t}){return Wx(Zc(e),t)}function Zc(e,t=[]){let n=[];return I.Children.forEach(e,(r,i)=>{if(!I.isValidElement(r))return;let s=[...t,i];if(r.type===I.Fragment){n.push.apply(n,Zc(r.props.children,s));return}rt(r.type===_t,`[${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>`),rt(!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=Zc(r.props.children,s)),n.push(o)}),n}var jl="get",Ml="application/x-www-form-urlencoded";function _u(e){return e!=null&&typeof e.tagName=="string"}function cw(e){return _u(e)&&e.tagName.toLowerCase()==="button"}function dw(e){return _u(e)&&e.tagName.toLowerCase()==="form"}function fw(e){return _u(e)&&e.tagName.toLowerCase()==="input"}function hw(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function gw(e,t){return e.button===0&&(!t||t==="_self")&&!hw(e)}var il=null;function yw(){if(il===null)try{new FormData(document.createElement("form"),0),il=!1}catch(e){il=!0}return il}var mw=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function uc(e){return e!=null&&!mw.has(e)?(_n(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ml}"`),null):e}function pw(e,t){let n,r,i,s,o;if(dw(e)){let a=e.getAttribute("action");r=a?wr(a,t):null,n=e.getAttribute("method")||jl,i=uc(e.getAttribute("enctype"))||Ml,s=new FormData(e)}else if(cw(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?wr(l,t):null,n=e.getAttribute("formmethod")||a.getAttribute("method")||jl,i=uc(e.getAttribute("formenctype"))||uc(a.getAttribute("enctype"))||Ml,s=new FormData(a,e),!yw()){let{name:u,type:c,value:d}=e;if(c==="image"){let f=u?`${u}.`:"";s.append(`${f}x`,"0"),s.append(`${f}y`,"0")}else u&&s.append(u,d)}}else{if(_u(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=jl,r=null,i=Ml,o=e}return s&&i==="text/plain"&&(o=s,s=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:s,body:o}}function Sf(e,t){if(e===!1||e===null||typeof e=="undefined")throw new Error(t)}async function vw(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 bw(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function xw(e,t,n){let r=await Promise.all(e.map(async i=>{let s=t.routes[i.route.id];if(s){let o=await vw(s,n);return o.links?o.links():[]}return[]}));return _w(r.flat(1).filter(bw).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function qh(e,t,n,r,i,s){let o=(l,u)=>n[u]?l.route.id!==n[u].route.id:!0,a=(l,u)=>{var c;return n[u].pathname!==l.pathname||((c=n[u].route.path)==null?void 0:c.endsWith("*"))&&n[u].params["*"]!==l.params["*"]};return s==="assets"?t.filter((l,u)=>o(l,u)||a(l,u)):s==="data"?t.filter((l,u)=>{var d;let c=r.routes[l.route.id];if(!c||!c.hasLoader)return!1;if(o(l,u)||a(l,u))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 Sw(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 Sw(e){return[...new Set(e)]}function Cw(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function _w(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let s=JSON.stringify(Cw(i));return n.has(s)||(n.add(s),r.push({key:s,link:i})),r},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var kw=new Set([100,101,204,205]);function Ow(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&&wr(n.pathname,t)==="/"?n.pathname=`${t.replace(/\/$/,"")}/_root.data`:n.pathname=`${n.pathname.replace(/\/$/,"")}.data`,n}function jp(){let e=I.useContext(Xs);return Sf(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Ew(){let e=I.useContext(Su);return Sf(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Cf=I.createContext(void 0);Cf.displayName="FrameworkContext";function Mp(){let e=I.useContext(Cf);return Sf(e,"You must render this element inside a <HydratedRouter> element"),e}function Aw(e,t){let n=I.useContext(Cf),[r,i]=I.useState(!1),[s,o]=I.useState(!1),{onFocus:a,onBlur:l,onMouseEnter:u,onMouseLeave:c,onTouchStart:d}=t,f=I.useRef(null);I.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]),I.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:go(a,h),onBlur:go(l,g),onMouseEnter:go(u,h),onMouseLeave:go(c,g),onTouchStart:go(d,h)}]:[!1,f,{}]}function go(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Tw({page:e,...t}){let{router:n}=jp(),r=I.useMemo(()=>wp(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?I.createElement(jw,{page:e,matches:r,...t}):null}function Pw(e){let{manifest:t,routeModules:n}=Mp(),[r,i]=I.useState([]);return I.useEffect(()=>{let s=!1;return xw(e,t,n).then(o=>{s||i(o)}),()=>{s=!0}},[e,t,n]),r}function jw({page:e,matches:t,...n}){let r=Ut(),{manifest:i,routeModules:s}=Mp(),{basename:o}=jp(),{loaderData:a,matches:l}=Ew(),u=I.useMemo(()=>qh(e,t,l,i,r,"data"),[e,t,l,i,r]),c=I.useMemo(()=>qh(e,t,l,i,r,"assets"),[e,t,l,i,r]),d=I.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let g=new Set,m=!1;if(t.forEach(v=>{var S;let b=i.routes[v.route.id];!b||!b.hasLoader||(!u.some(C=>C.route.id===v.route.id)&&v.route.id in a&&((S=s[v.route.id])!=null&&S.shouldRevalidate)||b.hasClientLoader?m=!0:g.add(v.route.id))}),g.size===0)return[];let p=Ow(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,u,t,e,s]),f=I.useMemo(()=>ww(c,i),[c,i]),h=Pw(c);return I.createElement(I.Fragment,null,d.map(g=>I.createElement("link",{key:g,rel:"prefetch",as:"fetch",href:g,...n})),f.map(g=>I.createElement("link",{key:g,rel:"modulepreload",href:g,...n})),h.map(({key:g,link:m})=>I.createElement("link",{key:g,...m})))}function Mw(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var $p=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined";try{$p&&(window.__reactRouterVersion="7.6.3")}catch(e){}var Lp=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ii=I.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:s,replace:o,state:a,target:l,to:u,preventScrollReset:c,viewTransition:d,...f},h){let{basename:g}=I.useContext(In),m=typeof u=="string"&&Lp.test(u),p,v=!1;if(typeof u=="string"&&m&&(p=u,$p))try{let k=new URL(window.location.href),E=u.startsWith("//")?new URL(k.protocol+u):new URL(u),j=wr(E.pathname,g);E.origin===k.origin&&j!=null?u=j+E.search+E.hash:v=!0}catch(k){_n(!1,`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let b=Ux(u,{relative:i}),[S,C,w]=Aw(r,f),O=Iw(u,{replace:o,state:a,target:l,preventScrollReset:c,relative:i,viewTransition:d});function x(k){t&&t(k),k.defaultPrevented||O(k)}let _=I.createElement("a",{...f,...w,href:p||b,onClick:v||s?t:x,ref:Mw(h,C),target:l,"data-discover":!m&&n==="render"?"true":void 0});return S&&!m?I.createElement(I.Fragment,null,_,I.createElement(Tw,{page:b})):_});ii.displayName="Link";var $w=I.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:s,to:o,viewTransition:a,children:l,...u},c){let d=Ba(o,{relative:u.relative}),f=Ut(),h=I.useContext(Su),{navigator:g,basename:m}=I.useContext(In),p=h!=null&&qw(d)&&a===!0,v=g.encodeLocation?g.encodeLocation(d).pathname:d.pathname,b=f.pathname,S=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;n||(b=b.toLowerCase(),S=S?S.toLowerCase():null,v=v.toLowerCase()),S&&m&&(S=wr(S,m)||S);const C=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let w=b===v||!i&&b.startsWith(v)&&b.charAt(C)==="/",O=S!=null&&(S===v||!i&&S.startsWith(v)&&S.charAt(v.length)==="/"),x={isActive:w,isPending:O,isTransitioning:p},_=w?t:void 0,k;typeof r=="function"?k=r(x):k=[r,w?"active":null,O?"pending":null,p?"transitioning":null].filter(Boolean).join(" ");let E=typeof s=="function"?s(x):s;return I.createElement(ii,{...u,"aria-current":_,className:k,ref:c,style:E,to:o,viewTransition:a},typeof l=="function"?l(x):l)});$w.displayName="NavLink";var Lw=I.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:s,method:o=jl,action:a,onSubmit:l,relative:u,preventScrollReset:c,viewTransition:d,...f},h)=>{let g=Fw(),m=Bw(a,{relative:u}),p=o.toLowerCase()==="get"?"get":"post",v=typeof a=="string"&&Lp.test(a),b=S=>{if(l&&l(S),S.defaultPrevented)return;S.preventDefault();let C=S.nativeEvent.submitter,w=(C==null?void 0:C.getAttribute("formmethod"))||o;g(C||S.currentTarget,{fetcherKey:t,method:w,navigate:n,replace:i,state:s,relative:u,preventScrollReset:c,viewTransition:d})};return I.createElement("form",{ref:h,method:p,action:m,onSubmit:r?l:b,...f,"data-discover":!v&&e==="render"?"true":void 0})});Lw.displayName="Form";function Dw(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Dp(e){let t=I.useContext(Xs);return rt(t,Dw(e)),t}function Iw(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:s,viewTransition:o}={}){let a=fn(),l=Ut(),u=Ba(e,{relative:s});return I.useCallback(c=>{if(gw(c,t)){c.preventDefault();let d=n!==void 0?n:Hl(l)===Hl(u);a(e,{replace:d,state:r,preventScrollReset:i,relative:s,viewTransition:o})}},[l,a,u,n,r,t,e,i,s,o])}var Rw=0,Nw=()=>`__${String(++Rw)}__`;function Fw(){let{router:e}=Dp("useSubmit"),{basename:t}=I.useContext(In),n=rw();return I.useCallback(async(r,i={})=>{let{action:s,method:o,encType:a,formData:l,body:u}=pw(r,t);if(i.navigate===!1){let c=i.fetcherKey||Nw();await e.fetch(c,n,i.action||s,{preventScrollReset:i.preventScrollReset,formData:l,body:u,formMethod:i.method||o,formEncType:i.encType||a,flushSync:i.flushSync})}else await e.navigate(i.action||s,{preventScrollReset:i.preventScrollReset,formData:l,body:u,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 Bw(e,{relative:t}={}){let{basename:n}=I.useContext(In),r=I.useContext(kn);rt(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),s={...Ba(e||".",{relative:t})},o=Ut();if(e==null){s.search=o.search;let a=new URLSearchParams(s.search),l=a.getAll("index");if(l.some(c=>c==="")){a.delete("index"),l.filter(d=>d).forEach(d=>a.append("index",d));let c=a.toString();s.search=c?`?${c}`:""}}return(!e||e===".")&&i.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:pr([n,s.pathname])),Hl(s)}function qw(e,t={}){let n=I.useContext(Op);rt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Dp("useViewTransitionState"),i=Ba(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=wr(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=wr(n.nextLocation.pathname,r)||n.nextLocation.pathname;return zs(i.pathname,o)!=null||zs(i.pathname,s)!=null}[...kw];var Zs=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(){}},Ri=typeof window=="undefined"||"Deno"in globalThis;function Lt(){}function zw(e,t){return typeof e=="function"?e(t):e}function Jc(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ip(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Qr(e,t){return typeof e=="function"?e(t):e}function bn(e,t){return typeof e=="function"?e(t):e}function zh(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o){if(r){if(t.queryHash!==_f(o,t.options))return!1}else if(!Xo(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 Hh(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Ni(t.options.mutationKey)!==Ni(s))return!1}else if(!Xo(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function _f(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ni)(e)}function Ni(e){return JSON.stringify(e,(t,n)=>td(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Xo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Xo(e[n],t[n])):!1}function ed(e,t){if(e===t)return e;const n=Uh(e)&&Uh(t);if(n||td(e)&&td(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 u=0;for(let c=0;c<o;c++){const d=n?c:s[c];(!n&&l.has(d)||n)&&e[d]===void 0&&t[d]===void 0?(a[d]=void 0,u++):(a[d]=ed(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&u++)}return i===o&&u===i?e:a}return t}function Ul(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 Uh(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function td(e){if(!Gh(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Gh(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Gh(e){return Object.prototype.toString.call(e)==="[object Object]"}function Hw(e){return new Promise(t=>{setTimeout(t,e)})}function nd(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 ed(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 ed(e,t)}return t}function Uw(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Gw(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Gl=Symbol();function Rp(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Gl&&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===Gl?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Np(e,t){return typeof e=="function"?e(...t):!!e}var Ci,Dr,ys,lp,Kw=(lp=class extends Zs{constructor(){super();de(this,Ci);de(this,Dr);de(this,ys);Z(this,ys,t=>{if(!Ri&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){$(this,Dr)||this.setEventListener($(this,ys))}onUnsubscribe(){var t;this.hasListeners()||((t=$(this,Dr))==null||t.call(this),Z(this,Dr,void 0))}setEventListener(t){var n;Z(this,ys,t),(n=$(this,Dr))==null||n.call(this),Z(this,Dr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){$(this,Ci)!==t&&(Z(this,Ci,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof $(this,Ci)=="boolean"?$(this,Ci):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ci=new WeakMap,Dr=new WeakMap,ys=new WeakMap,lp),kf=new Kw,ms,Ir,ps,up,Vw=(up=class extends Zs{constructor(){super();de(this,ms,!0);de(this,Ir);de(this,ps);Z(this,ps,t=>{if(!Ri&&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(){$(this,Ir)||this.setEventListener($(this,ps))}onUnsubscribe(){var t;this.hasListeners()||((t=$(this,Ir))==null||t.call(this),Z(this,Ir,void 0))}setEventListener(t){var n;Z(this,ps,t),(n=$(this,Ir))==null||n.call(this),Z(this,Ir,t(this.setOnline.bind(this)))}setOnline(t){$(this,ms)!==t&&(Z(this,ms,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return $(this,ms)}},ms=new WeakMap,Ir=new WeakMap,ps=new WeakMap,up),Us=new Vw;function rd(){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 Ww(e){return Math.min(1e3*2**e,3e4)}function Fp(e){return(e!=null?e:"online")==="online"?Us.isOnline():!0}var Bp=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function cc(e){return e instanceof Bp}function qp(e){let t=!1,n=0,r=!1,i;const s=rd(),o=m=>{var p;r||(f(new Bp(m)),(p=e.abort)==null||p.call(e))},a=()=>{t=!0},l=()=>{t=!1},u=()=>kf.isFocused()&&(e.networkMode==="always"||Us.isOnline())&&e.canRun(),c=()=>Fp(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||u())&&m(v)},(p=e.onPause)==null||p.call(e)}).then(()=>{var m;i=void 0,r||(m=e.onContinue)==null||m.call(e)}),g=()=>{if(r)return;let m;const p=n===0?e.initialPromise:void 0;try{m=p!=null?p:e.fn()}catch(v){m=Promise.reject(v)}Promise.resolve(m).then(d).catch(v=>{var O,x,_;if(r)return;const b=(O=e.retry)!=null?O:Ri?0:3,S=(x=e.retryDelay)!=null?x:Ww,C=typeof S=="function"?S(n,v):S,w=b===!0||typeof b=="number"&&n<b||typeof b=="function"&&b(n,v);if(t||!w){f(v);return}n++,(_=e.onFail)==null||_.call(e,n,v),Hw(C).then(()=>u()?void 0:h()).then(()=>{t?f(v):g()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:a,continueRetry:l,canStart:c,start:()=>(c()?g():h().then(g),s)}}var Qw=e=>setTimeout(e,0);function Yw(){let e=[],t=0,n=a=>{a()},r=a=>{a()},i=Qw;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 yt=Yw(),_i,cp,zp=(cp=class{constructor(){de(this,_i)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Jc(this.gcTime)&&Z(this,_i,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e!=null?e:Ri?1/0:5*60*1e3)}clearGcTimeout(){$(this,_i)&&(clearTimeout($(this,_i)),Z(this,_i,void 0))}},_i=new WeakMap,cp),vs,ki,vn,Oi,kt,ka,Ei,Pn,ar,dp,Xw=(dp=class extends zp{constructor(t){var n;super();de(this,Pn);de(this,vs);de(this,ki);de(this,vn);de(this,Oi);de(this,kt);de(this,ka);de(this,Ei);Z(this,Ei,!1),Z(this,ka,t.defaultOptions),this.setOptions(t.options),this.observers=[],Z(this,Oi,t.client),Z(this,vn,$(this,Oi).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Z(this,vs,Zw(this.options)),this.state=(n=t.state)!=null?n:$(this,vs),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=$(this,kt))==null?void 0:t.promise}setOptions(t){this.options={...$(this,ka),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&$(this,vn).remove(this)}setData(t,n){const r=nd(this.state.data,t,this.options);return je(this,Pn,ar).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){je(this,Pn,ar).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=$(this,kt))==null?void 0:r.promise;return(i=$(this,kt))==null||i.cancel(t),n?n.then(Lt).catch(Lt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState($(this,vs))}isActive(){return this.observers.some(t=>bn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Gl||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Qr(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Ip(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=$(this,kt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=$(this,kt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),$(this,vn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||($(this,kt)&&($(this,Ei)?$(this,kt).cancel({revert:!0}):$(this,kt).cancelRetry()),this.scheduleGc()),$(this,vn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||je(this,Pn,ar).call(this,{type:"invalidate"})}fetch(t,n){var u,c,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if($(this,kt))return $(this,kt).continueRetry(),$(this,kt).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:()=>(Z(this,Ei,!0),r.signal)})},s=()=>{const f=Rp(this.options,n),g=(()=>{const m={client:$(this,Oi),queryKey:this.queryKey,meta:this.meta};return i(m),m})();return Z(this,Ei,!1),this.options.persister?this.options.persister(f,g,this):f(g)},a=(()=>{const f={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:$(this,Oi),state:this.state,fetchFn:s};return i(f),f})();(u=this.options.behavior)==null||u.onFetch(a,this),Z(this,ki,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&je(this,Pn,ar).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta});const l=f=>{var h,g,m,p;cc(f)&&f.silent||je(this,Pn,ar).call(this,{type:"error",error:f}),cc(f)||((g=(h=$(this,vn).config).onError)==null||g.call(h,f,this),(p=(m=$(this,vn).config).onSettled)==null||p.call(m,this.state.data,f,this)),this.scheduleGc()};return Z(this,kt,qp({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=$(this,vn).config).onSuccess)==null||g.call(h,f,this),(p=(m=$(this,vn).config).onSettled)==null||p.call(m,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,h)=>{je(this,Pn,ar).call(this,{type:"failed",failureCount:f,error:h})},onPause:()=>{je(this,Pn,ar).call(this,{type:"pause"})},onContinue:()=>{je(this,Pn,ar).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),$(this,kt).start()}},vs=new WeakMap,ki=new WeakMap,vn=new WeakMap,Oi=new WeakMap,kt=new WeakMap,ka=new WeakMap,Ei=new WeakMap,Pn=new WeakSet,ar=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,...Hp(r.data,this.options),fetchMeta:(i=t.meta)!=null?i:null};case"success":return Z(this,ki,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 cc(o)&&o.revert&&$(this,ki)?{...$(this,ki),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),yt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),$(this,vn).notify({query:this,type:"updated",action:t})})},dp);function Hp(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Fp(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Zw(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 Wn,fp,Jw=(fp=class extends Zs{constructor(t={}){super();de(this,Wn);this.config=t,Z(this,Wn,new Map)}build(t,n,r){var a;const i=n.queryKey,s=(a=n.queryHash)!=null?a:_f(i,n);let o=this.get(s);return o||(o=new Xw({client:t,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){$(this,Wn).has(t.queryHash)||($(this,Wn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=$(this,Wn).get(t.queryHash);n&&(t.destroy(),n===t&&$(this,Wn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){yt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return $(this,Wn).get(t)}getAll(){return[...$(this,Wn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>zh(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>zh(t,r)):n}notify(t){yt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){yt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){yt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Wn=new WeakMap,fp),Qn,Mt,Ai,Yn,Lr,hp,e3=(hp=class extends zp{constructor(t){super();de(this,Yn);de(this,Qn);de(this,Mt);de(this,Ai);this.mutationId=t.mutationId,Z(this,Mt,t.mutationCache),Z(this,Qn,[]),this.state=t.state||Up(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){$(this,Qn).includes(t)||($(this,Qn).push(t),this.clearGcTimeout(),$(this,Mt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Z(this,Qn,$(this,Qn).filter(n=>n!==t)),this.scheduleGc(),$(this,Mt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){$(this,Qn).length||(this.state.status==="pending"?this.scheduleGc():$(this,Mt).remove(this))}continue(){var t,n;return(n=(t=$(this,Ai))==null?void 0:t.continue())!=null?n:this.execute(this.state.variables)}async execute(t){var s,o,a,l,u,c,d,f,h,g,m,p,v,b,S,C,w,O,x,_,k;const n=()=>{je(this,Yn,Lr).call(this,{type:"continue"})};Z(this,Ai,qp({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(E,j)=>{je(this,Yn,Lr).call(this,{type:"failed",failureCount:E,error:j})},onPause:()=>{je(this,Yn,Lr).call(this,{type:"pause"})},onContinue:n,retry:(s=this.options.retry)!=null?s:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>$(this,Mt).canRun(this)}));const r=this.state.status==="pending",i=!$(this,Ai).canStart();try{if(r)n();else{je(this,Yn,Lr).call(this,{type:"pending",variables:t,isPaused:i}),await((a=(o=$(this,Mt).config).onMutate)==null?void 0:a.call(o,t,this));const j=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,t));j!==this.state.context&&je(this,Yn,Lr).call(this,{type:"pending",context:j,variables:t,isPaused:i})}const E=await $(this,Ai).start();return await((d=(c=$(this,Mt).config).onSuccess)==null?void 0:d.call(c,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=$(this,Mt).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)),je(this,Yn,Lr).call(this,{type:"success",data:E}),E}catch(E){try{throw await((S=(b=$(this,Mt).config).onError)==null?void 0:S.call(b,E,t,this.state.context,this)),await((w=(C=this.options).onError)==null?void 0:w.call(C,E,t,this.state.context)),await((x=(O=$(this,Mt).config).onSettled)==null?void 0:x.call(O,void 0,E,this.state.variables,this.state.context,this)),await((k=(_=this.options).onSettled)==null?void 0:k.call(_,void 0,E,t,this.state.context)),E}finally{je(this,Yn,Lr).call(this,{type:"error",error:E})}}finally{$(this,Mt).runNext(this)}}},Qn=new WeakMap,Mt=new WeakMap,Ai=new WeakMap,Yn=new WeakSet,Lr=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),yt.batch(()=>{$(this,Qn).forEach(r=>{r.onMutationUpdate(t)}),$(this,Mt).notify({mutation:this,type:"updated",action:t})})},hp);function Up(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var fr,jn,Oa,gp,t3=(gp=class extends Zs{constructor(t={}){super();de(this,fr);de(this,jn);de(this,Oa);this.config=t,Z(this,fr,new Set),Z(this,jn,new Map),Z(this,Oa,0)}build(t,n,r){const i=new e3({mutationCache:this,mutationId:++nl(this,Oa)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){$(this,fr).add(t);const n=sl(t);if(typeof n=="string"){const r=$(this,jn).get(n);r?r.push(t):$(this,jn).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if($(this,fr).delete(t)){const n=sl(t);if(typeof n=="string"){const r=$(this,jn).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&$(this,jn).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=sl(t);if(typeof n=="string"){const r=$(this,jn).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=sl(t);if(typeof n=="string"){const s=(r=$(this,jn).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(){yt.batch(()=>{$(this,fr).forEach(t=>{this.notify({type:"removed",mutation:t})}),$(this,fr).clear(),$(this,jn).clear()})}getAll(){return Array.from($(this,fr))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Hh(n,r))}findAll(t={}){return this.getAll().filter(n=>Hh(t,n))}notify(t){yt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return yt.batch(()=>Promise.all(t.map(n=>n.continue().catch(Lt))))}},fr=new WeakMap,jn=new WeakMap,Oa=new WeakMap,gp);function sl(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Kh(e){return{onFetch:(t,n)=>{var c,d,f,h,g;const r=t.options,i=(f=(d=(c=t.fetchOptions)==null?void 0:c.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 u=async()=>{var S;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=Rp(t.options,t.fetchOptions),b=async(C,w,O)=>{if(m)return Promise.reject();if(w==null&&C.pages.length)return Promise.resolve(C);const _=(()=>{const M={client:t.client,queryKey:t.queryKey,pageParam:w,direction:O?"backward":"forward",meta:t.options.meta};return p(M),M})(),k=await v(_),{maxPages:E}=t.options,j=O?Gw:Uw;return{pages:j(C.pages,k,E),pageParams:j(C.pageParams,w,E)}};if(i&&s.length){const C=i==="backward",w=C?n3:Vh,O={pages:s,pageParams:o},x=w(r,O);a=await b(O,x,C)}else{const C=e!=null?e:s.length;do{const w=l===0?(S=o[0])!=null?S:r.initialPageParam:Vh(r,a);if(l>0&&w==null)break;a=await b(a,w),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,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function Vh(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 n3(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var ut,Rr,Nr,bs,xs,Fr,ws,Ss,yp,r3=(yp=class{constructor(e={}){de(this,ut);de(this,Rr);de(this,Nr);de(this,bs);de(this,xs);de(this,Fr);de(this,ws);de(this,Ss);Z(this,ut,e.queryCache||new Jw),Z(this,Rr,e.mutationCache||new t3),Z(this,Nr,e.defaultOptions||{}),Z(this,bs,new Map),Z(this,xs,new Map),Z(this,Fr,0)}mount(){nl(this,Fr)._++,$(this,Fr)===1&&(Z(this,ws,kf.subscribe(async e=>{e&&(await this.resumePausedMutations(),$(this,ut).onFocus())})),Z(this,Ss,Us.subscribe(async e=>{e&&(await this.resumePausedMutations(),$(this,ut).onOnline())})))}unmount(){var e,t;nl(this,Fr)._--,$(this,Fr)===0&&((e=$(this,ws))==null||e.call(this),Z(this,ws,void 0),(t=$(this,Ss))==null||t.call(this),Z(this,Ss,void 0))}isFetching(e){return $(this,ut).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return $(this,Rr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=$(this,ut).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=$(this,ut).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Qr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return $(this,ut).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=$(this,ut).get(r.queryHash),s=i==null?void 0:i.state.data,o=zw(t,s);if(o!==void 0)return $(this,ut).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return yt.batch(()=>$(this,ut).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=$(this,ut).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=$(this,ut);yt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=$(this,ut);return yt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=yt.batch(()=>$(this,ut).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Lt).catch(Lt)}invalidateQueries(e,t={}){return yt.batch(()=>{var n,r;return $(this,ut).findAll(e).forEach(i=>{i.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(r=(n=e==null?void 0:e.refetchType)!=null?n:e==null?void 0:e.type)!=null?r:"active"},t)})}refetchQueries(e,t={}){var i;const n={...t,cancelRefetch:(i=t.cancelRefetch)!=null?i:!0},r=yt.batch(()=>$(this,ut).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch(Lt)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Lt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=$(this,ut).build(this,t);return n.isStaleByTime(Qr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Lt).catch(Lt)}fetchInfiniteQuery(e){return e.behavior=Kh(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Lt).catch(Lt)}ensureInfiniteQueryData(e){return e.behavior=Kh(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Us.isOnline()?$(this,Rr).resumePausedMutations():Promise.resolve()}getQueryCache(){return $(this,ut)}getMutationCache(){return $(this,Rr)}getDefaultOptions(){return $(this,Nr)}setDefaultOptions(e){Z(this,Nr,e)}setQueryDefaults(e,t){$(this,bs).set(Ni(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...$(this,bs).values()],n={};return t.forEach(r=>{Xo(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){$(this,xs).set(Ni(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...$(this,xs).values()],n={};return t.forEach(r=>{Xo(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...$(this,Nr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=_f(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===Gl&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...$(this,Nr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){$(this,ut).clear(),$(this,Rr).clear()}},ut=new WeakMap,Rr=new WeakMap,Nr=new WeakMap,bs=new WeakMap,xs=new WeakMap,Fr=new WeakMap,ws=new WeakMap,Ss=new WeakMap,yp),Nt,De,Ea,$t,Ti,Cs,Br,qr,Aa,_s,ks,Pi,ji,zr,Os,Ke,jo,id,sd,od,ad,ld,ud,cd,Gp,mp,i3=(mp=class extends Zs{constructor(t,n){super();de(this,Ke);de(this,Nt);de(this,De);de(this,Ea);de(this,$t);de(this,Ti);de(this,Cs);de(this,Br);de(this,qr);de(this,Aa);de(this,_s);de(this,ks);de(this,Pi);de(this,ji);de(this,zr);de(this,Os,new Set);this.options=n,Z(this,Nt,t),Z(this,qr,null),Z(this,Br,rd()),this.options.experimental_prefetchInRender||$(this,Br).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&&($(this,De).addObserver(this),Wh($(this,De),this.options)?je(this,Ke,jo).call(this):this.updateResult(),je(this,Ke,ad).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return dd($(this,De),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return dd($(this,De),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,je(this,Ke,ld).call(this),je(this,Ke,ud).call(this),$(this,De).removeObserver(this)}setOptions(t){const n=this.options,r=$(this,De);if(this.options=$(this,Nt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof bn(this.options.enabled,$(this,De))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");je(this,Ke,cd).call(this),$(this,De).setOptions(this.options),n._defaulted&&!Ul(this.options,n)&&$(this,Nt).getQueryCache().notify({type:"observerOptionsUpdated",query:$(this,De),observer:this});const i=this.hasListeners();i&&Qh($(this,De),r,this.options,n)&&je(this,Ke,jo).call(this),this.updateResult(),i&&($(this,De)!==r||bn(this.options.enabled,$(this,De))!==bn(n.enabled,$(this,De))||Qr(this.options.staleTime,$(this,De))!==Qr(n.staleTime,$(this,De)))&&je(this,Ke,id).call(this);const s=je(this,Ke,sd).call(this);i&&($(this,De)!==r||bn(this.options.enabled,$(this,De))!==bn(n.enabled,$(this,De))||s!==$(this,zr))&&je(this,Ke,od).call(this,s)}getOptimisticResult(t){const n=$(this,Nt).getQueryCache().build($(this,Nt),t),r=this.createResult(n,t);return o3(this,r)&&(Z(this,$t,r),Z(this,Cs,this.options),Z(this,Ti,$(this,De).state)),r}getCurrentResult(){return $(this,$t)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),Reflect.get(r,i))})}trackProp(t){$(this,Os).add(t)}getCurrentQuery(){return $(this,De)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=$(this,Nt).defaultQueryOptions(t),r=$(this,Nt).getQueryCache().build($(this,Nt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){var n;return je(this,Ke,jo).call(this,{...t,cancelRefetch:(n=t.cancelRefetch)!=null?n:!0}).then(()=>(this.updateResult(),$(this,$t)))}createResult(t,n){var k;const r=$(this,De),i=this.options,s=$(this,$t),o=$(this,Ti),a=$(this,Cs),u=t!==r?t.state:$(this,Ea),{state:c}=t;let d={...c},f=!1,h;if(n._optimisticResults){const E=this.hasListeners(),j=!E&&Wh(t,n),M=E&&Qh(t,r,n,i);(j||M)&&(d={...d,...Hp(c.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:g,errorUpdatedAt:m,status:p}=d;h=d.data;let v=!1;if(n.placeholderData!==void 0&&h===void 0&&p==="pending"){let E;s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(E=s.data,v=!0):E=typeof n.placeholderData=="function"?n.placeholderData((k=$(this,ks))==null?void 0:k.state.data,$(this,ks)):n.placeholderData,E!==void 0&&(p="success",h=nd(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===$(this,Aa))h=$(this,_s);else try{Z(this,Aa,n.select),h=n.select(h),h=nd(s==null?void 0:s.data,h,n),Z(this,_s,h),Z(this,qr,null)}catch(E){Z(this,qr,E)}$(this,qr)&&(g=$(this,qr),h=$(this,_s),m=Date.now(),p="error");const b=d.fetchStatus==="fetching",S=p==="pending",C=p==="error",w=S&&b,O=h!==void 0,_={status:p,fetchStatus:d.fetchStatus,isPending:S,isSuccess:p==="success",isError:C,isInitialLoading:w,isLoading:w,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>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:b,isRefetching:b&&!S,isLoadingError:C&&!O,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:C&&O,isStale:Of(t,n),refetch:this.refetch,promise:$(this,Br),isEnabled:bn(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const E=B=>{_.status==="error"?B.reject(_.error):_.data!==void 0&&B.resolve(_.data)},j=()=>{const B=Z(this,Br,_.promise=rd());E(B)},M=$(this,Br);switch(M.status){case"pending":t.queryHash===r.queryHash&&E(M);break;case"fulfilled":(_.status==="error"||_.data!==M.value)&&j();break;case"rejected":(_.status!=="error"||_.error!==M.reason)&&j();break}}return _}updateResult(){const t=$(this,$t),n=this.createResult($(this,De),this.options);if(Z(this,Ti,$(this,De).state),Z(this,Cs,this.options),$(this,Ti).data!==void 0&&Z(this,ks,$(this,De)),Ul(n,t))return;Z(this,$t,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!$(this,Os).size)return!0;const o=new Set(s!=null?s:$(this,Os));return this.options.throwOnError&&o.add("error"),Object.keys($(this,$t)).some(a=>{const l=a;return $(this,$t)[l]!==t[l]&&o.has(l)})};je(this,Ke,Gp).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&je(this,Ke,ad).call(this)}},Nt=new WeakMap,De=new WeakMap,Ea=new WeakMap,$t=new WeakMap,Ti=new WeakMap,Cs=new WeakMap,Br=new WeakMap,qr=new WeakMap,Aa=new WeakMap,_s=new WeakMap,ks=new WeakMap,Pi=new WeakMap,ji=new WeakMap,zr=new WeakMap,Os=new WeakMap,Ke=new WeakSet,jo=function(t){je(this,Ke,cd).call(this);let n=$(this,De).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Lt)),n},id=function(){je(this,Ke,ld).call(this);const t=Qr(this.options.staleTime,$(this,De));if(Ri||$(this,$t).isStale||!Jc(t))return;const r=Ip($(this,$t).dataUpdatedAt,t)+1;Z(this,Pi,setTimeout(()=>{$(this,$t).isStale||this.updateResult()},r))},sd=function(){var t;return(t=typeof this.options.refetchInterval=="function"?this.options.refetchInterval($(this,De)):this.options.refetchInterval)!=null?t:!1},od=function(t){je(this,Ke,ud).call(this),Z(this,zr,t),!(Ri||bn(this.options.enabled,$(this,De))===!1||!Jc($(this,zr))||$(this,zr)===0)&&Z(this,ji,setInterval(()=>{(this.options.refetchIntervalInBackground||kf.isFocused())&&je(this,Ke,jo).call(this)},$(this,zr)))},ad=function(){je(this,Ke,id).call(this),je(this,Ke,od).call(this,je(this,Ke,sd).call(this))},ld=function(){$(this,Pi)&&(clearTimeout($(this,Pi)),Z(this,Pi,void 0))},ud=function(){$(this,ji)&&(clearInterval($(this,ji)),Z(this,ji,void 0))},cd=function(){const t=$(this,Nt).getQueryCache().build($(this,Nt),this.options);if(t===$(this,De))return;const n=$(this,De);Z(this,De,t),Z(this,Ea,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Gp=function(t){yt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n($(this,$t))}),$(this,Nt).getQueryCache().notify({query:$(this,De),type:"observerResultsUpdated"})})},mp);function s3(e,t){return bn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Wh(e,t){return s3(e,t)||e.state.data!==void 0&&dd(e,t,t.refetchOnMount)}function dd(e,t,n){if(bn(t.enabled,e)!==!1&&Qr(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Of(e,t)}return!1}function Qh(e,t,n,r){return(e!==t||bn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Of(e,n)}function Of(e,t){return bn(t.enabled,e)!==!1&&e.isStaleByTime(Qr(t.staleTime,e))}function o3(e,t){return!Ul(e.getCurrentResult(),t)}var Hr,Ur,Ft,hr,xr,$l,fd,pp,a3=(pp=class extends Zs{constructor(n,r){super();de(this,xr);de(this,Hr);de(this,Ur);de(this,Ft);de(this,hr);Z(this,Hr,n),this.setOptions(r),this.bindMethods(),je(this,xr,$l).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=$(this,Hr).defaultMutationOptions(n),Ul(this.options,r)||$(this,Hr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:$(this,Ft),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Ni(r.mutationKey)!==Ni(this.options.mutationKey)?this.reset():((i=$(this,Ft))==null?void 0:i.state.status)==="pending"&&$(this,Ft).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=$(this,Ft))==null||n.removeObserver(this)}onMutationUpdate(n){je(this,xr,$l).call(this),je(this,xr,fd).call(this,n)}getCurrentResult(){return $(this,Ur)}reset(){var n;(n=$(this,Ft))==null||n.removeObserver(this),Z(this,Ft,void 0),je(this,xr,$l).call(this),je(this,xr,fd).call(this)}mutate(n,r){var i;return Z(this,hr,r),(i=$(this,Ft))==null||i.removeObserver(this),Z(this,Ft,$(this,Hr).getMutationCache().build($(this,Hr),this.options)),$(this,Ft).addObserver(this),$(this,Ft).execute(n)}},Hr=new WeakMap,Ur=new WeakMap,Ft=new WeakMap,hr=new WeakMap,xr=new WeakSet,$l=function(){var r,i;const n=(i=(r=$(this,Ft))==null?void 0:r.state)!=null?i:Up();Z(this,Ur,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},fd=function(n){yt.batch(()=>{var r,i,s,o,a,l,u,c;if($(this,hr)&&this.hasListeners()){const d=$(this,Ur).variables,f=$(this,Ur).context;(n==null?void 0:n.type)==="success"?((i=(r=$(this,hr)).onSuccess)==null||i.call(r,n.data,d,f),(o=(s=$(this,hr)).onSettled)==null||o.call(s,n.data,null,d,f)):(n==null?void 0:n.type)==="error"&&((l=(a=$(this,hr)).onError)==null||l.call(a,n.error,d,f),(c=(u=$(this,hr)).onSettled)==null||c.call(u,void 0,n.error,d,f))}this.listeners.forEach(d=>{d($(this,Ur))})})},pp),Kp=I.createContext(void 0),Gt=e=>{const t=I.useContext(Kp);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},l3=({client:e,children:t})=>(I.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),y.jsx(Kp.Provider,{value:e,children:t})),Vp=I.createContext(!1),u3=()=>I.useContext(Vp);Vp.Provider;function c3(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var d3=I.createContext(c3()),f3=()=>I.useContext(d3),h3=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},g3=e=>{I.useEffect(()=>{e.clearReset()},[e])},y3=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Np(n,[e.error,r])),m3=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))}},p3=(e,t)=>e.isLoading&&e.isFetching&&!t,v3=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Yh=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function b3(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=u3(),i=f3(),s=Gt(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",m3(o),h3(o,i),g3(i);const a=!s.getQueryCache().get(o.queryHash),[l]=I.useState(()=>new t(s,o)),u=l.getOptimisticResult(o),c=!r&&e.subscribed!==!1;if(I.useSyncExternalStore(I.useCallback(p=>{const v=c?l.subscribe(yt.batchCalls(p)):Lt;return l.updateResult(),v},[l,c]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),I.useEffect(()=>{l.setOptions(o)},[o,l]),v3(o,u))throw Yh(o,l,i);if(y3({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw u.error;if((g=(h=s.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||g.call(h,o,u),o.experimental_prefetchInRender&&!Ri&&p3(u,r)){const p=a?Yh(o,l,i):(m=s.getQueryCache().get(o.queryHash))==null?void 0:m.promise;p==null||p.catch(Lt).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?u:l.trackResult(u)}function si(e,t){return b3(e,i3,t)}function kr(e,t){const n=Gt(t),[r]=I.useState(()=>new a3(n,e));I.useEffect(()=>{r.setOptions(e)},[r,e]);const i=I.useSyncExternalStore(I.useCallback(o=>r.subscribe(yt.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=I.useCallback((o,a)=>{r.mutate(o,a).catch(Lt)},[r]);if(i.error&&Np(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}var Ee={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return Xh(this.context.count)},getNextContextId(){return Xh(this.context.count++)}};function Xh(e){const t=String(e),n=t.length-1;return Ee.context.id+(n?String.fromCharCode(96+n):"")+t}function Mo(e){Ee.context=e}var Wp=!1,x3=(e,t)=>e===t,Kl=Symbol("solid-proxy"),Qp=typeof Proxy=="function",ku=Symbol("solid-track"),Vl={equals:x3},Yp=nv,Or=1,Wl=2,Xp={owned:null,cleanups:null,context:null,owner:null},dc={},qe=null,fc=null,w3=null,Xe=null,Pt=null,vr=null,Ou=0;function br(e,t){const n=Xe,r=qe,i=e.length===0,s=t===void 0?r:t,o=i?Xp:{owned:null,cleanups:null,context:s?s.context:null,owner:s},a=i?e:()=>e(()=>at(()=>Zo(o)));qe=o,Xe=null;try{return er(a,!0)}finally{Xe=n,qe=r}}function ce(e,t){t=t?Object.assign({},Vl,t):Vl;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=i=>(typeof i=="function"&&(i=i(n.value)),tv(n,i));return[ev.bind(n),r]}function Zp(e,t,n){const r=Eu(e,t,!0,Or);Js(r)}function be(e,t,n){const r=Eu(e,t,!1,Or);Js(r)}function xe(e,t,n){Yp=M3;const r=Eu(e,t,!1,Or);(!n||!n.render)&&(r.user=!0),vr?vr.push(r):Js(r)}function K(e,t,n){n=n?Object.assign({},Vl,n):Vl;const r=Eu(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Js(r),ev.bind(r)}function S3(e){return e&&typeof e=="object"&&"then"in e}function C3(e,t,n){let r,i,s;r=!0,i=e,s={};let o=null,a=dc,l=null,u=!1,c="initialValue"in s,d=typeof r=="function"&&K(r);const f=new Set,[h,g]=(s.storage||ce)(s.initialValue),[m,p]=ce(void 0),[v,b]=ce(void 0,{equals:!1}),[S,C]=ce(c?"ready":"unresolved");Ee.context&&(l=Ee.getNextContextId(),s.ssrLoadFrom==="initial"?a=s.initialValue:Ee.load&&Ee.has(l)&&(a=Ee.load(l)));function w(k,E,j,M){return o===k&&(o=null,M!==void 0&&(c=!0),(k===a||E===a)&&s.onHydrated&&queueMicrotask(()=>s.onHydrated(M,{value:E})),a=dc,O(E,j)),E}function O(k,E){er(()=>{E===void 0&&g(()=>k),C(E!==void 0?"errored":c?"ready":"unresolved"),p(E);for(const j of f.keys())j.decrement();f.clear()},!1)}function x(){const k=T3,E=h(),j=m();if(j!==void 0&&!o)throw j;return Xe&&Xe.user,E}function _(k=!0){if(k!==!1&&u)return;u=!1;const E=d?d():r;if(E==null||E===!1){w(o,at(h));return}const j=a!==dc?a:at(()=>i(E,{value:h(),refetching:k}));return S3(j)?(o=j,"value"in j?(j.status==="success"?w(o,j.value,void 0,E):w(o,void 0,hd(j.value),E),j):(u=!0,queueMicrotask(()=>u=!1),er(()=>{C(c?"refreshing":"pending"),b()},!1),j.then(M=>w(j,M,void 0,E),M=>w(j,void 0,hd(M),E)))):(w(o,j,void 0,E),j)}return Object.defineProperties(x,{state:{get:()=>S()},error:{get:()=>m()},loading:{get(){const k=S();return k==="pending"||k==="refreshing"}},latest:{get(){if(!c)return x();const k=m();if(k&&!o)throw k;return h()}}}),d?Zp(()=>_(!1)):_(!1),[x,{refetch:_,mutate:g}]}function _3(e){return er(e,!1)}function at(e){if(Xe===null)return e();const t=Xe;Xe=null;try{return e()}finally{Xe=t}}function Sr(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 u=0;u<e.length;u++)a[u]=e[u]()}else a=e();if(s)return s=!1,o;const l=at(()=>t(a,i,o));return i=a,l}}function Cr(e){xe(()=>at(e))}function _e(e){return qe===null||(qe.cleanups===null?qe.cleanups=[e]:qe.cleanups.push(e)),e}function Zh(){return qe}function k3(e,t){const n=qe,r=Xe;qe=e,Xe=null;try{return er(t,!0)}catch(i){Ef(i)}finally{qe=n,Xe=r}}function O3(e){const t=Xe,n=qe;return Promise.resolve().then(()=>{Xe=t,qe=n;let r;return er(e,!1),Xe=qe=null,r?r.done:void 0})}var[E3,cI]=ce(!1);function A3(){return[E3,O3]}function wt(e,t){const n=Symbol("context");return{id:n,Provider:$3(n),defaultValue:e}}function St(e){let t;return qe&&qe.context&&(t=qe.context[e.id])!==void 0?t:e.defaultValue}function Jp(e){const t=K(e),n=K(()=>gd(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}var T3;function ev(){if(this.sources&&this.state)if(this.state===Or)Js(this);else{const e=Pt;Pt=null,er(()=>Yl(this),!1),Pt=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 tv(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&er(()=>{for(let i=0;i<e.observers.length;i+=1){const s=e.observers[i],o=fc&&fc.running;o&&fc.disposed.has(s),(o?!s.tState:!s.state)&&(s.pure?Pt.push(s):vr.push(s),s.observers&&rv(s)),o||(s.state=Or)}if(Pt.length>1e6)throw Pt=[],new Error},!1)),t}function Js(e){if(!e.fn)return;Zo(e);const t=Ou;P3(e,e.value,t)}function P3(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=Or,e.owned&&e.owned.forEach(Zo),e.owned=null),e.updatedAt=n+1,Ef(o)}finally{Xe=s,qe=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?tv(e,r):e.value=r,e.updatedAt=n)}function Eu(e,t,n,r=Or,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!==Xp&&(qe.owned?qe.owned.push(s):qe.owned=[s]),s}function Ql(e){if(e.state===0)return;if(e.state===Wl)return Yl(e);if(e.suspense&&at(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Ou);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===Or)Js(e);else if(e.state===Wl){const r=Pt;Pt=null,er(()=>Yl(e,t[0]),!1),Pt=r}}function er(e,t){if(Pt)return e();let n=!1;t||(Pt=[]),vr?n=!0:vr=[],Ou++;try{const r=e();return j3(n),r}catch(r){n||(vr=null),Pt=null,Ef(r)}}function j3(e){if(Pt&&(nv(Pt),Pt=null),e)return;const t=vr;vr=null,t.length&&er(()=>Yp(t),!1)}function nv(e){for(let t=0;t<e.length;t++)Ql(e[t])}function M3(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Ql(r)}if(Ee.context){if(Ee.count){Ee.effects||(Ee.effects=[]),Ee.effects.push(...e.slice(0,n));return}Mo()}for(Ee.effects&&(Ee.done||!Ee.count)&&(e=[...Ee.effects,...e],n+=Ee.effects.length,delete Ee.effects),t=0;t<n;t++)Ql(e[t])}function Yl(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===Or?r!==t&&(!r.updatedAt||r.updatedAt<Ou)&&Ql(r):i===Wl&&Yl(r,t)}}}function rv(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=Wl,n.pure?Pt.push(n):vr.push(n),n.observers&&rv(n))}}function Zo(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--)Zo(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Zo(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 hd(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Ef(e,t=qe){throw hd(e)}function gd(e){if(typeof e=="function"&&!e.length)return gd(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=gd(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function $3(e,t){return function(r){let i;return be(()=>i=at(()=>(qe.context={...qe.context,[e]:r.value},Jp(()=>r.children))),void 0),i}}var yd=Symbol("fallback");function Xl(e){for(let t=0;t<e.length;t++)e[t]()}function L3(e,t,n={}){let r=[],i=[],s=[],o=0,a=t.length>1?[]:null;return _e(()=>Xl(s)),()=>{let l=e()||[],u=l.length,c,d;return l[ku],at(()=>{let h,g,m,p,v,b,S,C,w;if(u===0)o!==0&&(Xl(s),s=[],r=[],i=[],o=0,a&&(a=[])),n.fallback&&(r=[yd],i[0]=br(O=>(s[0]=O,n.fallback())),o=1);else if(o===0){for(i=new Array(u),d=0;d<u;d++)r[d]=l[d],i[d]=br(f);o=u}else{for(m=new Array(u),p=new Array(u),a&&(v=new Array(u)),b=0,S=Math.min(o,u);b<S&&r[b]===l[b];b++);for(S=o-1,C=u-1;S>=b&&C>=b&&r[S]===l[C];S--,C--)m[C]=i[S],p[C]=s[S],a&&(v[C]=a[S]);for(h=new Map,g=new Array(C+1),d=C;d>=b;d--)w=l[d],c=h.get(w),g[d]=c===void 0?-1:c,h.set(w,d);for(c=b;c<=S;c++)w=r[c],d=h.get(w),d!==void 0&&d!==-1?(m[d]=i[c],p[d]=s[c],a&&(v[d]=a[c]),d=g[d],h.set(w,d)):s[c]();for(d=b;d<u;d++)d in m?(i[d]=m[d],s[d]=p[d],a&&(a[d]=v[d],a[d](d))):i[d]=br(f);i=i.slice(0,o=u),r=l.slice(0)}return i});function f(h){if(s[d]=h,a){const[g,m]=ce(d);return a[d]=m,t(l[d],g)}return t(l[d])}}}function D3(e,t,n={}){let r=[],i=[],s=[],o=[],a=0,l;return _e(()=>Xl(s)),()=>{const u=e()||[],c=u.length;return u[ku],at(()=>{if(c===0)return a!==0&&(Xl(s),s=[],r=[],i=[],a=0,o=[]),n.fallback&&(r=[yd],i[0]=br(f=>(s[0]=f,n.fallback())),a=1),i;for(r[0]===yd&&(s[0](),s=[],r=[],i=[],a=0),l=0;l<c;l++)l<r.length&&r[l]!==u[l]?o[l](()=>u[l]):l>=r.length&&(i[l]=br(d));for(;l<r.length;l++)s[l]();return a=o.length=s.length=c,r=u.slice(0),i=i.slice(0,a)});function d(f){s[l]=f;const[h,g]=ce(u[l]);return o[l]=g,t(h,l)}}}function D(e,t){return at(()=>e(t||{}))}function ol(){return!0}var md={get(e,t,n){return t===Kl?n:e.get(t)},has(e,t){return t===Kl?!0:e.has(t)},set:ol,deleteProperty:ol,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:ol,deleteProperty:ol}},ownKeys(e){return e.keys()}};function hc(e){return(e=typeof e=="function"?e():e)?e:{}}function I3(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function Ae(...e){let t=!1;for(let o=0;o<e.length;o++){const a=e[o];t=t||!!a&&Kl in a,e[o]=typeof a=="function"?(t=!0,K(a)):a}if(Qp&&t)return new Proxy({get(o){for(let a=e.length-1;a>=0;a--){const l=hc(e[a])[o];if(l!==void 0)return l}},has(o){for(let a=e.length-1;a>=0;a--)if(o in hc(e[a]))return!0;return!1},keys(){const o=[];for(let a=0;a<e.length;a++)o.push(...Object.keys(hc(e[a])));return[...new Set(o)]}},md);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 u=l.length-1;u>=0;u--){const c=l[u];if(c==="__proto__"||c==="constructor")continue;const d=Object.getOwnPropertyDescriptor(a,c);if(!r[c])r[c]=d.get?{enumerable:!0,configurable:!0,get:I3.bind(n[c]=[d.get.bind(a)])}:d.value!==void 0?d:void 0;else{const f=n[c];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(Qp&&Kl 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)}},md));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))}},md)),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 u of t)u.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 iv(e){let t,n;const r=i=>{const s=Ee.context;if(s){const[a,l]=ce();Ee.count||(Ee.count=0),Ee.count++,(n||(n=e())).then(u=>{!Ee.done&&Mo(s),Ee.count--,l(()=>u.default),Mo()}),t=a}else if(!t){const[a]=C3(()=>(n||(n=e())).then(l=>l.default));t=a}let o;return K(()=>(o=t())?at(()=>{if(!s||Ee.done)return o(i);const a=Ee.context;Mo(s);const l=o(i);return Mo(a),l}):"")};return r.preload=()=>n||((n=e()).then(i=>t=()=>i.default),n),r}var R3=0;function On(){return Ee.context?Ee.getNextContextId():`cl-${R3++}`}var sv=e=>`Stale read from <${e}>.`;function N3(e){const t="fallback"in e&&{fallback:()=>e.fallback};return K(L3(()=>e.each,e.children,t||void 0))}function F3(e){const t="fallback"in e&&{fallback:()=>e.fallback};return K(D3(()=>e.each,e.children,t||void 0))}function ve(e){const t=e.keyed,n=K(()=>e.when,void 0,void 0),r=t?n:K(n,void 0,{equals:(i,s)=>!i==!s});return K(()=>{const i=r();if(i){const s=e.children;return typeof s=="function"&&s.length>0?at(()=>s(t?i:()=>{if(!at(r))throw sv("Show");return n()})):s}return e.fallback},void 0,void 0)}function B3(e){const t=Jp(()=>e.children),n=K(()=>{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],u=s,c=K(()=>u()?void 0:l.when,void 0,void 0),d=l.keyed?c:K(c,void 0,{equals:(f,h)=>!f==!h});s=()=>u()||(d()?[a,c,l]:void 0)}return s});return K(()=>{const r=n()();if(!r)return e.fallback;const[i,s,o]=r,a=o.children;return typeof a=="function"&&a.length>0?at(()=>a(o.keyed?s():()=>{var u;if(((u=at(n)())==null?void 0:u[0])!==i)throw sv("Match");return s()})):a},void 0,void 0)}function gc(e){return e}var q3=["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"],z3=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...q3]),H3=new Set(["innerHTML","textContent","innerText","children"]),U3=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),G3=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 K3(e,t){const n=G3[e];return typeof n=="object"?n[t]?n.$:void 0:n}var V3=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),W3=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"]),Q3={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function Y3(e,t,n){let r=n.length,i=t.length,s=r,o=0,a=0,l=t[i-1].nextSibling,u=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 c=s<r?a?n[a-1].nextSibling:n[s-a]:l;for(;a<s;)e.insertBefore(n[a++],c)}else if(s===a)for(;o<i;)(!u||!u.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[s-1]&&n[a]===t[i-1]){const c=t[--i].nextSibling;e.insertBefore(n[a++],t[o++].nextSibling),e.insertBefore(n[--s],c),t[i]=n[s]}else{if(!u){u=new Map;let d=a;for(;d<s;)u.set(n[d],d++)}const c=u.get(t[o]);if(c!=null)if(a<c&&c<s){let d=o,f=1,h;for(;++d<i&&d<s&&!((h=u.get(t[d]))==null||h!==c+f);)f++;if(f>c-a){const g=t[o];for(;a<c;)e.insertBefore(n[a++],g)}else e.replaceChild(n[a++],t[o++])}else o++;else t[o++].remove()}}}var Uo="_$DX_DELEGATE";function ov(e,t,n,r={}){let i;return br(s=>{i=s,t===document?e():W(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=""}}function he(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 Au(e,t=window.document){const n=t[Uo]||(t[Uo]=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,uv))}}function X3(e=window.document){if(e[Uo]){for(let t of e[Uo].keys())e.removeEventListener(t,uv);delete e[Uo]}}function re(e,t,n){Wi(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function Z3(e,t,n,r){Wi(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function J3(e,t,n){Wi(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function se(e,t){Wi(e)||(t==null?e.removeAttribute("class"):e.className=t)}function av(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]||(Jh(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||(Jh(e,a,!0),n[a]=l)}return n}function tS(e,t,n){if(!t)return n?re(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 lv(e,t={},n,r){const i={};return r||be(()=>i.children=Jo(e,t.children,i.children)),be(()=>typeof t.ref=="function"&&eo(t.ref,e)),be(()=>nS(e,t,n,!0,i,!0)),i}function eo(e,t,n){return at(()=>e(t,n))}function W(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Jo(e,t,r,n);be(i=>Jo(e,t(),i,n),r)}function nS(e,t,n,r,i={},s=!1){t||(t={});for(const o in i)if(!(o in t)){if(o==="children")continue;i[o]=e0(e,o,null,i[o],n,s,t)}for(const o in t){if(o==="children")continue;const a=t[o];i[o]=e0(e,o,a,i[o],n,s,t)}}function rS(e){let t,n;return!Wi()||!(t=Ee.registry.get(n=sS()))?e():(Ee.completed&&Ee.completed.add(t),Ee.registry.delete(n),t)}function Wi(e){return!!Ee.context&&!Ee.done&&(!e||e.isConnected)}function iS(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Jh(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 e0(e,t,n,r,i,s,o){let a,l,u,c,d;if(t==="style")return tS(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=V3.has(f);if(!h&&r){const g=Array.isArray(r)?r[0]:r;e.removeEventListener(f,g)}(h||n)&&(av(e,f,n,h),h&&Au([f]))}else if(t.slice(0,5)==="attr:")re(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")J3(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(u=H3.has(t))||!i&&((c=K3(t,e.tagName))||(l=z3.has(t)))||(a=e.nodeName.includes("-")||"is"in o)){if(d)t=t.slice(5),l=!0;else if(Wi(e))return n;t==="class"||t==="className"?se(e,n):a&&!l&&!u?e[iS(t)]=n:e[c||t]=n}else{const f=i&&t.indexOf(":")>-1&&Q3[t.split(":")[0]];f?Z3(e,f,t,n):re(e,U3[t]||t,n)}return n}function uv(e){if(Ee.registry&&Ee.events&&Ee.events.find(([l,u])=>u===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 u=t[`${n}Data`];if(u!==void 0?l.call(t,u,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}}),Ee.registry&&!Ee.done&&(Ee.done=_$HY.done=!0),e.composedPath){const l=e.composedPath();s(l[0]);for(let u=0;u<l.length-2&&(t=l[u],!!o());u++){if(t._$host){t=t._$host,a();break}if(t.parentNode===i)break}}else a();s(r)}function Jo(e,t,n,r,i){const s=Wi(e);if(s){!n&&(n=[...e.childNodes]);let l=[];for(let u=0;u<n.length;u++){const c=n[u];c.nodeType===8&&c.data.slice(0,2)==="!$"?c.remove():l.push(c)}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=es(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=es(e,n,r)}else{if(o==="function")return be(()=>{let l=t();for(;typeof l=="function";)l=l();n=Jo(e,l,n,r)}),()=>n;if(Array.isArray(t)){const l=[],u=n&&Array.isArray(n);if(pd(l,t,n,i))return be(()=>n=Jo(e,l,n,r,!0)),()=>n;if(s){if(!l.length)return n;if(r===void 0)return n=[...e.childNodes];let c=l[0];if(c.parentNode!==e)return n;const d=[c];for(;(c=c.nextSibling)!==r;)d.push(c);return n=d}if(l.length===0){if(n=es(e,n,r),a)return n}else u?n.length===0?t0(e,l,r):Y3(e,n,l):(n&&es(e),t0(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=es(e,n,r,t);es(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function pd(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],u;if(!(a==null||a===!0||a===!1))if((u=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))i=pd(e,a,l)||i;else if(u==="function")if(r){for(;typeof a=="function";)a=a();i=pd(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||i}else e.push(a),i=!0;else{const c=String(a);l&&l.nodeType===3&&l.data===c?e.push(l):e.push(document.createTextNode(c))}}return i}function t0(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function es(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 sS(){return Ee.getNextContextId()}var oS="http://www.w3.org/2000/svg";function cv(e,t=!1){return t?document.createElementNS(oS,e):document.createElement(e)}function dv(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,i=Zh();let s,o=!!Ee.context;return xe(()=>{o&&(Zh().user=o=!1),s||(s=k3(i,()=>K(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,u]=ce(!1),c=()=>u(!0);br(d=>W(a,()=>l()?d():s(),null)),_e(c)}else{const l=cv(e.isSVG?"g":"div",e.isSVG),u=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),W(u,s),a.appendChild(l),e.ref&&e.ref(l),_e(()=>a.removeChild(l))}},void 0,{render:!o}),n}function aS(e,t){const n=K(e);return K(()=>{const r=n();switch(typeof r){case"function":return at(()=>r(t));case"string":const i=W3.has(r),s=Ee.context?rS():cv(r,i);return lv(s,t,i),s}})}function lS(e){const[,t]=Ve(e,["component"]);return aS(()=>e.component,t)}var uS=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()}},fv=class{constructor(t){this.generateIdentifier=t,this.kv=new uS}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)}},cS=class extends fv{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 dS(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=dS(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 Gs(e,t){Object.entries(e).forEach(([n,r])=>t(r,n))}function Ll(e,t){return e.indexOf(t)!==-1}function n0(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(t(r))return r}}var hS=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]}},gS=e=>Object.prototype.toString.call(e).slice(8,-1),hv=e=>typeof e=="undefined",yS=e=>e===null,ea=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,vd=e=>ea(e)&&Object.keys(e).length===0,Jr=e=>Array.isArray(e),mS=e=>typeof e=="string",pS=e=>typeof e=="number"&&!isNaN(e),vS=e=>typeof e=="boolean",bS=e=>e instanceof RegExp,ta=e=>e instanceof Map,na=e=>e instanceof Set,gv=e=>gS(e)==="Symbol",xS=e=>e instanceof Date&&!isNaN(e.valueOf()),wS=e=>e instanceof Error,r0=e=>typeof e=="number"&&isNaN(e),SS=e=>vS(e)||yS(e)||hv(e)||pS(e)||mS(e)||gv(e),CS=e=>typeof e=="bigint",_S=e=>e===1/0||e===-1/0,kS=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),OS=e=>e instanceof URL,yv=e=>e.replace(/\./g,"\\."),yc=e=>e.map(String).map(yv).join("."),Go=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 Bn(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var mv=[Bn(hv,"undefined",()=>null,()=>{}),Bn(CS,"bigint",e=>e.toString(),e=>typeof BigInt!="undefined"?BigInt(e):e),Bn(xS,"Date",e=>e.toISOString(),e=>new Date(e)),Bn(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}),Bn(bS,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),Bn(na,"set",e=>[...e.values()],e=>new Set(e)),Bn(ta,"map",e=>[...e.entries()],e=>new Map(e)),Bn(e=>r0(e)||_S(e),"number",e=>r0(e)?"NaN":e>0?"Infinity":"-Infinity",Number),Bn(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),Bn(OS,"URL",e=>e.toString(),e=>new URL(e))];function Tu(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var pv=Tu((e,t)=>gv(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}),ES=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),vv=Tu(kS,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const n=ES[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function bv(e,t){return e!=null&&e.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var xv=Tu(bv,(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)}),wv=Tu((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)}),AS=[xv,pv,wv,vv],i0=(e,t)=>{const n=n0(AS,i=>i.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};const r=n0(mv,i=>i.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation}},Sv={};mv.forEach(e=>{Sv[e.annotation]=e});var TS=(e,t,n)=>{if(Jr(t))switch(t[0]){case"symbol":return pv.untransform(e,t,n);case"class":return xv.untransform(e,t,n);case"custom":return wv.untransform(e,t,n);case"typed-array":return vv.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{const r=Sv[t];if(!r)throw new Error("Unknown transformation: "+t);return r.untransform(e,n)}},ls=(e,t)=>{const n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function Cv(e){if(Ll(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(Ll(e,"prototype"))throw new Error("prototype is not allowed as a property");if(Ll(e,"constructor"))throw new Error("constructor is not allowed as a property")}var PS=(e,t)=>{Cv(t);for(let n=0;n<t.length;n++){const r=t[n];if(na(e))e=ls(e,+r);else if(ta(e)){const i=+r,s=+t[++n]==0?"key":"value",o=ls(e,i);switch(s){case"key":e=o;break;case"value":e=e.get(o);break}}else e=e[r]}return e},bd=(e,t,n)=>{if(Cv(t),t.length===0)return n(e);let r=e;for(let s=0;s<t.length-1;s++){const o=t[s];if(Jr(r)){const a=+o;r=r[a]}else if(ea(r))r=r[o];else if(na(r)){const a=+o;r=ls(r,a)}else if(ta(r)){if(s===t.length-2)break;const l=+o,u=+t[++s]==0?"key":"value",c=ls(r,l);switch(u){case"key":r=c;break;case"value":r=r.get(c);break}}}const i=t[t.length-1];if(Jr(r)?r[+i]=n(r[+i]):ea(r)&&(r[i]=n(r[i])),na(r)){const s=ls(r,+i),o=n(s);s!==o&&(r.delete(s),r.add(o))}if(ta(r)){const s=+t[t.length-2],o=ls(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 xd(e,t,n=[]){if(!e)return;if(!Jr(e)){Gs(e,(s,o)=>xd(s,t,[...n,...Go(o)]));return}const[r,i]=e;i&&Gs(i,(s,o)=>{xd(s,t,[...n,...Go(o)])}),t(r,n)}function jS(e,t,n){return xd(t,(r,i)=>{e=bd(e,i,s=>TS(s,r,n))}),e}function MS(e,t){function n(r,i){const s=PS(e,Go(i));r.map(Go).forEach(o=>{e=bd(e,o,()=>s)})}if(Jr(t)){const[r,i]=t;r.forEach(s=>{e=bd(e,Go(s),()=>e)}),i&&Gs(i,n)}else Gs(t,n);return e}var $S=(e,t)=>ea(e)||Jr(e)||ta(e)||na(e)||bv(e,t);function LS(e,t,n){const r=n.get(e);r?r.push(t):n.set(e,[t])}function DS(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(yc):n[yc(s)]=o.map(yc)}),r?vd(n)?[r]:[r,n]:vd(n)?void 0:n}var _v=(e,t,n,r,i=[],s=[],o=new Map)=>{var h;const a=SS(e);if(!a){LS(e,i,t);const g=o.get(e);if(g)return r?{transformedValue:null}:g}if(!$S(e,n)){const g=i0(e,n),m=g?{transformedValue:g.value,annotations:[g.type]}:{transformedValue:e};return a||o.set(e,m),m}if(Ll(s,e))return{transformedValue:null};const l=i0(e,n),u=(h=l==null?void 0:l.value)!=null?h:e,c=Jr(u)?[]:{},d={};Gs(u,(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=_v(g,t,n,r,[...i,m],[...s,e],o);c[m]=p.transformedValue,Jr(p.annotations)?d[m]=p.annotations:ea(p.annotations)&&Gs(p.annotations,(v,b)=>{d[yv(m)+"."+b]=v})});const f=vd(d)?{transformedValue:c,annotations:l?[l.type]:void 0}:{transformedValue:c,annotations:l?[l.type,d]:d};return a||o.set(e,f),f};function kv(e){return Object.prototype.toString.call(e).slice(8,-1)}function s0(e){return kv(e)==="Array"}function IS(e){if(kv(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function RS(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 wd(e,t={}){if(s0(e))return e.map(i=>wd(i,t));if(!IS(e))return e;const n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((i,s)=>{if(s0(t.props)&&!t.props.includes(s))return i;const o=e[s],a=wd(o,t);return RS(i,s,a,e,t.nonenumerable),i},{})}var Ze=class{constructor({dedupe:e=!1}={}){this.classRegistry=new cS,this.symbolRegistry=new fv(t=>{var n;return(n=t.description)!=null?n:""}),this.customTransformerRegistry=new hS,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const t=new Map,n=_v(e,t,this,this.dedupe),r={json:n.transformedValue};n.annotations&&(r.meta={...r.meta,values:n.annotations});const i=DS(t,this.dedupe);return i&&(r.meta={...r.meta,referentialEqualities:i}),r}deserialize(e){const{json:t,meta:n}=e;let r=wd(t);return n!=null&&n.values&&(r=jS(r,n.values,this)),n!=null&&n.referentialEqualities&&(r=MS(r,n.referentialEqualities)),r}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e))}registerClass(e,t){this.classRegistry.register(e,t)}registerSymbol(e,t){this.symbolRegistry.register(e,t)}registerCustom(e,t){this.customTransformerRegistry.register({name:t,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}};Ze.defaultInstance=new Ze;Ze.serialize=Ze.defaultInstance.serialize.bind(Ze.defaultInstance);Ze.deserialize=Ze.defaultInstance.deserialize.bind(Ze.defaultInstance);Ze.stringify=Ze.defaultInstance.stringify.bind(Ze.defaultInstance);Ze.parse=Ze.defaultInstance.parse.bind(Ze.defaultInstance);Ze.registerClass=Ze.defaultInstance.registerClass.bind(Ze.defaultInstance);Ze.registerSymbol=Ze.defaultInstance.registerSymbol.bind(Ze.defaultInstance);Ze.registerCustom=Ze.defaultInstance.registerCustom.bind(Ze.defaultInstance);Ze.allowErrorProps=Ze.defaultInstance.allowErrorProps.bind(Ze.defaultInstance);var Ov=Ze.serialize,NS=Ze.stringify;function is(e){return e.state.fetchStatus==="fetching"?"fetching":e.getObserversCount()?e.state.fetchStatus==="paused"?"paused":e.isStale()?"stale":"fresh":"inactive"}function FS(e,t){return`${e}${t.charAt(0).toUpperCase()+t.slice(1)}`}function BS({queryState:e,observerCount:t,isStale:n}){return e.fetchStatus==="fetching"?"blue":t?e.fetchStatus==="paused"?"purple":n?"yellow":"green":"gray"}function us({status:e,isPaused:t}){return t?"purple":e==="error"?"red":e==="pending"?"yellow":e==="success"?"green":"gray"}function qS(e){return e==="fresh"?"green":e==="stale"?"yellow":e==="paused"?"purple":e==="inactive"?"gray":"blue"}var Zl=(e,t=!1)=>{const{json:n}=Ov(e);return JSON.stringify(n,null,t?2:void 0)},al=e=>e.state.fetchStatus!=="idle"?0:e.getObserversCount()?e.isStale()?2:1:3,zS=(e,t)=>e.queryHash.localeCompare(t.queryHash),Ev=(e,t)=>e.state.dataUpdatedAt<t.state.dataUpdatedAt?1:-1,HS=(e,t)=>al(e)===al(t)?Ev(e,t):al(e)>al(t)?1:-1,Sd={status:HS,"query hash":zS,"last updated":Ev},ll=e=>e.state.isPaused?0:e.state.status==="error"?2:e.state.status==="pending"?1:3,Av=(e,t)=>e.state.submittedAt<t.state.submittedAt?1:-1,US=(e,t)=>ll(e)===ll(t)?Av(e,t):ll(e)>ll(t)?1:-1,Cd={status:US,"last updated":Av},o0=e=>e*parseFloat(getComputedStyle(document.documentElement).fontSize),Tv=()=>{const[e,t]=ce("dark");return Cr(()=>{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),_e(()=>n.removeEventListener("change",r))}),e},xi=(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,xi(r.get(i),s,n)),r}if(e instanceof Set){const r=xi(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]=xi(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]=xi(r[i],s,n),r}return e},$o=(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,$o(n.get(r),i)),n}if(e instanceof Set){const n=$o(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]=$o(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]=$o(n[r],i),n}return e},Pv=(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)},Es,Ta,Pa,ja,Mi,Ma,As,Ts,Ps,js,Ms,$s,$a,vp,GS=(vp=class{constructor(e){de(this,Es);de(this,Ta);de(this,Pa);de(this,ja);de(this,Mi,!1);de(this,Ma);de(this,As);de(this,Ts);de(this,Ps);de(this,js);de(this,Ms);de(this,$s);de(this,$a);const{client:t,queryFlavor:n,version:r,onlineManager:i,buttonPosition:s,position:o,initialIsOpen:a,errorTypes:l,styleNonce:u,shadowDOMTarget:c}=e;Z(this,Es,ce(t)),Z(this,Pa,n),Z(this,ja,r),Z(this,Ta,i),Z(this,Ma,u),Z(this,As,c),Z(this,Ts,ce(s)),Z(this,Ps,ce(o)),Z(this,js,ce(a)),Z(this,Ms,ce(l))}setButtonPosition(e){$(this,Ts)[1](e)}setPosition(e){$(this,Ps)[1](e)}setInitialIsOpen(e){$(this,js)[1](e)}setErrorTypes(e){$(this,Ms)[1](e)}setClient(e){$(this,Es)[1](e)}mount(e){if($(this,Mi))throw new Error("Devtools is already mounted");const t=ov(()=>{const n=this,[r]=$(this,Ts),[i]=$(this,Ps),[s]=$(this,js),[o]=$(this,Ms),[a]=$(this,Es);let l;return $(this,$s)?l=$(this,$s):(l=iv(()=>Promise.resolve().then(()=>SL)),Z(this,$s,l)),Pv($(this,Ma),$(this,As)),D(l,Ae({get queryFlavor(){return $(n,Pa)},get version(){return $(n,ja)},get onlineManager(){return $(n,Ta)},get shadowDOMTarget(){return $(n,As)}},{get client(){return a()},get buttonPosition(){return r()},get position(){return i()},get initialIsOpen(){return s()},get errorTypes(){return o()}}))},e);Z(this,Mi,!0),Z(this,$a,t)}unmount(){var e;if(!$(this,Mi))throw new Error("Devtools is not mounted");(e=$(this,$a))==null||e.call(this),Z(this,Mi,!1)}},Es=new WeakMap,Ta=new WeakMap,Pa=new WeakMap,ja=new WeakMap,Mi=new WeakMap,Ma=new WeakMap,As=new WeakMap,Ts=new WeakMap,Ps=new WeakMap,js=new WeakMap,Ms=new WeakMap,$s=new WeakMap,$a=new WeakMap,vp),Ls,La,Da,Ia,$i,Ra,Ds,Is,Rs,Ns,Fs,Bs,qs,Na,bp,KS=(bp=class{constructor(e){de(this,Ls);de(this,La);de(this,Da);de(this,Ia);de(this,$i,!1);de(this,Ra);de(this,Ds);de(this,Is);de(this,Rs);de(this,Ns);de(this,Fs);de(this,Bs);de(this,qs);de(this,Na);const{client:t,queryFlavor:n,version:r,onlineManager:i,buttonPosition:s,position:o,initialIsOpen:a,errorTypes:l,styleNonce:u,shadowDOMTarget:c,onClose:d}=e;Z(this,Ls,ce(t)),Z(this,Da,n),Z(this,Ia,r),Z(this,La,i),Z(this,Ra,u),Z(this,Ds,c),Z(this,Is,ce(s)),Z(this,Rs,ce(o)),Z(this,Ns,ce(a)),Z(this,Fs,ce(l)),Z(this,Bs,ce(d))}setButtonPosition(e){$(this,Is)[1](e)}setPosition(e){$(this,Rs)[1](e)}setInitialIsOpen(e){$(this,Ns)[1](e)}setErrorTypes(e){$(this,Fs)[1](e)}setClient(e){$(this,Ls)[1](e)}setOnClose(e){$(this,Bs)[1](()=>e)}mount(e){if($(this,$i))throw new Error("Devtools is already mounted");const t=ov(()=>{const n=this,[r]=$(this,Is),[i]=$(this,Rs),[s]=$(this,Ns),[o]=$(this,Fs),[a]=$(this,Ls),[l]=$(this,Bs);let u;return $(this,qs)?u=$(this,qs):(u=iv(()=>Promise.resolve().then(()=>kL)),Z(this,qs,u)),Pv($(this,Ra),$(this,Ds)),D(u,Ae({get queryFlavor(){return $(n,Da)},get version(){return $(n,Ia)},get onlineManager(){return $(n,La)},get shadowDOMTarget(){return $(n,Ds)}},{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);Z(this,$i,!0),Z(this,Na,t)}unmount(){var e;if(!$(this,$i))throw new Error("Devtools is not mounted");(e=$(this,Na))==null||e.call(this),Z(this,$i,!1)}},Ls=new WeakMap,La=new WeakMap,Da=new WeakMap,Ia=new WeakMap,$i=new WeakMap,Ra=new WeakMap,Ds=new WeakMap,Is=new WeakMap,Rs=new WeakMap,Ns=new WeakMap,Fs=new WeakMap,Bs=new WeakMap,qs=new WeakMap,Na=new WeakMap,bp);function VS(e){const t=Gt(e.client),n=I.useRef(null),{buttonPosition:r,position:i,initialIsOpen:s,errorTypes:o,styleNonce:a,shadowDOMTarget:l}=e,[u]=I.useState(new GS({client:t,queryFlavor:"React Query",version:"5",onlineManager:Us,buttonPosition:r,position:i,initialIsOpen:s,errorTypes:o,styleNonce:a,shadowDOMTarget:l}));return I.useEffect(()=>{u.setClient(t)},[t,u]),I.useEffect(()=>{r&&u.setButtonPosition(r)},[r,u]),I.useEffect(()=>{i&&u.setPosition(i)},[i,u]),I.useEffect(()=>{u.setInitialIsOpen(s||!1)},[s,u]),I.useEffect(()=>{u.setErrorTypes(o||[])},[o,u]),I.useEffect(()=>(n.current&&u.mount(n.current),()=>{u.unmount()}),[u]),y.jsx("div",{dir:"ltr",className:"tsqd-parent-container",ref:n})}function WS(e){const t=Gt(e.client),n=I.useRef(null),{errorTypes:r,styleNonce:i,shadowDOMTarget:s}=e,[o]=I.useState(new KS({client:t,queryFlavor:"React Query",version:"5",onlineManager:Us,buttonPosition:"bottom-left",position:"bottom",initialIsOpen:!0,errorTypes:r,styleNonce:i,shadowDOMTarget:s,onClose:e.onClose}));return I.useEffect(()=>{o.setClient(t)},[t,o]),I.useEffect(()=>{var a;o.setOnClose((a=e.onClose)!=null?a:()=>{})},[e.onClose,o]),I.useEffect(()=>{o.setErrorTypes(r||[])},[r,o]),I.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 QS=process.env.NODE_ENV!=="development"?function(){return null}:VS;process.env.NODE_ENV;function jv(e,t){return function(){return e.apply(t,arguments)}}const{toString:YS}=Object.prototype,{getPrototypeOf:Af}=Object,{iterator:Pu,toStringTag:Mv}=Symbol,ju=(e=>t=>{const n=YS.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Rn=e=>(e=e.toLowerCase(),t=>ju(t)===e),Mu=e=>t=>typeof t===e,{isArray:to}=Array,ra=Mu("undefined");function XS(e){return e!==null&&!ra(e)&&e.constructor!==null&&!ra(e.constructor)&&zt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const $v=Rn("ArrayBuffer");function ZS(e){let t;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&$v(e.buffer),t}const JS=Mu("string"),zt=Mu("function"),Lv=Mu("number"),$u=e=>e!==null&&typeof e=="object",eC=e=>e===!0||e===!1,Dl=e=>{if(ju(e)!=="object")return!1;const t=Af(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Mv in e)&&!(Pu in e)},tC=Rn("Date"),nC=Rn("File"),rC=Rn("Blob"),iC=Rn("FileList"),sC=e=>$u(e)&&zt(e.pipe),oC=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||zt(e.append)&&((t=ju(e))==="formdata"||t==="object"&&zt(e.toString)&&e.toString()==="[object FormData]"))},aC=Rn("URLSearchParams"),[lC,uC,cC,dC]=["ReadableStream","Request","Response","Headers"].map(Rn),fC=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function qa(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e=="undefined")return;let r,i;if(typeof e!="object"&&(e=[e]),to(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 wi=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:global,Iv=e=>!ra(e)&&e!==wi;function _d(){const{caseless:e}=Iv(this)&&this||{},t={},n=(r,i)=>{const s=e&&Dv(t,i)||i;Dl(t[s])&&Dl(r)?t[s]=_d(t[s],r):Dl(r)?t[s]=_d({},r):to(r)?t[s]=r.slice():t[s]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&qa(arguments[r],n);return t}const hC=(e,t,n,{allOwnKeys:r}={})=>(qa(t,(i,s)=>{n&&zt(i)?e[s]=jv(i,n):e[s]=i},{allOwnKeys:r}),e),gC=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),yC=(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)},mC=(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&&Af(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},pC=(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},vC=e=>{if(!e)return null;if(to(e))return e;let t=e.length;if(!Lv(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},bC=(e=>t=>e&&t instanceof e)(typeof Uint8Array!="undefined"&&Af(Uint8Array)),xC=(e,t)=>{const r=(e&&e[Pu]).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},SC=Rn("HTMLFormElement"),CC=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),a0=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),_C=Rn("RegExp"),Rv=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};qa(n,(i,s)=>{let o;(o=t(i,s,e))!==!1&&(r[s]=o||i)}),Object.defineProperties(e,r)},kC=e=>{Rv(e,(t,n)=>{if(zt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(zt(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},OC=(e,t)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return to(e)?r(e):r(String(e).split(t)),n},EC=()=>{},AC=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function TC(e){return!!(e&&zt(e.append)&&e[Mv]==="FormData"&&e[Pu])}const PC=e=>{const t=new Array(10),n=(r,i)=>{if($u(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const s=to(r)?[]:{};return qa(r,(o,a)=>{const l=n(o,i+1);!ra(l)&&(s[a]=l)}),t[i]=void 0,s}}return r};return n(e,0)},jC=Rn("AsyncFunction"),MC=e=>e&&($u(e)||zt(e))&&zt(e.then)&&zt(e.catch),Nv=((e,t)=>e?setImmediate:t?((n,r)=>(wi.addEventListener("message",({source:i,data:s})=>{i===wi&&s===n&&r.length&&r.shift()()},!1),i=>{r.push(i),wi.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",zt(wi.postMessage)),$C=typeof queueMicrotask!="undefined"?queueMicrotask.bind(wi):typeof process!="undefined"&&process.nextTick||Nv,LC=e=>e!=null&&zt(e[Pu]),q={isArray:to,isArrayBuffer:$v,isBuffer:XS,isFormData:oC,isArrayBufferView:ZS,isString:JS,isNumber:Lv,isBoolean:eC,isObject:$u,isPlainObject:Dl,isReadableStream:lC,isRequest:uC,isResponse:cC,isHeaders:dC,isUndefined:ra,isDate:tC,isFile:nC,isBlob:rC,isRegExp:_C,isFunction:zt,isStream:sC,isURLSearchParams:aC,isTypedArray:bC,isFileList:iC,forEach:qa,merge:_d,extend:hC,trim:fC,stripBOM:gC,inherits:yC,toFlatObject:mC,kindOf:ju,kindOfTest:Rn,endsWith:pC,toArray:vC,forEachEntry:xC,matchAll:wC,isHTMLForm:SC,hasOwnProperty:a0,hasOwnProp:a0,reduceDescriptors:Rv,freezeMethods:kC,toObjectSet:OC,toCamelCase:CC,noop:EC,toFiniteNumber:AC,findKey:Dv,global:wi,isContextDefined:Iv,isSpecCompliantForm:TC,toJSONObject:PC,isAsyncFn:jC,isThenable:MC,setImmediate:Nv,asap:$C,isIterable:LC};function Pe(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)}q.inherits(Pe,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:q.toJSONObject(this.config),code:this.code,status:this.status}}});const Fv=Pe.prototype,Bv={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Bv[e]={value:e}});Object.defineProperties(Pe,Bv);Object.defineProperty(Fv,"isAxiosError",{value:!0});Pe.from=(e,t,n,r,i,s)=>{const o=Object.create(Fv);return q.toFlatObject(e,o,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),Pe.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,s&&Object.assign(o,s),o};const DC=null;function kd(e){return q.isPlainObject(e)||q.isArray(e)}function qv(e){return q.endsWith(e,"[]")?e.slice(0,-2):e}function l0(e,t,n){return e?e.concat(t).map(function(i,s){return i=qv(i),!n&&s?"["+i+"]":i}).join(n?".":""):t}function IC(e){return q.isArray(e)&&!e.some(kd)}const RC=q.toFlatObject(q,{},null,function(t){return/^is[A-Z]/.test(t)});function Lu(e,t,n){if(!q.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=q.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,p){return!q.isUndefined(p[m])});const r=n.metaTokens,i=n.visitor||c,s=n.dots,o=n.indexes,l=(n.Blob||typeof Blob!="undefined"&&Blob)&&q.isSpecCompliantForm(t);if(!q.isFunction(i))throw new TypeError("visitor must be a function");function u(g){if(g===null)return"";if(q.isDate(g))return g.toISOString();if(q.isBoolean(g))return g.toString();if(!l&&q.isBlob(g))throw new Pe("Blob is not supported. Use a Buffer instead.");return q.isArrayBuffer(g)||q.isTypedArray(g)?l&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function c(g,m,p){let v=g;if(g&&!p&&typeof g=="object"){if(q.endsWith(m,"{}"))m=r?m:m.slice(0,-2),g=JSON.stringify(g);else if(q.isArray(g)&&IC(g)||(q.isFileList(g)||q.endsWith(m,"[]"))&&(v=q.toArray(g)))return m=qv(m),v.forEach(function(S,C){!(q.isUndefined(S)||S===null)&&t.append(o===!0?l0([m],C,s):o===null?m:m+"[]",u(S))}),!1}return kd(g)?!0:(t.append(l0(p,m,s),u(g)),!1)}const d=[],f=Object.assign(RC,{defaultVisitor:c,convertValue:u,isVisitable:kd});function h(g,m){if(!q.isUndefined(g)){if(d.indexOf(g)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(g),q.forEach(g,function(v,b){(!(q.isUndefined(v)||v===null)&&i.call(t,v,q.isString(b)?b.trim():b,m,f))===!0&&h(v,m?m.concat(b):[b])}),d.pop()}}if(!q.isObject(e))throw new TypeError("data must be an object");return h(e),t}function u0(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Tf(e,t){this._pairs=[],e&&Lu(e,this,t)}const zv=Tf.prototype;zv.append=function(t,n){this._pairs.push([t,n])};zv.toString=function(t){const n=t?function(r){return t.call(this,r,u0)}:u0;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function NC(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Hv(e,t,n){if(!t)return e;const r=n&&n.encode||NC;q.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let s;if(i?s=i(t,n):s=q.isURLSearchParams(t)?t.toString():new Tf(t,n).toString(r),s){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class c0{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){q.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Uv={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},FC=typeof URLSearchParams!="undefined"?URLSearchParams:Tf,BC=typeof FormData!="undefined"?FormData:null,qC=typeof Blob!="undefined"?Blob:null,zC={isBrowser:!0,classes:{URLSearchParams:FC,FormData:BC,Blob:qC},protocols:["http","https","file","blob","url","data"]},Pf=typeof window!="undefined"&&typeof document!="undefined",Od=typeof navigator=="object"&&navigator||void 0,HC=Pf&&(!Od||["ReactNative","NativeScript","NS"].indexOf(Od.product)<0),UC=typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",GC=Pf&&window.location.href||"http://localhost",KC=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Pf,hasStandardBrowserEnv:HC,hasStandardBrowserWebWorkerEnv:UC,navigator:Od,origin:GC},Symbol.toStringTag,{value:"Module"})),Tt={...KC,...zC};function VC(e,t){return Lu(e,new Tt.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,s){return Tt.isNode&&q.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function WC(e){return q.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function QC(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 Gv(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&&q.isArray(i)?i.length:o,l?(q.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!a):((!i[o]||!q.isObject(i[o]))&&(i[o]=[]),t(n,r,i[o],s)&&q.isArray(i[o])&&(i[o]=QC(i[o])),!a)}if(q.isFormData(e)&&q.isFunction(e.entries)){const n={};return q.forEachEntry(e,(r,i)=>{t(WC(r),i,n,0)}),n}return null}function YC(e,t,n){if(q.isString(e))try{return(t||JSON.parse)(e),q.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const za={transitional:Uv,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=q.isObject(t);if(s&&q.isHTMLForm(t)&&(t=new FormData(t)),q.isFormData(t))return i?JSON.stringify(Gv(t)):t;if(q.isArrayBuffer(t)||q.isBuffer(t)||q.isStream(t)||q.isFile(t)||q.isBlob(t)||q.isReadableStream(t))return t;if(q.isArrayBufferView(t))return t.buffer;if(q.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 VC(t,this.formSerializer).toString();if((a=q.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Lu(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),YC(t)):t}],transformResponse:[function(t){const n=this.transitional||za.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(q.isResponse(t)||q.isReadableStream(t))return t;if(t&&q.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"?Pe.from(a,Pe.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:Tt.classes.FormData,Blob:Tt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};q.forEach(["delete","get","head","post","put","patch"],e=>{za.headers[e]={}});const XC=q.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"]),ZC=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]&&XC[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},d0=Symbol("internals");function yo(e){return e&&String(e).trim().toLowerCase()}function Il(e){return e===!1||e==null?e:q.isArray(e)?e.map(Il):String(e)}function JC(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 e5=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function mc(e,t,n,r,i){if(q.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!q.isString(t)){if(q.isString(r))return t.indexOf(r)!==-1;if(q.isRegExp(r))return r.test(t)}}function t5(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function n5(e,t){const n=q.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,s,o){return this[r].call(this,t,i,s,o)},configurable:!0})})}let Ht=class{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function s(a,l,u){const c=yo(l);if(!c)throw new Error("header name must be a non-empty string");const d=q.findKey(i,c);(!d||i[d]===void 0||u===!0||u===void 0&&i[d]!==!1)&&(i[d||l]=Il(a))}const o=(a,l)=>q.forEach(a,(u,c)=>s(u,c,l));if(q.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(q.isString(t)&&(t=t.trim())&&!e5(t))o(ZC(t),n);else if(q.isObject(t)&&q.isIterable(t)){let a={},l,u;for(const c of t){if(!q.isArray(c))throw TypeError("Object iterator must return a key-value pair");a[u=c[0]]=(l=a[u])?q.isArray(l)?[...l,c[1]]:[l,c[1]]:c[1]}o(a,n)}else t!=null&&s(n,t,r);return this}get(t,n){if(t=yo(t),t){const r=q.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return JC(i);if(q.isFunction(n))return n.call(this,i,r);if(q.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=yo(t),t){const r=q.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||mc(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function s(o){if(o=yo(o),o){const a=q.findKey(r,o);a&&(!n||mc(r,r[a],a,n))&&(delete r[a],i=!0)}}return q.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||mc(this,this[s],s,t,!0))&&(delete this[s],i=!0)}return i}normalize(t){const n=this,r={};return q.forEach(this,(i,s)=>{const o=q.findKey(r,s);if(o){n[o]=Il(i),delete n[s];return}const a=t?t5(s):String(s).trim();a!==s&&delete n[s],n[a]=Il(i),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return q.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&q.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[d0]=this[d0]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=yo(o);r[a]||(n5(i,o),r[a]=!0)}return q.isArray(t)?t.forEach(s):s(t),this}};Ht.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);q.reduceDescriptors(Ht.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});q.freezeMethods(Ht);function pc(e,t){const n=this||za,r=t||n,i=Ht.from(r.headers);let s=r.data;return q.forEach(e,function(a){s=a.call(n,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function Kv(e){return!!(e&&e.__CANCEL__)}function no(e,t,n){Pe.call(this,e==null?"canceled":e,Pe.ERR_CANCELED,t,n),this.name="CanceledError"}q.inherits(no,Pe,{__CANCEL__:!0});function Vv(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Pe("Request failed with status code "+n.status,[Pe.ERR_BAD_REQUEST,Pe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function r5(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function i5(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 u=Date.now(),c=r[s];o||(o=u),n[i]=l,r[i]=u;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),u-o<t)return;const h=c&&u-c;return h?Math.round(f*1e3/h):void 0}}function s5(e,t){let n=0,r=1e3/t,i,s;const o=(u,c=Date.now())=>{n=c,i=null,s&&(clearTimeout(s),s=null),e.apply(null,u)};return[(...u)=>{const c=Date.now(),d=c-n;d>=r?o(u,c):(i=u,s||(s=setTimeout(()=>{s=null,o(i)},r-d)))},()=>i&&o(i)]}const Jl=(e,t,n=3)=>{let r=0;const i=i5(50,250);return s5(s=>{const o=s.loaded,a=s.lengthComputable?s.total:void 0,l=o-r,u=i(l),c=o<=a;r=o;const d={loaded:o,total:a,progress:a?o/a:void 0,bytes:l,rate:u||void 0,estimated:u&&a&&c?(a-o)/u:void 0,event:s,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},f0=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},h0=e=>(...t)=>q.asap(()=>e(...t)),o5=Tt.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Tt.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Tt.origin),Tt.navigator&&/(msie|trident)/i.test(Tt.navigator.userAgent)):()=>!0,a5=Tt.hasStandardBrowserEnv?{write(e,t,n,r,i,s){const o=[e+"="+encodeURIComponent(t)];q.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),q.isString(r)&&o.push("path="+r),q.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 l5(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function u5(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Wv(e,t,n){let r=!l5(t);return e&&(r||n==!1)?u5(e,t):t}const g0=e=>e instanceof Ht?{...e}:e;function Fi(e,t){t=t||{};const n={};function r(u,c,d,f){return q.isPlainObject(u)&&q.isPlainObject(c)?q.merge.call({caseless:f},u,c):q.isPlainObject(c)?q.merge({},c):q.isArray(c)?c.slice():c}function i(u,c,d,f){if(q.isUndefined(c)){if(!q.isUndefined(u))return r(void 0,u,d,f)}else return r(u,c,d,f)}function s(u,c){if(!q.isUndefined(c))return r(void 0,c)}function o(u,c){if(q.isUndefined(c)){if(!q.isUndefined(u))return r(void 0,u)}else return r(void 0,c)}function a(u,c,d){if(d in t)return r(u,c);if(d in e)return r(void 0,u)}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:(u,c,d)=>i(g0(u),g0(c),d,!0)};return q.forEach(Object.keys(Object.assign({},e,t)),function(c){const d=l[c]||i,f=d(e[c],t[c],c);q.isUndefined(f)&&d!==a||(n[c]=f)}),n}const Qv=e=>{const t=Fi({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:o,auth:a}=t;t.headers=o=Ht.from(o),t.url=Hv(Wv(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(q.isFormData(n)){if(Tt.hasStandardBrowserEnv||Tt.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((l=o.getContentType())!==!1){const[u,...c]=l?l.split(";").map(d=>d.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...c].join("; "))}}if(Tt.hasStandardBrowserEnv&&(r&&q.isFunction(r)&&(r=r(t)),r||r!==!1&&o5(t.url))){const u=i&&s&&a5.read(s);u&&o.set(i,u)}return t},c5=typeof XMLHttpRequest!="undefined",d5=c5&&function(e){return new Promise(function(n,r){const i=Qv(e);let s=i.data;const o=Ht.from(i.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:u}=i,c,d,f,h,g;function m(){h&&h(),g&&g(),i.cancelToken&&i.cancelToken.unsubscribe(c),i.signal&&i.signal.removeEventListener("abort",c)}let p=new XMLHttpRequest;p.open(i.method.toUpperCase(),i.url,!0),p.timeout=i.timeout;function v(){if(!p)return;const S=Ht.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),w={data:!a||a==="text"||a==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:S,config:e,request:p};Vv(function(x){n(x),m()},function(x){r(x),m()},w),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 Pe("Request aborted",Pe.ECONNABORTED,e,p)),p=null)},p.onerror=function(){r(new Pe("Network Error",Pe.ERR_NETWORK,e,p)),p=null},p.ontimeout=function(){let C=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const w=i.transitional||Uv;i.timeoutErrorMessage&&(C=i.timeoutErrorMessage),r(new Pe(C,w.clarifyTimeoutError?Pe.ETIMEDOUT:Pe.ECONNABORTED,e,p)),p=null},s===void 0&&o.setContentType(null),"setRequestHeader"in p&&q.forEach(o.toJSON(),function(C,w){p.setRequestHeader(w,C)}),q.isUndefined(i.withCredentials)||(p.withCredentials=!!i.withCredentials),a&&a!=="json"&&(p.responseType=i.responseType),u&&([f,g]=Jl(u,!0),p.addEventListener("progress",f)),l&&p.upload&&([d,h]=Jl(l),p.upload.addEventListener("progress",d),p.upload.addEventListener("loadend",h)),(i.cancelToken||i.signal)&&(c=S=>{p&&(r(!S||S.type?new no(null,e,p):S),p.abort(),p=null)},i.cancelToken&&i.cancelToken.subscribe(c),i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c)));const b=r5(i.url);if(b&&Tt.protocols.indexOf(b)===-1){r(new Pe("Unsupported protocol "+b+":",Pe.ERR_BAD_REQUEST,e));return}p.send(s||null)})},f5=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const s=function(u){if(!i){i=!0,a();const c=u instanceof Error?u:this.reason;r.abort(c instanceof Pe?c:new no(c instanceof Error?c.message:c))}};let o=t&&setTimeout(()=>{o=null,s(new Pe(`timeout ${t} of ms exceeded`,Pe.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(s):u.removeEventListener("abort",s)}),e=null)};e.forEach(u=>u.addEventListener("abort",s));const{signal:l}=r;return l.unsubscribe=()=>q.asap(a),l}},h5=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},g5=async function*(e,t){for await(const n of y5(e))yield*h5(n,t)},y5=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()}},y0=(e,t,n,r)=>{const i=g5(e,t);let s=0,o,a=l=>{o||(o=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:u,value:c}=await i.next();if(u){a(),l.close();return}let d=c.byteLength;if(n){let f=s+=d;n(f)}l.enqueue(new Uint8Array(c))}catch(u){throw a(u),u}},cancel(l){return a(l),i.return()}},{highWaterMark:2})},Du=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Yv=Du&&typeof ReadableStream=="function",m5=Du&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Xv=(e,...t)=>{try{return!!e(...t)}catch(n){return!1}},p5=Yv&&Xv(()=>{let e=!1;const t=new Request(Tt.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),m0=64*1024,Ed=Yv&&Xv(()=>q.isReadableStream(new Response("").body)),eu={stream:Ed&&(e=>e.body)};Du&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!eu[t]&&(eu[t]=q.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new Pe(`Response type '${t}' is not supported`,Pe.ERR_NOT_SUPPORT,r)})})})(new Response);const v5=async e=>{if(e==null)return 0;if(q.isBlob(e))return e.size;if(q.isSpecCompliantForm(e))return(await new Request(Tt.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(q.isArrayBufferView(e)||q.isArrayBuffer(e))return e.byteLength;if(q.isURLSearchParams(e)&&(e=e+""),q.isString(e))return(await m5(e)).byteLength},b5=async(e,t)=>{const n=q.toFiniteNumber(e.getContentLength());return n==null?v5(t):n},x5=Du&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:s,timeout:o,onDownloadProgress:a,onUploadProgress:l,responseType:u,headers:c,withCredentials:d="same-origin",fetchOptions:f}=Qv(e);u=u?(u+"").toLowerCase():"text";let h=f5([i,s&&s.toAbortSignal()],o),g;const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let p;try{if(l&&p5&&n!=="get"&&n!=="head"&&(p=await b5(c,r))!==0){let w=new Request(t,{method:"POST",body:r,duplex:"half"}),O;if(q.isFormData(r)&&(O=w.headers.get("content-type"))&&c.setContentType(O),w.body){const[x,_]=f0(p,Jl(h0(l)));r=y0(w.body,m0,x,_)}}q.isString(d)||(d=d?"include":"omit");const v="credentials"in Request.prototype;g=new Request(t,{...f,signal:h,method:n.toUpperCase(),headers:c.normalize().toJSON(),body:r,duplex:"half",credentials:v?d:void 0});let b=await fetch(g,f);const S=Ed&&(u==="stream"||u==="response");if(Ed&&(a||S&&m)){const w={};["status","statusText","headers"].forEach(k=>{w[k]=b[k]});const O=q.toFiniteNumber(b.headers.get("content-length")),[x,_]=a&&f0(O,Jl(h0(a),!0))||[];b=new Response(y0(b.body,m0,x,()=>{_&&_(),m&&m()}),w)}u=u||"text";let C=await eu[q.findKey(eu,u)||"text"](b,e);return!S&&m&&m(),await new Promise((w,O)=>{Vv(w,O,{data:C,headers:Ht.from(b.headers),status:b.status,statusText:b.statusText,config:e,request:g})})}catch(v){throw m&&m(),v&&v.name==="TypeError"&&/Load failed|fetch/i.test(v.message)?Object.assign(new Pe("Network Error",Pe.ERR_NETWORK,e,g),{cause:v.cause||v}):Pe.from(v,v&&v.code,e,g)}}),Ad={http:DC,xhr:d5,fetch:x5};q.forEach(Ad,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(n){}Object.defineProperty(e,"adapterName",{value:t})}});const p0=e=>`- ${e}`,w5=e=>q.isFunction(e)||e===null||e===!1,Zv={getAdapter:e=>{e=q.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,!w5(n)&&(r=Ad[(o=String(n)).toLowerCase()],r===void 0))throw new Pe(`Unknown adapter '${o}'`);if(r)break;i[o||"#"+s]=r}if(!r){const s=Object.entries(i).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=t?s.length>1?`since :
15
+ `+s.map(p0).join(`
16
+ `):" "+p0(s[0]):"as no adapter specified";throw new Pe("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:Ad};function vc(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new no(null,e)}function v0(e){return vc(e),e.headers=Ht.from(e.headers),e.data=pc.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Zv.getAdapter(e.adapter||za.adapter)(e).then(function(r){return vc(e),r.data=pc.call(e,e.transformResponse,r),r.headers=Ht.from(r.headers),r},function(r){return Kv(r)||(vc(e),r&&r.response&&(r.response.data=pc.call(e,e.transformResponse,r.response),r.response.headers=Ht.from(r.response.headers))),Promise.reject(r)})}const Jv="1.10.0",Iu={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Iu[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const b0={};Iu.transitional=function(t,n,r){function i(s,o){return"[Axios v"+Jv+"] Transitional option '"+s+"'"+o+(r?". "+r:"")}return(s,o,a)=>{if(t===!1)throw new Pe(i(o," has been removed"+(n?" in "+n:"")),Pe.ERR_DEPRECATED);return n&&!b0[o]&&(b0[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}};Iu.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function S5(e,t,n){if(typeof e!="object")throw new Pe("options must be an object",Pe.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 Pe("option "+s+" must be "+l,Pe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Pe("Unknown option "+s,Pe.ERR_BAD_OPTION)}}const Rl={assertOptions:S5,validators:Iu},qn=Rl.validators;let Li=class{constructor(t){this.defaults=t||{},this.interceptors={request:new c0,response:new c0}}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=Fi(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&Rl.assertOptions(r,{silentJSONParsing:qn.transitional(qn.boolean),forcedJSONParsing:qn.transitional(qn.boolean),clarifyTimeoutError:qn.transitional(qn.boolean)},!1),i!=null&&(q.isFunction(i)?n.paramsSerializer={serialize:i}:Rl.assertOptions(i,{encode:qn.function,serialize:qn.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Rl.assertOptions(n,{baseUrl:qn.spelling("baseURL"),withXsrfToken:qn.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&q.merge(s.common,s[n.method]);s&&q.forEach(["delete","get","head","post","put","patch","common"],g=>{delete s[g]}),n.headers=Ht.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let c,d=0,f;if(!l){const g=[v0.bind(this),void 0];for(g.unshift.apply(g,a),g.push.apply(g,u),f=g.length,c=Promise.resolve(n);d<f;)c=c.then(g[d++],g[d++]);return c}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{c=v0.call(this,h)}catch(g){return Promise.reject(g)}for(d=0,f=u.length;d<f;)c=c.then(u[d++],u[d++]);return c}getUri(t){t=Fi(this.defaults,t);const n=Wv(t.baseURL,t.url,t.allowAbsoluteUrls);return Hv(n,t.params,t.paramsSerializer)}};q.forEach(["delete","get","head","options"],function(t){Li.prototype[t]=function(n,r){return this.request(Fi(r||{},{method:t,url:n,data:(r||{}).data}))}});q.forEach(["post","put","patch"],function(t){function n(r){return function(s,o,a){return this.request(Fi(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}Li.prototype[t]=n(),Li.prototype[t+"Form"]=n(!0)});let C5=class e2{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 no(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 e2(function(i){t=i}),cancel:t}}};function _5(e){return function(n){return e.apply(null,n)}}function k5(e){return q.isObject(e)&&e.isAxiosError===!0}const Td={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(Td).forEach(([e,t])=>{Td[t]=e});function t2(e){const t=new Li(e),n=jv(Li.prototype.request,t);return q.extend(n,Li.prototype,t,{allOwnKeys:!0}),q.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return t2(Fi(e,i))},n}const it=t2(za);it.Axios=Li;it.CanceledError=no;it.CancelToken=C5;it.isCancel=Kv;it.VERSION=Jv;it.toFormData=Lu;it.AxiosError=Pe;it.Cancel=it.CanceledError;it.all=function(t){return Promise.all(t)};it.spread=_5;it.isAxiosError=k5;it.mergeConfig=Fi;it.AxiosHeaders=Ht;it.formToJSON=e=>Gv(q.isHTMLForm(e)?new FormData(e):e);it.getAdapter=Zv.getAdapter;it.HttpStatusCode=Td;it.default=it;const{Axios:gI,AxiosError:yI,CanceledError:mI,isCancel:pI,CancelToken:vI,VERSION:bI,all:xI,Cancel:wI,isAxiosError:SI,spread:CI,toFormData:_I,AxiosHeaders:kI,HttpStatusCode:OI,formToJSON:EI,getAdapter:AI,mergeConfig:TI}=it,O5={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function ia(e){"@babel/helpers - typeof";return ia=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},ia(e)}function Dt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,g,m,p){var v=g&&g.prototype instanceof a?g:a,b=Object.create(v.prototype);return Qt(b,"_invoke",function(S,C,w){var O,x,_,k=0,E=w||[],j=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(A,P){return O=A,x=0,_=e,M.n=P,o}};function B(R,A){for(x=R,_=A,t=0;!j&&k&&!P&&t<E.length;t++){var P,L=E[t],H=M.p,G=L[2];R>3?(P=G===A)&&(_=L[(x=L[4])?5:(x=3,3)],L[4]=L[5]=e):L[0]<=H&&((P=R<2&&H<L[1])?(x=0,M.v=A,M.n=L[1]):H<G&&(P=R<3||L[0]>A||A>G)&&(L[4]=R,L[5]=A,M.n=G,x=0))}if(P||R>1)return o;throw j=!0,A}return function(R,A,P){if(k>1)throw TypeError("Generator is already running");for(j&&A===1&&B(A,P),x=A,_=P;(t=x<2?e:_)||!j;){O||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(k=2,O){if(x||(R="next"),t=O[R]){if(!(t=t.call(O,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=O.return)&&t.call(O),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);O=e}else if((t=(j=M.n<0)?_:S.call(C,M))!==o)break}catch(L){O=e,x=1,_=L}finally{k=1}}return{value:t,done:j}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(Qt(t={},r,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,Qt(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,Qt(d,"constructor",u),Qt(u,"constructor",l),l.displayName="GeneratorFunction",Qt(u,i,"GeneratorFunction"),Qt(d),Qt(d,i,"Generator"),Qt(d,r,function(){return this}),Qt(d,"toString",function(){return"[object Generator]"}),(Dt=function(){return{w:s,m:f}})()}function Qt(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Qt=function(o,a,l,u){if(a)i?i(o,a,{value:l,enumerable:!u,configurable:!u,writable:!u}):o[a]=l;else{var c=function(f,h){Qt(o,f,function(g){return this._invoke(f,h,g)})};c("next",0),c("throw",1),c("return",2)}},Qt(e,t,n,r)}function x0(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 Di(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?x0(Object(n),!0).forEach(function(r){E5(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function E5(e,t,n){return(t=A5(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A5(e){var t=T5(e,"string");return ia(t)=="symbol"?t:t+""}function T5(e,t){if(ia(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ia(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function w0(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function Bi(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){w0(s,r,i,o,a,"next",l)}function a(l){w0(s,r,i,o,a,"throw",l)}o(void 0)})}}var n2=function(){var t;return((t=O5)===null||t===void 0?void 0:t.VITE_MYYOAST_ACCESS_TOKEN)||""};function S0(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 P5="yst-insights-token",ro=it.create({withCredentials:!0});ro.interceptors.request.use(function(){var e=Bi(Dt().m(function t(n){var r,i;return Dt().w(function(s){for(;;)switch(s.n){case 0:return s.n=1,M5();case 1:return r=s.v,s.n=2,i2();case 2:return i=s.v,n.headers=Di(Di(Di({},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});ro.interceptors.response.use(function(e){return e},function(){var e=Bi(Dt().m(function t(n){var r;return Dt().w(function(i){for(;;)switch(i.n){case 0:return n==null||(r=n.response)===null||r===void 0||r.status,i.a(2,Promise.reject(n))}},t)}));return function(t){return e.apply(this,arguments)}}());function Ct(e){return Pd.apply(this,arguments)}function Pd(){return Pd=Bi(Dt().m(function e(t){var n;return Dt().w(function(r){for(;;)switch(r.n){case 0:return n=Di({},t),delete n.baseURL,r.a(2,ro.request(Di(Di({},n),{},{withCredentials:!0})))}},e)})),Pd.apply(this,arguments)}function r2(e){ro.defaults.baseURL=e}function C0(){return ro.defaults.baseURL}function j5(e){n2=e}var mo=null;function M5(){return jd.apply(this,arguments)}function jd(){return jd=Bi(Dt().m(function e(){var t,n,r,i,s;return Dt().w(function(o){for(;;)switch(o.p=o.n){case 0:if(t=n2(),n=ro.defaults.baseURL,r=$5(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(!mo){o.n=5;break}return o.a(2,mo);case 5:return mo=Bi(Dt().m(function a(){var l,u,c,d,f;return Dt().w(function(h){for(;;)switch(h.p=h.n){case 0:return h.p=0,h.n=1,i2();case 1:return l=h.v,h.n=2,it.post(n+"/users/getToken",{},{headers:Di({Authorization:"Bearer "+t},l?{"X-XSRF-TOKEN":l}:{}),withCredentials:!0});case 2:if(u=h.v,c=u.data,!(c!=null&&c.plainTextToken)){h.n=3;break}return sessionStorage.setItem(r,JSON.stringify({value:c.plainTextToken,validUntil:Date.parse(((d=c.accessToken)===null||d===void 0?void 0:d.expires_at)||"")||Date.now()+15*60*1e3})),h.a(2,c.plainTextToken);case 3:h.n=5;break;case 4:h.p=4,f=h.v,it.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,mo=null,h.f(5);case 6:return h.a(2,"")}},a,null,[[0,4,5,6]])}))(),o.a(2,mo)}},e,null,[[1,3]])})),jd.apply(this,arguments)}function $5(e,t){var n=Array.from(e+t).reduce(function(r,i){return(r<<5)-r+i.charCodeAt(0)},0);return P5+":"+n}var po=null;function i2(){return Md.apply(this,arguments)}function Md(){return Md=Bi(Dt().m(function e(){var t;return Dt().w(function(n){for(;;)switch(n.n){case 0:if(window.location.hostname===new URL(C0()||window.location.href).hostname){n.n=1;break}return n.a(2,"");case 1:if(t=S0("XSRF-TOKEN"),!t){n.n=2;break}return n.a(2,decodeURIComponent(t));case 2:if(!po){n.n=3;break}return n.a(2,po);case 3:return po=Bi(Dt().m(function r(){var i;return Dt().w(function(s){for(;;)switch(s.p=s.n){case 0:return s.p=0,s.n=1,it.get(((i=C0())===null||i===void 0?void 0:i.replace("/api/v1",""))+"/sanctum/csrf-cookie",{withCredentials:!0});case 1:return s.a(2,decodeURIComponent(S0("XSRF-TOKEN")||""));case 2:return s.p=2,po=null,s.f(2);case 3:return s.a(2)}},r,null,[[0,,2,3]])}))(),n.a(2,po)}},e)})),Md.apply(this,arguments)}function sa(e){"@babel/helpers - typeof";return sa=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},sa(e)}function _0(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 ke(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_0(Object(n),!0).forEach(function(r){L5(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function L5(e,t,n){return(t=D5(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function D5(e){var t=I5(e,"string");return sa(t)=="symbol"?t:t+""}function I5(e,t){if(sa(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(sa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var R5=function(t,n){return Ct({url:"/brands/".concat(t,"/analysis"),method:"GET",signal:n})},jf=function(t){return["/brands/".concat(t,"/analysis")]},N5=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:jf(t),a=function(u){var c=u.signal;return R5(t,c)};return ke({queryKey:o,queryFn:a,enabled:!!t},s)};function s2(e,t,n){var r=N5(e,t),i=si(r,n);return i.queryKey=r.queryKey,i}var F5=function(t,n,r){return Ct({url:"/brands/".concat(t,"/analysis/").concat(n),method:"GET",signal:r})},Zn=function(t,n){return["/brands/".concat(t,"/analysis/").concat(n)]},B5=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:Zn(t,n),l=function(c){var d=c.signal;return F5(t,n,d)};return ke({queryKey:a,queryFn:l,enabled:!!(t&&n)},o)};function Ru(e,t,n,r){var i=B5(e,t,n),s=si(i,r);return s.queryKey=i.queryKey,s}var q5=function(t,n){return Ct({url:"/brands/".concat(t,"/analysis/").concat(n),method:"DELETE"})},z5=function(t){var n=["deleteSingleAnalysis"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:ke(ke({},t),{},{mutation:ke(ke({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},u=l.brandId,c=l.analysisId;return q5(u,c)};return ke({mutationFn:s},i)},H5=function(t,n){var r=z5(t);return kr(r,n)},U5=function(t,n,r){return Ct({url:"/brands/".concat(t,"/analysis/").concat(n,"/status"),method:"GET",signal:r})},yr=function(t,n){return["/brands/".concat(t,"/analysis/").concat(n,"/status")]},G5=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:yr(t,n),l=function(c){var d=c.signal;return U5(t,n,d)};return ke({queryKey:a,queryFn:l,enabled:!!(t&&n)},o)};function K5(e,t,n,r){var i=G5(e,t,n),s=si(i,r);return s.queryKey=i.queryKey,s}var V5=function(t){return Ct({url:"/users/logout",method:"POST",signal:t})},W5=function(t){var n=["logout"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:ke(ke({},t),{},{mutation:ke(ke({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(){return V5()};return ke({mutationFn:s},i)},Q5=function(t,n){var r=W5(t);return kr(r,n)},Y5=function(t,n){return Ct({url:"/brands/".concat(t,"/associated-brands"),method:"GET",signal:n})},tu=function(t){return["/brands/".concat(t,"/associated-brands")]},X5=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:tu(t),a=function(u){var c=u.signal;return Y5(t,c)};return ke({queryKey:o,queryFn:a,enabled:!!t},s)};function Z5(e,t,n){var r=X5(e,t),i=si(r,n);return i.queryKey=r.queryKey,i}var J5=function(t,n,r){return Ct({url:"/brands/".concat(t,"/associated-brand-groups"),method:"POST",headers:{"Content-Type":"application/json"},data:n,signal:r})},e4=function(t){var n=["createBrandAssociationGroup"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:ke(ke({},t),{},{mutation:ke(ke({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},u=l.brandId,c=l.data;return J5(u,c)};return ke({mutationFn:s},i)},o2=function(t,n){var r=e4(t);return kr(r,n)},t4=function(t,n){return Ct({url:"/brands/".concat(t,"/associated-brand-groups/").concat(n),method:"DELETE"})},n4=function(t){var n=["deleteBrandAssociationGroup"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:ke(ke({},t),{},{mutation:ke(ke({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},u=l.brandId,c=l.brandGroupId;return t4(u,c)};return ke({mutationFn:s},i)},r4=function(t,n){var r=n4(t);return kr(r,n)},i4=function(t){return Ct({url:"/brands",method:"GET",signal:t})},Xn=function(){return["/brands"]},s4=function(t){var n,r=t!=null?t:{},i=r.query,s=(n=i==null?void 0:i.queryKey)!==null&&n!==void 0?n:Xn(),o=function(l){var u=l.signal;return i4(u)};return ke({queryKey:s,queryFn:o},i)};function Qi(e,t){var n=s4(e),r=si(n,t);return r.queryKey=n.queryKey,r}var o4=function(t,n){return Ct({url:"/brands",method:"POST",headers:{"Content-Type":"application/json"},data:t,signal:n})},a4=function(t){var n=["createBrand"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:ke(ke({},t),{},{mutation:ke(ke({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},u=l.data;return o4(u)};return ke({mutationFn:s},i)},l4=function(t,n){var r=a4(t);return kr(r,n)},u4=function(t,n){return Ct({url:"/brands/".concat(t),method:"GET",signal:n})},Mf=function(t){return["/brands/".concat(t)]},c4=function(t,n){var r,i=n!=null?n:{},s=i.query,o=(r=s==null?void 0:s.queryKey)!==null&&r!==void 0?r:Mf(t),a=function(u){var c=u.signal;return u4(t,c)};return ke({queryKey:o,queryFn:a,enabled:!!t},s)};function nu(e,t,n){var r=c4(e,t),i=si(r,n);return i.queryKey=r.queryKey,i}var d4=function(t){return Ct({url:"/brands/".concat(t),method:"DELETE"})},f4=function(t){var n=["deleteBrand"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:ke(ke({},t),{},{mutation:ke(ke({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},u=l.brandId;return d4(u)};return ke({mutationFn:s},i)},h4=function(t,n){var r=f4(t);return kr(r,n)},g4=function(t,n){return Ct({url:"/brands/".concat(t,"/settings"),method:"PATCH",headers:{"Content-Type":"application/json"},data:n})},y4=function(t){var n=["updateBrandSettings"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:ke(ke({},t),{},{mutation:ke(ke({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},u=l.brandId,c=l.data;return g4(u,c)};return ke({mutationFn:s},i)},a2=function(t,n){var r=y4(t);return kr(r,n)},m4=function(t,n){return Ct({url:"/brands/".concat(t,"/queries"),method:"PUT",headers:{"Content-Type":"application/json"},data:n})},p4=function(t){var n=["updateBrandQueries"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:ke(ke({},t),{},{mutation:ke(ke({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(a){var l=a!=null?a:{},u=l.brandId,c=l.data;return m4(u,c)};return ke({mutationFn:s},i)},v4=function(t,n){var r=p4(t);return kr(r,n)},b4=function(t,n){return Ct({url:"/brands/".concat(t,"/query-suggestions"),method:"GET",signal:n})},x4=function(t){return["/brands/".concat(t,"/query-suggestions")]},w4=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:x4(t),a=function(u){var c=u.signal;return b4(t,c)};return ke({queryKey:o,queryFn:a,enabled:!!t},s)};function S4(e,t,n){var r=w4(e,t),i=si(r,n);return i.queryKey=r.queryKey,i}var C4=function(t){return Ct({url:"/users/current",method:"GET",signal:t})},Nu=function(){return["/users/current"]},_4=function(t){var n,r=t!=null?t:{},i=r.query,s=(n=i==null?void 0:i.queryKey)!==null&&n!==void 0?n:Nu(),o=function(l){var u=l.signal;return C4(u)};return ke({queryKey:s,queryFn:o},i)};function Fu(e,t){var n=_4(e),r=si(n,t);return r.queryKey=n.queryKey,r}var k4=function(){return Ct({url:"/users/data",method:"DELETE"})},O4=function(t){var n=["deleteUserData"],r=t?t.mutation&&"mutationKey"in t.mutation&&t.mutation.mutationKey?t:ke(ke({},t),{},{mutation:ke(ke({},t.mutation),{},{mutationKey:n})}):{mutation:{mutationKey:n}},i=r.mutation,s=function(){return k4()};return ke({mutationFn:s},i)},E4=function(t,n){var r=O4(t);return kr(r,n)},l2=z.createContext(void 0),A4=function(t){var n,r,i,s,o,a,l,u,c=t.children,d=t.brandId,f=t.analysisId,h=t.model,g=t.hostAppProps,m=g===void 0?{}:g,p=rl("/brands/:brandId"),v=rl("/brands/:brandId/*"),b=rl("/brands/:brandId/analysis/:analysisId"),S=rl("/brands/:brandId/analysis/:analysisId/*"),C=(b==null||(n=b.params)===null||n===void 0?void 0:n.brandId)||(S==null||(r=S.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),w=b!=null&&(o=b.params)!==null&&o!==void 0&&o.analysisId||S!=null&&(a=S.params)!==null&&a!==void 0&&a.analysisId?Number((b==null||(l=b.params)===null||l===void 0?void 0:l.analysisId)||(S==null||(u=S.params)===null||u===void 0?void 0:u.analysisId)):void 0,O=z.useMemo(function(){return{brandId:C||d||"",analysisId:w||f||"latest",model:h||"openai",hostAppProps:m}},[C,d,w,f,h,m]),x=z.useMemo(function(){return{data:O}},[O]);return y.jsx(l2.Provider,{value:x,children:c})},u2=z.createContext(void 0),T4=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]),u=z.useMemo(function(){return{setBrandId:o,setAnalysisId:a,setModel:l}},[o,a,l]),c=z.useMemo(function(){return{mutations:u}},[u]);return y.jsx(u2.Provider,{value:c,children:n})};function bc(e,t){return $4(e)||M4(e,t)||j4(e,t)||P4()}function P4(){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 j4(e,t){if(e){if(typeof e=="string")return k0(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)?k0(e,t):void 0}}function k0(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 M4(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function $4(e){if(Array.isArray(e))return e}var L4=function(t){var n=t.children,r=t.hostAppProps,i=r===void 0?{}:r,s=z.useState(void 0),o=bc(s,2),a=o[0],l=o[1],u=z.useState("latest"),c=bc(u,2),d=c[0],f=c[1],h=z.useState(void 0),g=bc(h,2),m=g[0],p=g[1];return y.jsx(T4,{brandId:a,setBrandId:l,analysisId:d,setAnalysisId:f,model:m,setModel:p,children:y.jsx(A4,{brandId:a,analysisId:d,model:m,hostAppProps:i,children:n})})},Nn=function(){var t=z.useContext(l2);if(t===void 0)throw new Error("useBrandAnalysisData must be used within a BrandAnalysisDataProvider");return t.data},Ha=function(){var t=z.useContext(u2);if(t===void 0)throw new Error("useBrandAnalysisMutations must be used within a BrandAnalysisMutationsProvider");return t.mutations},xc={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 _0;function j4(){return _0||(_0=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})()}(pc)),pc.exports}var M4=j4();const Oe=mp(M4);var $4=function(t){return G5({mutation:{onSettled:function(){t&&t()}}})};function L4(e,t){return I.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),I.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 D4=I.forwardRef(L4);function I4(e,t){return I.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),I.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"}))}const R4=I.forwardRef(I4);function N4(e,t){return I.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),I.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"}))}const F4=I.forwardRef(N4);function B4(e,t){return I.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),I.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"}))}const q4=I.forwardRef(B4);function z4(e,t){return I.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),I.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"}),I.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))}const H4=I.forwardRef(z4);function U4(e,t){return I.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),I.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 G4=I.forwardRef(U4);function V4(e,t){return I.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),I.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 K4=I.forwardRef(V4);function W4(e,t){return I.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),I.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 o2=I.forwardRef(W4);function Q4(e,t){return I.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),I.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 Y4=I.forwardRef(Q4);function X4(e,t){return I.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),I.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 a2=I.forwardRef(X4);function Z4(e,t){return I.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),I.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"}))}const l2=I.forwardRef(Z4);function J4(e,t){return I.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),I.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 e6=I.forwardRef(J4);function t6(e,t){return I.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),I.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 n6=I.forwardRef(t6);function r6(e,t){return I.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),I.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 i6=I.forwardRef(r6);function s6(e,t){return I.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),I.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 jf=I.forwardRef(s6);function o6(e,t){return I.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),I.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 a6=I.forwardRef(o6);var l6=function(){return[{label:"Brand analysis",href:"/",Icon:e6,isActive:function(n){return n.startsWith("/setup")||n==="/"},showInMenu:!0},{label:"Settings",href:"/settings",Icon:H4,isActive:function(n){return n.startsWith("/settings")},showInMenu:!0}]},k0;function u6(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var O0=function(t){var n=t.className,r=Ut(),i=r.pathname,s=l6();return y.jsx("div",{className:Oe("yst-flex yst-flex-col yst-gap-10",n),children:y.jsx(T.SidebarNavigation.Sidebar,{children:y.jsx(T.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(T.SidebarNavigation.SubmenuItem,{className:Oe("yst-flex yst-gap-x-3",{"yst-sidebar-navigation__item--active":a}),href:o.href,to:o.href,as:ti,label:y.jsxs(y.Fragment,{children:[y.jsx(o.Icon,{className:Oe(k0||(k0=u6(["yst-sidebar-navigation__icon yst-h-6 yst-w-6"])))}),o.label]})},o.label)})})})})};const c6="data:image/svg+xml,%3csvg%20width='208'%20height='42'%20viewBox='0%200%20208%2042'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='169'%20width='39'%20height='16'%20rx='8'%20fill='%23BFDBFE'/%3e%3cpath%20d='M177.869%2012V4.9541H180.813C182.151%204.9541%20182.957%205.62793%20182.957%206.70703V6.7168C182.957%207.4541%20182.41%208.1084%20181.702%208.2207V8.30859C182.649%208.39648%20183.304%209.08008%20183.304%209.99316V10.0029C183.304%2011.2383%20182.386%2012%20180.882%2012H177.869ZM180.506%205.93555H179.129V7.92285H180.345C181.238%207.92285%20181.712%207.57617%20181.712%206.93652V6.92676C181.712%206.30176%20181.268%205.93555%20180.506%205.93555ZM180.545%208.81641H179.129V11.0186H180.594C181.521%2011.0186%20182.015%2010.6328%20182.015%209.91504V9.90527C182.015%209.19238%20181.507%208.81641%20180.545%208.81641ZM186.834%2012.1074C185.247%2012.1074%20184.285%2011.043%20184.285%209.34375V9.33887C184.285%207.65918%20185.257%206.56055%20186.775%206.56055C188.294%206.56055%20189.231%207.625%20189.231%209.23633V9.63672H185.501C185.516%2010.5938%20186.033%2011.1504%20186.858%2011.1504C187.518%2011.1504%20187.894%2010.8184%20188.011%2010.5742L188.025%2010.54H189.183L189.168%2010.584C188.997%2011.2725%20188.284%2012.1074%20186.834%2012.1074ZM186.79%207.5127C186.111%207.5127%20185.604%207.97168%20185.511%208.82129H188.045C187.962%207.94727%20187.469%207.5127%20186.79%207.5127ZM192.547%2012.0244C191.321%2012.0244%20190.818%2011.6143%20190.818%2010.584V7.60547H189.988V6.66309H190.818V5.35449H192.054V6.66309H193.182V7.60547H192.054V10.2959C192.054%2010.8281%20192.264%2011.0527%20192.771%2011.0527C192.942%2011.0527%20193.035%2011.0479%20193.182%2011.0332V11.9707C193.006%2012.0049%20192.781%2012.0244%20192.547%2012.0244ZM195.848%2012.0879C194.832%2012.0879%20194.095%2011.4629%20194.095%2010.4912V10.4814C194.095%209.5293%20194.822%208.97266%20196.121%208.89453L197.493%208.81152V8.35254C197.493%207.82031%20197.146%207.52734%20196.492%207.52734C195.936%207.52734%20195.574%207.72754%20195.452%208.0791L195.447%208.09863H194.3L194.305%208.05469C194.422%207.15625%20195.281%206.56055%20196.551%206.56055C197.923%206.56055%20198.694%207.22461%20198.694%208.35254V12H197.493V11.2676H197.41C197.117%2011.7852%20196.551%2012.0879%20195.848%2012.0879ZM195.296%2010.4326C195.296%2010.8867%20195.682%2011.1553%20196.219%2011.1553C196.951%2011.1553%20197.493%2010.6768%20197.493%2010.042V9.6123L196.292%209.69043C195.613%209.73438%20195.296%209.9834%20195.296%2010.4229V10.4326Z'%20fill='%231E3A8A'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M22.5037%2019.2842C22.9203%2019.2842%2023.2881%2019.5608%2023.402%2019.9612L24.4143%2023.5057C24.857%2025.0583%2026.071%2026.2724%2027.6236%2026.715L31.1682%2027.7273C31.6629%2027.8705%2031.9526%2028.3881%2031.8094%2028.8828C31.7215%2029.192%2031.4774%2029.4361%2031.1682%2029.524L27.6236%2030.5363C26.071%2030.9789%2024.857%2032.193%2024.4143%2033.7456L23.402%2037.2901C23.2588%2037.7849%2022.7413%2038.0745%2022.2466%2037.9313C21.9373%2037.8434%2021.6932%2037.5993%2021.6053%2037.2901L20.5931%2033.7456C20.1504%2032.193%2018.9364%2030.9789%2017.3838%2030.5363L13.8392%2029.524C13.3445%2029.3808%2013.0548%2028.8633%2013.198%2028.3685C13.2859%2028.0593%2013.53%2027.8152%2013.8392%2027.7273L17.3838%2026.715C18.9364%2026.2724%2020.1504%2025.0583%2020.5931%2023.5057L21.6053%2019.9612C21.7193%2019.5608%2022.0871%2019.2842%2022.5037%2019.2842Z'%20fill='url(%23paint0_radial_4548_14216)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13.3742%2012C13.6573%2012%2013.9047%2012.192%2013.9731%2012.4654L14.1846%2013.315C14.3799%2014.0864%2014.9821%2014.6918%2015.7535%2014.8838L16.603%2015.0954C16.9318%2015.1768%2017.1335%2015.512%2017.0522%2015.8407C16.9968%2016.0621%2016.8243%2016.2346%2016.603%2016.2899L15.7535%2016.5015C14.9821%2016.6968%2014.3767%2017.2989%2014.1846%2018.0703L13.9731%2018.9199C13.8917%2019.2486%2013.5564%2019.4504%2013.2277%2019.369C13.0064%2019.3137%2012.8339%2019.1412%2012.7785%2018.9199L12.567%2018.0703C12.3749%2017.2989%2011.7695%2016.6935%2010.9981%2016.5015L10.1486%2016.2899C9.81986%2016.2085%209.61805%2015.8733%209.69943%2015.5446C9.75476%2015.3232%209.92727%2015.1507%2010.1486%2015.0954L10.9981%2014.8838C11.7695%2014.6918%2012.3749%2014.0864%2012.567%2013.315L12.7785%2012.4654C12.8469%2012.192%2013.0943%2012%2013.3774%2012H13.3742Z'%20fill='url(%23paint1_radial_4548_14216)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.39254%2026.8813C6.54226%2026.8813%206.67571%2026.979%206.72453%2027.1189L6.90681%2027.669C6.97516%2027.8773%207.1379%2028.0401%207.34947%2028.1117L7.89954%2028.294C8.08181%2028.3558%208.17946%2028.5543%208.12087%2028.7366C8.08507%2028.8408%208.0037%2028.9222%207.89954%2028.958L7.34947%2029.1402C7.14116%2029.2086%206.97841%2029.3713%206.90681%2029.5829L6.72453%2030.133C6.66269%2030.3152%206.46414%2030.4129%206.28187%2030.3543C6.17771%2030.3185%206.09634%2030.2371%206.06054%2030.133L5.87827%2029.5829C5.80992%2029.3746%205.64392%2029.2118%205.4356%2029.1402L4.88553%2028.958C4.70326%2028.8961%204.60561%2028.6976%204.6642%2028.5153C4.7%2028.4111%204.78138%2028.3298%204.88553%2028.294L5.4356%2028.1117C5.64392%2028.0433%205.80666%2027.8806%205.87827%2027.669L6.06054%2027.1189C6.10936%2026.9757%206.24281%2026.8813%206.39254%2026.8813Z'%20fill='url(%23paint2_radial_4548_14216)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2.80904%2033.5596C2.95876%2033.5596%203.09221%2033.6572%203.14104%2033.7972L3.32331%2034.3473C3.39166%2034.5556%203.5544%2034.7183%203.76597%2034.7899L4.31604%2034.9722C4.49832%2035.034%204.59596%2035.2326%204.53737%2035.4148C4.50157%2035.519%204.4202%2035.6004%204.31604%2035.6362L3.76597%2035.8185C3.55766%2035.8868%203.39492%2036.0495%203.32331%2036.2611L3.14104%2036.8112C3.07919%2036.9935%202.88065%2037.0911%202.69837%2037.0325C2.59422%2036.9967%202.51285%2036.9153%202.47704%2036.8112L2.29477%2036.2611C2.22642%2036.0528%202.06042%2035.8901%201.85211%2035.8185L1.30204%2035.6362C1.11976%2035.5743%201.02212%2035.3758%201.0807%2035.1935C1.11651%2035.0894%201.19788%2035.008%201.30204%2034.9722L1.85211%2034.7899C2.06042%2034.7216%202.22316%2034.5588%202.29477%2034.3473L2.47704%2033.7972C2.52587%2033.654%202.65931%2033.5596%202.80904%2033.5596Z'%20fill='url(%23paint3_radial_4548_14216)'/%3e%3cpath%20d='M2.42488%2032.7235C1.94641%2031.4476%201.68277%2030.0676%201.68277%2028.6256C1.68277%2023.5806%204.89532%2019.2712%209.38379%2017.634L8.79466%2016.0586C3.66498%2017.9269%200%2022.8483%200%2028.6256C0%2030.2661%200.296193%2031.835%200.836502%2033.2866L2.42488%2032.7268V32.7235Z'%20fill='url(%23paint4_radial_4548_14216)'/%3e%3cpath%20d='M20.6587%2037.7652C18.6602%2039.3633%2016.1279%2040.3202%2013.3743%2040.3202C10.0023%2040.3202%206.96221%2038.8849%204.82702%2036.5967L3.58691%2037.7359C6.02807%2040.3593%209.51078%2041.9998%2013.3776%2041.9998C16.5218%2041.9998%2019.4121%2040.9159%2021.6938%2039.0997L20.662%2037.7684L20.6587%2037.7652Z'%20fill='url(%23paint5_radial_4548_14216)'/%3e%3cpath%20d='M13.3739%2022.3664C15.0436%2022.3664%2016.5604%2023.0238%2017.6833%2024.0914L18.8095%2022.8383C17.3904%2021.5038%2015.4798%2020.6836%2013.3771%2020.6836C9.89444%2020.6836%206.93902%2022.9262%205.86816%2026.0476L7.44678%2026.627C8.28328%2024.1533%2010.6235%2022.3631%2013.3771%2022.3631L13.3739%2022.3664Z'%20fill='url(%23paint6_radial_4548_14216)'/%3e%3cpath%20d='M17.6737%2033.1658C16.5508%2034.2301%2015.0373%2034.8843%2013.3741%2034.8843C10.6074%2034.8843%208.2574%2033.0811%207.43392%2030.5879L5.84229%2031.1249C6.89035%2034.2822%209.8653%2036.5638%2013.3773%2036.5638C15.4832%2036.5638%2017.3971%2035.7436%2018.8162%2034.4059L17.677%2033.169L17.6737%2033.1658Z'%20fill='url(%23paint7_radial_4548_14216)'/%3e%3cpath%20d='M39.169%2021.2891H43.677C45.7666%2021.2891%2047.2802%2021.595%2048.2111%2022.2037C49.142%2022.8123%2049.6074%2023.7758%2049.6074%2025.0908C49.6074%2025.9761%2049.3796%2026.7149%2048.9206%2027.3041C48.4617%2027.8932%2047.8075%2028.2642%2046.9482%2028.414V28.5181C48.0158%2028.7199%2048.8002%2029.1138%2049.3014%2029.7062C49.8027%2030.2985%2050.0533%2031.0992%2050.0533%2032.1115C50.0533%2033.4753%2049.5781%2034.5429%2048.6244%2035.3143C47.6707%2036.0857%2046.3493%2036.473%2044.6502%2036.473H39.1658V21.2891H39.169ZM41.6525%2027.5645H44.0416C45.0799%2027.5645%2045.8383%2027.3985%2046.3167%2027.0697C46.7952%2026.741%2047.0328%2026.1811%2047.0328%2025.3935C47.0328%2024.6806%2046.7757%2024.1631%2046.2581%2023.8474C45.7406%2023.5284%2044.9236%2023.3689%2043.8007%2023.3689H41.6492V27.5645H41.6525ZM41.6525%2029.5792V34.3867H44.2889C45.3272%2034.3867%2046.1117%2034.1881%2046.6422%2033.791C47.1728%2033.3939%2047.4364%2032.7657%2047.4364%2031.9065C47.4364%2031.1188%2047.1662%2030.5329%2046.6259%2030.1521C46.0856%2029.7713%2045.2654%2029.5792%2044.1653%2029.5792H41.6525Z'%20fill='url(%23paint8_linear_4548_14216)'/%3e%3cpath%20d='M58.7762%2024.7817C59.2677%2024.7817%2059.6713%2024.8175%2059.9902%2024.8859L59.7526%2027.161C59.4076%2027.0764%2059.0463%2027.0374%2058.672%2027.0374C57.6955%2027.0374%2056.9046%2027.3563%2056.2992%2027.9943C55.6938%2028.6322%2055.3911%2029.459%2055.3911%2030.4778V36.4797H52.95V24.9933H54.8606L55.1828%2027.0178H55.3065C55.6873%2026.3311%2056.1853%2025.7908%2056.7972%2025.3871C57.4091%2024.9868%2058.0699%2024.785%2058.7762%2024.785V24.7817Z'%20fill='url(%23paint9_linear_4548_14216)'/%3e%3cpath%20d='M69.309%2036.4734L68.8208%2034.8753H68.7394C68.1861%2035.575%2067.6295%2036.0503%2067.0664%2036.3041C66.5065%2036.558%2065.784%2036.685%2064.9051%2036.685C63.7757%2036.685%2062.8969%2036.379%2062.2622%2035.7703C61.6275%2035.1617%2061.3118%2034.2991%2061.3118%2033.186C61.3118%2032.0012%2061.7512%2031.1094%2062.63%2030.5072C63.5088%2029.9051%2064.8498%2029.5763%2066.6498%2029.521L68.632%2029.4591V28.8472C68.632%2028.1116%2068.4595%2027.5648%2068.1177%2027.2003C67.7759%2026.8357%2067.2421%2026.6534%2066.5228%2026.6534C65.9337%2026.6534%2065.3706%2026.7413%2064.8303%2026.9138C64.29%2027.0864%2063.7692%2027.2914%2063.2712%2027.5258L62.4803%2025.7811C63.1019%2025.4557%2063.7855%2025.2083%2064.5276%2025.039C65.2697%2024.8698%2065.9662%2024.7852%2066.627%2024.7852C68.0884%2024.7852%2069.1918%2025.1041%2069.9339%2025.7421C70.6793%2026.38%2071.0503%2027.3793%2071.0503%2028.7431V36.4799H69.3057L69.309%2036.4734ZM65.6733%2034.8134C66.5586%2034.8134%2067.2714%2034.566%2067.8085%2034.0713C68.3455%2033.5766%2068.6124%2032.8833%2068.6124%2031.9882V30.9922L67.138%2031.054C65.989%2031.0963%2065.1525%2031.2884%2064.6285%2031.6301C64.1044%2031.9719%2063.8441%2032.4992%2063.8441%2033.2055C63.8441%2033.7165%2063.997%2034.1136%2064.2997%2034.3935C64.6057%2034.6734%2065.0614%2034.8134%2065.67%2034.8134H65.6733Z'%20fill='url(%23paint10_linear_4548_14216)'/%3e%3cpath%20d='M84.5646%2036.4732H82.1137V29.4102C82.1137%2028.5248%2081.9347%2027.8641%2081.5799%2027.4279C81.2219%2026.9918%2080.6588%2026.7737%2079.8809%2026.7737C78.8491%2026.7737%2078.0939%2027.0797%2077.6155%2027.6883C77.137%2028.297%2076.8994%2029.319%2076.8994%2030.7512V36.4732H74.4583V24.9868H76.3689L76.7106%2026.4938H76.8343C77.1793%2025.947%2077.6708%2025.5238%2078.3088%2025.2277C78.9467%2024.9315%2079.653%2024.7817%2080.4277%2024.7817C83.1846%2024.7817%2084.5614%2026.1846%2084.5614%2028.987V36.4765L84.5646%2036.4732Z'%20fill='url(%23paint11_linear_4548_14216)'/%3e%3cpath%20d='M91.836%2036.6814C90.4038%2036.6814%2089.2841%2036.1606%2088.4802%2035.1223C87.6762%2034.084%2087.2759%2032.6258%2087.2759%2030.751C87.2759%2028.8762%2087.6827%2027.4018%2088.4965%2026.3537C89.3102%2025.3056%2090.4364%2024.7816%2091.8783%2024.7816C93.3202%2024.7816%2094.5375%2025.3382%2095.3252%2026.4546H95.4489C95.3317%2025.6311%2095.2731%2024.9802%2095.2731%2024.5017V20.3159H97.724V36.4763H95.8134L95.387%2034.9693H95.2731C94.4919%2036.1118%2093.3462%2036.6847%2091.836%2036.6847V36.6814ZM92.4902%2034.709C93.4927%2034.709%2094.225%2034.4258%2094.6807%2033.8627C95.1364%2033.2996%2095.374%2032.3817%2095.387%2031.1156V30.7738C95.387%2029.3254%2095.1527%2028.2969%2094.6807%2027.6882C94.2088%2027.0795%2093.4732%2026.7736%2092.4674%2026.7736C91.6081%2026.7736%2090.9474%2027.1219%2090.4852%2027.8184C90.023%2028.5149%2089.7886%2029.5044%2089.7886%2030.7933C89.7886%2032.0823%2090.0132%2033.0392%2090.4624%2033.7065C90.9116%2034.3737%2091.5886%2034.709%2092.4869%2034.709H92.4902Z'%20fill='url(%23paint12_linear_4548_14216)'/%3e%3cpath%20d='M106.997%2036.473V21.2891H109.481V36.473H106.997Z'%20fill='url(%23paint13_linear_4548_14216)'/%3e%3cpath%20d='M123.334%2036.4732H120.883V29.4102C120.883%2028.5248%20120.704%2027.8641%20120.349%2027.4279C119.991%2026.9918%20119.428%2026.7737%20118.65%2026.7737C117.618%2026.7737%20116.863%2027.0797%20116.385%2027.6883C115.906%2028.297%20115.668%2029.319%20115.668%2030.7512V36.4732H113.227V24.9868H115.138L115.48%2026.4938H115.603C115.948%2025.947%20116.44%2025.5238%20117.078%2025.2277C117.716%2024.9315%20118.422%2024.7817%20119.197%2024.7817C121.954%2024.7817%20123.33%2026.1846%20123.33%2028.987V36.4765L123.334%2036.4732Z'%20fill='url(%23paint14_linear_4548_14216)'/%3e%3cpath%20d='M134.449%2033.2019C134.449%2034.3249%20134.039%2035.1841%20133.222%2035.783C132.405%2036.3819%20131.233%2036.6814%20129.71%2036.6814C128.187%2036.6814%20126.95%2036.4503%20126.022%2035.9848V33.8757C127.373%2034.4974%20128.629%2034.8098%20129.791%2034.8098C131.295%2034.8098%20132.044%2034.3574%20132.044%2033.4493C132.044%2033.1596%20131.959%2032.9155%20131.793%2032.7235C131.627%2032.5314%20131.354%2032.3296%20130.973%2032.1213C130.592%2031.913%20130.062%2031.6786%20129.385%2031.415C128.063%2030.904%20127.168%2030.3897%20126.699%2029.8787C126.231%2029.3677%20126%2028.7004%20126%2027.8835C126%2026.9005%20126.397%2026.1389%20127.188%2025.592C127.982%2025.0485%20129.059%2024.7783%20130.423%2024.7783C131.787%2024.7783%20133.05%2025.0517%20134.254%2025.5986L133.466%2027.4376C132.226%2026.9265%20131.185%2026.6694%20130.342%2026.6694C129.053%2026.6694%20128.411%2027.0372%20128.411%2027.7695C128.411%2028.1308%20128.581%2028.4335%20128.916%2028.6842C129.251%2028.9348%20129.983%2029.2766%20131.113%2029.7127C132.06%2030.0805%20132.75%2030.4158%20133.18%2030.7217C133.609%2031.0277%20133.928%2031.3792%20134.137%2031.7763C134.345%2032.1734%20134.449%2032.6519%20134.449%2033.2052V33.2019Z'%20fill='url(%23paint15_linear_4548_14216)'/%3e%3cpath%20d='M136.939%2021.9434C136.939%2021.5072%20137.059%2021.172%20137.297%2020.9344C137.535%2020.6968%20137.876%2020.5796%20138.319%2020.5796C138.762%2020.5796%20139.081%2020.6968%20139.322%2020.9344C139.562%2021.1687%20139.68%2021.504%20139.68%2021.9434C139.68%2022.3828%20139.559%2022.6855%20139.322%2022.9264C139.084%2023.164%20138.749%2023.2844%20138.319%2023.2844C137.889%2023.2844%20137.535%2023.164%20137.297%2022.9264C137.059%2022.6887%20136.939%2022.36%20136.939%2021.9434ZM139.527%2036.4731H137.085V24.9867H139.527V36.4731Z'%20fill='url(%23paint16_linear_4548_14216)'/%3e%3cpath%20d='M152.715%2024.987V26.328L150.752%2026.6925C150.931%2026.9334%20151.081%2027.2328%20151.198%2027.5843C151.316%2027.9359%20151.374%2028.3102%20151.374%2028.7073C151.374%2029.892%20150.964%2030.8229%20150.147%2031.5C149.33%2032.177%20148.204%2032.5187%20146.772%2032.5187C146.404%2032.5187%20146.072%2032.4927%20145.776%2032.4373C145.248%2032.7628%20144.988%2033.1437%20144.988%2033.5798C144.988%2033.8435%20145.112%2034.0387%20145.356%2034.1722C145.603%2034.3024%20146.052%2034.3707%20146.71%2034.3707H148.715C149.981%2034.3707%20150.945%2034.6409%20151.602%2035.1812C152.259%2035.7215%20152.588%2036.4994%20152.588%2037.5182C152.588%2038.8202%20152.051%2039.8227%20150.977%2040.529C149.903%2041.2353%20148.354%2041.5868%20146.326%2041.5868C144.76%2041.5868%20143.566%2041.3101%20142.742%2040.7568C141.919%2040.2035%20141.505%2039.4125%20141.505%2038.3905C141.505%2037.6842%20141.73%2037.0918%20142.176%2036.6101C142.622%2036.1284%20143.247%2035.7964%20144.051%2035.6076C143.725%2035.4676%20143.455%2035.2463%20143.247%2034.9371C143.035%2034.6279%20142.931%2034.3056%20142.931%2033.9671C142.931%2033.5375%20143.051%2033.173%20143.296%2032.8768C143.54%2032.5806%20143.898%2032.2844%20144.376%2031.9947C143.781%2031.7376%20143.299%2031.3209%20142.928%2030.7416C142.557%2030.1655%20142.371%2029.4884%20142.371%2028.7105C142.371%2027.4639%20142.765%2026.4972%20143.549%2025.8137C144.334%2025.1269%20145.454%2024.7852%20146.908%2024.7852C147.234%2024.7852%20147.576%2024.8079%20147.93%2024.8535C148.289%2024.8991%20148.555%2024.9446%20148.734%2024.9935H152.712L152.715%2024.987ZM143.689%2038.2603C143.689%2038.7876%20143.927%2039.1912%20144.402%2039.4744C144.877%2039.7576%20145.541%2039.9008%20146.401%2039.9008C147.729%2039.9008%20148.721%2039.7087%20149.372%2039.3279C150.023%2038.9471%20150.349%2038.4426%20150.349%2037.8111C150.349%2037.3131%20150.17%2036.9584%20149.815%2036.7468C149.457%2036.5352%20148.796%2036.4311%20147.826%2036.4311H145.978C145.278%2036.4311%20144.721%2036.5971%20144.311%2036.9258C143.898%2037.2546%20143.693%2037.7005%20143.693%2038.2603H143.689ZM144.741%2028.7073C144.741%2029.4266%20144.926%2029.9799%20145.297%2030.3705C145.668%2030.7578%20146.199%2030.9531%20146.892%2030.9531C148.305%2030.9531%20149.011%2030.198%20149.011%2028.6877C149.011%2027.9391%20148.835%2027.363%20148.487%2026.9594C148.139%2026.5558%20147.605%2026.3507%20146.892%2026.3507C146.179%2026.3507%20145.652%2026.5526%20145.288%2026.9529C144.923%2027.3532%20144.741%2027.9391%20144.741%2028.7073Z'%20fill='url(%23paint17_linear_4548_14216)'/%3e%3cpath%20d='M164.95%2036.4729H162.499V29.4099C162.499%2028.5245%20162.32%2027.8638%20161.965%2027.4276C161.607%2026.9915%20161.044%2026.7734%20160.266%2026.7734C159.241%2026.7734%20158.489%2027.0794%20158.007%2027.6913C157.526%2028.3032%20157.285%2029.3317%20157.285%2030.7704V36.4729H154.844V20.3125H157.285V24.4136C157.285%2025.0711%20157.243%2025.7742%20157.161%2026.5228H157.317C157.649%2025.9695%20158.112%2025.5398%20158.704%2025.2339C159.296%2024.9279%20159.986%2024.7782%20160.774%2024.7782C163.557%2024.7782%20164.95%2026.181%20164.95%2028.9835V36.4729Z'%20fill='url(%23paint18_linear_4548_14216)'/%3e%3cpath%20d='M172.625%2034.709C173.221%2034.709%20173.816%2034.6146%20174.412%2034.4291V36.2681C174.142%2036.3853%20173.794%2036.4829%20173.367%2036.5643C172.941%2036.6424%20172.501%2036.6847%20172.042%2036.6847C169.728%2036.6847%20168.573%2035.4674%20168.573%2033.0295V26.8387H167.004V25.7581L168.687%2024.863L169.517%2022.4316H171.024V24.9867H174.295V26.8355H171.024V32.9839C171.024%2033.5731%20171.17%2034.006%20171.466%2034.2859C171.763%2034.5658%20172.147%2034.7058%20172.625%2034.7058V34.709Z'%20fill='url(%23paint19_linear_4548_14216)'/%3e%3cpath%20d='M184.424%2033.2019C184.424%2034.3249%20184.014%2035.1841%20183.197%2035.783C182.38%2036.3819%20181.208%2036.6814%20179.685%2036.6814C178.161%2036.6814%20176.925%2036.4503%20175.997%2035.9848V33.8757C177.348%2034.4974%20178.604%2034.8098%20179.766%2034.8098C181.27%2034.8098%20182.018%2034.3574%20182.018%2033.4493C182.018%2033.1596%20181.934%2032.9155%20181.768%2032.7235C181.602%2032.5314%20181.328%2032.3296%20180.948%2032.1213C180.567%2031.913%20180.036%2031.6786%20179.359%2031.415C178.038%2030.904%20177.143%2030.3897%20176.674%2029.8787C176.205%2029.3677%20175.974%2028.7004%20175.974%2027.8835C175.974%2026.9005%20176.371%2026.1389%20177.162%2025.592C177.956%2025.0485%20179.034%2024.7783%20180.397%2024.7783C181.761%2024.7783%20183.024%2025.0517%20184.228%2025.5986L183.441%2027.4376C182.201%2026.9265%20181.159%2026.6694%20180.316%2026.6694C179.027%2026.6694%20178.386%2027.0372%20178.386%2027.7695C178.386%2028.1308%20178.555%2028.4335%20178.89%2028.6842C179.226%2028.9348%20179.958%2029.2766%20181.088%2029.7127C182.035%2030.0805%20182.725%2030.4158%20183.154%2030.7217C183.584%2031.0277%20183.903%2031.3792%20184.111%2031.7763C184.32%2032.1734%20184.424%2032.6519%20184.424%2033.2052V33.2019Z'%20fill='url(%23paint20_linear_4548_14216)'/%3e%3cdefs%3e%3cradialGradient%20id='paint0_radial_4548_14216'%20cx='0'%20cy='0'%20r='1'%20gradientUnits='userSpaceOnUse'%20gradientTransform='translate(44.0672%2015.5248)%20scale(61.1655%2061.1655)'%3e%3cstop%20offset='0.17'%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/radialGradient%3e%3cradialGradient%20id='paint1_radial_4548_14216'%20cx='0'%20cy='0'%20r='1'%20gradientUnits='userSpaceOnUse'%20gradientTransform='translate(44.0676%2015.525)%20scale(61.1655%2061.1655)'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/radialGradient%3e%3cradialGradient%20id='paint2_radial_4548_14216'%20cx='0'%20cy='0'%20r='1'%20gradientUnits='userSpaceOnUse'%20gradientTransform='translate(44.0677%20-58.8974)%20scale(61.1655%2061.1654)'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/radialGradient%3e%3cradialGradient%20id='paint3_radial_4548_14216'%20cx='0'%20cy='0'%20r='1'%20gradientUnits='userSpaceOnUse'%20gradientTransform='translate(44.0677%20-58.8984)%20scale(61.1655%2061.1656)'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/radialGradient%3e%3cradialGradient%20id='paint4_radial_4548_14216'%20cx='0'%20cy='0'%20r='1'%20gradientUnits='userSpaceOnUse'%20gradientTransform='translate(44.0677%20-58.8978)%20scale(61.1655%2061.1655)'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/radialGradient%3e%3cradialGradient%20id='paint5_radial_4548_14216'%20cx='0'%20cy='0'%20r='1'%20gradientUnits='userSpaceOnUse'%20gradientTransform='translate(44.0677%20-58.8978)%20scale(61.1655%2061.1654)'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/radialGradient%3e%3cradialGradient%20id='paint6_radial_4548_14216'%20cx='0'%20cy='0'%20r='1'%20gradientUnits='userSpaceOnUse'%20gradientTransform='translate(44.0673%2015.5246)%20scale(61.1655%2061.1656)'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/radialGradient%3e%3cradialGradient%20id='paint7_radial_4548_14216'%20cx='0'%20cy='0'%20r='1'%20gradientUnits='userSpaceOnUse'%20gradientTransform='translate(44.0675%20-58.8983)%20scale(61.1655%2061.1656)'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/radialGradient%3e%3clinearGradient%20id='paint8_linear_4548_14216'%20x1='27.6858'%20y1='26.9883'%20x2='184.655'%20y2='47.7609'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint9_linear_4548_14216'%20x1='27.7019'%20y1='26.8681'%20x2='184.671'%20y2='47.6374'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint10_linear_4548_14216'%20x1='27.8582'%20y1='25.703'%20x2='184.827'%20y2='46.4723'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint11_linear_4548_14216'%20x1='28.0796'%20y1='24.0657'%20x2='185.049'%20y2='44.835'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint12_linear_4548_14216'%20x1='28.6426'%20y1='19.7724'%20x2='185.612'%20y2='40.5417'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint13_linear_4548_14216'%20x1='28.8281'%20y1='18.376'%20x2='185.794'%20y2='39.1453'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint14_linear_4548_14216'%20x1='28.7407'%20y1='19.0206'%20x2='185.71'%20y2='39.7899'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint15_linear_4548_14216'%20x1='28.9621'%20y1='17.367'%20x2='185.928'%20y2='38.1363'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint16_linear_4548_14216'%20x1='29.382'%20y1='14.187'%20x2='186.351'%20y2='34.9563'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint17_linear_4548_14216'%20x1='28.9585'%20y1='17.3836'%20x2='185.928'%20y2='38.1529'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint18_linear_4548_14216'%20x1='29.7136'%20y1='11.6741'%20x2='186.683'%20y2='32.4466'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint19_linear_4548_14216'%20x1='29.8241'%20y1='10.8313'%20x2='186.794'%20y2='31.6039'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint20_linear_4548_14216'%20x1='29.8206'%20y1='10.867'%20x2='186.79'%20y2='31.6364'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e";function d6(e,t){return y6(e)||g6(e,t)||h6(e,t)||f6()}function f6(){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 h6(e,t){if(e){if(typeof e=="string")return E0(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)?E0(e,t):void 0}}function E0(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 g6(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function y6(e){if(Array.isArray(e))return e}var m6=function(t){var n=t.className,r=Ut(),i=r.pathname,s=Rn(),o=s.hostAppProps,a=o.onLogout,l=z.useState(!1),u=d6(l,2),c=u[0],d=u[1],f=Iu({query:{select:function(C){var w=C.data;return w==null?void 0:w.data}}}),h=f.data,g=f.isLoading,m=$4(a),p=m.mutate,v=m.isPending,b=function(C){if(C.preventDefault(),d(!0),!v)return p()};return y.jsxs("div",{className:Oe("ystaii-sidemenu"),children:[y.jsx("div",{className:"ystaii-mobile-menu lg:yst-hidden",children:y.jsx(T.SidebarNavigation,{activePath:i,children:y.jsx(T.SidebarNavigation.Mobile,{closeButtonScreenReaderText:"Close sidebar",openButtonScreenReaderText:"Open sidebar",children:y.jsx(O0,{})})})}),y.jsxs("div",{className:Oe("ystaii-menuHeader","yst-mb-6 yst-mt-10 yst-flex yst-flex-row yst-justify-between yst-px-4","yst-flex-col yst-items-start yst-space-y-12 yst-max-w-2xl yst-mx-auto"),children:[y.jsx(T.Title,{children:y.jsx(ti,{className:Oe("yst-outline-none"),to:"/",children:y.jsx("img",{src:c6,alt:"Yoast",width:"208",height:"42",className:"yst-block"})})}),y.jsxs("div",{className:Oe("ystaii-userInfoContainer","yst-flex yst-flex-col"),children:[y.jsx("div",{children:y.jsx("b",{children:(h==null?void 0:h.displayName)||y.jsx(T.SkeletonLoader,{children:"Display name"})})}),y.jsx("div",{children:(h==null?void 0:h.email)||y.jsx(T.SkeletonLoader,{children:"loading-email@address.com"})}),y.jsx("div",{children:y.jsx(T.Link,{variant:"primary",className:"yst-no-underline",onClick:b,children:g?y.jsxs(T.SkeletonLoader,{children:["Sign out ",y.jsx("span",{"aria-hidden":"true",children:"→"})]}):c||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:Oe("ystaii-desktopMenu","yst-hidden","lg:yst-mb-0 lg:yst-block lg:yst-w-full lg:yst-shrink-0"),children:y.jsx(T.SidebarNavigation,{activePath:i,children:y.jsx(O0,{className:n})})})]})},u2=dx.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);}"]);u2.defaultProps={href:"#content"};function vc(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:Oe("ystaii-layout","yst-block","lg:yst-flex lg:yst-min-h-full lg:yst-overflow-visible"),children:[y.jsx(u2,{children:"Skip to main content"}),!s&&y.jsxs("div",{className:Oe("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(m6,{}),o&&y.jsx(o,{}),y.jsx("div",{id:"toast-portal"})]}),y.jsx("main",{className:Oe("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:Oe("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 jd(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,g,m,p){var v=g&&g.prototype instanceof a?g:a,b=Object.create(v.prototype);return Yt(b,"_invoke",function(S,C,w){var O,x,_,k=0,E=w||[],P=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(A,j){return O=A,x=0,_=e,M.n=j,o}};function B(R,A){for(x=R,_=A,t=0;!P&&k&&!j&&t<E.length;t++){var j,L=E[t],H=M.p,Q=L[2];R>3?(j=Q===A)&&(_=L[(x=L[4])?5:(x=3,3)],L[4]=L[5]=e):L[0]<=H&&((j=R<2&&H<L[1])?(x=0,M.v=A,M.n=L[1]):H<Q&&(j=R<3||L[0]>A||A>Q)&&(L[4]=R,L[5]=A,M.n=Q,x=0))}if(j||R>1)return o;throw P=!0,A}return function(R,A,j){if(k>1)throw TypeError("Generator is already running");for(P&&A===1&&B(A,j),x=A,_=j;(t=x<2?e:_)||!P;){O||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(k=2,O){if(x||(R="next"),t=O[R]){if(!(t=t.call(O,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=O.return)&&t.call(O),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);O=e}else if((t=(P=M.n<0)?_:S.call(C,M))!==o)break}catch(L){O=e,x=1,_=L}finally{k=1}}return{value:t,done:P}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(Yt(t={},r,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,Yt(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,Yt(d,"constructor",u),Yt(u,"constructor",l),l.displayName="GeneratorFunction",Yt(u,i,"GeneratorFunction"),Yt(d),Yt(d,i,"Generator"),Yt(d,r,function(){return this}),Yt(d,"toString",function(){return"[object Generator]"}),(jd=function(){return{w:s,m:f}})()}function Yt(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Yt=function(o,a,l,u){if(a)i?i(o,a,{value:l,enumerable:!u,configurable:!u,writable:!u}):o[a]=l;else{var c=function(f,h){Yt(o,f,function(g){return this._invoke(f,h,g)})};c("next",0),c("throw",1),c("return",2)}},Yt(e,t,n,r)}function A0(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function p6(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){A0(s,r,i,o,a,"next",l)}function a(l){A0(s,r,i,o,a,"throw",l)}o(void 0)})}}function v6(e,t){return S6(e)||w6(e,t)||x6(e,t)||b6()}function b6(){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 x6(e,t){if(e){if(typeof e=="string")return T0(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)?T0(e,t):void 0}}function T0(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 w6(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function S6(e){if(Array.isArray(e))return e}var C6=function(t){var n,r,i=t.className,s=Gt(),o=dn(),a=z.useState(!1),l=v6(a,2),u=l[0],c=l[1],d=Vi({query:{select:function(O){var x=O.data;return x==null?void 0:x.brands}}}),f=d.data,h=r2({mutation:{onSettled:function(){s.invalidateQueries({queryKey:[Yn()]})}}}),g=h.mutateAsync,m=h.isPending,p=(n=f==null?void 0:f.filter(function(w){var O;return((O=w.settings)===null||O===void 0?void 0:O.showAutomaticAnalysisDisabledNotification)===!0}))!==null&&n!==void 0?n:[],v=function(){c(!1)},b=function(){var w=p6(jd().m(function O(){var x;return jd().w(function(_){for(;;)switch(_.n){case 0:if(p.length!==0){_.n=1;break}return _.a(2);case 1:return x=p.map(function(k){return g({brandId:String(k.id),data:{showAutomaticAnalysisDisabledNotification:!1}})}),_.n=2,Promise.all(x);case 2:o("/settings"),v();case 3:return _.a(2)}},O)}));return function(){return w.apply(this,arguments)}}();z.useEffect(function(){f&&f.some(function(w){var O;return((O=w.settings)===null||O===void 0?void 0:O.showAutomaticAnalysisDisabledNotification)===!0})&&c(!0)},[f]);var S=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(w){return y.jsx("li",{children:y.jsx("b",{children:w.name})},w.id)})}),y.jsxs("p",{children:["If you prefer, you can go to ",y.jsx("b",{children:"Settings"})," and deactivate different brand(s) instead."]})]});return u?y.jsx(T.Modal,{isOpen:u,onClose:b,position:"center",as:"div",className:i,children:y.jsxs(T.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(T.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(T.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:S})}),y.jsx(T.Modal.Container.Content,{className:"yst-mb-4 yst-space-y-3",children:C})]})}),y.jsxs(T.Modal.Container.Footer,{className:"yst-mt-3 yst-flex yst-justify-end yst-gap-2",children:[y.jsx(T.Button,{variant:"secondary",onClick:b,children:"Close"}),y.jsx(T.Button,{variant:"primary",onClick:b,isLoading:m,disabled:p.length===0,children:"Go to settings"})]})]})}):null},Ru=function(){return y.jsx("div",{className:"yst-flex yst-min-h-screen yst-items-center yst-justify-center",children:y.jsxs("div",{className:"yst-flex yst-items-center yst-gap-3 yst-text-center",children:[y.jsx(T.Spinner,{variant:"primary"}),y.jsx("span",{className:"yst-italic",children:"Just a moment while we get things ready for you..."})]})})},_6={HOME:"/"},k6=function(t){var n=t.hideNav,r=n===void 0?!1:n,i=t.disableLayout,s=i===void 0?!1:i,o=t.DebugInfo,a=Ut(),l=dn(),u={disable:s,hideNav:r},c=Rn(),d=c.brandId,f=Fa(),h=f.setBrandId,g=Vi({query:{refetchOnReconnect:!1,refetchOnWindowFocus:!1,select:function(x){var _;return x==null||(_=x.data)===null||_===void 0?void 0:_.brands}}}),m=g.data,p=g.isLoading,v=g.error,b=g.refetch,S=z.useRef(!1),C=z.useMemo(function(){return m==null?void 0:m.find(function(O){return O.id===d})},[m,d]);z.useEffect(function(){var O;if(!(m===void 0||d)){var x=(O=m[0])===null||O===void 0?void 0:O.id;x&&h(x)}},[m,d,h,l,a.pathname]),z.useEffect(function(){!d||S.current||(S.current=!0)},[C,d,l,a.pathname,m]);var w=z.useCallback(function(){b()},[b]);return a.pathname!==_6.HOME&&p?y.jsx(vc,{...u,children:y.jsx(Ru,{})}):v?y.jsx(vc,{...u,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(T.Button,{variant:"primary",onClick:w,children:"Retry"})]})})}):y.jsxs(vc,{DebugInfo:o,...u,children:[y.jsx(Bs,{}),y.jsx(C6,{})]})},O6=function(){var t=xu(),n=t.brandId,r=t.analysisId,i=t2(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(Ru,{});if(a)return console.error("Error fetching analyses for validation:",a),y.jsx(mi,{to:"/brands/".concat(n),replace:!0});if(!r||r.trim()==="")return y.jsx(mi,{to:"/brands/".concat(n),replace:!0});if(r==="latest")return y.jsx(Bs,{});var l=parseInt(r,10);if(isNaN(l))return y.jsx(mi,{to:"/brands/".concat(n),replace:!0});var u=s==null?void 0:s.some(function(c){return c.id===l});return u?y.jsx(Bs,{}):y.jsx(mi,{to:"/brands/".concat(n),replace:!0})},P0=function(){var t=xu(),n=t.brandId,r=Vi({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(Ru,{});if(o)return y.jsx(mi,{to:"/",replace:!0});if(!n||n.trim()==="")return y.jsx(mi,{to:"/",replace:!0});var u=parseInt(n,10),c=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===u||d.id===n});return a&&!c?y.jsx(mi,{to:"/",replace:!0}):y.jsx(Bs,{})},E6={openai:"openai",perplexity:"perplexity",anthropic:"anthropic"},A6={updating:"updating"},di={pending:"pending",processing:"processing",completed:"completed",failed:"failed",cancelled:"cancelled"},T6=function(t){return typeof t=="string"&&t!=="latest"&&t.trim().length>0};function P6(e,t){return I.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),I.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 c2=I.forwardRef(P6);function j6(e,t){return I.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),I.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 M6=I.forwardRef(j6);function $6(e,t){return I.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),I.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 d2=I.forwardRef($6);function L6(e,t){return I.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),I.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 f2=I.forwardRef(L6);function D6(e,t){return I.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),I.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 I6=I.forwardRef(D6);function R6(e,t){return I.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),I.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 N6=I.forwardRef(R6);function F6(e,t){return I.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),I.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 j0=I.forwardRef(F6);function B6(e,t){return I.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),I.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"}),I.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 h2=I.forwardRef(B6);function q6(e,t){return I.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),I.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 z6=I.forwardRef(q6);function H6(e,t){return I.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),I.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 g2=I.forwardRef(H6);function na(e){"@babel/helpers - typeof";return na=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},na(e)}var U6=["children","as","startColor","endColor","angle","disabled","style","className"];function M0(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 $0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?M0(Object(n),!0).forEach(function(r){G6(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function G6(e,t,n){return(t=V6(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function V6(e){var t=K6(e,"string");return na(t)=="symbol"?t:t+""}function K6(e,t){if(na(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(na(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function W6(e,t){if(e==null)return{};var n,r,i=Q6(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 Q6(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 Nu=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,u=t.angle,c=u===void 0?102:u,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=W6(t,U6),b=$0(f?{display:"inline-block"}:{background:"linear-gradient(".concat(c,"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 Mf(e){var t=e.children,n=e.nestedInPaperContent,r=n===void 0?!1:n,i=e.className;return y.jsx("div",{className:Oe("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 Y6=function(){var t=dn();return y.jsx("form",{onSubmit:function(){return t("/setup")},children:y.jsxs(T.Paper,{className:"yst-mx-auto yst-flex yst-max-w-2xl",children:[y.jsx(T.Paper.Header,{children:y.jsxs(T.Title,{size:"1",children:["Welcome to ",y.jsx(Nu,{children:"Yoast AI Brand Insights"}),"!"]})}),y.jsxs(T.Paper.Content,{className:"yst-space-y-8",children:[y.jsxs("div",{className:"yst-space-y-4 *:yst-text-tiny",children:[y.jsx("p",{children:"See how your brand is represented in AI answers."}),y.jsxs("p",{children:[y.jsx("b",{className:"yst-font-medium yst-text-slate-800",children:"Yoast AI Brand Insights"})," ","shows how often your brand appears, how it's described, and how it compares to competitors in tools like ChatGPT."]}),y.jsx("p",{children:"It only takes three simple steps to get your brand insights:"})]}),y.jsx("div",{className:"yst-flex yst-flex-col yst-items-stretch yst-justify-stretch yst-gap-4 yst-pb-8",children:[{title:"1. ADD BRAND INFO",description:"Tell us about your brand and where it's active so we can customize your analysis."},{title:"2. REVIEW QUERIES",description:"Edit or approve the queries generated from your input."},{title:"3. RUN ANALYSIS",description:"Run your queries through relevant AI models to see how your brand shows up."}].map(function(n,r,i){return y.jsxs("div",{className:"yst-relative yst-flex yst-flex-col yst-items-stretch",children:[y.jsxs("div",{className:"yst-flex yst-flex-row yst-items-center yst-justify-stretch yst-gap-6",children:[y.jsx(T.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(T.Title,{size:"3",className:"yst-font-semibold yst-uppercase",children:n.title}),y.jsx("p",{className:"yst-my-0 yst-py-0",children:n.description})]})]}),r<i.length-1&&y.jsx("div",{className:"yst-absolute yst-left-[-2px] yst-top-1/2 yst-my-0 yst-ml-[13px] yst-h-full yst-border-l-2 yst-border-l-primary-600"})]},n.title)})})]}),y.jsx(Mf,{className:"yst-justify-end",children:y.jsxs(T.Button,{variant:"primary",onClick:function(){return t("/setup")},className:"yst-gap-1.5",children:["Start your first analysis ",y.jsx(M6,{})]})})]})})};function ra(e){return typeof e!="number"?{}:{"yst-text-green-600":e>0,"yst-text-red-600":e<0,"yst-text-gray-400":e===0}}function Ba(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,u=e.delta,c=e.deltaFormat,d=c===void 0?"absolute":c,f=e.deltaSuffix,h=e.scoreFormat,g=h===void 0?"absolute":h;return y.jsxs("div",{className:Oe(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 u=="number"&&!isNaN(u)&&y.jsxs("span",{className:Oe("yst-ml-2",ra(u)),children:[u>-1&&"+",u,d==="percentage"&&"%"," ",f]})]})}var X6=["Icon","className","children","position","id"];function Z6(e,t){return n_(e)||t_(e,t)||e_(e,t)||J6()}function J6(){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 e_(e,t){if(e){if(typeof e=="string")return L0(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)?L0(e,t):void 0}}function L0(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 t_(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function n_(e){if(Array.isArray(e))return e}function r_(e,t){if(e==null)return{};var n,r,i=i_(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 i_(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 $f(e){var t=e.Icon,n=t===void 0?Y4:t,r=e.className,i=r===void 0?"":r,s=e.children,o=e.position,a=o===void 0?"left":o,l=e.id,u=l===void 0?"":l,c=r_(e,X6),d=z.useState(!1),f=Z6(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":u?"tooltip-button-id":"tooltip-button",...c,children:[y.jsx(n,{className:"yst-relative yst-h-6 yst-w-6 yst-text-slate-400"}),h&&y.jsx(T.Tooltip,{position:a,id:u||"tooltip-button",children:s})]}):null}var qa=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,"-"))},u=l(n);return y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-between ".concat(a),children:[y.jsx(T.Title,{size:s,children:n}),y.jsx($f,{id:u,children:r})]})},D0=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(T.Badge,{className:r,children:i},s)})})},y2=function(t){var n,r,i,s,o=t.title,a=o===void 0?"Sentiment":o,l=t.tooltip,u=l===void 0?"":l,c=t.data,d=c==null?void 0:c.brandName,f=c==null||(n=c.positivityPercentage)===null||n===void 0?void 0:n.value,h=c==null||(r=c.positivityPercentage)===null||r===void 0||(r=r.previous)===null||r===void 0?void 0:r.difference,g=c==null||(i=c.keywords)===null||i===void 0?void 0:i.positive,m=c==null||(s=c.keywords)===null||s===void 0?void 0:s.negative,p=!c||f===void 0&&h===void 0;return y.jsx(T.Card,{className:"yst-overflow-visible",children:y.jsxs(T.Card.Content,{className:"yst-space-y-8",children:[y.jsx(qa,{title:a,tooltip:u}),y.jsx("div",{className:"yst-space-y-3",children:!p&&y.jsxs(y.Fragment,{children:[y.jsx("p",{children:d||y.jsx(T.SkeletonLoader,{className:"yst-h-6 yst-w-20"})}),y.jsxs("div",{children:[y.jsx("div",{className:"yst-inline-flex",children:y.jsx(Ba,{className:"yst-mb-1.5",score:f,scoreFormat:"percentage",suffix:"positive",delta:h})}),y.jsx(T.ProgressBar,{max:100,min:0,progress:f||0,className:Oe({"yst-bg-red-500":f},"[&>*]:yst-bg-green-500")})]})]})}),p&&y.jsx(T.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(T.Title,{as:"h5",size:"5",children:"Positive keywords"}),y.jsx(D0,{keywords:g,badgeClassName:"yst-bg-green-100 yst-text-green-800"})]}),!!m&&y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(T.Title,{as:"h5",size:"5",children:"Negative keywords"}),y.jsx(D0,{keywords:m,badgeClassName:"yst-bg-red-100 yst-text-red-800"})]})]})})};function ia(e){"@babel/helpers - typeof";return ia=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},ia(e)}var s_=["data"];function I0(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 o_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?I0(Object(n),!0).forEach(function(r){a_(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function a_(e,t,n){return(t=l_(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l_(e){var t=u_(e,"string");return ia(t)=="symbol"?t:t+""}function u_(e,t){if(ia(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ia(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function c_(e,t){if(e==null)return{};var n,r,i=d_(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 d_(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 ri=function(t,n,r){var i=Rn(),s=i.brandId,o=i.analysisId,a=i.model,l=s,u=o,c=a,d=Lu(l,u,{query:{enabled:!!l&&!!u,select:function(p){var v=p.data;return v==null?void 0:v.analysis}}}),f=d.data,h=c_(d,s_),g=z.useMemo(function(){if(!f||!c)return null;var m=f.scans||[];return m.find(function(p){return String(p.aiProvider)===String(c)})||null},[f,c]);return o_({data:g},h)};function f_(){var e,t=ri(),n=t.data;return y.jsx(y2,{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 h_=["children","as","className"];function g_(e,t){if(e==null)return{};var n,r,i=y_(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 y_(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 za=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,u=l===void 0?"div":l,c=o.className,d=c===void 0?"":c,f=g_(o,h_);return y.jsx(u,{className:Oe(String(s).trim(),d),...f,children:a})}},bc=[{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"}],R0=function(t){if(!t)return bc[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)%bc.length;return bc[s]};function sa(e){"@babel/helpers - typeof";return sa=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},sa(e)}var N0;function F0(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 B0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?F0(Object(n),!0).forEach(function(r){m_(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function m_(e,t,n){return(t=p_(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p_(e){var t=v_(e,"string");return sa(t)=="symbol"?t:t+""}function v_(e,t){if(sa(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(sa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function b_(e){return S_(e)||w_(e)||m2(e)||x_()}function x_(){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 w_(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function S_(e){if(Array.isArray(e))return Md(e)}function q0(e,t){return k_(e)||__(e,t)||m2(e,t)||C_()}function C_(){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 m2(e,t){if(e){if(typeof e=="string")return Md(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)?Md(e,t):void 0}}function Md(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 __(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function k_(e){if(Array.isArray(e))return e}function O_(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var yo=za(N0||(N0=O_(["md:yst-hidden yst-mr-2 yst-font-medium yst-text-slate-400 yst-inline-flex yst-w-20"]))),z0=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=t.enableCategories,u=l===void 0?!1:l,c=s||!n,d=n||{},f=d.rank,h=d.url,g=d.rootDomain,m=d.category,p=d.impact,v=d.numberOfMentions,b=v==null?void 0:v.value,S=v==null?void 0:v.previous,C=typeof(S==null?void 0:S.difference)=="number"?S.difference:b;return y.jsxs("tr",{className:"yst-flex yst-flex-col md:yst-table-row",children:[y.jsxs(T.Table.Cell,{className:"yst-ml-2 yst-py-1 md:yst-ml-0 md:yst-p-2",children:[y.jsx(yo,{as:"span",children:"Rank:"}),c?y.jsx(T.SkeletonLoader,{className:"yst-h-6 yst-w-24"}):y.jsx("span",{className:"yst-font-medium yst-text-slate-900",children:f!=null?f:"—"})]}),y.jsx(T.Table.Cell,{className:"yst-ml-2 yst-py-1 md:yst-ml-0 md:yst-p-2",children:c?y.jsx(T.SkeletonLoader,{className:"yst-h-6 yst-w-full"}):y.jsx("div",{className:"yst-flex yst-items-center yst-gap-2",children:y.jsxs(T.Link,{className:"yst-flex yst-items-center yst-gap-1 yst-font-medium",href:h||"#",rel:"nofollow noreferrer",target:"_blank",children:[y.jsx("span",{children:h!=null?h:"—"})," ",y.jsx(h2,{})]})})}),y.jsxs(T.Table.Cell,{className:"yst-ml-2 yst-py-1 yst-font-medium md:yst-ml-0 md:yst-p-2",children:[y.jsx(yo,{as:"span",children:"Domain:"}),c?y.jsx(T.SkeletonLoader,{className:"yst-h-6 yst-w-24"}):y.jsx("span",{className:"yst-font-medium yst-text-slate-900",children:g!=null?g:"—"})]}),u&&y.jsxs(T.Table.Cell,{className:"yst-ml-2 yst-py-1 md:yst-ml-0 md:yst-p-2",children:[y.jsx(yo,{as:"span",children:"Category:"}),c?y.jsx(T.SkeletonLoader,{className:"yst-h-6 yst-w-16"}):y.jsx(T.Badge,{className:Oe(R0(m||"").bg,R0(m||"").text),children:m!=null?m:"—"})]}),y.jsxs(T.Table.Cell,{className:Oe("yst-ml-2 yst-py-0 md:yst-ml-0 md:yst-p-2","yst-font-medium",{"yst-text-green-600":p==="High","yst-text-yellow-600":p==="Medium","yst-text-red-600":p==="Low"}),children:[y.jsx(yo,{as:"span",children:"Impact:"}),c?y.jsx(T.SkeletonLoader,{className:"yst-h-6 yst-w-12"}):p!=null?p:"—"]}),y.jsxs(T.Table.Cell,{className:"yst-ml-2 yst-pt-1 md:yst-ml-0 md:yst-p-2 md:yst-text-right",children:[y.jsx(yo,{as:"span",children:"Mentions:"}),c?y.jsx(T.SkeletonLoader,{className:"yst-h-6 yst-w-8"}):b?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:b}),y.jsxs("span",{className:"yst-text-slate-900",children:["/ ",r]})]}),!a&&y.jsxs("span",{className:Oe("yst-ml-auto",ra(C)),children:[C>-1&&"+",C]})]}):"—"]})]},c?void 0:h)},E_=function(t){var n,r,i,s,o,a=t.enableCategories,l=a===void 0?!1:a,u=z.useState("all"),c=q0(u,2),d=c[0],f=c[1],h=z.useState(1),g=q0(h,2),m=g[0],p=g[1],v=ri(),b=v.data,S=v.isLoading,C=v.isRefetching,w=b==null?void 0:b.citations,O=(b==null||(n=b.scores)===null||n===void 0||(n=n.standardized)===null||n===void 0?void 0:n.citations)||{},x=Object.hasOwn(O,"previous"),_=w==null||(r=w.list)===null||r===void 0?void 0:r.filter(function(A){return d==="all"?!0:A.category===d}),k=10,E=(_==null?void 0:_.length)||0,P=Math.ceil(E/k),M=(m-1)*k,B=M+k,R=_==null?void 0:_.slice(M,B);return z.useEffect(function(){m>P&&P>0&&p(1)},[P,m,p,d]),y.jsx(T.Card,{className:"yst-overflow-visible md:yst-col-span-2",children:y.jsxs(T.Card.Content,{className:"yst-flex yst-flex-col yst-gap-6",children:[y.jsxs("div",{className:"yst-space-y-4",children:[y.jsx(qa,{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(Ba,{score:w==null||(i=w.total)===null||i===void 0?void 0:i.value,suffix:"citations",delta:w==null||(s=w.total)===null||s===void 0||(s=s.previous)===null||s===void 0?void 0:s.difference,deltaSuffix:"since last analysis",isLoading:S,hideTotal:!0})]}),(w==null||(o=w.list)===null||o===void 0?void 0:o.length)===0&&!S&&!C?y.jsx(T.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:[l&&y.jsx(T.Select,{className:"yst-mb-4 md:yst-max-w-sm",label:"Filter categories",value:d,onChange:function(A){f(A)},id:"citation-category-filter",options:[{value:"all",label:"All categories"}].concat(b_(w!=null&&w.categories?w.categories.map(function(A){return{value:A,label:A}}):[]))}),y.jsxs(T.Table,{variant:"minimal",children:[y.jsx(T.Table.Head,{className:"yst-font-semibold",children:y.jsxs(T.Table.Row,{children:[y.jsx(T.Table.Cell,{className:"yst-hidden yst-text-slate-900 md:yst-table-cell md:yst-pl-2",children:"#"}),y.jsx(T.Table.Cell,{className:"yst yst-hidden yst-text-slate-900 md:yst-table-cell md:yst-px-2",children:"URL"}),y.jsx(T.Table.Cell,{className:"yst-hidden yst-text-slate-900 md:yst-table-cell md:yst-px-2",children:"Root domain"}),l&&y.jsx(T.Table.Cell,{className:"yst-hidden yst-text-slate-900 md:yst-table-cell",children:"Category"}),y.jsx(T.Table.Cell,{className:"yst-hidden yst-text-slate-900 md:yst-table-cell md:yst-px-2",children:"Impact"}),y.jsx(T.Table.Cell,{className:"yst-hidden yst-text-right yst-text-slate-900 md:yst-table-cell",children:"Mentions"})]})}),y.jsx(T.Table.Body,{children:S||C?Array.from({length:5}).map(function(A,j){return y.jsx(z0,{isLoading:!0,enableCategories:l},"skeleton-".concat(j))}):R&&R.length>0?R.map(function(A,j){return y.jsx(z0,{data:B0(B0({},A),{},{rank:M+j+1}),totalQueries:b==null?void 0:b.numberOfQueries,isFirstScan:!x,enableCategories:l},"citation-table-row-".concat(A.url,"-").concat(j))}):y.jsx(T.Table.Row,{children:y.jsxs(T.Table.Cell,{colSpan:l?6:5,className:"yst-py-8 yst-text-center yst-text-slate-500",children:[d==="all"?"No citations found.":'No citations found for the "'.concat(d,'" category.')," ",y.jsx(T.Link,{onClick:function(){return f("all")},children:"Show all categories."})]})},"no-results")})]})]}),_&&_.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 ",M+1," to"," ",B>E?E:B," of"," ",E," results"]}),y.jsx(T.Pagination,{variant:"text",className:"yst-flex-row yst-gap-0",current:m,total:P,onNavigate:p,screenReaderTextPrevious:"Previous page",screenReaderTextNext:"Next page"})]})]})]})})};function A_(e,t){return M_(e)||j_(e,t)||P_(e,t)||T_()}function T_(){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 P_(e,t){if(e){if(typeof e=="string")return H0(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)?H0(e,t):void 0}}function H0(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function M_(e){if(Array.isArray(e))return e}var U0=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,u=l||!r,c=r||{},d=c.rank,f=c.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(T.Table.Row,{children:[y.jsx(T.Table.Cell,{children:u?y.jsx(T.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:Oe("yst-inline-flex yst-items-center yst-justify-end",ra(h&&typeof g=="number"?g:0)),children:h&&typeof g=="number"?y.jsxs(y.Fragment,{children:[Math.abs(g),g>0?y.jsx(N6,{className:"yst-h-4 yst-w-4"}):y.jsx(I6,{className:"yst-h-4 yst-w-4"})]}):y.jsx(j0,{className:"yst-mx-1 yst-h-4 yst-w-4"})})]})}),y.jsx(T.Table.Cell,{children:u?y.jsx(T.SkeletonLoader,{className:"yst-h-6 yst-w-24"}):y.jsx("span",{className:"yst-font-medium",children:f!=null&&f.isSelf?y.jsx(Nu,{children:f==null?void 0:f.name}):(n=f==null?void 0:f.name)!==null&&n!==void 0?n:"—"})}),y.jsx(T.Table.Cell,{children:u?y.jsx(T.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:Oe("yst-ml-auto",ra(p&&typeof v=="number"?v:0)),children:p&&typeof v=="number"?y.jsxs(y.Fragment,{children:[v>-1&&"+",v]}):y.jsx(j0,{className:"yst-h-4 yst-w-4"})})]})})]},u||d==null?void 0:d.value)},$_=function(t){var n,r,i=t.className,s=z.useRef(null),o=z.useState(1),a=A_(o,2),l=a[0],u=a[1],c=ri(),d=c.data,f=c.isLoading,h=c.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,S=Math.ceil(b/v),C=(l-1)*v,w=C+v,O=g==null?void 0:g.slice(C,w);return z.useEffect(function(){l>S&&S>0&&u(1)},[S,l,u]),y.jsx(T.Card,{ref:s,className:Oe("yst-overflow-visible",i),children:y.jsxs(T.Card.Content,{className:"yst-mt-0 yst-space-y-6",children:[y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(qa,{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(T.Alert,{variant:"info",children:"The selected AI model returned no brands for your queries. This can happen with some queries or models."}):y.jsxs(T.Table,{variant:"minimal",children:[y.jsx(T.Table.Head,{children:y.jsxs(T.Table.Row,{children:[y.jsx(T.Table.Cell,{className:"yst-w-20 yst-font-semibold",children:"Rank"}),y.jsx(T.Table.Cell,{className:"yst-font-semibold",children:"Brand"}),y.jsx(T.Table.Cell,{className:"yst-w-20 yst-text-right yst-font-semibold",children:"Mentions"})]})}),y.jsx(T.Table.Body,{children:O&&Array.isArray(O)&&O.length>0?O.map(function(x){var _;return y.jsx(U0,{data:x,totalQueries:d==null?void 0:d.numberOfQueries,isFirstScan:!p},"rank-row-".concat((_=x.rank)===null||_===void 0?void 0:_.value))}):f||h?Array.from({length:v}).map(function(x,_){return y.jsx(U0,{isLoading:!0},"skeleton-".concat(_))}):null})]}),!f&&!h&&g&&g.length>v&&y.jsx(T.Pagination,{current:l,total:S,className:"yst-flex-row",onNavigate:u,screenReaderTextNext:"Next",screenReaderTextPrevious:"Previous",variant:"text"})]})})},L_=function(){var t,n=ri(),r=n.data,i=r==null||(t=r.sentiment)===null||t===void 0?void 0:t.topCompetitor;return y.jsx(y2,{title:"Competitor sentiment",data:i,tooltip:"Percentage of positive versus negative keywords in your query results related to your competitor's brand."})},D_=function(t){var n=t.brand,r=dn(),i=Fa(),s=i.setBrandId;return(n==null?void 0:n.setupStatus)==="pendingQuerySelection"?y.jsx(T.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(T.Link,{onClick:function(){n.id?(s(n.id),r("/setup/".concat(n.id,"/queries"))):console.error("Brand ID is missing.")},children:"Review queries"})})]})}):null},Fu=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,u=t.disabled,c=u===void 0?!1:u,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(T.Modal,{isOpen:n,onClose:r,position:"center",as:"div",className:m,children:y.jsxs(T.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(o2,{className:"yst-h-6 yst-w-6 yst-text-red-600"})})}),y.jsxs("div",{className:"yst-flex-1",children:[y.jsx(T.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(T.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:a})}),y.jsx(T.Modal.Container.Content,{className:"yst-mb-4 yst-space-y-3",children:typeof l=="string"?y.jsx("p",{children:l}):l})]})]}),y.jsxs(T.Modal.Container.Footer,{className:"yst-mt-3 yst-flex yst-justify-end yst-gap-2",children:[y.jsx(T.Button,{variant:"secondary",onClick:r,children:g}),y.jsx(T.Button,{variant:"error",onClick:i,isLoading:o,disabled:c,children:f})]})]})})},sl={exports:{}},ol={exports:{}},Ue={};/** @license React v16.13.1
22
+ */var O0;function D4(){return O0||(O0=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})()}(xc)),xc.exports}var I4=D4();const Oe=xp(I4);var R4=function(t){return Q5({mutation:{onSettled:function(){t&&t()}}})};function N4(e,t){return I.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),I.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 F4=I.forwardRef(N4);function B4(e,t){return I.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),I.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"}))}const q4=I.forwardRef(B4);function z4(e,t){return I.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),I.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"}))}const H4=I.forwardRef(z4);function U4(e,t){return I.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),I.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"}))}const G4=I.forwardRef(U4);function K4(e,t){return I.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),I.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"}),I.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))}const V4=I.forwardRef(K4);function W4(e,t){return I.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),I.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 Q4=I.forwardRef(W4);function Y4(e,t){return I.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),I.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 X4=I.forwardRef(Y4);function Z4(e,t){return I.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),I.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 c2=I.forwardRef(Z4);function J4(e,t){return I.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),I.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 e6=I.forwardRef(J4);function t6(e,t){return I.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),I.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 d2=I.forwardRef(t6);function n6(e,t){return I.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),I.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"}))}const f2=I.forwardRef(n6);function r6(e,t){return I.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),I.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 i6=I.forwardRef(r6);function s6(e,t){return I.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),I.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 o6=I.forwardRef(s6);function a6(e,t){return I.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),I.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 l6=I.forwardRef(a6);function u6(e,t){return I.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),I.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 $f=I.forwardRef(u6);function c6(e,t){return I.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),I.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 d6=I.forwardRef(c6);var f6=function(){return[{label:"Brand analysis",href:"/",Icon:i6,isActive:function(n){return n.startsWith("/setup")||n==="/"},showInMenu:!0},{label:"Settings",href:"/settings",Icon:V4,isActive:function(n){return n.startsWith("/settings")},showInMenu:!0}]},E0;function h6(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var A0=function(t){var n=t.className,r=Ut(),i=r.pathname,s=f6();return y.jsx("div",{className:Oe("yst-flex yst-flex-col yst-gap-10",n),children:y.jsx(T.SidebarNavigation.Sidebar,{children:y.jsx(T.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(T.SidebarNavigation.SubmenuItem,{className:Oe("yst-flex yst-gap-x-3",{"yst-sidebar-navigation__item--active":a}),href:o.href,to:o.href,as:ii,label:y.jsxs(y.Fragment,{children:[y.jsx(o.Icon,{className:Oe(E0||(E0=h6(["yst-sidebar-navigation__icon yst-h-6 yst-w-6"])))}),o.label]})},o.label)})})})})};const g6="data:image/svg+xml,%3csvg%20width='208'%20height='42'%20viewBox='0%200%20208%2042'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='169'%20width='39'%20height='16'%20rx='8'%20fill='%23BFDBFE'/%3e%3cpath%20d='M177.869%2012V4.9541H180.813C182.151%204.9541%20182.957%205.62793%20182.957%206.70703V6.7168C182.957%207.4541%20182.41%208.1084%20181.702%208.2207V8.30859C182.649%208.39648%20183.304%209.08008%20183.304%209.99316V10.0029C183.304%2011.2383%20182.386%2012%20180.882%2012H177.869ZM180.506%205.93555H179.129V7.92285H180.345C181.238%207.92285%20181.712%207.57617%20181.712%206.93652V6.92676C181.712%206.30176%20181.268%205.93555%20180.506%205.93555ZM180.545%208.81641H179.129V11.0186H180.594C181.521%2011.0186%20182.015%2010.6328%20182.015%209.91504V9.90527C182.015%209.19238%20181.507%208.81641%20180.545%208.81641ZM186.834%2012.1074C185.247%2012.1074%20184.285%2011.043%20184.285%209.34375V9.33887C184.285%207.65918%20185.257%206.56055%20186.775%206.56055C188.294%206.56055%20189.231%207.625%20189.231%209.23633V9.63672H185.501C185.516%2010.5938%20186.033%2011.1504%20186.858%2011.1504C187.518%2011.1504%20187.894%2010.8184%20188.011%2010.5742L188.025%2010.54H189.183L189.168%2010.584C188.997%2011.2725%20188.284%2012.1074%20186.834%2012.1074ZM186.79%207.5127C186.111%207.5127%20185.604%207.97168%20185.511%208.82129H188.045C187.962%207.94727%20187.469%207.5127%20186.79%207.5127ZM192.547%2012.0244C191.321%2012.0244%20190.818%2011.6143%20190.818%2010.584V7.60547H189.988V6.66309H190.818V5.35449H192.054V6.66309H193.182V7.60547H192.054V10.2959C192.054%2010.8281%20192.264%2011.0527%20192.771%2011.0527C192.942%2011.0527%20193.035%2011.0479%20193.182%2011.0332V11.9707C193.006%2012.0049%20192.781%2012.0244%20192.547%2012.0244ZM195.848%2012.0879C194.832%2012.0879%20194.095%2011.4629%20194.095%2010.4912V10.4814C194.095%209.5293%20194.822%208.97266%20196.121%208.89453L197.493%208.81152V8.35254C197.493%207.82031%20197.146%207.52734%20196.492%207.52734C195.936%207.52734%20195.574%207.72754%20195.452%208.0791L195.447%208.09863H194.3L194.305%208.05469C194.422%207.15625%20195.281%206.56055%20196.551%206.56055C197.923%206.56055%20198.694%207.22461%20198.694%208.35254V12H197.493V11.2676H197.41C197.117%2011.7852%20196.551%2012.0879%20195.848%2012.0879ZM195.296%2010.4326C195.296%2010.8867%20195.682%2011.1553%20196.219%2011.1553C196.951%2011.1553%20197.493%2010.6768%20197.493%2010.042V9.6123L196.292%209.69043C195.613%209.73438%20195.296%209.9834%20195.296%2010.4229V10.4326Z'%20fill='%231E3A8A'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M22.5037%2019.2842C22.9203%2019.2842%2023.2881%2019.5608%2023.402%2019.9612L24.4143%2023.5057C24.857%2025.0583%2026.071%2026.2724%2027.6236%2026.715L31.1682%2027.7273C31.6629%2027.8705%2031.9526%2028.3881%2031.8094%2028.8828C31.7215%2029.192%2031.4774%2029.4361%2031.1682%2029.524L27.6236%2030.5363C26.071%2030.9789%2024.857%2032.193%2024.4143%2033.7456L23.402%2037.2901C23.2588%2037.7849%2022.7413%2038.0745%2022.2466%2037.9313C21.9373%2037.8434%2021.6932%2037.5993%2021.6053%2037.2901L20.5931%2033.7456C20.1504%2032.193%2018.9364%2030.9789%2017.3838%2030.5363L13.8392%2029.524C13.3445%2029.3808%2013.0548%2028.8633%2013.198%2028.3685C13.2859%2028.0593%2013.53%2027.8152%2013.8392%2027.7273L17.3838%2026.715C18.9364%2026.2724%2020.1504%2025.0583%2020.5931%2023.5057L21.6053%2019.9612C21.7193%2019.5608%2022.0871%2019.2842%2022.5037%2019.2842Z'%20fill='url(%23paint0_radial_4548_14216)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13.3742%2012C13.6573%2012%2013.9047%2012.192%2013.9731%2012.4654L14.1846%2013.315C14.3799%2014.0864%2014.9821%2014.6918%2015.7535%2014.8838L16.603%2015.0954C16.9318%2015.1768%2017.1335%2015.512%2017.0522%2015.8407C16.9968%2016.0621%2016.8243%2016.2346%2016.603%2016.2899L15.7535%2016.5015C14.9821%2016.6968%2014.3767%2017.2989%2014.1846%2018.0703L13.9731%2018.9199C13.8917%2019.2486%2013.5564%2019.4504%2013.2277%2019.369C13.0064%2019.3137%2012.8339%2019.1412%2012.7785%2018.9199L12.567%2018.0703C12.3749%2017.2989%2011.7695%2016.6935%2010.9981%2016.5015L10.1486%2016.2899C9.81986%2016.2085%209.61805%2015.8733%209.69943%2015.5446C9.75476%2015.3232%209.92727%2015.1507%2010.1486%2015.0954L10.9981%2014.8838C11.7695%2014.6918%2012.3749%2014.0864%2012.567%2013.315L12.7785%2012.4654C12.8469%2012.192%2013.0943%2012%2013.3774%2012H13.3742Z'%20fill='url(%23paint1_radial_4548_14216)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.39254%2026.8813C6.54226%2026.8813%206.67571%2026.979%206.72453%2027.1189L6.90681%2027.669C6.97516%2027.8773%207.1379%2028.0401%207.34947%2028.1117L7.89954%2028.294C8.08181%2028.3558%208.17946%2028.5543%208.12087%2028.7366C8.08507%2028.8408%208.0037%2028.9222%207.89954%2028.958L7.34947%2029.1402C7.14116%2029.2086%206.97841%2029.3713%206.90681%2029.5829L6.72453%2030.133C6.66269%2030.3152%206.46414%2030.4129%206.28187%2030.3543C6.17771%2030.3185%206.09634%2030.2371%206.06054%2030.133L5.87827%2029.5829C5.80992%2029.3746%205.64392%2029.2118%205.4356%2029.1402L4.88553%2028.958C4.70326%2028.8961%204.60561%2028.6976%204.6642%2028.5153C4.7%2028.4111%204.78138%2028.3298%204.88553%2028.294L5.4356%2028.1117C5.64392%2028.0433%205.80666%2027.8806%205.87827%2027.669L6.06054%2027.1189C6.10936%2026.9757%206.24281%2026.8813%206.39254%2026.8813Z'%20fill='url(%23paint2_radial_4548_14216)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2.80904%2033.5596C2.95876%2033.5596%203.09221%2033.6572%203.14104%2033.7972L3.32331%2034.3473C3.39166%2034.5556%203.5544%2034.7183%203.76597%2034.7899L4.31604%2034.9722C4.49832%2035.034%204.59596%2035.2326%204.53737%2035.4148C4.50157%2035.519%204.4202%2035.6004%204.31604%2035.6362L3.76597%2035.8185C3.55766%2035.8868%203.39492%2036.0495%203.32331%2036.2611L3.14104%2036.8112C3.07919%2036.9935%202.88065%2037.0911%202.69837%2037.0325C2.59422%2036.9967%202.51285%2036.9153%202.47704%2036.8112L2.29477%2036.2611C2.22642%2036.0528%202.06042%2035.8901%201.85211%2035.8185L1.30204%2035.6362C1.11976%2035.5743%201.02212%2035.3758%201.0807%2035.1935C1.11651%2035.0894%201.19788%2035.008%201.30204%2034.9722L1.85211%2034.7899C2.06042%2034.7216%202.22316%2034.5588%202.29477%2034.3473L2.47704%2033.7972C2.52587%2033.654%202.65931%2033.5596%202.80904%2033.5596Z'%20fill='url(%23paint3_radial_4548_14216)'/%3e%3cpath%20d='M2.42488%2032.7235C1.94641%2031.4476%201.68277%2030.0676%201.68277%2028.6256C1.68277%2023.5806%204.89532%2019.2712%209.38379%2017.634L8.79466%2016.0586C3.66498%2017.9269%200%2022.8483%200%2028.6256C0%2030.2661%200.296193%2031.835%200.836502%2033.2866L2.42488%2032.7268V32.7235Z'%20fill='url(%23paint4_radial_4548_14216)'/%3e%3cpath%20d='M20.6587%2037.7652C18.6602%2039.3633%2016.1279%2040.3202%2013.3743%2040.3202C10.0023%2040.3202%206.96221%2038.8849%204.82702%2036.5967L3.58691%2037.7359C6.02807%2040.3593%209.51078%2041.9998%2013.3776%2041.9998C16.5218%2041.9998%2019.4121%2040.9159%2021.6938%2039.0997L20.662%2037.7684L20.6587%2037.7652Z'%20fill='url(%23paint5_radial_4548_14216)'/%3e%3cpath%20d='M13.3739%2022.3664C15.0436%2022.3664%2016.5604%2023.0238%2017.6833%2024.0914L18.8095%2022.8383C17.3904%2021.5038%2015.4798%2020.6836%2013.3771%2020.6836C9.89444%2020.6836%206.93902%2022.9262%205.86816%2026.0476L7.44678%2026.627C8.28328%2024.1533%2010.6235%2022.3631%2013.3771%2022.3631L13.3739%2022.3664Z'%20fill='url(%23paint6_radial_4548_14216)'/%3e%3cpath%20d='M17.6737%2033.1658C16.5508%2034.2301%2015.0373%2034.8843%2013.3741%2034.8843C10.6074%2034.8843%208.2574%2033.0811%207.43392%2030.5879L5.84229%2031.1249C6.89035%2034.2822%209.8653%2036.5638%2013.3773%2036.5638C15.4832%2036.5638%2017.3971%2035.7436%2018.8162%2034.4059L17.677%2033.169L17.6737%2033.1658Z'%20fill='url(%23paint7_radial_4548_14216)'/%3e%3cpath%20d='M39.169%2021.2891H43.677C45.7666%2021.2891%2047.2802%2021.595%2048.2111%2022.2037C49.142%2022.8123%2049.6074%2023.7758%2049.6074%2025.0908C49.6074%2025.9761%2049.3796%2026.7149%2048.9206%2027.3041C48.4617%2027.8932%2047.8075%2028.2642%2046.9482%2028.414V28.5181C48.0158%2028.7199%2048.8002%2029.1138%2049.3014%2029.7062C49.8027%2030.2985%2050.0533%2031.0992%2050.0533%2032.1115C50.0533%2033.4753%2049.5781%2034.5429%2048.6244%2035.3143C47.6707%2036.0857%2046.3493%2036.473%2044.6502%2036.473H39.1658V21.2891H39.169ZM41.6525%2027.5645H44.0416C45.0799%2027.5645%2045.8383%2027.3985%2046.3167%2027.0697C46.7952%2026.741%2047.0328%2026.1811%2047.0328%2025.3935C47.0328%2024.6806%2046.7757%2024.1631%2046.2581%2023.8474C45.7406%2023.5284%2044.9236%2023.3689%2043.8007%2023.3689H41.6492V27.5645H41.6525ZM41.6525%2029.5792V34.3867H44.2889C45.3272%2034.3867%2046.1117%2034.1881%2046.6422%2033.791C47.1728%2033.3939%2047.4364%2032.7657%2047.4364%2031.9065C47.4364%2031.1188%2047.1662%2030.5329%2046.6259%2030.1521C46.0856%2029.7713%2045.2654%2029.5792%2044.1653%2029.5792H41.6525Z'%20fill='url(%23paint8_linear_4548_14216)'/%3e%3cpath%20d='M58.7762%2024.7817C59.2677%2024.7817%2059.6713%2024.8175%2059.9902%2024.8859L59.7526%2027.161C59.4076%2027.0764%2059.0463%2027.0374%2058.672%2027.0374C57.6955%2027.0374%2056.9046%2027.3563%2056.2992%2027.9943C55.6938%2028.6322%2055.3911%2029.459%2055.3911%2030.4778V36.4797H52.95V24.9933H54.8606L55.1828%2027.0178H55.3065C55.6873%2026.3311%2056.1853%2025.7908%2056.7972%2025.3871C57.4091%2024.9868%2058.0699%2024.785%2058.7762%2024.785V24.7817Z'%20fill='url(%23paint9_linear_4548_14216)'/%3e%3cpath%20d='M69.309%2036.4734L68.8208%2034.8753H68.7394C68.1861%2035.575%2067.6295%2036.0503%2067.0664%2036.3041C66.5065%2036.558%2065.784%2036.685%2064.9051%2036.685C63.7757%2036.685%2062.8969%2036.379%2062.2622%2035.7703C61.6275%2035.1617%2061.3118%2034.2991%2061.3118%2033.186C61.3118%2032.0012%2061.7512%2031.1094%2062.63%2030.5072C63.5088%2029.9051%2064.8498%2029.5763%2066.6498%2029.521L68.632%2029.4591V28.8472C68.632%2028.1116%2068.4595%2027.5648%2068.1177%2027.2003C67.7759%2026.8357%2067.2421%2026.6534%2066.5228%2026.6534C65.9337%2026.6534%2065.3706%2026.7413%2064.8303%2026.9138C64.29%2027.0864%2063.7692%2027.2914%2063.2712%2027.5258L62.4803%2025.7811C63.1019%2025.4557%2063.7855%2025.2083%2064.5276%2025.039C65.2697%2024.8698%2065.9662%2024.7852%2066.627%2024.7852C68.0884%2024.7852%2069.1918%2025.1041%2069.9339%2025.7421C70.6793%2026.38%2071.0503%2027.3793%2071.0503%2028.7431V36.4799H69.3057L69.309%2036.4734ZM65.6733%2034.8134C66.5586%2034.8134%2067.2714%2034.566%2067.8085%2034.0713C68.3455%2033.5766%2068.6124%2032.8833%2068.6124%2031.9882V30.9922L67.138%2031.054C65.989%2031.0963%2065.1525%2031.2884%2064.6285%2031.6301C64.1044%2031.9719%2063.8441%2032.4992%2063.8441%2033.2055C63.8441%2033.7165%2063.997%2034.1136%2064.2997%2034.3935C64.6057%2034.6734%2065.0614%2034.8134%2065.67%2034.8134H65.6733Z'%20fill='url(%23paint10_linear_4548_14216)'/%3e%3cpath%20d='M84.5646%2036.4732H82.1137V29.4102C82.1137%2028.5248%2081.9347%2027.8641%2081.5799%2027.4279C81.2219%2026.9918%2080.6588%2026.7737%2079.8809%2026.7737C78.8491%2026.7737%2078.0939%2027.0797%2077.6155%2027.6883C77.137%2028.297%2076.8994%2029.319%2076.8994%2030.7512V36.4732H74.4583V24.9868H76.3689L76.7106%2026.4938H76.8343C77.1793%2025.947%2077.6708%2025.5238%2078.3088%2025.2277C78.9467%2024.9315%2079.653%2024.7817%2080.4277%2024.7817C83.1846%2024.7817%2084.5614%2026.1846%2084.5614%2028.987V36.4765L84.5646%2036.4732Z'%20fill='url(%23paint11_linear_4548_14216)'/%3e%3cpath%20d='M91.836%2036.6814C90.4038%2036.6814%2089.2841%2036.1606%2088.4802%2035.1223C87.6762%2034.084%2087.2759%2032.6258%2087.2759%2030.751C87.2759%2028.8762%2087.6827%2027.4018%2088.4965%2026.3537C89.3102%2025.3056%2090.4364%2024.7816%2091.8783%2024.7816C93.3202%2024.7816%2094.5375%2025.3382%2095.3252%2026.4546H95.4489C95.3317%2025.6311%2095.2731%2024.9802%2095.2731%2024.5017V20.3159H97.724V36.4763H95.8134L95.387%2034.9693H95.2731C94.4919%2036.1118%2093.3462%2036.6847%2091.836%2036.6847V36.6814ZM92.4902%2034.709C93.4927%2034.709%2094.225%2034.4258%2094.6807%2033.8627C95.1364%2033.2996%2095.374%2032.3817%2095.387%2031.1156V30.7738C95.387%2029.3254%2095.1527%2028.2969%2094.6807%2027.6882C94.2088%2027.0795%2093.4732%2026.7736%2092.4674%2026.7736C91.6081%2026.7736%2090.9474%2027.1219%2090.4852%2027.8184C90.023%2028.5149%2089.7886%2029.5044%2089.7886%2030.7933C89.7886%2032.0823%2090.0132%2033.0392%2090.4624%2033.7065C90.9116%2034.3737%2091.5886%2034.709%2092.4869%2034.709H92.4902Z'%20fill='url(%23paint12_linear_4548_14216)'/%3e%3cpath%20d='M106.997%2036.473V21.2891H109.481V36.473H106.997Z'%20fill='url(%23paint13_linear_4548_14216)'/%3e%3cpath%20d='M123.334%2036.4732H120.883V29.4102C120.883%2028.5248%20120.704%2027.8641%20120.349%2027.4279C119.991%2026.9918%20119.428%2026.7737%20118.65%2026.7737C117.618%2026.7737%20116.863%2027.0797%20116.385%2027.6883C115.906%2028.297%20115.668%2029.319%20115.668%2030.7512V36.4732H113.227V24.9868H115.138L115.48%2026.4938H115.603C115.948%2025.947%20116.44%2025.5238%20117.078%2025.2277C117.716%2024.9315%20118.422%2024.7817%20119.197%2024.7817C121.954%2024.7817%20123.33%2026.1846%20123.33%2028.987V36.4765L123.334%2036.4732Z'%20fill='url(%23paint14_linear_4548_14216)'/%3e%3cpath%20d='M134.449%2033.2019C134.449%2034.3249%20134.039%2035.1841%20133.222%2035.783C132.405%2036.3819%20131.233%2036.6814%20129.71%2036.6814C128.187%2036.6814%20126.95%2036.4503%20126.022%2035.9848V33.8757C127.373%2034.4974%20128.629%2034.8098%20129.791%2034.8098C131.295%2034.8098%20132.044%2034.3574%20132.044%2033.4493C132.044%2033.1596%20131.959%2032.9155%20131.793%2032.7235C131.627%2032.5314%20131.354%2032.3296%20130.973%2032.1213C130.592%2031.913%20130.062%2031.6786%20129.385%2031.415C128.063%2030.904%20127.168%2030.3897%20126.699%2029.8787C126.231%2029.3677%20126%2028.7004%20126%2027.8835C126%2026.9005%20126.397%2026.1389%20127.188%2025.592C127.982%2025.0485%20129.059%2024.7783%20130.423%2024.7783C131.787%2024.7783%20133.05%2025.0517%20134.254%2025.5986L133.466%2027.4376C132.226%2026.9265%20131.185%2026.6694%20130.342%2026.6694C129.053%2026.6694%20128.411%2027.0372%20128.411%2027.7695C128.411%2028.1308%20128.581%2028.4335%20128.916%2028.6842C129.251%2028.9348%20129.983%2029.2766%20131.113%2029.7127C132.06%2030.0805%20132.75%2030.4158%20133.18%2030.7217C133.609%2031.0277%20133.928%2031.3792%20134.137%2031.7763C134.345%2032.1734%20134.449%2032.6519%20134.449%2033.2052V33.2019Z'%20fill='url(%23paint15_linear_4548_14216)'/%3e%3cpath%20d='M136.939%2021.9434C136.939%2021.5072%20137.059%2021.172%20137.297%2020.9344C137.535%2020.6968%20137.876%2020.5796%20138.319%2020.5796C138.762%2020.5796%20139.081%2020.6968%20139.322%2020.9344C139.562%2021.1687%20139.68%2021.504%20139.68%2021.9434C139.68%2022.3828%20139.559%2022.6855%20139.322%2022.9264C139.084%2023.164%20138.749%2023.2844%20138.319%2023.2844C137.889%2023.2844%20137.535%2023.164%20137.297%2022.9264C137.059%2022.6887%20136.939%2022.36%20136.939%2021.9434ZM139.527%2036.4731H137.085V24.9867H139.527V36.4731Z'%20fill='url(%23paint16_linear_4548_14216)'/%3e%3cpath%20d='M152.715%2024.987V26.328L150.752%2026.6925C150.931%2026.9334%20151.081%2027.2328%20151.198%2027.5843C151.316%2027.9359%20151.374%2028.3102%20151.374%2028.7073C151.374%2029.892%20150.964%2030.8229%20150.147%2031.5C149.33%2032.177%20148.204%2032.5187%20146.772%2032.5187C146.404%2032.5187%20146.072%2032.4927%20145.776%2032.4373C145.248%2032.7628%20144.988%2033.1437%20144.988%2033.5798C144.988%2033.8435%20145.112%2034.0387%20145.356%2034.1722C145.603%2034.3024%20146.052%2034.3707%20146.71%2034.3707H148.715C149.981%2034.3707%20150.945%2034.6409%20151.602%2035.1812C152.259%2035.7215%20152.588%2036.4994%20152.588%2037.5182C152.588%2038.8202%20152.051%2039.8227%20150.977%2040.529C149.903%2041.2353%20148.354%2041.5868%20146.326%2041.5868C144.76%2041.5868%20143.566%2041.3101%20142.742%2040.7568C141.919%2040.2035%20141.505%2039.4125%20141.505%2038.3905C141.505%2037.6842%20141.73%2037.0918%20142.176%2036.6101C142.622%2036.1284%20143.247%2035.7964%20144.051%2035.6076C143.725%2035.4676%20143.455%2035.2463%20143.247%2034.9371C143.035%2034.6279%20142.931%2034.3056%20142.931%2033.9671C142.931%2033.5375%20143.051%2033.173%20143.296%2032.8768C143.54%2032.5806%20143.898%2032.2844%20144.376%2031.9947C143.781%2031.7376%20143.299%2031.3209%20142.928%2030.7416C142.557%2030.1655%20142.371%2029.4884%20142.371%2028.7105C142.371%2027.4639%20142.765%2026.4972%20143.549%2025.8137C144.334%2025.1269%20145.454%2024.7852%20146.908%2024.7852C147.234%2024.7852%20147.576%2024.8079%20147.93%2024.8535C148.289%2024.8991%20148.555%2024.9446%20148.734%2024.9935H152.712L152.715%2024.987ZM143.689%2038.2603C143.689%2038.7876%20143.927%2039.1912%20144.402%2039.4744C144.877%2039.7576%20145.541%2039.9008%20146.401%2039.9008C147.729%2039.9008%20148.721%2039.7087%20149.372%2039.3279C150.023%2038.9471%20150.349%2038.4426%20150.349%2037.8111C150.349%2037.3131%20150.17%2036.9584%20149.815%2036.7468C149.457%2036.5352%20148.796%2036.4311%20147.826%2036.4311H145.978C145.278%2036.4311%20144.721%2036.5971%20144.311%2036.9258C143.898%2037.2546%20143.693%2037.7005%20143.693%2038.2603H143.689ZM144.741%2028.7073C144.741%2029.4266%20144.926%2029.9799%20145.297%2030.3705C145.668%2030.7578%20146.199%2030.9531%20146.892%2030.9531C148.305%2030.9531%20149.011%2030.198%20149.011%2028.6877C149.011%2027.9391%20148.835%2027.363%20148.487%2026.9594C148.139%2026.5558%20147.605%2026.3507%20146.892%2026.3507C146.179%2026.3507%20145.652%2026.5526%20145.288%2026.9529C144.923%2027.3532%20144.741%2027.9391%20144.741%2028.7073Z'%20fill='url(%23paint17_linear_4548_14216)'/%3e%3cpath%20d='M164.95%2036.4729H162.499V29.4099C162.499%2028.5245%20162.32%2027.8638%20161.965%2027.4276C161.607%2026.9915%20161.044%2026.7734%20160.266%2026.7734C159.241%2026.7734%20158.489%2027.0794%20158.007%2027.6913C157.526%2028.3032%20157.285%2029.3317%20157.285%2030.7704V36.4729H154.844V20.3125H157.285V24.4136C157.285%2025.0711%20157.243%2025.7742%20157.161%2026.5228H157.317C157.649%2025.9695%20158.112%2025.5398%20158.704%2025.2339C159.296%2024.9279%20159.986%2024.7782%20160.774%2024.7782C163.557%2024.7782%20164.95%2026.181%20164.95%2028.9835V36.4729Z'%20fill='url(%23paint18_linear_4548_14216)'/%3e%3cpath%20d='M172.625%2034.709C173.221%2034.709%20173.816%2034.6146%20174.412%2034.4291V36.2681C174.142%2036.3853%20173.794%2036.4829%20173.367%2036.5643C172.941%2036.6424%20172.501%2036.6847%20172.042%2036.6847C169.728%2036.6847%20168.573%2035.4674%20168.573%2033.0295V26.8387H167.004V25.7581L168.687%2024.863L169.517%2022.4316H171.024V24.9867H174.295V26.8355H171.024V32.9839C171.024%2033.5731%20171.17%2034.006%20171.466%2034.2859C171.763%2034.5658%20172.147%2034.7058%20172.625%2034.7058V34.709Z'%20fill='url(%23paint19_linear_4548_14216)'/%3e%3cpath%20d='M184.424%2033.2019C184.424%2034.3249%20184.014%2035.1841%20183.197%2035.783C182.38%2036.3819%20181.208%2036.6814%20179.685%2036.6814C178.161%2036.6814%20176.925%2036.4503%20175.997%2035.9848V33.8757C177.348%2034.4974%20178.604%2034.8098%20179.766%2034.8098C181.27%2034.8098%20182.018%2034.3574%20182.018%2033.4493C182.018%2033.1596%20181.934%2032.9155%20181.768%2032.7235C181.602%2032.5314%20181.328%2032.3296%20180.948%2032.1213C180.567%2031.913%20180.036%2031.6786%20179.359%2031.415C178.038%2030.904%20177.143%2030.3897%20176.674%2029.8787C176.205%2029.3677%20175.974%2028.7004%20175.974%2027.8835C175.974%2026.9005%20176.371%2026.1389%20177.162%2025.592C177.956%2025.0485%20179.034%2024.7783%20180.397%2024.7783C181.761%2024.7783%20183.024%2025.0517%20184.228%2025.5986L183.441%2027.4376C182.201%2026.9265%20181.159%2026.6694%20180.316%2026.6694C179.027%2026.6694%20178.386%2027.0372%20178.386%2027.7695C178.386%2028.1308%20178.555%2028.4335%20178.89%2028.6842C179.226%2028.9348%20179.958%2029.2766%20181.088%2029.7127C182.035%2030.0805%20182.725%2030.4158%20183.154%2030.7217C183.584%2031.0277%20183.903%2031.3792%20184.111%2031.7763C184.32%2032.1734%20184.424%2032.6519%20184.424%2033.2052V33.2019Z'%20fill='url(%23paint20_linear_4548_14216)'/%3e%3cdefs%3e%3cradialGradient%20id='paint0_radial_4548_14216'%20cx='0'%20cy='0'%20r='1'%20gradientUnits='userSpaceOnUse'%20gradientTransform='translate(44.0672%2015.5248)%20scale(61.1655%2061.1655)'%3e%3cstop%20offset='0.17'%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/radialGradient%3e%3cradialGradient%20id='paint1_radial_4548_14216'%20cx='0'%20cy='0'%20r='1'%20gradientUnits='userSpaceOnUse'%20gradientTransform='translate(44.0676%2015.525)%20scale(61.1655%2061.1655)'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/radialGradient%3e%3cradialGradient%20id='paint2_radial_4548_14216'%20cx='0'%20cy='0'%20r='1'%20gradientUnits='userSpaceOnUse'%20gradientTransform='translate(44.0677%20-58.8974)%20scale(61.1655%2061.1654)'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/radialGradient%3e%3cradialGradient%20id='paint3_radial_4548_14216'%20cx='0'%20cy='0'%20r='1'%20gradientUnits='userSpaceOnUse'%20gradientTransform='translate(44.0677%20-58.8984)%20scale(61.1655%2061.1656)'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/radialGradient%3e%3cradialGradient%20id='paint4_radial_4548_14216'%20cx='0'%20cy='0'%20r='1'%20gradientUnits='userSpaceOnUse'%20gradientTransform='translate(44.0677%20-58.8978)%20scale(61.1655%2061.1655)'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/radialGradient%3e%3cradialGradient%20id='paint5_radial_4548_14216'%20cx='0'%20cy='0'%20r='1'%20gradientUnits='userSpaceOnUse'%20gradientTransform='translate(44.0677%20-58.8978)%20scale(61.1655%2061.1654)'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/radialGradient%3e%3cradialGradient%20id='paint6_radial_4548_14216'%20cx='0'%20cy='0'%20r='1'%20gradientUnits='userSpaceOnUse'%20gradientTransform='translate(44.0673%2015.5246)%20scale(61.1655%2061.1656)'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/radialGradient%3e%3cradialGradient%20id='paint7_radial_4548_14216'%20cx='0'%20cy='0'%20r='1'%20gradientUnits='userSpaceOnUse'%20gradientTransform='translate(44.0675%20-58.8983)%20scale(61.1655%2061.1656)'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/radialGradient%3e%3clinearGradient%20id='paint8_linear_4548_14216'%20x1='27.6858'%20y1='26.9883'%20x2='184.655'%20y2='47.7609'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint9_linear_4548_14216'%20x1='27.7019'%20y1='26.8681'%20x2='184.671'%20y2='47.6374'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint10_linear_4548_14216'%20x1='27.8582'%20y1='25.703'%20x2='184.827'%20y2='46.4723'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint11_linear_4548_14216'%20x1='28.0796'%20y1='24.0657'%20x2='185.049'%20y2='44.835'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint12_linear_4548_14216'%20x1='28.6426'%20y1='19.7724'%20x2='185.612'%20y2='40.5417'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint13_linear_4548_14216'%20x1='28.8281'%20y1='18.376'%20x2='185.794'%20y2='39.1453'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint14_linear_4548_14216'%20x1='28.7407'%20y1='19.0206'%20x2='185.71'%20y2='39.7899'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint15_linear_4548_14216'%20x1='28.9621'%20y1='17.367'%20x2='185.928'%20y2='38.1363'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint16_linear_4548_14216'%20x1='29.382'%20y1='14.187'%20x2='186.351'%20y2='34.9563'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint17_linear_4548_14216'%20x1='28.9585'%20y1='17.3836'%20x2='185.928'%20y2='38.1529'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint18_linear_4548_14216'%20x1='29.7136'%20y1='11.6741'%20x2='186.683'%20y2='32.4466'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint19_linear_4548_14216'%20x1='29.8241'%20y1='10.8313'%20x2='186.794'%20y2='31.6039'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint20_linear_4548_14216'%20x1='29.8206'%20y1='10.867'%20x2='186.79'%20y2='31.6364'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A61E69'/%3e%3cstop%20offset='1'%20stop-color='%236366F1'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e";function y6(e,t){return b6(e)||v6(e,t)||p6(e,t)||m6()}function m6(){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 p6(e,t){if(e){if(typeof e=="string")return T0(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)?T0(e,t):void 0}}function T0(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 v6(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function b6(e){if(Array.isArray(e))return e}var x6=function(t){var n=t.className,r=Ut(),i=r.pathname,s=Nn(),o=s.hostAppProps,a=o.onLogout,l=z.useState(!1),u=y6(l,2),c=u[0],d=u[1],f=Fu({query:{select:function(C){var w=C.data;return w==null?void 0:w.data}}}),h=f.data,g=f.isLoading,m=R4(a),p=m.mutate,v=m.isPending,b=function(C){if(C.preventDefault(),d(!0),!v)return p()};return y.jsxs("div",{className:Oe("ystaii-sidemenu"),children:[y.jsx("div",{className:"ystaii-mobile-menu lg:yst-hidden",children:y.jsx(T.SidebarNavigation,{activePath:i,children:y.jsx(T.SidebarNavigation.Mobile,{closeButtonScreenReaderText:"Close sidebar",openButtonScreenReaderText:"Open sidebar",children:y.jsx(A0,{})})})}),y.jsxs("div",{className:Oe("ystaii-menuHeader","yst-mb-6 yst-mt-10 yst-flex yst-flex-row yst-justify-between yst-px-4","yst-flex-col yst-items-start yst-space-y-12 yst-max-w-2xl yst-mx-auto"),children:[y.jsx(T.Title,{children:y.jsx(ii,{className:Oe("yst-outline-none"),to:"/",children:y.jsx("img",{src:g6,alt:"Yoast",width:"208",height:"42",className:"yst-block"})})}),y.jsxs("div",{className:Oe("ystaii-userInfoContainer","yst-flex yst-flex-col"),children:[y.jsx("div",{children:y.jsx("b",{children:(h==null?void 0:h.displayName)||y.jsx(T.SkeletonLoader,{children:"Display name"})})}),y.jsx("div",{children:(h==null?void 0:h.email)||y.jsx(T.SkeletonLoader,{children:"loading-email@address.com"})}),y.jsx("div",{children:y.jsx(T.Link,{variant:"primary",className:"yst-no-underline",onClick:b,children:g?y.jsxs(T.SkeletonLoader,{children:["Sign out ",y.jsx("span",{"aria-hidden":"true",children:"→"})]}):c||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:Oe("ystaii-desktopMenu","yst-hidden","lg:yst-mb-0 lg:yst-block lg:yst-w-full lg:yst-shrink-0"),children:y.jsx(T.SidebarNavigation,{activePath:i,children:y.jsx(A0,{className:n})})})]})},h2=yx.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);}"]);h2.defaultProps={href:"#content"};function wc(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:Oe("ystaii-layout","yst-block","lg:yst-flex lg:yst-min-h-full lg:yst-overflow-visible"),children:[y.jsx(h2,{children:"Skip to main content"}),!s&&y.jsxs("div",{className:Oe("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(x6,{}),o&&y.jsx(o,{}),y.jsx("div",{id:"toast-portal"})]}),y.jsx("main",{className:Oe("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:Oe("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 $d(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,g,m,p){var v=g&&g.prototype instanceof a?g:a,b=Object.create(v.prototype);return Yt(b,"_invoke",function(S,C,w){var O,x,_,k=0,E=w||[],j=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(A,P){return O=A,x=0,_=e,M.n=P,o}};function B(R,A){for(x=R,_=A,t=0;!j&&k&&!P&&t<E.length;t++){var P,L=E[t],H=M.p,G=L[2];R>3?(P=G===A)&&(_=L[(x=L[4])?5:(x=3,3)],L[4]=L[5]=e):L[0]<=H&&((P=R<2&&H<L[1])?(x=0,M.v=A,M.n=L[1]):H<G&&(P=R<3||L[0]>A||A>G)&&(L[4]=R,L[5]=A,M.n=G,x=0))}if(P||R>1)return o;throw j=!0,A}return function(R,A,P){if(k>1)throw TypeError("Generator is already running");for(j&&A===1&&B(A,P),x=A,_=P;(t=x<2?e:_)||!j;){O||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(k=2,O){if(x||(R="next"),t=O[R]){if(!(t=t.call(O,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=O.return)&&t.call(O),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);O=e}else if((t=(j=M.n<0)?_:S.call(C,M))!==o)break}catch(L){O=e,x=1,_=L}finally{k=1}}return{value:t,done:j}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(Yt(t={},r,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,Yt(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,Yt(d,"constructor",u),Yt(u,"constructor",l),l.displayName="GeneratorFunction",Yt(u,i,"GeneratorFunction"),Yt(d),Yt(d,i,"Generator"),Yt(d,r,function(){return this}),Yt(d,"toString",function(){return"[object Generator]"}),($d=function(){return{w:s,m:f}})()}function Yt(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Yt=function(o,a,l,u){if(a)i?i(o,a,{value:l,enumerable:!u,configurable:!u,writable:!u}):o[a]=l;else{var c=function(f,h){Yt(o,f,function(g){return this._invoke(f,h,g)})};c("next",0),c("throw",1),c("return",2)}},Yt(e,t,n,r)}function P0(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function w6(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){P0(s,r,i,o,a,"next",l)}function a(l){P0(s,r,i,o,a,"throw",l)}o(void 0)})}}function S6(e,t){return O6(e)||k6(e,t)||_6(e,t)||C6()}function C6(){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 _6(e,t){if(e){if(typeof e=="string")return j0(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)?j0(e,t):void 0}}function j0(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 k6(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function O6(e){if(Array.isArray(e))return e}var E6=function(t){var n,r,i=t.className,s=Gt(),o=fn(),a=z.useState(!1),l=S6(a,2),u=l[0],c=l[1],d=Qi({query:{select:function(O){var x=O.data;return x==null?void 0:x.brands}}}),f=d.data,h=a2({mutation:{onSettled:function(){s.invalidateQueries({queryKey:[Xn()]})}}}),g=h.mutateAsync,m=h.isPending,p=(n=f==null?void 0:f.filter(function(w){var O;return((O=w.settings)===null||O===void 0?void 0:O.showAutomaticAnalysisDisabledNotification)===!0}))!==null&&n!==void 0?n:[],v=function(){c(!1)},b=function(){var w=w6($d().m(function O(){var x;return $d().w(function(_){for(;;)switch(_.n){case 0:if(p.length!==0){_.n=1;break}return _.a(2);case 1:return x=p.map(function(k){return g({brandId:String(k.id),data:{showAutomaticAnalysisDisabledNotification:!1}})}),_.n=2,Promise.all(x);case 2:o("/settings"),v();case 3:return _.a(2)}},O)}));return function(){return w.apply(this,arguments)}}();z.useEffect(function(){f&&f.some(function(w){var O;return((O=w.settings)===null||O===void 0?void 0:O.showAutomaticAnalysisDisabledNotification)===!0})&&c(!0)},[f]);var S=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(w){return y.jsx("li",{children:y.jsx("b",{children:w.name})},w.id)})}),y.jsxs("p",{children:["If you prefer, you can go to ",y.jsx("b",{children:"Settings"})," and deactivate different brand(s) instead."]})]});return u?y.jsx(T.Modal,{isOpen:u,onClose:b,position:"center",as:"div",className:i,children:y.jsxs(T.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(T.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(T.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:S})}),y.jsx(T.Modal.Container.Content,{className:"yst-mb-4 yst-space-y-3",children:C})]})}),y.jsxs(T.Modal.Container.Footer,{className:"yst-mt-3 yst-flex yst-justify-end yst-gap-2",children:[y.jsx(T.Button,{variant:"secondary",onClick:b,children:"Close"}),y.jsx(T.Button,{variant:"primary",onClick:b,isLoading:m,disabled:p.length===0,children:"Go to settings"})]})]})}):null},Bu=function(){return y.jsx("div",{className:"yst-flex yst-min-h-screen yst-items-center yst-justify-center",children:y.jsxs("div",{className:"yst-flex yst-items-center yst-gap-3 yst-text-center",children:[y.jsx(T.Spinner,{variant:"primary"}),y.jsx("span",{className:"yst-italic",children:"Just a moment while we get things ready for you..."})]})})},A6={HOME:"/"},T6=function(t){var n=t.hideNav,r=n===void 0?!1:n,i=t.disableLayout,s=i===void 0?!1:i,o=t.DebugInfo,a=Ut(),l=fn(),u={disable:s,hideNav:r},c=Nn(),d=c.brandId,f=Ha(),h=f.setBrandId,g=Qi({query:{refetchOnReconnect:!1,refetchOnWindowFocus:!1,select:function(x){var _;return x==null||(_=x.data)===null||_===void 0?void 0:_.brands}}}),m=g.data,p=g.isLoading,v=g.error,b=g.refetch,S=z.useRef(!1),C=z.useMemo(function(){return m==null?void 0:m.find(function(O){return O.id===d})},[m,d]);z.useEffect(function(){var O;if(!(m===void 0||d)){var x=(O=m[0])===null||O===void 0?void 0:O.id;x&&h(x)}},[m,d,h,l,a.pathname]),z.useEffect(function(){!d||S.current||(S.current=!0)},[C,d,l,a.pathname,m]);var w=z.useCallback(function(){b()},[b]);return a.pathname!==A6.HOME&&p?y.jsx(wc,{...u,children:y.jsx(Bu,{})}):v?y.jsx(wc,{...u,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(T.Button,{variant:"primary",onClick:w,children:"Retry"})]})})}):y.jsxs(wc,{DebugInfo:o,...u,children:[y.jsx(Hs,{}),y.jsx(E6,{})]})},P6=function(){var t=Cu(),n=t.brandId,r=t.analysisId,i=s2(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(Bu,{});if(a)return console.error("Error fetching analyses for validation:",a),y.jsx(bi,{to:"/brands/".concat(n),replace:!0});if(!r||r.trim()==="")return y.jsx(bi,{to:"/brands/".concat(n),replace:!0});if(r==="latest")return y.jsx(Hs,{});var l=parseInt(r,10);if(isNaN(l))return y.jsx(bi,{to:"/brands/".concat(n),replace:!0});var u=s==null?void 0:s.some(function(c){return c.id===l});return u?y.jsx(Hs,{}):y.jsx(bi,{to:"/brands/".concat(n),replace:!0})},M0=function(){var t=Cu(),n=t.brandId,r=Qi({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(Bu,{});if(o)return y.jsx(bi,{to:"/",replace:!0});if(!n||n.trim()==="")return y.jsx(bi,{to:"/",replace:!0});var u=parseInt(n,10),c=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===u||d.id===n});return a&&!c?y.jsx(bi,{to:"/",replace:!0}):y.jsx(Hs,{})},j6={openai:"openai",perplexity:"perplexity",anthropic:"anthropic"},M6={updating:"updating"},gi={pending:"pending",processing:"processing",completed:"completed",failed:"failed",cancelled:"cancelled"},$6=function(t){return typeof t=="string"&&t!=="latest"&&t.trim().length>0};function L6(e,t){return I.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),I.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 g2=I.forwardRef(L6);function D6(e,t){return I.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),I.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 I6=I.forwardRef(D6);function R6(e,t){return I.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),I.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 y2=I.forwardRef(R6);function N6(e,t){return I.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),I.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 m2=I.forwardRef(N6);function F6(e,t){return I.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),I.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 B6=I.forwardRef(F6);function q6(e,t){return I.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),I.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 z6=I.forwardRef(q6);function H6(e,t){return I.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),I.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 $0=I.forwardRef(H6);function U6(e,t){return I.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),I.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"}),I.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 p2=I.forwardRef(U6);function G6(e,t){return I.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),I.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 K6=I.forwardRef(G6);function V6(e,t){return I.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),I.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 v2=I.forwardRef(V6);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)}var W6=["children","as","startColor","endColor","angle","disabled","style","className"];function L0(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 D0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?L0(Object(n),!0).forEach(function(r){Q6(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Q6(e,t,n){return(t=Y6(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y6(e){var t=X6(e,"string");return oa(t)=="symbol"?t:t+""}function X6(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 Z6(e,t){if(e==null)return{};var n,r,i=J6(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 J6(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 qu=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,u=t.angle,c=u===void 0?102:u,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=Z6(t,W6),b=D0(f?{display:"inline-block"}:{background:"linear-gradient(".concat(c,"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 Lf(e){var t=e.children,n=e.nestedInPaperContent,r=n===void 0?!1:n,i=e.className;return y.jsx("div",{className:Oe("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=fn();return y.jsx("form",{onSubmit:function(){return t("/setup")},children:y.jsxs(T.Paper,{className:"yst-mx-auto yst-flex yst-max-w-2xl",children:[y.jsx(T.Paper.Header,{children:y.jsxs(T.Title,{size:"1",children:["Welcome to ",y.jsx(qu,{children:"Yoast AI Brand Insights"}),"!"]})}),y.jsxs(T.Paper.Content,{className:"yst-space-y-8",children:[y.jsxs("div",{className:"yst-space-y-4 *:yst-text-tiny",children:[y.jsx("p",{children:"See how your brand is represented in AI answers."}),y.jsxs("p",{children:[y.jsx("b",{className:"yst-font-medium yst-text-slate-800",children:"Yoast AI Brand Insights"})," ","shows how often your brand appears, how it's described, and how it compares to competitors in tools like ChatGPT."]}),y.jsx("p",{children:"It only takes three simple steps to get your brand insights:"})]}),y.jsx("div",{className:"yst-flex yst-flex-col yst-items-stretch yst-justify-stretch yst-gap-4 yst-pb-8",children:[{title:"1. ADD BRAND INFO",description:"Tell us about your brand and where it's active so we can customize your analysis."},{title:"2. REVIEW QUERIES",description:"Edit or approve the queries generated from your input."},{title:"3. RUN ANALYSIS",description:"Run your queries through relevant AI models to see how your brand shows up."}].map(function(n,r,i){return y.jsxs("div",{className:"yst-relative yst-flex yst-flex-col yst-items-stretch",children:[y.jsxs("div",{className:"yst-flex yst-flex-row yst-items-center yst-justify-stretch yst-gap-6",children:[y.jsx(T.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(T.Title,{size:"3",className:"yst-font-semibold yst-uppercase",children:n.title}),y.jsx("p",{className:"yst-my-0 yst-py-0",children:n.description})]})]}),r<i.length-1&&y.jsx("div",{className:"yst-absolute yst-left-[-2px] yst-top-1/2 yst-my-0 yst-ml-[13px] yst-h-full yst-border-l-2 yst-border-l-primary-600"})]},n.title)})})]}),y.jsx(Lf,{className:"yst-justify-end",children:y.jsxs(T.Button,{variant:"primary",onClick:function(){return t("/setup")},className:"yst-gap-1.5",children:["Start your first analysis ",y.jsx(I6,{})]})})]})})};function aa(e){return typeof e!="number"?{}:{"yst-text-green-600":e>0,"yst-text-red-600":e<0,"yst-text-gray-400":e===0}}function Ua(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,u=e.delta,c=e.deltaFormat,d=c===void 0?"absolute":c,f=e.deltaSuffix,h=e.scoreFormat,g=h===void 0?"absolute":h;return y.jsxs("div",{className:Oe(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 u=="number"&&!isNaN(u)&&y.jsxs("span",{className:Oe("yst-ml-2",aa(u)),children:[u>-1&&"+",u,d==="percentage"&&"%"," ",f]})]})}var t_=["Icon","className","children","position","id"];function n_(e,t){return o_(e)||s_(e,t)||i_(e,t)||r_()}function r_(){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 i_(e,t){if(e){if(typeof e=="string")return I0(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)?I0(e,t):void 0}}function I0(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 s_(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function o_(e){if(Array.isArray(e))return e}function a_(e,t){if(e==null)return{};var n,r,i=l_(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 l_(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 Df(e){var t=e.Icon,n=t===void 0?e6:t,r=e.className,i=r===void 0?"":r,s=e.children,o=e.position,a=o===void 0?"left":o,l=e.id,u=l===void 0?"":l,c=a_(e,t_),d=z.useState(!1),f=n_(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":u?"tooltip-button-id":"tooltip-button",...c,children:[y.jsx(n,{className:"yst-relative yst-h-6 yst-w-6 yst-text-slate-400"}),h&&y.jsx(T.Tooltip,{position:a,id:u||"tooltip-button",children:s})]}):null}var Ga=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,"-"))},u=l(n);return y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-between ".concat(a),children:[y.jsx(T.Title,{size:s,children:n}),y.jsx(Df,{id:u,children:r})]})},R0=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(T.Badge,{className:r,children:i},s)})})},b2=function(t){var n,r,i,s,o=t.title,a=o===void 0?"Sentiment":o,l=t.tooltip,u=l===void 0?"":l,c=t.data,d=c==null?void 0:c.brandName,f=c==null||(n=c.positivityPercentage)===null||n===void 0?void 0:n.value,h=c==null||(r=c.positivityPercentage)===null||r===void 0||(r=r.previous)===null||r===void 0?void 0:r.difference,g=c==null||(i=c.keywords)===null||i===void 0?void 0:i.positive,m=c==null||(s=c.keywords)===null||s===void 0?void 0:s.negative,p=!c||f===void 0&&h===void 0;return y.jsx(T.Card,{className:"yst-overflow-visible",children:y.jsxs(T.Card.Content,{className:"yst-space-y-8",children:[y.jsx(Ga,{title:a,tooltip:u}),y.jsx("div",{className:"yst-space-y-3",children:!p&&y.jsxs(y.Fragment,{children:[y.jsx("p",{children:d||y.jsx(T.SkeletonLoader,{className:"yst-h-6 yst-w-20"})}),y.jsxs("div",{children:[y.jsx("div",{className:"yst-inline-flex",children:y.jsx(Ua,{className:"yst-mb-1.5",score:f,scoreFormat:"percentage",suffix:"positive",delta:h})}),y.jsx(T.ProgressBar,{max:100,min:0,progress:f||0,className:Oe({"yst-bg-red-500":f},"[&>*]:yst-bg-green-500")})]})]})}),p&&y.jsx(T.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(T.Title,{as:"h5",size:"5",children:"Positive keywords"}),y.jsx(R0,{keywords:g,badgeClassName:"yst-bg-green-100 yst-text-green-800"})]}),!!m&&y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(T.Title,{as:"h5",size:"5",children:"Negative keywords"}),y.jsx(R0,{keywords:m,badgeClassName:"yst-bg-red-100 yst-text-red-800"})]})]})})};function la(e){"@babel/helpers - typeof";return la=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},la(e)}var u_=["data"];function N0(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 c_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?N0(Object(n),!0).forEach(function(r){d_(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function d_(e,t,n){return(t=f_(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f_(e){var t=h_(e,"string");return la(t)=="symbol"?t:t+""}function h_(e,t){if(la(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(la(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function g_(e,t){if(e==null)return{};var n,r,i=y_(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 y_(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 oi=function(t,n,r){var i=Nn(),s=i.brandId,o=i.analysisId,a=i.model,l=s,u=o,c=a,d=Ru(l,u,{query:{enabled:!!l&&!!u,select:function(p){var v=p.data;return v==null?void 0:v.analysis}}}),f=d.data,h=g_(d,u_),g=z.useMemo(function(){if(!f||!c)return null;var m=f.scans||[];return m.find(function(p){return String(p.aiProvider)===String(c)})||null},[f,c]);return c_({data:g},h)};function m_(){var e,t=oi(),n=t.data;return y.jsx(b2,{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 p_=["children","as","className"];function v_(e,t){if(e==null)return{};var n,r,i=b_(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 b_(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 Ka=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,u=l===void 0?"div":l,c=o.className,d=c===void 0?"":c,f=v_(o,p_);return y.jsx(u,{className:Oe(String(s).trim(),d),...f,children:a})}},Sc=[{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"}],F0=function(t){if(!t)return Sc[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)%Sc.length;return Sc[s]};function ua(e){"@babel/helpers - typeof";return ua=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},ua(e)}var B0;function q0(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 z0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?q0(Object(n),!0).forEach(function(r){x_(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function x_(e,t,n){return(t=w_(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w_(e){var t=S_(e,"string");return ua(t)=="symbol"?t:t+""}function S_(e,t){if(ua(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ua(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function C_(e){return O_(e)||k_(e)||x2(e)||__()}function __(){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 k_(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function O_(e){if(Array.isArray(e))return Ld(e)}function H0(e,t){return T_(e)||A_(e,t)||x2(e,t)||E_()}function E_(){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 x2(e,t){if(e){if(typeof e=="string")return Ld(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)?Ld(e,t):void 0}}function Ld(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function A_(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function T_(e){if(Array.isArray(e))return e}function P_(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var vo=Ka(B0||(B0=P_(["md:yst-hidden yst-mr-2 yst-font-medium yst-text-slate-400 yst-inline-flex yst-w-20"]))),U0=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=t.enableCategories,u=l===void 0?!1:l,c=s||!n,d=n||{},f=d.rank,h=d.url,g=d.rootDomain,m=d.category,p=d.impact,v=d.numberOfMentions,b=v==null?void 0:v.value,S=v==null?void 0:v.previous,C=typeof(S==null?void 0:S.difference)=="number"?S.difference:b;return y.jsxs("tr",{className:"yst-flex yst-flex-col md:yst-table-row",children:[y.jsxs(T.Table.Cell,{className:"yst-ml-2 yst-py-1 md:yst-ml-0 md:yst-p-2",children:[y.jsx(vo,{as:"span",children:"Rank:"}),c?y.jsx(T.SkeletonLoader,{className:"yst-h-6 yst-w-24"}):y.jsx("span",{className:"yst-font-medium yst-text-slate-900",children:f!=null?f:"—"})]}),y.jsx(T.Table.Cell,{className:"yst-ml-2 yst-py-1 md:yst-ml-0 md:yst-p-2 yst-break-all",children:c?y.jsx(T.SkeletonLoader,{className:"yst-h-6 yst-w-full"}):y.jsx("div",{className:"yst-flex yst-items-center yst-gap-2",children:y.jsxs(T.Link,{className:"yst-flex yst-items-center yst-gap-1 yst-font-medium",href:h||"#",rel:"nofollow noreferrer",target:"_blank",children:[y.jsx("span",{children:h!=null?h:"—"})," ",y.jsx(p2,{})]})})}),y.jsxs(T.Table.Cell,{className:"yst-ml-2 yst-py-1 yst-font-medium md:yst-ml-0 md:yst-p-2",children:[y.jsx(vo,{as:"span",children:"Domain:"}),c?y.jsx(T.SkeletonLoader,{className:"yst-h-6 yst-w-24"}):y.jsx("span",{className:"yst-font-medium yst-text-slate-900",children:g!=null?g:"—"})]}),u&&y.jsxs(T.Table.Cell,{className:"yst-ml-2 yst-py-1 md:yst-ml-0 md:yst-p-2",children:[y.jsx(vo,{as:"span",children:"Category:"}),c?y.jsx(T.SkeletonLoader,{className:"yst-h-6 yst-w-16"}):y.jsx(T.Badge,{className:Oe(F0(m||"").bg,F0(m||"").text),children:m!=null?m:"—"})]}),y.jsxs(T.Table.Cell,{className:Oe("yst-ml-2 yst-py-0 md:yst-ml-0 md:yst-p-2","yst-font-medium",{"yst-text-green-600":p==="High","yst-text-yellow-600":p==="Medium","yst-text-red-600":p==="Low"}),children:[y.jsx(vo,{as:"span",children:"Impact:"}),c?y.jsx(T.SkeletonLoader,{className:"yst-h-6 yst-w-12"}):p!=null?p:"—"]}),y.jsxs(T.Table.Cell,{className:"yst-ml-2 yst-pt-1 md:yst-ml-0 md:yst-p-2 md:yst-text-right",children:[y.jsx(vo,{as:"span",children:"Mentions:"}),c?y.jsx(T.SkeletonLoader,{className:"yst-h-6 yst-w-8"}):b?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:b}),y.jsxs("span",{className:"yst-text-slate-900",children:["/ ",r]})]}),!a&&y.jsxs("span",{className:Oe("yst-ml-auto",aa(C)),children:[C>-1&&"+",C]})]}):"—"]})]},c?void 0:h)},j_=function(t){var n,r,i,s,o,a=t.enableCategories,l=a===void 0?!1:a,u=z.useState("all"),c=H0(u,2),d=c[0],f=c[1],h=z.useState(1),g=H0(h,2),m=g[0],p=g[1],v=oi(),b=v.data,S=v.isLoading,C=v.isRefetching,w=b==null?void 0:b.citations,O=(b==null||(n=b.scores)===null||n===void 0||(n=n.standardized)===null||n===void 0?void 0:n.citations)||{},x=Object.hasOwn(O,"previous"),_=w==null||(r=w.list)===null||r===void 0?void 0:r.filter(function(A){return d==="all"?!0:A.category===d}),k=10,E=(_==null?void 0:_.length)||0,j=Math.ceil(E/k),M=(m-1)*k,B=M+k,R=_==null?void 0:_.slice(M,B);return z.useEffect(function(){m>j&&j>0&&p(1)},[j,m,p,d]),y.jsx(T.Card,{className:"yst-overflow-visible md:yst-col-span-2",children:y.jsxs(T.Card.Content,{className:"yst-flex yst-flex-col yst-gap-6",children:[y.jsxs("div",{className:"yst-space-y-4",children:[y.jsx(Ga,{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(Ua,{score:w==null||(i=w.total)===null||i===void 0?void 0:i.value,suffix:"citations",delta:w==null||(s=w.total)===null||s===void 0||(s=s.previous)===null||s===void 0?void 0:s.difference,deltaSuffix:"since last analysis",isLoading:S,hideTotal:!0})]}),(w==null||(o=w.list)===null||o===void 0?void 0:o.length)===0&&!S&&!C?y.jsx(T.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:[l&&y.jsx(T.Select,{className:"yst-mb-4 md:yst-max-w-sm",label:"Filter categories",value:d,onChange:function(A){f(A)},id:"citation-category-filter",options:[{value:"all",label:"All categories"}].concat(C_(w!=null&&w.categories?w.categories.map(function(A){return{value:A,label:A}}):[]))}),y.jsxs(T.Table,{variant:"minimal",children:[y.jsx(T.Table.Head,{className:"yst-font-semibold",children:y.jsxs(T.Table.Row,{children:[y.jsx(T.Table.Cell,{className:"yst-hidden yst-text-slate-900 md:yst-table-cell md:yst-pl-2",children:"#"}),y.jsx(T.Table.Cell,{className:"yst yst-hidden yst-text-slate-900 md:yst-table-cell md:yst-px-2",children:"URL"}),y.jsx(T.Table.Cell,{className:"yst-hidden yst-text-slate-900 md:yst-table-cell md:yst-px-2",children:"Root domain"}),l&&y.jsx(T.Table.Cell,{className:"yst-hidden yst-text-slate-900 md:yst-table-cell",children:"Category"}),y.jsx(T.Table.Cell,{className:"yst-hidden yst-text-slate-900 md:yst-table-cell md:yst-px-2",children:"Impact"}),y.jsx(T.Table.Cell,{className:"yst-hidden yst-text-right yst-text-slate-900 md:yst-table-cell",children:"Mentions"})]})}),y.jsx(T.Table.Body,{children:S||C?Array.from({length:5}).map(function(A,P){return y.jsx(U0,{isLoading:!0,enableCategories:l},"skeleton-".concat(P))}):R&&R.length>0?R.map(function(A,P){return y.jsx(U0,{data:z0(z0({},A),{},{rank:M+P+1}),totalQueries:b==null?void 0:b.numberOfQueries,isFirstScan:!x,enableCategories:l},"citation-table-row-".concat(A.url,"-").concat(P))}):y.jsx(T.Table.Row,{children:y.jsxs(T.Table.Cell,{colSpan:l?6:5,className:"yst-py-8 yst-text-center yst-text-slate-500",children:[d==="all"?"No citations found.":'No citations found for the "'.concat(d,'" category.')," ",y.jsx(T.Link,{onClick:function(){return f("all")},children:"Show all categories."})]})},"no-results")})]})]}),_&&_.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 ",M+1," to"," ",B>E?E:B," of"," ",E," results"]}),y.jsx(T.Pagination,{variant:"text",className:"yst-flex-row yst-gap-0",current:m,total:j,onNavigate:p,screenReaderTextPrevious:"Previous page",screenReaderTextNext:"Next page"})]})]})]})})};function M_(e,t){return I_(e)||D_(e,t)||L_(e,t)||$_()}function $_(){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 L_(e,t){if(e){if(typeof e=="string")return G0(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)?G0(e,t):void 0}}function G0(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 D_(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function I_(e){if(Array.isArray(e))return e}var K0=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,u=l||!r,c=r||{},d=c.rank,f=c.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(T.Table.Row,{children:[y.jsx(T.Table.Cell,{children:u?y.jsx(T.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:Oe("yst-inline-flex yst-items-center yst-justify-end",aa(h&&typeof g=="number"?g:0)),children:h&&typeof g=="number"?y.jsxs(y.Fragment,{children:[Math.abs(g),g>0?y.jsx(z6,{className:"yst-h-4 yst-w-4"}):y.jsx(B6,{className:"yst-h-4 yst-w-4"})]}):y.jsx($0,{className:"yst-mx-1 yst-h-4 yst-w-4"})})]})}),y.jsx(T.Table.Cell,{children:u?y.jsx(T.SkeletonLoader,{className:"yst-h-6 yst-w-24"}):y.jsx("span",{className:"yst-font-medium",children:f!=null&&f.isSelf?y.jsx(qu,{children:f==null?void 0:f.name}):(n=f==null?void 0:f.name)!==null&&n!==void 0?n:"—"})}),y.jsx(T.Table.Cell,{children:u?y.jsx(T.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:Oe("yst-ml-auto",aa(p&&typeof v=="number"?v:0)),children:p&&typeof v=="number"?y.jsxs(y.Fragment,{children:[v>-1&&"+",v]}):y.jsx($0,{className:"yst-h-4 yst-w-4"})})]})})]},u||d==null?void 0:d.value)},R_=function(t){var n,r,i=t.className,s=z.useRef(null),o=z.useState(1),a=M_(o,2),l=a[0],u=a[1],c=oi(),d=c.data,f=c.isLoading,h=c.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,S=Math.ceil(b/v),C=(l-1)*v,w=C+v,O=g==null?void 0:g.slice(C,w);return z.useEffect(function(){l>S&&S>0&&u(1)},[S,l,u]),y.jsx(T.Card,{ref:s,className:Oe("yst-overflow-visible",i),children:y.jsxs(T.Card.Content,{className:"yst-mt-0 yst-space-y-6",children:[y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(Ga,{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(T.Alert,{variant:"info",children:"The selected AI model returned no brands for your queries. This can happen with some queries or models."}):y.jsxs(T.Table,{variant:"minimal",children:[y.jsx(T.Table.Head,{children:y.jsxs(T.Table.Row,{children:[y.jsx(T.Table.Cell,{className:"yst-w-20 yst-font-semibold",children:"Rank"}),y.jsx(T.Table.Cell,{className:"yst-font-semibold",children:"Brand"}),y.jsx(T.Table.Cell,{className:"yst-w-20 yst-text-right yst-font-semibold",children:"Mentions"})]})}),y.jsx(T.Table.Body,{children:O&&Array.isArray(O)&&O.length>0?O.map(function(x){var _;return y.jsx(K0,{data:x,totalQueries:d==null?void 0:d.numberOfQueries,isFirstScan:!p},"rank-row-".concat((_=x.rank)===null||_===void 0?void 0:_.value))}):f||h?Array.from({length:v}).map(function(x,_){return y.jsx(K0,{isLoading:!0},"skeleton-".concat(_))}):null})]}),!f&&!h&&g&&g.length>v&&y.jsx(T.Pagination,{current:l,total:S,className:"yst-flex-row",onNavigate:u,screenReaderTextNext:"Next",screenReaderTextPrevious:"Previous",variant:"text"})]})})},N_=function(){var t,n=oi(),r=n.data,i=r==null||(t=r.sentiment)===null||t===void 0?void 0:t.topCompetitor;return y.jsx(b2,{title:"Competitor sentiment",data:i,tooltip:"Percentage of positive versus negative keywords in your query results related to your competitor's brand."})},F_=function(t){var n=t.brand,r=fn(),i=Ha(),s=i.setBrandId;return(n==null?void 0:n.setupStatus)==="pendingQuerySelection"?y.jsx(T.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(T.Link,{onClick:function(){n.id?(s(n.id),r("/setup/".concat(n.id,"/queries"))):console.error("Brand ID is missing.")},children:"Review queries"})})]})}):null},zu=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,u=t.disabled,c=u===void 0?!1:u,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(T.Modal,{isOpen:n,onClose:r,position:"center",as:"div",className:m,children:y.jsxs(T.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(c2,{className:"yst-h-6 yst-w-6 yst-text-red-600"})})}),y.jsxs("div",{className:"yst-flex-1",children:[y.jsx(T.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(T.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:a})}),y.jsx(T.Modal.Container.Content,{className:"yst-mb-4 yst-space-y-3",children:typeof l=="string"?y.jsx("p",{children:l}):l})]})]}),y.jsxs(T.Modal.Container.Footer,{className:"yst-mt-3 yst-flex yst-justify-end yst-gap-2",children:[y.jsx(T.Button,{variant:"secondary",onClick:r,children:g}),y.jsx(T.Button,{variant:"error",onClick:i,isLoading:o,disabled:c,children:f})]})]})})},ul={exports:{}},cl={exports:{}},Ue={};/** @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 G0;function I_(){if(G0)return Ue;G0=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,u=e?Symbol.for("react.concurrent_mode"):60111,c=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 S(w){if(typeof w=="object"&&w!==null){var O=w.$$typeof;switch(O){case t:switch(w=w.type,w){case l:case u:case r:case s:case i:case d:return w;default:switch(w=w&&w.$$typeof,w){case a:case c:case g:case h:case o:return w;default:return O}}case n:return O}}}function C(w){return S(w)===u}return Ue.AsyncMode=l,Ue.ConcurrentMode=u,Ue.ContextConsumer=a,Ue.ContextProvider=o,Ue.Element=t,Ue.ForwardRef=c,Ue.Fragment=r,Ue.Lazy=g,Ue.Memo=h,Ue.Portal=n,Ue.Profiler=s,Ue.StrictMode=i,Ue.Suspense=d,Ue.isAsyncMode=function(w){return C(w)||S(w)===l},Ue.isConcurrentMode=C,Ue.isContextConsumer=function(w){return S(w)===a},Ue.isContextProvider=function(w){return S(w)===o},Ue.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===t},Ue.isForwardRef=function(w){return S(w)===c},Ue.isFragment=function(w){return S(w)===r},Ue.isLazy=function(w){return S(w)===g},Ue.isMemo=function(w){return S(w)===h},Ue.isPortal=function(w){return S(w)===n},Ue.isProfiler=function(w){return S(w)===s},Ue.isStrictMode=function(w){return S(w)===i},Ue.isSuspense=function(w){return S(w)===d},Ue.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===r||w===u||w===s||w===i||w===d||w===f||typeof w=="object"&&w!==null&&(w.$$typeof===g||w.$$typeof===h||w.$$typeof===o||w.$$typeof===a||w.$$typeof===c||w.$$typeof===p||w.$$typeof===v||w.$$typeof===b||w.$$typeof===m)},Ue.typeOf=S,Ue}var Ge={};/** @license React v16.13.1
35
+ */var V0;function B_(){if(V0)return Ue;V0=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,u=e?Symbol.for("react.concurrent_mode"):60111,c=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 S(w){if(typeof w=="object"&&w!==null){var O=w.$$typeof;switch(O){case t:switch(w=w.type,w){case l:case u:case r:case s:case i:case d:return w;default:switch(w=w&&w.$$typeof,w){case a:case c:case g:case h:case o:return w;default:return O}}case n:return O}}}function C(w){return S(w)===u}return Ue.AsyncMode=l,Ue.ConcurrentMode=u,Ue.ContextConsumer=a,Ue.ContextProvider=o,Ue.Element=t,Ue.ForwardRef=c,Ue.Fragment=r,Ue.Lazy=g,Ue.Memo=h,Ue.Portal=n,Ue.Profiler=s,Ue.StrictMode=i,Ue.Suspense=d,Ue.isAsyncMode=function(w){return C(w)||S(w)===l},Ue.isConcurrentMode=C,Ue.isContextConsumer=function(w){return S(w)===a},Ue.isContextProvider=function(w){return S(w)===o},Ue.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===t},Ue.isForwardRef=function(w){return S(w)===c},Ue.isFragment=function(w){return S(w)===r},Ue.isLazy=function(w){return S(w)===g},Ue.isMemo=function(w){return S(w)===h},Ue.isPortal=function(w){return S(w)===n},Ue.isProfiler=function(w){return S(w)===s},Ue.isStrictMode=function(w){return S(w)===i},Ue.isSuspense=function(w){return S(w)===d},Ue.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===r||w===u||w===s||w===i||w===d||w===f||typeof w=="object"&&w!==null&&(w.$$typeof===g||w.$$typeof===h||w.$$typeof===o||w.$$typeof===a||w.$$typeof===c||w.$$typeof===p||w.$$typeof===v||w.$$typeof===b||w.$$typeof===m)},Ue.typeOf=S,Ue}var Ge={};/** @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 V0;function R_(){return V0||(V0=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,u=e?Symbol.for("react.concurrent_mode"):60111,c=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 S(oe){return typeof oe=="string"||typeof oe=="function"||oe===r||oe===u||oe===s||oe===i||oe===d||oe===f||typeof oe=="object"&&oe!==null&&(oe.$$typeof===g||oe.$$typeof===h||oe.$$typeof===o||oe.$$typeof===a||oe.$$typeof===c||oe.$$typeof===p||oe.$$typeof===v||oe.$$typeof===b||oe.$$typeof===m)}function C(oe){if(typeof oe=="object"&&oe!==null){var He=oe.$$typeof;switch(He){case t:var lt=oe.type;switch(lt){case l:case u:case r:case s:case i:case d:return lt;default:var dt=lt&&lt.$$typeof;switch(dt){case a:case c:case g:case h:case o:return dt;default:return He}}case n:return He}}}var w=l,O=u,x=a,_=o,k=t,E=c,P=r,M=g,B=h,R=n,A=s,j=i,L=d,H=!1;function Q(oe){return H||(H=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),F(oe)||C(oe)===l}function F(oe){return C(oe)===u}function G(oe){return C(oe)===a}function ie(oe){return C(oe)===o}function ae(oe){return typeof oe=="object"&&oe!==null&&oe.$$typeof===t}function N(oe){return C(oe)===c}function le(oe){return C(oe)===r}function te(oe){return C(oe)===g}function me(oe){return C(oe)===h}function J(oe){return C(oe)===n}function Se(oe){return C(oe)===s}function ge(oe){return C(oe)===i}function ze(oe){return C(oe)===d}Ge.AsyncMode=w,Ge.ConcurrentMode=O,Ge.ContextConsumer=x,Ge.ContextProvider=_,Ge.Element=k,Ge.ForwardRef=E,Ge.Fragment=P,Ge.Lazy=M,Ge.Memo=B,Ge.Portal=R,Ge.Profiler=A,Ge.StrictMode=j,Ge.Suspense=L,Ge.isAsyncMode=Q,Ge.isConcurrentMode=F,Ge.isContextConsumer=G,Ge.isContextProvider=ie,Ge.isElement=ae,Ge.isForwardRef=N,Ge.isFragment=le,Ge.isLazy=te,Ge.isMemo=me,Ge.isPortal=J,Ge.isProfiler=Se,Ge.isStrictMode=ge,Ge.isSuspense=ze,Ge.isValidElementType=S,Ge.typeOf=C}()),Ge}var K0;function p2(){return K0||(K0=1,process.env.NODE_ENV==="production"?ol.exports=I_():ol.exports=R_()),ol.exports}/*
42
+ */var W0;function q_(){return W0||(W0=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,u=e?Symbol.for("react.concurrent_mode"):60111,c=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 S(oe){return typeof oe=="string"||typeof oe=="function"||oe===r||oe===u||oe===s||oe===i||oe===d||oe===f||typeof oe=="object"&&oe!==null&&(oe.$$typeof===g||oe.$$typeof===h||oe.$$typeof===o||oe.$$typeof===a||oe.$$typeof===c||oe.$$typeof===p||oe.$$typeof===v||oe.$$typeof===b||oe.$$typeof===m)}function C(oe){if(typeof oe=="object"&&oe!==null){var He=oe.$$typeof;switch(He){case t:var lt=oe.type;switch(lt){case l:case u:case r:case s:case i:case d:return lt;default:var dt=lt&&lt.$$typeof;switch(dt){case a:case c:case g:case h:case o:return dt;default:return He}}case n:return He}}}var w=l,O=u,x=a,_=o,k=t,E=c,j=r,M=g,B=h,R=n,A=s,P=i,L=d,H=!1;function G(oe){return H||(H=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),F(oe)||C(oe)===l}function F(oe){return C(oe)===u}function U(oe){return C(oe)===a}function ie(oe){return C(oe)===o}function ae(oe){return typeof oe=="object"&&oe!==null&&oe.$$typeof===t}function N(oe){return C(oe)===c}function le(oe){return C(oe)===r}function te(oe){return C(oe)===g}function me(oe){return C(oe)===h}function J(oe){return C(oe)===n}function Se(oe){return C(oe)===s}function ge(oe){return C(oe)===i}function ze(oe){return C(oe)===d}Ge.AsyncMode=w,Ge.ConcurrentMode=O,Ge.ContextConsumer=x,Ge.ContextProvider=_,Ge.Element=k,Ge.ForwardRef=E,Ge.Fragment=j,Ge.Lazy=M,Ge.Memo=B,Ge.Portal=R,Ge.Profiler=A,Ge.StrictMode=P,Ge.Suspense=L,Ge.isAsyncMode=G,Ge.isConcurrentMode=F,Ge.isContextConsumer=U,Ge.isContextProvider=ie,Ge.isElement=ae,Ge.isForwardRef=N,Ge.isFragment=le,Ge.isLazy=te,Ge.isMemo=me,Ge.isPortal=J,Ge.isProfiler=Se,Ge.isStrictMode=ge,Ge.isSuspense=ze,Ge.isValidElementType=S,Ge.typeOf=C}()),Ge}var Q0;function w2(){return Q0||(Q0=1,process.env.NODE_ENV==="production"?cl.exports=B_():cl.exports=q_()),cl.exports}/*
43
43
  object-assign
44
44
  (c) Sindre Sorhus
45
45
  @license MIT
46
- */var xc,W0;function N_(){if(W0)return xc;W0=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(c){return o[c]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(c){u[c]=c}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch(c){return!1}}return xc=i()?Object.assign:function(s,o){for(var a,l=r(s),u,c=1;c<arguments.length;c++){a=Object(arguments[c]);for(var d in a)t.call(a,d)&&(l[d]=a[d]);if(e){u=e(a);for(var f=0;f<u.length;f++)n.call(a,u[f])&&(l[u[f]]=a[u[f]])}}return l},xc}var wc,Q0;function Lf(){if(Q0)return wc;Q0=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return wc=e,wc}var Sc,Y0;function v2(){return Y0||(Y0=1,Sc=Function.call.bind(Object.prototype.hasOwnProperty)),Sc}var Cc,X0;function F_(){if(X0)return Cc;X0=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Lf(),n={},r=v2();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,u){if(process.env.NODE_ENV!=="production"){for(var c in s)if(r(s,c)){var d;try{if(typeof s[c]!="function"){var f=Error((l||"React class")+": "+a+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}d=s[c](o,c,l,a,null,t)}catch(g){d=g}if(d&&!(d instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+c+"` 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=u?u():"";e("Failed "+a+" type: "+d.message+(h!=null?h:""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Cc=i,Cc}var _c,Z0;function B_(){if(Z0)return _c;Z0=1;var e=p2(),t=N_(),n=Lf(),r=v2(),i=F_(),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(u){}});function o(){return null}return _c=function(a,l){var u=typeof Symbol=="function"&&Symbol.iterator,c="@@iterator";function d(F){var G=F&&(u&&F[u]||F[c]);if(typeof G=="function")return G}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:S,element:C(),elementType:w(),instanceOf:O,node:E(),objectOf:_,oneOf:x,oneOfType:k,shape:M,exact:B};function g(F,G){return F===G?F!==0||1/F===1/G:F!==F&&G!==G}function m(F,G){this.message=F,this.data=G&&typeof G=="object"?G:{},this.stack=""}m.prototype=Error.prototype;function p(F){if(process.env.NODE_ENV!=="production")var G={},ie=0;function ae(le,te,me,J,Se,ge,ze){if(J=J||f,ge=ge||me,ze!==n){if(l){var oe=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 oe.name="Invariant Violation",oe}else if(process.env.NODE_ENV!=="production"&&typeof console!="undefined"){var He=J+":"+me;!G[He]&&ie<3&&(s("You are manually calling a React.PropTypes validation function for the `"+ge+"` prop on `"+J+"`. 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."),G[He]=!0,ie++)}}return te[me]==null?le?te[me]===null?new m("The "+Se+" `"+ge+"` is marked as required "+("in `"+J+"`, but its value is `null`.")):new m("The "+Se+" `"+ge+"` is marked as required in "+("`"+J+"`, but its value is `undefined`.")):null:F(te,me,J,Se,ge)}var N=ae.bind(null,!1);return N.isRequired=ae.bind(null,!0),N}function v(F){function G(ie,ae,N,le,te,me){var J=ie[ae],Se=j(J);if(Se!==F){var ge=L(J);return new m("Invalid "+le+" `"+te+"` of type "+("`"+ge+"` supplied to `"+N+"`, expected ")+("`"+F+"`."),{expectedType:F})}return null}return p(G)}function b(){return p(o)}function S(F){function G(ie,ae,N,le,te){if(typeof F!="function")return new m("Property `"+te+"` of component `"+N+"` has invalid PropType notation inside arrayOf.");var me=ie[ae];if(!Array.isArray(me)){var J=j(me);return new m("Invalid "+le+" `"+te+"` of type "+("`"+J+"` supplied to `"+N+"`, expected an array."))}for(var Se=0;Se<me.length;Se++){var ge=F(me,Se,N,le,te+"["+Se+"]",n);if(ge instanceof Error)return ge}return null}return p(G)}function C(){function F(G,ie,ae,N,le){var te=G[ie];if(!a(te)){var me=j(te);return new m("Invalid "+N+" `"+le+"` of type "+("`"+me+"` supplied to `"+ae+"`, expected a single ReactElement."))}return null}return p(F)}function w(){function F(G,ie,ae,N,le){var te=G[ie];if(!e.isValidElementType(te)){var me=j(te);return new m("Invalid "+N+" `"+le+"` of type "+("`"+me+"` supplied to `"+ae+"`, expected a single ReactElement type."))}return null}return p(F)}function O(F){function G(ie,ae,N,le,te){if(!(ie[ae]instanceof F)){var me=F.name||f,J=Q(ie[ae]);return new m("Invalid "+le+" `"+te+"` of type "+("`"+J+"` supplied to `"+N+"`, expected ")+("instance of `"+me+"`."))}return null}return p(G)}function x(F){if(!Array.isArray(F))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):s("Invalid argument supplied to oneOf, expected an array.")),o;function G(ie,ae,N,le,te){for(var me=ie[ae],J=0;J<F.length;J++)if(g(me,F[J]))return null;var Se=JSON.stringify(F,function(ze,oe){var He=L(oe);return He==="symbol"?String(oe):oe});return new m("Invalid "+le+" `"+te+"` of value `"+String(me)+"` "+("supplied to `"+N+"`, expected one of "+Se+"."))}return p(G)}function _(F){function G(ie,ae,N,le,te){if(typeof F!="function")return new m("Property `"+te+"` of component `"+N+"` has invalid PropType notation inside objectOf.");var me=ie[ae],J=j(me);if(J!=="object")return new m("Invalid "+le+" `"+te+"` of type "+("`"+J+"` supplied to `"+N+"`, expected an object."));for(var Se in me)if(r(me,Se)){var ge=F(me,Se,N,le,te+"."+Se,n);if(ge instanceof Error)return ge}return null}return p(G)}function k(F){if(!Array.isArray(F))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var G=0;G<F.length;G++){var ie=F[G];if(typeof ie!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+H(ie)+" at index "+G+"."),o}function ae(N,le,te,me,J){for(var Se=[],ge=0;ge<F.length;ge++){var ze=F[ge],oe=ze(N,le,te,me,J,n);if(oe==null)return null;oe.data&&r(oe.data,"expectedType")&&Se.push(oe.data.expectedType)}var He=Se.length>0?", expected one of type ["+Se.join(", ")+"]":"";return new m("Invalid "+me+" `"+J+"` supplied to "+("`"+te+"`"+He+"."))}return p(ae)}function E(){function F(G,ie,ae,N,le){return R(G[ie])?null:new m("Invalid "+N+" `"+le+"` supplied to "+("`"+ae+"`, expected a ReactNode."))}return p(F)}function P(F,G,ie,ae,N){return new m((F||"React class")+": "+G+" type `"+ie+"."+ae+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+N+"`.")}function M(F){function G(ie,ae,N,le,te){var me=ie[ae],J=j(me);if(J!=="object")return new m("Invalid "+le+" `"+te+"` of type `"+J+"` "+("supplied to `"+N+"`, expected `object`."));for(var Se in F){var ge=F[Se];if(typeof ge!="function")return P(N,le,te,Se,L(ge));var ze=ge(me,Se,N,le,te+"."+Se,n);if(ze)return ze}return null}return p(G)}function B(F){function G(ie,ae,N,le,te){var me=ie[ae],J=j(me);if(J!=="object")return new m("Invalid "+le+" `"+te+"` of type `"+J+"` "+("supplied to `"+N+"`, expected `object`."));var Se=t({},ie[ae],F);for(var ge in Se){var ze=F[ge];if(r(F,ge)&&typeof ze!="function")return P(N,le,te,ge,L(ze));if(!ze)return new m("Invalid "+le+" `"+te+"` key `"+ge+"` supplied to `"+N+"`.\nBad object: "+JSON.stringify(ie[ae],null," ")+`
47
- Valid keys: `+JSON.stringify(Object.keys(F),null," "));var oe=ze(me,ge,N,le,te+"."+ge,n);if(oe)return oe}return null}return p(G)}function R(F){switch(typeof F){case"number":case"string":case"undefined":return!0;case"boolean":return!F;case"object":if(Array.isArray(F))return F.every(R);if(F===null||a(F))return!0;var G=d(F);if(G){var ie=G.call(F),ae;if(G!==F.entries){for(;!(ae=ie.next()).done;)if(!R(ae.value))return!1}else for(;!(ae=ie.next()).done;){var N=ae.value;if(N&&!R(N[1]))return!1}}else return!1;return!0;default:return!1}}function A(F,G){return F==="symbol"?!0:G?G["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&G instanceof Symbol:!1}function j(F){var G=typeof F;return Array.isArray(F)?"array":F instanceof RegExp?"object":A(G,F)?"symbol":G}function L(F){if(typeof F=="undefined"||F===null)return""+F;var G=j(F);if(G==="object"){if(F instanceof Date)return"date";if(F instanceof RegExp)return"regexp"}return G}function H(F){var G=L(F);switch(G){case"array":case"object":return"an "+G;case"boolean":case"date":case"regexp":return"a "+G;default:return G}}function Q(F){return!F.constructor||!F.constructor.name?f:F.constructor.name}return h.checkPropTypes=i,h.resetWarningCache=i.resetWarningCache,h.PropTypes=h,h},_c}var kc,J0;function q_(){if(J0)return kc;J0=1;var e=Lf();function t(){}function n(){}return n.resetWarningCache=t,kc=function(){function r(o,a,l,u,c,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},kc}var eg;function z_(){if(eg)return sl.exports;if(eg=1,process.env.NODE_ENV!=="production"){var e=p2(),t=!0;sl.exports=B_()(e.isElement,t)}else sl.exports=q_()();return sl.exports}var H_=z_();const $d=mp(H_);var Ha=function(t){var n=t.className,r=n===void 0?"":n;return y.jsx("hr",{className:Oe("yst-my-6",r)})};Ha.propTypes={className:$d.string};const b2=6048e5,U_=864e5,tg=Symbol.for("constructDateFrom");function cn(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&tg in e?e[tg](t):e instanceof Date?new e.constructor(t):new Date(t)}function Vt(e,t){return cn(t||e,e)}function x2(e,t,n){const r=Vt(e,n==null?void 0:n.in);if(isNaN(t))return cn(e,NaN);if(!t)return r;const i=r.getDate(),s=cn(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 G_={};function Bu(){return G_}function oa(e,t){var a,l,u,c,d,f,h,g;const n=Bu(),r=(g=(h=(c=(u=t==null?void 0:t.weekStartsOn)!=null?u:(l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)!=null?c:n.weekStartsOn)!=null?h:(f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)!=null?g:0,i=Vt(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 eu(e,t){return oa(e,{...t,weekStartsOn:1})}function w2(e,t){const n=Vt(e,t==null?void 0:t.in),r=n.getFullYear(),i=cn(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const s=eu(i),o=cn(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const a=eu(o);return n.getTime()>=s.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function ng(e){const t=Vt(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 qu(e,...t){const n=cn.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function tu(e,t){const n=Vt(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function V_(e,t,n){const[r,i]=qu(n==null?void 0:n.in,e,t),s=tu(r),o=tu(i),a=+s-ng(s),l=+o-ng(o);return Math.round((a-l)/U_)}function K_(e,t){const n=w2(e,t),r=cn(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),eu(r)}function W_(e){return cn(e,Date.now())}function Q_(e,t,n){const[r,i]=qu(n==null?void 0:n.in,e,t);return+tu(r)==+tu(i)}function Y_(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function X_(e){return!(!Y_(e)&&typeof e!="number"||isNaN(+Vt(e)))}function Z_(e,t){const n=Vt(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 J_(e,t){const[n,r]=qu(e,t.start,t.end);return{start:n,end:r}}function e8(e,t){const{start:n,end:r}=J_(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(cn(n,o)),o.setDate(o.getDate()+a),o.setHours(0,0,0,0);return i?l.reverse():l}function t8(e,t){const n=Vt(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function n8(e,t){const n=Vt(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const r8={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"}},i8=(e,t,n)=>{let r;const i=r8[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 Oc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const s8={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},o8={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},a8={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},l8={date:Oc({formats:s8,defaultWidth:"full"}),time:Oc({formats:o8,defaultWidth:"full"}),dateTime:Oc({formats:a8,defaultWidth:"full"})},u8={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},c8=(e,t,n,r)=>u8[e];function mo(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 d8={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},f8={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},h8={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"]},g8={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"]},y8={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"}},m8={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"}},p8=(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"},v8={ordinalNumber:p8,era:mo({values:d8,defaultWidth:"wide"}),quarter:mo({values:f8,defaultWidth:"wide",argumentCallback:e=>e-1}),month:mo({values:h8,defaultWidth:"wide"}),day:mo({values:g8,defaultWidth:"wide"}),dayPeriod:mo({values:y8,defaultWidth:"wide",formattingValues:m8,defaultFormattingWidth:"wide"})};function po(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)?x8(a,d=>d.test(o)):b8(a,d=>d.test(o));let u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const c=t.slice(o.length);return{value:u,rest:c}}}function b8(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function x8(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function w8(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 S8=/^(\d+)(th|st|nd|rd)?/i,C8=/\d+/i,_8={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},k8={any:[/^b/i,/^(a|c)/i]},O8={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},E8={any:[/1/i,/2/i,/3/i,/4/i]},A8={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},T8={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]},P8={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},j8={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]},M8={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},$8={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}},L8={ordinalNumber:w8({matchPattern:S8,parsePattern:C8,valueCallback:e=>parseInt(e,10)}),era:po({matchPatterns:_8,defaultMatchWidth:"wide",parsePatterns:k8,defaultParseWidth:"any"}),quarter:po({matchPatterns:O8,defaultMatchWidth:"wide",parsePatterns:E8,defaultParseWidth:"any",valueCallback:e=>e+1}),month:po({matchPatterns:A8,defaultMatchWidth:"wide",parsePatterns:T8,defaultParseWidth:"any"}),day:po({matchPatterns:P8,defaultMatchWidth:"wide",parsePatterns:j8,defaultParseWidth:"any"}),dayPeriod:po({matchPatterns:M8,defaultMatchWidth:"any",parsePatterns:$8,defaultParseWidth:"any"})},D8={code:"en-US",formatDistance:i8,formatLong:l8,formatRelative:c8,localize:v8,match:L8,options:{weekStartsOn:0,firstWeekContainsDate:1}};function I8(e,t){const n=Vt(e,t==null?void 0:t.in);return V_(n,n8(n))+1}function R8(e,t){const n=Vt(e,t==null?void 0:t.in),r=+eu(n)-+K_(n);return Math.round(r/b2)+1}function S2(e,t){var c,d,f,h,g,m,p,v;const n=Vt(e,t==null?void 0:t.in),r=n.getFullYear(),i=Bu(),s=(v=(p=(h=(f=t==null?void 0:t.firstWeekContainsDate)!=null?f:(d=(c=t==null?void 0:t.locale)==null?void 0:c.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=cn((t==null?void 0:t.in)||e,0);o.setFullYear(r+1,0,s),o.setHours(0,0,0,0);const a=oa(o,t),l=cn((t==null?void 0:t.in)||e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const u=oa(l,t);return+n>=+a?r+1:+n>=+u?r:r-1}function N8(e,t){var a,l,u,c,d,f,h,g;const n=Bu(),r=(g=(h=(c=(u=t==null?void 0:t.firstWeekContainsDate)!=null?u:(l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)!=null?c:n.firstWeekContainsDate)!=null?h:(f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)!=null?g:1,i=S2(e,t),s=cn((t==null?void 0:t.in)||e,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),oa(s,t)}function F8(e,t){const n=Vt(e,t==null?void 0:t.in),r=+oa(n,t)-+N8(n,t);return Math.round(r/b2)+1}function We(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Er={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)}},Zi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},rg={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 Er.y(e,t)},Y:function(e,t,n,r){const i=S2(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=w2(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 Er.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=F8(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):We(i,t.length)},I:function(e,t,n){const r=R8(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"}):Er.d(e,t)},D:function(e,t,n){const r=I8(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=Zi.noon:r===0?i=Zi.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=Zi.evening:r>=12?i=Zi.afternoon:r>=4?i=Zi.morning:i=Zi.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 Er.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Er.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"}):Er.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Er.s(e,t)},S:function(e,t){return Er.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return sg(r);case"XXXX":case"XX":return fi(r);case"XXXXX":case"XXX":default:return fi(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return sg(r);case"xxxx":case"xx":return fi(r);case"xxxxx":case"xxx":default:return fi(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ig(r,":");case"OOOO":default:return"GMT"+fi(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ig(r,":");case"zzzz":default:return"GMT"+fi(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 ig(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 sg(e,t){return e%60===0?(e>0?"-":"+")+We(Math.abs(e)/60,2):fi(e,t)}function fi(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 og=(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"})}},C2=(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"})}},B8=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return og(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}}",og(r,t)).replace("{{time}}",C2(i,t))},q8={p:C2,P:B8},z8=/^D+$/,H8=/^Y+$/,U8=["D","DD","YY","YYYY"];function G8(e){return z8.test(e)}function V8(e){return H8.test(e)}function K8(e,t,n){const r=W8(e,t,n);if(console.warn(r),U8.includes(e))throw new RangeError(r)}function W8(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 Q8=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Y8=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,X8=/^'([^]*?)'?$/,Z8=/''/g,J8=/[a-zA-Z]/;function jo(e,t,n){var c,d,f,h,g,m,p,v,b;const r=Bu(),i=(c=r.locale)!=null?c:D8,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=Vt(e,n==null?void 0:n.in);if(!X_(a))throw new RangeError("Invalid time value");let l=t.match(Y8).map(S=>{const C=S[0];if(C==="p"||C==="P"){const w=q8[C];return w(S,i.formatLong)}return S}).join("").match(Q8).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const C=S[0];if(C==="'")return{isToken:!1,value:e7(S)};if(rg[C])return{isToken:!0,value:S};if(C.match(J8))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");return{isToken:!1,value:S}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const u={firstWeekContainsDate:s,weekStartsOn:o,locale:i};return l.map(S=>{if(!S.isToken)return S.value;const C=S.value;(V8(C)||G8(C))&&K8(C,t,String(e));const w=rg[C[0]];return w(a,C,i.localize,u)}).join("")}function e7(e){const t=e.match(X8);return t?t[1].replace(Z8,"'"):e}function ag(e,t,n){const[r,i]=qu(n==null?void 0:n.in,e,t);return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()}function t7(e,t){return Q_(cn(e,e),W_(e))}function n7(e,t,n){return x2(e,-1,n)}function aa(e){"@babel/helpers - typeof";return aa=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},aa(e)}function Ec(e,t,n){return(t=r7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r7(e){var t=i7(e,"string");return aa(t)=="symbol"?t:t+""}function i7(e,t){if(aa(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(aa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lg(e,t){return l7(e)||a7(e,t)||o7(e,t)||s7()}function s7(){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 o7(e,t){if(e){if(typeof e=="string")return ug(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)?ug(e,t):void 0}}function ug(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 a7(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function l7(e){if(Array.isArray(e))return e}var qn={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"}},u7=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,u=t.onClose,c=z.useState(new Date),d=lg(c,2),f=d[0],h=d[1],g=function(_){if(!_)return null;var k=_.slice(0,10),E=k.split("-"),P=lg(E,3),M=P[0],B=P[1],R=P[2],A=Number(M),j=Number(B),L=Number(R);return Number.isNaN(A)||Number.isNaN(j)||Number.isNaN(L)||j<1||j>12||L<1||L>31?null:new Date(A,j-1,L)},m=z.useMemo(function(){var x=new Map;return n.forEach(function(_){var k=g(_.createdAt),E=k?jo(k,"yyyy-MM-dd"):"";E&&(x.has(E)||x.set(E,[]),x.get(E).push(_))}),x},[n]);z.useEffect(function(){if(l&&r){var x=n.find(function(P){return P.id===r});if(x){var _=g(x.createdAt);_&&h(_)}}else if(l&&n.length>0){var k=n.reduce(function(P,M){return new Date(M.createdAt)>new Date(P.createdAt)?M:P}),E=g(k.createdAt);E&&h(E)}},[l,r,n]);var p=z.useMemo(function(){return n.length===0?null:n.reduce(function(x,_){return new Date(_.createdAt)>new Date(x.createdAt)?_:x})},[n]),v=function(){if(p){var _=g(p.createdAt);_&&h(_)}},b=z.useMemo(function(){if(!p)return!1;var x=g(p.createdAt);return x?ag(x,f):!1},[p,f]),S=z.useMemo(function(){var x=t8(f),_=Z_(f),k=new Date(x),E=k.getDay(),P=E===0?6:E-1;k.setDate(k.getDate()-P);var M=new Date(_),B=M.getDay(),R=B===0?0:7-B;return M.setDate(M.getDate()+R),e8({start:k,end:M}).map(function(A){var j=jo(A,"yyyy-MM-dd"),L=m.get(j)||[],H=L.find(function(Q){return String(Q.id)===String(r)});return{date:j,dateObj:A,isCurrentMonth:ag(A,f),isToday:t7(A),isSelected:!!H,hasAnalyses:L.length>0,analyses:L}})},[f,m,r]),C=function(){h(function(_){return n7(_)})},w=function(){h(function(_){return x2(_,1)})},O=function(_){if(_.hasAnalyses){if(_.analyses.length===1)i(_.analyses[0].id);else{var k=_.analyses.reduce(function(E,P){return new Date(P.createdAt)>new Date(E.createdAt)?P:E});i(k.id)}u==null||u()}};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(F4,{className:"yst-h-5 yst-w-5"})]}),y.jsx("h2",{className:"yst-text-sm yst-font-semibold yst-text-slate-900",children:jo(f,"MMMM yyyy")}),y.jsxs("button",{type:"button",onClick:w,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(q4,{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(x,_){return y.jsx("div",{className:"yst-py-2 yst-text-center yst-text-xs yst-font-medium yst-text-slate-500",children:x},"".concat(x,"-").concat(_))})}),y.jsx("div",{className:"yst-grid yst-grid-cols-7 yst-gap-x-1",children:S.map(function(x){return y.jsx("div",{className:"yst-flex yst-items-center yst-justify-center yst-py-1",children:y.jsxs("button",{type:"button",onClick:function(){return O(x)},disabled:!x.hasAnalyses,className:Oe("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":x.isCurrentMonth,"yst-text-slate-400":!x.isCurrentMonth},{"focus:yst-outline-none focus:yst-ring-2 focus:yst-ring-blue-500":x.hasAnalyses,"yst-cursor-not-allowed":!x.hasAnalyses,"yst-cursor-pointer":x.hasAnalyses},Ec({},"".concat(qn.selected.background," ").concat(qn.selected.text," ").concat(qn.selected.hover),x.isSelected),Ec({},"".concat(qn.hasAnalysis.border," ").concat(qn.hasAnalysis.text," ").concat(qn.hasAnalysis.hover),x.hasAnalyses&&!x.isSelected)),children:[y.jsx("span",{className:Oe("yst-relative yst-z-10 yst-w-4",Ec({},qn.today.underline,x.isToday&&!x.isSelected)),children:jo(x.dateObj,"d")}),x.hasAnalyses&&x.analyses.length>1&&!x.isSelected&&y.jsx("span",{className:Oe("yst-absolute yst-right-1 yst-top-1 yst-h-2 yst-w-2 yst-rounded-full",qn.indicator.default)})]})},x.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(qn.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(qn.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(T.Button,{onClick:v,className:"yst-w-full",disabled:b,children:"Show latest analysis"})})]}):null};function Ac(e,t){return h7(e)||f7(e,t)||d7(e,t)||c7()}function c7(){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 d7(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 f7(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function h7(e){if(Array.isArray(e))return e}var g7=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,u=t.id,c=u===void 0?"analysis-date-select":u,d=z.useState(!1),f=Ac(d,2),h=f[0],g=f[1],m=z.useState("latest"),p=Ac(m,2),v=p[0],b=p[1],S=z.useRef(null),C=function(A){if(!A)return null;var j=A.slice(0,10),L=j.split("-"),H=Ac(L,3),Q=H[0],F=H[1],G=H[2],ie=Number(Q),ae=Number(F),N=Number(G);return Number.isNaN(ie)||Number.isNaN(ae)||Number.isNaN(N)||ae<1||ae>12||N<1||N>31?null:new Date(ie,ae-1,N)},w=function(A){var j=C(A.createdAt);return j?j.getTime():-1/0};z.useEffect(function(){if((r==="latest"||!r)&&n.length>0&&!o){var R=n.reduce(function(A,j){return w(j)>w(A)?j:A});i(R.id)}},[n,r,i,o]);var O=z.useMemo(function(){if(r==="latest"||!r){if(n.length>0){var R=n.reduce(function(A,j){return w(j)>w(A)?j:A});return R.id}return"latest"}return r},[r,n,w]);z.useEffect(function(){b(O)},[O]);var x=n.find(function(R){return String(R.id)===String(v)}),_=n.length>0?String(n.reduce(function(R,A){return w(A)>w(R)?A:R}).id):"",k=function(){if(x){var R=C(x.createdAt),A=R?jo(R,"MMMM d, yyyy"):x.createdAt?x.createdAt.slice(0,10):"Unknown date",j=String(x.id)===_?"(latest)":"(older)";return"".concat(A," ").concat(j)}return n.length>0?"Select date...":"No analyses available"}();z.useEffect(function(){var R=function(j){S.current&&!S.current.contains(j.target)&&g(!1)};return h&&document.addEventListener("mousedown",R),function(){document.removeEventListener("mousedown",R)}},[h]);var E=function(){!l&&!o&&g(!h)},P=function(A){b(A),i(A),g(!1)},M=function(){g(!1)},B=function(A){A.key==="Enter"||A.key===" "?(A.preventDefault(),E()):A.key==="Escape"&&g(!1)};return y.jsxs("div",{ref:S,className:"yst-relative",children:[y.jsxs("div",{className:"yst-relative",children:[y.jsx(T.TextInput,{id:c,onClick:E,onKeyDown:B,onChange:function(){},disabled:l||o,value:k,"aria-expanded":h,"aria-haspopup":"true","aria-label":"Select analysis date",className:Oe("yst-pr-10",{"yst-cursor-default":!l&&!o})}),y.jsx(D4,{className:Oe("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(u7,{analyses:n,selectedAnalysisId:v,onAnalysisSelect:P,isLoading:o,isOpen:h,onClose:M})]})};function _2(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 y7(e,t){var n=_2(e);return n!==void 0&&n>t*60*1e3}var m7=2;function k2(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m7,n=_2(e);return n!==void 0&&n>0&&n<=t*60*1e3}function Ld(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],u=a[1].replace(",",""),c=a.slice(2).join(" ");return"".concat(l," ").concat(u," at ").concat(c)}return"".concat(o)}var dg;function fg(e,t){return x7(e)||b7(e,t)||v7(e,t)||p7()}function p7(){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 v7(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 b7(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function x7(e){if(Array.isArray(e))return e}function Dd(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,g,m,p){var v=g&&g.prototype instanceof a?g:a,b=Object.create(v.prototype);return Xt(b,"_invoke",function(S,C,w){var O,x,_,k=0,E=w||[],P=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(A,j){return O=A,x=0,_=e,M.n=j,o}};function B(R,A){for(x=R,_=A,t=0;!P&&k&&!j&&t<E.length;t++){var j,L=E[t],H=M.p,Q=L[2];R>3?(j=Q===A)&&(_=L[(x=L[4])?5:(x=3,3)],L[4]=L[5]=e):L[0]<=H&&((j=R<2&&H<L[1])?(x=0,M.v=A,M.n=L[1]):H<Q&&(j=R<3||L[0]>A||A>Q)&&(L[4]=R,L[5]=A,M.n=Q,x=0))}if(j||R>1)return o;throw P=!0,A}return function(R,A,j){if(k>1)throw TypeError("Generator is already running");for(P&&A===1&&B(A,j),x=A,_=j;(t=x<2?e:_)||!P;){O||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(k=2,O){if(x||(R="next"),t=O[R]){if(!(t=t.call(O,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=O.return)&&t.call(O),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);O=e}else if((t=(P=M.n<0)?_:S.call(C,M))!==o)break}catch(L){O=e,x=1,_=L}finally{k=1}}return{value:t,done:P}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(Xt(t={},r,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,Xt(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,Xt(d,"constructor",u),Xt(u,"constructor",l),l.displayName="GeneratorFunction",Xt(u,i,"GeneratorFunction"),Xt(d),Xt(d,i,"Generator"),Xt(d,r,function(){return this}),Xt(d,"toString",function(){return"[object Generator]"}),(Dd=function(){return{w:s,m:f}})()}function Xt(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Xt=function(o,a,l,u){if(a)i?i(o,a,{value:l,enumerable:!u,configurable:!u,writable:!u}):o[a]=l;else{var c=function(f,h){Xt(o,f,function(g){return this._invoke(f,h,g)})};c("next",0),c("throw",1),c("return",2)}},Xt(e,t,n,r)}function gg(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function w7(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 S7(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Tc=za(dg||(dg=S7(["yst-flex-1 yst-space-y-2"]))),C7=function(t){var n,r,i,s,o=t.className,a=Rn(),l=a.brandId,u=a.analysisId,c=a.model,d=Fa(),f=d.setModel,h=d.setAnalysisId,g=Gt(),m=dn(),p=ri(),v=p.data,b=Iu({query:{select:function(Je){var Be=Je.data;return Be==null?void 0:Be.data}}}),S=b.data,C=b.isLoading,w=S==null?void 0:S.displayName,O=Vi({query:{select:function(Je){var Be=Je.data;return Be==null?void 0:Be.brands}}}),x=O.data,_=O.isLoading,k=t2(l,{query:{enabled:!!l,select:function(Je){var Be=Je.data;return Be==null?void 0:Be.analyses}}}),E=k.data,P=k.isLoading,M=Lu(l,u,{query:{enabled:!!l&&!!u,select:function(Je){var Be=Je.data;return Be}}}),B=M.data,R=M.isLoading,A=Jl(l,{query:{enabled:!!l,select:function(Je){var Be=Je.data;return Be}}}),j=A.data,L=A.isLoading,H=F5({mutation:{onSuccess:function(){var we=w7(Dd().m(function Be(){var An,Kt;return Dd().w(function(fn){for(;;)switch(fn.n){case 0:return fn.n=1,Promise.all([g.invalidateQueries({queryKey:Tf(l)}),g.invalidateQueries({queryKey:Xl(l,u)}),g.invalidateQueries({queryKey:Pf(l)})]);case 1:An=(E==null?void 0:E.filter(function(Nn){return String(Nn.id)!==String(u)}))||[],An.length>0?(Kt=An.reduce(function(Nn,nr){var Qi=Nn.createdAt?new Date(Nn.createdAt).getTime():0,Or=nr.createdAt?new Date(nr.createdAt).getTime():0;return Or>Qi?nr:Nn}),h(Kt.id),m("/brands/".concat(l,"/analysis/").concat(Kt.id))):(h("latest"),m("/brands/".concat(l))),N(!1);case 2:return fn.a(2)}},Be)}));function Je(){return we.apply(this,arguments)}return Je}()}}),Q=H.mutate,F=H.isPending;z.useEffect(function(){!L&&!R&&l&&x&&(x==null?void 0:x.length)<2&&(!(j!=null&&j.queries)||Array.isArray(j==null?void 0:j.queries)&&j.queries.length===0)&&(E==null?void 0:E.length)===0&&m("/setup/".concat(l,"/queries"))},[L,R,j,l,m,x,E==null?void 0:E.length]);var G=z.useState(!1),ie=fg(G,2),ae=ie[0],N=ie[1],le=function(){N(!1)},te=x==null?void 0:x.find(function(we){return String(we.id)===String(l)}),me=B==null||(n=B.analysis)===null||n===void 0?void 0:n.id,J=l!=null&&typeof me=="number"&&!isNaN(me),Se=z.useState(!1),ge=fg(Se,2),ze=ge[0],oe=ge[1];z.useEffect(function(){if(J){var we="yst_legal_alert_dismissed_".concat(l,"_").concat(me);oe(window.localStorage.getItem(we)===null)}},[l,me,J]);var He=function(Je){if(Je.preventDefault(),!!J){var Be="yst_legal_alert_dismissed_".concat(l,"_").concat(me);window.localStorage.setItem(Be,"true"),oe(!1)}},lt=function(Je){switch(Je){case"openai":return"OpenAI";case"perplexity":return"Perplexity";case"anthropic":return"Anthropic";default:return Je||"Unknown"}},dt=(B==null||(r=B.analysis)===null||r===void 0||(r=r.scans)===null||r===void 0?void 0:r.map(function(we){return{value:we.aiProvider,label:lt(we.aiProvider)}}))||[{value:"",label:"Default model"}],Ne=E!=null&&E.some(function(we){return String(we.id)===String(u)})?u:E&&E.length>0?E[0].id:"latest",Fe=Jl(l,{query:{enabled:!!l,select:function(Je){var Be=Je.data;return Be}}}),Y=Fe.data,Te=(Y==null?void 0:Y.name)||"your brand",tt=Ld(Y==null?void 0:Y.nextScheduledAnalysis),$e=B==null||(i=B.analysis)===null||i===void 0?void 0:i.status,ue=function(){var we=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:Te}),". The analysis is scheduled to run on"," ",y.jsx("b",{className:"yst-font-medium",children:tt}),". You'll see the results here once it's ready. We'll also notify you by email."]})]});if($e===void 0&&(j==null?void 0:j.setupStatus)==="scheduledFirstAnalysis")return{alertContent:we,alertVariant:"info"};switch($e){case di.pending:return{alertContent:we,alertVariant:"info"};case di.processing:return{alertContent:y.jsxs(y.Fragment,{children:["You've completed the setup for ",Te,". The analysis is now processing. You'll see the results here once it's ready. We'll also notify you by email."]}),alertVariant:"info"};case di.failed:return{alertContent:y.jsx(y.Fragment,{children:"Analysis failed. Try restarting the analysis or contact support if the issue persists."}),alertVariant:"danger"};case di.cancelled:return{alertContent:y.jsx(y.Fragment,{children:"Analysis was cancelled. You can restart the analysis when ready."}),alertVariant:"warning"};case di.completed:return{alertContent:null};default:return{alertContent:null,alertVariant:"info"}}}(),W=ue.alertContent,ne=ue.alertVariant,ee=!P&&(j==null?void 0:j.setupStatus)!=="pendingQuerySelection"&&(E==null?void 0:E.length)===0&&(j==null?void 0:j.nextScheduledAnalysis)===null,Ce=v&&["updating","completed"].includes(v.status)&&!v.isUpToDateWithBrandGroups,gt=(v==null?void 0:v.status)===A6.updating&&Ce===!1;return y.jsxs(y.Fragment,{children:[y.jsx(Fu,{isOpen:ae,onClose:le,onConfirm:function(){l&&u&&Q({brandId:l,analysisId:u})},isLoading:F,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(T.Card,{className:Oe("yst-relative yst-overflow-visible",o),children:y.jsxs(T.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(T.Title,{children:y.jsxs(y.Fragment,{children:[C||!w?y.jsx(T.SkeletonLoader,{className:"yst-inline-block yst-h-8 yst-w-64"}):y.jsxs(y.Fragment,{children:["Hi ",w,", "]})," "]})}),y.jsx("p",{className:"yst-text-sm yst-font-normal yst-text-slate-600",children:"welcome to your brand analysis!"})]})}),y.jsxs("div",{className:"yst-flex yst-flex-row yst-flex-wrap yst-items-center yst-justify-end yst-gap-4 yst-self-end md:yst-self-start",children:[y.jsxs(T.Button,{variant:"primary",className:"yst-gap-1.5",onClick:function(){return m("/setup")},disabled:P||_,children:[y.jsx(l2,{})," Analyze a different brand"]}),y.jsx("div",{className:"yst-relative",children:y.jsxs(T.DropdownMenu,{children:[y.jsx(T.DropdownMenu.IconTrigger,{screenReaderTriggerLabel:"Open brand list options",disabled:P||_||x&&(x==null?void 0:x.length)<1,children:y.jsx(K4,{})}),y.jsx(T.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(T.DropdownMenu.ButtonItem,{onClick:function(){return N(!0)},disabled:P||_||(B==null||(s=B.analysis)===null||s===void 0?void 0:s.status)!=="completed"||!E||E.length===0,className:"yst-flex yst-justify-start yst-gap-1.5 yst-text-red-600 hover:yst-bg-red-50",children:[y.jsx(jf,{className:"yst-h-4 yst-w-4"}),"Delete analysis"]})})]})})]})]}),y.jsx(Ha,{}),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(Tc,{children:[y.jsx(T.Label,{htmlFor:"brand-name",children:"Brand"}),y.jsx(T.Select,{onChange:function(we){m("/brands/".concat(we.toString()))},id:"brand-name",value:l?Number(l):"loading",options:x&&x.length>0?x.map(function(we){return{value:we.id,label:we.name}}):[{value:"loading",label:"Loading..."}],disabled:_||!x||x.length<2||!l})]}),y.jsxs(Tc,{children:[y.jsx(T.Label,{htmlFor:"analysis-date",children:"Analysis date"}),y.jsx(g7,{analyses:E||[],selectedAnalysisId:Ne,onAnalysisSelect:function(we){m("/brands/".concat(l,"/analysis/").concat(String(we)))},isLoading:P,disabled:P||!E||E.length<1,id:"analysis-date"})]}),y.jsxs(Tc,{children:[y.jsx(T.Label,{htmlFor:"ai-tool",children:"AI model"}),y.jsx(T.Select,{onChange:function(we){Object.values(E6).includes(we)?f(we):console.error("Invalid AI provider selected:",we)},id:"ai-tool",value:c,options:R||P?[{value:c,label:"Loading..."}]:dt,disabled:R||P||[{}].length<2})]})]})]})}),y.jsxs("div",{className:"ystaii-alerts yst-space-y-4",children:[J&&ze&&y.jsx(T.Alert,{children:y.jsxs("div",{className:"yst-flex yst-w-full",children:[y.jsx("div",{className:"yst-max-w-xl yst-space-y-4",children:y.jsx("p",{className:"yst-mb-0",children:"Note: This content was generated by an AI model (see dropdown above) and may contain errors. Please review before acting on it."})}),y.jsx("div",{className:"yst-ml-auto",children:y.jsx(T.Link,{onClick:He,variant:"default",children:y.jsx(g2,{})})})]})}),$e!==di.completed&&W&&y.jsx(T.Alert,{className:"md:yst-col-span-2",variant:ne,children:W}),Ce&&y.jsxs(T.Alert,{variant:"warning",children:["Note: This scan is not up to date with your current brand groups.",gt?y.jsxs(y.Fragment,{children:[" ","We're updating your sentiment analysis to reflect your new brand groups. This may take a few minutes."]}):y.jsx(y.Fragment,{children:" Newer scans will use your newly selected brand groupings."})]})]}),ee&&y.jsx(T.Alert,{variant:"info",className:"yst-mb-6",children:y.jsx("div",{className:"yst-flex yst-items-start yst-gap-3",children:y.jsxs("div",{className:"yst-flex-1",children:[y.jsx("h3",{className:"yst-mb-2 yst-font-medium yst-text-blue-800",children:"No analyses scheduled"}),y.jsxs("p",{className:"yst-text-bluer-700 yst-mb-0",children:[y.jsx("span",{className:"yst-font-medium yst-text-blue-900",children:te==null?void 0:te.name})," ","has not been analyzed yet, and no analyses are scheduled because this brand is set to inactive in your"," ",y.jsx("span",{className:"yst-cursor-pointer yst-font-medium yst-text-blue-900 yst-underline",onClick:function(){return m("/settings")},role:"button",tabIndex:0,onKeyPress:function(we){(we.key==="Enter"||we.key===" ")&&m("/settings")},children:"Settings"}),"."]})]})})}),te&&y.jsx(D_,{brand:te},te.id)]})},_7=function(){var t,n,r,i=ri(),s=i.data,o=i.isLoading,a=i.isRefetching,l=s==null?void 0:s.mentions;return y.jsx(T.Card,{className:"yst-overflow-visible",children:y.jsxs(T.Card.Content,{className:"yst-space-y-4",children:[y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(qa,{title:"Mentions",tooltip:"The queries where your brand was mentioned."}),y.jsx(Ba,{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(u,c){var d=c===0,f=l.queriesWithMentions&&c===l.queriesWithMentions.length-1;return y.jsxs("li",{className:Oe("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:u!=null&&u.mentioned?y.jsx(R4,{className:"yst-text-green-500"}):y.jsx(a6,{className:"yst-text-red-500"})}),y.jsx("span",{className:"yst-justify-start",children:u.query}),y.jsx("span",{className:"yst-ml-auto yst-flex yst-items-end",children:u!=null&&u.mentioned?y.jsx(T.Badge,{className:"yst-bg-green-100 yst-text-green-800",children:"Found"}):y.jsx(T.Badge,{className:"yst-bg-red-100 yst-text-red-800",children:"Not found"})})]},u.query)})}):y.jsx(T.SkeletonLoader,{className:"yst-h-56 yst-w-full"})]})})};/*!
46
+ */var Cc,Y0;function z_(){if(Y0)return Cc;Y0=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(c){return o[c]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(c){u[c]=c}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch(c){return!1}}return Cc=i()?Object.assign:function(s,o){for(var a,l=r(s),u,c=1;c<arguments.length;c++){a=Object(arguments[c]);for(var d in a)t.call(a,d)&&(l[d]=a[d]);if(e){u=e(a);for(var f=0;f<u.length;f++)n.call(a,u[f])&&(l[u[f]]=a[u[f]])}}return l},Cc}var _c,X0;function If(){if(X0)return _c;X0=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return _c=e,_c}var kc,Z0;function S2(){return Z0||(Z0=1,kc=Function.call.bind(Object.prototype.hasOwnProperty)),kc}var Oc,J0;function H_(){if(J0)return Oc;J0=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=If(),n={},r=S2();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,u){if(process.env.NODE_ENV!=="production"){for(var c in s)if(r(s,c)){var d;try{if(typeof s[c]!="function"){var f=Error((l||"React class")+": "+a+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}d=s[c](o,c,l,a,null,t)}catch(g){d=g}if(d&&!(d instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+c+"` 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=u?u():"";e("Failed "+a+" type: "+d.message+(h!=null?h:""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Oc=i,Oc}var Ec,eg;function U_(){if(eg)return Ec;eg=1;var e=w2(),t=z_(),n=If(),r=S2(),i=H_(),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(u){}});function o(){return null}return Ec=function(a,l){var u=typeof Symbol=="function"&&Symbol.iterator,c="@@iterator";function d(F){var U=F&&(u&&F[u]||F[c]);if(typeof U=="function")return U}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:S,element:C(),elementType:w(),instanceOf:O,node:E(),objectOf:_,oneOf:x,oneOfType:k,shape:M,exact:B};function g(F,U){return F===U?F!==0||1/F===1/U:F!==F&&U!==U}function m(F,U){this.message=F,this.data=U&&typeof U=="object"?U:{},this.stack=""}m.prototype=Error.prototype;function p(F){if(process.env.NODE_ENV!=="production")var U={},ie=0;function ae(le,te,me,J,Se,ge,ze){if(J=J||f,ge=ge||me,ze!==n){if(l){var oe=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 oe.name="Invariant Violation",oe}else if(process.env.NODE_ENV!=="production"&&typeof console!="undefined"){var He=J+":"+me;!U[He]&&ie<3&&(s("You are manually calling a React.PropTypes validation function for the `"+ge+"` prop on `"+J+"`. 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."),U[He]=!0,ie++)}}return te[me]==null?le?te[me]===null?new m("The "+Se+" `"+ge+"` is marked as required "+("in `"+J+"`, but its value is `null`.")):new m("The "+Se+" `"+ge+"` is marked as required in "+("`"+J+"`, but its value is `undefined`.")):null:F(te,me,J,Se,ge)}var N=ae.bind(null,!1);return N.isRequired=ae.bind(null,!0),N}function v(F){function U(ie,ae,N,le,te,me){var J=ie[ae],Se=P(J);if(Se!==F){var ge=L(J);return new m("Invalid "+le+" `"+te+"` of type "+("`"+ge+"` supplied to `"+N+"`, expected ")+("`"+F+"`."),{expectedType:F})}return null}return p(U)}function b(){return p(o)}function S(F){function U(ie,ae,N,le,te){if(typeof F!="function")return new m("Property `"+te+"` of component `"+N+"` has invalid PropType notation inside arrayOf.");var me=ie[ae];if(!Array.isArray(me)){var J=P(me);return new m("Invalid "+le+" `"+te+"` of type "+("`"+J+"` supplied to `"+N+"`, expected an array."))}for(var Se=0;Se<me.length;Se++){var ge=F(me,Se,N,le,te+"["+Se+"]",n);if(ge instanceof Error)return ge}return null}return p(U)}function C(){function F(U,ie,ae,N,le){var te=U[ie];if(!a(te)){var me=P(te);return new m("Invalid "+N+" `"+le+"` of type "+("`"+me+"` supplied to `"+ae+"`, expected a single ReactElement."))}return null}return p(F)}function w(){function F(U,ie,ae,N,le){var te=U[ie];if(!e.isValidElementType(te)){var me=P(te);return new m("Invalid "+N+" `"+le+"` of type "+("`"+me+"` supplied to `"+ae+"`, expected a single ReactElement type."))}return null}return p(F)}function O(F){function U(ie,ae,N,le,te){if(!(ie[ae]instanceof F)){var me=F.name||f,J=G(ie[ae]);return new m("Invalid "+le+" `"+te+"` of type "+("`"+J+"` supplied to `"+N+"`, expected ")+("instance of `"+me+"`."))}return null}return p(U)}function x(F){if(!Array.isArray(F))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):s("Invalid argument supplied to oneOf, expected an array.")),o;function U(ie,ae,N,le,te){for(var me=ie[ae],J=0;J<F.length;J++)if(g(me,F[J]))return null;var Se=JSON.stringify(F,function(ze,oe){var He=L(oe);return He==="symbol"?String(oe):oe});return new m("Invalid "+le+" `"+te+"` of value `"+String(me)+"` "+("supplied to `"+N+"`, expected one of "+Se+"."))}return p(U)}function _(F){function U(ie,ae,N,le,te){if(typeof F!="function")return new m("Property `"+te+"` of component `"+N+"` has invalid PropType notation inside objectOf.");var me=ie[ae],J=P(me);if(J!=="object")return new m("Invalid "+le+" `"+te+"` of type "+("`"+J+"` supplied to `"+N+"`, expected an object."));for(var Se in me)if(r(me,Se)){var ge=F(me,Se,N,le,te+"."+Se,n);if(ge instanceof Error)return ge}return null}return p(U)}function k(F){if(!Array.isArray(F))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var U=0;U<F.length;U++){var ie=F[U];if(typeof ie!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+H(ie)+" at index "+U+"."),o}function ae(N,le,te,me,J){for(var Se=[],ge=0;ge<F.length;ge++){var ze=F[ge],oe=ze(N,le,te,me,J,n);if(oe==null)return null;oe.data&&r(oe.data,"expectedType")&&Se.push(oe.data.expectedType)}var He=Se.length>0?", expected one of type ["+Se.join(", ")+"]":"";return new m("Invalid "+me+" `"+J+"` supplied to "+("`"+te+"`"+He+"."))}return p(ae)}function E(){function F(U,ie,ae,N,le){return R(U[ie])?null:new m("Invalid "+N+" `"+le+"` supplied to "+("`"+ae+"`, expected a ReactNode."))}return p(F)}function j(F,U,ie,ae,N){return new m((F||"React class")+": "+U+" type `"+ie+"."+ae+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+N+"`.")}function M(F){function U(ie,ae,N,le,te){var me=ie[ae],J=P(me);if(J!=="object")return new m("Invalid "+le+" `"+te+"` of type `"+J+"` "+("supplied to `"+N+"`, expected `object`."));for(var Se in F){var ge=F[Se];if(typeof ge!="function")return j(N,le,te,Se,L(ge));var ze=ge(me,Se,N,le,te+"."+Se,n);if(ze)return ze}return null}return p(U)}function B(F){function U(ie,ae,N,le,te){var me=ie[ae],J=P(me);if(J!=="object")return new m("Invalid "+le+" `"+te+"` of type `"+J+"` "+("supplied to `"+N+"`, expected `object`."));var Se=t({},ie[ae],F);for(var ge in Se){var ze=F[ge];if(r(F,ge)&&typeof ze!="function")return j(N,le,te,ge,L(ze));if(!ze)return new m("Invalid "+le+" `"+te+"` key `"+ge+"` supplied to `"+N+"`.\nBad object: "+JSON.stringify(ie[ae],null," ")+`
47
+ Valid keys: `+JSON.stringify(Object.keys(F),null," "));var oe=ze(me,ge,N,le,te+"."+ge,n);if(oe)return oe}return null}return p(U)}function R(F){switch(typeof F){case"number":case"string":case"undefined":return!0;case"boolean":return!F;case"object":if(Array.isArray(F))return F.every(R);if(F===null||a(F))return!0;var U=d(F);if(U){var ie=U.call(F),ae;if(U!==F.entries){for(;!(ae=ie.next()).done;)if(!R(ae.value))return!1}else for(;!(ae=ie.next()).done;){var N=ae.value;if(N&&!R(N[1]))return!1}}else return!1;return!0;default:return!1}}function A(F,U){return F==="symbol"?!0:U?U["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&U instanceof Symbol:!1}function P(F){var U=typeof F;return Array.isArray(F)?"array":F instanceof RegExp?"object":A(U,F)?"symbol":U}function L(F){if(typeof F=="undefined"||F===null)return""+F;var U=P(F);if(U==="object"){if(F instanceof Date)return"date";if(F instanceof RegExp)return"regexp"}return U}function H(F){var U=L(F);switch(U){case"array":case"object":return"an "+U;case"boolean":case"date":case"regexp":return"a "+U;default:return U}}function G(F){return!F.constructor||!F.constructor.name?f:F.constructor.name}return h.checkPropTypes=i,h.resetWarningCache=i.resetWarningCache,h.PropTypes=h,h},Ec}var Ac,tg;function G_(){if(tg)return Ac;tg=1;var e=If();function t(){}function n(){}return n.resetWarningCache=t,Ac=function(){function r(o,a,l,u,c,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},Ac}var ng;function K_(){if(ng)return ul.exports;if(ng=1,process.env.NODE_ENV!=="production"){var e=w2(),t=!0;ul.exports=U_()(e.isElement,t)}else ul.exports=G_()();return ul.exports}var V_=K_();const Dd=xp(V_);var Va=function(t){var n=t.className,r=n===void 0?"":n;return y.jsx("hr",{className:Oe("yst-my-6",r)})};Va.propTypes={className:Dd.string};const C2=6048e5,W_=864e5,rg=Symbol.for("constructDateFrom");function dn(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&rg in e?e[rg](t):e instanceof Date?new e.constructor(t):new Date(t)}function Kt(e,t){return dn(t||e,e)}function _2(e,t,n){const r=Kt(e,n==null?void 0:n.in);if(isNaN(t))return dn(e,NaN);if(!t)return r;const i=r.getDate(),s=dn(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 Q_={};function Hu(){return Q_}function ca(e,t){var a,l,u,c,d,f,h,g;const n=Hu(),r=(g=(h=(c=(u=t==null?void 0:t.weekStartsOn)!=null?u:(l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)!=null?c:n.weekStartsOn)!=null?h:(f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)!=null?g:0,i=Kt(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 ru(e,t){return ca(e,{...t,weekStartsOn:1})}function k2(e,t){const n=Kt(e,t==null?void 0:t.in),r=n.getFullYear(),i=dn(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const s=ru(i),o=dn(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const a=ru(o);return n.getTime()>=s.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function ig(e){const t=Kt(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 Uu(e,...t){const n=dn.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function iu(e,t){const n=Kt(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function Y_(e,t,n){const[r,i]=Uu(n==null?void 0:n.in,e,t),s=iu(r),o=iu(i),a=+s-ig(s),l=+o-ig(o);return Math.round((a-l)/W_)}function X_(e,t){const n=k2(e,t),r=dn(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),ru(r)}function Z_(e){return dn(e,Date.now())}function J_(e,t,n){const[r,i]=Uu(n==null?void 0:n.in,e,t);return+iu(r)==+iu(i)}function e8(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function t8(e){return!(!e8(e)&&typeof e!="number"||isNaN(+Kt(e)))}function n8(e,t){const n=Kt(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 r8(e,t){const[n,r]=Uu(e,t.start,t.end);return{start:n,end:r}}function i8(e,t){const{start:n,end:r}=r8(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(dn(n,o)),o.setDate(o.getDate()+a),o.setHours(0,0,0,0);return i?l.reverse():l}function s8(e,t){const n=Kt(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function o8(e,t){const n=Kt(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const a8={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"}},l8=(e,t,n)=>{let r;const i=a8[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 Tc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const u8={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},c8={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},d8={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},f8={date:Tc({formats:u8,defaultWidth:"full"}),time:Tc({formats:c8,defaultWidth:"full"}),dateTime:Tc({formats:d8,defaultWidth:"full"})},h8={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},g8=(e,t,n,r)=>h8[e];function bo(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 y8={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},m8={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},p8={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"]},v8={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"]},b8={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"}},x8={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"}},w8=(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"},S8={ordinalNumber:w8,era:bo({values:y8,defaultWidth:"wide"}),quarter:bo({values:m8,defaultWidth:"wide",argumentCallback:e=>e-1}),month:bo({values:p8,defaultWidth:"wide"}),day:bo({values:v8,defaultWidth:"wide"}),dayPeriod:bo({values:b8,defaultWidth:"wide",formattingValues:x8,defaultFormattingWidth:"wide"})};function xo(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)?_8(a,d=>d.test(o)):C8(a,d=>d.test(o));let u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const c=t.slice(o.length);return{value:u,rest:c}}}function C8(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function _8(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function k8(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 O8=/^(\d+)(th|st|nd|rd)?/i,E8=/\d+/i,A8={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},T8={any:[/^b/i,/^(a|c)/i]},P8={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},j8={any:[/1/i,/2/i,/3/i,/4/i]},M8={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},$8={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]},L8={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},D8={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]},I8={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},R8={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}},N8={ordinalNumber:k8({matchPattern:O8,parsePattern:E8,valueCallback:e=>parseInt(e,10)}),era:xo({matchPatterns:A8,defaultMatchWidth:"wide",parsePatterns:T8,defaultParseWidth:"any"}),quarter:xo({matchPatterns:P8,defaultMatchWidth:"wide",parsePatterns:j8,defaultParseWidth:"any",valueCallback:e=>e+1}),month:xo({matchPatterns:M8,defaultMatchWidth:"wide",parsePatterns:$8,defaultParseWidth:"any"}),day:xo({matchPatterns:L8,defaultMatchWidth:"wide",parsePatterns:D8,defaultParseWidth:"any"}),dayPeriod:xo({matchPatterns:I8,defaultMatchWidth:"any",parsePatterns:R8,defaultParseWidth:"any"})},F8={code:"en-US",formatDistance:l8,formatLong:f8,formatRelative:g8,localize:S8,match:N8,options:{weekStartsOn:0,firstWeekContainsDate:1}};function B8(e,t){const n=Kt(e,t==null?void 0:t.in);return Y_(n,o8(n))+1}function q8(e,t){const n=Kt(e,t==null?void 0:t.in),r=+ru(n)-+X_(n);return Math.round(r/C2)+1}function O2(e,t){var c,d,f,h,g,m,p,v;const n=Kt(e,t==null?void 0:t.in),r=n.getFullYear(),i=Hu(),s=(v=(p=(h=(f=t==null?void 0:t.firstWeekContainsDate)!=null?f:(d=(c=t==null?void 0:t.locale)==null?void 0:c.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=dn((t==null?void 0:t.in)||e,0);o.setFullYear(r+1,0,s),o.setHours(0,0,0,0);const a=ca(o,t),l=dn((t==null?void 0:t.in)||e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const u=ca(l,t);return+n>=+a?r+1:+n>=+u?r:r-1}function z8(e,t){var a,l,u,c,d,f,h,g;const n=Hu(),r=(g=(h=(c=(u=t==null?void 0:t.firstWeekContainsDate)!=null?u:(l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)!=null?c:n.firstWeekContainsDate)!=null?h:(f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)!=null?g:1,i=O2(e,t),s=dn((t==null?void 0:t.in)||e,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),ca(s,t)}function H8(e,t){const n=Kt(e,t==null?void 0:t.in),r=+ca(n,t)-+z8(n,t);return Math.round(r/C2)+1}function We(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Pr={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)}},ts={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},sg={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 Pr.y(e,t)},Y:function(e,t,n,r){const i=O2(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=k2(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 Pr.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=H8(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):We(i,t.length)},I:function(e,t,n){const r=q8(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"}):Pr.d(e,t)},D:function(e,t,n){const r=B8(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=ts.noon:r===0?i=ts.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=ts.evening:r>=12?i=ts.afternoon:r>=4?i=ts.morning:i=ts.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 Pr.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Pr.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"}):Pr.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Pr.s(e,t)},S:function(e,t){return Pr.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return ag(r);case"XXXX":case"XX":return yi(r);case"XXXXX":case"XXX":default:return yi(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return ag(r);case"xxxx":case"xx":return yi(r);case"xxxxx":case"xxx":default:return yi(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+og(r,":");case"OOOO":default:return"GMT"+yi(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+og(r,":");case"zzzz":default:return"GMT"+yi(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 og(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 ag(e,t){return e%60===0?(e>0?"-":"+")+We(Math.abs(e)/60,2):yi(e,t)}function yi(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 lg=(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"})}},E2=(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"})}},U8=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return lg(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}}",lg(r,t)).replace("{{time}}",E2(i,t))},G8={p:E2,P:U8},K8=/^D+$/,V8=/^Y+$/,W8=["D","DD","YY","YYYY"];function Q8(e){return K8.test(e)}function Y8(e){return V8.test(e)}function X8(e,t,n){const r=Z8(e,t,n);if(console.warn(r),W8.includes(e))throw new RangeError(r)}function Z8(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 J8=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,e7=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,t7=/^'([^]*?)'?$/,n7=/''/g,r7=/[a-zA-Z]/;function Lo(e,t,n){var c,d,f,h,g,m,p,v,b;const r=Hu(),i=(c=r.locale)!=null?c:F8,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=Kt(e,n==null?void 0:n.in);if(!t8(a))throw new RangeError("Invalid time value");let l=t.match(e7).map(S=>{const C=S[0];if(C==="p"||C==="P"){const w=G8[C];return w(S,i.formatLong)}return S}).join("").match(J8).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const C=S[0];if(C==="'")return{isToken:!1,value:i7(S)};if(sg[C])return{isToken:!0,value:S};if(C.match(r7))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");return{isToken:!1,value:S}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const u={firstWeekContainsDate:s,weekStartsOn:o,locale:i};return l.map(S=>{if(!S.isToken)return S.value;const C=S.value;(Y8(C)||Q8(C))&&X8(C,t,String(e));const w=sg[C[0]];return w(a,C,i.localize,u)}).join("")}function i7(e){const t=e.match(t7);return t?t[1].replace(n7,"'"):e}function ug(e,t,n){const[r,i]=Uu(n==null?void 0:n.in,e,t);return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()}function s7(e,t){return J_(dn(e,e),Z_(e))}function o7(e,t,n){return _2(e,-1,n)}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 Pc(e,t,n){return(t=a7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a7(e){var t=l7(e,"string");return da(t)=="symbol"?t:t+""}function l7(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 cg(e,t){return f7(e)||d7(e,t)||c7(e,t)||u7()}function u7(){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 c7(e,t){if(e){if(typeof e=="string")return dg(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)?dg(e,t):void 0}}function dg(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 d7(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function f7(e){if(Array.isArray(e))return e}var zn={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"}},h7=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,u=t.onClose,c=z.useState(new Date),d=cg(c,2),f=d[0],h=d[1],g=function(_){if(!_)return null;var k=_.slice(0,10),E=k.split("-"),j=cg(E,3),M=j[0],B=j[1],R=j[2],A=Number(M),P=Number(B),L=Number(R);return Number.isNaN(A)||Number.isNaN(P)||Number.isNaN(L)||P<1||P>12||L<1||L>31?null:new Date(A,P-1,L)},m=z.useMemo(function(){var x=new Map;return n.forEach(function(_){var k=g(_.createdAt),E=k?Lo(k,"yyyy-MM-dd"):"";E&&(x.has(E)||x.set(E,[]),x.get(E).push(_))}),x},[n]);z.useEffect(function(){if(l&&r){var x=n.find(function(j){return j.id===r});if(x){var _=g(x.createdAt);_&&h(_)}}else if(l&&n.length>0){var k=n.reduce(function(j,M){return new Date(M.createdAt)>new Date(j.createdAt)?M:j}),E=g(k.createdAt);E&&h(E)}},[l,r,n]);var p=z.useMemo(function(){return n.length===0?null:n.reduce(function(x,_){return new Date(_.createdAt)>new Date(x.createdAt)?_:x})},[n]),v=function(){if(p){var _=g(p.createdAt);_&&h(_)}},b=z.useMemo(function(){if(!p)return!1;var x=g(p.createdAt);return x?ug(x,f):!1},[p,f]),S=z.useMemo(function(){var x=s8(f),_=n8(f),k=new Date(x),E=k.getDay(),j=E===0?6:E-1;k.setDate(k.getDate()-j);var M=new Date(_),B=M.getDay(),R=B===0?0:7-B;return M.setDate(M.getDate()+R),i8({start:k,end:M}).map(function(A){var P=Lo(A,"yyyy-MM-dd"),L=m.get(P)||[],H=L.find(function(G){return String(G.id)===String(r)});return{date:P,dateObj:A,isCurrentMonth:ug(A,f),isToday:s7(A),isSelected:!!H,hasAnalyses:L.length>0,analyses:L}})},[f,m,r]),C=function(){h(function(_){return o7(_)})},w=function(){h(function(_){return _2(_,1)})},O=function(_){if(_.hasAnalyses){if(_.analyses.length===1)i(_.analyses[0].id);else{var k=_.analyses.reduce(function(E,j){return new Date(j.createdAt)>new Date(E.createdAt)?j:E});i(k.id)}u==null||u()}};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(H4,{className:"yst-h-5 yst-w-5"})]}),y.jsx("h2",{className:"yst-text-sm yst-font-semibold yst-text-slate-900",children:Lo(f,"MMMM yyyy")}),y.jsxs("button",{type:"button",onClick:w,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(G4,{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(x,_){return y.jsx("div",{className:"yst-py-2 yst-text-center yst-text-xs yst-font-medium yst-text-slate-500",children:x},"".concat(x,"-").concat(_))})}),y.jsx("div",{className:"yst-grid yst-grid-cols-7 yst-gap-x-1",children:S.map(function(x){return y.jsx("div",{className:"yst-flex yst-items-center yst-justify-center yst-py-1",children:y.jsxs("button",{type:"button",onClick:function(){return O(x)},disabled:!x.hasAnalyses,className:Oe("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":x.isCurrentMonth,"yst-text-slate-400":!x.isCurrentMonth},{"focus:yst-outline-none focus:yst-ring-2 focus:yst-ring-blue-500":x.hasAnalyses,"yst-cursor-not-allowed":!x.hasAnalyses,"yst-cursor-pointer":x.hasAnalyses},Pc({},"".concat(zn.selected.background," ").concat(zn.selected.text," ").concat(zn.selected.hover),x.isSelected),Pc({},"".concat(zn.hasAnalysis.border," ").concat(zn.hasAnalysis.text," ").concat(zn.hasAnalysis.hover),x.hasAnalyses&&!x.isSelected)),children:[y.jsx("span",{className:Oe("yst-relative yst-z-10 yst-w-4",Pc({},zn.today.underline,x.isToday&&!x.isSelected)),children:Lo(x.dateObj,"d")}),x.hasAnalyses&&x.analyses.length>1&&!x.isSelected&&y.jsx("span",{className:Oe("yst-absolute yst-right-1 yst-top-1 yst-h-2 yst-w-2 yst-rounded-full",zn.indicator.default)})]})},x.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(zn.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(zn.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(T.Button,{onClick:v,className:"yst-w-full",disabled:b,children:"Show latest analysis"})})]}):null};function jc(e,t){return p7(e)||m7(e,t)||y7(e,t)||g7()}function g7(){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 y7(e,t){if(e){if(typeof e=="string")return fg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fg(e,t):void 0}}function fg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function m7(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function p7(e){if(Array.isArray(e))return e}var v7=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,u=t.id,c=u===void 0?"analysis-date-select":u,d=z.useState(!1),f=jc(d,2),h=f[0],g=f[1],m=z.useState("latest"),p=jc(m,2),v=p[0],b=p[1],S=z.useRef(null),C=function(A){if(!A)return null;var P=A.slice(0,10),L=P.split("-"),H=jc(L,3),G=H[0],F=H[1],U=H[2],ie=Number(G),ae=Number(F),N=Number(U);return Number.isNaN(ie)||Number.isNaN(ae)||Number.isNaN(N)||ae<1||ae>12||N<1||N>31?null:new Date(ie,ae-1,N)},w=function(A){var P=C(A.createdAt);return P?P.getTime():-1/0};z.useEffect(function(){if((r==="latest"||!r)&&n.length>0&&!o){var R=n.reduce(function(A,P){return w(P)>w(A)?P:A});i(R.id)}},[n,r,i,o]);var O=z.useMemo(function(){if(r==="latest"||!r){if(n.length>0){var R=n.reduce(function(A,P){return w(P)>w(A)?P:A});return R.id}return"latest"}return r},[r,n,w]);z.useEffect(function(){b(O)},[O]);var x=n.find(function(R){return String(R.id)===String(v)}),_=n.length>0?String(n.reduce(function(R,A){return w(A)>w(R)?A:R}).id):"",k=function(){if(x){var R=C(x.createdAt),A=R?Lo(R,"MMMM d, yyyy"):x.createdAt?x.createdAt.slice(0,10):"Unknown date",P=String(x.id)===_?"(latest)":"(older)";return"".concat(A," ").concat(P)}return n.length>0?"Select date...":"No analyses available"}();z.useEffect(function(){var R=function(P){S.current&&!S.current.contains(P.target)&&g(!1)};return h&&document.addEventListener("mousedown",R),function(){document.removeEventListener("mousedown",R)}},[h]);var E=function(){!l&&!o&&g(!h)},j=function(A){b(A),i(A),g(!1)},M=function(){g(!1)},B=function(A){A.key==="Enter"||A.key===" "?(A.preventDefault(),E()):A.key==="Escape"&&g(!1)};return y.jsxs("div",{ref:S,className:"yst-relative",children:[y.jsxs("div",{className:"yst-relative",children:[y.jsx(T.TextInput,{id:c,onClick:E,onKeyDown:B,onChange:function(){},disabled:l||o,value:k,"aria-expanded":h,"aria-haspopup":"true","aria-label":"Select analysis date",className:Oe("yst-pr-10",{"yst-cursor-default":!l&&!o})}),y.jsx(F4,{className:Oe("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(h7,{analyses:n,selectedAnalysisId:v,onAnalysisSelect:j,isLoading:o,isOpen:h,onClose:M})]})};function A2(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 b7(e,t){var n=A2(e);return n!==void 0&&n>t*60*1e3}var x7=2;function T2(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:x7,n=A2(e);return n!==void 0&&n>0&&n<=t*60*1e3}function Id(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],u=a[1].replace(",",""),c=a.slice(2).join(" ");return"".concat(l," ").concat(u," at ").concat(c)}return"".concat(o)}var hg;function gg(e,t){return _7(e)||C7(e,t)||S7(e,t)||w7()}function w7(){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 S7(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 C7(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function _7(e){if(Array.isArray(e))return e}function Rd(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,g,m,p){var v=g&&g.prototype instanceof a?g:a,b=Object.create(v.prototype);return Xt(b,"_invoke",function(S,C,w){var O,x,_,k=0,E=w||[],j=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(A,P){return O=A,x=0,_=e,M.n=P,o}};function B(R,A){for(x=R,_=A,t=0;!j&&k&&!P&&t<E.length;t++){var P,L=E[t],H=M.p,G=L[2];R>3?(P=G===A)&&(_=L[(x=L[4])?5:(x=3,3)],L[4]=L[5]=e):L[0]<=H&&((P=R<2&&H<L[1])?(x=0,M.v=A,M.n=L[1]):H<G&&(P=R<3||L[0]>A||A>G)&&(L[4]=R,L[5]=A,M.n=G,x=0))}if(P||R>1)return o;throw j=!0,A}return function(R,A,P){if(k>1)throw TypeError("Generator is already running");for(j&&A===1&&B(A,P),x=A,_=P;(t=x<2?e:_)||!j;){O||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(k=2,O){if(x||(R="next"),t=O[R]){if(!(t=t.call(O,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=O.return)&&t.call(O),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);O=e}else if((t=(j=M.n<0)?_:S.call(C,M))!==o)break}catch(L){O=e,x=1,_=L}finally{k=1}}return{value:t,done:j}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(Xt(t={},r,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,Xt(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,Xt(d,"constructor",u),Xt(u,"constructor",l),l.displayName="GeneratorFunction",Xt(u,i,"GeneratorFunction"),Xt(d),Xt(d,i,"Generator"),Xt(d,r,function(){return this}),Xt(d,"toString",function(){return"[object Generator]"}),(Rd=function(){return{w:s,m:f}})()}function Xt(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Xt=function(o,a,l,u){if(a)i?i(o,a,{value:l,enumerable:!u,configurable:!u,writable:!u}):o[a]=l;else{var c=function(f,h){Xt(o,f,function(g){return this._invoke(f,h,g)})};c("next",0),c("throw",1),c("return",2)}},Xt(e,t,n,r)}function mg(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function k7(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){mg(s,r,i,o,a,"next",l)}function a(l){mg(s,r,i,o,a,"throw",l)}o(void 0)})}}function O7(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Mc=Ka(hg||(hg=O7(["yst-flex-1 yst-space-y-2"]))),E7=function(t){var n,r,i,s,o=t.className,a=Nn(),l=a.brandId,u=a.analysisId,c=a.model,d=Ha(),f=d.setModel,h=d.setAnalysisId,g=Gt(),m=fn(),p=oi(),v=p.data,b=Fu({query:{select:function(Je){var Be=Je.data;return Be==null?void 0:Be.data}}}),S=b.data,C=b.isLoading,w=S==null?void 0:S.displayName,O=Qi({query:{select:function(Je){var Be=Je.data;return Be==null?void 0:Be.brands}}}),x=O.data,_=O.isLoading,k=s2(l,{query:{enabled:!!l,select:function(Je){var Be=Je.data;return Be==null?void 0:Be.analyses}}}),E=k.data,j=k.isLoading,M=Ru(l,u,{query:{enabled:!!l&&!!u,select:function(Je){var Be=Je.data;return Be}}}),B=M.data,R=M.isLoading,A=nu(l,{query:{enabled:!!l,select:function(Je){var Be=Je.data;return Be}}}),P=A.data,L=A.isLoading,H=H5({mutation:{onSuccess:function(){var we=k7(Rd().m(function Be(){var Tn,Vt;return Rd().w(function(hn){for(;;)switch(hn.n){case 0:return hn.n=1,Promise.all([g.invalidateQueries({queryKey:jf(l)}),g.invalidateQueries({queryKey:Zn(l,u)}),g.invalidateQueries({queryKey:Mf(l)})]);case 1:Tn=(E==null?void 0:E.filter(function(Fn){return String(Fn.id)!==String(u)}))||[],Tn.length>0?(Vt=Tn.reduce(function(Fn,ir){var Zi=Fn.createdAt?new Date(Fn.createdAt).getTime():0,Tr=ir.createdAt?new Date(ir.createdAt).getTime():0;return Tr>Zi?ir:Fn}),h(Vt.id),m("/brands/".concat(l,"/analysis/").concat(Vt.id))):(h("latest"),m("/brands/".concat(l))),N(!1);case 2:return hn.a(2)}},Be)}));function Je(){return we.apply(this,arguments)}return Je}()}}),G=H.mutate,F=H.isPending;z.useEffect(function(){!L&&!R&&l&&x&&(x==null?void 0:x.length)<2&&(!(P!=null&&P.queries)||Array.isArray(P==null?void 0:P.queries)&&P.queries.length===0)&&(E==null?void 0:E.length)===0&&m("/setup/".concat(l,"/queries"))},[L,R,P,l,m,x,E==null?void 0:E.length]);var U=z.useState(!1),ie=gg(U,2),ae=ie[0],N=ie[1],le=function(){N(!1)},te=x==null?void 0:x.find(function(we){return String(we.id)===String(l)}),me=B==null||(n=B.analysis)===null||n===void 0?void 0:n.id,J=l!=null&&typeof me=="number"&&!isNaN(me),Se=z.useState(!1),ge=gg(Se,2),ze=ge[0],oe=ge[1];z.useEffect(function(){if(J){var we="yst_legal_alert_dismissed_".concat(l,"_").concat(me);oe(window.localStorage.getItem(we)===null)}},[l,me,J]);var He=function(Je){if(Je.preventDefault(),!!J){var Be="yst_legal_alert_dismissed_".concat(l,"_").concat(me);window.localStorage.setItem(Be,"true"),oe(!1)}},lt=function(Je){switch(Je){case"openai":return"OpenAI";case"perplexity":return"Perplexity";case"anthropic":return"Anthropic";default:return Je||"Unknown"}},dt=(B==null||(r=B.analysis)===null||r===void 0||(r=r.scans)===null||r===void 0?void 0:r.map(function(we){return{value:we.aiProvider,label:lt(we.aiProvider)}}))||[{value:"",label:"Default model"}],Ne=E!=null&&E.some(function(we){return String(we.id)===String(u)})?u:E&&E.length>0?E[0].id:"latest",Fe=nu(l,{query:{enabled:!!l,select:function(Je){var Be=Je.data;return Be}}}),Y=Fe.data,Te=(Y==null?void 0:Y.name)||"your brand",tt=Id(Y==null?void 0:Y.nextScheduledAnalysis),$e=B==null||(i=B.analysis)===null||i===void 0?void 0:i.status,ue=function(){var we=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:Te}),". The analysis is scheduled to run on"," ",y.jsx("b",{className:"yst-font-medium",children:tt}),". You'll see the results here once it's ready. We'll also notify you by email."]})]});if($e===void 0&&(P==null?void 0:P.setupStatus)==="scheduledFirstAnalysis")return{alertContent:we,alertVariant:"info"};switch($e){case gi.pending:return{alertContent:we,alertVariant:"info"};case gi.processing:return{alertContent:y.jsxs(y.Fragment,{children:["You've completed the setup for ",Te,". The analysis is now processing. You'll see the results here once it's ready. We'll also notify you by email."]}),alertVariant:"info"};case gi.failed:return{alertContent:y.jsx(y.Fragment,{children:"Analysis failed. Try restarting the analysis or contact support if the issue persists."}),alertVariant:"danger"};case gi.cancelled:return{alertContent:y.jsx(y.Fragment,{children:"Analysis was cancelled. You can restart the analysis when ready."}),alertVariant:"warning"};case gi.completed:return{alertContent:null};default:return{alertContent:null,alertVariant:"info"}}}(),Q=ue.alertContent,ne=ue.alertVariant,ee=!j&&(P==null?void 0:P.setupStatus)!=="pendingQuerySelection"&&(E==null?void 0:E.length)===0&&(P==null?void 0:P.nextScheduledAnalysis)===null,Ce=v&&["updating","completed"].includes(v.status)&&!v.isUpToDateWithBrandGroups,gt=(v==null?void 0:v.status)===M6.updating&&Ce===!0;return y.jsxs(y.Fragment,{children:[y.jsx(zu,{isOpen:ae,onClose:le,onConfirm:function(){l&&u&&G({brandId:l,analysisId:u})},isLoading:F,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(T.Card,{className:Oe("yst-relative yst-overflow-visible",o),children:y.jsxs(T.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(T.Title,{children:y.jsxs(y.Fragment,{children:[C||!w?y.jsx(T.SkeletonLoader,{className:"yst-inline-block yst-h-8 yst-w-64"}):y.jsxs(y.Fragment,{children:["Hi ",w,", "]})," "]})}),y.jsx("p",{className:"yst-text-sm yst-font-normal yst-text-slate-600",children:"welcome to your brand analysis!"})]})}),y.jsxs("div",{className:"yst-flex yst-flex-row yst-flex-wrap yst-items-center yst-justify-end yst-gap-4 yst-self-end md:yst-self-start",children:[y.jsxs(T.Button,{variant:"primary",className:"yst-gap-1.5",onClick:function(){return m("/setup")},disabled:j||_,children:[y.jsx(f2,{})," Analyze a different brand"]}),y.jsx("div",{className:"yst-relative",children:y.jsxs(T.DropdownMenu,{children:[y.jsx(T.DropdownMenu.IconTrigger,{screenReaderTriggerLabel:"Open brand list options",disabled:j||_||x&&(x==null?void 0:x.length)<1,children:y.jsx(X4,{})}),y.jsx(T.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(T.DropdownMenu.ButtonItem,{onClick:function(){return N(!0)},disabled:j||_||(B==null||(s=B.analysis)===null||s===void 0?void 0:s.status)!=="completed"||!E||E.length===0,className:"yst-flex yst-justify-start yst-gap-1.5 yst-text-red-600 hover:yst-bg-red-50",children:[y.jsx($f,{className:"yst-h-4 yst-w-4"}),"Delete analysis"]})})]})})]})]}),y.jsx(Va,{}),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(Mc,{children:[y.jsx(T.Label,{htmlFor:"brand-name",children:"Brand"}),y.jsx(T.Select,{onChange:function(we){m("/brands/".concat(we.toString()))},id:"brand-name",value:l?Number(l):"loading",options:x&&x.length>0?x.map(function(we){return{value:we.id,label:we.name}}):[{value:"loading",label:"Loading..."}],disabled:_||!x||x.length<2||!l})]}),y.jsxs(Mc,{children:[y.jsx(T.Label,{htmlFor:"analysis-date",children:"Analysis date"}),y.jsx(v7,{analyses:E||[],selectedAnalysisId:Ne,onAnalysisSelect:function(we){m("/brands/".concat(l,"/analysis/").concat(String(we)))},isLoading:j,disabled:j||!E||E.length<1,id:"analysis-date"})]}),y.jsxs(Mc,{children:[y.jsx(T.Label,{htmlFor:"ai-tool",children:"AI model"}),y.jsx(T.Select,{onChange:function(we){Object.values(j6).includes(we)?f(we):console.error("Invalid AI provider selected:",we)},id:"ai-tool",value:c,options:R||j?[{value:c,label:"Loading..."}]:dt,disabled:R||j||[{}].length<2})]})]})]})}),y.jsxs("div",{className:"ystaii-alerts yst-space-y-4",children:[J&&ze&&y.jsx(T.Alert,{children:y.jsxs("div",{className:"yst-flex yst-w-full",children:[y.jsx("div",{className:"yst-max-w-xl yst-space-y-4",children:y.jsx("p",{className:"yst-mb-0",children:"Note: This content was generated by an AI model (see dropdown above) and may contain errors. Please review before acting on it."})}),y.jsx("div",{className:"yst-ml-auto",children:y.jsx(T.Link,{onClick:He,variant:"default",children:y.jsx(v2,{})})})]})}),$e!==gi.completed&&Q&&y.jsx(T.Alert,{className:"md:yst-col-span-2",variant:ne,children:Q}),Ce&&y.jsxs(T.Alert,{variant:"warning",children:["Note: This scan is not up to date with your current brand groups.",gt?y.jsxs(y.Fragment,{children:[" ","We're updating your sentiment analysis to reflect your new brand groups. This may take a few minutes."]}):y.jsx(y.Fragment,{children:" Newer scans will use your newly selected brand groupings."})]})]}),ee&&y.jsx(T.Alert,{variant:"info",className:"yst-mb-6",children:y.jsx("div",{className:"yst-flex yst-items-start yst-gap-3",children:y.jsxs("div",{className:"yst-flex-1",children:[y.jsx("h3",{className:"yst-mb-2 yst-font-medium yst-text-blue-800",children:"No analyses scheduled"}),y.jsxs("p",{className:"yst-text-bluer-700 yst-mb-0",children:[y.jsx("span",{className:"yst-font-medium yst-text-blue-900",children:te==null?void 0:te.name})," ","has not been analyzed yet, and no analyses are scheduled because this brand is set to inactive in your"," ",y.jsx("span",{className:"yst-cursor-pointer yst-font-medium yst-text-blue-900 yst-underline",onClick:function(){return m("/settings")},role:"button",tabIndex:0,onKeyPress:function(we){(we.key==="Enter"||we.key===" ")&&m("/settings")},children:"Settings"}),"."]})]})})}),te&&y.jsx(F_,{brand:te},te.id)]})},A7=function(){var t,n,r,i=oi(),s=i.data,o=i.isLoading,a=i.isRefetching,l=s==null?void 0:s.mentions;return y.jsx(T.Card,{className:"yst-overflow-visible",children:y.jsxs(T.Card.Content,{className:"yst-space-y-4",children:[y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(Ga,{title:"Mentions",tooltip:"The queries where your brand was mentioned."}),y.jsx(Ua,{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(u,c){var d=c===0,f=l.queriesWithMentions&&c===l.queriesWithMentions.length-1;return y.jsxs("li",{className:Oe("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:u!=null&&u.mentioned?y.jsx(q4,{className:"yst-text-green-500"}):y.jsx(d6,{className:"yst-text-red-500"})}),y.jsx("span",{className:"yst-justify-start",children:u.query}),y.jsx("span",{className:"yst-ml-auto yst-flex yst-items-end",children:u!=null&&u.mentioned?y.jsx(T.Badge,{className:"yst-bg-green-100 yst-text-green-800",children:"Found"}):y.jsx(T.Badge,{className:"yst-bg-red-100 yst-text-red-800",children:"Not found"})})]},u.query)})}):y.jsx(T.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 Ua(e){return e+.5|0}const zr=(e,t,n)=>Math.max(Math.min(e,n),t);function Mo(e){return zr(Ua(e*2.55),0,255)}function Kr(e){return zr(Ua(e*255),0,255)}function lr(e){return zr(Ua(e/2.55)/100,0,1)}function yg(e){return zr(Ua(e*100),0,100)}const hn={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},Id=[..."0123456789ABCDEF"],k7=e=>Id[e&15],O7=e=>Id[(e&240)>>4]+Id[e&15],al=e=>(e&240)>>4===(e&15),E7=e=>al(e.r)&&al(e.g)&&al(e.b)&&al(e.a);function A7(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&hn[e[1]]*17,g:255&hn[e[2]]*17,b:255&hn[e[3]]*17,a:t===5?hn[e[4]]*17:255}:(t===7||t===9)&&(n={r:hn[e[1]]<<4|hn[e[2]],g:hn[e[3]]<<4|hn[e[4]],b:hn[e[5]]<<4|hn[e[6]],a:t===9?hn[e[7]]<<4|hn[e[8]]:255})),n}const T7=(e,t)=>e<255?t(e):"";function P7(e){var t=E7(e)?k7:O7;return e?"#"+t(e.r)+t(e.g)+t(e.b)+T7(e.a,t):void 0}const j7=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function O2(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 M7(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 $7(e,t,n){const r=O2(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 L7(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 Df(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,u,c;return s!==o&&(c=s-o,u=a>.5?c/(2-s-o):c/(s+o),l=L7(n,r,i,c,s),l=l*60+.5),[l|0,u||0,a]}function If(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(Kr)}function Rf(e,t,n){return If(O2,e,t,n)}function D7(e,t,n){return If($7,e,t,n)}function I7(e,t,n){return If(M7,e,t,n)}function E2(e){return(e%360+360)%360}function R7(e){const t=j7.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?Mo(+t[5]):Kr(+t[5]));const i=E2(+t[2]),s=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?r=D7(i,s,o):t[1]==="hsv"?r=I7(i,s,o):r=Rf(i,s,o),{r:r[0],g:r[1],b:r[2],a:n}}function N7(e,t){var n=Df(e);n[0]=E2(n[0]+t),n=Rf(n),e.r=n[0],e.g=n[1],e.b=n[2]}function F7(e){if(!e)return;const t=Df(e),n=t[0],r=yg(t[1]),i=yg(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${i}%, ${lr(e.a)})`:`hsl(${n}, ${r}%, ${i}%)`}const mg={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"},pg={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 B7(){const e={},t=Object.keys(pg),n=Object.keys(mg);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,mg[s]);s=parseInt(pg[o],16),e[a]=[s>>16&255,s>>8&255,s&255]}return e}let ll;function q7(e){ll||(ll=B7(),ll.transparent=[0,0,0,0]);const t=ll[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const z7=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function H7(e){const t=z7.exec(e);let n=255,r,i,s;if(t){if(t[7]!==r){const o=+t[7];n=t[8]?Mo(o):zr(o*255,0,255)}return r=+t[1],i=+t[3],s=+t[5],r=255&(t[2]?Mo(r):zr(r,0,255)),i=255&(t[4]?Mo(i):zr(i,0,255)),s=255&(t[6]?Mo(s):zr(s,0,255)),{r,g:i,b:s,a:n}}}function U7(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${lr(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Pc=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Ji=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function G7(e,t,n){const r=Ji(lr(e.r)),i=Ji(lr(e.g)),s=Ji(lr(e.b));return{r:Kr(Pc(r+n*(Ji(lr(t.r))-r))),g:Kr(Pc(i+n*(Ji(lr(t.g))-i))),b:Kr(Pc(s+n*(Ji(lr(t.b))-s))),a:e.a+n*(t.a-e.a)}}function ul(e,t,n){if(e){let r=Df(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=Rf(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function A2(e,t){return e&&Object.assign(t||{},e)}function vg(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=Kr(e[3]))):(t=A2(e,{r:0,g:0,b:0,a:1}),t.a=Kr(t.a)),t}function V7(e){return e.charAt(0)==="r"?H7(e):R7(e)}class la{constructor(t){if(t instanceof la)return t;const n=typeof t;let r;n==="object"?r=vg(t):n==="string"&&(r=A7(t)||q7(t)||V7(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=A2(this._rgb);return t&&(t.a=lr(t.a)),t}set rgb(t){this._rgb=vg(t)}rgbString(){return this._valid?U7(this._rgb):void 0}hexString(){return this._valid?P7(this._rgb):void 0}hslString(){return this._valid?F7(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,u=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;s=1-u,r.r=255&u*r.r+s*i.r+.5,r.g=255&u*r.g+s*i.g+.5,r.b=255&u*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=G7(this._rgb,t._rgb,n)),this}clone(){return new la(this.rgb)}alpha(t){return this._rgb.a=Kr(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Ua(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 ul(this._rgb,2,t),this}darken(t){return ul(this._rgb,2,-t),this}saturate(t){return ul(this._rgb,1,t),this}desaturate(t){return ul(this._rgb,1,-t),this}rotate(t){return N7(this._rgb,t),this}}/*!
55
+ */function Wa(e){return e+.5|0}const Gr=(e,t,n)=>Math.max(Math.min(e,n),t);function Do(e){return Gr(Wa(e*2.55),0,255)}function Yr(e){return Gr(Wa(e*255),0,255)}function cr(e){return Gr(Wa(e/2.55)/100,0,1)}function pg(e){return Gr(Wa(e*100),0,100)}const gn={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},Nd=[..."0123456789ABCDEF"],T7=e=>Nd[e&15],P7=e=>Nd[(e&240)>>4]+Nd[e&15],dl=e=>(e&240)>>4===(e&15),j7=e=>dl(e.r)&&dl(e.g)&&dl(e.b)&&dl(e.a);function M7(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&gn[e[1]]*17,g:255&gn[e[2]]*17,b:255&gn[e[3]]*17,a:t===5?gn[e[4]]*17:255}:(t===7||t===9)&&(n={r:gn[e[1]]<<4|gn[e[2]],g:gn[e[3]]<<4|gn[e[4]],b:gn[e[5]]<<4|gn[e[6]],a:t===9?gn[e[7]]<<4|gn[e[8]]:255})),n}const $7=(e,t)=>e<255?t(e):"";function L7(e){var t=j7(e)?T7:P7;return e?"#"+t(e.r)+t(e.g)+t(e.b)+$7(e.a,t):void 0}const D7=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function P2(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 I7(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 R7(e,t,n){const r=P2(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 N7(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 Rf(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,u,c;return s!==o&&(c=s-o,u=a>.5?c/(2-s-o):c/(s+o),l=N7(n,r,i,c,s),l=l*60+.5),[l|0,u||0,a]}function Nf(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(Yr)}function Ff(e,t,n){return Nf(P2,e,t,n)}function F7(e,t,n){return Nf(R7,e,t,n)}function B7(e,t,n){return Nf(I7,e,t,n)}function j2(e){return(e%360+360)%360}function q7(e){const t=D7.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?Do(+t[5]):Yr(+t[5]));const i=j2(+t[2]),s=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?r=F7(i,s,o):t[1]==="hsv"?r=B7(i,s,o):r=Ff(i,s,o),{r:r[0],g:r[1],b:r[2],a:n}}function z7(e,t){var n=Rf(e);n[0]=j2(n[0]+t),n=Ff(n),e.r=n[0],e.g=n[1],e.b=n[2]}function H7(e){if(!e)return;const t=Rf(e),n=t[0],r=pg(t[1]),i=pg(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${i}%, ${cr(e.a)})`:`hsl(${n}, ${r}%, ${i}%)`}const vg={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"},bg={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 U7(){const e={},t=Object.keys(bg),n=Object.keys(vg);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,vg[s]);s=parseInt(bg[o],16),e[a]=[s>>16&255,s>>8&255,s&255]}return e}let fl;function G7(e){fl||(fl=U7(),fl.transparent=[0,0,0,0]);const t=fl[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const K7=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function V7(e){const t=K7.exec(e);let n=255,r,i,s;if(t){if(t[7]!==r){const o=+t[7];n=t[8]?Do(o):Gr(o*255,0,255)}return r=+t[1],i=+t[3],s=+t[5],r=255&(t[2]?Do(r):Gr(r,0,255)),i=255&(t[4]?Do(i):Gr(i,0,255)),s=255&(t[6]?Do(s):Gr(s,0,255)),{r,g:i,b:s,a:n}}}function W7(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${cr(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const $c=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,ns=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function Q7(e,t,n){const r=ns(cr(e.r)),i=ns(cr(e.g)),s=ns(cr(e.b));return{r:Yr($c(r+n*(ns(cr(t.r))-r))),g:Yr($c(i+n*(ns(cr(t.g))-i))),b:Yr($c(s+n*(ns(cr(t.b))-s))),a:e.a+n*(t.a-e.a)}}function hl(e,t,n){if(e){let r=Rf(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=Ff(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function M2(e,t){return e&&Object.assign(t||{},e)}function xg(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=Yr(e[3]))):(t=M2(e,{r:0,g:0,b:0,a:1}),t.a=Yr(t.a)),t}function Y7(e){return e.charAt(0)==="r"?V7(e):q7(e)}class fa{constructor(t){if(t instanceof fa)return t;const n=typeof t;let r;n==="object"?r=xg(t):n==="string"&&(r=M7(t)||G7(t)||Y7(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=M2(this._rgb);return t&&(t.a=cr(t.a)),t}set rgb(t){this._rgb=xg(t)}rgbString(){return this._valid?W7(this._rgb):void 0}hexString(){return this._valid?L7(this._rgb):void 0}hslString(){return this._valid?H7(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,u=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;s=1-u,r.r=255&u*r.r+s*i.r+.5,r.g=255&u*r.g+s*i.g+.5,r.b=255&u*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=Q7(this._rgb,t._rgb,n)),this}clone(){return new fa(this.rgb)}alpha(t){return this._rgb.a=Yr(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Wa(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 hl(this._rgb,2,t),this}darken(t){return hl(this._rgb,2,-t),this}saturate(t){return hl(this._rgb,1,t),this}desaturate(t){return hl(this._rgb,1,-t),this}rotate(t){return z7(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 rr(){}const K7=(()=>{let e=0;return()=>e++})();function Ye(e){return e==null}function ot(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 Ie(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function bt(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function zn(e,t){return bt(e)?e:t}function Le(e,t){return typeof e=="undefined"?t:e}const W7=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function et(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(ot(e))for(s=e.length,i=0;i<s;i++)t.call(n,e[i],i);else if(Ie(e))for(o=Object.keys(e),s=o.length,i=0;i<s;i++)t.call(n,e[o[i]],o[i])}function nu(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 ru(e){if(ot(e))return e.map(ru);if(Ie(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let i=0;for(;i<r;++i)t[n[i]]=ru(e[n[i]]);return t}return e}function T2(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function Q7(e,t,n,r){if(!T2(e))return;const i=t[e],s=n[e];Ie(i)&&Ie(s)?ua(i,s,r):t[e]=ru(s)}function ua(e,t,n){const r=ot(t)?t:[t],i=r.length;if(!Ie(e))return e;n=n||{};const s=n.merger||Q7;let o;for(let a=0;a<i;++a){if(o=r[a],!Ie(o))continue;const l=Object.keys(o);for(let u=0,c=l.length;u<c;++u)s(l[u],e,o,n)}return e}function zo(e,t){return ua(e,t,{merger:Y7})}function Y7(e,t,n){if(!T2(e))return;const r=t[e],i=n[e];Ie(r)&&Ie(i)?zo(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=ru(i))}const bg={"":e=>e,x:e=>e.x,y:e=>e.y};function X7(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 Z7(e){const t=X7(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function ca(e,t){return(bg[t]||(bg[t]=Z7(t)))(e)}function Nf(e){return e.charAt(0).toUpperCase()+e.slice(1)}const iu=e=>typeof e!="undefined",Xr=e=>typeof e=="function",xg=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function J7(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const ht=Math.PI,ln=2*ht,e9=ln+ht,su=Number.POSITIVE_INFINITY,t9=ht/180,an=ht/2,oi=ht/4,wg=ht*2/3,P2=Math.log10,Hs=Math.sign;function Ho(e,t,n){return Math.abs(e-t)<n}function Sg(e){const t=Math.round(e);e=Ho(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(P2(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function n9(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 r9(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function da(e){return!r9(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function i9(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function s9(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 Hr(e){return e*(ht/180)}function Ff(e){return e*(180/ht)}function Cg(e){if(!bt(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function o9(e,t){const n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);let s=Math.atan2(r,n);return s<-.5*ht&&(s+=ln),{angle:s,distance:i}}function Rd(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function a9(e,t){return(e-t+e9)%ln-ht}function rn(e){return(e%ln+ln)%ln}function j2(e,t,n,r){const i=rn(e),s=rn(t),o=rn(n),a=rn(s-i),l=rn(o-i),u=rn(i-s),c=rn(i-o);return i===s||i===o||r&&s===o||a>l&&u<c}function bn(e,t,n){return Math.max(t,Math.min(n,e))}function l9(e){return bn(e,-32768,32767)}function as(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function Bf(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 bi=(e,t,n,r)=>Bf(e,n,r?i=>{const s=e[i][t];return s<n||s===n&&e[i+1][t]===n}:i=>e[i][t]<n),u9=(e,t,n)=>Bf(e,n,r=>e[r][t]>=n);function c9(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 M2=["push","pop","shift","splice","unshift"];function d9(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),M2.forEach(n=>{const r="_onData"+Nf(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 _g(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)&&(M2.forEach(s=>{delete e[s]}),delete e._chartjs)}function f9(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const $2=function(){return typeof window=="undefined"?function(e){return e()}:window.requestAnimationFrame}();function L2(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,$2.call(window,()=>{r=!1,e.apply(t,n)}))}}function h9(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const qf=e=>e==="start"?"left":e==="end"?"right":"center",Ot=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,g9=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function y9(e,t,n){const r=t.length;let i=0,s=r;if(e._sorted){const{iScale:o,vScale:a,_parsed:l}=e,u=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,c=o.axis,{min:d,max:f,minDefined:h,maxDefined:g}=o.getUserBounds();if(h){if(i=Math.min(bi(l,c,d).lo,n?r:bi(t,c,o.getPixelForValue(d)).lo),u){const m=l.slice(0,i+1).reverse().findIndex(p=>!Ye(p[a.axis]));i-=Math.max(0,m)}i=bn(i,0,r-1)}if(g){let m=Math.max(bi(l,o.axis,f,!0).hi+1,n?0:bi(t,c,o.getPixelForValue(f),!0).hi+1);if(u){const p=l.slice(m-1).findIndex(v=>!Ye(v[a.axis]));m+=Math.max(0,p)}s=bn(m,i,r)-i}else s=r-i}return{start:i,count:s}}function m9(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 cl=e=>e===0||e===1,kg=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*ln/n)),Og=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*ln/n)+1,Uo={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*an)+1,easeOutSine:e=>Math.sin(e*an),easeInOutSine:e=>-.5*(Math.cos(ht*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>cl(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=>cl(e)?e:kg(e,.075,.3),easeOutElastic:e=>cl(e)?e:Og(e,.075,.3),easeInOutElastic(e){return cl(e)?e:e<.5?.5*kg(e*2,.1125,.45):.5+.5*Og(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Uo.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Uo.easeInBounce(e*2)*.5:Uo.easeOutBounce(e*2-1)*.5+.5};function zf(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Eg(e){return zf(e)?e:new la(e)}function jc(e){return zf(e)?e:new la(e).saturate(.5).darken(.1).hexString()}const p9=["x","y","borderWidth","radius","tension"],v9=["color","borderColor","backgroundColor"];function b9(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:v9},numbers:{type:"number",properties:p9}}),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 x9(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Ag=new Map;function w9(e,t){t=t||{};const n=e+JSON.stringify(t);let r=Ag.get(n);return r||(r=new Intl.NumberFormat(e,t),Ag.set(n,r)),r}function D2(e,t,n){return w9(t,n).format(e)}const S9={values(e){return ot(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 u=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(u<1e-4||u>1e15)&&(i="scientific"),s=C9(e,n)}const o=P2(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),D2(e,r,l)}};function C9(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 Hf={formatters:S9};function _9(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:Hf.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 Ni=Object.create(null),Nd=Object.create(null);function Go(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 Mc(e,t,n){return typeof t=="string"?ua(Go(e,t),n):ua(Go(e,""),t)}class k9{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)=>jc(i.backgroundColor),this.hoverBorderColor=(r,i)=>jc(i.borderColor),this.hoverColor=(r,i)=>jc(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 Mc(this,t,n)}get(t){return Go(this,t)}describe(t,n){return Mc(Nd,t,n)}override(t,n){return Mc(Ni,t,n)}route(t,n,r,i){const s=Go(this,t),o=Go(this,r),a="_"+n;Object.defineProperties(s,{[a]:{value:s[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],u=o[i];return Ie(l)?Object.assign({},u,l):Le(l,u)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var ct=new k9({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[b9,x9,_9]);function O9(e){return!e||Ye(e.size)||Ye(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function ou(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 E9(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,u,c,d,f;for(l=0;l<a;l++)if(d=n[l],d!=null&&!ot(d))o=ou(e,i,s,o,d);else if(ot(d))for(u=0,c=d.length;u<c;u++)f=d[u],f!=null&&!ot(f)&&(o=ou(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 ai(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 Tg(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Fd(e,t,n,r){I2(e,t,n,r,null)}function I2(e,t,n,r,i){let s,o,a,l,u,c,d,f;const h=t.pointStyle,g=t.rotation,m=t.radius;let p=(g||0)*t9;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,ln):e.arc(n,r,m,0,ln),e.closePath();break;case"triangle":c=i?i/2:m,e.moveTo(n+Math.sin(p)*c,r-Math.cos(p)*m),p+=wg,e.lineTo(n+Math.sin(p)*c,r-Math.cos(p)*m),p+=wg,e.lineTo(n+Math.sin(p)*c,r-Math.cos(p)*m),e.closePath();break;case"rectRounded":u=m*.516,l=m-u,o=Math.cos(p+oi)*l,d=Math.cos(p+oi)*(i?i/2-u:l),a=Math.sin(p+oi)*l,f=Math.sin(p+oi)*(i?i/2-u:l),e.arc(n-d,r-a,u,p-ht,p-an),e.arc(n+f,r-o,u,p-an,p),e.arc(n+d,r+a,u,p,p+an),e.arc(n-f,r+o,u,p+an,p+ht),e.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*m,c=i?i/2:l,e.rect(n-c,r-l,2*c,2*l);break}p+=oi;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+=oi;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+=oi,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 hr(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 zu(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Hu(e){e.restore()}function A9(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 T9(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 P9(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 j9(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,u=n+s.actualBoundingBoxDescent,c=i.strikethrough?(l+u)/2:u;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(o,c),e.lineTo(a,c),e.stroke()}}function M9(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Fi(e,t,n,r,i,s={}){const o=ot(t)?t:[t],a=s.strokeWidth>0&&s.strokeColor!=="";let l,u;for(e.save(),e.font=i.string,P9(e,s),l=0;l<o.length;++l)u=o[l],s.backdrop&&M9(e,s.backdrop),a&&(s.strokeColor&&(e.strokeStyle=s.strokeColor),Ye(s.strokeWidth)||(e.lineWidth=s.strokeWidth),e.strokeText(u,n,r,s.maxWidth)),e.fillText(u,n,r,s.maxWidth),j9(e,n,r,u,s),r+=Number(i.lineHeight);e.restore()}function au(e,t){const{x:n,y:r,w:i,h:s,radius:o}=t;e.arc(n+o.topLeft,r+o.topLeft,o.topLeft,1.5*ht,ht,!0),e.lineTo(n,r+s-o.bottomLeft),e.arc(n+o.bottomLeft,r+s-o.bottomLeft,o.bottomLeft,ht,an,!0),e.lineTo(n+i-o.bottomRight,r+s),e.arc(n+i-o.bottomRight,r+s-o.bottomRight,o.bottomRight,an,0,!0),e.lineTo(n+i,r+o.topRight),e.arc(n+i-o.topRight,r+o.topRight,o.topRight,0,-an,!0),e.lineTo(n+o.topLeft,r)}const $9=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,L9=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function D9(e,t){const n=(""+e).match($9);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 I9=e=>+e||0;function R2(e,t){const n={},r=Ie(t),i=r?Object.keys(t):t,s=Ie(e)?r?o=>Le(e[o],e[t[o]]):o=>e[o]:()=>e;for(const o of i)n[o]=I9(s(o));return n}function R9(e){return R2(e,{top:"y",right:"x",bottom:"y",left:"x"})}function ls(e){return R2(e,["topLeft","topRight","bottomLeft","bottomRight"])}function jt(e){const t=R9(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function mt(e,t){e=e||{},t=t||ct.font;let n=Le(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=Le(e.style,t.style);r&&!(""+r).match(L9)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:Le(e.family,t.family),lineHeight:D9(Le(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:Le(e.weight,t.weight),string:""};return i.string=O9(i),i}function dl(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 N9(e,t,n){const{min:r,max:i}=e,s=W7(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 ii(e,t){return Object.assign(Object.create(e),t)}function Uf(e,t=[""],n,r,i=()=>e[0]){const s=n||e;typeof r=="undefined"&&(r=q2("_fallback",e));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:s,_fallback:r,_getTarget:i,override:a=>Uf([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 F2(a,l,()=>V9(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return jg(a).includes(l)},ownKeys(a){return jg(a)},set(a,l,u){const c=a._storage||(a._storage=i());return a[l]=c[l]=u,delete a._keys,!0}})}function Us(e,t,n,r){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:N2(e,r),setContext:s=>Us(e,s,n,r),override:s=>Us(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 F2(s,o,()=>B9(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 N2(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:Xr(n)?n:()=>n,isIndexable:Xr(r)?r:()=>r}}const F9=(e,t)=>e?e+Nf(t):t,Gf=(e,t)=>Ie(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function F2(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function B9(e,t,n){const{_proxy:r,_context:i,_subProxy:s,_descriptors:o}=e;let a=r[t];return Xr(a)&&o.isScriptable(t)&&(a=q9(t,a,e,n)),ot(a)&&a.length&&(a=z9(t,a,e,o.isIndexable)),Gf(t,a)&&(a=Us(a,i,s&&s[t],o)),a}function q9(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),Gf(e,l)&&(l=Vf(i._scopes,i,e,l)),l}function z9(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(Ie(t[0])){const l=t,u=i._scopes.filter(c=>c!==l);t=[];for(const c of l){const d=Vf(u,i,e,c);t.push(Us(d,s,o&&o[e],a))}}return t}function B2(e,t,n){return Xr(e)?e(t,n):e}const H9=(e,t)=>e===!0?t:typeof e=="string"?ca(t,e):void 0;function U9(e,t,n,r,i){for(const s of t){const o=H9(n,s);if(o){e.add(o);const a=B2(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 Vf(e,t,n,r){const i=t._rootScopes,s=B2(t._fallback,n,r),o=[...e,...i],a=new Set;a.add(r);let l=Pg(a,o,n,s||n,r);return l===null||typeof s!="undefined"&&s!==n&&(l=Pg(a,o,s,l,r),l===null)?!1:Uf(Array.from(a),[""],i,s,()=>G9(t,n,r))}function Pg(e,t,n,r,i){for(;n;)n=U9(e,t,n,r,i);return n}function G9(e,t,n){const r=e._getTarget();t in r||(r[t]={});const i=r[t];return ot(i)&&Ie(n)?n:i||{}}function V9(e,t,n,r){let i;for(const s of t)if(i=q2(F9(s,e),n),typeof i!="undefined")return Gf(e,i)?Vf(n,r,e,i):i}function q2(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r!="undefined")return r}}function jg(e){let t=e._keys;return t||(t=e._keys=K9(e._scopes)),t}function K9(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 W9(e,t,n,r){const{iScale:i}=e,{key:s="r"}=this._parsing,o=new Array(r);let a,l,u,c;for(a=0,l=r;a<l;++a)u=a+n,c=t[u],o[a]={r:i.parse(ca(c,s),u)};return o}const Q9=Number.EPSILON||1e-14,Gs=(e,t)=>t<e.length&&!e[t].skip&&e[t],z2=e=>e==="x"?"y":"x";function Y9(e,t,n,r){const i=e.skip?t:e,s=t,o=n.skip?t:n,a=Rd(s,i),l=Rd(o,s);let u=a/(a+l),c=l/(a+l);u=isNaN(u)?0:u,c=isNaN(c)?0:c;const d=r*u,f=r*c;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 X9(e,t,n){const r=e.length;let i,s,o,a,l,u=Gs(e,0);for(let c=0;c<r-1;++c)if(l=u,u=Gs(e,c+1),!(!l||!u)){if(Ho(t[c],0,Q9)){n[c]=n[c+1]=0;continue}i=n[c]/t[c],s=n[c+1]/t[c],a=Math.pow(i,2)+Math.pow(s,2),!(a<=9)&&(o=3/Math.sqrt(a),n[c]=i*o*t[c],n[c+1]=s*o*t[c])}}function Z9(e,t,n="x"){const r=z2(n),i=e.length;let s,o,a,l=Gs(e,0);for(let u=0;u<i;++u){if(o=a,a=l,l=Gs(e,u+1),!a)continue;const c=a[n],d=a[r];o&&(s=(c-o[n])/3,a[`cp1${n}`]=c-s,a[`cp1${r}`]=d-s*t[u]),l&&(s=(l[n]-c)/3,a[`cp2${n}`]=c+s,a[`cp2${r}`]=d+s*t[u])}}function J9(e,t="x"){const n=z2(t),r=e.length,i=Array(r).fill(0),s=Array(r);let o,a,l,u=Gs(e,0);for(o=0;o<r;++o)if(a=l,l=u,u=Gs(e,o+1),!!l){if(u){const c=u[t]-l[t];i[o]=c!==0?(u[n]-l[n])/c:0}s[o]=a?u?Hs(i[o-1])!==Hs(i[o])?0:(i[o-1]+i[o])/2:i[o-1]:i[o]}X9(e,i,s),Z9(e,s,t)}function fl(e,t,n){return Math.max(Math.min(e,n),t)}function ek(e,t){let n,r,i,s,o,a=hr(e[0],t);for(n=0,r=e.length;n<r;++n)o=s,s=a,a=n<r-1&&hr(e[n+1],t),s&&(i=e[n],o&&(i.cp1x=fl(i.cp1x,t.left,t.right),i.cp1y=fl(i.cp1y,t.top,t.bottom)),a&&(i.cp2x=fl(i.cp2x,t.left,t.right),i.cp2y=fl(i.cp2y,t.top,t.bottom)))}function tk(e,t,n,r,i){let s,o,a,l;if(t.spanGaps&&(e=e.filter(u=>!u.skip)),t.cubicInterpolationMode==="monotone")J9(e,i);else{let u=r?e[e.length-1]:e[0];for(s=0,o=e.length;s<o;++s)a=e[s],l=Y9(u,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,u=a}t.capBezierPoints&&ek(e,n)}function Kf(){return typeof window!="undefined"&&typeof document!="undefined"}function Wf(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function lu(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 Uu=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function nk(e,t){return Uu(e).getPropertyValue(t)}const rk=["top","right","bottom","left"];function $i(e,t,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const s=rk[i];r[s]=parseFloat(e[t+"-"+s+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const ik=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function sk(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:s}=r;let o=!1,a,l;if(ik(i,s,e.target))a=i,l=s;else{const u=t.getBoundingClientRect();a=r.clientX-u.left,l=r.clientY-u.top,o=!0}return{x:a,y:l,box:o}}function hi(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,i=Uu(n),s=i.boxSizing==="border-box",o=$i(i,"padding"),a=$i(i,"border","width"),{x:l,y:u,box:c}=sk(e,n),d=o.left+(c&&a.left),f=o.top+(c&&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((u-f)/g*n.height/r)}}function ok(e,t,n){let r,i;if(t===void 0||n===void 0){const s=e&&Wf(e);if(!s)t=e.clientWidth,n=e.clientHeight;else{const o=s.getBoundingClientRect(),a=Uu(s),l=$i(a,"border","width"),u=$i(a,"padding");t=o.width-u.width-l.width,n=o.height-u.height-l.height,r=lu(a.maxWidth,s,"clientWidth"),i=lu(a.maxHeight,s,"clientHeight")}}return{width:t,height:n,maxWidth:r||su,maxHeight:i||su}}const hl=e=>Math.round(e*10)/10;function ak(e,t,n,r){const i=Uu(e),s=$i(i,"margin"),o=lu(i.maxWidth,e,"clientWidth")||su,a=lu(i.maxHeight,e,"clientHeight")||su,l=ok(e,t,n);let{width:u,height:c}=l;if(i.boxSizing==="content-box"){const f=$i(i,"border","width"),h=$i(i,"padding");u-=h.width+f.width,c-=h.height+f.height}return u=Math.max(0,u-s.width),c=Math.max(0,r?u/r:c-s.height),u=hl(Math.min(u,o,l.maxWidth)),c=hl(Math.min(c,a,l.maxHeight)),u&&!c&&(c=hl(u/2)),(t!==void 0||n!==void 0)&&r&&l.height&&c>l.height&&(c=l.height,u=hl(Math.floor(c*r))),{width:u,height:c}}function Mg(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 lk=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};Kf()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch(t){}return e}();function $g(e,t){const n=nk(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function gi(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function uk(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 ck(e,t,n,r){const i={x:e.cp2x,y:e.cp2y},s={x:t.cp1x,y:t.cp1y},o=gi(e,i,n),a=gi(i,s,n),l=gi(s,t,n),u=gi(o,a,n),c=gi(a,l,n);return gi(u,c,n)}const dk=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}}},fk=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function us(e,t,n){return e?dk(t,n):fk()}function H2(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 U2(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function G2(e){return e==="angle"?{between:j2,compare:a9,normalize:rn}:{between:as,compare:(t,n)=>t-n,normalize:t=>t}}function Lg({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 hk(e,t,n){const{property:r,start:i,end:s}=n,{between:o,normalize:a}=G2(r),l=t.length;let{start:u,end:c,loop:d}=e,f,h;if(d){for(u+=l,c+=l,f=0,h=l;f<h&&o(a(t[u%l][r]),i,s);++f)u--,c--;u%=l,c%=l}return c<u&&(c+=l),{start:u,end:c,loop:d,style:e.style}}function V2(e,t,n){if(!n)return[e];const{property:r,start:i,end:s}=n,o=t.length,{compare:a,between:l,normalize:u}=G2(r),{start:c,end:d,loop:f,style:h}=hk(e,t,n),g=[];let m=!1,p=null,v,b,S;const C=()=>l(i,S,v)&&a(i,S)!==0,w=()=>a(s,v)===0||l(s,S,v),O=()=>m||C(),x=()=>!m||w();for(let _=c,k=c;_<=d;++_)b=t[_%o],!b.skip&&(v=u(b[r]),v!==S&&(m=l(v,i,s),p===null&&O()&&(p=a(v,i)===0?_:k),p!==null&&x()&&(g.push(Lg({start:p,end:_,loop:f,count:o,style:h})),p=null),k=_,S=v));return p!==null&&g.push(Lg({start:p,end:d,loop:f,count:o,style:h})),g}function K2(e,t){const n=[],r=e.segments;for(let i=0;i<r.length;i++){const s=V2(r[i],e.points,t);s.length&&n.push(...s)}return n}function gk(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 yk(e,t,n,r){const i=e.length,s=[];let o=t,a=e[t],l;for(l=t+1;l<=n;++l){const u=e[l%i];u.skip||u.stop?a.skip||(r=!1,s.push({start:t%i,end:(l-1)%i,loop:r}),t=o=u.stop?l:null):(o=l,a.skip&&(t=l)),a=u}return o!==null&&s.push({start:t%i,end:o%i,loop:r}),s}function mk(e,t){const n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];const s=!!e._loop,{start:o,end:a}=gk(n,i,s,r);if(r===!0)return Dg(e,[{start:o,end:a,loop:s}],n,t);const l=a<o?a+i:a,u=!!e._fullLoop&&o===0&&a===i-1;return Dg(e,yk(n,o,l,u),n,t)}function Dg(e,t,n,r){return!r||!r.setContext||!n?t:pk(e,t,n,r)}function pk(e,t,n,r){const i=e._chart.getContext(),s=Ig(e.options),{_datasetIndex:o,options:{spanGaps:a}}=e,l=n.length,u=[];let c=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&&(u.push({start:g%l,end:m%l,loop:p,style:v}),c=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=Ig(r.setContext(ii(i,{type:"segment",p0:m,p1:v,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:o}))),vk(p,c)&&h(d,f-1,g.loop,c),m=v,c=p}d<f-1&&h(d,f-1,g.loop,c)}return u}function Ig(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function vk(e,t){if(!t)return!1;const n=[],r=function(i,s){return zf(s)?(n.includes(s)||n.push(s),n.indexOf(s)):s};return JSON.stringify(e,r)!==JSON.stringify(t,r)}function gl(e,t,n){return e.options.clip?e[n]:t[n]}function bk(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:gl(n,t,"left"),right:gl(n,t,"right"),top:gl(r,t,"top"),bottom:gl(r,t,"bottom")}:t}function W2(e,t){const n=t._clip;if(n.disabled)return!1;const r=bk(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 sr(){}const X7=(()=>{let e=0;return()=>e++})();function Ye(e){return e==null}function ot(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 Ie(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function bt(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Hn(e,t){return bt(e)?e:t}function Le(e,t){return typeof e=="undefined"?t:e}const Z7=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function et(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(ot(e))for(s=e.length,i=0;i<s;i++)t.call(n,e[i],i);else if(Ie(e))for(o=Object.keys(e),s=o.length,i=0;i<s;i++)t.call(n,e[o[i]],o[i])}function su(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 ou(e){if(ot(e))return e.map(ou);if(Ie(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let i=0;for(;i<r;++i)t[n[i]]=ou(e[n[i]]);return t}return e}function $2(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function J7(e,t,n,r){if(!$2(e))return;const i=t[e],s=n[e];Ie(i)&&Ie(s)?ha(i,s,r):t[e]=ou(s)}function ha(e,t,n){const r=ot(t)?t:[t],i=r.length;if(!Ie(e))return e;n=n||{};const s=n.merger||J7;let o;for(let a=0;a<i;++a){if(o=r[a],!Ie(o))continue;const l=Object.keys(o);for(let u=0,c=l.length;u<c;++u)s(l[u],e,o,n)}return e}function Ko(e,t){return ha(e,t,{merger:e9})}function e9(e,t,n){if(!$2(e))return;const r=t[e],i=n[e];Ie(r)&&Ie(i)?Ko(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=ou(i))}const wg={"":e=>e,x:e=>e.x,y:e=>e.y};function t9(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 n9(e){const t=t9(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function ga(e,t){return(wg[t]||(wg[t]=n9(t)))(e)}function Bf(e){return e.charAt(0).toUpperCase()+e.slice(1)}const au=e=>typeof e!="undefined",ei=e=>typeof e=="function",Sg=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function r9(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const ht=Math.PI,un=2*ht,i9=un+ht,lu=Number.POSITIVE_INFINITY,s9=ht/180,ln=ht/2,ui=ht/4,Cg=ht*2/3,L2=Math.log10,Ks=Math.sign;function Vo(e,t,n){return Math.abs(e-t)<n}function _g(e){const t=Math.round(e);e=Vo(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(L2(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function o9(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 a9(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function ya(e){return!a9(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function l9(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function u9(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 Kr(e){return e*(ht/180)}function qf(e){return e*(180/ht)}function kg(e){if(!bt(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function c9(e,t){const n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);let s=Math.atan2(r,n);return s<-.5*ht&&(s+=un),{angle:s,distance:i}}function Fd(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function d9(e,t){return(e-t+i9)%un-ht}function sn(e){return(e%un+un)%un}function D2(e,t,n,r){const i=sn(e),s=sn(t),o=sn(n),a=sn(s-i),l=sn(o-i),u=sn(i-s),c=sn(i-o);return i===s||i===o||r&&s===o||a>l&&u<c}function xn(e,t,n){return Math.max(t,Math.min(n,e))}function f9(e){return xn(e,-32768,32767)}function cs(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function zf(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 Si=(e,t,n,r)=>zf(e,n,r?i=>{const s=e[i][t];return s<n||s===n&&e[i+1][t]===n}:i=>e[i][t]<n),h9=(e,t,n)=>zf(e,n,r=>e[r][t]>=n);function g9(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 I2=["push","pop","shift","splice","unshift"];function y9(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),I2.forEach(n=>{const r="_onData"+Bf(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 Og(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)&&(I2.forEach(s=>{delete e[s]}),delete e._chartjs)}function m9(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const R2=function(){return typeof window=="undefined"?function(e){return e()}:window.requestAnimationFrame}();function N2(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,R2.call(window,()=>{r=!1,e.apply(t,n)}))}}function p9(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const Hf=e=>e==="start"?"left":e==="end"?"right":"center",Ot=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,v9=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function b9(e,t,n){const r=t.length;let i=0,s=r;if(e._sorted){const{iScale:o,vScale:a,_parsed:l}=e,u=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,c=o.axis,{min:d,max:f,minDefined:h,maxDefined:g}=o.getUserBounds();if(h){if(i=Math.min(Si(l,c,d).lo,n?r:Si(t,c,o.getPixelForValue(d)).lo),u){const m=l.slice(0,i+1).reverse().findIndex(p=>!Ye(p[a.axis]));i-=Math.max(0,m)}i=xn(i,0,r-1)}if(g){let m=Math.max(Si(l,o.axis,f,!0).hi+1,n?0:Si(t,c,o.getPixelForValue(f),!0).hi+1);if(u){const p=l.slice(m-1).findIndex(v=>!Ye(v[a.axis]));m+=Math.max(0,p)}s=xn(m,i,r)-i}else s=r-i}return{start:i,count:s}}function x9(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 gl=e=>e===0||e===1,Eg=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*un/n)),Ag=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*un/n)+1,Wo={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*ln)+1,easeOutSine:e=>Math.sin(e*ln),easeInOutSine:e=>-.5*(Math.cos(ht*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>gl(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=>gl(e)?e:Eg(e,.075,.3),easeOutElastic:e=>gl(e)?e:Ag(e,.075,.3),easeInOutElastic(e){return gl(e)?e:e<.5?.5*Eg(e*2,.1125,.45):.5+.5*Ag(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-Wo.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?Wo.easeInBounce(e*2)*.5:Wo.easeOutBounce(e*2-1)*.5+.5};function Uf(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Tg(e){return Uf(e)?e:new fa(e)}function Lc(e){return Uf(e)?e:new fa(e).saturate(.5).darken(.1).hexString()}const w9=["x","y","borderWidth","radius","tension"],S9=["color","borderColor","backgroundColor"];function C9(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:S9},numbers:{type:"number",properties:w9}}),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 _9(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Pg=new Map;function k9(e,t){t=t||{};const n=e+JSON.stringify(t);let r=Pg.get(n);return r||(r=new Intl.NumberFormat(e,t),Pg.set(n,r)),r}function F2(e,t,n){return k9(t,n).format(e)}const O9={values(e){return ot(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 u=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(u<1e-4||u>1e15)&&(i="scientific"),s=E9(e,n)}const o=L2(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),F2(e,r,l)}};function E9(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 Gf={formatters:O9};function A9(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:Gf.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 qi=Object.create(null),Bd=Object.create(null);function Qo(e,t){if(!t)return e;const n=t.split(".");for(let r=0,i=n.length;r<i;++r){const s=n[r];e=e[s]||(e[s]=Object.create(null))}return e}function Dc(e,t,n){return typeof t=="string"?ha(Qo(e,t),n):ha(Qo(e,""),t)}class T9{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)=>Lc(i.backgroundColor),this.hoverBorderColor=(r,i)=>Lc(i.borderColor),this.hoverColor=(r,i)=>Lc(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 Dc(this,t,n)}get(t){return Qo(this,t)}describe(t,n){return Dc(Bd,t,n)}override(t,n){return Dc(qi,t,n)}route(t,n,r,i){const s=Qo(this,t),o=Qo(this,r),a="_"+n;Object.defineProperties(s,{[a]:{value:s[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],u=o[i];return Ie(l)?Object.assign({},u,l):Le(l,u)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var ct=new T9({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[C9,_9,A9]);function P9(e){return!e||Ye(e.size)||Ye(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function uu(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 j9(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,u,c,d,f;for(l=0;l<a;l++)if(d=n[l],d!=null&&!ot(d))o=uu(e,i,s,o,d);else if(ot(d))for(u=0,c=d.length;u<c;u++)f=d[u],f!=null&&!ot(f)&&(o=uu(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 ci(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 jg(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function qd(e,t,n,r){B2(e,t,n,r,null)}function B2(e,t,n,r,i){let s,o,a,l,u,c,d,f;const h=t.pointStyle,g=t.rotation,m=t.radius;let p=(g||0)*s9;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,un):e.arc(n,r,m,0,un),e.closePath();break;case"triangle":c=i?i/2:m,e.moveTo(n+Math.sin(p)*c,r-Math.cos(p)*m),p+=Cg,e.lineTo(n+Math.sin(p)*c,r-Math.cos(p)*m),p+=Cg,e.lineTo(n+Math.sin(p)*c,r-Math.cos(p)*m),e.closePath();break;case"rectRounded":u=m*.516,l=m-u,o=Math.cos(p+ui)*l,d=Math.cos(p+ui)*(i?i/2-u:l),a=Math.sin(p+ui)*l,f=Math.sin(p+ui)*(i?i/2-u:l),e.arc(n-d,r-a,u,p-ht,p-ln),e.arc(n+f,r-o,u,p-ln,p),e.arc(n+d,r+a,u,p,p+ln),e.arc(n-f,r+o,u,p+ln,p+ht),e.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*m,c=i?i/2:l,e.rect(n-c,r-l,2*c,2*l);break}p+=ui;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+=ui;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+=ui,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 mr(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 Gu(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Ku(e){e.restore()}function M9(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 $9(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 L9(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 D9(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,u=n+s.actualBoundingBoxDescent,c=i.strikethrough?(l+u)/2:u;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(o,c),e.lineTo(a,c),e.stroke()}}function I9(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function zi(e,t,n,r,i,s={}){const o=ot(t)?t:[t],a=s.strokeWidth>0&&s.strokeColor!=="";let l,u;for(e.save(),e.font=i.string,L9(e,s),l=0;l<o.length;++l)u=o[l],s.backdrop&&I9(e,s.backdrop),a&&(s.strokeColor&&(e.strokeStyle=s.strokeColor),Ye(s.strokeWidth)||(e.lineWidth=s.strokeWidth),e.strokeText(u,n,r,s.maxWidth)),e.fillText(u,n,r,s.maxWidth),D9(e,n,r,u,s),r+=Number(i.lineHeight);e.restore()}function cu(e,t){const{x:n,y:r,w:i,h:s,radius:o}=t;e.arc(n+o.topLeft,r+o.topLeft,o.topLeft,1.5*ht,ht,!0),e.lineTo(n,r+s-o.bottomLeft),e.arc(n+o.bottomLeft,r+s-o.bottomLeft,o.bottomLeft,ht,ln,!0),e.lineTo(n+i-o.bottomRight,r+s),e.arc(n+i-o.bottomRight,r+s-o.bottomRight,o.bottomRight,ln,0,!0),e.lineTo(n+i,r+o.topRight),e.arc(n+i-o.topRight,r+o.topRight,o.topRight,0,-ln,!0),e.lineTo(n+o.topLeft,r)}const R9=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,N9=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function F9(e,t){const n=(""+e).match(R9);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 B9=e=>+e||0;function q2(e,t){const n={},r=Ie(t),i=r?Object.keys(t):t,s=Ie(e)?r?o=>Le(e[o],e[t[o]]):o=>e[o]:()=>e;for(const o of i)n[o]=B9(s(o));return n}function q9(e){return q2(e,{top:"y",right:"x",bottom:"y",left:"x"})}function ds(e){return q2(e,["topLeft","topRight","bottomLeft","bottomRight"])}function jt(e){const t=q9(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function mt(e,t){e=e||{},t=t||ct.font;let n=Le(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=Le(e.style,t.style);r&&!(""+r).match(N9)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:Le(e.family,t.family),lineHeight:F9(Le(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:Le(e.weight,t.weight),string:""};return i.string=P9(i),i}function yl(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 z9(e,t,n){const{min:r,max:i}=e,s=Z7(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 ai(e,t){return Object.assign(Object.create(e),t)}function Kf(e,t=[""],n,r,i=()=>e[0]){const s=n||e;typeof r=="undefined"&&(r=G2("_fallback",e));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:s,_fallback:r,_getTarget:i,override:a=>Kf([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 H2(a,l,()=>Y9(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return $g(a).includes(l)},ownKeys(a){return $g(a)},set(a,l,u){const c=a._storage||(a._storage=i());return a[l]=c[l]=u,delete a._keys,!0}})}function Vs(e,t,n,r){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:z2(e,r),setContext:s=>Vs(e,s,n,r),override:s=>Vs(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 H2(s,o,()=>U9(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 z2(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:ei(n)?n:()=>n,isIndexable:ei(r)?r:()=>r}}const H9=(e,t)=>e?e+Bf(t):t,Vf=(e,t)=>Ie(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function H2(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function U9(e,t,n){const{_proxy:r,_context:i,_subProxy:s,_descriptors:o}=e;let a=r[t];return ei(a)&&o.isScriptable(t)&&(a=G9(t,a,e,n)),ot(a)&&a.length&&(a=K9(t,a,e,o.isIndexable)),Vf(t,a)&&(a=Vs(a,i,s&&s[t],o)),a}function G9(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),Vf(e,l)&&(l=Wf(i._scopes,i,e,l)),l}function K9(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(Ie(t[0])){const l=t,u=i._scopes.filter(c=>c!==l);t=[];for(const c of l){const d=Wf(u,i,e,c);t.push(Vs(d,s,o&&o[e],a))}}return t}function U2(e,t,n){return ei(e)?e(t,n):e}const V9=(e,t)=>e===!0?t:typeof e=="string"?ga(t,e):void 0;function W9(e,t,n,r,i){for(const s of t){const o=V9(n,s);if(o){e.add(o);const a=U2(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 Wf(e,t,n,r){const i=t._rootScopes,s=U2(t._fallback,n,r),o=[...e,...i],a=new Set;a.add(r);let l=Mg(a,o,n,s||n,r);return l===null||typeof s!="undefined"&&s!==n&&(l=Mg(a,o,s,l,r),l===null)?!1:Kf(Array.from(a),[""],i,s,()=>Q9(t,n,r))}function Mg(e,t,n,r,i){for(;n;)n=W9(e,t,n,r,i);return n}function Q9(e,t,n){const r=e._getTarget();t in r||(r[t]={});const i=r[t];return ot(i)&&Ie(n)?n:i||{}}function Y9(e,t,n,r){let i;for(const s of t)if(i=G2(H9(s,e),n),typeof i!="undefined")return Vf(e,i)?Wf(n,r,e,i):i}function G2(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r!="undefined")return r}}function $g(e){let t=e._keys;return t||(t=e._keys=X9(e._scopes)),t}function X9(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 Z9(e,t,n,r){const{iScale:i}=e,{key:s="r"}=this._parsing,o=new Array(r);let a,l,u,c;for(a=0,l=r;a<l;++a)u=a+n,c=t[u],o[a]={r:i.parse(ga(c,s),u)};return o}const J9=Number.EPSILON||1e-14,Ws=(e,t)=>t<e.length&&!e[t].skip&&e[t],K2=e=>e==="x"?"y":"x";function ek(e,t,n,r){const i=e.skip?t:e,s=t,o=n.skip?t:n,a=Fd(s,i),l=Fd(o,s);let u=a/(a+l),c=l/(a+l);u=isNaN(u)?0:u,c=isNaN(c)?0:c;const d=r*u,f=r*c;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 tk(e,t,n){const r=e.length;let i,s,o,a,l,u=Ws(e,0);for(let c=0;c<r-1;++c)if(l=u,u=Ws(e,c+1),!(!l||!u)){if(Vo(t[c],0,J9)){n[c]=n[c+1]=0;continue}i=n[c]/t[c],s=n[c+1]/t[c],a=Math.pow(i,2)+Math.pow(s,2),!(a<=9)&&(o=3/Math.sqrt(a),n[c]=i*o*t[c],n[c+1]=s*o*t[c])}}function nk(e,t,n="x"){const r=K2(n),i=e.length;let s,o,a,l=Ws(e,0);for(let u=0;u<i;++u){if(o=a,a=l,l=Ws(e,u+1),!a)continue;const c=a[n],d=a[r];o&&(s=(c-o[n])/3,a[`cp1${n}`]=c-s,a[`cp1${r}`]=d-s*t[u]),l&&(s=(l[n]-c)/3,a[`cp2${n}`]=c+s,a[`cp2${r}`]=d+s*t[u])}}function rk(e,t="x"){const n=K2(t),r=e.length,i=Array(r).fill(0),s=Array(r);let o,a,l,u=Ws(e,0);for(o=0;o<r;++o)if(a=l,l=u,u=Ws(e,o+1),!!l){if(u){const c=u[t]-l[t];i[o]=c!==0?(u[n]-l[n])/c:0}s[o]=a?u?Ks(i[o-1])!==Ks(i[o])?0:(i[o-1]+i[o])/2:i[o-1]:i[o]}tk(e,i,s),nk(e,s,t)}function ml(e,t,n){return Math.max(Math.min(e,n),t)}function ik(e,t){let n,r,i,s,o,a=mr(e[0],t);for(n=0,r=e.length;n<r;++n)o=s,s=a,a=n<r-1&&mr(e[n+1],t),s&&(i=e[n],o&&(i.cp1x=ml(i.cp1x,t.left,t.right),i.cp1y=ml(i.cp1y,t.top,t.bottom)),a&&(i.cp2x=ml(i.cp2x,t.left,t.right),i.cp2y=ml(i.cp2y,t.top,t.bottom)))}function sk(e,t,n,r,i){let s,o,a,l;if(t.spanGaps&&(e=e.filter(u=>!u.skip)),t.cubicInterpolationMode==="monotone")rk(e,i);else{let u=r?e[e.length-1]:e[0];for(s=0,o=e.length;s<o;++s)a=e[s],l=ek(u,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,u=a}t.capBezierPoints&&ik(e,n)}function Qf(){return typeof window!="undefined"&&typeof document!="undefined"}function Yf(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function du(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 Vu=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function ok(e,t){return Vu(e).getPropertyValue(t)}const ak=["top","right","bottom","left"];function Ii(e,t,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const s=ak[i];r[s]=parseFloat(e[t+"-"+s+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const lk=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function uk(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:s}=r;let o=!1,a,l;if(lk(i,s,e.target))a=i,l=s;else{const u=t.getBoundingClientRect();a=r.clientX-u.left,l=r.clientY-u.top,o=!0}return{x:a,y:l,box:o}}function mi(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,i=Vu(n),s=i.boxSizing==="border-box",o=Ii(i,"padding"),a=Ii(i,"border","width"),{x:l,y:u,box:c}=uk(e,n),d=o.left+(c&&a.left),f=o.top+(c&&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((u-f)/g*n.height/r)}}function ck(e,t,n){let r,i;if(t===void 0||n===void 0){const s=e&&Yf(e);if(!s)t=e.clientWidth,n=e.clientHeight;else{const o=s.getBoundingClientRect(),a=Vu(s),l=Ii(a,"border","width"),u=Ii(a,"padding");t=o.width-u.width-l.width,n=o.height-u.height-l.height,r=du(a.maxWidth,s,"clientWidth"),i=du(a.maxHeight,s,"clientHeight")}}return{width:t,height:n,maxWidth:r||lu,maxHeight:i||lu}}const pl=e=>Math.round(e*10)/10;function dk(e,t,n,r){const i=Vu(e),s=Ii(i,"margin"),o=du(i.maxWidth,e,"clientWidth")||lu,a=du(i.maxHeight,e,"clientHeight")||lu,l=ck(e,t,n);let{width:u,height:c}=l;if(i.boxSizing==="content-box"){const f=Ii(i,"border","width"),h=Ii(i,"padding");u-=h.width+f.width,c-=h.height+f.height}return u=Math.max(0,u-s.width),c=Math.max(0,r?u/r:c-s.height),u=pl(Math.min(u,o,l.maxWidth)),c=pl(Math.min(c,a,l.maxHeight)),u&&!c&&(c=pl(u/2)),(t!==void 0||n!==void 0)&&r&&l.height&&c>l.height&&(c=l.height,u=pl(Math.floor(c*r))),{width:u,height:c}}function Lg(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 fk=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};Qf()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch(t){}return e}();function Dg(e,t){const n=ok(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function pi(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function hk(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 gk(e,t,n,r){const i={x:e.cp2x,y:e.cp2y},s={x:t.cp1x,y:t.cp1y},o=pi(e,i,n),a=pi(i,s,n),l=pi(s,t,n),u=pi(o,a,n),c=pi(a,l,n);return pi(u,c,n)}const yk=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}}},mk=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function fs(e,t,n){return e?yk(t,n):mk()}function V2(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 W2(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function Q2(e){return e==="angle"?{between:D2,compare:d9,normalize:sn}:{between:cs,compare:(t,n)=>t-n,normalize:t=>t}}function Ig({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 pk(e,t,n){const{property:r,start:i,end:s}=n,{between:o,normalize:a}=Q2(r),l=t.length;let{start:u,end:c,loop:d}=e,f,h;if(d){for(u+=l,c+=l,f=0,h=l;f<h&&o(a(t[u%l][r]),i,s);++f)u--,c--;u%=l,c%=l}return c<u&&(c+=l),{start:u,end:c,loop:d,style:e.style}}function Y2(e,t,n){if(!n)return[e];const{property:r,start:i,end:s}=n,o=t.length,{compare:a,between:l,normalize:u}=Q2(r),{start:c,end:d,loop:f,style:h}=pk(e,t,n),g=[];let m=!1,p=null,v,b,S;const C=()=>l(i,S,v)&&a(i,S)!==0,w=()=>a(s,v)===0||l(s,S,v),O=()=>m||C(),x=()=>!m||w();for(let _=c,k=c;_<=d;++_)b=t[_%o],!b.skip&&(v=u(b[r]),v!==S&&(m=l(v,i,s),p===null&&O()&&(p=a(v,i)===0?_:k),p!==null&&x()&&(g.push(Ig({start:p,end:_,loop:f,count:o,style:h})),p=null),k=_,S=v));return p!==null&&g.push(Ig({start:p,end:d,loop:f,count:o,style:h})),g}function X2(e,t){const n=[],r=e.segments;for(let i=0;i<r.length;i++){const s=Y2(r[i],e.points,t);s.length&&n.push(...s)}return n}function vk(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 bk(e,t,n,r){const i=e.length,s=[];let o=t,a=e[t],l;for(l=t+1;l<=n;++l){const u=e[l%i];u.skip||u.stop?a.skip||(r=!1,s.push({start:t%i,end:(l-1)%i,loop:r}),t=o=u.stop?l:null):(o=l,a.skip&&(t=l)),a=u}return o!==null&&s.push({start:t%i,end:o%i,loop:r}),s}function xk(e,t){const n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];const s=!!e._loop,{start:o,end:a}=vk(n,i,s,r);if(r===!0)return Rg(e,[{start:o,end:a,loop:s}],n,t);const l=a<o?a+i:a,u=!!e._fullLoop&&o===0&&a===i-1;return Rg(e,bk(n,o,l,u),n,t)}function Rg(e,t,n,r){return!r||!r.setContext||!n?t:wk(e,t,n,r)}function wk(e,t,n,r){const i=e._chart.getContext(),s=Ng(e.options),{_datasetIndex:o,options:{spanGaps:a}}=e,l=n.length,u=[];let c=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&&(u.push({start:g%l,end:m%l,loop:p,style:v}),c=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=Ng(r.setContext(ai(i,{type:"segment",p0:m,p1:v,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:o}))),Sk(p,c)&&h(d,f-1,g.loop,c),m=v,c=p}d<f-1&&h(d,f-1,g.loop,c)}return u}function Ng(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function Sk(e,t){if(!t)return!1;const n=[],r=function(i,s){return Uf(s)?(n.includes(s)||n.push(s),n.indexOf(s)):s};return JSON.stringify(e,r)!==JSON.stringify(t,r)}function vl(e,t,n){return e.options.clip?e[n]:t[n]}function Ck(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:vl(n,t,"left"),right:vl(n,t,"right"),top:vl(r,t,"top"),bottom:vl(r,t,"bottom")}:t}function Z2(e,t){const n=t._clip;if(n.disabled)return!1;const r=Ck(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 xk{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=$2.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 or=new xk;const Rg="transparent",wk={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=Eg(e||Rg),i=r.valid&&Eg(t||Rg);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class Sk{constructor(t,n,r,i){const s=n[r];i=dl([t.to,i,s,t.from]);const o=dl([t.from,s,i]);this._active=!0,this._fn=t.fn||wk[t.type||typeof o],this._easing=Uo[t.easing]||Uo.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=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=dl([t.to,n,i,t.from]),this._from=dl([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 Q2{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Ie(t))return;const n=Object.keys(ct.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const s=t[i];if(!Ie(s))return;const o={};for(const a of n)o[a]=s[a];(ot(s.properties)&&s.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,o)})})}_animateOptions(t,n){const r=n.options,i=_k(t,r);if(!i)return[];const s=this._createAnimations(i,r);return r.$shared&&Ck(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 u=o[l];if(u.charAt(0)==="$")continue;if(u==="options"){i.push(...this._animateOptions(t,n));continue}const c=n[u];let d=s[u];const f=r.get(u);if(d)if(f&&d.active()){d.update(f,c,a);continue}else d.cancel();if(!f||!f.duration){t[u]=c;continue}s[u]=d=new Sk(f,t,u,c),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 or.add(this._chart,r),!0}}function Ck(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 _k(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 Ng(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 kk(e,t,n){if(n===!1)return!1;const r=Ng(e,n),i=Ng(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function Ok(e){let t,n,r,i;return Ie(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 Y2(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 Fg(e,t,n,r={}){const i=e.keys,s=r.mode==="single";let o,a,l,u;if(t===null)return;let c=!1;for(o=0,a=i.length;o<a;++o){if(l=+i[o],l===n){if(c=!0,r.all)continue;break}u=e.values[l],bt(u)&&(s||t===0||Hs(t)===Hs(u))&&(t+=u)}return!c&&!r.all?0:t}function Ek(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,u,c;for(l=0,u=o.length;l<u;++l)c=o[l],a[l]={[i]:c,[s]:e[c]};return a}function $c(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function Ak(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function Tk(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 Pk(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Bg(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 qg(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:s,vScale:o,index:a}=r,l=s.axis,u=o.axis,c=Ak(s,o,r),d=t.length;let f;for(let h=0;h<d;++h){const g=t[h],{[l]:m,[u]:p}=g,v=g._stacks||(g._stacks={});f=v[u]=Pk(i,c,m),f[a]=p,f._top=Bg(f,o,!0,r.type),f._bottom=Bg(f,o,!1,r.type);const b=f._visualValues||(f._visualValues={});b[a]=p}}function Lc(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function jk(e,t){return ii(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Mk(e,t,n){return ii(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function vo(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 Dc=e=>e==="reset"||e==="none",zg=(e,t)=>t?e:Object.assign({},e),$k=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Y2(n,!0),values:null};class cs{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=$c(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&&vo(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=Le(r.xAxisID,Lc(t,"x")),o=n.yAxisID=Le(r.yAxisID,Lc(t,"y")),a=n.rAxisID=Le(r.rAxisID,Lc(t,"r")),l=n.indexAxis,u=n.iAxisID=i(l,s,o,a),c=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(u),n.vScale=this.getScaleForId(c)}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&&_g(this._data,this),t._stacked&&vo(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Ie(n)){const i=this._cachedMeta;this._data=Ek(n,i)}else if(r!==n){if(r){_g(r,this);const i=this._cachedMeta;vo(i),i._parsed=[]}n&&Object.isExtensible(n)&&d9(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=$c(n.vScale,n),n.stack!==r.stack&&(i=!0,vo(n),n.stack=r.stack),this._resyncElements(t),(i||s!==n._stacked)&&(qg(this,n._parsed),n._stacked=$c(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,u=t>0&&r._parsed[t-1],c,d,f;if(this._parsing===!1)r._parsed=i,r._sorted=!0,f=i;else{ot(i[t])?f=this.parseArrayData(r,i,t,n):Ie(i[t])?f=this.parseObjectData(r,i,t,n):f=this.parsePrimitiveData(r,i,t,n);const h=()=>d[a]===null||u&&d[a]<u[a];for(c=0;c<n;++c)r._parsed[c+t]=d=f[c],l&&(h()&&(l=!1),u=d);r._sorted=l}o&&qg(this,f)}parsePrimitiveData(t,n,r,i){const{iScale:s,vScale:o}=t,a=s.axis,l=o.axis,u=s.getLabels(),c=s===o,d=new Array(i);let f,h,g;for(f=0,h=i;f<h;++f)g=f+r,d[f]={[a]:c||s.parse(u[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,u,c,d;for(l=0,u=i;l<u;++l)c=l+r,d=n[c],a[l]={x:s.parse(d[0],c),y:o.parse(d[1],c)};return a}parseObjectData(t,n,r,i){const{xScale:s,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,u=new Array(i);let c,d,f,h;for(c=0,d=i;c<d;++c)f=c+r,h=n[f],u[c]={x:s.parse(ca(h,a),f),y:o.parse(ca(h,l),f)};return u}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:Y2(i,!0),values:n._stacks[t.axis]._visualValues};return Fg(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=Fg(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=$k(n,r,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:d}=Tk(a);let f,h;function g(){h=i[f];const m=h[a.axis];return!bt(h[t.axis])||c>m||d<m}for(f=0;f<o&&!(!g()&&(this.updateRangeFromParsed(u,t,h,l),s));++f);if(s){for(f=o-1;f>=0;--f)if(!g()){this.updateRangeFromParsed(u,t,h,l);break}}return u}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],bt(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=Ok(Le(this.options.clip,kk(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,u=this.options.drawActiveElementsOnTop;let c;for(r.dataset&&r.dataset.draw(t,s,a,l),c=a;c<a+l;++c){const d=i[c];d.hidden||(d.active&&u?o.push(d):d.draw(t,s))}for(c=0;c<o.length;++c)o[c].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=Mk(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=jk(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&&iu(r);if(a)return zg(a,l);const u=this.chart.config,c=u.datasetElementScopeKeys(this._type,t),d=i?[`${t}Hover`,"hover",t,""]:[t,""],f=u.getOptionScopes(this.getDataset(),c),h=Object.keys(ct.elements[t]),g=()=>this.getContext(r,i,n),m=u.resolveNamedOptions(f,h,g,d);return m.$shared&&(m.$shared=l,s[o]=Object.freeze(zg(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 c=this.chart.config,d=c.datasetAnimationScopeKeys(this._type,n),f=c.getOptionScopes(this.getDataset(),d);l=c.createResolver(f,this.getContext(t,r,n))}const u=new Q2(i,l&&l.animations);return l&&l._cacheable&&(s[o]=Object.freeze(u)),u}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Dc(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){Dc(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!Dc(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,u]of this._syncList)this[a](l,u);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=u=>{for(u.length+=n,a=u.length-1;a>=o;a--)u[a]=u[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&&vo(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(cs,"defaults",{}),pe(cs,"datasetElementType",null),pe(cs,"dataElementType",null);class Ll extends cs{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}=y9(n,i,o);this._drawStart=a,this._drawCount=l,m9(n)&&(a=0,l=i.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!s._decimated,r.points=i;const u=this.resolveDatasetElementOptions(t);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(r,void 0,{animated:!o,options:u},t),this.updateElements(i,a,l,t)}updateElements(t,n,r,i){const s=i==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:u}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(n,i),f=o.axis,h=a.axis,{spanGaps:g,segment:m}=this.options,p=da(g)?g:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||s||i==="none",b=n+r,S=t.length;let C=n>0&&this.getParsed(n-1);for(let w=0;w<S;++w){const O=t[w],x=v?O:{};if(w<n||w>=b){x.skip=!0;continue}const _=this.getParsed(w),k=Ye(_[h]),E=x[f]=o.getPixelForValue(_[f],w),P=x[h]=s||k?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,_,l):_[h],w);x.skip=isNaN(E)||isNaN(P)||k,x.stop=w>0&&Math.abs(_[f]-C[f])>p,m&&(x.parsed=_,x.raw=u.data[w]),d&&(x.options=c||this.resolveDataElementOptions(w,O.active?"active":i)),v||this.updateElement(O,w,x,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(Ll,"id","line"),pe(Ll,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),pe(Ll,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Dl extends cs{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 W9.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],u=this.resolveDataElementOptions(a,l.active?"active":i),c=s.getPointPositionForValue(a,this.getParsed(a).r),d=o?s.xCenter:c.x,f=o?s.yCenter:c.y,h={x:d,y:f,angle:c.angle,skip:isNaN(d)||isNaN(f),options:u};this.updateElement(l,a,h,i)}}}pe(Dl,"id","radar"),pe(Dl,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),pe(Dl,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});function li(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Qf{constructor(t){pe(this,"options");this.options=t||{}}static override(t){Object.assign(Qf.prototype,t)}init(){}formats(){return li()}parse(){return li()}format(){return li()}add(){return li()}diff(){return li()}startOf(){return li()}endOf(){return li()}}var Lk={_date:Qf};function Dk(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 u=a._reversePixels?u9:bi;if(r){if(i._sharedOptions){const c=s[0],d=typeof c.getRange=="function"&&c.getRange(t);if(d){const f=u(s,t,n-d),h=u(s,t,n+d);return{lo:f.lo,hi:h.hi}}}}else{const c=u(s,t,n);if(l){const{vScale:d}=i._cachedMeta,{_parsed:f}=e,h=f.slice(0,c.lo+1).reverse().findIndex(m=>!Ye(m[d.axis]));c.lo-=Math.max(0,h);const g=f.slice(c.hi).findIndex(m=>!Ye(m[d.axis]));c.hi+=Math.max(0,g)}return c}}return{lo:0,hi:s.length-1}}function Gu(e,t,n,r,i){const s=e.getSortedVisibleDatasetMetas(),o=n[t];for(let a=0,l=s.length;a<l;++a){const{index:u,data:c}=s[a],{lo:d,hi:f}=Dk(s[a],t,o,i);for(let h=d;h<=f;++h){const g=c[h];g.skip||r(g,u,h)}}}function Ik(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 Ic(e,t,n,r,i){const s=[];return!i&&!e.isPointInArea(t)||Gu(e,n,t,function(a,l,u){!i&&!hr(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&s.push({element:a,datasetIndex:l,index:u})},!0),s}function Rk(e,t,n,r){let i=[];function s(o,a,l){const{startAngle:u,endAngle:c}=o.getProps(["startAngle","endAngle"],r),{angle:d}=o9(o,{x:t.x,y:t.y});j2(d,u,c)&&i.push({element:o,datasetIndex:a,index:l})}return Gu(e,n,t,s),i}function Nk(e,t,n,r,i,s){let o=[];const a=Ik(n);let l=Number.POSITIVE_INFINITY;function u(c,d,f){const h=c.inRange(t.x,t.y,i);if(r&&!h)return;const g=c.getCenterPoint(i);if(!(!!s||e.isPointInArea(g))&&!h)return;const p=a(t,g);p<l?(o=[{element:c,datasetIndex:d,index:f}],l=p):p===l&&o.push({element:c,datasetIndex:d,index:f})}return Gu(e,n,t,u),o}function Rc(e,t,n,r,i,s){return!s&&!e.isPointInArea(t)?[]:n==="r"&&!r?Rk(e,t,n,i):Nk(e,t,n,r,i,s)}function Hg(e,t,n,r,i){const s=[],o=n==="x"?"inXRange":"inYRange";let a=!1;return Gu(e,n,t,(l,u,c)=>{l[o]&&l[o](t[n],i)&&(s.push({element:l,datasetIndex:u,index:c}),a=a||l.inRange(t.x,t.y,i))}),r&&!a?[]:s}var Fk={modes:{index(e,t,n,r){const i=hi(t,e),s=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?Ic(e,i,s,r,o):Rc(e,i,s,!1,r,o),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(u=>{const c=a[0].index,d=u.data[c];d&&!d.skip&&l.push({element:d,datasetIndex:u.index,index:c})}),l):[]},dataset(e,t,n,r){const i=hi(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?Ic(e,i,s,r,o):Rc(e,i,s,!1,r,o);if(a.length>0){const l=a[0].datasetIndex,u=e.getDatasetMeta(l).data;a=[];for(let c=0;c<u.length;++c)a.push({element:u[c],datasetIndex:l,index:c})}return a},point(e,t,n,r){const i=hi(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return Ic(e,i,s,r,o)},nearest(e,t,n,r){const i=hi(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return Rc(e,i,s,n.intersect,r,o)},x(e,t,n,r){const i=hi(t,e);return Hg(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=hi(t,e);return Hg(e,i,"y",n.intersect,r)}}};const X2=["left","top","right","bottom"];function bo(e,t){return e.filter(n=>n.pos===t)}function Ug(e,t){return e.filter(n=>X2.indexOf(n.pos)===-1&&n.box.axis===t)}function xo(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 Bk(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 qk(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:s}=n;if(!r||!X2.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 zk(e,t){const n=qk(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,u=n[a.stack],c=u&&a.stackWeight/u.weight;a.horizontal?(a.width=c?c*r:l&&t.availableWidth,a.height=i):(a.width=r,a.height=c?c*i:l&&t.availableHeight)}return n}function Hk(e){const t=Bk(e),n=xo(t.filter(u=>u.box.fullSize),!0),r=xo(bo(t,"left"),!0),i=xo(bo(t,"right")),s=xo(bo(t,"top"),!0),o=xo(bo(t,"bottom")),a=Ug(t,"x"),l=Ug(t,"y");return{fullSize:n,leftAndTop:r.concat(s),rightAndBottom:i.concat(l).concat(o).concat(a),chartArea:bo(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:s.concat(o).concat(a)}}function Gg(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function Z2(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 Uk(e,t,n,r){const{pos:i,box:s}=n,o=e.maxPadding;if(!Ie(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&&Z2(o,s.getPadding());const a=Math.max(0,t.outerWidth-Gg(o,e,"left","right")),l=Math.max(0,t.outerHeight-Gg(o,e,"top","bottom")),u=a!==e.w,c=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:u,other:c}:{same:c,other:u}}function Gk(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 Vk(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 $o(e,t,n,r){const i=[];let s,o,a,l,u,c;for(s=0,o=e.length,u=0;s<o;++s){a=e[s],l=a.box,l.update(a.width||t.w,a.height||t.h,Vk(a.horizontal,t));const{same:d,other:f}=Uk(t,n,a,r);u|=d&&i.length,c=c||f,l.fullSize||i.push(a)}return u&&$o(i,t,n,r)||c}function yl(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 Vg(e,t,n,r){const i=n.padding;let{x:s,y:o}=t;for(const a of e){const l=a.box,u=r[a.stack]||{placed:0,weight:1},c=a.stackWeight/u.weight||1;if(a.horizontal){const d=t.w*c,f=u.size||l.height;iu(u.start)&&(o=u.start),l.fullSize?yl(l,i.left,o,n.outerWidth-i.right-i.left,f):yl(l,t.left+u.placed,o,d,f),u.start=o,u.placed+=d,o=l.bottom}else{const d=t.h*c,f=u.size||l.width;iu(u.start)&&(s=u.start),l.fullSize?yl(l,s,i.top,f,n.outerHeight-i.bottom-i.top):yl(l,s,t.top+u.placed,f,d),u.start=s,u.placed+=d,s=l.right}}t.x=s,t.y=o}var xn={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=jt(e.options.layout.padding),s=Math.max(t-i.width,0),o=Math.max(n-i.height,0),a=Hk(e.boxes),l=a.vertical,u=a.horizontal;Qe(e.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const c=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/c,hBoxMaxHeight:o/2}),f=Object.assign({},i);Z2(f,jt(r));const h=Object.assign({maxPadding:f,w:s,h:o,x:i.left,y:i.top},i),g=zk(l.concat(u),d);$o(a.fullSize,h,d,g),$o(l,h,d,g),$o(u,h,d,g)&&$o(l,h,d,g),Gk(h),Vg(a.leftAndTop,h,d,g),h.x+=h.w,h.y+=h.h,Vg(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 J2{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 Kk extends J2{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Il="$chartjs",Wk={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Kg=e=>e===null||e==="";function Qk(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[Il]={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",Kg(i)){const s=$g(e,"width");s!==void 0&&(e.width=s)}if(Kg(r))if(e.style.height==="")e.height=e.width/(t||2);else{const s=$g(e,"height");s!==void 0&&(e.height=s)}return e}const eb=lk?{passive:!0}:!1;function Yk(e,t,n){e&&e.addEventListener(t,n,eb)}function Xk(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,eb)}function Zk(e,t){const n=Wk[e.type]||e.type,{x:r,y:i}=hi(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function uu(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function Jk(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||uu(a.addedNodes,r),o=o&&!uu(a.removedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function eO(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||uu(a.removedNodes,r),o=o&&!uu(a.addedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const fa=new Map;let Wg=0;function tb(){const e=window.devicePixelRatio;e!==Wg&&(Wg=e,fa.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function tO(e,t){fa.size||window.addEventListener("resize",tb),fa.set(e,t)}function nO(e){fa.delete(e),fa.size||window.removeEventListener("resize",tb)}function rO(e,t,n){const r=e.canvas,i=r&&Wf(r);if(!i)return;const s=L2((a,l)=>{const u=i.clientWidth;n(a,l),u<i.clientWidth&&n()},window),o=new ResizeObserver(a=>{const l=a[0],u=l.contentRect.width,c=l.contentRect.height;u===0&&c===0||s(u,c)});return o.observe(i),tO(e,s),o}function Nc(e,t,n){n&&n.disconnect(),t==="resize"&&nO(e)}function iO(e,t,n){const r=e.canvas,i=L2(s=>{e.ctx!==null&&n(Zk(s,e))},e);return Yk(r,t,i),i}class sO extends J2{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(Qk(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Il])return!1;const r=n[Il].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[Il],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),o={attach:Jk,detach:eO,resize:rO}[n]||iO;i[n]=o(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:Nc,detach:Nc,resize:Nc}[n]||Xk)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return ak(t,n,r,i)}isAttached(t){const n=t&&Wf(t);return!!(n&&n.isConnected)}}function oO(e){return!Kf()||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas?Kk:sO}var Ol;let Ki=(Ol=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 da(this.x)&&da(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(Ol,"defaults",{}),pe(Ol,"defaultRoutes"),Ol);function aO(e,t){const n=e.options.ticks,r=lO(e),i=Math.min(n.maxTicksLimit||r,r),s=n.major.enabled?cO(t):[],o=s.length,a=s[0],l=s[o-1],u=[];if(o>i)return dO(t,u,s,o/i),u;const c=uO(s,t,i);if(o>0){let d,f;const h=o>1?Math.round((l-a)/(o-1)):null;for(ml(t,u,c,Ye(h)?0:a-h,a),d=0,f=o-1;d<f;d++)ml(t,u,c,s[d],s[d+1]);return ml(t,u,c,l,Ye(h)?t.length:l+h),u}return ml(t,u,c),u}function lO(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 uO(e,t,n){const r=fO(e),i=t.length/n;if(!r)return Math.max(i,1);const s=n9(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 cO(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function dO(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 ml(e,t,n,r,i){const s=Le(r,0),o=Math.min(Le(i,e.length),e.length);let a=0,l,u,c;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),c=s;c<0;)a++,c=Math.round(s+a*n);for(u=Math.max(s,0);u<o;u++)u===c&&(t.push(e[u]),a++,c=Math.round(s+a*n))}function fO(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 hO=e=>e==="left"?"right":e==="right"?"left":e,Qg=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Yg=(e,t)=>Math.min(t||e,e);function Xg(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 gO(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),u;if(!(n&&(r===1?u=Math.max(l-s,o-l):t===0?u=(e.getPixelForTick(1)-l)/2:u=(l-e.getPixelForTick(i-1))/2,l+=i<t?u:-u,l<s-a||l>o+a)))return l}function yO(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 wo(e){return e.drawTicks?e.tickLength:0}function Zg(e,t){if(!e.display)return 0;const n=mt(e.font,t),r=jt(e.padding);return(ot(e.text)?e.text.length:1)*n.lineHeight+r.height}function mO(e,t){return ii(e,{scale:t,type:"scale"})}function pO(e,t,n){return ii(e,{tick:n,index:t,type:"tick"})}function vO(e,t,n){let r=qf(e);return(n&&t!=="right"||!n&&t==="right")&&(r=hO(r)),r}function bO(e,t,n,r){const{top:i,left:s,bottom:o,right:a,chart:l}=e,{chartArea:u,scales:c}=l;let d=0,f,h,g;const m=o-i,p=a-s;if(e.isHorizontal()){if(h=Ot(r,s,a),Ie(n)){const v=Object.keys(n)[0],b=n[v];g=c[v].getPixelForValue(b)+m-t}else n==="center"?g=(u.bottom+u.top)/2+m-t:g=Qg(e,n,t);f=a-s}else{if(Ie(n)){const v=Object.keys(n)[0],b=n[v];h=c[v].getPixelForValue(b)-p+t}else n==="center"?h=(u.left+u.right)/2-p+t:h=Qg(e,n,t);g=Ot(r,o,i),d=n==="left"?-an:an}return{titleX:h,titleY:g,maxWidth:f,rotation:d}}class to extends Ki{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=zn(t,Number.POSITIVE_INFINITY),n=zn(n,Number.NEGATIVE_INFINITY),r=zn(r,Number.POSITIVE_INFINITY),i=zn(i,Number.NEGATIVE_INFINITY),{min:zn(t,r),max:zn(n,i),minDefined:bt(t),maxDefined:bt(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,u=a.length;l<u;++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:zn(n,zn(r,n)),max:zn(r,zn(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(){et(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=N9(this,s,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Xg(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=aO(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(){et(this.options.afterUpdate,[this])}beforeSetDimensions(){et(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(){et(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),et(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){et(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=et(n.callback,[s.value,r,t],this)}afterTickToLabelConversion(){et(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){et(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=Yg(this.ticks.length,t.ticks.maxTicksLimit),i=n.minRotation||0,s=n.maxRotation;let o=i,a,l,u;if(!this._isVisible()||!n.display||i>=s||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const c=this._getLabelSizes(),d=c.widest.width,f=c.highest.height,h=bn(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-wo(t.grid)-n.padding-Zg(t.title,this.chart.options.font),u=Math.sqrt(d*d+f*f),o=Ff(Math.min(Math.asin(bn((c.highest.height+6)/a,-1,1)),Math.asin(bn(l/u,-1,1))-Math.asin(bn(f/u,-1,1)))),o=Math.max(i,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){et(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){et(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=Zg(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=wo(s)+l):(t.height=this.maxHeight,t.width=wo(s)+l),r.display&&this.ticks.length){const{first:u,last:c,widest:d,highest:f}=this._getLabelSizes(),h=r.padding*2,g=Hr(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(u,c,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,u=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const c=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,h=0;l?u?(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-c+o)*this.width/(this.width-c),0),this.paddingRight=Math.max((h-d+o)*this.width/(this.width-d),0)}else{let c=n.height/2,d=t.height/2;s==="start"?(c=0,d=t.height):s==="end"&&(c=n.height,d=0),this.paddingTop=c+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(){et(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=Xg(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/Yg(n,r));let u=0,c=0,d,f,h,g,m,p,v,b,S,C,w;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,S=C=0,!Ye(g)&&!ot(g))S=ou(i,v.data,v.gc,S,g),C=b;else if(ot(g))for(f=0,h=g.length;f<h;++f)w=g[f],!Ye(w)&&!ot(w)&&(S=ou(i,v.data,v.gc,S,w),C+=b);o.push(S),a.push(C),u=Math.max(S,u),c=Math.max(C,c)}yO(s,n);const O=o.indexOf(u),x=a.indexOf(c),_=k=>({width:o[k]||0,height:a[k]||0});return{first:_(0),last:_(n-1),widest:_(O),highest:_(x),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 l9(this._alignToPixels?ai(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=pO(this.getContext(),t,r))}return this.$context||(this.$context=mO(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Hr(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,u=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=wo(s),h=[],g=a.setContext(this.getContext()),m=g.display?g.width:0,p=m/2,v=function(j){return ai(r,j,m)};let b,S,C,w,O,x,_,k,E,P,M,B;if(o==="top")b=v(this.bottom),x=this.bottom-f,k=b-p,P=v(t.top)+p,B=t.bottom;else if(o==="bottom")b=v(this.top),P=t.top,B=v(t.bottom)-p,x=b+p,k=this.top+f;else if(o==="left")b=v(this.right),O=this.right-f,_=b-p,E=v(t.left)+p,M=t.right;else if(o==="right")b=v(this.left),E=t.left,M=v(t.right)-p,O=b+p,_=this.left+f;else if(n==="x"){if(o==="center")b=v((t.top+t.bottom)/2+.5);else if(Ie(o)){const j=Object.keys(o)[0],L=o[j];b=v(this.chart.scales[j].getPixelForValue(L))}P=t.top,B=t.bottom,x=b+p,k=x+f}else if(n==="y"){if(o==="center")b=v((t.left+t.right)/2);else if(Ie(o)){const j=Object.keys(o)[0],L=o[j];b=v(this.chart.scales[j].getPixelForValue(L))}O=b-p,_=O-f,E=t.left,M=t.right}const R=Le(i.ticks.maxTicksLimit,d),A=Math.max(1,Math.ceil(d/R));for(S=0;S<d;S+=A){const j=this.getContext(S),L=s.setContext(j),H=a.setContext(j),Q=L.lineWidth,F=L.color,G=H.dash||[],ie=H.dashOffset,ae=L.tickWidth,N=L.tickColor,le=L.tickBorderDash||[],te=L.tickBorderDashOffset;C=gO(this,S,l),C!==void 0&&(w=ai(r,C,Q),u?O=_=E=M=w:x=k=P=B=w,h.push({tx1:O,ty1:x,tx2:_,ty2:k,x1:E,y1:P,x2:M,y2:B,width:Q,color:F,borderDash:G,borderDashOffset:ie,tickWidth:ae,tickColor:N,tickBorderDash:le,tickBorderDashOffset:te}))}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:u,padding:c,mirror:d}=s,f=wo(r.grid),h=f+c,g=d?-c:h,m=-Hr(this.labelRotation),p=[];let v,b,S,C,w,O,x,_,k,E,P,M,B="middle";if(i==="top")O=this.bottom-g,x=this._getXAxisLabelAlignment();else if(i==="bottom")O=this.top+g,x=this._getXAxisLabelAlignment();else if(i==="left"){const A=this._getYAxisLabelAlignment(f);x=A.textAlign,w=A.x}else if(i==="right"){const A=this._getYAxisLabelAlignment(f);x=A.textAlign,w=A.x}else if(n==="x"){if(i==="center")O=(t.top+t.bottom)/2+h;else if(Ie(i)){const A=Object.keys(i)[0],j=i[A];O=this.chart.scales[A].getPixelForValue(j)+h}x=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")w=(t.left+t.right)/2-h;else if(Ie(i)){const A=Object.keys(i)[0],j=i[A];w=this.chart.scales[A].getPixelForValue(j)}x=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?B="top":l==="end"&&(B="bottom"));const R=this._getLabelSizes();for(v=0,b=a.length;v<b;++v){S=a[v],C=S.label;const A=s.setContext(this.getContext(v));_=this.getPixelForTick(v)+s.labelOffset,k=this._resolveTickFontOptions(v),E=k.lineHeight,P=ot(C)?C.length:1;const j=P/2,L=A.color,H=A.textStrokeColor,Q=A.textStrokeWidth;let F=x;o?(w=_,x==="inner"&&(v===b-1?F=this.options.reverse?"left":"right":v===0?F=this.options.reverse?"right":"left":F="center"),i==="top"?u==="near"||m!==0?M=-P*E+E/2:u==="center"?M=-R.highest.height/2-j*E+E:M=-R.highest.height+E/2:u==="near"||m!==0?M=E/2:u==="center"?M=R.highest.height/2-j*E:M=R.highest.height-P*E,d&&(M*=-1),m!==0&&!A.showLabelBackdrop&&(w+=E/2*Math.sin(m))):(O=_,M=(1-P)*E/2);let G;if(A.showLabelBackdrop){const ie=jt(A.backdropPadding),ae=R.heights[v],N=R.widths[v];let le=M-ie.top,te=0-ie.left;switch(B){case"middle":le-=ae/2;break;case"bottom":le-=ae;break}switch(x){case"center":te-=N/2;break;case"right":te-=N;break;case"inner":v===b-1?te-=N:v>0&&(te-=N/2);break}G={left:te,top:le,width:N+ie.width,height:ae+ie.height,color:A.backdropColor}}p.push({label:C,font:k,textOffset:M,options:{rotation:m,color:L,strokeColor:H,strokeWidth:Q,textAlign:F,textBaseline:B,translation:[w,O],backdrop:G}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Hr(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 u,c;return n==="left"?i?(c=this.right+s,r==="near"?u="left":r==="center"?(u="center",c+=l/2):(u="right",c+=l)):(c=this.right-a,r==="near"?u="right":r==="center"?(u="center",c-=l/2):(u="left",c=this.left)):n==="right"?i?(c=this.left+s,r==="near"?u="right":r==="center"?(u="center",c-=l/2):(u="left",c-=l)):(c=this.left+a,r==="near"?u="left":r==="center"?(u="center",c+=l/2):(u="right",c=this.right)):u="right",{textAlign:u,x:c}}_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,u,c)=>{!c.width||!c.color||(r.save(),r.lineWidth=c.width,r.strokeStyle=c.color,r.setLineDash(c.borderDash||[]),r.lineDashOffset=c.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(u.x,u.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 u,c,d,f;this.isHorizontal()?(u=ai(t,this.left,o)-o/2,c=ai(t,this.right,a)+a/2,d=f=l):(d=ai(t,this.top,o)-o/2,f=ai(t,this.bottom,a)+a/2,u=c=l),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(u,d),n.lineTo(c,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&zu(r,i);const s=this.getLabelItems(t);for(const o of s){const a=o.options,l=o.font,u=o.label,c=o.textOffset;Fi(r,u,0,c,l,a)}i&&Hu(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const s=mt(r.font),o=jt(r.padding),a=r.align;let l=s.lineHeight/2;n==="bottom"||n==="center"||Ie(n)?(l+=o.bottom,ot(r.text)&&(l+=s.lineHeight*(r.text.length-1))):l+=o.top;const{titleX:u,titleY:c,maxWidth:d,rotation:f}=bO(this,l,n,a);Fi(t,r.text,0,0,s,{color:r.color,maxWidth:d,rotation:f,textAlign:vO(a,n,i),textBaseline:"middle",translation:[u,c]})}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=Le(t.grid&&t.grid.z,-1),i=Le(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==to.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 mt(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class pl{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;SO(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,xO(t,o,r),this.override&&ct.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 ct[i]&&(delete ct[i][r],this.override&&delete Ni[r])}}function xO(e,t,n){const r=ua(Object.create(null),[n?ct.get(n):{},ct.get(t),e.defaults]);ct.set(t,r),e.defaultRoutes&&wO(t,e.defaultRoutes),e.descriptors&&ct.describe(t,e.descriptors)}function wO(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(".");ct.route(s,i,l,a)})}function SO(e){return"id"in e&&"defaults"in e}class CO{constructor(){this.controllers=new pl(cs,"datasets",!0),this.elements=new pl(Ki,"elements"),this.plugins=new pl(Object,"plugins"),this.scales=new pl(to,"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=Nf(t);et(r["before"+i],[],r),n[t](r),et(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 Gn=new CO;class _O{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(et(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=Le(r.options&&r.options.plugins,{}),s=kO(r);return i===!1&&!n?[]:EO(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 kO(e){const t={},n=[],r=Object.keys(Gn.plugins.items);for(let s=0;s<r.length;s++)n.push(Gn.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 OO(e,t){return!t&&e===!1?null:e===!0?{}:e}function EO(e,{plugins:t,localIds:n},r,i){const s=[],o=e.getContext();for(const a of t){const l=a.id,u=OO(r[l],i);u!==null&&s.push({plugin:a,options:AO(e.config,{plugin:a,local:n[l]},u,o)})}return s}function AO(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 Bd(e,t){const n=ct.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function TO(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function PO(e,t){return e===t?"_index_":"_value_"}function Jg(e){if(e==="x"||e==="y"||e==="r")return e}function jO(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function qd(e,...t){if(Jg(e))return e;for(const n of t){const r=n.axis||jO(n.position)||e.length>1&&Jg(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function ey(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function MO(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 ey(e,"x",n[0])||ey(e,"y",n[0])}return{}}function $O(e,t){const n=Ni[e.type]||{scales:{}},r=t.scales||{},i=Bd(e.type,t),s=Object.create(null);return Object.keys(r).forEach(o=>{const a=r[o];if(!Ie(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=qd(o,a,MO(o,e),ct.scales[a.type]),u=PO(l,i),c=n.scales||{};s[o]=zo(Object.create(null),[{axis:l},a,c[l],c[u]])}),e.data.datasets.forEach(o=>{const a=o.type||e.type,l=o.indexAxis||Bd(a,t),c=(Ni[a]||{}).scales||{};Object.keys(c).forEach(d=>{const f=TO(d,l),h=o[f+"AxisID"]||f;s[h]=s[h]||Object.create(null),zo(s[h],[{axis:f},r[h],c[d]])})}),Object.keys(s).forEach(o=>{const a=s[o];zo(a,[ct.scales[a.type],ct.scale])}),s}function nb(e){const t=e.options||(e.options={});t.plugins=Le(t.plugins,{}),t.scales=$O(e,t)}function rb(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function LO(e){return e=e||{},e.data=rb(e.data),nb(e),e}const ty=new Map,ib=new Set;function vl(e,t){let n=ty.get(e);return n||(n=t(),ty.set(e,n),ib.add(n)),n}const So=(e,t,n)=>{const r=ca(t,n);r!==void 0&&e.add(r)};class DO{constructor(t){this._config=LO(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(),nb(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return vl(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return vl(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return vl(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return vl(`${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(c=>{t&&(l.add(t),c.forEach(d=>So(l,t,d))),c.forEach(d=>So(l,i,d)),c.forEach(d=>So(l,Ni[s]||{},d)),c.forEach(d=>So(l,ct,d)),c.forEach(d=>So(l,Nd,d))});const u=Array.from(l);return u.length===0&&u.push(Object.create(null)),ib.has(n)&&o.set(n,u),u}chartOptionScopes(){const{options:t,type:n}=this;return[t,Ni[n]||{},ct.datasets[n]||{},{type:n},ct,Nd]}resolveNamedOptions(t,n,r,i=[""]){const s={$shared:!0},{resolver:o,subPrefixes:a}=ny(this._resolverCache,t,i);let l=o;if(RO(o,n)){s.$shared=!1,r=Xr(r)?r():r;const u=this.createResolver(t,r,a);l=Us(o,r,u)}for(const u of n)s[u]=l[u];return s}createResolver(t,n,r=[""],i){const{resolver:s}=ny(this._resolverCache,t,r);return Ie(n)?Us(s,n,void 0,i):s}}function ny(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:Uf(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,s)),s}const IO=e=>Ie(e)&&Object.getOwnPropertyNames(e).some(t=>Xr(e[t]));function RO(e,t){const{isScriptable:n,isIndexable:r}=N2(e);for(const i of t){const s=n(i),o=r(i),a=(o||s)&&e[i];if(s&&(Xr(a)||IO(a))||o&&ot(a))return!0}return!1}var NO="4.5.0";const FO=["top","bottom","left","right","chartArea"];function ry(e,t){return e==="top"||e==="bottom"||FO.indexOf(e)===-1&&t==="x"}function iy(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function sy(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),et(n&&n.onComplete,[e],t)}function BO(e){const t=e.chart,n=t.options.animation;et(n&&n.onProgress,[e],t)}function sb(e){return Kf()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Rl={},oy=e=>{const t=sb(e);return Object.values(Rl).filter(n=>n.canvas===t).pop()};function qO(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 zO(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}var Pr;let Vu=(Pr=class{static register(...t){Gn.add(...t),ay()}static unregister(...t){Gn.remove(...t),ay()}constructor(t,n){const r=this.config=new DO(n),i=sb(t),s=oy(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||oO(i)),this.platform.updateConfig(r);const a=this.platform.acquireContext(i,o.aspectRatio),l=a&&a.canvas,u=l&&l.height,c=l&&l.width;if(this.id=K7(),this.ctx=a,this.canvas=l,this.width=c,this.height=u,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 _O,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=h9(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],Rl[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}or.listen(this,"complete",sy),or.listen(this,"progress",BO),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 Gn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Mg(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Tg(this.canvas,this.ctx),this}stop(){return or.stop(this),this}resize(t,n){or.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,Mg(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),et(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=qd(o,a),u=l==="r",c=l==="x";return{options:a,dposition:u?"chartArea":c?"bottom":"left",dtype:u?"radialLinear":c?"category":"linear"}}))),Qe(s,o=>{const a=o.options,l=a.id,u=qd(l,a),c=Le(a.type,o.dtype);(a.position===void 0||ry(a.position,u)!==ry(o.dposition))&&(a.position=o.dposition),i[l]=!0;let d=null;if(l in r&&r[l].type===c)d=r[l];else{const f=Gn.getScale(c);d=new f({id:l,type:c,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,t)}),Qe(i,(o,a)=>{o||delete r[a]}),Qe(r,o=>{xn.configure(this,o,o.options),xn.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(iy("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||Bd(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=Gn.getController(a),{datasetElementType:u,dataElementType:c}=ct.datasets[a];Object.assign(l,{dataElementType:Gn.getElement(c),datasetElementType:u&&Gn.getElement(u)}),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 u=0,c=this.data.datasets.length;u<c;u++){const{controller:d}=this.getDatasetMeta(u),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,u=>{u.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(iy("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=>{xn.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!xg(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;qO(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(!xg(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;xn.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,Xr(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&&(or.has(this)?this.attached&&!or.running(this)&&or.start(this):(this.draw(),sy({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=W2(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(i&&zu(n,i),t.controller.draw(),i&&Hu(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return hr(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const s=Fk.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=ii(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);iu(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(),or.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(),Tg(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Rl[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,u)=>{n.addEventListener(this,l,u),t[l]=u},i=(l,u)=>{t[l]&&(n.removeEventListener(this,l,u),delete t[l])},s=(l,u)=>{this.canvas&&this.resize(l,u)};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 u=o&&this.getDatasetMeta(o.datasetIndex).controller;u&&u[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}});!nu(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,u)=>l.filter(c=>!u.some(d=>c.datasetIndex===d.datasetIndex&&c.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=J7(t),u=zO(t,this._lastEvent,r,l);r&&(this._lastEvent=null,et(s.onHover,[t,a,this],this),l&&et(s.onClick,[t,a,this],this));const c=!nu(a,i);return(c||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=u,c}_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(Pr,"defaults",ct),pe(Pr,"instances",Rl),pe(Pr,"overrides",Ni),pe(Pr,"registry",Gn),pe(Pr,"version",NO),pe(Pr,"getChart",oy),Pr);function ay(){return Qe(Vu.instances,e=>e._plugins.invalidate())}function ob(e,t,n=t){e.lineCap=Le(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Le(n.borderDash,t.borderDash)),e.lineDashOffset=Le(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Le(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Le(n.borderWidth,t.borderWidth),e.strokeStyle=Le(n.borderColor,t.borderColor)}function HO(e,t,n){e.lineTo(n.x,n.y)}function UO(e){return e.stepped?A9:e.tension||e.cubicInterpolationMode==="monotone"?T9:HO}function ab(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),u=Math.min(s,a),c=i<o&&s<o||i>a&&s>a;return{count:r,start:l,loop:t.loop,ilen:u<l&&!c?r+u-l:u-l}}function GO(e,t,n,r){const{points:i,options:s}=t,{count:o,start:a,loop:l,ilen:u}=ab(i,n,r),c=UO(s);let{move:d=!0,reverse:f}=r||{},h,g,m;for(h=0;h<=u;++h)g=i[(a+(f?u-h:h))%o],!g.skip&&(d?(e.moveTo(g.x,g.y),d=!1):c(e,m,g,f,s.stepped),m=g);return l&&(g=i[(a+(f?u:0))%o],c(e,m,g,f,s.stepped)),!!l}function VO(e,t,n,r){const i=t.points,{count:s,start:o,ilen:a}=ab(i,n,r),{move:l=!0,reverse:u}=r||{};let c=0,d=0,f,h,g,m,p,v;const b=C=>(o+(u?a-C:C))%s,S=()=>{m!==p&&(e.lineTo(c,p),e.lineTo(c,m),e.lineTo(c,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,w=h.y,O=C|0;O===g?(w<m?m=w:w>p&&(p=w),c=(d*c+C)/++d):(S(),e.lineTo(C,w),g=O,d=0,m=p=w),v=w}S()}function zd(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?VO:GO}function KO(e){return e.stepped?uk:e.tension||e.cubicInterpolationMode==="monotone"?ck:gi}function WO(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),ob(e,t.options),e.stroke(i)}function QO(e,t,n,r){const{segments:i,options:s}=t,o=zd(t);for(const a of i)ob(e,s,a.style),e.beginPath(),o(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const YO=typeof Path2D=="function";function XO(e,t,n,r){YO&&!t.options.segment?WO(e,t,n,r):QO(e,t,n,r)}class Ur extends Ki{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;tk(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=mk(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=K2(this,{property:n,start:i,end:i});if(!o.length)return;const a=[],l=KO(r);let u,c;for(u=0,c=o.length;u<c;++u){const{start:d,end:f}=o[u],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 zd(this)(t,this,n,r)}path(t,n,r){const i=this.segments,s=zd(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(),XO(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}pe(Ur,"id","line"),pe(Ur,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),pe(Ur,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),pe(Ur,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function ly(e,t,n,r){const i=e.options,{[n]:s}=e.getProps([n],r);return Math.abs(t-s)<i.radius+i.hitRadius}class Nl extends Ki{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 ly(this,n,"x",r)}inYRange(n,r){return ly(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||!hr(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,Fd(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}pe(Nl,"id","point"),pe(Nl,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),pe(Nl,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function ZO(e,t,n){const r=e.segments,i=e.points,s=t.points,o=[];for(const a of r){let{start:l,end:u}=a;u=Ku(l,u,i);const c=Hd(n,i[l],i[u],a.loop);if(!t.segments){o.push({source:a,target:c,start:i[l],end:i[u]});continue}const d=K2(t,c);for(const f of d){const h=Hd(n,s[f.start],s[f.end],f.loop),g=V2(a,i,h);for(const m of g)o.push({source:m,target:f,start:{[n]:uy(c,h,"start",Math.max)},end:{[n]:uy(c,h,"end",Math.min)}})}}return o}function Hd(e,t,n,r){if(r)return;let i=t[e],s=n[e];return e==="angle"&&(i=rn(i),s=rn(s)),{property:e,start:i,end:s}}function JO(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,s=[];return t.segments.forEach(({start:o,end:a})=>{a=Ku(o,a,i);const l=i[o],u=i[a];r!==null?(s.push({x:l.x,y:r}),s.push({x:u.x,y:r})):n!==null&&(s.push({x:n,y:l.y}),s.push({x:n,y:u.y}))}),s}function Ku(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function uy(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function lb(e,t){let n=[],r=!1;return ot(e)?(r=!0,n=e):n=JO(e,t),n.length?new Ur({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function cy(e){return e&&e.fill!==!1}function eE(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(!bt(i))return i;if(o=e[i],!o)return!1;if(o.visible)return i;s.push(i),i=o.fill}return!1}function tE(e,t,n){const r=sE(e);if(Ie(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return bt(i)&&Math.floor(i)===i?nE(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function nE(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function rE(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:Ie(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function iE(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:Ie(e)?r=e.value:r=t.getBaseValue(),r}function sE(e){const t=e.options,n=t.fill;let r=Le(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function oE(e){const{scale:t,index:n,line:r}=e,i=[],s=r.segments,o=r.points,a=aE(t,n);a.push(lb({x:null,y:t.bottom},r));for(let l=0;l<s.length;l++){const u=s[l];for(let c=u.start;c<=u.end;c++)lE(i,o[c],a)}return new Ur({points:i,options:{}})}function aE(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 lE(e,t,n){const r=[];for(let i=0;i<n.length;i++){const s=n[i],{first:o,last:a,point:l}=uE(s,t,"x");if(!(!l||o&&a)){if(o)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function uE(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 u=0;u<s.length;u++){const c=s[u],d=o[c.start][n],f=o[c.end][n];if(as(i,d,f)){a=i===d,l=i===f;break}}return{first:a,last:l,point:r}}class ub{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:ln},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 cE(e){const{chart:t,fill:n,line:r}=e;if(bt(n))return dE(t,n);if(n==="stack")return oE(e);if(n==="shape")return!0;const i=fE(e);return i instanceof ub?i:lb(i,r)}function dE(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function fE(e){return(e.scale||{}).getPointPositionForValue?gE(e):hE(e)}function hE(e){const{scale:t={},fill:n}=e,r=rE(n,t);if(bt(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function gE(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,s=r.reverse?t.max:t.min,o=iE(n,t,s),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,s);return new ub({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 Fc(e,t,n){const r=cE(t),{chart:i,index:s,line:o,scale:a,axis:l}=t,u=o.options,c=u.fill,d=u.backgroundColor,{above:f=d,below:h=d}=c||{},g=i.getDatasetMeta(s),m=W2(i,g);r&&o.points.length&&(zu(e,n),yE(e,{line:o,target:r,above:f,below:h,area:n,scale:a,axis:l,clip:m}),Hu(e))}function yE(e,t){const{line:n,target:r,above:i,below:s,area:o,scale:a,clip:l}=t,u=n._loop?"angle":t.axis;e.save();let c=s;s!==i&&(u==="x"?(dy(e,r,o.top),Bc(e,{line:n,target:r,color:i,scale:a,property:u,clip:l}),e.restore(),e.save(),dy(e,r,o.bottom)):u==="y"&&(fy(e,r,o.left),Bc(e,{line:n,target:r,color:s,scale:a,property:u,clip:l}),e.restore(),e.save(),fy(e,r,o.right),c=i)),Bc(e,{line:n,target:r,color:c,scale:a,property:u,clip:l}),e.restore()}function dy(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:u}=a,c=i[l],d=i[Ku(l,u,i)];s?(e.moveTo(c.x,c.y),s=!1):(e.lineTo(c.x,n),e.lineTo(c.x,c.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 fy(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:u}=a,c=i[l],d=i[Ku(l,u,i)];s?(e.moveTo(c.x,c.y),s=!1):(e.lineTo(n,c.y),e.lineTo(c.x,c.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 Bc(e,t){const{line:n,target:r,property:i,color:s,scale:o,clip:a}=t,l=ZO(n,r,i);for(const{source:u,target:c,start:d,end:f}of l){const{style:{backgroundColor:h=s}={}}=u,g=r!==!0;e.save(),e.fillStyle=h,mE(e,o,a,g&&Hd(i,d,f)),e.beginPath();const m=!!n.pathSegment(e,u);let p;if(g){m?e.closePath():hy(e,r,f,i);const v=!!r.pathSegment(e,c,{move:m,reverse:!0});p=m&&v,p||hy(e,r,d,i)}e.closePath(),e.fill(p?"evenodd":"nonzero"),e.restore()}}function mE(e,t,n,r){const i=t.chart.chartArea,{property:s,start:o,end:a}=r||{};if(s==="x"||s==="y"){let l,u,c,d;s==="x"?(l=o,u=i.top,c=a,d=i.bottom):(l=i.left,u=o,c=i.right,d=a),e.beginPath(),n&&(l=Math.max(l,n.left),c=Math.min(c,n.right),u=Math.max(u,n.top),d=Math.min(d,n.bottom)),e.rect(l,u,c-l,d-u),e.clip()}}function hy(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var pE={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 Ur&&(l={visible:e.isDatasetVisible(o),index:o,fill:tE(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=eE(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&&Fc(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;cy(s)&&Fc(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!cy(r)||n.drawTime!=="beforeDatasetDraw"||Fc(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const gy=(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)}},vE=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class yy extends Ki{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=et(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=mt(r.font),s=i.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=gy(r,s);let u,c;n.font=i.string,this.isHorizontal()?(u=this.maxWidth,c=this._fitRows(o,s,a,l)+10):(c=this.maxHeight,u=this._fitCols(o,i,a,l)+10),this.width=Math.min(u,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,i){const{ctx:s,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],u=this.lineWidths=[0],c=i+a;let d=t;s.textAlign="left",s.textBaseline="middle";let f=-1,h=-c;return this.legendItems.forEach((g,m)=>{const p=r+n/2+s.measureText(g.text).width;(m===0||u[u.length-1]+p+2*a>o)&&(d+=c,u[u.length-(m>0?0:1)]=0,h+=c,f++),l[m]={left:0,top:h,row:f,width:p,height:i},u[u.length-1]+=p+a}),d}_fitCols(t,n,r,i){const{ctx:s,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],u=this.columnSizes=[],c=o-t;let d=a,f=0,h=0,g=0,m=0;return this.legendItems.forEach((p,v)=>{const{itemWidth:b,itemHeight:S}=bE(r,n,s,p,i);v>0&&h+S+2*a>c&&(d+=f+a,u.push({width:f,height:h}),g+=f+a,m++,f=h=0),l[v]={left:g,top:h,col:m,width:b,height:S},f=Math.max(f,b),h+=S+a}),d+=f,u.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=us(s,this.left,this.width);if(this.isHorizontal()){let a=0,l=Ot(r,this.left+i,this.right-this.lineWidths[a]);for(const u of n)a!==u.row&&(a=u.row,l=Ot(r,this.left+i,this.right-this.lineWidths[a])),u.top+=this.top+t+i,u.left=o.leftForLtr(o.x(l),u.width),l+=u.width+i}else{let a=0,l=Ot(r,this.top+t+i,this.bottom-this.columnSizes[a].height);for(const u of n)u.col!==a&&(a=u.col,l=Ot(r,this.top+t+i,this.bottom-this.columnSizes[a].height)),u.top=l,u.left+=this.left+i,u.left=o.leftForLtr(o.x(u.left),u.width),l+=u.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;zu(t,this),this._draw(),Hu(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:s,labels:o}=t,a=ct.color,l=us(t.rtl,this.left,this.width),u=mt(o.font),{padding:c}=o,d=u.size,f=d/2;let h;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=u.string;const{boxWidth:g,boxHeight:m,itemHeight:p}=gy(o,d),v=function(O,x,_){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;i.save();const k=Le(_.lineWidth,1);if(i.fillStyle=Le(_.fillStyle,a),i.lineCap=Le(_.lineCap,"butt"),i.lineDashOffset=Le(_.lineDashOffset,0),i.lineJoin=Le(_.lineJoin,"miter"),i.lineWidth=k,i.strokeStyle=Le(_.strokeStyle,a),i.setLineDash(Le(_.lineDash,[])),o.usePointStyle){const E={radius:m*Math.SQRT2/2,pointStyle:_.pointStyle,rotation:_.rotation,borderWidth:k},P=l.xPlus(O,g/2),M=x+f;I2(i,E,P,M,o.pointStyleWidth&&g)}else{const E=x+Math.max((d-m)/2,0),P=l.leftForLtr(O,g),M=ls(_.borderRadius);i.beginPath(),Object.values(M).some(B=>B!==0)?au(i,{x:P,y:E,w:g,h:m,radius:M}):i.rect(P,E,g,m),i.fill(),k!==0&&i.stroke()}i.restore()},b=function(O,x,_){Fi(i,_.text,O,x+p/2,u,{strikethrough:_.hidden,textAlign:l.textAlign(_.textAlign)})},S=this.isHorizontal(),C=this._computeTitleHeight();S?h={x:Ot(s,this.left+c,this.right-r[0]),y:this.top+c+C,line:0}:h={x:this.left+c,y:Ot(s,this.top+C+c,this.bottom-n[0].height),line:0},H2(this.ctx,t.textDirection);const w=p+c;this.legendItems.forEach((O,x)=>{i.strokeStyle=O.fontColor,i.fillStyle=O.fontColor;const _=i.measureText(O.text).width,k=l.textAlign(O.textAlign||(O.textAlign=o.textAlign)),E=g+f+_;let P=h.x,M=h.y;l.setWidth(this.width),S?x>0&&P+E+c>this.right&&(M=h.y+=w,h.line++,P=h.x=Ot(s,this.left+c,this.right-r[h.line])):x>0&&M+w>this.bottom&&(P=h.x=P+n[h.line].width+c,h.line++,M=h.y=Ot(s,this.top+C+c,this.bottom-n[h.line].height));const B=l.x(P);if(v(B,M,O),P=g9(k,P+g+f,S?P+E:this.right,t.rtl),b(l.x(P),M,O),S)h.x+=E+c;else if(typeof O.text!="string"){const R=u.lineHeight;h.y+=cb(O,R)+c}else h.y+=w}),U2(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=mt(n.font),i=jt(n.padding);if(!n.display)return;const s=us(t.rtl,this.left,this.width),o=this.ctx,a=n.position,l=r.size/2,u=i.top+l;let c,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),c=this.top+u,d=Ot(t.align,d,this.right-f);else{const g=this.columnSizes.reduce((m,p)=>Math.max(m,p.height),0);c=u+Ot(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const h=Ot(a,d,d+f);o.textAlign=s.textAlign(qf(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=r.string,Fi(o,n.text,h,c,r)}_computeTitleHeight(){const t=this.options.title,n=mt(t.font),r=jt(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,s;if(as(t,this.left,this.right)&&as(n,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(i=s[r],as(t,i.left,i.left+i.width)&&as(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!SE(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,s=vE(i,r);i&&!s&&et(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!s&&et(n.onHover,[t,r,this],this)}else r&&et(n.onClick,[t,r,this],this)}}function bE(e,t,n,r,i){const s=xE(r,e,t,n),o=wE(i,r,t.lineHeight);return{itemWidth:s,itemHeight:o}}function xE(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 wE(e,t,n){let r=e;return typeof t.text!="string"&&(r=cb(t,n)),r}function cb(e,t){const n=e.text?e.text.length:0;return t*n}function SE(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var CE={id:"legend",_element:yy,start(e,t,n){const r=e.legend=new yy({ctx:e.ctx,options:n,chart:e});xn.configure(e,r,n),xn.addBox(e,r)},stop(e){xn.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;xn.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 u=l.controller.getStyle(n?0:void 0),c=jt(u.borderWidth);return{text:t[l.index].label,fillStyle:u.backgroundColor,fontColor:s,hidden:!l.visible,lineCap:u.borderCapStyle,lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:u.borderColor,pointStyle:r||u.pointStyle,rotation:u.rotation,textAlign:i||u.textAlign,borderRadius:o&&(a||u.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 db extends Ki{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=ot(r.text)?r.text.length:1;this._padding=jt(r.padding);const s=i*mt(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,u,c,d;return this.isHorizontal()?(c=Ot(a,r,s),d=n+t,u=s-r):(o.position==="left"?(c=r+t,d=Ot(a,i,n),l=ht*-.5):(c=s-t,d=Ot(a,n,i),l=ht*.5),u=i-n),{titleX:c,titleY:d,maxWidth:u,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=mt(n.font),s=r.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:u}=this._drawArgs(s);Fi(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:u,textAlign:qf(n.align),textBaseline:"middle",translation:[o,a]})}}function _E(e,t){const n=new db({ctx:e.ctx,options:t,chart:e});xn.configure(e,n,t),xn.addBox(e,n),e.titleBlock=n}var kE={id:"title",_element:db,start(e,t,n){_E(e,n)},stop(e){const t=e.titleBlock;xn.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;xn.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 Lo={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 u=l.getCenterPoint(),c=Rd(t,u);c<i&&(i=c,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function Un(e,t){return t&&(ot(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function ar(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
65
+ */class _k{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=R2.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 lr=new _k;const Fg="transparent",kk={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=Tg(e||Fg),i=r.valid&&Tg(t||Fg);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class Ok{constructor(t,n,r,i){const s=n[r];i=yl([t.to,i,s,t.from]);const o=yl([t.from,s,i]);this._active=!0,this._fn=t.fn||kk[t.type||typeof o],this._easing=Wo[t.easing]||Wo.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=yl([t.to,n,i,t.from]),this._from=yl([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 J2{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Ie(t))return;const n=Object.keys(ct.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const s=t[i];if(!Ie(s))return;const o={};for(const a of n)o[a]=s[a];(ot(s.properties)&&s.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,o)})})}_animateOptions(t,n){const r=n.options,i=Ak(t,r);if(!i)return[];const s=this._createAnimations(i,r);return r.$shared&&Ek(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 u=o[l];if(u.charAt(0)==="$")continue;if(u==="options"){i.push(...this._animateOptions(t,n));continue}const c=n[u];let d=s[u];const f=r.get(u);if(d)if(f&&d.active()){d.update(f,c,a);continue}else d.cancel();if(!f||!f.duration){t[u]=c;continue}s[u]=d=new Ok(f,t,u,c),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 lr.add(this._chart,r),!0}}function Ek(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 Ak(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 Bg(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 Tk(e,t,n){if(n===!1)return!1;const r=Bg(e,n),i=Bg(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function Pk(e){let t,n,r,i;return Ie(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 eb(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 qg(e,t,n,r={}){const i=e.keys,s=r.mode==="single";let o,a,l,u;if(t===null)return;let c=!1;for(o=0,a=i.length;o<a;++o){if(l=+i[o],l===n){if(c=!0,r.all)continue;break}u=e.values[l],bt(u)&&(s||t===0||Ks(t)===Ks(u))&&(t+=u)}return!c&&!r.all?0:t}function jk(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,u,c;for(l=0,u=o.length;l<u;++l)c=o[l],a[l]={[i]:c,[s]:e[c]};return a}function Ic(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function Mk(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function $k(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 Lk(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function zg(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 Hg(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:s,vScale:o,index:a}=r,l=s.axis,u=o.axis,c=Mk(s,o,r),d=t.length;let f;for(let h=0;h<d;++h){const g=t[h],{[l]:m,[u]:p}=g,v=g._stacks||(g._stacks={});f=v[u]=Lk(i,c,m),f[a]=p,f._top=zg(f,o,!0,r.type),f._bottom=zg(f,o,!1,r.type);const b=f._visualValues||(f._visualValues={});b[a]=p}}function Rc(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function Dk(e,t){return ai(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Ik(e,t,n){return ai(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function wo(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 Nc=e=>e==="reset"||e==="none",Ug=(e,t)=>t?e:Object.assign({},e),Rk=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:eb(n,!0),values:null};class hs{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=Ic(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&&wo(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=Le(r.xAxisID,Rc(t,"x")),o=n.yAxisID=Le(r.yAxisID,Rc(t,"y")),a=n.rAxisID=Le(r.rAxisID,Rc(t,"r")),l=n.indexAxis,u=n.iAxisID=i(l,s,o,a),c=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(u),n.vScale=this.getScaleForId(c)}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&&Og(this._data,this),t._stacked&&wo(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Ie(n)){const i=this._cachedMeta;this._data=jk(n,i)}else if(r!==n){if(r){Og(r,this);const i=this._cachedMeta;wo(i),i._parsed=[]}n&&Object.isExtensible(n)&&y9(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=Ic(n.vScale,n),n.stack!==r.stack&&(i=!0,wo(n),n.stack=r.stack),this._resyncElements(t),(i||s!==n._stacked)&&(Hg(this,n._parsed),n._stacked=Ic(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,u=t>0&&r._parsed[t-1],c,d,f;if(this._parsing===!1)r._parsed=i,r._sorted=!0,f=i;else{ot(i[t])?f=this.parseArrayData(r,i,t,n):Ie(i[t])?f=this.parseObjectData(r,i,t,n):f=this.parsePrimitiveData(r,i,t,n);const h=()=>d[a]===null||u&&d[a]<u[a];for(c=0;c<n;++c)r._parsed[c+t]=d=f[c],l&&(h()&&(l=!1),u=d);r._sorted=l}o&&Hg(this,f)}parsePrimitiveData(t,n,r,i){const{iScale:s,vScale:o}=t,a=s.axis,l=o.axis,u=s.getLabels(),c=s===o,d=new Array(i);let f,h,g;for(f=0,h=i;f<h;++f)g=f+r,d[f]={[a]:c||s.parse(u[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,u,c,d;for(l=0,u=i;l<u;++l)c=l+r,d=n[c],a[l]={x:s.parse(d[0],c),y:o.parse(d[1],c)};return a}parseObjectData(t,n,r,i){const{xScale:s,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,u=new Array(i);let c,d,f,h;for(c=0,d=i;c<d;++c)f=c+r,h=n[f],u[c]={x:s.parse(ga(h,a),f),y:o.parse(ga(h,l),f)};return u}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:eb(i,!0),values:n._stacks[t.axis]._visualValues};return qg(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=qg(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=Rk(n,r,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:d}=$k(a);let f,h;function g(){h=i[f];const m=h[a.axis];return!bt(h[t.axis])||c>m||d<m}for(f=0;f<o&&!(!g()&&(this.updateRangeFromParsed(u,t,h,l),s));++f);if(s){for(f=o-1;f>=0;--f)if(!g()){this.updateRangeFromParsed(u,t,h,l);break}}return u}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],bt(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=Pk(Le(this.options.clip,Tk(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,u=this.options.drawActiveElementsOnTop;let c;for(r.dataset&&r.dataset.draw(t,s,a,l),c=a;c<a+l;++c){const d=i[c];d.hidden||(d.active&&u?o.push(d):d.draw(t,s))}for(c=0;c<o.length;++c)o[c].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=Ik(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=Dk(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&&au(r);if(a)return Ug(a,l);const u=this.chart.config,c=u.datasetElementScopeKeys(this._type,t),d=i?[`${t}Hover`,"hover",t,""]:[t,""],f=u.getOptionScopes(this.getDataset(),c),h=Object.keys(ct.elements[t]),g=()=>this.getContext(r,i,n),m=u.resolveNamedOptions(f,h,g,d);return m.$shared&&(m.$shared=l,s[o]=Object.freeze(Ug(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 c=this.chart.config,d=c.datasetAnimationScopeKeys(this._type,n),f=c.getOptionScopes(this.getDataset(),d);l=c.createResolver(f,this.getContext(t,r,n))}const u=new J2(i,l&&l.animations);return l&&l._cacheable&&(s[o]=Object.freeze(u)),u}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Nc(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){Nc(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!Nc(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,u]of this._syncList)this[a](l,u);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=u=>{for(u.length+=n,a=u.length-1;a>=o;a--)u[a]=u[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&&wo(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(hs,"defaults",{}),pe(hs,"datasetElementType",null),pe(hs,"dataElementType",null);class Nl extends hs{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}=b9(n,i,o);this._drawStart=a,this._drawCount=l,x9(n)&&(a=0,l=i.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!s._decimated,r.points=i;const u=this.resolveDatasetElementOptions(t);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(r,void 0,{animated:!o,options:u},t),this.updateElements(i,a,l,t)}updateElements(t,n,r,i){const s=i==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:u}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(n,i),f=o.axis,h=a.axis,{spanGaps:g,segment:m}=this.options,p=ya(g)?g:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||s||i==="none",b=n+r,S=t.length;let C=n>0&&this.getParsed(n-1);for(let w=0;w<S;++w){const O=t[w],x=v?O:{};if(w<n||w>=b){x.skip=!0;continue}const _=this.getParsed(w),k=Ye(_[h]),E=x[f]=o.getPixelForValue(_[f],w),j=x[h]=s||k?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,_,l):_[h],w);x.skip=isNaN(E)||isNaN(j)||k,x.stop=w>0&&Math.abs(_[f]-C[f])>p,m&&(x.parsed=_,x.raw=u.data[w]),d&&(x.options=c||this.resolveDataElementOptions(w,O.active?"active":i)),v||this.updateElement(O,w,x,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(Nl,"id","line"),pe(Nl,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),pe(Nl,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Fl extends hs{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 Z9.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],u=this.resolveDataElementOptions(a,l.active?"active":i),c=s.getPointPositionForValue(a,this.getParsed(a).r),d=o?s.xCenter:c.x,f=o?s.yCenter:c.y,h={x:d,y:f,angle:c.angle,skip:isNaN(d)||isNaN(f),options:u};this.updateElement(l,a,h,i)}}}pe(Fl,"id","radar"),pe(Fl,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),pe(Fl,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});function di(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Xf{constructor(t){pe(this,"options");this.options=t||{}}static override(t){Object.assign(Xf.prototype,t)}init(){}formats(){return di()}parse(){return di()}format(){return di()}add(){return di()}diff(){return di()}startOf(){return di()}endOf(){return di()}}var Nk={_date:Xf};function Fk(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 u=a._reversePixels?h9:Si;if(r){if(i._sharedOptions){const c=s[0],d=typeof c.getRange=="function"&&c.getRange(t);if(d){const f=u(s,t,n-d),h=u(s,t,n+d);return{lo:f.lo,hi:h.hi}}}}else{const c=u(s,t,n);if(l){const{vScale:d}=i._cachedMeta,{_parsed:f}=e,h=f.slice(0,c.lo+1).reverse().findIndex(m=>!Ye(m[d.axis]));c.lo-=Math.max(0,h);const g=f.slice(c.hi).findIndex(m=>!Ye(m[d.axis]));c.hi+=Math.max(0,g)}return c}}return{lo:0,hi:s.length-1}}function Wu(e,t,n,r,i){const s=e.getSortedVisibleDatasetMetas(),o=n[t];for(let a=0,l=s.length;a<l;++a){const{index:u,data:c}=s[a],{lo:d,hi:f}=Fk(s[a],t,o,i);for(let h=d;h<=f;++h){const g=c[h];g.skip||r(g,u,h)}}}function Bk(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 Fc(e,t,n,r,i){const s=[];return!i&&!e.isPointInArea(t)||Wu(e,n,t,function(a,l,u){!i&&!mr(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&s.push({element:a,datasetIndex:l,index:u})},!0),s}function qk(e,t,n,r){let i=[];function s(o,a,l){const{startAngle:u,endAngle:c}=o.getProps(["startAngle","endAngle"],r),{angle:d}=c9(o,{x:t.x,y:t.y});D2(d,u,c)&&i.push({element:o,datasetIndex:a,index:l})}return Wu(e,n,t,s),i}function zk(e,t,n,r,i,s){let o=[];const a=Bk(n);let l=Number.POSITIVE_INFINITY;function u(c,d,f){const h=c.inRange(t.x,t.y,i);if(r&&!h)return;const g=c.getCenterPoint(i);if(!(!!s||e.isPointInArea(g))&&!h)return;const p=a(t,g);p<l?(o=[{element:c,datasetIndex:d,index:f}],l=p):p===l&&o.push({element:c,datasetIndex:d,index:f})}return Wu(e,n,t,u),o}function Bc(e,t,n,r,i,s){return!s&&!e.isPointInArea(t)?[]:n==="r"&&!r?qk(e,t,n,i):zk(e,t,n,r,i,s)}function Gg(e,t,n,r,i){const s=[],o=n==="x"?"inXRange":"inYRange";let a=!1;return Wu(e,n,t,(l,u,c)=>{l[o]&&l[o](t[n],i)&&(s.push({element:l,datasetIndex:u,index:c}),a=a||l.inRange(t.x,t.y,i))}),r&&!a?[]:s}var Hk={modes:{index(e,t,n,r){const i=mi(t,e),s=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?Fc(e,i,s,r,o):Bc(e,i,s,!1,r,o),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(u=>{const c=a[0].index,d=u.data[c];d&&!d.skip&&l.push({element:d,datasetIndex:u.index,index:c})}),l):[]},dataset(e,t,n,r){const i=mi(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?Fc(e,i,s,r,o):Bc(e,i,s,!1,r,o);if(a.length>0){const l=a[0].datasetIndex,u=e.getDatasetMeta(l).data;a=[];for(let c=0;c<u.length;++c)a.push({element:u[c],datasetIndex:l,index:c})}return a},point(e,t,n,r){const i=mi(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return Fc(e,i,s,r,o)},nearest(e,t,n,r){const i=mi(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return Bc(e,i,s,n.intersect,r,o)},x(e,t,n,r){const i=mi(t,e);return Gg(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=mi(t,e);return Gg(e,i,"y",n.intersect,r)}}};const tb=["left","top","right","bottom"];function So(e,t){return e.filter(n=>n.pos===t)}function Kg(e,t){return e.filter(n=>tb.indexOf(n.pos)===-1&&n.box.axis===t)}function Co(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 Uk(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 Gk(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 Kk(e,t){const n=Gk(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,u=n[a.stack],c=u&&a.stackWeight/u.weight;a.horizontal?(a.width=c?c*r:l&&t.availableWidth,a.height=i):(a.width=r,a.height=c?c*i:l&&t.availableHeight)}return n}function Vk(e){const t=Uk(e),n=Co(t.filter(u=>u.box.fullSize),!0),r=Co(So(t,"left"),!0),i=Co(So(t,"right")),s=Co(So(t,"top"),!0),o=Co(So(t,"bottom")),a=Kg(t,"x"),l=Kg(t,"y");return{fullSize:n,leftAndTop:r.concat(s),rightAndBottom:i.concat(l).concat(o).concat(a),chartArea:So(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:s.concat(o).concat(a)}}function Vg(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function nb(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 Wk(e,t,n,r){const{pos:i,box:s}=n,o=e.maxPadding;if(!Ie(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&&nb(o,s.getPadding());const a=Math.max(0,t.outerWidth-Vg(o,e,"left","right")),l=Math.max(0,t.outerHeight-Vg(o,e,"top","bottom")),u=a!==e.w,c=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:u,other:c}:{same:c,other:u}}function Qk(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 Yk(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 Io(e,t,n,r){const i=[];let s,o,a,l,u,c;for(s=0,o=e.length,u=0;s<o;++s){a=e[s],l=a.box,l.update(a.width||t.w,a.height||t.h,Yk(a.horizontal,t));const{same:d,other:f}=Wk(t,n,a,r);u|=d&&i.length,c=c||f,l.fullSize||i.push(a)}return u&&Io(i,t,n,r)||c}function bl(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 Wg(e,t,n,r){const i=n.padding;let{x:s,y:o}=t;for(const a of e){const l=a.box,u=r[a.stack]||{placed:0,weight:1},c=a.stackWeight/u.weight||1;if(a.horizontal){const d=t.w*c,f=u.size||l.height;au(u.start)&&(o=u.start),l.fullSize?bl(l,i.left,o,n.outerWidth-i.right-i.left,f):bl(l,t.left+u.placed,o,d,f),u.start=o,u.placed+=d,o=l.bottom}else{const d=t.h*c,f=u.size||l.width;au(u.start)&&(s=u.start),l.fullSize?bl(l,s,i.top,f,n.outerHeight-i.bottom-i.top):bl(l,s,t.top+u.placed,f,d),u.start=s,u.placed+=d,s=l.right}}t.x=s,t.y=o}var wn={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=jt(e.options.layout.padding),s=Math.max(t-i.width,0),o=Math.max(n-i.height,0),a=Vk(e.boxes),l=a.vertical,u=a.horizontal;Qe(e.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const c=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/c,hBoxMaxHeight:o/2}),f=Object.assign({},i);nb(f,jt(r));const h=Object.assign({maxPadding:f,w:s,h:o,x:i.left,y:i.top},i),g=Kk(l.concat(u),d);Io(a.fullSize,h,d,g),Io(l,h,d,g),Io(u,h,d,g)&&Io(l,h,d,g),Qk(h),Wg(a.leftAndTop,h,d,g),h.x+=h.w,h.y+=h.h,Wg(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 rb{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 Xk extends rb{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Bl="$chartjs",Zk={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Qg=e=>e===null||e==="";function Jk(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[Bl]={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",Qg(i)){const s=Dg(e,"width");s!==void 0&&(e.width=s)}if(Qg(r))if(e.style.height==="")e.height=e.width/(t||2);else{const s=Dg(e,"height");s!==void 0&&(e.height=s)}return e}const ib=fk?{passive:!0}:!1;function eO(e,t,n){e&&e.addEventListener(t,n,ib)}function tO(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,ib)}function nO(e,t){const n=Zk[e.type]||e.type,{x:r,y:i}=mi(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function fu(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function rO(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||fu(a.addedNodes,r),o=o&&!fu(a.removedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function iO(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||fu(a.removedNodes,r),o=o&&!fu(a.addedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const ma=new Map;let Yg=0;function sb(){const e=window.devicePixelRatio;e!==Yg&&(Yg=e,ma.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function sO(e,t){ma.size||window.addEventListener("resize",sb),ma.set(e,t)}function oO(e){ma.delete(e),ma.size||window.removeEventListener("resize",sb)}function aO(e,t,n){const r=e.canvas,i=r&&Yf(r);if(!i)return;const s=N2((a,l)=>{const u=i.clientWidth;n(a,l),u<i.clientWidth&&n()},window),o=new ResizeObserver(a=>{const l=a[0],u=l.contentRect.width,c=l.contentRect.height;u===0&&c===0||s(u,c)});return o.observe(i),sO(e,s),o}function qc(e,t,n){n&&n.disconnect(),t==="resize"&&oO(e)}function lO(e,t,n){const r=e.canvas,i=N2(s=>{e.ctx!==null&&n(nO(s,e))},e);return eO(r,t,i),i}class uO extends rb{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(Jk(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Bl])return!1;const r=n[Bl].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[Bl],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),o={attach:rO,detach:iO,resize:aO}[n]||lO;i[n]=o(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:qc,detach:qc,resize:qc}[n]||tO)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return dk(t,n,r,i)}isAttached(t){const n=t&&Yf(t);return!!(n&&n.isConnected)}}function cO(e){return!Qf()||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas?Xk:uO}var Pl;let Yi=(Pl=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 ya(this.x)&&ya(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(Pl,"defaults",{}),pe(Pl,"defaultRoutes"),Pl);function dO(e,t){const n=e.options.ticks,r=fO(e),i=Math.min(n.maxTicksLimit||r,r),s=n.major.enabled?gO(t):[],o=s.length,a=s[0],l=s[o-1],u=[];if(o>i)return yO(t,u,s,o/i),u;const c=hO(s,t,i);if(o>0){let d,f;const h=o>1?Math.round((l-a)/(o-1)):null;for(xl(t,u,c,Ye(h)?0:a-h,a),d=0,f=o-1;d<f;d++)xl(t,u,c,s[d],s[d+1]);return xl(t,u,c,l,Ye(h)?t.length:l+h),u}return xl(t,u,c),u}function fO(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 hO(e,t,n){const r=mO(e),i=t.length/n;if(!r)return Math.max(i,1);const s=o9(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 gO(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function yO(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 xl(e,t,n,r,i){const s=Le(r,0),o=Math.min(Le(i,e.length),e.length);let a=0,l,u,c;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),c=s;c<0;)a++,c=Math.round(s+a*n);for(u=Math.max(s,0);u<o;u++)u===c&&(t.push(e[u]),a++,c=Math.round(s+a*n))}function mO(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 pO=e=>e==="left"?"right":e==="right"?"left":e,Xg=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Zg=(e,t)=>Math.min(t||e,e);function Jg(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 vO(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),u;if(!(n&&(r===1?u=Math.max(l-s,o-l):t===0?u=(e.getPixelForTick(1)-l)/2:u=(l-e.getPixelForTick(i-1))/2,l+=i<t?u:-u,l<s-a||l>o+a)))return l}function bO(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 _o(e){return e.drawTicks?e.tickLength:0}function ey(e,t){if(!e.display)return 0;const n=mt(e.font,t),r=jt(e.padding);return(ot(e.text)?e.text.length:1)*n.lineHeight+r.height}function xO(e,t){return ai(e,{scale:t,type:"scale"})}function wO(e,t,n){return ai(e,{tick:n,index:t,type:"tick"})}function SO(e,t,n){let r=Hf(e);return(n&&t!=="right"||!n&&t==="right")&&(r=pO(r)),r}function CO(e,t,n,r){const{top:i,left:s,bottom:o,right:a,chart:l}=e,{chartArea:u,scales:c}=l;let d=0,f,h,g;const m=o-i,p=a-s;if(e.isHorizontal()){if(h=Ot(r,s,a),Ie(n)){const v=Object.keys(n)[0],b=n[v];g=c[v].getPixelForValue(b)+m-t}else n==="center"?g=(u.bottom+u.top)/2+m-t:g=Xg(e,n,t);f=a-s}else{if(Ie(n)){const v=Object.keys(n)[0],b=n[v];h=c[v].getPixelForValue(b)-p+t}else n==="center"?h=(u.left+u.right)/2-p+t:h=Xg(e,n,t);g=Ot(r,o,i),d=n==="left"?-ln:ln}return{titleX:h,titleY:g,maxWidth:f,rotation:d}}class io extends Yi{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=Hn(t,Number.POSITIVE_INFINITY),n=Hn(n,Number.NEGATIVE_INFINITY),r=Hn(r,Number.POSITIVE_INFINITY),i=Hn(i,Number.NEGATIVE_INFINITY),{min:Hn(t,r),max:Hn(n,i),minDefined:bt(t),maxDefined:bt(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,u=a.length;l<u;++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:Hn(n,Hn(r,n)),max:Hn(r,Hn(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(){et(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=z9(this,s,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Jg(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=dO(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(){et(this.options.afterUpdate,[this])}beforeSetDimensions(){et(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(){et(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),et(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){et(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=et(n.callback,[s.value,r,t],this)}afterTickToLabelConversion(){et(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){et(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=Zg(this.ticks.length,t.ticks.maxTicksLimit),i=n.minRotation||0,s=n.maxRotation;let o=i,a,l,u;if(!this._isVisible()||!n.display||i>=s||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const c=this._getLabelSizes(),d=c.widest.width,f=c.highest.height,h=xn(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-_o(t.grid)-n.padding-ey(t.title,this.chart.options.font),u=Math.sqrt(d*d+f*f),o=qf(Math.min(Math.asin(xn((c.highest.height+6)/a,-1,1)),Math.asin(xn(l/u,-1,1))-Math.asin(xn(f/u,-1,1)))),o=Math.max(i,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){et(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){et(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=ey(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=_o(s)+l):(t.height=this.maxHeight,t.width=_o(s)+l),r.display&&this.ticks.length){const{first:u,last:c,widest:d,highest:f}=this._getLabelSizes(),h=r.padding*2,g=Kr(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(u,c,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,u=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const c=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,h=0;l?u?(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-c+o)*this.width/(this.width-c),0),this.paddingRight=Math.max((h-d+o)*this.width/(this.width-d),0)}else{let c=n.height/2,d=t.height/2;s==="start"?(c=0,d=t.height):s==="end"&&(c=n.height,d=0),this.paddingTop=c+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(){et(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=Jg(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/Zg(n,r));let u=0,c=0,d,f,h,g,m,p,v,b,S,C,w;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,S=C=0,!Ye(g)&&!ot(g))S=uu(i,v.data,v.gc,S,g),C=b;else if(ot(g))for(f=0,h=g.length;f<h;++f)w=g[f],!Ye(w)&&!ot(w)&&(S=uu(i,v.data,v.gc,S,w),C+=b);o.push(S),a.push(C),u=Math.max(S,u),c=Math.max(C,c)}bO(s,n);const O=o.indexOf(u),x=a.indexOf(c),_=k=>({width:o[k]||0,height:a[k]||0});return{first:_(0),last:_(n-1),widest:_(O),highest:_(x),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 f9(this._alignToPixels?ci(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=wO(this.getContext(),t,r))}return this.$context||(this.$context=xO(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Kr(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,u=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=_o(s),h=[],g=a.setContext(this.getContext()),m=g.display?g.width:0,p=m/2,v=function(P){return ci(r,P,m)};let b,S,C,w,O,x,_,k,E,j,M,B;if(o==="top")b=v(this.bottom),x=this.bottom-f,k=b-p,j=v(t.top)+p,B=t.bottom;else if(o==="bottom")b=v(this.top),j=t.top,B=v(t.bottom)-p,x=b+p,k=this.top+f;else if(o==="left")b=v(this.right),O=this.right-f,_=b-p,E=v(t.left)+p,M=t.right;else if(o==="right")b=v(this.left),E=t.left,M=v(t.right)-p,O=b+p,_=this.left+f;else if(n==="x"){if(o==="center")b=v((t.top+t.bottom)/2+.5);else if(Ie(o)){const P=Object.keys(o)[0],L=o[P];b=v(this.chart.scales[P].getPixelForValue(L))}j=t.top,B=t.bottom,x=b+p,k=x+f}else if(n==="y"){if(o==="center")b=v((t.left+t.right)/2);else if(Ie(o)){const P=Object.keys(o)[0],L=o[P];b=v(this.chart.scales[P].getPixelForValue(L))}O=b-p,_=O-f,E=t.left,M=t.right}const R=Le(i.ticks.maxTicksLimit,d),A=Math.max(1,Math.ceil(d/R));for(S=0;S<d;S+=A){const P=this.getContext(S),L=s.setContext(P),H=a.setContext(P),G=L.lineWidth,F=L.color,U=H.dash||[],ie=H.dashOffset,ae=L.tickWidth,N=L.tickColor,le=L.tickBorderDash||[],te=L.tickBorderDashOffset;C=vO(this,S,l),C!==void 0&&(w=ci(r,C,G),u?O=_=E=M=w:x=k=j=B=w,h.push({tx1:O,ty1:x,tx2:_,ty2:k,x1:E,y1:j,x2:M,y2:B,width:G,color:F,borderDash:U,borderDashOffset:ie,tickWidth:ae,tickColor:N,tickBorderDash:le,tickBorderDashOffset:te}))}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:u,padding:c,mirror:d}=s,f=_o(r.grid),h=f+c,g=d?-c:h,m=-Kr(this.labelRotation),p=[];let v,b,S,C,w,O,x,_,k,E,j,M,B="middle";if(i==="top")O=this.bottom-g,x=this._getXAxisLabelAlignment();else if(i==="bottom")O=this.top+g,x=this._getXAxisLabelAlignment();else if(i==="left"){const A=this._getYAxisLabelAlignment(f);x=A.textAlign,w=A.x}else if(i==="right"){const A=this._getYAxisLabelAlignment(f);x=A.textAlign,w=A.x}else if(n==="x"){if(i==="center")O=(t.top+t.bottom)/2+h;else if(Ie(i)){const A=Object.keys(i)[0],P=i[A];O=this.chart.scales[A].getPixelForValue(P)+h}x=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")w=(t.left+t.right)/2-h;else if(Ie(i)){const A=Object.keys(i)[0],P=i[A];w=this.chart.scales[A].getPixelForValue(P)}x=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?B="top":l==="end"&&(B="bottom"));const R=this._getLabelSizes();for(v=0,b=a.length;v<b;++v){S=a[v],C=S.label;const A=s.setContext(this.getContext(v));_=this.getPixelForTick(v)+s.labelOffset,k=this._resolveTickFontOptions(v),E=k.lineHeight,j=ot(C)?C.length:1;const P=j/2,L=A.color,H=A.textStrokeColor,G=A.textStrokeWidth;let F=x;o?(w=_,x==="inner"&&(v===b-1?F=this.options.reverse?"left":"right":v===0?F=this.options.reverse?"right":"left":F="center"),i==="top"?u==="near"||m!==0?M=-j*E+E/2:u==="center"?M=-R.highest.height/2-P*E+E:M=-R.highest.height+E/2:u==="near"||m!==0?M=E/2:u==="center"?M=R.highest.height/2-P*E:M=R.highest.height-j*E,d&&(M*=-1),m!==0&&!A.showLabelBackdrop&&(w+=E/2*Math.sin(m))):(O=_,M=(1-j)*E/2);let U;if(A.showLabelBackdrop){const ie=jt(A.backdropPadding),ae=R.heights[v],N=R.widths[v];let le=M-ie.top,te=0-ie.left;switch(B){case"middle":le-=ae/2;break;case"bottom":le-=ae;break}switch(x){case"center":te-=N/2;break;case"right":te-=N;break;case"inner":v===b-1?te-=N:v>0&&(te-=N/2);break}U={left:te,top:le,width:N+ie.width,height:ae+ie.height,color:A.backdropColor}}p.push({label:C,font:k,textOffset:M,options:{rotation:m,color:L,strokeColor:H,strokeWidth:G,textAlign:F,textBaseline:B,translation:[w,O],backdrop:U}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Kr(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 u,c;return n==="left"?i?(c=this.right+s,r==="near"?u="left":r==="center"?(u="center",c+=l/2):(u="right",c+=l)):(c=this.right-a,r==="near"?u="right":r==="center"?(u="center",c-=l/2):(u="left",c=this.left)):n==="right"?i?(c=this.left+s,r==="near"?u="right":r==="center"?(u="center",c-=l/2):(u="left",c-=l)):(c=this.left+a,r==="near"?u="left":r==="center"?(u="center",c+=l/2):(u="right",c=this.right)):u="right",{textAlign:u,x:c}}_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,u,c)=>{!c.width||!c.color||(r.save(),r.lineWidth=c.width,r.strokeStyle=c.color,r.setLineDash(c.borderDash||[]),r.lineDashOffset=c.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(u.x,u.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 u,c,d,f;this.isHorizontal()?(u=ci(t,this.left,o)-o/2,c=ci(t,this.right,a)+a/2,d=f=l):(d=ci(t,this.top,o)-o/2,f=ci(t,this.bottom,a)+a/2,u=c=l),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(u,d),n.lineTo(c,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&Gu(r,i);const s=this.getLabelItems(t);for(const o of s){const a=o.options,l=o.font,u=o.label,c=o.textOffset;zi(r,u,0,c,l,a)}i&&Ku(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const s=mt(r.font),o=jt(r.padding),a=r.align;let l=s.lineHeight/2;n==="bottom"||n==="center"||Ie(n)?(l+=o.bottom,ot(r.text)&&(l+=s.lineHeight*(r.text.length-1))):l+=o.top;const{titleX:u,titleY:c,maxWidth:d,rotation:f}=CO(this,l,n,a);zi(t,r.text,0,0,s,{color:r.color,maxWidth:d,rotation:f,textAlign:SO(a,n,i),textBaseline:"middle",translation:[u,c]})}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=Le(t.grid&&t.grid.z,-1),i=Le(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==io.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 mt(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class wl{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;OO(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,_O(t,o,r),this.override&&ct.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 ct[i]&&(delete ct[i][r],this.override&&delete qi[r])}}function _O(e,t,n){const r=ha(Object.create(null),[n?ct.get(n):{},ct.get(t),e.defaults]);ct.set(t,r),e.defaultRoutes&&kO(t,e.defaultRoutes),e.descriptors&&ct.describe(t,e.descriptors)}function kO(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(".");ct.route(s,i,l,a)})}function OO(e){return"id"in e&&"defaults"in e}class EO{constructor(){this.controllers=new wl(hs,"datasets",!0),this.elements=new wl(Yi,"elements"),this.plugins=new wl(Object,"plugins"),this.scales=new wl(io,"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=Bf(t);et(r["before"+i],[],r),n[t](r),et(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 Kn=new EO;class AO{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(et(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=Le(r.options&&r.options.plugins,{}),s=TO(r);return i===!1&&!n?[]:jO(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 TO(e){const t={},n=[],r=Object.keys(Kn.plugins.items);for(let s=0;s<r.length;s++)n.push(Kn.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 PO(e,t){return!t&&e===!1?null:e===!0?{}:e}function jO(e,{plugins:t,localIds:n},r,i){const s=[],o=e.getContext();for(const a of t){const l=a.id,u=PO(r[l],i);u!==null&&s.push({plugin:a,options:MO(e.config,{plugin:a,local:n[l]},u,o)})}return s}function MO(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 zd(e,t){const n=ct.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function $O(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function LO(e,t){return e===t?"_index_":"_value_"}function ty(e){if(e==="x"||e==="y"||e==="r")return e}function DO(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Hd(e,...t){if(ty(e))return e;for(const n of t){const r=n.axis||DO(n.position)||e.length>1&&ty(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function ny(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function IO(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 ny(e,"x",n[0])||ny(e,"y",n[0])}return{}}function RO(e,t){const n=qi[e.type]||{scales:{}},r=t.scales||{},i=zd(e.type,t),s=Object.create(null);return Object.keys(r).forEach(o=>{const a=r[o];if(!Ie(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=Hd(o,a,IO(o,e),ct.scales[a.type]),u=LO(l,i),c=n.scales||{};s[o]=Ko(Object.create(null),[{axis:l},a,c[l],c[u]])}),e.data.datasets.forEach(o=>{const a=o.type||e.type,l=o.indexAxis||zd(a,t),c=(qi[a]||{}).scales||{};Object.keys(c).forEach(d=>{const f=$O(d,l),h=o[f+"AxisID"]||f;s[h]=s[h]||Object.create(null),Ko(s[h],[{axis:f},r[h],c[d]])})}),Object.keys(s).forEach(o=>{const a=s[o];Ko(a,[ct.scales[a.type],ct.scale])}),s}function ob(e){const t=e.options||(e.options={});t.plugins=Le(t.plugins,{}),t.scales=RO(e,t)}function ab(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function NO(e){return e=e||{},e.data=ab(e.data),ob(e),e}const ry=new Map,lb=new Set;function Sl(e,t){let n=ry.get(e);return n||(n=t(),ry.set(e,n),lb.add(n)),n}const ko=(e,t,n)=>{const r=ga(t,n);r!==void 0&&e.add(r)};class FO{constructor(t){this._config=NO(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=ab(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(),ob(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Sl(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Sl(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Sl(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return Sl(`${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(c=>{t&&(l.add(t),c.forEach(d=>ko(l,t,d))),c.forEach(d=>ko(l,i,d)),c.forEach(d=>ko(l,qi[s]||{},d)),c.forEach(d=>ko(l,ct,d)),c.forEach(d=>ko(l,Bd,d))});const u=Array.from(l);return u.length===0&&u.push(Object.create(null)),lb.has(n)&&o.set(n,u),u}chartOptionScopes(){const{options:t,type:n}=this;return[t,qi[n]||{},ct.datasets[n]||{},{type:n},ct,Bd]}resolveNamedOptions(t,n,r,i=[""]){const s={$shared:!0},{resolver:o,subPrefixes:a}=iy(this._resolverCache,t,i);let l=o;if(qO(o,n)){s.$shared=!1,r=ei(r)?r():r;const u=this.createResolver(t,r,a);l=Vs(o,r,u)}for(const u of n)s[u]=l[u];return s}createResolver(t,n,r=[""],i){const{resolver:s}=iy(this._resolverCache,t,r);return Ie(n)?Vs(s,n,void 0,i):s}}function iy(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:Kf(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,s)),s}const BO=e=>Ie(e)&&Object.getOwnPropertyNames(e).some(t=>ei(e[t]));function qO(e,t){const{isScriptable:n,isIndexable:r}=z2(e);for(const i of t){const s=n(i),o=r(i),a=(o||s)&&e[i];if(s&&(ei(a)||BO(a))||o&&ot(a))return!0}return!1}var zO="4.5.0";const HO=["top","bottom","left","right","chartArea"];function sy(e,t){return e==="top"||e==="bottom"||HO.indexOf(e)===-1&&t==="x"}function oy(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function ay(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),et(n&&n.onComplete,[e],t)}function UO(e){const t=e.chart,n=t.options.animation;et(n&&n.onProgress,[e],t)}function ub(e){return Qf()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const ql={},ly=e=>{const t=ub(e);return Object.values(ql).filter(n=>n.canvas===t).pop()};function GO(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 KO(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}var $r;let Qu=($r=class{static register(...t){Kn.add(...t),uy()}static unregister(...t){Kn.remove(...t),uy()}constructor(t,n){const r=this.config=new FO(n),i=ub(t),s=ly(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||cO(i)),this.platform.updateConfig(r);const a=this.platform.acquireContext(i,o.aspectRatio),l=a&&a.canvas,u=l&&l.height,c=l&&l.width;if(this.id=X7(),this.ctx=a,this.canvas=l,this.width=c,this.height=u,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 AO,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=p9(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],ql[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}lr.listen(this,"complete",ay),lr.listen(this,"progress",UO),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 Kn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Lg(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return jg(this.canvas,this.ctx),this}stop(){return lr.stop(this),this}resize(t,n){lr.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,Lg(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),et(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=Hd(o,a),u=l==="r",c=l==="x";return{options:a,dposition:u?"chartArea":c?"bottom":"left",dtype:u?"radialLinear":c?"category":"linear"}}))),Qe(s,o=>{const a=o.options,l=a.id,u=Hd(l,a),c=Le(a.type,o.dtype);(a.position===void 0||sy(a.position,u)!==sy(o.dposition))&&(a.position=o.dposition),i[l]=!0;let d=null;if(l in r&&r[l].type===c)d=r[l];else{const f=Kn.getScale(c);d=new f({id:l,type:c,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,t)}),Qe(i,(o,a)=>{o||delete r[a]}),Qe(r,o=>{wn.configure(this,o,o.options),wn.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(oy("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||zd(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=Kn.getController(a),{datasetElementType:u,dataElementType:c}=ct.datasets[a];Object.assign(l,{dataElementType:Kn.getElement(c),datasetElementType:u&&Kn.getElement(u)}),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 u=0,c=this.data.datasets.length;u<c;u++){const{controller:d}=this.getDatasetMeta(u),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,u=>{u.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(oy("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=>{wn.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!Sg(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;GO(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(!Sg(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;wn.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,ei(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&&(lr.has(this)?this.attached&&!lr.running(this)&&lr.start(this):(this.draw(),ay({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=Z2(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(i&&Gu(n,i),t.controller.draw(),i&&Ku(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return mr(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const s=Hk.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=ai(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);au(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(),lr.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(),jg(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete ql[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,u)=>{n.addEventListener(this,l,u),t[l]=u},i=(l,u)=>{t[l]&&(n.removeEventListener(this,l,u),delete t[l])},s=(l,u)=>{this.canvas&&this.resize(l,u)};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 u=o&&this.getDatasetMeta(o.datasetIndex).controller;u&&u[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}});!su(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,u)=>l.filter(c=>!u.some(d=>c.datasetIndex===d.datasetIndex&&c.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=r9(t),u=KO(t,this._lastEvent,r,l);r&&(this._lastEvent=null,et(s.onHover,[t,a,this],this),l&&et(s.onClick,[t,a,this],this));const c=!su(a,i);return(c||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=u,c}_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($r,"defaults",ct),pe($r,"instances",ql),pe($r,"overrides",qi),pe($r,"registry",Kn),pe($r,"version",zO),pe($r,"getChart",ly),$r);function uy(){return Qe(Qu.instances,e=>e._plugins.invalidate())}function cb(e,t,n=t){e.lineCap=Le(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Le(n.borderDash,t.borderDash)),e.lineDashOffset=Le(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Le(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Le(n.borderWidth,t.borderWidth),e.strokeStyle=Le(n.borderColor,t.borderColor)}function VO(e,t,n){e.lineTo(n.x,n.y)}function WO(e){return e.stepped?M9:e.tension||e.cubicInterpolationMode==="monotone"?$9:VO}function db(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),u=Math.min(s,a),c=i<o&&s<o||i>a&&s>a;return{count:r,start:l,loop:t.loop,ilen:u<l&&!c?r+u-l:u-l}}function QO(e,t,n,r){const{points:i,options:s}=t,{count:o,start:a,loop:l,ilen:u}=db(i,n,r),c=WO(s);let{move:d=!0,reverse:f}=r||{},h,g,m;for(h=0;h<=u;++h)g=i[(a+(f?u-h:h))%o],!g.skip&&(d?(e.moveTo(g.x,g.y),d=!1):c(e,m,g,f,s.stepped),m=g);return l&&(g=i[(a+(f?u:0))%o],c(e,m,g,f,s.stepped)),!!l}function YO(e,t,n,r){const i=t.points,{count:s,start:o,ilen:a}=db(i,n,r),{move:l=!0,reverse:u}=r||{};let c=0,d=0,f,h,g,m,p,v;const b=C=>(o+(u?a-C:C))%s,S=()=>{m!==p&&(e.lineTo(c,p),e.lineTo(c,m),e.lineTo(c,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,w=h.y,O=C|0;O===g?(w<m?m=w:w>p&&(p=w),c=(d*c+C)/++d):(S(),e.lineTo(C,w),g=O,d=0,m=p=w),v=w}S()}function Ud(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?YO:QO}function XO(e){return e.stepped?hk:e.tension||e.cubicInterpolationMode==="monotone"?gk:pi}function ZO(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),cb(e,t.options),e.stroke(i)}function JO(e,t,n,r){const{segments:i,options:s}=t,o=Ud(t);for(const a of i)cb(e,s,a.style),e.beginPath(),o(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const eE=typeof Path2D=="function";function tE(e,t,n,r){eE&&!t.options.segment?ZO(e,t,n,r):JO(e,t,n,r)}class Vr extends Yi{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;sk(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=xk(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=X2(this,{property:n,start:i,end:i});if(!o.length)return;const a=[],l=XO(r);let u,c;for(u=0,c=o.length;u<c;++u){const{start:d,end:f}=o[u],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 Ud(this)(t,this,n,r)}path(t,n,r){const i=this.segments,s=Ud(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(),tE(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}pe(Vr,"id","line"),pe(Vr,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),pe(Vr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),pe(Vr,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function cy(e,t,n,r){const i=e.options,{[n]:s}=e.getProps([n],r);return Math.abs(t-s)<i.radius+i.hitRadius}class zl extends Yi{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 cy(this,n,"x",r)}inYRange(n,r){return cy(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||!mr(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,qd(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}pe(zl,"id","point"),pe(zl,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),pe(zl,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function nE(e,t,n){const r=e.segments,i=e.points,s=t.points,o=[];for(const a of r){let{start:l,end:u}=a;u=Yu(l,u,i);const c=Gd(n,i[l],i[u],a.loop);if(!t.segments){o.push({source:a,target:c,start:i[l],end:i[u]});continue}const d=X2(t,c);for(const f of d){const h=Gd(n,s[f.start],s[f.end],f.loop),g=Y2(a,i,h);for(const m of g)o.push({source:m,target:f,start:{[n]:dy(c,h,"start",Math.max)},end:{[n]:dy(c,h,"end",Math.min)}})}}return o}function Gd(e,t,n,r){if(r)return;let i=t[e],s=n[e];return e==="angle"&&(i=sn(i),s=sn(s)),{property:e,start:i,end:s}}function rE(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,s=[];return t.segments.forEach(({start:o,end:a})=>{a=Yu(o,a,i);const l=i[o],u=i[a];r!==null?(s.push({x:l.x,y:r}),s.push({x:u.x,y:r})):n!==null&&(s.push({x:n,y:l.y}),s.push({x:n,y:u.y}))}),s}function Yu(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function dy(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function fb(e,t){let n=[],r=!1;return ot(e)?(r=!0,n=e):n=rE(e,t),n.length?new Vr({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function fy(e){return e&&e.fill!==!1}function iE(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(!bt(i))return i;if(o=e[i],!o)return!1;if(o.visible)return i;s.push(i),i=o.fill}return!1}function sE(e,t,n){const r=uE(e);if(Ie(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return bt(i)&&Math.floor(i)===i?oE(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function oE(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function aE(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:Ie(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function lE(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:Ie(e)?r=e.value:r=t.getBaseValue(),r}function uE(e){const t=e.options,n=t.fill;let r=Le(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function cE(e){const{scale:t,index:n,line:r}=e,i=[],s=r.segments,o=r.points,a=dE(t,n);a.push(fb({x:null,y:t.bottom},r));for(let l=0;l<s.length;l++){const u=s[l];for(let c=u.start;c<=u.end;c++)fE(i,o[c],a)}return new Vr({points:i,options:{}})}function dE(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 fE(e,t,n){const r=[];for(let i=0;i<n.length;i++){const s=n[i],{first:o,last:a,point:l}=hE(s,t,"x");if(!(!l||o&&a)){if(o)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function hE(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 u=0;u<s.length;u++){const c=s[u],d=o[c.start][n],f=o[c.end][n];if(cs(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:un},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 gE(e){const{chart:t,fill:n,line:r}=e;if(bt(n))return yE(t,n);if(n==="stack")return cE(e);if(n==="shape")return!0;const i=mE(e);return i instanceof hb?i:fb(i,r)}function yE(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function mE(e){return(e.scale||{}).getPointPositionForValue?vE(e):pE(e)}function pE(e){const{scale:t={},fill:n}=e,r=aE(n,t);if(bt(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function vE(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,s=r.reverse?t.max:t.min,o=lE(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 zc(e,t,n){const r=gE(t),{chart:i,index:s,line:o,scale:a,axis:l}=t,u=o.options,c=u.fill,d=u.backgroundColor,{above:f=d,below:h=d}=c||{},g=i.getDatasetMeta(s),m=Z2(i,g);r&&o.points.length&&(Gu(e,n),bE(e,{line:o,target:r,above:f,below:h,area:n,scale:a,axis:l,clip:m}),Ku(e))}function bE(e,t){const{line:n,target:r,above:i,below:s,area:o,scale:a,clip:l}=t,u=n._loop?"angle":t.axis;e.save();let c=s;s!==i&&(u==="x"?(hy(e,r,o.top),Hc(e,{line:n,target:r,color:i,scale:a,property:u,clip:l}),e.restore(),e.save(),hy(e,r,o.bottom)):u==="y"&&(gy(e,r,o.left),Hc(e,{line:n,target:r,color:s,scale:a,property:u,clip:l}),e.restore(),e.save(),gy(e,r,o.right),c=i)),Hc(e,{line:n,target:r,color:c,scale:a,property:u,clip:l}),e.restore()}function hy(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:u}=a,c=i[l],d=i[Yu(l,u,i)];s?(e.moveTo(c.x,c.y),s=!1):(e.lineTo(c.x,n),e.lineTo(c.x,c.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 gy(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:u}=a,c=i[l],d=i[Yu(l,u,i)];s?(e.moveTo(c.x,c.y),s=!1):(e.lineTo(n,c.y),e.lineTo(c.x,c.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 Hc(e,t){const{line:n,target:r,property:i,color:s,scale:o,clip:a}=t,l=nE(n,r,i);for(const{source:u,target:c,start:d,end:f}of l){const{style:{backgroundColor:h=s}={}}=u,g=r!==!0;e.save(),e.fillStyle=h,xE(e,o,a,g&&Gd(i,d,f)),e.beginPath();const m=!!n.pathSegment(e,u);let p;if(g){m?e.closePath():yy(e,r,f,i);const v=!!r.pathSegment(e,c,{move:m,reverse:!0});p=m&&v,p||yy(e,r,d,i)}e.closePath(),e.fill(p?"evenodd":"nonzero"),e.restore()}}function xE(e,t,n,r){const i=t.chart.chartArea,{property:s,start:o,end:a}=r||{};if(s==="x"||s==="y"){let l,u,c,d;s==="x"?(l=o,u=i.top,c=a,d=i.bottom):(l=i.left,u=o,c=i.right,d=a),e.beginPath(),n&&(l=Math.max(l,n.left),c=Math.min(c,n.right),u=Math.max(u,n.top),d=Math.min(d,n.bottom)),e.rect(l,u,c-l,d-u),e.clip()}}function yy(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var wE={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 Vr&&(l={visible:e.isDatasetVisible(o),index:o,fill:sE(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=iE(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&&zc(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;fy(s)&&zc(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!fy(r)||n.drawTime!=="beforeDatasetDraw"||zc(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const my=(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)}},SE=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class py extends Yi{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=et(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=mt(r.font),s=i.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=my(r,s);let u,c;n.font=i.string,this.isHorizontal()?(u=this.maxWidth,c=this._fitRows(o,s,a,l)+10):(c=this.maxHeight,u=this._fitCols(o,i,a,l)+10),this.width=Math.min(u,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,i){const{ctx:s,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],u=this.lineWidths=[0],c=i+a;let d=t;s.textAlign="left",s.textBaseline="middle";let f=-1,h=-c;return this.legendItems.forEach((g,m)=>{const p=r+n/2+s.measureText(g.text).width;(m===0||u[u.length-1]+p+2*a>o)&&(d+=c,u[u.length-(m>0?0:1)]=0,h+=c,f++),l[m]={left:0,top:h,row:f,width:p,height:i},u[u.length-1]+=p+a}),d}_fitCols(t,n,r,i){const{ctx:s,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],u=this.columnSizes=[],c=o-t;let d=a,f=0,h=0,g=0,m=0;return this.legendItems.forEach((p,v)=>{const{itemWidth:b,itemHeight:S}=CE(r,n,s,p,i);v>0&&h+S+2*a>c&&(d+=f+a,u.push({width:f,height:h}),g+=f+a,m++,f=h=0),l[v]={left:g,top:h,col:m,width:b,height:S},f=Math.max(f,b),h+=S+a}),d+=f,u.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=fs(s,this.left,this.width);if(this.isHorizontal()){let a=0,l=Ot(r,this.left+i,this.right-this.lineWidths[a]);for(const u of n)a!==u.row&&(a=u.row,l=Ot(r,this.left+i,this.right-this.lineWidths[a])),u.top+=this.top+t+i,u.left=o.leftForLtr(o.x(l),u.width),l+=u.width+i}else{let a=0,l=Ot(r,this.top+t+i,this.bottom-this.columnSizes[a].height);for(const u of n)u.col!==a&&(a=u.col,l=Ot(r,this.top+t+i,this.bottom-this.columnSizes[a].height)),u.top=l,u.left+=this.left+i,u.left=o.leftForLtr(o.x(u.left),u.width),l+=u.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Gu(t,this),this._draw(),Ku(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:s,labels:o}=t,a=ct.color,l=fs(t.rtl,this.left,this.width),u=mt(o.font),{padding:c}=o,d=u.size,f=d/2;let h;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=u.string;const{boxWidth:g,boxHeight:m,itemHeight:p}=my(o,d),v=function(O,x,_){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;i.save();const k=Le(_.lineWidth,1);if(i.fillStyle=Le(_.fillStyle,a),i.lineCap=Le(_.lineCap,"butt"),i.lineDashOffset=Le(_.lineDashOffset,0),i.lineJoin=Le(_.lineJoin,"miter"),i.lineWidth=k,i.strokeStyle=Le(_.strokeStyle,a),i.setLineDash(Le(_.lineDash,[])),o.usePointStyle){const E={radius:m*Math.SQRT2/2,pointStyle:_.pointStyle,rotation:_.rotation,borderWidth:k},j=l.xPlus(O,g/2),M=x+f;B2(i,E,j,M,o.pointStyleWidth&&g)}else{const E=x+Math.max((d-m)/2,0),j=l.leftForLtr(O,g),M=ds(_.borderRadius);i.beginPath(),Object.values(M).some(B=>B!==0)?cu(i,{x:j,y:E,w:g,h:m,radius:M}):i.rect(j,E,g,m),i.fill(),k!==0&&i.stroke()}i.restore()},b=function(O,x,_){zi(i,_.text,O,x+p/2,u,{strikethrough:_.hidden,textAlign:l.textAlign(_.textAlign)})},S=this.isHorizontal(),C=this._computeTitleHeight();S?h={x:Ot(s,this.left+c,this.right-r[0]),y:this.top+c+C,line:0}:h={x:this.left+c,y:Ot(s,this.top+C+c,this.bottom-n[0].height),line:0},V2(this.ctx,t.textDirection);const w=p+c;this.legendItems.forEach((O,x)=>{i.strokeStyle=O.fontColor,i.fillStyle=O.fontColor;const _=i.measureText(O.text).width,k=l.textAlign(O.textAlign||(O.textAlign=o.textAlign)),E=g+f+_;let j=h.x,M=h.y;l.setWidth(this.width),S?x>0&&j+E+c>this.right&&(M=h.y+=w,h.line++,j=h.x=Ot(s,this.left+c,this.right-r[h.line])):x>0&&M+w>this.bottom&&(j=h.x=j+n[h.line].width+c,h.line++,M=h.y=Ot(s,this.top+C+c,this.bottom-n[h.line].height));const B=l.x(j);if(v(B,M,O),j=v9(k,j+g+f,S?j+E:this.right,t.rtl),b(l.x(j),M,O),S)h.x+=E+c;else if(typeof O.text!="string"){const R=u.lineHeight;h.y+=gb(O,R)+c}else h.y+=w}),W2(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=mt(n.font),i=jt(n.padding);if(!n.display)return;const s=fs(t.rtl,this.left,this.width),o=this.ctx,a=n.position,l=r.size/2,u=i.top+l;let c,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),c=this.top+u,d=Ot(t.align,d,this.right-f);else{const g=this.columnSizes.reduce((m,p)=>Math.max(m,p.height),0);c=u+Ot(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const h=Ot(a,d,d+f);o.textAlign=s.textAlign(Hf(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=r.string,zi(o,n.text,h,c,r)}_computeTitleHeight(){const t=this.options.title,n=mt(t.font),r=jt(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,s;if(cs(t,this.left,this.right)&&cs(n,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(i=s[r],cs(t,i.left,i.left+i.width)&&cs(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!OE(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,s=SE(i,r);i&&!s&&et(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!s&&et(n.onHover,[t,r,this],this)}else r&&et(n.onClick,[t,r,this],this)}}function CE(e,t,n,r,i){const s=_E(r,e,t,n),o=kE(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 kE(e,t,n){let r=e;return typeof t.text!="string"&&(r=gb(t,n)),r}function gb(e,t){const n=e.text?e.text.length:0;return t*n}function OE(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var EE={id:"legend",_element:py,start(e,t,n){const r=e.legend=new py({ctx:e.ctx,options:n,chart:e});wn.configure(e,r,n),wn.addBox(e,r)},stop(e){wn.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;wn.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 u=l.controller.getStyle(n?0:void 0),c=jt(u.borderWidth);return{text:t[l.index].label,fillStyle:u.backgroundColor,fontColor:s,hidden:!l.visible,lineCap:u.borderCapStyle,lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:u.borderColor,pointStyle:r||u.pointStyle,rotation:u.rotation,textAlign:i||u.textAlign,borderRadius:o&&(a||u.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 yb extends Yi{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=ot(r.text)?r.text.length:1;this._padding=jt(r.padding);const s=i*mt(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,u,c,d;return this.isHorizontal()?(c=Ot(a,r,s),d=n+t,u=s-r):(o.position==="left"?(c=r+t,d=Ot(a,i,n),l=ht*-.5):(c=s-t,d=Ot(a,n,i),l=ht*.5),u=i-n),{titleX:c,titleY:d,maxWidth:u,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=mt(n.font),s=r.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:u}=this._drawArgs(s);zi(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:u,textAlign:Hf(n.align),textBaseline:"middle",translation:[o,a]})}}function AE(e,t){const n=new yb({ctx:e.ctx,options:t,chart:e});wn.configure(e,n,t),wn.addBox(e,n),e.titleBlock=n}var TE={id:"title",_element:yb,start(e,t,n){AE(e,n)},stop(e){const t=e.titleBlock;wn.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;wn.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 Ro={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 u=l.getCenterPoint(),c=Fd(t,u);c<i&&(i=c,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function Gn(e,t){return t&&(ot(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function ur(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
66
66
  `)>-1?e.split(`
67
- `):e}function OE(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 my(e,t){const n=e.chart.ctx,{body:r,footer:i,title:s}=e,{boxWidth:o,boxHeight:a}=t,l=mt(t.bodyFont),u=mt(t.titleFont),c=mt(t.footerFont),d=s.length,f=i.length,h=r.length,g=jt(t.padding);let m=g.height,p=0,v=r.reduce((C,w)=>C+w.before.length+w.lines.length+w.after.length,0);if(v+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*u.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*c.lineHeight+(f-1)*t.footerSpacing);let b=0;const S=function(C){p=Math.max(p,n.measureText(C).width+b)};return n.save(),n.font=u.string,Qe(e.title,S),n.font=l.string,Qe(e.beforeBody.concat(e.afterBody),S),b=t.displayColors?o+2+t.boxPadding:0,Qe(r,C=>{Qe(C.before,S),Qe(C.lines,S),Qe(C.after,S)}),b=0,n.font=c.string,Qe(e.footer,S),n.restore(),p+=g.width,{width:p,height:m}}function EE(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function AE(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 TE(e,t,n,r){const{x:i,width:s}=n,{width:o,chartArea:{left:a,right:l}}=e;let u="center";return r==="center"?u=i<=(a+l)/2?"left":"right":i<=s/2?u="left":i>=o-s/2&&(u="right"),AE(u,e,t,n)&&(u="center"),u}function py(e,t,n){const r=n.yAlign||t.yAlign||EE(e,n);return{xAlign:n.xAlign||t.xAlign||TE(e,t,n,r),yAlign:r}}function PE(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function jE(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function vy(e,t,n,r){const{caretSize:i,caretPadding:s,cornerRadius:o}=e,{xAlign:a,yAlign:l}=n,u=i+s,{topLeft:c,topRight:d,bottomLeft:f,bottomRight:h}=ls(o);let g=PE(t,a);const m=jE(t,l,u);return l==="center"?a==="left"?g+=u:a==="right"&&(g-=u):a==="left"?g-=Math.max(c,f)+i:a==="right"&&(g+=Math.max(d,h)+i),{x:bn(g,0,r.width-t.width),y:bn(m,0,r.height-t.height)}}function bl(e,t,n){const r=jt(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function by(e){return Un([],ar(e))}function ME(e,t,n){return ii(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function xy(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const fb={beforeTitle:rr,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:rr,beforeBody:rr,beforeLabel:rr,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:rr,afterBody:rr,beforeFooter:rr,footer:rr,afterFooter:rr};function Rt(e,t,n,r){const i=e[t].call(n,r);return typeof i=="undefined"?fb[t].call(n,r):i}class Ud extends Ki{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 Q2(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=ME(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=Rt(r,"beforeTitle",this,t),s=Rt(r,"title",this,t),o=Rt(r,"afterTitle",this,t);let a=[];return a=Un(a,ar(i)),a=Un(a,ar(s)),a=Un(a,ar(o)),a}getBeforeBody(t,n){return by(Rt(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return Qe(t,s=>{const o={before:[],lines:[],after:[]},a=xy(r,s);Un(o.before,ar(Rt(a,"beforeLabel",this,s))),Un(o.lines,Rt(a,"label",this,s)),Un(o.after,ar(Rt(a,"afterLabel",this,s))),i.push(o)}),i}getAfterBody(t,n){return by(Rt(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=Rt(r,"beforeFooter",this,t),s=Rt(r,"footer",this,t),o=Rt(r,"afterFooter",this,t);let a=[];return a=Un(a,ar(i)),a=Un(a,ar(s)),a=Un(a,ar(o)),a}_createItems(t){const n=this._active,r=this.chart.data,i=[],s=[],o=[];let a=[],l,u;for(l=0,u=n.length;l<u;++l)a.push(OE(this.chart,n[l]));return t.filter&&(a=a.filter((c,d,f)=>t.filter(c,d,f,r))),t.itemSort&&(a=a.sort((c,d)=>t.itemSort(c,d,r))),Qe(a,c=>{const d=xy(t.callbacks,c);i.push(Rt(d,"labelColor",this,c)),s.push(Rt(d,"labelPointStyle",this,c)),o.push(Rt(d,"labelTextColor",this,c))}),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=Lo[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=my(this,r),u=Object.assign({},a,l),c=py(this.chart,r,u),d=vy(r,u,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.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:u,bottomLeft:c,bottomRight:d}=ls(a),{x:f,y:h}=t,{width:g,height:m}=n;let p,v,b,S,C,w;return s==="center"?(C=h+m/2,i==="left"?(p=f,v=p-o,S=C+o,w=C-o):(p=f+g,v=p+o,S=C-o,w=C+o),b=p):(i==="left"?v=f+Math.max(l,c)+o:i==="right"?v=f+g-Math.max(u,d)-o:v=this.caretX,s==="top"?(S=h,C=S-o,p=v-o,b=v+o):(S=h+m,C=S+o,p=v+o,b=v-o),w=S),{x1:p,x2:v,x3:b,y1:S,y2:C,y3:w}}drawTitle(t,n,r){const i=this.title,s=i.length;let o,a,l;if(s){const u=us(r.rtl,this.x,this.width);for(t.x=bl(this,r.titleAlign,r),n.textAlign=u.textAlign(r.titleAlign),n.textBaseline="middle",o=mt(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=o.string,l=0;l<s;++l)n.fillText(i[l],u.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:u}=s,c=mt(s.bodyFont),d=bl(this,"left",s),f=i.x(d),h=l<c.lineHeight?(c.lineHeight-l)/2:0,g=n.y+h;if(s.usePointStyle){const m={radius:Math.min(u,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},p=i.leftForLtr(f,u)+u/2,v=g+l/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,Fd(t,m,p,v),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Fd(t,m,p,v)}else{t.lineWidth=Ie(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,u),p=i.leftForLtr(i.xPlus(f,1),u-2),v=ls(o.borderRadius);Object.values(v).some(b=>b!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,au(t,{x:m,y:g,w:u,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),au(t,{x:p,y:g+1,w:u-2,h:l-2,radius:v}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(m,g,u,l),t.strokeRect(m,g,u,l),t.fillStyle=o.backgroundColor,t.fillRect(p,g+1,u-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:u,boxPadding:c}=r,d=mt(r.bodyFont);let f=d.lineHeight,h=0;const g=us(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,S,C,w,O,x;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=bl(this,p,r),n.fillStyle=r.bodyColor,Qe(this.beforeBody,m),h=a&&p!=="right"?o==="center"?u/2+c:u+2+c:0,C=0,O=i.length;C<O;++C){for(v=i[C],b=this.labelTextColors[C],n.fillStyle=b,Qe(v.before,m),S=v.lines,a&&S.length&&(this._drawColorBox(n,t,C,g,r),f=Math.max(d.lineHeight,l)),w=0,x=S.length;w<x;++w)m(S[w]),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=us(r.rtl,this.x,this.width);for(t.x=bl(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",o=mt(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:u,height:c}=r,{topLeft:d,topRight:f,bottomLeft:h,bottomRight:g}=ls(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+u-f,l),n.quadraticCurveTo(a+u,l,a+u,l+f),o==="center"&&s==="right"&&this.drawCaret(t,n,r,i),n.lineTo(a+u,l+c-g),n.quadraticCurveTo(a+u,l+c,a+u-g,l+c),o==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(a+h,l+c),n.quadraticCurveTo(a,l+c,a,l+c-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=Lo[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=my(this,t),l=Object.assign({},o,this._size),u=py(n,t,l),c=vy(t,l,u,n);(i._to!==c.x||s._to!==c.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,c))}}_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=jt(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),H2(t,n.textDirection),s.y+=o.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),U2(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:a,index:l})=>{const u=this.chart.getDatasetMeta(a);if(!u)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:u.data[l],index:l}}),s=!nu(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||!nu(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=Lo[s.position].call(this,t,n);return o!==!1&&(r!==o.x||i!==o.y)}}pe(Ud,"positioners",Lo);var $E={id:"tooltip",_element:Ud,positioners:Lo,afterInit(e,t,n){n&&(e.tooltip=new Ud({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:fb},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 LE=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function DE(e,t,n,r){const i=e.indexOf(t);if(i===-1)return LE(e,t,n,r);const s=e.lastIndexOf(t);return i!==s?n:i}const IE=(e,t)=>e===null?null:bn(Math.round(e),0,t);function wy(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Gd extends to{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:DE(r,t,Le(n,t),this._addedLabels),IE(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 wy.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(Gd,"id","category"),pe(Gd,"defaults",{ticks:{callback:wy}});function RE(e,t){const n=[],{bounds:i,step:s,min:o,max:a,precision:l,count:u,maxTicks:c,maxDigits:d,includeBounds:f}=e,h=s||1,g=c-1,{min:m,max:p}=t,v=!Ye(o),b=!Ye(a),S=!Ye(u),C=(p-m)/(d+1);let w=Sg((p-m)/g/h)*h,O,x,_,k;if(w<1e-14&&!v&&!b)return[{value:m},{value:p}];k=Math.ceil(p/w)-Math.floor(m/w),k>g&&(w=Sg(k*w/g/h)*h),Ye(l)||(O=Math.pow(10,l),w=Math.ceil(w*O)/O),i==="ticks"?(x=Math.floor(m/w)*w,_=Math.ceil(p/w)*w):(x=m,_=p),v&&b&&s&&i9((a-o)/s,w/1e3)?(k=Math.round(Math.min((a-o)/w,c)),w=(a-o)/k,x=o,_=a):S?(x=v?o:x,_=b?a:_,k=u-1,w=(_-x)/k):(k=(_-x)/w,Ho(k,Math.round(k),w/1e3)?k=Math.round(k):k=Math.ceil(k));const E=Math.max(Cg(w),Cg(x));O=Math.pow(10,Ye(l)?E:l),x=Math.round(x*O)/O,_=Math.round(_*O)/O;let P=0;for(v&&(f&&x!==o?(n.push({value:o}),x<o&&P++,Ho(Math.round((x+P*w)*O)/O,o,Sy(o,C,e))&&P++):x<o&&P++);P<k;++P){const M=Math.round((x+P*w)*O)/O;if(b&&M>a)break;n.push({value:M})}return b&&f&&_!==a?n.length&&Ho(n[n.length-1].value,a,Sy(a,C,e))?n[n.length-1].value=a:n.push({value:a}):(!b||_===a)&&n.push({value:_}),n}function Sy(e,t,{horizontal:n,minRotation:r}){const i=Hr(r),s=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(""+e).length;return Math.min(t/s,o)}class Vd extends to{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=Hs(i),u=Hs(s);l<0&&u<0?a(0):l>0&&u>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=RE(i,s);return t.bounds==="ticks"&&s9(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 D2(t,this.chart.options.locale,this.options.ticks.format)}}class Kd extends Vd{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=bt(t)?t:0,this.max=bt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Hr(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(Kd,"id","linear"),pe(Kd,"defaults",{ticks:{callback:Hf.formatters.numeric}});function Wd(e){const t=e.ticks;if(t.display&&e.display){const n=jt(t.backdropPadding);return Le(t.font&&t.font.size,ct.font.size)+n.height}return 0}function NE(e,t,n){return n=ot(n)?n:[n],{w:E9(e,t.string,n),h:n.length*t.lineHeight}}function Cy(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 FE(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],s=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?ht/s:0;for(let l=0;l<s;l++){const u=o.setContext(e.getPointLabelContext(l));i[l]=u.padding;const c=e.getPointPosition(l,e.drawingArea+i[l],a),d=mt(u.font),f=NE(e.ctx,d,e._pointLabels[l]);r[l]=f;const h=rn(e.getIndexAngle(l)+a),g=Math.round(Ff(h)),m=Cy(g,c.x,f.w,0,180),p=Cy(g,c.y,f.h,90,270);BE(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=HE(e,r,i)}function BE(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 qE(e,t,n){const r=e.drawingArea,{extra:i,additionalAngle:s,padding:o,size:a}=n,l=e.getPointPosition(t,r+i+o,s),u=Math.round(Ff(rn(l.angle+an))),c=VE(l.y,a.h,u),d=UE(u),f=GE(l.x,a.w,d);return{visible:!0,x:l.x,y:c,textAlign:d,left:f,top:c,right:f+a.w,bottom:c+a.h}}function zE(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:s}=e;return!(hr({x:n,y:r},t)||hr({x:n,y:s},t)||hr({x:i,y:r},t)||hr({x:i,y:s},t))}function HE(e,t,n){const r=[],i=e._pointLabels.length,s=e.options,{centerPointLabels:o,display:a}=s.pointLabels,l={extra:Wd(s)/2,additionalAngle:o?ht/i:0};let u;for(let c=0;c<i;c++){l.padding=n[c],l.size=t[c];const d=qE(e,c,l);r.push(d),a==="auto"&&(d.visible=zE(d,u),d.visible&&(u=d))}return r}function UE(e){return e===0||e===180?"center":e<180?"left":"right"}function GE(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function VE(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function KE(e,t,n){const{left:r,top:i,right:s,bottom:o}=n,{backdropColor:a}=t;if(!Ye(a)){const l=ls(t.borderRadius),u=jt(t.backdropPadding);e.fillStyle=a;const c=r-u.left,d=i-u.top,f=s-r+u.width,h=o-i+u.height;Object.values(l).some(g=>g!==0)?(e.beginPath(),au(e,{x:c,y:d,w:f,h,radius:l}),e.fill()):e.fillRect(c,d,f,h)}}function WE(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));KE(n,o,s);const a=mt(o.font),{x:l,y:u,textAlign:c}=s;Fi(n,e._pointLabels[i],l,u+a.lineHeight/2,a,{color:o.color,textAlign:c,textBaseline:"middle"})}}function hb(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,ln);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 QE(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(),hb(e,n,o,r),s.closePath(),s.stroke(),s.restore())}function YE(e,t,n){return ii(e,{label:n,index:t,type:"pointLabel"})}class Do extends Vd{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=jt(Wd(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=bt(t)&&!isNaN(t)?t:0,this.max=bt(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Wd(this.options))}generateTickLabels(t){Vd.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const i=et(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?FE(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=ln/(this._pointLabels.length||1),r=this.options.startAngle||0;return rn(t*n+Hr(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 YE(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const i=this.getIndexAngle(t)-an+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(),hb(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,u;if(n.pointLabels.display&&WE(this,o),i.display&&this.ticks.forEach((c,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(c.value);const f=this.getContext(d),h=i.setContext(f),g=s.setContext(f);QE(this,h,l,o,g)}}),r.display){for(t.save(),a=o-1;a>=0;a--){const c=r.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=c;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,l=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),u=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(u.x,u.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 u=r.setContext(this.getContext(l)),c=mt(u.font);if(s=this.getDistanceFromCenterForValue(this.ticks[l].value),u.showLabelBackdrop){t.font=c.string,o=t.measureText(a.label).width,t.fillStyle=u.backdropColor;const d=jt(u.backdropPadding);t.fillRect(-o/2-d.left,-s-c.size/2-d.top,o+d.width,c.size+d.height)}Fi(t,a.label,0,-s,c,{color:u.color,strokeColor:u.textStrokeColor,strokeWidth:u.textStrokeWidth})}),t.restore()}drawTitle(){}}pe(Do,"id","radialLinear"),pe(Do,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Hf.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),pe(Do,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),pe(Do,"descriptors",{angleLines:{_fallback:"grid"}});const Wu={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},qt=Object.keys(Wu);function _y(e,t){return e-t}function ky(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)),bt(o)||(o=typeof r=="string"?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i==="week"&&(da(s)||s===!0)?n.startOf(o,"isoWeek",s):n.startOf(o,i)),+o)}function Oy(e,t,n,r){const i=qt.length;for(let s=qt.indexOf(e);s<i-1;++s){const o=Wu[qt[s]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-t)/(a*o.size))<=r)return qt[s]}return qt[i-1]}function XE(e,t,n,r,i){for(let s=qt.length-1;s>=qt.indexOf(n);s--){const o=qt[s];if(Wu[o].common&&e._adapter.diff(i,r,o)>=t-1)return o}return qt[n?qt.indexOf(n):0]}function ZE(e){for(let t=qt.indexOf(e)+1,n=qt.length;t<n;++t)if(Wu[qt[t]].common)return qt[t]}function Ey(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=Bf(n,t),s=n[r]>=t?n[r]:n[i];e[s]=!0}}function JE(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 Ay(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:JE(e,r,i,n)}class cu extends to{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 Lk._date(t.adapters.date);i.init(n),zo(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:ky(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(u){!o&&!isNaN(u.min)&&(i=Math.min(i,u.min)),!a&&!isNaN(u.max)&&(s=Math.max(s,u.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=bt(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),s=bt(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=c9(i,s,o);return this._unit=n.unit||(r.autoSkip?Oy(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):XE(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:ZE(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),Ay(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=bn(n,0,o),r=bn(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||Oy(s.minUnit,n,r,this._getLabelCapacity(n)),a=Le(i.ticks.stepSize,1),l=o==="week"?s.isoWeekday:!1,u=da(l)||l===!0,c={};let d=n,f,h;if(u&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,u?"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++)Ey(c,f,g);return(f===r||i.bounds==="ticks"||h===1)&&Ey(c,f,g),Object.keys(c).sort(_y).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 et(o,[t,n,r],this);const a=s.time.displayFormats,l=this._unit,u=this._majorUnit,c=l&&a[l],d=u&&a[u],f=r[n],h=u&&d&&f&&f.major;return this._adapter.format(t,i||(h?d:c))}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=Hr(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,Ay(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(ky(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return f9(t.sort(_y))}}pe(cu,"id","time"),pe(cu,"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 xl(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}=bi(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}=bi(e,"time",t)),{time:s,pos:a}=e[r],{time:o,pos:l}=e[i]);const u=o-s;return u?a+(l-a)*(t-s)/u:a}class Ty extends cu{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=xl(n,this.min),this._tableRange=xl(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],s=[];let o,a,l,u,c;for(o=0,a=t.length;o<a;++o)u=t[o],u>=n&&u<=r&&i.push(u);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(o=0,a=i.length;o<a;++o)c=i[o+1],l=i[o-1],u=i[o],Math.round((c+l)/2)!==u&&s.push({time:u,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(xl(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return xl(this._table,r*this._tableRange+this._minPos,!0)}}pe(Ty,"id","timeseries"),pe(Ty,"defaults",cu.defaults);const gb="label";function Py(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function eA(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function yb(e,t){e.labels=t}function mb(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 tA(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:gb;const n={labels:[],datasets:[]};return yb(n,e.labels),mb(n,e.datasets,t),n}function nA(e,t){const{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:s,type:o,data:a,options:l,plugins:u=[],fallbackContent:c,updateMode:d,...f}=e,h=z.useRef(null),g=z.useRef(null),m=()=>{h.current&&(g.current=new Vu(h.current,{type:o,data:tA(a,s),options:l&&{...l},plugins:u}),Py(t,g.current))},p=()=>{Py(t,null),g.current&&(g.current.destroy(),g.current=null)};return z.useEffect(()=>{!i&&g.current&&l&&eA(g.current,l)},[i,l]),z.useEffect(()=>{!i&&g.current&&yb(g.current.config.data,a.labels)},[i,a.labels]),z.useEffect(()=>{!i&&g.current&&a.datasets&&mb(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},c)}const rA=z.forwardRef(nA);function pb(e,t){return Vu.register(t),z.forwardRef((n,r)=>z.createElement(rA,{...n,ref:r,type:e}))}const iA=pb("line",Ll),sA=pb("radar",Dl);Vu.register(Gd,Kd,Do,Ur,Nl,pE,kE,$E,CE);var Qd={elements:{line:{backgroundColor:"rgba(166, 30, 105, 0.2)",borderColor:"rgba(166, 30, 105, 1)",borderWidth:4},point:{backgroundColor:"rgba(166, 30, 105, 1)",borderColor:"rgba(255,255,255, .9)",borderWidth:2,radius:5,hoverRadius:6,hoverBorderWidth:3}},responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{mode:"index",intersect:!1}},interaction:{mode:"nearest",axis:"x",intersect:!1}},oA=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 jy(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 My(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jy(Object(n),!0).forEach(function(r){aA(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aA(e,t,n){return(t=lA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lA(e){var t=uA(e,"string");return Vs(t)=="symbol"?t:t+""}function uA(e,t){if(Vs(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Vs(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vs(e){"@babel/helpers - typeof";return Vs=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},Vs(e)}function cA(e){var t=new Date(e);return isNaN(t.getTime())?String(e):t.toLocaleString("en-US",{month:"short",day:"numeric"})}var dA=function(){var t,n,r,i,s=ri(),o=s.data,a=s.isLoading,l=s.isRefetching,u=o==null?void 0:o.mentions,c=u==null||(t=u.mentionedInNumberOfQueries)===null||t===void 0||(t=t.previous)===null||t===void 0?void 0:t.difference,d=u==null?void 0:u.chart,f=Array.isArray(d==null?void 0:d.labels)?d.labels:d!=null&&d.labels&&Vs(d.labels)==="object"?Object.values(d.labels):[],h=f.map(function(v){return cA(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=My(My({},Qd),{},{responsive:!0,maintainAspectRatio:!1,scales:{x:{display:!0,title:{display:!1,text:"Date"},grid:{display:!1}},y:{display:!0,title:{display:!1,text:"Number of Mentions"},beginAtZero:!0,max:g,ticks:{stepSize:1}}}});return y.jsx(T.Card,{className:"yst-overflow-visible",children:y.jsxs(T.Card.Content,{className:"yst-space-y-4",children:[y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(qa,{title:"Mentions progress",tooltip:"Tracks how your brand mentions have changed over time across the same query set."}),y.jsx(Ba,{score:u==null||(n=u.mentionedInNumberOfQueries)===null||n===void 0?void 0:n.value,total:o==null?void 0:o.numberOfQueries,delta:c,deltaSuffix:"since last analysis",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(T.Alert,{variant:"info",children:"One more analysis needed to show more insights."}):y.jsx("div",{className:"yst-h-72",children:y.jsx(iA,{data:function(){var v={labels:h,datasets:[d==null?void 0:d.datasets]};return v}(),options:p})})]})})};function wl(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,u=l===void 0?!1:l,c=e.delta,d=e.tooltipPosition,f=d===void 0?"left":d;return y.jsxs("div",{className:Oe("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",u&&"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 c=="number"&&y.jsxs("p",{className:Oe("yst-flex yst-items-center yst-gap-1 yst-text-tiny yst-font-bold",ra(c)),children:[c>0?y.jsx(d2,{}):c<0?y.jsx(c2,{}):null,c>-1e-6&&"+",c]}),i&&y.jsx($f,{id:"tooltip-".concat(r.replace(/\s+/g,"-").toLowerCase()),className:"yst-absolute yst-right-2 yst-top-2",position:f,children:i})]})}function fA(e){var t=e.children,n=e.className;return y.jsx("div",{className:Oe("yst-grid yst-w-full yst-grid-cols-2 yst-gap-0 yst-rounded-lg",n),children:t})}function hA(e){return e>0?"yst-text-green-600":e<0?"yst-text-red-600":"yst-text-slate-500"}function gA(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:Oe("yst-flex yst-items-center yst-gap-1 yst-text-tiny yst-font-bold",hA(i),r),"aria-label":s?"Visibility increased by ".concat(a):o?"Visibility decreased by ".concat(a):"No change in visibility",children:[s&&y.jsx(d2,{className:"yst-w-4 yst-h-4"}),o&&y.jsx(c2,{className:"yst-w-4 yst-h-4"}),a]})}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 yA(e,t){return bA(e)||vA(e,t)||pA(e,t)||mA()}function mA(){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 pA(e,t){if(e){if(typeof e=="string")return $y(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)?$y(e,t):void 0}}function $y(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 vA(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function bA(e){if(Array.isArray(e))return e}function Ly(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 Sl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ly(Object(n),!0).forEach(function(r){xA(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ly(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xA(e,t,n){return(t=wA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wA(e){var t=SA(e,"string");return ha(t)=="symbol"?t:t+""}function SA(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 CA(){var e,t,n,r,i,s,o,a,l,u,c,d,f,h,g,m,p,v,b,S,C,w,O,x,_=Rn(),k=_.brandId,E=_.analysisId,P=Lu(k,E,{query:{select:function(Fe){var Y=Fe.data;return Y},enabled:!!k&&!!E}}),M=P.data,B=P.isLoading,R=M==null||(e=M.analysis)===null||e===void 0?void 0:e.scans,A=Array.isArray(R)&&R.length>0?R.reduce(function(Ne,Fe){if(!Ne)return Fe;if(!(Fe!=null&&Fe.finishedAt)||!(Ne!=null&&Ne.finishedAt))return Ne;var Y=new Date(Fe.finishedAt),Te=new Date(Ne.finishedAt);return Y>Te?Fe:Ne},R[0]):void 0,j=A==null||(t=A.scores)===null||t===void 0?void 0:t.standardized,L=(n=A==null||(r=A.mentions)===null||r===void 0||(r=r.mentionedInNumberOfQueries)===null||r===void 0?void 0:r.value)!==null&&n!==void 0?n:0,H=A==null||(i=A.mentions)===null||i===void 0||(i=i.mentionedInNumberOfQueries)===null||i===void 0||(i=i.previous)===null||i===void 0?void 0:i.difference,Q=(s=A==null||(o=A.scores)===null||o===void 0||(o=o.standardized)===null||o===void 0||(o=o.citations)===null||o===void 0?void 0:o.value)!==null&&s!==void 0?s:0,F=(a=A==null||(l=A.citations)===null||l===void 0||(l=l.total)===null||l===void 0?void 0:l.value)!==null&&a!==void 0?a:0,G=A==null||(u=A.citations)===null||u===void 0||(u=u.total)===null||u===void 0||(u=u.previous)===null||u===void 0?void 0:u.difference,ie=A==null||(c=A.rankings)===null||c===void 0||(c=c.list)===null||c===void 0?void 0:c.find(function(Ne){var Fe;return((Fe=Ne.brand)===null||Fe===void 0?void 0:Fe.isSelf)===!0}),ae=(d=ie==null||(f=ie.rank)===null||f===void 0?void 0:f.value)!==null&&d!==void 0?d:"—",N=ie==null||(h=ie.rank)===null||h===void 0||(h=h.previous)===null||h===void 0?void 0:h.difference;N&&(N=N*-1);var le=(g=j==null||(m=j.visibility)===null||m===void 0?void 0:m.value)!==null&&g!==void 0?g:0,te=j==null||(p=j.visibility)===null||p===void 0||(p=p.previous)===null||p===void 0?void 0:p.value,me=(v=j==null||(b=j.ranking)===null||b===void 0?void 0:b.value)!==null&&v!==void 0?v:0,J=(S=j==null||(C=j.sentiment)===null||C===void 0?void 0:C.value)!==null&&S!==void 0?S:0,Se=(w=j==null||(O=j.mentions)===null||O===void 0?void 0:O.value)!==null&&w!==void 0?w:0,ge={labels:["Mentions","Ranking","Citations","Sentiment"],datasets:[{data:[Se,me,Q,J],backgroundColor:oA,pointBackgroundColor:"rgba(166, 30, 105, 1)"}]},ze=Sl(Sl({},Qd),{},{plugins:Sl(Sl({},Qd.plugins),{},{tooltip:{mode:"point",intersect:!0,callbacks:{label:function(Fe){var Y=Fe.label||"",Te=Fe.parsed.r||0;return"".concat(Y,": ").concat(Te,"%")}}}}),interaction:{mode:"point",intersect:!0},scales:{r:{beginAtZero:!0,min:0,max:100,ticks:{stepSize:20}}}}),oe=z.useState(typeof window!="undefined"&&window.innerWidth<800?"top":"left"),He=yA(oe,2),lt=He[0],dt=He[1];return z.useEffect(function(){function Ne(){dt(window.innerWidth<800?"top":"left")}return window.addEventListener("resize",Ne),function(){return window.removeEventListener("resize",Ne)}},[]),y.jsx(T.Card,{className:"yst-overflow-visible md:yst-col-span-2",children:y.jsxs(T.Card.Content,{children:[y.jsx(T.Title,{size:"3",className:"yst-mb-2",children:"AI visibility index (AIVI)"}),y.jsx(Ba,{score:le,total:100,isLoading:B}),y.jsx(gA,{current:le,previous:te,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(sA,{data:ge,options:ze}),y.jsx($f,{id:"tooltip-radar-chart",className:"yst-absolute yst-right-2 yst-top-2",position:"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(fA,{children:[y.jsx(wl,{value:L,label:"Mentions",tooltip:"Mentions show how often your brand appears in AI-generated answers to the questions we send to LLMs.",borderBottom:!0,borderRight:!0,delta:H,tooltipPosition:lt}),y.jsx(wl,{value:ae&&y.jsxs(y.Fragment,{children:[ae,ae===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:N}),y.jsx(wl,{value:F,label:"Citations",tooltip:"Citations are the source links found in AI-generated answers. They form the basis for mentions, sentiment, and ranking insights.",borderRight:!0,delta:G,tooltipPosition:lt}),y.jsx(wl,{value:J?"".concat(J,"%"):"—",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:A==null||(x=A.scores)===null||x===void 0||(x=x.standardized)===null||x===void 0||(x=x.sentiment)===null||x===void 0||(x=x.previous)===null||x===void 0?void 0:x.difference})]})})]})]})})}const _A="data:image/svg+xml,%3csvg%20width='17'%20height='17'%20viewBox='0%200%2017%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3.652%2015.0488C2.3816%2015.0488%201.348%2014.0152%201.348%2012.7448V5.22476C1.348%203.95436%202.3816%202.92075%203.652%202.92075H9.5912L9.9304%202.07275H3.652C1.9144%202.07275%200.5%203.48716%200.5%205.22476V12.7448C0.5%2014.4824%201.9144%2015.8968%203.652%2015.8968H3.6776V15.0488H3.652Z'%20fill='%23A61E69'/%3e%3cpath%20d='M16.5%205.22468C16.5%203.74948%2015.4824%202.51428%2014.1096%202.17188L13.812%202.97188C14.8584%203.18628%2015.6488%204.11748%2015.6488%205.22788V15.0519H9.16236C9.00236%2015.3527%208.83276%2015.6375%208.65356%2015.8999H16.4968V5.22468H16.5Z'%20fill='%23A61E69'/%3e%3cpath%20d='M11.5815%200.140137L8.03267%209.99614L6.28867%204.53374H4.15747L6.82307%2011.3785C7.06947%2012.0121%207.06947%2012.7129%206.82307%2013.3497C6.56387%2014.0121%206.10627%2014.8025%204.82947%2015.0361L4.77187%2015.0457V16.8633H4.84547C5.91107%2016.8185%206.73667%2016.4665%207.44387%2015.7561C8.16387%2015.0329%208.78147%2013.9065%209.38947%2012.2137L13.8919%200.140137H11.5815Z'%20fill='%23A61E69'/%3e%3c/svg%3e";var kA=function(){var t,n=ri(),r=n.data,i=n.isLoading,s=n.isRefetching;return i&&!s||(r==null||(t=r.mentions)===null||t===void 0||(t=t.mentionedInNumberOfQueries)===null||t===void 0?void 0:t.value)!==0?null:y.jsx(T.Card,{className:"yst-overflow-visible md:yst-col-span-2 yst-text-slate-800",children:y.jsxs(T.Card.Content,{className:"yst-space-y-4 yst-max-w-2xl",children:[y.jsx(T.Title,{size:"3",children:"We couldn’t find your brand in this brand analysis..."}),y.jsx("p",{children:"This means LLMs may not yet be surfacing your site in answers. Don’t worry, here are some steps you can take today to boost your AI visibility:"}),y.jsxs("ol",{className:"yst-list-decimal yst-ml-5 [&>li::marker]:yst-font-semibold ",children:[y.jsxs("li",{children:[y.jsx("strong",{children:"Activate llms.txt →"})," ",y.jsx("a",{href:"https://yoast.com/features/llms-txt/",target:"_blank",rel:"noopener noreferrer",children:"Set up llms.txt in Yoast SEO"}),"."," ","Make sure AI systems know where to look and which pages matter most."]}),y.jsxs("li",{children:[y.jsx("strong",{children:"Adopt an LLM-friendly content structure →"})," ",y.jsx("a",{href:"https://yoast.com/yoast-seo-premium-september-9-2025/",target:"_blank",rel:"noopener noreferrer",children:"See how in our latest update"}),". Start with clear definitions or TL;DRs, use subheadings, and format answers so LLMs can lift them directly."]}),y.jsxs("li",{children:[y.jsx("strong",{children:"Simplify writing and readability →"})," ","Use shorter sentences, plain language, and one idea per paragraph. This makes it easier for AI systems to recognize and quote your content."]})]}),y.jsxs("p",{children:["Want to go deeper? →"," ",y.jsx("a",{href:"https://yoast.com/how-to-optimize-content-for-llms/",target:"_blank",rel:"noopener noreferrer",children:"Read our full guide on optimizing content for LLMs"}),"."]})]})})};function OA(e,t){return PA(e)||TA(e,t)||AA(e,t)||EA()}function EA(){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 AA(e,t){if(e){if(typeof e=="string")return Dy(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)?Dy(e,t):void 0}}function Dy(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 TA(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function PA(e){if(Array.isArray(e))return e}var qc=function(){var t=Rn(),n=t.brandId,r=t.analysisId,i=Vi({query:{select:function(_){var k=_.data;return k==null?void 0:k.brands}}}),s=i.data,o=i.isLoading,a=Lu(n,r,{query:{enabled:!!n&&T6(r),select:function(_){var k=_.data;return k==null?void 0:k.analysis}}}),l=a.data,u=a.isLoading,c=l==null?void 0:l.status,d=o||u,f=s&&(s==null?void 0:s.length)>0,h=!d&&l&&c===di.completed,g=z.useState(!1),m=OA(g,2),p=m[0],v=m[1],b=z.useRef(null),S=z.useRef(void 0),C=localStorage.getItem("yst_congratulations_toast_seen")==="true";z.useEffect(function(){return h&&!S.current&&!C&&(b.current=setTimeout(function(){v(!0),localStorage.setItem("yst_congratulations_toast_seen","true")},1e4)),!h&&S.current&&(v(!1),b.current&&(clearTimeout(b.current),b.current=null)),S.current=h,function(){b.current&&(clearTimeout(b.current),b.current=null)}},[h,C]);function w(x){var _=x.children;if(typeof window=="undefined")return null;var k=document.getElementById("toast-portal");return k?fx.createPortal(_,k):null}var O=function(_){var k=_.isVisible,E=_.setIsVisible,P=function(){E(!1)};return y.jsxs(T.Toast,{id:"toast",isVisible:k,position:"bottom-left",setIsVisible:function(M){M||E(!1)},children:[y.jsxs("div",{className:"yst-flex yst-gap-3 yst-items-start yst-mb-3",children:[y.jsx("img",{src:_A}),y.jsxs("div",{className:"yst-grow",children:[y.jsx(T.Title,{size:"3",className:"yst-mb-1",children:"Congratulations on your first analysis!"}),"You’ve completed your brand analysis. We’d love to hear what you think."]}),y.jsx(T.Button,{variant:"tertiary",onClick:P,children:y.jsx(g2,{})})]}),y.jsxs("div",{className:"yst-flex yst-justify-end yst-gap-4",children:[y.jsx(T.Button,{variant:"tertiary",onClick:P,children:"Dismiss"}),y.jsxs(T.Button,{as:"a",href:"https://www.surveymonkey.com/r/HGSB8DL",target:"_blank",children:["Give feedback",y.jsx(h2,{className:"yst-ml-2"})]})]})]})};return o?y.jsx(Ru,{}):f?y.jsxs("div",{className:"yst-space-y-4",children:[y.jsx(C7,{}),h&&y.jsxs("div",{className:"yst-space-y-4",children:[y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-between",children:[y.jsx(T.Title,{size:"2",children:"Your brand analysis"}),y.jsxs(T.Button,{as:ti,variant:"secondary",to:"/brands/".concat(n,"/brand-list"),className:Oe("yst-gap-1.5"),disabled:!n,children:[y.jsx(a2,{})," Edit brand list"]})]}),y.jsxs("div",{className:"yst-grid yst-grid-cols-1 yst-gap-4 md:yst-grid-cols-2",children:[y.jsx(kA,{}),y.jsx(CA,{}),y.jsx(_7,{}),y.jsx(dA,{}),y.jsx($_,{}),y.jsx(E_,{}),y.jsx(f_,{}),y.jsx(L_,{})]}),y.jsx(w,{children:y.jsx(O,{isVisible:p,setIsVisible:v})})]})]}):y.jsx(Y6,{})};function vb(e){var t=e.children,n=e.description,r=e.title;return y.jsxs(T.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(T.Title,{className:Oe({"yst-mb-3":n||t}),children:r}),n&&y.jsx("p",{children:n}),t]})}var jA=function(){return y.jsx(T.Card,{className:"yst-mb-4",children:y.jsxs(T.Card.Content,{className:"yst-flex yst-flex-col yst-gap-8",children:[y.jsx(T.Title,{size:"2",children:"Query - Best fish restaurant in Nijmegen"}),y.jsxs("div",{children:[y.jsx("p",{children:"AI Response:"}),y.jsx(T.Link,{href:"#todo",children:"Show more"})]}),y.jsxs("div",{children:[y.jsx("p",{children:"Extracted brands:"}),y.jsx(T.Badge,{children:"Example"}),y.jsx(T.Badge,{children:"Example"}),y.jsx(T.Badge,{children:"Example"}),y.jsx(T.Badge,{children:"Example"}),y.jsx(T.Badge,{children:"Example"})]}),y.jsxs(T.Table,{children:[y.jsx(T.Table.Head,{children:y.jsxs(T.Table.Row,{children:[y.jsx(T.Table.Header,{children:"URL"}),y.jsx(T.Table.Header,{children:"Associated brand"})]})}),y.jsxs(T.Table.Body,{children:[y.jsxs(T.Table.Row,{children:[y.jsx(T.Table.Cell,{children:y.jsx(T.Link,{href:"https://example.com",target:"_blank",children:"https://example.com"})}),y.jsx(T.Table.Cell,{children:"Example Brand"})]}),y.jsxs(T.Table.Row,{children:[y.jsx(T.Table.Cell,{children:y.jsx(T.Link,{href:"https://example2.com",target:"_blank",children:"https://example2.com"})}),y.jsx(T.Table.Cell,{children:"Example Brand 2"})]})]})]})]})})},MA=function(){return y.jsxs(T.Card,{children:[y.jsx(vb,{title:"Query history"}),y.jsx(T.Card,{className:"yst-mb-4",children:y.jsxs(T.Card.Content,{children:[y.jsxs("p",{className:"yst-mb-8",children:["Manna Fish Restaurant - Analysis performed on:"," ",y.jsx(T.Badge,{children:"2025-04-08 12:31:21"})]}),[0,1,2,3,4].map(function(t){return y.jsx(jA,{},t)})]})})]})},$A=z.lazy(function(){return Promise.resolve().then(()=>HL)}),LA=z.lazy(function(){return Promise.resolve().then(()=>pD)}),DA=z.lazy(function(){return Promise.resolve().then(()=>xD)}),IA=z.lazy(function(){return Promise.resolve().then(()=>LD)}),RA=z.lazy(function(){return Promise.resolve().then(()=>XD)}),NA=z.lazy(function(){return Promise.resolve().then(()=>rI)}),FA=new Jw({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1,staleTime:1e3*60*5},mutations:{retry:!1}}}),ui=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(T.SkeletonLoader,{className:"yst-h-8 yst-w-3/4"}),y.jsx(T.SkeletonLoader,{className:"yst-h-6 yst-w-full"}),y.jsx(T.SkeletonLoader,{className:"yst-h-6 yst-w-2/3"})]})})},BA=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(sw,{children:y.jsxs(_t,{element:y.jsx(k6,{hideNav:r,disableLayout:s,DebugInfo:o}),children:[y.jsxs(_t,{path:"/",element:y.jsx(Bs,{}),children:[y.jsx(_t,{index:!0,element:y.jsx(qc,{})}),y.jsxs(_t,{path:"brands/:brandId",element:y.jsx(P0,{}),children:[y.jsx(_t,{index:!0,element:y.jsx(qc,{})}),y.jsx(_t,{path:"brand-list",element:y.jsx(z.Suspense,{fallback:y.jsx(ui,{}),children:y.jsx($A,{})})}),y.jsx(_t,{path:"analysis/:analysisId",element:y.jsx(O6,{}),children:y.jsx(_t,{index:!0,element:y.jsx(qc,{})})})]}),y.jsxs(_t,{path:"/setup",element:y.jsx(z.Suspense,{fallback:y.jsx(ui,{}),children:y.jsx(DA,{})}),children:[y.jsx(_t,{index:!0,element:y.jsx(z.Suspense,{fallback:y.jsx(ui,{}),children:y.jsx(IA,{})})}),y.jsxs(_t,{path:":brandId",element:y.jsx(P0,{}),children:[y.jsx(_t,{path:"queries",element:y.jsx(z.Suspense,{fallback:y.jsx(ui,{}),children:y.jsx(RA,{})})}),y.jsx(_t,{path:"analysis",element:y.jsx(z.Suspense,{fallback:y.jsx(ui,{}),children:y.jsx(NA,{})})})]})]})]}),y.jsx(_t,{path:"/settings",element:y.jsx(z.Suspense,{fallback:y.jsx(ui,{}),children:y.jsx(LA,{})})}),y.jsx(_t,{path:"/query-history",element:y.jsx(z.Suspense,{fallback:y.jsx(ui,{}),children:y.jsx(MA,{})})})]})})},qA=function(t){var n=t.DebugInfo,r=t.hostAppProps;return y.jsxs(i3,{client:FA,children:[y.jsx(P4,{hostAppProps:r,children:y.jsx(BA,{DebugInfo:n})}),y.jsx(GS,{initialIsOpen:!1})]})};function zA(e){var t=e.subpath,n=t===void 0?"/":t,r=e.onNavigate,i=dn(),s=Ut(),o=z.useRef(n),a=z.useRef(null),l=z.useRef(!1),u="".concat(s.pathname).concat(s.search).concat(s.hash),c=z.useCallback(r,[r]);return z.useEffect(function(){if(n===u){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,u,i]),z.useEffect(function(){l.current||u!==n&&u!==a.current&&(a.current=u,c(u))},[u,n,c]),null}function HA(e,t){return KA(e)||VA(e,t)||GA(e,t)||UA()}function UA(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
70
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GA(e,t){if(e){if(typeof e=="string")return Iy(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)?Iy(e,t):void 0}}function Iy(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 VA(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function KA(e){if(Array.isArray(e))return e}var WA=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,u=t.DebugInfo,c=t.basename,d=c===void 0?"/":c,f=t.subpath,h=f===void 0?"/":f,g=t.onNavigate,m=g===void 0?function(){}:g,p=t.onLogout,v=p===void 0?function(){}:p,b=t.onAddSubscription,S=b===void 0?function(){}:b,C=function(P,M){var B=P.endsWith("/")?P.slice(0,-1):P,R=M.startsWith("/")?M:"/".concat(M);return B+R||"/"},w=z.useState(!!(a||l)),O=HA(w,2),x=O[0],_=O[1],k={onAddSubscription:S,onLogout:v,onNavigate:m,DebugInfo:u,basename:d,subpath:h};return z.useEffect(function(){l&&Jv(l),E5(typeof a!="function"?function(){return a}:a),_(!1)},[l,a]),x?y.jsx("div",{className:i,style:s,children:y.jsx(T.Spinner,{})}):y.jsx("div",{className:i,style:s,children:y.jsxs(rw,{initialEntries:[C(d,h)],basename:d||"/",children:[y.jsx(zA,{subpath:h,onNavigate:m}),y.jsx(T.Root,{context:{isRtl:r},children:y.jsx(qA,{DebugInfo:u,hostAppProps:k})})]})})},QA=e=>e!=null,YA=e=>e.filter(QA);function XA(e){return(...t)=>{for(const n of e)n&&n(...t)}}var X=e=>typeof e=="function"&&!e.length?e():e,Yd=e=>Array.isArray(e)?e:e?[e]:[];function ZA(e,...t){return typeof e=="function"?e(...t):e}var JA=_e;function eT(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 tT(e){const[t,n]=ce(),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=ce(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(S){r(S,`Error setting ${s}${f} to ${m} in ${b.name}`)}});const v=o.get(f);v&&v[1]()},u=f=>i.forEach(h=>{try{h.removeItem(`${s}${f}`)}catch(g){r(g,`Error removing ${s}${f} from ${h.name}`)}}),c=()=>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&&xr(()=>{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),_e(()=>globalThis.removeEventListener("storage",f))):(i.forEach(h=>{var g;return(g=h.addEventListener)==null?void 0:g.call(h,"storage",f)}),_e(()=>i.forEach(h=>{var g;return(g=h.removeEventListener)==null?void 0:g.call(h,"storage",f)})))}),[a,l,{clear:c,error:t,remove:u,toJSON:d}]}var bb=tT,nT=e=>(typeof e.clear=="function"||(e.clear=()=>{let t;for(;t=e.key(0);)e.removeItem(t)}),e),Ry=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},gn=nT({_cookies:[globalThis.document,"cookie"],getItem:e=>{var t,n;return(n=(t=gn._cookies[0][gn._cookies[1]].match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)"))==null?void 0:t.pop())!=null?n:null},setItem:(e,t,n)=>{const r=gn.getItem(e);gn._cookies[0][gn._cookies[1]]=`${e}=${t}${Ry(n)}`;const i=Object.assign(new Event("storage"),{key:e,oldValue:r,newValue:t,url:globalThis.document.URL,storageArea:gn});window.dispatchEvent(i)},removeItem:e=>{gn._cookies[0][gn._cookies[1]]=`${e}=deleted${Ry({expires:new Date(0)})}`},key:e=>{let t=null,n=0;return gn._cookies[0][gn._cookies[1]].replace(/(?:^|;)\s*(.+?)\s*=\s*[^;]+/g,(r,i)=>(!t&&i&&n++===e&&(t=i),"")),t},get length(){let e=0;return gn._cookies[0][gn._cookies[1]].replace(/(?:^|;)\s*.+?\s*=\s*[^;]+/g,t=>(e+=t?1:0,"")),e}}),rT=1024,Bi=796,Yf=700,iT="bottom-right",Xd="bottom",xb="system",sT=!1,wb=500,oT=500,Sb=500,aT=Object.keys(bd)[0],Ny=1,lT=Object.keys(xd)[0],Xf=wt({client:void 0,onlineManager:void 0,queryFlavor:"",version:"",shadowDOMTarget:void 0});function ye(){return St(Xf)}var Cb=wt(void 0),_b=e=>{const[t,n]=ce(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="",K3(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(u=>{try{const c=[...u.cssRules].map(g=>g.cssText).join(""),d=document.createElement("style"),f=u.ownerNode;let h="";f&&"id"in f&&(h=f.id),h&&d.setAttribute("id",h),d.textContent=c,l.document.head.appendChild(d)}catch(c){const d=document.createElement("link");if(u.href==null)return;d.rel="stylesheet",d.type=u.type,d.media=u.media.toString(),d.href=u.href,l.document.head.appendChild(d)}}),ku(["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||oT))}),xe(()=>{const o=(ye().shadowDOMTarget||document).querySelector("#_goober"),a=t();if(o&&a){const l=new MutationObserver(()=>{const u=(ye().shadowDOMTarget||a.document).querySelector("#_goober");u&&(u.textContent=o.textContent)});l.observe(o,{childList:!0,subtree:!0,characterDataOldValue:!0}),_e(()=>{l.disconnect()})}});const s=U(()=>{var o;return{pipWindow:t(),requestPipWindow:i,closePipWindow:r,disabled:(o=e.disabled)!=null?o:!1}});return D(Cb.Provider,{value:s,get children(){return e.children}})},Zf=()=>U(()=>{const t=St(Cb);if(!t)throw new Error("usePiPWindow must be used within a PiPProvider");return t()}),Jf=wt(()=>"dark");function xt(){return St(Jf)}var kb={À:"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"},uT=Object.keys(kb).join("|"),cT=new RegExp(uT,"g");function dT(e){return e.replace(cT,t=>kb[t])}var Bt={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function Fy(e,t,n){var r;if(n=n||{},n.threshold=(r=n.threshold)!=null?r:Bt.MATCHES,!n.accessors){const o=By(e,t,n);return{rankedValue:e,rank:o,accessorIndex:-1,accessorThreshold:n.threshold,passed:o>=n.threshold}}const i=yT(e,n.accessors),s={rankedValue:e,rank:Bt.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let o=0;o<i.length;o++){const a=i[o];let l=By(a.itemValue,t,n);const{minRanking:u,maxRanking:c,threshold:d=n.threshold}=a.attributes;l<u&&l>=Bt.MATCHES?l=u:l>c&&(l=c),l=Math.min(l,c),l>=d&&l>s.rank&&(s.rank=l,s.passed=!0,s.accessorIndex=o,s.accessorThreshold=d,s.rankedValue=a.itemValue)}return s}function By(e,t,n){return e=qy(e,n),t=qy(t,n),t.length>e.length?Bt.NO_MATCH:e===t?Bt.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?Bt.EQUAL:e.startsWith(t)?Bt.STARTS_WITH:e.includes(` ${t}`)?Bt.WORD_STARTS_WITH:e.includes(t)?Bt.CONTAINS:t.length===1?Bt.NO_MATCH:fT(e).includes(t)?Bt.ACRONYM:hT(e,t))}function fT(e){let t="";return e.split(" ").forEach(r=>{r.split("-").forEach(s=>{t+=s.substr(0,1)})}),t}function hT(e,t){let n=0,r=0;function i(l,u,c){for(let d=c,f=u.length;d<f;d++)if(u[d]===l)return n+=1,d+1;return-1}function s(l){const u=1/l,c=n/t.length;return Bt.MATCHES+c*u}const o=i(t[0],e,0);if(o<0)return Bt.NO_MATCH;r=o;for(let l=1,u=t.length;l<u;l++){const c=t[l];if(r=i(c,e,r),!(r>-1))return Bt.NO_MATCH}const a=r-o;return s(a)}function qy(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=dT(e)),e}function gT(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 yT(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const s=t[r],o=mT(s),a=gT(e,s);for(let l=0,u=a.length;l<u;l++)n.push({itemValue:a[l],attributes:o})}return n}var zy={maxRanking:1/0,minRanking:-1/0};function mT(e){return typeof e=="function"?zy:{...zy,...e}}var pT={data:""},vT=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||pT,bT=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,xT=/\/\*[^]*?\*\/| +/g,Hy=/\n+/g,yi=(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"?yi(o,s):s+"{"+yi(o,s[1]=="k"?"":t)+"}":typeof o=="object"?r+=yi(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+=yi.p?yi.p(s,o):s+":"+o+";")}return n+(t&&i?t+"{"+i+"}":i)+r},ir={},Ob=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+Ob(e[n]);return t}return e},wT=(e,t,n,r,i)=>{let s=Ob(e),o=ir[s]||(ir[s]=(l=>{let u=0,c=11;for(;u<l.length;)c=101*c+l.charCodeAt(u++)>>>0;return"go"+c})(s));if(!ir[o]){let l=s!==e?e:(u=>{let c,d,f=[{}];for(;c=bT.exec(u.replace(xT,""));)c[4]?f.shift():c[3]?(d=c[3].replace(Hy," ").trim(),f.unshift(f[0][d]=f[0][d]||{})):f[0][c[1]]=c[2].replace(Hy," ").trim();return f[0]})(e);ir[o]=yi(i?{["@keyframes "+o]:l}:l,n?"":"."+o)}let a=n&&ir.g?ir.g:null;return n&&(ir.g=ir[o]),((l,u,c,d)=>{d?u.data=u.data.replace(d,l):u.data.indexOf(l)===-1&&(u.data=c?l+u.data:u.data+l)})(ir[o],t,r,a),o},ST=(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?"":yi(a,""):a===!1?"":a}return r+i+(o==null?"":o)},"");function Me(e){let t=this||{},n=e.call?e(t.p):e;return wT(n.unshift?n.raw?ST(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,vT(t.target),t.g,t.o,t.k)}Me.bind({g:1});Me.bind({k:1});function Eb(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=Eb(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function fe(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Eb(e))&&(r&&(r+=" "),r+=t);return r}function CT(e,t){const n=at(e),{onChange:r}=t;let i=new Set(t.appear?void 0:n);const s=new WeakSet,[o,a]=ce([],{equals:!1}),[l]=_3(),u=d=>{a(f=>(f.push.apply(f,d),f));for(const f of d)s.delete(f)},c=(d,f,h)=>d.splice(h,0,f);return U(d=>{const f=o(),h=e();if(h[Su],at(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:u}),g}return at(()=>{const g=new Set(h),m=h.slice(),p=[],v=[],b=[];for(const C of h)(i.has(C)?b:p).push(C);let S=!p.length;for(let C=0;C<d.length;C++){const w=d[C];g.has(w)||(s.has(w)||(v.push(w),s.add(w)),c(m,w,C)),S&&w!==m[C]&&(S=!1)}return!v.length&&S?d:(r({list:m,added:p,removed:v,unchanged:b,finishRemoved:u}),i=g,m)})},t.appear?[]:n.slice())}function It(...e){return XA(e)}var Uy=e=>e instanceof Element;function Zd(e,t){if(t(e))return e;if(typeof e=="function"&&!e.length)return Zd(e(),t);if(Array.isArray(e)){const n=[];for(const r of e){const i=Zd(r,t);i&&(Array.isArray(i)?n.push.apply(n,i):n.push(i))}return n.length?n:null}return null}function _T(e,t=Uy,n=Uy){const r=U(e),i=U(()=>Zd(r(),t));return i.toArray=()=>{const s=i();return Array.isArray(s)?s:s?[s]:[]},i}function kT(e){return U(()=>{const t=e.name||"s";return{enterActive:(e.enterActiveClass||t+"-enter-active").split(" "),enter:(e.enterClass||t+"-enter").split(" "),enterTo:(e.enterToClass||t+"-enter-to").split(" "),exitActive:(e.exitActiveClass||t+"-exit-active").split(" "),exit:(e.exitClass||t+"-exit").split(" "),exitTo:(e.exitToClass||t+"-exit-to").split(" "),move:(e.moveClass||t+"-move").split(" ")}})}function Ab(e){requestAnimationFrame(()=>requestAnimationFrame(e))}function OT(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())}),Ab(()=>{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 ET(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()),Ab(()=>{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 Gy=e=>{const t=kT(e);return CT(_T(()=>e.children).toArray,{appear:e.appear,onChange({added:n,removed:r,finishRemoved:i,list:s}){const o=t();for(const l of n)OT(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:u,rect:c}of a)if(u.isConnected){const d=u.getBoundingClientRect(),f=c.left-d.left,h=c.top-d.top;(f||h)&&(u.style.transform=`translate(${f}px, ${h}px)`,u.style.transitionDuration="0s",l.push(u))}document.body.offsetHeight;for(const u of l){let c=function(d){(d.target===u||/transform$/.test(d.propertyName))&&(u.removeEventListener("transitionend",c),u.classList.remove(...o.move))};u.classList.add(...o.move),u.style.transform=u.style.transitionDuration="",u.addEventListener("transitionend",c)}});for(const l of r)ET(o,e,l,()=>i([l]))}})},zc=Symbol("fallback");function Vy(e){for(const t of e)t.dispose()}function AT(e,t,n,r={}){const i=new Map;return _e(()=>Vy(i.values())),()=>{const o=e()||[];return o[Su],at(()=>{var c,d;if(!o.length)return Vy(i.values()),i.clear(),r.fallback?[mr(h=>(i.set(zc,{dispose:h}),r.fallback()))]:[];const a=new Array(o.length),l=i.get(zc);if(!i.size||l){l==null||l.dispose(),i.delete(zc);for(let f=0;f<o.length;f++){const h=o[f],g=t(h,f);s(a,h,f,g)}return a}const u=new Set(i.keys());for(let f=0;f<o.length;f++){const h=o[f],g=t(h,f);u.delete(g);const m=i.get(g);m?(a[f]=m.mapped,(c=m.setIndex)==null||c.call(m,f),m.setItem(()=>h)):s(a,h,f,g)}for(const f of u)(d=i.get(f))==null||d.dispose(),i.delete(f);return a})};function s(o,a,l,u){mr(c=>{const[d,f]=ce(a),h={setItem:f,dispose:c};if(n.length>1){const[g,m]=ce(l);h.setIndex=m,h.mapped=n(d,g)}else h.mapped=n(d);i.set(u,h),o[l]=h.mapped})}}function du(e){const{by:t}=e;return U(AT(()=>e.each,typeof t=="function"?t:n=>n[t],e.children,"fallback"in e?{fallback:()=>e.fallback}:void 0))}function TT(e,t,n,r){return e.addEventListener(t,n,r),JA(e.removeEventListener.bind(e,t,n,r))}function PT(e,t,n,r){const i=()=>{Yd(X(e)).forEach(s=>{s&&Yd(X(t)).forEach(o=>TT(s,o,n,r))})};typeof e=="function"?xe(i):be(i)}function jT(e,t){const n=new ResizeObserver(e);return _e(n.disconnect.bind(n)),{observe:r=>n.observe(r,t),unobserve:n.unobserve.bind(n)}}function Tb(e,t,n){const r=new WeakMap,{observe:i,unobserve:s}=jT(o=>{for(const a of o){const{contentRect:l,target:u}=a,c=Math.round(l.width),d=Math.round(l.height),f=r.get(u);(!f||f.width!==c||f.height!==d)&&(t(l,u,a),r.set(u,{width:c,height:d}))}},n);xe(o=>{const a=YA(Yd(X(e)));return eT(a,o,i,s),a},[])}var MT=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function Ky(e){const t={};let n;for(;n=MT.exec(e);)t[n[1]]=n[2];return t}function Qu(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=Ky(e)}else typeof t=="string"&&(t=Ky(t));return{...e,...t}}function $T(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function Jd(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function LT(e){return typeof e=="number"}function ns(e){return Object.prototype.toString.call(e)==="[object String]"}function DT(e){return typeof e=="function"}function Ga(e){return t=>`${e()}-${t}`}function wn(e,t){return e?e===t||e.contains(t):!1}function Io(e,t=!1){const{activeElement:n}=Jn(e);if(!(n!=null&&n.nodeName))return null;if(Pb(n)&&n.contentDocument)return Io(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const i=Jn(n).getElementById(r);if(i)return i}}return n}function IT(e){return Jn(e).defaultView||window}function Jn(e){return e?e.ownerDocument||e:document}function Pb(e){return e.tagName==="IFRAME"}var eh=(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))(eh||{});function th(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 Yu(){return th(/^Mac/i)}function RT(){return th(/^iPhone/i)}function NT(){return th(/^iPad/i)||Yu()&&navigator.maxTouchPoints>1}function FT(){return RT()||NT()}function BT(){return Yu()||FT()}function nt(e,t){return t&&(DT(t)?t(e):t[0](t[1],e)),e==null?void 0:e.defaultPrevented}function vt(e){return t=>{for(const n of e)nt(t,n)}}function qT(e){return Yu()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function At(e){if(e)if(zT())e.focus({preventScroll:!0});else{const t=HT(e);e.focus(),UT(t)}}var Cl=null;function zT(){if(Cl==null){Cl=!1;try{document.createElement("div").focus({get preventScroll(){return Cl=!0,!0}})}catch(e){}}return Cl}function HT(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 UT(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var jb=["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'])"],GT=[...jb,'[tabindex]:not([tabindex="-1"]):not([disabled])'],nh=jb.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",VT=GT.join(':not([hidden]):not([tabindex="-1"]),');function Mb(e,t){const r=Array.from(e.querySelectorAll(nh)).filter(Wy);return t&&Wy(e)&&r.unshift(e),r.forEach((i,s)=>{if(Pb(i)&&i.contentDocument){const o=i.contentDocument.body,a=Mb(o,!1);r.splice(s,1,...a)}}),r}function Wy(e){return $b(e)&&!KT(e)}function $b(e){return e.matches(nh)&&rh(e)}function KT(e){return parseInt(e.getAttribute("tabindex")||"0",10)<0}function rh(e,t){return e.nodeName!=="#comment"&&WT(e)&&QT(e,t)&&(!e.parentElement||rh(e.parentElement,e))}function WT(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 QT(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function YT(e,t,n){const r=t!=null&&t.tabbable?VT:nh,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)&&rh(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 Qy(e){for(;e&&!XT(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function XT(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function ZT(){}function JT(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[u,c]=t[a],[d,f]=t[l],[,h]=t[l===0?o-1:l-1]||[0,0],g=(c-f)*(n-u)-(u-d)*(r-c);if(f<c){if(r>=f&&r<c){if(g===0)return!0;g>0&&(r===f?r>h&&(i=!i):i=!i)}}else if(c<f){if(r>c&&r<=f){if(g===0)return!0;g<0&&(r===f?r<h&&(i=!i):i=!i)}}else if(r==c&&(n>=d&&n<=u||n>=u&&n<=d))return!0}return i}function Re(e,t){return Ae(e,t)}var Co=new Map,Yy=new Set;function Xy(){if(typeof window=="undefined")return;const e=n=>{if(!n.target)return;let r=Co.get(n.target);r||(r=new Set,Co.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=Co.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Co.delete(n.target)),Co.size===0)){for(const i of Yy)i();Yy.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document!="undefined"&&(document.readyState!=="loading"?Xy():document.addEventListener("DOMContentLoaded",Xy));function ef(e,t){const n=Zy(e,t,"left"),r=Zy(e,t,"top"),i=t.offsetWidth,s=t.offsetHeight;let o=e.scrollLeft,a=e.scrollTop;const l=o+e.offsetWidth,u=a+e.offsetHeight;n<=o?o=n:n+i>l&&(o+=n+i-l),r<=a?a=r:r+s>u&&(a+=r+s-u),e.scrollLeft=o,e.scrollTop=a}function Zy(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 eP(e,t){var n,r;if(document.contains(e)){const i=document.scrollingElement||document.documentElement;if(window.getComputedStyle(i).overflow==="hidden"){let o=Qy(e);for(;e&&o&&e!==i&&o!==i;)ef(o,e),e=o,o=Qy(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:u}=e.getBoundingClientRect();(Math.abs(o-l)>1||Math.abs(a-u)>1)&&((r=e.scrollIntoView)==null||r.call(e,{block:"nearest"}))}}}var Lb={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 Sn(e){return t=>(e(t),()=>e(void 0))}function Xu(e,t){const[n,r]=ce(Jy(t==null?void 0:t()));return xe(()=>{var i;r(((i=e())==null?void 0:i.tagName.toLowerCase())||Jy(t==null?void 0:t()))}),n}function Jy(e){return ns(e)?e:void 0}function st(e){const[t,n]=Ke(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return D(iS,Ae(n,{get component(){return t.as}}))}var tP=["id","name","validationState","required","disabled","readOnly"];function nP(e){const t=`form-control-${kn()}`,n=Re({id:t},e),[r,i]=ce(),[s,o]=ce(),[a,l]=ce(),[u,c]=ce(),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(),u(),m].filter(Boolean).join(" ")||void 0,h=U(()=>({"data-valid":X(n.validationState)==="valid"?"":void 0,"data-invalid":X(n.validationState)==="invalid"?"":void 0,"data-required":X(n.required)?"":void 0,"data-disabled":X(n.disabled)?"":void 0,"data-readonly":X(n.readOnly)?"":void 0}));return{formControlContext:{name:()=>{var m;return(m=X(n.name))!=null?m:X(n.id)},dataset:h,validationState:()=>X(n.validationState),isRequired:()=>X(n.required),isDisabled:()=>X(n.disabled),isReadOnly:()=>X(n.readOnly),labelId:r,fieldId:s,descriptionId:a,errorMessageId:u,getAriaLabelledBy:d,getAriaDescribedBy:f,generateId:Ga(()=>X(n.id)),registerLabel:Sn(i),registerField:Sn(o),registerDescription:Sn(l),registerErrorMessage:Sn(c)}}}var Db=wt();function Va(){const e=St(Db);if(e===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function Ib(e){const t=Va(),n=Re({id:t.generateId("description")},e);return xe(()=>_e(t.registerDescription(n.id))),D(st,Ae({as:"div"},()=>t.dataset(),n))}function Rb(e){const t=Va(),n=Re({id:t.generateId("error-message")},e),[r,i]=Ke(n,["forceMount"]),s=()=>t.validationState()==="invalid";return xe(()=>{s()&&_e(t.registerErrorMessage(i.id))}),D(ve,{get when(){return r.forceMount||s()},get children(){return D(st,Ae({as:"div"},()=>t.dataset(),i))}})}function rP(e){let t;const n=Va(),r=Re({id:n.generateId("label")},e),[i,s]=Ke(r,["ref"]),o=Xu(()=>t,()=>"label");return xe(()=>_e(n.registerLabel(s.id))),D(st,Ae({as:"label",ref(a){const l=It(u=>t=u,i.ref);typeof l=="function"&&l(a)},get for(){return U(()=>o()==="label")()?n.fieldId():void 0}},()=>n.dataset(),s))}function iP(e,t){xe(br(e,n=>{if(n==null)return;const r=sP(n);r!=null&&(r.addEventListener("reset",t,{passive:!0}),_e(()=>{r.removeEventListener("reset",t)}))}))}function sP(e){return oP(e)?e.form:e.closest("form")}function oP(e){return e.matches("textarea, input, select, button")}function Ka(e){var o;const[t,n]=ce((o=e.defaultValue)==null?void 0:o.call(e)),r=U(()=>{var a;return((a=e.value)==null?void 0:a.call(e))!==void 0}),i=U(()=>{var a;return r()?(a=e.value)==null?void 0:a.call(e):t()});return[i,a=>{at(()=>{var u;const l=ZA(a,i());return Object.is(l,i())||(r()||n(l),(u=e.onChange)==null||u.call(e,l)),l})}]}function Nb(e){const[t,n]=Ka(e);return[()=>{var i;return(i=t())!=null?i:!1},n]}function aP(e){const[t,n]=Ka(e);return[()=>{var i;return(i=t())!=null?i:[]},n]}function lP(e={}){const[t,n]=Nb({value:()=>X(e.isSelected),defaultValue:()=>!!X(e.defaultIsSelected),onChange:s=>{var o;return(o=e.onSelectedChange)==null?void 0:o.call(e,s)}});return{isSelected:t,setIsSelected:s=>{!X(e.isReadOnly)&&!X(e.isDisabled)&&n(s)},toggle:()=>{!X(e.isReadOnly)&&!X(e.isDisabled)&&n(!t())}}}var uP=Object.defineProperty,Zu=(e,t)=>{for(var n in t)uP(e,n,{get:t[n],enumerable:!0})},Fb=wt();function Bb(){return St(Fb)}function cP(){const e=Bb();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function qb(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function dP(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&&qb(s,n))return r+1}return 0}function fP(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:qb(a,l)?(r>s&&(n=!0),-1):(r<s&&(n=!0),1)}),n?t.map(([r,i])=>i):e}function zb(e,t){const n=fP(e);e!==n&&t(n)}function hP(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 Jn(r).body}function gP(e,t){xe(()=>{const n=setTimeout(()=>{zb(e(),t)});_e(()=>clearTimeout(n))})}function yP(e,t){if(typeof IntersectionObserver!="function"){gP(e,t);return}let n=[];xe(()=>{const r=()=>{const o=!!n.length;n=e(),o&&zb(e(),t)},i=hP(e()),s=new IntersectionObserver(r,{root:i});for(const o of e()){const a=o.ref();a&&s.observe(a)}_e(()=>s.disconnect())})}function mP(e={}){const[t,n]=aP({value:()=>X(e.items),onChange:s=>{var o;return(o=e.onItemsChange)==null?void 0:o.call(e,s)}});yP(t,n);const r=s=>(n(o=>{const a=dP(o,s);return $T(o,s,a)}),()=>{n(o=>{const a=o.filter(l=>l.ref()!==s.ref());return o.length===a.length?o:a})});return{DomCollectionProvider:s=>D(Fb.Provider,{value:{registerItem:r},get children(){return s.children}})}}function pP(e){const t=cP(),n=Re({shouldRegisterItem:!0},e);xe(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());_e(r)})}function Hb(e){var l,u,c;let t=(l=e.startIndex)!=null?l:0;const n=(u=e.startLevel)!=null?u:0,r=[],i=d=>{var g;if(d==null)return"";const f=(g=e.getKey)!=null?g:"key",h=ns(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=ns(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=ns(f)?d[f]:f(d))!=null?g:!1},a=d=>{var f;if(d!=null)return ns(e.getSectionChildren)?d[e.getSectionChildren]:(f=e.getSectionChildren)==null?void 0:f.call(e,d)};for(const d of e.dataSource){if(ns(d)||LT(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=(c=a(d))!=null?c:[];if(f.length>0){const h=Hb({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 vP(e,t=[]){return U(()=>{const n=Hb({dataSource:X(e.dataSource),getKey:X(e.getKey),getTextValue:X(e.getTextValue),getDisabled:X(e.getDisabled),getSectionChildren:X(e.getSectionChildren)});for(let r=0;r<t.length;r++)t[r]();return e.factory(n)})}var bP=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),xP=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function wP(e){var n;if(Intl.Locale){const r=(n=new Intl.Locale(e).maximize().script)!=null?n:"";return bP.has(r)}const t=e.split("-")[0];return xP.has(t)}function SP(e){return wP(e)?"rtl":"ltr"}function Ub(){let e=typeof navigator!="undefined"&&(navigator.language||navigator.userLanguage)||"en-US";return{locale:e,direction:SP(e)}}var tf=Ub(),Ro=new Set;function em(){tf=Ub();for(const e of Ro)e(tf)}function CP(){const[e,t]=ce(tf),n=U(()=>e());return xr(()=>{Ro.size===0&&window.addEventListener("languagechange",em),Ro.add(t),_e(()=>{Ro.delete(t),Ro.size===0&&window.removeEventListener("languagechange",em)})}),{locale:()=>n().locale,direction:()=>n().direction}}var _P=wt();function si(){const e=CP();return St(_P)||e}var Hc=new Map;function kP(e){const{locale:t}=si(),n=U(()=>t()+(e?Object.entries(e).sort((r,i)=>r[0]<i[0]?-1:1).join():""));return U(()=>{const r=n();let i;return Hc.has(r)&&(i=Hc.get(r)),i||(i=new Intl.Collator(t(),e),Hc.set(r,i)),i})}var ur=class Gb extends Set{constructor(n,r,i){super(n);pe(this,"anchorKey");pe(this,"currentKey");n instanceof Gb?(this.anchorKey=r||n.anchorKey,this.currentKey=i||n.currentKey):(this.anchorKey=r,this.currentKey=i)}};function OP(e){const[t,n]=Ka(e);return[()=>{var i;return(i=t())!=null?i:new ur},n]}function Vb(e){return BT()?e.altKey:e.ctrlKey}function rs(e){return Yu()?e.metaKey:e.ctrlKey}function tm(e){return new ur(e)}function EP(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function AP(e){const t=Re({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=ce(!1),[i,s]=ce(),o=U(()=>{const m=X(t.selectedKeys);return m!=null?tm(m):m}),a=U(()=>{const m=X(t.defaultSelectedKeys);return m!=null?tm(m):new ur}),[l,u]=OP({value:o,defaultValue:a,onChange:m=>{var p;return(p=t.onSelectionChange)==null?void 0:p.call(t,m)}}),[c,d]=ce(X(t.selectionBehavior)),f=()=>X(t.selectionMode),h=()=>{var m;return(m=X(t.disallowEmptySelection))!=null?m:!1},g=m=>{(X(t.allowDuplicateSelectionEvents)||!EP(m,l()))&&u(m)};return xe(()=>{const m=l();X(t.selectionBehavior)==="replace"&&c()==="toggle"&&typeof m=="object"&&m.size===0&&d("replace")}),xe(()=>{var m;d((m=X(t.selectionBehavior))!=null?m:"toggle")}),{selectionMode:f,disallowEmptySelection:h,selectionBehavior:c,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:i,setFocusedKey:s,selectedKeys:l,setSelectedKeys:g}}function TP(e){const[t,n]=ce(""),[r,i]=ce(-1);return{typeSelectHandlers:{onKeyDown:o=>{var f,h,g;if(X(e.isDisabled))return;const a=X(e.keyboardDelegate),l=X(e.selectionManager);if(!a.getKeyForSearch)return;const u=PP(o.key);if(!u||o.ctrlKey||o.metaKey)return;u===" "&&t().trim().length>0&&(o.preventDefault(),o.stopPropagation());let c=n(m=>m+u),d=(f=a.getKeyForSearch(c,l.focusedKey()))!=null?f:a.getKeyForSearch(c);d==null&&jP(c)&&(c=c[0],d=(h=a.getKeyForSearch(c,l.focusedKey()))!=null?h:a.getKeyForSearch(c)),d!=null&&(l.setFocusedKey(d),(g=e.onTypeSelect)==null||g.call(e,d)),clearTimeout(r()),i(window.setTimeout(()=>n(""),500))}}}}function PP(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function jP(e){return e.split("").every(t=>t===e[0])}function MP(e,t,n){const i=Ae({selectOnFocus:()=>X(e.selectionManager).selectionBehavior()==="replace"},e),s=()=>t(),{direction:o}=si();let a={top:0,left:0};PT(()=>X(i.isVirtualized)?void 0:s(),"scroll",()=>{const p=s();p&&(a={top:p.scrollTop,left:p.scrollLeft})});const{typeSelectHandlers:l}=TP({isDisabled:()=>X(i.disallowTypeAhead),keyboardDelegate:()=>X(i.keyboardDelegate),selectionManager:()=>X(i.selectionManager)}),u=()=>{var p;return(p=X(i.orientation))!=null?p:"vertical"},c=p=>{var _,k,E,P,M,B,R,A;nt(p,l.onKeyDown),p.altKey&&p.key==="Tab"&&p.preventDefault();const v=t();if(!(v!=null&&v.contains(p.target)))return;const b=X(i.selectionManager),S=X(i.selectOnFocus),C=j=>{j!=null&&(b.setFocusedKey(j),p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(j):S&&!Vb(p)&&b.replaceSelection(j))},w=X(i.keyboardDelegate),O=X(i.shouldFocusWrap),x=b.focusedKey();switch(p.key){case(u()==="vertical"?"ArrowDown":"ArrowRight"):{if(w.getKeyBelow){p.preventDefault();let j;x!=null?j=w.getKeyBelow(x):j=(_=w.getFirstKey)==null?void 0:_.call(w),j==null&&O&&(j=(k=w.getFirstKey)==null?void 0:k.call(w,x)),C(j)}break}case(u()==="vertical"?"ArrowUp":"ArrowLeft"):{if(w.getKeyAbove){p.preventDefault();let j;x!=null?j=w.getKeyAbove(x):j=(E=w.getLastKey)==null?void 0:E.call(w),j==null&&O&&(j=(P=w.getLastKey)==null?void 0:P.call(w,x)),C(j)}break}case(u()==="vertical"?"ArrowLeft":"ArrowUp"):{if(w.getKeyLeftOf){p.preventDefault();const j=o()==="rtl";let L;x!=null?L=w.getKeyLeftOf(x):L=j?(M=w.getFirstKey)==null?void 0:M.call(w):(B=w.getLastKey)==null?void 0:B.call(w),C(L)}break}case(u()==="vertical"?"ArrowRight":"ArrowDown"):{if(w.getKeyRightOf){p.preventDefault();const j=o()==="rtl";let L;x!=null?L=w.getKeyRightOf(x):L=j?(R=w.getLastKey)==null?void 0:R.call(w):(A=w.getFirstKey)==null?void 0:A.call(w),C(L)}break}case"Home":if(w.getFirstKey){p.preventDefault();const j=w.getFirstKey(x,rs(p));j!=null&&(b.setFocusedKey(j),rs(p)&&p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(j):S&&b.replaceSelection(j))}break;case"End":if(w.getLastKey){p.preventDefault();const j=w.getLastKey(x,rs(p));j!=null&&(b.setFocusedKey(j),rs(p)&&p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(j):S&&b.replaceSelection(j))}break;case"PageDown":if(w.getKeyPageBelow&&x!=null){p.preventDefault();const j=w.getKeyPageBelow(x);C(j)}break;case"PageUp":if(w.getKeyPageAbove&&x!=null){p.preventDefault();const j=w.getKeyPageAbove(x);C(j)}break;case"a":rs(p)&&b.selectionMode()==="multiple"&&X(i.disallowSelectAll)!==!0&&(p.preventDefault(),b.selectAll());break;case"Escape":p.defaultPrevented||(p.preventDefault(),X(i.disallowEmptySelection)||b.clearSelection());break;case"Tab":if(!X(i.allowsTabNavigation)){if(p.shiftKey)v.focus();else{const j=YT(v,{tabbable:!0});let L,H;do H=j.lastChild(),H&&(L=H);while(H);L&&!L.contains(document.activeElement)&&At(L)}break}}},d=p=>{var C,w,O,x;const v=X(i.selectionManager),b=X(i.keyboardDelegate),S=X(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),S&&v.replaceSelection(E))},k=p.relatedTarget;k&&p.currentTarget.compareDocumentPosition(k)&Node.DOCUMENT_POSITION_FOLLOWING?_((w=v.lastSelectedKey())!=null?w:(C=b.getLastKey)==null?void 0:C.call(b)):_((x=v.firstSelectedKey())!=null?x:(O=b.getFirstKey)==null?void 0:O.call(b))}else if(!X(i.isVirtualized)){const _=s();if(_){_.scrollTop=a.top,_.scrollLeft=a.left;const k=_.querySelector(`[data-key="${v.focusedKey()}"]`);k&&(At(k),ef(_,k))}}}},f=p=>{const v=X(i.selectionManager);p.currentTarget.contains(p.relatedTarget)||v.setFocused(!1)},h=p=>{s()===p.target&&p.preventDefault()},g=()=>{var O,x;const p=X(i.autoFocus);if(!p)return;const v=X(i.selectionManager),b=X(i.keyboardDelegate);let S;p==="first"&&(S=(O=b.getFirstKey)==null?void 0:O.call(b)),p==="last"&&(S=(x=b.getLastKey)==null?void 0:x.call(b));const C=v.selectedKeys();C.size&&(S=C.values().next().value),v.setFocused(!0),v.setFocusedKey(S);const w=t();w&&S==null&&!X(i.shouldUseVirtualFocus)&&At(w)};return xr(()=>{i.deferAutoFocus?setTimeout(g,0):g()}),xe(br([s,()=>X(i.isVirtualized),()=>X(i.selectionManager).focusedKey()],p=>{var C;const[v,b,S]=p;if(b)S&&((C=i.scrollToKey)==null||C.call(i,S));else if(S&&v){const w=v.querySelector(`[data-key="${S}"]`);w&&ef(v,w)}})),{tabIndex:U(()=>{if(!X(i.shouldUseVirtualFocus))return X(i.selectionManager).focusedKey()==null?0:-1}),onKeyDown:c,onMouseDown:h,onFocusIn:d,onFocusOut:f}}function Kb(e,t){const n=()=>X(e.selectionManager),r=()=>X(e.key),i=()=>X(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"||rs(b)||"pointerType"in b&&b.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},o=()=>n().isSelected(r()),a=()=>X(e.disabled)||n().isDisabled(r()),l=()=>!a()&&n().canSelectItem(r());let u=null;const c=b=>{l()&&(u=b.pointerType,b.pointerType==="mouse"&&b.button===0&&!X(e.shouldSelectOnPressUp)&&s(b))},d=b=>{l()&&b.pointerType==="mouse"&&b.button===0&&X(e.shouldSelectOnPressUp)&&X(e.allowsDifferentPressOrigin)&&s(b)},f=b=>{l()&&(X(e.shouldSelectOnPressUp)&&!X(e.allowsDifferentPressOrigin)||u!=="mouse")&&s(b)},h=b=>{!l()||!["Enter"," "].includes(b.key)||(Vb(b)?n().toggleSelection(r()):s(b))},g=b=>{a()&&b.preventDefault()},m=b=>{const S=t();i()||a()||!S||b.target===S&&n().setFocusedKey(r())},p=U(()=>{if(!(i()||a()))return r()===n().focusedKey()?0:-1}),v=U(()=>X(e.virtualized)?void 0:r());return xe(br([t,r,i,()=>n().focusedKey(),()=>n().isFocused()],([b,S,C,w,O])=>{b&&S===w&&O&&!C&&document.activeElement!==b&&(e.focus?e.focus():At(b))})),{isSelected:o,isDisabled:a,allowsSelection:l,tabIndex:p,dataKey:v,onPointerDown:c,onPointerUp:d,onClick:f,onKeyDown:h,onMouseDown:g,onFocus:m}}var $P=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 ur(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 ur(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 ur([t],t,t):new ur;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode()==="none")return;const t=new ur;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 ur)}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}},nm=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 LP(e){const t=AP(e),r=vP({dataSource:()=>X(e.dataSource),getKey:()=>X(e.getKey),getTextValue:()=>X(e.getTextValue),getDisabled:()=>X(e.getDisabled),getSectionChildren:()=>X(e.getSectionChildren),factory:s=>e.filter?new nm(e.filter(s)):new nm(s)},[()=>e.filter]),i=new $P(r,t);return Wp(()=>{const s=t.focusedKey();s!=null&&!r().getItem(s)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>i}}var Et=e=>typeof e=="function"?e():e,DP=e=>{const t=U(()=>{const o=Et(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]=ce(Et(e.show)?"present":"hidden");let s="none";return xe(o=>{const a=Et(e.show);return at(()=>{var c;if(o===a)return a;const l=s,u=n();a?i("present"):u==="none"||((c=t())==null?void 0:c.display)==="none"?i("hidden"):i(o===!0&&l!==u?"hiding":"hidden")}),a}),xe(()=>{const o=Et(e.element);if(!o)return;const a=u=>{u.target===o&&(s=n())},l=u=>{const d=n().includes(u.animationName);u.target===o&&d&&r()==="hiding"&&i("hidden")};o.addEventListener("animationstart",a),o.addEventListener("animationcancel",l),o.addEventListener("animationend",l),_e(()=>{o.removeEventListener("animationstart",a),o.removeEventListener("animationcancel",l),o.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r}},IP=DP,Wb=IP,fu="data-kb-top-layer",Qb,nf=!1,wr=[];function ga(e){return wr.findIndex(t=>t.node===e)}function RP(e){return wr[ga(e)]}function NP(e){return wr[wr.length-1].node===e}function Yb(){return wr.filter(e=>e.isPointerBlocking)}function FP(){return[...Yb()].slice(-1)[0]}function ih(){return Yb().length>0}function Xb(e){var n;const t=ga((n=FP())==null?void 0:n.node);return ga(e)<t}function BP(e){wr.push(e)}function qP(e){const t=ga(e);t<0||wr.splice(t,1)}function zP(){for(const{node:e}of wr)e.style.pointerEvents=Xb(e)?"none":"auto"}function HP(e){if(ih()&&!nf){const t=Jn(e);Qb=document.body.style.pointerEvents,t.body.style.pointerEvents="none",nf=!0}}function UP(e){if(ih())return;const t=Jn(e);t.body.style.pointerEvents=Qb,t.body.style.length===0&&t.body.removeAttribute("style"),nf=!1}var Wt={layers:wr,isTopMostLayer:NP,hasPointerBlockingLayer:ih,isBelowPointerBlockingLayer:Xb,addLayer:BP,removeLayer:qP,indexOf:ga,find:RP,assignPointerEventToLayers:zP,disableBodyPointerEvents:HP,restoreBodyPointerEvents:UP},GP={};Zu(GP,{Button:()=>WP,Root:()=>sh});var VP=["button","color","file","image","reset","submit"];function KP(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?VP.indexOf(e.type)!==-1:!1}function sh(e){let t;const n=Re({type:"button"},e),[r,i]=Ke(n,["ref","type","disabled"]),s=Xu(()=>t,()=>"button"),o=U(()=>{const u=s();return u==null?!1:KP({tagName:u,type:r.type})}),a=U(()=>s()==="input"),l=U(()=>s()==="a"&&(t==null?void 0:t.getAttribute("href"))!=null);return D(st,Ae({as:"button",ref(u){const c=It(d=>t=d,r.ref);typeof c=="function"&&c(u)},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 WP=sh,QP=["top","right","bottom","left"],Xn=Math.min,on=Math.max,hu=Math.round,_l=Math.floor,Zr=e=>({x:e,y:e}),YP={left:"right",right:"left",bottom:"top",top:"bottom"},XP={start:"end",end:"start"};function rf(e,t,n){return on(e,Xn(t,n))}function Wi(e,t){return typeof e=="function"?e(t):e}function Jr(e){return e.split("-")[0]}function no(e){return e.split("-")[1]}function Zb(e){return e==="x"?"y":"x"}function oh(e){return e==="y"?"height":"width"}function qi(e){return["top","bottom"].includes(Jr(e))?"y":"x"}function ah(e){return Zb(qi(e))}function ZP(e,t,n){n===void 0&&(n=!1);const r=no(e),i=ah(e),s=oh(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=gu(o)),[o,gu(o)]}function JP(e){const t=gu(e);return[sf(e),t,sf(t)]}function sf(e){return e.replace(/start|end/g,t=>XP[t])}function ej(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 tj(e,t,n,r){const i=no(e);let s=ej(Jr(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(sf)))),s}function gu(e){return e.replace(/left|right|bottom|top/g,t=>YP[t])}function nj(e){return{top:0,right:0,bottom:0,left:0,...e}}function Jb(e){return typeof e!="number"?nj(e):{top:e,right:e,bottom:e,left:e}}function yu(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 rm(e,t,n){let{reference:r,floating:i}=e;const s=qi(t),o=ah(t),a=oh(o),l=Jr(t),u=s==="y",c=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:c,y:r.y-i.height};break;case"bottom":h={x:c,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(no(t)){case"start":h[o]-=f*(n&&u?-1:1);break;case"end":h[o]+=f*(n&&u?-1:1);break}return h}var rj=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 u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=rm(u,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:S,data:C,reset:w}=await v({x:c,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:h,rects:u,platform:o,elements:{reference:e,floating:t}});c=b!=null?b:c,d=S!=null?S:d,h={...h,[p]:{...h[p],...C}},w&&g<=50&&(g++,typeof w=="object"&&(w.placement&&(f=w.placement),w.rects&&(u=w.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):w.rects),{x:c,y:d}=rm(u,f,l)),m=-1)}return{x:c,y:d,placement:f,strategy:i,middlewareData:h}};async function ya(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Wi(t,e),g=Jb(h),p=a[f?d==="floating"?"reference":"floating":d],v=yu(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:u,rootBoundary:c,strategy:l})),b=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(S))?await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1}:{x:1,y:1},w=yu(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:S,strategy:l}):b);return{top:(v.top-w.top+g.top)/C.y,bottom:(w.bottom-v.bottom+g.bottom)/C.y,left:(v.left-w.left+g.left)/C.x,right:(w.right-v.right+g.right)/C.x}}var ij=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:u,padding:c=0}=Wi(e,t)||{};if(u==null)return{};const d=Jb(c),f={x:n,y:r},h=ah(i),g=oh(h),m=await o.getDimensions(u),p=h==="y",v=p?"top":"left",b=p?"bottom":"right",S=p?"clientHeight":"clientWidth",C=s.reference[g]+s.reference[h]-f[h]-s.floating[g],w=f[h]-s.reference[h],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let x=O?O[S]:0;(!x||!await(o.isElement==null?void 0:o.isElement(O)))&&(x=a.floating[S]||s.floating[g]);const _=C/2-w/2,k=x/2-m[g]/2-1,E=Xn(d[v],k),P=Xn(d[b],k),M=E,B=x-m[g]-P,R=x/2-m[g]/2+_,A=rf(M,R,B),j=!l.arrow&&no(i)!=null&&R!==A&&s.reference[g]/2-(R<M?E:P)-m[g]/2<0,L=j?R<M?R-M:R-B:0;return{[h]:f[h]+L,data:{[h]:A,centerOffset:R-A-L,...j&&{alignmentOffset:L}},reset:j}}}),sj=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:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...p}=Wi(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=Jr(i),b=qi(a),S=Jr(a)===a,C=await(l.isRTL==null?void 0:l.isRTL(u.floating)),w=f||(S||!m?[gu(a)]:JP(a)),O=g!=="none";!f&&O&&w.push(...tj(a,m,g,C));const x=[a,...w],_=await ya(t,p),k=[];let E=((r=s.flip)==null?void 0:r.overflows)||[];if(c&&k.push(_[v]),d){const R=ZP(i,o,C);k.push(_[R[0]],_[R[1]])}if(E=[...E,{placement:i,overflows:k}],!k.every(R=>R<=0)){var P,M;const R=(((P=s.flip)==null?void 0:P.index)||0)+1,A=x[R];if(A)return{data:{index:R,overflows:E},reset:{placement:A}};let j=(M=E.filter(L=>L.overflows[0]<=0).sort((L,H)=>L.overflows[1]-H.overflows[1])[0])==null?void 0:M.placement;if(!j)switch(h){case"bestFit":{var B;const L=(B=E.filter(H=>{if(O){const Q=qi(H.placement);return Q===b||Q==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(Q=>Q>0).reduce((Q,F)=>Q+F,0)]).sort((H,Q)=>H[1]-Q[1])[0])==null?void 0:B[0];L&&(j=L);break}case"initialPlacement":j=a;break}if(i!==j)return{reset:{placement:j}}}return{}}}};function im(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function sm(e){return QP.some(t=>e[t]>=0)}var oj=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Wi(e,t);switch(r){case"referenceHidden":{const s=await ya(t,{...i,elementContext:"reference"}),o=im(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:sm(o)}}}case"escaped":{const s=await ya(t,{...i,altBoundary:!0}),o=im(s,n.floating);return{data:{escapedOffsets:o,escaped:sm(o)}}}default:return{}}}}};async function aj(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Jr(n),a=no(n),l=qi(n)==="y",u=["left","top"].includes(o)?-1:1,c=s&&l?-1:1,d=Wi(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*c,y:f*u}:{x:f*u,y:h*c}}var lj=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 aj(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}}}}},uj=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}=Wi(e,t),u={x:n,y:r},c=await ya(t,l),d=qi(Jr(i)),f=Zb(d);let h=u[f],g=u[d];if(s){const p=f==="y"?"top":"left",v=f==="y"?"bottom":"right",b=h+c[p],S=h-c[v];h=rf(b,h,S)}if(o){const p=d==="y"?"top":"left",v=d==="y"?"bottom":"right",b=g+c[p],S=g-c[v];g=rf(b,g,S)}const m=a.fn({...t,[f]:h,[d]:g});return{...m,data:{x:m.x-n,y:m.y-r}}}}},cj=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}=Wi(e,t),l=await ya(t,a),u=Jr(n),c=no(n),d=qi(n)==="y",{width:f,height:h}=r.floating;let g,m;u==="top"||u==="bottom"?(g=u,m=c===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(m=u,g=c==="end"?"top":"bottom");const p=h-l.top-l.bottom,v=f-l.left-l.right,b=Xn(h-l[g],p),S=Xn(f-l[m],v),C=!t.middlewareData.shift;let w=b,O=S;if(d?O=c||C?Xn(S,v):v:w=c||C?Xn(b,p):p,C&&!c){const _=on(l.left,0),k=on(l.right,0),E=on(l.top,0),P=on(l.bottom,0);d?O=f-2*(_!==0||k!==0?_+k:on(l.left,l.right)):w=h-2*(E!==0||P!==0?E+P:on(l.top,l.bottom))}await o({...t,availableWidth:O,availableHeight:w});const x=await i.getDimensions(s.floating);return f!==x.width||h!==x.height?{reset:{rects:!0}}:{}}}};function ro(e){return e1(e)?(e.nodeName||"").toLowerCase():"#document"}function un(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function _r(e){var t;return(t=(e1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function e1(e){return e instanceof Node||e instanceof un(e).Node}function $n(e){return e instanceof Element||e instanceof un(e).Element}function er(e){return e instanceof HTMLElement||e instanceof un(e).HTMLElement}function om(e){return typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof un(e).ShadowRoot}function Wa(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Ln(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function dj(e){return["table","td","th"].includes(ro(e))}function Ju(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(n){return!1}})}function lh(e){const t=uh(),n=$n(e)?Ln(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 fj(e){let t=ei(e);for(;er(t)&&!Ks(t);){if(lh(t))return t;if(Ju(t))return null;t=ei(t)}return null}function uh(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ks(e){return["html","body","#document"].includes(ro(e))}function Ln(e){return un(e).getComputedStyle(e)}function ec(e){return $n(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ei(e){if(ro(e)==="html")return e;const t=e.assignedSlot||e.parentNode||om(e)&&e.host||_r(e);return om(t)?t.host:t}function t1(e){const t=ei(e);return Ks(t)?e.ownerDocument?e.ownerDocument.body:e.body:er(t)&&Wa(t)?t:t1(t)}function ma(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=t1(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=un(i);return s?t.concat(o,o.visualViewport||[],Wa(i)?i:[],o.frameElement&&n?ma(o.frameElement):[]):t.concat(i,ma(i,[],n))}function n1(e){const t=Ln(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=er(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,a=hu(n)!==s||hu(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function ch(e){return $n(e)?e:e.contextElement}function ds(e){const t=ch(e);if(!er(t))return Zr(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=n1(t);let o=(s?hu(n.width):n.width)/r,a=(s?hu(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}var hj=Zr(0);function r1(e){const t=un(e);return!uh()||!t.visualViewport?hj:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function gj(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==un(e)?!1:t}function zi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=ch(e);let o=Zr(1);t&&(r?$n(r)&&(o=ds(r)):o=ds(e));const a=gj(s,n,r)?r1(s):Zr(0);let l=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,c=i.width/o.x,d=i.height/o.y;if(s){const f=un(s),h=r&&$n(r)?un(r):r;let g=f,m=g.frameElement;for(;m&&r&&h!==g;){const p=ds(m),v=m.getBoundingClientRect(),b=Ln(m),S=v.left+(m.clientLeft+parseFloat(b.paddingLeft))*p.x,C=v.top+(m.clientTop+parseFloat(b.paddingTop))*p.y;l*=p.x,u*=p.y,c*=p.x,d*=p.y,l+=S,u+=C,g=un(m),m=g.frameElement}}return yu({width:c,height:d,x:l,y:u})}function yj(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",o=_r(r),a=t?Ju(t.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=Zr(1);const c=Zr(0),d=er(r);if((d||!d&&!s)&&((ro(r)!=="body"||Wa(o))&&(l=ec(r)),er(r))){const f=zi(r);u=ds(r),c.x=f.x+r.clientLeft,c.y=f.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x,y:n.y*u.y-l.scrollTop*u.y+c.y}}function mj(e){return Array.from(e.getClientRects())}function i1(e){return zi(_r(e)).left+ec(e).scrollLeft}function pj(e){const t=_r(e),n=ec(e),r=e.ownerDocument.body,i=on(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=on(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+i1(e);const a=-n.scrollTop;return Ln(r).direction==="rtl"&&(o+=on(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function vj(e,t){const n=un(e),r=_r(e),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const u=uh();(!u||u&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function bj(e,t){const n=zi(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=er(e)?ds(e):Zr(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:o,height:a,x:l,y:u}}function am(e,t,n){let r;if(t==="viewport")r=vj(e,n);else if(t==="document")r=pj(_r(e));else if($n(t))r=bj(t,n);else{const i=r1(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return yu(r)}function s1(e,t){const n=ei(e);return n===t||!$n(n)||Ks(n)?!1:Ln(n).position==="fixed"||s1(n,t)}function xj(e,t){const n=t.get(e);if(n)return n;let r=ma(e,[],!1).filter(a=>$n(a)&&ro(a)!=="body"),i=null;const s=Ln(e).position==="fixed";let o=s?ei(e):e;for(;$n(o)&&!Ks(o);){const a=Ln(o),l=lh(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Wa(o)&&!l&&s1(e,o))?r=r.filter(c=>c!==o):i=a,o=ei(o)}return t.set(e,r),r}function wj(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?Ju(t)?[]:xj(t,this._c):[].concat(n),r],a=o[0],l=o.reduce((u,c)=>{const d=am(t,c,i);return u.top=on(d.top,u.top),u.right=Xn(d.right,u.right),u.bottom=Xn(d.bottom,u.bottom),u.left=on(d.left,u.left),u},am(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Sj(e){const{width:t,height:n}=n1(e);return{width:t,height:n}}function Cj(e,t,n){const r=er(t),i=_r(t),s=n==="fixed",o=zi(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=Zr(0);if(r||!r&&!s)if((ro(t)!=="body"||Wa(i))&&(a=ec(t)),r){const d=zi(t,!0,s,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&(l.x=i1(i));const u=o.left+a.scrollLeft-l.x,c=o.top+a.scrollTop-l.y;return{x:u,y:c,width:o.width,height:o.height}}function Uc(e){return Ln(e).position==="static"}function lm(e,t){return!er(e)||Ln(e).position==="fixed"?null:t?t(e):e.offsetParent}function o1(e,t){const n=un(e);if(Ju(e))return n;if(!er(e)){let i=ei(e);for(;i&&!Ks(i);){if($n(i)&&!Uc(i))return i;i=ei(i)}return n}let r=lm(e,t);for(;r&&dj(r)&&Uc(r);)r=lm(r,t);return r&&Ks(r)&&Uc(r)&&!lh(r)?n:r||fj(e)||n}var _j=async function(e){const t=this.getOffsetParent||o1,n=this.getDimensions,r=await n(e.floating);return{reference:Cj(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function kj(e){return Ln(e).direction==="rtl"}var a1={convertOffsetParentRelativeRectToViewportRelativeRect:yj,getDocumentElement:_r,getClippingRect:wj,getOffsetParent:o1,getElementRects:_j,getClientRects:mj,getDimensions:Sj,getScale:ds,isElement:$n,isRTL:kj};function Oj(e,t){let n=null,r;const i=_r(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:u,top:c,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const h=_l(c),g=_l(i.clientWidth-(u+d)),m=_l(i.clientHeight-(c+f)),p=_l(u),b={rootMargin:-h+"px "+-g+"px "+-m+"px "+-p+"px",threshold:on(0,Xn(1,l))||1};let S=!0;function C(w){const O=w[0].intersectionRatio;if(O!==l){if(!S)return o();O?o(!1,O):r=setTimeout(()=>{o(!1,1e-7)},1e3)}S=!1}try{n=new IntersectionObserver(C,{...b,root:i.ownerDocument})}catch(w){n=new IntersectionObserver(C,b)}n.observe(e)}return o(!0),s}function Ej(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,u=ch(e),c=i||s?[...u?ma(u):[],...ma(t)]:[];c.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const d=u&&a?Oj(u,n):null;let f=-1,h=null;o&&(h=new ResizeObserver(v=>{let[b]=v;b&&b.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var S;(S=h)==null||S.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let g,m=l?zi(e):null;l&&p();function p(){const v=zi(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;c.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 Aj=lj,Tj=uj,Pj=sj,jj=cj,Mj=oj,$j=ij,Lj=(e,t,n)=>{const r=new Map,i={platform:a1,...n},s={...i.platform,_c:r};return rj(e,t,{...i,platform:s})},dh=wt();function fh(){const e=St(dh);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var Dj=he('<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">'),of=30,um=of/2,Ij={top:180,right:-90,bottom:0,left:90};function hh(e){const t=fh(),n=Re({size:of},e),[r,i]=Ke(n,["ref","style","size"]),s=()=>t.currentPlacement().split("-")[0],o=Rj(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"},u=()=>{var f;return((f=o())==null?void 0:f.getPropertyValue(`border-${s()}-width`))||"0px"},c=()=>Number.parseInt(u())*2*(of/r.size),d=()=>`rotate(${Ij[s()]} ${um} ${um}) translate(0 2)`;return D(st,Ae({as:"div",ref(f){const h=It(t.setArrowRef,r.ref);typeof h=="function"&&h(f)},"aria-hidden":"true",get style(){return Qu({position:"absolute","font-size":`${r.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:a(),stroke:l(),"stroke-width":c()},r.style)}},i,{get children(){const f=Dj(),h=f.firstChild;return be(()=>re(h,"transform",d())),f}}))}function Rj(e){const[t,n]=ce();return xe(()=>{const r=e();r&&n(IT(r).getComputedStyle(r))}),t}function Nj(e){const t=fh(),[n,r]=Ke(e,["ref","style"]);return D(st,Ae({as:"div",ref(i){const s=It(t.setPositionerRef,n.ref);typeof s=="function"&&s(i)},"data-popper-positioner":"",get style(){return Qu({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}function cm(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 Fj(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?cm(r):e?e.getBoundingClientRect():cm()}}}function Bj(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var qj={top:"bottom",right:"left",bottom:"top",left:"right"};function zj(e,t){const[n,r]=e.split("-"),i=qj[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 Hj(e){const t=Re({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]=ce(),[i,s]=ce(),[o,a]=ce(t.placement),l=()=>{var f;return Fj((f=t.anchorRef)==null?void 0:f.call(t),t.getAnchorRect)},{direction:u}=si();async function c(){var O,x,_;const f=l(),h=n(),g=i();if(!f||!h)return;const m=((g==null?void 0:g.clientHeight)||0)/2,p=typeof t.gutter=="number"?t.gutter+m:(O=t.gutter)!=null?O:m;h.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),f.getBoundingClientRect();const v=[Aj(({placement:k})=>{const E=!!k.split("-")[1];return{mainAxis:p,crossAxis:E?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const k=typeof t.flip=="string"?t.flip.split(" "):void 0;if(k!==void 0&&!k.every(Bj))throw new Error("`flip` expects a spaced-delimited list of placements");v.push(Pj({padding:t.overflowPadding,fallbackPlacements:k}))}(t.slide||t.overlap)&&v.push(Tj({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),v.push(jj({padding:t.overflowPadding,apply({availableWidth:k,availableHeight:E,rects:P}){const M=Math.round(P.reference.width);k=Math.floor(k),E=Math.floor(E),h.style.setProperty("--kb-popper-anchor-width",`${M}px`),h.style.setProperty("--kb-popper-content-available-width",`${k}px`),h.style.setProperty("--kb-popper-content-available-height",`${E}px`),t.sameWidth&&(h.style.width=`${M}px`),t.fitViewport&&(h.style.maxWidth=`${k}px`,h.style.maxHeight=`${E}px`)}})),t.hideWhenDetached&&v.push(Mj({padding:t.detachedPadding})),g&&v.push($j({element:g,padding:t.arrowPadding}));const b=await Lj(f,h,{placement:t.placement,strategy:"absolute",middleware:v,platform:{...a1,isRTL:()=>u()==="rtl"}});if(a(b.placement),(x=t.onCurrentPlacementChange)==null||x.call(t,b.placement),!h)return;h.style.setProperty("--kb-popper-content-transform-origin",zj(b.placement,u()));const S=Math.round(b.x),C=Math.round(b.y);let w;if(t.hideWhenDetached&&(w=(_=b.middlewareData.hide)!=null&&_.referenceHidden?"hidden":"visible"),Object.assign(h.style,{top:"0",left:"0",transform:`translate3d(${S}px, ${C}px, 0)`,visibility:w}),g&&b.middlewareData.arrow){const{x:k,y:E}=b.middlewareData.arrow,P=b.placement.split("-")[0];Object.assign(g.style,{left:k!=null?`${k}px`:"",top:E!=null?`${E}px`:"",[P]:"100%"})}}xe(()=>{const f=l(),h=n();if(!f||!h)return;const g=Ej(f,h,c,{elementResize:typeof ResizeObserver=="function"});_e(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 D(dh.Provider,{value:d,get children(){return t.children}})}var l1=Object.assign(Hj,{Arrow:hh,Context:dh,usePopperContext:fh,Positioner:Nj});function Uj(e){const t=n=>{var r;n.key===eh.Escape&&((r=e.onEscapeKeyDown)==null||r.call(e,n))};xe(()=>{var r,i;if(X(e.isDisabled))return;const n=(i=(r=e.ownerDocument)==null?void 0:r.call(e))!=null?i:Jn();n.addEventListener("keydown",t),_e(()=>{n.removeEventListener("keydown",t)})})}var dm="interactOutside.pointerDownOutside",fm="interactOutside.focusOutside";function Gj(e,t){let n,r=ZT;const i=()=>Jn(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(`[${fu}]`)||!wn(i(),f)||wn(t(),f)?!1:!((h=e.shouldExcludeElement)!=null&&h.call(e,f))},u=d=>{function f(){const h=t(),g=d.target;if(!h||!g||!l(d))return;const m=vt([s,a]);g.addEventListener(dm,m,{once:!0});const p=new CustomEvent(dm,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||qT(d)&&d.button===0}});g.dispatchEvent(p)}d.pointerType==="touch"?(i().removeEventListener("click",f),r=f,i().addEventListener("click",f,{once:!0})):f()},c=d=>{const f=t(),h=d.target;if(!f||!h||!l(d))return;const g=vt([o,a]);h.addEventListener(fm,g,{once:!0});const m=new CustomEvent(fm,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});h.dispatchEvent(m)};xe(()=>{X(e.isDisabled)||(n=window.setTimeout(()=>{i().addEventListener("pointerdown",u,!0)},0),i().addEventListener("focusin",c,!0),_e(()=>{window.clearTimeout(n),i().removeEventListener("click",r),i().removeEventListener("pointerdown",u,!0),i().removeEventListener("focusin",c,!0)}))})}var u1=wt();function Vj(){return St(u1)}function Kj(e){let t;const n=Vj(),[r,i]=Ke(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()}};Gj({shouldExcludeElement:d=>{var f;return t?((f=r.excludedElements)==null?void 0:f.some(h=>wn(h(),d)))||[...s].some(h=>wn(h,d)):!1},onPointerDownOutside:d=>{var f,h,g;!t||Wt.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!Wt.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),Uj({ownerDocument:()=>Jn(t),onEscapeKeyDown:d=>{var f;!t||!Wt.isTopMostLayer(t)||((f=r.onEscapeKeyDown)==null||f.call(r,d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),xr(()=>{if(!t)return;Wt.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n==null?void 0:n.registerNestedLayer(t);Wt.assignPointerEventToLayers(),Wt.disableBodyPointerEvents(t),_e(()=>{t&&(Wt.removeLayer(t),d==null||d(),Wt.assignPointerEventToLayers(),Wt.restoreBodyPointerEvents(t))})}),xe(br([()=>t,()=>r.disableOutsidePointerEvents],([d,f])=>{if(!d)return;const h=Wt.find(d);h&&h.isPointerBlocking!==f&&(h.isPointerBlocking=f,Wt.assignPointerEventToLayers()),f&&Wt.disableBodyPointerEvents(d),_e(()=>{Wt.restoreBodyPointerEvents(d)})},{defer:!0}));const c={registerNestedLayer:o};return D(u1.Provider,{value:c,get children(){return D(st,Ae({as:"div",ref(d){const f=It(h=>t=h,r.ref);typeof f=="function"&&f(d)}},i))}})}function c1(e={}){const[t,n]=Nb({value:()=>X(e.open),defaultValue:()=>!!X(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 mn={};Zu(mn,{Description:()=>Ib,ErrorMessage:()=>Rb,Item:()=>g1,ItemControl:()=>y1,ItemDescription:()=>m1,ItemIndicator:()=>p1,ItemInput:()=>v1,ItemLabel:()=>b1,Label:()=>x1,RadioGroup:()=>Wj,Root:()=>w1});var d1=wt();function f1(){const e=St(d1);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupContext` must be used within a `RadioGroup` component");return e}var h1=wt();function Qa(){const e=St(h1);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupItemContext` must be used within a `RadioGroup.Item` component");return e}function g1(e){const t=Va(),n=f1(),r=`${t.generateId("item")}-${kn()}`,i=Re({id:r},e),[s,o]=Ke(i,["value","disabled","onPointerDown"]),[a,l]=ce(),[u,c]=ce(),[d,f]=ce(),[h,g]=ce(),[m,p]=ce(!1),v=U(()=>n.isSelectedValue(s.value)),b=U(()=>s.disabled||t.isDisabled()||!1),S=O=>{nt(O,s.onPointerDown),m()&&O.preventDefault()},C=U(()=>({...t.dataset(),"data-disabled":b()?"":void 0,"data-checked":v()?"":void 0})),w={value:()=>s.value,dataset:C,isSelected:v,isDisabled:b,inputId:a,labelId:u,descriptionId:d,inputRef:h,select:()=>n.setSelectedValue(s.value),generateId:Ga(()=>o.id),registerInput:Sn(l),registerLabel:Sn(c),registerDescription:Sn(f),setIsFocused:p,setInputRef:g};return D(h1.Provider,{value:w,get children(){return D(st,Ae({as:"div",role:"group",onPointerDown:S},C,o))}})}function y1(e){const t=Qa(),n=Re({id:t.generateId("control")},e),[r,i]=Ke(n,["onClick","onKeyDown"]);return D(st,Ae({as:"div",onClick:a=>{var l;nt(a,r.onClick),t.select(),(l=t.inputRef())==null||l.focus()},onKeyDown:a=>{var l;nt(a,r.onKeyDown),a.key===eh.Space&&(t.select(),(l=t.inputRef())==null||l.focus())}},()=>t.dataset(),i))}function m1(e){const t=Qa(),n=Re({id:t.generateId("description")},e);return xe(()=>_e(t.registerDescription(n.id))),D(st,Ae({as:"div"},()=>t.dataset(),n))}function p1(e){const t=Qa(),n=Re({id:t.generateId("indicator")},e),[r,i]=Ke(n,["ref","forceMount"]),[s,o]=ce(),{present:a}=Wb({show:()=>r.forceMount||t.isSelected(),element:()=>{var l;return(l=s())!=null?l:null}});return D(ve,{get when(){return a()},get children(){return D(st,Ae({as:"div",ref(l){const u=It(o,r.ref);typeof u=="function"&&u(l)}},()=>t.dataset(),i))}})}function v1(e){const t=Va(),n=f1(),r=Qa(),i=Re({id:r.generateId("input")},e),[s,o]=Ke(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,[u,c]=ce(!1),d=g=>{if(nt(g,s.onChange),g.stopPropagation(),!u()){n.setSelectedValue(r.value());const m=g.target;m.checked=r.isSelected()}c(!1)},f=g=>{nt(g,s.onFocus),r.setIsFocused(!0)},h=g=>{nt(g,s.onBlur),r.setIsFocused(!1)};return xe(br([()=>r.isSelected(),()=>r.value()],g=>{if(!g[0]&&g[1]===r.value())return;c(!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(()=>_e(r.registerInput(o.id))),D(st,Ae({as:"input",ref(g){const m=It(r.setInputRef,s.ref);typeof m=="function"&&m(g)},type:"radio",get name(){return t.name()},get value(){return r.value()},get checked(){return r.isSelected()},get required(){return t.isRequired()},get disabled(){return r.isDisabled()},get readonly(){return t.isReadOnly()},get style(){return Qu({...Lb},s.style)},get"aria-labelledby"(){return a()},get"aria-describedby"(){return l()},onChange:d,onFocus:f,onBlur:h},()=>r.dataset(),o))}function b1(e){const t=Qa(),n=Re({id:t.generateId("label")},e);return xe(()=>_e(t.registerLabel(n.id))),D(st,Ae({as:"label",get for(){return t.inputId()}},()=>t.dataset(),n))}function x1(e){return D(rP,Ae({as:"span"},e))}function w1(e){let t;const n=`radiogroup-${kn()}`,r=Re({id:n,orientation:"vertical"},e),[i,s,o]=Ke(r,["ref","value","defaultValue","onChange","orientation","aria-labelledby","aria-describedby"],tP),[a,l]=Ka({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:g=>{var m;return(m=i.onChange)==null?void 0:m.call(i,g)}}),{formControlContext:u}=nP(s);iP(()=>t,()=>{var g;return l((g=i.defaultValue)!=null?g:"")});const c=()=>u.getAriaLabelledBy(X(s.id),o["aria-label"],i["aria-labelledby"]),d=()=>u.getAriaDescribedBy(i["aria-describedby"]),f=g=>g===a(),h={ariaDescribedBy:d,isSelectedValue:f,setSelectedValue:g=>{if(!(u.isReadOnly()||u.isDisabled())&&(l(g),t))for(const m of t.querySelectorAll("[type='radio']")){const p=m;p.checked=f(p.value)}}};return D(Db.Provider,{value:u,get children(){return D(d1.Provider,{value:h,get children(){return D(st,Ae({as:"div",ref(g){const m=It(p=>t=p,i.ref);typeof m=="function"&&m(g)},role:"radiogroup",get id(){return X(s.id)},get"aria-invalid"(){return u.validationState()==="invalid"||void 0},get"aria-required"(){return u.isRequired()||void 0},get"aria-disabled"(){return u.isDisabled()||void 0},get"aria-readonly"(){return u.isReadOnly()||void 0},get"aria-orientation"(){return i.orientation},get"aria-labelledby"(){return c()},get"aria-describedby"(){return d()}},()=>u.dataset(),o))}})}})}var Wj=Object.assign(w1,{Description:Ib,ErrorMessage:Rb,Item:g1,ItemControl:y1,ItemDescription:m1,ItemIndicator:p1,ItemInput:v1,ItemLabel:b1,Label:x1}),Qj=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 Yj(e,t,n){const r=kP({usage:"search",sensitivity:"base"}),i=U(()=>{const s=X(e.keyboardDelegate);return s||new Qj(e.collection,t,r)});return MP({selectionManager:()=>X(e.selectionManager),keyboardDelegate:i,autoFocus:()=>X(e.autoFocus),deferAutoFocus:()=>X(e.deferAutoFocus),shouldFocusWrap:()=>X(e.shouldFocusWrap),disallowEmptySelection:()=>X(e.disallowEmptySelection),selectOnFocus:()=>X(e.selectOnFocus),disallowTypeAhead:()=>X(e.disallowTypeAhead),shouldUseVirtualFocus:()=>X(e.shouldUseVirtualFocus),allowsTabNavigation:()=>X(e.allowsTabNavigation),isVirtualized:()=>X(e.isVirtualized),scrollToKey:s=>{var o;return(o=X(e.scrollToKey))==null?void 0:o(s)},orientation:()=>X(e.orientation)},t)}var Gc="focusScope.autoFocusOnMount",Vc="focusScope.autoFocusOnUnmount",hm={bubbles:!1,cancelable:!0},gm={stack:[],active(){return this.stack[0]},add(e){var t;e!==this.active()&&((t=this.active())==null||t.pause()),this.stack=Jd(this.stack,e),this.stack.unshift(e)},remove(e){var t;this.stack=Jd(this.stack,e),(t=this.active())==null||t.resume()}};function Xj(e,t){const[n,r]=ce(!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=()=>Jn(t()),u=()=>{const g=l().createElement("span");return g.setAttribute("data-focus-trap",""),g.tabIndex=0,Object.assign(g.style,Lb),g},c=()=>{const g=t();return g?Mb(g,!0).filter(m=>!m.hasAttribute("data-focus-trap")):[]},d=()=>{const g=c();return g.length>0?g[0]:null},f=()=>{const g=c();return g.length>0?g[g.length-1]:null},h=()=>{const g=t();if(!g)return!1;const m=Io(g);return!m||wn(g,m)?!1:$b(m)};xe(()=>{const g=t();if(!g)return;gm.add(i);const m=Io(g);if(!wn(g,m)){const v=new CustomEvent(Gc,hm);g.addEventListener(Gc,o),g.dispatchEvent(v),v.defaultPrevented||setTimeout(()=>{At(d()),Io(g)===m&&At(g)},0)}_e(()=>{g.removeEventListener(Gc,o),setTimeout(()=>{const v=new CustomEvent(Vc,hm);h()&&v.preventDefault(),g.addEventListener(Vc,a),g.dispatchEvent(v),v.defaultPrevented||At(m!=null?m:l().body),g.removeEventListener(Vc,a),gm.remove(i)},0)})}),xe(()=>{const g=t();if(!g||!X(e.trapFocus)||n())return;const m=v=>{const b=v.target;b!=null&&b.closest(`[${fu}]`)||(wn(g,b)?s=b:At(s))},p=v=>{const b=v.relatedTarget,S=b!=null?b:Io(g);S!=null&&S.closest(`[${fu}]`)||wn(g,S)||At(s)};l().addEventListener("focusin",m),l().addEventListener("focusout",p),_e(()=>{l().removeEventListener("focusin",m),l().removeEventListener("focusout",p)})}),xe(()=>{const g=t();if(!g||!X(e.trapFocus)||n())return;const m=u();g.insertAdjacentElement("afterbegin",m);const p=u();g.insertAdjacentElement("beforeend",p);function v(S){const C=d(),w=f();S.relatedTarget===C?At(w):At(C)}m.addEventListener("focusin",v),p.addEventListener("focusin",v);const b=new MutationObserver(S=>{for(const C of S)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}),_e(()=>{m.removeEventListener("focusin",v),p.removeEventListener("focusin",v),m.remove(),p.remove(),b.disconnect()})})}var Zj="data-live-announcer";function Jj(e){xe(()=>{X(e.isDisabled)||_e(eM(X(e.targets),X(e.root)))})}var _o=new WeakMap,yn=[];function eM(e,t=document.body){const n=new Set(e),r=new Set,i=l=>{for(const f of l.querySelectorAll(`[${Zj}], [${fu}]`))n.add(f);const u=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},c=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:u}),d=u(l);if(d===NodeFilter.FILTER_ACCEPT&&s(l),d!==NodeFilter.FILTER_REJECT){let f=c.nextNode();for(;f!=null;)s(f),f=c.nextNode()}},s=l=>{var c;const u=(c=_o.get(l))!=null?c:0;l.getAttribute("aria-hidden")==="true"&&u===0||(u===0&&l.setAttribute("aria-hidden","true"),r.add(l),_o.set(l,u+1))};yn.length&&yn[yn.length-1].disconnect(),i(t);const o=new MutationObserver(l=>{for(const u of l)if(!(u.type!=="childList"||u.addedNodes.length===0)&&![...n,...r].some(c=>c.contains(u.target))){for(const c of u.removedNodes)c instanceof Element&&(n.delete(c),r.delete(c));for(const c of u.addedNodes)(c instanceof HTMLElement||c instanceof SVGElement)&&(c.dataset.liveAnnouncer==="true"||c.dataset.reactAriaTopLayer==="true")?n.add(c):c instanceof Element&&i(c)}});o.observe(t,{childList:!0,subtree:!0});const a={observe(){o.observe(t,{childList:!0,subtree:!0})},disconnect(){o.disconnect()}};return yn.push(a),()=>{o.disconnect();for(const l of r){const u=_o.get(l);if(u==null)return;u===1?(l.removeAttribute("aria-hidden"),_o.delete(l)):_o.set(l,u-1)}a===yn[yn.length-1]?(yn.pop(),yn.length&&yn[yn.length-1].observe()):yn.splice(yn.indexOf(a),1)}}var kl=new Map,tM=e=>{xe(()=>{var s,o;const t=(s=Et(e.style))!=null?s:{},n=(o=Et(e.properties))!=null?o:[],r={};for(const a in t)r[a]=e.element.style[a];const i=kl.get(e.key);i?i.activeCount++:kl.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);_e(()=>{var l;const a=kl.get(e.key);if(a){if(a.activeCount!==1){a.activeCount--;return}kl.delete(e.key);for(const[u,c]of Object.entries(a.originalStyles))e.element.style[u]=c;for(const u of a.properties)e.element.style.removeProperty(u);e.element.style.length===0&&e.element.removeAttribute("style"),(l=e.cleanup)==null||l.call(e)}})})},ym=tM,nM=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},rM=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},iM=(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[u,c,d]=nM(i,t),f=d-u-r*c;(c!==0||f!==0)&&rM(i,t)&&(s+=f,o+=c),i===(n!=null?n:document.documentElement)?a=!0:i=(l=i._$host)!=null?l:i.parentElement}while(i&&!a);return[s,o]},[mm,pm]=ce([]),sM=e=>mm().indexOf(e)===mm().length-1,oM=e=>{const t=Ae({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=kn();let r=[0,0],i=null,s=null;xe(()=>{Et(t.enabled)&&(pm(u=>[...u,n]),_e(()=>{pm(u=>u.filter(c=>c!==n))}))}),xe(()=>{if(!Et(t.enabled)||!Et(t.hideScrollbar))return;const{body:u}=document,c=window.innerWidth-u.offsetWidth;if(Et(t.preventScrollbarShift)){const d={overflow:"hidden"},f=[];c>0&&(Et(t.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(u).paddingRight} + ${c}px)`:d.marginRight=`calc(${window.getComputedStyle(u).marginRight} + ${c}px)`,f.push({key:"--scrollbar-width",value:`${c}px`}));const h=window.scrollY,g=window.scrollX;ym({key:"prevent-scroll",element:u,style:d,properties:f,cleanup:()=>{Et(t.restoreScrollPosition)&&c>0&&window.scrollTo(g,h)}})}else ym({key:"prevent-scroll",element:u,style:{overflow:"hidden"}})}),xe(()=>{!sM(n)||!Et(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",o,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),_e(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",o),document.removeEventListener("touchmove",l)}))});const o=u=>{r=vm(u),i=null,s=null},a=u=>{const c=u.target,d=Et(t.element),f=aM(u),h=Math.abs(f[0])>Math.abs(f[1])?"x":"y",g=h==="x"?f[0]:f[1],m=bm(c,h,g,d);let p;d&&af(d,c)?p=!m:p=!0,p&&u.cancelable&&u.preventDefault()},l=u=>{const c=Et(t.element),d=u.target;let f;if(u.touches.length===2)f=!Et(t.allowPinchZoom);else{if(i==null||s===null){const h=vm(u).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=bm(d,i,s,c);c&&af(c,d)?f=!h:f=!0}}f&&u.cancelable&&u.preventDefault()}},aM=e=>[e.deltaX,e.deltaY],vm=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],bm=(e,t,n,r)=>{const i=r!==null&&af(r,e),[s,o]=iM(e,t,i?r:void 0);return!(n>0&&Math.abs(s)<=1||n<0&&Math.abs(o)<1)},af=(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},lM=oM,uM=lM,S1=wt();function C1(){return St(S1)}function kr(){const e=C1();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var _1=wt();function gh(){const e=St(_1);if(e===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var k1=wt();function tr(){const e=St(k1);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function yh(e){let t;const n=tr(),r=kr(),i=Re({id:n.generateId(`item-${kn()}`)},e),[s,o]=Ke(i,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=ce(),[u,c]=ce(),[d,f]=ce(),h=()=>r.listState().selectionManager(),g=()=>o.id,m=()=>h().focusedKey()===g(),p=()=>{var k;(k=s.onSelect)==null||k.call(s),s.closeOnSelect&&setTimeout(()=>{r.close(!0)})};pP({getItem:()=>{var k,E,P,M,B;return{ref:()=>t,type:"item",key:g(),textValue:(M=(P=(E=s.textValue)!=null?E:(k=d())==null?void 0:k.textContent)!=null?P:t==null?void 0:t.textContent)!=null?M:"",disabled:(B=s.disabled)!=null?B:!1}}});const v=Kb({key:g,selectionManager:h,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),b=k=>{nt(k,s.onPointerMove),k.pointerType==="mouse"&&(s.disabled?r.onItemLeave(k):(r.onItemEnter(k),k.defaultPrevented||(At(k.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(g()))))},S=k=>{nt(k,s.onPointerLeave),k.pointerType==="mouse"&&r.onItemLeave(k)},C=k=>{nt(k,s.onPointerUp),!s.disabled&&k.button===0&&p()},w=k=>{if(nt(k,s.onKeyDown),!k.repeat&&!s.disabled)switch(k.key){case"Enter":case" ":p();break}},O=U(()=>{if(s.indeterminate)return"mixed";if(s.checked!=null)return s.checked}),x=U(()=>({"data-indeterminate":s.indeterminate?"":void 0,"data-checked":s.checked&&!s.indeterminate?"":void 0,"data-disabled":s.disabled?"":void 0,"data-highlighted":m()?"":void 0})),_={isChecked:()=>s.checked,dataset:x,setLabelRef:f,generateId:Ga(()=>o.id),registerLabel:Sn(l),registerDescription:Sn(c)};return D(_1.Provider,{value:_,get children(){return D(st,Ae({as:"div",ref(k){const E=It(P=>t=P,s.ref);typeof E=="function"&&E(k)},get tabIndex(){return v.tabIndex()},get"aria-checked"(){return O()},get"aria-disabled"(){return s.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return u()},get"data-key"(){return v.dataKey()},get onPointerDown(){return vt([s.onPointerDown,v.onPointerDown])},get onPointerUp(){return vt([C,v.onPointerUp])},get onClick(){return vt([s.onClick,v.onClick])},get onKeyDown(){return vt([w,v.onKeyDown])},get onMouseDown(){return vt([s.onMouseDown,v.onMouseDown])},get onFocus(){return vt([s.onFocus,v.onFocus])},onPointerMove:b,onPointerLeave:S},x,o))}})}function O1(e){const t=Re({closeOnSelect:!1},e),[n,r]=Ke(t,["checked","defaultChecked","onChange","onSelect"]),i=lP({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 D(yh,Ae({role:"menuitemcheckbox",get checked(){return i.isSelected()},onSelect:()=>{var o;(o=n.onSelect)==null||o.call(n),i.toggle()}},r))}var cM=wt();function tc(){return St(cM)}var pa={next:(e,t)=>e==="ltr"?t==="horizontal"?"ArrowRight":"ArrowDown":t==="horizontal"?"ArrowLeft":"ArrowUp",previous:(e,t)=>pa.next(e==="ltr"?"rtl":"ltr",t)},xm={first:e=>e==="horizontal"?"ArrowDown":"ArrowRight",last:e=>e==="horizontal"?"ArrowUp":"ArrowLeft"};function E1(e){const t=tr(),n=kr(),r=tc(),{direction:i}=si(),s=Re({id:t.generateId("trigger")},e),[o,a]=Ke(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 u=Xu(()=>n.triggerRef(),()=>"button"),c=U(()=>{var v;return u()==="a"&&((v=n.triggerRef())==null?void 0:v.getAttribute("href"))!=null});xe(br(()=>r==null?void 0:r.value(),v=>{var b;c()&&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=>{nt(v,o.onPointerDown),v.currentTarget.dataset.pointerType=v.pointerType,!o.disabled&&v.pointerType!=="touch"&&v.button===0&&d()},h=v=>{nt(v,o.onClick),o.disabled||v.currentTarget.dataset.pointerType==="touch"&&d()},g=v=>{if(nt(v,o.onKeyDown),!o.disabled){if(c())switch(v.key){case"Enter":case" ":return}switch(v.key){case"Enter":case" ":case xm.first(t.orientation()):v.stopPropagation(),v.preventDefault(),eP(v.currentTarget),n.open("first"),r==null||r.setAutoFocusMenu(!0),r==null||r.setValue(l);break;case xm.last(t.orientation()):v.stopPropagation(),v.preventDefault(),n.open("last");break;case pa.next(i(),t.orientation()):if(r===void 0)break;v.stopPropagation(),v.preventDefault(),r.nextMenu();break;case pa.previous(i(),t.orientation()):if(r===void 0)break;v.stopPropagation(),v.preventDefault(),r.previousMenu();break}}},m=v=>{var b;nt(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=>{nt(v,o.onFocus),r!==void 0&&v.currentTarget.dataset.pointerType!=="touch"&&r.setValue(l)};return xe(()=>_e(n.registerTriggerId(o.id))),D(sh,Ae({ref(v){const b=It(n.setTriggerRef,o.ref);typeof b=="function"&&b(v)},get"data-kb-menu-value-trigger"(){return t.value()},get id(){return o.id},get disabled(){return o.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return U(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return l()!==void 0&&(r==null?void 0:r.value())===l()?!0:void 0},get tabIndex(){return r!==void 0?r.value()===l()||r.lastValue()===l()?0:-1:void 0},onPointerDown:f,onMouseOver:m,onClick:h,onKeyDown:g,onFocus:p,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),a))}var dM=wt();function A1(){return St(dM)}function T1(e){let t;const n=tr(),r=kr(),i=tc(),s=A1(),{direction:o}=si(),a=Re({id:n.generateId(`content-${kn()}`)},e),[l,u]=Ke(a,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let c=0;const d=()=>r.parentMenuContext()==null&&i===void 0&&n.isModal(),f=Yj({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);Xj({trapFocus:()=>d()&&r.isOpen(),onMountAutoFocus:S=>{var C;i===void 0&&((C=l.onOpenAutoFocus)==null||C.call(l,S))},onUnmountAutoFocus:l.onCloseAutoFocus},()=>t);const h=S=>{if(wn(S.currentTarget,S.target)&&(S.key==="Tab"&&r.isOpen()&&S.preventDefault(),i!==void 0&&S.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(S.key){case pa.next(o(),n.orientation()):S.stopPropagation(),S.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.nextMenu();break;case pa.previous(o(),n.orientation()):if(S.currentTarget.hasAttribute("data-closed"))break;S.stopPropagation(),S.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.previousMenu();break}},g=S=>{var C;(C=l.onEscapeKeyDown)==null||C.call(l,S),i==null||i.setAutoFocusMenu(!1),r.close(!0)},m=S=>{var C;(C=l.onFocusOutside)==null||C.call(l,S),n.isModal()&&S.preventDefault()},p=S=>{var C,w;nt(S,l.onPointerEnter),r.isOpen()&&((C=r.parentMenuContext())==null||C.listState().selectionManager().setFocused(!1),(w=r.parentMenuContext())==null||w.listState().selectionManager().setFocusedKey(void 0))},v=S=>{if(nt(S,l.onPointerMove),S.pointerType!=="mouse")return;const C=S.target,w=c!==S.clientX;wn(S.currentTarget,C)&&w&&(r.setPointerDir(S.clientX>c?"right":"left"),c=S.clientX)};xe(()=>_e(r.registerContentId(l.id)));const b={ref:It(S=>{r.setContentRef(S),t=S},l.ref),role:"menu",get id(){return l.id},get tabIndex(){return f.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:vt([l.onKeyDown,f.onKeyDown,h]),onMouseDown:vt([l.onMouseDown,f.onMouseDown]),onFocusIn:vt([l.onFocusIn,f.onFocusIn]),onFocusOut:vt([l.onFocusOut,f.onFocusOut]),onPointerEnter:p,onPointerMove:v,get"data-orientation"(){return n.orientation()}};return D(ve,{get when(){return r.contentPresent()},get children(){return D(ve,{get when(){return s===void 0||r.parentMenuContext()!=null},get fallback(){return D(st,Ae({as:"div"},()=>r.dataset(),b,u))},get children(){return D(l1.Positioner,{get children(){return D(Kj,Ae({get disableOutsidePointerEvents(){return U(()=>!!d())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return Qu({"--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,u))}})}})}})}function fM(e){let t;const n=tr(),r=kr(),[i,s]=Ke(e,["ref"]);return uM({element:()=>t!=null?t:null,enabled:()=>r.contentPresent()&&n.preventScroll()}),D(T1,Ae({ref(o){const a=It(l=>{t=l},i.ref);typeof a=="function"&&a(o)}},s))}var P1=wt();function hM(){const e=St(P1);if(e===void 0)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}function mh(e){const t=tr(),n=Re({id:t.generateId(`group-${kn()}`)},e),[r,i]=ce(),s={generateId:Ga(()=>n.id),registerLabelId:Sn(i)};return D(P1.Provider,{value:s,get children(){return D(st,Ae({as:"div",role:"group",get"aria-labelledby"(){return r()}},n))}})}function j1(e){const t=hM(),n=Re({id:t.generateId("label")},e),[r,i]=Ke(n,["id"]);return xe(()=>_e(t.registerLabelId(r.id))),D(st,Ae({as:"span",get id(){return r.id},"aria-hidden":"true"},i))}function M1(e){const t=kr(),n=Re({children:"▼"},e);return D(st,Ae({as:"span","aria-hidden":"true"},()=>t.dataset(),n))}function $1(e){return D(yh,Ae({role:"menuitem",closeOnSelect:!0},e))}function L1(e){const t=gh(),n=Re({id:t.generateId("description")},e),[r,i]=Ke(n,["id"]);return xe(()=>_e(t.registerDescription(r.id))),D(st,Ae({as:"div",get id(){return r.id}},()=>t.dataset(),i))}function D1(e){const t=gh(),n=Re({id:t.generateId("indicator")},e),[r,i]=Ke(n,["forceMount"]);return D(ve,{get when(){return r.forceMount||t.isChecked()},get children(){return D(st,Ae({as:"div"},()=>t.dataset(),i))}})}function I1(e){const t=gh(),n=Re({id:t.generateId("label")},e),[r,i]=Ke(n,["ref","id"]);return xe(()=>_e(t.registerLabel(r.id))),D(st,Ae({as:"div",ref(s){const o=It(t.setLabelRef,r.ref);typeof o=="function"&&o(s)},get id(){return r.id}},()=>t.dataset(),i))}function R1(e){const t=kr();return D(ve,{get when(){return t.contentPresent()},get children(){return D(av,e)}})}var N1=wt();function gM(){const e=St(N1);if(e===void 0)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}function F1(e){const n=tr().generateId(`radiogroup-${kn()}`),r=Re({id:n},e),[i,s]=Ke(r,["value","defaultValue","onChange","disabled"]),[o,a]=Ka({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:u=>{var c;return(c=i.onChange)==null?void 0:c.call(i,u)}}),l={isDisabled:()=>i.disabled,isSelectedValue:u=>u===o(),setSelectedValue:a};return D(N1.Provider,{value:l,get children(){return D(mh,s)}})}function B1(e){const t=gM(),n=Re({closeOnSelect:!1},e),[r,i]=Ke(n,["value","onSelect"]);return D(yh,Ae({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 yM(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 mM(e,t){return t?JT([e.clientX,e.clientY],t):!1}function q1(e){const t=tr(),n=Bb(),r=C1(),i=tc(),s=A1(),o=Re({placement:t.orientation()==="horizontal"?"bottom-start":"right-start"},e),[a,l]=Ke(o,["open","defaultOpen","onOpenChange"]);let u=0,c=null,d="right";const[f,h]=ce(),[g,m]=ce(),[p,v]=ce(),[b,S]=ce(),[C,w]=ce(!0),[O,x]=ce(l.placement),[_,k]=ce([]),[E,P]=ce([]),{DomCollectionProvider:M}=mP({items:E,onItemsChange:P}),B=c1({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:J=>{var Se;return(Se=a.onOpenChange)==null?void 0:Se.call(a,J)}}),{present:R}=Wb({show:()=>t.forceMount()||B.isOpen(),element:()=>{var J;return(J=b())!=null?J:null}}),A=LP({selectionMode:"none",dataSource:E}),j=J=>{w(J),B.open()},L=(J=!1)=>{B.close(),J&&r&&r.close(!0)},H=J=>{w(J),B.toggle()},Q=()=>{const J=b();J&&(At(J),A.selectionManager().setFocused(!0),A.selectionManager().setFocusedKey(void 0))},F=()=>{s!=null?setTimeout(()=>Q()):Q()},G=J=>{k(ge=>[...ge,J]);const Se=r==null?void 0:r.registerNestedMenu(J);return()=>{k(ge=>Jd(ge,J)),Se==null||Se()}},ie=J=>d===(c==null?void 0:c.side)&&mM(J,c==null?void 0:c.area),ae=J=>{ie(J)&&J.preventDefault()},N=J=>{ie(J)||F()},le=J=>{ie(J)&&J.preventDefault()};Jj({isDisabled:()=>!(r==null&&B.isOpen()&&t.isModal()),targets:()=>[b(),..._()].filter(Boolean)}),xe(()=>{const J=b();if(!J||!r)return;const Se=r.registerNestedMenu(J);_e(()=>{Se()})}),xe(()=>{r===void 0&&(i==null||i.registerMenu(t.value(),[b(),..._()]))}),xe(()=>{var J;r!==void 0||i===void 0||(i.value()===t.value()?((J=p())==null||J.focus(),i.autoFocusMenu()&&j(!0)):L())}),xe(()=>{r!==void 0||i===void 0||B.isOpen()&&i.setValue(t.value())}),_e(()=>{r===void 0&&(i==null||i.unregisterMenu(t.value()))});const me={dataset:U(()=>({"data-expanded":B.isOpen()?"":void 0,"data-closed":B.isOpen()?void 0:""})),isOpen:B.isOpen,contentPresent:R,nestedMenus:_,currentPlacement:O,pointerGraceTimeoutId:()=>u,autoFocus:C,listState:()=>A,parentMenuContext:()=>r,triggerRef:p,contentRef:b,triggerId:f,contentId:g,setTriggerRef:v,setContentRef:S,open:j,close:L,toggle:H,focusContent:F,onItemEnter:ae,onItemLeave:N,onTriggerLeave:le,setPointerDir:J=>d=J,setPointerGraceTimeoutId:J=>u=J,setPointerGraceIntent:J=>c=J,registerNestedMenu:G,registerItemToParentDomCollection:n==null?void 0:n.registerItem,registerTriggerId:Sn(h),registerContentId:Sn(m)};return D(M,{get children(){return D(S1.Provider,{value:me,get children(){return D(ve,{when:s===void 0,get fallback(){return l.children},get children(){return D(l1,Ae({anchorRef:p,contentRef:b,onCurrentPlacementChange:x},l))}})}})}})}function z1(e){const{direction:t}=si();return D(q1,Ae({get placement(){return t()==="rtl"?"left-start":"right-start"},flip:!0},e))}var pM={close:(e,t)=>e==="ltr"?[t==="horizontal"?"ArrowLeft":"ArrowUp"]:[t==="horizontal"?"ArrowRight":"ArrowDown"]};function H1(e){const t=kr(),n=tr(),[r,i]=Ke(e,["onFocusOutside","onKeyDown"]),{direction:s}=si();return D(T1,Ae({onOpenAutoFocus:c=>{c.preventDefault()},onCloseAutoFocus:c=>{c.preventDefault()},onFocusOutside:c=>{var f;(f=r.onFocusOutside)==null||f.call(r,c);const d=c.target;wn(t.triggerRef(),d)||t.close()},onKeyDown:c=>{nt(c,r.onKeyDown);const d=wn(c.currentTarget,c.target),f=pM.close(s(),n.orientation()).includes(c.key),h=t.parentMenuContext()!=null;d&&f&&h&&(t.close(),At(t.triggerRef()))}},i))}var wm=["Enter"," "],vM={open:(e,t)=>e==="ltr"?[...wm,t==="horizontal"?"ArrowRight":"ArrowDown"]:[...wm,t==="horizontal"?"ArrowLeft":"ArrowUp"]};function U1(e){let t;const n=tr(),r=kr(),i=Re({id:n.generateId(`sub-trigger-${kn()}`)},e),[s,o]=Ke(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:u}=si(),c=()=>s.id,d=()=>{const S=r.parentMenuContext();if(S==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return S.listState().selectionManager()},f=()=>r.listState().collection(),h=()=>d().focusedKey()===c(),g=Kb({key:c,selectionManager:d,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),m=S=>{nt(S,s.onClick),!r.isOpen()&&!s.disabled&&r.open(!0)},p=S=>{var w;if(nt(S,s.onPointerMove),S.pointerType!=="mouse")return;const C=r.parentMenuContext();if(C==null||C.onItemEnter(S),!S.defaultPrevented){if(s.disabled){C==null||C.onItemLeave(S);return}!r.isOpen()&&!a&&((w=r.parentMenuContext())==null||w.setPointerGraceIntent(null),a=window.setTimeout(()=>{r.open(!1),l()},100)),C==null||C.onItemEnter(S),S.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),At(S.currentTarget),C==null||C.listState().selectionManager().setFocused(!0),C==null||C.listState().selectionManager().setFocusedKey(c()))}},v=S=>{if(nt(S,s.onPointerLeave),S.pointerType!=="mouse")return;l();const C=r.parentMenuContext(),w=r.contentRef();if(w){C==null||C.setPointerGraceIntent({area:yM(r.currentPlacement(),S,w),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(C==null?void 0:C.pointerGraceTimeoutId());const O=window.setTimeout(()=>{C==null||C.setPointerGraceIntent(null)},300);C==null||C.setPointerGraceTimeoutId(O)}else{if(C==null||C.onTriggerLeave(S),S.defaultPrevented)return;C==null||C.setPointerGraceIntent(null)}C==null||C.onItemLeave(S)},b=S=>{nt(S,s.onKeyDown),!S.repeat&&(s.disabled||vM.open(u(),n.orientation()).includes(S.key)&&(S.stopPropagation(),S.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,w,O;if(r.registerItemToParentDomCollection==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");const S=r.registerItemToParentDomCollection({ref:()=>t,type:"item",key:c(),textValue:(w=(C=s.textValue)!=null?C:t==null?void 0:t.textContent)!=null?w:"",disabled:(O=s.disabled)!=null?O:!1});_e(S)}),xe(br(()=>{var S;return(S=r.parentMenuContext())==null?void 0:S.pointerGraceTimeoutId()},S=>{_e(()=>{var C;window.clearTimeout(S),(C=r.parentMenuContext())==null||C.setPointerGraceIntent(null)})})),xe(()=>_e(r.registerTriggerId(s.id))),_e(()=>{l()}),D(st,Ae({as:"div",ref(S){const C=It(w=>{r.setTriggerRef(w),t=w},s.ref);typeof C=="function"&&C(S)},get id(){return s.id},role:"menuitem",get tabIndex(){return g.tabIndex()},"aria-haspopup":"true",get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return U(()=>!!r.isOpen())()?r.contentId():void 0},get"aria-disabled"(){return s.disabled},get"data-key"(){return g.dataKey()},get"data-highlighted"(){return h()?"":void 0},get"data-disabled"(){return s.disabled?"":void 0},get onPointerDown(){return vt([s.onPointerDown,g.onPointerDown])},get onPointerUp(){return vt([s.onPointerUp,g.onPointerUp])},get onClick(){return vt([m,g.onClick])},get onKeyDown(){return vt([b,g.onKeyDown])},get onMouseDown(){return vt([s.onMouseDown,g.onMouseDown])},get onFocus(){return vt([s.onFocus,g.onFocus])},onPointerMove:p,onPointerLeave:v},()=>r.dataset(),o))}function bM(e){const t=tc(),n=`menu-${kn()}`,r=Re({id:n,modal:!0},e),[i,s]=Ke(r,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),o=c1({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:l=>{var u;return(u=i.onOpenChange)==null?void 0:u.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:Ga(()=>i.id),value:()=>i.value,orientation:()=>{var l,u;return(u=(l=i.orientation)!=null?l:t==null?void 0:t.orientation())!=null?u:"horizontal"}};return D(k1.Provider,{value:a,get children(){return D(q1,Ae({get open(){return o.isOpen()},get onOpenChange(){return o.setIsOpen}},s))}})}var xM={};Zu(xM,{Root:()=>nc,Separator:()=>wM});function nc(e){let t;const n=Re({orientation:"horizontal"},e),[r,i]=Ke(n,["ref","orientation"]),s=Xu(()=>t,()=>"hr");return D(st,Ae({as:"hr",ref(o){const a=It(l=>t=l,r.ref);typeof a=="function"&&a(o)},get role(){return s()!=="hr"?"separator":void 0},get"aria-orientation"(){return r.orientation==="vertical"?"vertical":void 0},get"data-orientation"(){return r.orientation}},i))}var wM=nc,ft={};Zu(ft,{Arrow:()=>hh,CheckboxItem:()=>O1,Content:()=>G1,DropdownMenu:()=>SM,Group:()=>mh,GroupLabel:()=>j1,Icon:()=>M1,Item:()=>$1,ItemDescription:()=>L1,ItemIndicator:()=>D1,ItemLabel:()=>I1,Portal:()=>R1,RadioGroup:()=>F1,RadioItem:()=>B1,Root:()=>V1,Separator:()=>nc,Sub:()=>z1,SubContent:()=>H1,SubTrigger:()=>U1,Trigger:()=>E1});function G1(e){const t=tr(),n=kr(),[r,i]=Ke(e,["onCloseAutoFocus","onInteractOutside"]);let s=!1;return D(fM,Ae({onCloseAutoFocus:l=>{var u;(u=r.onCloseAutoFocus)==null||u.call(r,l),s||At(n.triggerRef()),s=!1,l.preventDefault()},onInteractOutside:l=>{var u;(u=r.onInteractOutside)==null||u.call(r,l),(!t.isModal()||l.detail.isContextMenu)&&(s=!0)}},i))}function V1(e){const t=`dropdownmenu-${kn()}`,n=Re({id:t},e);return D(bM,n)}var SM=Object.assign(V1,{Arrow:hh,CheckboxItem:O1,Content:G1,Group:mh,GroupLabel:j1,Icon:M1,Item:$1,ItemDescription:L1,ItemIndicator:D1,ItemLabel:I1,Portal:R1,RadioGroup:F1,RadioItem:B1,Separator:nc,Sub:z1,SubContent:H1,SubTrigger:U1,Trigger:E1}),V={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"}},CM=he('<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>'),_M=he('<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>'),kM=he('<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>'),OM=he('<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>'),ph=he('<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>'),EM=he('<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>'),AM=he('<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>'),TM=he('<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>'),PM=he('<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">'),jM=he('<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">'),MM=he('<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>'),$M=he('<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>'),LM=he('<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>'),DM=he('<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>'),K1=he('<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>'),IM=he('<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>'),RM=he('<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>'),NM=he('<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>'),FM=he('<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>'),BM=he('<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>'),qM=he('<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>'),zM=he('<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>'),HM=he('<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 UM(){return CM()}function W1(){return _M()}function Vo(){return kM()}function Sm(){return OM()}function Cm(){return ph()}function GM(){return(()=>{var e=ph();return e.style.setProperty("transform","rotate(90deg)"),e})()}function VM(){return(()=>{var e=ph();return e.style.setProperty("transform","rotate(-90deg)"),e})()}function KM(){return EM()}function WM(){return AM()}function QM(){return TM()}function YM(){return PM()}function XM(){return jM()}function ZM(){return MM()}function JM(){return $M()}function e$(){return LM()}function t$(){return DM()}function n$(e){return(()=>{var t=K1(),n=t.firstChild;return be(()=>re(n,"stroke",e.theme==="dark"?"#12B76A":"#027A48")),t})()}function r$(){return IM()}function i$(){return RM()}function s$(e){return[D(ve,{get when(){return e.checked},get children(){var t=K1(),n=t.firstChild;return be(()=>re(n,"stroke",e.theme==="dark"?"#9B8AFB":"#6938EF")),t}}),D(ve,{get when(){return!e.checked},get children(){var t=NM(),n=t.firstChild;return be(()=>re(n,"stroke",e.theme==="dark"?"#9B8AFB":"#6938EF")),t}})]}function o$(){return FM()}function a$(){return BM()}function l$(){return qM()}function u$(){return zM()}function _m(){const e=kn();return(()=>{var t=HM(),n=t.firstChild,r=n.nextSibling,i=r.nextSibling,s=i.firstChild,o=i.nextSibling,a=o.firstChild,l=o.nextSibling,u=l.nextSibling,c=u.firstChild,d=u.nextSibling,f=d.firstChild,h=d.nextSibling,g=h.nextSibling,m=g.firstChild,p=g.nextSibling,v=p.firstChild,b=p.nextSibling,S=b.nextSibling,C=S.firstChild,w=S.nextSibling,O=w.firstChild,x=w.nextSibling,_=x.nextSibling,k=_.firstChild,E=_.nextSibling,P=E.firstChild,M=E.nextSibling,B=M.nextSibling,R=B.firstChild,A=B.nextSibling,j=A.firstChild,L=A.nextSibling,H=L.nextSibling,Q=H.firstChild,F=H.nextSibling,G=F.firstChild,ie=F.nextSibling,ae=ie.firstChild,N=ae.nextSibling,le=N.nextSibling,te=le.nextSibling,me=te.nextSibling,J=ie.nextSibling,Se=J.firstChild,ge=J.nextSibling,ze=ge.firstChild,oe=ge.nextSibling,He=oe.firstChild,lt=He.nextSibling,dt=lt.nextSibling,Ne=dt.firstChild,Fe=Ne.nextSibling,Y=Fe.nextSibling,Te=Y.nextSibling,tt=Te.nextSibling,$e=tt.nextSibling,ue=$e.nextSibling,W=ue.nextSibling,ne=W.nextSibling,ee=ne.nextSibling,Ce=ee.nextSibling,gt=Ce.nextSibling,we=oe.nextSibling,Je=we.firstChild,Be=we.nextSibling,An=Be.firstChild,Kt=Be.nextSibling,fn=Kt.firstChild,Nn=fn.nextSibling,nr=Kt.nextSibling,Qi=nr.firstChild,Or=nr.nextSibling,Xa=Or.firstChild,oo=Or.nextSibling,ao=oo.firstChild,lo=ao.nextSibling,Yi=lo.nextSibling,wh=Yi.nextSibling,Sh=wh.nextSibling,Ch=Sh.nextSibling,_h=Ch.nextSibling,kh=_h.nextSibling,Oh=kh.nextSibling,Eh=Oh.nextSibling,Ah=Eh.nextSibling,Th=Ah.nextSibling,Ph=Th.nextSibling,jh=Ph.nextSibling,Mh=jh.nextSibling,$h=Mh.nextSibling,Lh=$h.nextSibling,lx=Lh.nextSibling;return re(n,"id",`a-${e}`),re(r,"fill",`url(#a-${e})`),re(s,"id",`am-${e}`),re(o,"id",`b-${e}`),re(a,"filter",`url(#am-${e})`),re(l,"mask",`url(#b-${e})`),re(c,"id",`ah-${e}`),re(d,"id",`k-${e}`),re(f,"filter",`url(#ah-${e})`),re(h,"mask",`url(#k-${e})`),re(m,"id",`ae-${e}`),re(p,"id",`j-${e}`),re(v,"filter",`url(#ae-${e})`),re(b,"mask",`url(#j-${e})`),re(C,"id",`ai-${e}`),re(w,"id",`i-${e}`),re(O,"filter",`url(#ai-${e})`),re(x,"mask",`url(#i-${e})`),re(k,"id",`aj-${e}`),re(E,"id",`h-${e}`),re(P,"filter",`url(#aj-${e})`),re(M,"mask",`url(#h-${e})`),re(R,"id",`ag-${e}`),re(A,"id",`g-${e}`),re(j,"filter",`url(#ag-${e})`),re(L,"mask",`url(#g-${e})`),re(Q,"id",`af-${e}`),re(F,"id",`f-${e}`),re(G,"filter",`url(#af-${e})`),re(ie,"mask",`url(#f-${e})`),re(te,"id",`m-${e}`),re(me,"fill",`url(#m-${e})`),re(Se,"id",`ak-${e}`),re(ge,"id",`e-${e}`),re(ze,"filter",`url(#ak-${e})`),re(oe,"mask",`url(#e-${e})`),re(He,"id",`n-${e}`),re(lt,"fill",`url(#n-${e})`),re(Ne,"id",`r-${e}`),re(Fe,"fill",`url(#r-${e})`),re(Y,"id",`s-${e}`),re(Te,"fill",`url(#s-${e})`),re(tt,"id",`q-${e}`),re($e,"fill",`url(#q-${e})`),re(ue,"id",`p-${e}`),re(W,"fill",`url(#p-${e})`),re(ne,"id",`o-${e}`),re(ee,"fill",`url(#o-${e})`),re(Ce,"id",`l-${e}`),re(gt,"fill",`url(#l-${e})`),re(Je,"id",`al-${e}`),re(Be,"id",`d-${e}`),re(An,"filter",`url(#al-${e})`),re(Kt,"mask",`url(#d-${e})`),re(fn,"id",`u-${e}`),re(Nn,"fill",`url(#u-${e})`),re(Qi,"id",`ad-${e}`),re(Or,"id",`c-${e}`),re(Xa,"filter",`url(#ad-${e})`),re(oo,"mask",`url(#c-${e})`),re(ao,"id",`t-${e}`),re(lo,"fill",`url(#t-${e})`),re(Yi,"id",`v-${e}`),re(wh,"stroke",`url(#v-${e})`),re(Sh,"id",`aa-${e}`),re(Ch,"stroke",`url(#aa-${e})`),re(_h,"id",`w-${e}`),re(kh,"stroke",`url(#w-${e})`),re(Oh,"id",`ac-${e}`),re(Eh,"stroke",`url(#ac-${e})`),re(Ah,"id",`ab-${e}`),re(Th,"stroke",`url(#ab-${e})`),re(Ph,"id",`y-${e}`),re(jh,"stroke",`url(#y-${e})`),re(Mh,"id",`x-${e}`),re($h,"stroke",`url(#x-${e})`),re(Lh,"id",`z-${e}`),re(lx,"stroke",`url(#z-${e})`),t})()}var c$=he('<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>'),d$=he('<button title="Copy object to clipboard">'),f$=he('<button title="Remove all items"aria-label="Remove all items">'),h$=he('<button title="Delete item"aria-label="Delete item">'),g$=he('<button title="Toggle value"aria-label="Toggle value">'),y$=he('<button title="Bulk Edit Data"aria-label="Bulk Edit Data">'),ko=he("<div>"),m$=he("<div><button> <span></span> <span> "),p$=he("<input>"),km=he("<span>"),v$=he("<div><span>:"),b$=he("<div><div><button> [<!>...<!>]");function x$(e,t){let n=0;const r=[];for(;n<e.length;)r.push(e.slice(n,n+t)),n=n+t;return r}var Om=e=>{const t=xt(),n=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,r=U(()=>t()==="dark"?so(n):io(n));return(()=>{var i=c$();return be(()=>se(i,fe(r().expander,n`
67
+ `):e}function PE(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 vy(e,t){const n=e.chart.ctx,{body:r,footer:i,title:s}=e,{boxWidth:o,boxHeight:a}=t,l=mt(t.bodyFont),u=mt(t.titleFont),c=mt(t.footerFont),d=s.length,f=i.length,h=r.length,g=jt(t.padding);let m=g.height,p=0,v=r.reduce((C,w)=>C+w.before.length+w.lines.length+w.after.length,0);if(v+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*u.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*c.lineHeight+(f-1)*t.footerSpacing);let b=0;const S=function(C){p=Math.max(p,n.measureText(C).width+b)};return n.save(),n.font=u.string,Qe(e.title,S),n.font=l.string,Qe(e.beforeBody.concat(e.afterBody),S),b=t.displayColors?o+2+t.boxPadding:0,Qe(r,C=>{Qe(C.before,S),Qe(C.lines,S),Qe(C.after,S)}),b=0,n.font=c.string,Qe(e.footer,S),n.restore(),p+=g.width,{width:p,height:m}}function jE(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function ME(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 $E(e,t,n,r){const{x:i,width:s}=n,{width:o,chartArea:{left:a,right:l}}=e;let u="center";return r==="center"?u=i<=(a+l)/2?"left":"right":i<=s/2?u="left":i>=o-s/2&&(u="right"),ME(u,e,t,n)&&(u="center"),u}function by(e,t,n){const r=n.yAlign||t.yAlign||jE(e,n);return{xAlign:n.xAlign||t.xAlign||$E(e,t,n,r),yAlign:r}}function LE(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function DE(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function xy(e,t,n,r){const{caretSize:i,caretPadding:s,cornerRadius:o}=e,{xAlign:a,yAlign:l}=n,u=i+s,{topLeft:c,topRight:d,bottomLeft:f,bottomRight:h}=ds(o);let g=LE(t,a);const m=DE(t,l,u);return l==="center"?a==="left"?g+=u:a==="right"&&(g-=u):a==="left"?g-=Math.max(c,f)+i:a==="right"&&(g+=Math.max(d,h)+i),{x:xn(g,0,r.width-t.width),y:xn(m,0,r.height-t.height)}}function Cl(e,t,n){const r=jt(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function wy(e){return Gn([],ur(e))}function IE(e,t,n){return ai(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function Sy(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const mb={beforeTitle:sr,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:sr,beforeBody:sr,beforeLabel:sr,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:sr,afterBody:sr,beforeFooter:sr,footer:sr,afterFooter:sr};function Rt(e,t,n,r){const i=e[t].call(n,r);return typeof i=="undefined"?mb[t].call(n,r):i}class Kd extends Yi{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 J2(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=IE(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=Rt(r,"beforeTitle",this,t),s=Rt(r,"title",this,t),o=Rt(r,"afterTitle",this,t);let a=[];return a=Gn(a,ur(i)),a=Gn(a,ur(s)),a=Gn(a,ur(o)),a}getBeforeBody(t,n){return wy(Rt(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return Qe(t,s=>{const o={before:[],lines:[],after:[]},a=Sy(r,s);Gn(o.before,ur(Rt(a,"beforeLabel",this,s))),Gn(o.lines,Rt(a,"label",this,s)),Gn(o.after,ur(Rt(a,"afterLabel",this,s))),i.push(o)}),i}getAfterBody(t,n){return wy(Rt(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=Rt(r,"beforeFooter",this,t),s=Rt(r,"footer",this,t),o=Rt(r,"afterFooter",this,t);let a=[];return a=Gn(a,ur(i)),a=Gn(a,ur(s)),a=Gn(a,ur(o)),a}_createItems(t){const n=this._active,r=this.chart.data,i=[],s=[],o=[];let a=[],l,u;for(l=0,u=n.length;l<u;++l)a.push(PE(this.chart,n[l]));return t.filter&&(a=a.filter((c,d,f)=>t.filter(c,d,f,r))),t.itemSort&&(a=a.sort((c,d)=>t.itemSort(c,d,r))),Qe(a,c=>{const d=Sy(t.callbacks,c);i.push(Rt(d,"labelColor",this,c)),s.push(Rt(d,"labelPointStyle",this,c)),o.push(Rt(d,"labelTextColor",this,c))}),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=Ro[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=vy(this,r),u=Object.assign({},a,l),c=by(this.chart,r,u),d=xy(r,u,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.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:u,bottomLeft:c,bottomRight:d}=ds(a),{x:f,y:h}=t,{width:g,height:m}=n;let p,v,b,S,C,w;return s==="center"?(C=h+m/2,i==="left"?(p=f,v=p-o,S=C+o,w=C-o):(p=f+g,v=p+o,S=C-o,w=C+o),b=p):(i==="left"?v=f+Math.max(l,c)+o:i==="right"?v=f+g-Math.max(u,d)-o:v=this.caretX,s==="top"?(S=h,C=S-o,p=v-o,b=v+o):(S=h+m,C=S+o,p=v+o,b=v-o),w=S),{x1:p,x2:v,x3:b,y1:S,y2:C,y3:w}}drawTitle(t,n,r){const i=this.title,s=i.length;let o,a,l;if(s){const u=fs(r.rtl,this.x,this.width);for(t.x=Cl(this,r.titleAlign,r),n.textAlign=u.textAlign(r.titleAlign),n.textBaseline="middle",o=mt(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=o.string,l=0;l<s;++l)n.fillText(i[l],u.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:u}=s,c=mt(s.bodyFont),d=Cl(this,"left",s),f=i.x(d),h=l<c.lineHeight?(c.lineHeight-l)/2:0,g=n.y+h;if(s.usePointStyle){const m={radius:Math.min(u,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},p=i.leftForLtr(f,u)+u/2,v=g+l/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,qd(t,m,p,v),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,qd(t,m,p,v)}else{t.lineWidth=Ie(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,u),p=i.leftForLtr(i.xPlus(f,1),u-2),v=ds(o.borderRadius);Object.values(v).some(b=>b!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,cu(t,{x:m,y:g,w:u,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),cu(t,{x:p,y:g+1,w:u-2,h:l-2,radius:v}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(m,g,u,l),t.strokeRect(m,g,u,l),t.fillStyle=o.backgroundColor,t.fillRect(p,g+1,u-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:u,boxPadding:c}=r,d=mt(r.bodyFont);let f=d.lineHeight,h=0;const g=fs(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,S,C,w,O,x;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=Cl(this,p,r),n.fillStyle=r.bodyColor,Qe(this.beforeBody,m),h=a&&p!=="right"?o==="center"?u/2+c:u+2+c:0,C=0,O=i.length;C<O;++C){for(v=i[C],b=this.labelTextColors[C],n.fillStyle=b,Qe(v.before,m),S=v.lines,a&&S.length&&(this._drawColorBox(n,t,C,g,r),f=Math.max(d.lineHeight,l)),w=0,x=S.length;w<x;++w)m(S[w]),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=fs(r.rtl,this.x,this.width);for(t.x=Cl(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",o=mt(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:u,height:c}=r,{topLeft:d,topRight:f,bottomLeft:h,bottomRight:g}=ds(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+u-f,l),n.quadraticCurveTo(a+u,l,a+u,l+f),o==="center"&&s==="right"&&this.drawCaret(t,n,r,i),n.lineTo(a+u,l+c-g),n.quadraticCurveTo(a+u,l+c,a+u-g,l+c),o==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(a+h,l+c),n.quadraticCurveTo(a,l+c,a,l+c-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=Ro[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=vy(this,t),l=Object.assign({},o,this._size),u=by(n,t,l),c=xy(t,l,u,n);(i._to!==c.x||s._to!==c.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,c))}}_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=jt(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),V2(t,n.textDirection),s.y+=o.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),W2(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:a,index:l})=>{const u=this.chart.getDatasetMeta(a);if(!u)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:u.data[l],index:l}}),s=!su(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||!su(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=Ro[s.position].call(this,t,n);return o!==!1&&(r!==o.x||i!==o.y)}}pe(Kd,"positioners",Ro);var RE={id:"tooltip",_element:Kd,positioners:Ro,afterInit(e,t,n){n&&(e.tooltip=new Kd({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:mb},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 NE=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function FE(e,t,n,r){const i=e.indexOf(t);if(i===-1)return NE(e,t,n,r);const s=e.lastIndexOf(t);return i!==s?n:i}const BE=(e,t)=>e===null?null:xn(Math.round(e),0,t);function Cy(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Vd extends io{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:FE(r,t,Le(n,t),this._addedLabels),BE(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 Cy.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(Vd,"id","category"),pe(Vd,"defaults",{ticks:{callback:Cy}});function qE(e,t){const n=[],{bounds:i,step:s,min:o,max:a,precision:l,count:u,maxTicks:c,maxDigits:d,includeBounds:f}=e,h=s||1,g=c-1,{min:m,max:p}=t,v=!Ye(o),b=!Ye(a),S=!Ye(u),C=(p-m)/(d+1);let w=_g((p-m)/g/h)*h,O,x,_,k;if(w<1e-14&&!v&&!b)return[{value:m},{value:p}];k=Math.ceil(p/w)-Math.floor(m/w),k>g&&(w=_g(k*w/g/h)*h),Ye(l)||(O=Math.pow(10,l),w=Math.ceil(w*O)/O),i==="ticks"?(x=Math.floor(m/w)*w,_=Math.ceil(p/w)*w):(x=m,_=p),v&&b&&s&&l9((a-o)/s,w/1e3)?(k=Math.round(Math.min((a-o)/w,c)),w=(a-o)/k,x=o,_=a):S?(x=v?o:x,_=b?a:_,k=u-1,w=(_-x)/k):(k=(_-x)/w,Vo(k,Math.round(k),w/1e3)?k=Math.round(k):k=Math.ceil(k));const E=Math.max(kg(w),kg(x));O=Math.pow(10,Ye(l)?E:l),x=Math.round(x*O)/O,_=Math.round(_*O)/O;let j=0;for(v&&(f&&x!==o?(n.push({value:o}),x<o&&j++,Vo(Math.round((x+j*w)*O)/O,o,_y(o,C,e))&&j++):x<o&&j++);j<k;++j){const M=Math.round((x+j*w)*O)/O;if(b&&M>a)break;n.push({value:M})}return b&&f&&_!==a?n.length&&Vo(n[n.length-1].value,a,_y(a,C,e))?n[n.length-1].value=a:n.push({value:a}):(!b||_===a)&&n.push({value:_}),n}function _y(e,t,{horizontal:n,minRotation:r}){const i=Kr(r),s=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(""+e).length;return Math.min(t/s,o)}class Wd extends io{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=Ks(i),u=Ks(s);l<0&&u<0?a(0):l>0&&u>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=qE(i,s);return t.bounds==="ticks"&&u9(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 F2(t,this.chart.options.locale,this.options.ticks.format)}}class Qd extends Wd{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=bt(t)?t:0,this.max=bt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Kr(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(Qd,"id","linear"),pe(Qd,"defaults",{ticks:{callback:Gf.formatters.numeric}});function Yd(e){const t=e.ticks;if(t.display&&e.display){const n=jt(t.backdropPadding);return Le(t.font&&t.font.size,ct.font.size)+n.height}return 0}function zE(e,t,n){return n=ot(n)?n:[n],{w:j9(e,t.string,n),h:n.length*t.lineHeight}}function ky(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 HE(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],s=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?ht/s:0;for(let l=0;l<s;l++){const u=o.setContext(e.getPointLabelContext(l));i[l]=u.padding;const c=e.getPointPosition(l,e.drawingArea+i[l],a),d=mt(u.font),f=zE(e.ctx,d,e._pointLabels[l]);r[l]=f;const h=sn(e.getIndexAngle(l)+a),g=Math.round(qf(h)),m=ky(g,c.x,f.w,0,180),p=ky(g,c.y,f.h,90,270);UE(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=VE(e,r,i)}function UE(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 GE(e,t,n){const r=e.drawingArea,{extra:i,additionalAngle:s,padding:o,size:a}=n,l=e.getPointPosition(t,r+i+o,s),u=Math.round(qf(sn(l.angle+ln))),c=YE(l.y,a.h,u),d=WE(u),f=QE(l.x,a.w,d);return{visible:!0,x:l.x,y:c,textAlign:d,left:f,top:c,right:f+a.w,bottom:c+a.h}}function KE(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:s}=e;return!(mr({x:n,y:r},t)||mr({x:n,y:s},t)||mr({x:i,y:r},t)||mr({x:i,y:s},t))}function VE(e,t,n){const r=[],i=e._pointLabels.length,s=e.options,{centerPointLabels:o,display:a}=s.pointLabels,l={extra:Yd(s)/2,additionalAngle:o?ht/i:0};let u;for(let c=0;c<i;c++){l.padding=n[c],l.size=t[c];const d=GE(e,c,l);r.push(d),a==="auto"&&(d.visible=KE(d,u),d.visible&&(u=d))}return r}function WE(e){return e===0||e===180?"center":e<180?"left":"right"}function QE(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function YE(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function XE(e,t,n){const{left:r,top:i,right:s,bottom:o}=n,{backdropColor:a}=t;if(!Ye(a)){const l=ds(t.borderRadius),u=jt(t.backdropPadding);e.fillStyle=a;const c=r-u.left,d=i-u.top,f=s-r+u.width,h=o-i+u.height;Object.values(l).some(g=>g!==0)?(e.beginPath(),cu(e,{x:c,y:d,w:f,h,radius:l}),e.fill()):e.fillRect(c,d,f,h)}}function ZE(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));XE(n,o,s);const a=mt(o.font),{x:l,y:u,textAlign:c}=s;zi(n,e._pointLabels[i],l,u+a.lineHeight/2,a,{color:o.color,textAlign:c,textBaseline:"middle"})}}function pb(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,un);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 JE(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(),pb(e,n,o,r),s.closePath(),s.stroke(),s.restore())}function eA(e,t,n){return ai(e,{label:n,index:t,type:"pointLabel"})}class No extends Wd{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=jt(Yd(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=bt(t)&&!isNaN(t)?t:0,this.max=bt(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Yd(this.options))}generateTickLabels(t){Wd.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const i=et(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?HE(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=un/(this._pointLabels.length||1),r=this.options.startAngle||0;return sn(t*n+Kr(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 eA(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const i=this.getIndexAngle(t)-ln+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(),pb(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,u;if(n.pointLabels.display&&ZE(this,o),i.display&&this.ticks.forEach((c,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(c.value);const f=this.getContext(d),h=i.setContext(f),g=s.setContext(f);JE(this,h,l,o,g)}}),r.display){for(t.save(),a=o-1;a>=0;a--){const c=r.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=c;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,l=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),u=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(u.x,u.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 u=r.setContext(this.getContext(l)),c=mt(u.font);if(s=this.getDistanceFromCenterForValue(this.ticks[l].value),u.showLabelBackdrop){t.font=c.string,o=t.measureText(a.label).width,t.fillStyle=u.backdropColor;const d=jt(u.backdropPadding);t.fillRect(-o/2-d.left,-s-c.size/2-d.top,o+d.width,c.size+d.height)}zi(t,a.label,0,-s,c,{color:u.color,strokeColor:u.textStrokeColor,strokeWidth:u.textStrokeWidth})}),t.restore()}drawTitle(){}}pe(No,"id","radialLinear"),pe(No,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Gf.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),pe(No,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),pe(No,"descriptors",{angleLines:{_fallback:"grid"}});const Xu={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},qt=Object.keys(Xu);function Oy(e,t){return e-t}function Ey(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)),bt(o)||(o=typeof r=="string"?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i==="week"&&(ya(s)||s===!0)?n.startOf(o,"isoWeek",s):n.startOf(o,i)),+o)}function Ay(e,t,n,r){const i=qt.length;for(let s=qt.indexOf(e);s<i-1;++s){const o=Xu[qt[s]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-t)/(a*o.size))<=r)return qt[s]}return qt[i-1]}function tA(e,t,n,r,i){for(let s=qt.length-1;s>=qt.indexOf(n);s--){const o=qt[s];if(Xu[o].common&&e._adapter.diff(i,r,o)>=t-1)return o}return qt[n?qt.indexOf(n):0]}function nA(e){for(let t=qt.indexOf(e)+1,n=qt.length;t<n;++t)if(Xu[qt[t]].common)return qt[t]}function Ty(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=zf(n,t),s=n[r]>=t?n[r]:n[i];e[s]=!0}}function rA(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 Py(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:rA(e,r,i,n)}class hu extends io{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 Nk._date(t.adapters.date);i.init(n),Ko(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:Ey(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(u){!o&&!isNaN(u.min)&&(i=Math.min(i,u.min)),!a&&!isNaN(u.max)&&(s=Math.max(s,u.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=bt(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),s=bt(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=g9(i,s,o);return this._unit=n.unit||(r.autoSkip?Ay(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):tA(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:nA(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),Py(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=xn(n,0,o),r=xn(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||Ay(s.minUnit,n,r,this._getLabelCapacity(n)),a=Le(i.ticks.stepSize,1),l=o==="week"?s.isoWeekday:!1,u=ya(l)||l===!0,c={};let d=n,f,h;if(u&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,u?"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++)Ty(c,f,g);return(f===r||i.bounds==="ticks"||h===1)&&Ty(c,f,g),Object.keys(c).sort(Oy).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 et(o,[t,n,r],this);const a=s.time.displayFormats,l=this._unit,u=this._majorUnit,c=l&&a[l],d=u&&a[u],f=r[n],h=u&&d&&f&&f.major;return this._adapter.format(t,i||(h?d:c))}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=Kr(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,Py(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(Ey(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return m9(t.sort(Oy))}}pe(hu,"id","time"),pe(hu,"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 _l(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}=Si(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}=Si(e,"time",t)),{time:s,pos:a}=e[r],{time:o,pos:l}=e[i]);const u=o-s;return u?a+(l-a)*(t-s)/u:a}class jy extends hu{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=_l(n,this.min),this._tableRange=_l(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],s=[];let o,a,l,u,c;for(o=0,a=t.length;o<a;++o)u=t[o],u>=n&&u<=r&&i.push(u);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(o=0,a=i.length;o<a;++o)c=i[o+1],l=i[o-1],u=i[o],Math.round((c+l)/2)!==u&&s.push({time:u,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(_l(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return _l(this._table,r*this._tableRange+this._minPos,!0)}}pe(jy,"id","timeseries"),pe(jy,"defaults",hu.defaults);const vb="label";function My(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function iA(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function bb(e,t){e.labels=t}function xb(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:vb;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 sA(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:vb;const n={labels:[],datasets:[]};return bb(n,e.labels),xb(n,e.datasets,t),n}function oA(e,t){const{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:s,type:o,data:a,options:l,plugins:u=[],fallbackContent:c,updateMode:d,...f}=e,h=z.useRef(null),g=z.useRef(null),m=()=>{h.current&&(g.current=new Qu(h.current,{type:o,data:sA(a,s),options:l&&{...l},plugins:u}),My(t,g.current))},p=()=>{My(t,null),g.current&&(g.current.destroy(),g.current=null)};return z.useEffect(()=>{!i&&g.current&&l&&iA(g.current,l)},[i,l]),z.useEffect(()=>{!i&&g.current&&bb(g.current.config.data,a.labels)},[i,a.labels]),z.useEffect(()=>{!i&&g.current&&a.datasets&&xb(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},c)}const aA=z.forwardRef(oA);function wb(e,t){return Qu.register(t),z.forwardRef((n,r)=>z.createElement(aA,{...n,ref:r,type:e}))}const lA=wb("line",Nl),uA=wb("radar",Fl);Qu.register(Vd,Qd,No,Vr,zl,wE,TE,RE,EE);var Xd={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}},cA=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 $y(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 Ly(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$y(Object(n),!0).forEach(function(r){dA(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$y(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dA(e,t,n){return(t=fA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fA(e){var t=hA(e,"string");return Qs(t)=="symbol"?t:t+""}function hA(e,t){if(Qs(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Qs(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qs(e){"@babel/helpers - typeof";return Qs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qs(e)}function gA(e){var t=new Date(e);return isNaN(t.getTime())?String(e):t.toLocaleString("en-US",{month:"short",day:"numeric"})}var yA=function(){var t,n,r,i,s=oi(),o=s.data,a=s.isLoading,l=s.isRefetching,u=o==null?void 0:o.mentions,c=u==null||(t=u.mentionedInNumberOfQueries)===null||t===void 0||(t=t.previous)===null||t===void 0?void 0:t.difference,d=u==null?void 0:u.chart,f=Array.isArray(d==null?void 0:d.labels)?d.labels:d!=null&&d.labels&&Qs(d.labels)==="object"?Object.values(d.labels):[],h=f.map(function(v){return gA(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=Ly(Ly({},Xd),{},{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(T.Card,{className:"yst-overflow-visible",children:y.jsxs(T.Card.Content,{className:"yst-space-y-4",children:[y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(Ga,{title:"Mentions progress",tooltip:"Tracks how your brand mentions have changed over time across the same query set."}),y.jsx(Ua,{score:u==null||(n=u.mentionedInNumberOfQueries)===null||n===void 0?void 0:n.value,total:o==null?void 0:o.numberOfQueries,delta:c,deltaSuffix:"since last analysis",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(T.Alert,{variant:"info",children:"One more analysis needed to show more insights."}):y.jsx("div",{className:"yst-h-72",children:y.jsx(lA,{data:function(){var v={labels:h,datasets:[d==null?void 0:d.datasets]};return v}(),options:p})})]})})};function kl(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,u=l===void 0?!1:l,c=e.delta,d=e.tooltipPosition,f=d===void 0?"left":d;return y.jsxs("div",{className:Oe("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",u&&"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 c=="number"&&y.jsxs("p",{className:Oe("yst-flex yst-items-center yst-gap-1 yst-text-tiny yst-font-bold",aa(c)),children:[c>0?y.jsx(y2,{}):c<0?y.jsx(g2,{}):null,c>-1e-6&&"+",c]}),i&&y.jsx(Df,{id:"tooltip-".concat(r.replace(/\s+/g,"-").toLowerCase()),className:"yst-absolute yst-right-2 yst-top-2",position:f,children:i})]})}function mA(e){var t=e.children,n=e.className;return y.jsx("div",{className:Oe("yst-grid yst-w-full yst-grid-cols-2 yst-gap-0 yst-rounded-lg",n),children:t})}function pA(e){return e>0?"yst-text-green-600":e<0?"yst-text-red-600":"yst-text-slate-500"}function vA(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:Oe("yst-flex yst-items-center yst-gap-1 yst-text-tiny yst-font-bold",pA(i),r),"aria-label":s?"Visibility increased by ".concat(a):o?"Visibility decreased by ".concat(a):"No change in visibility",children:[s&&y.jsx(y2,{className:"yst-w-4 yst-h-4"}),o&&y.jsx(g2,{className:"yst-w-4 yst-h-4"}),a]})}function pa(e){"@babel/helpers - typeof";return pa=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},pa(e)}function bA(e,t){return CA(e)||SA(e,t)||wA(e,t)||xA()}function xA(){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 wA(e,t){if(e){if(typeof e=="string")return Dy(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)?Dy(e,t):void 0}}function Dy(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function CA(e){if(Array.isArray(e))return e}function Iy(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 Ol(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Iy(Object(n),!0).forEach(function(r){_A(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Iy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _A(e,t,n){return(t=kA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kA(e){var t=OA(e,"string");return pa(t)=="symbol"?t:t+""}function OA(e,t){if(pa(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(pa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function EA(){var e,t,n,r,i,s,o,a,l,u,c,d,f,h,g,m,p,v,b,S,C,w,O,x,_=Nn(),k=_.brandId,E=_.analysisId,j=Ru(k,E,{query:{select:function(Fe){var Y=Fe.data;return Y},enabled:!!k&&!!E}}),M=j.data,B=j.isLoading,R=M==null||(e=M.analysis)===null||e===void 0?void 0:e.scans,A=Array.isArray(R)&&R.length>0?R.reduce(function(Ne,Fe){if(!Ne)return Fe;if(!(Fe!=null&&Fe.finishedAt)||!(Ne!=null&&Ne.finishedAt))return Ne;var Y=new Date(Fe.finishedAt),Te=new Date(Ne.finishedAt);return Y>Te?Fe:Ne},R[0]):void 0,P=A==null||(t=A.scores)===null||t===void 0?void 0:t.standardized,L=(n=A==null||(r=A.mentions)===null||r===void 0||(r=r.mentionedInNumberOfQueries)===null||r===void 0?void 0:r.value)!==null&&n!==void 0?n:0,H=A==null||(i=A.mentions)===null||i===void 0||(i=i.mentionedInNumberOfQueries)===null||i===void 0||(i=i.previous)===null||i===void 0?void 0:i.difference,G=(s=A==null||(o=A.scores)===null||o===void 0||(o=o.standardized)===null||o===void 0||(o=o.citations)===null||o===void 0?void 0:o.value)!==null&&s!==void 0?s:0,F=(a=A==null||(l=A.citations)===null||l===void 0||(l=l.total)===null||l===void 0?void 0:l.value)!==null&&a!==void 0?a:0,U=A==null||(u=A.citations)===null||u===void 0||(u=u.total)===null||u===void 0||(u=u.previous)===null||u===void 0?void 0:u.difference,ie=A==null||(c=A.rankings)===null||c===void 0||(c=c.list)===null||c===void 0?void 0:c.find(function(Ne){var Fe;return((Fe=Ne.brand)===null||Fe===void 0?void 0:Fe.isSelf)===!0}),ae=(d=ie==null||(f=ie.rank)===null||f===void 0?void 0:f.value)!==null&&d!==void 0?d:"—",N=ie==null||(h=ie.rank)===null||h===void 0||(h=h.previous)===null||h===void 0?void 0:h.difference;N&&(N=N*-1);var le=(g=P==null||(m=P.visibility)===null||m===void 0?void 0:m.value)!==null&&g!==void 0?g:0,te=P==null||(p=P.visibility)===null||p===void 0||(p=p.previous)===null||p===void 0?void 0:p.value,me=(v=P==null||(b=P.ranking)===null||b===void 0?void 0:b.value)!==null&&v!==void 0?v:0,J=(S=P==null||(C=P.sentiment)===null||C===void 0?void 0:C.value)!==null&&S!==void 0?S:0,Se=(w=P==null||(O=P.mentions)===null||O===void 0?void 0:O.value)!==null&&w!==void 0?w:0,ge={labels:["Mentions","Ranking","Citations","Sentiment"],datasets:[{data:[Se,me,G,J],backgroundColor:cA,pointBackgroundColor:"rgba(166, 30, 105, 1)"}]},ze=Ol(Ol({},Xd),{},{plugins:Ol(Ol({},Xd.plugins),{},{tooltip:{mode:"point",intersect:!0,callbacks:{label:function(Fe){var Y=Fe.label||"",Te=Fe.parsed.r||0;return"".concat(Y,": ").concat(Te,"%")}}}}),interaction:{mode:"point",intersect:!0},scales:{r:{beginAtZero:!0,min:0,max:100,ticks:{stepSize:20}}}}),oe=z.useState(typeof window!="undefined"&&window.innerWidth<800?"top":"left"),He=bA(oe,2),lt=He[0],dt=He[1];return z.useEffect(function(){function Ne(){dt(window.innerWidth<800?"top":"left")}return window.addEventListener("resize",Ne),function(){return window.removeEventListener("resize",Ne)}},[]),y.jsx(T.Card,{className:"yst-overflow-visible md:yst-col-span-2",children:y.jsxs(T.Card.Content,{children:[y.jsx(T.Title,{size:"3",className:"yst-mb-2",children:"AI visibility index (AIVI)"}),y.jsx(Ua,{score:le,total:100,isLoading:B}),y.jsx(vA,{current:le,previous:te,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(uA,{data:ge,options:ze}),y.jsx(Df,{id:"tooltip-radar-chart",className:"yst-absolute yst-right-2 yst-top-2",position:"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(mA,{children:[y.jsx(kl,{value:L,label:"Mentions",tooltip:"Mentions show how often your brand appears in AI-generated answers to the questions we send to LLMs.",borderBottom:!0,borderRight:!0,delta:H,tooltipPosition:lt}),y.jsx(kl,{value:ae&&y.jsxs(y.Fragment,{children:[ae,ae===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:N}),y.jsx(kl,{value:F,label:"Citations",tooltip:"Citations are the source links found in AI-generated answers. They form the basis for mentions, sentiment, and ranking insights.",borderRight:!0,delta:U,tooltipPosition:lt}),y.jsx(kl,{value:J?"".concat(J,"%"):"—",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:A==null||(x=A.scores)===null||x===void 0||(x=x.standardized)===null||x===void 0||(x=x.sentiment)===null||x===void 0||(x=x.previous)===null||x===void 0?void 0:x.difference})]})})]})]})})}const AA="data:image/svg+xml,%3csvg%20width='17'%20height='17'%20viewBox='0%200%2017%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3.652%2015.0488C2.3816%2015.0488%201.348%2014.0152%201.348%2012.7448V5.22476C1.348%203.95436%202.3816%202.92075%203.652%202.92075H9.5912L9.9304%202.07275H3.652C1.9144%202.07275%200.5%203.48716%200.5%205.22476V12.7448C0.5%2014.4824%201.9144%2015.8968%203.652%2015.8968H3.6776V15.0488H3.652Z'%20fill='%23A61E69'/%3e%3cpath%20d='M16.5%205.22468C16.5%203.74948%2015.4824%202.51428%2014.1096%202.17188L13.812%202.97188C14.8584%203.18628%2015.6488%204.11748%2015.6488%205.22788V15.0519H9.16236C9.00236%2015.3527%208.83276%2015.6375%208.65356%2015.8999H16.4968V5.22468H16.5Z'%20fill='%23A61E69'/%3e%3cpath%20d='M11.5815%200.140137L8.03267%209.99614L6.28867%204.53374H4.15747L6.82307%2011.3785C7.06947%2012.0121%207.06947%2012.7129%206.82307%2013.3497C6.56387%2014.0121%206.10627%2014.8025%204.82947%2015.0361L4.77187%2015.0457V16.8633H4.84547C5.91107%2016.8185%206.73667%2016.4665%207.44387%2015.7561C8.16387%2015.0329%208.78147%2013.9065%209.38947%2012.2137L13.8919%200.140137H11.5815Z'%20fill='%23A61E69'/%3e%3c/svg%3e";var TA=function(){var t,n=oi(),r=n.data,i=n.isLoading,s=n.isRefetching;return i&&!s||(r==null||(t=r.mentions)===null||t===void 0||(t=t.mentionedInNumberOfQueries)===null||t===void 0?void 0:t.value)!==0?null:y.jsx(T.Card,{className:"yst-overflow-visible md:yst-col-span-2 yst-text-slate-800",children:y.jsxs(T.Card.Content,{className:"yst-space-y-4 yst-max-w-2xl",children:[y.jsx(T.Title,{size:"3",children:"We couldn’t find your brand in this brand analysis..."}),y.jsx("p",{children:"This means LLMs may not yet be surfacing your site in answers. Don’t worry, here are some steps you can take today to boost your AI visibility:"}),y.jsxs("ol",{className:"yst-list-decimal yst-ml-5 [&>li::marker]:yst-font-semibold ",children:[y.jsxs("li",{children:[y.jsx("strong",{children:"Activate llms.txt →"})," ",y.jsx("a",{href:"https://yoast.com/features/llms-txt/",target:"_blank",rel:"noopener noreferrer",children:"Set up llms.txt in Yoast SEO"}),"."," ","Make sure AI systems know where to look and which pages matter most."]}),y.jsxs("li",{children:[y.jsx("strong",{children:"Adopt an LLM-friendly content structure →"})," ",y.jsx("a",{href:"https://yoast.com/yoast-seo-premium-september-9-2025/",target:"_blank",rel:"noopener noreferrer",children:"See how in our latest update"}),". Start with clear definitions or TL;DRs, use subheadings, and format answers so LLMs can lift them directly."]}),y.jsxs("li",{children:[y.jsx("strong",{children:"Simplify writing and readability →"})," ","Use shorter sentences, plain language, and one idea per paragraph. This makes it easier for AI systems to recognize and quote your content."]})]}),y.jsxs("p",{children:["Want to go deeper? →"," ",y.jsx("a",{href:"https://yoast.com/how-to-optimize-content-for-llms/",target:"_blank",rel:"noopener noreferrer",children:"Read our full guide on optimizing content for LLMs"}),"."]})]})})};function PA(e,t){return LA(e)||$A(e,t)||MA(e,t)||jA()}function jA(){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 MA(e,t){if(e){if(typeof e=="string")return Ry(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)?Ry(e,t):void 0}}function Ry(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function $A(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function LA(e){if(Array.isArray(e))return e}var Uc=function(){var t=Nn(),n=t.brandId,r=t.analysisId,i=Qi({query:{select:function(_){var k=_.data;return k==null?void 0:k.brands}}}),s=i.data,o=i.isLoading,a=Ru(n,r,{query:{enabled:!!n&&$6(r),select:function(_){var k=_.data;return k==null?void 0:k.analysis}}}),l=a.data,u=a.isLoading,c=l==null?void 0:l.status,d=o||u,f=s&&(s==null?void 0:s.length)>0,h=!d&&l&&c===gi.completed,g=z.useState(!1),m=PA(g,2),p=m[0],v=m[1],b=z.useRef(null),S=z.useRef(void 0),C=localStorage.getItem("yst_congratulations_toast_seen")==="true";z.useEffect(function(){return h&&!S.current&&!C&&(b.current=setTimeout(function(){v(!0),localStorage.setItem("yst_congratulations_toast_seen","true")},1e4)),!h&&S.current&&(v(!1),b.current&&(clearTimeout(b.current),b.current=null)),S.current=h,function(){b.current&&(clearTimeout(b.current),b.current=null)}},[h,C]);function w(x){var _=x.children;if(typeof window=="undefined")return null;var k=document.getElementById("toast-portal");return k?mx.createPortal(_,k):null}var O=function(_){var k=_.isVisible,E=_.setIsVisible,j=function(){E(!1)};return y.jsxs(T.Toast,{id:"toast",isVisible:k,position:"bottom-left",setIsVisible:function(M){M||E(!1)},children:[y.jsxs("div",{className:"yst-flex yst-gap-3 yst-items-start yst-mb-3",children:[y.jsx("img",{src:AA}),y.jsxs("div",{className:"yst-grow",children:[y.jsx(T.Title,{size:"3",className:"yst-mb-1",children:"Congratulations on your first analysis!"}),"You’ve completed your brand analysis. We’d love to hear what you think."]}),y.jsx(T.Button,{variant:"tertiary",onClick:j,children:y.jsx(v2,{})})]}),y.jsxs("div",{className:"yst-flex yst-justify-end yst-gap-4",children:[y.jsx(T.Button,{variant:"tertiary",onClick:j,children:"Dismiss"}),y.jsxs(T.Button,{as:"a",href:"https://www.surveymonkey.com/r/HGSB8DL",target:"_blank",children:["Give feedback",y.jsx(p2,{className:"yst-ml-2"})]})]})]})};return o?y.jsx(Bu,{}):f?y.jsxs("div",{className:"yst-space-y-4",children:[y.jsx(E7,{}),h&&y.jsxs("div",{className:"yst-space-y-4",children:[y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-between",children:[y.jsx(T.Title,{size:"2",children:"Your brand analysis"}),y.jsxs(T.Button,{as:ii,variant:"secondary",to:"/brands/".concat(n,"/brand-list"),className:Oe("yst-gap-1.5"),disabled:!n,children:[y.jsx(d2,{})," Edit brand list"]})]}),y.jsxs("div",{className:"yst-grid yst-grid-cols-1 yst-gap-4 md:yst-grid-cols-2",children:[y.jsx(TA,{}),y.jsx(EA,{}),y.jsx(A7,{}),y.jsx(yA,{}),y.jsx(R_,{}),y.jsx(j_,{}),y.jsx(m_,{}),y.jsx(N_,{})]}),y.jsx(w,{children:y.jsx(O,{isVisible:p,setIsVisible:v})})]})]}):y.jsx(e_,{})};function Sb(e){var t=e.children,n=e.description,r=e.title;return y.jsxs(T.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(T.Title,{className:Oe({"yst-mb-3":n||t}),children:r}),n&&y.jsx("p",{children:n}),t]})}var DA=function(){return y.jsx(T.Card,{className:"yst-mb-4",children:y.jsxs(T.Card.Content,{className:"yst-flex yst-flex-col yst-gap-8",children:[y.jsx(T.Title,{size:"2",children:"Query - Best fish restaurant in Nijmegen"}),y.jsxs("div",{children:[y.jsx("p",{children:"AI Response:"}),y.jsx(T.Link,{href:"#todo",children:"Show more"})]}),y.jsxs("div",{children:[y.jsx("p",{children:"Extracted brands:"}),y.jsx(T.Badge,{children:"Example"}),y.jsx(T.Badge,{children:"Example"}),y.jsx(T.Badge,{children:"Example"}),y.jsx(T.Badge,{children:"Example"}),y.jsx(T.Badge,{children:"Example"})]}),y.jsxs(T.Table,{children:[y.jsx(T.Table.Head,{children:y.jsxs(T.Table.Row,{children:[y.jsx(T.Table.Header,{children:"URL"}),y.jsx(T.Table.Header,{children:"Associated brand"})]})}),y.jsxs(T.Table.Body,{children:[y.jsxs(T.Table.Row,{children:[y.jsx(T.Table.Cell,{children:y.jsx(T.Link,{href:"https://example.com",target:"_blank",children:"https://example.com"})}),y.jsx(T.Table.Cell,{children:"Example Brand"})]}),y.jsxs(T.Table.Row,{children:[y.jsx(T.Table.Cell,{children:y.jsx(T.Link,{href:"https://example2.com",target:"_blank",children:"https://example2.com"})}),y.jsx(T.Table.Cell,{children:"Example Brand 2"})]})]})]})]})})},IA=function(){return y.jsxs(T.Card,{children:[y.jsx(Sb,{title:"Query history"}),y.jsx(T.Card,{className:"yst-mb-4",children:y.jsxs(T.Card.Content,{children:[y.jsxs("p",{className:"yst-mb-8",children:["Manna Fish Restaurant - Analysis performed on:"," ",y.jsx(T.Badge,{children:"2025-04-08 12:31:21"})]}),[0,1,2,3,4].map(function(t){return y.jsx(DA,{},t)})]})})]})},RA=z.lazy(function(){return Promise.resolve().then(()=>VL)}),NA=z.lazy(function(){return Promise.resolve().then(()=>wD)}),FA=z.lazy(function(){return Promise.resolve().then(()=>_D)}),BA=z.lazy(function(){return Promise.resolve().then(()=>ND)}),qA=z.lazy(function(){return Promise.resolve().then(()=>tI)}),zA=z.lazy(function(){return Promise.resolve().then(()=>aI)}),HA=new r3({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1,staleTime:1e3*60*5},mutations:{retry:!1}}}),fi=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(T.SkeletonLoader,{className:"yst-h-8 yst-w-3/4"}),y.jsx(T.SkeletonLoader,{className:"yst-h-6 yst-w-full"}),y.jsx(T.SkeletonLoader,{className:"yst-h-6 yst-w-2/3"})]})})},UA=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(uw,{children:y.jsxs(_t,{element:y.jsx(T6,{hideNav:r,disableLayout:s,DebugInfo:o}),children:[y.jsxs(_t,{path:"/",element:y.jsx(Hs,{}),children:[y.jsx(_t,{index:!0,element:y.jsx(Uc,{})}),y.jsxs(_t,{path:"brands/:brandId",element:y.jsx(M0,{}),children:[y.jsx(_t,{index:!0,element:y.jsx(Uc,{})}),y.jsx(_t,{path:"brand-list",element:y.jsx(z.Suspense,{fallback:y.jsx(fi,{}),children:y.jsx(RA,{})})}),y.jsx(_t,{path:"analysis/:analysisId",element:y.jsx(P6,{}),children:y.jsx(_t,{index:!0,element:y.jsx(Uc,{})})})]}),y.jsxs(_t,{path:"/setup",element:y.jsx(z.Suspense,{fallback:y.jsx(fi,{}),children:y.jsx(FA,{})}),children:[y.jsx(_t,{index:!0,element:y.jsx(z.Suspense,{fallback:y.jsx(fi,{}),children:y.jsx(BA,{})})}),y.jsxs(_t,{path:":brandId",element:y.jsx(M0,{}),children:[y.jsx(_t,{path:"queries",element:y.jsx(z.Suspense,{fallback:y.jsx(fi,{}),children:y.jsx(qA,{})})}),y.jsx(_t,{path:"analysis",element:y.jsx(z.Suspense,{fallback:y.jsx(fi,{}),children:y.jsx(zA,{})})})]})]})]}),y.jsx(_t,{path:"/settings",element:y.jsx(z.Suspense,{fallback:y.jsx(fi,{}),children:y.jsx(NA,{})})}),y.jsx(_t,{path:"/query-history",element:y.jsx(z.Suspense,{fallback:y.jsx(fi,{}),children:y.jsx(IA,{})})})]})})},GA=function(t){var n=t.DebugInfo,r=t.hostAppProps;return y.jsxs(l3,{client:HA,children:[y.jsx(L4,{hostAppProps:r,children:y.jsx(UA,{DebugInfo:n})}),y.jsx(QS,{initialIsOpen:!1})]})};function KA(e){var t=e.subpath,n=t===void 0?"/":t,r=e.onNavigate,i=fn(),s=Ut(),o=z.useRef(n),a=z.useRef(null),l=z.useRef(!1),u="".concat(s.pathname).concat(s.search).concat(s.hash),c=z.useCallback(r,[r]);return z.useEffect(function(){if(n===u){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,u,i]),z.useEffect(function(){l.current||u!==n&&u!==a.current&&(a.current=u,c(u))},[u,n,c]),null}function VA(e,t){return XA(e)||YA(e,t)||QA(e,t)||WA()}function WA(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
70
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function QA(e,t){if(e){if(typeof e=="string")return Ny(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ny(e,t):void 0}}function Ny(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function YA(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function XA(e){if(Array.isArray(e))return e}var ZA=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,u=t.DebugInfo,c=t.basename,d=c===void 0?"/":c,f=t.subpath,h=f===void 0?"/":f,g=t.onNavigate,m=g===void 0?function(){}:g,p=t.onLogout,v=p===void 0?function(){}:p,b=t.onAddSubscription,S=b===void 0?function(){}:b,C=function(j,M){var B=j.endsWith("/")?j.slice(0,-1):j,R=M.startsWith("/")?M:"/".concat(M);return B+R||"/"},w=z.useState(!!(a||l)),O=VA(w,2),x=O[0],_=O[1],k={onAddSubscription:S,onLogout:v,onNavigate:m,DebugInfo:u,basename:d,subpath:h};return z.useEffect(function(){l&&r2(l),j5(typeof a!="function"?function(){return a}:a),_(!1)},[l,a]),x?y.jsx("div",{className:i,style:s,children:y.jsx(T.Spinner,{})}):y.jsx("div",{className:i,style:s,children:y.jsxs(aw,{initialEntries:[C(d,h)],basename:d||"/",children:[y.jsx(KA,{subpath:h,onNavigate:m}),y.jsx(T.Root,{context:{isRtl:r},children:y.jsx(GA,{DebugInfo:u,hostAppProps:k})})]})})},JA=e=>e!=null,eT=e=>e.filter(JA);function tT(e){return(...t)=>{for(const n of e)n&&n(...t)}}var X=e=>typeof e=="function"&&!e.length?e():e,Zd=e=>Array.isArray(e)?e:e?[e]:[];function nT(e,...t){return typeof e=="function"?e(...t):e}var rT=_e;function iT(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 sT(e){const[t,n]=ce(),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=ce(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(S){r(S,`Error setting ${s}${f} to ${m} in ${b.name}`)}});const v=o.get(f);v&&v[1]()},u=f=>i.forEach(h=>{try{h.removeItem(`${s}${f}`)}catch(g){r(g,`Error removing ${s}${f} from ${h.name}`)}}),c=()=>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&&Cr(()=>{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),_e(()=>globalThis.removeEventListener("storage",f))):(i.forEach(h=>{var g;return(g=h.addEventListener)==null?void 0:g.call(h,"storage",f)}),_e(()=>i.forEach(h=>{var g;return(g=h.removeEventListener)==null?void 0:g.call(h,"storage",f)})))}),[a,l,{clear:c,error:t,remove:u,toJSON:d}]}var Cb=sT,oT=e=>(typeof e.clear=="function"||(e.clear=()=>{let t;for(;t=e.key(0);)e.removeItem(t)}),e),Fy=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},yn=oT({_cookies:[globalThis.document,"cookie"],getItem:e=>{var t,n;return(n=(t=yn._cookies[0][yn._cookies[1]].match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)"))==null?void 0:t.pop())!=null?n:null},setItem:(e,t,n)=>{const r=yn.getItem(e);yn._cookies[0][yn._cookies[1]]=`${e}=${t}${Fy(n)}`;const i=Object.assign(new Event("storage"),{key:e,oldValue:r,newValue:t,url:globalThis.document.URL,storageArea:yn});window.dispatchEvent(i)},removeItem:e=>{yn._cookies[0][yn._cookies[1]]=`${e}=deleted${Fy({expires:new Date(0)})}`},key:e=>{let t=null,n=0;return yn._cookies[0][yn._cookies[1]].replace(/(?:^|;)\s*(.+?)\s*=\s*[^;]+/g,(r,i)=>(!t&&i&&n++===e&&(t=i),"")),t},get length(){let e=0;return yn._cookies[0][yn._cookies[1]].replace(/(?:^|;)\s*.+?\s*=\s*[^;]+/g,t=>(e+=t?1:0,"")),e}}),aT=1024,Hi=796,Zf=700,lT="bottom-right",Jd="bottom",_b="system",uT=!1,kb=500,cT=500,Ob=500,dT=Object.keys(Sd)[0],By=1,fT=Object.keys(Cd)[0],Jf=wt({client:void 0,onlineManager:void 0,queryFlavor:"",version:"",shadowDOMTarget:void 0});function ye(){return St(Jf)}var Eb=wt(void 0),Ab=e=>{const[t,n]=ce(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="",X3(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(u=>{try{const c=[...u.cssRules].map(g=>g.cssText).join(""),d=document.createElement("style"),f=u.ownerNode;let h="";f&&"id"in f&&(h=f.id),h&&d.setAttribute("id",h),d.textContent=c,l.document.head.appendChild(d)}catch(c){const d=document.createElement("link");if(u.href==null)return;d.rel="stylesheet",d.type=u.type,d.media=u.media.toString(),d.href=u.href,l.document.head.appendChild(d)}}),Au(["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||cT))}),xe(()=>{const o=(ye().shadowDOMTarget||document).querySelector("#_goober"),a=t();if(o&&a){const l=new MutationObserver(()=>{const u=(ye().shadowDOMTarget||a.document).querySelector("#_goober");u&&(u.textContent=o.textContent)});l.observe(o,{childList:!0,subtree:!0,characterDataOldValue:!0}),_e(()=>{l.disconnect()})}});const s=K(()=>{var o;return{pipWindow:t(),requestPipWindow:i,closePipWindow:r,disabled:(o=e.disabled)!=null?o:!1}});return D(Eb.Provider,{value:s,get children(){return e.children}})},eh=()=>K(()=>{const t=St(Eb);if(!t)throw new Error("usePiPWindow must be used within a PiPProvider");return t()}),th=wt(()=>"dark");function xt(){return St(th)}var Tb={À:"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"},hT=Object.keys(Tb).join("|"),gT=new RegExp(hT,"g");function yT(e){return e.replace(gT,t=>Tb[t])}var Bt={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function qy(e,t,n){var r;if(n=n||{},n.threshold=(r=n.threshold)!=null?r:Bt.MATCHES,!n.accessors){const o=zy(e,t,n);return{rankedValue:e,rank:o,accessorIndex:-1,accessorThreshold:n.threshold,passed:o>=n.threshold}}const i=bT(e,n.accessors),s={rankedValue:e,rank:Bt.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let o=0;o<i.length;o++){const a=i[o];let l=zy(a.itemValue,t,n);const{minRanking:u,maxRanking:c,threshold:d=n.threshold}=a.attributes;l<u&&l>=Bt.MATCHES?l=u:l>c&&(l=c),l=Math.min(l,c),l>=d&&l>s.rank&&(s.rank=l,s.passed=!0,s.accessorIndex=o,s.accessorThreshold=d,s.rankedValue=a.itemValue)}return s}function zy(e,t,n){return e=Hy(e,n),t=Hy(t,n),t.length>e.length?Bt.NO_MATCH:e===t?Bt.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?Bt.EQUAL:e.startsWith(t)?Bt.STARTS_WITH:e.includes(` ${t}`)?Bt.WORD_STARTS_WITH:e.includes(t)?Bt.CONTAINS:t.length===1?Bt.NO_MATCH:mT(e).includes(t)?Bt.ACRONYM:pT(e,t))}function mT(e){let t="";return e.split(" ").forEach(r=>{r.split("-").forEach(s=>{t+=s.substr(0,1)})}),t}function pT(e,t){let n=0,r=0;function i(l,u,c){for(let d=c,f=u.length;d<f;d++)if(u[d]===l)return n+=1,d+1;return-1}function s(l){const u=1/l,c=n/t.length;return Bt.MATCHES+c*u}const o=i(t[0],e,0);if(o<0)return Bt.NO_MATCH;r=o;for(let l=1,u=t.length;l<u;l++){const c=t[l];if(r=i(c,e,r),!(r>-1))return Bt.NO_MATCH}const a=r-o;return s(a)}function Hy(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=yT(e)),e}function vT(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 bT(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const s=t[r],o=xT(s),a=vT(e,s);for(let l=0,u=a.length;l<u;l++)n.push({itemValue:a[l],attributes:o})}return n}var Uy={maxRanking:1/0,minRanking:-1/0};function xT(e){return typeof e=="function"?Uy:{...Uy,...e}}var wT={data:""},ST=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||wT,CT=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,_T=/\/\*[^]*?\*\/| +/g,Gy=/\n+/g,vi=(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"?vi(o,s):s+"{"+vi(o,s[1]=="k"?"":t)+"}":typeof o=="object"?r+=vi(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+=vi.p?vi.p(s,o):s+":"+o+";")}return n+(t&&i?t+"{"+i+"}":i)+r},or={},Pb=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+Pb(e[n]);return t}return e},kT=(e,t,n,r,i)=>{let s=Pb(e),o=or[s]||(or[s]=(l=>{let u=0,c=11;for(;u<l.length;)c=101*c+l.charCodeAt(u++)>>>0;return"go"+c})(s));if(!or[o]){let l=s!==e?e:(u=>{let c,d,f=[{}];for(;c=CT.exec(u.replace(_T,""));)c[4]?f.shift():c[3]?(d=c[3].replace(Gy," ").trim(),f.unshift(f[0][d]=f[0][d]||{})):f[0][c[1]]=c[2].replace(Gy," ").trim();return f[0]})(e);or[o]=vi(i?{["@keyframes "+o]:l}:l,n?"":"."+o)}let a=n&&or.g?or.g:null;return n&&(or.g=or[o]),((l,u,c,d)=>{d?u.data=u.data.replace(d,l):u.data.indexOf(l)===-1&&(u.data=c?l+u.data:u.data+l)})(or[o],t,r,a),o},OT=(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?"":vi(a,""):a===!1?"":a}return r+i+(o==null?"":o)},"");function Me(e){let t=this||{},n=e.call?e(t.p):e;return kT(n.unshift?n.raw?OT(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,ST(t.target),t.g,t.o,t.k)}Me.bind({g:1});Me.bind({k:1});function jb(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=jb(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function fe(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=jb(e))&&(r&&(r+=" "),r+=t);return r}function ET(e,t){const n=at(e),{onChange:r}=t;let i=new Set(t.appear?void 0:n);const s=new WeakSet,[o,a]=ce([],{equals:!1}),[l]=A3(),u=d=>{a(f=>(f.push.apply(f,d),f));for(const f of d)s.delete(f)},c=(d,f,h)=>d.splice(h,0,f);return K(d=>{const f=o(),h=e();if(h[ku],at(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:u}),g}return at(()=>{const g=new Set(h),m=h.slice(),p=[],v=[],b=[];for(const C of h)(i.has(C)?b:p).push(C);let S=!p.length;for(let C=0;C<d.length;C++){const w=d[C];g.has(w)||(s.has(w)||(v.push(w),s.add(w)),c(m,w,C)),S&&w!==m[C]&&(S=!1)}return!v.length&&S?d:(r({list:m,added:p,removed:v,unchanged:b,finishRemoved:u}),i=g,m)})},t.appear?[]:n.slice())}function It(...e){return tT(e)}var Ky=e=>e instanceof Element;function ef(e,t){if(t(e))return e;if(typeof e=="function"&&!e.length)return ef(e(),t);if(Array.isArray(e)){const n=[];for(const r of e){const i=ef(r,t);i&&(Array.isArray(i)?n.push.apply(n,i):n.push(i))}return n.length?n:null}return null}function AT(e,t=Ky,n=Ky){const r=K(e),i=K(()=>ef(r(),t));return i.toArray=()=>{const s=i();return Array.isArray(s)?s:s?[s]:[]},i}function TT(e){return K(()=>{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 Mb(e){requestAnimationFrame(()=>requestAnimationFrame(e))}function PT(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())}),Mb(()=>{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 jT(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()),Mb(()=>{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 Vy=e=>{const t=TT(e);return ET(AT(()=>e.children).toArray,{appear:e.appear,onChange({added:n,removed:r,finishRemoved:i,list:s}){const o=t();for(const l of n)PT(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:u,rect:c}of a)if(u.isConnected){const d=u.getBoundingClientRect(),f=c.left-d.left,h=c.top-d.top;(f||h)&&(u.style.transform=`translate(${f}px, ${h}px)`,u.style.transitionDuration="0s",l.push(u))}document.body.offsetHeight;for(const u of l){let c=function(d){(d.target===u||/transform$/.test(d.propertyName))&&(u.removeEventListener("transitionend",c),u.classList.remove(...o.move))};u.classList.add(...o.move),u.style.transform=u.style.transitionDuration="",u.addEventListener("transitionend",c)}});for(const l of r)jT(o,e,l,()=>i([l]))}})},Gc=Symbol("fallback");function Wy(e){for(const t of e)t.dispose()}function MT(e,t,n,r={}){const i=new Map;return _e(()=>Wy(i.values())),()=>{const o=e()||[];return o[ku],at(()=>{var c,d;if(!o.length)return Wy(i.values()),i.clear(),r.fallback?[br(h=>(i.set(Gc,{dispose:h}),r.fallback()))]:[];const a=new Array(o.length),l=i.get(Gc);if(!i.size||l){l==null||l.dispose(),i.delete(Gc);for(let f=0;f<o.length;f++){const h=o[f],g=t(h,f);s(a,h,f,g)}return a}const u=new Set(i.keys());for(let f=0;f<o.length;f++){const h=o[f],g=t(h,f);u.delete(g);const m=i.get(g);m?(a[f]=m.mapped,(c=m.setIndex)==null||c.call(m,f),m.setItem(()=>h)):s(a,h,f,g)}for(const f of u)(d=i.get(f))==null||d.dispose(),i.delete(f);return a})};function s(o,a,l,u){br(c=>{const[d,f]=ce(a),h={setItem:f,dispose:c};if(n.length>1){const[g,m]=ce(l);h.setIndex=m,h.mapped=n(d,g)}else h.mapped=n(d);i.set(u,h),o[l]=h.mapped})}}function gu(e){const{by:t}=e;return K(MT(()=>e.each,typeof t=="function"?t:n=>n[t],e.children,"fallback"in e?{fallback:()=>e.fallback}:void 0))}function $T(e,t,n,r){return e.addEventListener(t,n,r),rT(e.removeEventListener.bind(e,t,n,r))}function LT(e,t,n,r){const i=()=>{Zd(X(e)).forEach(s=>{s&&Zd(X(t)).forEach(o=>$T(s,o,n,r))})};typeof e=="function"?xe(i):be(i)}function DT(e,t){const n=new ResizeObserver(e);return _e(n.disconnect.bind(n)),{observe:r=>n.observe(r,t),unobserve:n.unobserve.bind(n)}}function $b(e,t,n){const r=new WeakMap,{observe:i,unobserve:s}=DT(o=>{for(const a of o){const{contentRect:l,target:u}=a,c=Math.round(l.width),d=Math.round(l.height),f=r.get(u);(!f||f.width!==c||f.height!==d)&&(t(l,u,a),r.set(u,{width:c,height:d}))}},n);xe(o=>{const a=eT(Zd(X(e)));return iT(a,o,i,s),a},[])}var IT=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function Qy(e){const t={};let n;for(;n=IT.exec(e);)t[n[1]]=n[2];return t}function Zu(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=Qy(e)}else typeof t=="string"&&(t=Qy(t));return{...e,...t}}function RT(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function tf(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function NT(e){return typeof e=="number"}function ss(e){return Object.prototype.toString.call(e)==="[object String]"}function FT(e){return typeof e=="function"}function Qa(e){return t=>`${e()}-${t}`}function Sn(e,t){return e?e===t||e.contains(t):!1}function Fo(e,t=!1){const{activeElement:n}=tr(e);if(!(n!=null&&n.nodeName))return null;if(Lb(n)&&n.contentDocument)return Fo(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const i=tr(n).getElementById(r);if(i)return i}}return n}function BT(e){return tr(e).defaultView||window}function tr(e){return e?e.ownerDocument||e:document}function Lb(e){return e.tagName==="IFRAME"}var nh=(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))(nh||{});function rh(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 Ju(){return rh(/^Mac/i)}function qT(){return rh(/^iPhone/i)}function zT(){return rh(/^iPad/i)||Ju()&&navigator.maxTouchPoints>1}function HT(){return qT()||zT()}function UT(){return Ju()||HT()}function nt(e,t){return t&&(FT(t)?t(e):t[0](t[1],e)),e==null?void 0:e.defaultPrevented}function vt(e){return t=>{for(const n of e)nt(t,n)}}function GT(e){return Ju()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function At(e){if(e)if(KT())e.focus({preventScroll:!0});else{const t=VT(e);e.focus(),WT(t)}}var El=null;function KT(){if(El==null){El=!1;try{document.createElement("div").focus({get preventScroll(){return El=!0,!0}})}catch(e){}}return El}function VT(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 WT(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var Db=["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'])"],QT=[...Db,'[tabindex]:not([tabindex="-1"]):not([disabled])'],ih=Db.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",YT=QT.join(':not([hidden]):not([tabindex="-1"]),');function Ib(e,t){const r=Array.from(e.querySelectorAll(ih)).filter(Yy);return t&&Yy(e)&&r.unshift(e),r.forEach((i,s)=>{if(Lb(i)&&i.contentDocument){const o=i.contentDocument.body,a=Ib(o,!1);r.splice(s,1,...a)}}),r}function Yy(e){return Rb(e)&&!XT(e)}function Rb(e){return e.matches(ih)&&sh(e)}function XT(e){return parseInt(e.getAttribute("tabindex")||"0",10)<0}function sh(e,t){return e.nodeName!=="#comment"&&ZT(e)&&JT(e,t)&&(!e.parentElement||sh(e.parentElement,e))}function ZT(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 JT(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function eP(e,t,n){const r=t!=null&&t.tabbable?YT:ih,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)&&sh(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 Xy(e){for(;e&&!tP(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function tP(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function nP(){}function rP(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[u,c]=t[a],[d,f]=t[l],[,h]=t[l===0?o-1:l-1]||[0,0],g=(c-f)*(n-u)-(u-d)*(r-c);if(f<c){if(r>=f&&r<c){if(g===0)return!0;g>0&&(r===f?r>h&&(i=!i):i=!i)}}else if(c<f){if(r>c&&r<=f){if(g===0)return!0;g<0&&(r===f?r<h&&(i=!i):i=!i)}}else if(r==c&&(n>=d&&n<=u||n>=u&&n<=d))return!0}return i}function Re(e,t){return Ae(e,t)}var Oo=new Map,Zy=new Set;function Jy(){if(typeof window=="undefined")return;const e=n=>{if(!n.target)return;let r=Oo.get(n.target);r||(r=new Set,Oo.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=Oo.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Oo.delete(n.target)),Oo.size===0)){for(const i of Zy)i();Zy.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document!="undefined"&&(document.readyState!=="loading"?Jy():document.addEventListener("DOMContentLoaded",Jy));function nf(e,t){const n=em(e,t,"left"),r=em(e,t,"top"),i=t.offsetWidth,s=t.offsetHeight;let o=e.scrollLeft,a=e.scrollTop;const l=o+e.offsetWidth,u=a+e.offsetHeight;n<=o?o=n:n+i>l&&(o+=n+i-l),r<=a?a=r:r+s>u&&(a+=r+s-u),e.scrollLeft=o,e.scrollTop=a}function em(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 iP(e,t){var n,r;if(document.contains(e)){const i=document.scrollingElement||document.documentElement;if(window.getComputedStyle(i).overflow==="hidden"){let o=Xy(e);for(;e&&o&&e!==i&&o!==i;)nf(o,e),e=o,o=Xy(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:u}=e.getBoundingClientRect();(Math.abs(o-l)>1||Math.abs(a-u)>1)&&((r=e.scrollIntoView)==null||r.call(e,{block:"nearest"}))}}}var Nb={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 Cn(e){return t=>(e(t),()=>e(void 0))}function ec(e,t){const[n,r]=ce(tm(t==null?void 0:t()));return xe(()=>{var i;r(((i=e())==null?void 0:i.tagName.toLowerCase())||tm(t==null?void 0:t()))}),n}function tm(e){return ss(e)?e:void 0}function st(e){const[t,n]=Ve(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return D(lS,Ae(n,{get component(){return t.as}}))}var sP=["id","name","validationState","required","disabled","readOnly"];function oP(e){const t=`form-control-${On()}`,n=Re({id:t},e),[r,i]=ce(),[s,o]=ce(),[a,l]=ce(),[u,c]=ce(),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(),u(),m].filter(Boolean).join(" ")||void 0,h=K(()=>({"data-valid":X(n.validationState)==="valid"?"":void 0,"data-invalid":X(n.validationState)==="invalid"?"":void 0,"data-required":X(n.required)?"":void 0,"data-disabled":X(n.disabled)?"":void 0,"data-readonly":X(n.readOnly)?"":void 0}));return{formControlContext:{name:()=>{var m;return(m=X(n.name))!=null?m:X(n.id)},dataset:h,validationState:()=>X(n.validationState),isRequired:()=>X(n.required),isDisabled:()=>X(n.disabled),isReadOnly:()=>X(n.readOnly),labelId:r,fieldId:s,descriptionId:a,errorMessageId:u,getAriaLabelledBy:d,getAriaDescribedBy:f,generateId:Qa(()=>X(n.id)),registerLabel:Cn(i),registerField:Cn(o),registerDescription:Cn(l),registerErrorMessage:Cn(c)}}}var Fb=wt();function Ya(){const e=St(Fb);if(e===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function Bb(e){const t=Ya(),n=Re({id:t.generateId("description")},e);return xe(()=>_e(t.registerDescription(n.id))),D(st,Ae({as:"div"},()=>t.dataset(),n))}function qb(e){const t=Ya(),n=Re({id:t.generateId("error-message")},e),[r,i]=Ve(n,["forceMount"]),s=()=>t.validationState()==="invalid";return xe(()=>{s()&&_e(t.registerErrorMessage(i.id))}),D(ve,{get when(){return r.forceMount||s()},get children(){return D(st,Ae({as:"div"},()=>t.dataset(),i))}})}function aP(e){let t;const n=Ya(),r=Re({id:n.generateId("label")},e),[i,s]=Ve(r,["ref"]),o=ec(()=>t,()=>"label");return xe(()=>_e(n.registerLabel(s.id))),D(st,Ae({as:"label",ref(a){const l=It(u=>t=u,i.ref);typeof l=="function"&&l(a)},get for(){return K(()=>o()==="label")()?n.fieldId():void 0}},()=>n.dataset(),s))}function lP(e,t){xe(Sr(e,n=>{if(n==null)return;const r=uP(n);r!=null&&(r.addEventListener("reset",t,{passive:!0}),_e(()=>{r.removeEventListener("reset",t)}))}))}function uP(e){return cP(e)?e.form:e.closest("form")}function cP(e){return e.matches("textarea, input, select, button")}function Xa(e){var o;const[t,n]=ce((o=e.defaultValue)==null?void 0:o.call(e)),r=K(()=>{var a;return((a=e.value)==null?void 0:a.call(e))!==void 0}),i=K(()=>{var a;return r()?(a=e.value)==null?void 0:a.call(e):t()});return[i,a=>{at(()=>{var u;const l=nT(a,i());return Object.is(l,i())||(r()||n(l),(u=e.onChange)==null||u.call(e,l)),l})}]}function zb(e){const[t,n]=Xa(e);return[()=>{var i;return(i=t())!=null?i:!1},n]}function dP(e){const[t,n]=Xa(e);return[()=>{var i;return(i=t())!=null?i:[]},n]}function fP(e={}){const[t,n]=zb({value:()=>X(e.isSelected),defaultValue:()=>!!X(e.defaultIsSelected),onChange:s=>{var o;return(o=e.onSelectedChange)==null?void 0:o.call(e,s)}});return{isSelected:t,setIsSelected:s=>{!X(e.isReadOnly)&&!X(e.isDisabled)&&n(s)},toggle:()=>{!X(e.isReadOnly)&&!X(e.isDisabled)&&n(!t())}}}var hP=Object.defineProperty,tc=(e,t)=>{for(var n in t)hP(e,n,{get:t[n],enumerable:!0})},Hb=wt();function Ub(){return St(Hb)}function gP(){const e=Ub();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function Gb(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function yP(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&&Gb(s,n))return r+1}return 0}function mP(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:Gb(a,l)?(r>s&&(n=!0),-1):(r<s&&(n=!0),1)}),n?t.map(([r,i])=>i):e}function Kb(e,t){const n=mP(e);e!==n&&t(n)}function pP(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 tr(r).body}function vP(e,t){xe(()=>{const n=setTimeout(()=>{Kb(e(),t)});_e(()=>clearTimeout(n))})}function bP(e,t){if(typeof IntersectionObserver!="function"){vP(e,t);return}let n=[];xe(()=>{const r=()=>{const o=!!n.length;n=e(),o&&Kb(e(),t)},i=pP(e()),s=new IntersectionObserver(r,{root:i});for(const o of e()){const a=o.ref();a&&s.observe(a)}_e(()=>s.disconnect())})}function xP(e={}){const[t,n]=dP({value:()=>X(e.items),onChange:s=>{var o;return(o=e.onItemsChange)==null?void 0:o.call(e,s)}});bP(t,n);const r=s=>(n(o=>{const a=yP(o,s);return RT(o,s,a)}),()=>{n(o=>{const a=o.filter(l=>l.ref()!==s.ref());return o.length===a.length?o:a})});return{DomCollectionProvider:s=>D(Hb.Provider,{value:{registerItem:r},get children(){return s.children}})}}function wP(e){const t=gP(),n=Re({shouldRegisterItem:!0},e);xe(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());_e(r)})}function Vb(e){var l,u,c;let t=(l=e.startIndex)!=null?l:0;const n=(u=e.startLevel)!=null?u:0,r=[],i=d=>{var g;if(d==null)return"";const f=(g=e.getKey)!=null?g:"key",h=ss(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=ss(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=ss(f)?d[f]:f(d))!=null?g:!1},a=d=>{var f;if(d!=null)return ss(e.getSectionChildren)?d[e.getSectionChildren]:(f=e.getSectionChildren)==null?void 0:f.call(e,d)};for(const d of e.dataSource){if(ss(d)||NT(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=(c=a(d))!=null?c:[];if(f.length>0){const h=Vb({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 SP(e,t=[]){return K(()=>{const n=Vb({dataSource:X(e.dataSource),getKey:X(e.getKey),getTextValue:X(e.getTextValue),getDisabled:X(e.getDisabled),getSectionChildren:X(e.getSectionChildren)});for(let r=0;r<t.length;r++)t[r]();return e.factory(n)})}var CP=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),_P=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function kP(e){var n;if(Intl.Locale){const r=(n=new Intl.Locale(e).maximize().script)!=null?n:"";return CP.has(r)}const t=e.split("-")[0];return _P.has(t)}function OP(e){return kP(e)?"rtl":"ltr"}function Wb(){let e=typeof navigator!="undefined"&&(navigator.language||navigator.userLanguage)||"en-US";return{locale:e,direction:OP(e)}}var rf=Wb(),Bo=new Set;function nm(){rf=Wb();for(const e of Bo)e(rf)}function EP(){const[e,t]=ce(rf),n=K(()=>e());return Cr(()=>{Bo.size===0&&window.addEventListener("languagechange",nm),Bo.add(t),_e(()=>{Bo.delete(t),Bo.size===0&&window.removeEventListener("languagechange",nm)})}),{locale:()=>n().locale,direction:()=>n().direction}}var AP=wt();function li(){const e=EP();return St(AP)||e}var Kc=new Map;function TP(e){const{locale:t}=li(),n=K(()=>t()+(e?Object.entries(e).sort((r,i)=>r[0]<i[0]?-1:1).join():""));return K(()=>{const r=n();let i;return Kc.has(r)&&(i=Kc.get(r)),i||(i=new Intl.Collator(t(),e),Kc.set(r,i)),i})}var dr=class Qb extends Set{constructor(n,r,i){super(n);pe(this,"anchorKey");pe(this,"currentKey");n instanceof Qb?(this.anchorKey=r||n.anchorKey,this.currentKey=i||n.currentKey):(this.anchorKey=r,this.currentKey=i)}};function PP(e){const[t,n]=Xa(e);return[()=>{var i;return(i=t())!=null?i:new dr},n]}function Yb(e){return UT()?e.altKey:e.ctrlKey}function os(e){return Ju()?e.metaKey:e.ctrlKey}function rm(e){return new dr(e)}function jP(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){const t=Re({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=ce(!1),[i,s]=ce(),o=K(()=>{const m=X(t.selectedKeys);return m!=null?rm(m):m}),a=K(()=>{const m=X(t.defaultSelectedKeys);return m!=null?rm(m):new dr}),[l,u]=PP({value:o,defaultValue:a,onChange:m=>{var p;return(p=t.onSelectionChange)==null?void 0:p.call(t,m)}}),[c,d]=ce(X(t.selectionBehavior)),f=()=>X(t.selectionMode),h=()=>{var m;return(m=X(t.disallowEmptySelection))!=null?m:!1},g=m=>{(X(t.allowDuplicateSelectionEvents)||!jP(m,l()))&&u(m)};return xe(()=>{const m=l();X(t.selectionBehavior)==="replace"&&c()==="toggle"&&typeof m=="object"&&m.size===0&&d("replace")}),xe(()=>{var m;d((m=X(t.selectionBehavior))!=null?m:"toggle")}),{selectionMode:f,disallowEmptySelection:h,selectionBehavior:c,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:i,setFocusedKey:s,selectedKeys:l,setSelectedKeys:g}}function $P(e){const[t,n]=ce(""),[r,i]=ce(-1);return{typeSelectHandlers:{onKeyDown:o=>{var f,h,g;if(X(e.isDisabled))return;const a=X(e.keyboardDelegate),l=X(e.selectionManager);if(!a.getKeyForSearch)return;const u=LP(o.key);if(!u||o.ctrlKey||o.metaKey)return;u===" "&&t().trim().length>0&&(o.preventDefault(),o.stopPropagation());let c=n(m=>m+u),d=(f=a.getKeyForSearch(c,l.focusedKey()))!=null?f:a.getKeyForSearch(c);d==null&&DP(c)&&(c=c[0],d=(h=a.getKeyForSearch(c,l.focusedKey()))!=null?h:a.getKeyForSearch(c)),d!=null&&(l.setFocusedKey(d),(g=e.onTypeSelect)==null||g.call(e,d)),clearTimeout(r()),i(window.setTimeout(()=>n(""),500))}}}}function LP(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function DP(e){return e.split("").every(t=>t===e[0])}function IP(e,t,n){const i=Ae({selectOnFocus:()=>X(e.selectionManager).selectionBehavior()==="replace"},e),s=()=>t(),{direction:o}=li();let a={top:0,left:0};LT(()=>X(i.isVirtualized)?void 0:s(),"scroll",()=>{const p=s();p&&(a={top:p.scrollTop,left:p.scrollLeft})});const{typeSelectHandlers:l}=$P({isDisabled:()=>X(i.disallowTypeAhead),keyboardDelegate:()=>X(i.keyboardDelegate),selectionManager:()=>X(i.selectionManager)}),u=()=>{var p;return(p=X(i.orientation))!=null?p:"vertical"},c=p=>{var _,k,E,j,M,B,R,A;nt(p,l.onKeyDown),p.altKey&&p.key==="Tab"&&p.preventDefault();const v=t();if(!(v!=null&&v.contains(p.target)))return;const b=X(i.selectionManager),S=X(i.selectOnFocus),C=P=>{P!=null&&(b.setFocusedKey(P),p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(P):S&&!Yb(p)&&b.replaceSelection(P))},w=X(i.keyboardDelegate),O=X(i.shouldFocusWrap),x=b.focusedKey();switch(p.key){case(u()==="vertical"?"ArrowDown":"ArrowRight"):{if(w.getKeyBelow){p.preventDefault();let P;x!=null?P=w.getKeyBelow(x):P=(_=w.getFirstKey)==null?void 0:_.call(w),P==null&&O&&(P=(k=w.getFirstKey)==null?void 0:k.call(w,x)),C(P)}break}case(u()==="vertical"?"ArrowUp":"ArrowLeft"):{if(w.getKeyAbove){p.preventDefault();let P;x!=null?P=w.getKeyAbove(x):P=(E=w.getLastKey)==null?void 0:E.call(w),P==null&&O&&(P=(j=w.getLastKey)==null?void 0:j.call(w,x)),C(P)}break}case(u()==="vertical"?"ArrowLeft":"ArrowUp"):{if(w.getKeyLeftOf){p.preventDefault();const P=o()==="rtl";let L;x!=null?L=w.getKeyLeftOf(x):L=P?(M=w.getFirstKey)==null?void 0:M.call(w):(B=w.getLastKey)==null?void 0:B.call(w),C(L)}break}case(u()==="vertical"?"ArrowRight":"ArrowDown"):{if(w.getKeyRightOf){p.preventDefault();const P=o()==="rtl";let L;x!=null?L=w.getKeyRightOf(x):L=P?(R=w.getLastKey)==null?void 0:R.call(w):(A=w.getFirstKey)==null?void 0:A.call(w),C(L)}break}case"Home":if(w.getFirstKey){p.preventDefault();const P=w.getFirstKey(x,os(p));P!=null&&(b.setFocusedKey(P),os(p)&&p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(P):S&&b.replaceSelection(P))}break;case"End":if(w.getLastKey){p.preventDefault();const P=w.getLastKey(x,os(p));P!=null&&(b.setFocusedKey(P),os(p)&&p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(P):S&&b.replaceSelection(P))}break;case"PageDown":if(w.getKeyPageBelow&&x!=null){p.preventDefault();const P=w.getKeyPageBelow(x);C(P)}break;case"PageUp":if(w.getKeyPageAbove&&x!=null){p.preventDefault();const P=w.getKeyPageAbove(x);C(P)}break;case"a":os(p)&&b.selectionMode()==="multiple"&&X(i.disallowSelectAll)!==!0&&(p.preventDefault(),b.selectAll());break;case"Escape":p.defaultPrevented||(p.preventDefault(),X(i.disallowEmptySelection)||b.clearSelection());break;case"Tab":if(!X(i.allowsTabNavigation)){if(p.shiftKey)v.focus();else{const P=eP(v,{tabbable:!0});let L,H;do H=P.lastChild(),H&&(L=H);while(H);L&&!L.contains(document.activeElement)&&At(L)}break}}},d=p=>{var C,w,O,x;const v=X(i.selectionManager),b=X(i.keyboardDelegate),S=X(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),S&&v.replaceSelection(E))},k=p.relatedTarget;k&&p.currentTarget.compareDocumentPosition(k)&Node.DOCUMENT_POSITION_FOLLOWING?_((w=v.lastSelectedKey())!=null?w:(C=b.getLastKey)==null?void 0:C.call(b)):_((x=v.firstSelectedKey())!=null?x:(O=b.getFirstKey)==null?void 0:O.call(b))}else if(!X(i.isVirtualized)){const _=s();if(_){_.scrollTop=a.top,_.scrollLeft=a.left;const k=_.querySelector(`[data-key="${v.focusedKey()}"]`);k&&(At(k),nf(_,k))}}}},f=p=>{const v=X(i.selectionManager);p.currentTarget.contains(p.relatedTarget)||v.setFocused(!1)},h=p=>{s()===p.target&&p.preventDefault()},g=()=>{var O,x;const p=X(i.autoFocus);if(!p)return;const v=X(i.selectionManager),b=X(i.keyboardDelegate);let S;p==="first"&&(S=(O=b.getFirstKey)==null?void 0:O.call(b)),p==="last"&&(S=(x=b.getLastKey)==null?void 0:x.call(b));const C=v.selectedKeys();C.size&&(S=C.values().next().value),v.setFocused(!0),v.setFocusedKey(S);const w=t();w&&S==null&&!X(i.shouldUseVirtualFocus)&&At(w)};return Cr(()=>{i.deferAutoFocus?setTimeout(g,0):g()}),xe(Sr([s,()=>X(i.isVirtualized),()=>X(i.selectionManager).focusedKey()],p=>{var C;const[v,b,S]=p;if(b)S&&((C=i.scrollToKey)==null||C.call(i,S));else if(S&&v){const w=v.querySelector(`[data-key="${S}"]`);w&&nf(v,w)}})),{tabIndex:K(()=>{if(!X(i.shouldUseVirtualFocus))return X(i.selectionManager).focusedKey()==null?0:-1}),onKeyDown:c,onMouseDown:h,onFocusIn:d,onFocusOut:f}}function Xb(e,t){const n=()=>X(e.selectionManager),r=()=>X(e.key),i=()=>X(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"||os(b)||"pointerType"in b&&b.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},o=()=>n().isSelected(r()),a=()=>X(e.disabled)||n().isDisabled(r()),l=()=>!a()&&n().canSelectItem(r());let u=null;const c=b=>{l()&&(u=b.pointerType,b.pointerType==="mouse"&&b.button===0&&!X(e.shouldSelectOnPressUp)&&s(b))},d=b=>{l()&&b.pointerType==="mouse"&&b.button===0&&X(e.shouldSelectOnPressUp)&&X(e.allowsDifferentPressOrigin)&&s(b)},f=b=>{l()&&(X(e.shouldSelectOnPressUp)&&!X(e.allowsDifferentPressOrigin)||u!=="mouse")&&s(b)},h=b=>{!l()||!["Enter"," "].includes(b.key)||(Yb(b)?n().toggleSelection(r()):s(b))},g=b=>{a()&&b.preventDefault()},m=b=>{const S=t();i()||a()||!S||b.target===S&&n().setFocusedKey(r())},p=K(()=>{if(!(i()||a()))return r()===n().focusedKey()?0:-1}),v=K(()=>X(e.virtualized)?void 0:r());return xe(Sr([t,r,i,()=>n().focusedKey(),()=>n().isFocused()],([b,S,C,w,O])=>{b&&S===w&&O&&!C&&document.activeElement!==b&&(e.focus?e.focus():At(b))})),{isSelected:o,isDisabled:a,allowsSelection:l,tabIndex:p,dataKey:v,onPointerDown:c,onPointerUp:d,onClick:f,onKeyDown:h,onMouseDown:g,onFocus:m}}var RP=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 dr(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 dr(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 dr([t],t,t):new dr;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode()==="none")return;const t=new dr;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 dr)}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}},im=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 NP(e){const t=MP(e),r=SP({dataSource:()=>X(e.dataSource),getKey:()=>X(e.getKey),getTextValue:()=>X(e.getTextValue),getDisabled:()=>X(e.getDisabled),getSectionChildren:()=>X(e.getSectionChildren),factory:s=>e.filter?new im(e.filter(s)):new im(s)},[()=>e.filter]),i=new RP(r,t);return Zp(()=>{const s=t.focusedKey();s!=null&&!r().getItem(s)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>i}}var Et=e=>typeof e=="function"?e():e,FP=e=>{const t=K(()=>{const o=Et(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]=ce(Et(e.show)?"present":"hidden");let s="none";return xe(o=>{const a=Et(e.show);return at(()=>{var c;if(o===a)return a;const l=s,u=n();a?i("present"):u==="none"||((c=t())==null?void 0:c.display)==="none"?i("hidden"):i(o===!0&&l!==u?"hiding":"hidden")}),a}),xe(()=>{const o=Et(e.element);if(!o)return;const a=u=>{u.target===o&&(s=n())},l=u=>{const d=n().includes(u.animationName);u.target===o&&d&&r()==="hiding"&&i("hidden")};o.addEventListener("animationstart",a),o.addEventListener("animationcancel",l),o.addEventListener("animationend",l),_e(()=>{o.removeEventListener("animationstart",a),o.removeEventListener("animationcancel",l),o.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r}},BP=FP,Zb=BP,yu="data-kb-top-layer",Jb,sf=!1,_r=[];function va(e){return _r.findIndex(t=>t.node===e)}function qP(e){return _r[va(e)]}function zP(e){return _r[_r.length-1].node===e}function e1(){return _r.filter(e=>e.isPointerBlocking)}function HP(){return[...e1()].slice(-1)[0]}function oh(){return e1().length>0}function t1(e){var n;const t=va((n=HP())==null?void 0:n.node);return va(e)<t}function UP(e){_r.push(e)}function GP(e){const t=va(e);t<0||_r.splice(t,1)}function KP(){for(const{node:e}of _r)e.style.pointerEvents=t1(e)?"none":"auto"}function VP(e){if(oh()&&!sf){const t=tr(e);Jb=document.body.style.pointerEvents,t.body.style.pointerEvents="none",sf=!0}}function WP(e){if(oh())return;const t=tr(e);t.body.style.pointerEvents=Jb,t.body.style.length===0&&t.body.removeAttribute("style"),sf=!1}var Wt={layers:_r,isTopMostLayer:zP,hasPointerBlockingLayer:oh,isBelowPointerBlockingLayer:t1,addLayer:UP,removeLayer:GP,indexOf:va,find:qP,assignPointerEventToLayers:KP,disableBodyPointerEvents:VP,restoreBodyPointerEvents:WP},QP={};tc(QP,{Button:()=>ZP,Root:()=>ah});var YP=["button","color","file","image","reset","submit"];function XP(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?YP.indexOf(e.type)!==-1:!1}function ah(e){let t;const n=Re({type:"button"},e),[r,i]=Ve(n,["ref","type","disabled"]),s=ec(()=>t,()=>"button"),o=K(()=>{const u=s();return u==null?!1:XP({tagName:u,type:r.type})}),a=K(()=>s()==="input"),l=K(()=>s()==="a"&&(t==null?void 0:t.getAttribute("href"))!=null);return D(st,Ae({as:"button",ref(u){const c=It(d=>t=d,r.ref);typeof c=="function"&&c(u)},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 ZP=ah,JP=["top","right","bottom","left"],Jn=Math.min,an=Math.max,mu=Math.round,Al=Math.floor,ti=e=>({x:e,y:e}),ej={left:"right",right:"left",bottom:"top",top:"bottom"},tj={start:"end",end:"start"};function of(e,t,n){return an(e,Jn(t,n))}function Xi(e,t){return typeof e=="function"?e(t):e}function ni(e){return e.split("-")[0]}function so(e){return e.split("-")[1]}function n1(e){return e==="x"?"y":"x"}function lh(e){return e==="y"?"height":"width"}function Ui(e){return["top","bottom"].includes(ni(e))?"y":"x"}function uh(e){return n1(Ui(e))}function nj(e,t,n){n===void 0&&(n=!1);const r=so(e),i=uh(e),s=lh(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=pu(o)),[o,pu(o)]}function rj(e){const t=pu(e);return[af(e),t,af(t)]}function af(e){return e.replace(/start|end/g,t=>tj[t])}function ij(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 sj(e,t,n,r){const i=so(e);let s=ij(ni(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(af)))),s}function pu(e){return e.replace(/left|right|bottom|top/g,t=>ej[t])}function oj(e){return{top:0,right:0,bottom:0,left:0,...e}}function r1(e){return typeof e!="number"?oj(e):{top:e,right:e,bottom:e,left:e}}function vu(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 sm(e,t,n){let{reference:r,floating:i}=e;const s=Ui(t),o=uh(t),a=lh(o),l=ni(t),u=s==="y",c=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:c,y:r.y-i.height};break;case"bottom":h={x:c,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(so(t)){case"start":h[o]-=f*(n&&u?-1:1);break;case"end":h[o]+=f*(n&&u?-1:1);break}return h}var aj=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 u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=sm(u,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:S,data:C,reset:w}=await v({x:c,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:h,rects:u,platform:o,elements:{reference:e,floating:t}});c=b!=null?b:c,d=S!=null?S:d,h={...h,[p]:{...h[p],...C}},w&&g<=50&&(g++,typeof w=="object"&&(w.placement&&(f=w.placement),w.rects&&(u=w.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):w.rects),{x:c,y:d}=sm(u,f,l)),m=-1)}return{x:c,y:d,placement:f,strategy:i,middlewareData:h}};async function ba(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Xi(t,e),g=r1(h),p=a[f?d==="floating"?"reference":"floating":d],v=vu(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:u,rootBoundary:c,strategy:l})),b=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(S))?await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1}:{x:1,y:1},w=vu(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:S,strategy:l}):b);return{top:(v.top-w.top+g.top)/C.y,bottom:(w.bottom-v.bottom+g.bottom)/C.y,left:(v.left-w.left+g.left)/C.x,right:(w.right-v.right+g.right)/C.x}}var lj=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:u,padding:c=0}=Xi(e,t)||{};if(u==null)return{};const d=r1(c),f={x:n,y:r},h=uh(i),g=lh(h),m=await o.getDimensions(u),p=h==="y",v=p?"top":"left",b=p?"bottom":"right",S=p?"clientHeight":"clientWidth",C=s.reference[g]+s.reference[h]-f[h]-s.floating[g],w=f[h]-s.reference[h],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let x=O?O[S]:0;(!x||!await(o.isElement==null?void 0:o.isElement(O)))&&(x=a.floating[S]||s.floating[g]);const _=C/2-w/2,k=x/2-m[g]/2-1,E=Jn(d[v],k),j=Jn(d[b],k),M=E,B=x-m[g]-j,R=x/2-m[g]/2+_,A=of(M,R,B),P=!l.arrow&&so(i)!=null&&R!==A&&s.reference[g]/2-(R<M?E:j)-m[g]/2<0,L=P?R<M?R-M:R-B:0;return{[h]:f[h]+L,data:{[h]:A,centerOffset:R-A-L,...P&&{alignmentOffset:L}},reset:P}}}),uj=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:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...p}=Xi(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=ni(i),b=Ui(a),S=ni(a)===a,C=await(l.isRTL==null?void 0:l.isRTL(u.floating)),w=f||(S||!m?[pu(a)]:rj(a)),O=g!=="none";!f&&O&&w.push(...sj(a,m,g,C));const x=[a,...w],_=await ba(t,p),k=[];let E=((r=s.flip)==null?void 0:r.overflows)||[];if(c&&k.push(_[v]),d){const R=nj(i,o,C);k.push(_[R[0]],_[R[1]])}if(E=[...E,{placement:i,overflows:k}],!k.every(R=>R<=0)){var j,M;const R=(((j=s.flip)==null?void 0:j.index)||0)+1,A=x[R];if(A)return{data:{index:R,overflows:E},reset:{placement:A}};let P=(M=E.filter(L=>L.overflows[0]<=0).sort((L,H)=>L.overflows[1]-H.overflows[1])[0])==null?void 0:M.placement;if(!P)switch(h){case"bestFit":{var B;const L=(B=E.filter(H=>{if(O){const G=Ui(H.placement);return G===b||G==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(G=>G>0).reduce((G,F)=>G+F,0)]).sort((H,G)=>H[1]-G[1])[0])==null?void 0:B[0];L&&(P=L);break}case"initialPlacement":P=a;break}if(i!==P)return{reset:{placement:P}}}return{}}}};function om(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function am(e){return JP.some(t=>e[t]>=0)}var cj=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Xi(e,t);switch(r){case"referenceHidden":{const s=await ba(t,{...i,elementContext:"reference"}),o=om(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:am(o)}}}case"escaped":{const s=await ba(t,{...i,altBoundary:!0}),o=om(s,n.floating);return{data:{escapedOffsets:o,escaped:am(o)}}}default:return{}}}}};async function dj(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ni(n),a=so(n),l=Ui(n)==="y",u=["left","top"].includes(o)?-1:1,c=s&&l?-1:1,d=Xi(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*c,y:f*u}:{x:f*u,y:h*c}}var fj=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 dj(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}}}}},hj=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}=Xi(e,t),u={x:n,y:r},c=await ba(t,l),d=Ui(ni(i)),f=n1(d);let h=u[f],g=u[d];if(s){const p=f==="y"?"top":"left",v=f==="y"?"bottom":"right",b=h+c[p],S=h-c[v];h=of(b,h,S)}if(o){const p=d==="y"?"top":"left",v=d==="y"?"bottom":"right",b=g+c[p],S=g-c[v];g=of(b,g,S)}const m=a.fn({...t,[f]:h,[d]:g});return{...m,data:{x:m.x-n,y:m.y-r}}}}},gj=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}=Xi(e,t),l=await ba(t,a),u=ni(n),c=so(n),d=Ui(n)==="y",{width:f,height:h}=r.floating;let g,m;u==="top"||u==="bottom"?(g=u,m=c===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(m=u,g=c==="end"?"top":"bottom");const p=h-l.top-l.bottom,v=f-l.left-l.right,b=Jn(h-l[g],p),S=Jn(f-l[m],v),C=!t.middlewareData.shift;let w=b,O=S;if(d?O=c||C?Jn(S,v):v:w=c||C?Jn(b,p):p,C&&!c){const _=an(l.left,0),k=an(l.right,0),E=an(l.top,0),j=an(l.bottom,0);d?O=f-2*(_!==0||k!==0?_+k:an(l.left,l.right)):w=h-2*(E!==0||j!==0?E+j:an(l.top,l.bottom))}await o({...t,availableWidth:O,availableHeight:w});const x=await i.getDimensions(s.floating);return f!==x.width||h!==x.height?{reset:{rects:!0}}:{}}}};function oo(e){return i1(e)?(e.nodeName||"").toLowerCase():"#document"}function cn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Er(e){var t;return(t=(i1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function i1(e){return e instanceof Node||e instanceof cn(e).Node}function Ln(e){return e instanceof Element||e instanceof cn(e).Element}function nr(e){return e instanceof HTMLElement||e instanceof cn(e).HTMLElement}function lm(e){return typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof cn(e).ShadowRoot}function Za(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Dn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function yj(e){return["table","td","th"].includes(oo(e))}function nc(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(n){return!1}})}function ch(e){const t=dh(),n=Ln(e)?Dn(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 mj(e){let t=ri(e);for(;nr(t)&&!Ys(t);){if(ch(t))return t;if(nc(t))return null;t=ri(t)}return null}function dh(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ys(e){return["html","body","#document"].includes(oo(e))}function Dn(e){return cn(e).getComputedStyle(e)}function rc(e){return Ln(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ri(e){if(oo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||lm(e)&&e.host||Er(e);return lm(t)?t.host:t}function s1(e){const t=ri(e);return Ys(t)?e.ownerDocument?e.ownerDocument.body:e.body:nr(t)&&Za(t)?t:s1(t)}function xa(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=s1(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=cn(i);return s?t.concat(o,o.visualViewport||[],Za(i)?i:[],o.frameElement&&n?xa(o.frameElement):[]):t.concat(i,xa(i,[],n))}function o1(e){const t=Dn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=nr(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,a=mu(n)!==s||mu(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function fh(e){return Ln(e)?e:e.contextElement}function gs(e){const t=fh(e);if(!nr(t))return ti(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=o1(t);let o=(s?mu(n.width):n.width)/r,a=(s?mu(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}var pj=ti(0);function a1(e){const t=cn(e);return!dh()||!t.visualViewport?pj:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function vj(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==cn(e)?!1:t}function Gi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=fh(e);let o=ti(1);t&&(r?Ln(r)&&(o=gs(r)):o=gs(e));const a=vj(s,n,r)?a1(s):ti(0);let l=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,c=i.width/o.x,d=i.height/o.y;if(s){const f=cn(s),h=r&&Ln(r)?cn(r):r;let g=f,m=g.frameElement;for(;m&&r&&h!==g;){const p=gs(m),v=m.getBoundingClientRect(),b=Dn(m),S=v.left+(m.clientLeft+parseFloat(b.paddingLeft))*p.x,C=v.top+(m.clientTop+parseFloat(b.paddingTop))*p.y;l*=p.x,u*=p.y,c*=p.x,d*=p.y,l+=S,u+=C,g=cn(m),m=g.frameElement}}return vu({width:c,height:d,x:l,y:u})}function bj(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",o=Er(r),a=t?nc(t.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=ti(1);const c=ti(0),d=nr(r);if((d||!d&&!s)&&((oo(r)!=="body"||Za(o))&&(l=rc(r)),nr(r))){const f=Gi(r);u=gs(r),c.x=f.x+r.clientLeft,c.y=f.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x,y:n.y*u.y-l.scrollTop*u.y+c.y}}function xj(e){return Array.from(e.getClientRects())}function l1(e){return Gi(Er(e)).left+rc(e).scrollLeft}function wj(e){const t=Er(e),n=rc(e),r=e.ownerDocument.body,i=an(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=an(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+l1(e);const a=-n.scrollTop;return Dn(r).direction==="rtl"&&(o+=an(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function Sj(e,t){const n=cn(e),r=Er(e),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const u=dh();(!u||u&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function Cj(e,t){const n=Gi(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=nr(e)?gs(e):ti(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:o,height:a,x:l,y:u}}function um(e,t,n){let r;if(t==="viewport")r=Sj(e,n);else if(t==="document")r=wj(Er(e));else if(Ln(t))r=Cj(t,n);else{const i=a1(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return vu(r)}function u1(e,t){const n=ri(e);return n===t||!Ln(n)||Ys(n)?!1:Dn(n).position==="fixed"||u1(n,t)}function _j(e,t){const n=t.get(e);if(n)return n;let r=xa(e,[],!1).filter(a=>Ln(a)&&oo(a)!=="body"),i=null;const s=Dn(e).position==="fixed";let o=s?ri(e):e;for(;Ln(o)&&!Ys(o);){const a=Dn(o),l=ch(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Za(o)&&!l&&u1(e,o))?r=r.filter(c=>c!==o):i=a,o=ri(o)}return t.set(e,r),r}function kj(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?nc(t)?[]:_j(t,this._c):[].concat(n),r],a=o[0],l=o.reduce((u,c)=>{const d=um(t,c,i);return u.top=an(d.top,u.top),u.right=Jn(d.right,u.right),u.bottom=Jn(d.bottom,u.bottom),u.left=an(d.left,u.left),u},um(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Oj(e){const{width:t,height:n}=o1(e);return{width:t,height:n}}function Ej(e,t,n){const r=nr(t),i=Er(t),s=n==="fixed",o=Gi(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=ti(0);if(r||!r&&!s)if((oo(t)!=="body"||Za(i))&&(a=rc(t)),r){const d=Gi(t,!0,s,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&(l.x=l1(i));const u=o.left+a.scrollLeft-l.x,c=o.top+a.scrollTop-l.y;return{x:u,y:c,width:o.width,height:o.height}}function Vc(e){return Dn(e).position==="static"}function cm(e,t){return!nr(e)||Dn(e).position==="fixed"?null:t?t(e):e.offsetParent}function c1(e,t){const n=cn(e);if(nc(e))return n;if(!nr(e)){let i=ri(e);for(;i&&!Ys(i);){if(Ln(i)&&!Vc(i))return i;i=ri(i)}return n}let r=cm(e,t);for(;r&&yj(r)&&Vc(r);)r=cm(r,t);return r&&Ys(r)&&Vc(r)&&!ch(r)?n:r||mj(e)||n}var Aj=async function(e){const t=this.getOffsetParent||c1,n=this.getDimensions,r=await n(e.floating);return{reference:Ej(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Tj(e){return Dn(e).direction==="rtl"}var d1={convertOffsetParentRelativeRectToViewportRelativeRect:bj,getDocumentElement:Er,getClippingRect:kj,getOffsetParent:c1,getElementRects:Aj,getClientRects:xj,getDimensions:Oj,getScale:gs,isElement:Ln,isRTL:Tj};function Pj(e,t){let n=null,r;const i=Er(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:u,top:c,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const h=Al(c),g=Al(i.clientWidth-(u+d)),m=Al(i.clientHeight-(c+f)),p=Al(u),b={rootMargin:-h+"px "+-g+"px "+-m+"px "+-p+"px",threshold:an(0,Jn(1,l))||1};let S=!0;function C(w){const O=w[0].intersectionRatio;if(O!==l){if(!S)return o();O?o(!1,O):r=setTimeout(()=>{o(!1,1e-7)},1e3)}S=!1}try{n=new IntersectionObserver(C,{...b,root:i.ownerDocument})}catch(w){n=new IntersectionObserver(C,b)}n.observe(e)}return o(!0),s}function jj(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,u=fh(e),c=i||s?[...u?xa(u):[],...xa(t)]:[];c.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const d=u&&a?Pj(u,n):null;let f=-1,h=null;o&&(h=new ResizeObserver(v=>{let[b]=v;b&&b.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var S;(S=h)==null||S.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let g,m=l?Gi(e):null;l&&p();function p(){const v=Gi(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;c.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 Mj=fj,$j=hj,Lj=uj,Dj=gj,Ij=cj,Rj=lj,Nj=(e,t,n)=>{const r=new Map,i={platform:d1,...n},s={...i.platform,_c:r};return aj(e,t,{...i,platform:s})},hh=wt();function gh(){const e=St(hh);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var Fj=he('<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">'),lf=30,dm=lf/2,Bj={top:180,right:-90,bottom:0,left:90};function yh(e){const t=gh(),n=Re({size:lf},e),[r,i]=Ve(n,["ref","style","size"]),s=()=>t.currentPlacement().split("-")[0],o=qj(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"},u=()=>{var f;return((f=o())==null?void 0:f.getPropertyValue(`border-${s()}-width`))||"0px"},c=()=>Number.parseInt(u())*2*(lf/r.size),d=()=>`rotate(${Bj[s()]} ${dm} ${dm}) translate(0 2)`;return D(st,Ae({as:"div",ref(f){const h=It(t.setArrowRef,r.ref);typeof h=="function"&&h(f)},"aria-hidden":"true",get style(){return Zu({position:"absolute","font-size":`${r.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:a(),stroke:l(),"stroke-width":c()},r.style)}},i,{get children(){const f=Fj(),h=f.firstChild;return be(()=>re(h,"transform",d())),f}}))}function qj(e){const[t,n]=ce();return xe(()=>{const r=e();r&&n(BT(r).getComputedStyle(r))}),t}function zj(e){const t=gh(),[n,r]=Ve(e,["ref","style"]);return D(st,Ae({as:"div",ref(i){const s=It(t.setPositionerRef,n.ref);typeof s=="function"&&s(i)},"data-popper-positioner":"",get style(){return Zu({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}function fm(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 Hj(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?fm(r):e?e.getBoundingClientRect():fm()}}}function Uj(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var Gj={top:"bottom",right:"left",bottom:"top",left:"right"};function Kj(e,t){const[n,r]=e.split("-"),i=Gj[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 Vj(e){const t=Re({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]=ce(),[i,s]=ce(),[o,a]=ce(t.placement),l=()=>{var f;return Hj((f=t.anchorRef)==null?void 0:f.call(t),t.getAnchorRect)},{direction:u}=li();async function c(){var O,x,_;const f=l(),h=n(),g=i();if(!f||!h)return;const m=((g==null?void 0:g.clientHeight)||0)/2,p=typeof t.gutter=="number"?t.gutter+m:(O=t.gutter)!=null?O:m;h.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),f.getBoundingClientRect();const v=[Mj(({placement:k})=>{const E=!!k.split("-")[1];return{mainAxis:p,crossAxis:E?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const k=typeof t.flip=="string"?t.flip.split(" "):void 0;if(k!==void 0&&!k.every(Uj))throw new Error("`flip` expects a spaced-delimited list of placements");v.push(Lj({padding:t.overflowPadding,fallbackPlacements:k}))}(t.slide||t.overlap)&&v.push($j({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),v.push(Dj({padding:t.overflowPadding,apply({availableWidth:k,availableHeight:E,rects:j}){const M=Math.round(j.reference.width);k=Math.floor(k),E=Math.floor(E),h.style.setProperty("--kb-popper-anchor-width",`${M}px`),h.style.setProperty("--kb-popper-content-available-width",`${k}px`),h.style.setProperty("--kb-popper-content-available-height",`${E}px`),t.sameWidth&&(h.style.width=`${M}px`),t.fitViewport&&(h.style.maxWidth=`${k}px`,h.style.maxHeight=`${E}px`)}})),t.hideWhenDetached&&v.push(Ij({padding:t.detachedPadding})),g&&v.push(Rj({element:g,padding:t.arrowPadding}));const b=await Nj(f,h,{placement:t.placement,strategy:"absolute",middleware:v,platform:{...d1,isRTL:()=>u()==="rtl"}});if(a(b.placement),(x=t.onCurrentPlacementChange)==null||x.call(t,b.placement),!h)return;h.style.setProperty("--kb-popper-content-transform-origin",Kj(b.placement,u()));const S=Math.round(b.x),C=Math.round(b.y);let w;if(t.hideWhenDetached&&(w=(_=b.middlewareData.hide)!=null&&_.referenceHidden?"hidden":"visible"),Object.assign(h.style,{top:"0",left:"0",transform:`translate3d(${S}px, ${C}px, 0)`,visibility:w}),g&&b.middlewareData.arrow){const{x:k,y:E}=b.middlewareData.arrow,j=b.placement.split("-")[0];Object.assign(g.style,{left:k!=null?`${k}px`:"",top:E!=null?`${E}px`:"",[j]:"100%"})}}xe(()=>{const f=l(),h=n();if(!f||!h)return;const g=jj(f,h,c,{elementResize:typeof ResizeObserver=="function"});_e(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 D(hh.Provider,{value:d,get children(){return t.children}})}var f1=Object.assign(Vj,{Arrow:yh,Context:hh,usePopperContext:gh,Positioner:zj});function Wj(e){const t=n=>{var r;n.key===nh.Escape&&((r=e.onEscapeKeyDown)==null||r.call(e,n))};xe(()=>{var r,i;if(X(e.isDisabled))return;const n=(i=(r=e.ownerDocument)==null?void 0:r.call(e))!=null?i:tr();n.addEventListener("keydown",t),_e(()=>{n.removeEventListener("keydown",t)})})}var hm="interactOutside.pointerDownOutside",gm="interactOutside.focusOutside";function Qj(e,t){let n,r=nP;const i=()=>tr(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(`[${yu}]`)||!Sn(i(),f)||Sn(t(),f)?!1:!((h=e.shouldExcludeElement)!=null&&h.call(e,f))},u=d=>{function f(){const h=t(),g=d.target;if(!h||!g||!l(d))return;const m=vt([s,a]);g.addEventListener(hm,m,{once:!0});const p=new CustomEvent(hm,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||GT(d)&&d.button===0}});g.dispatchEvent(p)}d.pointerType==="touch"?(i().removeEventListener("click",f),r=f,i().addEventListener("click",f,{once:!0})):f()},c=d=>{const f=t(),h=d.target;if(!f||!h||!l(d))return;const g=vt([o,a]);h.addEventListener(gm,g,{once:!0});const m=new CustomEvent(gm,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});h.dispatchEvent(m)};xe(()=>{X(e.isDisabled)||(n=window.setTimeout(()=>{i().addEventListener("pointerdown",u,!0)},0),i().addEventListener("focusin",c,!0),_e(()=>{window.clearTimeout(n),i().removeEventListener("click",r),i().removeEventListener("pointerdown",u,!0),i().removeEventListener("focusin",c,!0)}))})}var h1=wt();function Yj(){return St(h1)}function Xj(e){let t;const n=Yj(),[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()}};Qj({shouldExcludeElement:d=>{var f;return t?((f=r.excludedElements)==null?void 0:f.some(h=>Sn(h(),d)))||[...s].some(h=>Sn(h,d)):!1},onPointerDownOutside:d=>{var f,h,g;!t||Wt.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!Wt.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),Wj({ownerDocument:()=>tr(t),onEscapeKeyDown:d=>{var f;!t||!Wt.isTopMostLayer(t)||((f=r.onEscapeKeyDown)==null||f.call(r,d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),Cr(()=>{if(!t)return;Wt.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n==null?void 0:n.registerNestedLayer(t);Wt.assignPointerEventToLayers(),Wt.disableBodyPointerEvents(t),_e(()=>{t&&(Wt.removeLayer(t),d==null||d(),Wt.assignPointerEventToLayers(),Wt.restoreBodyPointerEvents(t))})}),xe(Sr([()=>t,()=>r.disableOutsidePointerEvents],([d,f])=>{if(!d)return;const h=Wt.find(d);h&&h.isPointerBlocking!==f&&(h.isPointerBlocking=f,Wt.assignPointerEventToLayers()),f&&Wt.disableBodyPointerEvents(d),_e(()=>{Wt.restoreBodyPointerEvents(d)})},{defer:!0}));const c={registerNestedLayer:o};return D(h1.Provider,{value:c,get children(){return D(st,Ae({as:"div",ref(d){const f=It(h=>t=h,r.ref);typeof f=="function"&&f(d)}},i))}})}function g1(e={}){const[t,n]=zb({value:()=>X(e.open),defaultValue:()=>!!X(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 pn={};tc(pn,{Description:()=>Bb,ErrorMessage:()=>qb,Item:()=>v1,ItemControl:()=>b1,ItemDescription:()=>x1,ItemIndicator:()=>w1,ItemInput:()=>S1,ItemLabel:()=>C1,Label:()=>_1,RadioGroup:()=>Zj,Root:()=>k1});var y1=wt();function m1(){const e=St(y1);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupContext` must be used within a `RadioGroup` component");return e}var p1=wt();function Ja(){const e=St(p1);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupItemContext` must be used within a `RadioGroup.Item` component");return e}function v1(e){const t=Ya(),n=m1(),r=`${t.generateId("item")}-${On()}`,i=Re({id:r},e),[s,o]=Ve(i,["value","disabled","onPointerDown"]),[a,l]=ce(),[u,c]=ce(),[d,f]=ce(),[h,g]=ce(),[m,p]=ce(!1),v=K(()=>n.isSelectedValue(s.value)),b=K(()=>s.disabled||t.isDisabled()||!1),S=O=>{nt(O,s.onPointerDown),m()&&O.preventDefault()},C=K(()=>({...t.dataset(),"data-disabled":b()?"":void 0,"data-checked":v()?"":void 0})),w={value:()=>s.value,dataset:C,isSelected:v,isDisabled:b,inputId:a,labelId:u,descriptionId:d,inputRef:h,select:()=>n.setSelectedValue(s.value),generateId:Qa(()=>o.id),registerInput:Cn(l),registerLabel:Cn(c),registerDescription:Cn(f),setIsFocused:p,setInputRef:g};return D(p1.Provider,{value:w,get children(){return D(st,Ae({as:"div",role:"group",onPointerDown:S},C,o))}})}function b1(e){const t=Ja(),n=Re({id:t.generateId("control")},e),[r,i]=Ve(n,["onClick","onKeyDown"]);return D(st,Ae({as:"div",onClick:a=>{var l;nt(a,r.onClick),t.select(),(l=t.inputRef())==null||l.focus()},onKeyDown:a=>{var l;nt(a,r.onKeyDown),a.key===nh.Space&&(t.select(),(l=t.inputRef())==null||l.focus())}},()=>t.dataset(),i))}function x1(e){const t=Ja(),n=Re({id:t.generateId("description")},e);return xe(()=>_e(t.registerDescription(n.id))),D(st,Ae({as:"div"},()=>t.dataset(),n))}function w1(e){const t=Ja(),n=Re({id:t.generateId("indicator")},e),[r,i]=Ve(n,["ref","forceMount"]),[s,o]=ce(),{present:a}=Zb({show:()=>r.forceMount||t.isSelected(),element:()=>{var l;return(l=s())!=null?l:null}});return D(ve,{get when(){return a()},get children(){return D(st,Ae({as:"div",ref(l){const u=It(o,r.ref);typeof u=="function"&&u(l)}},()=>t.dataset(),i))}})}function S1(e){const t=Ya(),n=m1(),r=Ja(),i=Re({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,[u,c]=ce(!1),d=g=>{if(nt(g,s.onChange),g.stopPropagation(),!u()){n.setSelectedValue(r.value());const m=g.target;m.checked=r.isSelected()}c(!1)},f=g=>{nt(g,s.onFocus),r.setIsFocused(!0)},h=g=>{nt(g,s.onBlur),r.setIsFocused(!1)};return xe(Sr([()=>r.isSelected(),()=>r.value()],g=>{if(!g[0]&&g[1]===r.value())return;c(!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(()=>_e(r.registerInput(o.id))),D(st,Ae({as:"input",ref(g){const m=It(r.setInputRef,s.ref);typeof m=="function"&&m(g)},type:"radio",get name(){return t.name()},get value(){return r.value()},get checked(){return r.isSelected()},get required(){return t.isRequired()},get disabled(){return r.isDisabled()},get readonly(){return t.isReadOnly()},get style(){return Zu({...Nb},s.style)},get"aria-labelledby"(){return a()},get"aria-describedby"(){return l()},onChange:d,onFocus:f,onBlur:h},()=>r.dataset(),o))}function C1(e){const t=Ja(),n=Re({id:t.generateId("label")},e);return xe(()=>_e(t.registerLabel(n.id))),D(st,Ae({as:"label",get for(){return t.inputId()}},()=>t.dataset(),n))}function _1(e){return D(aP,Ae({as:"span"},e))}function k1(e){let t;const n=`radiogroup-${On()}`,r=Re({id:n,orientation:"vertical"},e),[i,s,o]=Ve(r,["ref","value","defaultValue","onChange","orientation","aria-labelledby","aria-describedby"],sP),[a,l]=Xa({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:g=>{var m;return(m=i.onChange)==null?void 0:m.call(i,g)}}),{formControlContext:u}=oP(s);lP(()=>t,()=>{var g;return l((g=i.defaultValue)!=null?g:"")});const c=()=>u.getAriaLabelledBy(X(s.id),o["aria-label"],i["aria-labelledby"]),d=()=>u.getAriaDescribedBy(i["aria-describedby"]),f=g=>g===a(),h={ariaDescribedBy:d,isSelectedValue:f,setSelectedValue:g=>{if(!(u.isReadOnly()||u.isDisabled())&&(l(g),t))for(const m of t.querySelectorAll("[type='radio']")){const p=m;p.checked=f(p.value)}}};return D(Fb.Provider,{value:u,get children(){return D(y1.Provider,{value:h,get children(){return D(st,Ae({as:"div",ref(g){const m=It(p=>t=p,i.ref);typeof m=="function"&&m(g)},role:"radiogroup",get id(){return X(s.id)},get"aria-invalid"(){return u.validationState()==="invalid"||void 0},get"aria-required"(){return u.isRequired()||void 0},get"aria-disabled"(){return u.isDisabled()||void 0},get"aria-readonly"(){return u.isReadOnly()||void 0},get"aria-orientation"(){return i.orientation},get"aria-labelledby"(){return c()},get"aria-describedby"(){return d()}},()=>u.dataset(),o))}})}})}var Zj=Object.assign(k1,{Description:Bb,ErrorMessage:qb,Item:v1,ItemControl:b1,ItemDescription:x1,ItemIndicator:w1,ItemInput:S1,ItemLabel:C1,Label:_1}),Jj=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 eM(e,t,n){const r=TP({usage:"search",sensitivity:"base"}),i=K(()=>{const s=X(e.keyboardDelegate);return s||new Jj(e.collection,t,r)});return IP({selectionManager:()=>X(e.selectionManager),keyboardDelegate:i,autoFocus:()=>X(e.autoFocus),deferAutoFocus:()=>X(e.deferAutoFocus),shouldFocusWrap:()=>X(e.shouldFocusWrap),disallowEmptySelection:()=>X(e.disallowEmptySelection),selectOnFocus:()=>X(e.selectOnFocus),disallowTypeAhead:()=>X(e.disallowTypeAhead),shouldUseVirtualFocus:()=>X(e.shouldUseVirtualFocus),allowsTabNavigation:()=>X(e.allowsTabNavigation),isVirtualized:()=>X(e.isVirtualized),scrollToKey:s=>{var o;return(o=X(e.scrollToKey))==null?void 0:o(s)},orientation:()=>X(e.orientation)},t)}var Wc="focusScope.autoFocusOnMount",Qc="focusScope.autoFocusOnUnmount",ym={bubbles:!1,cancelable:!0},mm={stack:[],active(){return this.stack[0]},add(e){var t;e!==this.active()&&((t=this.active())==null||t.pause()),this.stack=tf(this.stack,e),this.stack.unshift(e)},remove(e){var t;this.stack=tf(this.stack,e),(t=this.active())==null||t.resume()}};function tM(e,t){const[n,r]=ce(!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=()=>tr(t()),u=()=>{const g=l().createElement("span");return g.setAttribute("data-focus-trap",""),g.tabIndex=0,Object.assign(g.style,Nb),g},c=()=>{const g=t();return g?Ib(g,!0).filter(m=>!m.hasAttribute("data-focus-trap")):[]},d=()=>{const g=c();return g.length>0?g[0]:null},f=()=>{const g=c();return g.length>0?g[g.length-1]:null},h=()=>{const g=t();if(!g)return!1;const m=Fo(g);return!m||Sn(g,m)?!1:Rb(m)};xe(()=>{const g=t();if(!g)return;mm.add(i);const m=Fo(g);if(!Sn(g,m)){const v=new CustomEvent(Wc,ym);g.addEventListener(Wc,o),g.dispatchEvent(v),v.defaultPrevented||setTimeout(()=>{At(d()),Fo(g)===m&&At(g)},0)}_e(()=>{g.removeEventListener(Wc,o),setTimeout(()=>{const v=new CustomEvent(Qc,ym);h()&&v.preventDefault(),g.addEventListener(Qc,a),g.dispatchEvent(v),v.defaultPrevented||At(m!=null?m:l().body),g.removeEventListener(Qc,a),mm.remove(i)},0)})}),xe(()=>{const g=t();if(!g||!X(e.trapFocus)||n())return;const m=v=>{const b=v.target;b!=null&&b.closest(`[${yu}]`)||(Sn(g,b)?s=b:At(s))},p=v=>{const b=v.relatedTarget,S=b!=null?b:Fo(g);S!=null&&S.closest(`[${yu}]`)||Sn(g,S)||At(s)};l().addEventListener("focusin",m),l().addEventListener("focusout",p),_e(()=>{l().removeEventListener("focusin",m),l().removeEventListener("focusout",p)})}),xe(()=>{const g=t();if(!g||!X(e.trapFocus)||n())return;const m=u();g.insertAdjacentElement("afterbegin",m);const p=u();g.insertAdjacentElement("beforeend",p);function v(S){const C=d(),w=f();S.relatedTarget===C?At(w):At(C)}m.addEventListener("focusin",v),p.addEventListener("focusin",v);const b=new MutationObserver(S=>{for(const C of S)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}),_e(()=>{m.removeEventListener("focusin",v),p.removeEventListener("focusin",v),m.remove(),p.remove(),b.disconnect()})})}var nM="data-live-announcer";function rM(e){xe(()=>{X(e.isDisabled)||_e(iM(X(e.targets),X(e.root)))})}var Eo=new WeakMap,mn=[];function iM(e,t=document.body){const n=new Set(e),r=new Set,i=l=>{for(const f of l.querySelectorAll(`[${nM}], [${yu}]`))n.add(f);const u=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},c=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:u}),d=u(l);if(d===NodeFilter.FILTER_ACCEPT&&s(l),d!==NodeFilter.FILTER_REJECT){let f=c.nextNode();for(;f!=null;)s(f),f=c.nextNode()}},s=l=>{var c;const u=(c=Eo.get(l))!=null?c:0;l.getAttribute("aria-hidden")==="true"&&u===0||(u===0&&l.setAttribute("aria-hidden","true"),r.add(l),Eo.set(l,u+1))};mn.length&&mn[mn.length-1].disconnect(),i(t);const o=new MutationObserver(l=>{for(const u of l)if(!(u.type!=="childList"||u.addedNodes.length===0)&&![...n,...r].some(c=>c.contains(u.target))){for(const c of u.removedNodes)c instanceof Element&&(n.delete(c),r.delete(c));for(const c of u.addedNodes)(c instanceof HTMLElement||c instanceof SVGElement)&&(c.dataset.liveAnnouncer==="true"||c.dataset.reactAriaTopLayer==="true")?n.add(c):c instanceof Element&&i(c)}});o.observe(t,{childList:!0,subtree:!0});const a={observe(){o.observe(t,{childList:!0,subtree:!0})},disconnect(){o.disconnect()}};return mn.push(a),()=>{o.disconnect();for(const l of r){const u=Eo.get(l);if(u==null)return;u===1?(l.removeAttribute("aria-hidden"),Eo.delete(l)):Eo.set(l,u-1)}a===mn[mn.length-1]?(mn.pop(),mn.length&&mn[mn.length-1].observe()):mn.splice(mn.indexOf(a),1)}}var Tl=new Map,sM=e=>{xe(()=>{var s,o;const t=(s=Et(e.style))!=null?s:{},n=(o=Et(e.properties))!=null?o:[],r={};for(const a in t)r[a]=e.element.style[a];const i=Tl.get(e.key);i?i.activeCount++:Tl.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);_e(()=>{var l;const a=Tl.get(e.key);if(a){if(a.activeCount!==1){a.activeCount--;return}Tl.delete(e.key);for(const[u,c]of Object.entries(a.originalStyles))e.element.style[u]=c;for(const u of a.properties)e.element.style.removeProperty(u);e.element.style.length===0&&e.element.removeAttribute("style"),(l=e.cleanup)==null||l.call(e)}})})},pm=sM,oM=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},aM=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},lM=(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[u,c,d]=oM(i,t),f=d-u-r*c;(c!==0||f!==0)&&aM(i,t)&&(s+=f,o+=c),i===(n!=null?n:document.documentElement)?a=!0:i=(l=i._$host)!=null?l:i.parentElement}while(i&&!a);return[s,o]},[vm,bm]=ce([]),uM=e=>vm().indexOf(e)===vm().length-1,cM=e=>{const t=Ae({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=On();let r=[0,0],i=null,s=null;xe(()=>{Et(t.enabled)&&(bm(u=>[...u,n]),_e(()=>{bm(u=>u.filter(c=>c!==n))}))}),xe(()=>{if(!Et(t.enabled)||!Et(t.hideScrollbar))return;const{body:u}=document,c=window.innerWidth-u.offsetWidth;if(Et(t.preventScrollbarShift)){const d={overflow:"hidden"},f=[];c>0&&(Et(t.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(u).paddingRight} + ${c}px)`:d.marginRight=`calc(${window.getComputedStyle(u).marginRight} + ${c}px)`,f.push({key:"--scrollbar-width",value:`${c}px`}));const h=window.scrollY,g=window.scrollX;pm({key:"prevent-scroll",element:u,style:d,properties:f,cleanup:()=>{Et(t.restoreScrollPosition)&&c>0&&window.scrollTo(g,h)}})}else pm({key:"prevent-scroll",element:u,style:{overflow:"hidden"}})}),xe(()=>{!uM(n)||!Et(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",o,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),_e(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",o),document.removeEventListener("touchmove",l)}))});const o=u=>{r=xm(u),i=null,s=null},a=u=>{const c=u.target,d=Et(t.element),f=dM(u),h=Math.abs(f[0])>Math.abs(f[1])?"x":"y",g=h==="x"?f[0]:f[1],m=wm(c,h,g,d);let p;d&&uf(d,c)?p=!m:p=!0,p&&u.cancelable&&u.preventDefault()},l=u=>{const c=Et(t.element),d=u.target;let f;if(u.touches.length===2)f=!Et(t.allowPinchZoom);else{if(i==null||s===null){const h=xm(u).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=wm(d,i,s,c);c&&uf(c,d)?f=!h:f=!0}}f&&u.cancelable&&u.preventDefault()}},dM=e=>[e.deltaX,e.deltaY],xm=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],wm=(e,t,n,r)=>{const i=r!==null&&uf(r,e),[s,o]=lM(e,t,i?r:void 0);return!(n>0&&Math.abs(s)<=1||n<0&&Math.abs(o)<1)},uf=(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},fM=cM,hM=fM,O1=wt();function E1(){return St(O1)}function Ar(){const e=E1();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var A1=wt();function mh(){const e=St(A1);if(e===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var T1=wt();function rr(){const e=St(T1);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function ph(e){let t;const n=rr(),r=Ar(),i=Re({id:n.generateId(`item-${On()}`)},e),[s,o]=Ve(i,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=ce(),[u,c]=ce(),[d,f]=ce(),h=()=>r.listState().selectionManager(),g=()=>o.id,m=()=>h().focusedKey()===g(),p=()=>{var k;(k=s.onSelect)==null||k.call(s),s.closeOnSelect&&setTimeout(()=>{r.close(!0)})};wP({getItem:()=>{var k,E,j,M,B;return{ref:()=>t,type:"item",key:g(),textValue:(M=(j=(E=s.textValue)!=null?E:(k=d())==null?void 0:k.textContent)!=null?j:t==null?void 0:t.textContent)!=null?M:"",disabled:(B=s.disabled)!=null?B:!1}}});const v=Xb({key:g,selectionManager:h,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),b=k=>{nt(k,s.onPointerMove),k.pointerType==="mouse"&&(s.disabled?r.onItemLeave(k):(r.onItemEnter(k),k.defaultPrevented||(At(k.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(g()))))},S=k=>{nt(k,s.onPointerLeave),k.pointerType==="mouse"&&r.onItemLeave(k)},C=k=>{nt(k,s.onPointerUp),!s.disabled&&k.button===0&&p()},w=k=>{if(nt(k,s.onKeyDown),!k.repeat&&!s.disabled)switch(k.key){case"Enter":case" ":p();break}},O=K(()=>{if(s.indeterminate)return"mixed";if(s.checked!=null)return s.checked}),x=K(()=>({"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:x,setLabelRef:f,generateId:Qa(()=>o.id),registerLabel:Cn(l),registerDescription:Cn(c)};return D(A1.Provider,{value:_,get children(){return D(st,Ae({as:"div",ref(k){const E=It(j=>t=j,s.ref);typeof E=="function"&&E(k)},get tabIndex(){return v.tabIndex()},get"aria-checked"(){return O()},get"aria-disabled"(){return s.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return u()},get"data-key"(){return v.dataKey()},get onPointerDown(){return vt([s.onPointerDown,v.onPointerDown])},get onPointerUp(){return vt([C,v.onPointerUp])},get onClick(){return vt([s.onClick,v.onClick])},get onKeyDown(){return vt([w,v.onKeyDown])},get onMouseDown(){return vt([s.onMouseDown,v.onMouseDown])},get onFocus(){return vt([s.onFocus,v.onFocus])},onPointerMove:b,onPointerLeave:S},x,o))}})}function P1(e){const t=Re({closeOnSelect:!1},e),[n,r]=Ve(t,["checked","defaultChecked","onChange","onSelect"]),i=fP({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 D(ph,Ae({role:"menuitemcheckbox",get checked(){return i.isSelected()},onSelect:()=>{var o;(o=n.onSelect)==null||o.call(n),i.toggle()}},r))}var gM=wt();function ic(){return St(gM)}var wa={next:(e,t)=>e==="ltr"?t==="horizontal"?"ArrowRight":"ArrowDown":t==="horizontal"?"ArrowLeft":"ArrowUp",previous:(e,t)=>wa.next(e==="ltr"?"rtl":"ltr",t)},Sm={first:e=>e==="horizontal"?"ArrowDown":"ArrowRight",last:e=>e==="horizontal"?"ArrowUp":"ArrowLeft"};function j1(e){const t=rr(),n=Ar(),r=ic(),{direction:i}=li(),s=Re({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 u=ec(()=>n.triggerRef(),()=>"button"),c=K(()=>{var v;return u()==="a"&&((v=n.triggerRef())==null?void 0:v.getAttribute("href"))!=null});xe(Sr(()=>r==null?void 0:r.value(),v=>{var b;c()&&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=>{nt(v,o.onPointerDown),v.currentTarget.dataset.pointerType=v.pointerType,!o.disabled&&v.pointerType!=="touch"&&v.button===0&&d()},h=v=>{nt(v,o.onClick),o.disabled||v.currentTarget.dataset.pointerType==="touch"&&d()},g=v=>{if(nt(v,o.onKeyDown),!o.disabled){if(c())switch(v.key){case"Enter":case" ":return}switch(v.key){case"Enter":case" ":case Sm.first(t.orientation()):v.stopPropagation(),v.preventDefault(),iP(v.currentTarget),n.open("first"),r==null||r.setAutoFocusMenu(!0),r==null||r.setValue(l);break;case Sm.last(t.orientation()):v.stopPropagation(),v.preventDefault(),n.open("last");break;case wa.next(i(),t.orientation()):if(r===void 0)break;v.stopPropagation(),v.preventDefault(),r.nextMenu();break;case wa.previous(i(),t.orientation()):if(r===void 0)break;v.stopPropagation(),v.preventDefault(),r.previousMenu();break}}},m=v=>{var b;nt(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=>{nt(v,o.onFocus),r!==void 0&&v.currentTarget.dataset.pointerType!=="touch"&&r.setValue(l)};return xe(()=>_e(n.registerTriggerId(o.id))),D(ah,Ae({ref(v){const b=It(n.setTriggerRef,o.ref);typeof b=="function"&&b(v)},get"data-kb-menu-value-trigger"(){return t.value()},get id(){return o.id},get disabled(){return o.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return K(()=>!!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 yM=wt();function M1(){return St(yM)}function $1(e){let t;const n=rr(),r=Ar(),i=ic(),s=M1(),{direction:o}=li(),a=Re({id:n.generateId(`content-${On()}`)},e),[l,u]=Ve(a,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let c=0;const d=()=>r.parentMenuContext()==null&&i===void 0&&n.isModal(),f=eM({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);tM({trapFocus:()=>d()&&r.isOpen(),onMountAutoFocus:S=>{var C;i===void 0&&((C=l.onOpenAutoFocus)==null||C.call(l,S))},onUnmountAutoFocus:l.onCloseAutoFocus},()=>t);const h=S=>{if(Sn(S.currentTarget,S.target)&&(S.key==="Tab"&&r.isOpen()&&S.preventDefault(),i!==void 0&&S.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(S.key){case wa.next(o(),n.orientation()):S.stopPropagation(),S.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.nextMenu();break;case wa.previous(o(),n.orientation()):if(S.currentTarget.hasAttribute("data-closed"))break;S.stopPropagation(),S.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.previousMenu();break}},g=S=>{var C;(C=l.onEscapeKeyDown)==null||C.call(l,S),i==null||i.setAutoFocusMenu(!1),r.close(!0)},m=S=>{var C;(C=l.onFocusOutside)==null||C.call(l,S),n.isModal()&&S.preventDefault()},p=S=>{var C,w;nt(S,l.onPointerEnter),r.isOpen()&&((C=r.parentMenuContext())==null||C.listState().selectionManager().setFocused(!1),(w=r.parentMenuContext())==null||w.listState().selectionManager().setFocusedKey(void 0))},v=S=>{if(nt(S,l.onPointerMove),S.pointerType!=="mouse")return;const C=S.target,w=c!==S.clientX;Sn(S.currentTarget,C)&&w&&(r.setPointerDir(S.clientX>c?"right":"left"),c=S.clientX)};xe(()=>_e(r.registerContentId(l.id)));const b={ref:It(S=>{r.setContentRef(S),t=S},l.ref),role:"menu",get id(){return l.id},get tabIndex(){return f.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:vt([l.onKeyDown,f.onKeyDown,h]),onMouseDown:vt([l.onMouseDown,f.onMouseDown]),onFocusIn:vt([l.onFocusIn,f.onFocusIn]),onFocusOut:vt([l.onFocusOut,f.onFocusOut]),onPointerEnter:p,onPointerMove:v,get"data-orientation"(){return n.orientation()}};return D(ve,{get when(){return r.contentPresent()},get children(){return D(ve,{get when(){return s===void 0||r.parentMenuContext()!=null},get fallback(){return D(st,Ae({as:"div"},()=>r.dataset(),b,u))},get children(){return D(f1.Positioner,{get children(){return D(Xj,Ae({get disableOutsidePointerEvents(){return K(()=>!!d())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return Zu({"--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,u))}})}})}})}function mM(e){let t;const n=rr(),r=Ar(),[i,s]=Ve(e,["ref"]);return hM({element:()=>t!=null?t:null,enabled:()=>r.contentPresent()&&n.preventScroll()}),D($1,Ae({ref(o){const a=It(l=>{t=l},i.ref);typeof a=="function"&&a(o)}},s))}var L1=wt();function pM(){const e=St(L1);if(e===void 0)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}function vh(e){const t=rr(),n=Re({id:t.generateId(`group-${On()}`)},e),[r,i]=ce(),s={generateId:Qa(()=>n.id),registerLabelId:Cn(i)};return D(L1.Provider,{value:s,get children(){return D(st,Ae({as:"div",role:"group",get"aria-labelledby"(){return r()}},n))}})}function D1(e){const t=pM(),n=Re({id:t.generateId("label")},e),[r,i]=Ve(n,["id"]);return xe(()=>_e(t.registerLabelId(r.id))),D(st,Ae({as:"span",get id(){return r.id},"aria-hidden":"true"},i))}function I1(e){const t=Ar(),n=Re({children:"▼"},e);return D(st,Ae({as:"span","aria-hidden":"true"},()=>t.dataset(),n))}function R1(e){return D(ph,Ae({role:"menuitem",closeOnSelect:!0},e))}function N1(e){const t=mh(),n=Re({id:t.generateId("description")},e),[r,i]=Ve(n,["id"]);return xe(()=>_e(t.registerDescription(r.id))),D(st,Ae({as:"div",get id(){return r.id}},()=>t.dataset(),i))}function F1(e){const t=mh(),n=Re({id:t.generateId("indicator")},e),[r,i]=Ve(n,["forceMount"]);return D(ve,{get when(){return r.forceMount||t.isChecked()},get children(){return D(st,Ae({as:"div"},()=>t.dataset(),i))}})}function B1(e){const t=mh(),n=Re({id:t.generateId("label")},e),[r,i]=Ve(n,["ref","id"]);return xe(()=>_e(t.registerLabel(r.id))),D(st,Ae({as:"div",ref(s){const o=It(t.setLabelRef,r.ref);typeof o=="function"&&o(s)},get id(){return r.id}},()=>t.dataset(),i))}function q1(e){const t=Ar();return D(ve,{get when(){return t.contentPresent()},get children(){return D(dv,e)}})}var z1=wt();function vM(){const e=St(z1);if(e===void 0)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}function H1(e){const n=rr().generateId(`radiogroup-${On()}`),r=Re({id:n},e),[i,s]=Ve(r,["value","defaultValue","onChange","disabled"]),[o,a]=Xa({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:u=>{var c;return(c=i.onChange)==null?void 0:c.call(i,u)}}),l={isDisabled:()=>i.disabled,isSelectedValue:u=>u===o(),setSelectedValue:a};return D(z1.Provider,{value:l,get children(){return D(vh,s)}})}function U1(e){const t=vM(),n=Re({closeOnSelect:!1},e),[r,i]=Ve(n,["value","onSelect"]);return D(ph,Ae({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 bM(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 xM(e,t){return t?rP([e.clientX,e.clientY],t):!1}function G1(e){const t=rr(),n=Ub(),r=E1(),i=ic(),s=M1(),o=Re({placement:t.orientation()==="horizontal"?"bottom-start":"right-start"},e),[a,l]=Ve(o,["open","defaultOpen","onOpenChange"]);let u=0,c=null,d="right";const[f,h]=ce(),[g,m]=ce(),[p,v]=ce(),[b,S]=ce(),[C,w]=ce(!0),[O,x]=ce(l.placement),[_,k]=ce([]),[E,j]=ce([]),{DomCollectionProvider:M}=xP({items:E,onItemsChange:j}),B=g1({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:J=>{var Se;return(Se=a.onOpenChange)==null?void 0:Se.call(a,J)}}),{present:R}=Zb({show:()=>t.forceMount()||B.isOpen(),element:()=>{var J;return(J=b())!=null?J:null}}),A=NP({selectionMode:"none",dataSource:E}),P=J=>{w(J),B.open()},L=(J=!1)=>{B.close(),J&&r&&r.close(!0)},H=J=>{w(J),B.toggle()},G=()=>{const J=b();J&&(At(J),A.selectionManager().setFocused(!0),A.selectionManager().setFocusedKey(void 0))},F=()=>{s!=null?setTimeout(()=>G()):G()},U=J=>{k(ge=>[...ge,J]);const Se=r==null?void 0:r.registerNestedMenu(J);return()=>{k(ge=>tf(ge,J)),Se==null||Se()}},ie=J=>d===(c==null?void 0:c.side)&&xM(J,c==null?void 0:c.area),ae=J=>{ie(J)&&J.preventDefault()},N=J=>{ie(J)||F()},le=J=>{ie(J)&&J.preventDefault()};rM({isDisabled:()=>!(r==null&&B.isOpen()&&t.isModal()),targets:()=>[b(),..._()].filter(Boolean)}),xe(()=>{const J=b();if(!J||!r)return;const Se=r.registerNestedMenu(J);_e(()=>{Se()})}),xe(()=>{r===void 0&&(i==null||i.registerMenu(t.value(),[b(),..._()]))}),xe(()=>{var J;r!==void 0||i===void 0||(i.value()===t.value()?((J=p())==null||J.focus(),i.autoFocusMenu()&&P(!0)):L())}),xe(()=>{r!==void 0||i===void 0||B.isOpen()&&i.setValue(t.value())}),_e(()=>{r===void 0&&(i==null||i.unregisterMenu(t.value()))});const me={dataset:K(()=>({"data-expanded":B.isOpen()?"":void 0,"data-closed":B.isOpen()?void 0:""})),isOpen:B.isOpen,contentPresent:R,nestedMenus:_,currentPlacement:O,pointerGraceTimeoutId:()=>u,autoFocus:C,listState:()=>A,parentMenuContext:()=>r,triggerRef:p,contentRef:b,triggerId:f,contentId:g,setTriggerRef:v,setContentRef:S,open:P,close:L,toggle:H,focusContent:F,onItemEnter:ae,onItemLeave:N,onTriggerLeave:le,setPointerDir:J=>d=J,setPointerGraceTimeoutId:J=>u=J,setPointerGraceIntent:J=>c=J,registerNestedMenu:U,registerItemToParentDomCollection:n==null?void 0:n.registerItem,registerTriggerId:Cn(h),registerContentId:Cn(m)};return D(M,{get children(){return D(O1.Provider,{value:me,get children(){return D(ve,{when:s===void 0,get fallback(){return l.children},get children(){return D(f1,Ae({anchorRef:p,contentRef:b,onCurrentPlacementChange:x},l))}})}})}})}function K1(e){const{direction:t}=li();return D(G1,Ae({get placement(){return t()==="rtl"?"left-start":"right-start"},flip:!0},e))}var wM={close:(e,t)=>e==="ltr"?[t==="horizontal"?"ArrowLeft":"ArrowUp"]:[t==="horizontal"?"ArrowRight":"ArrowDown"]};function V1(e){const t=Ar(),n=rr(),[r,i]=Ve(e,["onFocusOutside","onKeyDown"]),{direction:s}=li();return D($1,Ae({onOpenAutoFocus:c=>{c.preventDefault()},onCloseAutoFocus:c=>{c.preventDefault()},onFocusOutside:c=>{var f;(f=r.onFocusOutside)==null||f.call(r,c);const d=c.target;Sn(t.triggerRef(),d)||t.close()},onKeyDown:c=>{nt(c,r.onKeyDown);const d=Sn(c.currentTarget,c.target),f=wM.close(s(),n.orientation()).includes(c.key),h=t.parentMenuContext()!=null;d&&f&&h&&(t.close(),At(t.triggerRef()))}},i))}var Cm=["Enter"," "],SM={open:(e,t)=>e==="ltr"?[...Cm,t==="horizontal"?"ArrowRight":"ArrowDown"]:[...Cm,t==="horizontal"?"ArrowLeft":"ArrowUp"]};function W1(e){let t;const n=rr(),r=Ar(),i=Re({id:n.generateId(`sub-trigger-${On()}`)},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:u}=li(),c=()=>s.id,d=()=>{const S=r.parentMenuContext();if(S==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return S.listState().selectionManager()},f=()=>r.listState().collection(),h=()=>d().focusedKey()===c(),g=Xb({key:c,selectionManager:d,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),m=S=>{nt(S,s.onClick),!r.isOpen()&&!s.disabled&&r.open(!0)},p=S=>{var w;if(nt(S,s.onPointerMove),S.pointerType!=="mouse")return;const C=r.parentMenuContext();if(C==null||C.onItemEnter(S),!S.defaultPrevented){if(s.disabled){C==null||C.onItemLeave(S);return}!r.isOpen()&&!a&&((w=r.parentMenuContext())==null||w.setPointerGraceIntent(null),a=window.setTimeout(()=>{r.open(!1),l()},100)),C==null||C.onItemEnter(S),S.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),At(S.currentTarget),C==null||C.listState().selectionManager().setFocused(!0),C==null||C.listState().selectionManager().setFocusedKey(c()))}},v=S=>{if(nt(S,s.onPointerLeave),S.pointerType!=="mouse")return;l();const C=r.parentMenuContext(),w=r.contentRef();if(w){C==null||C.setPointerGraceIntent({area:bM(r.currentPlacement(),S,w),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(C==null?void 0:C.pointerGraceTimeoutId());const O=window.setTimeout(()=>{C==null||C.setPointerGraceIntent(null)},300);C==null||C.setPointerGraceTimeoutId(O)}else{if(C==null||C.onTriggerLeave(S),S.defaultPrevented)return;C==null||C.setPointerGraceIntent(null)}C==null||C.onItemLeave(S)},b=S=>{nt(S,s.onKeyDown),!S.repeat&&(s.disabled||SM.open(u(),n.orientation()).includes(S.key)&&(S.stopPropagation(),S.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,w,O;if(r.registerItemToParentDomCollection==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");const S=r.registerItemToParentDomCollection({ref:()=>t,type:"item",key:c(),textValue:(w=(C=s.textValue)!=null?C:t==null?void 0:t.textContent)!=null?w:"",disabled:(O=s.disabled)!=null?O:!1});_e(S)}),xe(Sr(()=>{var S;return(S=r.parentMenuContext())==null?void 0:S.pointerGraceTimeoutId()},S=>{_e(()=>{var C;window.clearTimeout(S),(C=r.parentMenuContext())==null||C.setPointerGraceIntent(null)})})),xe(()=>_e(r.registerTriggerId(s.id))),_e(()=>{l()}),D(st,Ae({as:"div",ref(S){const C=It(w=>{r.setTriggerRef(w),t=w},s.ref);typeof C=="function"&&C(S)},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 K(()=>!!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 vt([s.onPointerDown,g.onPointerDown])},get onPointerUp(){return vt([s.onPointerUp,g.onPointerUp])},get onClick(){return vt([m,g.onClick])},get onKeyDown(){return vt([b,g.onKeyDown])},get onMouseDown(){return vt([s.onMouseDown,g.onMouseDown])},get onFocus(){return vt([s.onFocus,g.onFocus])},onPointerMove:p,onPointerLeave:v},()=>r.dataset(),o))}function CM(e){const t=ic(),n=`menu-${On()}`,r=Re({id:n,modal:!0},e),[i,s]=Ve(r,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),o=g1({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:l=>{var u;return(u=i.onOpenChange)==null?void 0:u.call(i,l)}}),a={isModal:()=>{var l;return(l=i.modal)!=null?l:!0},preventScroll:()=>{var l;return(l=i.preventScroll)!=null?l:a.isModal()},forceMount:()=>{var l;return(l=i.forceMount)!=null?l:!1},generateId:Qa(()=>i.id),value:()=>i.value,orientation:()=>{var l,u;return(u=(l=i.orientation)!=null?l:t==null?void 0:t.orientation())!=null?u:"horizontal"}};return D(T1.Provider,{value:a,get children(){return D(G1,Ae({get open(){return o.isOpen()},get onOpenChange(){return o.setIsOpen}},s))}})}var _M={};tc(_M,{Root:()=>sc,Separator:()=>kM});function sc(e){let t;const n=Re({orientation:"horizontal"},e),[r,i]=Ve(n,["ref","orientation"]),s=ec(()=>t,()=>"hr");return D(st,Ae({as:"hr",ref(o){const a=It(l=>t=l,r.ref);typeof a=="function"&&a(o)},get role(){return s()!=="hr"?"separator":void 0},get"aria-orientation"(){return r.orientation==="vertical"?"vertical":void 0},get"data-orientation"(){return r.orientation}},i))}var kM=sc,ft={};tc(ft,{Arrow:()=>yh,CheckboxItem:()=>P1,Content:()=>Q1,DropdownMenu:()=>OM,Group:()=>vh,GroupLabel:()=>D1,Icon:()=>I1,Item:()=>R1,ItemDescription:()=>N1,ItemIndicator:()=>F1,ItemLabel:()=>B1,Portal:()=>q1,RadioGroup:()=>H1,RadioItem:()=>U1,Root:()=>Y1,Separator:()=>sc,Sub:()=>K1,SubContent:()=>V1,SubTrigger:()=>W1,Trigger:()=>j1});function Q1(e){const t=rr(),n=Ar(),[r,i]=Ve(e,["onCloseAutoFocus","onInteractOutside"]);let s=!1;return D(mM,Ae({onCloseAutoFocus:l=>{var u;(u=r.onCloseAutoFocus)==null||u.call(r,l),s||At(n.triggerRef()),s=!1,l.preventDefault()},onInteractOutside:l=>{var u;(u=r.onInteractOutside)==null||u.call(r,l),(!t.isModal()||l.detail.isContextMenu)&&(s=!0)}},i))}function Y1(e){const t=`dropdownmenu-${On()}`,n=Re({id:t},e);return D(CM,n)}var OM=Object.assign(Y1,{Arrow:yh,CheckboxItem:P1,Content:Q1,Group:vh,GroupLabel:D1,Icon:I1,Item:R1,ItemDescription:N1,ItemIndicator:F1,ItemLabel:B1,Portal:q1,RadioGroup:H1,RadioItem:U1,Separator:sc,Sub:K1,SubContent:V1,SubTrigger:W1,Trigger:j1}),V={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"}},EM=he('<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>'),AM=he('<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>'),TM=he('<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>'),PM=he('<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>'),bh=he('<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>'),jM=he('<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>'),MM=he('<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>'),$M=he('<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>'),LM=he('<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">'),DM=he('<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">'),IM=he('<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>'),RM=he('<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>'),NM=he('<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>'),FM=he('<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>'),X1=he('<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>'),BM=he('<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>'),qM=he('<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>'),zM=he('<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>'),HM=he('<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>'),UM=he('<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>'),GM=he('<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>'),KM=he('<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>'),VM=he('<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 WM(){return EM()}function Z1(){return AM()}function Yo(){return TM()}function _m(){return PM()}function km(){return bh()}function QM(){return(()=>{var e=bh();return e.style.setProperty("transform","rotate(90deg)"),e})()}function YM(){return(()=>{var e=bh();return e.style.setProperty("transform","rotate(-90deg)"),e})()}function XM(){return jM()}function ZM(){return MM()}function JM(){return $M()}function e$(){return LM()}function t$(){return DM()}function n$(){return IM()}function r$(){return RM()}function i$(){return NM()}function s$(){return FM()}function o$(e){return(()=>{var t=X1(),n=t.firstChild;return be(()=>re(n,"stroke",e.theme==="dark"?"#12B76A":"#027A48")),t})()}function a$(){return BM()}function l$(){return qM()}function u$(e){return[D(ve,{get when(){return e.checked},get children(){var t=X1(),n=t.firstChild;return be(()=>re(n,"stroke",e.theme==="dark"?"#9B8AFB":"#6938EF")),t}}),D(ve,{get when(){return!e.checked},get children(){var t=zM(),n=t.firstChild;return be(()=>re(n,"stroke",e.theme==="dark"?"#9B8AFB":"#6938EF")),t}})]}function c$(){return HM()}function d$(){return UM()}function f$(){return GM()}function h$(){return KM()}function Om(){const e=On();return(()=>{var t=VM(),n=t.firstChild,r=n.nextSibling,i=r.nextSibling,s=i.firstChild,o=i.nextSibling,a=o.firstChild,l=o.nextSibling,u=l.nextSibling,c=u.firstChild,d=u.nextSibling,f=d.firstChild,h=d.nextSibling,g=h.nextSibling,m=g.firstChild,p=g.nextSibling,v=p.firstChild,b=p.nextSibling,S=b.nextSibling,C=S.firstChild,w=S.nextSibling,O=w.firstChild,x=w.nextSibling,_=x.nextSibling,k=_.firstChild,E=_.nextSibling,j=E.firstChild,M=E.nextSibling,B=M.nextSibling,R=B.firstChild,A=B.nextSibling,P=A.firstChild,L=A.nextSibling,H=L.nextSibling,G=H.firstChild,F=H.nextSibling,U=F.firstChild,ie=F.nextSibling,ae=ie.firstChild,N=ae.nextSibling,le=N.nextSibling,te=le.nextSibling,me=te.nextSibling,J=ie.nextSibling,Se=J.firstChild,ge=J.nextSibling,ze=ge.firstChild,oe=ge.nextSibling,He=oe.firstChild,lt=He.nextSibling,dt=lt.nextSibling,Ne=dt.firstChild,Fe=Ne.nextSibling,Y=Fe.nextSibling,Te=Y.nextSibling,tt=Te.nextSibling,$e=tt.nextSibling,ue=$e.nextSibling,Q=ue.nextSibling,ne=Q.nextSibling,ee=ne.nextSibling,Ce=ee.nextSibling,gt=Ce.nextSibling,we=oe.nextSibling,Je=we.firstChild,Be=we.nextSibling,Tn=Be.firstChild,Vt=Be.nextSibling,hn=Vt.firstChild,Fn=hn.nextSibling,ir=Vt.nextSibling,Zi=ir.firstChild,Tr=ir.nextSibling,tl=Tr.firstChild,uo=Tr.nextSibling,co=uo.firstChild,fo=co.nextSibling,Ji=fo.nextSibling,Ch=Ji.nextSibling,_h=Ch.nextSibling,kh=_h.nextSibling,Oh=kh.nextSibling,Eh=Oh.nextSibling,Ah=Eh.nextSibling,Th=Ah.nextSibling,Ph=Th.nextSibling,jh=Ph.nextSibling,Mh=jh.nextSibling,$h=Mh.nextSibling,Lh=$h.nextSibling,Dh=Lh.nextSibling,Ih=Dh.nextSibling,fx=Ih.nextSibling;return re(n,"id",`a-${e}`),re(r,"fill",`url(#a-${e})`),re(s,"id",`am-${e}`),re(o,"id",`b-${e}`),re(a,"filter",`url(#am-${e})`),re(l,"mask",`url(#b-${e})`),re(c,"id",`ah-${e}`),re(d,"id",`k-${e}`),re(f,"filter",`url(#ah-${e})`),re(h,"mask",`url(#k-${e})`),re(m,"id",`ae-${e}`),re(p,"id",`j-${e}`),re(v,"filter",`url(#ae-${e})`),re(b,"mask",`url(#j-${e})`),re(C,"id",`ai-${e}`),re(w,"id",`i-${e}`),re(O,"filter",`url(#ai-${e})`),re(x,"mask",`url(#i-${e})`),re(k,"id",`aj-${e}`),re(E,"id",`h-${e}`),re(j,"filter",`url(#aj-${e})`),re(M,"mask",`url(#h-${e})`),re(R,"id",`ag-${e}`),re(A,"id",`g-${e}`),re(P,"filter",`url(#ag-${e})`),re(L,"mask",`url(#g-${e})`),re(G,"id",`af-${e}`),re(F,"id",`f-${e}`),re(U,"filter",`url(#af-${e})`),re(ie,"mask",`url(#f-${e})`),re(te,"id",`m-${e}`),re(me,"fill",`url(#m-${e})`),re(Se,"id",`ak-${e}`),re(ge,"id",`e-${e}`),re(ze,"filter",`url(#ak-${e})`),re(oe,"mask",`url(#e-${e})`),re(He,"id",`n-${e}`),re(lt,"fill",`url(#n-${e})`),re(Ne,"id",`r-${e}`),re(Fe,"fill",`url(#r-${e})`),re(Y,"id",`s-${e}`),re(Te,"fill",`url(#s-${e})`),re(tt,"id",`q-${e}`),re($e,"fill",`url(#q-${e})`),re(ue,"id",`p-${e}`),re(Q,"fill",`url(#p-${e})`),re(ne,"id",`o-${e}`),re(ee,"fill",`url(#o-${e})`),re(Ce,"id",`l-${e}`),re(gt,"fill",`url(#l-${e})`),re(Je,"id",`al-${e}`),re(Be,"id",`d-${e}`),re(Tn,"filter",`url(#al-${e})`),re(Vt,"mask",`url(#d-${e})`),re(hn,"id",`u-${e}`),re(Fn,"fill",`url(#u-${e})`),re(Zi,"id",`ad-${e}`),re(Tr,"id",`c-${e}`),re(tl,"filter",`url(#ad-${e})`),re(uo,"mask",`url(#c-${e})`),re(co,"id",`t-${e}`),re(fo,"fill",`url(#t-${e})`),re(Ji,"id",`v-${e}`),re(Ch,"stroke",`url(#v-${e})`),re(_h,"id",`aa-${e}`),re(kh,"stroke",`url(#aa-${e})`),re(Oh,"id",`w-${e}`),re(Eh,"stroke",`url(#w-${e})`),re(Ah,"id",`ac-${e}`),re(Th,"stroke",`url(#ac-${e})`),re(Ph,"id",`ab-${e}`),re(jh,"stroke",`url(#ab-${e})`),re(Mh,"id",`y-${e}`),re($h,"stroke",`url(#y-${e})`),re(Lh,"id",`x-${e}`),re(Dh,"stroke",`url(#x-${e})`),re(Ih,"id",`z-${e}`),re(fx,"stroke",`url(#z-${e})`),t})()}var g$=he('<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>'),y$=he('<button title="Copy object to clipboard">'),m$=he('<button title="Remove all items"aria-label="Remove all items">'),p$=he('<button title="Delete item"aria-label="Delete item">'),v$=he('<button title="Toggle value"aria-label="Toggle value">'),b$=he('<button title="Bulk Edit Data"aria-label="Bulk Edit Data">'),Ao=he("<div>"),x$=he("<div><button> <span></span> <span> "),w$=he("<input>"),Em=he("<span>"),S$=he("<div><span>:"),C$=he("<div><div><button> [<!>...<!>]");function _$(e,t){let n=0;const r=[];for(;n<e.length;)r.push(e.slice(n,n+t)),n=n+t;return r}var Am=e=>{const t=xt(),n=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,r=K(()=>t()==="dark"?lo(n):ao(n));return(()=>{var i=g$();return be(()=>se(i,fe(r().expander,n`
71
71
  transform: rotate(${e.expanded?90:0}deg);
72
72
  `,e.expanded&&n`
73
73
  & svg {
74
74
  top: -1px;
75
75
  }
76
- `))),i})()},w$=e=>{const t=xt(),n=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,r=U(()=>t()==="dark"?so(n):io(n)),[i,s]=ce("NoCopy");return(()=>{var o=d$();return rv(o,"click",i()==="NoCopy"?()=>{navigator.clipboard.writeText(LS(e.value)).then(()=>{s("SuccessCopy"),setTimeout(()=>{s("NoCopy")},1500)},a=>{s("ErrorCopy"),setTimeout(()=>{s("NoCopy")},1500)})}:void 0,!0),K(o,D(I3,{get children(){return[D(dc,{get when(){return i()==="NoCopy"},get children(){return D(e$,{})}}),D(dc,{get when(){return i()==="SuccessCopy"},get children(){return D(n$,{get theme(){return t()}})}}),D(dc,{get when(){return i()==="ErrorCopy"},get children(){return D(r$,{})}})]}})),be(a=>{var l=r().actionButton,u=`${i()==="NoCopy"?"Copy object to clipboard":i()==="SuccessCopy"?"Object copied to clipboard":"Error copying object to clipboard"}`;return l!==a.e&&se(o,a.e=l),u!==a.t&&re(o,"aria-label",a.t=u),a},{e:void 0,t:void 0}),o})()},S$=e=>{const t=xt(),n=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,r=U(()=>t()==="dark"?so(n):io(n)),i=ye().client;return(()=>{var s=f$();return s.$$click=()=>{const o=e.activeQuery.state.data,a=pi(o,e.dataPath,[]);i.setQueryData(e.activeQuery.queryKey,a)},K(s,D(i$,{})),be(()=>se(s,r().actionButton)),s})()},Em=e=>{const t=xt(),n=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,r=U(()=>t()==="dark"?so(n):io(n)),i=ye().client;return(()=>{var s=h$();return s.$$click=()=>{const o=e.activeQuery.state.data,a=Po(o,e.dataPath);i.setQueryData(e.activeQuery.queryKey,a)},K(s,D(W1,{})),be(()=>se(s,fe(r().actionButton))),s})()},C$=e=>{const t=xt(),n=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,r=U(()=>t()==="dark"?so(n):io(n)),i=ye().client;return(()=>{var s=g$();return s.$$click=()=>{const o=e.activeQuery.state.data,a=pi(o,e.dataPath,!e.value);i.setQueryData(e.activeQuery.queryKey,a)},K(s,D(s$,{get theme(){return t()},get checked(){return e.value}})),be(()=>se(s,fe(r().actionButton,n`
76
+ `))),i})()},k$=e=>{const t=xt(),n=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,r=K(()=>t()==="dark"?lo(n):ao(n)),[i,s]=ce("NoCopy");return(()=>{var o=y$();return av(o,"click",i()==="NoCopy"?()=>{navigator.clipboard.writeText(NS(e.value)).then(()=>{s("SuccessCopy"),setTimeout(()=>{s("NoCopy")},1500)},a=>{s("ErrorCopy"),setTimeout(()=>{s("NoCopy")},1500)})}:void 0,!0),W(o,D(B3,{get children(){return[D(gc,{get when(){return i()==="NoCopy"},get children(){return D(i$,{})}}),D(gc,{get when(){return i()==="SuccessCopy"},get children(){return D(o$,{get theme(){return t()}})}}),D(gc,{get when(){return i()==="ErrorCopy"},get children(){return D(a$,{})}})]}})),be(a=>{var l=r().actionButton,u=`${i()==="NoCopy"?"Copy object to clipboard":i()==="SuccessCopy"?"Object copied to clipboard":"Error copying object to clipboard"}`;return l!==a.e&&se(o,a.e=l),u!==a.t&&re(o,"aria-label",a.t=u),a},{e:void 0,t:void 0}),o})()},O$=e=>{const t=xt(),n=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,r=K(()=>t()==="dark"?lo(n):ao(n)),i=ye().client;return(()=>{var s=m$();return s.$$click=()=>{const o=e.activeQuery.state.data,a=xi(o,e.dataPath,[]);i.setQueryData(e.activeQuery.queryKey,a)},W(s,D(l$,{})),be(()=>se(s,r().actionButton)),s})()},Tm=e=>{const t=xt(),n=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,r=K(()=>t()==="dark"?lo(n):ao(n)),i=ye().client;return(()=>{var s=p$();return s.$$click=()=>{const o=e.activeQuery.state.data,a=$o(o,e.dataPath);i.setQueryData(e.activeQuery.queryKey,a)},W(s,D(Z1,{})),be(()=>se(s,fe(r().actionButton))),s})()},E$=e=>{const t=xt(),n=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,r=K(()=>t()==="dark"?lo(n):ao(n)),i=ye().client;return(()=>{var s=v$();return s.$$click=()=>{const o=e.activeQuery.state.data,a=xi(o,e.dataPath,!e.value);i.setQueryData(e.activeQuery.queryKey,a)},W(s,D(u$,{get theme(){return t()},get checked(){return e.value}})),be(()=>se(s,fe(r().actionButton,n`
77
77
  width: ${V.size[3.5]};
78
78
  height: ${V.size[3.5]};
79
- `))),s})()};function Am(e){return Symbol.iterator in e}function Gr(e){var g;const t=xt(),n=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,r=U(()=>t()==="dark"?so(n):io(n)),i=ye().client,[s,o]=ce((e.defaultExpanded||[]).includes(e.label)),a=()=>o(m=>!m),[l,u]=ce([]),c=U(()=>Array.isArray(e.value)?e.value.map((m,p)=>({label:p.toString(),value:m})):e.value!==null&&typeof e.value=="object"&&Am(e.value)&&typeof e.value[Symbol.iterator]=="function"?e.value instanceof Map?Array.from(e.value,([m,p])=>({label:m,value:p})):Array.from(e.value,(m,p)=>({label:p.toString(),value:m})):typeof e.value=="object"&&e.value!==null?Object.entries(e.value).map(([m,p])=>({label:m,value:p})):[]),d=U(()=>Array.isArray(e.value)?"array":e.value!==null&&typeof e.value=="object"&&Am(e.value)&&typeof e.value[Symbol.iterator]=="function"?"Iterable":typeof e.value=="object"&&e.value!==null?"object":typeof e.value),f=U(()=>x$(c(),100)),h=(g=e.dataPath)!=null?g:[];return(()=>{var m=ko();return K(m,D(ve,{get when(){return f().length},get children(){return[(()=>{var p=m$(),v=p.firstChild,b=v.firstChild,S=b.nextSibling,C=S.nextSibling,w=C.nextSibling,O=w.firstChild;return v.$$click=()=>a(),K(v,D(Om,{get expanded(){return s()}}),b),K(S,()=>e.label),K(w,()=>String(d()).toLowerCase()==="iterable"?"(Iterable) ":"",O),K(w,()=>c().length,O),K(w,()=>c().length>1?"items":"item",null),K(p,D(ve,{get when(){return e.editable},get children(){var x=ko();return K(x,D(w$,{get value(){return e.value}}),null),K(x,D(ve,{get when(){return e.itemsDeletable&&e.activeQuery!==void 0},get children(){return D(Em,{get activeQuery(){return e.activeQuery},dataPath:h})}}),null),K(x,D(ve,{get when(){return d()==="array"&&e.activeQuery!==void 0},get children(){return D(S$,{get activeQuery(){return e.activeQuery},dataPath:h})}}),null),K(x,D(ve,{get when(){return U(()=>!!e.onEdit)()&&!Sv(e.value).meta},get children(){var _=y$();return _.$$click=()=>{var k;(k=e.onEdit)==null||k.call(e)},K(_,D(t$,{})),be(()=>se(_,r().actionButton)),_}}),null),be(()=>se(x,r().actions)),x}}),null),be(x=>{var _=r().expanderButtonContainer,k=r().expanderButton,E=r().info;return _!==x.e&&se(p,x.e=_),k!==x.t&&se(v,x.t=k),E!==x.a&&se(w,x.a=E),x},{e:void 0,t:void 0,a:void 0}),p})(),D(ve,{get when(){return s()},get children(){return[D(ve,{get when(){return f().length===1},get children(){var p=ko();return K(p,D(du,{get each(){return c()},by:v=>v.label,children:v=>D(Gr,{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(()=>se(p,r().subEntry)),p}}),D(ve,{get when(){return f().length>1},get children(){var p=ko();return K(p,D(D3,{get each(){return f()},children:(v,b)=>(()=>{var S=b$(),C=S.firstChild,w=C.firstChild,O=w.firstChild,x=O.nextSibling,_=x.nextSibling,k=_.nextSibling;return k.nextSibling,w.$$click=()=>u(E=>E.includes(b)?E.filter(P=>P!==b):[...E,b]),K(w,D(Om,{get expanded(){return l().includes(b)}}),O),K(w,b*100,x),K(w,b*100+100-1,k),K(C,D(ve,{get when(){return l().includes(b)},get children(){var E=ko();return K(E,D(du,{get each(){return v()},by:P=>P.label,children:P=>D(Gr,{get defaultExpanded(){return e.defaultExpanded},get label(){return P().label},get value(){return P().value},get editable(){return e.editable},get dataPath(){return[...h,P().label]},get activeQuery(){return e.activeQuery}})})),be(()=>se(E,r().subEntry)),E}}),null),be(E=>{var P=r().entry,M=r().expanderButton;return P!==E.e&&se(C,E.e=P),M!==E.t&&se(w,E.t=M),E},{e:void 0,t:void 0}),S})()})),be(()=>se(p,r().subEntry)),p}})]}})]}}),null),K(m,D(ve,{get when(){return f().length===0},get children(){var p=v$(),v=p.firstChild,b=v.firstChild;return K(v,()=>e.label,b),K(p,D(ve,{get when(){return U(()=>!!(e.editable&&e.activeQuery!==void 0))()&&(d()==="string"||d()==="number"||d()==="boolean")},get fallback(){return(()=>{var S=km();return K(S,()=>Wl(e.value)),be(()=>se(S,r().value)),S})()},get children(){return[D(ve,{get when(){return U(()=>!!(e.editable&&e.activeQuery!==void 0))()&&(d()==="string"||d()==="number")},get children(){var S=p$();return S.addEventListener("change",C=>{const w=e.activeQuery.state.data,O=pi(w,h,d()==="number"?C.target.valueAsNumber:C.target.value);i.setQueryData(e.activeQuery.queryKey,O)}),be(C=>{var w=d()==="number"?"number":"text",O=fe(r().value,r().editableInput);return w!==C.e&&re(S,"type",C.e=w),O!==C.t&&se(S,C.t=O),C},{e:void 0,t:void 0}),be(()=>S.value=e.value),S}}),D(ve,{get when(){return d()==="boolean"},get children(){var S=km();return K(S,D(C$,{get activeQuery(){return e.activeQuery},dataPath:h,get value(){return e.value}}),null),K(S,()=>Wl(e.value),null),be(()=>se(S,fe(r().value,r().actions,r().editableInput))),S}})]}}),null),K(p,D(ve,{get when(){return e.editable&&e.itemsDeletable&&e.activeQuery!==void 0},get children(){return D(Em,{get activeQuery(){return e.activeQuery},dataPath:h})}}),null),be(S=>{var C=r().row,w=r().label;return C!==S.e&&se(p,S.e=C),w!==S.t&&se(v,S.t=w),S},{e:void 0,t:void 0}),p}}),null),be(()=>se(m,r().entry)),m})()}var Q1=(e,t)=>{const{colors:n,font:r,size:i,border:s}=V,o=(a,l)=>e==="light"?a:l;return{entry:t`
79
+ `))),s})()};function Pm(e){return Symbol.iterator in e}function Wr(e){var g;const t=xt(),n=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,r=K(()=>t()==="dark"?lo(n):ao(n)),i=ye().client,[s,o]=ce((e.defaultExpanded||[]).includes(e.label)),a=()=>o(m=>!m),[l,u]=ce([]),c=K(()=>Array.isArray(e.value)?e.value.map((m,p)=>({label:p.toString(),value:m})):e.value!==null&&typeof e.value=="object"&&Pm(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=K(()=>Array.isArray(e.value)?"array":e.value!==null&&typeof e.value=="object"&&Pm(e.value)&&typeof e.value[Symbol.iterator]=="function"?"Iterable":typeof e.value=="object"&&e.value!==null?"object":typeof e.value),f=K(()=>_$(c(),100)),h=(g=e.dataPath)!=null?g:[];return(()=>{var m=Ao();return W(m,D(ve,{get when(){return f().length},get children(){return[(()=>{var p=x$(),v=p.firstChild,b=v.firstChild,S=b.nextSibling,C=S.nextSibling,w=C.nextSibling,O=w.firstChild;return v.$$click=()=>a(),W(v,D(Am,{get expanded(){return s()}}),b),W(S,()=>e.label),W(w,()=>String(d()).toLowerCase()==="iterable"?"(Iterable) ":"",O),W(w,()=>c().length,O),W(w,()=>c().length>1?"items":"item",null),W(p,D(ve,{get when(){return e.editable},get children(){var x=Ao();return W(x,D(k$,{get value(){return e.value}}),null),W(x,D(ve,{get when(){return e.itemsDeletable&&e.activeQuery!==void 0},get children(){return D(Tm,{get activeQuery(){return e.activeQuery},dataPath:h})}}),null),W(x,D(ve,{get when(){return d()==="array"&&e.activeQuery!==void 0},get children(){return D(O$,{get activeQuery(){return e.activeQuery},dataPath:h})}}),null),W(x,D(ve,{get when(){return K(()=>!!e.onEdit)()&&!Ov(e.value).meta},get children(){var _=b$();return _.$$click=()=>{var k;(k=e.onEdit)==null||k.call(e)},W(_,D(s$,{})),be(()=>se(_,r().actionButton)),_}}),null),be(()=>se(x,r().actions)),x}}),null),be(x=>{var _=r().expanderButtonContainer,k=r().expanderButton,E=r().info;return _!==x.e&&se(p,x.e=_),k!==x.t&&se(v,x.t=k),E!==x.a&&se(w,x.a=E),x},{e:void 0,t:void 0,a:void 0}),p})(),D(ve,{get when(){return s()},get children(){return[D(ve,{get when(){return f().length===1},get children(){var p=Ao();return W(p,D(gu,{get each(){return c()},by:v=>v.label,children:v=>D(Wr,{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(()=>se(p,r().subEntry)),p}}),D(ve,{get when(){return f().length>1},get children(){var p=Ao();return W(p,D(F3,{get each(){return f()},children:(v,b)=>(()=>{var S=C$(),C=S.firstChild,w=C.firstChild,O=w.firstChild,x=O.nextSibling,_=x.nextSibling,k=_.nextSibling;return k.nextSibling,w.$$click=()=>u(E=>E.includes(b)?E.filter(j=>j!==b):[...E,b]),W(w,D(Am,{get expanded(){return l().includes(b)}}),O),W(w,b*100,x),W(w,b*100+100-1,k),W(C,D(ve,{get when(){return l().includes(b)},get children(){var E=Ao();return W(E,D(gu,{get each(){return v()},by:j=>j.label,children:j=>D(Wr,{get defaultExpanded(){return e.defaultExpanded},get label(){return j().label},get value(){return j().value},get editable(){return e.editable},get dataPath(){return[...h,j().label]},get activeQuery(){return e.activeQuery}})})),be(()=>se(E,r().subEntry)),E}}),null),be(E=>{var j=r().entry,M=r().expanderButton;return j!==E.e&&se(C,E.e=j),M!==E.t&&se(w,E.t=M),E},{e:void 0,t:void 0}),S})()})),be(()=>se(p,r().subEntry)),p}})]}})]}}),null),W(m,D(ve,{get when(){return f().length===0},get children(){var p=S$(),v=p.firstChild,b=v.firstChild;return W(v,()=>e.label,b),W(p,D(ve,{get when(){return K(()=>!!(e.editable&&e.activeQuery!==void 0))()&&(d()==="string"||d()==="number"||d()==="boolean")},get fallback(){return(()=>{var S=Em();return W(S,()=>Zl(e.value)),be(()=>se(S,r().value)),S})()},get children(){return[D(ve,{get when(){return K(()=>!!(e.editable&&e.activeQuery!==void 0))()&&(d()==="string"||d()==="number")},get children(){var S=w$();return S.addEventListener("change",C=>{const w=e.activeQuery.state.data,O=xi(w,h,d()==="number"?C.target.valueAsNumber:C.target.value);i.setQueryData(e.activeQuery.queryKey,O)}),be(C=>{var w=d()==="number"?"number":"text",O=fe(r().value,r().editableInput);return w!==C.e&&re(S,"type",C.e=w),O!==C.t&&se(S,C.t=O),C},{e:void 0,t:void 0}),be(()=>S.value=e.value),S}}),D(ve,{get when(){return d()==="boolean"},get children(){var S=Em();return W(S,D(E$,{get activeQuery(){return e.activeQuery},dataPath:h,get value(){return e.value}}),null),W(S,()=>Zl(e.value),null),be(()=>se(S,fe(r().value,r().actions,r().editableInput))),S}})]}}),null),W(p,D(ve,{get when(){return e.editable&&e.itemsDeletable&&e.activeQuery!==void 0},get children(){return D(Tm,{get activeQuery(){return e.activeQuery},dataPath:h})}}),null),be(S=>{var C=r().row,w=r().label;return C!==S.e&&se(p,S.e=C),w!==S.t&&se(v,S.t=w),S},{e:void 0,t:void 0}),p}}),null),be(()=>se(m,r().entry)),m})()}var J1=(e,t)=>{const{colors:n,font:r,size:i,border:s}=V,o=(a,l)=>e==="light"?a:l;return{entry:t`
80
80
  & * {
81
81
  font-size: ${r.size.xs};
82
82
  font-family:
@@ -188,7 +188,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
188
188
  outline: 2px solid ${n.blue[800]};
189
189
  outline-offset: 2px;
190
190
  }
191
- `}},io=e=>Q1("light",e),so=e=>Q1("dark",e);ku(["click"]);var _$=he('<div><div aria-hidden=true></div><button type=button aria-label="Open Tanstack query devtools"class=tsqd-open-btn>'),Ya=he("<div>"),k$=he('<aside aria-label="Tanstack query devtools"><div></div><button aria-label="Close tanstack query devtools">'),O$=he("<select name=tsqd-queries-filter-sort>"),E$=he("<select name=tsqd-mutations-filter-sort>"),A$=he("<span>Asc"),T$=he("<span>Desc"),P$=he('<button aria-label="Open in picture-in-picture mode"title="Open in picture-in-picture mode">'),j$=he("<div>Settings"),M$=he("<span>Position"),$$=he("<span>Top"),L$=he("<span>Bottom"),D$=he("<span>Left"),I$=he("<span>Right"),R$=he("<span>Theme"),N$=he("<span>Light"),F$=he("<span>Dark"),B$=he("<span>System"),q$=he("<div><div class=tsqd-queries-container>"),z$=he("<div><div class=tsqd-mutations-container>"),H$=he('<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>'),Tm=he("<option>Sort by "),U$=he("<div class=tsqd-query-disabled-indicator>disabled"),G$=he("<div class=tsqd-query-static-indicator>static"),Y1=he("<button><div></div><code class=tsqd-query-hash>"),V$=he("<div role=tooltip id=tsqd-status-tooltip>"),K$=he("<span>"),W$=he("<button><span></span><span>"),Q$=he("<button><span></span> Error"),Y$=he('<div><span></span>Trigger Error<select><option value=""disabled selected>'),X$=he('<div class="tsqd-query-details-explorer-container tsqd-query-details-data-explorer">'),Z$=he("<form><textarea name=data></textarea><div><span></span><div><button type=button>Cancel</button><button>Save"),J$=he('<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">'),eL=he("<option>"),tL=he('<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">'),[sn,rc]=ce(null),[Wr,X1]=ce(null),[Mn,vh]=ce(0),[Oo,nL]=ce(!1),rL=e=>{const t=xt(),n=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,r=U(()=>t()==="dark"?En(n):On(n)),i=U(()=>ye().onlineManager);xr(()=>{const d=i().subscribe(f=>{nL(!f)});_e(()=>{d()})});const s=Zf(),o=U(()=>ye().buttonPosition||iT),a=U(()=>e.localStore.open==="true"?!0:e.localStore.open==="false"?!1:ye().initialIsOpen||sT),l=U(()=>e.localStore.position||ye().position||Xd);let u;xe(()=>{const d=u.parentElement,f=e.localStore.height||wb,h=e.localStore.width||Sb,g=l();d.style.setProperty("--tsqd-panel-height",`${g==="top"?"-":""}${f}px`),d.style.setProperty("--tsqd-panel-width",`${g==="left"?"-":""}${h}px`)}),xr(()=>{const d=()=>{const f=u.parentElement,h=getComputedStyle(f).fontSize;f.style.setProperty("--tsqd-font-size",h)};d(),window.addEventListener("focus",d),_e(()=>{window.removeEventListener("focus",d)})});const c=U(()=>{var d;return(d=e.localStore.pip_open)!=null?d:"false"});return[D(ve,{get when(){return U(()=>!!s().pipWindow)()&&c()=="true"},get children(){return D(av,{get mount(){var d;return(d=s().pipWindow)==null?void 0:d.document.body},get children(){return D(iL,{get children(){return D(bh,e)}})}})}}),(()=>{var d=Ya(),f=u;return typeof f=="function"?Xs(f,d):u=d,K(d,D(Gy,{name:"tsqd-panel-transition",get children(){return D(ve,{get when(){return U(()=>!!(a()&&!s().pipWindow))()&&c()=="false"},get children(){return D(oL,{get localStore(){return e.localStore},get setLocalStore(){return e.setLocalStore}})}})}}),null),K(d,D(Gy,{name:"tsqd-button-transition",get children(){return D(ve,{get when(){return!a()},get children(){var h=_$(),g=h.firstChild,m=g.nextSibling;return K(g,D(_m,{})),m.$$click=()=>e.setLocalStore("open","true"),K(m,D(_m,{})),be(()=>se(h,fe(r().devtoolsBtn,r()[`devtoolsBtn-position-${o()}`],"tsqd-open-btn-container"))),h}})}}),null),be(()=>se(d,fe(n`
191
+ `}},ao=e=>J1("light",e),lo=e=>J1("dark",e);Au(["click"]);var A$=he('<div><div aria-hidden=true></div><button type=button aria-label="Open Tanstack query devtools"class=tsqd-open-btn>'),el=he("<div>"),T$=he('<aside aria-label="Tanstack query devtools"><div></div><button aria-label="Close tanstack query devtools">'),P$=he("<select name=tsqd-queries-filter-sort>"),j$=he("<select name=tsqd-mutations-filter-sort>"),M$=he("<span>Asc"),$$=he("<span>Desc"),L$=he('<button aria-label="Open in picture-in-picture mode"title="Open in picture-in-picture mode">'),D$=he("<div>Settings"),I$=he("<span>Position"),R$=he("<span>Top"),N$=he("<span>Bottom"),F$=he("<span>Left"),B$=he("<span>Right"),q$=he("<span>Theme"),z$=he("<span>Light"),H$=he("<span>Dark"),U$=he("<span>System"),G$=he("<div><div class=tsqd-queries-container>"),K$=he("<div><div class=tsqd-mutations-container>"),V$=he('<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>'),jm=he("<option>Sort by "),W$=he("<div class=tsqd-query-disabled-indicator>disabled"),Q$=he("<div class=tsqd-query-static-indicator>static"),ex=he("<button><div></div><code class=tsqd-query-hash>"),Y$=he("<div role=tooltip id=tsqd-status-tooltip>"),X$=he("<span>"),Z$=he("<button><span></span><span>"),J$=he("<button><span></span> Error"),eL=he('<div><span></span>Trigger Error<select><option value=""disabled selected>'),tL=he('<div class="tsqd-query-details-explorer-container tsqd-query-details-data-explorer">'),nL=he("<form><textarea name=data></textarea><div><span></span><div><button type=button>Cancel</button><button>Save"),rL=he('<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">'),iL=he("<option>"),sL=he('<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">'),[on,oc]=ce(null),[Xr,tx]=ce(null),[$n,xh]=ce(0),[To,oL]=ce(!1),aL=e=>{const t=xt(),n=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,r=K(()=>t()==="dark"?An(n):En(n)),i=K(()=>ye().onlineManager);Cr(()=>{const d=i().subscribe(f=>{oL(!f)});_e(()=>{d()})});const s=eh(),o=K(()=>ye().buttonPosition||lT),a=K(()=>e.localStore.open==="true"?!0:e.localStore.open==="false"?!1:ye().initialIsOpen||uT),l=K(()=>e.localStore.position||ye().position||Jd);let u;xe(()=>{const d=u.parentElement,f=e.localStore.height||kb,h=e.localStore.width||Ob,g=l();d.style.setProperty("--tsqd-panel-height",`${g==="top"?"-":""}${f}px`),d.style.setProperty("--tsqd-panel-width",`${g==="left"?"-":""}${h}px`)}),Cr(()=>{const d=()=>{const f=u.parentElement,h=getComputedStyle(f).fontSize;f.style.setProperty("--tsqd-font-size",h)};d(),window.addEventListener("focus",d),_e(()=>{window.removeEventListener("focus",d)})});const c=K(()=>{var d;return(d=e.localStore.pip_open)!=null?d:"false"});return[D(ve,{get when(){return K(()=>!!s().pipWindow)()&&c()=="true"},get children(){return D(dv,{get mount(){var d;return(d=s().pipWindow)==null?void 0:d.document.body},get children(){return D(lL,{get children(){return D(wh,e)}})}})}}),(()=>{var d=el(),f=u;return typeof f=="function"?eo(f,d):u=d,W(d,D(Vy,{name:"tsqd-panel-transition",get children(){return D(ve,{get when(){return K(()=>!!(a()&&!s().pipWindow))()&&c()=="false"},get children(){return D(cL,{get localStore(){return e.localStore},get setLocalStore(){return e.setLocalStore}})}})}}),null),W(d,D(Vy,{name:"tsqd-button-transition",get children(){return D(ve,{get when(){return!a()},get children(){var h=A$(),g=h.firstChild,m=g.nextSibling;return W(g,D(Om,{})),m.$$click=()=>e.setLocalStore("open","true"),W(m,D(Om,{})),be(()=>se(h,fe(r().devtoolsBtn,r()[`devtoolsBtn-position-${o()}`],"tsqd-open-btn-container"))),h}})}}),null),be(()=>se(d,fe(n`
192
192
  & .tsqd-panel-transition-exit-active,
193
193
  & .tsqd-panel-transition-enter-active {
194
194
  transition:
@@ -214,54 +214,54 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
214
214
  transform: ${o()==="relative"?"none;":o()==="top-left"?"translateX(-72px);":o()==="top-right"?"translateX(72px);":"translateY(72px);"};
215
215
  opacity: 0;
216
216
  }
217
- `,"tsqd-transitions-container"))),d})()]},iL=e=>{const t=Zf(),n=xt(),r=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,i=U(()=>n()==="dark"?En(r):On(r)),s=()=>{const{colors:o}=V,a=(l,u)=>n()==="dark"?u:l;return Mn()<Bi?r`
217
+ `,"tsqd-transitions-container"))),d})()]},lL=e=>{const t=eh(),n=xt(),r=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,i=K(()=>n()==="dark"?An(r):En(r)),s=()=>{const{colors:o}=V,a=(l,u)=>n()==="dark"?u:l;return $n()<Hi?r`
218
218
  flex-direction: column;
219
219
  background-color: ${a(o.gray[300],o.gray[600])};
220
220
  `:r`
221
221
  flex-direction: row;
222
222
  background-color: ${a(o.gray[200],o.darkGray[900])};
223
- `};return xe(()=>{const o=t().pipWindow,a=()=>{o&&vh(o.innerWidth)};o&&(o.addEventListener("resize",a),a()),_e(()=>{o&&o.removeEventListener("resize",a)})}),(()=>{var o=Ya();return o.style.setProperty("--tsqd-font-size","16px"),o.style.setProperty("max-height","100vh"),o.style.setProperty("height","100vh"),o.style.setProperty("width","100vw"),K(o,()=>e.children),be(()=>se(o,fe(i().panel,s(),{[r`
223
+ `};return xe(()=>{const o=t().pipWindow,a=()=>{o&&xh(o.innerWidth)};o&&(o.addEventListener("resize",a),a()),_e(()=>{o&&o.removeEventListener("resize",a)})}),(()=>{var o=el();return o.style.setProperty("--tsqd-font-size","16px"),o.style.setProperty("max-height","100vh"),o.style.setProperty("height","100vh"),o.style.setProperty("width","100vw"),W(o,()=>e.children),be(()=>se(o,fe(i().panel,s(),{[r`
224
224
  min-width: min-content;
225
- `]:Mn()<Yf},"tsqd-main-panel"))),o})()},sL=e=>{const t=xt(),n=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,r=U(()=>t()==="dark"?En(n):On(n));let i;xr(()=>{Tb(i,({width:o},a)=>{a===i&&vh(o)})});const s=()=>{const{colors:o}=V,a=(l,u)=>t()==="dark"?u:l;return Mn()<Bi?n`
225
+ `]:$n()<Zf},"tsqd-main-panel"))),o})()},uL=e=>{const t=xt(),n=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,r=K(()=>t()==="dark"?An(n):En(n));let i;Cr(()=>{$b(i,({width:o},a)=>{a===i&&xh(o)})});const s=()=>{const{colors:o}=V,a=(l,u)=>t()==="dark"?u:l;return $n()<Hi?n`
226
226
  flex-direction: column;
227
227
  background-color: ${a(o.gray[300],o.gray[600])};
228
228
  `:n`
229
229
  flex-direction: row;
230
230
  background-color: ${a(o.gray[200],o.darkGray[900])};
231
- `};return(()=>{var o=Ya(),a=i;return typeof a=="function"?Xs(a,o):i=o,o.style.setProperty("--tsqd-font-size","16px"),K(o,()=>e.children),be(()=>se(o,fe(r().parentPanel,s(),{[n`
231
+ `};return(()=>{var o=el(),a=i;return typeof a=="function"?eo(a,o):i=o,o.style.setProperty("--tsqd-font-size","16px"),W(o,()=>e.children),be(()=>se(o,fe(r().parentPanel,s(),{[n`
232
232
  min-width: min-content;
233
- `]:Mn()<Yf},"tsqd-main-panel"))),o})()},oL=e=>{const t=xt(),n=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,r=U(()=>t()==="dark"?En(n):On(n)),[i,s]=ce(!1),o=U(()=>e.localStore.position||ye().position||Xd),a=c=>{const d=c.currentTarget.parentElement;if(!d)return;s(!0);const{height:f,width:h}=d.getBoundingClientRect(),g=c.clientX,m=c.clientY;let p=0;const v=i0(3.5),b=i0(12),S=w=>{if(w.preventDefault(),o()==="left"||o()==="right"){const O=o()==="right"?g-w.clientX:w.clientX-g;p=Math.round(h+O),p<b&&(p=b),e.setLocalStore("width",String(Math.round(p)));const x=d.getBoundingClientRect().width;Number(e.localStore.width)<x&&e.setLocalStore("width",String(x))}else{const O=o()==="bottom"?m-w.clientY:w.clientY-m;p=Math.round(f+O),p<v&&(p=v,rc(null)),e.setLocalStore("height",String(Math.round(p)))}},C=()=>{i()&&s(!1),document.removeEventListener("mousemove",S,!1),document.removeEventListener("mouseUp",C,!1)};document.addEventListener("mousemove",S,!1),document.addEventListener("mouseup",C,!1)};let l;xr(()=>{Tb(l,({width:c},d)=>{d===l&&vh(c)})}),xe(()=>{var m,p;const c=(p=(m=l.parentElement)==null?void 0:m.parentElement)==null?void 0:p.parentElement;if(!c)return;const d=e.localStore.position||Xd,f=DS("padding",d),h=e.localStore.position==="left"||e.localStore.position==="right",g=(({padding:v,paddingTop:b,paddingBottom:S,paddingLeft:C,paddingRight:w})=>({padding:v,paddingTop:b,paddingBottom:S,paddingLeft:C,paddingRight:w}))(c.style);c.style[f]=`${h?e.localStore.width:e.localStore.height}px`,_e(()=>{Object.entries(g).forEach(([v,b])=>{c.style[v]=b})})});const u=()=>{const{colors:c}=V,d=(f,h)=>t()==="dark"?h:f;return Mn()<Bi?n`
233
+ `]:$n()<Zf},"tsqd-main-panel"))),o})()},cL=e=>{const t=xt(),n=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,r=K(()=>t()==="dark"?An(n):En(n)),[i,s]=ce(!1),o=K(()=>e.localStore.position||ye().position||Jd),a=c=>{const d=c.currentTarget.parentElement;if(!d)return;s(!0);const{height:f,width:h}=d.getBoundingClientRect(),g=c.clientX,m=c.clientY;let p=0;const v=o0(3.5),b=o0(12),S=w=>{if(w.preventDefault(),o()==="left"||o()==="right"){const O=o()==="right"?g-w.clientX:w.clientX-g;p=Math.round(h+O),p<b&&(p=b),e.setLocalStore("width",String(Math.round(p)));const x=d.getBoundingClientRect().width;Number(e.localStore.width)<x&&e.setLocalStore("width",String(x))}else{const O=o()==="bottom"?m-w.clientY:w.clientY-m;p=Math.round(f+O),p<v&&(p=v,oc(null)),e.setLocalStore("height",String(Math.round(p)))}},C=()=>{i()&&s(!1),document.removeEventListener("mousemove",S,!1),document.removeEventListener("mouseUp",C,!1)};document.addEventListener("mousemove",S,!1),document.addEventListener("mouseup",C,!1)};let l;Cr(()=>{$b(l,({width:c},d)=>{d===l&&xh(c)})}),xe(()=>{var m,p;const c=(p=(m=l.parentElement)==null?void 0:m.parentElement)==null?void 0:p.parentElement;if(!c)return;const d=e.localStore.position||Jd,f=FS("padding",d),h=e.localStore.position==="left"||e.localStore.position==="right",g=(({padding:v,paddingTop:b,paddingBottom:S,paddingLeft:C,paddingRight:w})=>({padding:v,paddingTop:b,paddingBottom:S,paddingLeft:C,paddingRight:w}))(c.style);c.style[f]=`${h?e.localStore.width:e.localStore.height}px`,_e(()=>{Object.entries(g).forEach(([v,b])=>{c.style[v]=b})})});const u=()=>{const{colors:c}=V,d=(f,h)=>t()==="dark"?h:f;return $n()<Hi?n`
234
234
  flex-direction: column;
235
235
  background-color: ${d(c.gray[300],c.gray[600])};
236
236
  `:n`
237
237
  flex-direction: row;
238
238
  background-color: ${d(c.gray[200],c.darkGray[900])};
239
- `};return(()=>{var c=k$(),d=c.firstChild,f=d.nextSibling,h=l;return typeof h=="function"?Xs(h,c):l=c,d.$$mousedown=a,f.$$click=()=>e.setLocalStore("open","false"),K(f,D(Vo,{})),K(c,D(bh,e),null),be(g=>{var m=fe(r().panel,r()[`panel-position-${o()}`],u(),{[n`
239
+ `};return(()=>{var c=T$(),d=c.firstChild,f=d.nextSibling,h=l;return typeof h=="function"?eo(h,c):l=c,d.$$mousedown=a,f.$$click=()=>e.setLocalStore("open","false"),W(f,D(Yo,{})),W(c,D(wh,e),null),be(g=>{var m=fe(r().panel,r()[`panel-position-${o()}`],u(),{[n`
240
240
  min-width: min-content;
241
- `]:Mn()<Yf&&(o()==="right"||o()==="left")},"tsqd-main-panel"),p=o()==="bottom"||o()==="top"?`${e.localStore.height||wb}px`:"auto",v=o()==="right"||o()==="left"?`${e.localStore.width||Sb}px`:"auto",b=fe(r().dragHandle,r()[`dragHandle-position-${o()}`],"tsqd-drag-handle"),S=fe(r().closeBtn,r()[`closeBtn-position-${o()}`],"tsqd-minimize-btn");return m!==g.e&&se(c,g.e=m),p!==g.t&&((g.t=p)!=null?c.style.setProperty("height",p):c.style.removeProperty("height")),v!==g.a&&((g.a=v)!=null?c.style.setProperty("width",v):c.style.removeProperty("width")),b!==g.o&&se(d,g.o=b),S!==g.i&&se(f,g.i=S),g},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),c})()},bh=e=>{hL(),gL();let t;const n=xt(),r=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,i=U(()=>n()==="dark"?En(r):On(r)),s=Zf(),[o,a]=ce("queries"),l=U(()=>e.localStore.sort||aT),u=U(()=>Number(e.localStore.sortOrder)||Ny),c=U(()=>e.localStore.mutationSort||lT),d=U(()=>Number(e.localStore.mutationSortOrder)||Ny),f=U(()=>bd[l()]),h=U(()=>xd[c()]),g=U(()=>ye().onlineManager),m=U(()=>ye().client.getQueryCache()),p=U(()=>ye().client.getMutationCache()),v=pt(x=>x().getAll().length,!1),b=U(br(()=>[v(),e.localStore.filter,l(),u()],()=>{const x=m().getAll(),_=e.localStore.filter?x.filter(E=>Fy(E.queryHash,e.localStore.filter||"").passed):[...x];return f()?_.sort((E,P)=>f()(E,P)*u()):_})),S=jn(x=>x().getAll().length,!1),C=U(br(()=>[S(),e.localStore.mutationFilter,c(),d()],()=>{const x=p().getAll(),_=e.localStore.mutationFilter?x.filter(E=>{const P=`${E.options.mutationKey?JSON.stringify(E.options.mutationKey)+" - ":""}${new Date(E.state.submittedAt).toLocaleString()}`;return Fy(P,e.localStore.mutationFilter||"").passed}):[...x];return h()?_.sort((E,P)=>h()(E,P)*d()):_})),w=x=>{e.setLocalStore("position",x)},O=x=>{const k=getComputedStyle(t).getPropertyValue("--tsqd-font-size");x.style.setProperty("--tsqd-font-size",k)};return[(()=>{var x=H$(),_=x.firstChild,k=_.firstChild,E=k.firstChild,P=E.firstChild,M=P.nextSibling,B=M.firstChild,R=_.nextSibling,A=R.firstChild,j=A.firstChild,L=j.firstChild,H=j.nextSibling,Q=H.nextSibling,F=A.nextSibling,G=F.firstChild,ie=G.nextSibling,ae=t;return typeof ae=="function"?Xs(ae,x):t=x,E.$$click=()=>{if(!s().pipWindow&&!e.showPanelViewOnly){e.setLocalStore("open","false");return}e.onClose&&e.onClose()},K(M,()=>ye().queryFlavor,B),K(M,()=>ye().version,null),K(k,D(mn.Root,{get class(){return fe(i().viewToggle)},get value(){return o()},onChange:N=>{a(N),rc(null),X1(null)},get children(){return[D(mn.Item,{value:"queries",class:"tsqd-radio-toggle",get children(){return[D(mn.ItemInput,{}),D(mn.ItemControl,{get children(){return D(mn.ItemIndicator,{})}}),D(mn.ItemLabel,{title:"Toggle Queries View",children:"Queries"})]}}),D(mn.Item,{value:"mutations",class:"tsqd-radio-toggle",get children(){return[D(mn.ItemInput,{}),D(mn.ItemControl,{get children(){return D(mn.ItemIndicator,{})}}),D(mn.ItemLabel,{title:"Toggle Mutations View",children:"Mutations"})]}})]}}),null),K(_,D(ve,{get when(){return o()==="queries"},get children(){return D(uL,{})}}),null),K(_,D(ve,{get when(){return o()==="mutations"},get children(){return D(cL,{})}}),null),K(j,D(UM,{}),L),L.$$input=N=>{o()==="queries"?e.setLocalStore("filter",N.currentTarget.value):e.setLocalStore("mutationFilter",N.currentTarget.value)},K(H,D(ve,{get when(){return o()==="queries"},get children(){var N=O$();return N.addEventListener("change",le=>{e.setLocalStore("sort",le.currentTarget.value)}),K(N,()=>Object.keys(bd).map(le=>(()=>{var te=Tm();return te.firstChild,te.value=le,K(te,le,null),te})())),be(()=>N.value=l()),N}}),null),K(H,D(ve,{get when(){return o()==="mutations"},get children(){var N=E$();return N.addEventListener("change",le=>{e.setLocalStore("mutationSort",le.currentTarget.value)}),K(N,()=>Object.keys(xd).map(le=>(()=>{var te=Tm();return te.firstChild,te.value=le,K(te,le,null),te})())),be(()=>N.value=c()),N}}),null),K(H,D(Vo,{}),null),Q.$$click=()=>{o()==="queries"?e.setLocalStore("sortOrder",String(u()*-1)):e.setLocalStore("mutationSortOrder",String(d()*-1))},K(Q,D(ve,{get when(){return(o()==="queries"?u():d())===1},get children(){return[A$(),D(Sm,{})]}}),null),K(Q,D(ve,{get when(){return(o()==="queries"?u():d())===-1},get children(){return[T$(),D(Cm,{})]}}),null),G.$$click=()=>{o()==="queries"?(Vn({type:"CLEAR_QUERY_CACHE"}),m().clear()):(Vn({type:"CLEAR_MUTATION_CACHE"}),p().clear())},K(G,D(W1,{})),ie.$$click=()=>{g().setOnline(!g().isOnline())},K(ie,(()=>{var N=U(()=>!!Oo());return()=>N()?D(XM,{}):D(YM,{})})()),K(F,D(ve,{get when(){return U(()=>!s().pipWindow)()&&!s().disabled},get children(){var N=P$();return N.$$click=()=>{var le;s().requestPipWindow(Number(window.innerWidth),Number((le=e.localStore.height)!=null?le:500))},K(N,D(JM,{})),be(()=>se(N,fe(i().actionsBtn,"tsqd-actions-btn","tsqd-action-open-pip"))),N}}),null),K(F,D(ft.Root,{gutter:4,get children(){return[D(ft.Trigger,{get class(){return fe(i().actionsBtn,"tsqd-actions-btn","tsqd-action-settings")},get children(){return D(ZM,{})}}),D(ft.Portal,{ref:N=>O(N),get mount(){return U(()=>!!s().pipWindow)()?s().pipWindow.document.body:document.body},get children(){return D(ft.Content,{get class(){return fe(i().settingsMenu,"tsqd-settings-menu")},get children(){return[(()=>{var N=j$();return be(()=>se(N,fe(i().settingsMenuHeader,"tsqd-settings-menu-header"))),N})(),D(ve,{get when(){return!e.showPanelViewOnly},get children(){return D(ft.Sub,{overlap:!0,gutter:8,shift:-4,get children(){return[D(ft.SubTrigger,{get class(){return fe(i().settingsSubTrigger,"tsqd-settings-menu-sub-trigger","tsqd-settings-menu-sub-trigger-position")},get children(){return[M$(),D(Vo,{})]}}),D(ft.Portal,{ref:N=>O(N),get mount(){return U(()=>!!s().pipWindow)()?s().pipWindow.document.body:document.body},get children(){return D(ft.SubContent,{get class(){return fe(i().settingsMenu,"tsqd-settings-submenu")},get children(){return[D(ft.Item,{onSelect:()=>{w("top")},as:"button",get class(){return fe(i().settingsSubButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-top")},get children(){return[$$(),D(Sm,{})]}}),D(ft.Item,{onSelect:()=>{w("bottom")},as:"button",get class(){return fe(i().settingsSubButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-bottom")},get children(){return[L$(),D(Cm,{})]}}),D(ft.Item,{onSelect:()=>{w("left")},as:"button",get class(){return fe(i().settingsSubButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-left")},get children(){return[D$(),D(GM,{})]}}),D(ft.Item,{onSelect:()=>{w("right")},as:"button",get class(){return fe(i().settingsSubButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-right")},get children(){return[I$(),D(VM,{})]}})]}})}})]}})}}),D(ft.Sub,{overlap:!0,gutter:8,shift:-4,get children(){return[D(ft.SubTrigger,{get class(){return fe(i().settingsSubTrigger,"tsqd-settings-menu-sub-trigger","tsqd-settings-menu-sub-trigger-position")},get children(){return[R$(),D(Vo,{})]}}),D(ft.Portal,{ref:N=>O(N),get mount(){return U(()=>!!s().pipWindow)()?s().pipWindow.document.body:document.body},get children(){return D(ft.SubContent,{get class(){return fe(i().settingsMenu,"tsqd-settings-submenu")},get children(){return[D(ft.Item,{onSelect:()=>{e.setLocalStore("theme_preference","light")},as:"button",get class(){return fe(i().settingsSubButton,e.localStore.theme_preference==="light"&&i().themeSelectedButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-top")},get children(){return[N$(),D(KM,{})]}}),D(ft.Item,{onSelect:()=>{e.setLocalStore("theme_preference","dark")},as:"button",get class(){return fe(i().settingsSubButton,e.localStore.theme_preference==="dark"&&i().themeSelectedButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-bottom")},get children(){return[F$(),D(WM,{})]}}),D(ft.Item,{onSelect:()=>{e.setLocalStore("theme_preference","system")},as:"button",get class(){return fe(i().settingsSubButton,e.localStore.theme_preference==="system"&&i().themeSelectedButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-left")},get children(){return[B$(),D(QM,{})]}})]}})}})]}})]}})}})]}}),null),K(x,D(ve,{get when(){return o()==="queries"},get children(){var N=q$(),le=N.firstChild;return K(le,D(du,{by:te=>te.queryHash,get each(){return b()},children:te=>D(aL,{get query(){return te()}})})),be(()=>se(N,fe(i().overflowQueryContainer,"tsqd-queries-overflow-container"))),N}}),null),K(x,D(ve,{get when(){return o()==="mutations"},get children(){var N=z$(),le=N.firstChild;return K(le,D(du,{by:te=>te.mutationId,get each(){return C()},children:te=>D(lL,{get mutation(){return te()}})})),be(()=>se(N,fe(i().overflowQueryContainer,"tsqd-mutations-overflow-container"))),N}}),null),be(N=>{var le=fe(i().queriesContainer,Mn()<Bi&&(sn()||Wr())&&r`
241
+ `]:$n()<Zf&&(o()==="right"||o()==="left")},"tsqd-main-panel"),p=o()==="bottom"||o()==="top"?`${e.localStore.height||kb}px`:"auto",v=o()==="right"||o()==="left"?`${e.localStore.width||Ob}px`:"auto",b=fe(r().dragHandle,r()[`dragHandle-position-${o()}`],"tsqd-drag-handle"),S=fe(r().closeBtn,r()[`closeBtn-position-${o()}`],"tsqd-minimize-btn");return m!==g.e&&se(c,g.e=m),p!==g.t&&((g.t=p)!=null?c.style.setProperty("height",p):c.style.removeProperty("height")),v!==g.a&&((g.a=v)!=null?c.style.setProperty("width",v):c.style.removeProperty("width")),b!==g.o&&se(d,g.o=b),S!==g.i&&se(f,g.i=S),g},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),c})()},wh=e=>{pL(),vL();let t;const n=xt(),r=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,i=K(()=>n()==="dark"?An(r):En(r)),s=eh(),[o,a]=ce("queries"),l=K(()=>e.localStore.sort||dT),u=K(()=>Number(e.localStore.sortOrder)||By),c=K(()=>e.localStore.mutationSort||fT),d=K(()=>Number(e.localStore.mutationSortOrder)||By),f=K(()=>Sd[l()]),h=K(()=>Cd[c()]),g=K(()=>ye().onlineManager),m=K(()=>ye().client.getQueryCache()),p=K(()=>ye().client.getMutationCache()),v=pt(x=>x().getAll().length,!1),b=K(Sr(()=>[v(),e.localStore.filter,l(),u()],()=>{const x=m().getAll(),_=e.localStore.filter?x.filter(E=>qy(E.queryHash,e.localStore.filter||"").passed):[...x];return f()?_.sort((E,j)=>f()(E,j)*u()):_})),S=Mn(x=>x().getAll().length,!1),C=K(Sr(()=>[S(),e.localStore.mutationFilter,c(),d()],()=>{const x=p().getAll(),_=e.localStore.mutationFilter?x.filter(E=>{const j=`${E.options.mutationKey?JSON.stringify(E.options.mutationKey)+" - ":""}${new Date(E.state.submittedAt).toLocaleString()}`;return qy(j,e.localStore.mutationFilter||"").passed}):[...x];return h()?_.sort((E,j)=>h()(E,j)*d()):_})),w=x=>{e.setLocalStore("position",x)},O=x=>{const k=getComputedStyle(t).getPropertyValue("--tsqd-font-size");x.style.setProperty("--tsqd-font-size",k)};return[(()=>{var x=V$(),_=x.firstChild,k=_.firstChild,E=k.firstChild,j=E.firstChild,M=j.nextSibling,B=M.firstChild,R=_.nextSibling,A=R.firstChild,P=A.firstChild,L=P.firstChild,H=P.nextSibling,G=H.nextSibling,F=A.nextSibling,U=F.firstChild,ie=U.nextSibling,ae=t;return typeof ae=="function"?eo(ae,x):t=x,E.$$click=()=>{if(!s().pipWindow&&!e.showPanelViewOnly){e.setLocalStore("open","false");return}e.onClose&&e.onClose()},W(M,()=>ye().queryFlavor,B),W(M,()=>ye().version,null),W(k,D(pn.Root,{get class(){return fe(i().viewToggle)},get value(){return o()},onChange:N=>{a(N),oc(null),tx(null)},get children(){return[D(pn.Item,{value:"queries",class:"tsqd-radio-toggle",get children(){return[D(pn.ItemInput,{}),D(pn.ItemControl,{get children(){return D(pn.ItemIndicator,{})}}),D(pn.ItemLabel,{title:"Toggle Queries View",children:"Queries"})]}}),D(pn.Item,{value:"mutations",class:"tsqd-radio-toggle",get children(){return[D(pn.ItemInput,{}),D(pn.ItemControl,{get children(){return D(pn.ItemIndicator,{})}}),D(pn.ItemLabel,{title:"Toggle Mutations View",children:"Mutations"})]}})]}}),null),W(_,D(ve,{get when(){return o()==="queries"},get children(){return D(hL,{})}}),null),W(_,D(ve,{get when(){return o()==="mutations"},get children(){return D(gL,{})}}),null),W(P,D(WM,{}),L),L.$$input=N=>{o()==="queries"?e.setLocalStore("filter",N.currentTarget.value):e.setLocalStore("mutationFilter",N.currentTarget.value)},W(H,D(ve,{get when(){return o()==="queries"},get children(){var N=P$();return N.addEventListener("change",le=>{e.setLocalStore("sort",le.currentTarget.value)}),W(N,()=>Object.keys(Sd).map(le=>(()=>{var te=jm();return te.firstChild,te.value=le,W(te,le,null),te})())),be(()=>N.value=l()),N}}),null),W(H,D(ve,{get when(){return o()==="mutations"},get children(){var N=j$();return N.addEventListener("change",le=>{e.setLocalStore("mutationSort",le.currentTarget.value)}),W(N,()=>Object.keys(Cd).map(le=>(()=>{var te=jm();return te.firstChild,te.value=le,W(te,le,null),te})())),be(()=>N.value=c()),N}}),null),W(H,D(Yo,{}),null),G.$$click=()=>{o()==="queries"?e.setLocalStore("sortOrder",String(u()*-1)):e.setLocalStore("mutationSortOrder",String(d()*-1))},W(G,D(ve,{get when(){return(o()==="queries"?u():d())===1},get children(){return[M$(),D(_m,{})]}}),null),W(G,D(ve,{get when(){return(o()==="queries"?u():d())===-1},get children(){return[$$(),D(km,{})]}}),null),U.$$click=()=>{o()==="queries"?(Vn({type:"CLEAR_QUERY_CACHE"}),m().clear()):(Vn({type:"CLEAR_MUTATION_CACHE"}),p().clear())},W(U,D(Z1,{})),ie.$$click=()=>{g().setOnline(!g().isOnline())},W(ie,(()=>{var N=K(()=>!!To());return()=>N()?D(t$,{}):D(e$,{})})()),W(F,D(ve,{get when(){return K(()=>!s().pipWindow)()&&!s().disabled},get children(){var N=L$();return N.$$click=()=>{var le;s().requestPipWindow(Number(window.innerWidth),Number((le=e.localStore.height)!=null?le:500))},W(N,D(r$,{})),be(()=>se(N,fe(i().actionsBtn,"tsqd-actions-btn","tsqd-action-open-pip"))),N}}),null),W(F,D(ft.Root,{gutter:4,get children(){return[D(ft.Trigger,{get class(){return fe(i().actionsBtn,"tsqd-actions-btn","tsqd-action-settings")},get children(){return D(n$,{})}}),D(ft.Portal,{ref:N=>O(N),get mount(){return K(()=>!!s().pipWindow)()?s().pipWindow.document.body:document.body},get children(){return D(ft.Content,{get class(){return fe(i().settingsMenu,"tsqd-settings-menu")},get children(){return[(()=>{var N=D$();return be(()=>se(N,fe(i().settingsMenuHeader,"tsqd-settings-menu-header"))),N})(),D(ve,{get when(){return!e.showPanelViewOnly},get children(){return D(ft.Sub,{overlap:!0,gutter:8,shift:-4,get children(){return[D(ft.SubTrigger,{get class(){return fe(i().settingsSubTrigger,"tsqd-settings-menu-sub-trigger","tsqd-settings-menu-sub-trigger-position")},get children(){return[I$(),D(Yo,{})]}}),D(ft.Portal,{ref:N=>O(N),get mount(){return K(()=>!!s().pipWindow)()?s().pipWindow.document.body:document.body},get children(){return D(ft.SubContent,{get class(){return fe(i().settingsMenu,"tsqd-settings-submenu")},get children(){return[D(ft.Item,{onSelect:()=>{w("top")},as:"button",get class(){return fe(i().settingsSubButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-top")},get children(){return[R$(),D(_m,{})]}}),D(ft.Item,{onSelect:()=>{w("bottom")},as:"button",get class(){return fe(i().settingsSubButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-bottom")},get children(){return[N$(),D(km,{})]}}),D(ft.Item,{onSelect:()=>{w("left")},as:"button",get class(){return fe(i().settingsSubButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-left")},get children(){return[F$(),D(QM,{})]}}),D(ft.Item,{onSelect:()=>{w("right")},as:"button",get class(){return fe(i().settingsSubButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-right")},get children(){return[B$(),D(YM,{})]}})]}})}})]}})}}),D(ft.Sub,{overlap:!0,gutter:8,shift:-4,get children(){return[D(ft.SubTrigger,{get class(){return fe(i().settingsSubTrigger,"tsqd-settings-menu-sub-trigger","tsqd-settings-menu-sub-trigger-position")},get children(){return[q$(),D(Yo,{})]}}),D(ft.Portal,{ref:N=>O(N),get mount(){return K(()=>!!s().pipWindow)()?s().pipWindow.document.body:document.body},get children(){return D(ft.SubContent,{get class(){return fe(i().settingsMenu,"tsqd-settings-submenu")},get children(){return[D(ft.Item,{onSelect:()=>{e.setLocalStore("theme_preference","light")},as:"button",get class(){return fe(i().settingsSubButton,e.localStore.theme_preference==="light"&&i().themeSelectedButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-top")},get children(){return[z$(),D(XM,{})]}}),D(ft.Item,{onSelect:()=>{e.setLocalStore("theme_preference","dark")},as:"button",get class(){return fe(i().settingsSubButton,e.localStore.theme_preference==="dark"&&i().themeSelectedButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-bottom")},get children(){return[H$(),D(ZM,{})]}}),D(ft.Item,{onSelect:()=>{e.setLocalStore("theme_preference","system")},as:"button",get class(){return fe(i().settingsSubButton,e.localStore.theme_preference==="system"&&i().themeSelectedButton,"tsqd-settings-menu-position-btn","tsqd-settings-menu-position-btn-left")},get children(){return[U$(),D(JM,{})]}})]}})}})]}})]}})}})]}}),null),W(x,D(ve,{get when(){return o()==="queries"},get children(){var N=G$(),le=N.firstChild;return W(le,D(gu,{by:te=>te.queryHash,get each(){return b()},children:te=>D(dL,{get query(){return te()}})})),be(()=>se(N,fe(i().overflowQueryContainer,"tsqd-queries-overflow-container"))),N}}),null),W(x,D(ve,{get when(){return o()==="mutations"},get children(){var N=K$(),le=N.firstChild;return W(le,D(gu,{by:te=>te.mutationId,get each(){return C()},children:te=>D(fL,{get mutation(){return te()}})})),be(()=>se(N,fe(i().overflowQueryContainer,"tsqd-mutations-overflow-container"))),N}}),null),be(N=>{var le=fe(i().queriesContainer,$n()<Hi&&(on()||Xr())&&r`
242
242
  height: 50%;
243
243
  max-height: 50%;
244
- `,Mn()<Bi&&!(sn()||Wr())&&r`
244
+ `,$n()<Hi&&!(on()||Xr())&&r`
245
245
  height: 100%;
246
246
  max-height: 100%;
247
- `,"tsqd-queries-container"),te=fe(i().row,"tsqd-header"),me=i().logoAndToggleContainer,J=fe(i().logo,"tsqd-text-logo-container"),Se=fe(i().tanstackLogo,"tsqd-text-logo-tanstack"),ge=fe(i().queryFlavorLogo,"tsqd-text-logo-query-flavor"),ze=fe(i().row,"tsqd-filters-actions-container"),oe=fe(i().filtersContainer,"tsqd-filters-container"),He=fe(i().filterInput,"tsqd-query-filter-textfield-container"),lt=fe("tsqd-query-filter-textfield"),dt=fe(i().filterSelect,"tsqd-query-filter-sort-container"),Ne=`Sort order ${(o()==="queries"?u():d())===-1?"descending":"ascending"}`,Fe=(o()==="queries"?u():d())===-1,Y=fe(i().actionsContainer,"tsqd-actions-container"),Te=fe(i().actionsBtn,"tsqd-actions-btn","tsqd-action-clear-cache"),tt=`Clear ${o()} cache`,$e=fe(i().actionsBtn,Oo()&&i().actionsBtnOffline,"tsqd-actions-btn","tsqd-action-mock-offline-behavior"),ue=`${Oo()?"Unset offline mocking behavior":"Mock offline behavior"}`,W=Oo(),ne=`${Oo()?"Unset offline mocking behavior":"Mock offline behavior"}`;return le!==N.e&&se(x,N.e=le),te!==N.t&&se(_,N.t=te),me!==N.a&&se(k,N.a=me),J!==N.o&&se(E,N.o=J),Se!==N.i&&se(P,N.i=Se),ge!==N.n&&se(M,N.n=ge),ze!==N.s&&se(R,N.s=ze),oe!==N.h&&se(A,N.h=oe),He!==N.r&&se(j,N.r=He),lt!==N.d&&se(L,N.d=lt),dt!==N.l&&se(H,N.l=dt),Ne!==N.u&&re(Q,"aria-label",N.u=Ne),Fe!==N.c&&re(Q,"aria-pressed",N.c=Fe),Y!==N.w&&se(F,N.w=Y),Te!==N.m&&se(G,N.m=Te),tt!==N.f&&re(G,"title",N.f=tt),$e!==N.y&&se(ie,N.y=$e),ue!==N.g&&re(ie,"aria-label",N.g=ue),W!==N.p&&re(ie,"aria-pressed",N.p=W),ne!==N.b&&re(ie,"title",N.b=ne),N},{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(()=>L.value=o()==="queries"?e.localStore.filter||"":e.localStore.mutationFilter||""),x})(),D(ve,{get when(){return U(()=>o()==="queries")()&&sn()},get children(){return D(dL,{})}}),D(ve,{get when(){return U(()=>o()==="mutations")()&&Wr()},get children(){return D(fL,{})}})]},aL=e=>{const t=xt(),n=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,r=U(()=>t()==="dark"?En(n):On(n)),{colors:i,alpha:s}=V,o=(g,m)=>t()==="dark"?m:g,a=pt(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=pt(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),u=pt(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),c=pt(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=pt(g=>{var m,p;return(p=(m=g().find({queryKey:e.query.queryKey}))==null?void 0:m.getObserversCount())!=null?p:0},!0,g=>g.query.queryHash===e.query.queryHash),f=U(()=>IS({queryState:a(),observerCount:d(),isStale:c()})),h=()=>f()==="gray"?n`
247
+ `,"tsqd-queries-container"),te=fe(i().row,"tsqd-header"),me=i().logoAndToggleContainer,J=fe(i().logo,"tsqd-text-logo-container"),Se=fe(i().tanstackLogo,"tsqd-text-logo-tanstack"),ge=fe(i().queryFlavorLogo,"tsqd-text-logo-query-flavor"),ze=fe(i().row,"tsqd-filters-actions-container"),oe=fe(i().filtersContainer,"tsqd-filters-container"),He=fe(i().filterInput,"tsqd-query-filter-textfield-container"),lt=fe("tsqd-query-filter-textfield"),dt=fe(i().filterSelect,"tsqd-query-filter-sort-container"),Ne=`Sort order ${(o()==="queries"?u():d())===-1?"descending":"ascending"}`,Fe=(o()==="queries"?u():d())===-1,Y=fe(i().actionsContainer,"tsqd-actions-container"),Te=fe(i().actionsBtn,"tsqd-actions-btn","tsqd-action-clear-cache"),tt=`Clear ${o()} cache`,$e=fe(i().actionsBtn,To()&&i().actionsBtnOffline,"tsqd-actions-btn","tsqd-action-mock-offline-behavior"),ue=`${To()?"Unset offline mocking behavior":"Mock offline behavior"}`,Q=To(),ne=`${To()?"Unset offline mocking behavior":"Mock offline behavior"}`;return le!==N.e&&se(x,N.e=le),te!==N.t&&se(_,N.t=te),me!==N.a&&se(k,N.a=me),J!==N.o&&se(E,N.o=J),Se!==N.i&&se(j,N.i=Se),ge!==N.n&&se(M,N.n=ge),ze!==N.s&&se(R,N.s=ze),oe!==N.h&&se(A,N.h=oe),He!==N.r&&se(P,N.r=He),lt!==N.d&&se(L,N.d=lt),dt!==N.l&&se(H,N.l=dt),Ne!==N.u&&re(G,"aria-label",N.u=Ne),Fe!==N.c&&re(G,"aria-pressed",N.c=Fe),Y!==N.w&&se(F,N.w=Y),Te!==N.m&&se(U,N.m=Te),tt!==N.f&&re(U,"title",N.f=tt),$e!==N.y&&se(ie,N.y=$e),ue!==N.g&&re(ie,"aria-label",N.g=ue),Q!==N.p&&re(ie,"aria-pressed",N.p=Q),ne!==N.b&&re(ie,"title",N.b=ne),N},{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(()=>L.value=o()==="queries"?e.localStore.filter||"":e.localStore.mutationFilter||""),x})(),D(ve,{get when(){return K(()=>o()==="queries")()&&on()},get children(){return D(yL,{})}}),D(ve,{get when(){return K(()=>o()==="mutations")()&&Xr()},get children(){return D(mL,{})}})]},dL=e=>{const t=xt(),n=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,r=K(()=>t()==="dark"?An(n):En(n)),{colors:i,alpha:s}=V,o=(g,m)=>t()==="dark"?m:g,a=pt(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=pt(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),u=pt(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),c=pt(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=pt(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=K(()=>BS({queryState:a(),observerCount:d(),isStale:c()})),h=()=>f()==="gray"?n`
248
248
  background-color: ${o(i[f()][200],i[f()][700])};
249
249
  color: ${o(i[f()][700],i[f()][300])};
250
250
  `:n`
251
251
  background-color: ${o(i[f()][200]+s[80],i[f()][900])};
252
252
  color: ${o(i[f()][800],i[f()][300])};
253
- `;return D(ve,{get when(){return a()},get children(){var g=Y1(),m=g.firstChild,p=m.nextSibling;return g.$$click=()=>rc(e.query.queryHash===sn()?null:e.query.queryHash),K(m,d),K(p,()=>e.query.queryHash),K(g,D(ve,{get when(){return l()},get children(){return U$()}}),null),K(g,D(ve,{get when(){return u()},get children(){return G$()}}),null),be(v=>{var b=fe(r().queryRow,sn()===e.query.queryHash&&r().selectedQueryRow,"tsqd-query-row"),S=`Query key ${e.query.queryHash}`,C=fe(h(),"tsqd-query-observer-count");return b!==v.e&&se(g,v.e=b),S!==v.t&&re(g,"aria-label",v.t=S),C!==v.a&&se(m,v.a=C),v},{e:void 0,t:void 0,a:void 0}),g}})},lL=e=>{const t=xt(),n=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,r=U(()=>t()==="dark"?En(n):On(n)),{colors:i,alpha:s}=V,o=(f,h)=>t()==="dark"?h:f,a=jn(f=>{const g=f().getAll().find(m=>m.mutationId===e.mutation.mutationId);return g==null?void 0:g.state}),l=jn(f=>{const g=f().getAll().find(m=>m.mutationId===e.mutation.mutationId);return g?g.state.isPaused:!1}),u=jn(f=>{const g=f().getAll().find(m=>m.mutationId===e.mutation.mutationId);return g?g.state.status:"idle"}),c=U(()=>os({isPaused:l(),status:u()})),d=()=>c()==="gray"?n`
253
+ `;return D(ve,{get when(){return a()},get children(){var g=ex(),m=g.firstChild,p=m.nextSibling;return g.$$click=()=>oc(e.query.queryHash===on()?null:e.query.queryHash),W(m,d),W(p,()=>e.query.queryHash),W(g,D(ve,{get when(){return l()},get children(){return W$()}}),null),W(g,D(ve,{get when(){return u()},get children(){return Q$()}}),null),be(v=>{var b=fe(r().queryRow,on()===e.query.queryHash&&r().selectedQueryRow,"tsqd-query-row"),S=`Query key ${e.query.queryHash}`,C=fe(h(),"tsqd-query-observer-count");return b!==v.e&&se(g,v.e=b),S!==v.t&&re(g,"aria-label",v.t=S),C!==v.a&&se(m,v.a=C),v},{e:void 0,t:void 0,a:void 0}),g}})},fL=e=>{const t=xt(),n=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,r=K(()=>t()==="dark"?An(n):En(n)),{colors:i,alpha:s}=V,o=(f,h)=>t()==="dark"?h:f,a=Mn(f=>{const g=f().getAll().find(m=>m.mutationId===e.mutation.mutationId);return g==null?void 0:g.state}),l=Mn(f=>{const g=f().getAll().find(m=>m.mutationId===e.mutation.mutationId);return g?g.state.isPaused:!1}),u=Mn(f=>{const g=f().getAll().find(m=>m.mutationId===e.mutation.mutationId);return g?g.state.status:"idle"}),c=K(()=>us({isPaused:l(),status:u()})),d=()=>c()==="gray"?n`
254
254
  background-color: ${o(i[c()][200],i[c()][700])};
255
255
  color: ${o(i[c()][700],i[c()][300])};
256
256
  `:n`
257
257
  background-color: ${o(i[c()][200]+s[80],i[c()][900])};
258
258
  color: ${o(i[c()][800],i[c()][300])};
259
- `;return D(ve,{get when(){return a()},get children(){var f=Y1(),h=f.firstChild,g=h.nextSibling;return f.$$click=()=>{X1(e.mutation.mutationId===Wr()?null:e.mutation.mutationId)},K(h,D(ve,{get when(){return c()==="purple"},get children(){return D(u$,{})}}),null),K(h,D(ve,{get when(){return c()==="green"},get children(){return D(o$,{})}}),null),K(h,D(ve,{get when(){return c()==="red"},get children(){return D(l$,{})}}),null),K(h,D(ve,{get when(){return c()==="yellow"},get children(){return D(a$,{})}}),null),K(g,D(ve,{get when(){return e.mutation.options.mutationKey},get children(){return[U(()=>JSON.stringify(e.mutation.options.mutationKey))," -"," "]}}),null),K(g,()=>new Date(e.mutation.state.submittedAt).toLocaleString(),null),be(m=>{var p=fe(r().queryRow,Wr()===e.mutation.mutationId&&r().selectedQueryRow,"tsqd-query-row"),v=`Mutation submitted at ${new Date(e.mutation.state.submittedAt).toLocaleString()}`,b=fe(d(),"tsqd-query-observer-count");return p!==m.e&&se(f,m.e=p),v!==m.t&&re(f,"aria-label",m.t=v),b!==m.a&&se(h,m.a=b),m},{e:void 0,t:void 0,a:void 0}),f}})},uL=()=>{const e=pt(l=>l().getAll().filter(u=>ts(u)==="stale").length),t=pt(l=>l().getAll().filter(u=>ts(u)==="fresh").length),n=pt(l=>l().getAll().filter(u=>ts(u)==="fetching").length),r=pt(l=>l().getAll().filter(u=>ts(u)==="paused").length),i=pt(l=>l().getAll().filter(u=>ts(u)==="inactive").length),s=xt(),o=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,a=U(()=>s()==="dark"?En(o):On(o));return(()=>{var l=Ya();return K(l,D(fr,{label:"Fresh",color:"green",get count(){return t()}}),null),K(l,D(fr,{label:"Fetching",color:"blue",get count(){return n()}}),null),K(l,D(fr,{label:"Paused",color:"purple",get count(){return r()}}),null),K(l,D(fr,{label:"Stale",color:"yellow",get count(){return e()}}),null),K(l,D(fr,{label:"Inactive",color:"gray",get count(){return i()}}),null),be(()=>se(l,fe(a().queryStatusContainer,"tsqd-query-status-container"))),l})()},cL=()=>{const e=jn(a=>a().getAll().filter(l=>os({isPaused:l.state.isPaused,status:l.state.status})==="green").length),t=jn(a=>a().getAll().filter(l=>os({isPaused:l.state.isPaused,status:l.state.status})==="yellow").length),n=jn(a=>a().getAll().filter(l=>os({isPaused:l.state.isPaused,status:l.state.status})==="purple").length),r=jn(a=>a().getAll().filter(l=>os({isPaused:l.state.isPaused,status:l.state.status})==="red").length),i=xt(),s=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,o=U(()=>i()==="dark"?En(s):On(s));return(()=>{var a=Ya();return K(a,D(fr,{label:"Paused",color:"purple",get count(){return n()}}),null),K(a,D(fr,{label:"Pending",color:"yellow",get count(){return t()}}),null),K(a,D(fr,{label:"Success",color:"green",get count(){return e()}}),null),K(a,D(fr,{label:"Error",color:"red",get count(){return r()}}),null),be(()=>se(a,fe(o().queryStatusContainer,"tsqd-query-status-container"))),a})()},fr=e=>{const t=xt(),n=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,r=U(()=>t()==="dark"?En(n):On(n)),{colors:i,alpha:s}=V,o=(h,g)=>t()==="dark"?g:h;let a;const[l,u]=ce(!1),[c,d]=ce(!1),f=U(()=>!(sn()&&Mn()<rT&&Mn()>Bi||Mn()<Bi));return(()=>{var h=W$(),g=h.firstChild,m=g.nextSibling,p=a;return typeof p=="function"?Xs(p,h):a=h,h.addEventListener("mouseleave",()=>{u(!1),d(!1)}),h.addEventListener("mouseenter",()=>u(!0)),h.addEventListener("blur",()=>d(!1)),h.addEventListener("focus",()=>d(!0)),iv(h,Ae({get disabled(){return f()},get class(){return fe(r().queryStatusTag,!f()&&n`
259
+ `;return D(ve,{get when(){return a()},get children(){var f=ex(),h=f.firstChild,g=h.nextSibling;return f.$$click=()=>{tx(e.mutation.mutationId===Xr()?null:e.mutation.mutationId)},W(h,D(ve,{get when(){return c()==="purple"},get children(){return D(h$,{})}}),null),W(h,D(ve,{get when(){return c()==="green"},get children(){return D(c$,{})}}),null),W(h,D(ve,{get when(){return c()==="red"},get children(){return D(f$,{})}}),null),W(h,D(ve,{get when(){return c()==="yellow"},get children(){return D(d$,{})}}),null),W(g,D(ve,{get when(){return e.mutation.options.mutationKey},get children(){return[K(()=>JSON.stringify(e.mutation.options.mutationKey))," -"," "]}}),null),W(g,()=>new Date(e.mutation.state.submittedAt).toLocaleString(),null),be(m=>{var p=fe(r().queryRow,Xr()===e.mutation.mutationId&&r().selectedQueryRow,"tsqd-query-row"),v=`Mutation submitted at ${new Date(e.mutation.state.submittedAt).toLocaleString()}`,b=fe(d(),"tsqd-query-observer-count");return p!==m.e&&se(f,m.e=p),v!==m.t&&re(f,"aria-label",m.t=v),b!==m.a&&se(h,m.a=b),m},{e:void 0,t:void 0,a:void 0}),f}})},hL=()=>{const e=pt(l=>l().getAll().filter(u=>is(u)==="stale").length),t=pt(l=>l().getAll().filter(u=>is(u)==="fresh").length),n=pt(l=>l().getAll().filter(u=>is(u)==="fetching").length),r=pt(l=>l().getAll().filter(u=>is(u)==="paused").length),i=pt(l=>l().getAll().filter(u=>is(u)==="inactive").length),s=xt(),o=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,a=K(()=>s()==="dark"?An(o):En(o));return(()=>{var l=el();return W(l,D(gr,{label:"Fresh",color:"green",get count(){return t()}}),null),W(l,D(gr,{label:"Fetching",color:"blue",get count(){return n()}}),null),W(l,D(gr,{label:"Paused",color:"purple",get count(){return r()}}),null),W(l,D(gr,{label:"Stale",color:"yellow",get count(){return e()}}),null),W(l,D(gr,{label:"Inactive",color:"gray",get count(){return i()}}),null),be(()=>se(l,fe(a().queryStatusContainer,"tsqd-query-status-container"))),l})()},gL=()=>{const e=Mn(a=>a().getAll().filter(l=>us({isPaused:l.state.isPaused,status:l.state.status})==="green").length),t=Mn(a=>a().getAll().filter(l=>us({isPaused:l.state.isPaused,status:l.state.status})==="yellow").length),n=Mn(a=>a().getAll().filter(l=>us({isPaused:l.state.isPaused,status:l.state.status})==="purple").length),r=Mn(a=>a().getAll().filter(l=>us({isPaused:l.state.isPaused,status:l.state.status})==="red").length),i=xt(),s=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,o=K(()=>i()==="dark"?An(s):En(s));return(()=>{var a=el();return W(a,D(gr,{label:"Paused",color:"purple",get count(){return n()}}),null),W(a,D(gr,{label:"Pending",color:"yellow",get count(){return t()}}),null),W(a,D(gr,{label:"Success",color:"green",get count(){return e()}}),null),W(a,D(gr,{label:"Error",color:"red",get count(){return r()}}),null),be(()=>se(a,fe(o().queryStatusContainer,"tsqd-query-status-container"))),a})()},gr=e=>{const t=xt(),n=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,r=K(()=>t()==="dark"?An(n):En(n)),{colors:i,alpha:s}=V,o=(h,g)=>t()==="dark"?g:h;let a;const[l,u]=ce(!1),[c,d]=ce(!1),f=K(()=>!(on()&&$n()<aT&&$n()>Hi||$n()<Hi));return(()=>{var h=Z$(),g=h.firstChild,m=g.nextSibling,p=a;return typeof p=="function"?eo(p,h):a=h,h.addEventListener("mouseleave",()=>{u(!1),d(!1)}),h.addEventListener("mouseenter",()=>u(!0)),h.addEventListener("blur",()=>d(!1)),h.addEventListener("focus",()=>d(!0)),lv(h,Ae({get disabled(){return f()},get class(){return fe(r().queryStatusTag,!f()&&n`
260
260
  cursor: pointer;
261
261
  &:hover {
262
262
  background: ${o(i.gray[200],i.darkGray[400])}${s[80]};
263
263
  }
264
- `,"tsqd-query-status-tag",`tsqd-query-status-tag-${e.label.toLowerCase()}`)}},()=>l()||c()?{"aria-describedby":"tsqd-status-tooltip"}:{}),!1,!0),K(h,D(ve,{get when(){return U(()=>!f())()&&(l()||c())},get children(){var v=V$();return K(v,()=>e.label),be(()=>se(v,fe(r().statusTooltip,"tsqd-query-status-tooltip"))),v}}),g),K(h,D(ve,{get when(){return f()},get children(){var v=K$();return K(v,()=>e.label),be(()=>se(v,fe(r().queryStatusTagLabel,"tsqd-query-status-tag-label"))),v}}),m),K(m,()=>e.count),be(v=>{var b=fe(n`
264
+ `,"tsqd-query-status-tag",`tsqd-query-status-tag-${e.label.toLowerCase()}`)}},()=>l()||c()?{"aria-describedby":"tsqd-status-tooltip"}:{}),!1,!0),W(h,D(ve,{get when(){return K(()=>!f())()&&(l()||c())},get children(){var v=Y$();return W(v,()=>e.label),be(()=>se(v,fe(r().statusTooltip,"tsqd-query-status-tooltip"))),v}}),g),W(h,D(ve,{get when(){return f()},get children(){var v=X$();return W(v,()=>e.label),be(()=>se(v,fe(r().queryStatusTagLabel,"tsqd-query-status-tag-label"))),v}}),m),W(m,()=>e.count),be(v=>{var b=fe(n`
265
265
  width: ${V.size[1.5]};
266
266
  height: ${V.size[1.5]};
267
267
  border-radius: ${V.border.radius.full};
@@ -269,7 +269,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
269
269
  `,"tsqd-query-status-tag-dot"),S=fe(r().queryStatusCount,e.count>0&&e.color!=="gray"&&n`
270
270
  background-color: ${o(i[e.color][100],i[e.color][900])};
271
271
  color: ${o(i[e.color][700],i[e.color][300])};
272
- `,"tsqd-query-status-tag-count");return b!==v.e&&se(g,v.e=b),S!==v.t&&se(m,v.t=S),v},{e:void 0,t:void 0}),h})()},dL=()=>{const e=xt(),t=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,n=U(()=>e()==="dark"?En(t):On(t)),{colors:r}=V,i=(k,E)=>e()==="dark"?E:k,s=ye().client,[o,a]=ce(!1),[l,u]=ce("view"),[c,d]=ce(!1),f=U(()=>ye().errorTypes||[]),h=pt(k=>k().getAll().find(E=>E.queryHash===sn()),!1),g=pt(k=>k().getAll().find(E=>E.queryHash===sn()),!1),m=pt(k=>{var E;return(E=k().getAll().find(P=>P.queryHash===sn()))==null?void 0:E.state},!1),p=pt(k=>{var E;return(E=k().getAll().find(P=>P.queryHash===sn()))==null?void 0:E.state.data},!1),v=pt(k=>{const E=k().getAll().find(P=>P.queryHash===sn());return E?ts(E):"inactive"}),b=pt(k=>{const E=k().getAll().find(P=>P.queryHash===sn());return E?E.state.status:"pending"}),S=pt(k=>{var E,P;return(P=(E=k().getAll().find(M=>M.queryHash===sn()))==null?void 0:E.getObserversCount())!=null?P:0}),C=U(()=>RS(v())),w=()=>{var E,P;Vn({type:"REFETCH",queryHash:(E=h())==null?void 0:E.queryHash});const k=(P=h())==null?void 0:P.fetch();k==null||k.catch(()=>{})},O=k=>{var B;const E=h();if(!E)return;Vn({type:"TRIGGER_ERROR",queryHash:E.queryHash,metadata:{error:k==null?void 0:k.name}});const P=(B=k==null?void 0:k.initializer(E))!=null?B:new Error("Unknown error from devtools"),M=E.options;E.setState({status:"error",error:P,fetchMeta:{...E.state.fetchMeta,__previousQueryOptions:M}})},x=()=>{const k=h();if(!k)return;Vn({type:"RESTORE_LOADING",queryHash:k.queryHash});const E=k.state,P=k.state.fetchMeta?k.state.fetchMeta.__previousQueryOptions:null;k.cancel({silent:!0}),k.setState({...E,fetchStatus:"idle",fetchMeta:null}),P&&k.fetch(P)};xe(()=>{v()!=="fetching"&&a(!1)});const _=()=>C()==="gray"?t`
272
+ `,"tsqd-query-status-tag-count");return b!==v.e&&se(g,v.e=b),S!==v.t&&se(m,v.t=S),v},{e:void 0,t:void 0}),h})()},yL=()=>{const e=xt(),t=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,n=K(()=>e()==="dark"?An(t):En(t)),{colors:r}=V,i=(k,E)=>e()==="dark"?E:k,s=ye().client,[o,a]=ce(!1),[l,u]=ce("view"),[c,d]=ce(!1),f=K(()=>ye().errorTypes||[]),h=pt(k=>k().getAll().find(E=>E.queryHash===on()),!1),g=pt(k=>k().getAll().find(E=>E.queryHash===on()),!1),m=pt(k=>{var E;return(E=k().getAll().find(j=>j.queryHash===on()))==null?void 0:E.state},!1),p=pt(k=>{var E;return(E=k().getAll().find(j=>j.queryHash===on()))==null?void 0:E.state.data},!1),v=pt(k=>{const E=k().getAll().find(j=>j.queryHash===on());return E?is(E):"inactive"}),b=pt(k=>{const E=k().getAll().find(j=>j.queryHash===on());return E?E.state.status:"pending"}),S=pt(k=>{var E,j;return(j=(E=k().getAll().find(M=>M.queryHash===on()))==null?void 0:E.getObserversCount())!=null?j:0}),C=K(()=>qS(v())),w=()=>{var E,j;Vn({type:"REFETCH",queryHash:(E=h())==null?void 0:E.queryHash});const k=(j=h())==null?void 0:j.fetch();k==null||k.catch(()=>{})},O=k=>{var B;const E=h();if(!E)return;Vn({type:"TRIGGER_ERROR",queryHash:E.queryHash,metadata:{error:k==null?void 0:k.name}});const j=(B=k==null?void 0:k.initializer(E))!=null?B:new Error("Unknown error from devtools"),M=E.options;E.setState({status:"error",error:j,fetchMeta:{...E.state.fetchMeta,__previousQueryOptions:M}})},x=()=>{const k=h();if(!k)return;Vn({type:"RESTORE_LOADING",queryHash:k.queryHash});const E=k.state,j=k.state.fetchMeta?k.state.fetchMeta.__previousQueryOptions:null;k.cancel({silent:!0}),k.setState({...E,fetchStatus:"idle",fetchMeta:null}),j&&k.fetch(j)};xe(()=>{v()!=="fetching"&&a(!1)});const _=()=>C()==="gray"?t`
273
273
  background-color: ${i(r[C()][200],r[C()][700])};
274
274
  color: ${i(r[C()][700],r[C()][300])};
275
275
  border-color: ${i(r[C()][400],r[C()][600])};
@@ -277,17 +277,17 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
277
277
  background-color: ${i(r[C()][100],r[C()][900])};
278
278
  color: ${i(r[C()][700],r[C()][300])};
279
279
  border-color: ${i(r[C()][400],r[C()][600])};
280
- `;return D(ve,{get when(){return U(()=>!!h())()&&m()},get children(){var k=J$(),E=k.firstChild,P=E.nextSibling,M=P.firstChild,B=M.firstChild,R=B.firstChild,A=B.nextSibling,j=M.nextSibling,L=j.firstChild,H=L.nextSibling,Q=j.nextSibling,F=Q.firstChild,G=F.nextSibling,ie=P.nextSibling,ae=ie.nextSibling,N=ae.firstChild,le=N.firstChild,te=N.nextSibling,me=te.firstChild,J=te.nextSibling,Se=J.firstChild,ge=J.nextSibling,ze=ge.firstChild,oe=ge.nextSibling,He=oe.firstChild,lt=He.nextSibling,dt=ae.nextSibling;dt.firstChild;var Ne=dt.nextSibling,Fe=Ne.nextSibling;return K(R,()=>Wl(h().queryKey,!0)),K(A,v),K(H,S),K(G,()=>new Date(m().dataUpdatedAt).toLocaleTimeString()),N.$$click=w,te.$$click=()=>{var Y;Vn({type:"INVALIDATE",queryHash:(Y=h())==null?void 0:Y.queryHash}),s.invalidateQueries(h())},J.$$click=()=>{var Y;Vn({type:"RESET",queryHash:(Y=h())==null?void 0:Y.queryHash}),s.resetQueries(h())},ge.$$click=()=>{var Y;Vn({type:"REMOVE",queryHash:(Y=h())==null?void 0:Y.queryHash}),s.removeQueries(h()),rc(null)},oe.$$click=()=>{var Y;if(((Y=h())==null?void 0:Y.state.data)===void 0)a(!0),x();else{const Te=h();if(!Te)return;Vn({type:"TRIGGER_LOADING",queryHash:Te.queryHash});const tt=Te.options;Te.fetch({...tt,queryFn:()=>new Promise(()=>{}),gcTime:-1}),Te.setState({data:void 0,status:"pending",fetchMeta:{...Te.state.fetchMeta,__previousQueryOptions:tt}})}},K(oe,()=>b()==="pending"?"Restore":"Trigger",lt),K(ae,D(ve,{get when(){return f().length===0||b()==="error"},get children(){var Y=Q$(),Te=Y.firstChild,tt=Te.nextSibling;return Y.$$click=()=>{var $e;h().state.error?(Vn({type:"RESTORE_ERROR",queryHash:($e=h())==null?void 0:$e.queryHash}),s.resetQueries(h())):O()},K(Y,()=>b()==="error"?"Restore":"Trigger",tt),be($e=>{var ue=fe(t`
280
+ `;return D(ve,{get when(){return K(()=>!!h())()&&m()},get children(){var k=rL(),E=k.firstChild,j=E.nextSibling,M=j.firstChild,B=M.firstChild,R=B.firstChild,A=B.nextSibling,P=M.nextSibling,L=P.firstChild,H=L.nextSibling,G=P.nextSibling,F=G.firstChild,U=F.nextSibling,ie=j.nextSibling,ae=ie.nextSibling,N=ae.firstChild,le=N.firstChild,te=N.nextSibling,me=te.firstChild,J=te.nextSibling,Se=J.firstChild,ge=J.nextSibling,ze=ge.firstChild,oe=ge.nextSibling,He=oe.firstChild,lt=He.nextSibling,dt=ae.nextSibling;dt.firstChild;var Ne=dt.nextSibling,Fe=Ne.nextSibling;return W(R,()=>Zl(h().queryKey,!0)),W(A,v),W(H,S),W(U,()=>new Date(m().dataUpdatedAt).toLocaleTimeString()),N.$$click=w,te.$$click=()=>{var Y;Vn({type:"INVALIDATE",queryHash:(Y=h())==null?void 0:Y.queryHash}),s.invalidateQueries(h())},J.$$click=()=>{var Y;Vn({type:"RESET",queryHash:(Y=h())==null?void 0:Y.queryHash}),s.resetQueries(h())},ge.$$click=()=>{var Y;Vn({type:"REMOVE",queryHash:(Y=h())==null?void 0:Y.queryHash}),s.removeQueries(h()),oc(null)},oe.$$click=()=>{var Y;if(((Y=h())==null?void 0:Y.state.data)===void 0)a(!0),x();else{const Te=h();if(!Te)return;Vn({type:"TRIGGER_LOADING",queryHash:Te.queryHash});const tt=Te.options;Te.fetch({...tt,queryFn:()=>new Promise(()=>{}),gcTime:-1}),Te.setState({data:void 0,status:"pending",fetchMeta:{...Te.state.fetchMeta,__previousQueryOptions:tt}})}},W(oe,()=>b()==="pending"?"Restore":"Trigger",lt),W(ae,D(ve,{get when(){return f().length===0||b()==="error"},get children(){var Y=J$(),Te=Y.firstChild,tt=Te.nextSibling;return Y.$$click=()=>{var $e;h().state.error?(Vn({type:"RESTORE_ERROR",queryHash:($e=h())==null?void 0:$e.queryHash}),s.resetQueries(h())):O()},W(Y,()=>b()==="error"?"Restore":"Trigger",tt),be($e=>{var ue=fe(t`
281
281
  color: ${i(r.red[500],r.red[400])};
282
- `,"tsqd-query-details-actions-btn","tsqd-query-details-action-error"),W=b()==="pending",ne=t`
282
+ `,"tsqd-query-details-actions-btn","tsqd-query-details-action-error"),Q=b()==="pending",ne=t`
283
283
  background-color: ${i(r.red[500],r.red[400])};
284
- `;return ue!==$e.e&&se(Y,$e.e=ue),W!==$e.t&&(Y.disabled=$e.t=W),ne!==$e.a&&se(Te,$e.a=ne),$e},{e:void 0,t:void 0,a:void 0}),Y}}),null),K(ae,D(ve,{get when(){return!(f().length===0||b()==="error")},get children(){var Y=Y$(),Te=Y.firstChild,tt=Te.nextSibling,$e=tt.nextSibling;return $e.firstChild,$e.addEventListener("change",ue=>{const W=f().find(ne=>ne.name===ue.currentTarget.value);O(W)}),K($e,D(L3,{get each(){return f()},children:ue=>(()=>{var W=eL();return K(W,()=>ue.name),be(()=>W.value=ue.name),W})()}),null),K(Y,D(Vo,{}),null),be(ue=>{var W=fe(n().actionsSelect,"tsqd-query-details-actions-btn","tsqd-query-details-action-error-multiple"),ne=t`
284
+ `;return ue!==$e.e&&se(Y,$e.e=ue),Q!==$e.t&&(Y.disabled=$e.t=Q),ne!==$e.a&&se(Te,$e.a=ne),$e},{e:void 0,t:void 0,a:void 0}),Y}}),null),W(ae,D(ve,{get when(){return!(f().length===0||b()==="error")},get children(){var Y=eL(),Te=Y.firstChild,tt=Te.nextSibling,$e=tt.nextSibling;return $e.firstChild,$e.addEventListener("change",ue=>{const Q=f().find(ne=>ne.name===ue.currentTarget.value);O(Q)}),W($e,D(N3,{get each(){return f()},children:ue=>(()=>{var Q=iL();return W(Q,()=>ue.name),be(()=>Q.value=ue.name),Q})()}),null),W(Y,D(Yo,{}),null),be(ue=>{var Q=fe(n().actionsSelect,"tsqd-query-details-actions-btn","tsqd-query-details-action-error-multiple"),ne=t`
285
285
  background-color: ${V.colors.red[400]};
286
- `,ee=b()==="pending";return W!==ue.e&&se(Y,ue.e=W),ne!==ue.t&&se(Te,ue.t=ne),ee!==ue.a&&($e.disabled=ue.a=ee),ue},{e:void 0,t:void 0,a:void 0}),Y}}),null),K(dt,()=>l()==="view"?"Explorer":"Editor",null),K(k,D(ve,{get when(){return l()==="view"},get children(){var Y=X$();return K(Y,D(Gr,{label:"Data",defaultExpanded:["Data"],get value(){return p()},editable:!0,onEdit:()=>u("edit"),get activeQuery(){return h()}})),be(Te=>(Te=V.size[2])!=null?Y.style.setProperty("padding",Te):Y.style.removeProperty("padding")),Y}}),Ne),K(k,D(ve,{get when(){return l()==="edit"},get children(){var Y=Z$(),Te=Y.firstChild,tt=Te.nextSibling,$e=tt.firstChild,ue=$e.nextSibling,W=ue.firstChild,ne=W.nextSibling;return Y.addEventListener("submit",ee=>{ee.preventDefault();const gt=new FormData(ee.currentTarget).get("data");try{const we=JSON.parse(gt);h().setState({...h().state,data:we}),u("view")}catch(we){d(!0)}}),Te.addEventListener("focus",()=>d(!1)),K($e,()=>c()?"Invalid Value":""),W.$$click=()=>u("view"),be(ee=>{var Ce=fe(n().devtoolsEditForm,"tsqd-query-details-data-editor"),gt=n().devtoolsEditTextarea,we=c(),Je=n().devtoolsEditFormActions,Be=n().devtoolsEditFormError,An=n().devtoolsEditFormActionContainer,Kt=fe(n().devtoolsEditFormAction,t`
286
+ `,ee=b()==="pending";return Q!==ue.e&&se(Y,ue.e=Q),ne!==ue.t&&se(Te,ue.t=ne),ee!==ue.a&&($e.disabled=ue.a=ee),ue},{e:void 0,t:void 0,a:void 0}),Y}}),null),W(dt,()=>l()==="view"?"Explorer":"Editor",null),W(k,D(ve,{get when(){return l()==="view"},get children(){var Y=tL();return W(Y,D(Wr,{label:"Data",defaultExpanded:["Data"],get value(){return p()},editable:!0,onEdit:()=>u("edit"),get activeQuery(){return h()}})),be(Te=>(Te=V.size[2])!=null?Y.style.setProperty("padding",Te):Y.style.removeProperty("padding")),Y}}),Ne),W(k,D(ve,{get when(){return l()==="edit"},get children(){var Y=nL(),Te=Y.firstChild,tt=Te.nextSibling,$e=tt.firstChild,ue=$e.nextSibling,Q=ue.firstChild,ne=Q.nextSibling;return Y.addEventListener("submit",ee=>{ee.preventDefault();const gt=new FormData(ee.currentTarget).get("data");try{const we=JSON.parse(gt);h().setState({...h().state,data:we}),u("view")}catch(we){d(!0)}}),Te.addEventListener("focus",()=>d(!1)),W($e,()=>c()?"Invalid Value":""),Q.$$click=()=>u("view"),be(ee=>{var Ce=fe(n().devtoolsEditForm,"tsqd-query-details-data-editor"),gt=n().devtoolsEditTextarea,we=c(),Je=n().devtoolsEditFormActions,Be=n().devtoolsEditFormError,Tn=n().devtoolsEditFormActionContainer,Vt=fe(n().devtoolsEditFormAction,t`
287
287
  color: ${i(r.gray[600],r.gray[300])};
288
- `),fn=fe(n().devtoolsEditFormAction,t`
288
+ `),hn=fe(n().devtoolsEditFormAction,t`
289
289
  color: ${i(r.blue[600],r.blue[400])};
290
- `);return Ce!==ee.e&&se(Y,ee.e=Ce),gt!==ee.t&&se(Te,ee.t=gt),we!==ee.a&&re(Te,"data-error",ee.a=we),Je!==ee.o&&se(tt,ee.o=Je),Be!==ee.i&&se($e,ee.i=Be),An!==ee.n&&se(ue,ee.n=An),Kt!==ee.s&&se(W,ee.s=Kt),fn!==ee.h&&se(ne,ee.h=fn),ee},{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(()=>Te.value=JSON.stringify(p(),null,2)),Y}}),Ne),K(Fe,D(Gr,{label:"Query",defaultExpanded:["Query","queryKey"],get value(){return g()}})),be(Y=>{var Te=fe(n().detailsContainer,"tsqd-query-details-container"),tt=fe(n().detailsHeader,"tsqd-query-details-header"),$e=fe(n().detailsBody,"tsqd-query-details-summary-container"),ue=fe(n().queryDetailsStatus,_()),W=fe(n().detailsHeader,"tsqd-query-details-header"),ne=fe(n().actionsBody,"tsqd-query-details-actions-container"),ee=fe(t`
290
+ `);return Ce!==ee.e&&se(Y,ee.e=Ce),gt!==ee.t&&se(Te,ee.t=gt),we!==ee.a&&re(Te,"data-error",ee.a=we),Je!==ee.o&&se(tt,ee.o=Je),Be!==ee.i&&se($e,ee.i=Be),Tn!==ee.n&&se(ue,ee.n=Tn),Vt!==ee.s&&se(Q,ee.s=Vt),hn!==ee.h&&se(ne,ee.h=hn),ee},{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(()=>Te.value=JSON.stringify(p(),null,2)),Y}}),Ne),W(Fe,D(Wr,{label:"Query",defaultExpanded:["Query","queryKey"],get value(){return g()}})),be(Y=>{var Te=fe(n().detailsContainer,"tsqd-query-details-container"),tt=fe(n().detailsHeader,"tsqd-query-details-header"),$e=fe(n().detailsBody,"tsqd-query-details-summary-container"),ue=fe(n().queryDetailsStatus,_()),Q=fe(n().detailsHeader,"tsqd-query-details-header"),ne=fe(n().actionsBody,"tsqd-query-details-actions-container"),ee=fe(t`
291
291
  color: ${i(r.blue[600],r.blue[400])};
292
292
  `,"tsqd-query-details-actions-btn","tsqd-query-details-action-refetch"),Ce=v()==="fetching",gt=t`
293
293
  background-color: ${i(r.blue[600],r.blue[400])};
@@ -295,19 +295,19 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
295
295
  color: ${i(r.yellow[600],r.yellow[400])};
296
296
  `,"tsqd-query-details-actions-btn","tsqd-query-details-action-invalidate"),Je=b()==="pending",Be=t`
297
297
  background-color: ${i(r.yellow[600],r.yellow[400])};
298
- `,An=fe(t`
298
+ `,Tn=fe(t`
299
299
  color: ${i(r.gray[600],r.gray[300])};
300
- `,"tsqd-query-details-actions-btn","tsqd-query-details-action-reset"),Kt=b()==="pending",fn=t`
300
+ `,"tsqd-query-details-actions-btn","tsqd-query-details-action-reset"),Vt=b()==="pending",hn=t`
301
301
  background-color: ${i(r.gray[600],r.gray[400])};
302
- `,Nn=fe(t`
302
+ `,Fn=fe(t`
303
303
  color: ${i(r.pink[500],r.pink[400])};
304
- `,"tsqd-query-details-actions-btn","tsqd-query-details-action-remove"),nr=v()==="fetching",Qi=t`
304
+ `,"tsqd-query-details-actions-btn","tsqd-query-details-action-remove"),ir=v()==="fetching",Zi=t`
305
305
  background-color: ${i(r.pink[500],r.pink[400])};
306
- `,Or=fe(t`
306
+ `,Tr=fe(t`
307
307
  color: ${i(r.cyan[500],r.cyan[400])};
308
- `,"tsqd-query-details-actions-btn","tsqd-query-details-action-loading"),Xa=o(),oo=t`
308
+ `,"tsqd-query-details-actions-btn","tsqd-query-details-action-loading"),tl=o(),uo=t`
309
309
  background-color: ${i(r.cyan[500],r.cyan[400])};
310
- `,ao=fe(n().detailsHeader,"tsqd-query-details-header"),lo=fe(n().detailsHeader,"tsqd-query-details-header"),Yi=V.size[2];return Te!==Y.e&&se(k,Y.e=Te),tt!==Y.t&&se(E,Y.t=tt),$e!==Y.a&&se(P,Y.a=$e),ue!==Y.o&&se(A,Y.o=ue),W!==Y.i&&se(ie,Y.i=W),ne!==Y.n&&se(ae,Y.n=ne),ee!==Y.s&&se(N,Y.s=ee),Ce!==Y.h&&(N.disabled=Y.h=Ce),gt!==Y.r&&se(le,Y.r=gt),we!==Y.d&&se(te,Y.d=we),Je!==Y.l&&(te.disabled=Y.l=Je),Be!==Y.u&&se(me,Y.u=Be),An!==Y.c&&se(J,Y.c=An),Kt!==Y.w&&(J.disabled=Y.w=Kt),fn!==Y.m&&se(Se,Y.m=fn),Nn!==Y.f&&se(ge,Y.f=Nn),nr!==Y.y&&(ge.disabled=Y.y=nr),Qi!==Y.g&&se(ze,Y.g=Qi),Or!==Y.p&&se(oe,Y.p=Or),Xa!==Y.b&&(oe.disabled=Y.b=Xa),oo!==Y.T&&se(He,Y.T=oo),ao!==Y.A&&se(dt,Y.A=ao),lo!==Y.O&&se(Ne,Y.O=lo),Yi!==Y.I&&((Y.I=Yi)!=null?Fe.style.setProperty("padding",Yi):Fe.style.removeProperty("padding")),Y},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0,y:void 0,g:void 0,p:void 0,b:void 0,T:void 0,A:void 0,O:void 0,I:void 0}),k}})},fL=()=>{const e=xt(),t=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,n=U(()=>e()==="dark"?En(t):On(t)),{colors:r}=V,i=(c,d)=>e()==="dark"?d:c,s=jn(c=>{const f=c().getAll().find(h=>h.mutationId===Wr());return f?f.state.isPaused:!1}),o=jn(c=>{const f=c().getAll().find(h=>h.mutationId===Wr());return f?f.state.status:"idle"}),a=U(()=>os({isPaused:s(),status:o()})),l=jn(c=>c().getAll().find(d=>d.mutationId===Wr()),!1),u=()=>a()==="gray"?t`
310
+ `,co=fe(n().detailsHeader,"tsqd-query-details-header"),fo=fe(n().detailsHeader,"tsqd-query-details-header"),Ji=V.size[2];return Te!==Y.e&&se(k,Y.e=Te),tt!==Y.t&&se(E,Y.t=tt),$e!==Y.a&&se(j,Y.a=$e),ue!==Y.o&&se(A,Y.o=ue),Q!==Y.i&&se(ie,Y.i=Q),ne!==Y.n&&se(ae,Y.n=ne),ee!==Y.s&&se(N,Y.s=ee),Ce!==Y.h&&(N.disabled=Y.h=Ce),gt!==Y.r&&se(le,Y.r=gt),we!==Y.d&&se(te,Y.d=we),Je!==Y.l&&(te.disabled=Y.l=Je),Be!==Y.u&&se(me,Y.u=Be),Tn!==Y.c&&se(J,Y.c=Tn),Vt!==Y.w&&(J.disabled=Y.w=Vt),hn!==Y.m&&se(Se,Y.m=hn),Fn!==Y.f&&se(ge,Y.f=Fn),ir!==Y.y&&(ge.disabled=Y.y=ir),Zi!==Y.g&&se(ze,Y.g=Zi),Tr!==Y.p&&se(oe,Y.p=Tr),tl!==Y.b&&(oe.disabled=Y.b=tl),uo!==Y.T&&se(He,Y.T=uo),co!==Y.A&&se(dt,Y.A=co),fo!==Y.O&&se(Ne,Y.O=fo),Ji!==Y.I&&((Y.I=Ji)!=null?Fe.style.setProperty("padding",Ji):Fe.style.removeProperty("padding")),Y},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0,y:void 0,g:void 0,p:void 0,b:void 0,T:void 0,A:void 0,O:void 0,I:void 0}),k}})},mL=()=>{const e=xt(),t=ye().shadowDOMTarget?Me.bind({target:ye().shadowDOMTarget}):Me,n=K(()=>e()==="dark"?An(t):En(t)),{colors:r}=V,i=(c,d)=>e()==="dark"?d:c,s=Mn(c=>{const f=c().getAll().find(h=>h.mutationId===Xr());return f?f.state.isPaused:!1}),o=Mn(c=>{const f=c().getAll().find(h=>h.mutationId===Xr());return f?f.state.status:"idle"}),a=K(()=>us({isPaused:s(),status:o()})),l=Mn(c=>c().getAll().find(d=>d.mutationId===Xr()),!1),u=()=>a()==="gray"?t`
311
311
  background-color: ${i(r[a()][200],r[a()][700])};
312
312
  color: ${i(r[a()][700],r[a()][300])};
313
313
  border-color: ${i(r[a()][400],r[a()][600])};
@@ -315,7 +315,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
315
315
  background-color: ${i(r[a()][100],r[a()][900])};
316
316
  color: ${i(r[a()][700],r[a()][300])};
317
317
  border-color: ${i(r[a()][400],r[a()][600])};
318
- `;return D(ve,{get when(){return l()},get children(){var c=tL(),d=c.firstChild,f=d.nextSibling,h=f.firstChild,g=h.firstChild,m=g.firstChild,p=g.nextSibling,v=h.nextSibling,b=v.firstChild,S=b.nextSibling,C=f.nextSibling,w=C.nextSibling,O=w.nextSibling,x=O.nextSibling,_=x.nextSibling,k=_.nextSibling,E=k.nextSibling,P=E.nextSibling;return K(m,D(ve,{get when(){return l().options.mutationKey},fallback:"No mutationKey found",get children(){return Wl(l().options.mutationKey,!0)}})),K(p,D(ve,{get when(){return a()==="purple"},children:"pending"}),null),K(p,D(ve,{get when(){return a()!=="purple"},get children(){return o()}}),null),K(S,()=>new Date(l().state.submittedAt).toLocaleTimeString()),K(w,D(Gr,{label:"Variables",defaultExpanded:["Variables"],get value(){return l().state.variables}})),K(x,D(Gr,{label:"Context",defaultExpanded:["Context"],get value(){return l().state.context}})),K(k,D(Gr,{label:"Data",defaultExpanded:["Data"],get value(){return l().state.data}})),K(P,D(Gr,{label:"Mutation",defaultExpanded:["Mutation"],get value(){return l()}})),be(M=>{var B=fe(n().detailsContainer,"tsqd-query-details-container"),R=fe(n().detailsHeader,"tsqd-query-details-header"),A=fe(n().detailsBody,"tsqd-query-details-summary-container"),j=fe(n().queryDetailsStatus,u()),L=fe(n().detailsHeader,"tsqd-query-details-header"),H=V.size[2],Q=fe(n().detailsHeader,"tsqd-query-details-header"),F=V.size[2],G=fe(n().detailsHeader,"tsqd-query-details-header"),ie=V.size[2],ae=fe(n().detailsHeader,"tsqd-query-details-header"),N=V.size[2];return B!==M.e&&se(c,M.e=B),R!==M.t&&se(d,M.t=R),A!==M.a&&se(f,M.a=A),j!==M.o&&se(p,M.o=j),L!==M.i&&se(C,M.i=L),H!==M.n&&((M.n=H)!=null?w.style.setProperty("padding",H):w.style.removeProperty("padding")),Q!==M.s&&se(O,M.s=Q),F!==M.h&&((M.h=F)!=null?x.style.setProperty("padding",F):x.style.removeProperty("padding")),G!==M.r&&se(_,M.r=G),ie!==M.d&&((M.d=ie)!=null?k.style.setProperty("padding",ie):k.style.removeProperty("padding")),ae!==M.l&&se(E,M.l=ae),N!==M.u&&((M.u=N)!=null?P.style.setProperty("padding",N):P.style.removeProperty("padding")),M},{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}})},mu=new Map,hL=()=>{const e=U(()=>ye().client.getQueryCache()),t=e().subscribe(n=>{x3(()=>{for(const[r,i]of mu.entries())i.shouldUpdate(n)&&i.setter(r(e))})});return _e(()=>{mu.clear(),t()}),t},pt=(e,t=!0,n=()=>!0)=>{const r=U(()=>ye().client.getQueryCache()),[i,s]=ce(e(r),t?void 0:{equals:!1});return xe(()=>{s(e(r))}),mu.set(e,{setter:s,shouldUpdate:n}),_e(()=>{mu.delete(e)}),i},pu=new Map,gL=()=>{const e=U(()=>ye().client.getMutationCache()),t=e().subscribe(()=>{for(const[n,r]of pu.entries())queueMicrotask(()=>{r(n(e))})});return _e(()=>{pu.clear(),t()}),t},jn=(e,t=!0)=>{const n=U(()=>ye().client.getMutationCache()),[r,i]=ce(e(n),t?void 0:{equals:!1});return xe(()=>{i(e(n))}),pu.set(e,i),_e(()=>{pu.delete(e)}),r},yL="@tanstack/query-devtools-event",Vn=({type:e,queryHash:t,metadata:n})=>{const r=new CustomEvent(yL,{detail:{type:e,queryHash:t,metadata:n},bubbles:!0,cancelable:!0});window.dispatchEvent(r)},Z1=(e,t)=>{const{colors:n,font:r,size:i,alpha:s,shadow:o,border:a}=V,l=(u,c)=>e==="light"?u:c;return{devtoolsBtn:t`
318
+ `;return D(ve,{get when(){return l()},get children(){var c=sL(),d=c.firstChild,f=d.nextSibling,h=f.firstChild,g=h.firstChild,m=g.firstChild,p=g.nextSibling,v=h.nextSibling,b=v.firstChild,S=b.nextSibling,C=f.nextSibling,w=C.nextSibling,O=w.nextSibling,x=O.nextSibling,_=x.nextSibling,k=_.nextSibling,E=k.nextSibling,j=E.nextSibling;return W(m,D(ve,{get when(){return l().options.mutationKey},fallback:"No mutationKey found",get children(){return Zl(l().options.mutationKey,!0)}})),W(p,D(ve,{get when(){return a()==="purple"},children:"pending"}),null),W(p,D(ve,{get when(){return a()!=="purple"},get children(){return o()}}),null),W(S,()=>new Date(l().state.submittedAt).toLocaleTimeString()),W(w,D(Wr,{label:"Variables",defaultExpanded:["Variables"],get value(){return l().state.variables}})),W(x,D(Wr,{label:"Context",defaultExpanded:["Context"],get value(){return l().state.context}})),W(k,D(Wr,{label:"Data",defaultExpanded:["Data"],get value(){return l().state.data}})),W(j,D(Wr,{label:"Mutation",defaultExpanded:["Mutation"],get value(){return l()}})),be(M=>{var B=fe(n().detailsContainer,"tsqd-query-details-container"),R=fe(n().detailsHeader,"tsqd-query-details-header"),A=fe(n().detailsBody,"tsqd-query-details-summary-container"),P=fe(n().queryDetailsStatus,u()),L=fe(n().detailsHeader,"tsqd-query-details-header"),H=V.size[2],G=fe(n().detailsHeader,"tsqd-query-details-header"),F=V.size[2],U=fe(n().detailsHeader,"tsqd-query-details-header"),ie=V.size[2],ae=fe(n().detailsHeader,"tsqd-query-details-header"),N=V.size[2];return B!==M.e&&se(c,M.e=B),R!==M.t&&se(d,M.t=R),A!==M.a&&se(f,M.a=A),P!==M.o&&se(p,M.o=P),L!==M.i&&se(C,M.i=L),H!==M.n&&((M.n=H)!=null?w.style.setProperty("padding",H):w.style.removeProperty("padding")),G!==M.s&&se(O,M.s=G),F!==M.h&&((M.h=F)!=null?x.style.setProperty("padding",F):x.style.removeProperty("padding")),U!==M.r&&se(_,M.r=U),ie!==M.d&&((M.d=ie)!=null?k.style.setProperty("padding",ie):k.style.removeProperty("padding")),ae!==M.l&&se(E,M.l=ae),N!==M.u&&((M.u=N)!=null?j.style.setProperty("padding",N):j.style.removeProperty("padding")),M},{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}})},bu=new Map,pL=()=>{const e=K(()=>ye().client.getQueryCache()),t=e().subscribe(n=>{_3(()=>{for(const[r,i]of bu.entries())i.shouldUpdate(n)&&i.setter(r(e))})});return _e(()=>{bu.clear(),t()}),t},pt=(e,t=!0,n=()=>!0)=>{const r=K(()=>ye().client.getQueryCache()),[i,s]=ce(e(r),t?void 0:{equals:!1});return xe(()=>{s(e(r))}),bu.set(e,{setter:s,shouldUpdate:n}),_e(()=>{bu.delete(e)}),i},xu=new Map,vL=()=>{const e=K(()=>ye().client.getMutationCache()),t=e().subscribe(()=>{for(const[n,r]of xu.entries())queueMicrotask(()=>{r(n(e))})});return _e(()=>{xu.clear(),t()}),t},Mn=(e,t=!0)=>{const n=K(()=>ye().client.getMutationCache()),[r,i]=ce(e(n),t?void 0:{equals:!1});return xe(()=>{i(e(n))}),xu.set(e,i),_e(()=>{xu.delete(e)}),r},bL="@tanstack/query-devtools-event",Vn=({type:e,queryHash:t,metadata:n})=>{const r=new CustomEvent(bL,{detail:{type:e,queryHash:t,metadata:n},bubbles:!0,cancelable:!0});window.dispatchEvent(r)},nx=(e,t)=>{const{colors:n,font:r,size:i,alpha:s,shadow:o,border:a}=V,l=(u,c)=>e==="light"?u:c;return{devtoolsBtn:t`
319
319
  z-index: 100000;
320
320
  position: fixed;
321
321
  padding: 4px;
@@ -1280,17 +1280,17 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1280
1280
  opacity: 0.6;
1281
1281
  cursor: not-allowed;
1282
1282
  }
1283
- `}},On=e=>Z1("light",e),En=e=>Z1("dark",e);ku(["click","mousedown","input"]);var mL=e=>{const[t,n]=bb({prefix:"TanstackQueryDevtools"}),r=kv(),i=U(()=>{const s=t.theme_preference||xb;return s!=="system"?s:r()});return D(Xf.Provider,{value:e,get children(){return D(_b,{localStore:t,setLocalStore:n,get children(){return D(Jf.Provider,{value:i,get children(){return D(rL,{localStore:t,setLocalStore:n})}})}})}})},pL=mL;const vL=Object.freeze(Object.defineProperty({__proto__:null,default:pL},Symbol.toStringTag,{value:"Module"}));var bL=e=>{const[t,n]=bb({prefix:"TanstackQueryDevtools"}),r=kv(),i=U(()=>{const s=t.theme_preference||xb;return s!=="system"?s:r()});return D(Xf.Provider,{value:e,get children(){return D(_b,{disabled:!0,localStore:t,setLocalStore:n,get children(){return D(Jf.Provider,{value:i,get children(){return D(sL,{get children(){return D(bh,{localStore:t,setLocalStore:n,get onClose(){return e.onClose},showPanelViewOnly:!0})}})}})}})}})},xL=bL;const wL=Object.freeze(Object.defineProperty({__proto__:null,default:xL},Symbol.toStringTag,{value:"Module"}));function J1(e){var t=e.children,n=e.description,r=e.title;return y.jsxs(T.Paper.Header,{children:[r&&y.jsx(T.Title,{className:Oe({"yst-mb-3":n||t}),children:r}),n&&(typeof n=="string"?y.jsx("p",{children:n}):n),t]})}function Kc(e,t){return kL(e)||_L(e,t)||CL(e,t)||SL()}function SL(){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 CL(e,t){if(e){if(typeof e=="string")return Pm(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)?Pm(e,t):void 0}}function Pm(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 _L(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function kL(e){if(Array.isArray(e))return e}var OL=function(t){var n=t.isOpen,r=t.onClose,i=t.groupToEdit,s=t.allBrands,o=Rn(),a=o.brandId,l=z.useState(""),u=Kc(l,2),c=u[0],d=u[1],f=z.useState([]),h=Kc(f,2),g=h[0],m=h[1],p=z.useState(!1),v=Kc(p,2),b=v[0],S=v[1],C=Gt();z.useEffect(function(){if(n&&i&&i.type==="group"){var L;d(String(i.name||""));var H=((L=i.groupedBrands)===null||L===void 0?void 0:L.map(function(Q){return String(Q.id||"")}))||[];m(H)}},[n,i]);var w=n2({mutation:{onSuccess:function(){C.invalidateQueries({queryKey:Zl(a)}),M()},onError:function(H){console.error("Error creating brand group:",H)}}}),O=w.mutate,x=w.isPending,_=J5({mutation:{onSuccess:function(){C.invalidateQueries({queryKey:Zl(a)}),M(),A()},onError:function(H){console.error("Error deleting brand group:",H),window.alert("An error occurred while ungrouping the brands. Please try again later.")}}}),k=_.mutate,E=_.isPending,P=function(){!c.trim()||!(i!=null&&i.id)||O({brandId:a,data:{groupName:c.trim(),brandIds:g.map(function(H){return Number(H)})}})},M=function(){d(""),m([]),r()},B=function(){return g.map(function(H){if(i&&i.type==="group"){var Q,F=(Q=i.groupedBrands)===null||Q===void 0?void 0:Q.find(function(ie){return String(ie.id)===H});if(F)return F.name||""}var G=s.find(function(ie){return String(ie.id)===H});return G?G.type==="group"?"Group: ".concat(G.name):G.name||"":""}).filter(Boolean)},R=function(){S(!0)},A=function(){return S(!1)},j=function(){typeof(i==null?void 0:i.id)=="number"&&k({brandId:a,brandGroupId:i.id})};return!i||i.type!=="group"?null:y.jsxs(y.Fragment,{children:[y.jsx(T.Modal,{isOpen:n,onClose:b?function(){}:M,as:"div",children:y.jsx(T.Modal.Panel,{children:y.jsxs(T.Modal.Container,{children:[y.jsx(T.Modal.Container.Header,{className:"yst-mb-4",children:y.jsx(T.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Edit brand group"})}),y.jsxs(T.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(T.TextInput,{id:"editGroupName",value:c,onChange:function(L){return d(L.target.value)},placeholder:"Enter group name",className:"yst-w-full"})]}),y.jsxs("div",{children:[y.jsx(T.TagField,{readOnly:!0,id:"editGroupedBrands",label:"Grouped brands",tags:B(),onRemoveTag:function(L){if(g.length<2)return S(!0);m(function(H){return H.filter(function(Q,F){return F!==L})})},onAddTag:function(){}}),g.length===0?y.jsx("p",{className:"yst-mt-2 yst-text-sm",children:'Click "Ungroup brands" to remove this group.'}):y.jsx("p",{className:"yst-mt-2 yst-text-sm yst-italic yst-text-gray-500",children:"Note: To add brands to this group, save this group, then use the checkboxes to select this group as well as any additional brands to be grouped."})]})]}),y.jsx(T.Modal.Container.Footer,{children:y.jsxs("div",{className:"yst-flex yst-w-full yst-items-center yst-justify-between",children:[y.jsx("div",{className:"yst-flex yst-justify-start",children:y.jsx(T.Button,{variant:"tertiary",onClick:R,disabled:x,className:"yst-text-red-600",children:"Ungroup brands"})}),y.jsxs("div",{className:"yst-flex yst-justify-end yst-gap-2",children:[y.jsx(T.Button,{variant:"secondary",onClick:M,children:"Cancel"}),y.jsx(T.Button,{variant:"primary",onClick:P,disabled:!c.trim()||x,isLoading:x,children:x?"Saving...":"Save changes"})]})]})})]})})}),y.jsx(Fu,{isOpen:b,onClose:A,onConfirm:j,title:"Ungroup this brand group?",description:y.jsxs(y.Fragment,{children:[y.jsx("p",{children:"The group will be removed, but the brands inside will remain in your brand list."}),y.jsx("p",{children:"This action cannot be undone. To create a new group with these brands, simply select them and create a new group."})]}),confirmText:"Yes, ungroup",isLoading:E})]})};function lf(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,g,m,p){var v=g&&g.prototype instanceof a?g:a,b=Object.create(v.prototype);return Zt(b,"_invoke",function(S,C,w){var O,x,_,k=0,E=w||[],P=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(A,j){return O=A,x=0,_=e,M.n=j,o}};function B(R,A){for(x=R,_=A,t=0;!P&&k&&!j&&t<E.length;t++){var j,L=E[t],H=M.p,Q=L[2];R>3?(j=Q===A)&&(_=L[(x=L[4])?5:(x=3,3)],L[4]=L[5]=e):L[0]<=H&&((j=R<2&&H<L[1])?(x=0,M.v=A,M.n=L[1]):H<Q&&(j=R<3||L[0]>A||A>Q)&&(L[4]=R,L[5]=A,M.n=Q,x=0))}if(j||R>1)return o;throw P=!0,A}return function(R,A,j){if(k>1)throw TypeError("Generator is already running");for(P&&A===1&&B(A,j),x=A,_=j;(t=x<2?e:_)||!P;){O||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(k=2,O){if(x||(R="next"),t=O[R]){if(!(t=t.call(O,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=O.return)&&t.call(O),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);O=e}else if((t=(P=M.n<0)?_:S.call(C,M))!==o)break}catch(L){O=e,x=1,_=L}finally{k=1}}return{value:t,done:P}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(Zt(t={},r,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,Zt(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,Zt(d,"constructor",u),Zt(u,"constructor",l),l.displayName="GeneratorFunction",Zt(u,i,"GeneratorFunction"),Zt(d),Zt(d,i,"Generator"),Zt(d,r,function(){return this}),Zt(d,"toString",function(){return"[object Generator]"}),(lf=function(){return{w:s,m:f}})()}function Zt(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Zt=function(o,a,l,u){if(a)i?i(o,a,{value:l,enumerable:!u,configurable:!u,writable:!u}):o[a]=l;else{var c=function(f,h){Zt(o,f,function(g){return this._invoke(f,h,g)})};c("next",0),c("throw",1),c("return",2)}},Zt(e,t,n,r)}function jm(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function EL(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){jm(s,r,i,o,a,"next",l)}function a(l){jm(s,r,i,o,a,"throw",l)}o(void 0)})}}function Mm(e,t){return jL(e)||PL(e,t)||TL(e,t)||AL()}function AL(){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 TL(e,t){if(e){if(typeof e=="string")return $m(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$m(e,t):void 0}}function $m(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function PL(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function jL(e){if(Array.isArray(e))return e}var ML=function(t){var n=t.isOpen,r=t.onClose,i=t.brandId,s=t.brandsToGroup,o=t.onGroupCreated,a=Gt(),l=Rn(),u=l.analysisId,c=z.useState(""),d=Mm(c,2),f=d[0],h=d[1],g=z.useState([]),m=Mm(g,2),p=m[0],v=m[1];z.useEffect(function(){if(n&&s.length>0){var _,k=(_=s[0])===null||_===void 0?void 0:_.name;h(String(k||"New Group")),v(s.map(function(E){var P;return String((P=E.id)!==null&&P!==void 0?P:"")}))}},[n,s]);var b=n2({mutation:{onSuccess:function(){var _=EL(lf().m(function E(){return lf().w(function(P){for(;;)switch(P.n){case 0:return P.n=1,Promise.all([a.invalidateQueries({queryKey:Zl(i)}),a.invalidateQueries({queryKey:Tf(i)}),a.invalidateQueries({queryKey:Pd(i,"latest")}),a.invalidateQueries({queryKey:Xl(i,"latest")}),a.invalidateQueries({queryKey:Pd(i,u)}),a.invalidateQueries({queryKey:Xl(i,u)})]);case 1:o==null||o(),w();case 2:return P.a(2)}},E)}));function k(){return _.apply(this,arguments)}return k}(),onError:function(k){console.error("Error creating group:",k)}}}),S=b.mutate,C=b.isPending,w=function(){h(""),v([]),r()},O=function(){if(!(!f.trim()||p.length===0)){var k=p.flatMap(function(E){var P=s.find(function(M){return String(M.id)===E});return P&&P.type==="group"&&Array.isArray(P.groupedBrands)?P.groupedBrands.map(function(M){return String(M.id)}):E});S({brandId:i,data:{groupName:f.trim(),brandIds:k.filter(function(E){return E!==""}).map(function(E){return Number(E)})}})}},x=function(k){v(function(E){return E.filter(function(P){return P!==k})})};return y.jsx(T.Modal,{isOpen:n,onClose:w,children:y.jsx(T.Modal.Panel,{children:y.jsxs(T.Modal.Container,{children:[y.jsx(T.Modal.Container.Header,{children:y.jsx(T.Modal.Title,{children:"Edit brand group"})}),y.jsxs(T.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(T.TextInput,{id:"groupName",value:f,onChange:function(_){return h(_.target.value)},placeholder:"Enter group name",className:"yst-w-full"})]}),y.jsxs("div",{children:[y.jsx(T.TagField,{readOnly:!0,id:"groupedBrands",label:"Brands in group (".concat(p.length,")"),tags:p.map(function(_){var k=s.find(function(E){return String(E.id)===_});return k?k.type==="group"?"Group: ".concat(k.name):k.name||"":""}).filter(Boolean),onRemoveTag:function(_){var k=p.find(function(E){var P=s.find(function(B){return String(B.id)===E});if(!P)return!1;var M=P.type==="group"?"Group: ".concat(P.name):P.name||"";return M===_});k&&x(k)},onAddTag:function(){}}),p.length===0&&y.jsx("p",{className:"yst-text-sm yst-italic yst-text-gray-500",children:"No brands selected"})]}),y.jsx("p",{children:"Note: To add brands to this group, save this group, then use the checkboxes to select this group as well as any additional brands to be grouped."})]}),y.jsx(T.Modal.Container.Footer,{className:"yst-pt-4",children:y.jsxs("div",{className:"yst-flex yst-justify-end yst-gap-2",children:[y.jsx(T.Button,{variant:"secondary",onClick:w,disabled:C,children:"Cancel"}),y.jsx(T.Button,{variant:"primary",onClick:O,disabled:!f.trim()||p.length===0||C,children:C?"Saving...":"Save group"})]})})]})})})};function va(e){"@babel/helpers - typeof";return va=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},va(e)}function Lm(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 Dm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Lm(Object(n),!0).forEach(function(r){ex(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lm(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ex(e,t,n){return(t=$L(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $L(e){var t=LL(e,"string");return va(t)=="symbol"?t:t+""}function LL(e,t){if(va(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(va(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function DL(e){return NL(e)||RL(e)||tx(e)||IL()}function IL(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1286
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RL(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function NL(e){if(Array.isArray(e))return uf(e)}function Hn(e,t){return qL(e)||BL(e,t)||tx(e,t)||FL()}function FL(){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 tx(e,t){if(e){if(typeof e=="string")return uf(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)?uf(e,t):void 0}}function uf(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 BL(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function qL(e){if(Array.isArray(e))return e}var zL=function(){var t,n=dn(),r=z.useState(!1),i=Hn(r,2),s=i[0],o=i[1],a=z.useState({}),l=Hn(a,2),u=l[0],c=l[1],d=z.useState(""),f=Hn(d,2),h=f[0],g=f[1],m=z.useState(1),p=Hn(m,2),v=p[0],b=p[1],S=z.useState({}),C=Hn(S,2),w=C[0],O=C[1],x=z.useState(!1),_=Hn(x,2),k=_[0],E=_[1],P=z.useState(!1),M=Hn(P,2),B=M[0],R=M[1],A=z.useState(null),j=Hn(A,2),L=j[0],H=j[1],Q=Rn(),F=Q.brandId;function G(W){return String(W.id)}var ie=W5(F,{query:{enabled:!!F}}),ae=ie.data,N=ie.isLoading,le=10,te=(ae==null||(t=ae.data)===null||t===void 0?void 0:t.associatedBrands.filter(function(W){var ne,ee;return h?((ne=(ee=W.name)===null||ee===void 0?void 0:ee.toLowerCase())!==null&&ne!==void 0?ne:"").includes(h.toLowerCase()):!0}))||[],me=Math.ceil(te.length/le),J=(v-1)*le,Se=DL(te).sort(function(W,ne){return W.type==="group"&&ne.type!=="group"?-1:W.type!=="group"&&ne.type==="group"?1:0}),ge=Se.slice(J,J+le),ze=function(ne){var ee=te.find(function(Ce){return G(Ce)===ne});ee&&ee.type==="group"&&(H(ee),R(!0))},oe=Object.entries(w).filter(function(W){var ne=Hn(W,2),ee=ne[1];return ee}).map(function(W){var ne=Hn(W,1),ee=ne[0];return ee}),He=function(){E(!0)},lt=function(ne){g(ne.target.value),b(1)},dt=function(ne){O(function(ee){return Dm(Dm({},ee),{},ex({},ne,!ee[ne]))})},Ne=function(){n("/")},Fe=function(){O({}),c({}),o(!1)},Y=function(){E(!1)},Te=function(){O({}),b(1),g("")},tt=function(){R(!1),H(null)},$e=function(ne,ee){return ne in u?!!u[ne]:!ee.isHidden},ue=[{Header:"Brand name",accessor:"name",Cell:function(ne){var ee=ne.value,Ce=ne.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(T.Checkbox,{id:"brand-checkbox-".concat(Ce.id),checked:!!w[G(Ce)],onChange:function(){return dt(G(Ce))},value:G(Ce),label:Ce.isSelf?y.jsx(Nu,{children:ee}):ee,name:"brand-checkbox-".concat(Ce.id),disabled:!$e(G(Ce),Ce)}),Ce.type==="group"&&y.jsx(z6,{className:"yst-h-4 yst-w-4 yst-text-slate-400"})]})})},LoadingComponent:function(ne){var ee=ne.id,Ce=ee===void 0?"":ee;return y.jsxs("div",{className:"yst-flex",children:[y.jsx(T.Checkbox,{id:"loading-row-checkbox-".concat(Ce),value:"loading",label:"",disabled:!0,name:"brand-checkbox-".concat(Ce)})," ",y.jsx(T.SkeletonLoader,{className:"yst-h-6 yst-w-32",id:"loading-row-skeleton-".concat(Ce)})]})}},{Header:"Actions",accessor:"id",Cell:function(ne){var ee=ne.value,Ce=ne.row;return y.jsx(y.Fragment,{children:Ce.type==="group"?y.jsxs(T.Button,{variant:"tertiary",size:"small",onClick:function(){return ze(String(ee!=null?ee:""))},className:"yst-gap-1.5 yst-px-0",disabled:!$e(G(Ce),Ce),children:[y.jsx(a2,{className:"yst-h-4 yst-w-4"}),"Edit group"]}):void 0})},LoadingComponent:function(){return y.jsx(T.SkeletonLoader,{className:"yst-h-6 yst-w-24"})}}];return y.jsxs(T.Paper,{className:"yst-mx-auto yst-max-w-2xl",children:[y.jsx(J1,{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(T.Paper.Content,{children:[y.jsx("div",{className:"yst-mb-6",children:y.jsx(T.TextInput,{id:"brand-search",label:"Search brands",placeholder:"Search brands",value:h,onChange:lt})}),y.jsx("div",{className:"yst-mb-6",children:y.jsxs(T.Table,{columns:ue,className:"yst-w-full",variant:"minimal",children:[y.jsx(T.Table.Head,{children:y.jsx(T.Table.Row,{children:ue.map(function(W){return y.jsx(T.Table.Header,{children:W.Header},W.accessor)})})}),y.jsx(T.Table.Body,{children:N?[1,2,3].map(function(W,ne){return y.jsx(T.Table.Row,{children:ue.map(function(ee,Ce){return y.jsx(T.Table.Cell,{children:y.jsx(ee.LoadingComponent,{id:"skeleton-".concat(ne,"-").concat(Ce)},ee.accessor)},"cell-".concat(Ce))})},ne)}):ge.length===0?y.jsx(T.Table.Row,{children:y.jsx(T.Table.Cell,{colSpan:ue.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(T.Button,{variant:"secondary",size:"small",onClick:function(){g(""),b(1)},className:"yst-mt-4",children:"Clear search"})]})})}):ge.map(function(W){return y.jsx(T.Table.Row,{children:ue.map(function(ne){return y.jsx(T.Table.Cell,{children:ne.Cell?ne.Cell({value:W[ne.accessor],row:W}):W[ne.accessor]},ne.accessor)})},W.id)})})]})}),y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-between",children:[y.jsxs(T.Button,{variant:"secondary",onClick:He,className:"yst-mb-0 yst-gap-2",disabled:oe.length<2,children:[y.jsx(n6,{})," Group brands"]}),y.jsx(T.Pagination,{variant:"text",current:v,total:me,onNavigate:b,className:"yst-flex-row",screenReaderTextPrevious:"Previous page",screenReaderTextNext:"Next page"})]})]}),y.jsx(Mf,{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(T.Button,{variant:"secondary",className:"yst-mb-0",onClick:Fe,children:"Discard changes"}),y.jsx(T.Button,{variant:"primary",className:"yst-mb-0",onClick:Ne,children:"Save changes"})]}):y.jsx(T.Button,{as:ti,to:"/brands/".concat(F),variant:"tertiary",className:"yst-mb-0",children:"Return to analysis"})})}),y.jsx(ML,{isOpen:k,onClose:Y,brandId:F,brandsToGroup:te.filter(function(W){return oe.includes(G(W))}),onGroupCreated:Te}),y.jsx(OL,{isOpen:B,onClose:tt,groupToEdit:L,allBrands:te})]})};const HL=Object.freeze(Object.defineProperty({__proto__:null,default:zL},Symbol.toStringTag,{value:"Module"}));function UL(e,t){return WL(e)||KL(e,t)||VL(e,t)||GL()}function GL(){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 VL(e,t){if(e){if(typeof e=="string")return Im(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)?Im(e,t):void 0}}function Im(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 KL(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function WL(e){if(Array.isArray(e))return e}var QL=function(t){var n=t.isOpen,r=t.onClose,i=Gt(),s=z.useState(""),o=UL(s,2),a=o[0],l=o[1],u=C4({mutation:{onSuccess:function(){i.clear(),r()}}}),c=u.mutate,d=u.isPending;return z.useEffect(function(){n&&l("")},[n]),y.jsx(Fu,{isOpen:n,onClose:r,onConfirm:function(){c()},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(T.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 cf(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,g,m,p){var v=g&&g.prototype instanceof a?g:a,b=Object.create(v.prototype);return Jt(b,"_invoke",function(S,C,w){var O,x,_,k=0,E=w||[],P=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(A,j){return O=A,x=0,_=e,M.n=j,o}};function B(R,A){for(x=R,_=A,t=0;!P&&k&&!j&&t<E.length;t++){var j,L=E[t],H=M.p,Q=L[2];R>3?(j=Q===A)&&(_=L[(x=L[4])?5:(x=3,3)],L[4]=L[5]=e):L[0]<=H&&((j=R<2&&H<L[1])?(x=0,M.v=A,M.n=L[1]):H<Q&&(j=R<3||L[0]>A||A>Q)&&(L[4]=R,L[5]=A,M.n=Q,x=0))}if(j||R>1)return o;throw P=!0,A}return function(R,A,j){if(k>1)throw TypeError("Generator is already running");for(P&&A===1&&B(A,j),x=A,_=j;(t=x<2?e:_)||!P;){O||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(k=2,O){if(x||(R="next"),t=O[R]){if(!(t=t.call(O,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=O.return)&&t.call(O),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);O=e}else if((t=(P=M.n<0)?_:S.call(C,M))!==o)break}catch(L){O=e,x=1,_=L}finally{k=1}}return{value:t,done:P}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(Jt(t={},r,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,Jt(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,Jt(d,"constructor",u),Jt(u,"constructor",l),l.displayName="GeneratorFunction",Jt(u,i,"GeneratorFunction"),Jt(d),Jt(d,i,"Generator"),Jt(d,r,function(){return this}),Jt(d,"toString",function(){return"[object Generator]"}),(cf=function(){return{w:s,m:f}})()}function Jt(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Jt=function(o,a,l,u){if(a)i?i(o,a,{value:l,enumerable:!u,configurable:!u,writable:!u}):o[a]=l;else{var c=function(f,h){Jt(o,f,function(g){return this._invoke(f,h,g)})};c("next",0),c("throw",1),c("return",2)}},Jt(e,t,n,r)}function Rm(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function YL(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){Rm(s,r,i,o,a,"next",l)}function a(l){Rm(s,r,i,o,a,"throw",l)}o(void 0)})}}function XL(e,t){return tD(e)||eD(e,t)||JL(e,t)||ZL()}function ZL(){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 JL(e,t){if(e){if(typeof e=="string")return Nm(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)?Nm(e,t):void 0}}function Nm(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 eD(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function tD(e){if(Array.isArray(e))return e}var nD=function(t){var n=t.isOpen,r=t.brandId,i=t.onClose,s=t.brandName,o=Gt(),a=z.useState(""),l=XL(a,2),u=l[0],c=l[1],d=u4({mutation:{onSuccess:function(){var g=YL(cf().m(function p(){return cf().w(function(v){for(;;)switch(v.n){case 0:return v.n=1,Promise.all([o.invalidateQueries({queryKey:Yn()}),o.invalidateQueries({queryKey:Du()})]);case 1:i();case 2:return v.a(2)}},p)}));function m(){return g.apply(this,arguments)}return m}()}}),f=d.mutate,h=d.isPending;return z.useEffect(function(){n&&c("")},[n]),y.jsx(Fu,{isOpen:n,onClose:i,onConfirm:function(){if(!s){console.error("Brand name is required for deletion confirmation");return}f({brandId:r})},isLoading:h,disabled:u.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(T.TextField,{id:"delete-modal-brand-name-confirmation",label:"To confirm, please type your brand name ".concat(s,":"),value:u,onChange:function(g){return c(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 ba(e){"@babel/helpers - typeof";return ba=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},ba(e)}function No(){/*! 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 en(b,"_invoke",function(S,C,w){var O,x,_,k=0,E=w||[],P=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(A,j){return O=A,x=0,_=e,M.n=j,o}};function B(R,A){for(x=R,_=A,t=0;!P&&k&&!j&&t<E.length;t++){var j,L=E[t],H=M.p,Q=L[2];R>3?(j=Q===A)&&(_=L[(x=L[4])?5:(x=3,3)],L[4]=L[5]=e):L[0]<=H&&((j=R<2&&H<L[1])?(x=0,M.v=A,M.n=L[1]):H<Q&&(j=R<3||L[0]>A||A>Q)&&(L[4]=R,L[5]=A,M.n=Q,x=0))}if(j||R>1)return o;throw P=!0,A}return function(R,A,j){if(k>1)throw TypeError("Generator is already running");for(P&&A===1&&B(A,j),x=A,_=j;(t=x<2?e:_)||!P;){O||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(k=2,O){if(x||(R="next"),t=O[R]){if(!(t=t.call(O,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=O.return)&&t.call(O),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);O=e}else if((t=(P=M.n<0)?_:S.call(C,M))!==o)break}catch(L){O=e,x=1,_=L}finally{k=1}}return{value:t,done:P}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(en(t={},r,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,en(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,en(d,"constructor",u),en(u,"constructor",l),l.displayName="GeneratorFunction",en(u,i,"GeneratorFunction"),en(d),en(d,i,"Generator"),en(d,r,function(){return this}),en(d,"toString",function(){return"[object Generator]"}),(No=function(){return{w:s,m:f}})()}function en(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}en=function(o,a,l,u){if(a)i?i(o,a,{value:l,enumerable:!u,configurable:!u,writable:!u}):o[a]=l;else{var c=function(f,h){en(o,f,function(g){return this._invoke(f,h,g)})};c("next",0),c("throw",1),c("return",2)}},en(e,t,n,r)}function Fm(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 Ar(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Fm(Object(n),!0).forEach(function(r){rD(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fm(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rD(e,t,n){return(t=iD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iD(e){var t=sD(e,"string");return ba(t)=="symbol"?t:t+""}function sD(e,t){if(ba(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ba(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Bm(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function qm(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){Bm(s,r,i,o,a,"next",l)}function a(l){Bm(s,r,i,o,a,"throw",l)}o(void 0)})}}function oD(e,t){return cD(e)||uD(e,t)||lD(e,t)||aD()}function aD(){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 lD(e,t){if(e){if(typeof e=="string")return zm(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)?zm(e,t):void 0}}function zm(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 uD(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function cD(e){if(Array.isArray(e))return e}var dD=function(t){var n,r,i=t.brand,s=t.isLast,o=t.onDelete,a=i.id,l=Rn(),u=l.hostAppProps,c=u.onAddSubscription,d=dn(),f=Fa(),h=f.setBrandId,g=z.useState(!1),m=oD(g,2),p=m[0],v=m[1],b=Gt(),S=Iu({query:{select:function(B){var R=B.data;return R}}}),C=S.data,w=r2({mutation:{onMutate:function(){var M=qm(No().m(function R(A){var j,L,H;return No().w(function(Q){for(;;)switch(Q.n){case 0:return j=A.brandId,L=A.data,Q.n=1,b.cancelQueries({queryKey:Yn()});case 1:return H=b.getQueryData(Yn()),b.setQueryData(Yn(),function(F){var G,ie;return F&&Ar(Ar({},F),{},{data:Ar(Ar({},F.data),{},{brands:((G=(ie=F.data)===null||ie===void 0?void 0:ie.brands)!==null&&G!==void 0?G:[]).map(function(ae){return ae.id===j?Ar(Ar({},ae),{},{settings:Ar(Ar({},ae.settings),{},{enableAutomaticAnalysis:L.enableAutomaticAnalysis})}):ae})})})}),Q.a(2,{previous:H})}},R)}));function B(R){return M.apply(this,arguments)}return B}(),onSuccess:function(){if(i&&i.settings&&i.settings.enableAutomaticAnalysis===!1)return v(!1);v(!P)},onError:function(B,R,A){A!=null&&A.previous&&b.setQueryData(Yn(),A.previous)},onSettled:function(){var M=qm(No().m(function R(){return No().w(function(A){for(;;)switch(A.n){case 0:return A.n=1,Promise.all([b.invalidateQueries({queryKey:Yn()}),b.invalidateQueries({queryKey:Du()})]);case 1:return A.a(2)}},R)}));function B(){return M.apply(this,arguments)}return B}()}}),O=w.mutate,x=w.isPending,_=function(B){O({brandId:a,data:{enableAutomaticAnalysis:B}})},k=function(B){if(B){if(!E)return v(!0);if(!P)return _(!0);v(!0)}else _(!1)},E=Number(C==null?void 0:C.maxNumberOfActiveBrands)-Number(C==null?void 0:C.numberOfActiveBrands)>0||!!(i!=null&&(n=i.settings)!==null&&n!==void 0&&n.enableAutomaticAnalysis),P=k2(i==null?void 0:i.firstNextAnalysisOpportunity);return y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:Oe("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":!s}),children:[y.jsx(T.Toggle,{id:"toggle-brand-".concat(i==null?void 0:i.id),checked:i==null||(r=i.settings)===null||r===void 0?void 0:r.enableAutomaticAnalysis,screenReaderLabel:"Enable or disable automatic analysis for this brand",onChange:k,disabled:(i==null?void 0:i.id)==="loading"||x}),y.jsxs("div",{className:"yst-font-medium",children:[(i==null?void 0:i.id)==="loading"?y.jsx(T.SkeletonLoader,{className:"yst-h-6 yst-w-32"}):i==null?void 0:i.name,(i==null?void 0:i.setupStatus)==="pendingQuerySelection"&&y.jsx("div",{children:y.jsx(T.Link,{onClick:function(){i.id?(h(i.id),d("/setup/".concat(i.id,"/queries"))):console.error("Brand ID is missing.")},children:"Finish setup"})}),(i==null?void 0:i.nextScheduledAnalysis)&&y.jsxs("div",{className:"yst-italic yst-font-normal yst-text-slate-500",children:["Next analysis:"," ",Ld(i.nextScheduledAnalysis)]})]}),y.jsx("div",{className:"yst-ml-auto yst-flex yst-flex-row yst-items-center yst-justify-end yst-gap-2 yst-text-slate-800",children:(i==null?void 0:i.id)==="loading"?y.jsx(T.SkeletonLoader,{className:"yst-h-6 yst-w-24"}):y.jsxs(T.Button,{size:"small",variant:"tertiary",className:"yst-gap-1 yst-text-red-600 *:hover:yst-text-red-700",onClick:function(){i!=null&&i.id&&o(i.id)},disabled:(i==null?void 0:i.id)==="loading",children:[y.jsx(jf,{})," Delete brand"]})})]}),y.jsx(T.Modal,{isOpen:p,onClose:function(){return v(!1)},position:"center",as:"div",className:Oe({"yst-mx-auto yst-max-w-xl":E}),children:E?y.jsx(T.Modal.Panel,{children:P?y.jsxs(y.Fragment,{children:[y.jsx(T.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(T.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Start brand analysis now?"})}),y.jsxs(T.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(T.Modal.Container.Footer,{className:"yst-mt-3 yst-flex yst-justify-end yst-gap-2",children:[y.jsx(T.Button,{variant:"secondary",onClick:function(){return v(!1)},children:"Cancel"}),y.jsx(T.Button,{variant:"primary",onClick:function(){_(!0)},isLoading:x,children:"Yes, start analysis"})]})]}):y.jsxs(y.Fragment,{children:[y.jsx(T.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(T.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Automatic analysis enabled"})}),y.jsxs(T.Modal.Container.Content,{className:"yst-mb-4 yst-space-y-3",children:[y.jsx("p",{children:"You've turned on the weekly automatic analysis for this brand."}),y.jsxs("p",{children:["The next analysis will run on"," ",y.jsx("span",{className:"yst-font-medium",children:Ld(i==null?void 0:i.nextScheduledAnalysis)||"the next analysis cycle"}),"."]})]}),y.jsx(T.Modal.Container.Footer,{className:"yst-mt-3 yst-flex yst-justify-end yst-gap-2",children:y.jsx(T.Button,{variant:"primary",onClick:function(){return v(!1)},children:"Got it"})})]})}):y.jsxs(T.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(T.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(T.Modal.Title,{as:"h3",className:"yst-text-center yst-text-lg yst-font-medium",children:"You've reached your active brand limit"})}),y.jsx(T.Modal.Container.Content,{children:y.jsx("p",{className:"yst-text-center",children:"Each subscription lets you activate 1 brand. Add another subscription or deactivate an existing brand to activate this brand."})})]})}),y.jsx(T.Modal.Container.Footer,{children:y.jsxs("div",{className:"yst-flex yst-flex-col yst-justify-stretch yst-gap-2",children:[c&&y.jsxs(T.Button,{variant:"upsell",className:"yst-flex yst-gap-1",onClick:c,children:[y.jsx(l2,{}),"Add a subscription"]}),y.jsx(T.Button,{variant:"tertiary",className:"",onClick:function(){return v(!1)},children:"Manage active brands"})]})})]})})]})},Hm,Um,Gm;function Wc(e,t){return yD(e)||gD(e,t)||hD(e,t)||fD()}function fD(){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 hD(e,t){if(e){if(typeof e=="string")return Vm(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)?Vm(e,t):void 0}}function Vm(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 gD(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function yD(e){if(Array.isArray(e))return e}function xh(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Km=za(Hm||(Hm=xh(["xl:yst-w-1/3"]))),Wm=za(Um||(Um=xh(["xl:yst-w-2/3"]))),Qm=za(Gm||(Gm=xh(["yst-flex yst-flex-col yst-gap-8 xl:yst-flex-row"]))),mD=function(){var t,n,r,i,s=z.useState(!1),o=Wc(s,2),a=o[0],l=o[1],u=z.useState(!1),c=Wc(u,2),d=c[0],f=c[1],h=z.useState(null),g=Wc(h,2),m=g[0],p=g[1],v=Iu({query:{select:function(x){var _=x.data;return _}}}),b=v.data,S=Vi({query:{select:function(x){var _=x.data;return _==null?void 0:_.brands}}}),C=S.data,w=C==null?void 0:C.find(function(O){return O.id===m});return y.jsxs("form",{children:[y.jsxs(T.Card,{children:[y.jsx(vb,{title:"Settings",description:"Manage your brand settings and data. You can update analysis preferences or delete brands from your account."}),y.jsxs(T.Card.Content,{children:[y.jsxs(Qm,{children:[y.jsxs(Km,{className:"yst-space-y-2",children:[y.jsx(T.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:"—"," subscription(s)"]}),". This gives you up to"," ",y.jsxs("b",{children:[(n=b==null?void 0:b.maxNumberOfActiveBrands)!==null&&n!==void 0?n:"—"," active brand(s)"]}),", 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(Wm,{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(T.Link,{as:ti,to:"/setup",children:"add a brand"})," ","to start analyzing."]}),(C!=null?C:[{id:"loading",name:"Loading..."}]).map(function(O,x,_){return y.jsx(dD,{brand:O,isLast:x===_.length-1,onDelete:function(k){p(k),l(!0)}},O.id)})]})]}),y.jsx(Ha,{}),y.jsxs(Qm,{children:[y.jsxs(Km,{className:"yst-space-y-2",children:[y.jsx(T.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(Wm,{className:"yst-space-y-4",children:[y.jsxs(T.Button,{variant:"error",onClick:function(){f(!0)},disabled:(C==null?void 0:C.length)===0,children:[y.jsx(jf,{})," 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(nD,{isOpen:a,onClose:function(){l(!1),p(null)},brandId:m||"",brandName:w==null?void 0:w.name}),y.jsx(QL,{isOpen:d,onClose:function(){f(!1)}})]})};const pD=Object.freeze(Object.defineProperty({__proto__:null,default:mD},Symbol.toStringTag,{value:"Module"}));function vu(e){"@babel/helpers - typeof";return vu=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},vu(e)}var df=[{path:"/setup",id:1,title:"Brand & location info",description:"Enter a few basic details about your brand so we can generate relevant queries people might use in AI models like ChatGPT. This helps us analyze how visible your brand is in their responses."},{path:"/setup/:brandId/queries",id:2,title:"Queries",description:"Review the queries we've generated from your brand info. These are phrases people might type into AI models that could trigger your brand to appear."},{path:"/setup/:brandId/analysis",id:3,title:"Analysis",description:"We're checking how your brand shows up in AI. Your queries will now be tested in ChatGPT. This process should take around 5 minutes."}],vD=function(t){return df.find(function(n){return!!Fs(n.path,t)})||df[0]};function bD(){var e=Ut(),t=vD(e.pathname);return y.jsxs(T.Paper,{className:"yst-mx-auto yst-max-w-2xl",children:[y.jsx(J1,{title:y.jsx(nx,{currentStep:t,steps:df}),description:t.description}),y.jsx(T.Paper.Content,{children:y.jsx(Bs,{})})]})}var nx=function(t){var n=t.title,r=t.currentStep,i=t.steps;return y.jsxs("span",{className:"yst-inline-flex yst-flex-row yst-gap-4",children:[y.jsxs("span",{className:"yst-tracking-[.2em] yst-text-slate-400",children:[y.jsx("span",{className:"yst-text-slate-900",children:vu(r)==="object"?r.id:r}),"/",Array.isArray(i)?i.length:i]}),y.jsx("span",{children:vu(r)==="object"?r.title:n||"Step ".concat(r)})]})};const xD=Object.freeze(Object.defineProperty({__proto__:null,SetupPaperTitle:nx,default:bD},Symbol.toStringTag,{value:"Module"}));var rx=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,u=t.isLoading,c=u===void 0?!1:u;return y.jsx(Mf,{nestedInPaperContent:!0,children:y.jsxs("div",{className:Oe({"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(T.Button,{variant:"tertiary",onClick:n,className:"yst-no-underline",children:"← Back"}),y.jsx("div",{className:Oe("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(T.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:c,children:[i==="ai"&&y.jsx(i6,{}),s]})})]})})},wD=[{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"}],SD=[{value:"AF",label:"Afghanistan"},{value:"AX",label:"Åland Islands"},{value:"AL",label:"Albania"},{value:"DZ",label:"Algeria"},{value:"AS",label:"American Samoa"},{value:"AD",label:"Andorra"},{value:"AO",label:"Angola"},{value:"AI",label:"Anguilla"},{value:"AQ",label:"Antarctica"},{value:"AG",label:"Antigua and Barbuda"},{value:"AR",label:"Argentina"},{value:"AM",label:"Armenia"},{value:"AW",label:"Aruba"},{value:"AT",label:"Austria"},{value:"AZ",label:"Azerbaijan"},{value:"BS",label:"Bahamas"},{value:"BH",label:"Bahrain"},{value:"BD",label:"Bangladesh"},{value:"BB",label:"Barbados"},{value:"BY",label:"Belarus"},{value:"BE",label:"Belgium"},{value:"PW",label:"Belau"},{value:"BZ",label:"Belize"},{value:"BJ",label:"Benin"},{value:"BM",label:"Bermuda"},{value:"BT",label:"Bhutan"},{value:"BO",label:"Bolivia"},{value:"BQ",label:"Bonaire, Saint Eustatius and Saba"},{value:"BA",label:"Bosnia and Herzegovina"},{value:"BW",label:"Botswana"},{value:"BV",label:"Bouvet Island"},{value:"BR",label:"Brazil"},{value:"IO",label:"British Indian Ocean Territory"},{value:"BN",label:"Brunei"},{value:"BG",label:"Bulgaria"},{value:"BF",label:"Burkina Faso"},{value:"BI",label:"Burundi"},{value:"KH",label:"Cambodia"},{value:"CM",label:"Cameroon"},{value:"CV",label:"Cape Verde"},{value:"KY",label:"Cayman Islands"},{value:"CF",label:"Central African Republic"},{value:"TD",label:"Chad"},{value:"CL",label:"Chile"},{value:"CN",label:"China"},{value:"CX",label:"Christmas Island"},{value:"CC",label:"Cocos (Keeling) Islands"},{value:"CO",label:"Colombia"},{value:"KM",label:"Comoros"},{value:"CG",label:"Congo (Brazzaville)"},{value:"CD",label:"Congo (Kinshasa)"},{value:"CK",label:"Cook Islands"},{value:"CR",label:"Costa Rica"},{value:"HR",label:"Croatia"},{value:"CU",label:"Cuba"},{value:"CW",label:"Curaçao"},{value:"CY",label:"Cyprus"},{value:"CZ",label:"Czech Republic"},{value:"DK",label:"Denmark"},{value:"DJ",label:"Djibouti"},{value:"DM",label:"Dominica"},{value:"DO",label:"Dominican Republic"},{value:"EC",label:"Ecuador"},{value:"EG",label:"Egypt"},{value:"SV",label:"El Salvador"},{value:"GQ",label:"Equatorial Guinea"},{value:"ER",label:"Eritrea"},{value:"EE",label:"Estonia"},{value:"ET",label:"Ethiopia"},{value:"FK",label:"Falkland Islands"},{value:"FO",label:"Faroe Islands"},{value:"FJ",label:"Fiji"},{value:"FI",label:"Finland"},{value:"GF",label:"French Guiana"},{value:"PF",label:"French Polynesia"},{value:"TF",label:"French Southern Territories"},{value:"GA",label:"Gabon"},{value:"GM",label:"Gambia"},{value:"GE",label:"Georgia"},{value:"GH",label:"Ghana"},{value:"GI",label:"Gibraltar"},{value:"GR",label:"Greece"},{value:"GL",label:"Greenland"},{value:"GD",label:"Grenada"},{value:"GP",label:"Guadeloupe"},{value:"GU",label:"Guam"},{value:"GT",label:"Guatemala"},{value:"GG",label:"Guernsey"},{value:"GN",label:"Guinea"},{value:"GW",label:"Guinea-Bissau"},{value:"GY",label:"Guyana"},{value:"HT",label:"Haiti"},{value:"HM",label:"Heard Island and McDonald Islands"},{value:"HN",label:"Honduras"},{value:"HK",label:"Hong Kong"},{value:"HU",label:"Hungary"},{value:"IS",label:"Iceland"},{value:"IN",label:"India"},{value:"ID",label:"Indonesia"},{value:"IR",label:"Iran"},{value:"IQ",label:"Iraq"},{value:"IE",label:"Ireland"},{value:"IM",label:"Isle of Man"},{value:"IL",label:"Israel"},{value:"IT",label:"Italy"},{value:"CI",label:"Ivory Coast"},{value:"JM",label:"Jamaica"},{value:"JP",label:"Japan"},{value:"JE",label:"Jersey"},{value:"JO",label:"Jordan"},{value:"KZ",label:"Kazakhstan"},{value:"KE",label:"Kenya"},{value:"KI",label:"Kiribati"},{value:"KW",label:"Kuwait"},{value:"KG",label:"Kyrgyzstan"},{value:"LA",label:"Laos"},{value:"LV",label:"Latvia"},{value:"LB",label:"Lebanon"},{value:"LS",label:"Lesotho"},{value:"LR",label:"Liberia"},{value:"LY",label:"Libya"},{value:"LI",label:"Liechtenstein"},{value:"LT",label:"Lithuania"},{value:"LU",label:"Luxembourg"},{value:"MO",label:"Macao"},{value:"MK",label:"North Macedonia"},{value:"MG",label:"Madagascar"},{value:"MW",label:"Malawi"},{value:"MY",label:"Malaysia"},{value:"MV",label:"Maldives"},{value:"ML",label:"Mali"},{value:"MT",label:"Malta"},{value:"MH",label:"Marshall Islands"},{value:"MQ",label:"Martinique"},{value:"MR",label:"Mauritania"},{value:"MU",label:"Mauritius"},{value:"YT",label:"Mayotte"},{value:"MX",label:"Mexico"},{value:"FM",label:"Micronesia"},{value:"MD",label:"Moldova"},{value:"MC",label:"Monaco"},{value:"MN",label:"Mongolia"},{value:"ME",label:"Montenegro"},{value:"MS",label:"Montserrat"},{value:"MA",label:"Morocco"},{value:"MZ",label:"Mozambique"},{value:"MM",label:"Myanmar"},{value:"NA",label:"Namibia"},{value:"NR",label:"Nauru"},{value:"NP",label:"Nepal"},{value:"NC",label:"New Caledonia"},{value:"NZ",label:"New Zealand"},{value:"NI",label:"Nicaragua"},{value:"NE",label:"Niger"},{value:"NG",label:"Nigeria"},{value:"NU",label:"Niue"},{value:"NF",label:"Norfolk Island"},{value:"MP",label:"Northern Mariana Islands"},{value:"KP",label:"North Korea"},{value:"NO",label:"Norway"},{value:"OM",label:"Oman"},{value:"PK",label:"Pakistan"},{value:"PS",label:"Palestinian Territory"},{value:"PA",label:"Panama"},{value:"PG",label:"Papua New Guinea"},{value:"PY",label:"Paraguay"},{value:"PE",label:"Peru"},{value:"PH",label:"Philippines"},{value:"PN",label:"Pitcairn"},{value:"PL",label:"Poland"},{value:"PT",label:"Portugal"},{value:"PR",label:"Puerto Rico"},{value:"QA",label:"Qatar"},{value:"RE",label:"Reunion"},{value:"RO",label:"Romania"},{value:"RU",label:"Russia"},{value:"RW",label:"Rwanda"},{value:"BL",label:"Saint Barthélemy"},{value:"SH",label:"Saint Helena"},{value:"KN",label:"Saint Kitts and Nevis"},{value:"LC",label:"Saint Lucia"},{value:"MF",label:"Saint Martin (French part)"},{value:"SX",label:"Saint Martin (Dutch part)"},{value:"PM",label:"Saint Pierre and Miquelon"},{value:"VC",label:"Saint Vincent and the Grenadines"},{value:"SM",label:"San Marino"},{value:"ST",label:"São Tomé and Príncipe"},{value:"SA",label:"Saudi Arabia"},{value:"SN",label:"Senegal"},{value:"RS",label:"Serbia"},{value:"SC",label:"Seychelles"},{value:"SL",label:"Sierra Leone"},{value:"SG",label:"Singapore"},{value:"SK",label:"Slovakia"},{value:"SI",label:"Slovenia"},{value:"SB",label:"Solomon Islands"},{value:"SO",label:"Somalia"},{value:"ZA",label:"South Africa"},{value:"GS",label:"South Georgia/Sandwich Islands"},{value:"KR",label:"South Korea"},{value:"SS",label:"South Sudan"},{value:"ES",label:"Spain"},{value:"LK",label:"Sri Lanka"},{value:"SD",label:"Sudan"},{value:"SR",label:"Suriname"},{value:"SJ",label:"Svalbard and Jan Mayen"},{value:"SZ",label:"Eswatini"},{value:"SE",label:"Sweden"},{value:"CH",label:"Switzerland"},{value:"SY",label:"Syria"},{value:"TW",label:"Taiwan"},{value:"TJ",label:"Tajikistan"},{value:"TZ",label:"Tanzania"},{value:"TH",label:"Thailand"},{value:"TL",label:"Timor-Leste"},{value:"TG",label:"Togo"},{value:"TK",label:"Tokelau"},{value:"TO",label:"Tonga"},{value:"TT",label:"Trinidad and Tobago"},{value:"TN",label:"Tunisia"},{value:"TR",label:"Turkey"},{value:"TM",label:"Turkmenistan"},{value:"TC",label:"Turks and Caicos Islands"},{value:"TV",label:"Tuvalu"},{value:"UG",label:"Uganda"},{value:"UA",label:"Ukraine"},{value:"AE",label:"United Arab Emirates"},{value:"UM",label:"United States (US) Minor Outlying Islands"},{value:"UY",label:"Uruguay"},{value:"UZ",label:"Uzbekistan"},{value:"VU",label:"Vanuatu"},{value:"VA",label:"Vatican"},{value:"VE",label:"Venezuela"},{value:"VN",label:"Vietnam"},{value:"VG",label:"Virgin Islands (British)"},{value:"VI",label:"Virgin Islands (US)"},{value:"WF",label:"Wallis and Futuna"},{value:"EH",label:"Western Sahara"},{value:"WS",label:"Samoa"},{value:"YE",label:"Yemen"},{value:"ZM",label:"Zambia"},{value:"ZW",label:"Zimbabwe"}],Ym=[].concat(wD,SD,[{value:"OTHER",label:"Other"}]),CD=[{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"}],_D=[{value:"sq",label:"Albanian"},{value:"am",label:"Amharic"},{value:"ar",label:"Arabic"},{value:"hy",label:"Armenian"},{value:"bn",label:"Bengali"},{value:"bs",label:"Bosnian"},{value:"bg",label:"Bulgarian"},{value:"my",label:"Burmese"},{value:"ca",label:"Catalan"},{value:"zh",label:"Chinese"},{value:"hr",label:"Croatian"},{value:"cs",label:"Czech"},{value:"da",label:"Danish"},{value:"nl",label:"Dutch"},{value:"et",label:"Estonian"},{value:"fi",label:"Finnish"},{value:"fr",label:"French"},{value:"ka",label:"Georgian"},{value:"de",label:"German"},{value:"el",label:"Greek"},{value:"gu",label:"Gujarati"},{value:"hi",label:"Hindi"},{value:"hu",label:"Hungarian"},{value:"is",label:"Icelandic"},{value:"id",label:"Indonesian"},{value:"it",label:"Italian"},{value:"ja",label:"Japanese"},{value:"kn",label:"Kannada"},{value:"kk",label:"Kazakh"},{value:"ko",label:"Korean"},{value:"lv",label:"Latvian"},{value:"lt",label:"Lithuanian"},{value:"mk",label:"Macedonian"},{value:"ms",label:"Malay"},{value:"ml",label:"Malayalam"},{value:"mr",label:"Marathi"},{value:"mn",label:"Mongolian"},{value:"no",label:"Norwegian"},{value:"fa",label:"Persian"},{value:"pl",label:"Polish"},{value:"pt",label:"Portuguese"},{value:"pa",label:"Punjabi"},{value:"ro",label:"Romanian"},{value:"ru",label:"Russian"},{value:"sr",label:"Serbian"},{value:"sk",label:"Slovak"},{value:"sl",label:"Slovenian"},{value:"so",label:"Somali"},{value:"es",label:"Spanish"},{value:"sw",label:"Swahili"},{value:"sv",label:"Swedish"},{value:"tl",label:"Tagalog"},{value:"ta",label:"Tamil"},{value:"te",label:"Telugu"},{value:"th",label:"Thai"},{value:"tr",label:"Turkish"},{value:"uk",label:"Ukrainian"},{value:"ur",label:"Urdu"},{value:"vi",label:"Vietnamese"}],kD=[].concat(CD,_D);function Qr(e){"@babel/helpers - typeof";return Qr=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},Qr(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 Zm(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){ix(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 ix(e,t,n){return(t=OD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OD(e){var t=ED(e,"string");return Qr(t)=="symbol"?t:t+""}function ED(e,t){if(Qr(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Qr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ff(){/*! 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 tn(b,"_invoke",function(S,C,w){var O,x,_,k=0,E=w||[],P=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(A,j){return O=A,x=0,_=e,M.n=j,o}};function B(R,A){for(x=R,_=A,t=0;!P&&k&&!j&&t<E.length;t++){var j,L=E[t],H=M.p,Q=L[2];R>3?(j=Q===A)&&(_=L[(x=L[4])?5:(x=3,3)],L[4]=L[5]=e):L[0]<=H&&((j=R<2&&H<L[1])?(x=0,M.v=A,M.n=L[1]):H<Q&&(j=R<3||L[0]>A||A>Q)&&(L[4]=R,L[5]=A,M.n=Q,x=0))}if(j||R>1)return o;throw P=!0,A}return function(R,A,j){if(k>1)throw TypeError("Generator is already running");for(P&&A===1&&B(A,j),x=A,_=j;(t=x<2?e:_)||!P;){O||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(k=2,O){if(x||(R="next"),t=O[R]){if(!(t=t.call(O,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=O.return)&&t.call(O),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);O=e}else if((t=(P=M.n<0)?_:S.call(C,M))!==o)break}catch(L){O=e,x=1,_=L}finally{k=1}}return{value:t,done:P}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(tn(t={},r,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,tn(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,tn(d,"constructor",u),tn(u,"constructor",l),l.displayName="GeneratorFunction",tn(u,i,"GeneratorFunction"),tn(d),tn(d,i,"Generator"),tn(d,r,function(){return this}),tn(d,"toString",function(){return"[object Generator]"}),(ff=function(){return{w:s,m:f}})()}function tn(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}tn=function(o,a,l,u){if(a)i?i(o,a,{value:l,enumerable:!u,configurable:!u,writable:!u}):o[a]=l;else{var c=function(f,h){tn(o,f,function(g){return this._invoke(f,h,g)})};c("next",0),c("throw",1),c("return",2)}},tn(e,t,n,r)}function Jm(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function AD(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){Jm(s,r,i,o,a,"next",l)}function a(l){Jm(s,r,i,o,a,"throw",l)}o(void 0)})}}function Eo(e,t){return MD(e)||jD(e,t)||PD(e,t)||TD()}function TD(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1292
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function PD(e,t){if(e){if(typeof e=="string")return ep(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)?ep(e,t):void 0}}function ep(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 jD(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function MD(e){if(Array.isArray(e))return e}var $D=function(){var t,n=dn(),r=Fa(),i=Gt(),s=z.useState(),o=Eo(s,2),a=o[0],l=o[1],u=z.useState(!1),c=Eo(u,2),d=c[0],f=c[1],h=z.useState({name:"",url:"",description:"",language:"en",isLocal:!1,country:"",region:""}),g=Eo(h,2),m=g[0],p=g[1],v=z.useState(null),b=Eo(v,2),S=b[0],C=b[1],w=i4({mutation:{onSuccess:function(){var A=AD(ff().m(function L(H){var Q;return ff().w(function(F){for(;;)switch(F.n){case 0:return Q=H.data.id,F.n=1,Promise.all([i.invalidateQueries({queryKey:Du()}),i.invalidateQueries({queryKey:Yn()})]);case 1:Q&&r.setBrandId(Q),H!=null&&H.status&&H.status>=200&&H.status<300&&Q&&(r.setBrandId(Q),l(Q));case 2:return F.a(2)}},L)}));function j(L){return A.apply(this,arguments)}return j}(),onError:function(){f(!1)}}}),O=w.mutate,x=w.isPending,_=w.error,k=Vi({query:{enabled:!!a,select:function(j){var L=j.data;return L==null?void 0:L.brands},refetchInterval:function(j){var L;return((j==null||(L=j.state)===null||L===void 0||(L=L.data)===null||L===void 0||(L=L.data)===null||L===void 0?void 0:L.brands)||[]).find(function(H){return H.id===a})?!1:2*1e3}}}),E=k.data;z.useEffect(function(){a&&E!==null&&E!==void 0&&E.find(function(A){return A.id===a})&&n("/setup/".concat(a,"/queries"),{replace:!0})},[a,E,n]);var P=function(j,L){p(function(H){return Zm(Zm({},H),{},ix({},j,L))})},M=function(j){if(j.preventDefault(),C(null),m.description.length>250){C("Your brand description is too long. Please keep it within the 250-character limit."),f(!1);return}f(!0);var L=m.url;L&&!/^https?:\/\//i.test(L)&&(L="https://".concat(L)),O({data:{name:m.name,url:L,description:m.description,focusLanguage:m.language,country:m.country,regionOrCity:m.region}})};function B(A){return Qr(A)==="object"&&A!==null&&"response"in A&&Qr(A.response)==="object"&&A.response!==void 0&&"data"in A.response}var R=B(_)?_.response.data.errors:void 0;return y.jsxs("form",{onSubmit:M,children:[y.jsxs("div",{className:"yst-space-y-6",children:[y.jsx(T.Title,{size:"2",children:"Brand info"}),!!_&&y.jsx(T.Alert,{variant:"error",title:"Error",isVisible:!!_,children:y.jsx("ul",{children:R&&Qr(R)==="object"?Object.entries(R).flatMap(function(A){var j=Eo(A,2),L=j[0],H=j[1];return Array.isArray(H)?H.map(function(Q,F){return y.jsx("li",{children:Q},"".concat(L,"-").concat(F))}):null}):"There was an error creating the brand."})}),S&&y.jsx(T.Alert,{variant:"error",title:"Error",isVisible:!!S,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(T.TextField,{id:"name",label:"Brand name",value:m.name,onChange:function(A){return P("name",A.target.value)}}),y.jsx(T.TextField,{id:"url",label:"Website URL (optional)",placeholder:"Example: https://yourwebsite.com",value:m.url,onChange:function(A){return P("url",A.target.value)}}),y.jsxs("div",{id:"brand-description-textarea",children:[y.jsx(T.TextareaField,{id:"brand-description",label:"Brand description",value:m.description,onChange:function(A){var j=A.target.value;P("description",j)},...m.description.length>250?{validation:{variant:"error",message:"Your brand description is too long. Please keep it within the 250-character limit."}}:{},placeholder:"e.g. We design eco-friendly yoga mats for busy professionals who want sustainable gear that’s durable, stylish and kind to the planet."}),y.jsxs("div",{className:"yst-flex yst-mt-1",children:[y.jsxs("div",{className:"yst-flex-grow yst-flex-col",children:[m.description.length>250&&y.jsx("div",{className:"yst-text-red-500 yst-mb-2",children:"Your brand description is too long. Please keep it within the 250-character limit."}),"Tell us about your brand: what you do, who it’s for and what makes it special."]}),y.jsxs("div",{className:Oe("yst-text-xs yst-mt-[-4px] yst-ml-6",{"yst-text-slate-500":m.description.length<=250,"yst-text-red-500":m.description.length>250}),children:[m.description.length,"/250"]})]})]}),y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(T.Select,{className:"yst-max-w-sm",id:"language-select",label:"Target language",value:m.language,onChange:function(A){return P("language",A)},options:kD.map(function(A){return{label:A.label,value:A.value}})}),y.jsx("p",{children:"The main language your brand uses to communicate or create content."})]})]}),y.jsx(Ha,{}),y.jsxs("div",{className:"yst-space-y-6",children:[y.jsx(T.Title,{size:"2",children:"Location info"}),y.jsx("p",{children:"Specify a location to enhance the accuracy of the analysis."}),y.jsx(T.Autocomplete,{className:"yst-max-w-sm",id:"country-select",label:"Target country (optional)",value:m.country,nullable:!0,placeholder:"Select...",onChange:function(A){return P("country",A)},onQueryChange:function(){},selectedLabel:((t=Ym.find(function(A){return A.value===m.country}))===null||t===void 0?void 0:t.label)||"",children:Ym.map(function(A){return y.jsx(T.Autocomplete.Option,{value:A.value,children:A.label},A.value)})}),m.country&&y.jsx(T.TextField,{id:"region",label:"Target city, state, or region (optional)",value:m.region,onChange:function(A){return P("region",A.target.value)},description:`Enter a city, state, or region to narrow down the analysis. For
1293
- example: California, Bavaria, or Paris.`})]}),y.jsx(rx,{onBack:function(){return n(-1)},buttonText:"Generate queries",isButtonDisabled:x||!!a||d,isLoading:x||!!a})]})};const LD=Object.freeze(Object.defineProperty({__proto__:null,default:$D},Symbol.toStringTag,{value:"Module"})),tp=e=>I.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},I.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"}),I.createElement("defs",null,I.createElement("linearGradient",{id:"paint0_linear_3891_2757",x1:1.99951,y1:2,x2:15.3308,y2:3.72773,gradientUnits:"userSpaceOnUse"},I.createElement("stop",{stopColor:"#A61E69"}),I.createElement("stop",{offset:1,stopColor:"#6366F1"}))));function xa(e){"@babel/helpers - typeof";return xa=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},xa(e)}function DD(e){return ND(e)||RD(e)||sx(e)||ID()}function ID(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1294
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RD(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ND(e){if(Array.isArray(e))return gf(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 Tr(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){FD(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 FD(e,t,n){return(t=BD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BD(e){var t=qD(e,"string");return xa(t)=="symbol"?t:t+""}function qD(e,t){if(xa(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(xa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hf(){/*! 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 nn(b,"_invoke",function(S,C,w){var O,x,_,k=0,E=w||[],P=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(A,j){return O=A,x=0,_=e,M.n=j,o}};function B(R,A){for(x=R,_=A,t=0;!P&&k&&!j&&t<E.length;t++){var j,L=E[t],H=M.p,Q=L[2];R>3?(j=Q===A)&&(_=L[(x=L[4])?5:(x=3,3)],L[4]=L[5]=e):L[0]<=H&&((j=R<2&&H<L[1])?(x=0,M.v=A,M.n=L[1]):H<Q&&(j=R<3||L[0]>A||A>Q)&&(L[4]=R,L[5]=A,M.n=Q,x=0))}if(j||R>1)return o;throw P=!0,A}return function(R,A,j){if(k>1)throw TypeError("Generator is already running");for(P&&A===1&&B(A,j),x=A,_=j;(t=x<2?e:_)||!P;){O||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(k=2,O){if(x||(R="next"),t=O[R]){if(!(t=t.call(O,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=O.return)&&t.call(O),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);O=e}else if((t=(P=M.n<0)?_:S.call(C,M))!==o)break}catch(L){O=e,x=1,_=L}finally{k=1}}return{value:t,done:P}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(nn(t={},r,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,nn(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,nn(d,"constructor",u),nn(u,"constructor",l),l.displayName="GeneratorFunction",nn(u,i,"GeneratorFunction"),nn(d),nn(d,i,"Generator"),nn(d,r,function(){return this}),nn(d,"toString",function(){return"[object Generator]"}),(hf=function(){return{w:s,m:f}})()}function nn(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}nn=function(o,a,l,u){if(a)i?i(o,a,{value:l,enumerable:!u,configurable:!u,writable:!u}):o[a]=l;else{var c=function(f,h){nn(o,f,function(g){return this._invoke(f,h,g)})};c("next",0),c("throw",1),c("return",2)}},nn(e,t,n,r)}function rp(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function zD(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){rp(s,r,i,o,a,"next",l)}function a(l){rp(s,r,i,o,a,"throw",l)}o(void 0)})}}function ci(e,t){return GD(e)||UD(e,t)||sx(e,t)||HD()}function HD(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1295
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sx(e,t){if(e){if(typeof e=="string")return gf(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)?gf(e,t):void 0}}function gf(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 UD(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function GD(e){if(Array.isArray(e))return e}var is=5,Fo="Generating...",VD="Re-generating...",KD=100,WD=["******************************","***********************","*******************************************************","***********************************************","***************************************************************","*******************************************************","*******************************************************","***********************************************"],QD=Array.from({length:is},function(e,t){return{id:"query-".concat(t),text:Fo,isRegenerating:!0}}),YD=function(){var t,n=xu(),r=n.brandId,i="/setup/".concat(r,"/analysis"),s=dn(),o=Gt(),a=z.useState(QD),l=ci(a,2),u=l[0],c=l[1],d=z.useState(!1),f=ci(d,2),h=f[0],g=f[1],m=z.useState([]),p=ci(m,2),v=p[0],b=p[1],S=z.useState([]),C=ci(S,2),w=C[0],O=C[1],x=z.useState(!1),_=ci(x,2),k=_[0],E=_[1],P=z.useState(null),M=ci(P,2),B=M[0],R=M[1],A=z.useState(!1),j=ci(A,2),L=j[0],H=j[1],Q=v4(r||"",{query:{enabled:!!r}}),F=Q.data,G=Q.isRefetching,ie=Q.isError,ae=Q.refetch,N=Jl(r||"",{query:{enabled:!!r}}),le=N.data,te=z.useCallback(function(ue){var W;if(!(le!=null&&(W=le.data)!==null&&W!==void 0&&W.name))return!1;var ne=le.data.name.toLowerCase().trim();return ne?ue.toLowerCase().includes(ne):!1},[le==null||(t=le.data)===null||t===void 0?void 0:t.name]),me=z.useCallback(function(){return u.some(function(ue){return te(ue.text)})},[u,te]),J=function(){H(!1)},Se=function(){H(!1),r&&oe({brandId:r,data:{queries:u.map(function(W){return W.text})}})},ge=function(){H(!1);var W=u.findIndex(function(ne){return te(ne.text)});W!==-1&&setTimeout(function(){var ne=document.getElementById("query-text-".concat(W));ne&&(ne.focus(),ne.select())},KD)},ze=g4({mutation:{onSuccess:function(){var ue=zD(hf().m(function ne(ee){return hf().w(function(Ce){for(;;)switch(Ce.n){case 0:if(R(null),!(ee!=null&&ee.status&&ee.status>=200&&ee.status<300)){Ce.n=2;break}return Ce.n=1,Promise.all([o.invalidateQueries({queryKey:Pf(r||"")}),o.invalidateQueries({queryKey:Yn()})]);case 1:s(i);case 2:return Ce.a(2)}},ne)}));function W(ne){return ue.apply(this,arguments)}return W}(),onError:function(W){var ne,ee;if((W==null||(ne=W.response)===null||ne===void 0||(ne=ne.data)===null||ne===void 0?void 0:ne.message)==="Cannot update queries for a brand that has existing analyses."){s(i,{replace:!0});return}var Ce=(W==null||(ee=W.response)===null||ee===void 0||(ee=ee.data)===null||ee===void 0?void 0:ee.message)||(W==null?void 0:W.message)||"An unexpected error occurred.";R(Ce)}}}),oe=ze.mutate,He=ze.isPending;z.useEffect(function(){r||s("/setup",{replace:!0})},[r,s]),z.useEffect(function(){var ue;if(F!=null&&(ue=F.data)!==null&&ue!==void 0&&ue.queries&&Array.isArray(F.data.queries)){var W=F.data.queries.slice(0,is);c(W.map(function(ne,ee){return{id:"query-".concat(ee),text:ne,isRegenerating:!1}})),O(F.data.queries.slice(is))}else ie&&(c(Array.from({length:is},function(ne,ee){return{id:"query-".concat(ee),text:"",isRegenerating:!1}})),O([]))},[F,ie]),z.useEffect(function(){var ue;if(k&&F!==null&&F!==void 0&&(ue=F.data)!==null&&ue!==void 0&&ue.queries&&Array.isArray(F.data.queries)&&!G){var W=F.data.queries.slice(0,is),ne=v.map(Number);c(function(ee){return ee.map(function(Ce,gt){var we=ne.indexOf(gt);return Tr(Tr({},Ce),{},{text:we>=0&&W[we]?W[we]:Ce.text,isRegenerating:!1})})}),E(!1),b([])}},[F,G,k,v]);var lt=z.useCallback(function(ue,W){var ne=new Set(W);return w.filter(function(ee){return!ne.has(ee)}).slice(0,ue)},[w]),dt=z.useMemo(function(){return G||u.length===0||u.some(function(ue){return ue.isRegenerating||ue.text===Fo&&!ie||ue.text.trim()===""})||h},[G,u,h,ie]),Ne=G||u.some(function(ue){return ue.text===Fo})&&!ie,Fe=z.useCallback(function(ue){var W=ue.toString();b(function(ne){return ne.includes(W)?ne.filter(function(ee){return ee!==W}):[].concat(DD(ne),[W])})},[]),Y=z.useCallback(function(ue,W){c(function(ne){return ne.map(function(ee,Ce){return Ce===ue?Tr(Tr({},ee),{},{text:W}):ee})})},[]),Te=function(){g(!h),b([])},tt=z.useCallback(function(){if(!(G||v.length===0)){c(function(ee){return ee.map(function(Ce,gt){return Tr(Tr({},Ce),{},{isRegenerating:v.includes(gt.toString())})})});var ue=u.map(function(ee){return ee.text}),W=v.length,ne=lt(W,ue);ne.length===W?(c(function(ee){return ee.map(function(Ce,gt){var we=v.indexOf(gt.toString());return we>=0?Tr(Tr({},Ce),{},{text:ne[we],isRegenerating:!1}):Ce})}),O(function(ee){var Ce=new Set(ne);return ee.filter(function(gt){return!Ce.has(gt)})}),b([])):(E(!0),ae())}},[G,v,ae,u,lt]),$e=z.useCallback(function(ue){if(ue.preventDefault(),!!r){if(me()){H(!0);return}oe({brandId:r,data:{queries:u.map(function(W){return W.text})}})}},[r,u,oe,me]);return y.jsxs("div",{children:[B&&y.jsx(T.Alert,{className:"yst-mb-4",variant:"error",children:B}),y.jsxs("form",{onSubmit:$e,children:[y.jsxs("div",{className:"yst-mb-8",children:[y.jsx(T.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:Oe("yst-flex yst-gap-2",h?"yst-justify-end":"yst-justify-start"),children:h?y.jsxs(y.Fragment,{children:[y.jsx(T.Button,{size:"small",variant:"secondary",onClick:Te,children:"Done"}),y.jsxs(T.Button,{variant:"secondary",size:"small",onClick:tt,className:"yst-gap-1",isLoading:G,disabled:G||v.length===0,children:[y.jsx(tp,{"aria-hidden":"true"}),"Regenerate selected queries"]})]}):y.jsxs(T.Button,{size:"small",variant:"secondary",onClick:Te,className:"yst-gap-1.5",disabled:Ne,children:[y.jsx(G4,{}),"Select queries to regenerate"]})})]})]}),y.jsx("div",{className:"yst-mb-8",children:u.length===0?WD.map(function(ue,W){return y.jsx("div",{className:Oe("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(T.SkeletonLoader,{children:ue||"Example placeholder query for demonstration purposes."})},"placeholder-query-".concat(W))}):u.slice(0,is).map(function(ue,W){var ne=ue.isRegenerating?ue.text===Fo?Fo:VD:ue.text;return y.jsx("div",{className:Oe("yst-mb-4"),children:y.jsxs("div",{className:"yst-flex yst-gap-2",children:[h&&y.jsx("div",{className:"yst-flex yst-items-center",children:y.jsx(T.Checkbox,{id:"query-regenerate-".concat(W),name:"query-regenerate-".concat(W),value:W.toString(),checked:v.includes(W.toString()),onChange:function(){return Fe(W)},disabled:G})}),y.jsx("div",{className:"yst-flex-1",children:y.jsx(T.TextField,{id:"query-text-".concat(W),label:"Query ".concat(W+1),type:"text",value:ne,onChange:function(ee){ue.isRegenerating||Y(W,ee.target.value)},placeholder:"Enter your query...",className:"yst-w-full",disabled:ue.isRegenerating,required:!0,minLength:3,maxLength:255,validation:te(ue.text)?{variant:"warning",message:"For more accurate insights, avoid using your brand name in the query."}:void 0})})]})},ue.id)})}),y.jsx(rx,{buttonText:"Run analysis (~ 5 minutes)",isButtonDisabled:dt,isLoading:He})]}),y.jsx(T.Modal,{isOpen:L,onClose:J,position:"center",as:"div",children:y.jsx(T.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-amber-100",children:y.jsx(o2,{className:"yst-h-6 yst-w-6 yst-text-amber-600"})})}),y.jsxs("div",{className:"yst-flex-1",children:[y.jsx(T.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(T.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Brand name detected in your queries"})}),y.jsxs(T.Modal.Container.Content,{className:"yst-mb-6 yst-space-y-3",children:[y.jsx("p",{className:"yst-text-sm yst-text-slate-600",children:"We found your brand name in one or more of your queries. Using your brand name in queries often show more mentions and more positive sentiment, which can skew your results."}),y.jsx("p",{className:"yst-text-sm yst-text-slate-600",children:"For more balanced results, remove your brand name or make the queries more general."})]}),y.jsxs(T.Modal.Container.Footer,{className:"yst-flex yst-justify-end yst-gap-3",children:[y.jsxs(T.Button,{onClick:Se,variant:"secondary",className:"yst-gap-1.5",disabled:He,isLoading:He,children:[y.jsx(tp,{}),"Run analysis anyway"]}),y.jsx(T.Button,{variant:"primary",onClick:ge,children:"Review and edit queries"})]})]})]})})})]})};const XD=Object.freeze(Object.defineProperty({__proto__:null,default:YD},Symbol.toStringTag,{value:"Module"}));var ZD=["min","max","progress","className"];function JD(e,t){if(e==null)return{};var n,r,i=eI(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 eI(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 ox=z.forwardRef(function(e,t){var n=e.min,r=e.max,i=e.progress,s=e.className,o=JD(e,ZD),a=z.useMemo(function(){var u=Math.max(0,r-n);if(u===0)return 0;var c=(i-n)/u*100;return Math.max(0,Math.min(100,c))},[n,r,i]),l=Math.min(Math.max(i,n),r);return y.jsx("div",{ref:t,role:"progressbar","aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":l,"aria-valuetext":"".concat(Math.round(a),"%"),className:Oe(s),...o,children:y.jsx("div",{className:"yst-relative yst-h-2 yst-w-full yst-overflow-hidden yst-rounded-full yst-bg-slate-200/40",children:y.jsx("div",{className:"yst-absolute yst-left-0 yst-top-0 yst-h-full yst-rounded-full yst-bg-[linear-gradient(97.38deg,_#A61E69_0%,_#6366F1_100%)] yst-transition-[width] yst-duration-300 yst-ease-out",style:{width:"".concat(a,"%")}})})})});ox.displayName="ProgressBarGradient";var es=[{labelAbove:"Running queries...",label:"Running queries",threshold:99},{labelAbove:"Done!",label:"Building analysis",threshold:100}],ax=function(t){var n=t.progress,r=n===void 0?0:n,i=t.className,s=i===void 0?"":i,o=function(){for(var u=0;u<es.length;u++)if(r<=es[u].threshold)return es[u];return es[es.length-1]},a=o();return y.jsxs("div",{className:Oe("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(T.Spinner,{}):y.jsx(f2,{className:"yst-text-green-400"}),y.jsx("span",{className:"yst-text-sm yst-font-medium yst-italic",children:a.labelAbove})]}),y.jsx(ox,{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:es.map(function(l){return y.jsx("span",{children:y.jsx(Nu,{disabled:a.label!==l.label,children:l.label})},l.label)})})]})};ax.propTypes={progress:$d.number,className:$d.string};var tI=function(t){switch(t){case"pending":case"processing":return 2*1e3;case"completed":return!1;default:return 10*1e3}},nI=function(){var t,n,r,i=dn(),s=Gt(),o=xu(),a=Rn(),l=a.brandId,u=o.brandId||l,c=Jl(u,{query:{enabled:!!u,select:function(C){var w=C.data;return w}}}),d=c.data,f=z5(u,"latest",{query:{enabled:!!u,select:function(C){var w=C.data;return w},refetchInterval:function(C){var w,O=C==null||(w=C.state)===null||w===void 0||(w=w.data)===null||w===void 0?void 0:w.data;return tI(O==null?void 0:O.status)}}}),h=f.data,g=h==null?void 0:h.id,m=g?"/brands/".concat(u,"/analysis/").concat(g):"/brands/".concat(u);z.useEffect(function(){var S=(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&&y7(d.nextScheduledAnalysis,5)&&!S&&i("/brands/".concat(u),{replace:!0})},[d==null?void 0:d.nextScheduledAnalysis,u,i,h==null?void 0:h.status]),z.useEffect(function(){((d==null?void 0:d.setupStatus)==="completed"||(d==null?void 0:d.setupStatus)==="scheduledFirstAnalysis"&&d!==null&&d!==void 0&&d.firstNextAnalysisOpportunity&&!k2(d.firstNextAnalysisOpportunity,2))&&i(m,{replace:!0})},[d==null?void 0:d.firstNextAnalysisOpportunity,d==null?void 0:d.setupStatus,m,i]);var 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 S=80/p,C=v*S;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(ax,{progress:b}),y.jsx(Ha,{}),y.jsx("div",{className:"yst-space-y-8",children:d==null||(r=d.queries)===null||r===void 0?void 0:r.map(function(S){var C,w=S.id,O=S.query,x=w&&(h==null||(C=h.completedQueries)===null||C===void 0?void 0:C.includes(w));return y.jsxs("div",{className:Oe("yst-flex yst-items-center yst-justify-between yst-gap-3"),children:[x===!0?y.jsx(f2,{className:"yst-h-5 yst-w-5 yst-text-green-400"}):y.jsx(T.Spinner,{}),y.jsx("span",{className:"yst-flex-1 yst-text-sm",children:O})]},"result-item-".concat(O))})})]}),y.jsx("div",{className:"yst-mb-[-2rem] yst-ml-[-2rem] yst-mr-[-2rem] yst-mt-8 yst-flex yst-justify-end yst-gap-4 yst-rounded-bl-lg yst-rounded-br-lg yst-border-t yst-border-slate-200 yst-bg-slate-50 yst-px-8 yst-py-6",children:y.jsx(T.Button,{as:ti,to:m,onClick:function(S){if(b!==100){S.preventDefault();return}s.clear()},disabled:b!==100,children:"Continue →"})})]})};const rI=Object.freeze(Object.defineProperty({__proto__:null,default:nI},Symbol.toStringTag,{value:"Module"}));exports.AIInsightsClient=WA;exports.setApiBaseUrl=Jv;
1283
+ `}},En=e=>nx("light",e),An=e=>nx("dark",e);Au(["click","mousedown","input"]);var xL=e=>{const[t,n]=Cb({prefix:"TanstackQueryDevtools"}),r=Tv(),i=K(()=>{const s=t.theme_preference||_b;return s!=="system"?s:r()});return D(Jf.Provider,{value:e,get children(){return D(Ab,{localStore:t,setLocalStore:n,get children(){return D(th.Provider,{value:i,get children(){return D(aL,{localStore:t,setLocalStore:n})}})}})}})},wL=xL;const SL=Object.freeze(Object.defineProperty({__proto__:null,default:wL},Symbol.toStringTag,{value:"Module"}));var CL=e=>{const[t,n]=Cb({prefix:"TanstackQueryDevtools"}),r=Tv(),i=K(()=>{const s=t.theme_preference||_b;return s!=="system"?s:r()});return D(Jf.Provider,{value:e,get children(){return D(Ab,{disabled:!0,localStore:t,setLocalStore:n,get children(){return D(th.Provider,{value:i,get children(){return D(uL,{get children(){return D(wh,{localStore:t,setLocalStore:n,get onClose(){return e.onClose},showPanelViewOnly:!0})}})}})}})}})},_L=CL;const kL=Object.freeze(Object.defineProperty({__proto__:null,default:_L},Symbol.toStringTag,{value:"Module"}));function rx(e){var t=e.children,n=e.description,r=e.title;return y.jsxs(T.Paper.Header,{children:[r&&y.jsx(T.Title,{className:Oe({"yst-mb-3":n||t}),children:r}),n&&(typeof n=="string"?y.jsx("p",{children:n}):n),t]})}function qo(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,g,m,p){var v=g&&g.prototype instanceof a?g:a,b=Object.create(v.prototype);return Zt(b,"_invoke",function(S,C,w){var O,x,_,k=0,E=w||[],j=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(A,P){return O=A,x=0,_=e,M.n=P,o}};function B(R,A){for(x=R,_=A,t=0;!j&&k&&!P&&t<E.length;t++){var P,L=E[t],H=M.p,G=L[2];R>3?(P=G===A)&&(_=L[(x=L[4])?5:(x=3,3)],L[4]=L[5]=e):L[0]<=H&&((P=R<2&&H<L[1])?(x=0,M.v=A,M.n=L[1]):H<G&&(P=R<3||L[0]>A||A>G)&&(L[4]=R,L[5]=A,M.n=G,x=0))}if(P||R>1)return o;throw j=!0,A}return function(R,A,P){if(k>1)throw TypeError("Generator is already running");for(j&&A===1&&B(A,P),x=A,_=P;(t=x<2?e:_)||!j;){O||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(k=2,O){if(x||(R="next"),t=O[R]){if(!(t=t.call(O,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=O.return)&&t.call(O),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);O=e}else if((t=(j=M.n<0)?_:S.call(C,M))!==o)break}catch(L){O=e,x=1,_=L}finally{k=1}}return{value:t,done:j}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(Zt(t={},r,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,Zt(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,Zt(d,"constructor",u),Zt(u,"constructor",l),l.displayName="GeneratorFunction",Zt(u,i,"GeneratorFunction"),Zt(d),Zt(d,i,"Generator"),Zt(d,r,function(){return this}),Zt(d,"toString",function(){return"[object Generator]"}),(qo=function(){return{w:s,m:f}})()}function Zt(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Zt=function(o,a,l,u){if(a)i?i(o,a,{value:l,enumerable:!u,configurable:!u,writable:!u}):o[a]=l;else{var c=function(f,h){Zt(o,f,function(g){return this._invoke(f,h,g)})};c("next",0),c("throw",1),c("return",2)}},Zt(e,t,n,r)}function Mm(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function $m(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){Mm(s,r,i,o,a,"next",l)}function a(l){Mm(s,r,i,o,a,"throw",l)}o(void 0)})}}function Yc(e,t){return TL(e)||AL(e,t)||EL(e,t)||OL()}function OL(){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 EL(e,t){if(e){if(typeof e=="string")return Lm(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)?Lm(e,t):void 0}}function Lm(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 AL(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function TL(e){if(Array.isArray(e))return e}var PL=function(t){var n=t.isOpen,r=t.onClose,i=t.groupToEdit,s=t.allBrands,o=Nn(),a=o.brandId,l=o.analysisId,u=z.useState(""),c=Yc(u,2),d=c[0],f=c[1],h=z.useState([]),g=Yc(h,2),m=g[0],p=g[1],v=z.useState(!1),b=Yc(v,2),S=b[0],C=b[1],w=Gt();z.useEffect(function(){if(n&&i&&i.type==="group"){var H;f(String(i.name||""));var G=((H=i.groupedBrands)===null||H===void 0?void 0:H.map(function(F){return String(F.id||"")}))||[];p(G)}},[n,i]);var O=o2({mutation:{onSuccess:function(){var H=$m(qo().m(function F(){return qo().w(function(U){for(;;)switch(U.n){case 0:return U.n=1,Promise.all([w.invalidateQueries({queryKey:tu(a)}),w.invalidateQueries({queryKey:yr(a,"latest")}),w.invalidateQueries({queryKey:Zn(a,"latest")}),w.invalidateQueries({queryKey:yr(a,l)}),w.invalidateQueries({queryKey:Zn(a,l)})]);case 1:B();case 2:return U.a(2)}},F)}));function G(){return H.apply(this,arguments)}return G}(),onError:function(G){console.error("Error creating brand group:",G)}}}),x=O.mutate,_=O.isPending,k=r4({mutation:{onSuccess:function(){var H=$m(qo().m(function F(){return qo().w(function(U){for(;;)switch(U.n){case 0:return U.n=1,Promise.all([w.invalidateQueries({queryKey:tu(a)}),w.invalidateQueries({queryKey:yr(a,"latest")}),w.invalidateQueries({queryKey:Zn(a,"latest")}),w.invalidateQueries({queryKey:yr(a,l)}),w.invalidateQueries({queryKey:Zn(a,l)})]);case 1:B(),P();case 2:return U.a(2)}},F)}));function G(){return H.apply(this,arguments)}return G}(),onError:function(G){console.error("Error deleting brand group:",G),window.alert("An error occurred while ungrouping the brands. Please try again later.")}}}),E=k.mutate,j=k.isPending,M=function(){!d.trim()||!(i!=null&&i.id)||x({brandId:a,data:{groupName:d.trim(),brandIds:m.map(function(G){return Number(G)})}})},B=function(){f(""),p([]),r()},R=function(){return m.map(function(G){if(i&&i.type==="group"){var F,U=(F=i.groupedBrands)===null||F===void 0?void 0:F.find(function(ae){return String(ae.id)===G});if(U)return U.name||""}var ie=s.find(function(ae){return String(ae.id)===G});return ie?ie.type==="group"?"Group: ".concat(ie.name):ie.name||"":""}).filter(Boolean)},A=function(){C(!0)},P=function(){return C(!1)},L=function(){typeof(i==null?void 0:i.id)=="number"&&E({brandId:a,brandGroupId:i.id})};return!i||i.type!=="group"?null:y.jsxs(y.Fragment,{children:[y.jsx(T.Modal,{isOpen:n,onClose:S?function(){}:B,as:"div",children:y.jsx(T.Modal.Panel,{children:y.jsxs(T.Modal.Container,{children:[y.jsx(T.Modal.Container.Header,{className:"yst-mb-4",children:y.jsx(T.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Edit brand group"})}),y.jsxs(T.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(T.TextInput,{id:"editGroupName",value:d,onChange:function(H){return f(H.target.value)},placeholder:"Enter group name",className:"yst-w-full"})]}),y.jsxs("div",{children:[y.jsx(T.TagField,{readOnly:!0,id:"editGroupedBrands",label:"Grouped brands",tags:R(),onRemoveTag:function(H){if(m.length<2)return C(!0);p(function(G){return G.filter(function(F,U){return U!==H})})},onAddTag:function(){}}),m.length===0?y.jsx("p",{className:"yst-mt-2 yst-text-sm",children:'Click "Ungroup brands" to remove this group.'}):y.jsx("p",{className:"yst-mt-2 yst-text-sm yst-italic yst-text-gray-500",children:"Note: To add brands to this group, save this group, then use the checkboxes to select this group as well as any additional brands to be grouped."})]})]}),y.jsx(T.Modal.Container.Footer,{children:y.jsxs("div",{className:"yst-flex yst-w-full yst-items-center yst-justify-between",children:[y.jsx("div",{className:"yst-flex yst-justify-start",children:y.jsx(T.Button,{variant:"tertiary",onClick:A,disabled:_,className:"yst-text-red-600",children:"Ungroup brands"})}),y.jsxs("div",{className:"yst-flex yst-justify-end yst-gap-2",children:[y.jsx(T.Button,{variant:"secondary",onClick:B,children:"Cancel"}),y.jsx(T.Button,{variant:"primary",onClick:M,disabled:!d.trim()||_,isLoading:_,children:_?"Saving...":"Save changes"})]})]})})]})})}),y.jsx(zu,{isOpen:S,onClose:P,onConfirm:L,title:"Ungroup this brand group?",description:y.jsxs(y.Fragment,{children:[y.jsx("p",{children:"The group will be removed, but the brands inside will remain in your brand list."}),y.jsx("p",{children:"This action cannot be undone. To create a new group with these brands, simply select them and create a new group."})]}),confirmText:"Yes, ungroup",isLoading:j})]})};function cf(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,g,m,p){var v=g&&g.prototype instanceof a?g:a,b=Object.create(v.prototype);return Jt(b,"_invoke",function(S,C,w){var O,x,_,k=0,E=w||[],j=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(A,P){return O=A,x=0,_=e,M.n=P,o}};function B(R,A){for(x=R,_=A,t=0;!j&&k&&!P&&t<E.length;t++){var P,L=E[t],H=M.p,G=L[2];R>3?(P=G===A)&&(_=L[(x=L[4])?5:(x=3,3)],L[4]=L[5]=e):L[0]<=H&&((P=R<2&&H<L[1])?(x=0,M.v=A,M.n=L[1]):H<G&&(P=R<3||L[0]>A||A>G)&&(L[4]=R,L[5]=A,M.n=G,x=0))}if(P||R>1)return o;throw j=!0,A}return function(R,A,P){if(k>1)throw TypeError("Generator is already running");for(j&&A===1&&B(A,P),x=A,_=P;(t=x<2?e:_)||!j;){O||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(k=2,O){if(x||(R="next"),t=O[R]){if(!(t=t.call(O,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=O.return)&&t.call(O),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);O=e}else if((t=(j=M.n<0)?_:S.call(C,M))!==o)break}catch(L){O=e,x=1,_=L}finally{k=1}}return{value:t,done:j}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(Jt(t={},r,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,Jt(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,Jt(d,"constructor",u),Jt(u,"constructor",l),l.displayName="GeneratorFunction",Jt(u,i,"GeneratorFunction"),Jt(d),Jt(d,i,"Generator"),Jt(d,r,function(){return this}),Jt(d,"toString",function(){return"[object Generator]"}),(cf=function(){return{w:s,m:f}})()}function Jt(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Jt=function(o,a,l,u){if(a)i?i(o,a,{value:l,enumerable:!u,configurable:!u,writable:!u}):o[a]=l;else{var c=function(f,h){Jt(o,f,function(g){return this._invoke(f,h,g)})};c("next",0),c("throw",1),c("return",2)}},Jt(e,t,n,r)}function Dm(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function jL(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){Dm(s,r,i,o,a,"next",l)}function a(l){Dm(s,r,i,o,a,"throw",l)}o(void 0)})}}function Im(e,t){return DL(e)||LL(e,t)||$L(e,t)||ML()}function ML(){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 $L(e,t){if(e){if(typeof e=="string")return Rm(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)?Rm(e,t):void 0}}function Rm(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 LL(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function DL(e){if(Array.isArray(e))return e}var IL=function(t){var n=t.isOpen,r=t.onClose,i=t.brandId,s=t.brandsToGroup,o=t.onGroupCreated,a=Gt(),l=Nn(),u=l.analysisId,c=z.useState(""),d=Im(c,2),f=d[0],h=d[1],g=z.useState([]),m=Im(g,2),p=m[0],v=m[1];z.useEffect(function(){if(n&&s.length>0){var _,k=(_=s[0])===null||_===void 0?void 0:_.name;h(String(k||"New Group")),v(s.map(function(E){var j;return String((j=E.id)!==null&&j!==void 0?j:"")}))}},[n,s]);var b=o2({mutation:{onSuccess:function(){var _=jL(cf().m(function E(){return cf().w(function(j){for(;;)switch(j.n){case 0:return j.n=1,Promise.all([a.invalidateQueries({queryKey:tu(i)}),a.invalidateQueries({queryKey:jf(i)}),a.invalidateQueries({queryKey:yr(i,"latest")}),a.invalidateQueries({queryKey:Zn(i,"latest")}),a.invalidateQueries({queryKey:yr(i,u)}),a.invalidateQueries({queryKey:Zn(i,u)})]);case 1:o==null||o(),w();case 2:return j.a(2)}},E)}));function k(){return _.apply(this,arguments)}return k}(),onError:function(k){console.error("Error creating group:",k)}}}),S=b.mutate,C=b.isPending,w=function(){h(""),v([]),r()},O=function(){if(!(!f.trim()||p.length===0)){var k=p.flatMap(function(E){var j=s.find(function(M){return String(M.id)===E});return j&&j.type==="group"&&Array.isArray(j.groupedBrands)?j.groupedBrands.map(function(M){return String(M.id)}):E});S({brandId:i,data:{groupName:f.trim(),brandIds:k.filter(function(E){return E!==""}).map(function(E){return Number(E)})}})}},x=function(k){v(function(E){return E.filter(function(j){return j!==k})})};return y.jsx(T.Modal,{isOpen:n,onClose:w,children:y.jsx(T.Modal.Panel,{children:y.jsxs(T.Modal.Container,{children:[y.jsx(T.Modal.Container.Header,{children:y.jsx(T.Modal.Title,{children:"Edit brand group"})}),y.jsxs(T.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(T.TextInput,{id:"groupName",value:f,onChange:function(_){return h(_.target.value)},placeholder:"Enter group name",className:"yst-w-full"})]}),y.jsxs("div",{children:[y.jsx(T.TagField,{readOnly:!0,id:"groupedBrands",label:"Brands in group (".concat(p.length,")"),tags:p.map(function(_){var k=s.find(function(E){return String(E.id)===_});return k?k.type==="group"?"Group: ".concat(k.name):k.name||"":""}).filter(Boolean),onRemoveTag:function(_){var k=p.find(function(E){var j=s.find(function(B){return String(B.id)===E});if(!j)return!1;var M=j.type==="group"?"Group: ".concat(j.name):j.name||"";return M===_});k&&x(k)},onAddTag:function(){}}),p.length===0&&y.jsx("p",{className:"yst-text-sm yst-italic yst-text-gray-500",children:"No brands selected"})]}),y.jsx("p",{children:"Note: To add brands to this group, save this group, then use the checkboxes to select this group as well as any additional brands to be grouped."})]}),y.jsx(T.Modal.Container.Footer,{className:"yst-pt-4",children:y.jsxs("div",{className:"yst-flex yst-justify-end yst-gap-2",children:[y.jsx(T.Button,{variant:"secondary",onClick:w,disabled:C,children:"Cancel"}),y.jsx(T.Button,{variant:"primary",onClick:O,disabled:!f.trim()||p.length===0||C,children:C?"Saving...":"Save group"})]})})]})})})};function Sa(e){"@babel/helpers - typeof";return Sa=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},Sa(e)}function Nm(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 Fm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Nm(Object(n),!0).forEach(function(r){ix(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nm(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ix(e,t,n){return(t=RL(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RL(e){var t=NL(e,"string");return Sa(t)=="symbol"?t:t+""}function NL(e,t){if(Sa(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Sa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function FL(e){return zL(e)||qL(e)||sx(e)||BL()}function BL(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1286
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qL(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function zL(e){if(Array.isArray(e))return df(e)}function Un(e,t){return GL(e)||UL(e,t)||sx(e,t)||HL()}function HL(){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 sx(e,t){if(e){if(typeof e=="string")return df(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)?df(e,t):void 0}}function df(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 UL(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function GL(e){if(Array.isArray(e))return e}var KL=function(){var t,n=fn(),r=z.useState(!1),i=Un(r,2),s=i[0],o=i[1],a=z.useState({}),l=Un(a,2),u=l[0],c=l[1],d=z.useState(""),f=Un(d,2),h=f[0],g=f[1],m=z.useState(1),p=Un(m,2),v=p[0],b=p[1],S=z.useState({}),C=Un(S,2),w=C[0],O=C[1],x=z.useState(!1),_=Un(x,2),k=_[0],E=_[1],j=z.useState(!1),M=Un(j,2),B=M[0],R=M[1],A=z.useState(null),P=Un(A,2),L=P[0],H=P[1],G=Nn(),F=G.brandId;function U(Q){return String(Q.id)}var ie=Z5(F,{query:{enabled:!!F}}),ae=ie.data,N=ie.isLoading,le=10,te=(ae==null||(t=ae.data)===null||t===void 0?void 0:t.associatedBrands.filter(function(Q){var ne,ee;return h?((ne=(ee=Q.name)===null||ee===void 0?void 0:ee.toLowerCase())!==null&&ne!==void 0?ne:"").includes(h.toLowerCase()):!0}))||[],me=Math.ceil(te.length/le),J=(v-1)*le,Se=FL(te).sort(function(Q,ne){return Q.type==="group"&&ne.type!=="group"?-1:Q.type!=="group"&&ne.type==="group"?1:0}),ge=Se.slice(J,J+le),ze=function(ne){var ee=te.find(function(Ce){return U(Ce)===ne});ee&&ee.type==="group"&&(H(ee),R(!0))},oe=Object.entries(w).filter(function(Q){var ne=Un(Q,2),ee=ne[1];return ee}).map(function(Q){var ne=Un(Q,1),ee=ne[0];return ee}),He=function(){E(!0)},lt=function(ne){g(ne.target.value),b(1)},dt=function(ne){O(function(ee){return Fm(Fm({},ee),{},ix({},ne,!ee[ne]))})},Ne=function(){n("/")},Fe=function(){O({}),c({}),o(!1)},Y=function(){E(!1)},Te=function(){O({}),b(1),g("")},tt=function(){R(!1),H(null)},$e=function(ne,ee){return ne in u?!!u[ne]:!ee.isHidden},ue=[{Header:"Brand name",accessor:"name",Cell:function(ne){var ee=ne.value,Ce=ne.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(T.Checkbox,{id:"brand-checkbox-".concat(Ce.id),checked:!!w[U(Ce)],onChange:function(){return dt(U(Ce))},value:U(Ce),label:Ce.isSelf?y.jsx(qu,{children:ee}):ee,name:"brand-checkbox-".concat(Ce.id),disabled:!$e(U(Ce),Ce)}),Ce.type==="group"&&y.jsx(K6,{className:"yst-h-4 yst-w-4 yst-text-slate-400"})]})})},LoadingComponent:function(ne){var ee=ne.id,Ce=ee===void 0?"":ee;return y.jsxs("div",{className:"yst-flex",children:[y.jsx(T.Checkbox,{id:"loading-row-checkbox-".concat(Ce),value:"loading",label:"",disabled:!0,name:"brand-checkbox-".concat(Ce)})," ",y.jsx(T.SkeletonLoader,{className:"yst-h-6 yst-w-32",id:"loading-row-skeleton-".concat(Ce)})]})}},{Header:"Actions",accessor:"id",Cell:function(ne){var ee=ne.value,Ce=ne.row;return y.jsx(y.Fragment,{children:Ce.type==="group"?y.jsxs(T.Button,{variant:"tertiary",size:"small",onClick:function(){return ze(String(ee!=null?ee:""))},className:"yst-gap-1.5 yst-px-0",disabled:!$e(U(Ce),Ce),children:[y.jsx(d2,{className:"yst-h-4 yst-w-4"}),"Edit group"]}):void 0})},LoadingComponent:function(){return y.jsx(T.SkeletonLoader,{className:"yst-h-6 yst-w-24"})}}];return y.jsxs(T.Paper,{className:"yst-mx-auto yst-max-w-2xl",children:[y.jsx(rx,{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(T.Paper.Content,{children:[y.jsx("div",{className:"yst-mb-6",children:y.jsx(T.TextInput,{id:"brand-search",label:"Search brands",placeholder:"Search brands",value:h,onChange:lt})}),y.jsx("div",{className:"yst-mb-6",children:y.jsxs(T.Table,{columns:ue,className:"yst-w-full",variant:"minimal",children:[y.jsx(T.Table.Head,{children:y.jsx(T.Table.Row,{children:ue.map(function(Q){return y.jsx(T.Table.Header,{children:Q.Header},Q.accessor)})})}),y.jsx(T.Table.Body,{children:N?[1,2,3].map(function(Q,ne){return y.jsx(T.Table.Row,{children:ue.map(function(ee,Ce){return y.jsx(T.Table.Cell,{children:y.jsx(ee.LoadingComponent,{id:"skeleton-".concat(ne,"-").concat(Ce)},ee.accessor)},"cell-".concat(Ce))})},ne)}):ge.length===0?y.jsx(T.Table.Row,{children:y.jsx(T.Table.Cell,{colSpan:ue.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(T.Button,{variant:"secondary",size:"small",onClick:function(){g(""),b(1)},className:"yst-mt-4",children:"Clear search"})]})})}):ge.map(function(Q){return y.jsx(T.Table.Row,{children:ue.map(function(ne){return y.jsx(T.Table.Cell,{children:ne.Cell?ne.Cell({value:Q[ne.accessor],row:Q}):Q[ne.accessor]},ne.accessor)})},Q.id)})})]})}),y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-between",children:[y.jsxs(T.Button,{variant:"secondary",onClick:He,className:"yst-mb-0 yst-gap-2",disabled:oe.length<2,children:[y.jsx(o6,{})," Group brands"]}),y.jsx(T.Pagination,{variant:"text",current:v,total:me,onNavigate:b,className:"yst-flex-row",screenReaderTextPrevious:"Previous page",screenReaderTextNext:"Next page"})]})]}),y.jsx(Lf,{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(T.Button,{variant:"secondary",className:"yst-mb-0",onClick:Fe,children:"Discard changes"}),y.jsx(T.Button,{variant:"primary",className:"yst-mb-0",onClick:Ne,children:"Save changes"})]}):y.jsx(T.Button,{as:ii,to:"/brands/".concat(F),variant:"tertiary",className:"yst-mb-0",children:"Return to analysis"})})}),y.jsx(IL,{isOpen:k,onClose:Y,brandId:F,brandsToGroup:te.filter(function(Q){return oe.includes(U(Q))}),onGroupCreated:Te}),y.jsx(PL,{isOpen:B,onClose:tt,groupToEdit:L,allBrands:te})]})};const VL=Object.freeze(Object.defineProperty({__proto__:null,default:KL},Symbol.toStringTag,{value:"Module"}));function WL(e,t){return ZL(e)||XL(e,t)||YL(e,t)||QL()}function QL(){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 YL(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 XL(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function ZL(e){if(Array.isArray(e))return e}var JL=function(t){var n=t.isOpen,r=t.onClose,i=Gt(),s=z.useState(""),o=WL(s,2),a=o[0],l=o[1],u=E4({mutation:{onSuccess:function(){i.clear(),r()}}}),c=u.mutate,d=u.isPending;return z.useEffect(function(){n&&l("")},[n]),y.jsx(zu,{isOpen:n,onClose:r,onConfirm:function(){c()},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(T.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 ff(){/*! 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 en(b,"_invoke",function(S,C,w){var O,x,_,k=0,E=w||[],j=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(A,P){return O=A,x=0,_=e,M.n=P,o}};function B(R,A){for(x=R,_=A,t=0;!j&&k&&!P&&t<E.length;t++){var P,L=E[t],H=M.p,G=L[2];R>3?(P=G===A)&&(_=L[(x=L[4])?5:(x=3,3)],L[4]=L[5]=e):L[0]<=H&&((P=R<2&&H<L[1])?(x=0,M.v=A,M.n=L[1]):H<G&&(P=R<3||L[0]>A||A>G)&&(L[4]=R,L[5]=A,M.n=G,x=0))}if(P||R>1)return o;throw j=!0,A}return function(R,A,P){if(k>1)throw TypeError("Generator is already running");for(j&&A===1&&B(A,P),x=A,_=P;(t=x<2?e:_)||!j;){O||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(k=2,O){if(x||(R="next"),t=O[R]){if(!(t=t.call(O,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=O.return)&&t.call(O),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);O=e}else if((t=(j=M.n<0)?_:S.call(C,M))!==o)break}catch(L){O=e,x=1,_=L}finally{k=1}}return{value:t,done:j}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(en(t={},r,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,en(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,en(d,"constructor",u),en(u,"constructor",l),l.displayName="GeneratorFunction",en(u,i,"GeneratorFunction"),en(d),en(d,i,"Generator"),en(d,r,function(){return this}),en(d,"toString",function(){return"[object Generator]"}),(ff=function(){return{w:s,m:f}})()}function en(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}en=function(o,a,l,u){if(a)i?i(o,a,{value:l,enumerable:!u,configurable:!u,writable:!u}):o[a]=l;else{var c=function(f,h){en(o,f,function(g){return this._invoke(f,h,g)})};c("next",0),c("throw",1),c("return",2)}},en(e,t,n,r)}function qm(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function eD(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){qm(s,r,i,o,a,"next",l)}function a(l){qm(s,r,i,o,a,"throw",l)}o(void 0)})}}function tD(e,t){return sD(e)||iD(e,t)||rD(e,t)||nD()}function nD(){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 rD(e,t){if(e){if(typeof e=="string")return zm(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)?zm(e,t):void 0}}function zm(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 iD(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function sD(e){if(Array.isArray(e))return e}var oD=function(t){var n=t.isOpen,r=t.brandId,i=t.onClose,s=t.brandName,o=Gt(),a=z.useState(""),l=tD(a,2),u=l[0],c=l[1],d=h4({mutation:{onSuccess:function(){var g=eD(ff().m(function p(){return ff().w(function(v){for(;;)switch(v.n){case 0:return v.n=1,Promise.all([o.invalidateQueries({queryKey:Xn()}),o.invalidateQueries({queryKey:Nu()})]);case 1:i();case 2:return v.a(2)}},p)}));function m(){return g.apply(this,arguments)}return m}()}}),f=d.mutate,h=d.isPending;return z.useEffect(function(){n&&c("")},[n]),y.jsx(zu,{isOpen:n,onClose:i,onConfirm:function(){if(!s){console.error("Brand name is required for deletion confirmation");return}f({brandId:r})},isLoading:h,disabled:u.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(T.TextField,{id:"delete-modal-brand-name-confirmation",label:"To confirm, please type your brand name ".concat(s,":"),value:u,onChange:function(g){return c(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 Ca(e){"@babel/helpers - typeof";return Ca=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ca(e)}function zo(){/*! 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 tn(b,"_invoke",function(S,C,w){var O,x,_,k=0,E=w||[],j=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(A,P){return O=A,x=0,_=e,M.n=P,o}};function B(R,A){for(x=R,_=A,t=0;!j&&k&&!P&&t<E.length;t++){var P,L=E[t],H=M.p,G=L[2];R>3?(P=G===A)&&(_=L[(x=L[4])?5:(x=3,3)],L[4]=L[5]=e):L[0]<=H&&((P=R<2&&H<L[1])?(x=0,M.v=A,M.n=L[1]):H<G&&(P=R<3||L[0]>A||A>G)&&(L[4]=R,L[5]=A,M.n=G,x=0))}if(P||R>1)return o;throw j=!0,A}return function(R,A,P){if(k>1)throw TypeError("Generator is already running");for(j&&A===1&&B(A,P),x=A,_=P;(t=x<2?e:_)||!j;){O||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(k=2,O){if(x||(R="next"),t=O[R]){if(!(t=t.call(O,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=O.return)&&t.call(O),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);O=e}else if((t=(j=M.n<0)?_:S.call(C,M))!==o)break}catch(L){O=e,x=1,_=L}finally{k=1}}return{value:t,done:j}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(tn(t={},r,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,tn(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,tn(d,"constructor",u),tn(u,"constructor",l),l.displayName="GeneratorFunction",tn(u,i,"GeneratorFunction"),tn(d),tn(d,i,"Generator"),tn(d,r,function(){return this}),tn(d,"toString",function(){return"[object Generator]"}),(zo=function(){return{w:s,m:f}})()}function tn(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}tn=function(o,a,l,u){if(a)i?i(o,a,{value:l,enumerable:!u,configurable:!u,writable:!u}):o[a]=l;else{var c=function(f,h){tn(o,f,function(g){return this._invoke(f,h,g)})};c("next",0),c("throw",1),c("return",2)}},tn(e,t,n,r)}function Hm(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 jr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Hm(Object(n),!0).forEach(function(r){aD(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hm(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aD(e,t,n){return(t=lD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lD(e){var t=uD(e,"string");return Ca(t)=="symbol"?t:t+""}function uD(e,t){if(Ca(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ca(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Um(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function Gm(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){Um(s,r,i,o,a,"next",l)}function a(l){Um(s,r,i,o,a,"throw",l)}o(void 0)})}}function cD(e,t){return gD(e)||hD(e,t)||fD(e,t)||dD()}function dD(){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 fD(e,t){if(e){if(typeof e=="string")return Km(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)?Km(e,t):void 0}}function Km(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 hD(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function gD(e){if(Array.isArray(e))return e}var yD=function(t){var n,r,i=t.brand,s=t.isLast,o=t.onDelete,a=i.id,l=Nn(),u=l.hostAppProps,c=l.analysisId,d=u.onAddSubscription,f=fn(),h=Ha(),g=h.setBrandId,m=z.useState(!1),p=cD(m,2),v=p[0],b=p[1],S=Gt(),C=Fu({query:{select:function(R){var A=R.data;return A}}}),w=C.data,O=a2({mutation:{onMutate:function(){var B=Gm(zo().m(function A(P){var L,H,G;return zo().w(function(F){for(;;)switch(F.n){case 0:return L=P.brandId,H=P.data,F.n=1,S.cancelQueries({queryKey:Xn()});case 1:return G=S.getQueryData(Xn()),S.setQueryData(Xn(),function(U){var ie,ae;return U&&jr(jr({},U),{},{data:jr(jr({},U.data),{},{brands:((ie=(ae=U.data)===null||ae===void 0?void 0:ae.brands)!==null&&ie!==void 0?ie:[]).map(function(N){return N.id===L?jr(jr({},N),{},{settings:jr(jr({},N.settings),{},{enableAutomaticAnalysis:H.enableAutomaticAnalysis})}):N})})})}),F.a(2,{previous:G})}},A)}));function R(A){return B.apply(this,arguments)}return R}(),onSuccess:function(){if(i&&i.settings&&i.settings.enableAutomaticAnalysis===!1)return b(!1);b(!M)},onError:function(R,A,P){P!=null&&P.previous&&S.setQueryData(Xn(),P.previous)},onSettled:function(){var B=Gm(zo().m(function A(){return zo().w(function(P){for(;;)switch(P.n){case 0:return P.n=1,Promise.all([S.invalidateQueries({queryKey:Xn()}),S.invalidateQueries({queryKey:Nu()}),S.invalidateQueries({queryKey:yr(a,"latest")}),S.invalidateQueries({queryKey:Zn(a,"latest")}),S.invalidateQueries({queryKey:yr(a,c)}),S.invalidateQueries({queryKey:Zn(a,c)})]);case 1:return P.a(2)}},A)}));function R(){return B.apply(this,arguments)}return R}()}}),x=O.mutate,_=O.isPending,k=function(R){x({brandId:a,data:{enableAutomaticAnalysis:R}})},E=function(R){if(R){if(!j)return b(!0);if(!M)return k(!0);b(!0)}else k(!1)},j=Number(w==null?void 0:w.maxNumberOfActiveBrands)-Number(w==null?void 0:w.numberOfActiveBrands)>0||!!(i!=null&&(n=i.settings)!==null&&n!==void 0&&n.enableAutomaticAnalysis),M=T2(i==null?void 0:i.firstNextAnalysisOpportunity);return y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:Oe("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":!s}),children:[y.jsx(T.Toggle,{id:"toggle-brand-".concat(i==null?void 0:i.id),checked:i==null||(r=i.settings)===null||r===void 0?void 0:r.enableAutomaticAnalysis,screenReaderLabel:"Enable or disable automatic analysis for this brand",onChange:E,disabled:(i==null?void 0:i.id)==="loading"||_}),y.jsxs("div",{className:"yst-font-medium",children:[(i==null?void 0:i.id)==="loading"?y.jsx(T.SkeletonLoader,{className:"yst-h-6 yst-w-32"}):i==null?void 0:i.name,(i==null?void 0:i.setupStatus)==="pendingQuerySelection"&&y.jsx("div",{children:y.jsx(T.Link,{onClick:function(){i.id?(g(i.id),f("/setup/".concat(i.id,"/queries"))):console.error("Brand ID is missing.")},children:"Finish setup"})}),(i==null?void 0:i.nextScheduledAnalysis)&&y.jsxs("div",{className:"yst-italic yst-font-normal yst-text-slate-500",children:["Next analysis:"," ",Id(i.nextScheduledAnalysis)]})]}),y.jsx("div",{className:"yst-ml-auto yst-flex yst-flex-row yst-items-center yst-justify-end yst-gap-2 yst-text-slate-800",children:(i==null?void 0:i.id)==="loading"?y.jsx(T.SkeletonLoader,{className:"yst-h-6 yst-w-24"}):y.jsxs(T.Button,{size:"small",variant:"tertiary",className:"yst-gap-1 yst-text-red-600 *:hover:yst-text-red-700",onClick:function(){i!=null&&i.id&&o(i.id)},disabled:(i==null?void 0:i.id)==="loading",children:[y.jsx($f,{})," Delete brand"]})})]}),y.jsx(T.Modal,{isOpen:v,onClose:function(){return b(!1)},position:"center",as:"div",className:Oe({"yst-mx-auto yst-max-w-xl":j}),children:j?y.jsx(T.Modal.Panel,{children:M?y.jsxs(y.Fragment,{children:[y.jsx(T.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(T.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Start brand analysis now?"})}),y.jsxs(T.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(T.Modal.Container.Footer,{className:"yst-mt-3 yst-flex yst-justify-end yst-gap-2",children:[y.jsx(T.Button,{variant:"secondary",onClick:function(){return b(!1)},children:"Cancel"}),y.jsx(T.Button,{variant:"primary",onClick:function(){k(!0)},isLoading:_,children:"Yes, start analysis"})]})]}):y.jsxs(y.Fragment,{children:[y.jsx(T.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(T.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Automatic analysis enabled"})}),y.jsxs(T.Modal.Container.Content,{className:"yst-mb-4 yst-space-y-3",children:[y.jsx("p",{children:"You've turned on the weekly automatic analysis for this brand."}),y.jsxs("p",{children:["The next analysis will run on"," ",y.jsx("span",{className:"yst-font-medium",children:Id(i==null?void 0:i.nextScheduledAnalysis)||"the next analysis cycle"}),"."]})]}),y.jsx(T.Modal.Container.Footer,{className:"yst-mt-3 yst-flex yst-justify-end yst-gap-2",children:y.jsx(T.Button,{variant:"primary",onClick:function(){return b(!1)},children:"Got it"})})]})}):y.jsxs(T.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(T.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(T.Modal.Title,{as:"h3",className:"yst-text-center yst-text-lg yst-font-medium",children:"You've reached your active brand limit"})}),y.jsx(T.Modal.Container.Content,{children:y.jsx("p",{className:"yst-text-center",children:"Each subscription lets you activate 1 brand. Add another subscription or deactivate an existing brand to activate this brand."})})]})}),y.jsx(T.Modal.Container.Footer,{children:y.jsxs("div",{className:"yst-flex yst-flex-col yst-justify-stretch yst-gap-2",children:[d&&y.jsxs(T.Button,{variant:"upsell",className:"yst-flex yst-gap-1",onClick:d,children:[y.jsx(f2,{}),"Add a subscription"]}),y.jsx(T.Button,{variant:"tertiary",className:"",onClick:function(){return b(!1)},children:"Manage active brands"})]})})]})})]})},Vm,Wm,Qm;function Xc(e,t){return bD(e)||vD(e,t)||pD(e,t)||mD()}function mD(){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 pD(e,t){if(e){if(typeof e=="string")return Ym(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)?Ym(e,t):void 0}}function Ym(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 vD(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function bD(e){if(Array.isArray(e))return e}function Sh(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Xm=Ka(Vm||(Vm=Sh(["xl:yst-w-1/3"]))),Zm=Ka(Wm||(Wm=Sh(["xl:yst-w-2/3"]))),Jm=Ka(Qm||(Qm=Sh(["yst-flex yst-flex-col yst-gap-8 xl:yst-flex-row"]))),xD=function(){var t,n,r,i,s=z.useState(!1),o=Xc(s,2),a=o[0],l=o[1],u=z.useState(!1),c=Xc(u,2),d=c[0],f=c[1],h=z.useState(null),g=Xc(h,2),m=g[0],p=g[1],v=Fu({query:{select:function(x){var _=x.data;return _}}}),b=v.data,S=Qi({query:{select:function(x){var _=x.data;return _==null?void 0:_.brands}}}),C=S.data,w=C==null?void 0:C.find(function(O){return O.id===m});return y.jsxs("form",{children:[y.jsxs(T.Card,{children:[y.jsx(Sb,{title:"Settings",description:"Manage your brand settings and data. You can update analysis preferences or delete brands from your account."}),y.jsxs(T.Card.Content,{children:[y.jsxs(Jm,{children:[y.jsxs(Xm,{className:"yst-space-y-2",children:[y.jsx(T.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:"—"," subscription(s)"]}),". This gives you up to"," ",y.jsxs("b",{children:[(n=b==null?void 0:b.maxNumberOfActiveBrands)!==null&&n!==void 0?n:"—"," active brand(s)"]}),", 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(Zm,{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(T.Link,{as:ii,to:"/setup",children:"add a brand"})," ","to start analyzing."]}),(C!=null?C:[{id:"loading",name:"Loading..."}]).map(function(O,x,_){return y.jsx(yD,{brand:O,isLast:x===_.length-1,onDelete:function(k){p(k),l(!0)}},O.id)})]})]}),y.jsx(Va,{}),y.jsxs(Jm,{children:[y.jsxs(Xm,{className:"yst-space-y-2",children:[y.jsx(T.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(Zm,{className:"yst-space-y-4",children:[y.jsxs(T.Button,{variant:"error",onClick:function(){f(!0)},disabled:(C==null?void 0:C.length)===0,children:[y.jsx($f,{})," 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(oD,{isOpen:a,onClose:function(){l(!1),p(null)},brandId:m||"",brandName:w==null?void 0:w.name}),y.jsx(JL,{isOpen:d,onClose:function(){f(!1)}})]})};const wD=Object.freeze(Object.defineProperty({__proto__:null,default:xD},Symbol.toStringTag,{value:"Module"}));function wu(e){"@babel/helpers - typeof";return wu=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},wu(e)}var hf=[{path:"/setup",id:1,title:"Brand & location info",description:"Enter a few basic details about your brand so we can generate relevant queries people might use in AI models like ChatGPT. This helps us analyze how visible your brand is in their responses."},{path:"/setup/:brandId/queries",id:2,title:"Queries",description:"Review the queries we've generated from your brand info. These are phrases people might type into AI models that could trigger your brand to appear."},{path:"/setup/:brandId/analysis",id:3,title:"Analysis",description:"We're checking how your brand shows up in AI. Your queries will now be tested in ChatGPT. This process should take around 5 minutes."}],SD=function(t){return hf.find(function(n){return!!zs(n.path,t)})||hf[0]};function CD(){var e=Ut(),t=SD(e.pathname);return y.jsxs(T.Paper,{className:"yst-mx-auto yst-max-w-2xl",children:[y.jsx(rx,{title:y.jsx(ox,{currentStep:t,steps:hf}),description:t.description}),y.jsx(T.Paper.Content,{children:y.jsx(Hs,{})})]})}var ox=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:wu(r)==="object"?r.id:r}),"/",Array.isArray(i)?i.length:i]}),y.jsx("span",{children:wu(r)==="object"?r.title:n||"Step ".concat(r)})]})};const _D=Object.freeze(Object.defineProperty({__proto__:null,SetupPaperTitle:ox,default:CD},Symbol.toStringTag,{value:"Module"}));var ax=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,u=t.isLoading,c=u===void 0?!1:u;return y.jsx(Lf,{nestedInPaperContent:!0,children:y.jsxs("div",{className:Oe({"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(T.Button,{variant:"tertiary",onClick:n,className:"yst-no-underline",children:"← Back"}),y.jsx("div",{className:Oe("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(T.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:c,children:[i==="ai"&&y.jsx(l6,{}),s]})})]})})},kD=[{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"}],OD=[{value:"AF",label:"Afghanistan"},{value:"AX",label:"Åland Islands"},{value:"AL",label:"Albania"},{value:"DZ",label:"Algeria"},{value:"AS",label:"American Samoa"},{value:"AD",label:"Andorra"},{value:"AO",label:"Angola"},{value:"AI",label:"Anguilla"},{value:"AQ",label:"Antarctica"},{value:"AG",label:"Antigua and Barbuda"},{value:"AR",label:"Argentina"},{value:"AM",label:"Armenia"},{value:"AW",label:"Aruba"},{value:"AT",label:"Austria"},{value:"AZ",label:"Azerbaijan"},{value:"BS",label:"Bahamas"},{value:"BH",label:"Bahrain"},{value:"BD",label:"Bangladesh"},{value:"BB",label:"Barbados"},{value:"BY",label:"Belarus"},{value:"BE",label:"Belgium"},{value:"PW",label:"Belau"},{value:"BZ",label:"Belize"},{value:"BJ",label:"Benin"},{value:"BM",label:"Bermuda"},{value:"BT",label:"Bhutan"},{value:"BO",label:"Bolivia"},{value:"BQ",label:"Bonaire, Saint Eustatius and Saba"},{value:"BA",label:"Bosnia and Herzegovina"},{value:"BW",label:"Botswana"},{value:"BV",label:"Bouvet Island"},{value:"BR",label:"Brazil"},{value:"IO",label:"British Indian Ocean Territory"},{value:"BN",label:"Brunei"},{value:"BG",label:"Bulgaria"},{value:"BF",label:"Burkina Faso"},{value:"BI",label:"Burundi"},{value:"KH",label:"Cambodia"},{value:"CM",label:"Cameroon"},{value:"CV",label:"Cape Verde"},{value:"KY",label:"Cayman Islands"},{value:"CF",label:"Central African Republic"},{value:"TD",label:"Chad"},{value:"CL",label:"Chile"},{value:"CN",label:"China"},{value:"CX",label:"Christmas Island"},{value:"CC",label:"Cocos (Keeling) Islands"},{value:"CO",label:"Colombia"},{value:"KM",label:"Comoros"},{value:"CG",label:"Congo (Brazzaville)"},{value:"CD",label:"Congo (Kinshasa)"},{value:"CK",label:"Cook Islands"},{value:"CR",label:"Costa Rica"},{value:"HR",label:"Croatia"},{value:"CU",label:"Cuba"},{value:"CW",label:"Curaçao"},{value:"CY",label:"Cyprus"},{value:"CZ",label:"Czech Republic"},{value:"DK",label:"Denmark"},{value:"DJ",label:"Djibouti"},{value:"DM",label:"Dominica"},{value:"DO",label:"Dominican Republic"},{value:"EC",label:"Ecuador"},{value:"EG",label:"Egypt"},{value:"SV",label:"El Salvador"},{value:"GQ",label:"Equatorial Guinea"},{value:"ER",label:"Eritrea"},{value:"EE",label:"Estonia"},{value:"ET",label:"Ethiopia"},{value:"FK",label:"Falkland Islands"},{value:"FO",label:"Faroe Islands"},{value:"FJ",label:"Fiji"},{value:"FI",label:"Finland"},{value:"GF",label:"French Guiana"},{value:"PF",label:"French Polynesia"},{value:"TF",label:"French Southern Territories"},{value:"GA",label:"Gabon"},{value:"GM",label:"Gambia"},{value:"GE",label:"Georgia"},{value:"GH",label:"Ghana"},{value:"GI",label:"Gibraltar"},{value:"GR",label:"Greece"},{value:"GL",label:"Greenland"},{value:"GD",label:"Grenada"},{value:"GP",label:"Guadeloupe"},{value:"GU",label:"Guam"},{value:"GT",label:"Guatemala"},{value:"GG",label:"Guernsey"},{value:"GN",label:"Guinea"},{value:"GW",label:"Guinea-Bissau"},{value:"GY",label:"Guyana"},{value:"HT",label:"Haiti"},{value:"HM",label:"Heard Island and McDonald Islands"},{value:"HN",label:"Honduras"},{value:"HK",label:"Hong Kong"},{value:"HU",label:"Hungary"},{value:"IS",label:"Iceland"},{value:"IN",label:"India"},{value:"ID",label:"Indonesia"},{value:"IR",label:"Iran"},{value:"IQ",label:"Iraq"},{value:"IE",label:"Ireland"},{value:"IM",label:"Isle of Man"},{value:"IL",label:"Israel"},{value:"IT",label:"Italy"},{value:"CI",label:"Ivory Coast"},{value:"JM",label:"Jamaica"},{value:"JP",label:"Japan"},{value:"JE",label:"Jersey"},{value:"JO",label:"Jordan"},{value:"KZ",label:"Kazakhstan"},{value:"KE",label:"Kenya"},{value:"KI",label:"Kiribati"},{value:"KW",label:"Kuwait"},{value:"KG",label:"Kyrgyzstan"},{value:"LA",label:"Laos"},{value:"LV",label:"Latvia"},{value:"LB",label:"Lebanon"},{value:"LS",label:"Lesotho"},{value:"LR",label:"Liberia"},{value:"LY",label:"Libya"},{value:"LI",label:"Liechtenstein"},{value:"LT",label:"Lithuania"},{value:"LU",label:"Luxembourg"},{value:"MO",label:"Macao"},{value:"MK",label:"North Macedonia"},{value:"MG",label:"Madagascar"},{value:"MW",label:"Malawi"},{value:"MY",label:"Malaysia"},{value:"MV",label:"Maldives"},{value:"ML",label:"Mali"},{value:"MT",label:"Malta"},{value:"MH",label:"Marshall Islands"},{value:"MQ",label:"Martinique"},{value:"MR",label:"Mauritania"},{value:"MU",label:"Mauritius"},{value:"YT",label:"Mayotte"},{value:"MX",label:"Mexico"},{value:"FM",label:"Micronesia"},{value:"MD",label:"Moldova"},{value:"MC",label:"Monaco"},{value:"MN",label:"Mongolia"},{value:"ME",label:"Montenegro"},{value:"MS",label:"Montserrat"},{value:"MA",label:"Morocco"},{value:"MZ",label:"Mozambique"},{value:"MM",label:"Myanmar"},{value:"NA",label:"Namibia"},{value:"NR",label:"Nauru"},{value:"NP",label:"Nepal"},{value:"NC",label:"New Caledonia"},{value:"NZ",label:"New Zealand"},{value:"NI",label:"Nicaragua"},{value:"NE",label:"Niger"},{value:"NG",label:"Nigeria"},{value:"NU",label:"Niue"},{value:"NF",label:"Norfolk Island"},{value:"MP",label:"Northern Mariana Islands"},{value:"KP",label:"North Korea"},{value:"NO",label:"Norway"},{value:"OM",label:"Oman"},{value:"PK",label:"Pakistan"},{value:"PS",label:"Palestinian Territory"},{value:"PA",label:"Panama"},{value:"PG",label:"Papua New Guinea"},{value:"PY",label:"Paraguay"},{value:"PE",label:"Peru"},{value:"PH",label:"Philippines"},{value:"PN",label:"Pitcairn"},{value:"PL",label:"Poland"},{value:"PT",label:"Portugal"},{value:"PR",label:"Puerto Rico"},{value:"QA",label:"Qatar"},{value:"RE",label:"Reunion"},{value:"RO",label:"Romania"},{value:"RU",label:"Russia"},{value:"RW",label:"Rwanda"},{value:"BL",label:"Saint Barthélemy"},{value:"SH",label:"Saint Helena"},{value:"KN",label:"Saint Kitts and Nevis"},{value:"LC",label:"Saint Lucia"},{value:"MF",label:"Saint Martin (French part)"},{value:"SX",label:"Saint Martin (Dutch part)"},{value:"PM",label:"Saint Pierre and Miquelon"},{value:"VC",label:"Saint Vincent and the Grenadines"},{value:"SM",label:"San Marino"},{value:"ST",label:"São Tomé and Príncipe"},{value:"SA",label:"Saudi Arabia"},{value:"SN",label:"Senegal"},{value:"RS",label:"Serbia"},{value:"SC",label:"Seychelles"},{value:"SL",label:"Sierra Leone"},{value:"SG",label:"Singapore"},{value:"SK",label:"Slovakia"},{value:"SI",label:"Slovenia"},{value:"SB",label:"Solomon Islands"},{value:"SO",label:"Somalia"},{value:"ZA",label:"South Africa"},{value:"GS",label:"South Georgia/Sandwich Islands"},{value:"KR",label:"South Korea"},{value:"SS",label:"South Sudan"},{value:"ES",label:"Spain"},{value:"LK",label:"Sri Lanka"},{value:"SD",label:"Sudan"},{value:"SR",label:"Suriname"},{value:"SJ",label:"Svalbard and Jan Mayen"},{value:"SZ",label:"Eswatini"},{value:"SE",label:"Sweden"},{value:"CH",label:"Switzerland"},{value:"SY",label:"Syria"},{value:"TW",label:"Taiwan"},{value:"TJ",label:"Tajikistan"},{value:"TZ",label:"Tanzania"},{value:"TH",label:"Thailand"},{value:"TL",label:"Timor-Leste"},{value:"TG",label:"Togo"},{value:"TK",label:"Tokelau"},{value:"TO",label:"Tonga"},{value:"TT",label:"Trinidad and Tobago"},{value:"TN",label:"Tunisia"},{value:"TR",label:"Turkey"},{value:"TM",label:"Turkmenistan"},{value:"TC",label:"Turks and Caicos Islands"},{value:"TV",label:"Tuvalu"},{value:"UG",label:"Uganda"},{value:"UA",label:"Ukraine"},{value:"AE",label:"United Arab Emirates"},{value:"UM",label:"United States (US) Minor Outlying Islands"},{value:"UY",label:"Uruguay"},{value:"UZ",label:"Uzbekistan"},{value:"VU",label:"Vanuatu"},{value:"VA",label:"Vatican"},{value:"VE",label:"Venezuela"},{value:"VN",label:"Vietnam"},{value:"VG",label:"Virgin Islands (British)"},{value:"VI",label:"Virgin Islands (US)"},{value:"WF",label:"Wallis and Futuna"},{value:"EH",label:"Western Sahara"},{value:"WS",label:"Samoa"},{value:"YE",label:"Yemen"},{value:"ZM",label:"Zambia"},{value:"ZW",label:"Zimbabwe"}],ep=[].concat(kD,OD,[{value:"OTHER",label:"Other"}]),ED=[{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"}],AD=[{value:"sq",label:"Albanian"},{value:"am",label:"Amharic"},{value:"ar",label:"Arabic"},{value:"hy",label:"Armenian"},{value:"bn",label:"Bengali"},{value:"bs",label:"Bosnian"},{value:"bg",label:"Bulgarian"},{value:"my",label:"Burmese"},{value:"ca",label:"Catalan"},{value:"zh",label:"Chinese"},{value:"hr",label:"Croatian"},{value:"cs",label:"Czech"},{value:"da",label:"Danish"},{value:"nl",label:"Dutch"},{value:"et",label:"Estonian"},{value:"fi",label:"Finnish"},{value:"fr",label:"French"},{value:"ka",label:"Georgian"},{value:"de",label:"German"},{value:"el",label:"Greek"},{value:"gu",label:"Gujarati"},{value:"hi",label:"Hindi"},{value:"hu",label:"Hungarian"},{value:"is",label:"Icelandic"},{value:"id",label:"Indonesian"},{value:"it",label:"Italian"},{value:"ja",label:"Japanese"},{value:"kn",label:"Kannada"},{value:"kk",label:"Kazakh"},{value:"ko",label:"Korean"},{value:"lv",label:"Latvian"},{value:"lt",label:"Lithuanian"},{value:"mk",label:"Macedonian"},{value:"ms",label:"Malay"},{value:"ml",label:"Malayalam"},{value:"mr",label:"Marathi"},{value:"mn",label:"Mongolian"},{value:"no",label:"Norwegian"},{value:"fa",label:"Persian"},{value:"pl",label:"Polish"},{value:"pt",label:"Portuguese"},{value:"pa",label:"Punjabi"},{value:"ro",label:"Romanian"},{value:"ru",label:"Russian"},{value:"sr",label:"Serbian"},{value:"sk",label:"Slovak"},{value:"sl",label:"Slovenian"},{value:"so",label:"Somali"},{value:"es",label:"Spanish"},{value:"sw",label:"Swahili"},{value:"sv",label:"Swedish"},{value:"tl",label:"Tagalog"},{value:"ta",label:"Tamil"},{value:"te",label:"Telugu"},{value:"th",label:"Thai"},{value:"tr",label:"Turkish"},{value:"uk",label:"Ukrainian"},{value:"ur",label:"Urdu"},{value:"vi",label:"Vietnamese"}],TD=[].concat(ED,AD);function Zr(e){"@babel/helpers - typeof";return Zr=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},Zr(e)}function tp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function np(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tp(Object(n),!0).forEach(function(r){lx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tp(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lx(e,t,n){return(t=PD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PD(e){var t=jD(e,"string");return Zr(t)=="symbol"?t:t+""}function jD(e,t){if(Zr(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Zr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gf(){/*! 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 nn(b,"_invoke",function(S,C,w){var O,x,_,k=0,E=w||[],j=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(A,P){return O=A,x=0,_=e,M.n=P,o}};function B(R,A){for(x=R,_=A,t=0;!j&&k&&!P&&t<E.length;t++){var P,L=E[t],H=M.p,G=L[2];R>3?(P=G===A)&&(_=L[(x=L[4])?5:(x=3,3)],L[4]=L[5]=e):L[0]<=H&&((P=R<2&&H<L[1])?(x=0,M.v=A,M.n=L[1]):H<G&&(P=R<3||L[0]>A||A>G)&&(L[4]=R,L[5]=A,M.n=G,x=0))}if(P||R>1)return o;throw j=!0,A}return function(R,A,P){if(k>1)throw TypeError("Generator is already running");for(j&&A===1&&B(A,P),x=A,_=P;(t=x<2?e:_)||!j;){O||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(k=2,O){if(x||(R="next"),t=O[R]){if(!(t=t.call(O,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=O.return)&&t.call(O),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);O=e}else if((t=(j=M.n<0)?_:S.call(C,M))!==o)break}catch(L){O=e,x=1,_=L}finally{k=1}}return{value:t,done:j}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(nn(t={},r,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,nn(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,nn(d,"constructor",u),nn(u,"constructor",l),l.displayName="GeneratorFunction",nn(u,i,"GeneratorFunction"),nn(d),nn(d,i,"Generator"),nn(d,r,function(){return this}),nn(d,"toString",function(){return"[object Generator]"}),(gf=function(){return{w:s,m:f}})()}function nn(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}nn=function(o,a,l,u){if(a)i?i(o,a,{value:l,enumerable:!u,configurable:!u,writable:!u}):o[a]=l;else{var c=function(f,h){nn(o,f,function(g){return this._invoke(f,h,g)})};c("next",0),c("throw",1),c("return",2)}},nn(e,t,n,r)}function rp(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function MD(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){rp(s,r,i,o,a,"next",l)}function a(l){rp(s,r,i,o,a,"throw",l)}o(void 0)})}}function Po(e,t){return ID(e)||DD(e,t)||LD(e,t)||$D()}function $D(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1292
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function LD(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 DD(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function ID(e){if(Array.isArray(e))return e}var RD=function(){var t,n=fn(),r=Ha(),i=Gt(),s=z.useState(),o=Po(s,2),a=o[0],l=o[1],u=z.useState(!1),c=Po(u,2),d=c[0],f=c[1],h=z.useState({name:"",url:"",description:"",language:"en",isLocal:!1,country:"",region:""}),g=Po(h,2),m=g[0],p=g[1],v=z.useState(null),b=Po(v,2),S=b[0],C=b[1],w=l4({mutation:{onSuccess:function(){var A=MD(gf().m(function L(H){var G;return gf().w(function(F){for(;;)switch(F.n){case 0:return G=H.data.id,F.n=1,Promise.all([i.invalidateQueries({queryKey:Nu()}),i.invalidateQueries({queryKey:Xn()})]);case 1:G&&r.setBrandId(G),H!=null&&H.status&&H.status>=200&&H.status<300&&G&&(r.setBrandId(G),l(G));case 2:return F.a(2)}},L)}));function P(L){return A.apply(this,arguments)}return P}(),onError:function(){f(!1)}}}),O=w.mutate,x=w.isPending,_=w.error,k=Qi({query:{enabled:!!a,select:function(P){var L=P.data;return L==null?void 0:L.brands},refetchInterval:function(P){var L;return((P==null||(L=P.state)===null||L===void 0||(L=L.data)===null||L===void 0||(L=L.data)===null||L===void 0?void 0:L.brands)||[]).find(function(H){return H.id===a})?!1:2*1e3}}}),E=k.data;z.useEffect(function(){a&&E!==null&&E!==void 0&&E.find(function(A){return A.id===a})&&n("/setup/".concat(a,"/queries"),{replace:!0})},[a,E,n]);var j=function(P,L){p(function(H){return np(np({},H),{},lx({},P,L))})},M=function(P){if(P.preventDefault(),C(null),m.description.length>250){C("Your brand description is too long. Please keep it within the 250-character limit."),f(!1);return}f(!0);var L=m.url;L&&!/^https?:\/\//i.test(L)&&(L="https://".concat(L)),O({data:{name:m.name,url:L,description:m.description,focusLanguage:m.language,country:m.country,regionOrCity:m.region}})};function B(A){return Zr(A)==="object"&&A!==null&&"response"in A&&Zr(A.response)==="object"&&A.response!==void 0&&"data"in A.response}var R=B(_)?_.response.data.errors:void 0;return y.jsxs("form",{onSubmit:M,children:[y.jsxs("div",{className:"yst-space-y-6",children:[y.jsx(T.Title,{size:"2",children:"Brand info"}),!!_&&y.jsx(T.Alert,{variant:"error",title:"Error",isVisible:!!_,children:y.jsx("ul",{children:R&&Zr(R)==="object"?Object.entries(R).flatMap(function(A){var P=Po(A,2),L=P[0],H=P[1];return Array.isArray(H)?H.map(function(G,F){return y.jsx("li",{children:G},"".concat(L,"-").concat(F))}):null}):"There was an error creating the brand."})}),S&&y.jsx(T.Alert,{variant:"error",title:"Error",isVisible:!!S,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(T.TextField,{id:"name",label:"Brand name",value:m.name,onChange:function(A){return j("name",A.target.value)}}),y.jsx(T.TextField,{id:"url",label:"Website URL (optional)",placeholder:"Example: https://yourwebsite.com",value:m.url,onChange:function(A){return j("url",A.target.value)}}),y.jsxs("div",{id:"brand-description-textarea",children:[y.jsx(T.TextareaField,{id:"brand-description",label:"Brand description",value:m.description,onChange:function(A){var P=A.target.value;j("description",P)},...m.description.length>250?{validation:{variant:"error",message:"Your brand description is too long. Please keep it within the 250-character limit."}}:{},placeholder:"e.g. We design eco-friendly yoga mats for busy professionals who want sustainable gear that’s durable, stylish and kind to the planet."}),y.jsxs("div",{className:"yst-flex yst-mt-1",children:[y.jsxs("div",{className:"yst-flex-grow yst-flex-col",children:[m.description.length>250&&y.jsx("div",{className:"yst-text-red-500 yst-mb-2",children:"Your brand description is too long. Please keep it within the 250-character limit."}),"Tell us about your brand: what you do, who it’s for and what makes it special."]}),y.jsxs("div",{className:Oe("yst-text-xs yst-mt-[-4px] yst-ml-6",{"yst-text-slate-500":m.description.length<=250,"yst-text-red-500":m.description.length>250}),children:[m.description.length,"/250"]})]})]}),y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(T.Select,{className:"yst-max-w-sm",id:"language-select",label:"Target language",value:m.language,onChange:function(A){return j("language",A)},options:TD.map(function(A){return{label:A.label,value:A.value}})}),y.jsx("p",{children:"The main language your brand uses to communicate or create content."})]})]}),y.jsx(Va,{}),y.jsxs("div",{className:"yst-space-y-6",children:[y.jsx(T.Title,{size:"2",children:"Location info"}),y.jsx("p",{children:"Specify a location to enhance the accuracy of the analysis."}),y.jsx(T.Autocomplete,{className:"yst-max-w-sm",id:"country-select",label:"Target country (optional)",value:m.country,nullable:!0,placeholder:"Select...",onChange:function(A){return j("country",A)},onQueryChange:function(){},selectedLabel:((t=ep.find(function(A){return A.value===m.country}))===null||t===void 0?void 0:t.label)||"",children:ep.map(function(A){return y.jsx(T.Autocomplete.Option,{value:A.value,children:A.label},A.value)})}),m.country&&y.jsx(T.TextField,{id:"region",label:"Target city, state, or region (optional)",value:m.region,onChange:function(A){return j("region",A.target.value)},description:`Enter a city, state, or region to narrow down the analysis. For
1293
+ example: California, Bavaria, or Paris.`})]}),y.jsx(ax,{onBack:function(){return n(-1)},buttonText:"Generate queries",isButtonDisabled:x||!!a||d,isLoading:x||!!a})]})};const ND=Object.freeze(Object.defineProperty({__proto__:null,default:RD},Symbol.toStringTag,{value:"Module"})),sp=e=>I.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},I.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"}),I.createElement("defs",null,I.createElement("linearGradient",{id:"paint0_linear_3891_2757",x1:1.99951,y1:2,x2:15.3308,y2:3.72773,gradientUnits:"userSpaceOnUse"},I.createElement("stop",{stopColor:"#A61E69"}),I.createElement("stop",{offset:1,stopColor:"#6366F1"}))));function _a(e){"@babel/helpers - typeof";return _a=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},_a(e)}function FD(e){return zD(e)||qD(e)||ux(e)||BD()}function BD(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1294
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qD(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function zD(e){if(Array.isArray(e))return mf(e)}function op(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 Mr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?op(Object(n),!0).forEach(function(r){HD(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):op(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function HD(e,t,n){return(t=UD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UD(e){var t=GD(e,"string");return _a(t)=="symbol"?t:t+""}function GD(e,t){if(_a(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(_a(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yf(){/*! 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 rn(b,"_invoke",function(S,C,w){var O,x,_,k=0,E=w||[],j=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(A,P){return O=A,x=0,_=e,M.n=P,o}};function B(R,A){for(x=R,_=A,t=0;!j&&k&&!P&&t<E.length;t++){var P,L=E[t],H=M.p,G=L[2];R>3?(P=G===A)&&(_=L[(x=L[4])?5:(x=3,3)],L[4]=L[5]=e):L[0]<=H&&((P=R<2&&H<L[1])?(x=0,M.v=A,M.n=L[1]):H<G&&(P=R<3||L[0]>A||A>G)&&(L[4]=R,L[5]=A,M.n=G,x=0))}if(P||R>1)return o;throw j=!0,A}return function(R,A,P){if(k>1)throw TypeError("Generator is already running");for(j&&A===1&&B(A,P),x=A,_=P;(t=x<2?e:_)||!j;){O||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(k=2,O){if(x||(R="next"),t=O[R]){if(!(t=t.call(O,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=O.return)&&t.call(O),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);O=e}else if((t=(j=M.n<0)?_:S.call(C,M))!==o)break}catch(L){O=e,x=1,_=L}finally{k=1}}return{value:t,done:j}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(rn(t={},r,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,rn(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,rn(d,"constructor",u),rn(u,"constructor",l),l.displayName="GeneratorFunction",rn(u,i,"GeneratorFunction"),rn(d),rn(d,i,"Generator"),rn(d,r,function(){return this}),rn(d,"toString",function(){return"[object Generator]"}),(yf=function(){return{w:s,m:f}})()}function rn(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}rn=function(o,a,l,u){if(a)i?i(o,a,{value:l,enumerable:!u,configurable:!u,writable:!u}):o[a]=l;else{var c=function(f,h){rn(o,f,function(g){return this._invoke(f,h,g)})};c("next",0),c("throw",1),c("return",2)}},rn(e,t,n,r)}function ap(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function KD(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){ap(s,r,i,o,a,"next",l)}function a(l){ap(s,r,i,o,a,"throw",l)}o(void 0)})}}function hi(e,t){return QD(e)||WD(e,t)||ux(e,t)||VD()}function VD(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1295
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ux(e,t){if(e){if(typeof e=="string")return mf(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)?mf(e,t):void 0}}function mf(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 WD(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,u=!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(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function QD(e){if(Array.isArray(e))return e}var as=5,Ho="Generating...",YD="Re-generating...",XD=100,ZD=["******************************","***********************","*******************************************************","***********************************************","***************************************************************","*******************************************************","*******************************************************","***********************************************"],JD=Array.from({length:as},function(e,t){return{id:"query-".concat(t),text:Ho,isRegenerating:!0}}),eI=function(){var t,n=Cu(),r=n.brandId,i="/setup/".concat(r,"/analysis"),s=fn(),o=Gt(),a=z.useState(JD),l=hi(a,2),u=l[0],c=l[1],d=z.useState(!1),f=hi(d,2),h=f[0],g=f[1],m=z.useState([]),p=hi(m,2),v=p[0],b=p[1],S=z.useState([]),C=hi(S,2),w=C[0],O=C[1],x=z.useState(!1),_=hi(x,2),k=_[0],E=_[1],j=z.useState(null),M=hi(j,2),B=M[0],R=M[1],A=z.useState(!1),P=hi(A,2),L=P[0],H=P[1],G=S4(r||"",{query:{enabled:!!r}}),F=G.data,U=G.isRefetching,ie=G.isError,ae=G.refetch,N=nu(r||"",{query:{enabled:!!r}}),le=N.data,te=z.useCallback(function(ue){var Q;if(!(le!=null&&(Q=le.data)!==null&&Q!==void 0&&Q.name))return!1;var ne=le.data.name.toLowerCase().trim();return ne?ue.toLowerCase().includes(ne):!1},[le==null||(t=le.data)===null||t===void 0?void 0:t.name]),me=z.useCallback(function(){return u.some(function(ue){return te(ue.text)})},[u,te]),J=function(){H(!1)},Se=function(){H(!1),r&&oe({brandId:r,data:{queries:u.map(function(Q){return Q.text})}})},ge=function(){H(!1);var Q=u.findIndex(function(ne){return te(ne.text)});Q!==-1&&setTimeout(function(){var ne=document.getElementById("query-text-".concat(Q));ne&&(ne.focus(),ne.select())},XD)},ze=v4({mutation:{onSuccess:function(){var ue=KD(yf().m(function ne(ee){return yf().w(function(Ce){for(;;)switch(Ce.n){case 0:if(R(null),!(ee!=null&&ee.status&&ee.status>=200&&ee.status<300)){Ce.n=2;break}return Ce.n=1,Promise.all([o.invalidateQueries({queryKey:Mf(r||"")}),o.invalidateQueries({queryKey:Xn()})]);case 1:s(i);case 2:return Ce.a(2)}},ne)}));function Q(ne){return ue.apply(this,arguments)}return Q}(),onError:function(Q){var ne,ee;if((Q==null||(ne=Q.response)===null||ne===void 0||(ne=ne.data)===null||ne===void 0?void 0:ne.message)==="Cannot update queries for a brand that has existing analyses."){s(i,{replace:!0});return}var Ce=(Q==null||(ee=Q.response)===null||ee===void 0||(ee=ee.data)===null||ee===void 0?void 0:ee.message)||(Q==null?void 0:Q.message)||"An unexpected error occurred.";R(Ce)}}}),oe=ze.mutate,He=ze.isPending;z.useEffect(function(){r||s("/setup",{replace:!0})},[r,s]),z.useEffect(function(){var ue;if(F!=null&&(ue=F.data)!==null&&ue!==void 0&&ue.queries&&Array.isArray(F.data.queries)){var Q=F.data.queries.slice(0,as);c(Q.map(function(ne,ee){return{id:"query-".concat(ee),text:ne,isRegenerating:!1}})),O(F.data.queries.slice(as))}else ie&&(c(Array.from({length:as},function(ne,ee){return{id:"query-".concat(ee),text:"",isRegenerating:!1}})),O([]))},[F,ie]),z.useEffect(function(){var ue;if(k&&F!==null&&F!==void 0&&(ue=F.data)!==null&&ue!==void 0&&ue.queries&&Array.isArray(F.data.queries)&&!U){var Q=F.data.queries.slice(0,as),ne=v.map(Number);c(function(ee){return ee.map(function(Ce,gt){var we=ne.indexOf(gt);return Mr(Mr({},Ce),{},{text:we>=0&&Q[we]?Q[we]:Ce.text,isRegenerating:!1})})}),E(!1),b([])}},[F,U,k,v]);var lt=z.useCallback(function(ue,Q){var ne=new Set(Q);return w.filter(function(ee){return!ne.has(ee)}).slice(0,ue)},[w]),dt=z.useMemo(function(){return U||u.length===0||u.some(function(ue){return ue.isRegenerating||ue.text===Ho&&!ie||ue.text.trim()===""})||h},[U,u,h,ie]),Ne=U||u.some(function(ue){return ue.text===Ho})&&!ie,Fe=z.useCallback(function(ue){var Q=ue.toString();b(function(ne){return ne.includes(Q)?ne.filter(function(ee){return ee!==Q}):[].concat(FD(ne),[Q])})},[]),Y=z.useCallback(function(ue,Q){c(function(ne){return ne.map(function(ee,Ce){return Ce===ue?Mr(Mr({},ee),{},{text:Q}):ee})})},[]),Te=function(){g(!h),b([])},tt=z.useCallback(function(){if(!(U||v.length===0)){c(function(ee){return ee.map(function(Ce,gt){return Mr(Mr({},Ce),{},{isRegenerating:v.includes(gt.toString())})})});var ue=u.map(function(ee){return ee.text}),Q=v.length,ne=lt(Q,ue);ne.length===Q?(c(function(ee){return ee.map(function(Ce,gt){var we=v.indexOf(gt.toString());return we>=0?Mr(Mr({},Ce),{},{text:ne[we],isRegenerating:!1}):Ce})}),O(function(ee){var Ce=new Set(ne);return ee.filter(function(gt){return!Ce.has(gt)})}),b([])):(E(!0),ae())}},[U,v,ae,u,lt]),$e=z.useCallback(function(ue){if(ue.preventDefault(),!!r){if(me()){H(!0);return}oe({brandId:r,data:{queries:u.map(function(Q){return Q.text})}})}},[r,u,oe,me]);return y.jsxs("div",{children:[B&&y.jsx(T.Alert,{className:"yst-mb-4",variant:"error",children:B}),y.jsxs("form",{onSubmit:$e,children:[y.jsxs("div",{className:"yst-mb-8",children:[y.jsx(T.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:Oe("yst-flex yst-gap-2",h?"yst-justify-end":"yst-justify-start"),children:h?y.jsxs(y.Fragment,{children:[y.jsx(T.Button,{size:"small",variant:"secondary",onClick:Te,children:"Done"}),y.jsxs(T.Button,{variant:"secondary",size:"small",onClick:tt,className:"yst-gap-1",isLoading:U,disabled:U||v.length===0,children:[y.jsx(sp,{"aria-hidden":"true"}),"Regenerate selected queries"]})]}):y.jsxs(T.Button,{size:"small",variant:"secondary",onClick:Te,className:"yst-gap-1.5",disabled:Ne,children:[y.jsx(Q4,{}),"Select queries to regenerate"]})})]})]}),y.jsx("div",{className:"yst-mb-8",children:u.length===0?ZD.map(function(ue,Q){return y.jsx("div",{className:Oe("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(T.SkeletonLoader,{children:ue||"Example placeholder query for demonstration purposes."})},"placeholder-query-".concat(Q))}):u.slice(0,as).map(function(ue,Q){var ne=ue.isRegenerating?ue.text===Ho?Ho:YD:ue.text;return y.jsx("div",{className:Oe("yst-mb-4"),children:y.jsxs("div",{className:"yst-flex yst-gap-2",children:[h&&y.jsx("div",{className:"yst-flex yst-items-center",children:y.jsx(T.Checkbox,{id:"query-regenerate-".concat(Q),name:"query-regenerate-".concat(Q),value:Q.toString(),checked:v.includes(Q.toString()),onChange:function(){return Fe(Q)},disabled:U})}),y.jsx("div",{className:"yst-flex-1",children:y.jsx(T.TextField,{id:"query-text-".concat(Q),label:"Query ".concat(Q+1),type:"text",value:ne,onChange:function(ee){ue.isRegenerating||Y(Q,ee.target.value)},placeholder:"Enter your query...",className:"yst-w-full",disabled:ue.isRegenerating,required:!0,minLength:3,maxLength:255,validation:te(ue.text)?{variant:"warning",message:"For more accurate insights, avoid using your brand name in the query."}:void 0})})]})},ue.id)})}),y.jsx(ax,{buttonText:"Run analysis (~ 5 minutes)",isButtonDisabled:dt,isLoading:He})]}),y.jsx(T.Modal,{isOpen:L,onClose:J,position:"center",as:"div",children:y.jsx(T.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-amber-100",children:y.jsx(c2,{className:"yst-h-6 yst-w-6 yst-text-amber-600"})})}),y.jsxs("div",{className:"yst-flex-1",children:[y.jsx(T.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(T.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Brand name detected in your queries"})}),y.jsxs(T.Modal.Container.Content,{className:"yst-mb-6 yst-space-y-3",children:[y.jsx("p",{className:"yst-text-sm yst-text-slate-600",children:"We found your brand name in one or more of your queries. Using your brand name in queries often show more mentions and more positive sentiment, which can skew your results."}),y.jsx("p",{className:"yst-text-sm yst-text-slate-600",children:"For more balanced results, remove your brand name or make the queries more general."})]}),y.jsxs(T.Modal.Container.Footer,{className:"yst-flex yst-justify-end yst-gap-3",children:[y.jsxs(T.Button,{onClick:Se,variant:"secondary",className:"yst-gap-1.5",disabled:He,isLoading:He,children:[y.jsx(sp,{}),"Run analysis anyway"]}),y.jsx(T.Button,{variant:"primary",onClick:ge,children:"Review and edit queries"})]})]})]})})})]})};const tI=Object.freeze(Object.defineProperty({__proto__:null,default:eI},Symbol.toStringTag,{value:"Module"}));var nI=["min","max","progress","className"];function rI(e,t){if(e==null)return{};var n,r,i=iI(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 iI(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 cx=z.forwardRef(function(e,t){var n=e.min,r=e.max,i=e.progress,s=e.className,o=rI(e,nI),a=z.useMemo(function(){var u=Math.max(0,r-n);if(u===0)return 0;var c=(i-n)/u*100;return Math.max(0,Math.min(100,c))},[n,r,i]),l=Math.min(Math.max(i,n),r);return y.jsx("div",{ref:t,role:"progressbar","aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":l,"aria-valuetext":"".concat(Math.round(a),"%"),className:Oe(s),...o,children:y.jsx("div",{className:"yst-relative yst-h-2 yst-w-full yst-overflow-hidden yst-rounded-full yst-bg-slate-200/40",children:y.jsx("div",{className:"yst-absolute yst-left-0 yst-top-0 yst-h-full yst-rounded-full yst-bg-[linear-gradient(97.38deg,_#A61E69_0%,_#6366F1_100%)] yst-transition-[width] yst-duration-300 yst-ease-out",style:{width:"".concat(a,"%")}})})})});cx.displayName="ProgressBarGradient";var rs=[{labelAbove:"Running queries...",label:"Running queries",threshold:99},{labelAbove:"Done!",label:"Building analysis",threshold:100}],dx=function(t){var n=t.progress,r=n===void 0?0:n,i=t.className,s=i===void 0?"":i,o=function(){for(var u=0;u<rs.length;u++)if(r<=rs[u].threshold)return rs[u];return rs[rs.length-1]},a=o();return y.jsxs("div",{className:Oe("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(T.Spinner,{}):y.jsx(m2,{className:"yst-text-green-400"}),y.jsx("span",{className:"yst-text-sm yst-font-medium yst-italic",children:a.labelAbove})]}),y.jsx(cx,{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:rs.map(function(l){return y.jsx("span",{children:y.jsx(qu,{disabled:a.label!==l.label,children:l.label})},l.label)})})]})};dx.propTypes={progress:Dd.number,className:Dd.string};var sI=function(t){switch(t){case"pending":case"processing":return 2*1e3;case"completed":return!1;default:return 10*1e3}},oI=function(){var t,n,r,i=fn(),s=Gt(),o=Cu(),a=Nn(),l=a.brandId,u=o.brandId||l,c=nu(u,{query:{enabled:!!u,select:function(C){var w=C.data;return w}}}),d=c.data,f=K5(u,"latest",{query:{enabled:!!u,select:function(C){var w=C.data;return w},refetchInterval:function(C){var w,O=C==null||(w=C.state)===null||w===void 0||(w=w.data)===null||w===void 0?void 0:w.data;return sI(O==null?void 0:O.status)}}}),h=f.data,g=h==null?void 0:h.id,m=g?"/brands/".concat(u,"/analysis/").concat(g):"/brands/".concat(u);z.useEffect(function(){var S=(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&&b7(d.nextScheduledAnalysis,5)&&!S&&i("/brands/".concat(u),{replace:!0})},[d==null?void 0:d.nextScheduledAnalysis,u,i,h==null?void 0:h.status]),z.useEffect(function(){((d==null?void 0:d.setupStatus)==="completed"||(d==null?void 0:d.setupStatus)==="scheduledFirstAnalysis"&&d!==null&&d!==void 0&&d.firstNextAnalysisOpportunity&&!T2(d.firstNextAnalysisOpportunity,2))&&i(m,{replace:!0})},[d==null?void 0:d.firstNextAnalysisOpportunity,d==null?void 0:d.setupStatus,m,i]);var 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 S=80/p,C=v*S;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(dx,{progress:b}),y.jsx(Va,{}),y.jsx("div",{className:"yst-space-y-8",children:d==null||(r=d.queries)===null||r===void 0?void 0:r.map(function(S){var C,w=S.id,O=S.query,x=w&&(h==null||(C=h.completedQueries)===null||C===void 0?void 0:C.includes(w));return y.jsxs("div",{className:Oe("yst-flex yst-items-center yst-justify-between yst-gap-3"),children:[x===!0?y.jsx(m2,{className:"yst-h-5 yst-w-5 yst-text-green-400"}):y.jsx(T.Spinner,{}),y.jsx("span",{className:"yst-flex-1 yst-text-sm",children:O})]},"result-item-".concat(O))})})]}),y.jsx("div",{className:"yst-mb-[-2rem] yst-ml-[-2rem] yst-mr-[-2rem] yst-mt-8 yst-flex yst-justify-end yst-gap-4 yst-rounded-bl-lg yst-rounded-br-lg yst-border-t yst-border-slate-200 yst-bg-slate-50 yst-px-8 yst-py-6",children:y.jsx(T.Button,{as:ii,to:m,onClick:function(S){if(b!==100){S.preventDefault();return}s.clear()},disabled:b!==100,children:"Continue →"})})]})};const aI=Object.freeze(Object.defineProperty({__proto__:null,default:oI},Symbol.toStringTag,{value:"Module"}));exports.AIInsightsClient=ZA;exports.setApiBaseUrl=r2;
1296
1296
  //# sourceMappingURL=ai-insights-client.cjs.js.map