@yoast/ai-insights-client 1.4.51 → 1.4.52

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.
@@ -14,15 +14,15 @@ Please change the parent <Route path="${b}"> to <Route path="${b==="/"?"*":`${b}
14
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[h0]=this[h0]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=po(o);r[a]||(n5(i,o),r[a]=!0)}return H.isArray(t)?t.forEach(s):s(t),this}};Ut.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);H.reduceDescriptors(Ut.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});H.freezeMethods(Ut);function xc(e,t){const n=this||Ua,r=t||n,i=Ut.from(r.headers);let s=r.data;return H.forEach(e,function(a){s=a.call(n,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function Wv(e){return!!(e&&e.__CANCEL__)}function io(e,t,n){Pe.call(this,e==null?"canceled":e,Pe.ERR_CANCELED,t,n),this.name="CanceledError"}H.inherits(io,Pe,{__CANCEL__:!0});function Qv(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 tu=(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)},g0=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},y0=e=>(...t)=>H.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)];H.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),H.isString(r)&&o.push("path="+r),H.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 Yv(e,t,n){let r=!l5(t);return e&&(r||n==!1)?u5(e,t):t}const m0=e=>e instanceof Ut?{...e}:e;function Bi(e,t){t=t||{};const n={};function r(u,c,d,f){return H.isPlainObject(u)&&H.isPlainObject(c)?H.merge.call({caseless:f},u,c):H.isPlainObject(c)?H.merge({},c):H.isArray(c)?c.slice():c}function i(u,c,d,f){if(H.isUndefined(c)){if(!H.isUndefined(u))return r(void 0,u,d,f)}else return r(u,c,d,f)}function s(u,c){if(!H.isUndefined(c))return r(void 0,c)}function o(u,c){if(H.isUndefined(c)){if(!H.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(m0(u),m0(c),d,!0)};return H.forEach(Object.keys(Object.assign({},e,t)),function(c){const d=l[c]||i,f=d(e[c],t[c],c);H.isUndefined(f)&&d!==a||(n[c]=f)}),n}const Xv=e=>{const t=Bi({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:o,auth:a}=t;t.headers=o=Ut.from(o),t.url=Gv(Yv(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(H.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&&H.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=Xv(e);let s=i.data;const o=Ut.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=Ut.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};Qv(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||Kv;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&&H.forEach(o.toJSON(),function(C,w){p.setRequestHeader(w,C)}),H.isUndefined(i.withCredentials)||(p.withCredentials=!!i.withCredentials),a&&a!=="json"&&(p.responseType=i.responseType),u&&([f,g]=tu(u,!0),p.addEventListener("progress",f)),l&&p.upload&&([d,h]=tu(l),p.upload.addEventListener("progress",d),p.upload.addEventListener("loadend",h)),(i.cancelToken||i.signal)&&(c=S=>{p&&(r(!S||S.type?new io(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 io(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=()=>H.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()}},p0=(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})},Ru=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Zv=Ru&&typeof ReadableStream=="function",m5=Ru&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Jv=(e,...t)=>{try{return!!e(...t)}catch(n){return!1}},p5=Zv&&Jv(()=>{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}),v0=64*1024,jd=Zv&&Jv(()=>H.isReadableStream(new Response("").body)),nu={stream:jd&&(e=>e.body)};Ru&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!nu[t]&&(nu[t]=H.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(H.isBlob(e))return e.size;if(H.isSpecCompliantForm(e))return(await new Request(Tt.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(H.isArrayBufferView(e)||H.isArrayBuffer(e))return e.byteLength;if(H.isURLSearchParams(e)&&(e=e+""),H.isString(e))return(await m5(e)).byteLength},b5=async(e,t)=>{const n=H.toFiniteNumber(e.getContentLength());return n==null?v5(t):n},x5=Ru&&(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}=Xv(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"}),k;if(H.isFormData(r)&&(k=w.headers.get("content-type"))&&c.setContentType(k),w.body){const[x,_]=g0(p,tu(y0(l)));r=p0(w.body,v0,x,_)}}H.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=jd&&(u==="stream"||u==="response");if(jd&&(a||S&&m)){const w={};["status","statusText","headers"].forEach(O=>{w[O]=b[O]});const k=H.toFiniteNumber(b.headers.get("content-length")),[x,_]=a&&g0(k,tu(y0(a),!0))||[];b=new Response(p0(b.body,v0,x,()=>{_&&_(),m&&m()}),w)}u=u||"text";let C=await nu[H.findKey(nu,u)||"text"](b,e);return!S&&m&&m(),await new Promise((w,k)=>{Qv(w,k,{data:C,headers:Ut.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)}}),Md={http:DC,xhr:d5,fetch:x5};H.forEach(Md,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(n){}Object.defineProperty(e,"adapterName",{value:t})}});const b0=e=>`- ${e}`,w5=e=>H.isFunction(e)||e===null||e===!1,e2={getAdapter:e=>{e=H.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=Md[(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
15
  `+s.map(b0).join(`
16
16
  `):" "+b0(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:Md};function wc(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new io(null,e)}function x0(e){return wc(e),e.headers=Ut.from(e.headers),e.data=xc.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),e2.getAdapter(e.adapter||Ua.adapter)(e).then(function(r){return wc(e),r.data=xc.call(e,e.transformResponse,r),r.headers=Ut.from(r.headers),r},function(r){return Wv(r)||(wc(e),r&&r.response&&(r.response.data=xc.call(e,e.transformResponse,r.response),r.response.headers=Ut.from(r.response.headers))),Promise.reject(r)})}const t2="1.10.0",Nu={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Nu[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const w0={};Nu.transitional=function(t,n,r){function i(s,o){return"[Axios v"+t2+"] 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&&!w0[o]&&(w0[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}};Nu.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 Fl={assertOptions:S5,validators:Nu},qn=Fl.validators;let Di=class{constructor(t){this.defaults=t||{},this.interceptors={request:new f0,response:new f0}}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=Bi(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&Fl.assertOptions(r,{silentJSONParsing:qn.transitional(qn.boolean),forcedJSONParsing:qn.transitional(qn.boolean),clarifyTimeoutError:qn.transitional(qn.boolean)},!1),i!=null&&(H.isFunction(i)?n.paramsSerializer={serialize:i}:Fl.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),Fl.assertOptions(n,{baseUrl:qn.spelling("baseURL"),withXsrfToken:qn.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&H.merge(s.common,s[n.method]);s&&H.forEach(["delete","get","head","post","put","patch","common"],g=>{delete s[g]}),n.headers=Ut.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=[x0.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=x0.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=Bi(this.defaults,t);const n=Yv(t.baseURL,t.url,t.allowAbsoluteUrls);return Gv(n,t.params,t.paramsSerializer)}};H.forEach(["delete","get","head","options"],function(t){Di.prototype[t]=function(n,r){return this.request(Bi(r||{},{method:t,url:n,data:(r||{}).data}))}});H.forEach(["post","put","patch"],function(t){function n(r){return function(s,o,a){return this.request(Bi(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}Di.prototype[t]=n(),Di.prototype[t+"Form"]=n(!0)});let C5=class n2{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 io(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 n2(function(i){t=i}),cancel:t}}};function _5(e){return function(n){return e.apply(null,n)}}function k5(e){return H.isObject(e)&&e.isAxiosError===!0}const $d={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($d).forEach(([e,t])=>{$d[t]=e});function r2(e){const t=new Di(e),n=$v(Di.prototype.request,t);return H.extend(n,Di.prototype,t,{allOwnKeys:!0}),H.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return r2(Bi(e,i))},n}const it=r2(Ua);it.Axios=Di;it.CanceledError=io;it.CancelToken=C5;it.isCancel=Wv;it.VERSION=t2;it.toFormData=Iu;it.AxiosError=Pe;it.Cancel=it.CanceledError;it.all=function(t){return Promise.all(t)};it.spread=_5;it.isAxiosError=k5;it.mergeConfig=Bi;it.AxiosHeaders=Ut;it.formToJSON=e=>Vv(H.isHTMLForm(e)?new FormData(e):e);it.getAdapter=e2.getAdapter;it.HttpStatusCode=$d;it.default=it;const{Axios:pI,AxiosError:vI,CanceledError:bI,isCancel:xI,CancelToken:wI,VERSION:SI,all:CI,Cancel:_I,isAxiosError:kI,spread:OI,toFormData:EI,AxiosHeaders:AI,HttpStatusCode:TI,formToJSON:PI,getAdapter:jI,mergeConfig:MI}=it,O5={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function oa(e){"@babel/helpers - typeof";return oa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oa(e)}function 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 k,x,_,O=0,E=w||[],T=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(j,P){return k=j,x=0,_=e,M.n=P,o}};function B(R,j){for(x=R,_=j,t=0;!T&&O&&!P&&t<E.length;t++){var P,I=E[t],G=M.p,V=I[2];R>3?(P=V===j)&&(_=I[(x=I[4])?5:(x=3,3)],I[4]=I[5]=e):I[0]<=G&&((P=R<2&&G<I[1])?(x=0,M.v=j,M.n=I[1]):G<V&&(P=R<3||I[0]>j||j>V)&&(I[4]=R,I[5]=j,M.n=V,x=0))}if(P||R>1)return o;throw T=!0,j}return function(R,j,P){if(O>1)throw TypeError("Generator is already running");for(T&&j===1&&B(j,P),x=j,_=P;(t=x<2?e:_)||!T;){k||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(O=2,k){if(x||(R="next"),t=k[R]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=k.return)&&t.call(k),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);k=e}else if((t=(T=M.n<0)?_:S.call(C,M))!==o)break}catch(I){k=e,x=1,_=I}finally{O=1}}return{value:t,done:T}}}(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 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 Ii(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){E5(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 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 oa(t)=="symbol"?t:t+""}function T5(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 C0(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 qi(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){C0(s,r,i,o,a,"next",l)}function a(l){C0(s,r,i,o,a,"throw",l)}o(void 0)})}}var i2=function(){var t;return((t=O5)===null||t===void 0?void 0:t.VITE_MYYOAST_ACCESS_TOKEN)||""};function _0(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",so=it.create({withCredentials:!0});so.interceptors.request.use(function(){var e=qi(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,o2();case 2:return i=s.v,n.headers=Ii(Ii(Ii({},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});so.interceptors.response.use(function(e){return e},function(){var e=qi(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 Ld.apply(this,arguments)}function Ld(){return Ld=qi(Dt().m(function e(t){var n;return Dt().w(function(r){for(;;)switch(r.n){case 0:return n=Ii({},t),delete n.baseURL,r.a(2,so.request(Ii(Ii({},n),{},{withCredentials:!0})))}},e)})),Ld.apply(this,arguments)}function s2(e){so.defaults.baseURL=e}function k0(){return so.defaults.baseURL}function j5(e){i2=e}var vo=null;function M5(){return Dd.apply(this,arguments)}function Dd(){return Dd=qi(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=i2(),n=so.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(!vo){o.n=5;break}return o.a(2,vo);case 5:return vo=qi(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,o2();case 1:return l=h.v,h.n=2,it.post(n+"/users/getToken",{},{headers:Ii({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,vo=null,h.f(5);case 6:return h.a(2,"")}},a,null,[[0,4,5,6]])}))(),o.a(2,vo)}},e,null,[[1,3]])})),Dd.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 bo=null;function o2(){return Id.apply(this,arguments)}function Id(){return Id=qi(Dt().m(function e(){var t;return Dt().w(function(n){for(;;)switch(n.n){case 0:if(window.location.hostname===new URL(k0()||window.location.href).hostname){n.n=1;break}return n.a(2,"");case 1:if(t=_0("XSRF-TOKEN"),!t){n.n=2;break}return n.a(2,decodeURIComponent(t));case 2:if(!bo){n.n=3;break}return n.a(2,bo);case 3:return bo=qi(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=k0())===null||i===void 0?void 0:i.replace("/api/v1",""))+"/sanctum/csrf-cookie",{withCredentials:!0});case 1:return s.a(2,decodeURIComponent(_0("XSRF-TOKEN")||""));case 2:return s.p=2,bo=null,s.f(2);case 3:return s.a(2)}},r,null,[[0,,2,3]])}))(),n.a(2,bo)}},e)})),Id.apply(this,arguments)}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 O0(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?O0(Object(n),!0).forEach(function(r){L5(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O0(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 aa(t)=="symbol"?t:t+""}function I5(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)}var R5=function(t,n){return Ct({url:"/brands/".concat(t,"/analysis"),method:"GET",signal:n})},Lf=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:Lf(t),a=function(u){var c=u.signal;return R5(t,c)};return ke({queryKey:o,queryFn:a,enabled:!!t},s)};function a2(e,t,n){var r=N5(e,t),i=ai(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 Fu(e,t,n,r){var i=B5(e,t,n),s=ai(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 Er(r,n)},U5=function(t,n,r){return Ct({url:"/brands/".concat(t,"/analysis/").concat(n,"/status"),method:"GET",signal:r})},pr=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:pr(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=ai(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 Er(r,n)},Y5=function(t,n){return Ct({url:"/brands/".concat(t,"/associated-brands"),method:"GET",signal:n})},ru=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:ru(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=ai(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)},l2=function(t,n){var r=e4(t);return Er(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 Er(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 Yi(e,t){var n=s4(e),r=ai(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 Er(r,n)},u4=function(t,n){return Ct({url:"/brands/".concat(t),method:"GET",signal:n})},Bu=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:Bu(t),a=function(u){var c=u.signal;return u4(t,c)};return ke({queryKey:o,queryFn:a,enabled:!!t},s)};function iu(e,t,n){var r=c4(e,t),i=ai(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 Er(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)},u2=function(t,n){var r=y4(t);return Er(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 Er(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=ai(r,n);return i.queryKey=r.queryKey,i}var C4=function(t){return Ct({url:"/users/current",method:"GET",signal:t})},qu=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:qu(),o=function(l){var u=l.signal;return C4(u)};return ke({queryKey:s,queryFn:o},i)};function zu(e,t){var n=_4(e),r=ai(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 Er(r,n)},c2=q.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=sl("/brands/:brandId"),v=sl("/brands/:brandId/*"),b=sl("/brands/:brandId/analysis/:analysisId"),S=sl("/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,k=q.useMemo(function(){return{brandId:C||d||"",analysisId:w||f||"latest",model:h||"openai",hostAppProps:m}},[C,d,w,f,h,m]),x=q.useMemo(function(){return{data:k}},[k]);return y.jsx(c2.Provider,{value:x,children:c})},d2=q.createContext(void 0),T4=function(t){var n=t.children,r=t.setBrandId,i=t.setAnalysisId,s=t.setModel,o=q.useCallback(function(d){r(d),i("latest")},[r,i]),a=q.useCallback(function(d){i(d)},[i]),l=q.useCallback(function(d){s(d)},[s]),u=q.useMemo(function(){return{setBrandId:o,setAnalysisId:a,setModel:l}},[o,a,l]),c=q.useMemo(function(){return{mutations:u}},[u]);return y.jsx(d2.Provider,{value:c,children:n})};function Sc(e,t){return $4(e)||M4(e,t)||j4(e,t)||P4()}function P4(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
17
+ `+s):r.stack=s}catch(o){}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Bi(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&Fl.assertOptions(r,{silentJSONParsing:qn.transitional(qn.boolean),forcedJSONParsing:qn.transitional(qn.boolean),clarifyTimeoutError:qn.transitional(qn.boolean)},!1),i!=null&&(H.isFunction(i)?n.paramsSerializer={serialize:i}:Fl.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),Fl.assertOptions(n,{baseUrl:qn.spelling("baseURL"),withXsrfToken:qn.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&H.merge(s.common,s[n.method]);s&&H.forEach(["delete","get","head","post","put","patch","common"],g=>{delete s[g]}),n.headers=Ut.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=[x0.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=x0.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=Bi(this.defaults,t);const n=Yv(t.baseURL,t.url,t.allowAbsoluteUrls);return Gv(n,t.params,t.paramsSerializer)}};H.forEach(["delete","get","head","options"],function(t){Di.prototype[t]=function(n,r){return this.request(Bi(r||{},{method:t,url:n,data:(r||{}).data}))}});H.forEach(["post","put","patch"],function(t){function n(r){return function(s,o,a){return this.request(Bi(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}Di.prototype[t]=n(),Di.prototype[t+"Form"]=n(!0)});let C5=class n2{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 io(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 n2(function(i){t=i}),cancel:t}}};function _5(e){return function(n){return e.apply(null,n)}}function k5(e){return H.isObject(e)&&e.isAxiosError===!0}const $d={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($d).forEach(([e,t])=>{$d[t]=e});function r2(e){const t=new Di(e),n=$v(Di.prototype.request,t);return H.extend(n,Di.prototype,t,{allOwnKeys:!0}),H.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return r2(Bi(e,i))},n}const it=r2(Ua);it.Axios=Di;it.CanceledError=io;it.CancelToken=C5;it.isCancel=Wv;it.VERSION=t2;it.toFormData=Iu;it.AxiosError=Pe;it.Cancel=it.CanceledError;it.all=function(t){return Promise.all(t)};it.spread=_5;it.isAxiosError=k5;it.mergeConfig=Bi;it.AxiosHeaders=Ut;it.formToJSON=e=>Vv(H.isHTMLForm(e)?new FormData(e):e);it.getAdapter=e2.getAdapter;it.HttpStatusCode=$d;it.default=it;const{Axios:pI,AxiosError:vI,CanceledError:bI,isCancel:xI,CancelToken:wI,VERSION:SI,all:CI,Cancel:_I,isAxiosError:kI,spread:OI,toFormData:EI,AxiosHeaders:AI,HttpStatusCode:TI,formToJSON:PI,getAdapter:jI,mergeConfig:MI}=it,O5={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function oa(e){"@babel/helpers - typeof";return oa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oa(e)}function 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 k,x,_,O=0,E=w||[],T=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(j,P){return k=j,x=0,_=e,M.n=P,o}};function B(R,j){for(x=R,_=j,t=0;!T&&O&&!P&&t<E.length;t++){var P,I=E[t],G=M.p,W=I[2];R>3?(P=W===j)&&(_=I[(x=I[4])?5:(x=3,3)],I[4]=I[5]=e):I[0]<=G&&((P=R<2&&G<I[1])?(x=0,M.v=j,M.n=I[1]):G<W&&(P=R<3||I[0]>j||j>W)&&(I[4]=R,I[5]=j,M.n=W,x=0))}if(P||R>1)return o;throw T=!0,j}return function(R,j,P){if(O>1)throw TypeError("Generator is already running");for(T&&j===1&&B(j,P),x=j,_=P;(t=x<2?e:_)||!T;){k||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(O=2,k){if(x||(R="next"),t=k[R]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=k.return)&&t.call(k),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);k=e}else if((t=(T=M.n<0)?_:S.call(C,M))!==o)break}catch(I){k=e,x=1,_=I}finally{O=1}}return{value:t,done:T}}}(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 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 Ii(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){E5(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 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 oa(t)=="symbol"?t:t+""}function T5(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 C0(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 qi(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){C0(s,r,i,o,a,"next",l)}function a(l){C0(s,r,i,o,a,"throw",l)}o(void 0)})}}var i2=function(){var t;return((t=O5)===null||t===void 0?void 0:t.VITE_MYYOAST_ACCESS_TOKEN)||""};function _0(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",so=it.create({withCredentials:!0});so.interceptors.request.use(function(){var e=qi(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,o2();case 2:return i=s.v,n.headers=Ii(Ii(Ii({},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});so.interceptors.response.use(function(e){return e},function(){var e=qi(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 Ld.apply(this,arguments)}function Ld(){return Ld=qi(Dt().m(function e(t){var n;return Dt().w(function(r){for(;;)switch(r.n){case 0:return n=Ii({},t),delete n.baseURL,r.a(2,so.request(Ii(Ii({},n),{},{withCredentials:!0})))}},e)})),Ld.apply(this,arguments)}function s2(e){so.defaults.baseURL=e}function k0(){return so.defaults.baseURL}function j5(e){i2=e}var vo=null;function M5(){return Dd.apply(this,arguments)}function Dd(){return Dd=qi(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=i2(),n=so.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(!vo){o.n=5;break}return o.a(2,vo);case 5:return vo=qi(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,o2();case 1:return l=h.v,h.n=2,it.post(n+"/users/getToken",{},{headers:Ii({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,vo=null,h.f(5);case 6:return h.a(2,"")}},a,null,[[0,4,5,6]])}))(),o.a(2,vo)}},e,null,[[1,3]])})),Dd.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 bo=null;function o2(){return Id.apply(this,arguments)}function Id(){return Id=qi(Dt().m(function e(){var t;return Dt().w(function(n){for(;;)switch(n.n){case 0:if(window.location.hostname===new URL(k0()||window.location.href).hostname){n.n=1;break}return n.a(2,"");case 1:if(t=_0("XSRF-TOKEN"),!t){n.n=2;break}return n.a(2,decodeURIComponent(t));case 2:if(!bo){n.n=3;break}return n.a(2,bo);case 3:return bo=qi(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=k0())===null||i===void 0?void 0:i.replace("/api/v1",""))+"/sanctum/csrf-cookie",{withCredentials:!0});case 1:return s.a(2,decodeURIComponent(_0("XSRF-TOKEN")||""));case 2:return s.p=2,bo=null,s.f(2);case 3:return s.a(2)}},r,null,[[0,,2,3]])}))(),n.a(2,bo)}},e)})),Id.apply(this,arguments)}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 O0(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?O0(Object(n),!0).forEach(function(r){L5(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O0(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 aa(t)=="symbol"?t:t+""}function I5(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)}var R5=function(t,n){return Ct({url:"/brands/".concat(t,"/analysis"),method:"GET",signal:n})},Lf=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:Lf(t),a=function(u){var c=u.signal;return R5(t,c)};return ke({queryKey:o,queryFn:a,enabled:!!t},s)};function a2(e,t,n){var r=N5(e,t),i=ai(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 Fu(e,t,n,r){var i=B5(e,t,n),s=ai(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 Er(r,n)},U5=function(t,n,r){return Ct({url:"/brands/".concat(t,"/analysis/").concat(n,"/status"),method:"GET",signal:r})},pr=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:pr(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=ai(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 Er(r,n)},Y5=function(t,n){return Ct({url:"/brands/".concat(t,"/associated-brands"),method:"GET",signal:n})},ru=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:ru(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=ai(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)},l2=function(t,n){var r=e4(t);return Er(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 Er(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 Yi(e,t){var n=s4(e),r=ai(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 Er(r,n)},u4=function(t,n){return Ct({url:"/brands/".concat(t),method:"GET",signal:n})},Bu=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:Bu(t),a=function(u){var c=u.signal;return u4(t,c)};return ke({queryKey:o,queryFn:a,enabled:!!t},s)};function iu(e,t,n){var r=c4(e,t),i=ai(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 Er(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)},u2=function(t,n){var r=y4(t);return Er(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 Er(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=ai(r,n);return i.queryKey=r.queryKey,i}var C4=function(t){return Ct({url:"/users/current",method:"GET",signal:t})},qu=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:qu(),o=function(l){var u=l.signal;return C4(u)};return ke({queryKey:s,queryFn:o},i)};function zu(e,t){var n=_4(e),r=ai(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 Er(r,n)},c2=q.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=sl("/brands/:brandId"),v=sl("/brands/:brandId/*"),b=sl("/brands/:brandId/analysis/:analysisId"),S=sl("/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,k=q.useMemo(function(){return{brandId:C||d||"",analysisId:w||f||"latest",model:h||"openai",hostAppProps:m}},[C,d,w,f,h,m]),x=q.useMemo(function(){return{data:k}},[k]);return y.jsx(c2.Provider,{value:x,children:c})},d2=q.createContext(void 0),T4=function(t){var n=t.children,r=t.setBrandId,i=t.setAnalysisId,s=t.setModel,o=q.useCallback(function(d){r(d),i("latest")},[r,i]),a=q.useCallback(function(d){i(d)},[i]),l=q.useCallback(function(d){s(d)},[s]),u=q.useMemo(function(){return{setBrandId:o,setAnalysisId:a,setModel:l}},[o,a,l]),c=q.useMemo(function(){return{mutations:u}},[u]);return y.jsx(d2.Provider,{value:c,children:n})};function Sc(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
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 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 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=q.useState(void 0),o=Sc(s,2),a=o[0],l=o[1],u=q.useState("latest"),c=Sc(u,2),d=c[0],f=c[1],h=q.useState(void 0),g=Sc(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=q.useContext(c2);if(t===void 0)throw new Error("useBrandAnalysisData must be used within a BrandAnalysisDataProvider");return t.data},Ga=function(){var t=q.useContext(d2);if(t===void 0)throw new Error("useBrandAnalysisMutations must be used within a BrandAnalysisMutationsProvider");return t.mutations},Cc={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
22
  */var A0;function D4(){return A0||(A0=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})()}(Cc)),Cc.exports}var I4=D4();const Oe=Sp(I4);var R4=function(t){return Q5({mutation:{onSettled:function(){t&&t()}}})};function N4(e,t){return D.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),D.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=D.forwardRef(N4);function B4(e,t){return D.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),D.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=D.forwardRef(B4);function z4(e,t){return D.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),D.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"}))}const H4=D.forwardRef(z4);function U4(e,t){return D.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),D.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"}))}const G4=D.forwardRef(U4);function K4(e,t){return D.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),D.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"}),D.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))}const V4=D.forwardRef(K4);function W4(e,t){return D.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),D.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=D.forwardRef(W4);function Y4(e,t){return D.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),D.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=D.forwardRef(Y4);function Z4(e,t){return D.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),D.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 f2=D.forwardRef(Z4);function J4(e,t){return D.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),D.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=D.forwardRef(J4);function t6(e,t){return D.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),D.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 h2=D.forwardRef(t6);function n6(e,t){return D.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),D.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"}))}const g2=D.forwardRef(n6);function r6(e,t){return D.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),D.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=D.forwardRef(r6);function s6(e,t){return D.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),D.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=D.forwardRef(s6);function a6(e,t){return D.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),D.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=D.forwardRef(a6);function u6(e,t){return D.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),D.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 Df=D.forwardRef(u6);function c6(e,t){return D.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),D.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=D.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}]},T0;function h6(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var P0=function(t){var n=t.className,r=It(),i=r.pathname,s=f6();return y.jsx("div",{className:Oe("yst-flex yst-flex-col yst-gap-10",n),children:y.jsx(A.SidebarNavigation.Sidebar,{children:y.jsx(A.SidebarNavigation.List,{className:"yst-space-y-2",children:s.filter(function(o){return o.showInMenu!==!1}).map(function(o){var a=o.isActive?o.isActive(i):!1;return y.jsx(A.SidebarNavigation.SubmenuItem,{className:Oe("yst-flex yst-gap-x-3",{"yst-sidebar-navigation__item--active":a}),href:o.href,to:o.href,as:oi,label:y.jsxs(y.Fragment,{children:[y.jsx(o.Icon,{className:Oe(T0||(T0=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 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 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=It(),i=r.pathname,s=Nn(),o=s.hostAppProps,a=o.onLogout,l=q.useState(!1),u=y6(l,2),c=u[0],d=u[1],f=zu({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(A.SidebarNavigation,{activePath:i,children:y.jsx(A.SidebarNavigation.Mobile,{closeButtonScreenReaderText:"Close sidebar",openButtonScreenReaderText:"Open sidebar",children:y.jsx(P0,{})})})}),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(A.Title,{children:y.jsx(oi,{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(A.SkeletonLoader,{children:"Display name"})})}),y.jsx("div",{children:(h==null?void 0:h.email)||y.jsx(A.SkeletonLoader,{children:"loading-email@address.com"})}),y.jsx("div",{children:y.jsx(A.Link,{variant:"primary",className:"yst-no-underline",onClick:b,children:g?y.jsxs(A.SkeletonLoader,{children:["Sign out ",y.jsx("span",{"aria-hidden":"true",children:"→"})]}):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(A.SidebarNavigation,{activePath:i,children:y.jsx(P0,{className:n})})})]})},w6=["className","href"];function S6(e,t){if(e==null)return{};var n,r,i=C6(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 C6(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 _6=function(t){var n=t.className,r=t.href,i=r===void 0?"#content":r,s=S6(t,w6);return y.jsx("a",{href:i,className:Oe("yst-absolute yst-left-[10px] yst-z-[100000] yst-block yst-h-12 yst-min-w-[150px] yst-px-[15px] yst-text-[14px] yst-leading-[48px] yst-bg-[var(--bg-color-white)] yst-rounded yst-shadow-md yst-underline yst-text-center yst-outline-none; yst--top-[1000em] focus:yst-top-[10px] focus:yst-text-[var(--text-color-blue)]",n),...s,children:"Skip to main content"})};function _c(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(_6,{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",{id:"content",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 Do(){/*! 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 k,x,_,O=0,E=w||[],T=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(j,P){return k=j,x=0,_=e,M.n=P,o}};function B(R,j){for(x=R,_=j,t=0;!T&&O&&!P&&t<E.length;t++){var P,I=E[t],G=M.p,V=I[2];R>3?(P=V===j)&&(_=I[(x=I[4])?5:(x=3,3)],I[4]=I[5]=e):I[0]<=G&&((P=R<2&&G<I[1])?(x=0,M.v=j,M.n=I[1]):G<V&&(P=R<3||I[0]>j||j>V)&&(I[4]=R,I[5]=j,M.n=V,x=0))}if(P||R>1)return o;throw T=!0,j}return function(R,j,P){if(O>1)throw TypeError("Generator is already running");for(T&&j===1&&B(j,P),x=j,_=P;(t=x<2?e:_)||!T;){k||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(O=2,k){if(x||(R="next"),t=k[R]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=k.return)&&t.call(k),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);k=e}else if((t=(T=M.n<0)?_:S.call(C,M))!==o)break}catch(I){k=e,x=1,_=I}finally{O=1}}return{value:t,done:T}}}(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]"}),(Do=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 M0(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 $0(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){M0(s,r,i,o,a,"next",l)}function a(l){M0(s,r,i,o,a,"throw",l)}o(void 0)})}}function k6(e,t){return T6(e)||A6(e,t)||E6(e,t)||O6()}function O6(){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 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 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=It(),i=r.pathname,s=Nn(),o=s.hostAppProps,a=o.onLogout,l=q.useState(!1),u=y6(l,2),c=u[0],d=u[1],f=zu({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(A.SidebarNavigation,{activePath:i,children:y.jsx(A.SidebarNavigation.Mobile,{closeButtonScreenReaderText:"Close sidebar",openButtonScreenReaderText:"Open sidebar",children:y.jsx(P0,{})})})}),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(A.Title,{children:y.jsx(oi,{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(A.SkeletonLoader,{children:"Display name"})})}),y.jsx("div",{children:(h==null?void 0:h.email)||y.jsx(A.SkeletonLoader,{children:"loading-email@address.com"})}),y.jsx("div",{children:y.jsx(A.Link,{variant:"primary",className:"yst-no-underline",onClick:b,children:g?y.jsxs(A.SkeletonLoader,{children:["Sign out ",y.jsx("span",{"aria-hidden":"true",children:"→"})]}):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(A.SidebarNavigation,{activePath:i,children:y.jsx(P0,{className:n})})})]})},w6=["className","href"];function S6(e,t){if(e==null)return{};var n,r,i=C6(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 C6(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 _6=function(t){var n=t.className,r=t.href,i=r===void 0?"#content":r,s=S6(t,w6);return y.jsx("a",{href:i,className:Oe("yst-absolute yst-left-[10px] yst-z-[100000] yst-block yst-h-12 yst-min-w-[150px] yst-px-[15px] yst-text-[14px] yst-leading-[48px] yst-bg-[var(--bg-color-white)] yst-rounded yst-shadow-md yst-underline yst-text-center yst-outline-none; yst--top-[1000em] focus:yst-top-[10px] focus:yst-text-[var(--text-color-blue)]",n),...s,children:"Skip to main content"})};function _c(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(_6,{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",{id:"content",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 Do(){/*! 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 k,x,_,O=0,E=w||[],T=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(j,P){return k=j,x=0,_=e,M.n=P,o}};function B(R,j){for(x=R,_=j,t=0;!T&&O&&!P&&t<E.length;t++){var P,I=E[t],G=M.p,W=I[2];R>3?(P=W===j)&&(_=I[(x=I[4])?5:(x=3,3)],I[4]=I[5]=e):I[0]<=G&&((P=R<2&&G<I[1])?(x=0,M.v=j,M.n=I[1]):G<W&&(P=R<3||I[0]>j||j>W)&&(I[4]=R,I[5]=j,M.n=W,x=0))}if(P||R>1)return o;throw T=!0,j}return function(R,j,P){if(O>1)throw TypeError("Generator is already running");for(T&&j===1&&B(j,P),x=j,_=P;(t=x<2?e:_)||!T;){k||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(O=2,k){if(x||(R="next"),t=k[R]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=k.return)&&t.call(k),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);k=e}else if((t=(T=M.n<0)?_:S.call(C,M))!==o)break}catch(I){k=e,x=1,_=I}finally{O=1}}return{value:t,done:T}}}(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]"}),(Do=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 M0(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 $0(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){M0(s,r,i,o,a,"next",l)}function a(l){M0(s,r,i,o,a,"throw",l)}o(void 0)})}}function k6(e,t){return T6(e)||A6(e,t)||E6(e,t)||O6()}function O6(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
24
24
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function E6(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 A6(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 T6(e){if(Array.isArray(e))return e}var P6=function(t){var n,r=t.className,i=Gt(),s=fn(),o=q.useState(!1),a=k6(o,2),l=a[0],u=a[1],c=Yi({query:{select:function(w){var k=w.data;return k==null?void 0:k.brands}}}),d=c.data,f=u2({mutation:{onSettled:function(){i.invalidateQueries({queryKey:[Xn()]})}}}),h=f.mutateAsync,g=f.isPending,m=q.useMemo(function(){var C;return(C=d==null?void 0:d.filter(function(w){var k;return((k=w.settings)===null||k===void 0?void 0:k.showAutomaticAnalysisDisabledNotification)===!0}))!==null&&C!==void 0?C:[]},[d]);q.useEffect(function(){u(m.length!==0)},[m]);var p=function(){var C=$0(Do().m(function w(){var k;return Do().w(function(x){for(;;)switch(x.n){case 0:return k=m.map(function(_){return h({brandId:String(_.id),data:{showAutomaticAnalysisDisabledNotification:!1}})}),x.n=1,Promise.all(k);case 1:u(!1);case 2:return x.a(2)}},w)}));return function(){return C.apply(this,arguments)}}(),v=function(){var C=$0(Do().m(function w(){return Do().w(function(k){for(;;)switch(k.n){case 0:return k.n=1,p();case 1:s("/settings");case 2:return k.a(2)}},w)}));return function(){return C.apply(this,arguments)}}(),b=m.length===1?"One brand has been deactivated":"Multiple brands have been deactivated",S=m.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:m==null||(n=m[0])===null||n===void 0?void 0:n.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:m.map(function(C){return y.jsx("li",{children:y.jsx("b",{children:C.name})},C.id)})}),y.jsxs("p",{children:["If you prefer, you can go to ",y.jsx("b",{children:"Settings"})," and deactivate different brand(s) instead."]})]});return l?y.jsx(A.Modal,{isOpen:l,onClose:v,position:"center",as:"div",className:r,children:y.jsxs(A.Modal.Panel,{children:[y.jsx("div",{className:"yst-flex yst-items-start yst-justify-stretch yst-gap-4",children:y.jsxs("div",{className:"yst-flex-1",children:[y.jsx(A.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(A.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:b})}),y.jsx(A.Modal.Container.Content,{className:"yst-mb-4 yst-space-y-3",children:S})]})}),y.jsxs(A.Modal.Container.Footer,{className:"yst-mt-3 yst-flex yst-justify-end yst-gap-2",children:[y.jsx(A.Button,{variant:"secondary",onClick:v,children:"Close"}),y.jsx(A.Button,{variant:"primary",onClick:v,isLoading:g,disabled:g,children:"Go to settings"})]})]})}):null},Hu=function(){return y.jsx("div",{className:"yst-flex yst-min-h-screen yst-items-center yst-justify-center",children:y.jsxs("div",{className:"yst-flex yst-items-center yst-gap-3 yst-text-center",children:[y.jsx(A.Spinner,{variant:"primary"}),y.jsx("span",{className:"yst-italic",children:"Just a moment while we get things ready for you..."})]})})},j6={HOME:"/"},M6=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=It(),l=fn(),u={disable:s,hideNav:r},c=Nn(),d=c.brandId,f=Ga(),h=f.setBrandId,g=Yi({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=q.useRef(!1),C=q.useMemo(function(){return m==null?void 0:m.find(function(k){return k.id===d})},[m,d]);q.useEffect(function(){var k;if(!(m===void 0||d)){var x=(k=m[0])===null||k===void 0?void 0:k.id;x&&h(x)}},[m,d,h,l,a.pathname]),q.useEffect(function(){!d||S.current||(S.current=!0)},[C,d,l,a.pathname,m]);var w=q.useCallback(function(){b()},[b]);return a.pathname!==j6.HOME&&p?y.jsx(_c,{...u,children:y.jsx(Hu,{})}):v?y.jsx(_c,{...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(A.Button,{variant:"primary",onClick:w,children:"Retry"})]})})}):y.jsxs(_c,{DebugInfo:o,...u,children:[y.jsx(Gs,{}),y.jsx(P6,{})]})},$6=function(){var t=ku(),n=t.brandId,r=t.analysisId,i=a2(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(Hu,{});if(a)return console.error("Error fetching analyses for validation:",a),y.jsx(xi,{to:"/brands/".concat(n),replace:!0});if(!r||r.trim()==="")return y.jsx(xi,{to:"/brands/".concat(n),replace:!0});if(r==="latest")return y.jsx(Gs,{});var l=parseInt(r,10);if(isNaN(l))return y.jsx(xi,{to:"/brands/".concat(n),replace:!0});var u=s==null?void 0:s.some(function(c){return c.id===l});return u?y.jsx(Gs,{}):y.jsx(xi,{to:"/brands/".concat(n),replace:!0})},D0=function(){var t=ku(),n=t.brandId,r=Yi({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(Hu,{});if(o)return y.jsx(xi,{to:"/",replace:!0});if(!n||n.trim()==="")return y.jsx(xi,{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(xi,{to:"/",replace:!0}):y.jsx(Gs,{})},L6={openai:"openai",perplexity:"perplexity",anthropic:"anthropic"},D6={updating:"updating"},yi={pending:"pending",processing:"processing",completed:"completed",failed:"failed",cancelled:"cancelled"},I6=function(t){return typeof t=="string"&&t!=="latest"&&t.trim().length>0};function R6(e,t){return D.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),D.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 y2=D.forwardRef(R6);function N6(e,t){return D.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),D.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 F6=D.forwardRef(N6);function B6(e,t){return D.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),D.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 m2=D.forwardRef(B6);function q6(e,t){return D.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),D.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 p2=D.forwardRef(q6);function z6(e,t){return D.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),D.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 H6=D.forwardRef(z6);function U6(e,t){return D.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),D.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 G6=D.forwardRef(U6);function K6(e,t){return D.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),D.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 I0=D.forwardRef(K6);function V6(e,t){return D.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),D.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"}),D.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 v2=D.forwardRef(V6);function W6(e,t){return D.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),D.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 Q6=D.forwardRef(W6);function Y6(e,t){return D.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),D.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 b2=D.forwardRef(Y6);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 X6=["children","as","startColor","endColor","angle","disabled","style","className"];function R0(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 N0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?R0(Object(n),!0).forEach(function(r){Z6(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Z6(e,t,n){return(t=J6(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function J6(e){var t=e_(e,"string");return la(t)=="symbol"?t:t+""}function e_(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 t_(e,t){if(e==null)return{};var n,r,i=n_(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 n_(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 Uu=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=t_(t,X6),b=N0(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 If(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 r_=function(){var t=fn();return y.jsx("form",{onSubmit:function(){return t("/setup")},children:y.jsxs(A.Paper,{className:"yst-mx-auto yst-flex yst-max-w-2xl",children:[y.jsx(A.Paper.Header,{children:y.jsxs(A.Title,{size:"1",children:["Welcome to ",y.jsx(Uu,{children:"Yoast AI Brand Insights"}),"!"]})}),y.jsxs(A.Paper.Content,{className:"yst-space-y-8",children:[y.jsxs("div",{className:"yst-space-y-4 *:yst-text-tiny",children:[y.jsx("p",{children:"See how your brand is represented in AI answers."}),y.jsxs("p",{children:[y.jsx("b",{className:"yst-font-medium yst-text-slate-800",children:"Yoast AI Brand Insights"})," ","shows how often your brand appears, how it's described, and how it compares to competitors in tools like ChatGPT."]}),y.jsx("p",{children:"It only takes three simple steps to get your brand insights:"})]}),y.jsx("div",{className:"yst-flex yst-flex-col yst-items-stretch yst-justify-stretch yst-gap-4 yst-pb-8",children:[{title:"1. ADD BRAND INFO",description:"Tell us about your brand and where it's active so we can customize your analysis."},{title:"2. REVIEW QUERIES",description:"Edit or approve the queries generated from your input."},{title:"3. RUN ANALYSIS",description:"Run your queries through relevant AI models to see how your brand shows up."}].map(function(n,r,i){return y.jsxs("div",{className:"yst-relative yst-flex yst-flex-col yst-items-stretch",children:[y.jsxs("div",{className:"yst-flex yst-flex-row yst-items-center yst-justify-stretch yst-gap-6",children:[y.jsx(A.Stepper.Step,{isActive:!0,isComplete:!1,children:y.jsx("span",{className:"yst-hidden",children:r+1})}),y.jsxs("div",{className:"yst-flex yst-flex-1 yst-flex-col yst-gap-2 yst-rounded yst-border yst-border-slate-200 yst-p-6",children:[y.jsx(A.Title,{size:"3",className:"yst-font-semibold yst-uppercase",children:n.title}),y.jsx("p",{className:"yst-my-0 yst-py-0",children:n.description})]})]}),r<i.length-1&&y.jsx("div",{className:"yst-absolute yst-left-[-2px] yst-top-1/2 yst-my-0 yst-ml-[13px] yst-h-full yst-border-l-2 yst-border-l-primary-600"})]},n.title)})})]}),y.jsx(If,{className:"yst-justify-end",children:y.jsxs(A.Button,{variant:"primary",onClick:function(){return t("/setup")},className:"yst-gap-1.5",children:["Start your first analysis ",y.jsx(F6,{})]})})]})})};function ua(e){return typeof e!="number"?{}:{"yst-text-green-600":e>0,"yst-text-red-600":e<0,"yst-text-gray-400":e===0}}function Ka(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",ua(u)),children:[u>-1&&"+",u,d==="percentage"&&"%"," ",f]})]})}var i_=["Icon","className","children","position","id"];function s_(e,t){return u_(e)||l_(e,t)||a_(e,t)||o_()}function o_(){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 a_(e,t){if(e){if(typeof e=="string")return F0(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)?F0(e,t):void 0}}function F0(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 u_(e){if(Array.isArray(e))return 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}function Rf(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=c_(e,i_),d=q.useState(!1),f=s_(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(A.Tooltip,{position:a,id:u||"tooltip-button",children:s})]}):null}var Va=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(A.Title,{size:s,children:n}),y.jsx(Rf,{id:u,children:r})]})},B0=function(t){var n=t.keywords,r=t.badgeClassName;return y.jsx("div",{className:"yst-flex yst-flex-wrap yst-gap-2",children:n.map(function(i,s){return i&&y.jsx(A.Badge,{className:r,children:i},s)})})},x2=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(A.Card,{className:"yst-overflow-visible",children:y.jsxs(A.Card.Content,{className:"yst-space-y-8",children:[y.jsx(Va,{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(A.SkeletonLoader,{className:"yst-h-6 yst-w-20"})}),y.jsxs("div",{children:[y.jsx("div",{className:"yst-inline-flex",children:y.jsx(Ka,{className:"yst-mb-1.5",score:f,scoreFormat:"percentage",suffix:"positive",delta:h})}),y.jsx(A.ProgressBar,{max:100,min:0,progress:f||0,className:Oe({"yst-bg-red-500":f},"[&>*]:yst-bg-green-500")})]})]})}),p&&y.jsx(A.Alert,{variant:"info",children:"The selected AI model returned no brand sentiment data for your queries. This can happen with some queries or models."}),!!g&&y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(A.Title,{as:"h5",size:"5",children:"Positive keywords"}),y.jsx(B0,{keywords:g,badgeClassName:"yst-bg-green-100 yst-text-green-800"})]}),!!m&&y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(A.Title,{as:"h5",size:"5",children:"Negative keywords"}),y.jsx(B0,{keywords:m,badgeClassName:"yst-bg-red-100 yst-text-red-800"})]})]})})};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)}var f_=["data"];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 h_(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){g_(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 g_(e,t,n){return(t=y_(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y_(e){var t=m_(e,"string");return ca(t)=="symbol"?t:t+""}function m_(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 p_(e,t){if(e==null)return{};var n,r,i=v_(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 v_(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 li=function(t,n,r){var i=Nn(),s=i.brandId,o=i.analysisId,a=i.model,l=s,u=o,c=a,d=Fu(l,u,{query:{enabled:!!l&&!!u,select:function(p){var v=p.data;return v==null?void 0:v.analysis}}}),f=d.data,h=p_(d,f_),g=q.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 h_({data:g},h)};function b_(){var e,t=li(),n=t.data;return y.jsx(x2,{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 x_=["children","as","className"];function w_(e,t){if(e==null)return{};var n,r,i=S_(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 S_(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 Wa=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=w_(o,x_);return y.jsx(u,{className:Oe(String(s).trim(),d),...f,children:a})}},kc=[{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"}],z0=function(t){if(!t)return kc[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)%kc.length;return kc[s]};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)}var H0;function U0(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 G0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?U0(Object(n),!0).forEach(function(r){C_(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function C_(e,t,n){return(t=__(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function __(e){var t=k_(e,"string");return da(t)=="symbol"?t:t+""}function k_(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 O_(e){return T_(e)||A_(e)||w2(e)||E_()}function E_(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
25
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a_(e,t){if(e){if(typeof e=="string")return F0(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)?F0(e,t):void 0}}function F0(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 u_(e){if(Array.isArray(e))return 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}function Rf(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=c_(e,i_),d=q.useState(!1),f=s_(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(A.Tooltip,{position:a,id:u||"tooltip-button",children:s})]}):null}var Va=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(A.Title,{size:s,children:n}),y.jsx(Rf,{id:u,children:r})]})},B0=function(t){var n=t.keywords,r=t.badgeClassName;return y.jsx("div",{className:"yst-flex yst-flex-wrap yst-gap-2",children:n.map(function(i,s){return i&&y.jsx(A.Badge,{className:r,children:i},s)})})},x2=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(A.Card,{className:"yst-overflow-visible",children:y.jsxs(A.Card.Content,{className:"yst-space-y-8",children:[y.jsx(Va,{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(A.SkeletonLoader,{className:"yst-h-6 yst-w-20"})}),y.jsxs("div",{children:[y.jsx("div",{className:"yst-inline-flex",children:y.jsx(Ka,{className:"yst-mb-1.5",score:f,scoreFormat:"percentage",suffix:"positive",delta:h})}),y.jsx(A.ProgressBar,{max:100,min:0,progress:f||0,className:Oe({"yst-bg-red-500":f},"[&>*]:yst-bg-green-500")})]})]})}),p&&y.jsx(A.Alert,{variant:"info",children:"The selected AI model returned no brand sentiment data for your queries. This can happen with some queries or models."}),!!g&&y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(A.Title,{as:"h5",size:"5",children:"Positive keywords"}),y.jsx(B0,{keywords:g,badgeClassName:"yst-bg-green-100 yst-text-green-800"})]}),!!m&&y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(A.Title,{as:"h5",size:"5",children:"Negative keywords"}),y.jsx(B0,{keywords:m,badgeClassName:"yst-bg-red-100 yst-text-red-800"})]})]})})};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)}var f_=["data"];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 h_(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){g_(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 g_(e,t,n){return(t=y_(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y_(e){var t=m_(e,"string");return ca(t)=="symbol"?t:t+""}function m_(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 p_(e,t){if(e==null)return{};var n,r,i=v_(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 v_(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 li=function(t,n,r){var i=Nn(),s=i.brandId,o=i.analysisId,a=i.model,l=s,u=o,c=a,d=Fu(l,u,{query:{enabled:!!l&&!!u,select:function(p){var v=p.data;return v==null?void 0:v.analysis}}}),f=d.data,h=p_(d,f_),g=q.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 h_({data:g},h)};function b_(){var e,t=li(),n=t.data;return y.jsx(x2,{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 x_=["children","as","className"];function w_(e,t){if(e==null)return{};var n,r,i=S_(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 S_(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 Wa=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=w_(o,x_);return y.jsx(u,{className:Oe(String(s).trim(),d),...f,children:a})}},kc=[{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"}],z0=function(t){if(!t)return kc[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)%kc.length;return kc[s]};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)}var H0;function U0(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 G0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?U0(Object(n),!0).forEach(function(r){C_(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function C_(e,t,n){return(t=__(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function __(e){var t=k_(e,"string");return da(t)=="symbol"?t:t+""}function k_(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 O_(e){return T_(e)||A_(e)||w2(e)||E_()}function E_(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
26
26
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function A_(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function T_(e){if(Array.isArray(e))return Rd(e)}function K0(e,t){return M_(e)||j_(e,t)||w2(e,t)||P_()}function P_(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
27
27
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function w2(e,t){if(e){if(typeof e=="string")return Rd(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)?Rd(e,t):void 0}}function Rd(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}function $_(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var xo=Wa(H0||(H0=$_(["md:yst-hidden yst-mr-2 yst-font-medium yst-text-slate-400 yst-inline-flex yst-w-20"]))),V0=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(A.Table.Cell,{className:"yst-ml-2 yst-py-1 md:yst-ml-0 md:yst-p-2",children:[y.jsx(xo,{as:"span",children:"Rank:"}),c?y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-24"}):y.jsx("span",{className:"yst-font-medium yst-text-slate-900",children:f!=null?f:"—"})]}),y.jsx(A.Table.Cell,{className:"yst-ml-2 yst-py-1 md:yst-ml-0 md:yst-p-2 yst-break-all",children:c?y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-full"}):y.jsx("div",{className:"yst-flex yst-items-center yst-gap-2",children:y.jsxs(A.Link,{className:"yst-flex yst-items-center yst-gap-1 yst-font-medium",href:h||"#",rel:"nofollow noreferrer",target:"_blank",children:[y.jsx("span",{children:h!=null?h:"—"})," ",y.jsx(v2,{})]})})}),y.jsxs(A.Table.Cell,{className:"yst-ml-2 yst-py-1 yst-font-medium md:yst-ml-0 md:yst-p-2",children:[y.jsx(xo,{as:"span",children:"Domain:"}),c?y.jsx(A.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(A.Table.Cell,{className:"yst-ml-2 yst-py-1 md:yst-ml-0 md:yst-p-2",children:[y.jsx(xo,{as:"span",children:"Category:"}),c?y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-16"}):y.jsx(A.Badge,{className:Oe(z0(m||"").bg,z0(m||"").text),children:m!=null?m:"—"})]}),y.jsxs(A.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(xo,{as:"span",children:"Impact:"}),c?y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-12"}):p!=null?p:"—"]}),y.jsxs(A.Table.Cell,{className:"yst-ml-2 yst-pt-1 md:yst-ml-0 md:yst-p-2 md:yst-text-right",children:[y.jsx(xo,{as:"span",children:"Mentions:"}),c?y.jsx(A.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",ua(C)),children:[C>-1&&"+",C]})]}):"—"]})]},c?void 0:h)},L_=function(t){var n,r,i,s,o,a=t.enableCategories,l=a===void 0?!1:a,u=q.useState("all"),c=K0(u,2),d=c[0],f=c[1],h=q.useState(1),g=K0(h,2),m=g[0],p=g[1],v=li(),b=v.data,S=v.isLoading,C=v.isRefetching,w=b==null?void 0:b.citations,k=(b==null||(n=b.scores)===null||n===void 0||(n=n.standardized)===null||n===void 0?void 0:n.citations)||{},x=Object.hasOwn(k,"previous"),_=w==null||(r=w.list)===null||r===void 0?void 0:r.filter(function(j){return d==="all"?!0:j.category===d}),O=10,E=(_==null?void 0:_.length)||0,T=Math.ceil(E/O),M=(m-1)*O,B=M+O,R=_==null?void 0:_.slice(M,B);return q.useEffect(function(){m>T&&T>0&&p(1)},[T,m,p,d]),y.jsx(A.Card,{className:"yst-overflow-visible md:yst-col-span-2",children:y.jsxs(A.Card.Content,{className:"yst-flex yst-flex-col yst-gap-6",children:[y.jsxs("div",{className:"yst-space-y-4",children:[y.jsx(Va,{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(Ka,{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(A.Alert,{children:"The selected AI model returned no citations for your queries. This can happen with some queries or models."}):y.jsxs(y.Fragment,{children:[y.jsxs("div",{children:[l&&y.jsx(A.Select,{className:"yst-mb-4 md:yst-max-w-sm",label:"Filter categories",value:d,onChange:function(j){f(j)},id:"citation-category-filter",options:[{value:"all",label:"All categories"}].concat(O_(w!=null&&w.categories?w.categories.map(function(j){return{value:j,label:j}}):[]))}),y.jsxs(A.Table,{variant:"minimal",children:[y.jsx(A.Table.Head,{className:"yst-font-semibold",children:y.jsxs(A.Table.Row,{children:[y.jsx(A.Table.Cell,{className:"yst-hidden yst-text-slate-900 md:yst-table-cell md:yst-pl-2",children:"#"}),y.jsx(A.Table.Cell,{className:"yst yst-hidden yst-text-slate-900 md:yst-table-cell md:yst-px-2",children:"URL"}),y.jsx(A.Table.Cell,{className:"yst-hidden yst-text-slate-900 md:yst-table-cell md:yst-px-2",children:"Root domain"}),l&&y.jsx(A.Table.Cell,{className:"yst-hidden yst-text-slate-900 md:yst-table-cell",children:"Category"}),y.jsx(A.Table.Cell,{className:"yst-hidden yst-text-slate-900 md:yst-table-cell md:yst-px-2",children:"Impact"}),y.jsx(A.Table.Cell,{className:"yst-hidden yst-text-right yst-text-slate-900 md:yst-table-cell",children:"Mentions"})]})}),y.jsx(A.Table.Body,{children:S||C?Array.from({length:5}).map(function(j,P){return y.jsx(V0,{isLoading:!0,enableCategories:l},"skeleton-".concat(P))}):R&&R.length>0?R.map(function(j,P){return y.jsx(V0,{data:G0(G0({},j),{},{rank:M+P+1}),totalQueries:b==null?void 0:b.numberOfQueries,isFirstScan:!x,enableCategories:l},"citation-table-row-".concat(j.url,"-").concat(P))}):y.jsx(A.Table.Row,{children:y.jsxs(A.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(A.Link,{onClick:function(){return f("all")},children:"Show all categories."})]})},"no-results")})]})]}),_&&_.length>O&&y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-end yst-gap-4",children:[y.jsxs("p",{className:"yst-mb-0",children:["Showing ",M+1," to"," ",B>E?E:B," of"," ",E," results"]}),y.jsx(A.Pagination,{variant:"text",className:"yst-flex-row yst-gap-0",current:m,total:T,onNavigate:p,screenReaderTextPrevious:"Previous page",screenReaderTextNext:"Next page"})]})]})]})})};function D_(e,t){return F_(e)||N_(e,t)||R_(e,t)||I_()}function I_(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
28
28
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function R_(e,t){if(e){if(typeof e=="string")return W0(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)?W0(e,t):void 0}}function W0(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 N_(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 F_(e){if(Array.isArray(e))return e}var Q0=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(A.Table.Row,{children:[y.jsx(A.Table.Cell,{children:u?y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-8"}):y.jsxs("span",{className:"yst-flex yst-justify-between yst-gap-4",children:[y.jsxs("span",{className:"yst-flex yst-flex-nowrap yst-gap-2 yst-font-medium",children:[y.jsx("span",{className:"yst-text-slate-500",children:"#"}),y.jsx("span",{className:"yst-text-slate-900",children:d==null?void 0:d.value})]}),!o&&y.jsx("span",{className:Oe("yst-inline-flex yst-items-center yst-justify-end",ua(h&&typeof g=="number"?g:0)),children:h&&typeof g=="number"?y.jsxs(y.Fragment,{children:[Math.abs(g),g>0?y.jsx(G6,{className:"yst-h-4 yst-w-4"}):y.jsx(H6,{className:"yst-h-4 yst-w-4"})]}):y.jsx(I0,{className:"yst-mx-1 yst-h-4 yst-w-4"})})]})}),y.jsx(A.Table.Cell,{children:u?y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-24"}):y.jsx("span",{className:"yst-font-medium",children:f!=null&&f.isSelf?y.jsx(Uu,{children:f==null?void 0:f.name}):(n=f==null?void 0:f.name)!==null&&n!==void 0?n:"—"})}),y.jsx(A.Table.Cell,{children:u?y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-8"}):y.jsxs("span",{className:"yst-flex yst-justify-end yst-gap-4",children:[y.jsxs("span",{className:"yst-flex yst-flex-nowrap yst-gap-1 yst-font-medium",children:[y.jsx("span",{className:"yst-text-slate-500",children:m==null?void 0:m.value}),y.jsxs("span",{className:"yst-text-slate-900",children:["/ ",i]})]}),!o&&y.jsx("span",{className:Oe("yst-ml-auto",ua(p&&typeof v=="number"?v:0)),children:p&&typeof v=="number"?y.jsxs(y.Fragment,{children:[v>-1&&"+",v]}):y.jsx(I0,{className:"yst-h-4 yst-w-4"})})]})})]},u||d==null?void 0:d.value)},B_=function(t){var n,r,i=t.className,s=q.useRef(null),o=q.useState(1),a=D_(o,2),l=a[0],u=a[1],c=li(),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,k=g==null?void 0:g.slice(C,w);return q.useEffect(function(){l>S&&S>0&&u(1)},[S,l,u]),y.jsx(A.Card,{ref:s,className:Oe("yst-overflow-visible",i),children:y.jsxs(A.Card.Content,{className:"yst-mt-0 yst-space-y-6",children:[y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(Va,{title:"Competitor ranking",tooltip:"How often competitors are mentioned in your submitted queries."}),y.jsx("p",{children:"Brands with the most mentions for your prompts."})]}),!f&&!h&&(!g||g.length===0)?y.jsx(A.Alert,{variant:"info",children:"The selected AI model returned no brands for your queries. This can happen with some queries or models."}):y.jsxs(A.Table,{variant:"minimal",children:[y.jsx(A.Table.Head,{children:y.jsxs(A.Table.Row,{children:[y.jsx(A.Table.Cell,{className:"yst-w-20 yst-font-semibold",children:"Rank"}),y.jsx(A.Table.Cell,{className:"yst-font-semibold",children:"Brand"}),y.jsx(A.Table.Cell,{className:"yst-w-20 yst-text-right yst-font-semibold",children:"Mentions"})]})}),y.jsx(A.Table.Body,{children:k&&Array.isArray(k)&&k.length>0?k.map(function(x){var _;return y.jsx(Q0,{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(Q0,{isLoading:!0},"skeleton-".concat(_))}):null})]}),!f&&!h&&g&&g.length>v&&y.jsx(A.Pagination,{current:l,total:S,className:"yst-flex-row",onNavigate:u,screenReaderTextNext:"Next",screenReaderTextPrevious:"Previous",variant:"text"})]})})},q_=function(){var t,n=li(),r=n.data,i=r==null||(t=r.sentiment)===null||t===void 0?void 0:t.topCompetitor;return y.jsx(x2,{title:"Competitor sentiment",data:i,tooltip:"Percentage of positive versus negative keywords in your query results related to your competitor's brand."})},z_=function(t){var n=t.brand,r=fn(),i=Ga(),s=i.setBrandId;return(n==null?void 0:n.setupStatus)==="pendingQuerySelection"?y.jsx(A.Alert,{className:"yst-mt-0",children:y.jsxs("div",{className:"yst-max-w-xl yst-space-y-4",children:[y.jsxs("div",{className:"yst-space-y-2",children:[y.jsxs("h3",{className:"yst-font-medium",children:["Finish your analysis for ",(n==null?void 0:n.name)||"Brand ".concat(n==null?void 0:n.id)]}),y.jsx("p",{children:"Your brand is saved, but you haven’t completed the analysis yet. Review your queries and run the analysis to get your brand insights!"})]}),y.jsx("div",{className:"yst-flex yst-justify-start yst-gap-6",children:y.jsx(A.Link,{onClick:function(){n.id?(s(n.id),r("/setup/".concat(n.id,"/queries"))):console.error("Brand ID is missing.")},children:"Review queries"})})]})}):null},Gu=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(A.Modal,{isOpen:n,onClose:r,position:"center",as:"div",className:m,children:y.jsxs(A.Modal.Panel,{children:[y.jsxs("div",{className:"yst-flex yst-items-start yst-justify-stretch yst-gap-4",children:[y.jsx("div",{children:y.jsx("span",{className:"yst-inline-flex yst-h-10 yst-w-10 yst-items-center yst-justify-center yst-rounded-full yst-bg-red-100",children:y.jsx(f2,{className:"yst-h-6 yst-w-6 yst-text-red-600"})})}),y.jsxs("div",{className:"yst-flex-1",children:[y.jsx(A.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(A.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:a})}),y.jsx(A.Modal.Container.Content,{className:"yst-mb-4 yst-space-y-3",children:typeof l=="string"?y.jsx("p",{children:l}):l})]})]}),y.jsxs(A.Modal.Container.Footer,{className:"yst-mt-3 yst-flex yst-justify-end yst-gap-2",children:[y.jsx(A.Button,{variant:"secondary",onClick:r,children:g}),y.jsx(A.Button,{variant:"error",onClick:i,isLoading:o,disabled:c,children:f})]})]})})},dl={exports:{}},fl={exports:{}},Ue={};/** @license React v16.13.1
@@ -39,15 +39,15 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
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 X0;function U_(){return X0||(X0=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(le){return typeof le=="string"||typeof le=="function"||le===r||le===u||le===s||le===i||le===d||le===f||typeof le=="object"&&le!==null&&(le.$$typeof===g||le.$$typeof===h||le.$$typeof===o||le.$$typeof===a||le.$$typeof===c||le.$$typeof===p||le.$$typeof===v||le.$$typeof===b||le.$$typeof===m)}function C(le){if(typeof le=="object"&&le!==null){var He=le.$$typeof;switch(He){case t:var lt=le.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,k=u,x=a,_=o,O=t,E=c,T=r,M=g,B=h,R=n,j=s,P=i,I=d,G=!1;function V(le){return G||(G=!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(le)||C(le)===l}function F(le){return C(le)===u}function U(le){return C(le)===a}function z(le){return C(le)===o}function Q(le){return typeof le=="object"&&le!==null&&le.$$typeof===t}function N(le){return C(le)===c}function te(le){return C(le)===r}function J(le){return C(le)===g}function ge(le){return C(le)===h}function re(le){return C(le)===n}function Se(le){return C(le)===s}function ye(le){return C(le)===i}function ze(le){return C(le)===d}Ge.AsyncMode=w,Ge.ConcurrentMode=k,Ge.ContextConsumer=x,Ge.ContextProvider=_,Ge.Element=O,Ge.ForwardRef=E,Ge.Fragment=T,Ge.Lazy=M,Ge.Memo=B,Ge.Portal=R,Ge.Profiler=j,Ge.StrictMode=P,Ge.Suspense=I,Ge.isAsyncMode=V,Ge.isConcurrentMode=F,Ge.isContextConsumer=U,Ge.isContextProvider=z,Ge.isElement=Q,Ge.isForwardRef=N,Ge.isFragment=te,Ge.isLazy=J,Ge.isMemo=ge,Ge.isPortal=re,Ge.isProfiler=Se,Ge.isStrictMode=ye,Ge.isSuspense=ze,Ge.isValidElementType=S,Ge.typeOf=C}()),Ge}var Z0;function S2(){return Z0||(Z0=1,process.env.NODE_ENV==="production"?fl.exports=H_():fl.exports=U_()),fl.exports}/*
42
+ */var X0;function U_(){return X0||(X0=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(le){return typeof le=="string"||typeof le=="function"||le===r||le===u||le===s||le===i||le===d||le===f||typeof le=="object"&&le!==null&&(le.$$typeof===g||le.$$typeof===h||le.$$typeof===o||le.$$typeof===a||le.$$typeof===c||le.$$typeof===p||le.$$typeof===v||le.$$typeof===b||le.$$typeof===m)}function C(le){if(typeof le=="object"&&le!==null){var He=le.$$typeof;switch(He){case t:var lt=le.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,k=u,x=a,_=o,O=t,E=c,T=r,M=g,B=h,R=n,j=s,P=i,I=d,G=!1;function W(le){return G||(G=!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(le)||C(le)===l}function F(le){return C(le)===u}function U(le){return C(le)===a}function z(le){return C(le)===o}function V(le){return typeof le=="object"&&le!==null&&le.$$typeof===t}function N(le){return C(le)===c}function te(le){return C(le)===r}function J(le){return C(le)===g}function ge(le){return C(le)===h}function re(le){return C(le)===n}function Se(le){return C(le)===s}function ye(le){return C(le)===i}function ze(le){return C(le)===d}Ge.AsyncMode=w,Ge.ConcurrentMode=k,Ge.ContextConsumer=x,Ge.ContextProvider=_,Ge.Element=O,Ge.ForwardRef=E,Ge.Fragment=T,Ge.Lazy=M,Ge.Memo=B,Ge.Portal=R,Ge.Profiler=j,Ge.StrictMode=P,Ge.Suspense=I,Ge.isAsyncMode=W,Ge.isConcurrentMode=F,Ge.isContextConsumer=U,Ge.isContextProvider=z,Ge.isElement=V,Ge.isForwardRef=N,Ge.isFragment=te,Ge.isLazy=J,Ge.isMemo=ge,Ge.isPortal=re,Ge.isProfiler=Se,Ge.isStrictMode=ye,Ge.isSuspense=ze,Ge.isValidElementType=S,Ge.typeOf=C}()),Ge}var Z0;function S2(){return Z0||(Z0=1,process.env.NODE_ENV==="production"?fl.exports=H_():fl.exports=U_()),fl.exports}/*
43
43
  object-assign
44
44
  (c) Sindre Sorhus
45
45
  @license MIT
46
- */var Oc,J0;function G_(){if(J0)return Oc;J0=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 Oc=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},Oc}var Ec,eg;function Nf(){if(eg)return Ec;eg=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ec=e,Ec}var Ac,tg;function C2(){return tg||(tg=1,Ac=Function.call.bind(Object.prototype.hasOwnProperty)),Ac}var Tc,ng;function K_(){if(ng)return Tc;ng=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Nf(),n={},r=C2();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={})},Tc=i,Tc}var Pc,rg;function V_(){if(rg)return Pc;rg=1;var e=S2(),t=G_(),n=Nf(),r=C2(),i=K_(),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 Pc=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:k,node:E(),objectOf:_,oneOf:x,oneOfType:O,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={},z=0;function Q(te,J,ge,re,Se,ye,ze){if(re=re||f,ye=ye||ge,ze!==n){if(l){var le=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 le.name="Invariant Violation",le}else if(process.env.NODE_ENV!=="production"&&typeof console!="undefined"){var He=re+":"+ge;!U[He]&&z<3&&(s("You are manually calling a React.PropTypes validation function for the `"+ye+"` prop on `"+re+"`. 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,z++)}}return J[ge]==null?te?J[ge]===null?new m("The "+Se+" `"+ye+"` is marked as required "+("in `"+re+"`, but its value is `null`.")):new m("The "+Se+" `"+ye+"` is marked as required in "+("`"+re+"`, but its value is `undefined`.")):null:F(J,ge,re,Se,ye)}var N=Q.bind(null,!1);return N.isRequired=Q.bind(null,!0),N}function v(F){function U(z,Q,N,te,J,ge){var re=z[Q],Se=P(re);if(Se!==F){var ye=I(re);return new m("Invalid "+te+" `"+J+"` of type "+("`"+ye+"` supplied to `"+N+"`, expected ")+("`"+F+"`."),{expectedType:F})}return null}return p(U)}function b(){return p(o)}function S(F){function U(z,Q,N,te,J){if(typeof F!="function")return new m("Property `"+J+"` of component `"+N+"` has invalid PropType notation inside arrayOf.");var ge=z[Q];if(!Array.isArray(ge)){var re=P(ge);return new m("Invalid "+te+" `"+J+"` of type "+("`"+re+"` supplied to `"+N+"`, expected an array."))}for(var Se=0;Se<ge.length;Se++){var ye=F(ge,Se,N,te,J+"["+Se+"]",n);if(ye instanceof Error)return ye}return null}return p(U)}function C(){function F(U,z,Q,N,te){var J=U[z];if(!a(J)){var ge=P(J);return new m("Invalid "+N+" `"+te+"` of type "+("`"+ge+"` supplied to `"+Q+"`, expected a single ReactElement."))}return null}return p(F)}function w(){function F(U,z,Q,N,te){var J=U[z];if(!e.isValidElementType(J)){var ge=P(J);return new m("Invalid "+N+" `"+te+"` of type "+("`"+ge+"` supplied to `"+Q+"`, expected a single ReactElement type."))}return null}return p(F)}function k(F){function U(z,Q,N,te,J){if(!(z[Q]instanceof F)){var ge=F.name||f,re=V(z[Q]);return new m("Invalid "+te+" `"+J+"` of type "+("`"+re+"` supplied to `"+N+"`, expected ")+("instance of `"+ge+"`."))}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(z,Q,N,te,J){for(var ge=z[Q],re=0;re<F.length;re++)if(g(ge,F[re]))return null;var Se=JSON.stringify(F,function(ze,le){var He=I(le);return He==="symbol"?String(le):le});return new m("Invalid "+te+" `"+J+"` of value `"+String(ge)+"` "+("supplied to `"+N+"`, expected one of "+Se+"."))}return p(U)}function _(F){function U(z,Q,N,te,J){if(typeof F!="function")return new m("Property `"+J+"` of component `"+N+"` has invalid PropType notation inside objectOf.");var ge=z[Q],re=P(ge);if(re!=="object")return new m("Invalid "+te+" `"+J+"` of type "+("`"+re+"` supplied to `"+N+"`, expected an object."));for(var Se in ge)if(r(ge,Se)){var ye=F(ge,Se,N,te,J+"."+Se,n);if(ye instanceof Error)return ye}return null}return p(U)}function O(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 z=F[U];if(typeof z!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+G(z)+" at index "+U+"."),o}function Q(N,te,J,ge,re){for(var Se=[],ye=0;ye<F.length;ye++){var ze=F[ye],le=ze(N,te,J,ge,re,n);if(le==null)return null;le.data&&r(le.data,"expectedType")&&Se.push(le.data.expectedType)}var He=Se.length>0?", expected one of type ["+Se.join(", ")+"]":"";return new m("Invalid "+ge+" `"+re+"` supplied to "+("`"+J+"`"+He+"."))}return p(Q)}function E(){function F(U,z,Q,N,te){return R(U[z])?null:new m("Invalid "+N+" `"+te+"` supplied to "+("`"+Q+"`, expected a ReactNode."))}return p(F)}function T(F,U,z,Q,N){return new m((F||"React class")+": "+U+" type `"+z+"."+Q+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+N+"`.")}function M(F){function U(z,Q,N,te,J){var ge=z[Q],re=P(ge);if(re!=="object")return new m("Invalid "+te+" `"+J+"` of type `"+re+"` "+("supplied to `"+N+"`, expected `object`."));for(var Se in F){var ye=F[Se];if(typeof ye!="function")return T(N,te,J,Se,I(ye));var ze=ye(ge,Se,N,te,J+"."+Se,n);if(ze)return ze}return null}return p(U)}function B(F){function U(z,Q,N,te,J){var ge=z[Q],re=P(ge);if(re!=="object")return new m("Invalid "+te+" `"+J+"` of type `"+re+"` "+("supplied to `"+N+"`, expected `object`."));var Se=t({},z[Q],F);for(var ye in Se){var ze=F[ye];if(r(F,ye)&&typeof ze!="function")return T(N,te,J,ye,I(ze));if(!ze)return new m("Invalid "+te+" `"+J+"` key `"+ye+"` supplied to `"+N+"`.\nBad object: "+JSON.stringify(z[Q],null," ")+`
47
- Valid keys: `+JSON.stringify(Object.keys(F),null," "));var le=ze(ge,ye,N,te,J+"."+ye,n);if(le)return le}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 z=U.call(F),Q;if(U!==F.entries){for(;!(Q=z.next()).done;)if(!R(Q.value))return!1}else for(;!(Q=z.next()).done;){var N=Q.value;if(N&&!R(N[1]))return!1}}else return!1;return!0;default:return!1}}function j(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":j(U,F)?"symbol":U}function I(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 G(F){var U=I(F);switch(U){case"array":case"object":return"an "+U;case"boolean":case"date":case"regexp":return"a "+U;default:return U}}function V(F){return!F.constructor||!F.constructor.name?f:F.constructor.name}return h.checkPropTypes=i,h.resetWarningCache=i.resetWarningCache,h.PropTypes=h,h},Pc}var jc,ig;function W_(){if(ig)return jc;ig=1;var e=Nf();function t(){}function n(){}return n.resetWarningCache=t,jc=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},jc}var sg;function Q_(){if(sg)return dl.exports;if(sg=1,process.env.NODE_ENV!=="production"){var e=S2(),t=!0;dl.exports=V_()(e.isElement,t)}else dl.exports=W_()();return dl.exports}var Y_=Q_();const Nd=Sp(Y_);var Qa=function(t){var n=t.className,r=n===void 0?"":n;return y.jsx("hr",{className:Oe("yst-my-6",r)})};Qa.propTypes={className:Nd.string};const _2=6048e5,X_=864e5,og=Symbol.for("constructDateFrom");function dn(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&og in e?e[og](t):e instanceof Date?new e.constructor(t):new Date(t)}function Kt(e,t){return dn(t||e,e)}function k2(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 Z_={};function Ku(){return Z_}function fa(e,t){var a,l,u,c,d,f,h,g;const n=Ku(),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 su(e,t){return fa(e,{...t,weekStartsOn:1})}function O2(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=su(i),o=dn(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const a=su(o);return n.getTime()>=s.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function ag(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 Vu(e,...t){const n=dn.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function ou(e,t){const n=Kt(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function J_(e,t,n){const[r,i]=Vu(n==null?void 0:n.in,e,t),s=ou(r),o=ou(i),a=+s-ag(s),l=+o-ag(o);return Math.round((a-l)/X_)}function e8(e,t){const n=O2(e,t),r=dn(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),su(r)}function t8(e){return dn(e,Date.now())}function n8(e,t,n){const[r,i]=Vu(n==null?void 0:n.in,e,t);return+ou(r)==+ou(i)}function r8(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function i8(e){return!(!r8(e)&&typeof e!="number"||isNaN(+Kt(e)))}function s8(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 o8(e,t){const[n,r]=Vu(e,t.start,t.end);return{start:n,end:r}}function a8(e,t){const{start:n,end:r}=o8(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 l8(e,t){const n=Kt(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function u8(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 c8={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"}},d8=(e,t,n)=>{let r;const i=c8[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 Mc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const f8={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},h8={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},g8={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},y8={date:Mc({formats:f8,defaultWidth:"full"}),time:Mc({formats:h8,defaultWidth:"full"}),dateTime:Mc({formats:g8,defaultWidth:"full"})},m8={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},p8=(e,t,n,r)=>m8[e];function wo(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 v8={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},b8={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},x8={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"]},w8={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"]},S8={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"}},C8={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"}},_8=(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"},k8={ordinalNumber:_8,era:wo({values:v8,defaultWidth:"wide"}),quarter:wo({values:b8,defaultWidth:"wide",argumentCallback:e=>e-1}),month:wo({values:x8,defaultWidth:"wide"}),day:wo({values:w8,defaultWidth:"wide"}),dayPeriod:wo({values:S8,defaultWidth:"wide",formattingValues:C8,defaultFormattingWidth:"wide"})};function So(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)?E8(a,d=>d.test(o)):O8(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 O8(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function E8(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function A8(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 T8=/^(\d+)(th|st|nd|rd)?/i,P8=/\d+/i,j8={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},M8={any:[/^b/i,/^(a|c)/i]},$8={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},L8={any:[/1/i,/2/i,/3/i,/4/i]},D8={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},I8={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]},R8={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},N8={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]},F8={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},B8={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}},q8={ordinalNumber:A8({matchPattern:T8,parsePattern:P8,valueCallback:e=>parseInt(e,10)}),era:So({matchPatterns:j8,defaultMatchWidth:"wide",parsePatterns:M8,defaultParseWidth:"any"}),quarter:So({matchPatterns:$8,defaultMatchWidth:"wide",parsePatterns:L8,defaultParseWidth:"any",valueCallback:e=>e+1}),month:So({matchPatterns:D8,defaultMatchWidth:"wide",parsePatterns:I8,defaultParseWidth:"any"}),day:So({matchPatterns:R8,defaultMatchWidth:"wide",parsePatterns:N8,defaultParseWidth:"any"}),dayPeriod:So({matchPatterns:F8,defaultMatchWidth:"any",parsePatterns:B8,defaultParseWidth:"any"})},z8={code:"en-US",formatDistance:d8,formatLong:y8,formatRelative:p8,localize:k8,match:q8,options:{weekStartsOn:0,firstWeekContainsDate:1}};function H8(e,t){const n=Kt(e,t==null?void 0:t.in);return J_(n,u8(n))+1}function U8(e,t){const n=Kt(e,t==null?void 0:t.in),r=+su(n)-+e8(n);return Math.round(r/_2)+1}function E2(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=Ku(),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=fa(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=fa(l,t);return+n>=+a?r+1:+n>=+u?r:r-1}function G8(e,t){var a,l,u,c,d,f,h,g;const n=Ku(),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=E2(e,t),s=dn((t==null?void 0:t.in)||e,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),fa(s,t)}function K8(e,t){const n=Kt(e,t==null?void 0:t.in),r=+fa(n,t)-+G8(n,t);return Math.round(r/_2)+1}function We(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Mr={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)}},ns={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},lg={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 Mr.y(e,t)},Y:function(e,t,n,r){const i=E2(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=O2(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 Mr.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=K8(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):We(i,t.length)},I:function(e,t,n){const r=U8(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"}):Mr.d(e,t)},D:function(e,t,n){const r=H8(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=ns.noon:r===0?i=ns.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=ns.evening:r>=12?i=ns.afternoon:r>=4?i=ns.morning:i=ns.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 Mr.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Mr.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"}):Mr.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Mr.s(e,t)},S:function(e,t){return Mr.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return cg(r);case"XXXX":case"XX":return mi(r);case"XXXXX":case"XXX":default:return mi(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return cg(r);case"xxxx":case"xx":return mi(r);case"xxxxx":case"xxx":default:return mi(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ug(r,":");case"OOOO":default:return"GMT"+mi(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ug(r,":");case"zzzz":default:return"GMT"+mi(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 ug(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 cg(e,t){return e%60===0?(e>0?"-":"+")+We(Math.abs(e)/60,2):mi(e,t)}function mi(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 dg=(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"})}},A2=(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"})}},V8=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return dg(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}}",dg(r,t)).replace("{{time}}",A2(i,t))},W8={p:A2,P:V8},Q8=/^D+$/,Y8=/^Y+$/,X8=["D","DD","YY","YYYY"];function Z8(e){return Q8.test(e)}function J8(e){return Y8.test(e)}function e7(e,t,n){const r=t7(e,t,n);if(console.warn(r),X8.includes(e))throw new RangeError(r)}function t7(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 n7=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,r7=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,i7=/^'([^]*?)'?$/,s7=/''/g,o7=/[a-zA-Z]/;function Io(e,t,n){var c,d,f,h,g,m,p,v,b;const r=Ku(),i=(c=r.locale)!=null?c:z8,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(!i8(a))throw new RangeError("Invalid time value");let l=t.match(r7).map(S=>{const C=S[0];if(C==="p"||C==="P"){const w=W8[C];return w(S,i.formatLong)}return S}).join("").match(n7).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const C=S[0];if(C==="'")return{isToken:!1,value:a7(S)};if(lg[C])return{isToken:!0,value:S};if(C.match(o7))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;(J8(C)||Z8(C))&&e7(C,t,String(e));const w=lg[C[0]];return w(a,C,i.localize,u)}).join("")}function a7(e){const t=e.match(i7);return t?t[1].replace(s7,"'"):e}function fg(e,t,n){const[r,i]=Vu(n==null?void 0:n.in,e,t);return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()}function l7(e,t){return n8(dn(e,e),t8(e))}function u7(e,t,n){return k2(e,-1,n)}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 $c(e,t,n){return(t=c7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c7(e){var t=d7(e,"string");return ha(t)=="symbol"?t:t+""}function d7(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 hg(e,t){return y7(e)||g7(e,t)||h7(e,t)||f7()}function f7(){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 h7(e,t){if(e){if(typeof e=="string")return gg(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)?gg(e,t):void 0}}function gg(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 g7(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 y7(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"}},m7=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=q.useState(new Date),d=hg(c,2),f=d[0],h=d[1],g=function(_){if(!_)return null;var O=_.slice(0,10),E=O.split("-"),T=hg(E,3),M=T[0],B=T[1],R=T[2],j=Number(M),P=Number(B),I=Number(R);return Number.isNaN(j)||Number.isNaN(P)||Number.isNaN(I)||P<1||P>12||I<1||I>31?null:new Date(j,P-1,I)},m=q.useMemo(function(){var x=new Map;return n.forEach(function(_){var O=g(_.createdAt),E=O?Io(O,"yyyy-MM-dd"):"";E&&(x.has(E)||x.set(E,[]),x.get(E).push(_))}),x},[n]);q.useEffect(function(){if(l&&r){var x=n.find(function(T){return T.id===r});if(x){var _=g(x.createdAt);_&&h(_)}}else if(l&&n.length>0){var O=n.reduce(function(T,M){return new Date(M.createdAt)>new Date(T.createdAt)?M:T}),E=g(O.createdAt);E&&h(E)}},[l,r,n]);var p=q.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=q.useMemo(function(){if(!p)return!1;var x=g(p.createdAt);return x?fg(x,f):!1},[p,f]),S=q.useMemo(function(){var x=l8(f),_=s8(f),O=new Date(x),E=O.getDay(),T=E===0?6:E-1;O.setDate(O.getDate()-T);var M=new Date(_),B=M.getDay(),R=B===0?0:7-B;return M.setDate(M.getDate()+R),a8({start:O,end:M}).map(function(j){var P=Io(j,"yyyy-MM-dd"),I=m.get(P)||[],G=I.find(function(V){return String(V.id)===String(r)});return{date:P,dateObj:j,isCurrentMonth:fg(j,f),isToday:l7(j),isSelected:!!G,hasAnalyses:I.length>0,analyses:I}})},[f,m,r]),C=function(){h(function(_){return u7(_)})},w=function(){h(function(_){return k2(_,1)})},k=function(_){if(_.hasAnalyses){if(_.analyses.length===1)i(_.analyses[0].id);else{var O=_.analyses.reduce(function(E,T){return new Date(T.createdAt)>new Date(E.createdAt)?T:E});i(O.id)}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:Io(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 k(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},$c({},"".concat(zn.selected.background," ").concat(zn.selected.text," ").concat(zn.selected.hover),x.isSelected),$c({},"".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",$c({},zn.today.underline,x.isToday&&!x.isSelected)),children:Io(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(A.Button,{onClick:v,className:"yst-w-full",disabled:b,children:"Show latest analysis"})})]}):null};function Lc(e,t){return x7(e)||b7(e,t)||v7(e,t)||p7()}function p7(){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 v7(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 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){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 x7(e){if(Array.isArray(e))return e}var w7=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=q.useState(!1),f=Lc(d,2),h=f[0],g=f[1],m=q.useState("latest"),p=Lc(m,2),v=p[0],b=p[1],S=q.useRef(null),C=function(j){if(!j)return null;var P=j.slice(0,10),I=P.split("-"),G=Lc(I,3),V=G[0],F=G[1],U=G[2],z=Number(V),Q=Number(F),N=Number(U);return Number.isNaN(z)||Number.isNaN(Q)||Number.isNaN(N)||Q<1||Q>12||N<1||N>31?null:new Date(z,Q-1,N)},w=function(j){var P=C(j.createdAt);return P?P.getTime():-1/0};q.useEffect(function(){if((r==="latest"||!r)&&n.length>0&&!o){var R=n.reduce(function(j,P){return w(P)>w(j)?P:j});i(R.id)}},[n,r,i,o]);var k=q.useMemo(function(){if(r==="latest"||!r){if(n.length>0){var R=n.reduce(function(j,P){return w(P)>w(j)?P:j});return R.id}return"latest"}return r},[r,n,w]);q.useEffect(function(){b(k)},[k]);var x=n.find(function(R){return String(R.id)===String(v)}),_=n.length>0?String(n.reduce(function(R,j){return w(j)>w(R)?j:R}).id):"",O=function(){if(x){var R=C(x.createdAt),j=R?Io(R,"MMMM d, yyyy"):x.createdAt?x.createdAt.slice(0,10):"Unknown date",P=String(x.id)===_?"(latest)":"(older)";return"".concat(j," ").concat(P)}return n.length>0?"Select date...":"No analyses available"}();q.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)},T=function(j){b(j),i(j),g(!1)},M=function(){g(!1)},B=function(j){j.key==="Enter"||j.key===" "?(j.preventDefault(),E()):j.key==="Escape"&&g(!1)};return y.jsxs("div",{ref:S,className:"yst-relative",children:[y.jsxs("div",{className:"yst-relative",children:[y.jsx(A.TextInput,{id:c,onClick:E,onKeyDown:B,onChange:function(){},disabled:l||o,value:O,"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(m7,{analyses:n,selectedAnalysisId:v,onAnalysisSelect:T,isLoading:o,isOpen:h,onClose:M})]})};function T2(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 S7(e,t){var n=T2(e);return n!==void 0&&n>t*60*1e3}var C7=2;function P2(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:C7,n=T2(e);return n!==void 0&&n<=t*60*1e3}function Fd(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 mg;function pg(e,t){return E7(e)||O7(e,t)||k7(e,t)||_7()}function _7(){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 k7(e,t){if(e){if(typeof e=="string")return vg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vg(e,t):void 0}}function vg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function O7(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 E7(e){if(Array.isArray(e))return e}function Bd(){/*! 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 k,x,_,O=0,E=w||[],T=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(j,P){return k=j,x=0,_=e,M.n=P,o}};function B(R,j){for(x=R,_=j,t=0;!T&&O&&!P&&t<E.length;t++){var P,I=E[t],G=M.p,V=I[2];R>3?(P=V===j)&&(_=I[(x=I[4])?5:(x=3,3)],I[4]=I[5]=e):I[0]<=G&&((P=R<2&&G<I[1])?(x=0,M.v=j,M.n=I[1]):G<V&&(P=R<3||I[0]>j||j>V)&&(I[4]=R,I[5]=j,M.n=V,x=0))}if(P||R>1)return o;throw T=!0,j}return function(R,j,P){if(O>1)throw TypeError("Generator is already running");for(T&&j===1&&B(j,P),x=j,_=P;(t=x<2?e:_)||!T;){k||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(O=2,k){if(x||(R="next"),t=k[R]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=k.return)&&t.call(k),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);k=e}else if((t=(T=M.n<0)?_:S.call(C,M))!==o)break}catch(I){k=e,x=1,_=I}finally{O=1}}return{value:t,done:T}}}(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]"}),(Bd=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 bg(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 A7(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){bg(s,r,i,o,a,"next",l)}function a(l){bg(s,r,i,o,a,"throw",l)}o(void 0)})}}function T7(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Dc=Wa(mg||(mg=T7(["yst-flex-1 yst-space-y-2"]))),P7=function(t){var n,r,i,s,o=t.className,a=Nn(),l=a.brandId,u=a.analysisId,c=a.model,d=Ga(),f=d.setModel,h=d.setAnalysisId,g=Gt(),m=fn(),p=li(),v=p.data,b=zu({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,k=Yi({query:{select:function(Je){var Be=Je.data;return Be==null?void 0:Be.brands}}}),x=k.data,_=k.isLoading,O=a2(l,{query:{enabled:!!l,select:function(Je){var Be=Je.data;return Be==null?void 0:Be.analyses}}}),E=O.data,T=O.isLoading,M=Fu(l,u,{query:{enabled:!!l&&!!u,select:function(Je){var Be=Je.data;return Be}}}),B=M.data,R=M.isLoading,j=iu(l,{query:{enabled:!!l,select:function(Je){var Be=Je.data;return Be}}}),P=j.data,I=j.isLoading,G=H5({mutation:{onSuccess:function(){var we=A7(Bd().m(function Be(){var Tn,Vt;return Bd().w(function(hn){for(;;)switch(hn.n){case 0:return hn.n=1,Promise.all([g.invalidateQueries({queryKey:Lf(l)}),g.invalidateQueries({queryKey:Zn(l,u)}),g.invalidateQueries({queryKey:Bu(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 Ji=Fn.createdAt?new Date(Fn.createdAt).getTime():0,jr=ir.createdAt?new Date(ir.createdAt).getTime():0;return jr>Ji?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}()}}),V=G.mutate,F=G.isPending;q.useEffect(function(){!I&&!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"))},[I,R,P,l,m,x,E==null?void 0:E.length]);var U=q.useState(!1),z=pg(U,2),Q=z[0],N=z[1],te=function(){N(!1)},J=x==null?void 0:x.find(function(we){return String(we.id)===String(l)}),ge=B==null||(n=B.analysis)===null||n===void 0?void 0:n.id,re=l!=null&&typeof ge=="number"&&!isNaN(ge),Se=q.useState(!1),ye=pg(Se,2),ze=ye[0],le=ye[1];q.useEffect(function(){if(re){var we="yst_legal_alert_dismissed_".concat(l,"_").concat(ge);le(window.localStorage.getItem(we)===null)}},[l,ge,re]);var He=function(Je){if(Je.preventDefault(),!!re){var Be="yst_legal_alert_dismissed_".concat(l,"_").concat(ge);window.localStorage.setItem(Be,"true"),le(!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=iu(l,{query:{enabled:!!l,select:function(Je){var Be=Je.data;return Be}}}),Z=Fe.data,Te=(Z==null?void 0:Z.name)||"your brand",tt=Fd(Z==null?void 0:Z.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 yi.pending:return{alertContent:we,alertVariant:"info"};case yi.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 yi.failed:return{alertContent:y.jsx(y.Fragment,{children:"Analysis failed. Try restarting the analysis or contact support if the issue persists."}),alertVariant:"danger"};case yi.cancelled:return{alertContent:y.jsx(y.Fragment,{children:"Analysis was cancelled. You can restart the analysis when ready."}),alertVariant:"warning"};case yi.completed:return{alertContent:null};default:return{alertContent:null,alertVariant:"info"}}}(),X=ue.alertContent,se=ue.alertVariant,ie=!T&&(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)===D6.updating&&Ce===!0;return y.jsxs(y.Fragment,{children:[y.jsx(Gu,{isOpen:Q,onClose:te,onConfirm:function(){l&&u&&V({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(A.Card,{className:Oe("yst-relative yst-overflow-visible",o),children:y.jsxs(A.Card.Content,{className:"yst-mt-0",children:[y.jsxs("div",{className:"yst-flex yst-flex-1 yst-flex-col yst-flex-wrap yst-items-start yst-justify-between yst-gap-4 md:yst-flex-row xl:yst-items-center",children:[y.jsx("div",{className:"xl:yst-max-w-1/4",children:y.jsxs("div",{className:"yst-flex yst-flex-col xl:yst-flex-row xl:yst-items-baseline xl:yst-gap-2",children:[y.jsx(A.Title,{children:y.jsxs(y.Fragment,{children:[C||!w?y.jsx(A.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(A.Button,{variant:"primary",className:"yst-gap-1.5",onClick:function(){return m("/setup")},disabled:T||_,children:[y.jsx(g2,{})," Analyze a different brand"]}),y.jsx("div",{className:"yst-relative",children:y.jsxs(A.DropdownMenu,{children:[y.jsx(A.DropdownMenu.IconTrigger,{screenReaderTriggerLabel:"Open brand list options",disabled:T||_||x&&(x==null?void 0:x.length)<1,children:y.jsx(X4,{})}),y.jsx(A.DropdownMenu.List,{className:"yst-absolute yst-right-0 yst-top-full yst-z-40 yst-mt-2 yst-flex yst-w-64 yst-flex-col yst-justify-start",children:y.jsxs(A.DropdownMenu.ButtonItem,{onClick:function(){return N(!0)},disabled:T||_||(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(Df,{className:"yst-h-4 yst-w-4"}),"Delete analysis"]})})]})})]})]}),y.jsx(Qa,{}),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(Dc,{children:[y.jsx(A.Label,{htmlFor:"brand-name",children:"Brand"}),y.jsx(A.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(Dc,{children:[y.jsx(A.Label,{htmlFor:"analysis-date",children:"Analysis date"}),y.jsx(w7,{analyses:E||[],selectedAnalysisId:Ne,onAnalysisSelect:function(we){m("/brands/".concat(l,"/analysis/").concat(String(we)))},isLoading:T,disabled:T||!E||E.length<1,id:"analysis-date"})]}),y.jsxs(Dc,{children:[y.jsx(A.Label,{htmlFor:"ai-tool",children:"AI model"}),y.jsx(A.Select,{onChange:function(we){Object.values(L6).includes(we)?f(we):console.error("Invalid AI provider selected:",we)},id:"ai-tool",value:c,options:R||T?[{value:c,label:"Loading..."}]:dt,disabled:R||T||[{}].length<2})]})]})]})}),y.jsxs("div",{className:"ystaii-alerts yst-space-y-4",children:[re&&ze&&y.jsx(A.Alert,{children:y.jsxs("div",{className:"yst-flex yst-w-full",children:[y.jsx("div",{className:"yst-max-w-xl yst-space-y-4",children:y.jsx("p",{className:"yst-mb-0",children:"Note: This content was generated by an AI model (see dropdown above) and may contain errors. Please review before acting on it."})}),y.jsx("div",{className:"yst-ml-auto",children:y.jsx(A.Link,{onClick:He,variant:"default",children:y.jsx(b2,{})})})]})}),$e!==yi.completed&&X&&y.jsx(A.Alert,{className:"md:yst-col-span-2",variant:se,children:X}),Ce&&y.jsxs(A.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."})]})]}),ie&&y.jsx(A.Alert,{variant:"info",className:"yst-mb-6",children:y.jsx("div",{className:"yst-flex yst-items-start yst-gap-3",children:y.jsxs("div",{className:"yst-flex-1",children:[y.jsx("h3",{className:"yst-mb-2 yst-font-medium yst-text-blue-800",children:"No analyses scheduled"}),y.jsxs("p",{className:"yst-text-bluer-700 yst-mb-0",children:[y.jsx("span",{className:"yst-font-medium yst-text-blue-900",children:J==null?void 0:J.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"}),"."]})]})})}),J&&y.jsx(z_,{brand:J},J.id)]})},j7=function(){var t,n,r,i=li(),s=i.data,o=i.isLoading,a=i.isRefetching,l=s==null?void 0:s.mentions;return y.jsx(A.Card,{className:"yst-overflow-visible",children:y.jsxs(A.Card.Content,{className:"yst-space-y-4",children:[y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(Va,{title:"Mentions",tooltip:"The queries where your brand was mentioned."}),y.jsx(Ka,{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(A.Badge,{className:"yst-bg-green-100 yst-text-green-800",children:"Found"}):y.jsx(A.Badge,{className:"yst-bg-red-100 yst-text-red-800",children:"Not found"})})]},u.query)})}):y.jsx(A.SkeletonLoader,{className:"yst-h-56 yst-w-full"})]})})};/*!
46
+ */var Oc,J0;function G_(){if(J0)return Oc;J0=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 Oc=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},Oc}var Ec,eg;function Nf(){if(eg)return Ec;eg=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ec=e,Ec}var Ac,tg;function C2(){return tg||(tg=1,Ac=Function.call.bind(Object.prototype.hasOwnProperty)),Ac}var Tc,ng;function K_(){if(ng)return Tc;ng=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Nf(),n={},r=C2();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={})},Tc=i,Tc}var Pc,rg;function V_(){if(rg)return Pc;rg=1;var e=S2(),t=G_(),n=Nf(),r=C2(),i=K_(),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 Pc=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:k,node:E(),objectOf:_,oneOf:x,oneOfType:O,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={},z=0;function V(te,J,ge,re,Se,ye,ze){if(re=re||f,ye=ye||ge,ze!==n){if(l){var le=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 le.name="Invariant Violation",le}else if(process.env.NODE_ENV!=="production"&&typeof console!="undefined"){var He=re+":"+ge;!U[He]&&z<3&&(s("You are manually calling a React.PropTypes validation function for the `"+ye+"` prop on `"+re+"`. 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,z++)}}return J[ge]==null?te?J[ge]===null?new m("The "+Se+" `"+ye+"` is marked as required "+("in `"+re+"`, but its value is `null`.")):new m("The "+Se+" `"+ye+"` is marked as required in "+("`"+re+"`, but its value is `undefined`.")):null:F(J,ge,re,Se,ye)}var N=V.bind(null,!1);return N.isRequired=V.bind(null,!0),N}function v(F){function U(z,V,N,te,J,ge){var re=z[V],Se=P(re);if(Se!==F){var ye=I(re);return new m("Invalid "+te+" `"+J+"` of type "+("`"+ye+"` supplied to `"+N+"`, expected ")+("`"+F+"`."),{expectedType:F})}return null}return p(U)}function b(){return p(o)}function S(F){function U(z,V,N,te,J){if(typeof F!="function")return new m("Property `"+J+"` of component `"+N+"` has invalid PropType notation inside arrayOf.");var ge=z[V];if(!Array.isArray(ge)){var re=P(ge);return new m("Invalid "+te+" `"+J+"` of type "+("`"+re+"` supplied to `"+N+"`, expected an array."))}for(var Se=0;Se<ge.length;Se++){var ye=F(ge,Se,N,te,J+"["+Se+"]",n);if(ye instanceof Error)return ye}return null}return p(U)}function C(){function F(U,z,V,N,te){var J=U[z];if(!a(J)){var ge=P(J);return new m("Invalid "+N+" `"+te+"` of type "+("`"+ge+"` supplied to `"+V+"`, expected a single ReactElement."))}return null}return p(F)}function w(){function F(U,z,V,N,te){var J=U[z];if(!e.isValidElementType(J)){var ge=P(J);return new m("Invalid "+N+" `"+te+"` of type "+("`"+ge+"` supplied to `"+V+"`, expected a single ReactElement type."))}return null}return p(F)}function k(F){function U(z,V,N,te,J){if(!(z[V]instanceof F)){var ge=F.name||f,re=W(z[V]);return new m("Invalid "+te+" `"+J+"` of type "+("`"+re+"` supplied to `"+N+"`, expected ")+("instance of `"+ge+"`."))}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(z,V,N,te,J){for(var ge=z[V],re=0;re<F.length;re++)if(g(ge,F[re]))return null;var Se=JSON.stringify(F,function(ze,le){var He=I(le);return He==="symbol"?String(le):le});return new m("Invalid "+te+" `"+J+"` of value `"+String(ge)+"` "+("supplied to `"+N+"`, expected one of "+Se+"."))}return p(U)}function _(F){function U(z,V,N,te,J){if(typeof F!="function")return new m("Property `"+J+"` of component `"+N+"` has invalid PropType notation inside objectOf.");var ge=z[V],re=P(ge);if(re!=="object")return new m("Invalid "+te+" `"+J+"` of type "+("`"+re+"` supplied to `"+N+"`, expected an object."));for(var Se in ge)if(r(ge,Se)){var ye=F(ge,Se,N,te,J+"."+Se,n);if(ye instanceof Error)return ye}return null}return p(U)}function O(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 z=F[U];if(typeof z!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+G(z)+" at index "+U+"."),o}function V(N,te,J,ge,re){for(var Se=[],ye=0;ye<F.length;ye++){var ze=F[ye],le=ze(N,te,J,ge,re,n);if(le==null)return null;le.data&&r(le.data,"expectedType")&&Se.push(le.data.expectedType)}var He=Se.length>0?", expected one of type ["+Se.join(", ")+"]":"";return new m("Invalid "+ge+" `"+re+"` supplied to "+("`"+J+"`"+He+"."))}return p(V)}function E(){function F(U,z,V,N,te){return R(U[z])?null:new m("Invalid "+N+" `"+te+"` supplied to "+("`"+V+"`, expected a ReactNode."))}return p(F)}function T(F,U,z,V,N){return new m((F||"React class")+": "+U+" type `"+z+"."+V+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+N+"`.")}function M(F){function U(z,V,N,te,J){var ge=z[V],re=P(ge);if(re!=="object")return new m("Invalid "+te+" `"+J+"` of type `"+re+"` "+("supplied to `"+N+"`, expected `object`."));for(var Se in F){var ye=F[Se];if(typeof ye!="function")return T(N,te,J,Se,I(ye));var ze=ye(ge,Se,N,te,J+"."+Se,n);if(ze)return ze}return null}return p(U)}function B(F){function U(z,V,N,te,J){var ge=z[V],re=P(ge);if(re!=="object")return new m("Invalid "+te+" `"+J+"` of type `"+re+"` "+("supplied to `"+N+"`, expected `object`."));var Se=t({},z[V],F);for(var ye in Se){var ze=F[ye];if(r(F,ye)&&typeof ze!="function")return T(N,te,J,ye,I(ze));if(!ze)return new m("Invalid "+te+" `"+J+"` key `"+ye+"` supplied to `"+N+"`.\nBad object: "+JSON.stringify(z[V],null," ")+`
47
+ Valid keys: `+JSON.stringify(Object.keys(F),null," "));var le=ze(ge,ye,N,te,J+"."+ye,n);if(le)return le}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 z=U.call(F),V;if(U!==F.entries){for(;!(V=z.next()).done;)if(!R(V.value))return!1}else for(;!(V=z.next()).done;){var N=V.value;if(N&&!R(N[1]))return!1}}else return!1;return!0;default:return!1}}function j(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":j(U,F)?"symbol":U}function I(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 G(F){var U=I(F);switch(U){case"array":case"object":return"an "+U;case"boolean":case"date":case"regexp":return"a "+U;default:return U}}function W(F){return!F.constructor||!F.constructor.name?f:F.constructor.name}return h.checkPropTypes=i,h.resetWarningCache=i.resetWarningCache,h.PropTypes=h,h},Pc}var jc,ig;function W_(){if(ig)return jc;ig=1;var e=Nf();function t(){}function n(){}return n.resetWarningCache=t,jc=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},jc}var sg;function Q_(){if(sg)return dl.exports;if(sg=1,process.env.NODE_ENV!=="production"){var e=S2(),t=!0;dl.exports=V_()(e.isElement,t)}else dl.exports=W_()();return dl.exports}var Y_=Q_();const Nd=Sp(Y_);var Qa=function(t){var n=t.className,r=n===void 0?"":n;return y.jsx("hr",{className:Oe("yst-my-6",r)})};Qa.propTypes={className:Nd.string};const _2=6048e5,X_=864e5,og=Symbol.for("constructDateFrom");function dn(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&og in e?e[og](t):e instanceof Date?new e.constructor(t):new Date(t)}function Kt(e,t){return dn(t||e,e)}function k2(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 Z_={};function Ku(){return Z_}function fa(e,t){var a,l,u,c,d,f,h,g;const n=Ku(),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 su(e,t){return fa(e,{...t,weekStartsOn:1})}function O2(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=su(i),o=dn(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const a=su(o);return n.getTime()>=s.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function ag(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 Vu(e,...t){const n=dn.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function ou(e,t){const n=Kt(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function J_(e,t,n){const[r,i]=Vu(n==null?void 0:n.in,e,t),s=ou(r),o=ou(i),a=+s-ag(s),l=+o-ag(o);return Math.round((a-l)/X_)}function e8(e,t){const n=O2(e,t),r=dn(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),su(r)}function t8(e){return dn(e,Date.now())}function n8(e,t,n){const[r,i]=Vu(n==null?void 0:n.in,e,t);return+ou(r)==+ou(i)}function r8(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function i8(e){return!(!r8(e)&&typeof e!="number"||isNaN(+Kt(e)))}function s8(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 o8(e,t){const[n,r]=Vu(e,t.start,t.end);return{start:n,end:r}}function a8(e,t){const{start:n,end:r}=o8(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 l8(e,t){const n=Kt(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function u8(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 c8={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"}},d8=(e,t,n)=>{let r;const i=c8[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 Mc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const f8={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},h8={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},g8={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},y8={date:Mc({formats:f8,defaultWidth:"full"}),time:Mc({formats:h8,defaultWidth:"full"}),dateTime:Mc({formats:g8,defaultWidth:"full"})},m8={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},p8=(e,t,n,r)=>m8[e];function wo(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 v8={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},b8={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},x8={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"]},w8={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"]},S8={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"}},C8={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"}},_8=(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"},k8={ordinalNumber:_8,era:wo({values:v8,defaultWidth:"wide"}),quarter:wo({values:b8,defaultWidth:"wide",argumentCallback:e=>e-1}),month:wo({values:x8,defaultWidth:"wide"}),day:wo({values:w8,defaultWidth:"wide"}),dayPeriod:wo({values:S8,defaultWidth:"wide",formattingValues:C8,defaultFormattingWidth:"wide"})};function So(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)?E8(a,d=>d.test(o)):O8(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 O8(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function E8(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function A8(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 T8=/^(\d+)(th|st|nd|rd)?/i,P8=/\d+/i,j8={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},M8={any:[/^b/i,/^(a|c)/i]},$8={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},L8={any:[/1/i,/2/i,/3/i,/4/i]},D8={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},I8={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]},R8={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},N8={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]},F8={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},B8={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}},q8={ordinalNumber:A8({matchPattern:T8,parsePattern:P8,valueCallback:e=>parseInt(e,10)}),era:So({matchPatterns:j8,defaultMatchWidth:"wide",parsePatterns:M8,defaultParseWidth:"any"}),quarter:So({matchPatterns:$8,defaultMatchWidth:"wide",parsePatterns:L8,defaultParseWidth:"any",valueCallback:e=>e+1}),month:So({matchPatterns:D8,defaultMatchWidth:"wide",parsePatterns:I8,defaultParseWidth:"any"}),day:So({matchPatterns:R8,defaultMatchWidth:"wide",parsePatterns:N8,defaultParseWidth:"any"}),dayPeriod:So({matchPatterns:F8,defaultMatchWidth:"any",parsePatterns:B8,defaultParseWidth:"any"})},z8={code:"en-US",formatDistance:d8,formatLong:y8,formatRelative:p8,localize:k8,match:q8,options:{weekStartsOn:0,firstWeekContainsDate:1}};function H8(e,t){const n=Kt(e,t==null?void 0:t.in);return J_(n,u8(n))+1}function U8(e,t){const n=Kt(e,t==null?void 0:t.in),r=+su(n)-+e8(n);return Math.round(r/_2)+1}function E2(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=Ku(),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=fa(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=fa(l,t);return+n>=+a?r+1:+n>=+u?r:r-1}function G8(e,t){var a,l,u,c,d,f,h,g;const n=Ku(),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=E2(e,t),s=dn((t==null?void 0:t.in)||e,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),fa(s,t)}function K8(e,t){const n=Kt(e,t==null?void 0:t.in),r=+fa(n,t)-+G8(n,t);return Math.round(r/_2)+1}function We(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Mr={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)}},ns={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},lg={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 Mr.y(e,t)},Y:function(e,t,n,r){const i=E2(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=O2(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 Mr.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=K8(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):We(i,t.length)},I:function(e,t,n){const r=U8(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"}):Mr.d(e,t)},D:function(e,t,n){const r=H8(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=ns.noon:r===0?i=ns.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=ns.evening:r>=12?i=ns.afternoon:r>=4?i=ns.morning:i=ns.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 Mr.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Mr.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"}):Mr.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Mr.s(e,t)},S:function(e,t){return Mr.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return cg(r);case"XXXX":case"XX":return mi(r);case"XXXXX":case"XXX":default:return mi(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return cg(r);case"xxxx":case"xx":return mi(r);case"xxxxx":case"xxx":default:return mi(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ug(r,":");case"OOOO":default:return"GMT"+mi(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ug(r,":");case"zzzz":default:return"GMT"+mi(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 ug(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 cg(e,t){return e%60===0?(e>0?"-":"+")+We(Math.abs(e)/60,2):mi(e,t)}function mi(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 dg=(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"})}},A2=(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"})}},V8=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return dg(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}}",dg(r,t)).replace("{{time}}",A2(i,t))},W8={p:A2,P:V8},Q8=/^D+$/,Y8=/^Y+$/,X8=["D","DD","YY","YYYY"];function Z8(e){return Q8.test(e)}function J8(e){return Y8.test(e)}function e7(e,t,n){const r=t7(e,t,n);if(console.warn(r),X8.includes(e))throw new RangeError(r)}function t7(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 n7=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,r7=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,i7=/^'([^]*?)'?$/,s7=/''/g,o7=/[a-zA-Z]/;function Io(e,t,n){var c,d,f,h,g,m,p,v,b;const r=Ku(),i=(c=r.locale)!=null?c:z8,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(!i8(a))throw new RangeError("Invalid time value");let l=t.match(r7).map(S=>{const C=S[0];if(C==="p"||C==="P"){const w=W8[C];return w(S,i.formatLong)}return S}).join("").match(n7).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const C=S[0];if(C==="'")return{isToken:!1,value:a7(S)};if(lg[C])return{isToken:!0,value:S};if(C.match(o7))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;(J8(C)||Z8(C))&&e7(C,t,String(e));const w=lg[C[0]];return w(a,C,i.localize,u)}).join("")}function a7(e){const t=e.match(i7);return t?t[1].replace(s7,"'"):e}function fg(e,t,n){const[r,i]=Vu(n==null?void 0:n.in,e,t);return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()}function l7(e,t){return n8(dn(e,e),t8(e))}function u7(e,t,n){return k2(e,-1,n)}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 $c(e,t,n){return(t=c7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c7(e){var t=d7(e,"string");return ha(t)=="symbol"?t:t+""}function d7(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 hg(e,t){return y7(e)||g7(e,t)||h7(e,t)||f7()}function f7(){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 h7(e,t){if(e){if(typeof e=="string")return gg(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)?gg(e,t):void 0}}function gg(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 g7(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 y7(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"}},m7=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=q.useState(new Date),d=hg(c,2),f=d[0],h=d[1],g=function(_){if(!_)return null;var O=_.slice(0,10),E=O.split("-"),T=hg(E,3),M=T[0],B=T[1],R=T[2],j=Number(M),P=Number(B),I=Number(R);return Number.isNaN(j)||Number.isNaN(P)||Number.isNaN(I)||P<1||P>12||I<1||I>31?null:new Date(j,P-1,I)},m=q.useMemo(function(){var x=new Map;return n.forEach(function(_){var O=g(_.createdAt),E=O?Io(O,"yyyy-MM-dd"):"";E&&(x.has(E)||x.set(E,[]),x.get(E).push(_))}),x},[n]);q.useEffect(function(){if(l&&r){var x=n.find(function(T){return T.id===r});if(x){var _=g(x.createdAt);_&&h(_)}}else if(l&&n.length>0){var O=n.reduce(function(T,M){return new Date(M.createdAt)>new Date(T.createdAt)?M:T}),E=g(O.createdAt);E&&h(E)}},[l,r,n]);var p=q.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=q.useMemo(function(){if(!p)return!1;var x=g(p.createdAt);return x?fg(x,f):!1},[p,f]),S=q.useMemo(function(){var x=l8(f),_=s8(f),O=new Date(x),E=O.getDay(),T=E===0?6:E-1;O.setDate(O.getDate()-T);var M=new Date(_),B=M.getDay(),R=B===0?0:7-B;return M.setDate(M.getDate()+R),a8({start:O,end:M}).map(function(j){var P=Io(j,"yyyy-MM-dd"),I=m.get(P)||[],G=I.find(function(W){return String(W.id)===String(r)});return{date:P,dateObj:j,isCurrentMonth:fg(j,f),isToday:l7(j),isSelected:!!G,hasAnalyses:I.length>0,analyses:I}})},[f,m,r]),C=function(){h(function(_){return u7(_)})},w=function(){h(function(_){return k2(_,1)})},k=function(_){if(_.hasAnalyses){if(_.analyses.length===1)i(_.analyses[0].id);else{var O=_.analyses.reduce(function(E,T){return new Date(T.createdAt)>new Date(E.createdAt)?T:E});i(O.id)}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:Io(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 k(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},$c({},"".concat(zn.selected.background," ").concat(zn.selected.text," ").concat(zn.selected.hover),x.isSelected),$c({},"".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",$c({},zn.today.underline,x.isToday&&!x.isSelected)),children:Io(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(A.Button,{onClick:v,className:"yst-w-full",disabled:b,children:"Show latest analysis"})})]}):null};function Lc(e,t){return x7(e)||b7(e,t)||v7(e,t)||p7()}function p7(){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 v7(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 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){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 x7(e){if(Array.isArray(e))return e}var w7=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=q.useState(!1),f=Lc(d,2),h=f[0],g=f[1],m=q.useState("latest"),p=Lc(m,2),v=p[0],b=p[1],S=q.useRef(null),C=function(j){if(!j)return null;var P=j.slice(0,10),I=P.split("-"),G=Lc(I,3),W=G[0],F=G[1],U=G[2],z=Number(W),V=Number(F),N=Number(U);return Number.isNaN(z)||Number.isNaN(V)||Number.isNaN(N)||V<1||V>12||N<1||N>31?null:new Date(z,V-1,N)},w=function(j){var P=C(j.createdAt);return P?P.getTime():-1/0};q.useEffect(function(){if((r==="latest"||!r)&&n.length>0&&!o){var R=n.reduce(function(j,P){return w(P)>w(j)?P:j});i(R.id)}},[n,r,i,o]);var k=q.useMemo(function(){if(r==="latest"||!r){if(n.length>0){var R=n.reduce(function(j,P){return w(P)>w(j)?P:j});return R.id}return"latest"}return r},[r,n,w]);q.useEffect(function(){b(k)},[k]);var x=n.find(function(R){return String(R.id)===String(v)}),_=n.length>0?String(n.reduce(function(R,j){return w(j)>w(R)?j:R}).id):"",O=function(){if(x){var R=C(x.createdAt),j=R?Io(R,"MMMM d, yyyy"):x.createdAt?x.createdAt.slice(0,10):"Unknown date",P=String(x.id)===_?"(latest)":"(older)";return"".concat(j," ").concat(P)}return n.length>0?"Select date...":"No analyses available"}();q.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)},T=function(j){b(j),i(j),g(!1)},M=function(){g(!1)},B=function(j){j.key==="Enter"||j.key===" "?(j.preventDefault(),E()):j.key==="Escape"&&g(!1)};return y.jsxs("div",{ref:S,className:"yst-relative",children:[y.jsxs("div",{className:"yst-relative",children:[y.jsx(A.TextInput,{id:c,onClick:E,onKeyDown:B,onChange:function(){},disabled:l||o,value:O,"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(m7,{analyses:n,selectedAnalysisId:v,onAnalysisSelect:T,isLoading:o,isOpen:h,onClose:M})]})};function T2(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 S7(e,t){var n=T2(e);return n!==void 0&&n>t*60*1e3}var C7=2;function P2(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:C7,n=T2(e);return n!==void 0&&n<=t*60*1e3}function Fd(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 mg;function pg(e,t){return E7(e)||O7(e,t)||k7(e,t)||_7()}function _7(){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 k7(e,t){if(e){if(typeof e=="string")return vg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vg(e,t):void 0}}function vg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function O7(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 E7(e){if(Array.isArray(e))return e}function Bd(){/*! 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 k,x,_,O=0,E=w||[],T=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(j,P){return k=j,x=0,_=e,M.n=P,o}};function B(R,j){for(x=R,_=j,t=0;!T&&O&&!P&&t<E.length;t++){var P,I=E[t],G=M.p,W=I[2];R>3?(P=W===j)&&(_=I[(x=I[4])?5:(x=3,3)],I[4]=I[5]=e):I[0]<=G&&((P=R<2&&G<I[1])?(x=0,M.v=j,M.n=I[1]):G<W&&(P=R<3||I[0]>j||j>W)&&(I[4]=R,I[5]=j,M.n=W,x=0))}if(P||R>1)return o;throw T=!0,j}return function(R,j,P){if(O>1)throw TypeError("Generator is already running");for(T&&j===1&&B(j,P),x=j,_=P;(t=x<2?e:_)||!T;){k||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(O=2,k){if(x||(R="next"),t=k[R]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=k.return)&&t.call(k),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);k=e}else if((t=(T=M.n<0)?_:S.call(C,M))!==o)break}catch(I){k=e,x=1,_=I}finally{O=1}}return{value:t,done:T}}}(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]"}),(Bd=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 bg(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 A7(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){bg(s,r,i,o,a,"next",l)}function a(l){bg(s,r,i,o,a,"throw",l)}o(void 0)})}}function T7(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Dc=Wa(mg||(mg=T7(["yst-flex-1 yst-space-y-2"]))),P7=function(t){var n,r,i,s,o=t.className,a=Nn(),l=a.brandId,u=a.analysisId,c=a.model,d=Ga(),f=d.setModel,h=d.setAnalysisId,g=Gt(),m=fn(),p=li(),v=p.data,b=zu({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,k=Yi({query:{select:function(Je){var Be=Je.data;return Be==null?void 0:Be.brands}}}),x=k.data,_=k.isLoading,O=a2(l,{query:{enabled:!!l,select:function(Je){var Be=Je.data;return Be==null?void 0:Be.analyses}}}),E=O.data,T=O.isLoading,M=Fu(l,u,{query:{enabled:!!l&&!!u,select:function(Je){var Be=Je.data;return Be}}}),B=M.data,R=M.isLoading,j=iu(l,{query:{enabled:!!l,select:function(Je){var Be=Je.data;return Be}}}),P=j.data,I=j.isLoading,G=H5({mutation:{onSuccess:function(){var we=A7(Bd().m(function Be(){var Tn,Vt;return Bd().w(function(hn){for(;;)switch(hn.n){case 0:return hn.n=1,Promise.all([g.invalidateQueries({queryKey:Lf(l)}),g.invalidateQueries({queryKey:Zn(l,u)}),g.invalidateQueries({queryKey:Bu(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 Ji=Fn.createdAt?new Date(Fn.createdAt).getTime():0,jr=ir.createdAt?new Date(ir.createdAt).getTime():0;return jr>Ji?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}()}}),W=G.mutate,F=G.isPending;q.useEffect(function(){!I&&!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"))},[I,R,P,l,m,x,E==null?void 0:E.length]);var U=q.useState(!1),z=pg(U,2),V=z[0],N=z[1],te=function(){N(!1)},J=x==null?void 0:x.find(function(we){return String(we.id)===String(l)}),ge=B==null||(n=B.analysis)===null||n===void 0?void 0:n.id,re=l!=null&&typeof ge=="number"&&!isNaN(ge),Se=q.useState(!1),ye=pg(Se,2),ze=ye[0],le=ye[1];q.useEffect(function(){if(re){var we="yst_legal_alert_dismissed_".concat(l,"_").concat(ge);le(window.localStorage.getItem(we)===null)}},[l,ge,re]);var He=function(Je){if(Je.preventDefault(),!!re){var Be="yst_legal_alert_dismissed_".concat(l,"_").concat(ge);window.localStorage.setItem(Be,"true"),le(!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=iu(l,{query:{enabled:!!l,select:function(Je){var Be=Je.data;return Be}}}),Z=Fe.data,Te=(Z==null?void 0:Z.name)||"your brand",tt=Fd(Z==null?void 0:Z.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 yi.pending:return{alertContent:we,alertVariant:"info"};case yi.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 yi.failed:return{alertContent:y.jsx(y.Fragment,{children:"Analysis failed. Try restarting the analysis or contact support if the issue persists."}),alertVariant:"danger"};case yi.cancelled:return{alertContent:y.jsx(y.Fragment,{children:"Analysis was cancelled. You can restart the analysis when ready."}),alertVariant:"warning"};case yi.completed:return{alertContent:null};default:return{alertContent:null,alertVariant:"info"}}}(),X=ue.alertContent,se=ue.alertVariant,ie=!T&&(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)===D6.updating&&Ce===!0;return y.jsxs(y.Fragment,{children:[y.jsx(Gu,{isOpen:V,onClose:te,onConfirm:function(){l&&u&&W({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(A.Card,{className:Oe("yst-relative yst-overflow-visible",o),children:y.jsxs(A.Card.Content,{className:"yst-mt-0",children:[y.jsxs("div",{className:"yst-flex yst-flex-1 yst-flex-col yst-flex-wrap yst-items-start yst-justify-between yst-gap-4 md:yst-flex-row xl:yst-items-center",children:[y.jsx("div",{className:"xl:yst-max-w-1/4",children:y.jsxs("div",{className:"yst-flex yst-flex-col xl:yst-flex-row xl:yst-items-baseline xl:yst-gap-2",children:[y.jsx(A.Title,{children:y.jsxs(y.Fragment,{children:[C||!w?y.jsx(A.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(A.Button,{variant:"primary",className:"yst-gap-1.5",onClick:function(){return m("/setup")},disabled:T||_,children:[y.jsx(g2,{})," Analyze a different brand"]}),y.jsx("div",{className:"yst-relative",children:y.jsxs(A.DropdownMenu,{children:[y.jsx(A.DropdownMenu.IconTrigger,{screenReaderTriggerLabel:"Open brand list options",disabled:T||_||x&&(x==null?void 0:x.length)<1,children:y.jsx(X4,{})}),y.jsx(A.DropdownMenu.List,{className:"yst-absolute yst-right-0 yst-top-full yst-z-40 yst-mt-2 yst-flex yst-w-64 yst-flex-col yst-justify-start",children:y.jsxs(A.DropdownMenu.ButtonItem,{onClick:function(){return N(!0)},disabled:T||_||(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(Df,{className:"yst-h-4 yst-w-4"}),"Delete analysis"]})})]})})]})]}),y.jsx(Qa,{}),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(Dc,{children:[y.jsx(A.Label,{htmlFor:"brand-name",children:"Brand"}),y.jsx(A.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(Dc,{children:[y.jsx(A.Label,{htmlFor:"analysis-date",children:"Analysis date"}),y.jsx(w7,{analyses:E||[],selectedAnalysisId:Ne,onAnalysisSelect:function(we){m("/brands/".concat(l,"/analysis/").concat(String(we)))},isLoading:T,disabled:T||!E||E.length<1,id:"analysis-date"})]}),y.jsxs(Dc,{children:[y.jsx(A.Label,{htmlFor:"ai-tool",children:"AI model"}),y.jsx(A.Select,{onChange:function(we){Object.values(L6).includes(we)?f(we):console.error("Invalid AI provider selected:",we)},id:"ai-tool",value:c,options:R||T?[{value:c,label:"Loading..."}]:dt,disabled:R||T||[{}].length<2})]})]})]})}),y.jsxs("div",{className:"ystaii-alerts yst-space-y-4",children:[re&&ze&&y.jsx(A.Alert,{children:y.jsxs("div",{className:"yst-flex yst-w-full",children:[y.jsx("div",{className:"yst-max-w-xl yst-space-y-4",children:y.jsx("p",{className:"yst-mb-0",children:"Note: This content was generated by an AI model (see dropdown above) and may contain errors. Please review before acting on it."})}),y.jsx("div",{className:"yst-ml-auto",children:y.jsx(A.Link,{onClick:He,variant:"default",children:y.jsx(b2,{})})})]})}),$e!==yi.completed&&X&&y.jsx(A.Alert,{className:"md:yst-col-span-2",variant:se,children:X}),Ce&&y.jsxs(A.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."})]})]}),ie&&y.jsx(A.Alert,{variant:"info",className:"yst-mb-6",children:y.jsx("div",{className:"yst-flex yst-items-start yst-gap-3",children:y.jsxs("div",{className:"yst-flex-1",children:[y.jsx("h3",{className:"yst-mb-2 yst-font-medium yst-text-blue-800",children:"No analyses scheduled"}),y.jsxs("p",{className:"yst-text-bluer-700 yst-mb-0",children:[y.jsx("span",{className:"yst-font-medium yst-text-blue-900",children:J==null?void 0:J.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"}),"."]})]})})}),J&&y.jsx(z_,{brand:J},J.id)]})},j7=function(){var t,n,r,i=li(),s=i.data,o=i.isLoading,a=i.isRefetching,l=s==null?void 0:s.mentions;return y.jsx(A.Card,{className:"yst-overflow-visible",children:y.jsxs(A.Card.Content,{className:"yst-space-y-4",children:[y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(Va,{title:"Mentions",tooltip:"The queries where your brand was mentioned."}),y.jsx(Ka,{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(A.Badge,{className:"yst-bg-green-100 yst-text-green-800",children:"Found"}):y.jsx(A.Badge,{className:"yst-bg-red-100 yst-text-red-800",children:"Not found"})})]},u.query)})}):y.jsx(A.SkeletonLoader,{className:"yst-h-56 yst-w-full"})]})})};/*!
51
51
  * @kurkle/color v0.3.4
52
52
  * https://github.com/kurkle/color#readme
53
53
  * (c) 2024 Jukka Kurkela
@@ -62,21 +62,21 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
62
62
  * https://www.chartjs.org
63
63
  * (c) 2025 Chart.js Contributors
64
64
  * Released under the MIT License
65
- */class Ek{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=N2.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 cr=new Ek;const zg="transparent",Ak={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=Mg(e||zg),i=r.valid&&Mg(t||zg);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class Tk{constructor(t,n,r,i){const s=n[r];i=pl([t.to,i,s,t.from]);const o=pl([t.from,s,i]);this._active=!0,this._fn=t.fn||Ak[t.type||typeof o],this._easing=Yo[t.easing]||Yo.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=pl([t.to,n,i,t.from]),this._from=pl([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 eb{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=jk(t,r);if(!i)return[];const s=this._createAnimations(i,r);return r.$shared&&Pk(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 Tk(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 cr.add(this._chart,r),!0}}function Pk(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 jk(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 Hg(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 Mk(e,t,n){if(n===!1)return!1;const r=Hg(e,n),i=Hg(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function $k(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 tb(e,t){const n=[],r=e._getSortedDatasetMetas(t);let i,s;for(i=0,s=r.length;i<s;++i)n.push(r[i].index);return n}function Ug(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||Ws(t)===Ws(u))&&(t+=u)}return!c&&!r.all?0:t}function Lk(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 Fc(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function Dk(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function Ik(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 Rk(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Gg(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 Kg(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=Dk(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]=Rk(i,c,m),f[a]=p,f._top=Gg(f,o,!0,r.type),f._bottom=Gg(f,o,!1,r.type);const b=f._visualValues||(f._visualValues={});b[a]=p}}function Bc(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function Nk(e,t){return ui(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Fk(e,t,n){return ui(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Co(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const i of t){const s=i._stacks;if(!s||s[r]===void 0||s[r][n]===void 0)return;delete s[r][n],s[r]._visualValues!==void 0&&s[r]._visualValues[n]!==void 0&&delete s[r]._visualValues[n]}}}const qc=e=>e==="reset"||e==="none",Vg=(e,t)=>t?e:Object.assign({},e),Bk=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:tb(n,!0),values:null};class ys{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=Fc(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Co(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(d,f,h,g)=>d==="x"?f:d==="r"?g:h,s=n.xAxisID=Le(r.xAxisID,Bc(t,"x")),o=n.yAxisID=Le(r.yAxisID,Bc(t,"y")),a=n.rAxisID=Le(r.rAxisID,Bc(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&&Tg(this._data,this),t._stacked&&Co(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Ie(n)){const i=this._cachedMeta;this._data=Lk(n,i)}else if(r!==n){if(r){Tg(r,this);const i=this._cachedMeta;Co(i),i._parsed=[]}n&&Object.isExtensible(n)&&v9(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=Fc(n.vScale,n),n.stack!==r.stack&&(i=!0,Co(n),n.stack=r.stack),this._resyncElements(t),(i||s!==n._stacked)&&(Kg(this,n._parsed),n._stacked=Fc(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&&Kg(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(ma(h,a),f),y:o.parse(ma(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:tb(i,!0),values:n._stacks[t.axis]._visualValues};return Ug(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=Ug(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=Bk(n,r,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:d}=Ik(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=$k(Le(this.options.clip,Mk(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=Fk(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=Nk(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&&uu(r);if(a)return Vg(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(Vg(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 eb(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||qc(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){qc(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!qc(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&&Co(r,i)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,i]=t;this[n](r,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}pe(ys,"defaults",{}),pe(ys,"datasetElementType",null),pe(ys,"dataElementType",null);class Bl extends ys{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}=S9(n,i,o);this._drawStart=a,this._drawCount=l,C9(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=pa(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 k=t[w],x=v?k:{};if(w<n||w>=b){x.skip=!0;continue}const _=this.getParsed(w),O=Ye(_[h]),E=x[f]=o.getPixelForValue(_[f],w),T=x[h]=s||O?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,_,l):_[h],w);x.skip=isNaN(E)||isNaN(T)||O,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,k.active?"active":i)),v||this.updateElement(k,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(Bl,"id","line"),pe(Bl,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),pe(Bl,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class ql extends ys{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 tk.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(ql,"id","radar"),pe(ql,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),pe(ql,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});function hi(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Jf{constructor(t){pe(this,"options");this.options=t||{}}static override(t){Object.assign(Jf.prototype,t)}init(){}formats(){return hi()}parse(){return hi()}format(){return hi()}add(){return hi()}diff(){return hi()}startOf(){return hi()}endOf(){return hi()}}var qk={_date:Jf};function zk(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?m9:Ci;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 Xu(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}=zk(s[a],t,o,i);for(let h=d;h<=f;++h){const g=c[h];g.skip||r(g,u,h)}}}function Hk(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 zc(e,t,n,r,i){const s=[];return!i&&!e.isPointInArea(t)||Xu(e,n,t,function(a,l,u){!i&&!vr(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&s.push({element:a,datasetIndex:l,index:u})},!0),s}function Uk(e,t,n,r){let i=[];function s(o,a,l){const{startAngle:u,endAngle:c}=o.getProps(["startAngle","endAngle"],r),{angle:d}=h9(o,{x:t.x,y:t.y});I2(d,u,c)&&i.push({element:o,datasetIndex:a,index:l})}return Xu(e,n,t,s),i}function Gk(e,t,n,r,i,s){let o=[];const a=Hk(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 Xu(e,n,t,u),o}function Hc(e,t,n,r,i,s){return!s&&!e.isPointInArea(t)?[]:n==="r"&&!r?Uk(e,t,n,i):Gk(e,t,n,r,i,s)}function Wg(e,t,n,r,i){const s=[],o=n==="x"?"inXRange":"inYRange";let a=!1;return Xu(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 Kk={modes:{index(e,t,n,r){const i=pi(t,e),s=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?zc(e,i,s,r,o):Hc(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=pi(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?zc(e,i,s,r,o):Hc(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=pi(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return zc(e,i,s,r,o)},nearest(e,t,n,r){const i=pi(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return Hc(e,i,s,n.intersect,r,o)},x(e,t,n,r){const i=pi(t,e);return Wg(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=pi(t,e);return Wg(e,i,"y",n.intersect,r)}}};const nb=["left","top","right","bottom"];function _o(e,t){return e.filter(n=>n.pos===t)}function Qg(e,t){return e.filter(n=>nb.indexOf(n.pos)===-1&&n.box.axis===t)}function ko(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 Vk(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 Wk(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:s}=n;if(!r||!nb.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 Qk(e,t){const n=Wk(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 Yk(e){const t=Vk(e),n=ko(t.filter(u=>u.box.fullSize),!0),r=ko(_o(t,"left"),!0),i=ko(_o(t,"right")),s=ko(_o(t,"top"),!0),o=ko(_o(t,"bottom")),a=Qg(t,"x"),l=Qg(t,"y");return{fullSize:n,leftAndTop:r.concat(s),rightAndBottom:i.concat(l).concat(o).concat(a),chartArea:_o(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:s.concat(o).concat(a)}}function Yg(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function rb(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 Xk(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&&rb(o,s.getPadding());const a=Math.max(0,t.outerWidth-Yg(o,e,"left","right")),l=Math.max(0,t.outerHeight-Yg(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 Zk(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 Jk(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 No(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,Jk(a.horizontal,t));const{same:d,other:f}=Xk(t,n,a,r);u|=d&&i.length,c=c||f,l.fullSize||i.push(a)}return u&&No(i,t,n,r)||c}function wl(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 Xg(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;uu(u.start)&&(o=u.start),l.fullSize?wl(l,i.left,o,n.outerWidth-i.right-i.left,f):wl(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;uu(u.start)&&(s=u.start),l.fullSize?wl(l,s,i.top,f,n.outerHeight-i.bottom-i.top):wl(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=Yk(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);rb(f,jt(r));const h=Object.assign({maxPadding:f,w:s,h:o,x:i.left,y:i.top},i),g=Qk(l.concat(u),d);No(a.fullSize,h,d,g),No(l,h,d,g),No(u,h,d,g)&&No(l,h,d,g),Zk(h),Xg(a.leftAndTop,h,d,g),h.x+=h.w,h.y+=h.h,Xg(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 ib{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class eO extends ib{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const zl="$chartjs",tO={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Zg=e=>e===null||e==="";function nO(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[zl]={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",Zg(i)){const s=Ng(e,"width");s!==void 0&&(e.width=s)}if(Zg(r))if(e.style.height==="")e.height=e.width/(t||2);else{const s=Ng(e,"height");s!==void 0&&(e.height=s)}return e}const sb=yk?{passive:!0}:!1;function rO(e,t,n){e&&e.addEventListener(t,n,sb)}function iO(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,sb)}function sO(e,t){const n=tO[e.type]||e.type,{x:r,y:i}=pi(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function gu(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function oO(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||gu(a.addedNodes,r),o=o&&!gu(a.removedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function aO(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||gu(a.removedNodes,r),o=o&&!gu(a.addedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const va=new Map;let Jg=0;function ob(){const e=window.devicePixelRatio;e!==Jg&&(Jg=e,va.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function lO(e,t){va.size||window.addEventListener("resize",ob),va.set(e,t)}function uO(e){va.delete(e),va.size||window.removeEventListener("resize",ob)}function cO(e,t,n){const r=e.canvas,i=r&&Zf(r);if(!i)return;const s=F2((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),lO(e,s),o}function Uc(e,t,n){n&&n.disconnect(),t==="resize"&&uO(e)}function dO(e,t,n){const r=e.canvas,i=F2(s=>{e.ctx!==null&&n(sO(s,e))},e);return rO(r,t,i),i}class fO extends ib{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(nO(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[zl])return!1;const r=n[zl].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[zl],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),o={attach:oO,detach:aO,resize:cO}[n]||dO;i[n]=o(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:Uc,detach:Uc,resize:Uc}[n]||iO)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return gk(t,n,r,i)}isAttached(t){const n=t&&Zf(t);return!!(n&&n.isConnected)}}function hO(e){return!Xf()||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas?eO:fO}var Ml;let Xi=(Ml=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 pa(this.x)&&pa(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(Ml,"defaults",{}),pe(Ml,"defaultRoutes"),Ml);function gO(e,t){const n=e.options.ticks,r=yO(e),i=Math.min(n.maxTicksLimit||r,r),s=n.major.enabled?pO(t):[],o=s.length,a=s[0],l=s[o-1],u=[];if(o>i)return vO(t,u,s,o/i),u;const c=mO(s,t,i);if(o>0){let d,f;const h=o>1?Math.round((l-a)/(o-1)):null;for(Sl(t,u,c,Ye(h)?0:a-h,a),d=0,f=o-1;d<f;d++)Sl(t,u,c,s[d],s[d+1]);return Sl(t,u,c,l,Ye(h)?t.length:l+h),u}return Sl(t,u,c),u}function yO(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 mO(e,t,n){const r=bO(e),i=t.length/n;if(!r)return Math.max(i,1);const s=u9(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 pO(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function vO(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 Sl(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 bO(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 xO=e=>e==="left"?"right":e==="right"?"left":e,ey=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,ty=(e,t)=>Math.min(t||e,e);function ny(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 wO(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 SO(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 Oo(e){return e.drawTicks?e.tickLength:0}function ry(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 CO(e,t){return ui(e,{scale:t,type:"scale"})}function _O(e,t,n){return ui(e,{tick:n,index:t,type:"tick"})}function kO(e,t,n){let r=Gf(e);return(n&&t!=="right"||!n&&t==="right")&&(r=xO(r)),r}function OO(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=ey(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=ey(e,n,t);g=Ot(r,o,i),d=n==="left"?-ln:ln}return{titleX:h,titleY:g,maxWidth:f,rotation:d}}class oo extends Xi{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=G9(this,s,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?ny(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=gO(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=ty(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-Oo(t.grid)-n.padding-ry(t.title,this.chart.options.font),u=Math.sqrt(d*d+f*f),o=Hf(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=ry(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=Oo(s)+l):(t.height=this.maxHeight,t.width=Oo(s)+l),r.display&&this.ticks.length){const{first:u,last:c,widest:d,highest:f}=this._getLabelSizes(),h=r.padding*2,g=Wr(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=ny(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/ty(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=du(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=du(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)}SO(s,n);const k=o.indexOf(u),x=a.indexOf(c),_=O=>({width:o[O]||0,height:a[O]||0});return{first:_(0),last:_(n-1),widest:_(k),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 y9(this._alignToPixels?fi(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=_O(this.getContext(),t,r))}return this.$context||(this.$context=CO(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Wr(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=Oo(s),h=[],g=a.setContext(this.getContext()),m=g.display?g.width:0,p=m/2,v=function(P){return fi(r,P,m)};let b,S,C,w,k,x,_,O,E,T,M,B;if(o==="top")b=v(this.bottom),x=this.bottom-f,O=b-p,T=v(t.top)+p,B=t.bottom;else if(o==="bottom")b=v(this.top),T=t.top,B=v(t.bottom)-p,x=b+p,O=this.top+f;else if(o==="left")b=v(this.right),k=this.right-f,_=b-p,E=v(t.left)+p,M=t.right;else if(o==="right")b=v(this.left),E=t.left,M=v(t.right)-p,k=b+p,_=this.left+f;else if(n==="x"){if(o==="center")b=v((t.top+t.bottom)/2+.5);else if(Ie(o)){const P=Object.keys(o)[0],I=o[P];b=v(this.chart.scales[P].getPixelForValue(I))}T=t.top,B=t.bottom,x=b+p,O=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],I=o[P];b=v(this.chart.scales[P].getPixelForValue(I))}k=b-p,_=k-f,E=t.left,M=t.right}const R=Le(i.ticks.maxTicksLimit,d),j=Math.max(1,Math.ceil(d/R));for(S=0;S<d;S+=j){const P=this.getContext(S),I=s.setContext(P),G=a.setContext(P),V=I.lineWidth,F=I.color,U=G.dash||[],z=G.dashOffset,Q=I.tickWidth,N=I.tickColor,te=I.tickBorderDash||[],J=I.tickBorderDashOffset;C=wO(this,S,l),C!==void 0&&(w=fi(r,C,V),u?k=_=E=M=w:x=O=T=B=w,h.push({tx1:k,ty1:x,tx2:_,ty2:O,x1:E,y1:T,x2:M,y2:B,width:V,color:F,borderDash:U,borderDashOffset:z,tickWidth:Q,tickColor:N,tickBorderDash:te,tickBorderDashOffset:J}))}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=Oo(r.grid),h=f+c,g=d?-c:h,m=-Wr(this.labelRotation),p=[];let v,b,S,C,w,k,x,_,O,E,T,M,B="middle";if(i==="top")k=this.bottom-g,x=this._getXAxisLabelAlignment();else if(i==="bottom")k=this.top+g,x=this._getXAxisLabelAlignment();else if(i==="left"){const j=this._getYAxisLabelAlignment(f);x=j.textAlign,w=j.x}else if(i==="right"){const j=this._getYAxisLabelAlignment(f);x=j.textAlign,w=j.x}else if(n==="x"){if(i==="center")k=(t.top+t.bottom)/2+h;else if(Ie(i)){const j=Object.keys(i)[0],P=i[j];k=this.chart.scales[j].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 j=Object.keys(i)[0],P=i[j];w=this.chart.scales[j].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 j=s.setContext(this.getContext(v));_=this.getPixelForTick(v)+s.labelOffset,O=this._resolveTickFontOptions(v),E=O.lineHeight,T=ot(C)?C.length:1;const P=T/2,I=j.color,G=j.textStrokeColor,V=j.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=-T*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-T*E,d&&(M*=-1),m!==0&&!j.showLabelBackdrop&&(w+=E/2*Math.sin(m))):(k=_,M=(1-T)*E/2);let U;if(j.showLabelBackdrop){const z=jt(j.backdropPadding),Q=R.heights[v],N=R.widths[v];let te=M-z.top,J=0-z.left;switch(B){case"middle":te-=Q/2;break;case"bottom":te-=Q;break}switch(x){case"center":J-=N/2;break;case"right":J-=N;break;case"inner":v===b-1?J-=N:v>0&&(J-=N/2);break}U={left:J,top:te,width:N+z.width,height:Q+z.height,color:j.backdropColor}}p.push({label:C,font:O,textOffset:M,options:{rotation:m,color:I,strokeColor:G,strokeWidth:V,textAlign:F,textBaseline:B,translation:[w,k],backdrop:U}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Wr(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=fi(t,this.left,o)-o/2,c=fi(t,this.right,a)+a/2,d=f=l):(d=fi(t,this.top,o)-o/2,f=fi(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&&Wu(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;Hi(r,u,0,c,l,a)}i&&Qu(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}=OO(this,l,n,a);Hi(t,r.text,0,0,s,{color:r.color,maxWidth:d,rotation:f,textAlign:kO(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!==oo.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 Cl{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;TO(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,EO(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 zi[r])}}function EO(e,t,n){const r=ya(Object.create(null),[n?ct.get(n):{},ct.get(t),e.defaults]);ct.set(t,r),e.defaultRoutes&&AO(t,e.defaultRoutes),e.descriptors&&ct.describe(t,e.descriptors)}function AO(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 TO(e){return"id"in e&&"defaults"in e}class PO{constructor(){this.controllers=new Cl(ys,"datasets",!0),this.elements=new Cl(Xi,"elements"),this.plugins=new Cl(Object,"plugins"),this.scales=new Cl(oo,"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=zf(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 PO;class jO{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=MO(r);return i===!1&&!n?[]:LO(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 MO(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 $O(e,t){return!t&&e===!1?null:e===!0?{}:e}function LO(e,{plugins:t,localIds:n},r,i){const s=[],o=e.getContext();for(const a of t){const l=a.id,u=$O(r[l],i);u!==null&&s.push({plugin:a,options:DO(e.config,{plugin:a,local:n[l]},u,o)})}return s}function DO(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 Gd(e,t){const n=ct.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function IO(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function RO(e,t){return e===t?"_index_":"_value_"}function iy(e){if(e==="x"||e==="y"||e==="r")return e}function NO(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Kd(e,...t){if(iy(e))return e;for(const n of t){const r=n.axis||NO(n.position)||e.length>1&&iy(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function sy(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function FO(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 sy(e,"x",n[0])||sy(e,"y",n[0])}return{}}function BO(e,t){const n=zi[e.type]||{scales:{}},r=t.scales||{},i=Gd(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=Kd(o,a,FO(o,e),ct.scales[a.type]),u=RO(l,i),c=n.scales||{};s[o]=Wo(Object.create(null),[{axis:l},a,c[l],c[u]])}),e.data.datasets.forEach(o=>{const a=o.type||e.type,l=o.indexAxis||Gd(a,t),c=(zi[a]||{}).scales||{};Object.keys(c).forEach(d=>{const f=IO(d,l),h=o[f+"AxisID"]||f;s[h]=s[h]||Object.create(null),Wo(s[h],[{axis:f},r[h],c[d]])})}),Object.keys(s).forEach(o=>{const a=s[o];Wo(a,[ct.scales[a.type],ct.scale])}),s}function ab(e){const t=e.options||(e.options={});t.plugins=Le(t.plugins,{}),t.scales=BO(e,t)}function lb(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function qO(e){return e=e||{},e.data=lb(e.data),ab(e),e}const oy=new Map,ub=new Set;function _l(e,t){let n=oy.get(e);return n||(n=t(),oy.set(e,n),ub.add(n)),n}const Eo=(e,t,n)=>{const r=ma(t,n);r!==void 0&&e.add(r)};class zO{constructor(t){this._config=qO(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=lb(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(),ab(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return _l(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return _l(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return _l(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return _l(`${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=>Eo(l,t,d))),c.forEach(d=>Eo(l,i,d)),c.forEach(d=>Eo(l,zi[s]||{},d)),c.forEach(d=>Eo(l,ct,d)),c.forEach(d=>Eo(l,Hd,d))});const u=Array.from(l);return u.length===0&&u.push(Object.create(null)),ub.has(n)&&o.set(n,u),u}chartOptionScopes(){const{options:t,type:n}=this;return[t,zi[n]||{},ct.datasets[n]||{},{type:n},ct,Hd]}resolveNamedOptions(t,n,r,i=[""]){const s={$shared:!0},{resolver:o,subPrefixes:a}=ay(this._resolverCache,t,i);let l=o;if(UO(o,n)){s.$shared=!1,r=ni(r)?r():r;const u=this.createResolver(t,r,a);l=Qs(o,r,u)}for(const u of n)s[u]=l[u];return s}createResolver(t,n,r=[""],i){const{resolver:s}=ay(this._resolverCache,t,r);return Ie(n)?Qs(s,n,void 0,i):s}}function ay(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:Wf(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,s)),s}const HO=e=>Ie(e)&&Object.getOwnPropertyNames(e).some(t=>ni(e[t]));function UO(e,t){const{isScriptable:n,isIndexable:r}=H2(e);for(const i of t){const s=n(i),o=r(i),a=(o||s)&&e[i];if(s&&(ni(a)||HO(a))||o&&ot(a))return!0}return!1}var GO="4.5.0";const KO=["top","bottom","left","right","chartArea"];function ly(e,t){return e==="top"||e==="bottom"||KO.indexOf(e)===-1&&t==="x"}function uy(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function cy(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),et(n&&n.onComplete,[e],t)}function VO(e){const t=e.chart,n=t.options.animation;et(n&&n.onProgress,[e],t)}function cb(e){return Xf()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Hl={},dy=e=>{const t=cb(e);return Object.values(Hl).filter(n=>n.canvas===t).pop()};function WO(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 QO(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}var Dr;let Zu=(Dr=class{static register(...t){Kn.add(...t),fy()}static unregister(...t){Kn.remove(...t),fy()}constructor(t,n){const r=this.config=new zO(n),i=cb(t),s=dy(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||hO(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=e9(),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 jO,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=x9(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],Hl[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}cr.listen(this,"complete",cy),cr.listen(this,"progress",VO),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():Rg(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Lg(this.canvas,this.ctx),this}stop(){return cr.stop(this),this}resize(t,n){cr.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,Rg(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=Kd(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=Kd(l,a),c=Le(a.type,o.dtype);(a.position===void 0||ly(a.position,u)!==ly(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(uy("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||Gd(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(uy("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);(!kg(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;WO(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(!kg(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,ni(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&&(cr.has(this)?this.attached&&!cr.running(this)&&cr.start(this):(this.draw(),cy({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=J2(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(i&&Wu(n,i),t.controller.draw(),i&&Qu(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return vr(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const s=Kk.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=ui(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);uu(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(),cr.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(),Lg(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Hl[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}});!au(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=o9(t),u=QO(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=!au(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(Dr,"defaults",ct),pe(Dr,"instances",Hl),pe(Dr,"overrides",zi),pe(Dr,"registry",Kn),pe(Dr,"version",GO),pe(Dr,"getChart",dy),Dr);function fy(){return Qe(Zu.instances,e=>e._plugins.invalidate())}function db(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 YO(e,t,n){e.lineTo(n.x,n.y)}function XO(e){return e.stepped?D9:e.tension||e.cubicInterpolationMode==="monotone"?I9:YO}function fb(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 ZO(e,t,n,r){const{points:i,options:s}=t,{count:o,start:a,loop:l,ilen:u}=fb(i,n,r),c=XO(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 JO(e,t,n,r){const i=t.points,{count:s,start:o,ilen:a}=fb(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,k=C|0;k===g?(w<m?m=w:w>p&&(p=w),c=(d*c+C)/++d):(S(),e.lineTo(C,w),g=k,d=0,m=p=w),v=w}S()}function Vd(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?JO:ZO}function eE(e){return e.stepped?mk:e.tension||e.cubicInterpolationMode==="monotone"?pk:vi}function tE(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),db(e,t.options),e.stroke(i)}function nE(e,t,n,r){const{segments:i,options:s}=t,o=Vd(t);for(const a of i)db(e,s,a.style),e.beginPath(),o(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const rE=typeof Path2D=="function";function iE(e,t,n,r){rE&&!t.options.segment?tE(e,t,n,r):nE(e,t,n,r)}class Qr extends Xi{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;lk(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=Ck(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=Z2(this,{property:n,start:i,end:i});if(!o.length)return;const a=[],l=eE(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 Vd(this)(t,this,n,r)}path(t,n,r){const i=this.segments,s=Vd(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(),iE(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}pe(Qr,"id","line"),pe(Qr,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),pe(Qr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),pe(Qr,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function hy(e,t,n,r){const i=e.options,{[n]:s}=e.getProps([n],r);return Math.abs(t-s)<i.radius+i.hitRadius}class Ul extends Xi{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 hy(this,n,"x",r)}inYRange(n,r){return hy(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||!vr(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,Ud(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}pe(Ul,"id","point"),pe(Ul,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),pe(Ul,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function sE(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=Ju(l,u,i);const c=Wd(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=Z2(t,c);for(const f of d){const h=Wd(n,s[f.start],s[f.end],f.loop),g=X2(a,i,h);for(const m of g)o.push({source:m,target:f,start:{[n]:gy(c,h,"start",Math.max)},end:{[n]:gy(c,h,"end",Math.min)}})}}return o}function Wd(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 oE(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,s=[];return t.segments.forEach(({start:o,end:a})=>{a=Ju(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 Ju(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function gy(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function hb(e,t){let n=[],r=!1;return ot(e)?(r=!0,n=e):n=oE(e,t),n.length?new Qr({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function yy(e){return e&&e.fill!==!1}function aE(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 lE(e,t,n){const r=fE(e);if(Ie(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return bt(i)&&Math.floor(i)===i?uE(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function uE(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function cE(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 dE(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 fE(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 hE(e){const{scale:t,index:n,line:r}=e,i=[],s=r.segments,o=r.points,a=gE(t,n);a.push(hb({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++)yE(i,o[c],a)}return new Qr({points:i,options:{}})}function gE(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 yE(e,t,n){const r=[];for(let i=0;i<n.length;i++){const s=n[i],{first:o,last:a,point:l}=mE(s,t,"x");if(!(!l||o&&a)){if(o)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function mE(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(fs(i,d,f)){a=i===d,l=i===f;break}}return{first:a,last:l,point:r}}class gb{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 pE(e){const{chart:t,fill:n,line:r}=e;if(bt(n))return vE(t,n);if(n==="stack")return hE(e);if(n==="shape")return!0;const i=bE(e);return i instanceof gb?i:hb(i,r)}function vE(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function bE(e){return(e.scale||{}).getPointPositionForValue?wE(e):xE(e)}function xE(e){const{scale:t={},fill:n}=e,r=cE(n,t);if(bt(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function wE(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,s=r.reverse?t.max:t.min,o=dE(n,t,s),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,s);return new gb({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 Gc(e,t,n){const r=pE(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=J2(i,g);r&&o.points.length&&(Wu(e,n),SE(e,{line:o,target:r,above:f,below:h,area:n,scale:a,axis:l,clip:m}),Qu(e))}function SE(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"?(my(e,r,o.top),Kc(e,{line:n,target:r,color:i,scale:a,property:u,clip:l}),e.restore(),e.save(),my(e,r,o.bottom)):u==="y"&&(py(e,r,o.left),Kc(e,{line:n,target:r,color:s,scale:a,property:u,clip:l}),e.restore(),e.save(),py(e,r,o.right),c=i)),Kc(e,{line:n,target:r,color:c,scale:a,property:u,clip:l}),e.restore()}function my(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[Ju(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 py(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[Ju(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 Kc(e,t){const{line:n,target:r,property:i,color:s,scale:o,clip:a}=t,l=sE(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,CE(e,o,a,g&&Wd(i,d,f)),e.beginPath();const m=!!n.pathSegment(e,u);let p;if(g){m?e.closePath():vy(e,r,f,i);const v=!!r.pathSegment(e,c,{move:m,reverse:!0});p=m&&v,p||vy(e,r,d,i)}e.closePath(),e.fill(p?"evenodd":"nonzero"),e.restore()}}function CE(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 vy(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var _E={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 Qr&&(l={visible:e.isDatasetVisible(o),index:o,fill:lE(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=aE(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&&Gc(e.ctx,a,s))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let i=r.length-1;i>=0;--i){const s=r[i].$filler;yy(s)&&Gc(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!yy(r)||n.drawTime!=="beforeDatasetDraw"||Gc(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const by=(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)}},kE=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class xy extends Xi{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}=by(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}=OE(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=gs(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;Wu(t,this),this._draw(),Qu(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:s,labels:o}=t,a=ct.color,l=gs(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}=by(o,d),v=function(k,x,_){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;i.save();const O=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=O,i.strokeStyle=Le(_.strokeStyle,a),i.setLineDash(Le(_.lineDash,[])),o.usePointStyle){const E={radius:m*Math.SQRT2/2,pointStyle:_.pointStyle,rotation:_.rotation,borderWidth:O},T=l.xPlus(k,g/2),M=x+f;q2(i,E,T,M,o.pointStyleWidth&&g)}else{const E=x+Math.max((d-m)/2,0),T=l.leftForLtr(k,g),M=hs(_.borderRadius);i.beginPath(),Object.values(M).some(B=>B!==0)?fu(i,{x:T,y:E,w:g,h:m,radius:M}):i.rect(T,E,g,m),i.fill(),O!==0&&i.stroke()}i.restore()},b=function(k,x,_){Hi(i,_.text,k,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},W2(this.ctx,t.textDirection);const w=p+c;this.legendItems.forEach((k,x)=>{i.strokeStyle=k.fontColor,i.fillStyle=k.fontColor;const _=i.measureText(k.text).width,O=l.textAlign(k.textAlign||(k.textAlign=o.textAlign)),E=g+f+_;let T=h.x,M=h.y;l.setWidth(this.width),S?x>0&&T+E+c>this.right&&(M=h.y+=w,h.line++,T=h.x=Ot(s,this.left+c,this.right-r[h.line])):x>0&&M+w>this.bottom&&(T=h.x=T+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(T);if(v(B,M,k),T=w9(O,T+g+f,S?T+E:this.right,t.rtl),b(l.x(T),M,k),S)h.x+=E+c;else if(typeof k.text!="string"){const R=u.lineHeight;h.y+=yb(k,R)+c}else h.y+=w}),Q2(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=gs(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(Gf(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=r.string,Hi(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(fs(t,this.left,this.right)&&fs(n,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(i=s[r],fs(t,i.left,i.left+i.width)&&fs(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!TE(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,s=kE(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 OE(e,t,n,r,i){const s=EE(r,e,t,n),o=AE(i,r,t.lineHeight);return{itemWidth:s,itemHeight:o}}function EE(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 AE(e,t,n){let r=e;return typeof t.text!="string"&&(r=yb(t,n)),r}function yb(e,t){const n=e.text?e.text.length:0;return t*n}function TE(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var PE={id:"legend",_element:xy,start(e,t,n){const r=e.legend=new xy({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 mb extends Xi{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);Hi(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:u,textAlign:Gf(n.align),textBaseline:"middle",translation:[o,a]})}}function jE(e,t){const n=new mb({ctx:e.ctx,options:t,chart:e});wn.configure(e,n,t),wn.addBox(e,n),e.titleBlock=n}var ME={id:"title",_element:mb,start(e,t,n){jE(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 Fo={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=zd(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 dr(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
65
+ */class Ek{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=N2.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 cr=new Ek;const zg="transparent",Ak={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=Mg(e||zg),i=r.valid&&Mg(t||zg);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class Tk{constructor(t,n,r,i){const s=n[r];i=pl([t.to,i,s,t.from]);const o=pl([t.from,s,i]);this._active=!0,this._fn=t.fn||Ak[t.type||typeof o],this._easing=Yo[t.easing]||Yo.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=pl([t.to,n,i,t.from]),this._from=pl([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 eb{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=jk(t,r);if(!i)return[];const s=this._createAnimations(i,r);return r.$shared&&Pk(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 Tk(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 cr.add(this._chart,r),!0}}function Pk(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 jk(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 Hg(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 Mk(e,t,n){if(n===!1)return!1;const r=Hg(e,n),i=Hg(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function $k(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 tb(e,t){const n=[],r=e._getSortedDatasetMetas(t);let i,s;for(i=0,s=r.length;i<s;++i)n.push(r[i].index);return n}function Ug(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||Ws(t)===Ws(u))&&(t+=u)}return!c&&!r.all?0:t}function Lk(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 Fc(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function Dk(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function Ik(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 Rk(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Gg(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 Kg(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=Dk(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]=Rk(i,c,m),f[a]=p,f._top=Gg(f,o,!0,r.type),f._bottom=Gg(f,o,!1,r.type);const b=f._visualValues||(f._visualValues={});b[a]=p}}function Bc(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function Nk(e,t){return ui(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Fk(e,t,n){return ui(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Co(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const i of t){const s=i._stacks;if(!s||s[r]===void 0||s[r][n]===void 0)return;delete s[r][n],s[r]._visualValues!==void 0&&s[r]._visualValues[n]!==void 0&&delete s[r]._visualValues[n]}}}const qc=e=>e==="reset"||e==="none",Vg=(e,t)=>t?e:Object.assign({},e),Bk=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:tb(n,!0),values:null};class ys{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=Fc(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Co(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(d,f,h,g)=>d==="x"?f:d==="r"?g:h,s=n.xAxisID=Le(r.xAxisID,Bc(t,"x")),o=n.yAxisID=Le(r.yAxisID,Bc(t,"y")),a=n.rAxisID=Le(r.rAxisID,Bc(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&&Tg(this._data,this),t._stacked&&Co(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Ie(n)){const i=this._cachedMeta;this._data=Lk(n,i)}else if(r!==n){if(r){Tg(r,this);const i=this._cachedMeta;Co(i),i._parsed=[]}n&&Object.isExtensible(n)&&v9(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=Fc(n.vScale,n),n.stack!==r.stack&&(i=!0,Co(n),n.stack=r.stack),this._resyncElements(t),(i||s!==n._stacked)&&(Kg(this,n._parsed),n._stacked=Fc(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&&Kg(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(ma(h,a),f),y:o.parse(ma(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:tb(i,!0),values:n._stacks[t.axis]._visualValues};return Ug(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=Ug(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=Bk(n,r,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:d}=Ik(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=$k(Le(this.options.clip,Mk(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=Fk(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=Nk(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&&uu(r);if(a)return Vg(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(Vg(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 eb(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||qc(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){qc(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!qc(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&&Co(r,i)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,i]=t;this[n](r,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}pe(ys,"defaults",{}),pe(ys,"datasetElementType",null),pe(ys,"dataElementType",null);class Bl extends ys{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}=S9(n,i,o);this._drawStart=a,this._drawCount=l,C9(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=pa(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 k=t[w],x=v?k:{};if(w<n||w>=b){x.skip=!0;continue}const _=this.getParsed(w),O=Ye(_[h]),E=x[f]=o.getPixelForValue(_[f],w),T=x[h]=s||O?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,_,l):_[h],w);x.skip=isNaN(E)||isNaN(T)||O,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,k.active?"active":i)),v||this.updateElement(k,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(Bl,"id","line"),pe(Bl,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),pe(Bl,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class ql extends ys{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 tk.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(ql,"id","radar"),pe(ql,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),pe(ql,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});function hi(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Jf{constructor(t){pe(this,"options");this.options=t||{}}static override(t){Object.assign(Jf.prototype,t)}init(){}formats(){return hi()}parse(){return hi()}format(){return hi()}add(){return hi()}diff(){return hi()}startOf(){return hi()}endOf(){return hi()}}var qk={_date:Jf};function zk(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?m9:Ci;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 Xu(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}=zk(s[a],t,o,i);for(let h=d;h<=f;++h){const g=c[h];g.skip||r(g,u,h)}}}function Hk(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 zc(e,t,n,r,i){const s=[];return!i&&!e.isPointInArea(t)||Xu(e,n,t,function(a,l,u){!i&&!vr(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&s.push({element:a,datasetIndex:l,index:u})},!0),s}function Uk(e,t,n,r){let i=[];function s(o,a,l){const{startAngle:u,endAngle:c}=o.getProps(["startAngle","endAngle"],r),{angle:d}=h9(o,{x:t.x,y:t.y});I2(d,u,c)&&i.push({element:o,datasetIndex:a,index:l})}return Xu(e,n,t,s),i}function Gk(e,t,n,r,i,s){let o=[];const a=Hk(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 Xu(e,n,t,u),o}function Hc(e,t,n,r,i,s){return!s&&!e.isPointInArea(t)?[]:n==="r"&&!r?Uk(e,t,n,i):Gk(e,t,n,r,i,s)}function Wg(e,t,n,r,i){const s=[],o=n==="x"?"inXRange":"inYRange";let a=!1;return Xu(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 Kk={modes:{index(e,t,n,r){const i=pi(t,e),s=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?zc(e,i,s,r,o):Hc(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=pi(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?zc(e,i,s,r,o):Hc(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=pi(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return zc(e,i,s,r,o)},nearest(e,t,n,r){const i=pi(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return Hc(e,i,s,n.intersect,r,o)},x(e,t,n,r){const i=pi(t,e);return Wg(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=pi(t,e);return Wg(e,i,"y",n.intersect,r)}}};const nb=["left","top","right","bottom"];function _o(e,t){return e.filter(n=>n.pos===t)}function Qg(e,t){return e.filter(n=>nb.indexOf(n.pos)===-1&&n.box.axis===t)}function ko(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 Vk(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 Wk(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:s}=n;if(!r||!nb.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 Qk(e,t){const n=Wk(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 Yk(e){const t=Vk(e),n=ko(t.filter(u=>u.box.fullSize),!0),r=ko(_o(t,"left"),!0),i=ko(_o(t,"right")),s=ko(_o(t,"top"),!0),o=ko(_o(t,"bottom")),a=Qg(t,"x"),l=Qg(t,"y");return{fullSize:n,leftAndTop:r.concat(s),rightAndBottom:i.concat(l).concat(o).concat(a),chartArea:_o(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:s.concat(o).concat(a)}}function Yg(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function rb(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 Xk(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&&rb(o,s.getPadding());const a=Math.max(0,t.outerWidth-Yg(o,e,"left","right")),l=Math.max(0,t.outerHeight-Yg(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 Zk(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 Jk(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 No(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,Jk(a.horizontal,t));const{same:d,other:f}=Xk(t,n,a,r);u|=d&&i.length,c=c||f,l.fullSize||i.push(a)}return u&&No(i,t,n,r)||c}function wl(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 Xg(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;uu(u.start)&&(o=u.start),l.fullSize?wl(l,i.left,o,n.outerWidth-i.right-i.left,f):wl(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;uu(u.start)&&(s=u.start),l.fullSize?wl(l,s,i.top,f,n.outerHeight-i.bottom-i.top):wl(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=Yk(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);rb(f,jt(r));const h=Object.assign({maxPadding:f,w:s,h:o,x:i.left,y:i.top},i),g=Qk(l.concat(u),d);No(a.fullSize,h,d,g),No(l,h,d,g),No(u,h,d,g)&&No(l,h,d,g),Zk(h),Xg(a.leftAndTop,h,d,g),h.x+=h.w,h.y+=h.h,Xg(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 ib{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class eO extends ib{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const zl="$chartjs",tO={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Zg=e=>e===null||e==="";function nO(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[zl]={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",Zg(i)){const s=Ng(e,"width");s!==void 0&&(e.width=s)}if(Zg(r))if(e.style.height==="")e.height=e.width/(t||2);else{const s=Ng(e,"height");s!==void 0&&(e.height=s)}return e}const sb=yk?{passive:!0}:!1;function rO(e,t,n){e&&e.addEventListener(t,n,sb)}function iO(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,sb)}function sO(e,t){const n=tO[e.type]||e.type,{x:r,y:i}=pi(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function gu(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function oO(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||gu(a.addedNodes,r),o=o&&!gu(a.removedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function aO(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||gu(a.removedNodes,r),o=o&&!gu(a.addedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const va=new Map;let Jg=0;function ob(){const e=window.devicePixelRatio;e!==Jg&&(Jg=e,va.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function lO(e,t){va.size||window.addEventListener("resize",ob),va.set(e,t)}function uO(e){va.delete(e),va.size||window.removeEventListener("resize",ob)}function cO(e,t,n){const r=e.canvas,i=r&&Zf(r);if(!i)return;const s=F2((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),lO(e,s),o}function Uc(e,t,n){n&&n.disconnect(),t==="resize"&&uO(e)}function dO(e,t,n){const r=e.canvas,i=F2(s=>{e.ctx!==null&&n(sO(s,e))},e);return rO(r,t,i),i}class fO extends ib{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(nO(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[zl])return!1;const r=n[zl].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[zl],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),o={attach:oO,detach:aO,resize:cO}[n]||dO;i[n]=o(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:Uc,detach:Uc,resize:Uc}[n]||iO)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return gk(t,n,r,i)}isAttached(t){const n=t&&Zf(t);return!!(n&&n.isConnected)}}function hO(e){return!Xf()||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas?eO:fO}var Ml;let Xi=(Ml=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 pa(this.x)&&pa(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(Ml,"defaults",{}),pe(Ml,"defaultRoutes"),Ml);function gO(e,t){const n=e.options.ticks,r=yO(e),i=Math.min(n.maxTicksLimit||r,r),s=n.major.enabled?pO(t):[],o=s.length,a=s[0],l=s[o-1],u=[];if(o>i)return vO(t,u,s,o/i),u;const c=mO(s,t,i);if(o>0){let d,f;const h=o>1?Math.round((l-a)/(o-1)):null;for(Sl(t,u,c,Ye(h)?0:a-h,a),d=0,f=o-1;d<f;d++)Sl(t,u,c,s[d],s[d+1]);return Sl(t,u,c,l,Ye(h)?t.length:l+h),u}return Sl(t,u,c),u}function yO(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 mO(e,t,n){const r=bO(e),i=t.length/n;if(!r)return Math.max(i,1);const s=u9(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 pO(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function vO(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 Sl(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 bO(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 xO=e=>e==="left"?"right":e==="right"?"left":e,ey=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,ty=(e,t)=>Math.min(t||e,e);function ny(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 wO(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 SO(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 Oo(e){return e.drawTicks?e.tickLength:0}function ry(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 CO(e,t){return ui(e,{scale:t,type:"scale"})}function _O(e,t,n){return ui(e,{tick:n,index:t,type:"tick"})}function kO(e,t,n){let r=Gf(e);return(n&&t!=="right"||!n&&t==="right")&&(r=xO(r)),r}function OO(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=ey(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=ey(e,n,t);g=Ot(r,o,i),d=n==="left"?-ln:ln}return{titleX:h,titleY:g,maxWidth:f,rotation:d}}class oo extends Xi{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=G9(this,s,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?ny(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=gO(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=ty(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-Oo(t.grid)-n.padding-ry(t.title,this.chart.options.font),u=Math.sqrt(d*d+f*f),o=Hf(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=ry(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=Oo(s)+l):(t.height=this.maxHeight,t.width=Oo(s)+l),r.display&&this.ticks.length){const{first:u,last:c,widest:d,highest:f}=this._getLabelSizes(),h=r.padding*2,g=Wr(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=ny(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/ty(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=du(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=du(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)}SO(s,n);const k=o.indexOf(u),x=a.indexOf(c),_=O=>({width:o[O]||0,height:a[O]||0});return{first:_(0),last:_(n-1),widest:_(k),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 y9(this._alignToPixels?fi(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=_O(this.getContext(),t,r))}return this.$context||(this.$context=CO(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Wr(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=Oo(s),h=[],g=a.setContext(this.getContext()),m=g.display?g.width:0,p=m/2,v=function(P){return fi(r,P,m)};let b,S,C,w,k,x,_,O,E,T,M,B;if(o==="top")b=v(this.bottom),x=this.bottom-f,O=b-p,T=v(t.top)+p,B=t.bottom;else if(o==="bottom")b=v(this.top),T=t.top,B=v(t.bottom)-p,x=b+p,O=this.top+f;else if(o==="left")b=v(this.right),k=this.right-f,_=b-p,E=v(t.left)+p,M=t.right;else if(o==="right")b=v(this.left),E=t.left,M=v(t.right)-p,k=b+p,_=this.left+f;else if(n==="x"){if(o==="center")b=v((t.top+t.bottom)/2+.5);else if(Ie(o)){const P=Object.keys(o)[0],I=o[P];b=v(this.chart.scales[P].getPixelForValue(I))}T=t.top,B=t.bottom,x=b+p,O=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],I=o[P];b=v(this.chart.scales[P].getPixelForValue(I))}k=b-p,_=k-f,E=t.left,M=t.right}const R=Le(i.ticks.maxTicksLimit,d),j=Math.max(1,Math.ceil(d/R));for(S=0;S<d;S+=j){const P=this.getContext(S),I=s.setContext(P),G=a.setContext(P),W=I.lineWidth,F=I.color,U=G.dash||[],z=G.dashOffset,V=I.tickWidth,N=I.tickColor,te=I.tickBorderDash||[],J=I.tickBorderDashOffset;C=wO(this,S,l),C!==void 0&&(w=fi(r,C,W),u?k=_=E=M=w:x=O=T=B=w,h.push({tx1:k,ty1:x,tx2:_,ty2:O,x1:E,y1:T,x2:M,y2:B,width:W,color:F,borderDash:U,borderDashOffset:z,tickWidth:V,tickColor:N,tickBorderDash:te,tickBorderDashOffset:J}))}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=Oo(r.grid),h=f+c,g=d?-c:h,m=-Wr(this.labelRotation),p=[];let v,b,S,C,w,k,x,_,O,E,T,M,B="middle";if(i==="top")k=this.bottom-g,x=this._getXAxisLabelAlignment();else if(i==="bottom")k=this.top+g,x=this._getXAxisLabelAlignment();else if(i==="left"){const j=this._getYAxisLabelAlignment(f);x=j.textAlign,w=j.x}else if(i==="right"){const j=this._getYAxisLabelAlignment(f);x=j.textAlign,w=j.x}else if(n==="x"){if(i==="center")k=(t.top+t.bottom)/2+h;else if(Ie(i)){const j=Object.keys(i)[0],P=i[j];k=this.chart.scales[j].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 j=Object.keys(i)[0],P=i[j];w=this.chart.scales[j].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 j=s.setContext(this.getContext(v));_=this.getPixelForTick(v)+s.labelOffset,O=this._resolveTickFontOptions(v),E=O.lineHeight,T=ot(C)?C.length:1;const P=T/2,I=j.color,G=j.textStrokeColor,W=j.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=-T*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-T*E,d&&(M*=-1),m!==0&&!j.showLabelBackdrop&&(w+=E/2*Math.sin(m))):(k=_,M=(1-T)*E/2);let U;if(j.showLabelBackdrop){const z=jt(j.backdropPadding),V=R.heights[v],N=R.widths[v];let te=M-z.top,J=0-z.left;switch(B){case"middle":te-=V/2;break;case"bottom":te-=V;break}switch(x){case"center":J-=N/2;break;case"right":J-=N;break;case"inner":v===b-1?J-=N:v>0&&(J-=N/2);break}U={left:J,top:te,width:N+z.width,height:V+z.height,color:j.backdropColor}}p.push({label:C,font:O,textOffset:M,options:{rotation:m,color:I,strokeColor:G,strokeWidth:W,textAlign:F,textBaseline:B,translation:[w,k],backdrop:U}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Wr(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=fi(t,this.left,o)-o/2,c=fi(t,this.right,a)+a/2,d=f=l):(d=fi(t,this.top,o)-o/2,f=fi(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&&Wu(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;Hi(r,u,0,c,l,a)}i&&Qu(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}=OO(this,l,n,a);Hi(t,r.text,0,0,s,{color:r.color,maxWidth:d,rotation:f,textAlign:kO(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!==oo.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 Cl{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;TO(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,EO(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 zi[r])}}function EO(e,t,n){const r=ya(Object.create(null),[n?ct.get(n):{},ct.get(t),e.defaults]);ct.set(t,r),e.defaultRoutes&&AO(t,e.defaultRoutes),e.descriptors&&ct.describe(t,e.descriptors)}function AO(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 TO(e){return"id"in e&&"defaults"in e}class PO{constructor(){this.controllers=new Cl(ys,"datasets",!0),this.elements=new Cl(Xi,"elements"),this.plugins=new Cl(Object,"plugins"),this.scales=new Cl(oo,"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=zf(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 PO;class jO{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=MO(r);return i===!1&&!n?[]:LO(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 MO(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 $O(e,t){return!t&&e===!1?null:e===!0?{}:e}function LO(e,{plugins:t,localIds:n},r,i){const s=[],o=e.getContext();for(const a of t){const l=a.id,u=$O(r[l],i);u!==null&&s.push({plugin:a,options:DO(e.config,{plugin:a,local:n[l]},u,o)})}return s}function DO(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 Gd(e,t){const n=ct.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function IO(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function RO(e,t){return e===t?"_index_":"_value_"}function iy(e){if(e==="x"||e==="y"||e==="r")return e}function NO(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Kd(e,...t){if(iy(e))return e;for(const n of t){const r=n.axis||NO(n.position)||e.length>1&&iy(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function sy(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function FO(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 sy(e,"x",n[0])||sy(e,"y",n[0])}return{}}function BO(e,t){const n=zi[e.type]||{scales:{}},r=t.scales||{},i=Gd(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=Kd(o,a,FO(o,e),ct.scales[a.type]),u=RO(l,i),c=n.scales||{};s[o]=Wo(Object.create(null),[{axis:l},a,c[l],c[u]])}),e.data.datasets.forEach(o=>{const a=o.type||e.type,l=o.indexAxis||Gd(a,t),c=(zi[a]||{}).scales||{};Object.keys(c).forEach(d=>{const f=IO(d,l),h=o[f+"AxisID"]||f;s[h]=s[h]||Object.create(null),Wo(s[h],[{axis:f},r[h],c[d]])})}),Object.keys(s).forEach(o=>{const a=s[o];Wo(a,[ct.scales[a.type],ct.scale])}),s}function ab(e){const t=e.options||(e.options={});t.plugins=Le(t.plugins,{}),t.scales=BO(e,t)}function lb(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function qO(e){return e=e||{},e.data=lb(e.data),ab(e),e}const oy=new Map,ub=new Set;function _l(e,t){let n=oy.get(e);return n||(n=t(),oy.set(e,n),ub.add(n)),n}const Eo=(e,t,n)=>{const r=ma(t,n);r!==void 0&&e.add(r)};class zO{constructor(t){this._config=qO(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=lb(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(),ab(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return _l(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return _l(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return _l(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return _l(`${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=>Eo(l,t,d))),c.forEach(d=>Eo(l,i,d)),c.forEach(d=>Eo(l,zi[s]||{},d)),c.forEach(d=>Eo(l,ct,d)),c.forEach(d=>Eo(l,Hd,d))});const u=Array.from(l);return u.length===0&&u.push(Object.create(null)),ub.has(n)&&o.set(n,u),u}chartOptionScopes(){const{options:t,type:n}=this;return[t,zi[n]||{},ct.datasets[n]||{},{type:n},ct,Hd]}resolveNamedOptions(t,n,r,i=[""]){const s={$shared:!0},{resolver:o,subPrefixes:a}=ay(this._resolverCache,t,i);let l=o;if(UO(o,n)){s.$shared=!1,r=ni(r)?r():r;const u=this.createResolver(t,r,a);l=Qs(o,r,u)}for(const u of n)s[u]=l[u];return s}createResolver(t,n,r=[""],i){const{resolver:s}=ay(this._resolverCache,t,r);return Ie(n)?Qs(s,n,void 0,i):s}}function ay(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:Wf(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,s)),s}const HO=e=>Ie(e)&&Object.getOwnPropertyNames(e).some(t=>ni(e[t]));function UO(e,t){const{isScriptable:n,isIndexable:r}=H2(e);for(const i of t){const s=n(i),o=r(i),a=(o||s)&&e[i];if(s&&(ni(a)||HO(a))||o&&ot(a))return!0}return!1}var GO="4.5.0";const KO=["top","bottom","left","right","chartArea"];function ly(e,t){return e==="top"||e==="bottom"||KO.indexOf(e)===-1&&t==="x"}function uy(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function cy(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),et(n&&n.onComplete,[e],t)}function VO(e){const t=e.chart,n=t.options.animation;et(n&&n.onProgress,[e],t)}function cb(e){return Xf()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Hl={},dy=e=>{const t=cb(e);return Object.values(Hl).filter(n=>n.canvas===t).pop()};function WO(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 QO(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}var Dr;let Zu=(Dr=class{static register(...t){Kn.add(...t),fy()}static unregister(...t){Kn.remove(...t),fy()}constructor(t,n){const r=this.config=new zO(n),i=cb(t),s=dy(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||hO(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=e9(),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 jO,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=x9(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],Hl[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}cr.listen(this,"complete",cy),cr.listen(this,"progress",VO),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():Rg(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Lg(this.canvas,this.ctx),this}stop(){return cr.stop(this),this}resize(t,n){cr.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,Rg(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=Kd(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=Kd(l,a),c=Le(a.type,o.dtype);(a.position===void 0||ly(a.position,u)!==ly(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(uy("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||Gd(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(uy("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);(!kg(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;WO(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(!kg(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,ni(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&&(cr.has(this)?this.attached&&!cr.running(this)&&cr.start(this):(this.draw(),cy({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=J2(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(i&&Wu(n,i),t.controller.draw(),i&&Qu(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return vr(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const s=Kk.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=ui(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);uu(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(),cr.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(),Lg(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Hl[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}});!au(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=o9(t),u=QO(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=!au(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(Dr,"defaults",ct),pe(Dr,"instances",Hl),pe(Dr,"overrides",zi),pe(Dr,"registry",Kn),pe(Dr,"version",GO),pe(Dr,"getChart",dy),Dr);function fy(){return Qe(Zu.instances,e=>e._plugins.invalidate())}function db(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 YO(e,t,n){e.lineTo(n.x,n.y)}function XO(e){return e.stepped?D9:e.tension||e.cubicInterpolationMode==="monotone"?I9:YO}function fb(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 ZO(e,t,n,r){const{points:i,options:s}=t,{count:o,start:a,loop:l,ilen:u}=fb(i,n,r),c=XO(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 JO(e,t,n,r){const i=t.points,{count:s,start:o,ilen:a}=fb(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,k=C|0;k===g?(w<m?m=w:w>p&&(p=w),c=(d*c+C)/++d):(S(),e.lineTo(C,w),g=k,d=0,m=p=w),v=w}S()}function Vd(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?JO:ZO}function eE(e){return e.stepped?mk:e.tension||e.cubicInterpolationMode==="monotone"?pk:vi}function tE(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),db(e,t.options),e.stroke(i)}function nE(e,t,n,r){const{segments:i,options:s}=t,o=Vd(t);for(const a of i)db(e,s,a.style),e.beginPath(),o(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const rE=typeof Path2D=="function";function iE(e,t,n,r){rE&&!t.options.segment?tE(e,t,n,r):nE(e,t,n,r)}class Qr extends Xi{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;lk(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=Ck(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=Z2(this,{property:n,start:i,end:i});if(!o.length)return;const a=[],l=eE(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 Vd(this)(t,this,n,r)}path(t,n,r){const i=this.segments,s=Vd(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(),iE(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}pe(Qr,"id","line"),pe(Qr,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),pe(Qr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),pe(Qr,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function hy(e,t,n,r){const i=e.options,{[n]:s}=e.getProps([n],r);return Math.abs(t-s)<i.radius+i.hitRadius}class Ul extends Xi{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 hy(this,n,"x",r)}inYRange(n,r){return hy(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||!vr(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,Ud(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}pe(Ul,"id","point"),pe(Ul,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),pe(Ul,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function sE(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=Ju(l,u,i);const c=Wd(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=Z2(t,c);for(const f of d){const h=Wd(n,s[f.start],s[f.end],f.loop),g=X2(a,i,h);for(const m of g)o.push({source:m,target:f,start:{[n]:gy(c,h,"start",Math.max)},end:{[n]:gy(c,h,"end",Math.min)}})}}return o}function Wd(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 oE(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,s=[];return t.segments.forEach(({start:o,end:a})=>{a=Ju(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 Ju(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function gy(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function hb(e,t){let n=[],r=!1;return ot(e)?(r=!0,n=e):n=oE(e,t),n.length?new Qr({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function yy(e){return e&&e.fill!==!1}function aE(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 lE(e,t,n){const r=fE(e);if(Ie(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return bt(i)&&Math.floor(i)===i?uE(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function uE(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function cE(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 dE(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 fE(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 hE(e){const{scale:t,index:n,line:r}=e,i=[],s=r.segments,o=r.points,a=gE(t,n);a.push(hb({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++)yE(i,o[c],a)}return new Qr({points:i,options:{}})}function gE(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 yE(e,t,n){const r=[];for(let i=0;i<n.length;i++){const s=n[i],{first:o,last:a,point:l}=mE(s,t,"x");if(!(!l||o&&a)){if(o)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function mE(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(fs(i,d,f)){a=i===d,l=i===f;break}}return{first:a,last:l,point:r}}class gb{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 pE(e){const{chart:t,fill:n,line:r}=e;if(bt(n))return vE(t,n);if(n==="stack")return hE(e);if(n==="shape")return!0;const i=bE(e);return i instanceof gb?i:hb(i,r)}function vE(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function bE(e){return(e.scale||{}).getPointPositionForValue?wE(e):xE(e)}function xE(e){const{scale:t={},fill:n}=e,r=cE(n,t);if(bt(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function wE(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,s=r.reverse?t.max:t.min,o=dE(n,t,s),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,s);return new gb({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 Gc(e,t,n){const r=pE(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=J2(i,g);r&&o.points.length&&(Wu(e,n),SE(e,{line:o,target:r,above:f,below:h,area:n,scale:a,axis:l,clip:m}),Qu(e))}function SE(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"?(my(e,r,o.top),Kc(e,{line:n,target:r,color:i,scale:a,property:u,clip:l}),e.restore(),e.save(),my(e,r,o.bottom)):u==="y"&&(py(e,r,o.left),Kc(e,{line:n,target:r,color:s,scale:a,property:u,clip:l}),e.restore(),e.save(),py(e,r,o.right),c=i)),Kc(e,{line:n,target:r,color:c,scale:a,property:u,clip:l}),e.restore()}function my(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[Ju(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 py(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[Ju(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 Kc(e,t){const{line:n,target:r,property:i,color:s,scale:o,clip:a}=t,l=sE(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,CE(e,o,a,g&&Wd(i,d,f)),e.beginPath();const m=!!n.pathSegment(e,u);let p;if(g){m?e.closePath():vy(e,r,f,i);const v=!!r.pathSegment(e,c,{move:m,reverse:!0});p=m&&v,p||vy(e,r,d,i)}e.closePath(),e.fill(p?"evenodd":"nonzero"),e.restore()}}function CE(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 vy(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var _E={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 Qr&&(l={visible:e.isDatasetVisible(o),index:o,fill:lE(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=aE(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&&Gc(e.ctx,a,s))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let i=r.length-1;i>=0;--i){const s=r[i].$filler;yy(s)&&Gc(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!yy(r)||n.drawTime!=="beforeDatasetDraw"||Gc(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const by=(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)}},kE=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class xy extends Xi{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}=by(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}=OE(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=gs(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;Wu(t,this),this._draw(),Qu(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:s,labels:o}=t,a=ct.color,l=gs(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}=by(o,d),v=function(k,x,_){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;i.save();const O=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=O,i.strokeStyle=Le(_.strokeStyle,a),i.setLineDash(Le(_.lineDash,[])),o.usePointStyle){const E={radius:m*Math.SQRT2/2,pointStyle:_.pointStyle,rotation:_.rotation,borderWidth:O},T=l.xPlus(k,g/2),M=x+f;q2(i,E,T,M,o.pointStyleWidth&&g)}else{const E=x+Math.max((d-m)/2,0),T=l.leftForLtr(k,g),M=hs(_.borderRadius);i.beginPath(),Object.values(M).some(B=>B!==0)?fu(i,{x:T,y:E,w:g,h:m,radius:M}):i.rect(T,E,g,m),i.fill(),O!==0&&i.stroke()}i.restore()},b=function(k,x,_){Hi(i,_.text,k,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},W2(this.ctx,t.textDirection);const w=p+c;this.legendItems.forEach((k,x)=>{i.strokeStyle=k.fontColor,i.fillStyle=k.fontColor;const _=i.measureText(k.text).width,O=l.textAlign(k.textAlign||(k.textAlign=o.textAlign)),E=g+f+_;let T=h.x,M=h.y;l.setWidth(this.width),S?x>0&&T+E+c>this.right&&(M=h.y+=w,h.line++,T=h.x=Ot(s,this.left+c,this.right-r[h.line])):x>0&&M+w>this.bottom&&(T=h.x=T+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(T);if(v(B,M,k),T=w9(O,T+g+f,S?T+E:this.right,t.rtl),b(l.x(T),M,k),S)h.x+=E+c;else if(typeof k.text!="string"){const R=u.lineHeight;h.y+=yb(k,R)+c}else h.y+=w}),Q2(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=gs(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(Gf(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=r.string,Hi(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(fs(t,this.left,this.right)&&fs(n,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(i=s[r],fs(t,i.left,i.left+i.width)&&fs(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!TE(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,s=kE(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 OE(e,t,n,r,i){const s=EE(r,e,t,n),o=AE(i,r,t.lineHeight);return{itemWidth:s,itemHeight:o}}function EE(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 AE(e,t,n){let r=e;return typeof t.text!="string"&&(r=yb(t,n)),r}function yb(e,t){const n=e.text?e.text.length:0;return t*n}function TE(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var PE={id:"legend",_element:xy,start(e,t,n){const r=e.legend=new xy({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 mb extends Xi{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);Hi(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:u,textAlign:Gf(n.align),textBaseline:"middle",translation:[o,a]})}}function jE(e,t){const n=new mb({ctx:e.ctx,options:t,chart:e});wn.configure(e,n,t),wn.addBox(e,n),e.titleBlock=n}var ME={id:"title",_element:mb,start(e,t,n){jE(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 Fo={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=zd(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 dr(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
66
66
  `)>-1?e.split(`
67
67
  `):e}function $E(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 wy(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 LE(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function DE(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 IE(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"),DE(u,e,t,n)&&(u="center"),u}function Sy(e,t,n){const r=n.yAlign||t.yAlign||LE(e,n);return{xAlign:n.xAlign||t.xAlign||IE(e,t,n,r),yAlign:r}}function RE(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function NE(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function Cy(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}=hs(o);let g=RE(t,a);const m=NE(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 kl(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 _y(e){return Gn([],dr(e))}function FE(e,t,n){return ui(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function ky(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const pb={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 Nt(e,t,n,r){const i=e[t].call(n,r);return typeof i=="undefined"?pb[t].call(n,r):i}class Qd extends Xi{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 eb(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=FE(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=Nt(r,"beforeTitle",this,t),s=Nt(r,"title",this,t),o=Nt(r,"afterTitle",this,t);let a=[];return a=Gn(a,dr(i)),a=Gn(a,dr(s)),a=Gn(a,dr(o)),a}getBeforeBody(t,n){return _y(Nt(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return Qe(t,s=>{const o={before:[],lines:[],after:[]},a=ky(r,s);Gn(o.before,dr(Nt(a,"beforeLabel",this,s))),Gn(o.lines,Nt(a,"label",this,s)),Gn(o.after,dr(Nt(a,"afterLabel",this,s))),i.push(o)}),i}getAfterBody(t,n){return _y(Nt(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=Nt(r,"beforeFooter",this,t),s=Nt(r,"footer",this,t),o=Nt(r,"afterFooter",this,t);let a=[];return a=Gn(a,dr(i)),a=Gn(a,dr(s)),a=Gn(a,dr(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($E(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=ky(t.callbacks,c);i.push(Nt(d,"labelColor",this,c)),s.push(Nt(d,"labelPointStyle",this,c)),o.push(Nt(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=Fo[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=wy(this,r),u=Object.assign({},a,l),c=Sy(this.chart,r,u),d=Cy(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}=hs(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=gs(r.rtl,this.x,this.width);for(t.x=kl(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=kl(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,Ud(t,m,p,v),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Ud(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=hs(o.borderRadius);Object.values(v).some(b=>b!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,fu(t,{x:m,y:g,w:u,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),fu(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=gs(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,k,x;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=kl(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,k=i.length;C<k;++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=gs(r.rtl,this.x,this.width);for(t.x=kl(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}=hs(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=Fo[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=wy(this,t),l=Object.assign({},o,this._size),u=Sy(n,t,l),c=Cy(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),W2(t,n.textDirection),s.y+=o.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),Q2(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=!au(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||!au(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=Fo[s.position].call(this,t,n);return o!==!1&&(r!==o.x||i!==o.y)}}pe(Qd,"positioners",Fo);var BE={id:"tooltip",_element:Qd,positioners:Fo,afterInit(e,t,n){n&&(e.tooltip=new Qd({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:pb},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 qE=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function zE(e,t,n,r){const i=e.indexOf(t);if(i===-1)return qE(e,t,n,r);const s=e.lastIndexOf(t);return i!==s?n:i}const HE=(e,t)=>e===null?null:xn(Math.round(e),0,t);function Oy(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Yd extends oo{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:zE(r,t,Le(n,t),this._addedLabels),HE(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 Oy.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(Yd,"id","category"),pe(Yd,"defaults",{ticks:{callback:Oy}});function UE(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=Eg((p-m)/g/h)*h,k,x,_,O;if(w<1e-14&&!v&&!b)return[{value:m},{value:p}];O=Math.ceil(p/w)-Math.floor(m/w),O>g&&(w=Eg(O*w/g/h)*h),Ye(l)||(k=Math.pow(10,l),w=Math.ceil(w*k)/k),i==="ticks"?(x=Math.floor(m/w)*w,_=Math.ceil(p/w)*w):(x=m,_=p),v&&b&&s&&d9((a-o)/s,w/1e3)?(O=Math.round(Math.min((a-o)/w,c)),w=(a-o)/O,x=o,_=a):S?(x=v?o:x,_=b?a:_,O=u-1,w=(_-x)/O):(O=(_-x)/w,Qo(O,Math.round(O),w/1e3)?O=Math.round(O):O=Math.ceil(O));const E=Math.max(Ag(w),Ag(x));k=Math.pow(10,Ye(l)?E:l),x=Math.round(x*k)/k,_=Math.round(_*k)/k;let T=0;for(v&&(f&&x!==o?(n.push({value:o}),x<o&&T++,Qo(Math.round((x+T*w)*k)/k,o,Ey(o,C,e))&&T++):x<o&&T++);T<O;++T){const M=Math.round((x+T*w)*k)/k;if(b&&M>a)break;n.push({value:M})}return b&&f&&_!==a?n.length&&Qo(n[n.length-1].value,a,Ey(a,C,e))?n[n.length-1].value=a:n.push({value:a}):(!b||_===a)&&n.push({value:_}),n}function Ey(e,t,{horizontal:n,minRotation:r}){const i=Wr(r),s=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(""+e).length;return Math.min(t/s,o)}class Xd extends oo{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=Ws(i),u=Ws(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=UE(i,s);return t.bounds==="ticks"&&f9(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 B2(t,this.chart.options.locale,this.options.ticks.format)}}class Zd extends Xd{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=Wr(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(Zd,"id","linear"),pe(Zd,"defaults",{ticks:{callback:Vf.formatters.numeric}});function Jd(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 GE(e,t,n){return n=ot(n)?n:[n],{w:L9(e,t.string,n),h:n.length*t.lineHeight}}function Ay(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 KE(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=GE(e.ctx,d,e._pointLabels[l]);r[l]=f;const h=sn(e.getIndexAngle(l)+a),g=Math.round(Hf(h)),m=Ay(g,c.x,f.w,0,180),p=Ay(g,c.y,f.h,90,270);VE(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=YE(e,r,i)}function VE(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 WE(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(Hf(sn(l.angle+ln))),c=JE(l.y,a.h,u),d=XE(u),f=ZE(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 QE(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:s}=e;return!(vr({x:n,y:r},t)||vr({x:n,y:s},t)||vr({x:i,y:r},t)||vr({x:i,y:s},t))}function YE(e,t,n){const r=[],i=e._pointLabels.length,s=e.options,{centerPointLabels:o,display:a}=s.pointLabels,l={extra:Jd(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=WE(e,c,l);r.push(d),a==="auto"&&(d.visible=QE(d,u),d.visible&&(u=d))}return r}function XE(e){return e===0||e===180?"center":e<180?"left":"right"}function ZE(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function JE(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function eA(e,t,n){const{left:r,top:i,right:s,bottom:o}=n,{backdropColor:a}=t;if(!Ye(a)){const l=hs(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(),fu(e,{x:c,y:d,w:f,h,radius:l}),e.fill()):e.fillRect(c,d,f,h)}}function tA(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));eA(n,o,s);const a=mt(o.font),{x:l,y:u,textAlign:c}=s;Hi(n,e._pointLabels[i],l,u+a.lineHeight/2,a,{color:o.color,textAlign:c,textBaseline:"middle"})}}function vb(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 nA(e,t,n,r,i){const s=e.ctx,o=t.circular,{color:a,lineWidth:l}=t;!o&&!r||!a||!l||n<0||(s.save(),s.strokeStyle=a,s.lineWidth=l,s.setLineDash(i.dash||[]),s.lineDashOffset=i.dashOffset,s.beginPath(),vb(e,n,o,r),s.closePath(),s.stroke(),s.restore())}function rA(e,t,n){return ui(e,{label:n,index:t,type:"pointLabel"})}class Bo extends Xd{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(Jd(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/Jd(this.options))}generateTickLabels(t){Xd.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?KE(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+Wr(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 rA(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(),vb(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:i,border:s}=n,o=this._pointLabels.length;let a,l,u;if(n.pointLabels.display&&tA(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);nA(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)}Hi(t,a.label,0,-s,c,{color:u.color,strokeColor:u.textStrokeColor,strokeWidth:u.textStrokeWidth})}),t.restore()}drawTitle(){}}pe(Bo,"id","radialLinear"),pe(Bo,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Vf.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),pe(Bo,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),pe(Bo,"descriptors",{angleLines:{_fallback:"grid"}});const ec={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}},zt=Object.keys(ec);function Ty(e,t){return e-t}function Py(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"&&(pa(s)||s===!0)?n.startOf(o,"isoWeek",s):n.startOf(o,i)),+o)}function jy(e,t,n,r){const i=zt.length;for(let s=zt.indexOf(e);s<i-1;++s){const o=ec[zt[s]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-t)/(a*o.size))<=r)return zt[s]}return zt[i-1]}function iA(e,t,n,r,i){for(let s=zt.length-1;s>=zt.indexOf(n);s--){const o=zt[s];if(ec[o].common&&e._adapter.diff(i,r,o)>=t-1)return o}return zt[n?zt.indexOf(n):0]}function sA(e){for(let t=zt.indexOf(e)+1,n=zt.length;t<n;++t)if(ec[zt[t]].common)return zt[t]}function My(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=Uf(n,t),s=n[r]>=t?n[r]:n[i];e[s]=!0}}function oA(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 $y(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:oA(e,r,i,n)}class yu extends oo{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 qk._date(t.adapters.date);i.init(n),Wo(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:Py(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=p9(i,s,o);return this._unit=n.unit||(r.autoSkip?jy(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):iA(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:sA(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),$y(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||jy(s.minUnit,n,r,this._getLabelCapacity(n)),a=Le(i.ticks.stepSize,1),l=o==="week"?s.isoWeekday:!1,u=pa(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++)My(c,f,g);return(f===r||i.bounds==="ticks"||h===1)&&My(c,f,g),Object.keys(c).sort(Ty).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=Wr(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,$y(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(Py(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return b9(t.sort(Ty))}}pe(yu,"id","time"),pe(yu,"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 Ol(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}=Ci(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}=Ci(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 Ly extends yu{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=Ol(n,this.min),this._tableRange=Ol(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(Ol(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Ol(this._table,r*this._tableRange+this._minPos,!0)}}pe(Ly,"id","timeseries"),pe(Ly,"defaults",yu.defaults);const bb="label";function Dy(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function aA(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function xb(e,t){e.labels=t}function wb(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:bb;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 lA(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:bb;const n={labels:[],datasets:[]};return xb(n,e.labels),wb(n,e.datasets,t),n}function uA(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=q.useRef(null),g=q.useRef(null),m=()=>{h.current&&(g.current=new Zu(h.current,{type:o,data:lA(a,s),options:l&&{...l},plugins:u}),Dy(t,g.current))},p=()=>{Dy(t,null),g.current&&(g.current.destroy(),g.current=null)};return q.useEffect(()=>{!i&&g.current&&l&&aA(g.current,l)},[i,l]),q.useEffect(()=>{!i&&g.current&&xb(g.current.config.data,a.labels)},[i,a.labels]),q.useEffect(()=>{!i&&g.current&&a.datasets&&wb(g.current.config.data,a.datasets,s)},[i,a.datasets]),q.useEffect(()=>{g.current&&(i?(p(),setTimeout(m)):g.current.update(d))},[i,l,a.labels,a.datasets,d]),q.useEffect(()=>{g.current&&(p(),setTimeout(m))},[o]),q.useEffect(()=>(m(),()=>p()),[]),q.createElement("canvas",{ref:h,role:"img",height:n,width:r,...f},c)}const cA=q.forwardRef(uA);function Sb(e,t){return Zu.register(t),q.forwardRef((n,r)=>q.createElement(cA,{...n,ref:r,type:e}))}const dA=Sb("line",Bl),fA=Sb("radar",ql);Zu.register(Yd,Zd,Bo,Qr,Ul,_E,ME,BE,PE);var ef={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}},hA=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 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 Ry(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){gA(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 gA(e,t,n){return(t=yA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yA(e){var t=mA(e,"string");return Xs(t)=="symbol"?t:t+""}function mA(e,t){if(Xs(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Xs(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xs(e){"@babel/helpers - typeof";return Xs=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},Xs(e)}function pA(e){var t=new Date(e);return isNaN(t.getTime())?String(e):t.toLocaleString("en-US",{month:"short",day:"numeric"})}var vA=function(){var t,n,r,i,s=li(),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&&Xs(d.labels)==="object"?Object.values(d.labels):[],h=f.map(function(v){return pA(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=Ry(Ry({},ef),{},{responsive:!0,maintainAspectRatio:!1,scales:{x:{display:!0,title:{display:!1,text:"Date"},grid:{display:!1}},y:{display:!0,title:{display:!1,text:"Number of Mentions"},beginAtZero:!0,max:g,ticks:{stepSize:1}}}});return y.jsx(A.Card,{className:"yst-overflow-visible",children:y.jsxs(A.Card.Content,{className:"yst-space-y-4",children:[y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(Va,{title:"Mentions progress",tooltip:"Tracks how your brand mentions have changed over time across the same query set."}),y.jsx(Ka,{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(A.Alert,{variant:"info",children:"One more analysis needed to show more insights."}):y.jsx("div",{className:"yst-h-72",children:y.jsx(dA,{data:function(){var v={labels:h,datasets:[d==null?void 0:d.datasets]};return v}(),options:p})})]})})};function El(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",ua(c)),children:[c>0?y.jsx(m2,{}):c<0?y.jsx(y2,{}):null,c>-1e-6&&"+",c]}),i&&y.jsx(Rf,{id:"tooltip-".concat(r.replace(/\s+/g,"-").toLowerCase()),className:"yst-absolute yst-right-2 yst-top-2",position:f,children:i})]})}function bA(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 xA(e){return e>0?"yst-text-green-600":e<0?"yst-text-red-600":"yst-text-slate-500"}function wA(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",xA(i),r),"aria-label":s?"Visibility increased by ".concat(a):o?"Visibility decreased by ".concat(a):"No change in visibility",children:[s&&y.jsx(m2,{className:"yst-w-4 yst-h-4"}),o&&y.jsx(y2,{className:"yst-w-4 yst-h-4"}),a]})}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 SA(e,t){return OA(e)||kA(e,t)||_A(e,t)||CA()}function CA(){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 _A(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 kA(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 OA(e){if(Array.isArray(e))return e}function Fy(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 Al(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Fy(Object(n),!0).forEach(function(r){EA(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function EA(e,t,n){return(t=AA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AA(e){var t=TA(e,"string");return ba(t)=="symbol"?t:t+""}function TA(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 PA(){var e,t,n,r,i,s,o,a,l,u,c,d,f,h,g,m,p,v,b,S,C,w,k,x,_=Nn(),O=_.brandId,E=_.analysisId,T=Fu(O,E,{query:{select:function(Fe){var Z=Fe.data;return Z},enabled:!!O&&!!E}}),M=T.data,B=T.isLoading,R=M==null||(e=M.analysis)===null||e===void 0?void 0:e.scans,j=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 Z=new Date(Fe.finishedAt),Te=new Date(Ne.finishedAt);return Z>Te?Fe:Ne},R[0]):void 0,P=j==null||(t=j.scores)===null||t===void 0?void 0:t.standardized,I=(n=j==null||(r=j.mentions)===null||r===void 0||(r=r.mentionedInNumberOfQueries)===null||r===void 0?void 0:r.value)!==null&&n!==void 0?n:0,G=j==null||(i=j.mentions)===null||i===void 0||(i=i.mentionedInNumberOfQueries)===null||i===void 0||(i=i.previous)===null||i===void 0?void 0:i.difference,V=(s=j==null||(o=j.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=j==null||(l=j.citations)===null||l===void 0||(l=l.total)===null||l===void 0?void 0:l.value)!==null&&a!==void 0?a:0,U=j==null||(u=j.citations)===null||u===void 0||(u=u.total)===null||u===void 0||(u=u.previous)===null||u===void 0?void 0:u.difference,z=j==null||(c=j.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}),Q=(d=z==null||(f=z.rank)===null||f===void 0?void 0:f.value)!==null&&d!==void 0?d:"—",N=z==null||(h=z.rank)===null||h===void 0||(h=h.previous)===null||h===void 0?void 0:h.difference;N&&(N=N*-1);var te=(g=P==null||(m=P.visibility)===null||m===void 0?void 0:m.value)!==null&&g!==void 0?g:0,J=P==null||(p=P.visibility)===null||p===void 0||(p=p.previous)===null||p===void 0?void 0:p.value,ge=(v=P==null||(b=P.ranking)===null||b===void 0?void 0:b.value)!==null&&v!==void 0?v:0,re=(S=P==null||(C=P.sentiment)===null||C===void 0?void 0:C.value)!==null&&S!==void 0?S:0,Se=(w=P==null||(k=P.mentions)===null||k===void 0?void 0:k.value)!==null&&w!==void 0?w:0,ye={labels:["Mentions","Ranking","Citations","Sentiment"],datasets:[{data:[Se,ge,V,re],backgroundColor:hA,pointBackgroundColor:"rgba(166, 30, 105, 1)"}]},ze=Al(Al({},ef),{},{plugins:Al(Al({},ef.plugins),{},{tooltip:{mode:"point",intersect:!0,callbacks:{label:function(Fe){var Z=Fe.label||"",Te=Fe.parsed.r||0;return"".concat(Z,": ").concat(Te,"%")}}}}),interaction:{mode:"point",intersect:!0},scales:{r:{beginAtZero:!0,min:0,max:100,ticks:{stepSize:20}}}}),le=q.useState(typeof window!="undefined"&&window.innerWidth<800?"top":"left"),He=SA(le,2),lt=He[0],dt=He[1];return q.useEffect(function(){function Ne(){dt(window.innerWidth<800?"top":"left")}return window.addEventListener("resize",Ne),function(){return window.removeEventListener("resize",Ne)}},[]),y.jsx(A.Card,{className:"yst-overflow-visible md:yst-col-span-2",children:y.jsxs(A.Card.Content,{children:[y.jsx(A.Title,{size:"3",className:"yst-mb-2",children:"AI visibility index (AIVI)"}),y.jsx(Ka,{score:te,total:100,isLoading:B}),y.jsx(wA,{current:te,previous:J,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(fA,{data:ye,options:ze}),y.jsx(Rf,{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(bA,{children:[y.jsx(El,{value:I,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:G,tooltipPosition:lt}),y.jsx(El,{value:Q&&y.jsxs(y.Fragment,{children:[Q,Q===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(El,{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(El,{value:re?"".concat(re,"%"):"—",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:j==null||(x=j.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 jA="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 MA=function(){var t,n=li(),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(A.Card,{className:"yst-overflow-visible md:yst-col-span-2 yst-text-slate-800",children:y.jsxs(A.Card.Content,{className:"yst-space-y-4 yst-max-w-2xl",children:[y.jsx(A.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 $A(e,t){return RA(e)||IA(e,t)||DA(e,t)||LA()}function LA(){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 _A(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 kA(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 OA(e){if(Array.isArray(e))return e}function Fy(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 Al(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Fy(Object(n),!0).forEach(function(r){EA(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function EA(e,t,n){return(t=AA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AA(e){var t=TA(e,"string");return ba(t)=="symbol"?t:t+""}function TA(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 PA(){var e,t,n,r,i,s,o,a,l,u,c,d,f,h,g,m,p,v,b,S,C,w,k,x,_=Nn(),O=_.brandId,E=_.analysisId,T=Fu(O,E,{query:{select:function(Fe){var Z=Fe.data;return Z},enabled:!!O&&!!E}}),M=T.data,B=T.isLoading,R=M==null||(e=M.analysis)===null||e===void 0?void 0:e.scans,j=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 Z=new Date(Fe.finishedAt),Te=new Date(Ne.finishedAt);return Z>Te?Fe:Ne},R[0]):void 0,P=j==null||(t=j.scores)===null||t===void 0?void 0:t.standardized,I=(n=j==null||(r=j.mentions)===null||r===void 0||(r=r.mentionedInNumberOfQueries)===null||r===void 0?void 0:r.value)!==null&&n!==void 0?n:0,G=j==null||(i=j.mentions)===null||i===void 0||(i=i.mentionedInNumberOfQueries)===null||i===void 0||(i=i.previous)===null||i===void 0?void 0:i.difference,W=(s=j==null||(o=j.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=j==null||(l=j.citations)===null||l===void 0||(l=l.total)===null||l===void 0?void 0:l.value)!==null&&a!==void 0?a:0,U=j==null||(u=j.citations)===null||u===void 0||(u=u.total)===null||u===void 0||(u=u.previous)===null||u===void 0?void 0:u.difference,z=j==null||(c=j.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}),V=(d=z==null||(f=z.rank)===null||f===void 0?void 0:f.value)!==null&&d!==void 0?d:"—",N=z==null||(h=z.rank)===null||h===void 0||(h=h.previous)===null||h===void 0?void 0:h.difference;N&&(N=N*-1);var te=(g=P==null||(m=P.visibility)===null||m===void 0?void 0:m.value)!==null&&g!==void 0?g:0,J=P==null||(p=P.visibility)===null||p===void 0||(p=p.previous)===null||p===void 0?void 0:p.value,ge=(v=P==null||(b=P.ranking)===null||b===void 0?void 0:b.value)!==null&&v!==void 0?v:0,re=(S=P==null||(C=P.sentiment)===null||C===void 0?void 0:C.value)!==null&&S!==void 0?S:0,Se=(w=P==null||(k=P.mentions)===null||k===void 0?void 0:k.value)!==null&&w!==void 0?w:0,ye={labels:["Mentions","Ranking","Citations","Sentiment"],datasets:[{data:[Se,ge,W,re],backgroundColor:hA,pointBackgroundColor:"rgba(166, 30, 105, 1)"}]},ze=Al(Al({},ef),{},{plugins:Al(Al({},ef.plugins),{},{tooltip:{mode:"point",intersect:!0,callbacks:{label:function(Fe){var Z=Fe.label||"",Te=Fe.parsed.r||0;return"".concat(Z,": ").concat(Te,"%")}}}}),interaction:{mode:"point",intersect:!0},scales:{r:{beginAtZero:!0,min:0,max:100,ticks:{stepSize:20}}}}),le=q.useState(typeof window!="undefined"&&window.innerWidth<800?"top":"left"),He=SA(le,2),lt=He[0],dt=He[1];return q.useEffect(function(){function Ne(){dt(window.innerWidth<800?"top":"left")}return window.addEventListener("resize",Ne),function(){return window.removeEventListener("resize",Ne)}},[]),y.jsx(A.Card,{className:"yst-overflow-visible md:yst-col-span-2",children:y.jsxs(A.Card.Content,{children:[y.jsx(A.Title,{size:"3",className:"yst-mb-2",children:"AI Visibility Index (AIVI)"}),y.jsx(Ka,{score:te,total:100,isLoading:B}),y.jsx(wA,{current:te,previous:J,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(fA,{data:ye,options:ze}),y.jsx(Rf,{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(bA,{children:[y.jsx(El,{value:I,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:G,tooltipPosition:lt}),y.jsx(El,{value:typeof V=="number"&&Number.isFinite(V)&&V>0?y.jsxs(y.Fragment,{children:["#",V,V===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(El,{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(El,{value:re?"".concat(re,"%"):"—",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:j==null||(x=j.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 jA="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 MA=function(){var t,n=li(),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(A.Card,{className:"yst-overflow-visible md:yst-col-span-2 yst-text-slate-800",children:y.jsxs(A.Card.Content,{className:"yst-space-y-4 yst-max-w-2xl",children:[y.jsx(A.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 $A(e,t){return RA(e)||IA(e,t)||DA(e,t)||LA()}function LA(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
69
69
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DA(e,t){if(e){if(typeof e=="string")return By(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)?By(e,t):void 0}}function By(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 IA(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 RA(e){if(Array.isArray(e))return e}var Vc=function(){var t=Nn(),n=t.brandId,r=t.analysisId,i=Yi({query:{select:function(_){var O=_.data;return O==null?void 0:O.brands}}}),s=i.data,o=i.isLoading,a=Fu(n,r,{query:{enabled:!!n&&I6(r),select:function(_){var O=_.data;return O==null?void 0:O.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===yi.completed,g=q.useState(!1),m=$A(g,2),p=m[0],v=m[1],b=q.useRef(null),S=q.useRef(void 0),C=localStorage.getItem("yst_congratulations_toast_seen")==="true";q.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 O=document.getElementById("toast-portal");return O?mx.createPortal(_,O):null}var k=function(_){var O=_.isVisible,E=_.setIsVisible,T=function(){E(!1)};return y.jsxs(A.Toast,{id:"toast",isVisible:O,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:jA}),y.jsxs("div",{className:"yst-grow",children:[y.jsx(A.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(A.Button,{variant:"tertiary",onClick:T,children:y.jsx(b2,{})})]}),y.jsxs("div",{className:"yst-flex yst-justify-end yst-gap-4",children:[y.jsx(A.Button,{variant:"tertiary",onClick:T,children:"Dismiss"}),y.jsxs(A.Button,{as:"a",href:"https://www.surveymonkey.com/r/HGSB8DL",target:"_blank",children:["Give feedback",y.jsx(v2,{className:"yst-ml-2"})]})]})]})};return o?y.jsx(Hu,{}):f?y.jsxs("div",{className:"yst-space-y-4",children:[y.jsx(P7,{}),h&&y.jsxs("div",{className:"yst-space-y-4",children:[y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-between",children:[y.jsx(A.Title,{size:"2",children:"Your brand analysis"}),y.jsxs(A.Button,{as:oi,variant:"secondary",to:"/brands/".concat(n,"/brand-list"),className:Oe("yst-gap-1.5"),disabled:!n,children:[y.jsx(h2,{})," Edit brand list"]})]}),y.jsxs("div",{className:"yst-grid yst-grid-cols-1 yst-gap-4 md:yst-grid-cols-2",children:[y.jsx(MA,{}),y.jsx(PA,{}),y.jsx(j7,{}),y.jsx(vA,{}),y.jsx(B_,{}),y.jsx(L_,{}),y.jsx(b_,{}),y.jsx(q_,{})]}),y.jsx(w,{children:y.jsx(k,{isVisible:p,setIsVisible:v})})]})]}):y.jsx(r_,{})};function Cb(e){var t=e.children,n=e.description,r=e.title;return y.jsxs(A.Card.Header,{className:"yst-h-auto yst-flex-col yst-items-start yst-gap-0 yst-border-b-[1px] yst-border-b-slate-200 yst-bg-white yst-py-8",children:[r&&y.jsx(A.Title,{className:Oe({"yst-mb-3":n||t}),children:r}),n&&y.jsx("p",{children:n}),t]})}var NA=function(){return y.jsx(A.Card,{className:"yst-mb-4",children:y.jsxs(A.Card.Content,{className:"yst-flex yst-flex-col yst-gap-8",children:[y.jsx(A.Title,{size:"2",children:"Query - Best fish restaurant in Nijmegen"}),y.jsxs("div",{children:[y.jsx("p",{children:"AI Response:"}),y.jsx(A.Link,{href:"#todo",children:"Show more"})]}),y.jsxs("div",{children:[y.jsx("p",{children:"Extracted brands:"}),y.jsx(A.Badge,{children:"Example"}),y.jsx(A.Badge,{children:"Example"}),y.jsx(A.Badge,{children:"Example"}),y.jsx(A.Badge,{children:"Example"}),y.jsx(A.Badge,{children:"Example"})]}),y.jsxs(A.Table,{children:[y.jsx(A.Table.Head,{children:y.jsxs(A.Table.Row,{children:[y.jsx(A.Table.Header,{children:"URL"}),y.jsx(A.Table.Header,{children:"Associated brand"})]})}),y.jsxs(A.Table.Body,{children:[y.jsxs(A.Table.Row,{children:[y.jsx(A.Table.Cell,{children:y.jsx(A.Link,{href:"https://example.com",target:"_blank",children:"https://example.com"})}),y.jsx(A.Table.Cell,{children:"Example Brand"})]}),y.jsxs(A.Table.Row,{children:[y.jsx(A.Table.Cell,{children:y.jsx(A.Link,{href:"https://example2.com",target:"_blank",children:"https://example2.com"})}),y.jsx(A.Table.Cell,{children:"Example Brand 2"})]})]})]})]})})},FA=function(){return y.jsxs(A.Card,{children:[y.jsx(Cb,{title:"Query history"}),y.jsx(A.Card,{className:"yst-mb-4",children:y.jsxs(A.Card.Content,{children:[y.jsxs("p",{className:"yst-mb-8",children:["Manna Fish Restaurant - Analysis performed on:"," ",y.jsx(A.Badge,{children:"2025-04-08 12:31:21"})]}),[0,1,2,3,4].map(function(t){return y.jsx(NA,{},t)})]})})]})},or=function(t){var n=t.title,r=It();return q.useEffect(function(){document.title=n},[r,n]),null},BA=q.lazy(function(){return Promise.resolve().then(()=>YL)}),qA=q.lazy(function(){return Promise.resolve().then(()=>_D)}),zA=q.lazy(function(){return Promise.resolve().then(()=>ED)}),HA=q.lazy(function(){return Promise.resolve().then(()=>qD)}),UA=q.lazy(function(){return Promise.resolve().then(()=>iI)}),GA=q.lazy(function(){return Promise.resolve().then(()=>cI)}),KA=new r3({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1,staleTime:1e3*60*5},mutations:{retry:!1}}}),ar=function(){return y.jsx("div",{className:"yst-flex yst-min-h-[200px] yst-items-center yst-justify-center",children:y.jsxs("div",{className:"yst-w-full yst-max-w-md yst-space-y-3",children:[y.jsx(A.SkeletonLoader,{className:"yst-h-8 yst-w-3/4"}),y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-full"}),y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-2/3"})]})})},VA=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(M6,{hideNav:r,disableLayout:s,DebugInfo:o}),children:[y.jsxs(_t,{path:"/",element:y.jsx(Gs,{}),children:[y.jsx(_t,{index:!0,element:y.jsxs(q.Suspense,{fallback:y.jsx(ar,{}),children:[y.jsx(or,{title:"AI Brand Insights"}),y.jsx(Vc,{})]})}),y.jsxs(_t,{path:"brands/:brandId",element:y.jsx(D0,{}),children:[y.jsx(_t,{index:!0,element:y.jsx(Vc,{})}),y.jsx(_t,{path:"brand-list",element:y.jsxs(q.Suspense,{fallback:y.jsx(ar,{}),children:[y.jsx(or,{title:"Brands - AI Brand Insights"}),y.jsx(BA,{})]})}),y.jsx(_t,{path:"analysis/:analysisId",element:y.jsx($6,{}),children:y.jsx(_t,{index:!0,element:y.jsxs(q.Suspense,{fallback:y.jsx(ar,{}),children:[y.jsx(or,{title:"Analysis - AI Brand Insights"}),y.jsx(Vc,{})]})})})]}),y.jsxs(_t,{path:"/setup",element:y.jsxs(q.Suspense,{fallback:y.jsx(ar,{}),children:[y.jsx(or,{title:"Setup brand - AI Brand Insights"}),y.jsx(zA,{})]}),children:[y.jsx(_t,{index:!0,element:y.jsxs(q.Suspense,{fallback:y.jsx(ar,{}),children:[y.jsx(or,{title:"AI Brand Insights"}),y.jsx(HA,{})]})}),y.jsxs(_t,{path:":brandId",element:y.jsx(D0,{}),children:[y.jsx(_t,{path:"queries",element:y.jsxs(q.Suspense,{fallback:y.jsx(ar,{}),children:[y.jsx(or,{title:"Setup queries - AI Brand Insights"}),y.jsx(UA,{})]})}),y.jsx(_t,{path:"analysis",element:y.jsxs(q.Suspense,{fallback:y.jsx(ar,{}),children:[y.jsx(or,{title:"Analysis - AI Brand Insights"}),y.jsx(GA,{})]})})]})]})]}),y.jsx(_t,{path:"/settings",element:y.jsxs(q.Suspense,{fallback:y.jsx(ar,{}),children:[y.jsx(or,{title:"Settings - AI Brand Insights"}),y.jsx(qA,{})]})}),y.jsx(_t,{path:"/query-history",element:y.jsxs(q.Suspense,{fallback:y.jsx(ar,{}),children:[y.jsx(or,{title:"Query history - AI Brand Insights"}),y.jsx(FA,{})]})})]})})},WA=function(t){var n=t.DebugInfo,r=t.hostAppProps;return y.jsxs(l3,{client:KA,children:[y.jsx(L4,{hostAppProps:r,children:y.jsx(VA,{DebugInfo:n})}),y.jsx(QS,{initialIsOpen:!1})]})};function QA(e){var t=e.subpath,n=t===void 0?"/":t,r=e.onNavigate,i=fn(),s=It(),o=q.useRef(n),a=q.useRef(null),l=q.useRef(!1),u="".concat(s.pathname).concat(s.search).concat(s.hash),c=q.useCallback(r,[r]);return q.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]),q.useEffect(function(){l.current||u!==n&&u!==a.current&&(a.current=u,c(u))},[u,n,c]),null}function YA(e,t){return eT(e)||JA(e,t)||ZA(e,t)||XA()}function XA(){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 ZA(e,t){if(e){if(typeof e=="string")return qy(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)?qy(e,t):void 0}}function qy(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 JA(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 eT(e){if(Array.isArray(e))return e}var tT=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(T,M){var B=T.endsWith("/")?T.slice(0,-1):T,R=M.startsWith("/")?M:"/".concat(M);return B+R||"/"},w=q.useState(!!(a||l)),k=YA(w,2),x=k[0],_=k[1],O={onAddSubscription:S,onLogout:v,onNavigate:m,DebugInfo:u,basename:d,subpath:h};return q.useEffect(function(){l&&s2(l),j5(typeof a!="function"?function(){return a}:a),_(!1)},[l,a]),x?y.jsx("div",{className:i,style:s,children:y.jsx(A.Spinner,{})}):y.jsx("div",{className:i,style:s,children:y.jsxs(aw,{initialEntries:[C(d,h)],basename:d||"/",children:[y.jsx(QA,{subpath:h,onNavigate:m}),y.jsx(A.Root,{context:{isRtl:r},children:y.jsx(WA,{DebugInfo:u,hostAppProps:O})})]})})},nT=e=>e!=null,rT=e=>e.filter(nT);function iT(e){return(...t)=>{for(const n of e)n&&n(...t)}}var ee=e=>typeof e=="function"&&!e.length?e():e,tf=e=>Array.isArray(e)?e:e?[e]:[];function sT(e,...t){return typeof e=="function"?e(...t):e}var oT=_e;function aT(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 lT(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&&kr(()=>{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 _b=lT,uT=e=>(typeof e.clear=="function"||(e.clear=()=>{let t;for(;t=e.key(0);)e.removeItem(t)}),e),zy=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=uT({_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}${zy(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${zy({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}}),cT=1024,Ui=796,eh=700,dT="bottom-right",nf="bottom",kb="system",fT=!1,Ob=500,hT=500,Eb=500,gT=Object.keys(Od)[0],Hy=1,yT=Object.keys(Ed)[0],th=wt({client:void 0,onlineManager:void 0,queryFlavor:"",version:"",shadowDOMTarget:void 0});function me(){return St(th)}var Ab=wt(void 0),Tb=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)}),[...(me().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)}}),Pu(["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||hT))}),xe(()=>{const o=(me().shadowDOMTarget||document).querySelector("#_goober"),a=t();if(o&&a){const l=new MutationObserver(()=>{const u=(me().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 L(Ab.Provider,{value:s,get children(){return e.children}})},nh=()=>K(()=>{const t=St(Ab);if(!t)throw new Error("usePiPWindow must be used within a PiPProvider");return t()}),rh=wt(()=>"dark");function xt(){return St(rh)}var Pb={À:"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"},mT=Object.keys(Pb).join("|"),pT=new RegExp(mT,"g");function vT(e){return e.replace(pT,t=>Pb[t])}var qt={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function Uy(e,t,n){var r;if(n=n||{},n.threshold=(r=n.threshold)!=null?r:qt.MATCHES,!n.accessors){const o=Gy(e,t,n);return{rankedValue:e,rank:o,accessorIndex:-1,accessorThreshold:n.threshold,passed:o>=n.threshold}}const i=ST(e,n.accessors),s={rankedValue:e,rank:qt.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let o=0;o<i.length;o++){const a=i[o];let l=Gy(a.itemValue,t,n);const{minRanking:u,maxRanking:c,threshold:d=n.threshold}=a.attributes;l<u&&l>=qt.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 Gy(e,t,n){return e=Ky(e,n),t=Ky(t,n),t.length>e.length?qt.NO_MATCH:e===t?qt.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?qt.EQUAL:e.startsWith(t)?qt.STARTS_WITH:e.includes(` ${t}`)?qt.WORD_STARTS_WITH:e.includes(t)?qt.CONTAINS:t.length===1?qt.NO_MATCH:bT(e).includes(t)?qt.ACRONYM:xT(e,t))}function bT(e){let t="";return e.split(" ").forEach(r=>{r.split("-").forEach(s=>{t+=s.substr(0,1)})}),t}function xT(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 qt.MATCHES+c*u}const o=i(t[0],e,0);if(o<0)return qt.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 qt.NO_MATCH}const a=r-o;return s(a)}function Ky(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=vT(e)),e}function wT(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 ST(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const s=t[r],o=CT(s),a=wT(e,s);for(let l=0,u=a.length;l<u;l++)n.push({itemValue:a[l],attributes:o})}return n}var Vy={maxRanking:1/0,minRanking:-1/0};function CT(e){return typeof e=="function"?Vy:{...Vy,...e}}var _T={data:""},kT=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||_T,OT=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,ET=/\/\*[^]*?\*\/| +/g,Wy=/\n+/g,bi=(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"?bi(o,s):s+"{"+bi(o,s[1]=="k"?"":t)+"}":typeof o=="object"?r+=bi(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+=bi.p?bi.p(s,o):s+":"+o+";")}return n+(t&&i?t+"{"+i+"}":i)+r},lr={},jb=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+jb(e[n]);return t}return e},AT=(e,t,n,r,i)=>{let s=jb(e),o=lr[s]||(lr[s]=(l=>{let u=0,c=11;for(;u<l.length;)c=101*c+l.charCodeAt(u++)>>>0;return"go"+c})(s));if(!lr[o]){let l=s!==e?e:(u=>{let c,d,f=[{}];for(;c=OT.exec(u.replace(ET,""));)c[4]?f.shift():c[3]?(d=c[3].replace(Wy," ").trim(),f.unshift(f[0][d]=f[0][d]||{})):f[0][c[1]]=c[2].replace(Wy," ").trim();return f[0]})(e);lr[o]=bi(i?{["@keyframes "+o]:l}:l,n?"":"."+o)}let a=n&&lr.g?lr.g:null;return n&&(lr.g=lr[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)})(lr[o],t,r,a),o},TT=(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?"":bi(a,""):a===!1?"":a}return r+i+(o==null?"":o)},"");function Me(e){let t=this||{},n=e.call?e(t.p):e;return AT(n.unshift?n.raw?TT(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,kT(t.target),t.g,t.o,t.k)}Me.bind({g:1});Me.bind({k:1});function Mb(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=Mb(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=Mb(e))&&(r&&(r+=" "),r+=t);return r}function PT(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[Eu],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 Rt(...e){return iT(e)}var Qy=e=>e instanceof Element;function rf(e,t){if(t(e))return e;if(typeof e=="function"&&!e.length)return rf(e(),t);if(Array.isArray(e)){const n=[];for(const r of e){const i=rf(r,t);i&&(Array.isArray(i)?n.push.apply(n,i):n.push(i))}return n.length?n:null}return null}function jT(e,t=Qy,n=Qy){const r=K(e),i=K(()=>rf(r(),t));return i.toArray=()=>{const s=i();return Array.isArray(s)?s:s?[s]:[]},i}function MT(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 $b(e){requestAnimationFrame(()=>requestAnimationFrame(e))}function $T(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())}),$b(()=>{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 LT(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()),$b(()=>{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 Yy=e=>{const t=MT(e);return PT(jT(()=>e.children).toArray,{appear:e.appear,onChange({added:n,removed:r,finishRemoved:i,list:s}){const o=t();for(const l of n)$T(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)LT(o,e,l,()=>i([l]))}})},Wc=Symbol("fallback");function Xy(e){for(const t of e)t.dispose()}function DT(e,t,n,r={}){const i=new Map;return _e(()=>Xy(i.values())),()=>{const o=e()||[];return o[Eu],at(()=>{var c,d;if(!o.length)return Xy(i.values()),i.clear(),r.fallback?[wr(h=>(i.set(Wc,{dispose:h}),r.fallback()))]:[];const a=new Array(o.length),l=i.get(Wc);if(!i.size||l){l==null||l.dispose(),i.delete(Wc);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){wr(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 mu(e){const{by:t}=e;return K(DT(()=>e.each,typeof t=="function"?t:n=>n[t],e.children,"fallback"in e?{fallback:()=>e.fallback}:void 0))}function IT(e,t,n,r){return e.addEventListener(t,n,r),oT(e.removeEventListener.bind(e,t,n,r))}function RT(e,t,n,r){const i=()=>{tf(ee(e)).forEach(s=>{s&&tf(ee(t)).forEach(o=>IT(s,o,n,r))})};typeof e=="function"?xe(i):be(i)}function NT(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 Lb(e,t,n){const r=new WeakMap,{observe:i,unobserve:s}=NT(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=rT(tf(ee(e)));return aT(a,o,i,s),a},[])}var FT=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function Zy(e){const t={};let n;for(;n=FT.exec(e);)t[n[1]]=n[2];return t}function tc(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=Zy(e)}else typeof t=="string"&&(t=Zy(t));return{...e,...t}}function BT(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function sf(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function qT(e){return typeof e=="number"}function as(e){return Object.prototype.toString.call(e)==="[object String]"}function zT(e){return typeof e=="function"}function Xa(e){return t=>`${e()}-${t}`}function Sn(e,t){return e?e===t||e.contains(t):!1}function qo(e,t=!1){const{activeElement:n}=tr(e);if(!(n!=null&&n.nodeName))return null;if(Db(n)&&n.contentDocument)return qo(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 HT(e){return tr(e).defaultView||window}function tr(e){return e?e.ownerDocument||e:document}function Db(e){return e.tagName==="IFRAME"}var ih=(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))(ih||{});function sh(e){var t;return typeof window!="undefined"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)==null?void 0:t.platform)||window.navigator.platform):!1}function nc(){return sh(/^Mac/i)}function UT(){return sh(/^iPhone/i)}function GT(){return sh(/^iPad/i)||nc()&&navigator.maxTouchPoints>1}function KT(){return UT()||GT()}function VT(){return nc()||KT()}function nt(e,t){return t&&(zT(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 WT(e){return nc()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function At(e){if(e)if(QT())e.focus({preventScroll:!0});else{const t=YT(e);e.focus(),XT(t)}}var Tl=null;function QT(){if(Tl==null){Tl=!1;try{document.createElement("div").focus({get preventScroll(){return Tl=!0,!0}})}catch(e){}}return Tl}function YT(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 XT(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var Ib=["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'])"],ZT=[...Ib,'[tabindex]:not([tabindex="-1"]):not([disabled])'],oh=Ib.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",JT=ZT.join(':not([hidden]):not([tabindex="-1"]),');function Rb(e,t){const r=Array.from(e.querySelectorAll(oh)).filter(Jy);return t&&Jy(e)&&r.unshift(e),r.forEach((i,s)=>{if(Db(i)&&i.contentDocument){const o=i.contentDocument.body,a=Rb(o,!1);r.splice(s,1,...a)}}),r}function Jy(e){return Nb(e)&&!eP(e)}function Nb(e){return e.matches(oh)&&ah(e)}function eP(e){return parseInt(e.getAttribute("tabindex")||"0",10)<0}function ah(e,t){return e.nodeName!=="#comment"&&tP(e)&&nP(e,t)&&(!e.parentElement||ah(e.parentElement,e))}function tP(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 nP(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function rP(e,t,n){const r=t!=null&&t.tabbable?JT:oh,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)&&ah(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 em(e){for(;e&&!iP(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function iP(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function sP(){}function oP(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 Ao=new Map,tm=new Set;function nm(){if(typeof window=="undefined")return;const e=n=>{if(!n.target)return;let r=Ao.get(n.target);r||(r=new Set,Ao.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=Ao.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Ao.delete(n.target)),Ao.size===0)){for(const i of tm)i();tm.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document!="undefined"&&(document.readyState!=="loading"?nm():document.addEventListener("DOMContentLoaded",nm));function of(e,t){const n=rm(e,t,"left"),r=rm(e,t,"top"),i=t.offsetWidth,s=t.offsetHeight;let o=e.scrollLeft,a=e.scrollTop;const l=o+e.offsetWidth,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 rm(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){i-=e[r];break}t=t.offsetParent}return i}function aP(e,t){var n,r;if(document.contains(e)){const i=document.scrollingElement||document.documentElement;if(window.getComputedStyle(i).overflow==="hidden"){let o=em(e);for(;e&&o&&e!==i&&o!==i;)of(o,e),e=o,o=em(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 Fb={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 rc(e,t){const[n,r]=ce(im(t==null?void 0:t()));return xe(()=>{var i;r(((i=e())==null?void 0:i.tagName.toLowerCase())||im(t==null?void 0:t()))}),n}function im(e){return as(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 L(lS,Ae(n,{get component(){return t.as}}))}var lP=["id","name","validationState","required","disabled","readOnly"];function uP(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":ee(n.validationState)==="valid"?"":void 0,"data-invalid":ee(n.validationState)==="invalid"?"":void 0,"data-required":ee(n.required)?"":void 0,"data-disabled":ee(n.disabled)?"":void 0,"data-readonly":ee(n.readOnly)?"":void 0}));return{formControlContext:{name:()=>{var m;return(m=ee(n.name))!=null?m:ee(n.id)},dataset:h,validationState:()=>ee(n.validationState),isRequired:()=>ee(n.required),isDisabled:()=>ee(n.disabled),isReadOnly:()=>ee(n.readOnly),labelId:r,fieldId:s,descriptionId:a,errorMessageId:u,getAriaLabelledBy:d,getAriaDescribedBy:f,generateId:Xa(()=>ee(n.id)),registerLabel:Cn(i),registerField:Cn(o),registerDescription:Cn(l),registerErrorMessage:Cn(c)}}}var Bb=wt();function Za(){const e=St(Bb);if(e===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function qb(e){const t=Za(),n=Re({id:t.generateId("description")},e);return xe(()=>_e(t.registerDescription(n.id))),L(st,Ae({as:"div"},()=>t.dataset(),n))}function zb(e){const t=Za(),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))}),L(ve,{get when(){return r.forceMount||s()},get children(){return L(st,Ae({as:"div"},()=>t.dataset(),i))}})}function cP(e){let t;const n=Za(),r=Re({id:n.generateId("label")},e),[i,s]=Ve(r,["ref"]),o=rc(()=>t,()=>"label");return xe(()=>_e(n.registerLabel(s.id))),L(st,Ae({as:"label",ref(a){const l=Rt(u=>t=u,i.ref);typeof l=="function"&&l(a)},get for(){return K(()=>o()==="label")()?n.fieldId():void 0}},()=>n.dataset(),s))}function dP(e,t){xe(_r(e,n=>{if(n==null)return;const r=fP(n);r!=null&&(r.addEventListener("reset",t,{passive:!0}),_e(()=>{r.removeEventListener("reset",t)}))}))}function fP(e){return hP(e)?e.form:e.closest("form")}function hP(e){return e.matches("textarea, input, select, button")}function Ja(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=sT(a,i());return Object.is(l,i())||(r()||n(l),(u=e.onChange)==null||u.call(e,l)),l})}]}function Hb(e){const[t,n]=Ja(e);return[()=>{var i;return(i=t())!=null?i:!1},n]}function gP(e){const[t,n]=Ja(e);return[()=>{var i;return(i=t())!=null?i:[]},n]}function yP(e={}){const[t,n]=Hb({value:()=>ee(e.isSelected),defaultValue:()=>!!ee(e.defaultIsSelected),onChange:s=>{var o;return(o=e.onSelectedChange)==null?void 0:o.call(e,s)}});return{isSelected:t,setIsSelected:s=>{!ee(e.isReadOnly)&&!ee(e.isDisabled)&&n(s)},toggle:()=>{!ee(e.isReadOnly)&&!ee(e.isDisabled)&&n(!t())}}}var mP=Object.defineProperty,ic=(e,t)=>{for(var n in t)mP(e,n,{get:t[n],enumerable:!0})},Ub=wt();function Gb(){return St(Ub)}function pP(){const e=Gb();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function Kb(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function vP(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&&Kb(s,n))return r+1}return 0}function bP(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:Kb(a,l)?(r>s&&(n=!0),-1):(r<s&&(n=!0),1)}),n?t.map(([r,i])=>i):e}function Vb(e,t){const n=bP(e);e!==n&&t(n)}function xP(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 wP(e,t){xe(()=>{const n=setTimeout(()=>{Vb(e(),t)});_e(()=>clearTimeout(n))})}function SP(e,t){if(typeof IntersectionObserver!="function"){wP(e,t);return}let n=[];xe(()=>{const r=()=>{const o=!!n.length;n=e(),o&&Vb(e(),t)},i=xP(e()),s=new IntersectionObserver(r,{root:i});for(const o of e()){const a=o.ref();a&&s.observe(a)}_e(()=>s.disconnect())})}function CP(e={}){const[t,n]=gP({value:()=>ee(e.items),onChange:s=>{var o;return(o=e.onItemsChange)==null?void 0:o.call(e,s)}});SP(t,n);const r=s=>(n(o=>{const a=vP(o,s);return BT(o,s,a)}),()=>{n(o=>{const a=o.filter(l=>l.ref()!==s.ref());return o.length===a.length?o:a})});return{DomCollectionProvider:s=>L(Ub.Provider,{value:{registerItem:r},get children(){return s.children}})}}function _P(e){const t=pP(),n=Re({shouldRegisterItem:!0},e);xe(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());_e(r)})}function Wb(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=as(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=as(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=as(f)?d[f]:f(d))!=null?g:!1},a=d=>{var f;if(d!=null)return as(e.getSectionChildren)?d[e.getSectionChildren]:(f=e.getSectionChildren)==null?void 0:f.call(e,d)};for(const d of e.dataSource){if(as(d)||qT(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=Wb({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 kP(e,t=[]){return K(()=>{const n=Wb({dataSource:ee(e.dataSource),getKey:ee(e.getKey),getTextValue:ee(e.getTextValue),getDisabled:ee(e.getDisabled),getSectionChildren:ee(e.getSectionChildren)});for(let r=0;r<t.length;r++)t[r]();return e.factory(n)})}var OP=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),EP=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function AP(e){var n;if(Intl.Locale){const r=(n=new Intl.Locale(e).maximize().script)!=null?n:"";return OP.has(r)}const t=e.split("-")[0];return EP.has(t)}function TP(e){return AP(e)?"rtl":"ltr"}function Qb(){let e=typeof navigator!="undefined"&&(navigator.language||navigator.userLanguage)||"en-US";return{locale:e,direction:TP(e)}}var af=Qb(),zo=new Set;function sm(){af=Qb();for(const e of zo)e(af)}function PP(){const[e,t]=ce(af),n=K(()=>e());return kr(()=>{zo.size===0&&window.addEventListener("languagechange",sm),zo.add(t),_e(()=>{zo.delete(t),zo.size===0&&window.removeEventListener("languagechange",sm)})}),{locale:()=>n().locale,direction:()=>n().direction}}var jP=wt();function ci(){const e=PP();return St(jP)||e}var Qc=new Map;function MP(e){const{locale:t}=ci(),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 Qc.has(r)&&(i=Qc.get(r)),i||(i=new Intl.Collator(t(),e),Qc.set(r,i)),i})}var hr=class Yb extends Set{constructor(n,r,i){super(n);pe(this,"anchorKey");pe(this,"currentKey");n instanceof Yb?(this.anchorKey=r||n.anchorKey,this.currentKey=i||n.currentKey):(this.anchorKey=r,this.currentKey=i)}};function $P(e){const[t,n]=Ja(e);return[()=>{var i;return(i=t())!=null?i:new hr},n]}function Xb(e){return VT()?e.altKey:e.ctrlKey}function ls(e){return nc()?e.metaKey:e.ctrlKey}function om(e){return new hr(e)}function LP(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function DP(e){const t=Re({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=ce(!1),[i,s]=ce(),o=K(()=>{const m=ee(t.selectedKeys);return m!=null?om(m):m}),a=K(()=>{const m=ee(t.defaultSelectedKeys);return m!=null?om(m):new hr}),[l,u]=$P({value:o,defaultValue:a,onChange:m=>{var p;return(p=t.onSelectionChange)==null?void 0:p.call(t,m)}}),[c,d]=ce(ee(t.selectionBehavior)),f=()=>ee(t.selectionMode),h=()=>{var m;return(m=ee(t.disallowEmptySelection))!=null?m:!1},g=m=>{(ee(t.allowDuplicateSelectionEvents)||!LP(m,l()))&&u(m)};return xe(()=>{const m=l();ee(t.selectionBehavior)==="replace"&&c()==="toggle"&&typeof m=="object"&&m.size===0&&d("replace")}),xe(()=>{var m;d((m=ee(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 IP(e){const[t,n]=ce(""),[r,i]=ce(-1);return{typeSelectHandlers:{onKeyDown:o=>{var f,h,g;if(ee(e.isDisabled))return;const a=ee(e.keyboardDelegate),l=ee(e.selectionManager);if(!a.getKeyForSearch)return;const u=RP(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&&NP(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 RP(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function NP(e){return e.split("").every(t=>t===e[0])}function FP(e,t,n){const i=Ae({selectOnFocus:()=>ee(e.selectionManager).selectionBehavior()==="replace"},e),s=()=>t(),{direction:o}=ci();let a={top:0,left:0};RT(()=>ee(i.isVirtualized)?void 0:s(),"scroll",()=>{const p=s();p&&(a={top:p.scrollTop,left:p.scrollLeft})});const{typeSelectHandlers:l}=IP({isDisabled:()=>ee(i.disallowTypeAhead),keyboardDelegate:()=>ee(i.keyboardDelegate),selectionManager:()=>ee(i.selectionManager)}),u=()=>{var p;return(p=ee(i.orientation))!=null?p:"vertical"},c=p=>{var _,O,E,T,M,B,R,j;nt(p,l.onKeyDown),p.altKey&&p.key==="Tab"&&p.preventDefault();const v=t();if(!(v!=null&&v.contains(p.target)))return;const b=ee(i.selectionManager),S=ee(i.selectOnFocus),C=P=>{P!=null&&(b.setFocusedKey(P),p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(P):S&&!Xb(p)&&b.replaceSelection(P))},w=ee(i.keyboardDelegate),k=ee(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&&k&&(P=(O=w.getFirstKey)==null?void 0:O.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&&k&&(P=(T=w.getLastKey)==null?void 0:T.call(w,x)),C(P)}break}case(u()==="vertical"?"ArrowLeft":"ArrowUp"):{if(w.getKeyLeftOf){p.preventDefault();const P=o()==="rtl";let I;x!=null?I=w.getKeyLeftOf(x):I=P?(M=w.getFirstKey)==null?void 0:M.call(w):(B=w.getLastKey)==null?void 0:B.call(w),C(I)}break}case(u()==="vertical"?"ArrowRight":"ArrowDown"):{if(w.getKeyRightOf){p.preventDefault();const P=o()==="rtl";let I;x!=null?I=w.getKeyRightOf(x):I=P?(R=w.getLastKey)==null?void 0:R.call(w):(j=w.getFirstKey)==null?void 0:j.call(w),C(I)}break}case"Home":if(w.getFirstKey){p.preventDefault();const P=w.getFirstKey(x,ls(p));P!=null&&(b.setFocusedKey(P),ls(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,ls(p));P!=null&&(b.setFocusedKey(P),ls(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":ls(p)&&b.selectionMode()==="multiple"&&ee(i.disallowSelectAll)!==!0&&(p.preventDefault(),b.selectAll());break;case"Escape":p.defaultPrevented||(p.preventDefault(),ee(i.disallowEmptySelection)||b.clearSelection());break;case"Tab":if(!ee(i.allowsTabNavigation)){if(p.shiftKey)v.focus();else{const P=rP(v,{tabbable:!0});let I,G;do G=P.lastChild(),G&&(I=G);while(G);I&&!I.contains(document.activeElement)&&At(I)}break}}},d=p=>{var C,w,k,x;const v=ee(i.selectionManager),b=ee(i.keyboardDelegate),S=ee(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))},O=p.relatedTarget;O&&p.currentTarget.compareDocumentPosition(O)&Node.DOCUMENT_POSITION_FOLLOWING?_((w=v.lastSelectedKey())!=null?w:(C=b.getLastKey)==null?void 0:C.call(b)):_((x=v.firstSelectedKey())!=null?x:(k=b.getFirstKey)==null?void 0:k.call(b))}else if(!ee(i.isVirtualized)){const _=s();if(_){_.scrollTop=a.top,_.scrollLeft=a.left;const O=_.querySelector(`[data-key="${v.focusedKey()}"]`);O&&(At(O),of(_,O))}}}},f=p=>{const v=ee(i.selectionManager);p.currentTarget.contains(p.relatedTarget)||v.setFocused(!1)},h=p=>{s()===p.target&&p.preventDefault()},g=()=>{var k,x;const p=ee(i.autoFocus);if(!p)return;const v=ee(i.selectionManager),b=ee(i.keyboardDelegate);let S;p==="first"&&(S=(k=b.getFirstKey)==null?void 0:k.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&&!ee(i.shouldUseVirtualFocus)&&At(w)};return kr(()=>{i.deferAutoFocus?setTimeout(g,0):g()}),xe(_r([s,()=>ee(i.isVirtualized),()=>ee(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&&of(v,w)}})),{tabIndex:K(()=>{if(!ee(i.shouldUseVirtualFocus))return ee(i.selectionManager).focusedKey()==null?0:-1}),onKeyDown:c,onMouseDown:h,onFocusIn:d,onFocusOut:f}}function Zb(e,t){const n=()=>ee(e.selectionManager),r=()=>ee(e.key),i=()=>ee(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"||ls(b)||"pointerType"in b&&b.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},o=()=>n().isSelected(r()),a=()=>ee(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&&!ee(e.shouldSelectOnPressUp)&&s(b))},d=b=>{l()&&b.pointerType==="mouse"&&b.button===0&&ee(e.shouldSelectOnPressUp)&&ee(e.allowsDifferentPressOrigin)&&s(b)},f=b=>{l()&&(ee(e.shouldSelectOnPressUp)&&!ee(e.allowsDifferentPressOrigin)||u!=="mouse")&&s(b)},h=b=>{!l()||!["Enter"," "].includes(b.key)||(Xb(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(()=>ee(e.virtualized)?void 0:r());return xe(_r([t,r,i,()=>n().focusedKey(),()=>n().isFocused()],([b,S,C,w,k])=>{b&&S===w&&k&&!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 BP=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 hr(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 hr(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 hr([t],t,t):new hr;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode()==="none")return;const t=new hr;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 hr)}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}},am=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 qP(e){const t=DP(e),r=kP({dataSource:()=>ee(e.dataSource),getKey:()=>ee(e.getKey),getTextValue:()=>ee(e.getTextValue),getDisabled:()=>ee(e.getDisabled),getSectionChildren:()=>ee(e.getSectionChildren),factory:s=>e.filter?new am(e.filter(s)):new am(s)},[()=>e.filter]),i=new BP(r,t);return ev(()=>{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,zP=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}},HP=zP,Jb=HP,pu="data-kb-top-layer",e1,lf=!1,Or=[];function xa(e){return Or.findIndex(t=>t.node===e)}function UP(e){return Or[xa(e)]}function GP(e){return Or[Or.length-1].node===e}function t1(){return Or.filter(e=>e.isPointerBlocking)}function KP(){return[...t1()].slice(-1)[0]}function lh(){return t1().length>0}function n1(e){var n;const t=xa((n=KP())==null?void 0:n.node);return xa(e)<t}function VP(e){Or.push(e)}function WP(e){const t=xa(e);t<0||Or.splice(t,1)}function QP(){for(const{node:e}of Or)e.style.pointerEvents=n1(e)?"none":"auto"}function YP(e){if(lh()&&!lf){const t=tr(e);e1=document.body.style.pointerEvents,t.body.style.pointerEvents="none",lf=!0}}function XP(e){if(lh())return;const t=tr(e);t.body.style.pointerEvents=e1,t.body.style.length===0&&t.body.removeAttribute("style"),lf=!1}var Wt={layers:Or,isTopMostLayer:GP,hasPointerBlockingLayer:lh,isBelowPointerBlockingLayer:n1,addLayer:VP,removeLayer:WP,indexOf:xa,find:UP,assignPointerEventToLayers:QP,disableBodyPointerEvents:YP,restoreBodyPointerEvents:XP},ZP={};ic(ZP,{Button:()=>tj,Root:()=>uh});var JP=["button","color","file","image","reset","submit"];function ej(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?JP.indexOf(e.type)!==-1:!1}function uh(e){let t;const n=Re({type:"button"},e),[r,i]=Ve(n,["ref","type","disabled"]),s=rc(()=>t,()=>"button"),o=K(()=>{const u=s();return u==null?!1:ej({tagName:u,type:r.type})}),a=K(()=>s()==="input"),l=K(()=>s()==="a"&&(t==null?void 0:t.getAttribute("href"))!=null);return L(st,Ae({as:"button",ref(u){const c=Rt(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 tj=uh,nj=["top","right","bottom","left"],Jn=Math.min,an=Math.max,vu=Math.round,Pl=Math.floor,ri=e=>({x:e,y:e}),rj={left:"right",right:"left",bottom:"top",top:"bottom"},ij={start:"end",end:"start"};function uf(e,t,n){return an(e,Jn(t,n))}function Zi(e,t){return typeof e=="function"?e(t):e}function ii(e){return e.split("-")[0]}function ao(e){return e.split("-")[1]}function r1(e){return e==="x"?"y":"x"}function ch(e){return e==="y"?"height":"width"}function Gi(e){return["top","bottom"].includes(ii(e))?"y":"x"}function dh(e){return r1(Gi(e))}function sj(e,t,n){n===void 0&&(n=!1);const r=ao(e),i=dh(e),s=ch(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=bu(o)),[o,bu(o)]}function oj(e){const t=bu(e);return[cf(e),t,cf(t)]}function cf(e){return e.replace(/start|end/g,t=>ij[t])}function aj(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 lj(e,t,n,r){const i=ao(e);let s=aj(ii(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(cf)))),s}function bu(e){return e.replace(/left|right|bottom|top/g,t=>rj[t])}function uj(e){return{top:0,right:0,bottom:0,left:0,...e}}function i1(e){return typeof e!="number"?uj(e):{top:e,right:e,bottom:e,left:e}}function xu(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 lm(e,t,n){let{reference:r,floating:i}=e;const s=Gi(t),o=dh(t),a=ch(o),l=ii(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(ao(t)){case"start":h[o]-=f*(n&&u?-1:1);break;case"end":h[o]+=f*(n&&u?-1:1);break}return h}var cj=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}=lm(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}=lm(u,f,l)),m=-1)}return{x:c,y:d,placement:f,strategy:i,middlewareData:h}};async function wa(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}=Zi(t,e),g=i1(h),p=a[f?d==="floating"?"reference":"floating":d],v=xu(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=xu(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 dj=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}=Zi(e,t)||{};if(u==null)return{};const d=i1(c),f={x:n,y:r},h=dh(i),g=ch(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],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let x=k?k[S]:0;(!x||!await(o.isElement==null?void 0:o.isElement(k)))&&(x=a.floating[S]||s.floating[g]);const _=C/2-w/2,O=x/2-m[g]/2-1,E=Jn(d[v],O),T=Jn(d[b],O),M=E,B=x-m[g]-T,R=x/2-m[g]/2+_,j=uf(M,R,B),P=!l.arrow&&ao(i)!=null&&R!==j&&s.reference[g]/2-(R<M?E:T)-m[g]/2<0,I=P?R<M?R-M:R-B:0;return{[h]:f[h]+I,data:{[h]:j,centerOffset:R-j-I,...P&&{alignmentOffset:I}},reset:P}}}),fj=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}=Zi(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=ii(i),b=Gi(a),S=ii(a)===a,C=await(l.isRTL==null?void 0:l.isRTL(u.floating)),w=f||(S||!m?[bu(a)]:oj(a)),k=g!=="none";!f&&k&&w.push(...lj(a,m,g,C));const x=[a,...w],_=await wa(t,p),O=[];let E=((r=s.flip)==null?void 0:r.overflows)||[];if(c&&O.push(_[v]),d){const R=sj(i,o,C);O.push(_[R[0]],_[R[1]])}if(E=[...E,{placement:i,overflows:O}],!O.every(R=>R<=0)){var T,M;const R=(((T=s.flip)==null?void 0:T.index)||0)+1,j=x[R];if(j)return{data:{index:R,overflows:E},reset:{placement:j}};let P=(M=E.filter(I=>I.overflows[0]<=0).sort((I,G)=>I.overflows[1]-G.overflows[1])[0])==null?void 0:M.placement;if(!P)switch(h){case"bestFit":{var B;const I=(B=E.filter(G=>{if(k){const V=Gi(G.placement);return V===b||V==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(V=>V>0).reduce((V,F)=>V+F,0)]).sort((G,V)=>G[1]-V[1])[0])==null?void 0:B[0];I&&(P=I);break}case"initialPlacement":P=a;break}if(i!==P)return{reset:{placement:P}}}return{}}}};function um(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function cm(e){return nj.some(t=>e[t]>=0)}var hj=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Zi(e,t);switch(r){case"referenceHidden":{const s=await wa(t,{...i,elementContext:"reference"}),o=um(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:cm(o)}}}case"escaped":{const s=await wa(t,{...i,altBoundary:!0}),o=um(s,n.floating);return{data:{escapedOffsets:o,escaped:cm(o)}}}default:return{}}}}};async function gj(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ii(n),a=ao(n),l=Gi(n)==="y",u=["left","top"].includes(o)?-1:1,c=s&&l?-1:1,d=Zi(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*c,y:f*u}:{x:f*u,y:h*c}}var yj=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 gj(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}}}}},mj=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:p=>{let{x:v,y:b}=p;return{x:v,y:b}}},...l}=Zi(e,t),u={x:n,y:r},c=await wa(t,l),d=Gi(ii(i)),f=r1(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=uf(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=uf(b,g,S)}const m=a.fn({...t,[f]:h,[d]:g});return{...m,data:{x:m.x-n,y:m.y-r}}}}},pj=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:s}=t,{apply:o=()=>{},...a}=Zi(e,t),l=await wa(t,a),u=ii(n),c=ao(n),d=Gi(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,k=S;if(d?k=c||C?Jn(S,v):v:w=c||C?Jn(b,p):p,C&&!c){const _=an(l.left,0),O=an(l.right,0),E=an(l.top,0),T=an(l.bottom,0);d?k=f-2*(_!==0||O!==0?_+O:an(l.left,l.right)):w=h-2*(E!==0||T!==0?E+T:an(l.top,l.bottom))}await o({...t,availableWidth:k,availableHeight:w});const x=await i.getDimensions(s.floating);return f!==x.width||h!==x.height?{reset:{rects:!0}}:{}}}};function lo(e){return s1(e)?(e.nodeName||"").toLowerCase():"#document"}function cn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Tr(e){var t;return(t=(s1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function s1(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 dm(e){return typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof cn(e).ShadowRoot}function el(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 vj(e){return["table","td","th"].includes(lo(e))}function sc(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(n){return!1}})}function fh(e){const t=hh(),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 bj(e){let t=si(e);for(;nr(t)&&!Zs(t);){if(fh(t))return t;if(sc(t))return null;t=si(t)}return null}function hh(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Zs(e){return["html","body","#document"].includes(lo(e))}function Dn(e){return cn(e).getComputedStyle(e)}function oc(e){return Ln(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function si(e){if(lo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||dm(e)&&e.host||Tr(e);return dm(t)?t.host:t}function o1(e){const t=si(e);return Zs(t)?e.ownerDocument?e.ownerDocument.body:e.body:nr(t)&&el(t)?t:o1(t)}function Sa(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=o1(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=cn(i);return s?t.concat(o,o.visualViewport||[],el(i)?i:[],o.frameElement&&n?Sa(o.frameElement):[]):t.concat(i,Sa(i,[],n))}function a1(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=vu(n)!==s||vu(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function gh(e){return Ln(e)?e:e.contextElement}function ms(e){const t=gh(e);if(!nr(t))return ri(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=a1(t);let o=(s?vu(n.width):n.width)/r,a=(s?vu(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}var xj=ri(0);function l1(e){const t=cn(e);return!hh()||!t.visualViewport?xj:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function wj(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==cn(e)?!1:t}function Ki(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=gh(e);let o=ri(1);t&&(r?Ln(r)&&(o=ms(r)):o=ms(e));const a=wj(s,n,r)?l1(s):ri(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=ms(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 xu({width:c,height:d,x:l,y:u})}function Sj(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",o=Tr(r),a=t?sc(t.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=ri(1);const c=ri(0),d=nr(r);if((d||!d&&!s)&&((lo(r)!=="body"||el(o))&&(l=oc(r)),nr(r))){const f=Ki(r);u=ms(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 Cj(e){return Array.from(e.getClientRects())}function u1(e){return Ki(Tr(e)).left+oc(e).scrollLeft}function _j(e){const t=Tr(e),n=oc(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+u1(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 kj(e,t){const n=cn(e),r=Tr(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=hh();(!u||u&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function Oj(e,t){const n=Ki(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=nr(e)?ms(e):ri(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 fm(e,t,n){let r;if(t==="viewport")r=kj(e,n);else if(t==="document")r=_j(Tr(e));else if(Ln(t))r=Oj(t,n);else{const i=l1(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return xu(r)}function c1(e,t){const n=si(e);return n===t||!Ln(n)||Zs(n)?!1:Dn(n).position==="fixed"||c1(n,t)}function Ej(e,t){const n=t.get(e);if(n)return n;let r=Sa(e,[],!1).filter(a=>Ln(a)&&lo(a)!=="body"),i=null;const s=Dn(e).position==="fixed";let o=s?si(e):e;for(;Ln(o)&&!Zs(o);){const a=Dn(o),l=fh(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||el(o)&&!l&&c1(e,o))?r=r.filter(c=>c!==o):i=a,o=si(o)}return t.set(e,r),r}function Aj(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?sc(t)?[]:Ej(t,this._c):[].concat(n),r],a=o[0],l=o.reduce((u,c)=>{const d=fm(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},fm(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Tj(e){const{width:t,height:n}=a1(e);return{width:t,height:n}}function Pj(e,t,n){const r=nr(t),i=Tr(t),s=n==="fixed",o=Ki(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=ri(0);if(r||!r&&!s)if((lo(t)!=="body"||el(i))&&(a=oc(t)),r){const d=Ki(t,!0,s,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&(l.x=u1(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 Yc(e){return Dn(e).position==="static"}function hm(e,t){return!nr(e)||Dn(e).position==="fixed"?null:t?t(e):e.offsetParent}function d1(e,t){const n=cn(e);if(sc(e))return n;if(!nr(e)){let i=si(e);for(;i&&!Zs(i);){if(Ln(i)&&!Yc(i))return i;i=si(i)}return n}let r=hm(e,t);for(;r&&vj(r)&&Yc(r);)r=hm(r,t);return r&&Zs(r)&&Yc(r)&&!fh(r)?n:r||bj(e)||n}var jj=async function(e){const t=this.getOffsetParent||d1,n=this.getDimensions,r=await n(e.floating);return{reference:Pj(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Mj(e){return Dn(e).direction==="rtl"}var f1={convertOffsetParentRelativeRectToViewportRelativeRect:Sj,getDocumentElement:Tr,getClippingRect:Aj,getOffsetParent:d1,getElementRects:jj,getClientRects:Cj,getDimensions:Tj,getScale:ms,isElement:Ln,isRTL:Mj};function $j(e,t){let n=null,r;const i=Tr(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=Pl(c),g=Pl(i.clientWidth-(u+d)),m=Pl(i.clientHeight-(c+f)),p=Pl(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 k=w[0].intersectionRatio;if(k!==l){if(!S)return o();k?o(!1,k):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 Lj(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=gh(e),c=i||s?[...u?Sa(u):[],...Sa(t)]:[];c.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const d=u&&a?$j(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?Ki(e):null;l&&p();function p(){const v=Ki(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 Dj=yj,Ij=mj,Rj=fj,Nj=pj,Fj=hj,Bj=dj,qj=(e,t,n)=>{const r=new Map,i={platform:f1,...n},s={...i.platform,_c:r};return cj(e,t,{...i,platform:s})},yh=wt();function mh(){const e=St(yh);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var zj=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">'),df=30,gm=df/2,Hj={top:180,right:-90,bottom:0,left:90};function ph(e){const t=mh(),n=Re({size:df},e),[r,i]=Ve(n,["ref","style","size"]),s=()=>t.currentPlacement().split("-")[0],o=Uj(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*(df/r.size),d=()=>`rotate(${Hj[s()]} ${gm} ${gm}) translate(0 2)`;return L(st,Ae({as:"div",ref(f){const h=Rt(t.setArrowRef,r.ref);typeof h=="function"&&h(f)},"aria-hidden":"true",get style(){return tc({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=zj(),h=f.firstChild;return be(()=>oe(h,"transform",d())),f}}))}function Uj(e){const[t,n]=ce();return xe(()=>{const r=e();r&&n(HT(r).getComputedStyle(r))}),t}function Gj(e){const t=mh(),[n,r]=Ve(e,["ref","style"]);return L(st,Ae({as:"div",ref(i){const s=Rt(t.setPositionerRef,n.ref);typeof s=="function"&&s(i)},"data-popper-positioner":"",get style(){return tc({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}function ym(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 Kj(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?ym(r):e?e.getBoundingClientRect():ym()}}}function Vj(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var Wj={top:"bottom",right:"left",bottom:"top",left:"right"};function Qj(e,t){const[n,r]=e.split("-"),i=Wj[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 Yj(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 Kj((f=t.anchorRef)==null?void 0:f.call(t),t.getAnchorRect)},{direction:u}=ci();async function c(){var k,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:(k=t.gutter)!=null?k:m;h.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),f.getBoundingClientRect();const v=[Dj(({placement:O})=>{const E=!!O.split("-")[1];return{mainAxis:p,crossAxis:E?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const O=typeof t.flip=="string"?t.flip.split(" "):void 0;if(O!==void 0&&!O.every(Vj))throw new Error("`flip` expects a spaced-delimited list of placements");v.push(Rj({padding:t.overflowPadding,fallbackPlacements:O}))}(t.slide||t.overlap)&&v.push(Ij({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),v.push(Nj({padding:t.overflowPadding,apply({availableWidth:O,availableHeight:E,rects:T}){const M=Math.round(T.reference.width);O=Math.floor(O),E=Math.floor(E),h.style.setProperty("--kb-popper-anchor-width",`${M}px`),h.style.setProperty("--kb-popper-content-available-width",`${O}px`),h.style.setProperty("--kb-popper-content-available-height",`${E}px`),t.sameWidth&&(h.style.width=`${M}px`),t.fitViewport&&(h.style.maxWidth=`${O}px`,h.style.maxHeight=`${E}px`)}})),t.hideWhenDetached&&v.push(Fj({padding:t.detachedPadding})),g&&v.push(Bj({element:g,padding:t.arrowPadding}));const b=await qj(f,h,{placement:t.placement,strategy:"absolute",middleware:v,platform:{...f1,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",Qj(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:O,y:E}=b.middlewareData.arrow,T=b.placement.split("-")[0];Object.assign(g.style,{left:O!=null?`${O}px`:"",top:E!=null?`${E}px`:"",[T]:"100%"})}}xe(()=>{const f=l(),h=n();if(!f||!h)return;const g=Lj(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 L(yh.Provider,{value:d,get children(){return t.children}})}var h1=Object.assign(Yj,{Arrow:ph,Context:yh,usePopperContext:mh,Positioner:Gj});function Xj(e){const t=n=>{var r;n.key===ih.Escape&&((r=e.onEscapeKeyDown)==null||r.call(e,n))};xe(()=>{var r,i;if(ee(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 mm="interactOutside.pointerDownOutside",pm="interactOutside.focusOutside";function Zj(e,t){let n,r=sP;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(`[${pu}]`)||!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(mm,m,{once:!0});const p=new CustomEvent(mm,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||WT(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(pm,g,{once:!0});const m=new CustomEvent(pm,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});h.dispatchEvent(m)};xe(()=>{ee(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 g1=wt();function Jj(){return St(g1)}function eM(e){let t;const n=Jj(),[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()}};Zj({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),Xj({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()))}}),kr(()=>{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(_r([()=>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 L(g1.Provider,{value:c,get children(){return L(st,Ae({as:"div",ref(d){const f=Rt(h=>t=h,r.ref);typeof f=="function"&&f(d)}},i))}})}function y1(e={}){const[t,n]=Hb({value:()=>ee(e.open),defaultValue:()=>!!ee(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={};ic(pn,{Description:()=>qb,ErrorMessage:()=>zb,Item:()=>b1,ItemControl:()=>x1,ItemDescription:()=>w1,ItemIndicator:()=>S1,ItemInput:()=>C1,ItemLabel:()=>_1,Label:()=>k1,RadioGroup:()=>tM,Root:()=>O1});var m1=wt();function p1(){const e=St(m1);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupContext` must be used within a `RadioGroup` component");return e}var v1=wt();function tl(){const e=St(v1);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupItemContext` must be used within a `RadioGroup.Item` component");return e}function b1(e){const t=Za(),n=p1(),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=k=>{nt(k,s.onPointerDown),m()&&k.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:Xa(()=>o.id),registerInput:Cn(l),registerLabel:Cn(c),registerDescription:Cn(f),setIsFocused:p,setInputRef:g};return L(v1.Provider,{value:w,get children(){return L(st,Ae({as:"div",role:"group",onPointerDown:S},C,o))}})}function x1(e){const t=tl(),n=Re({id:t.generateId("control")},e),[r,i]=Ve(n,["onClick","onKeyDown"]);return L(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===ih.Space&&(t.select(),(l=t.inputRef())==null||l.focus())}},()=>t.dataset(),i))}function w1(e){const t=tl(),n=Re({id:t.generateId("description")},e);return xe(()=>_e(t.registerDescription(n.id))),L(st,Ae({as:"div"},()=>t.dataset(),n))}function S1(e){const t=tl(),n=Re({id:t.generateId("indicator")},e),[r,i]=Ve(n,["ref","forceMount"]),[s,o]=ce(),{present:a}=Jb({show:()=>r.forceMount||t.isSelected(),element:()=>{var l;return(l=s())!=null?l:null}});return L(ve,{get when(){return a()},get children(){return L(st,Ae({as:"div",ref(l){const u=Rt(o,r.ref);typeof u=="function"&&u(l)}},()=>t.dataset(),i))}})}function C1(e){const t=Za(),n=p1(),r=tl(),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(_r([()=>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))),L(st,Ae({as:"input",ref(g){const m=Rt(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 tc({...Fb},s.style)},get"aria-labelledby"(){return a()},get"aria-describedby"(){return l()},onChange:d,onFocus:f,onBlur:h},()=>r.dataset(),o))}function _1(e){const t=tl(),n=Re({id:t.generateId("label")},e);return xe(()=>_e(t.registerLabel(n.id))),L(st,Ae({as:"label",get for(){return t.inputId()}},()=>t.dataset(),n))}function k1(e){return L(cP,Ae({as:"span"},e))}function O1(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"],lP),[a,l]=Ja({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:g=>{var m;return(m=i.onChange)==null?void 0:m.call(i,g)}}),{formControlContext:u}=uP(s);dP(()=>t,()=>{var g;return l((g=i.defaultValue)!=null?g:"")});const c=()=>u.getAriaLabelledBy(ee(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 L(Bb.Provider,{value:u,get children(){return L(m1.Provider,{value:h,get children(){return L(st,Ae({as:"div",ref(g){const m=Rt(p=>t=p,i.ref);typeof m=="function"&&m(g)},role:"radiogroup",get id(){return ee(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 tM=Object.assign(O1,{Description:qb,ErrorMessage:zb,Item:b1,ItemControl:x1,ItemDescription:w1,ItemIndicator:S1,ItemInput:C1,ItemLabel:_1,Label:k1}),nM=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 rM(e,t,n){const r=MP({usage:"search",sensitivity:"base"}),i=K(()=>{const s=ee(e.keyboardDelegate);return s||new nM(e.collection,t,r)});return FP({selectionManager:()=>ee(e.selectionManager),keyboardDelegate:i,autoFocus:()=>ee(e.autoFocus),deferAutoFocus:()=>ee(e.deferAutoFocus),shouldFocusWrap:()=>ee(e.shouldFocusWrap),disallowEmptySelection:()=>ee(e.disallowEmptySelection),selectOnFocus:()=>ee(e.selectOnFocus),disallowTypeAhead:()=>ee(e.disallowTypeAhead),shouldUseVirtualFocus:()=>ee(e.shouldUseVirtualFocus),allowsTabNavigation:()=>ee(e.allowsTabNavigation),isVirtualized:()=>ee(e.isVirtualized),scrollToKey:s=>{var o;return(o=ee(e.scrollToKey))==null?void 0:o(s)},orientation:()=>ee(e.orientation)},t)}var Xc="focusScope.autoFocusOnMount",Zc="focusScope.autoFocusOnUnmount",vm={bubbles:!1,cancelable:!0},bm={stack:[],active(){return this.stack[0]},add(e){var t;e!==this.active()&&((t=this.active())==null||t.pause()),this.stack=sf(this.stack,e),this.stack.unshift(e)},remove(e){var t;this.stack=sf(this.stack,e),(t=this.active())==null||t.resume()}};function iM(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,Fb),g},c=()=>{const g=t();return g?Rb(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=qo(g);return!m||Sn(g,m)?!1:Nb(m)};xe(()=>{const g=t();if(!g)return;bm.add(i);const m=qo(g);if(!Sn(g,m)){const v=new CustomEvent(Xc,vm);g.addEventListener(Xc,o),g.dispatchEvent(v),v.defaultPrevented||setTimeout(()=>{At(d()),qo(g)===m&&At(g)},0)}_e(()=>{g.removeEventListener(Xc,o),setTimeout(()=>{const v=new CustomEvent(Zc,vm);h()&&v.preventDefault(),g.addEventListener(Zc,a),g.dispatchEvent(v),v.defaultPrevented||At(m!=null?m:l().body),g.removeEventListener(Zc,a),bm.remove(i)},0)})}),xe(()=>{const g=t();if(!g||!ee(e.trapFocus)||n())return;const m=v=>{const b=v.target;b!=null&&b.closest(`[${pu}]`)||(Sn(g,b)?s=b:At(s))},p=v=>{const b=v.relatedTarget,S=b!=null?b:qo(g);S!=null&&S.closest(`[${pu}]`)||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||!ee(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 sM="data-live-announcer";function oM(e){xe(()=>{ee(e.isDisabled)||_e(aM(ee(e.targets),ee(e.root)))})}var To=new WeakMap,mn=[];function aM(e,t=document.body){const n=new Set(e),r=new Set,i=l=>{for(const f of l.querySelectorAll(`[${sM}], [${pu}]`))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=To.get(l))!=null?c:0;l.getAttribute("aria-hidden")==="true"&&u===0||(u===0&&l.setAttribute("aria-hidden","true"),r.add(l),To.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=To.get(l);if(u==null)return;u===1?(l.removeAttribute("aria-hidden"),To.delete(l)):To.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 jl=new Map,lM=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=jl.get(e.key);i?i.activeCount++:jl.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=jl.get(e.key);if(a){if(a.activeCount!==1){a.activeCount--;return}jl.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)}})})},xm=lM,uM=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},cM=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},dM=(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]=uM(i,t),f=d-u-r*c;(c!==0||f!==0)&&cM(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]},[wm,Sm]=ce([]),fM=e=>wm().indexOf(e)===wm().length-1,hM=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)&&(Sm(u=>[...u,n]),_e(()=>{Sm(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;xm({key:"prevent-scroll",element:u,style:d,properties:f,cleanup:()=>{Et(t.restoreScrollPosition)&&c>0&&window.scrollTo(g,h)}})}else xm({key:"prevent-scroll",element:u,style:{overflow:"hidden"}})}),xe(()=>{!fM(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=Cm(u),i=null,s=null},a=u=>{const c=u.target,d=Et(t.element),f=gM(u),h=Math.abs(f[0])>Math.abs(f[1])?"x":"y",g=h==="x"?f[0]:f[1],m=_m(c,h,g,d);let p;d&&ff(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=Cm(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=_m(d,i,s,c);c&&ff(c,d)?f=!h:f=!0}}f&&u.cancelable&&u.preventDefault()}},gM=e=>[e.deltaX,e.deltaY],Cm=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],_m=(e,t,n,r)=>{const i=r!==null&&ff(r,e),[s,o]=dM(e,t,i?r:void 0);return!(n>0&&Math.abs(s)<=1||n<0&&Math.abs(o)<1)},ff=(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},yM=hM,mM=yM,E1=wt();function A1(){return St(E1)}function Pr(){const e=A1();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var T1=wt();function vh(){const e=St(T1);if(e===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var P1=wt();function rr(){const e=St(P1);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function bh(e){let t;const n=rr(),r=Pr(),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 O;(O=s.onSelect)==null||O.call(s),s.closeOnSelect&&setTimeout(()=>{r.close(!0)})};_P({getItem:()=>{var O,E,T,M,B;return{ref:()=>t,type:"item",key:g(),textValue:(M=(T=(E=s.textValue)!=null?E:(O=d())==null?void 0:O.textContent)!=null?T:t==null?void 0:t.textContent)!=null?M:"",disabled:(B=s.disabled)!=null?B:!1}}});const v=Zb({key:g,selectionManager:h,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),b=O=>{nt(O,s.onPointerMove),O.pointerType==="mouse"&&(s.disabled?r.onItemLeave(O):(r.onItemEnter(O),O.defaultPrevented||(At(O.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(g()))))},S=O=>{nt(O,s.onPointerLeave),O.pointerType==="mouse"&&r.onItemLeave(O)},C=O=>{nt(O,s.onPointerUp),!s.disabled&&O.button===0&&p()},w=O=>{if(nt(O,s.onKeyDown),!O.repeat&&!s.disabled)switch(O.key){case"Enter":case" ":p();break}},k=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:Xa(()=>o.id),registerLabel:Cn(l),registerDescription:Cn(c)};return L(T1.Provider,{value:_,get children(){return L(st,Ae({as:"div",ref(O){const E=Rt(T=>t=T,s.ref);typeof E=="function"&&E(O)},get tabIndex(){return v.tabIndex()},get"aria-checked"(){return k()},get"aria-disabled"(){return s.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return 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 j1(e){const t=Re({closeOnSelect:!1},e),[n,r]=Ve(t,["checked","defaultChecked","onChange","onSelect"]),i=yP({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 L(bh,Ae({role:"menuitemcheckbox",get checked(){return i.isSelected()},onSelect:()=>{var o;(o=n.onSelect)==null||o.call(n),i.toggle()}},r))}var pM=wt();function ac(){return St(pM)}var Ca={next:(e,t)=>e==="ltr"?t==="horizontal"?"ArrowRight":"ArrowDown":t==="horizontal"?"ArrowLeft":"ArrowUp",previous:(e,t)=>Ca.next(e==="ltr"?"rtl":"ltr",t)},km={first:e=>e==="horizontal"?"ArrowDown":"ArrowRight",last:e=>e==="horizontal"?"ArrowUp":"ArrowLeft"};function M1(e){const t=rr(),n=Pr(),r=ac(),{direction:i}=ci(),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=rc(()=>n.triggerRef(),()=>"button"),c=K(()=>{var v;return u()==="a"&&((v=n.triggerRef())==null?void 0:v.getAttribute("href"))!=null});xe(_r(()=>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 km.first(t.orientation()):v.stopPropagation(),v.preventDefault(),aP(v.currentTarget),n.open("first"),r==null||r.setAutoFocusMenu(!0),r==null||r.setValue(l);break;case km.last(t.orientation()):v.stopPropagation(),v.preventDefault(),n.open("last");break;case Ca.next(i(),t.orientation()):if(r===void 0)break;v.stopPropagation(),v.preventDefault(),r.nextMenu();break;case Ca.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))),L(uh,Ae({ref(v){const b=Rt(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 vM=wt();function $1(){return St(vM)}function L1(e){let t;const n=rr(),r=Pr(),i=ac(),s=$1(),{direction:o}=ci(),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=rM({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);iM({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 Ca.next(o(),n.orientation()):S.stopPropagation(),S.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.nextMenu();break;case Ca.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:Rt(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 L(ve,{get when(){return r.contentPresent()},get children(){return L(ve,{get when(){return s===void 0||r.parentMenuContext()!=null},get fallback(){return L(st,Ae({as:"div"},()=>r.dataset(),b,u))},get children(){return L(h1.Positioner,{get children(){return L(eM,Ae({get disableOutsidePointerEvents(){return K(()=>!!d())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return tc({"--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 bM(e){let t;const n=rr(),r=Pr(),[i,s]=Ve(e,["ref"]);return mM({element:()=>t!=null?t:null,enabled:()=>r.contentPresent()&&n.preventScroll()}),L(L1,Ae({ref(o){const a=Rt(l=>{t=l},i.ref);typeof a=="function"&&a(o)}},s))}var D1=wt();function xM(){const e=St(D1);if(e===void 0)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}function xh(e){const t=rr(),n=Re({id:t.generateId(`group-${On()}`)},e),[r,i]=ce(),s={generateId:Xa(()=>n.id),registerLabelId:Cn(i)};return L(D1.Provider,{value:s,get children(){return L(st,Ae({as:"div",role:"group",get"aria-labelledby"(){return r()}},n))}})}function I1(e){const t=xM(),n=Re({id:t.generateId("label")},e),[r,i]=Ve(n,["id"]);return xe(()=>_e(t.registerLabelId(r.id))),L(st,Ae({as:"span",get id(){return r.id},"aria-hidden":"true"},i))}function R1(e){const t=Pr(),n=Re({children:"▼"},e);return L(st,Ae({as:"span","aria-hidden":"true"},()=>t.dataset(),n))}function N1(e){return L(bh,Ae({role:"menuitem",closeOnSelect:!0},e))}function F1(e){const t=vh(),n=Re({id:t.generateId("description")},e),[r,i]=Ve(n,["id"]);return xe(()=>_e(t.registerDescription(r.id))),L(st,Ae({as:"div",get id(){return r.id}},()=>t.dataset(),i))}function B1(e){const t=vh(),n=Re({id:t.generateId("indicator")},e),[r,i]=Ve(n,["forceMount"]);return L(ve,{get when(){return r.forceMount||t.isChecked()},get children(){return L(st,Ae({as:"div"},()=>t.dataset(),i))}})}function q1(e){const t=vh(),n=Re({id:t.generateId("label")},e),[r,i]=Ve(n,["ref","id"]);return xe(()=>_e(t.registerLabel(r.id))),L(st,Ae({as:"div",ref(s){const o=Rt(t.setLabelRef,r.ref);typeof o=="function"&&o(s)},get id(){return r.id}},()=>t.dataset(),i))}function z1(e){const t=Pr();return L(ve,{get when(){return t.contentPresent()},get children(){return L(hv,e)}})}var H1=wt();function wM(){const e=St(H1);if(e===void 0)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}function U1(e){const n=rr().generateId(`radiogroup-${On()}`),r=Re({id:n},e),[i,s]=Ve(r,["value","defaultValue","onChange","disabled"]),[o,a]=Ja({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 L(H1.Provider,{value:l,get children(){return L(xh,s)}})}function G1(e){const t=wM(),n=Re({closeOnSelect:!1},e),[r,i]=Ve(n,["value","onSelect"]);return L(bh,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 SM(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 CM(e,t){return t?oP([e.clientX,e.clientY],t):!1}function K1(e){const t=rr(),n=Gb(),r=A1(),i=ac(),s=$1(),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),[k,x]=ce(l.placement),[_,O]=ce([]),[E,T]=ce([]),{DomCollectionProvider:M}=CP({items:E,onItemsChange:T}),B=y1({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:re=>{var Se;return(Se=a.onOpenChange)==null?void 0:Se.call(a,re)}}),{present:R}=Jb({show:()=>t.forceMount()||B.isOpen(),element:()=>{var re;return(re=b())!=null?re:null}}),j=qP({selectionMode:"none",dataSource:E}),P=re=>{w(re),B.open()},I=(re=!1)=>{B.close(),re&&r&&r.close(!0)},G=re=>{w(re),B.toggle()},V=()=>{const re=b();re&&(At(re),j.selectionManager().setFocused(!0),j.selectionManager().setFocusedKey(void 0))},F=()=>{s!=null?setTimeout(()=>V()):V()},U=re=>{O(ye=>[...ye,re]);const Se=r==null?void 0:r.registerNestedMenu(re);return()=>{O(ye=>sf(ye,re)),Se==null||Se()}},z=re=>d===(c==null?void 0:c.side)&&CM(re,c==null?void 0:c.area),Q=re=>{z(re)&&re.preventDefault()},N=re=>{z(re)||F()},te=re=>{z(re)&&re.preventDefault()};oM({isDisabled:()=>!(r==null&&B.isOpen()&&t.isModal()),targets:()=>[b(),..._()].filter(Boolean)}),xe(()=>{const re=b();if(!re||!r)return;const Se=r.registerNestedMenu(re);_e(()=>{Se()})}),xe(()=>{r===void 0&&(i==null||i.registerMenu(t.value(),[b(),..._()]))}),xe(()=>{var re;r!==void 0||i===void 0||(i.value()===t.value()?((re=p())==null||re.focus(),i.autoFocusMenu()&&P(!0)):I())}),xe(()=>{r!==void 0||i===void 0||B.isOpen()&&i.setValue(t.value())}),_e(()=>{r===void 0&&(i==null||i.unregisterMenu(t.value()))});const ge={dataset:K(()=>({"data-expanded":B.isOpen()?"":void 0,"data-closed":B.isOpen()?void 0:""})),isOpen:B.isOpen,contentPresent:R,nestedMenus:_,currentPlacement:k,pointerGraceTimeoutId:()=>u,autoFocus:C,listState:()=>j,parentMenuContext:()=>r,triggerRef:p,contentRef:b,triggerId:f,contentId:g,setTriggerRef:v,setContentRef:S,open:P,close:I,toggle:G,focusContent:F,onItemEnter:Q,onItemLeave:N,onTriggerLeave:te,setPointerDir:re=>d=re,setPointerGraceTimeoutId:re=>u=re,setPointerGraceIntent:re=>c=re,registerNestedMenu:U,registerItemToParentDomCollection:n==null?void 0:n.registerItem,registerTriggerId:Cn(h),registerContentId:Cn(m)};return L(M,{get children(){return L(E1.Provider,{value:ge,get children(){return L(ve,{when:s===void 0,get fallback(){return l.children},get children(){return L(h1,Ae({anchorRef:p,contentRef:b,onCurrentPlacementChange:x},l))}})}})}})}function V1(e){const{direction:t}=ci();return L(K1,Ae({get placement(){return t()==="rtl"?"left-start":"right-start"},flip:!0},e))}var _M={close:(e,t)=>e==="ltr"?[t==="horizontal"?"ArrowLeft":"ArrowUp"]:[t==="horizontal"?"ArrowRight":"ArrowDown"]};function W1(e){const t=Pr(),n=rr(),[r,i]=Ve(e,["onFocusOutside","onKeyDown"]),{direction:s}=ci();return L(L1,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=_M.close(s(),n.orientation()).includes(c.key),h=t.parentMenuContext()!=null;d&&f&&h&&(t.close(),At(t.triggerRef()))}},i))}var Om=["Enter"," "],kM={open:(e,t)=>e==="ltr"?[...Om,t==="horizontal"?"ArrowRight":"ArrowDown"]:[...Om,t==="horizontal"?"ArrowLeft":"ArrowUp"]};function Q1(e){let t;const n=rr(),r=Pr(),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}=ci(),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=Zb({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:SM(r.currentPlacement(),S,w),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(C==null?void 0:C.pointerGraceTimeoutId());const k=window.setTimeout(()=>{C==null||C.setPointerGraceIntent(null)},300);C==null||C.setPointerGraceTimeoutId(k)}else{if(C==null||C.onTriggerLeave(S),S.defaultPrevented)return;C==null||C.setPointerGraceIntent(null)}C==null||C.onItemLeave(S)},b=S=>{nt(S,s.onKeyDown),!S.repeat&&(s.disabled||kM.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,k;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:(k=s.disabled)!=null?k:!1});_e(S)}),xe(_r(()=>{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()}),L(st,Ae({as:"div",ref(S){const C=Rt(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 OM(e){const t=ac(),n=`menu-${On()}`,r=Re({id:n,modal:!0},e),[i,s]=Ve(r,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),o=y1({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:Xa(()=>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 L(P1.Provider,{value:a,get children(){return L(K1,Ae({get open(){return o.isOpen()},get onOpenChange(){return o.setIsOpen}},s))}})}var EM={};ic(EM,{Root:()=>lc,Separator:()=>AM});function lc(e){let t;const n=Re({orientation:"horizontal"},e),[r,i]=Ve(n,["ref","orientation"]),s=rc(()=>t,()=>"hr");return L(st,Ae({as:"hr",ref(o){const a=Rt(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 AM=lc,ft={};ic(ft,{Arrow:()=>ph,CheckboxItem:()=>j1,Content:()=>Y1,DropdownMenu:()=>TM,Group:()=>xh,GroupLabel:()=>I1,Icon:()=>R1,Item:()=>N1,ItemDescription:()=>F1,ItemIndicator:()=>B1,ItemLabel:()=>q1,Portal:()=>z1,RadioGroup:()=>U1,RadioItem:()=>G1,Root:()=>X1,Separator:()=>lc,Sub:()=>V1,SubContent:()=>W1,SubTrigger:()=>Q1,Trigger:()=>M1});function Y1(e){const t=rr(),n=Pr(),[r,i]=Ve(e,["onCloseAutoFocus","onInteractOutside"]);let s=!1;return L(bM,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 X1(e){const t=`dropdownmenu-${On()}`,n=Re({id:t},e);return L(OM,n)}var TM=Object.assign(X1,{Arrow:ph,CheckboxItem:j1,Content:Y1,Group:xh,GroupLabel:I1,Icon:R1,Item:N1,ItemDescription:F1,ItemIndicator:B1,ItemLabel:q1,Portal:z1,RadioGroup:U1,RadioItem:G1,Separator:lc,Sub:V1,SubContent:W1,SubTrigger:Q1,Trigger:M1}),W={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"}},PM=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>'),jM=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>'),MM=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>'),$M=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>'),wh=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>'),LM=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>'),DM=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>'),IM=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>'),RM=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">'),NM=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">'),FM=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>'),BM=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>'),qM=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>'),zM=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>'),Z1=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>'),HM=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>'),UM=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>'),GM=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>'),KM=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>'),VM=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>'),WM=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>'),QM=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>'),YM=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 XM(){return PM()}function J1(){return jM()}function Zo(){return MM()}function Em(){return $M()}function Am(){return wh()}function ZM(){return(()=>{var e=wh();return e.style.setProperty("transform","rotate(90deg)"),e})()}function JM(){return(()=>{var e=wh();return e.style.setProperty("transform","rotate(-90deg)"),e})()}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$(){return BM()}function a$(){return qM()}function l$(){return zM()}function u$(e){return(()=>{var t=Z1(),n=t.firstChild;return be(()=>oe(n,"stroke",e.theme==="dark"?"#12B76A":"#027A48")),t})()}function c$(){return HM()}function d$(){return UM()}function f$(e){return[L(ve,{get when(){return e.checked},get children(){var t=Z1(),n=t.firstChild;return be(()=>oe(n,"stroke",e.theme==="dark"?"#9B8AFB":"#6938EF")),t}}),L(ve,{get when(){return!e.checked},get children(){var t=GM(),n=t.firstChild;return be(()=>oe(n,"stroke",e.theme==="dark"?"#9B8AFB":"#6938EF")),t}})]}function h$(){return KM()}function g$(){return VM()}function y$(){return WM()}function m$(){return QM()}function Tm(){const e=On();return(()=>{var t=YM(),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,k=w.firstChild,x=w.nextSibling,_=x.nextSibling,O=_.firstChild,E=_.nextSibling,T=E.firstChild,M=E.nextSibling,B=M.nextSibling,R=B.firstChild,j=B.nextSibling,P=j.firstChild,I=j.nextSibling,G=I.nextSibling,V=G.firstChild,F=G.nextSibling,U=F.firstChild,z=F.nextSibling,Q=z.firstChild,N=Q.nextSibling,te=N.nextSibling,J=te.nextSibling,ge=J.nextSibling,re=z.nextSibling,Se=re.firstChild,ye=re.nextSibling,ze=ye.firstChild,le=ye.nextSibling,He=le.firstChild,lt=He.nextSibling,dt=lt.nextSibling,Ne=dt.firstChild,Fe=Ne.nextSibling,Z=Fe.nextSibling,Te=Z.nextSibling,tt=Te.nextSibling,$e=tt.nextSibling,ue=$e.nextSibling,X=ue.nextSibling,se=X.nextSibling,ie=se.nextSibling,Ce=ie.nextSibling,gt=Ce.nextSibling,we=le.nextSibling,Je=we.firstChild,Be=we.nextSibling,Tn=Be.firstChild,Vt=Be.nextSibling,hn=Vt.firstChild,Fn=hn.nextSibling,ir=Vt.nextSibling,Ji=ir.firstChild,jr=ir.nextSibling,rl=jr.firstChild,fo=jr.nextSibling,ho=fo.firstChild,go=ho.nextSibling,es=go.nextSibling,kh=es.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,Rh=Ih.nextSibling,Nh=Rh.nextSibling,hx=Nh.nextSibling;return oe(n,"id",`a-${e}`),oe(r,"fill",`url(#a-${e})`),oe(s,"id",`am-${e}`),oe(o,"id",`b-${e}`),oe(a,"filter",`url(#am-${e})`),oe(l,"mask",`url(#b-${e})`),oe(c,"id",`ah-${e}`),oe(d,"id",`k-${e}`),oe(f,"filter",`url(#ah-${e})`),oe(h,"mask",`url(#k-${e})`),oe(m,"id",`ae-${e}`),oe(p,"id",`j-${e}`),oe(v,"filter",`url(#ae-${e})`),oe(b,"mask",`url(#j-${e})`),oe(C,"id",`ai-${e}`),oe(w,"id",`i-${e}`),oe(k,"filter",`url(#ai-${e})`),oe(x,"mask",`url(#i-${e})`),oe(O,"id",`aj-${e}`),oe(E,"id",`h-${e}`),oe(T,"filter",`url(#aj-${e})`),oe(M,"mask",`url(#h-${e})`),oe(R,"id",`ag-${e}`),oe(j,"id",`g-${e}`),oe(P,"filter",`url(#ag-${e})`),oe(I,"mask",`url(#g-${e})`),oe(V,"id",`af-${e}`),oe(F,"id",`f-${e}`),oe(U,"filter",`url(#af-${e})`),oe(z,"mask",`url(#f-${e})`),oe(J,"id",`m-${e}`),oe(ge,"fill",`url(#m-${e})`),oe(Se,"id",`ak-${e}`),oe(ye,"id",`e-${e}`),oe(ze,"filter",`url(#ak-${e})`),oe(le,"mask",`url(#e-${e})`),oe(He,"id",`n-${e}`),oe(lt,"fill",`url(#n-${e})`),oe(Ne,"id",`r-${e}`),oe(Fe,"fill",`url(#r-${e})`),oe(Z,"id",`s-${e}`),oe(Te,"fill",`url(#s-${e})`),oe(tt,"id",`q-${e}`),oe($e,"fill",`url(#q-${e})`),oe(ue,"id",`p-${e}`),oe(X,"fill",`url(#p-${e})`),oe(se,"id",`o-${e}`),oe(ie,"fill",`url(#o-${e})`),oe(Ce,"id",`l-${e}`),oe(gt,"fill",`url(#l-${e})`),oe(Je,"id",`al-${e}`),oe(Be,"id",`d-${e}`),oe(Tn,"filter",`url(#al-${e})`),oe(Vt,"mask",`url(#d-${e})`),oe(hn,"id",`u-${e}`),oe(Fn,"fill",`url(#u-${e})`),oe(Ji,"id",`ad-${e}`),oe(jr,"id",`c-${e}`),oe(rl,"filter",`url(#ad-${e})`),oe(fo,"mask",`url(#c-${e})`),oe(ho,"id",`t-${e}`),oe(go,"fill",`url(#t-${e})`),oe(es,"id",`v-${e}`),oe(kh,"stroke",`url(#v-${e})`),oe(Oh,"id",`aa-${e}`),oe(Eh,"stroke",`url(#aa-${e})`),oe(Ah,"id",`w-${e}`),oe(Th,"stroke",`url(#w-${e})`),oe(Ph,"id",`ac-${e}`),oe(jh,"stroke",`url(#ac-${e})`),oe(Mh,"id",`ab-${e}`),oe($h,"stroke",`url(#ab-${e})`),oe(Lh,"id",`y-${e}`),oe(Dh,"stroke",`url(#y-${e})`),oe(Ih,"id",`x-${e}`),oe(Rh,"stroke",`url(#x-${e})`),oe(Nh,"id",`z-${e}`),oe(hx,"stroke",`url(#z-${e})`),t})()}var p$=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>'),v$=he('<button title="Copy object to clipboard">'),b$=he('<button title="Remove all items"aria-label="Remove all items">'),x$=he('<button title="Delete item"aria-label="Delete item">'),w$=he('<button title="Toggle value"aria-label="Toggle value">'),S$=he('<button title="Bulk Edit Data"aria-label="Bulk Edit Data">'),Po=he("<div>"),C$=he("<div><button> <span></span> <span> "),_$=he("<input>"),Pm=he("<span>"),k$=he("<div><span>:"),O$=he("<div><div><button> [<!>...<!>]");function E$(e,t){let n=0;const r=[];for(;n<e.length;)r.push(e.slice(n,n+t)),n=n+t;return r}var jm=e=>{const t=xt(),n=me().shadowDOMTarget?Me.bind({target:me().shadowDOMTarget}):Me,r=K(()=>t()==="dark"?co(n):uo(n));return(()=>{var i=p$();return be(()=>ae(i,fe(r().expander,n`
70
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ZA(e,t){if(e){if(typeof e=="string")return qy(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)?qy(e,t):void 0}}function qy(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 JA(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 eT(e){if(Array.isArray(e))return e}var tT=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(T,M){var B=T.endsWith("/")?T.slice(0,-1):T,R=M.startsWith("/")?M:"/".concat(M);return B+R||"/"},w=q.useState(!!(a||l)),k=YA(w,2),x=k[0],_=k[1],O={onAddSubscription:S,onLogout:v,onNavigate:m,DebugInfo:u,basename:d,subpath:h};return q.useEffect(function(){l&&s2(l),j5(typeof a!="function"?function(){return a}:a),_(!1)},[l,a]),x?y.jsx("div",{className:i,style:s,children:y.jsx(A.Spinner,{})}):y.jsx("div",{className:i,style:s,children:y.jsxs(aw,{initialEntries:[C(d,h)],basename:d||"/",children:[y.jsx(QA,{subpath:h,onNavigate:m}),y.jsx(A.Root,{context:{isRtl:r},children:y.jsx(WA,{DebugInfo:u,hostAppProps:O})})]})})},nT=e=>e!=null,rT=e=>e.filter(nT);function iT(e){return(...t)=>{for(const n of e)n&&n(...t)}}var ee=e=>typeof e=="function"&&!e.length?e():e,tf=e=>Array.isArray(e)?e:e?[e]:[];function sT(e,...t){return typeof e=="function"?e(...t):e}var oT=_e;function aT(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 lT(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&&kr(()=>{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 _b=lT,uT=e=>(typeof e.clear=="function"||(e.clear=()=>{let t;for(;t=e.key(0);)e.removeItem(t)}),e),zy=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=uT({_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}${zy(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${zy({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}}),cT=1024,Ui=796,eh=700,dT="bottom-right",nf="bottom",kb="system",fT=!1,Ob=500,hT=500,Eb=500,gT=Object.keys(Od)[0],Hy=1,yT=Object.keys(Ed)[0],th=wt({client:void 0,onlineManager:void 0,queryFlavor:"",version:"",shadowDOMTarget:void 0});function me(){return St(th)}var Ab=wt(void 0),Tb=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)}),[...(me().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)}}),Pu(["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||hT))}),xe(()=>{const o=(me().shadowDOMTarget||document).querySelector("#_goober"),a=t();if(o&&a){const l=new MutationObserver(()=>{const u=(me().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 L(Ab.Provider,{value:s,get children(){return e.children}})},nh=()=>K(()=>{const t=St(Ab);if(!t)throw new Error("usePiPWindow must be used within a PiPProvider");return t()}),rh=wt(()=>"dark");function xt(){return St(rh)}var Pb={À:"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"},mT=Object.keys(Pb).join("|"),pT=new RegExp(mT,"g");function vT(e){return e.replace(pT,t=>Pb[t])}var qt={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function Uy(e,t,n){var r;if(n=n||{},n.threshold=(r=n.threshold)!=null?r:qt.MATCHES,!n.accessors){const o=Gy(e,t,n);return{rankedValue:e,rank:o,accessorIndex:-1,accessorThreshold:n.threshold,passed:o>=n.threshold}}const i=ST(e,n.accessors),s={rankedValue:e,rank:qt.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let o=0;o<i.length;o++){const a=i[o];let l=Gy(a.itemValue,t,n);const{minRanking:u,maxRanking:c,threshold:d=n.threshold}=a.attributes;l<u&&l>=qt.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 Gy(e,t,n){return e=Ky(e,n),t=Ky(t,n),t.length>e.length?qt.NO_MATCH:e===t?qt.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?qt.EQUAL:e.startsWith(t)?qt.STARTS_WITH:e.includes(` ${t}`)?qt.WORD_STARTS_WITH:e.includes(t)?qt.CONTAINS:t.length===1?qt.NO_MATCH:bT(e).includes(t)?qt.ACRONYM:xT(e,t))}function bT(e){let t="";return e.split(" ").forEach(r=>{r.split("-").forEach(s=>{t+=s.substr(0,1)})}),t}function xT(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 qt.MATCHES+c*u}const o=i(t[0],e,0);if(o<0)return qt.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 qt.NO_MATCH}const a=r-o;return s(a)}function Ky(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=vT(e)),e}function wT(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 ST(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const s=t[r],o=CT(s),a=wT(e,s);for(let l=0,u=a.length;l<u;l++)n.push({itemValue:a[l],attributes:o})}return n}var Vy={maxRanking:1/0,minRanking:-1/0};function CT(e){return typeof e=="function"?Vy:{...Vy,...e}}var _T={data:""},kT=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||_T,OT=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,ET=/\/\*[^]*?\*\/| +/g,Wy=/\n+/g,bi=(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"?bi(o,s):s+"{"+bi(o,s[1]=="k"?"":t)+"}":typeof o=="object"?r+=bi(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+=bi.p?bi.p(s,o):s+":"+o+";")}return n+(t&&i?t+"{"+i+"}":i)+r},lr={},jb=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+jb(e[n]);return t}return e},AT=(e,t,n,r,i)=>{let s=jb(e),o=lr[s]||(lr[s]=(l=>{let u=0,c=11;for(;u<l.length;)c=101*c+l.charCodeAt(u++)>>>0;return"go"+c})(s));if(!lr[o]){let l=s!==e?e:(u=>{let c,d,f=[{}];for(;c=OT.exec(u.replace(ET,""));)c[4]?f.shift():c[3]?(d=c[3].replace(Wy," ").trim(),f.unshift(f[0][d]=f[0][d]||{})):f[0][c[1]]=c[2].replace(Wy," ").trim();return f[0]})(e);lr[o]=bi(i?{["@keyframes "+o]:l}:l,n?"":"."+o)}let a=n&&lr.g?lr.g:null;return n&&(lr.g=lr[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)})(lr[o],t,r,a),o},TT=(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?"":bi(a,""):a===!1?"":a}return r+i+(o==null?"":o)},"");function Me(e){let t=this||{},n=e.call?e(t.p):e;return AT(n.unshift?n.raw?TT(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,kT(t.target),t.g,t.o,t.k)}Me.bind({g:1});Me.bind({k:1});function Mb(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=Mb(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=Mb(e))&&(r&&(r+=" "),r+=t);return r}function PT(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[Eu],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 Rt(...e){return iT(e)}var Qy=e=>e instanceof Element;function rf(e,t){if(t(e))return e;if(typeof e=="function"&&!e.length)return rf(e(),t);if(Array.isArray(e)){const n=[];for(const r of e){const i=rf(r,t);i&&(Array.isArray(i)?n.push.apply(n,i):n.push(i))}return n.length?n:null}return null}function jT(e,t=Qy,n=Qy){const r=K(e),i=K(()=>rf(r(),t));return i.toArray=()=>{const s=i();return Array.isArray(s)?s:s?[s]:[]},i}function MT(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 $b(e){requestAnimationFrame(()=>requestAnimationFrame(e))}function $T(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())}),$b(()=>{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 LT(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()),$b(()=>{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 Yy=e=>{const t=MT(e);return PT(jT(()=>e.children).toArray,{appear:e.appear,onChange({added:n,removed:r,finishRemoved:i,list:s}){const o=t();for(const l of n)$T(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)LT(o,e,l,()=>i([l]))}})},Wc=Symbol("fallback");function Xy(e){for(const t of e)t.dispose()}function DT(e,t,n,r={}){const i=new Map;return _e(()=>Xy(i.values())),()=>{const o=e()||[];return o[Eu],at(()=>{var c,d;if(!o.length)return Xy(i.values()),i.clear(),r.fallback?[wr(h=>(i.set(Wc,{dispose:h}),r.fallback()))]:[];const a=new Array(o.length),l=i.get(Wc);if(!i.size||l){l==null||l.dispose(),i.delete(Wc);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){wr(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 mu(e){const{by:t}=e;return K(DT(()=>e.each,typeof t=="function"?t:n=>n[t],e.children,"fallback"in e?{fallback:()=>e.fallback}:void 0))}function IT(e,t,n,r){return e.addEventListener(t,n,r),oT(e.removeEventListener.bind(e,t,n,r))}function RT(e,t,n,r){const i=()=>{tf(ee(e)).forEach(s=>{s&&tf(ee(t)).forEach(o=>IT(s,o,n,r))})};typeof e=="function"?xe(i):be(i)}function NT(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 Lb(e,t,n){const r=new WeakMap,{observe:i,unobserve:s}=NT(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=rT(tf(ee(e)));return aT(a,o,i,s),a},[])}var FT=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function Zy(e){const t={};let n;for(;n=FT.exec(e);)t[n[1]]=n[2];return t}function tc(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=Zy(e)}else typeof t=="string"&&(t=Zy(t));return{...e,...t}}function BT(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function sf(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function qT(e){return typeof e=="number"}function as(e){return Object.prototype.toString.call(e)==="[object String]"}function zT(e){return typeof e=="function"}function Xa(e){return t=>`${e()}-${t}`}function Sn(e,t){return e?e===t||e.contains(t):!1}function qo(e,t=!1){const{activeElement:n}=tr(e);if(!(n!=null&&n.nodeName))return null;if(Db(n)&&n.contentDocument)return qo(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 HT(e){return tr(e).defaultView||window}function tr(e){return e?e.ownerDocument||e:document}function Db(e){return e.tagName==="IFRAME"}var ih=(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))(ih||{});function sh(e){var t;return typeof window!="undefined"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)==null?void 0:t.platform)||window.navigator.platform):!1}function nc(){return sh(/^Mac/i)}function UT(){return sh(/^iPhone/i)}function GT(){return sh(/^iPad/i)||nc()&&navigator.maxTouchPoints>1}function KT(){return UT()||GT()}function VT(){return nc()||KT()}function nt(e,t){return t&&(zT(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 WT(e){return nc()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function At(e){if(e)if(QT())e.focus({preventScroll:!0});else{const t=YT(e);e.focus(),XT(t)}}var Tl=null;function QT(){if(Tl==null){Tl=!1;try{document.createElement("div").focus({get preventScroll(){return Tl=!0,!0}})}catch(e){}}return Tl}function YT(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 XT(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var Ib=["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'])"],ZT=[...Ib,'[tabindex]:not([tabindex="-1"]):not([disabled])'],oh=Ib.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",JT=ZT.join(':not([hidden]):not([tabindex="-1"]),');function Rb(e,t){const r=Array.from(e.querySelectorAll(oh)).filter(Jy);return t&&Jy(e)&&r.unshift(e),r.forEach((i,s)=>{if(Db(i)&&i.contentDocument){const o=i.contentDocument.body,a=Rb(o,!1);r.splice(s,1,...a)}}),r}function Jy(e){return Nb(e)&&!eP(e)}function Nb(e){return e.matches(oh)&&ah(e)}function eP(e){return parseInt(e.getAttribute("tabindex")||"0",10)<0}function ah(e,t){return e.nodeName!=="#comment"&&tP(e)&&nP(e,t)&&(!e.parentElement||ah(e.parentElement,e))}function tP(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 nP(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function rP(e,t,n){const r=t!=null&&t.tabbable?JT:oh,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)&&ah(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 em(e){for(;e&&!iP(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function iP(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function sP(){}function oP(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 Ao=new Map,tm=new Set;function nm(){if(typeof window=="undefined")return;const e=n=>{if(!n.target)return;let r=Ao.get(n.target);r||(r=new Set,Ao.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=Ao.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Ao.delete(n.target)),Ao.size===0)){for(const i of tm)i();tm.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document!="undefined"&&(document.readyState!=="loading"?nm():document.addEventListener("DOMContentLoaded",nm));function of(e,t){const n=rm(e,t,"left"),r=rm(e,t,"top"),i=t.offsetWidth,s=t.offsetHeight;let o=e.scrollLeft,a=e.scrollTop;const l=o+e.offsetWidth,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 rm(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){i-=e[r];break}t=t.offsetParent}return i}function aP(e,t){var n,r;if(document.contains(e)){const i=document.scrollingElement||document.documentElement;if(window.getComputedStyle(i).overflow==="hidden"){let o=em(e);for(;e&&o&&e!==i&&o!==i;)of(o,e),e=o,o=em(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 Fb={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 rc(e,t){const[n,r]=ce(im(t==null?void 0:t()));return xe(()=>{var i;r(((i=e())==null?void 0:i.tagName.toLowerCase())||im(t==null?void 0:t()))}),n}function im(e){return as(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 L(lS,Ae(n,{get component(){return t.as}}))}var lP=["id","name","validationState","required","disabled","readOnly"];function uP(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":ee(n.validationState)==="valid"?"":void 0,"data-invalid":ee(n.validationState)==="invalid"?"":void 0,"data-required":ee(n.required)?"":void 0,"data-disabled":ee(n.disabled)?"":void 0,"data-readonly":ee(n.readOnly)?"":void 0}));return{formControlContext:{name:()=>{var m;return(m=ee(n.name))!=null?m:ee(n.id)},dataset:h,validationState:()=>ee(n.validationState),isRequired:()=>ee(n.required),isDisabled:()=>ee(n.disabled),isReadOnly:()=>ee(n.readOnly),labelId:r,fieldId:s,descriptionId:a,errorMessageId:u,getAriaLabelledBy:d,getAriaDescribedBy:f,generateId:Xa(()=>ee(n.id)),registerLabel:Cn(i),registerField:Cn(o),registerDescription:Cn(l),registerErrorMessage:Cn(c)}}}var Bb=wt();function Za(){const e=St(Bb);if(e===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function qb(e){const t=Za(),n=Re({id:t.generateId("description")},e);return xe(()=>_e(t.registerDescription(n.id))),L(st,Ae({as:"div"},()=>t.dataset(),n))}function zb(e){const t=Za(),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))}),L(ve,{get when(){return r.forceMount||s()},get children(){return L(st,Ae({as:"div"},()=>t.dataset(),i))}})}function cP(e){let t;const n=Za(),r=Re({id:n.generateId("label")},e),[i,s]=Ve(r,["ref"]),o=rc(()=>t,()=>"label");return xe(()=>_e(n.registerLabel(s.id))),L(st,Ae({as:"label",ref(a){const l=Rt(u=>t=u,i.ref);typeof l=="function"&&l(a)},get for(){return K(()=>o()==="label")()?n.fieldId():void 0}},()=>n.dataset(),s))}function dP(e,t){xe(_r(e,n=>{if(n==null)return;const r=fP(n);r!=null&&(r.addEventListener("reset",t,{passive:!0}),_e(()=>{r.removeEventListener("reset",t)}))}))}function fP(e){return hP(e)?e.form:e.closest("form")}function hP(e){return e.matches("textarea, input, select, button")}function Ja(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=sT(a,i());return Object.is(l,i())||(r()||n(l),(u=e.onChange)==null||u.call(e,l)),l})}]}function Hb(e){const[t,n]=Ja(e);return[()=>{var i;return(i=t())!=null?i:!1},n]}function gP(e){const[t,n]=Ja(e);return[()=>{var i;return(i=t())!=null?i:[]},n]}function yP(e={}){const[t,n]=Hb({value:()=>ee(e.isSelected),defaultValue:()=>!!ee(e.defaultIsSelected),onChange:s=>{var o;return(o=e.onSelectedChange)==null?void 0:o.call(e,s)}});return{isSelected:t,setIsSelected:s=>{!ee(e.isReadOnly)&&!ee(e.isDisabled)&&n(s)},toggle:()=>{!ee(e.isReadOnly)&&!ee(e.isDisabled)&&n(!t())}}}var mP=Object.defineProperty,ic=(e,t)=>{for(var n in t)mP(e,n,{get:t[n],enumerable:!0})},Ub=wt();function Gb(){return St(Ub)}function pP(){const e=Gb();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function Kb(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function vP(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&&Kb(s,n))return r+1}return 0}function bP(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:Kb(a,l)?(r>s&&(n=!0),-1):(r<s&&(n=!0),1)}),n?t.map(([r,i])=>i):e}function Vb(e,t){const n=bP(e);e!==n&&t(n)}function xP(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 wP(e,t){xe(()=>{const n=setTimeout(()=>{Vb(e(),t)});_e(()=>clearTimeout(n))})}function SP(e,t){if(typeof IntersectionObserver!="function"){wP(e,t);return}let n=[];xe(()=>{const r=()=>{const o=!!n.length;n=e(),o&&Vb(e(),t)},i=xP(e()),s=new IntersectionObserver(r,{root:i});for(const o of e()){const a=o.ref();a&&s.observe(a)}_e(()=>s.disconnect())})}function CP(e={}){const[t,n]=gP({value:()=>ee(e.items),onChange:s=>{var o;return(o=e.onItemsChange)==null?void 0:o.call(e,s)}});SP(t,n);const r=s=>(n(o=>{const a=vP(o,s);return BT(o,s,a)}),()=>{n(o=>{const a=o.filter(l=>l.ref()!==s.ref());return o.length===a.length?o:a})});return{DomCollectionProvider:s=>L(Ub.Provider,{value:{registerItem:r},get children(){return s.children}})}}function _P(e){const t=pP(),n=Re({shouldRegisterItem:!0},e);xe(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());_e(r)})}function Wb(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=as(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=as(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=as(f)?d[f]:f(d))!=null?g:!1},a=d=>{var f;if(d!=null)return as(e.getSectionChildren)?d[e.getSectionChildren]:(f=e.getSectionChildren)==null?void 0:f.call(e,d)};for(const d of e.dataSource){if(as(d)||qT(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=Wb({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 kP(e,t=[]){return K(()=>{const n=Wb({dataSource:ee(e.dataSource),getKey:ee(e.getKey),getTextValue:ee(e.getTextValue),getDisabled:ee(e.getDisabled),getSectionChildren:ee(e.getSectionChildren)});for(let r=0;r<t.length;r++)t[r]();return e.factory(n)})}var OP=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),EP=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function AP(e){var n;if(Intl.Locale){const r=(n=new Intl.Locale(e).maximize().script)!=null?n:"";return OP.has(r)}const t=e.split("-")[0];return EP.has(t)}function TP(e){return AP(e)?"rtl":"ltr"}function Qb(){let e=typeof navigator!="undefined"&&(navigator.language||navigator.userLanguage)||"en-US";return{locale:e,direction:TP(e)}}var af=Qb(),zo=new Set;function sm(){af=Qb();for(const e of zo)e(af)}function PP(){const[e,t]=ce(af),n=K(()=>e());return kr(()=>{zo.size===0&&window.addEventListener("languagechange",sm),zo.add(t),_e(()=>{zo.delete(t),zo.size===0&&window.removeEventListener("languagechange",sm)})}),{locale:()=>n().locale,direction:()=>n().direction}}var jP=wt();function ci(){const e=PP();return St(jP)||e}var Qc=new Map;function MP(e){const{locale:t}=ci(),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 Qc.has(r)&&(i=Qc.get(r)),i||(i=new Intl.Collator(t(),e),Qc.set(r,i)),i})}var hr=class Yb extends Set{constructor(n,r,i){super(n);pe(this,"anchorKey");pe(this,"currentKey");n instanceof Yb?(this.anchorKey=r||n.anchorKey,this.currentKey=i||n.currentKey):(this.anchorKey=r,this.currentKey=i)}};function $P(e){const[t,n]=Ja(e);return[()=>{var i;return(i=t())!=null?i:new hr},n]}function Xb(e){return VT()?e.altKey:e.ctrlKey}function ls(e){return nc()?e.metaKey:e.ctrlKey}function om(e){return new hr(e)}function LP(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function DP(e){const t=Re({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=ce(!1),[i,s]=ce(),o=K(()=>{const m=ee(t.selectedKeys);return m!=null?om(m):m}),a=K(()=>{const m=ee(t.defaultSelectedKeys);return m!=null?om(m):new hr}),[l,u]=$P({value:o,defaultValue:a,onChange:m=>{var p;return(p=t.onSelectionChange)==null?void 0:p.call(t,m)}}),[c,d]=ce(ee(t.selectionBehavior)),f=()=>ee(t.selectionMode),h=()=>{var m;return(m=ee(t.disallowEmptySelection))!=null?m:!1},g=m=>{(ee(t.allowDuplicateSelectionEvents)||!LP(m,l()))&&u(m)};return xe(()=>{const m=l();ee(t.selectionBehavior)==="replace"&&c()==="toggle"&&typeof m=="object"&&m.size===0&&d("replace")}),xe(()=>{var m;d((m=ee(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 IP(e){const[t,n]=ce(""),[r,i]=ce(-1);return{typeSelectHandlers:{onKeyDown:o=>{var f,h,g;if(ee(e.isDisabled))return;const a=ee(e.keyboardDelegate),l=ee(e.selectionManager);if(!a.getKeyForSearch)return;const u=RP(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&&NP(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 RP(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function NP(e){return e.split("").every(t=>t===e[0])}function FP(e,t,n){const i=Ae({selectOnFocus:()=>ee(e.selectionManager).selectionBehavior()==="replace"},e),s=()=>t(),{direction:o}=ci();let a={top:0,left:0};RT(()=>ee(i.isVirtualized)?void 0:s(),"scroll",()=>{const p=s();p&&(a={top:p.scrollTop,left:p.scrollLeft})});const{typeSelectHandlers:l}=IP({isDisabled:()=>ee(i.disallowTypeAhead),keyboardDelegate:()=>ee(i.keyboardDelegate),selectionManager:()=>ee(i.selectionManager)}),u=()=>{var p;return(p=ee(i.orientation))!=null?p:"vertical"},c=p=>{var _,O,E,T,M,B,R,j;nt(p,l.onKeyDown),p.altKey&&p.key==="Tab"&&p.preventDefault();const v=t();if(!(v!=null&&v.contains(p.target)))return;const b=ee(i.selectionManager),S=ee(i.selectOnFocus),C=P=>{P!=null&&(b.setFocusedKey(P),p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(P):S&&!Xb(p)&&b.replaceSelection(P))},w=ee(i.keyboardDelegate),k=ee(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&&k&&(P=(O=w.getFirstKey)==null?void 0:O.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&&k&&(P=(T=w.getLastKey)==null?void 0:T.call(w,x)),C(P)}break}case(u()==="vertical"?"ArrowLeft":"ArrowUp"):{if(w.getKeyLeftOf){p.preventDefault();const P=o()==="rtl";let I;x!=null?I=w.getKeyLeftOf(x):I=P?(M=w.getFirstKey)==null?void 0:M.call(w):(B=w.getLastKey)==null?void 0:B.call(w),C(I)}break}case(u()==="vertical"?"ArrowRight":"ArrowDown"):{if(w.getKeyRightOf){p.preventDefault();const P=o()==="rtl";let I;x!=null?I=w.getKeyRightOf(x):I=P?(R=w.getLastKey)==null?void 0:R.call(w):(j=w.getFirstKey)==null?void 0:j.call(w),C(I)}break}case"Home":if(w.getFirstKey){p.preventDefault();const P=w.getFirstKey(x,ls(p));P!=null&&(b.setFocusedKey(P),ls(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,ls(p));P!=null&&(b.setFocusedKey(P),ls(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":ls(p)&&b.selectionMode()==="multiple"&&ee(i.disallowSelectAll)!==!0&&(p.preventDefault(),b.selectAll());break;case"Escape":p.defaultPrevented||(p.preventDefault(),ee(i.disallowEmptySelection)||b.clearSelection());break;case"Tab":if(!ee(i.allowsTabNavigation)){if(p.shiftKey)v.focus();else{const P=rP(v,{tabbable:!0});let I,G;do G=P.lastChild(),G&&(I=G);while(G);I&&!I.contains(document.activeElement)&&At(I)}break}}},d=p=>{var C,w,k,x;const v=ee(i.selectionManager),b=ee(i.keyboardDelegate),S=ee(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))},O=p.relatedTarget;O&&p.currentTarget.compareDocumentPosition(O)&Node.DOCUMENT_POSITION_FOLLOWING?_((w=v.lastSelectedKey())!=null?w:(C=b.getLastKey)==null?void 0:C.call(b)):_((x=v.firstSelectedKey())!=null?x:(k=b.getFirstKey)==null?void 0:k.call(b))}else if(!ee(i.isVirtualized)){const _=s();if(_){_.scrollTop=a.top,_.scrollLeft=a.left;const O=_.querySelector(`[data-key="${v.focusedKey()}"]`);O&&(At(O),of(_,O))}}}},f=p=>{const v=ee(i.selectionManager);p.currentTarget.contains(p.relatedTarget)||v.setFocused(!1)},h=p=>{s()===p.target&&p.preventDefault()},g=()=>{var k,x;const p=ee(i.autoFocus);if(!p)return;const v=ee(i.selectionManager),b=ee(i.keyboardDelegate);let S;p==="first"&&(S=(k=b.getFirstKey)==null?void 0:k.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&&!ee(i.shouldUseVirtualFocus)&&At(w)};return kr(()=>{i.deferAutoFocus?setTimeout(g,0):g()}),xe(_r([s,()=>ee(i.isVirtualized),()=>ee(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&&of(v,w)}})),{tabIndex:K(()=>{if(!ee(i.shouldUseVirtualFocus))return ee(i.selectionManager).focusedKey()==null?0:-1}),onKeyDown:c,onMouseDown:h,onFocusIn:d,onFocusOut:f}}function Zb(e,t){const n=()=>ee(e.selectionManager),r=()=>ee(e.key),i=()=>ee(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"||ls(b)||"pointerType"in b&&b.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},o=()=>n().isSelected(r()),a=()=>ee(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&&!ee(e.shouldSelectOnPressUp)&&s(b))},d=b=>{l()&&b.pointerType==="mouse"&&b.button===0&&ee(e.shouldSelectOnPressUp)&&ee(e.allowsDifferentPressOrigin)&&s(b)},f=b=>{l()&&(ee(e.shouldSelectOnPressUp)&&!ee(e.allowsDifferentPressOrigin)||u!=="mouse")&&s(b)},h=b=>{!l()||!["Enter"," "].includes(b.key)||(Xb(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(()=>ee(e.virtualized)?void 0:r());return xe(_r([t,r,i,()=>n().focusedKey(),()=>n().isFocused()],([b,S,C,w,k])=>{b&&S===w&&k&&!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 BP=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 hr(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 hr(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 hr([t],t,t):new hr;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode()==="none")return;const t=new hr;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 hr)}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}},am=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 qP(e){const t=DP(e),r=kP({dataSource:()=>ee(e.dataSource),getKey:()=>ee(e.getKey),getTextValue:()=>ee(e.getTextValue),getDisabled:()=>ee(e.getDisabled),getSectionChildren:()=>ee(e.getSectionChildren),factory:s=>e.filter?new am(e.filter(s)):new am(s)},[()=>e.filter]),i=new BP(r,t);return ev(()=>{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,zP=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}},HP=zP,Jb=HP,pu="data-kb-top-layer",e1,lf=!1,Or=[];function xa(e){return Or.findIndex(t=>t.node===e)}function UP(e){return Or[xa(e)]}function GP(e){return Or[Or.length-1].node===e}function t1(){return Or.filter(e=>e.isPointerBlocking)}function KP(){return[...t1()].slice(-1)[0]}function lh(){return t1().length>0}function n1(e){var n;const t=xa((n=KP())==null?void 0:n.node);return xa(e)<t}function VP(e){Or.push(e)}function WP(e){const t=xa(e);t<0||Or.splice(t,1)}function QP(){for(const{node:e}of Or)e.style.pointerEvents=n1(e)?"none":"auto"}function YP(e){if(lh()&&!lf){const t=tr(e);e1=document.body.style.pointerEvents,t.body.style.pointerEvents="none",lf=!0}}function XP(e){if(lh())return;const t=tr(e);t.body.style.pointerEvents=e1,t.body.style.length===0&&t.body.removeAttribute("style"),lf=!1}var Wt={layers:Or,isTopMostLayer:GP,hasPointerBlockingLayer:lh,isBelowPointerBlockingLayer:n1,addLayer:VP,removeLayer:WP,indexOf:xa,find:UP,assignPointerEventToLayers:QP,disableBodyPointerEvents:YP,restoreBodyPointerEvents:XP},ZP={};ic(ZP,{Button:()=>tj,Root:()=>uh});var JP=["button","color","file","image","reset","submit"];function ej(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?JP.indexOf(e.type)!==-1:!1}function uh(e){let t;const n=Re({type:"button"},e),[r,i]=Ve(n,["ref","type","disabled"]),s=rc(()=>t,()=>"button"),o=K(()=>{const u=s();return u==null?!1:ej({tagName:u,type:r.type})}),a=K(()=>s()==="input"),l=K(()=>s()==="a"&&(t==null?void 0:t.getAttribute("href"))!=null);return L(st,Ae({as:"button",ref(u){const c=Rt(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 tj=uh,nj=["top","right","bottom","left"],Jn=Math.min,an=Math.max,vu=Math.round,Pl=Math.floor,ri=e=>({x:e,y:e}),rj={left:"right",right:"left",bottom:"top",top:"bottom"},ij={start:"end",end:"start"};function uf(e,t,n){return an(e,Jn(t,n))}function Zi(e,t){return typeof e=="function"?e(t):e}function ii(e){return e.split("-")[0]}function ao(e){return e.split("-")[1]}function r1(e){return e==="x"?"y":"x"}function ch(e){return e==="y"?"height":"width"}function Gi(e){return["top","bottom"].includes(ii(e))?"y":"x"}function dh(e){return r1(Gi(e))}function sj(e,t,n){n===void 0&&(n=!1);const r=ao(e),i=dh(e),s=ch(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=bu(o)),[o,bu(o)]}function oj(e){const t=bu(e);return[cf(e),t,cf(t)]}function cf(e){return e.replace(/start|end/g,t=>ij[t])}function aj(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 lj(e,t,n,r){const i=ao(e);let s=aj(ii(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(cf)))),s}function bu(e){return e.replace(/left|right|bottom|top/g,t=>rj[t])}function uj(e){return{top:0,right:0,bottom:0,left:0,...e}}function i1(e){return typeof e!="number"?uj(e):{top:e,right:e,bottom:e,left:e}}function xu(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 lm(e,t,n){let{reference:r,floating:i}=e;const s=Gi(t),o=dh(t),a=ch(o),l=ii(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(ao(t)){case"start":h[o]-=f*(n&&u?-1:1);break;case"end":h[o]+=f*(n&&u?-1:1);break}return h}var cj=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}=lm(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}=lm(u,f,l)),m=-1)}return{x:c,y:d,placement:f,strategy:i,middlewareData:h}};async function wa(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}=Zi(t,e),g=i1(h),p=a[f?d==="floating"?"reference":"floating":d],v=xu(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=xu(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 dj=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}=Zi(e,t)||{};if(u==null)return{};const d=i1(c),f={x:n,y:r},h=dh(i),g=ch(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],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let x=k?k[S]:0;(!x||!await(o.isElement==null?void 0:o.isElement(k)))&&(x=a.floating[S]||s.floating[g]);const _=C/2-w/2,O=x/2-m[g]/2-1,E=Jn(d[v],O),T=Jn(d[b],O),M=E,B=x-m[g]-T,R=x/2-m[g]/2+_,j=uf(M,R,B),P=!l.arrow&&ao(i)!=null&&R!==j&&s.reference[g]/2-(R<M?E:T)-m[g]/2<0,I=P?R<M?R-M:R-B:0;return{[h]:f[h]+I,data:{[h]:j,centerOffset:R-j-I,...P&&{alignmentOffset:I}},reset:P}}}),fj=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}=Zi(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=ii(i),b=Gi(a),S=ii(a)===a,C=await(l.isRTL==null?void 0:l.isRTL(u.floating)),w=f||(S||!m?[bu(a)]:oj(a)),k=g!=="none";!f&&k&&w.push(...lj(a,m,g,C));const x=[a,...w],_=await wa(t,p),O=[];let E=((r=s.flip)==null?void 0:r.overflows)||[];if(c&&O.push(_[v]),d){const R=sj(i,o,C);O.push(_[R[0]],_[R[1]])}if(E=[...E,{placement:i,overflows:O}],!O.every(R=>R<=0)){var T,M;const R=(((T=s.flip)==null?void 0:T.index)||0)+1,j=x[R];if(j)return{data:{index:R,overflows:E},reset:{placement:j}};let P=(M=E.filter(I=>I.overflows[0]<=0).sort((I,G)=>I.overflows[1]-G.overflows[1])[0])==null?void 0:M.placement;if(!P)switch(h){case"bestFit":{var B;const I=(B=E.filter(G=>{if(k){const W=Gi(G.placement);return W===b||W==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(W=>W>0).reduce((W,F)=>W+F,0)]).sort((G,W)=>G[1]-W[1])[0])==null?void 0:B[0];I&&(P=I);break}case"initialPlacement":P=a;break}if(i!==P)return{reset:{placement:P}}}return{}}}};function um(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function cm(e){return nj.some(t=>e[t]>=0)}var hj=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Zi(e,t);switch(r){case"referenceHidden":{const s=await wa(t,{...i,elementContext:"reference"}),o=um(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:cm(o)}}}case"escaped":{const s=await wa(t,{...i,altBoundary:!0}),o=um(s,n.floating);return{data:{escapedOffsets:o,escaped:cm(o)}}}default:return{}}}}};async function gj(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ii(n),a=ao(n),l=Gi(n)==="y",u=["left","top"].includes(o)?-1:1,c=s&&l?-1:1,d=Zi(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*c,y:f*u}:{x:f*u,y:h*c}}var yj=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 gj(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}}}}},mj=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:p=>{let{x:v,y:b}=p;return{x:v,y:b}}},...l}=Zi(e,t),u={x:n,y:r},c=await wa(t,l),d=Gi(ii(i)),f=r1(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=uf(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=uf(b,g,S)}const m=a.fn({...t,[f]:h,[d]:g});return{...m,data:{x:m.x-n,y:m.y-r}}}}},pj=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:s}=t,{apply:o=()=>{},...a}=Zi(e,t),l=await wa(t,a),u=ii(n),c=ao(n),d=Gi(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,k=S;if(d?k=c||C?Jn(S,v):v:w=c||C?Jn(b,p):p,C&&!c){const _=an(l.left,0),O=an(l.right,0),E=an(l.top,0),T=an(l.bottom,0);d?k=f-2*(_!==0||O!==0?_+O:an(l.left,l.right)):w=h-2*(E!==0||T!==0?E+T:an(l.top,l.bottom))}await o({...t,availableWidth:k,availableHeight:w});const x=await i.getDimensions(s.floating);return f!==x.width||h!==x.height?{reset:{rects:!0}}:{}}}};function lo(e){return s1(e)?(e.nodeName||"").toLowerCase():"#document"}function cn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Tr(e){var t;return(t=(s1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function s1(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 dm(e){return typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof cn(e).ShadowRoot}function el(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 vj(e){return["table","td","th"].includes(lo(e))}function sc(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(n){return!1}})}function fh(e){const t=hh(),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 bj(e){let t=si(e);for(;nr(t)&&!Zs(t);){if(fh(t))return t;if(sc(t))return null;t=si(t)}return null}function hh(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Zs(e){return["html","body","#document"].includes(lo(e))}function Dn(e){return cn(e).getComputedStyle(e)}function oc(e){return Ln(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function si(e){if(lo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||dm(e)&&e.host||Tr(e);return dm(t)?t.host:t}function o1(e){const t=si(e);return Zs(t)?e.ownerDocument?e.ownerDocument.body:e.body:nr(t)&&el(t)?t:o1(t)}function Sa(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=o1(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=cn(i);return s?t.concat(o,o.visualViewport||[],el(i)?i:[],o.frameElement&&n?Sa(o.frameElement):[]):t.concat(i,Sa(i,[],n))}function a1(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=vu(n)!==s||vu(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function gh(e){return Ln(e)?e:e.contextElement}function ms(e){const t=gh(e);if(!nr(t))return ri(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=a1(t);let o=(s?vu(n.width):n.width)/r,a=(s?vu(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}var xj=ri(0);function l1(e){const t=cn(e);return!hh()||!t.visualViewport?xj:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function wj(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==cn(e)?!1:t}function Ki(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=gh(e);let o=ri(1);t&&(r?Ln(r)&&(o=ms(r)):o=ms(e));const a=wj(s,n,r)?l1(s):ri(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=ms(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 xu({width:c,height:d,x:l,y:u})}function Sj(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",o=Tr(r),a=t?sc(t.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=ri(1);const c=ri(0),d=nr(r);if((d||!d&&!s)&&((lo(r)!=="body"||el(o))&&(l=oc(r)),nr(r))){const f=Ki(r);u=ms(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 Cj(e){return Array.from(e.getClientRects())}function u1(e){return Ki(Tr(e)).left+oc(e).scrollLeft}function _j(e){const t=Tr(e),n=oc(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+u1(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 kj(e,t){const n=cn(e),r=Tr(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=hh();(!u||u&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function Oj(e,t){const n=Ki(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=nr(e)?ms(e):ri(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 fm(e,t,n){let r;if(t==="viewport")r=kj(e,n);else if(t==="document")r=_j(Tr(e));else if(Ln(t))r=Oj(t,n);else{const i=l1(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return xu(r)}function c1(e,t){const n=si(e);return n===t||!Ln(n)||Zs(n)?!1:Dn(n).position==="fixed"||c1(n,t)}function Ej(e,t){const n=t.get(e);if(n)return n;let r=Sa(e,[],!1).filter(a=>Ln(a)&&lo(a)!=="body"),i=null;const s=Dn(e).position==="fixed";let o=s?si(e):e;for(;Ln(o)&&!Zs(o);){const a=Dn(o),l=fh(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||el(o)&&!l&&c1(e,o))?r=r.filter(c=>c!==o):i=a,o=si(o)}return t.set(e,r),r}function Aj(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?sc(t)?[]:Ej(t,this._c):[].concat(n),r],a=o[0],l=o.reduce((u,c)=>{const d=fm(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},fm(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Tj(e){const{width:t,height:n}=a1(e);return{width:t,height:n}}function Pj(e,t,n){const r=nr(t),i=Tr(t),s=n==="fixed",o=Ki(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=ri(0);if(r||!r&&!s)if((lo(t)!=="body"||el(i))&&(a=oc(t)),r){const d=Ki(t,!0,s,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&(l.x=u1(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 Yc(e){return Dn(e).position==="static"}function hm(e,t){return!nr(e)||Dn(e).position==="fixed"?null:t?t(e):e.offsetParent}function d1(e,t){const n=cn(e);if(sc(e))return n;if(!nr(e)){let i=si(e);for(;i&&!Zs(i);){if(Ln(i)&&!Yc(i))return i;i=si(i)}return n}let r=hm(e,t);for(;r&&vj(r)&&Yc(r);)r=hm(r,t);return r&&Zs(r)&&Yc(r)&&!fh(r)?n:r||bj(e)||n}var jj=async function(e){const t=this.getOffsetParent||d1,n=this.getDimensions,r=await n(e.floating);return{reference:Pj(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Mj(e){return Dn(e).direction==="rtl"}var f1={convertOffsetParentRelativeRectToViewportRelativeRect:Sj,getDocumentElement:Tr,getClippingRect:Aj,getOffsetParent:d1,getElementRects:jj,getClientRects:Cj,getDimensions:Tj,getScale:ms,isElement:Ln,isRTL:Mj};function $j(e,t){let n=null,r;const i=Tr(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=Pl(c),g=Pl(i.clientWidth-(u+d)),m=Pl(i.clientHeight-(c+f)),p=Pl(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 k=w[0].intersectionRatio;if(k!==l){if(!S)return o();k?o(!1,k):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 Lj(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=gh(e),c=i||s?[...u?Sa(u):[],...Sa(t)]:[];c.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const d=u&&a?$j(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?Ki(e):null;l&&p();function p(){const v=Ki(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 Dj=yj,Ij=mj,Rj=fj,Nj=pj,Fj=hj,Bj=dj,qj=(e,t,n)=>{const r=new Map,i={platform:f1,...n},s={...i.platform,_c:r};return cj(e,t,{...i,platform:s})},yh=wt();function mh(){const e=St(yh);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var zj=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">'),df=30,gm=df/2,Hj={top:180,right:-90,bottom:0,left:90};function ph(e){const t=mh(),n=Re({size:df},e),[r,i]=Ve(n,["ref","style","size"]),s=()=>t.currentPlacement().split("-")[0],o=Uj(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*(df/r.size),d=()=>`rotate(${Hj[s()]} ${gm} ${gm}) translate(0 2)`;return L(st,Ae({as:"div",ref(f){const h=Rt(t.setArrowRef,r.ref);typeof h=="function"&&h(f)},"aria-hidden":"true",get style(){return tc({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=zj(),h=f.firstChild;return be(()=>oe(h,"transform",d())),f}}))}function Uj(e){const[t,n]=ce();return xe(()=>{const r=e();r&&n(HT(r).getComputedStyle(r))}),t}function Gj(e){const t=mh(),[n,r]=Ve(e,["ref","style"]);return L(st,Ae({as:"div",ref(i){const s=Rt(t.setPositionerRef,n.ref);typeof s=="function"&&s(i)},"data-popper-positioner":"",get style(){return tc({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}function ym(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 Kj(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?ym(r):e?e.getBoundingClientRect():ym()}}}function Vj(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var Wj={top:"bottom",right:"left",bottom:"top",left:"right"};function Qj(e,t){const[n,r]=e.split("-"),i=Wj[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 Yj(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 Kj((f=t.anchorRef)==null?void 0:f.call(t),t.getAnchorRect)},{direction:u}=ci();async function c(){var k,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:(k=t.gutter)!=null?k:m;h.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),f.getBoundingClientRect();const v=[Dj(({placement:O})=>{const E=!!O.split("-")[1];return{mainAxis:p,crossAxis:E?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const O=typeof t.flip=="string"?t.flip.split(" "):void 0;if(O!==void 0&&!O.every(Vj))throw new Error("`flip` expects a spaced-delimited list of placements");v.push(Rj({padding:t.overflowPadding,fallbackPlacements:O}))}(t.slide||t.overlap)&&v.push(Ij({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),v.push(Nj({padding:t.overflowPadding,apply({availableWidth:O,availableHeight:E,rects:T}){const M=Math.round(T.reference.width);O=Math.floor(O),E=Math.floor(E),h.style.setProperty("--kb-popper-anchor-width",`${M}px`),h.style.setProperty("--kb-popper-content-available-width",`${O}px`),h.style.setProperty("--kb-popper-content-available-height",`${E}px`),t.sameWidth&&(h.style.width=`${M}px`),t.fitViewport&&(h.style.maxWidth=`${O}px`,h.style.maxHeight=`${E}px`)}})),t.hideWhenDetached&&v.push(Fj({padding:t.detachedPadding})),g&&v.push(Bj({element:g,padding:t.arrowPadding}));const b=await qj(f,h,{placement:t.placement,strategy:"absolute",middleware:v,platform:{...f1,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",Qj(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:O,y:E}=b.middlewareData.arrow,T=b.placement.split("-")[0];Object.assign(g.style,{left:O!=null?`${O}px`:"",top:E!=null?`${E}px`:"",[T]:"100%"})}}xe(()=>{const f=l(),h=n();if(!f||!h)return;const g=Lj(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 L(yh.Provider,{value:d,get children(){return t.children}})}var h1=Object.assign(Yj,{Arrow:ph,Context:yh,usePopperContext:mh,Positioner:Gj});function Xj(e){const t=n=>{var r;n.key===ih.Escape&&((r=e.onEscapeKeyDown)==null||r.call(e,n))};xe(()=>{var r,i;if(ee(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 mm="interactOutside.pointerDownOutside",pm="interactOutside.focusOutside";function Zj(e,t){let n,r=sP;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(`[${pu}]`)||!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(mm,m,{once:!0});const p=new CustomEvent(mm,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||WT(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(pm,g,{once:!0});const m=new CustomEvent(pm,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});h.dispatchEvent(m)};xe(()=>{ee(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 g1=wt();function Jj(){return St(g1)}function eM(e){let t;const n=Jj(),[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()}};Zj({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),Xj({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()))}}),kr(()=>{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(_r([()=>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 L(g1.Provider,{value:c,get children(){return L(st,Ae({as:"div",ref(d){const f=Rt(h=>t=h,r.ref);typeof f=="function"&&f(d)}},i))}})}function y1(e={}){const[t,n]=Hb({value:()=>ee(e.open),defaultValue:()=>!!ee(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={};ic(pn,{Description:()=>qb,ErrorMessage:()=>zb,Item:()=>b1,ItemControl:()=>x1,ItemDescription:()=>w1,ItemIndicator:()=>S1,ItemInput:()=>C1,ItemLabel:()=>_1,Label:()=>k1,RadioGroup:()=>tM,Root:()=>O1});var m1=wt();function p1(){const e=St(m1);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupContext` must be used within a `RadioGroup` component");return e}var v1=wt();function tl(){const e=St(v1);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupItemContext` must be used within a `RadioGroup.Item` component");return e}function b1(e){const t=Za(),n=p1(),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=k=>{nt(k,s.onPointerDown),m()&&k.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:Xa(()=>o.id),registerInput:Cn(l),registerLabel:Cn(c),registerDescription:Cn(f),setIsFocused:p,setInputRef:g};return L(v1.Provider,{value:w,get children(){return L(st,Ae({as:"div",role:"group",onPointerDown:S},C,o))}})}function x1(e){const t=tl(),n=Re({id:t.generateId("control")},e),[r,i]=Ve(n,["onClick","onKeyDown"]);return L(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===ih.Space&&(t.select(),(l=t.inputRef())==null||l.focus())}},()=>t.dataset(),i))}function w1(e){const t=tl(),n=Re({id:t.generateId("description")},e);return xe(()=>_e(t.registerDescription(n.id))),L(st,Ae({as:"div"},()=>t.dataset(),n))}function S1(e){const t=tl(),n=Re({id:t.generateId("indicator")},e),[r,i]=Ve(n,["ref","forceMount"]),[s,o]=ce(),{present:a}=Jb({show:()=>r.forceMount||t.isSelected(),element:()=>{var l;return(l=s())!=null?l:null}});return L(ve,{get when(){return a()},get children(){return L(st,Ae({as:"div",ref(l){const u=Rt(o,r.ref);typeof u=="function"&&u(l)}},()=>t.dataset(),i))}})}function C1(e){const t=Za(),n=p1(),r=tl(),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(_r([()=>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))),L(st,Ae({as:"input",ref(g){const m=Rt(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 tc({...Fb},s.style)},get"aria-labelledby"(){return a()},get"aria-describedby"(){return l()},onChange:d,onFocus:f,onBlur:h},()=>r.dataset(),o))}function _1(e){const t=tl(),n=Re({id:t.generateId("label")},e);return xe(()=>_e(t.registerLabel(n.id))),L(st,Ae({as:"label",get for(){return t.inputId()}},()=>t.dataset(),n))}function k1(e){return L(cP,Ae({as:"span"},e))}function O1(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"],lP),[a,l]=Ja({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:g=>{var m;return(m=i.onChange)==null?void 0:m.call(i,g)}}),{formControlContext:u}=uP(s);dP(()=>t,()=>{var g;return l((g=i.defaultValue)!=null?g:"")});const c=()=>u.getAriaLabelledBy(ee(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 L(Bb.Provider,{value:u,get children(){return L(m1.Provider,{value:h,get children(){return L(st,Ae({as:"div",ref(g){const m=Rt(p=>t=p,i.ref);typeof m=="function"&&m(g)},role:"radiogroup",get id(){return ee(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 tM=Object.assign(O1,{Description:qb,ErrorMessage:zb,Item:b1,ItemControl:x1,ItemDescription:w1,ItemIndicator:S1,ItemInput:C1,ItemLabel:_1,Label:k1}),nM=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 rM(e,t,n){const r=MP({usage:"search",sensitivity:"base"}),i=K(()=>{const s=ee(e.keyboardDelegate);return s||new nM(e.collection,t,r)});return FP({selectionManager:()=>ee(e.selectionManager),keyboardDelegate:i,autoFocus:()=>ee(e.autoFocus),deferAutoFocus:()=>ee(e.deferAutoFocus),shouldFocusWrap:()=>ee(e.shouldFocusWrap),disallowEmptySelection:()=>ee(e.disallowEmptySelection),selectOnFocus:()=>ee(e.selectOnFocus),disallowTypeAhead:()=>ee(e.disallowTypeAhead),shouldUseVirtualFocus:()=>ee(e.shouldUseVirtualFocus),allowsTabNavigation:()=>ee(e.allowsTabNavigation),isVirtualized:()=>ee(e.isVirtualized),scrollToKey:s=>{var o;return(o=ee(e.scrollToKey))==null?void 0:o(s)},orientation:()=>ee(e.orientation)},t)}var Xc="focusScope.autoFocusOnMount",Zc="focusScope.autoFocusOnUnmount",vm={bubbles:!1,cancelable:!0},bm={stack:[],active(){return this.stack[0]},add(e){var t;e!==this.active()&&((t=this.active())==null||t.pause()),this.stack=sf(this.stack,e),this.stack.unshift(e)},remove(e){var t;this.stack=sf(this.stack,e),(t=this.active())==null||t.resume()}};function iM(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,Fb),g},c=()=>{const g=t();return g?Rb(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=qo(g);return!m||Sn(g,m)?!1:Nb(m)};xe(()=>{const g=t();if(!g)return;bm.add(i);const m=qo(g);if(!Sn(g,m)){const v=new CustomEvent(Xc,vm);g.addEventListener(Xc,o),g.dispatchEvent(v),v.defaultPrevented||setTimeout(()=>{At(d()),qo(g)===m&&At(g)},0)}_e(()=>{g.removeEventListener(Xc,o),setTimeout(()=>{const v=new CustomEvent(Zc,vm);h()&&v.preventDefault(),g.addEventListener(Zc,a),g.dispatchEvent(v),v.defaultPrevented||At(m!=null?m:l().body),g.removeEventListener(Zc,a),bm.remove(i)},0)})}),xe(()=>{const g=t();if(!g||!ee(e.trapFocus)||n())return;const m=v=>{const b=v.target;b!=null&&b.closest(`[${pu}]`)||(Sn(g,b)?s=b:At(s))},p=v=>{const b=v.relatedTarget,S=b!=null?b:qo(g);S!=null&&S.closest(`[${pu}]`)||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||!ee(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 sM="data-live-announcer";function oM(e){xe(()=>{ee(e.isDisabled)||_e(aM(ee(e.targets),ee(e.root)))})}var To=new WeakMap,mn=[];function aM(e,t=document.body){const n=new Set(e),r=new Set,i=l=>{for(const f of l.querySelectorAll(`[${sM}], [${pu}]`))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=To.get(l))!=null?c:0;l.getAttribute("aria-hidden")==="true"&&u===0||(u===0&&l.setAttribute("aria-hidden","true"),r.add(l),To.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=To.get(l);if(u==null)return;u===1?(l.removeAttribute("aria-hidden"),To.delete(l)):To.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 jl=new Map,lM=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=jl.get(e.key);i?i.activeCount++:jl.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=jl.get(e.key);if(a){if(a.activeCount!==1){a.activeCount--;return}jl.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)}})})},xm=lM,uM=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},cM=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},dM=(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]=uM(i,t),f=d-u-r*c;(c!==0||f!==0)&&cM(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]},[wm,Sm]=ce([]),fM=e=>wm().indexOf(e)===wm().length-1,hM=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)&&(Sm(u=>[...u,n]),_e(()=>{Sm(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;xm({key:"prevent-scroll",element:u,style:d,properties:f,cleanup:()=>{Et(t.restoreScrollPosition)&&c>0&&window.scrollTo(g,h)}})}else xm({key:"prevent-scroll",element:u,style:{overflow:"hidden"}})}),xe(()=>{!fM(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=Cm(u),i=null,s=null},a=u=>{const c=u.target,d=Et(t.element),f=gM(u),h=Math.abs(f[0])>Math.abs(f[1])?"x":"y",g=h==="x"?f[0]:f[1],m=_m(c,h,g,d);let p;d&&ff(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=Cm(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=_m(d,i,s,c);c&&ff(c,d)?f=!h:f=!0}}f&&u.cancelable&&u.preventDefault()}},gM=e=>[e.deltaX,e.deltaY],Cm=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],_m=(e,t,n,r)=>{const i=r!==null&&ff(r,e),[s,o]=dM(e,t,i?r:void 0);return!(n>0&&Math.abs(s)<=1||n<0&&Math.abs(o)<1)},ff=(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},yM=hM,mM=yM,E1=wt();function A1(){return St(E1)}function Pr(){const e=A1();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var T1=wt();function vh(){const e=St(T1);if(e===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var P1=wt();function rr(){const e=St(P1);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function bh(e){let t;const n=rr(),r=Pr(),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 O;(O=s.onSelect)==null||O.call(s),s.closeOnSelect&&setTimeout(()=>{r.close(!0)})};_P({getItem:()=>{var O,E,T,M,B;return{ref:()=>t,type:"item",key:g(),textValue:(M=(T=(E=s.textValue)!=null?E:(O=d())==null?void 0:O.textContent)!=null?T:t==null?void 0:t.textContent)!=null?M:"",disabled:(B=s.disabled)!=null?B:!1}}});const v=Zb({key:g,selectionManager:h,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),b=O=>{nt(O,s.onPointerMove),O.pointerType==="mouse"&&(s.disabled?r.onItemLeave(O):(r.onItemEnter(O),O.defaultPrevented||(At(O.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(g()))))},S=O=>{nt(O,s.onPointerLeave),O.pointerType==="mouse"&&r.onItemLeave(O)},C=O=>{nt(O,s.onPointerUp),!s.disabled&&O.button===0&&p()},w=O=>{if(nt(O,s.onKeyDown),!O.repeat&&!s.disabled)switch(O.key){case"Enter":case" ":p();break}},k=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:Xa(()=>o.id),registerLabel:Cn(l),registerDescription:Cn(c)};return L(T1.Provider,{value:_,get children(){return L(st,Ae({as:"div",ref(O){const E=Rt(T=>t=T,s.ref);typeof E=="function"&&E(O)},get tabIndex(){return v.tabIndex()},get"aria-checked"(){return k()},get"aria-disabled"(){return s.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return 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 j1(e){const t=Re({closeOnSelect:!1},e),[n,r]=Ve(t,["checked","defaultChecked","onChange","onSelect"]),i=yP({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 L(bh,Ae({role:"menuitemcheckbox",get checked(){return i.isSelected()},onSelect:()=>{var o;(o=n.onSelect)==null||o.call(n),i.toggle()}},r))}var pM=wt();function ac(){return St(pM)}var Ca={next:(e,t)=>e==="ltr"?t==="horizontal"?"ArrowRight":"ArrowDown":t==="horizontal"?"ArrowLeft":"ArrowUp",previous:(e,t)=>Ca.next(e==="ltr"?"rtl":"ltr",t)},km={first:e=>e==="horizontal"?"ArrowDown":"ArrowRight",last:e=>e==="horizontal"?"ArrowUp":"ArrowLeft"};function M1(e){const t=rr(),n=Pr(),r=ac(),{direction:i}=ci(),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=rc(()=>n.triggerRef(),()=>"button"),c=K(()=>{var v;return u()==="a"&&((v=n.triggerRef())==null?void 0:v.getAttribute("href"))!=null});xe(_r(()=>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 km.first(t.orientation()):v.stopPropagation(),v.preventDefault(),aP(v.currentTarget),n.open("first"),r==null||r.setAutoFocusMenu(!0),r==null||r.setValue(l);break;case km.last(t.orientation()):v.stopPropagation(),v.preventDefault(),n.open("last");break;case Ca.next(i(),t.orientation()):if(r===void 0)break;v.stopPropagation(),v.preventDefault(),r.nextMenu();break;case Ca.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))),L(uh,Ae({ref(v){const b=Rt(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 vM=wt();function $1(){return St(vM)}function L1(e){let t;const n=rr(),r=Pr(),i=ac(),s=$1(),{direction:o}=ci(),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=rM({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);iM({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 Ca.next(o(),n.orientation()):S.stopPropagation(),S.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.nextMenu();break;case Ca.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:Rt(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 L(ve,{get when(){return r.contentPresent()},get children(){return L(ve,{get when(){return s===void 0||r.parentMenuContext()!=null},get fallback(){return L(st,Ae({as:"div"},()=>r.dataset(),b,u))},get children(){return L(h1.Positioner,{get children(){return L(eM,Ae({get disableOutsidePointerEvents(){return K(()=>!!d())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return tc({"--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 bM(e){let t;const n=rr(),r=Pr(),[i,s]=Ve(e,["ref"]);return mM({element:()=>t!=null?t:null,enabled:()=>r.contentPresent()&&n.preventScroll()}),L(L1,Ae({ref(o){const a=Rt(l=>{t=l},i.ref);typeof a=="function"&&a(o)}},s))}var D1=wt();function xM(){const e=St(D1);if(e===void 0)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}function xh(e){const t=rr(),n=Re({id:t.generateId(`group-${On()}`)},e),[r,i]=ce(),s={generateId:Xa(()=>n.id),registerLabelId:Cn(i)};return L(D1.Provider,{value:s,get children(){return L(st,Ae({as:"div",role:"group",get"aria-labelledby"(){return r()}},n))}})}function I1(e){const t=xM(),n=Re({id:t.generateId("label")},e),[r,i]=Ve(n,["id"]);return xe(()=>_e(t.registerLabelId(r.id))),L(st,Ae({as:"span",get id(){return r.id},"aria-hidden":"true"},i))}function R1(e){const t=Pr(),n=Re({children:"▼"},e);return L(st,Ae({as:"span","aria-hidden":"true"},()=>t.dataset(),n))}function N1(e){return L(bh,Ae({role:"menuitem",closeOnSelect:!0},e))}function F1(e){const t=vh(),n=Re({id:t.generateId("description")},e),[r,i]=Ve(n,["id"]);return xe(()=>_e(t.registerDescription(r.id))),L(st,Ae({as:"div",get id(){return r.id}},()=>t.dataset(),i))}function B1(e){const t=vh(),n=Re({id:t.generateId("indicator")},e),[r,i]=Ve(n,["forceMount"]);return L(ve,{get when(){return r.forceMount||t.isChecked()},get children(){return L(st,Ae({as:"div"},()=>t.dataset(),i))}})}function q1(e){const t=vh(),n=Re({id:t.generateId("label")},e),[r,i]=Ve(n,["ref","id"]);return xe(()=>_e(t.registerLabel(r.id))),L(st,Ae({as:"div",ref(s){const o=Rt(t.setLabelRef,r.ref);typeof o=="function"&&o(s)},get id(){return r.id}},()=>t.dataset(),i))}function z1(e){const t=Pr();return L(ve,{get when(){return t.contentPresent()},get children(){return L(hv,e)}})}var H1=wt();function wM(){const e=St(H1);if(e===void 0)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}function U1(e){const n=rr().generateId(`radiogroup-${On()}`),r=Re({id:n},e),[i,s]=Ve(r,["value","defaultValue","onChange","disabled"]),[o,a]=Ja({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 L(H1.Provider,{value:l,get children(){return L(xh,s)}})}function G1(e){const t=wM(),n=Re({closeOnSelect:!1},e),[r,i]=Ve(n,["value","onSelect"]);return L(bh,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 SM(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 CM(e,t){return t?oP([e.clientX,e.clientY],t):!1}function K1(e){const t=rr(),n=Gb(),r=A1(),i=ac(),s=$1(),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),[k,x]=ce(l.placement),[_,O]=ce([]),[E,T]=ce([]),{DomCollectionProvider:M}=CP({items:E,onItemsChange:T}),B=y1({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:re=>{var Se;return(Se=a.onOpenChange)==null?void 0:Se.call(a,re)}}),{present:R}=Jb({show:()=>t.forceMount()||B.isOpen(),element:()=>{var re;return(re=b())!=null?re:null}}),j=qP({selectionMode:"none",dataSource:E}),P=re=>{w(re),B.open()},I=(re=!1)=>{B.close(),re&&r&&r.close(!0)},G=re=>{w(re),B.toggle()},W=()=>{const re=b();re&&(At(re),j.selectionManager().setFocused(!0),j.selectionManager().setFocusedKey(void 0))},F=()=>{s!=null?setTimeout(()=>W()):W()},U=re=>{O(ye=>[...ye,re]);const Se=r==null?void 0:r.registerNestedMenu(re);return()=>{O(ye=>sf(ye,re)),Se==null||Se()}},z=re=>d===(c==null?void 0:c.side)&&CM(re,c==null?void 0:c.area),V=re=>{z(re)&&re.preventDefault()},N=re=>{z(re)||F()},te=re=>{z(re)&&re.preventDefault()};oM({isDisabled:()=>!(r==null&&B.isOpen()&&t.isModal()),targets:()=>[b(),..._()].filter(Boolean)}),xe(()=>{const re=b();if(!re||!r)return;const Se=r.registerNestedMenu(re);_e(()=>{Se()})}),xe(()=>{r===void 0&&(i==null||i.registerMenu(t.value(),[b(),..._()]))}),xe(()=>{var re;r!==void 0||i===void 0||(i.value()===t.value()?((re=p())==null||re.focus(),i.autoFocusMenu()&&P(!0)):I())}),xe(()=>{r!==void 0||i===void 0||B.isOpen()&&i.setValue(t.value())}),_e(()=>{r===void 0&&(i==null||i.unregisterMenu(t.value()))});const ge={dataset:K(()=>({"data-expanded":B.isOpen()?"":void 0,"data-closed":B.isOpen()?void 0:""})),isOpen:B.isOpen,contentPresent:R,nestedMenus:_,currentPlacement:k,pointerGraceTimeoutId:()=>u,autoFocus:C,listState:()=>j,parentMenuContext:()=>r,triggerRef:p,contentRef:b,triggerId:f,contentId:g,setTriggerRef:v,setContentRef:S,open:P,close:I,toggle:G,focusContent:F,onItemEnter:V,onItemLeave:N,onTriggerLeave:te,setPointerDir:re=>d=re,setPointerGraceTimeoutId:re=>u=re,setPointerGraceIntent:re=>c=re,registerNestedMenu:U,registerItemToParentDomCollection:n==null?void 0:n.registerItem,registerTriggerId:Cn(h),registerContentId:Cn(m)};return L(M,{get children(){return L(E1.Provider,{value:ge,get children(){return L(ve,{when:s===void 0,get fallback(){return l.children},get children(){return L(h1,Ae({anchorRef:p,contentRef:b,onCurrentPlacementChange:x},l))}})}})}})}function V1(e){const{direction:t}=ci();return L(K1,Ae({get placement(){return t()==="rtl"?"left-start":"right-start"},flip:!0},e))}var _M={close:(e,t)=>e==="ltr"?[t==="horizontal"?"ArrowLeft":"ArrowUp"]:[t==="horizontal"?"ArrowRight":"ArrowDown"]};function W1(e){const t=Pr(),n=rr(),[r,i]=Ve(e,["onFocusOutside","onKeyDown"]),{direction:s}=ci();return L(L1,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=_M.close(s(),n.orientation()).includes(c.key),h=t.parentMenuContext()!=null;d&&f&&h&&(t.close(),At(t.triggerRef()))}},i))}var Om=["Enter"," "],kM={open:(e,t)=>e==="ltr"?[...Om,t==="horizontal"?"ArrowRight":"ArrowDown"]:[...Om,t==="horizontal"?"ArrowLeft":"ArrowUp"]};function Q1(e){let t;const n=rr(),r=Pr(),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}=ci(),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=Zb({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:SM(r.currentPlacement(),S,w),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(C==null?void 0:C.pointerGraceTimeoutId());const k=window.setTimeout(()=>{C==null||C.setPointerGraceIntent(null)},300);C==null||C.setPointerGraceTimeoutId(k)}else{if(C==null||C.onTriggerLeave(S),S.defaultPrevented)return;C==null||C.setPointerGraceIntent(null)}C==null||C.onItemLeave(S)},b=S=>{nt(S,s.onKeyDown),!S.repeat&&(s.disabled||kM.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,k;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:(k=s.disabled)!=null?k:!1});_e(S)}),xe(_r(()=>{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()}),L(st,Ae({as:"div",ref(S){const C=Rt(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 OM(e){const t=ac(),n=`menu-${On()}`,r=Re({id:n,modal:!0},e),[i,s]=Ve(r,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),o=y1({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:Xa(()=>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 L(P1.Provider,{value:a,get children(){return L(K1,Ae({get open(){return o.isOpen()},get onOpenChange(){return o.setIsOpen}},s))}})}var EM={};ic(EM,{Root:()=>lc,Separator:()=>AM});function lc(e){let t;const n=Re({orientation:"horizontal"},e),[r,i]=Ve(n,["ref","orientation"]),s=rc(()=>t,()=>"hr");return L(st,Ae({as:"hr",ref(o){const a=Rt(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 AM=lc,ft={};ic(ft,{Arrow:()=>ph,CheckboxItem:()=>j1,Content:()=>Y1,DropdownMenu:()=>TM,Group:()=>xh,GroupLabel:()=>I1,Icon:()=>R1,Item:()=>N1,ItemDescription:()=>F1,ItemIndicator:()=>B1,ItemLabel:()=>q1,Portal:()=>z1,RadioGroup:()=>U1,RadioItem:()=>G1,Root:()=>X1,Separator:()=>lc,Sub:()=>V1,SubContent:()=>W1,SubTrigger:()=>Q1,Trigger:()=>M1});function Y1(e){const t=rr(),n=Pr(),[r,i]=Ve(e,["onCloseAutoFocus","onInteractOutside"]);let s=!1;return L(bM,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 X1(e){const t=`dropdownmenu-${On()}`,n=Re({id:t},e);return L(OM,n)}var TM=Object.assign(X1,{Arrow:ph,CheckboxItem:j1,Content:Y1,Group:xh,GroupLabel:I1,Icon:R1,Item:N1,ItemDescription:F1,ItemIndicator:B1,ItemLabel:q1,Portal:z1,RadioGroup:U1,RadioItem:G1,Separator:lc,Sub:V1,SubContent:W1,SubTrigger:Q1,Trigger:M1}),Q={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"}},PM=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>'),jM=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>'),MM=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>'),$M=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>'),wh=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>'),LM=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>'),DM=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>'),IM=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>'),RM=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">'),NM=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">'),FM=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>'),BM=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>'),qM=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>'),zM=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>'),Z1=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>'),HM=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>'),UM=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>'),GM=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>'),KM=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>'),VM=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>'),WM=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>'),QM=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>'),YM=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 XM(){return PM()}function J1(){return jM()}function Zo(){return MM()}function Em(){return $M()}function Am(){return wh()}function ZM(){return(()=>{var e=wh();return e.style.setProperty("transform","rotate(90deg)"),e})()}function JM(){return(()=>{var e=wh();return e.style.setProperty("transform","rotate(-90deg)"),e})()}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$(){return BM()}function a$(){return qM()}function l$(){return zM()}function u$(e){return(()=>{var t=Z1(),n=t.firstChild;return be(()=>oe(n,"stroke",e.theme==="dark"?"#12B76A":"#027A48")),t})()}function c$(){return HM()}function d$(){return UM()}function f$(e){return[L(ve,{get when(){return e.checked},get children(){var t=Z1(),n=t.firstChild;return be(()=>oe(n,"stroke",e.theme==="dark"?"#9B8AFB":"#6938EF")),t}}),L(ve,{get when(){return!e.checked},get children(){var t=GM(),n=t.firstChild;return be(()=>oe(n,"stroke",e.theme==="dark"?"#9B8AFB":"#6938EF")),t}})]}function h$(){return KM()}function g$(){return VM()}function y$(){return WM()}function m$(){return QM()}function Tm(){const e=On();return(()=>{var t=YM(),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,k=w.firstChild,x=w.nextSibling,_=x.nextSibling,O=_.firstChild,E=_.nextSibling,T=E.firstChild,M=E.nextSibling,B=M.nextSibling,R=B.firstChild,j=B.nextSibling,P=j.firstChild,I=j.nextSibling,G=I.nextSibling,W=G.firstChild,F=G.nextSibling,U=F.firstChild,z=F.nextSibling,V=z.firstChild,N=V.nextSibling,te=N.nextSibling,J=te.nextSibling,ge=J.nextSibling,re=z.nextSibling,Se=re.firstChild,ye=re.nextSibling,ze=ye.firstChild,le=ye.nextSibling,He=le.firstChild,lt=He.nextSibling,dt=lt.nextSibling,Ne=dt.firstChild,Fe=Ne.nextSibling,Z=Fe.nextSibling,Te=Z.nextSibling,tt=Te.nextSibling,$e=tt.nextSibling,ue=$e.nextSibling,X=ue.nextSibling,se=X.nextSibling,ie=se.nextSibling,Ce=ie.nextSibling,gt=Ce.nextSibling,we=le.nextSibling,Je=we.firstChild,Be=we.nextSibling,Tn=Be.firstChild,Vt=Be.nextSibling,hn=Vt.firstChild,Fn=hn.nextSibling,ir=Vt.nextSibling,Ji=ir.firstChild,jr=ir.nextSibling,rl=jr.firstChild,fo=jr.nextSibling,ho=fo.firstChild,go=ho.nextSibling,es=go.nextSibling,kh=es.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,Rh=Ih.nextSibling,Nh=Rh.nextSibling,hx=Nh.nextSibling;return oe(n,"id",`a-${e}`),oe(r,"fill",`url(#a-${e})`),oe(s,"id",`am-${e}`),oe(o,"id",`b-${e}`),oe(a,"filter",`url(#am-${e})`),oe(l,"mask",`url(#b-${e})`),oe(c,"id",`ah-${e}`),oe(d,"id",`k-${e}`),oe(f,"filter",`url(#ah-${e})`),oe(h,"mask",`url(#k-${e})`),oe(m,"id",`ae-${e}`),oe(p,"id",`j-${e}`),oe(v,"filter",`url(#ae-${e})`),oe(b,"mask",`url(#j-${e})`),oe(C,"id",`ai-${e}`),oe(w,"id",`i-${e}`),oe(k,"filter",`url(#ai-${e})`),oe(x,"mask",`url(#i-${e})`),oe(O,"id",`aj-${e}`),oe(E,"id",`h-${e}`),oe(T,"filter",`url(#aj-${e})`),oe(M,"mask",`url(#h-${e})`),oe(R,"id",`ag-${e}`),oe(j,"id",`g-${e}`),oe(P,"filter",`url(#ag-${e})`),oe(I,"mask",`url(#g-${e})`),oe(W,"id",`af-${e}`),oe(F,"id",`f-${e}`),oe(U,"filter",`url(#af-${e})`),oe(z,"mask",`url(#f-${e})`),oe(J,"id",`m-${e}`),oe(ge,"fill",`url(#m-${e})`),oe(Se,"id",`ak-${e}`),oe(ye,"id",`e-${e}`),oe(ze,"filter",`url(#ak-${e})`),oe(le,"mask",`url(#e-${e})`),oe(He,"id",`n-${e}`),oe(lt,"fill",`url(#n-${e})`),oe(Ne,"id",`r-${e}`),oe(Fe,"fill",`url(#r-${e})`),oe(Z,"id",`s-${e}`),oe(Te,"fill",`url(#s-${e})`),oe(tt,"id",`q-${e}`),oe($e,"fill",`url(#q-${e})`),oe(ue,"id",`p-${e}`),oe(X,"fill",`url(#p-${e})`),oe(se,"id",`o-${e}`),oe(ie,"fill",`url(#o-${e})`),oe(Ce,"id",`l-${e}`),oe(gt,"fill",`url(#l-${e})`),oe(Je,"id",`al-${e}`),oe(Be,"id",`d-${e}`),oe(Tn,"filter",`url(#al-${e})`),oe(Vt,"mask",`url(#d-${e})`),oe(hn,"id",`u-${e}`),oe(Fn,"fill",`url(#u-${e})`),oe(Ji,"id",`ad-${e}`),oe(jr,"id",`c-${e}`),oe(rl,"filter",`url(#ad-${e})`),oe(fo,"mask",`url(#c-${e})`),oe(ho,"id",`t-${e}`),oe(go,"fill",`url(#t-${e})`),oe(es,"id",`v-${e}`),oe(kh,"stroke",`url(#v-${e})`),oe(Oh,"id",`aa-${e}`),oe(Eh,"stroke",`url(#aa-${e})`),oe(Ah,"id",`w-${e}`),oe(Th,"stroke",`url(#w-${e})`),oe(Ph,"id",`ac-${e}`),oe(jh,"stroke",`url(#ac-${e})`),oe(Mh,"id",`ab-${e}`),oe($h,"stroke",`url(#ab-${e})`),oe(Lh,"id",`y-${e}`),oe(Dh,"stroke",`url(#y-${e})`),oe(Ih,"id",`x-${e}`),oe(Rh,"stroke",`url(#x-${e})`),oe(Nh,"id",`z-${e}`),oe(hx,"stroke",`url(#z-${e})`),t})()}var p$=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>'),v$=he('<button title="Copy object to clipboard">'),b$=he('<button title="Remove all items"aria-label="Remove all items">'),x$=he('<button title="Delete item"aria-label="Delete item">'),w$=he('<button title="Toggle value"aria-label="Toggle value">'),S$=he('<button title="Bulk Edit Data"aria-label="Bulk Edit Data">'),Po=he("<div>"),C$=he("<div><button> <span></span> <span> "),_$=he("<input>"),Pm=he("<span>"),k$=he("<div><span>:"),O$=he("<div><div><button> [<!>...<!>]");function E$(e,t){let n=0;const r=[];for(;n<e.length;)r.push(e.slice(n,n+t)),n=n+t;return r}var jm=e=>{const t=xt(),n=me().shadowDOMTarget?Me.bind({target:me().shadowDOMTarget}):Me,r=K(()=>t()==="dark"?co(n):uo(n));return(()=>{var i=p$();return be(()=>ae(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
76
  `))),i})()},A$=e=>{const t=xt(),n=me().shadowDOMTarget?Me.bind({target:me().shadowDOMTarget}):Me,r=K(()=>t()==="dark"?co(n):uo(n)),[i,s]=ce("NoCopy");return(()=>{var o=v$();return uv(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),Y(o,L(B3,{get children(){return[L(pc,{get when(){return i()==="NoCopy"},get children(){return L(a$,{})}}),L(pc,{get when(){return i()==="SuccessCopy"},get children(){return L(u$,{get theme(){return t()}})}}),L(pc,{get when(){return i()==="ErrorCopy"},get children(){return L(c$,{})}})]}})),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&&ae(o,a.e=l),u!==a.t&&oe(o,"aria-label",a.t=u),a},{e:void 0,t:void 0}),o})()},T$=e=>{const t=xt(),n=me().shadowDOMTarget?Me.bind({target:me().shadowDOMTarget}):Me,r=K(()=>t()==="dark"?co(n):uo(n)),i=me().client;return(()=>{var s=b$();return s.$$click=()=>{const o=e.activeQuery.state.data,a=wi(o,e.dataPath,[]);i.setQueryData(e.activeQuery.queryKey,a)},Y(s,L(d$,{})),be(()=>ae(s,r().actionButton)),s})()},Mm=e=>{const t=xt(),n=me().shadowDOMTarget?Me.bind({target:me().shadowDOMTarget}):Me,r=K(()=>t()==="dark"?co(n):uo(n)),i=me().client;return(()=>{var s=x$();return s.$$click=()=>{const o=e.activeQuery.state.data,a=Lo(o,e.dataPath);i.setQueryData(e.activeQuery.queryKey,a)},Y(s,L(J1,{})),be(()=>ae(s,fe(r().actionButton))),s})()},P$=e=>{const t=xt(),n=me().shadowDOMTarget?Me.bind({target:me().shadowDOMTarget}):Me,r=K(()=>t()==="dark"?co(n):uo(n)),i=me().client;return(()=>{var s=w$();return s.$$click=()=>{const o=e.activeQuery.state.data,a=wi(o,e.dataPath,!e.value);i.setQueryData(e.activeQuery.queryKey,a)},Y(s,L(f$,{get theme(){return t()},get checked(){return e.value}})),be(()=>ae(s,fe(r().actionButton,n`
77
- width: ${W.size[3.5]};
78
- height: ${W.size[3.5]};
79
- `))),s})()};function $m(e){return Symbol.iterator in e}function Yr(e){var g;const t=xt(),n=me().shadowDOMTarget?Me.bind({target:me().shadowDOMTarget}):Me,r=K(()=>t()==="dark"?co(n):uo(n)),i=me().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"&&$m(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"&&$m(e.value)&&typeof e.value[Symbol.iterator]=="function"?"Iterable":typeof e.value=="object"&&e.value!==null?"object":typeof e.value),f=K(()=>E$(c(),100)),h=(g=e.dataPath)!=null?g:[];return(()=>{var m=Po();return Y(m,L(ve,{get when(){return f().length},get children(){return[(()=>{var p=C$(),v=p.firstChild,b=v.firstChild,S=b.nextSibling,C=S.nextSibling,w=C.nextSibling,k=w.firstChild;return v.$$click=()=>a(),Y(v,L(jm,{get expanded(){return s()}}),b),Y(S,()=>e.label),Y(w,()=>String(d()).toLowerCase()==="iterable"?"(Iterable) ":"",k),Y(w,()=>c().length,k),Y(w,()=>c().length>1?"items":"item",null),Y(p,L(ve,{get when(){return e.editable},get children(){var x=Po();return Y(x,L(A$,{get value(){return e.value}}),null),Y(x,L(ve,{get when(){return e.itemsDeletable&&e.activeQuery!==void 0},get children(){return L(Mm,{get activeQuery(){return e.activeQuery},dataPath:h})}}),null),Y(x,L(ve,{get when(){return d()==="array"&&e.activeQuery!==void 0},get children(){return L(T$,{get activeQuery(){return e.activeQuery},dataPath:h})}}),null),Y(x,L(ve,{get when(){return K(()=>!!e.onEdit)()&&!Av(e.value).meta},get children(){var _=S$();return _.$$click=()=>{var O;(O=e.onEdit)==null||O.call(e)},Y(_,L(l$,{})),be(()=>ae(_,r().actionButton)),_}}),null),be(()=>ae(x,r().actions)),x}}),null),be(x=>{var _=r().expanderButtonContainer,O=r().expanderButton,E=r().info;return _!==x.e&&ae(p,x.e=_),O!==x.t&&ae(v,x.t=O),E!==x.a&&ae(w,x.a=E),x},{e:void 0,t:void 0,a:void 0}),p})(),L(ve,{get when(){return s()},get children(){return[L(ve,{get when(){return f().length===1},get children(){var p=Po();return Y(p,L(mu,{get each(){return c()},by:v=>v.label,children:v=>L(Yr,{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(()=>ae(p,r().subEntry)),p}}),L(ve,{get when(){return f().length>1},get children(){var p=Po();return Y(p,L(F3,{get each(){return f()},children:(v,b)=>(()=>{var S=O$(),C=S.firstChild,w=C.firstChild,k=w.firstChild,x=k.nextSibling,_=x.nextSibling,O=_.nextSibling;return O.nextSibling,w.$$click=()=>u(E=>E.includes(b)?E.filter(T=>T!==b):[...E,b]),Y(w,L(jm,{get expanded(){return l().includes(b)}}),k),Y(w,b*100,x),Y(w,b*100+100-1,O),Y(C,L(ve,{get when(){return l().includes(b)},get children(){var E=Po();return Y(E,L(mu,{get each(){return v()},by:T=>T.label,children:T=>L(Yr,{get defaultExpanded(){return e.defaultExpanded},get label(){return T().label},get value(){return T().value},get editable(){return e.editable},get dataPath(){return[...h,T().label]},get activeQuery(){return e.activeQuery}})})),be(()=>ae(E,r().subEntry)),E}}),null),be(E=>{var T=r().entry,M=r().expanderButton;return T!==E.e&&ae(C,E.e=T),M!==E.t&&ae(w,E.t=M),E},{e:void 0,t:void 0}),S})()})),be(()=>ae(p,r().subEntry)),p}})]}})]}}),null),Y(m,L(ve,{get when(){return f().length===0},get children(){var p=k$(),v=p.firstChild,b=v.firstChild;return Y(v,()=>e.label,b),Y(p,L(ve,{get when(){return K(()=>!!(e.editable&&e.activeQuery!==void 0))()&&(d()==="string"||d()==="number"||d()==="boolean")},get fallback(){return(()=>{var S=Pm();return Y(S,()=>eu(e.value)),be(()=>ae(S,r().value)),S})()},get children(){return[L(ve,{get when(){return K(()=>!!(e.editable&&e.activeQuery!==void 0))()&&(d()==="string"||d()==="number")},get children(){var S=_$();return S.addEventListener("change",C=>{const w=e.activeQuery.state.data,k=wi(w,h,d()==="number"?C.target.valueAsNumber:C.target.value);i.setQueryData(e.activeQuery.queryKey,k)}),be(C=>{var w=d()==="number"?"number":"text",k=fe(r().value,r().editableInput);return w!==C.e&&oe(S,"type",C.e=w),k!==C.t&&ae(S,C.t=k),C},{e:void 0,t:void 0}),be(()=>S.value=e.value),S}}),L(ve,{get when(){return d()==="boolean"},get children(){var S=Pm();return Y(S,L(P$,{get activeQuery(){return e.activeQuery},dataPath:h,get value(){return e.value}}),null),Y(S,()=>eu(e.value),null),be(()=>ae(S,fe(r().value,r().actions,r().editableInput))),S}})]}}),null),Y(p,L(ve,{get when(){return e.editable&&e.itemsDeletable&&e.activeQuery!==void 0},get children(){return L(Mm,{get activeQuery(){return e.activeQuery},dataPath:h})}}),null),be(S=>{var C=r().row,w=r().label;return C!==S.e&&ae(p,S.e=C),w!==S.t&&ae(v,S.t=w),S},{e:void 0,t:void 0}),p}}),null),be(()=>ae(m,r().entry)),m})()}var ex=(e,t)=>{const{colors:n,font:r,size:i,border:s}=W,o=(a,l)=>e==="light"?a:l;return{entry:t`
77
+ width: ${Q.size[3.5]};
78
+ height: ${Q.size[3.5]};
79
+ `))),s})()};function $m(e){return Symbol.iterator in e}function Yr(e){var g;const t=xt(),n=me().shadowDOMTarget?Me.bind({target:me().shadowDOMTarget}):Me,r=K(()=>t()==="dark"?co(n):uo(n)),i=me().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"&&$m(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"&&$m(e.value)&&typeof e.value[Symbol.iterator]=="function"?"Iterable":typeof e.value=="object"&&e.value!==null?"object":typeof e.value),f=K(()=>E$(c(),100)),h=(g=e.dataPath)!=null?g:[];return(()=>{var m=Po();return Y(m,L(ve,{get when(){return f().length},get children(){return[(()=>{var p=C$(),v=p.firstChild,b=v.firstChild,S=b.nextSibling,C=S.nextSibling,w=C.nextSibling,k=w.firstChild;return v.$$click=()=>a(),Y(v,L(jm,{get expanded(){return s()}}),b),Y(S,()=>e.label),Y(w,()=>String(d()).toLowerCase()==="iterable"?"(Iterable) ":"",k),Y(w,()=>c().length,k),Y(w,()=>c().length>1?"items":"item",null),Y(p,L(ve,{get when(){return e.editable},get children(){var x=Po();return Y(x,L(A$,{get value(){return e.value}}),null),Y(x,L(ve,{get when(){return e.itemsDeletable&&e.activeQuery!==void 0},get children(){return L(Mm,{get activeQuery(){return e.activeQuery},dataPath:h})}}),null),Y(x,L(ve,{get when(){return d()==="array"&&e.activeQuery!==void 0},get children(){return L(T$,{get activeQuery(){return e.activeQuery},dataPath:h})}}),null),Y(x,L(ve,{get when(){return K(()=>!!e.onEdit)()&&!Av(e.value).meta},get children(){var _=S$();return _.$$click=()=>{var O;(O=e.onEdit)==null||O.call(e)},Y(_,L(l$,{})),be(()=>ae(_,r().actionButton)),_}}),null),be(()=>ae(x,r().actions)),x}}),null),be(x=>{var _=r().expanderButtonContainer,O=r().expanderButton,E=r().info;return _!==x.e&&ae(p,x.e=_),O!==x.t&&ae(v,x.t=O),E!==x.a&&ae(w,x.a=E),x},{e:void 0,t:void 0,a:void 0}),p})(),L(ve,{get when(){return s()},get children(){return[L(ve,{get when(){return f().length===1},get children(){var p=Po();return Y(p,L(mu,{get each(){return c()},by:v=>v.label,children:v=>L(Yr,{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(()=>ae(p,r().subEntry)),p}}),L(ve,{get when(){return f().length>1},get children(){var p=Po();return Y(p,L(F3,{get each(){return f()},children:(v,b)=>(()=>{var S=O$(),C=S.firstChild,w=C.firstChild,k=w.firstChild,x=k.nextSibling,_=x.nextSibling,O=_.nextSibling;return O.nextSibling,w.$$click=()=>u(E=>E.includes(b)?E.filter(T=>T!==b):[...E,b]),Y(w,L(jm,{get expanded(){return l().includes(b)}}),k),Y(w,b*100,x),Y(w,b*100+100-1,O),Y(C,L(ve,{get when(){return l().includes(b)},get children(){var E=Po();return Y(E,L(mu,{get each(){return v()},by:T=>T.label,children:T=>L(Yr,{get defaultExpanded(){return e.defaultExpanded},get label(){return T().label},get value(){return T().value},get editable(){return e.editable},get dataPath(){return[...h,T().label]},get activeQuery(){return e.activeQuery}})})),be(()=>ae(E,r().subEntry)),E}}),null),be(E=>{var T=r().entry,M=r().expanderButton;return T!==E.e&&ae(C,E.e=T),M!==E.t&&ae(w,E.t=M),E},{e:void 0,t:void 0}),S})()})),be(()=>ae(p,r().subEntry)),p}})]}})]}}),null),Y(m,L(ve,{get when(){return f().length===0},get children(){var p=k$(),v=p.firstChild,b=v.firstChild;return Y(v,()=>e.label,b),Y(p,L(ve,{get when(){return K(()=>!!(e.editable&&e.activeQuery!==void 0))()&&(d()==="string"||d()==="number"||d()==="boolean")},get fallback(){return(()=>{var S=Pm();return Y(S,()=>eu(e.value)),be(()=>ae(S,r().value)),S})()},get children(){return[L(ve,{get when(){return K(()=>!!(e.editable&&e.activeQuery!==void 0))()&&(d()==="string"||d()==="number")},get children(){var S=_$();return S.addEventListener("change",C=>{const w=e.activeQuery.state.data,k=wi(w,h,d()==="number"?C.target.valueAsNumber:C.target.value);i.setQueryData(e.activeQuery.queryKey,k)}),be(C=>{var w=d()==="number"?"number":"text",k=fe(r().value,r().editableInput);return w!==C.e&&oe(S,"type",C.e=w),k!==C.t&&ae(S,C.t=k),C},{e:void 0,t:void 0}),be(()=>S.value=e.value),S}}),L(ve,{get when(){return d()==="boolean"},get children(){var S=Pm();return Y(S,L(P$,{get activeQuery(){return e.activeQuery},dataPath:h,get value(){return e.value}}),null),Y(S,()=>eu(e.value),null),be(()=>ae(S,fe(r().value,r().actions,r().editableInput))),S}})]}}),null),Y(p,L(ve,{get when(){return e.editable&&e.itemsDeletable&&e.activeQuery!==void 0},get children(){return L(Mm,{get activeQuery(){return e.activeQuery},dataPath:h})}}),null),be(S=>{var C=r().row,w=r().label;return C!==S.e&&ae(p,S.e=C),w!==S.t&&ae(v,S.t=w),S},{e:void 0,t:void 0}),p}}),null),be(()=>ae(m,r().entry)),m})()}var ex=(e,t)=>{const{colors:n,font:r,size:i,border:s}=Q,o=(a,l)=>e==="light"?a:l;return{entry:t`
80
80
  & * {
81
81
  font-size: ${r.size.xs};
82
82
  font-family:
@@ -214,7 +214,7 @@ 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})()]},dL=e=>{const t=nh(),n=xt(),r=me().shadowDOMTarget?Me.bind({target:me().shadowDOMTarget}):Me,i=K(()=>n()==="dark"?An(r):En(r)),s=()=>{const{colors:o}=W,a=(l,u)=>n()==="dark"?u:l;return $n()<Ui?r`
217
+ `,"tsqd-transitions-container"))),d})()]},dL=e=>{const t=nh(),n=xt(),r=me().shadowDOMTarget?Me.bind({target:me().shadowDOMTarget}):Me,i=K(()=>n()==="dark"?An(r):En(r)),s=()=>{const{colors:o}=Q,a=(l,u)=>n()==="dark"?u:l;return $n()<Ui?r`
218
218
  flex-direction: column;
219
219
  background-color: ${a(o.gray[300],o.gray[600])};
220
220
  `:r`
@@ -222,7 +222,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
222
222
  background-color: ${a(o.gray[200],o.darkGray[900])};
223
223
  `};return xe(()=>{const o=t().pipWindow,a=()=>{o&&Sh(o.innerWidth)};o&&(o.addEventListener("resize",a),a()),_e(()=>{o&&o.removeEventListener("resize",a)})}),(()=>{var o=nl();return o.style.setProperty("--tsqd-font-size","16px"),o.style.setProperty("max-height","100vh"),o.style.setProperty("height","100vh"),o.style.setProperty("width","100vw"),Y(o,()=>e.children),be(()=>ae(o,fe(i().panel,s(),{[r`
224
224
  min-width: min-content;
225
- `]:$n()<eh},"tsqd-main-panel"))),o})()},fL=e=>{const t=xt(),n=me().shadowDOMTarget?Me.bind({target:me().shadowDOMTarget}):Me,r=K(()=>t()==="dark"?An(n):En(n));let i;kr(()=>{Lb(i,({width:o},a)=>{a===i&&Sh(o)})});const s=()=>{const{colors:o}=W,a=(l,u)=>t()==="dark"?u:l;return $n()<Ui?n`
225
+ `]:$n()<eh},"tsqd-main-panel"))),o})()},fL=e=>{const t=xt(),n=me().shadowDOMTarget?Me.bind({target:me().shadowDOMTarget}):Me,r=K(()=>t()==="dark"?An(n):En(n));let i;kr(()=>{Lb(i,({width:o},a)=>{a===i&&Sh(o)})});const s=()=>{const{colors:o}=Q,a=(l,u)=>t()==="dark"?u:l;return $n()<Ui?n`
226
226
  flex-direction: column;
227
227
  background-color: ${a(o.gray[300],o.gray[600])};
228
228
  `:n`
@@ -230,7 +230,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
230
230
  background-color: ${a(o.gray[200],o.darkGray[900])};
231
231
  `};return(()=>{var o=nl(),a=i;return typeof a=="function"?no(a,o):i=o,o.style.setProperty("--tsqd-font-size","16px"),Y(o,()=>e.children),be(()=>ae(o,fe(r().parentPanel,s(),{[n`
232
232
  min-width: min-content;
233
- `]:$n()<eh},"tsqd-main-panel"))),o})()},hL=e=>{const t=xt(),n=me().shadowDOMTarget?Me.bind({target:me().shadowDOMTarget}):Me,r=K(()=>t()==="dark"?An(n):En(n)),[i,s]=ce(!1),o=K(()=>e.localStore.position||me().position||nf),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=l0(3.5),b=l0(12),S=w=>{if(w.preventDefault(),o()==="left"||o()==="right"){const k=o()==="right"?g-w.clientX:w.clientX-g;p=Math.round(h+k),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 k=o()==="bottom"?m-w.clientY:w.clientY-m;p=Math.round(f+k),p<v&&(p=v,uc(null)),e.setLocalStore("height",String(Math.round(p)))}},C=()=>{i()&&s(!1),document.removeEventListener("mousemove",S,!1),document.removeEventListener("mouseUp",C,!1)};document.addEventListener("mousemove",S,!1),document.addEventListener("mouseup",C,!1)};let l;kr(()=>{Lb(l,({width:c},d)=>{d===l&&Sh(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||nf,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}=W,d=(f,h)=>t()==="dark"?h:f;return $n()<Ui?n`
233
+ `]:$n()<eh},"tsqd-main-panel"))),o})()},hL=e=>{const t=xt(),n=me().shadowDOMTarget?Me.bind({target:me().shadowDOMTarget}):Me,r=K(()=>t()==="dark"?An(n):En(n)),[i,s]=ce(!1),o=K(()=>e.localStore.position||me().position||nf),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=l0(3.5),b=l0(12),S=w=>{if(w.preventDefault(),o()==="left"||o()==="right"){const k=o()==="right"?g-w.clientX:w.clientX-g;p=Math.round(h+k),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 k=o()==="bottom"?m-w.clientY:w.clientY-m;p=Math.round(f+k),p<v&&(p=v,uc(null)),e.setLocalStore("height",String(Math.round(p)))}},C=()=>{i()&&s(!1),document.removeEventListener("mousemove",S,!1),document.removeEventListener("mouseUp",C,!1)};document.addEventListener("mousemove",S,!1),document.addEventListener("mouseup",C,!1)};let l;kr(()=>{Lb(l,({width:c},d)=>{d===l&&Sh(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||nf,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}=Q,d=(f,h)=>t()==="dark"?h:f;return $n()<Ui?n`
234
234
  flex-direction: column;
235
235
  background-color: ${d(c.gray[300],c.gray[600])};
236
236
  `:n`
@@ -238,38 +238,38 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
238
238
  background-color: ${d(c.gray[200],c.darkGray[900])};
239
239
  `};return(()=>{var c=M$(),d=c.firstChild,f=d.nextSibling,h=l;return typeof h=="function"?no(h,c):l=c,d.$$mousedown=a,f.$$click=()=>e.setLocalStore("open","false"),Y(f,L(Zo,{})),Y(c,L(Ch,e),null),be(g=>{var m=fe(r().panel,r()[`panel-position-${o()}`],u(),{[n`
240
240
  min-width: min-content;
241
- `]:$n()<eh&&(o()==="right"||o()==="left")},"tsqd-main-panel"),p=o()==="bottom"||o()==="top"?`${e.localStore.height||Ob}px`:"auto",v=o()==="right"||o()==="left"?`${e.localStore.width||Eb}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&&ae(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&&ae(d,g.o=b),S!==g.i&&ae(f,g.i=S),g},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),c})()},Ch=e=>{xL(),wL();let t;const n=xt(),r=me().shadowDOMTarget?Me.bind({target:me().shadowDOMTarget}):Me,i=K(()=>n()==="dark"?An(r):En(r)),s=nh(),[o,a]=ce("queries"),l=K(()=>e.localStore.sort||gT),u=K(()=>Number(e.localStore.sortOrder)||Hy),c=K(()=>e.localStore.mutationSort||yT),d=K(()=>Number(e.localStore.mutationSortOrder)||Hy),f=K(()=>Od[l()]),h=K(()=>Ed[c()]),g=K(()=>me().onlineManager),m=K(()=>me().client.getQueryCache()),p=K(()=>me().client.getMutationCache()),v=pt(x=>x().getAll().length,!1),b=K(_r(()=>[v(),e.localStore.filter,l(),u()],()=>{const x=m().getAll(),_=e.localStore.filter?x.filter(E=>Uy(E.queryHash,e.localStore.filter||"").passed):[...x];return f()?_.sort((E,T)=>f()(E,T)*u()):_})),S=Mn(x=>x().getAll().length,!1),C=K(_r(()=>[S(),e.localStore.mutationFilter,c(),d()],()=>{const x=p().getAll(),_=e.localStore.mutationFilter?x.filter(E=>{const T=`${E.options.mutationKey?JSON.stringify(E.options.mutationKey)+" - ":""}${new Date(E.state.submittedAt).toLocaleString()}`;return Uy(T,e.localStore.mutationFilter||"").passed}):[...x];return h()?_.sort((E,T)=>h()(E,T)*d()):_})),w=x=>{e.setLocalStore("position",x)},k=x=>{const O=getComputedStyle(t).getPropertyValue("--tsqd-font-size");x.style.setProperty("--tsqd-font-size",O)};return[(()=>{var x=Y$(),_=x.firstChild,O=_.firstChild,E=O.firstChild,T=E.firstChild,M=T.nextSibling,B=M.firstChild,R=_.nextSibling,j=R.firstChild,P=j.firstChild,I=P.firstChild,G=P.nextSibling,V=G.nextSibling,F=j.nextSibling,U=F.firstChild,z=U.nextSibling,Q=t;return typeof Q=="function"?no(Q,x):t=x,E.$$click=()=>{if(!s().pipWindow&&!e.showPanelViewOnly){e.setLocalStore("open","false");return}e.onClose&&e.onClose()},Y(M,()=>me().queryFlavor,B),Y(M,()=>me().version,null),Y(O,L(pn.Root,{get class(){return fe(i().viewToggle)},get value(){return o()},onChange:N=>{a(N),uc(null),nx(null)},get children(){return[L(pn.Item,{value:"queries",class:"tsqd-radio-toggle",get children(){return[L(pn.ItemInput,{}),L(pn.ItemControl,{get children(){return L(pn.ItemIndicator,{})}}),L(pn.ItemLabel,{title:"Toggle Queries View",children:"Queries"})]}}),L(pn.Item,{value:"mutations",class:"tsqd-radio-toggle",get children(){return[L(pn.ItemInput,{}),L(pn.ItemControl,{get children(){return L(pn.ItemIndicator,{})}}),L(pn.ItemLabel,{title:"Toggle Mutations View",children:"Mutations"})]}})]}}),null),Y(_,L(ve,{get when(){return o()==="queries"},get children(){return L(mL,{})}}),null),Y(_,L(ve,{get when(){return o()==="mutations"},get children(){return L(pL,{})}}),null),Y(P,L(XM,{}),I),I.$$input=N=>{o()==="queries"?e.setLocalStore("filter",N.currentTarget.value):e.setLocalStore("mutationFilter",N.currentTarget.value)},Y(G,L(ve,{get when(){return o()==="queries"},get children(){var N=$$();return N.addEventListener("change",te=>{e.setLocalStore("sort",te.currentTarget.value)}),Y(N,()=>Object.keys(Od).map(te=>(()=>{var J=Lm();return J.firstChild,J.value=te,Y(J,te,null),J})())),be(()=>N.value=l()),N}}),null),Y(G,L(ve,{get when(){return o()==="mutations"},get children(){var N=L$();return N.addEventListener("change",te=>{e.setLocalStore("mutationSort",te.currentTarget.value)}),Y(N,()=>Object.keys(Ed).map(te=>(()=>{var J=Lm();return J.firstChild,J.value=te,Y(J,te,null),J})())),be(()=>N.value=c()),N}}),null),Y(G,L(Zo,{}),null),V.$$click=()=>{o()==="queries"?e.setLocalStore("sortOrder",String(u()*-1)):e.setLocalStore("mutationSortOrder",String(d()*-1))},Y(V,L(ve,{get when(){return(o()==="queries"?u():d())===1},get children(){return[D$(),L(Em,{})]}}),null),Y(V,L(ve,{get when(){return(o()==="queries"?u():d())===-1},get children(){return[I$(),L(Am,{})]}}),null),U.$$click=()=>{o()==="queries"?(Vn({type:"CLEAR_QUERY_CACHE"}),m().clear()):(Vn({type:"CLEAR_MUTATION_CACHE"}),p().clear())},Y(U,L(J1,{})),z.$$click=()=>{g().setOnline(!g().isOnline())},Y(z,(()=>{var N=K(()=>!!jo());return()=>N()?L(i$,{}):L(r$,{})})()),Y(F,L(ve,{get when(){return K(()=>!s().pipWindow)()&&!s().disabled},get children(){var N=R$();return N.$$click=()=>{var te;s().requestPipWindow(Number(window.innerWidth),Number((te=e.localStore.height)!=null?te:500))},Y(N,L(o$,{})),be(()=>ae(N,fe(i().actionsBtn,"tsqd-actions-btn","tsqd-action-open-pip"))),N}}),null),Y(F,L(ft.Root,{gutter:4,get children(){return[L(ft.Trigger,{get class(){return fe(i().actionsBtn,"tsqd-actions-btn","tsqd-action-settings")},get children(){return L(s$,{})}}),L(ft.Portal,{ref:N=>k(N),get mount(){return K(()=>!!s().pipWindow)()?s().pipWindow.document.body:document.body},get children(){return L(ft.Content,{get class(){return fe(i().settingsMenu,"tsqd-settings-menu")},get children(){return[(()=>{var N=N$();return be(()=>ae(N,fe(i().settingsMenuHeader,"tsqd-settings-menu-header"))),N})(),L(ve,{get when(){return!e.showPanelViewOnly},get children(){return L(ft.Sub,{overlap:!0,gutter:8,shift:-4,get children(){return[L(ft.SubTrigger,{get class(){return fe(i().settingsSubTrigger,"tsqd-settings-menu-sub-trigger","tsqd-settings-menu-sub-trigger-position")},get children(){return[F$(),L(Zo,{})]}}),L(ft.Portal,{ref:N=>k(N),get mount(){return K(()=>!!s().pipWindow)()?s().pipWindow.document.body:document.body},get children(){return L(ft.SubContent,{get class(){return fe(i().settingsMenu,"tsqd-settings-submenu")},get children(){return[L(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[B$(),L(Em,{})]}}),L(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[q$(),L(Am,{})]}}),L(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[z$(),L(ZM,{})]}}),L(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[H$(),L(JM,{})]}})]}})}})]}})}}),L(ft.Sub,{overlap:!0,gutter:8,shift:-4,get children(){return[L(ft.SubTrigger,{get class(){return fe(i().settingsSubTrigger,"tsqd-settings-menu-sub-trigger","tsqd-settings-menu-sub-trigger-position")},get children(){return[U$(),L(Zo,{})]}}),L(ft.Portal,{ref:N=>k(N),get mount(){return K(()=>!!s().pipWindow)()?s().pipWindow.document.body:document.body},get children(){return L(ft.SubContent,{get class(){return fe(i().settingsMenu,"tsqd-settings-submenu")},get children(){return[L(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[G$(),L(e$,{})]}}),L(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[K$(),L(t$,{})]}}),L(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[V$(),L(n$,{})]}})]}})}})]}})]}})}})]}}),null),Y(x,L(ve,{get when(){return o()==="queries"},get children(){var N=W$(),te=N.firstChild;return Y(te,L(mu,{by:J=>J.queryHash,get each(){return b()},children:J=>L(gL,{get query(){return J()}})})),be(()=>ae(N,fe(i().overflowQueryContainer,"tsqd-queries-overflow-container"))),N}}),null),Y(x,L(ve,{get when(){return o()==="mutations"},get children(){var N=Q$(),te=N.firstChild;return Y(te,L(mu,{by:J=>J.mutationId,get each(){return C()},children:J=>L(yL,{get mutation(){return J()}})})),be(()=>ae(N,fe(i().overflowQueryContainer,"tsqd-mutations-overflow-container"))),N}}),null),be(N=>{var te=fe(i().queriesContainer,$n()<Ui&&(on()||Jr())&&r`
241
+ `]:$n()<eh&&(o()==="right"||o()==="left")},"tsqd-main-panel"),p=o()==="bottom"||o()==="top"?`${e.localStore.height||Ob}px`:"auto",v=o()==="right"||o()==="left"?`${e.localStore.width||Eb}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&&ae(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&&ae(d,g.o=b),S!==g.i&&ae(f,g.i=S),g},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),c})()},Ch=e=>{xL(),wL();let t;const n=xt(),r=me().shadowDOMTarget?Me.bind({target:me().shadowDOMTarget}):Me,i=K(()=>n()==="dark"?An(r):En(r)),s=nh(),[o,a]=ce("queries"),l=K(()=>e.localStore.sort||gT),u=K(()=>Number(e.localStore.sortOrder)||Hy),c=K(()=>e.localStore.mutationSort||yT),d=K(()=>Number(e.localStore.mutationSortOrder)||Hy),f=K(()=>Od[l()]),h=K(()=>Ed[c()]),g=K(()=>me().onlineManager),m=K(()=>me().client.getQueryCache()),p=K(()=>me().client.getMutationCache()),v=pt(x=>x().getAll().length,!1),b=K(_r(()=>[v(),e.localStore.filter,l(),u()],()=>{const x=m().getAll(),_=e.localStore.filter?x.filter(E=>Uy(E.queryHash,e.localStore.filter||"").passed):[...x];return f()?_.sort((E,T)=>f()(E,T)*u()):_})),S=Mn(x=>x().getAll().length,!1),C=K(_r(()=>[S(),e.localStore.mutationFilter,c(),d()],()=>{const x=p().getAll(),_=e.localStore.mutationFilter?x.filter(E=>{const T=`${E.options.mutationKey?JSON.stringify(E.options.mutationKey)+" - ":""}${new Date(E.state.submittedAt).toLocaleString()}`;return Uy(T,e.localStore.mutationFilter||"").passed}):[...x];return h()?_.sort((E,T)=>h()(E,T)*d()):_})),w=x=>{e.setLocalStore("position",x)},k=x=>{const O=getComputedStyle(t).getPropertyValue("--tsqd-font-size");x.style.setProperty("--tsqd-font-size",O)};return[(()=>{var x=Y$(),_=x.firstChild,O=_.firstChild,E=O.firstChild,T=E.firstChild,M=T.nextSibling,B=M.firstChild,R=_.nextSibling,j=R.firstChild,P=j.firstChild,I=P.firstChild,G=P.nextSibling,W=G.nextSibling,F=j.nextSibling,U=F.firstChild,z=U.nextSibling,V=t;return typeof V=="function"?no(V,x):t=x,E.$$click=()=>{if(!s().pipWindow&&!e.showPanelViewOnly){e.setLocalStore("open","false");return}e.onClose&&e.onClose()},Y(M,()=>me().queryFlavor,B),Y(M,()=>me().version,null),Y(O,L(pn.Root,{get class(){return fe(i().viewToggle)},get value(){return o()},onChange:N=>{a(N),uc(null),nx(null)},get children(){return[L(pn.Item,{value:"queries",class:"tsqd-radio-toggle",get children(){return[L(pn.ItemInput,{}),L(pn.ItemControl,{get children(){return L(pn.ItemIndicator,{})}}),L(pn.ItemLabel,{title:"Toggle Queries View",children:"Queries"})]}}),L(pn.Item,{value:"mutations",class:"tsqd-radio-toggle",get children(){return[L(pn.ItemInput,{}),L(pn.ItemControl,{get children(){return L(pn.ItemIndicator,{})}}),L(pn.ItemLabel,{title:"Toggle Mutations View",children:"Mutations"})]}})]}}),null),Y(_,L(ve,{get when(){return o()==="queries"},get children(){return L(mL,{})}}),null),Y(_,L(ve,{get when(){return o()==="mutations"},get children(){return L(pL,{})}}),null),Y(P,L(XM,{}),I),I.$$input=N=>{o()==="queries"?e.setLocalStore("filter",N.currentTarget.value):e.setLocalStore("mutationFilter",N.currentTarget.value)},Y(G,L(ve,{get when(){return o()==="queries"},get children(){var N=$$();return N.addEventListener("change",te=>{e.setLocalStore("sort",te.currentTarget.value)}),Y(N,()=>Object.keys(Od).map(te=>(()=>{var J=Lm();return J.firstChild,J.value=te,Y(J,te,null),J})())),be(()=>N.value=l()),N}}),null),Y(G,L(ve,{get when(){return o()==="mutations"},get children(){var N=L$();return N.addEventListener("change",te=>{e.setLocalStore("mutationSort",te.currentTarget.value)}),Y(N,()=>Object.keys(Ed).map(te=>(()=>{var J=Lm();return J.firstChild,J.value=te,Y(J,te,null),J})())),be(()=>N.value=c()),N}}),null),Y(G,L(Zo,{}),null),W.$$click=()=>{o()==="queries"?e.setLocalStore("sortOrder",String(u()*-1)):e.setLocalStore("mutationSortOrder",String(d()*-1))},Y(W,L(ve,{get when(){return(o()==="queries"?u():d())===1},get children(){return[D$(),L(Em,{})]}}),null),Y(W,L(ve,{get when(){return(o()==="queries"?u():d())===-1},get children(){return[I$(),L(Am,{})]}}),null),U.$$click=()=>{o()==="queries"?(Vn({type:"CLEAR_QUERY_CACHE"}),m().clear()):(Vn({type:"CLEAR_MUTATION_CACHE"}),p().clear())},Y(U,L(J1,{})),z.$$click=()=>{g().setOnline(!g().isOnline())},Y(z,(()=>{var N=K(()=>!!jo());return()=>N()?L(i$,{}):L(r$,{})})()),Y(F,L(ve,{get when(){return K(()=>!s().pipWindow)()&&!s().disabled},get children(){var N=R$();return N.$$click=()=>{var te;s().requestPipWindow(Number(window.innerWidth),Number((te=e.localStore.height)!=null?te:500))},Y(N,L(o$,{})),be(()=>ae(N,fe(i().actionsBtn,"tsqd-actions-btn","tsqd-action-open-pip"))),N}}),null),Y(F,L(ft.Root,{gutter:4,get children(){return[L(ft.Trigger,{get class(){return fe(i().actionsBtn,"tsqd-actions-btn","tsqd-action-settings")},get children(){return L(s$,{})}}),L(ft.Portal,{ref:N=>k(N),get mount(){return K(()=>!!s().pipWindow)()?s().pipWindow.document.body:document.body},get children(){return L(ft.Content,{get class(){return fe(i().settingsMenu,"tsqd-settings-menu")},get children(){return[(()=>{var N=N$();return be(()=>ae(N,fe(i().settingsMenuHeader,"tsqd-settings-menu-header"))),N})(),L(ve,{get when(){return!e.showPanelViewOnly},get children(){return L(ft.Sub,{overlap:!0,gutter:8,shift:-4,get children(){return[L(ft.SubTrigger,{get class(){return fe(i().settingsSubTrigger,"tsqd-settings-menu-sub-trigger","tsqd-settings-menu-sub-trigger-position")},get children(){return[F$(),L(Zo,{})]}}),L(ft.Portal,{ref:N=>k(N),get mount(){return K(()=>!!s().pipWindow)()?s().pipWindow.document.body:document.body},get children(){return L(ft.SubContent,{get class(){return fe(i().settingsMenu,"tsqd-settings-submenu")},get children(){return[L(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[B$(),L(Em,{})]}}),L(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[q$(),L(Am,{})]}}),L(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[z$(),L(ZM,{})]}}),L(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[H$(),L(JM,{})]}})]}})}})]}})}}),L(ft.Sub,{overlap:!0,gutter:8,shift:-4,get children(){return[L(ft.SubTrigger,{get class(){return fe(i().settingsSubTrigger,"tsqd-settings-menu-sub-trigger","tsqd-settings-menu-sub-trigger-position")},get children(){return[U$(),L(Zo,{})]}}),L(ft.Portal,{ref:N=>k(N),get mount(){return K(()=>!!s().pipWindow)()?s().pipWindow.document.body:document.body},get children(){return L(ft.SubContent,{get class(){return fe(i().settingsMenu,"tsqd-settings-submenu")},get children(){return[L(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[G$(),L(e$,{})]}}),L(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[K$(),L(t$,{})]}}),L(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[V$(),L(n$,{})]}})]}})}})]}})]}})}})]}}),null),Y(x,L(ve,{get when(){return o()==="queries"},get children(){var N=W$(),te=N.firstChild;return Y(te,L(mu,{by:J=>J.queryHash,get each(){return b()},children:J=>L(gL,{get query(){return J()}})})),be(()=>ae(N,fe(i().overflowQueryContainer,"tsqd-queries-overflow-container"))),N}}),null),Y(x,L(ve,{get when(){return o()==="mutations"},get children(){var N=Q$(),te=N.firstChild;return Y(te,L(mu,{by:J=>J.mutationId,get each(){return C()},children:J=>L(yL,{get mutation(){return J()}})})),be(()=>ae(N,fe(i().overflowQueryContainer,"tsqd-mutations-overflow-container"))),N}}),null),be(N=>{var te=fe(i().queriesContainer,$n()<Ui&&(on()||Jr())&&r`
242
242
  height: 50%;
243
243
  max-height: 50%;
244
244
  `,$n()<Ui&&!(on()||Jr())&&r`
245
245
  height: 100%;
246
246
  max-height: 100%;
247
- `,"tsqd-queries-container"),J=fe(i().row,"tsqd-header"),ge=i().logoAndToggleContainer,re=fe(i().logo,"tsqd-text-logo-container"),Se=fe(i().tanstackLogo,"tsqd-text-logo-tanstack"),ye=fe(i().queryFlavorLogo,"tsqd-text-logo-query-flavor"),ze=fe(i().row,"tsqd-filters-actions-container"),le=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,Z=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,jo()&&i().actionsBtnOffline,"tsqd-actions-btn","tsqd-action-mock-offline-behavior"),ue=`${jo()?"Unset offline mocking behavior":"Mock offline behavior"}`,X=jo(),se=`${jo()?"Unset offline mocking behavior":"Mock offline behavior"}`;return te!==N.e&&ae(x,N.e=te),J!==N.t&&ae(_,N.t=J),ge!==N.a&&ae(O,N.a=ge),re!==N.o&&ae(E,N.o=re),Se!==N.i&&ae(T,N.i=Se),ye!==N.n&&ae(M,N.n=ye),ze!==N.s&&ae(R,N.s=ze),le!==N.h&&ae(j,N.h=le),He!==N.r&&ae(P,N.r=He),lt!==N.d&&ae(I,N.d=lt),dt!==N.l&&ae(G,N.l=dt),Ne!==N.u&&oe(V,"aria-label",N.u=Ne),Fe!==N.c&&oe(V,"aria-pressed",N.c=Fe),Z!==N.w&&ae(F,N.w=Z),Te!==N.m&&ae(U,N.m=Te),tt!==N.f&&oe(U,"title",N.f=tt),$e!==N.y&&ae(z,N.y=$e),ue!==N.g&&oe(z,"aria-label",N.g=ue),X!==N.p&&oe(z,"aria-pressed",N.p=X),se!==N.b&&oe(z,"title",N.b=se),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(()=>I.value=o()==="queries"?e.localStore.filter||"":e.localStore.mutationFilter||""),x})(),L(ve,{get when(){return K(()=>o()==="queries")()&&on()},get children(){return L(vL,{})}}),L(ve,{get when(){return K(()=>o()==="mutations")()&&Jr()},get children(){return L(bL,{})}})]},gL=e=>{const t=xt(),n=me().shadowDOMTarget?Me.bind({target:me().shadowDOMTarget}):Me,r=K(()=>t()==="dark"?An(n):En(n)),{colors:i,alpha:s}=W,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`
247
+ `,"tsqd-queries-container"),J=fe(i().row,"tsqd-header"),ge=i().logoAndToggleContainer,re=fe(i().logo,"tsqd-text-logo-container"),Se=fe(i().tanstackLogo,"tsqd-text-logo-tanstack"),ye=fe(i().queryFlavorLogo,"tsqd-text-logo-query-flavor"),ze=fe(i().row,"tsqd-filters-actions-container"),le=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,Z=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,jo()&&i().actionsBtnOffline,"tsqd-actions-btn","tsqd-action-mock-offline-behavior"),ue=`${jo()?"Unset offline mocking behavior":"Mock offline behavior"}`,X=jo(),se=`${jo()?"Unset offline mocking behavior":"Mock offline behavior"}`;return te!==N.e&&ae(x,N.e=te),J!==N.t&&ae(_,N.t=J),ge!==N.a&&ae(O,N.a=ge),re!==N.o&&ae(E,N.o=re),Se!==N.i&&ae(T,N.i=Se),ye!==N.n&&ae(M,N.n=ye),ze!==N.s&&ae(R,N.s=ze),le!==N.h&&ae(j,N.h=le),He!==N.r&&ae(P,N.r=He),lt!==N.d&&ae(I,N.d=lt),dt!==N.l&&ae(G,N.l=dt),Ne!==N.u&&oe(W,"aria-label",N.u=Ne),Fe!==N.c&&oe(W,"aria-pressed",N.c=Fe),Z!==N.w&&ae(F,N.w=Z),Te!==N.m&&ae(U,N.m=Te),tt!==N.f&&oe(U,"title",N.f=tt),$e!==N.y&&ae(z,N.y=$e),ue!==N.g&&oe(z,"aria-label",N.g=ue),X!==N.p&&oe(z,"aria-pressed",N.p=X),se!==N.b&&oe(z,"title",N.b=se),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(()=>I.value=o()==="queries"?e.localStore.filter||"":e.localStore.mutationFilter||""),x})(),L(ve,{get when(){return K(()=>o()==="queries")()&&on()},get children(){return L(vL,{})}}),L(ve,{get when(){return K(()=>o()==="mutations")()&&Jr()},get children(){return L(bL,{})}})]},gL=e=>{const t=xt(),n=me().shadowDOMTarget?Me.bind({target:me().shadowDOMTarget}):Me,r=K(()=>t()==="dark"?An(n):En(n)),{colors:i,alpha:s}=Q,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 L(ve,{get when(){return a()},get children(){var g=tx(),m=g.firstChild,p=m.nextSibling;return g.$$click=()=>uc(e.query.queryHash===on()?null:e.query.queryHash),Y(m,d),Y(p,()=>e.query.queryHash),Y(g,L(ve,{get when(){return l()},get children(){return X$()}}),null),Y(g,L(ve,{get when(){return u()},get children(){return Z$()}}),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&&ae(g,v.e=b),S!==v.t&&oe(g,"aria-label",v.t=S),C!==v.a&&ae(m,v.a=C),v},{e:void 0,t:void 0,a:void 0}),g}})},yL=e=>{const t=xt(),n=me().shadowDOMTarget?Me.bind({target:me().shadowDOMTarget}):Me,r=K(()=>t()==="dark"?An(n):En(n)),{colors:i,alpha:s}=W,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(()=>ds({isPaused:l(),status:u()})),d=()=>c()==="gray"?n`
253
+ `;return L(ve,{get when(){return a()},get children(){var g=tx(),m=g.firstChild,p=m.nextSibling;return g.$$click=()=>uc(e.query.queryHash===on()?null:e.query.queryHash),Y(m,d),Y(p,()=>e.query.queryHash),Y(g,L(ve,{get when(){return l()},get children(){return X$()}}),null),Y(g,L(ve,{get when(){return u()},get children(){return Z$()}}),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&&ae(g,v.e=b),S!==v.t&&oe(g,"aria-label",v.t=S),C!==v.a&&ae(m,v.a=C),v},{e:void 0,t:void 0,a:void 0}),g}})},yL=e=>{const t=xt(),n=me().shadowDOMTarget?Me.bind({target:me().shadowDOMTarget}):Me,r=K(()=>t()==="dark"?An(n):En(n)),{colors:i,alpha:s}=Q,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(()=>ds({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 L(ve,{get when(){return a()},get children(){var f=tx(),h=f.firstChild,g=h.nextSibling;return f.$$click=()=>{nx(e.mutation.mutationId===Jr()?null:e.mutation.mutationId)},Y(h,L(ve,{get when(){return c()==="purple"},get children(){return L(m$,{})}}),null),Y(h,L(ve,{get when(){return c()==="green"},get children(){return L(h$,{})}}),null),Y(h,L(ve,{get when(){return c()==="red"},get children(){return L(y$,{})}}),null),Y(h,L(ve,{get when(){return c()==="yellow"},get children(){return L(g$,{})}}),null),Y(g,L(ve,{get when(){return e.mutation.options.mutationKey},get children(){return[K(()=>JSON.stringify(e.mutation.options.mutationKey))," -"," "]}}),null),Y(g,()=>new Date(e.mutation.state.submittedAt).toLocaleString(),null),be(m=>{var p=fe(r().queryRow,Jr()===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&&ae(f,m.e=p),v!==m.t&&oe(f,"aria-label",m.t=v),b!==m.a&&ae(h,m.a=b),m},{e:void 0,t:void 0,a:void 0}),f}})},mL=()=>{const e=pt(l=>l().getAll().filter(u=>os(u)==="stale").length),t=pt(l=>l().getAll().filter(u=>os(u)==="fresh").length),n=pt(l=>l().getAll().filter(u=>os(u)==="fetching").length),r=pt(l=>l().getAll().filter(u=>os(u)==="paused").length),i=pt(l=>l().getAll().filter(u=>os(u)==="inactive").length),s=xt(),o=me().shadowDOMTarget?Me.bind({target:me().shadowDOMTarget}):Me,a=K(()=>s()==="dark"?An(o):En(o));return(()=>{var l=nl();return Y(l,L(mr,{label:"Fresh",color:"green",get count(){return t()}}),null),Y(l,L(mr,{label:"Fetching",color:"blue",get count(){return n()}}),null),Y(l,L(mr,{label:"Paused",color:"purple",get count(){return r()}}),null),Y(l,L(mr,{label:"Stale",color:"yellow",get count(){return e()}}),null),Y(l,L(mr,{label:"Inactive",color:"gray",get count(){return i()}}),null),be(()=>ae(l,fe(a().queryStatusContainer,"tsqd-query-status-container"))),l})()},pL=()=>{const e=Mn(a=>a().getAll().filter(l=>ds({isPaused:l.state.isPaused,status:l.state.status})==="green").length),t=Mn(a=>a().getAll().filter(l=>ds({isPaused:l.state.isPaused,status:l.state.status})==="yellow").length),n=Mn(a=>a().getAll().filter(l=>ds({isPaused:l.state.isPaused,status:l.state.status})==="purple").length),r=Mn(a=>a().getAll().filter(l=>ds({isPaused:l.state.isPaused,status:l.state.status})==="red").length),i=xt(),s=me().shadowDOMTarget?Me.bind({target:me().shadowDOMTarget}):Me,o=K(()=>i()==="dark"?An(s):En(s));return(()=>{var a=nl();return Y(a,L(mr,{label:"Paused",color:"purple",get count(){return n()}}),null),Y(a,L(mr,{label:"Pending",color:"yellow",get count(){return t()}}),null),Y(a,L(mr,{label:"Success",color:"green",get count(){return e()}}),null),Y(a,L(mr,{label:"Error",color:"red",get count(){return r()}}),null),be(()=>ae(a,fe(o().queryStatusContainer,"tsqd-query-status-container"))),a})()},mr=e=>{const t=xt(),n=me().shadowDOMTarget?Me.bind({target:me().shadowDOMTarget}):Me,r=K(()=>t()==="dark"?An(n):En(n)),{colors:i,alpha:s}=W,o=(h,g)=>t()==="dark"?g:h;let a;const[l,u]=ce(!1),[c,d]=ce(!1),f=K(()=>!(on()&&$n()<cT&&$n()>Ui||$n()<Ui));return(()=>{var h=tL(),g=h.firstChild,m=g.nextSibling,p=a;return typeof p=="function"?no(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)),cv(h,Ae({get disabled(){return f()},get class(){return fe(r().queryStatusTag,!f()&&n`
259
+ `;return L(ve,{get when(){return a()},get children(){var f=tx(),h=f.firstChild,g=h.nextSibling;return f.$$click=()=>{nx(e.mutation.mutationId===Jr()?null:e.mutation.mutationId)},Y(h,L(ve,{get when(){return c()==="purple"},get children(){return L(m$,{})}}),null),Y(h,L(ve,{get when(){return c()==="green"},get children(){return L(h$,{})}}),null),Y(h,L(ve,{get when(){return c()==="red"},get children(){return L(y$,{})}}),null),Y(h,L(ve,{get when(){return c()==="yellow"},get children(){return L(g$,{})}}),null),Y(g,L(ve,{get when(){return e.mutation.options.mutationKey},get children(){return[K(()=>JSON.stringify(e.mutation.options.mutationKey))," -"," "]}}),null),Y(g,()=>new Date(e.mutation.state.submittedAt).toLocaleString(),null),be(m=>{var p=fe(r().queryRow,Jr()===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&&ae(f,m.e=p),v!==m.t&&oe(f,"aria-label",m.t=v),b!==m.a&&ae(h,m.a=b),m},{e:void 0,t:void 0,a:void 0}),f}})},mL=()=>{const e=pt(l=>l().getAll().filter(u=>os(u)==="stale").length),t=pt(l=>l().getAll().filter(u=>os(u)==="fresh").length),n=pt(l=>l().getAll().filter(u=>os(u)==="fetching").length),r=pt(l=>l().getAll().filter(u=>os(u)==="paused").length),i=pt(l=>l().getAll().filter(u=>os(u)==="inactive").length),s=xt(),o=me().shadowDOMTarget?Me.bind({target:me().shadowDOMTarget}):Me,a=K(()=>s()==="dark"?An(o):En(o));return(()=>{var l=nl();return Y(l,L(mr,{label:"Fresh",color:"green",get count(){return t()}}),null),Y(l,L(mr,{label:"Fetching",color:"blue",get count(){return n()}}),null),Y(l,L(mr,{label:"Paused",color:"purple",get count(){return r()}}),null),Y(l,L(mr,{label:"Stale",color:"yellow",get count(){return e()}}),null),Y(l,L(mr,{label:"Inactive",color:"gray",get count(){return i()}}),null),be(()=>ae(l,fe(a().queryStatusContainer,"tsqd-query-status-container"))),l})()},pL=()=>{const e=Mn(a=>a().getAll().filter(l=>ds({isPaused:l.state.isPaused,status:l.state.status})==="green").length),t=Mn(a=>a().getAll().filter(l=>ds({isPaused:l.state.isPaused,status:l.state.status})==="yellow").length),n=Mn(a=>a().getAll().filter(l=>ds({isPaused:l.state.isPaused,status:l.state.status})==="purple").length),r=Mn(a=>a().getAll().filter(l=>ds({isPaused:l.state.isPaused,status:l.state.status})==="red").length),i=xt(),s=me().shadowDOMTarget?Me.bind({target:me().shadowDOMTarget}):Me,o=K(()=>i()==="dark"?An(s):En(s));return(()=>{var a=nl();return Y(a,L(mr,{label:"Paused",color:"purple",get count(){return n()}}),null),Y(a,L(mr,{label:"Pending",color:"yellow",get count(){return t()}}),null),Y(a,L(mr,{label:"Success",color:"green",get count(){return e()}}),null),Y(a,L(mr,{label:"Error",color:"red",get count(){return r()}}),null),be(()=>ae(a,fe(o().queryStatusContainer,"tsqd-query-status-container"))),a})()},mr=e=>{const t=xt(),n=me().shadowDOMTarget?Me.bind({target:me().shadowDOMTarget}):Me,r=K(()=>t()==="dark"?An(n):En(n)),{colors:i,alpha:s}=Q,o=(h,g)=>t()==="dark"?g:h;let a;const[l,u]=ce(!1),[c,d]=ce(!1),f=K(()=>!(on()&&$n()<cT&&$n()>Ui||$n()<Ui));return(()=>{var h=tL(),g=h.firstChild,m=g.nextSibling,p=a;return typeof p=="function"?no(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)),cv(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
264
  `,"tsqd-query-status-tag",`tsqd-query-status-tag-${e.label.toLowerCase()}`)}},()=>l()||c()?{"aria-describedby":"tsqd-status-tooltip"}:{}),!1,!0),Y(h,L(ve,{get when(){return K(()=>!f())()&&(l()||c())},get children(){var v=J$();return Y(v,()=>e.label),be(()=>ae(v,fe(r().statusTooltip,"tsqd-query-status-tooltip"))),v}}),g),Y(h,L(ve,{get when(){return f()},get children(){var v=eL();return Y(v,()=>e.label),be(()=>ae(v,fe(r().queryStatusTagLabel,"tsqd-query-status-tag-label"))),v}}),m),Y(m,()=>e.count),be(v=>{var b=fe(n`
265
- width: ${W.size[1.5]};
266
- height: ${W.size[1.5]};
267
- border-radius: ${W.border.radius.full};
268
- background-color: ${W.colors[e.color][500]};
265
+ width: ${Q.size[1.5]};
266
+ height: ${Q.size[1.5]};
267
+ border-radius: ${Q.border.radius.full};
268
+ background-color: ${Q.colors[e.color][500]};
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&&ae(g,v.e=b),S!==v.t&&ae(m,v.t=S),v},{e:void 0,t:void 0}),h})()},vL=()=>{const e=xt(),t=me().shadowDOMTarget?Me.bind({target:me().shadowDOMTarget}):Me,n=K(()=>e()==="dark"?An(t):En(t)),{colors:r}=W,i=(O,E)=>e()==="dark"?E:O,s=me().client,[o,a]=ce(!1),[l,u]=ce("view"),[c,d]=ce(!1),f=K(()=>me().errorTypes||[]),h=pt(O=>O().getAll().find(E=>E.queryHash===on()),!1),g=pt(O=>O().getAll().find(E=>E.queryHash===on()),!1),m=pt(O=>{var E;return(E=O().getAll().find(T=>T.queryHash===on()))==null?void 0:E.state},!1),p=pt(O=>{var E;return(E=O().getAll().find(T=>T.queryHash===on()))==null?void 0:E.state.data},!1),v=pt(O=>{const E=O().getAll().find(T=>T.queryHash===on());return E?os(E):"inactive"}),b=pt(O=>{const E=O().getAll().find(T=>T.queryHash===on());return E?E.state.status:"pending"}),S=pt(O=>{var E,T;return(T=(E=O().getAll().find(M=>M.queryHash===on()))==null?void 0:E.getObserversCount())!=null?T:0}),C=K(()=>qS(v())),w=()=>{var E,T;Vn({type:"REFETCH",queryHash:(E=h())==null?void 0:E.queryHash});const O=(T=h())==null?void 0:T.fetch();O==null||O.catch(()=>{})},k=O=>{var B;const E=h();if(!E)return;Vn({type:"TRIGGER_ERROR",queryHash:E.queryHash,metadata:{error:O==null?void 0:O.name}});const T=(B=O==null?void 0:O.initializer(E))!=null?B:new Error("Unknown error from devtools"),M=E.options;E.setState({status:"error",error:T,fetchMeta:{...E.state.fetchMeta,__previousQueryOptions:M}})},x=()=>{const O=h();if(!O)return;Vn({type:"RESTORE_LOADING",queryHash:O.queryHash});const E=O.state,T=O.state.fetchMeta?O.state.fetchMeta.__previousQueryOptions:null;O.cancel({silent:!0}),O.setState({...E,fetchStatus:"idle",fetchMeta:null}),T&&O.fetch(T)};xe(()=>{v()!=="fetching"&&a(!1)});const _=()=>C()==="gray"?t`
272
+ `,"tsqd-query-status-tag-count");return b!==v.e&&ae(g,v.e=b),S!==v.t&&ae(m,v.t=S),v},{e:void 0,t:void 0}),h})()},vL=()=>{const e=xt(),t=me().shadowDOMTarget?Me.bind({target:me().shadowDOMTarget}):Me,n=K(()=>e()==="dark"?An(t):En(t)),{colors:r}=Q,i=(O,E)=>e()==="dark"?E:O,s=me().client,[o,a]=ce(!1),[l,u]=ce("view"),[c,d]=ce(!1),f=K(()=>me().errorTypes||[]),h=pt(O=>O().getAll().find(E=>E.queryHash===on()),!1),g=pt(O=>O().getAll().find(E=>E.queryHash===on()),!1),m=pt(O=>{var E;return(E=O().getAll().find(T=>T.queryHash===on()))==null?void 0:E.state},!1),p=pt(O=>{var E;return(E=O().getAll().find(T=>T.queryHash===on()))==null?void 0:E.state.data},!1),v=pt(O=>{const E=O().getAll().find(T=>T.queryHash===on());return E?os(E):"inactive"}),b=pt(O=>{const E=O().getAll().find(T=>T.queryHash===on());return E?E.state.status:"pending"}),S=pt(O=>{var E,T;return(T=(E=O().getAll().find(M=>M.queryHash===on()))==null?void 0:E.getObserversCount())!=null?T:0}),C=K(()=>qS(v())),w=()=>{var E,T;Vn({type:"REFETCH",queryHash:(E=h())==null?void 0:E.queryHash});const O=(T=h())==null?void 0:T.fetch();O==null||O.catch(()=>{})},k=O=>{var B;const E=h();if(!E)return;Vn({type:"TRIGGER_ERROR",queryHash:E.queryHash,metadata:{error:O==null?void 0:O.name}});const T=(B=O==null?void 0:O.initializer(E))!=null?B:new Error("Unknown error from devtools"),M=E.options;E.setState({status:"error",error:T,fetchMeta:{...E.state.fetchMeta,__previousQueryOptions:M}})},x=()=>{const O=h();if(!O)return;Vn({type:"RESTORE_LOADING",queryHash:O.queryHash});const E=O.state,T=O.state.fetchMeta?O.state.fetchMeta.__previousQueryOptions:null;O.cancel({silent:!0}),O.setState({...E,fetchStatus:"idle",fetchMeta:null}),T&&O.fetch(T)};xe(()=>{v()!=="fetching"&&a(!1)});const _=()=>C()==="gray"?t`
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,13 +277,13 @@ 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 L(ve,{get when(){return K(()=>!!h())()&&m()},get children(){var O=oL(),E=O.firstChild,T=E.nextSibling,M=T.firstChild,B=M.firstChild,R=B.firstChild,j=B.nextSibling,P=M.nextSibling,I=P.firstChild,G=I.nextSibling,V=P.nextSibling,F=V.firstChild,U=F.nextSibling,z=T.nextSibling,Q=z.nextSibling,N=Q.firstChild,te=N.firstChild,J=N.nextSibling,ge=J.firstChild,re=J.nextSibling,Se=re.firstChild,ye=re.nextSibling,ze=ye.firstChild,le=ye.nextSibling,He=le.firstChild,lt=He.nextSibling,dt=Q.nextSibling;dt.firstChild;var Ne=dt.nextSibling,Fe=Ne.nextSibling;return Y(R,()=>eu(h().queryKey,!0)),Y(j,v),Y(G,S),Y(U,()=>new Date(m().dataUpdatedAt).toLocaleTimeString()),N.$$click=w,J.$$click=()=>{var Z;Vn({type:"INVALIDATE",queryHash:(Z=h())==null?void 0:Z.queryHash}),s.invalidateQueries(h())},re.$$click=()=>{var Z;Vn({type:"RESET",queryHash:(Z=h())==null?void 0:Z.queryHash}),s.resetQueries(h())},ye.$$click=()=>{var Z;Vn({type:"REMOVE",queryHash:(Z=h())==null?void 0:Z.queryHash}),s.removeQueries(h()),uc(null)},le.$$click=()=>{var Z;if(((Z=h())==null?void 0:Z.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}})}},Y(le,()=>b()==="pending"?"Restore":"Trigger",lt),Y(Q,L(ve,{get when(){return f().length===0||b()==="error"},get children(){var Z=nL(),Te=Z.firstChild,tt=Te.nextSibling;return Z.$$click=()=>{var $e;h().state.error?(Vn({type:"RESTORE_ERROR",queryHash:($e=h())==null?void 0:$e.queryHash}),s.resetQueries(h())):k()},Y(Z,()=>b()==="error"?"Restore":"Trigger",tt),be($e=>{var ue=fe(t`
280
+ `;return L(ve,{get when(){return K(()=>!!h())()&&m()},get children(){var O=oL(),E=O.firstChild,T=E.nextSibling,M=T.firstChild,B=M.firstChild,R=B.firstChild,j=B.nextSibling,P=M.nextSibling,I=P.firstChild,G=I.nextSibling,W=P.nextSibling,F=W.firstChild,U=F.nextSibling,z=T.nextSibling,V=z.nextSibling,N=V.firstChild,te=N.firstChild,J=N.nextSibling,ge=J.firstChild,re=J.nextSibling,Se=re.firstChild,ye=re.nextSibling,ze=ye.firstChild,le=ye.nextSibling,He=le.firstChild,lt=He.nextSibling,dt=V.nextSibling;dt.firstChild;var Ne=dt.nextSibling,Fe=Ne.nextSibling;return Y(R,()=>eu(h().queryKey,!0)),Y(j,v),Y(G,S),Y(U,()=>new Date(m().dataUpdatedAt).toLocaleTimeString()),N.$$click=w,J.$$click=()=>{var Z;Vn({type:"INVALIDATE",queryHash:(Z=h())==null?void 0:Z.queryHash}),s.invalidateQueries(h())},re.$$click=()=>{var Z;Vn({type:"RESET",queryHash:(Z=h())==null?void 0:Z.queryHash}),s.resetQueries(h())},ye.$$click=()=>{var Z;Vn({type:"REMOVE",queryHash:(Z=h())==null?void 0:Z.queryHash}),s.removeQueries(h()),uc(null)},le.$$click=()=>{var Z;if(((Z=h())==null?void 0:Z.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}})}},Y(le,()=>b()==="pending"?"Restore":"Trigger",lt),Y(V,L(ve,{get when(){return f().length===0||b()==="error"},get children(){var Z=nL(),Te=Z.firstChild,tt=Te.nextSibling;return Z.$$click=()=>{var $e;h().state.error?(Vn({type:"RESTORE_ERROR",queryHash:($e=h())==null?void 0:$e.queryHash}),s.resetQueries(h())):k()},Y(Z,()=>b()==="error"?"Restore":"Trigger",tt),be($e=>{var ue=fe(t`
281
281
  color: ${i(r.red[500],r.red[400])};
282
282
  `,"tsqd-query-details-actions-btn","tsqd-query-details-action-error"),X=b()==="pending",se=t`
283
283
  background-color: ${i(r.red[500],r.red[400])};
284
- `;return ue!==$e.e&&ae(Z,$e.e=ue),X!==$e.t&&(Z.disabled=$e.t=X),se!==$e.a&&ae(Te,$e.a=se),$e},{e:void 0,t:void 0,a:void 0}),Z}}),null),Y(Q,L(ve,{get when(){return!(f().length===0||b()==="error")},get children(){var Z=rL(),Te=Z.firstChild,tt=Te.nextSibling,$e=tt.nextSibling;return $e.firstChild,$e.addEventListener("change",ue=>{const X=f().find(se=>se.name===ue.currentTarget.value);k(X)}),Y($e,L(N3,{get each(){return f()},children:ue=>(()=>{var X=aL();return Y(X,()=>ue.name),be(()=>X.value=ue.name),X})()}),null),Y(Z,L(Zo,{}),null),be(ue=>{var X=fe(n().actionsSelect,"tsqd-query-details-actions-btn","tsqd-query-details-action-error-multiple"),se=t`
285
- background-color: ${W.colors.red[400]};
286
- `,ie=b()==="pending";return X!==ue.e&&ae(Z,ue.e=X),se!==ue.t&&ae(Te,ue.t=se),ie!==ue.a&&($e.disabled=ue.a=ie),ue},{e:void 0,t:void 0,a:void 0}),Z}}),null),Y(dt,()=>l()==="view"?"Explorer":"Editor",null),Y(O,L(ve,{get when(){return l()==="view"},get children(){var Z=iL();return Y(Z,L(Yr,{label:"Data",defaultExpanded:["Data"],get value(){return p()},editable:!0,onEdit:()=>u("edit"),get activeQuery(){return h()}})),be(Te=>(Te=W.size[2])!=null?Z.style.setProperty("padding",Te):Z.style.removeProperty("padding")),Z}}),Ne),Y(O,L(ve,{get when(){return l()==="edit"},get children(){var Z=sL(),Te=Z.firstChild,tt=Te.nextSibling,$e=tt.firstChild,ue=$e.nextSibling,X=ue.firstChild,se=X.nextSibling;return Z.addEventListener("submit",ie=>{ie.preventDefault();const gt=new FormData(ie.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)),Y($e,()=>c()?"Invalid Value":""),X.$$click=()=>u("view"),be(ie=>{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`
284
+ `;return ue!==$e.e&&ae(Z,$e.e=ue),X!==$e.t&&(Z.disabled=$e.t=X),se!==$e.a&&ae(Te,$e.a=se),$e},{e:void 0,t:void 0,a:void 0}),Z}}),null),Y(V,L(ve,{get when(){return!(f().length===0||b()==="error")},get children(){var Z=rL(),Te=Z.firstChild,tt=Te.nextSibling,$e=tt.nextSibling;return $e.firstChild,$e.addEventListener("change",ue=>{const X=f().find(se=>se.name===ue.currentTarget.value);k(X)}),Y($e,L(N3,{get each(){return f()},children:ue=>(()=>{var X=aL();return Y(X,()=>ue.name),be(()=>X.value=ue.name),X})()}),null),Y(Z,L(Zo,{}),null),be(ue=>{var X=fe(n().actionsSelect,"tsqd-query-details-actions-btn","tsqd-query-details-action-error-multiple"),se=t`
285
+ background-color: ${Q.colors.red[400]};
286
+ `,ie=b()==="pending";return X!==ue.e&&ae(Z,ue.e=X),se!==ue.t&&ae(Te,ue.t=se),ie!==ue.a&&($e.disabled=ue.a=ie),ue},{e:void 0,t:void 0,a:void 0}),Z}}),null),Y(dt,()=>l()==="view"?"Explorer":"Editor",null),Y(O,L(ve,{get when(){return l()==="view"},get children(){var Z=iL();return Y(Z,L(Yr,{label:"Data",defaultExpanded:["Data"],get value(){return p()},editable:!0,onEdit:()=>u("edit"),get activeQuery(){return h()}})),be(Te=>(Te=Q.size[2])!=null?Z.style.setProperty("padding",Te):Z.style.removeProperty("padding")),Z}}),Ne),Y(O,L(ve,{get when(){return l()==="edit"},get children(){var Z=sL(),Te=Z.firstChild,tt=Te.nextSibling,$e=tt.firstChild,ue=$e.nextSibling,X=ue.firstChild,se=X.nextSibling;return Z.addEventListener("submit",ie=>{ie.preventDefault();const gt=new FormData(ie.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)),Y($e,()=>c()?"Invalid Value":""),X.$$click=()=>u("view"),be(ie=>{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
288
  `),hn=fe(n().devtoolsEditFormAction,t`
289
289
  color: ${i(r.blue[600],r.blue[400])};
@@ -307,7 +307,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
307
307
  color: ${i(r.cyan[500],r.cyan[400])};
308
308
  `,"tsqd-query-details-actions-btn","tsqd-query-details-action-loading"),rl=o(),fo=t`
309
309
  background-color: ${i(r.cyan[500],r.cyan[400])};
310
- `,ho=fe(n().detailsHeader,"tsqd-query-details-header"),go=fe(n().detailsHeader,"tsqd-query-details-header"),es=W.size[2];return Te!==Z.e&&ae(O,Z.e=Te),tt!==Z.t&&ae(E,Z.t=tt),$e!==Z.a&&ae(T,Z.a=$e),ue!==Z.o&&ae(j,Z.o=ue),X!==Z.i&&ae(z,Z.i=X),se!==Z.n&&ae(Q,Z.n=se),ie!==Z.s&&ae(N,Z.s=ie),Ce!==Z.h&&(N.disabled=Z.h=Ce),gt!==Z.r&&ae(te,Z.r=gt),we!==Z.d&&ae(J,Z.d=we),Je!==Z.l&&(J.disabled=Z.l=Je),Be!==Z.u&&ae(ge,Z.u=Be),Tn!==Z.c&&ae(re,Z.c=Tn),Vt!==Z.w&&(re.disabled=Z.w=Vt),hn!==Z.m&&ae(Se,Z.m=hn),Fn!==Z.f&&ae(ye,Z.f=Fn),ir!==Z.y&&(ye.disabled=Z.y=ir),Ji!==Z.g&&ae(ze,Z.g=Ji),jr!==Z.p&&ae(le,Z.p=jr),rl!==Z.b&&(le.disabled=Z.b=rl),fo!==Z.T&&ae(He,Z.T=fo),ho!==Z.A&&ae(dt,Z.A=ho),go!==Z.O&&ae(Ne,Z.O=go),es!==Z.I&&((Z.I=es)!=null?Fe.style.setProperty("padding",es):Fe.style.removeProperty("padding")),Z},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0,y:void 0,g:void 0,p:void 0,b:void 0,T:void 0,A:void 0,O:void 0,I:void 0}),O}})},bL=()=>{const e=xt(),t=me().shadowDOMTarget?Me.bind({target:me().shadowDOMTarget}):Me,n=K(()=>e()==="dark"?An(t):En(t)),{colors:r}=W,i=(c,d)=>e()==="dark"?d:c,s=Mn(c=>{const f=c().getAll().find(h=>h.mutationId===Jr());return f?f.state.isPaused:!1}),o=Mn(c=>{const f=c().getAll().find(h=>h.mutationId===Jr());return f?f.state.status:"idle"}),a=K(()=>ds({isPaused:s(),status:o()})),l=Mn(c=>c().getAll().find(d=>d.mutationId===Jr()),!1),u=()=>a()==="gray"?t`
310
+ `,ho=fe(n().detailsHeader,"tsqd-query-details-header"),go=fe(n().detailsHeader,"tsqd-query-details-header"),es=Q.size[2];return Te!==Z.e&&ae(O,Z.e=Te),tt!==Z.t&&ae(E,Z.t=tt),$e!==Z.a&&ae(T,Z.a=$e),ue!==Z.o&&ae(j,Z.o=ue),X!==Z.i&&ae(z,Z.i=X),se!==Z.n&&ae(V,Z.n=se),ie!==Z.s&&ae(N,Z.s=ie),Ce!==Z.h&&(N.disabled=Z.h=Ce),gt!==Z.r&&ae(te,Z.r=gt),we!==Z.d&&ae(J,Z.d=we),Je!==Z.l&&(J.disabled=Z.l=Je),Be!==Z.u&&ae(ge,Z.u=Be),Tn!==Z.c&&ae(re,Z.c=Tn),Vt!==Z.w&&(re.disabled=Z.w=Vt),hn!==Z.m&&ae(Se,Z.m=hn),Fn!==Z.f&&ae(ye,Z.f=Fn),ir!==Z.y&&(ye.disabled=Z.y=ir),Ji!==Z.g&&ae(ze,Z.g=Ji),jr!==Z.p&&ae(le,Z.p=jr),rl!==Z.b&&(le.disabled=Z.b=rl),fo!==Z.T&&ae(He,Z.T=fo),ho!==Z.A&&ae(dt,Z.A=ho),go!==Z.O&&ae(Ne,Z.O=go),es!==Z.I&&((Z.I=es)!=null?Fe.style.setProperty("padding",es):Fe.style.removeProperty("padding")),Z},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0,y:void 0,g:void 0,p:void 0,b:void 0,T:void 0,A:void 0,O:void 0,I:void 0}),O}})},bL=()=>{const e=xt(),t=me().shadowDOMTarget?Me.bind({target:me().shadowDOMTarget}):Me,n=K(()=>e()==="dark"?An(t):En(t)),{colors:r}=Q,i=(c,d)=>e()==="dark"?d:c,s=Mn(c=>{const f=c().getAll().find(h=>h.mutationId===Jr());return f?f.state.isPaused:!1}),o=Mn(c=>{const f=c().getAll().find(h=>h.mutationId===Jr());return f?f.state.status:"idle"}),a=K(()=>ds({isPaused:s(),status:o()})),l=Mn(c=>c().getAll().find(d=>d.mutationId===Jr()),!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 L(ve,{get when(){return l()},get children(){var c=lL(),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,k=w.nextSibling,x=k.nextSibling,_=x.nextSibling,O=_.nextSibling,E=O.nextSibling,T=E.nextSibling;return Y(m,L(ve,{get when(){return l().options.mutationKey},fallback:"No mutationKey found",get children(){return eu(l().options.mutationKey,!0)}})),Y(p,L(ve,{get when(){return a()==="purple"},children:"pending"}),null),Y(p,L(ve,{get when(){return a()!=="purple"},get children(){return o()}}),null),Y(S,()=>new Date(l().state.submittedAt).toLocaleTimeString()),Y(w,L(Yr,{label:"Variables",defaultExpanded:["Variables"],get value(){return l().state.variables}})),Y(x,L(Yr,{label:"Context",defaultExpanded:["Context"],get value(){return l().state.context}})),Y(O,L(Yr,{label:"Data",defaultExpanded:["Data"],get value(){return l().state.data}})),Y(T,L(Yr,{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"),j=fe(n().detailsBody,"tsqd-query-details-summary-container"),P=fe(n().queryDetailsStatus,u()),I=fe(n().detailsHeader,"tsqd-query-details-header"),G=W.size[2],V=fe(n().detailsHeader,"tsqd-query-details-header"),F=W.size[2],U=fe(n().detailsHeader,"tsqd-query-details-header"),z=W.size[2],Q=fe(n().detailsHeader,"tsqd-query-details-header"),N=W.size[2];return B!==M.e&&ae(c,M.e=B),R!==M.t&&ae(d,M.t=R),j!==M.a&&ae(f,M.a=j),P!==M.o&&ae(p,M.o=P),I!==M.i&&ae(C,M.i=I),G!==M.n&&((M.n=G)!=null?w.style.setProperty("padding",G):w.style.removeProperty("padding")),V!==M.s&&ae(k,M.s=V),F!==M.h&&((M.h=F)!=null?x.style.setProperty("padding",F):x.style.removeProperty("padding")),U!==M.r&&ae(_,M.r=U),z!==M.d&&((M.d=z)!=null?O.style.setProperty("padding",z):O.style.removeProperty("padding")),Q!==M.l&&ae(E,M.l=Q),N!==M.u&&((M.u=N)!=null?T.style.setProperty("padding",N):T.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}})},wu=new Map,xL=()=>{const e=K(()=>me().client.getQueryCache()),t=e().subscribe(n=>{_3(()=>{for(const[r,i]of wu.entries())i.shouldUpdate(n)&&i.setter(r(e))})});return _e(()=>{wu.clear(),t()}),t},pt=(e,t=!0,n=()=>!0)=>{const r=K(()=>me().client.getQueryCache()),[i,s]=ce(e(r),t?void 0:{equals:!1});return xe(()=>{s(e(r))}),wu.set(e,{setter:s,shouldUpdate:n}),_e(()=>{wu.delete(e)}),i},Su=new Map,wL=()=>{const e=K(()=>me().client.getMutationCache()),t=e().subscribe(()=>{for(const[n,r]of Su.entries())queueMicrotask(()=>{r(n(e))})});return _e(()=>{Su.clear(),t()}),t},Mn=(e,t=!0)=>{const n=K(()=>me().client.getMutationCache()),[r,i]=ce(e(n),t?void 0:{equals:!1});return xe(()=>{i(e(n))}),Su.set(e,i),_e(()=>{Su.delete(e)}),r},SL="@tanstack/query-devtools-event",Vn=({type:e,queryHash:t,metadata:n})=>{const r=new CustomEvent(SL,{detail:{type:e,queryHash:t,metadata:n},bubbles:!0,cancelable:!0});window.dispatchEvent(r)},rx=(e,t)=>{const{colors:n,font:r,size:i,alpha:s,shadow:o,border:a}=W,l=(u,c)=>e==="light"?u:c;return{devtoolsBtn:t`
318
+ `;return L(ve,{get when(){return l()},get children(){var c=lL(),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,k=w.nextSibling,x=k.nextSibling,_=x.nextSibling,O=_.nextSibling,E=O.nextSibling,T=E.nextSibling;return Y(m,L(ve,{get when(){return l().options.mutationKey},fallback:"No mutationKey found",get children(){return eu(l().options.mutationKey,!0)}})),Y(p,L(ve,{get when(){return a()==="purple"},children:"pending"}),null),Y(p,L(ve,{get when(){return a()!=="purple"},get children(){return o()}}),null),Y(S,()=>new Date(l().state.submittedAt).toLocaleTimeString()),Y(w,L(Yr,{label:"Variables",defaultExpanded:["Variables"],get value(){return l().state.variables}})),Y(x,L(Yr,{label:"Context",defaultExpanded:["Context"],get value(){return l().state.context}})),Y(O,L(Yr,{label:"Data",defaultExpanded:["Data"],get value(){return l().state.data}})),Y(T,L(Yr,{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"),j=fe(n().detailsBody,"tsqd-query-details-summary-container"),P=fe(n().queryDetailsStatus,u()),I=fe(n().detailsHeader,"tsqd-query-details-header"),G=Q.size[2],W=fe(n().detailsHeader,"tsqd-query-details-header"),F=Q.size[2],U=fe(n().detailsHeader,"tsqd-query-details-header"),z=Q.size[2],V=fe(n().detailsHeader,"tsqd-query-details-header"),N=Q.size[2];return B!==M.e&&ae(c,M.e=B),R!==M.t&&ae(d,M.t=R),j!==M.a&&ae(f,M.a=j),P!==M.o&&ae(p,M.o=P),I!==M.i&&ae(C,M.i=I),G!==M.n&&((M.n=G)!=null?w.style.setProperty("padding",G):w.style.removeProperty("padding")),W!==M.s&&ae(k,M.s=W),F!==M.h&&((M.h=F)!=null?x.style.setProperty("padding",F):x.style.removeProperty("padding")),U!==M.r&&ae(_,M.r=U),z!==M.d&&((M.d=z)!=null?O.style.setProperty("padding",z):O.style.removeProperty("padding")),V!==M.l&&ae(E,M.l=V),N!==M.u&&((M.u=N)!=null?T.style.setProperty("padding",N):T.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}})},wu=new Map,xL=()=>{const e=K(()=>me().client.getQueryCache()),t=e().subscribe(n=>{_3(()=>{for(const[r,i]of wu.entries())i.shouldUpdate(n)&&i.setter(r(e))})});return _e(()=>{wu.clear(),t()}),t},pt=(e,t=!0,n=()=>!0)=>{const r=K(()=>me().client.getQueryCache()),[i,s]=ce(e(r),t?void 0:{equals:!1});return xe(()=>{s(e(r))}),wu.set(e,{setter:s,shouldUpdate:n}),_e(()=>{wu.delete(e)}),i},Su=new Map,wL=()=>{const e=K(()=>me().client.getMutationCache()),t=e().subscribe(()=>{for(const[n,r]of Su.entries())queueMicrotask(()=>{r(n(e))})});return _e(()=>{Su.clear(),t()}),t},Mn=(e,t=!0)=>{const n=K(()=>me().client.getMutationCache()),[r,i]=ce(e(n),t?void 0:{equals:!1});return xe(()=>{i(e(n))}),Su.set(e,i),_e(()=>{Su.delete(e)}),r},SL="@tanstack/query-devtools-event",Vn=({type:e,queryHash:t,metadata:n})=>{const r=new CustomEvent(SL,{detail:{type:e,queryHash:t,metadata:n},bubbles:!0,cancelable:!0});window.dispatchEvent(r)},rx=(e,t)=>{const{colors:n,font:r,size:i,alpha:s,shadow:o,border:a}=Q,l=(u,c)=>e==="light"?u:c;return{devtoolsBtn:t`
319
319
  z-index: 100000;
320
320
  position: fixed;
321
321
  padding: 4px;
@@ -372,7 +372,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
372
372
  position: fixed;
373
373
  z-index: 9999;
374
374
  display: flex;
375
- gap: ${W.size[.5]};
375
+ gap: ${Q.size[.5]};
376
376
  & * {
377
377
  box-sizing: border-box;
378
378
  text-transform: none;
@@ -397,7 +397,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
397
397
  z-index: 9999;
398
398
  display: flex;
399
399
  height: 100%;
400
- gap: ${W.size[.5]};
400
+ gap: ${Q.size[.5]};
401
401
  & * {
402
402
  box-sizing: border-box;
403
403
  text-transform: none;
@@ -603,8 +603,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
603
603
  display: flex;
604
604
  justify-content: space-between;
605
605
  align-items: center;
606
- padding: ${W.size[2]} ${W.size[2.5]};
607
- gap: ${W.size[2.5]};
606
+ padding: ${Q.size[2]} ${Q.size[2.5]};
607
+ gap: ${Q.size[2.5]};
608
608
  border-bottom: ${l(n.gray[300],n.darkGray[500])} 1px solid;
609
609
  align-items: center;
610
610
  & > button {
@@ -617,7 +617,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
617
617
  }
618
618
  `,logoAndToggleContainer:t`
619
619
  display: flex;
620
- gap: ${W.size[3]};
620
+ gap: ${Q.size[3]};
621
621
  align-items: center;
622
622
  `,logo:t`
623
623
  cursor: pointer;
@@ -625,7 +625,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
625
625
  flex-direction: column;
626
626
  background-color: transparent;
627
627
  border: none;
628
- gap: ${W.size[.5]};
628
+ gap: ${Q.size[.5]};
629
629
  padding: 0px;
630
630
  &:hover {
631
631
  opacity: 0.7;
@@ -655,19 +655,19 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
655
655
  white-space: nowrap;
656
656
  `,queryStatusContainer:t`
657
657
  display: flex;
658
- gap: ${W.size[2]};
658
+ gap: ${Q.size[2]};
659
659
  height: min-content;
660
660
  `,queryStatusTag:t`
661
661
  display: flex;
662
- gap: ${W.size[1.5]};
662
+ gap: ${Q.size[1.5]};
663
663
  box-sizing: border-box;
664
- height: ${W.size[6.5]};
664
+ height: ${Q.size[6.5]};
665
665
  background: ${l(n.gray[50],n.darkGray[500])};
666
666
  color: ${l(n.gray[700],n.gray[300])};
667
- border-radius: ${W.border.radius.sm};
667
+ border-radius: ${Q.border.radius.sm};
668
668
  font-size: ${r.size.sm};
669
- padding: ${W.size[1]};
670
- padding-left: ${W.size[1.5]};
669
+ padding: ${Q.size[1]};
670
+ padding-left: ${Q.size[1.5]};
671
671
  align-items: center;
672
672
  font-weight: ${r.weight.medium};
673
673
  border: ${l("1px solid "+n.gray[300],"1px solid transparent")};
@@ -689,16 +689,16 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
689
689
  background-color: ${l(n.gray[200],n.darkGray[300])};
690
690
  border-radius: 2px;
691
691
  font-variant-numeric: tabular-nums;
692
- height: ${W.size[4.5]};
692
+ height: ${Q.size[4.5]};
693
693
  `,statusTooltip:t`
694
694
  position: absolute;
695
695
  z-index: 1;
696
696
  background-color: ${l(n.gray[50],n.darkGray[500])};
697
697
  top: 100%;
698
698
  left: 50%;
699
- transform: translate(-50%, calc(${W.size[2]}));
700
- padding: ${W.size[.5]} ${W.size[2]};
701
- border-radius: ${W.border.radius.sm};
699
+ transform: translate(-50%, calc(${Q.size[2]}));
700
+ padding: ${Q.size[.5]} ${Q.size[2]};
701
+ border-radius: ${Q.border.radius.sm};
702
702
  font-size: ${r.size.xs};
703
703
  border: 1px solid ${l(n.gray[400],n.gray[600])};
704
704
  color: ${l(n.gray[600],n.gray[300])};
@@ -731,12 +731,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
731
731
  }
732
732
  `,filtersContainer:t`
733
733
  display: flex;
734
- gap: ${W.size[2]};
734
+ gap: ${Q.size[2]};
735
735
  & > button {
736
736
  cursor: pointer;
737
- padding: ${W.size[.5]} ${W.size[1.5]} ${W.size[.5]}
738
- ${W.size[2]};
739
- border-radius: ${W.border.radius.sm};
737
+ padding: ${Q.size[.5]} ${Q.size[1.5]} ${Q.size[.5]}
738
+ ${Q.size[2]};
739
+ border-radius: ${Q.border.radius.sm};
740
740
  background-color: ${l(n.gray[100],n.darkGray[400])};
741
741
  border: 1px solid ${l(n.gray[300],n.darkGray[200])};
742
742
  color: ${l(n.gray[700],n.gray[300])};
@@ -744,7 +744,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
744
744
  display: flex;
745
745
  align-items: center;
746
746
  line-height: ${r.lineHeight.sm};
747
- gap: ${W.size[1.5]};
747
+ gap: ${Q.size[1.5]};
748
748
  max-width: 160px;
749
749
  &:focus-visible {
750
750
  outline-offset: 2px;
@@ -752,19 +752,19 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
752
752
  outline: 2px solid ${n.blue[800]};
753
753
  }
754
754
  & svg {
755
- width: ${W.size[3]};
756
- height: ${W.size[3]};
755
+ width: ${Q.size[3]};
756
+ height: ${Q.size[3]};
757
757
  color: ${l(n.gray[500],n.gray[400])};
758
758
  }
759
759
  }
760
760
  `,filterInput:t`
761
761
  padding: ${i[.5]} ${i[2]};
762
- border-radius: ${W.border.radius.sm};
762
+ border-radius: ${Q.border.radius.sm};
763
763
  background-color: ${l(n.gray[100],n.darkGray[400])};
764
764
  display: flex;
765
765
  box-sizing: content-box;
766
766
  align-items: center;
767
- gap: ${W.size[1.5]};
767
+ gap: ${Q.size[1.5]};
768
768
  max-width: 160px;
769
769
  min-width: 100px;
770
770
  border: 1px solid ${l(n.gray[300],n.darkGray[200])};
@@ -796,20 +796,20 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
796
796
  outline: 2px solid ${n.blue[800]};
797
797
  }
798
798
  `,filterSelect:t`
799
- padding: ${W.size[.5]} ${W.size[2]};
800
- border-radius: ${W.border.radius.sm};
799
+ padding: ${Q.size[.5]} ${Q.size[2]};
800
+ border-radius: ${Q.border.radius.sm};
801
801
  background-color: ${l(n.gray[100],n.darkGray[400])};
802
802
  display: flex;
803
803
  align-items: center;
804
- gap: ${W.size[1.5]};
804
+ gap: ${Q.size[1.5]};
805
805
  box-sizing: content-box;
806
806
  max-width: 160px;
807
807
  border: 1px solid ${l(n.gray[300],n.darkGray[200])};
808
808
  height: min-content;
809
809
  & > svg {
810
810
  color: ${l(n.gray[600],n.gray[400])};
811
- width: ${W.size[2]};
812
- height: ${W.size[2]};
811
+ width: ${Q.size[2]};
812
+ height: ${Q.size[2]};
813
813
  }
814
814
  & > select {
815
815
  appearance: none;
@@ -830,17 +830,17 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
830
830
  }
831
831
  `,actionsContainer:t`
832
832
  display: flex;
833
- gap: ${W.size[2]};
833
+ gap: ${Q.size[2]};
834
834
  `,actionsBtn:t`
835
- border-radius: ${W.border.radius.sm};
835
+ border-radius: ${Q.border.radius.sm};
836
836
  background-color: ${l(n.gray[100],n.darkGray[400])};
837
837
  border: 1px solid ${l(n.gray[300],n.darkGray[200])};
838
- width: ${W.size[6.5]};
839
- height: ${W.size[6.5]};
838
+ width: ${Q.size[6.5]};
839
+ height: ${Q.size[6.5]};
840
840
  justify-content: center;
841
841
  display: flex;
842
842
  align-items: center;
843
- gap: ${W.size[1.5]};
843
+ gap: ${Q.size[1.5]};
844
844
  max-width: 160px;
845
845
  cursor: pointer;
846
846
  padding: 0;
@@ -849,8 +849,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
849
849
  }
850
850
  & svg {
851
851
  color: ${l(n.gray[700],n.gray[300])};
852
- width: ${W.size[3]};
853
- height: ${W.size[3]};
852
+ width: ${Q.size[3]};
853
+ height: ${Q.size[3]};
854
854
  }
855
855
  &:focus-visible {
856
856
  outline-offset: 2px;
@@ -891,9 +891,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
891
891
  }
892
892
 
893
893
  & .tsqd-query-observer-count {
894
- padding: 0 ${W.size[1]};
894
+ padding: 0 ${Q.size[1]};
895
895
  user-select: none;
896
- min-width: ${W.size[6.5]};
896
+ min-width: ${Q.size[6.5]};
897
897
  align-self: stretch;
898
898
  display: flex;
899
899
  align-items: center;
@@ -909,9 +909,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
909
909
  font-size: ${r.size.xs};
910
910
  display: flex;
911
911
  align-items: center;
912
- min-height: ${W.size[6]};
912
+ min-height: ${Q.size[6]};
913
913
  flex: 1;
914
- padding: ${W.size[1]} ${W.size[2]};
914
+ padding: ${Q.size[1]} ${Q.size[2]};
915
915
  font-family:
916
916
  ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
917
917
  'Liberation Mono', 'Courier New', monospace;
@@ -925,7 +925,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
925
925
  align-self: stretch;
926
926
  display: flex;
927
927
  align-items: center;
928
- padding: 0 ${W.size[2]};
928
+ padding: 0 ${Q.size[2]};
929
929
  color: ${l(n.gray[800],n.gray[300])};
930
930
  background-color: ${l(n.gray[300],n.darkGray[600])};
931
931
  border-bottom: 1px solid ${l(n.gray[300],n.darkGray[400])};
@@ -936,7 +936,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
936
936
  align-self: stretch;
937
937
  display: flex;
938
938
  align-items: center;
939
- padding: 0 ${W.size[2]};
939
+ padding: 0 ${Q.size[2]};
940
940
  color: ${l(n.teal[800],n.teal[300])};
941
941
  background-color: ${l(n.teal[100],n.teal[900])};
942
942
  border-bottom: 1px solid ${l(n.teal[300],n.teal[700])};
@@ -960,17 +960,17 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
960
960
  top: 0;
961
961
  z-index: 2;
962
962
  background-color: ${l(n.gray[200],n.darkGray[600])};
963
- padding: ${W.size[1.5]} ${W.size[2]};
963
+ padding: ${Q.size[1.5]} ${Q.size[2]};
964
964
  font-weight: ${r.weight.medium};
965
965
  font-size: ${r.size.xs};
966
966
  line-height: ${r.lineHeight.xs};
967
967
  text-align: left;
968
968
  `,detailsBody:t`
969
- margin: ${W.size[1.5]} 0px ${W.size[2]} 0px;
969
+ margin: ${Q.size[1.5]} 0px ${Q.size[2]} 0px;
970
970
  & > div {
971
971
  display: flex;
972
972
  align-items: stretch;
973
- padding: 0 ${W.size[2]};
973
+ padding: 0 ${Q.size[2]};
974
974
  line-height: ${r.lineHeight.sm};
975
975
  justify-content: space-between;
976
976
  & > span {
@@ -982,7 +982,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
982
982
  }
983
983
 
984
984
  & > div:first-child {
985
- margin-bottom: ${W.size[1.5]};
985
+ margin-bottom: ${Q.size[1.5]};
986
986
  }
987
987
 
988
988
  & code {
@@ -1001,25 +1001,25 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1001
1001
  }
1002
1002
  `,queryDetailsStatus:t`
1003
1003
  border: 1px solid ${n.darkGray[200]};
1004
- border-radius: ${W.border.radius.sm};
1004
+ border-radius: ${Q.border.radius.sm};
1005
1005
  font-weight: ${r.weight.medium};
1006
- padding: ${W.size[1]} ${W.size[2.5]};
1006
+ padding: ${Q.size[1]} ${Q.size[2.5]};
1007
1007
  `,actionsBody:t`
1008
1008
  flex-wrap: wrap;
1009
- margin: ${W.size[2]} 0px ${W.size[2]} 0px;
1009
+ margin: ${Q.size[2]} 0px ${Q.size[2]} 0px;
1010
1010
  display: flex;
1011
- gap: ${W.size[2]};
1012
- padding: 0px ${W.size[2]};
1011
+ gap: ${Q.size[2]};
1012
+ padding: 0px ${Q.size[2]};
1013
1013
  & > button {
1014
1014
  font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
1015
1015
  font-size: ${r.size.xs};
1016
- padding: ${W.size[1]} ${W.size[2]};
1016
+ padding: ${Q.size[1]} ${Q.size[2]};
1017
1017
  display: flex;
1018
- border-radius: ${W.border.radius.sm};
1018
+ border-radius: ${Q.border.radius.sm};
1019
1019
  background-color: ${l(n.gray[100],n.darkGray[600])};
1020
1020
  border: 1px solid ${l(n.gray[300],n.darkGray[400])};
1021
1021
  align-items: center;
1022
- gap: ${W.size[2]};
1022
+ gap: ${Q.size[2]};
1023
1023
  font-weight: ${r.weight.medium};
1024
1024
  line-height: ${r.lineHeight.xs};
1025
1025
  cursor: pointer;
@@ -1040,19 +1040,19 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1040
1040
  & > span {
1041
1041
  width: ${i[1.5]};
1042
1042
  height: ${i[1.5]};
1043
- border-radius: ${W.border.radius.full};
1043
+ border-radius: ${Q.border.radius.full};
1044
1044
  }
1045
1045
  }
1046
1046
  `,actionsSelect:t`
1047
1047
  font-size: ${r.size.xs};
1048
- padding: ${W.size[.5]} ${W.size[2]};
1048
+ padding: ${Q.size[.5]} ${Q.size[2]};
1049
1049
  display: flex;
1050
- border-radius: ${W.border.radius.sm};
1050
+ border-radius: ${Q.border.radius.sm};
1051
1051
  overflow: hidden;
1052
1052
  background-color: ${l(n.gray[100],n.darkGray[600])};
1053
1053
  border: 1px solid ${l(n.gray[300],n.darkGray[400])};
1054
1054
  align-items: center;
1055
- gap: ${W.size[2]};
1055
+ gap: ${Q.size[2]};
1056
1056
  font-weight: ${r.weight.medium};
1057
1057
  line-height: ${r.lineHeight.sm};
1058
1058
  color: ${l(n.red[500],n.red[400])};
@@ -1064,7 +1064,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1064
1064
  & > span {
1065
1065
  width: ${i[1.5]};
1066
1066
  height: ${i[1.5]};
1067
- border-radius: ${W.border.radius.full};
1067
+ border-radius: ${Q.border.radius.full};
1068
1068
  }
1069
1069
  &:focus-within {
1070
1070
  outline-offset: 2px;
@@ -1085,11 +1085,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1085
1085
  }
1086
1086
 
1087
1087
  & svg path {
1088
- stroke: ${W.colors.red[400]};
1088
+ stroke: ${Q.colors.red[400]};
1089
1089
  }
1090
1090
  & svg {
1091
- width: ${W.size[2]};
1092
- height: ${W.size[2]};
1091
+ width: ${Q.size[2]};
1092
+ height: ${Q.size[2]};
1093
1093
  }
1094
1094
  `,settingsMenu:t`
1095
1095
  display: flex;
@@ -1098,7 +1098,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1098
1098
  }
1099
1099
  flex-direction: column;
1100
1100
  gap: ${i[.5]};
1101
- border-radius: ${W.border.radius.sm};
1101
+ border-radius: ${Q.border.radius.sm};
1102
1102
  border: 1px solid ${l(n.gray[300],n.gray[700])};
1103
1103
  background-color: ${l(n.gray[50],n.darkGray[600])};
1104
1104
  font-size: ${r.size.xs};
@@ -1110,8 +1110,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1110
1110
  display: flex;
1111
1111
  align-items: center;
1112
1112
  justify-content: space-between;
1113
- border-radius: ${W.border.radius.xs};
1114
- padding: ${W.size[1]} ${W.size[1]};
1113
+ border-radius: ${Q.border.radius.xs};
1114
+ padding: ${Q.size[1]} ${Q.size[1]};
1115
1115
  cursor: pointer;
1116
1116
  background-color: transparent;
1117
1117
  border: none;
@@ -1119,8 +1119,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1119
1119
  & svg {
1120
1120
  color: ${l(n.gray[600],n.gray[400])};
1121
1121
  transform: rotate(-90deg);
1122
- width: ${W.size[2]};
1123
- height: ${W.size[2]};
1122
+ width: ${Q.size[2]};
1123
+ height: ${Q.size[2]};
1124
1124
  }
1125
1125
  &:hover {
1126
1126
  background-color: ${l(n.gray[200],n.darkGray[500])};
@@ -1134,7 +1134,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1134
1134
  cursor: not-allowed;
1135
1135
  }
1136
1136
  `,settingsMenuHeader:t`
1137
- padding: ${W.size[1]} ${W.size[1]};
1137
+ padding: ${Q.size[1]} ${Q.size[1]};
1138
1138
  font-weight: ${r.weight.medium};
1139
1139
  border-bottom: 1px solid ${l(n.gray[300],n.darkGray[400])};
1140
1140
  color: ${l(n.gray[500],n.gray[400])};
@@ -1145,8 +1145,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1145
1145
  justify-content: space-between;
1146
1146
  color: ${l(n.gray[700],n.gray[300])};
1147
1147
  font-size: ${r.size.xs};
1148
- border-radius: ${W.border.radius.xs};
1149
- padding: ${W.size[1]} ${W.size[1]};
1148
+ border-radius: ${Q.border.radius.xs};
1149
+ padding: ${Q.size[1]} ${Q.size[1]};
1150
1150
  cursor: pointer;
1151
1151
  background-color: transparent;
1152
1152
  border: none;
@@ -1170,7 +1170,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1170
1170
  background-color: ${l(n.purple[100],n.purple[900])};
1171
1171
  }
1172
1172
  `,viewToggle:t`
1173
- border-radius: ${W.border.radius.sm};
1173
+ border-radius: ${Q.border.radius.sm};
1174
1174
  background-color: ${l(n.gray[200],n.darkGray[600])};
1175
1175
  border: 1px solid ${l(n.gray[300],n.darkGray[200])};
1176
1176
  display: flex;
@@ -1208,14 +1208,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1208
1208
 
1209
1209
  & .tsqd-radio-toggle:first-child {
1210
1210
  & label {
1211
- padding: 0 ${W.size[1.5]} 0 ${W.size[2]};
1211
+ padding: 0 ${Q.size[1.5]} 0 ${Q.size[2]};
1212
1212
  }
1213
1213
  border-right: 1px solid ${l(n.gray[300],n.darkGray[200])};
1214
1214
  }
1215
1215
 
1216
1216
  & .tsqd-radio-toggle:nth-child(2) {
1217
1217
  & label {
1218
- padding: 0 ${W.size[2]} 0 ${W.size[1.5]};
1218
+ padding: 0 ${Q.size[2]} 0 ${Q.size[1.5]};
1219
1219
  }
1220
1220
  }
1221
1221
  `,devtoolsEditForm:t`
@@ -1257,7 +1257,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1257
1257
  `,devtoolsEditFormAction:t`
1258
1258
  font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
1259
1259
  font-size: ${r.size.xs};
1260
- padding: ${i[1]} ${W.size[2]};
1260
+ padding: ${i[1]} ${Q.size[2]};
1261
1261
  display: flex;
1262
1262
  border-radius: ${a.radius.sm};
1263
1263
  background-color: ${l(n.gray[100],n.darkGray[600])};
@@ -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
- `}},En=e=>rx("light",e),An=e=>rx("dark",e);Pu(["click","mousedown","input"]);var CL=e=>{const[t,n]=_b({prefix:"TanstackQueryDevtools"}),r=jv(),i=K(()=>{const s=t.theme_preference||kb;return s!=="system"?s:r()});return L(th.Provider,{value:e,get children(){return L(Tb,{localStore:t,setLocalStore:n,get children(){return L(rh.Provider,{value:i,get children(){return L(cL,{localStore:t,setLocalStore:n})}})}})}})},_L=CL;const kL=Object.freeze(Object.defineProperty({__proto__:null,default:_L},Symbol.toStringTag,{value:"Module"}));var OL=e=>{const[t,n]=_b({prefix:"TanstackQueryDevtools"}),r=jv(),i=K(()=>{const s=t.theme_preference||kb;return s!=="system"?s:r()});return L(th.Provider,{value:e,get children(){return L(Tb,{disabled:!0,localStore:t,setLocalStore:n,get children(){return L(rh.Provider,{value:i,get children(){return L(fL,{get children(){return L(Ch,{localStore:t,setLocalStore:n,get onClose(){return e.onClose},showPanelViewOnly:!0})}})}})}})}})},EL=OL;const AL=Object.freeze(Object.defineProperty({__proto__:null,default:EL},Symbol.toStringTag,{value:"Module"}));function ix(e){var t=e.children,n=e.description,r=e.title;return y.jsxs(A.Paper.Header,{children:[r&&y.jsx(A.Title,{className:Oe({"yst-mb-3":n||t}),children:r}),n&&(typeof n=="string"?y.jsx("p",{children:n}):n),t]})}function Ho(){/*! 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 k,x,_,O=0,E=w||[],T=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(j,P){return k=j,x=0,_=e,M.n=P,o}};function B(R,j){for(x=R,_=j,t=0;!T&&O&&!P&&t<E.length;t++){var P,I=E[t],G=M.p,V=I[2];R>3?(P=V===j)&&(_=I[(x=I[4])?5:(x=3,3)],I[4]=I[5]=e):I[0]<=G&&((P=R<2&&G<I[1])?(x=0,M.v=j,M.n=I[1]):G<V&&(P=R<3||I[0]>j||j>V)&&(I[4]=R,I[5]=j,M.n=V,x=0))}if(P||R>1)return o;throw T=!0,j}return function(R,j,P){if(O>1)throw TypeError("Generator is already running");for(T&&j===1&&B(j,P),x=j,_=P;(t=x<2?e:_)||!T;){k||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(O=2,k){if(x||(R="next"),t=k[R]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=k.return)&&t.call(k),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);k=e}else if((t=(T=M.n<0)?_:S.call(C,M))!==o)break}catch(I){k=e,x=1,_=I}finally{O=1}}return{value:t,done:T}}}(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]"}),(Ho=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 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 Im(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 Jc(e,t){return ML(e)||jL(e,t)||PL(e,t)||TL()}function TL(){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 PL(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 jL(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 ML(e){if(Array.isArray(e))return e}var $L=function(t){var n=t.isOpen,r=t.onClose,i=t.groupToEdit,s=t.allBrands,o=Nn(),a=o.brandId,l=o.analysisId,u=q.useState(""),c=Jc(u,2),d=c[0],f=c[1],h=q.useState([]),g=Jc(h,2),m=g[0],p=g[1],v=q.useState(!1),b=Jc(v,2),S=b[0],C=b[1],w=Gt();q.useEffect(function(){if(n&&i&&i.type==="group"){var G;f(String(i.name||""));var V=((G=i.groupedBrands)===null||G===void 0?void 0:G.map(function(F){return String(F.id||"")}))||[];p(V)}},[n,i]);var k=l2({mutation:{onSuccess:function(){var G=Im(Ho().m(function F(){return Ho().w(function(U){for(;;)switch(U.n){case 0:return U.n=1,Promise.all([w.invalidateQueries({queryKey:ru(a)}),w.invalidateQueries({queryKey:pr(a,"latest")}),w.invalidateQueries({queryKey:Zn(a,"latest")}),w.invalidateQueries({queryKey:pr(a,l)}),w.invalidateQueries({queryKey:Zn(a,l)})]);case 1:B();case 2:return U.a(2)}},F)}));function V(){return G.apply(this,arguments)}return V}(),onError:function(V){console.error("Error creating brand group:",V)}}}),x=k.mutate,_=k.isPending,O=r4({mutation:{onSuccess:function(){var G=Im(Ho().m(function F(){return Ho().w(function(U){for(;;)switch(U.n){case 0:return U.n=1,Promise.all([w.invalidateQueries({queryKey:ru(a)}),w.invalidateQueries({queryKey:pr(a,"latest")}),w.invalidateQueries({queryKey:Zn(a,"latest")}),w.invalidateQueries({queryKey:pr(a,l)}),w.invalidateQueries({queryKey:Zn(a,l)})]);case 1:B(),P();case 2:return U.a(2)}},F)}));function V(){return G.apply(this,arguments)}return V}(),onError:function(V){console.error("Error deleting brand group:",V),window.alert("An error occurred while ungrouping the brands. Please try again later.")}}}),E=O.mutate,T=O.isPending,M=function(){!d.trim()||!(i!=null&&i.id)||x({brandId:a,data:{groupName:d.trim(),brandIds:m.map(function(V){return Number(V)})}})},B=function(){f(""),p([]),r()},R=function(){return m.map(function(V){if(i&&i.type==="group"){var F,U=(F=i.groupedBrands)===null||F===void 0?void 0:F.find(function(Q){return String(Q.id)===V});if(U)return U.name||""}var z=s.find(function(Q){return String(Q.id)===V});return z?z.type==="group"?"Group: ".concat(z.name):z.name||"":""}).filter(Boolean)},j=function(){C(!0)},P=function(){return C(!1)},I=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(A.Modal,{isOpen:n,onClose:S?function(){}:B,as:"div",children:y.jsx(A.Modal.Panel,{children:y.jsxs(A.Modal.Container,{children:[y.jsx(A.Modal.Container.Header,{className:"yst-mb-4",children:y.jsx(A.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Edit brand group"})}),y.jsxs(A.Modal.Container.Content,{className:"yst-mb-8 yst-space-y-4",children:[y.jsx("p",{className:"yst-text-sm yst-text-slate-600",children:"Update the group name or ungroup brands by removing their tags."}),y.jsxs("div",{children:[y.jsx("label",{htmlFor:"editGroupName",className:"yst-mb-2 yst-block yst-text-sm yst-font-medium",children:"Group name"}),y.jsx(A.TextInput,{id:"editGroupName",value:d,onChange:function(G){return f(G.target.value)},placeholder:"Enter group name",className:"yst-w-full"})]}),y.jsxs("div",{children:[y.jsx(A.TagField,{readOnly:!0,id:"editGroupedBrands",label:"Grouped brands",tags:R(),onRemoveTag:function(G){if(m.length<2)return C(!0);p(function(V){return V.filter(function(F,U){return U!==G})})},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(A.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(A.Button,{variant:"tertiary",onClick:j,disabled:_,className:"yst-text-red-600",children:"Ungroup brands"})}),y.jsxs("div",{className:"yst-flex yst-justify-end yst-gap-2",children:[y.jsx(A.Button,{variant:"secondary",onClick:B,children:"Cancel"}),y.jsx(A.Button,{variant:"primary",onClick:M,disabled:!d.trim()||_,isLoading:_,children:_?"Saving...":"Save changes"})]})]})})]})})}),y.jsx(Gu,{isOpen:S,onClose:P,onConfirm:I,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:T})]})};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 Jt(b,"_invoke",function(S,C,w){var k,x,_,O=0,E=w||[],T=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(j,P){return k=j,x=0,_=e,M.n=P,o}};function B(R,j){for(x=R,_=j,t=0;!T&&O&&!P&&t<E.length;t++){var P,I=E[t],G=M.p,V=I[2];R>3?(P=V===j)&&(_=I[(x=I[4])?5:(x=3,3)],I[4]=I[5]=e):I[0]<=G&&((P=R<2&&G<I[1])?(x=0,M.v=j,M.n=I[1]):G<V&&(P=R<3||I[0]>j||j>V)&&(I[4]=R,I[5]=j,M.n=V,x=0))}if(P||R>1)return o;throw T=!0,j}return function(R,j,P){if(O>1)throw TypeError("Generator is already running");for(T&&j===1&&B(j,P),x=j,_=P;(t=x<2?e:_)||!T;){k||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(O=2,k){if(x||(R="next"),t=k[R]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=k.return)&&t.call(k),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);k=e}else if((t=(T=M.n<0)?_:S.call(C,M))!==o)break}catch(I){k=e,x=1,_=I}finally{O=1}}return{value:t,done:T}}}(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]"}),(hf=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 Nm(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 LL(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){Nm(s,r,i,o,a,"next",l)}function a(l){Nm(s,r,i,o,a,"throw",l)}o(void 0)})}}function Fm(e,t){return NL(e)||RL(e,t)||IL(e,t)||DL()}function DL(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1283
+ `}},En=e=>rx("light",e),An=e=>rx("dark",e);Pu(["click","mousedown","input"]);var CL=e=>{const[t,n]=_b({prefix:"TanstackQueryDevtools"}),r=jv(),i=K(()=>{const s=t.theme_preference||kb;return s!=="system"?s:r()});return L(th.Provider,{value:e,get children(){return L(Tb,{localStore:t,setLocalStore:n,get children(){return L(rh.Provider,{value:i,get children(){return L(cL,{localStore:t,setLocalStore:n})}})}})}})},_L=CL;const kL=Object.freeze(Object.defineProperty({__proto__:null,default:_L},Symbol.toStringTag,{value:"Module"}));var OL=e=>{const[t,n]=_b({prefix:"TanstackQueryDevtools"}),r=jv(),i=K(()=>{const s=t.theme_preference||kb;return s!=="system"?s:r()});return L(th.Provider,{value:e,get children(){return L(Tb,{disabled:!0,localStore:t,setLocalStore:n,get children(){return L(rh.Provider,{value:i,get children(){return L(fL,{get children(){return L(Ch,{localStore:t,setLocalStore:n,get onClose(){return e.onClose},showPanelViewOnly:!0})}})}})}})}})},EL=OL;const AL=Object.freeze(Object.defineProperty({__proto__:null,default:EL},Symbol.toStringTag,{value:"Module"}));function ix(e){var t=e.children,n=e.description,r=e.title;return y.jsxs(A.Paper.Header,{children:[r&&y.jsx(A.Title,{className:Oe({"yst-mb-3":n||t}),children:r}),n&&(typeof n=="string"?y.jsx("p",{children:n}):n),t]})}function Ho(){/*! 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 k,x,_,O=0,E=w||[],T=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(j,P){return k=j,x=0,_=e,M.n=P,o}};function B(R,j){for(x=R,_=j,t=0;!T&&O&&!P&&t<E.length;t++){var P,I=E[t],G=M.p,W=I[2];R>3?(P=W===j)&&(_=I[(x=I[4])?5:(x=3,3)],I[4]=I[5]=e):I[0]<=G&&((P=R<2&&G<I[1])?(x=0,M.v=j,M.n=I[1]):G<W&&(P=R<3||I[0]>j||j>W)&&(I[4]=R,I[5]=j,M.n=W,x=0))}if(P||R>1)return o;throw T=!0,j}return function(R,j,P){if(O>1)throw TypeError("Generator is already running");for(T&&j===1&&B(j,P),x=j,_=P;(t=x<2?e:_)||!T;){k||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(O=2,k){if(x||(R="next"),t=k[R]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=k.return)&&t.call(k),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);k=e}else if((t=(T=M.n<0)?_:S.call(C,M))!==o)break}catch(I){k=e,x=1,_=I}finally{O=1}}return{value:t,done:T}}}(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]"}),(Ho=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 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 Im(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 Jc(e,t){return ML(e)||jL(e,t)||PL(e,t)||TL()}function TL(){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 PL(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 jL(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 ML(e){if(Array.isArray(e))return e}var $L=function(t){var n=t.isOpen,r=t.onClose,i=t.groupToEdit,s=t.allBrands,o=Nn(),a=o.brandId,l=o.analysisId,u=q.useState(""),c=Jc(u,2),d=c[0],f=c[1],h=q.useState([]),g=Jc(h,2),m=g[0],p=g[1],v=q.useState(!1),b=Jc(v,2),S=b[0],C=b[1],w=Gt();q.useEffect(function(){if(n&&i&&i.type==="group"){var G;f(String(i.name||""));var W=((G=i.groupedBrands)===null||G===void 0?void 0:G.map(function(F){return String(F.id||"")}))||[];p(W)}},[n,i]);var k=l2({mutation:{onSuccess:function(){var G=Im(Ho().m(function F(){return Ho().w(function(U){for(;;)switch(U.n){case 0:return U.n=1,Promise.all([w.invalidateQueries({queryKey:ru(a)}),w.invalidateQueries({queryKey:pr(a,"latest")}),w.invalidateQueries({queryKey:Zn(a,"latest")}),w.invalidateQueries({queryKey:pr(a,l)}),w.invalidateQueries({queryKey:Zn(a,l)})]);case 1:B();case 2:return U.a(2)}},F)}));function W(){return G.apply(this,arguments)}return W}(),onError:function(W){console.error("Error creating brand group:",W)}}}),x=k.mutate,_=k.isPending,O=r4({mutation:{onSuccess:function(){var G=Im(Ho().m(function F(){return Ho().w(function(U){for(;;)switch(U.n){case 0:return U.n=1,Promise.all([w.invalidateQueries({queryKey:ru(a)}),w.invalidateQueries({queryKey:pr(a,"latest")}),w.invalidateQueries({queryKey:Zn(a,"latest")}),w.invalidateQueries({queryKey:pr(a,l)}),w.invalidateQueries({queryKey:Zn(a,l)})]);case 1:B(),P();case 2:return U.a(2)}},F)}));function W(){return G.apply(this,arguments)}return W}(),onError:function(W){console.error("Error deleting brand group:",W),window.alert("An error occurred while ungrouping the brands. Please try again later.")}}}),E=O.mutate,T=O.isPending,M=function(){!d.trim()||!(i!=null&&i.id)||x({brandId:a,data:{groupName:d.trim(),brandIds:m.map(function(W){return Number(W)})}})},B=function(){f(""),p([]),r()},R=function(){return m.map(function(W){if(i&&i.type==="group"){var F,U=(F=i.groupedBrands)===null||F===void 0?void 0:F.find(function(V){return String(V.id)===W});if(U)return U.name||""}var z=s.find(function(V){return String(V.id)===W});return z?z.type==="group"?"Group: ".concat(z.name):z.name||"":""}).filter(Boolean)},j=function(){C(!0)},P=function(){return C(!1)},I=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(A.Modal,{isOpen:n,onClose:S?function(){}:B,as:"div",children:y.jsx(A.Modal.Panel,{children:y.jsxs(A.Modal.Container,{children:[y.jsx(A.Modal.Container.Header,{className:"yst-mb-4",children:y.jsx(A.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Edit brand group"})}),y.jsxs(A.Modal.Container.Content,{className:"yst-mb-8 yst-space-y-4",children:[y.jsx("p",{className:"yst-text-sm yst-text-slate-600",children:"Update the group name or ungroup brands by removing their tags."}),y.jsxs("div",{children:[y.jsx("label",{htmlFor:"editGroupName",className:"yst-mb-2 yst-block yst-text-sm yst-font-medium",children:"Group name"}),y.jsx(A.TextInput,{id:"editGroupName",value:d,onChange:function(G){return f(G.target.value)},placeholder:"Enter group name",className:"yst-w-full"})]}),y.jsxs("div",{children:[y.jsx(A.TagField,{readOnly:!0,id:"editGroupedBrands",label:"Grouped brands",tags:R(),onRemoveTag:function(G){if(m.length<2)return C(!0);p(function(W){return W.filter(function(F,U){return U!==G})})},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(A.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(A.Button,{variant:"tertiary",onClick:j,disabled:_,className:"yst-text-red-600",children:"Ungroup brands"})}),y.jsxs("div",{className:"yst-flex yst-justify-end yst-gap-2",children:[y.jsx(A.Button,{variant:"secondary",onClick:B,children:"Cancel"}),y.jsx(A.Button,{variant:"primary",onClick:M,disabled:!d.trim()||_,isLoading:_,children:_?"Saving...":"Save changes"})]})]})})]})})}),y.jsx(Gu,{isOpen:S,onClose:P,onConfirm:I,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:T})]})};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 Jt(b,"_invoke",function(S,C,w){var k,x,_,O=0,E=w||[],T=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(j,P){return k=j,x=0,_=e,M.n=P,o}};function B(R,j){for(x=R,_=j,t=0;!T&&O&&!P&&t<E.length;t++){var P,I=E[t],G=M.p,W=I[2];R>3?(P=W===j)&&(_=I[(x=I[4])?5:(x=3,3)],I[4]=I[5]=e):I[0]<=G&&((P=R<2&&G<I[1])?(x=0,M.v=j,M.n=I[1]):G<W&&(P=R<3||I[0]>j||j>W)&&(I[4]=R,I[5]=j,M.n=W,x=0))}if(P||R>1)return o;throw T=!0,j}return function(R,j,P){if(O>1)throw TypeError("Generator is already running");for(T&&j===1&&B(j,P),x=j,_=P;(t=x<2?e:_)||!T;){k||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(O=2,k){if(x||(R="next"),t=k[R]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=k.return)&&t.call(k),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);k=e}else if((t=(T=M.n<0)?_:S.call(C,M))!==o)break}catch(I){k=e,x=1,_=I}finally{O=1}}return{value:t,done:T}}}(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]"}),(hf=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 Nm(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 LL(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){Nm(s,r,i,o,a,"next",l)}function a(l){Nm(s,r,i,o,a,"throw",l)}o(void 0)})}}function Fm(e,t){return NL(e)||RL(e,t)||IL(e,t)||DL()}function DL(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1285
1285
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function IL(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 RL(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 NL(e){if(Array.isArray(e))return e}var FL=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=q.useState(""),d=Fm(c,2),f=d[0],h=d[1],g=q.useState([]),m=Fm(g,2),p=m[0],v=m[1];q.useEffect(function(){if(n&&s.length>0){var _,O=(_=s[0])===null||_===void 0?void 0:_.name;h(String(O||"New Group")),v(s.map(function(E){var T;return String((T=E.id)!==null&&T!==void 0?T:"")}))}},[n,s]);var b=l2({mutation:{onSuccess:function(){var _=LL(hf().m(function E(){return hf().w(function(T){for(;;)switch(T.n){case 0:return T.n=1,Promise.all([a.invalidateQueries({queryKey:ru(i)}),a.invalidateQueries({queryKey:Lf(i)}),a.invalidateQueries({queryKey:pr(i,"latest")}),a.invalidateQueries({queryKey:Zn(i,"latest")}),a.invalidateQueries({queryKey:pr(i,u)}),a.invalidateQueries({queryKey:Zn(i,u)})]);case 1:o==null||o(),w();case 2:return T.a(2)}},E)}));function O(){return _.apply(this,arguments)}return O}(),onError:function(O){console.error("Error creating group:",O)}}}),S=b.mutate,C=b.isPending,w=function(){h(""),v([]),r()},k=function(){if(!(!f.trim()||p.length===0)){var O=p.flatMap(function(E){var T=s.find(function(M){return String(M.id)===E});return T&&T.type==="group"&&Array.isArray(T.groupedBrands)?T.groupedBrands.map(function(M){return String(M.id)}):E});S({brandId:i,data:{groupName:f.trim(),brandIds:O.filter(function(E){return E!==""}).map(function(E){return Number(E)})}})}},x=function(O){v(function(E){return E.filter(function(T){return T!==O})})};return y.jsx(A.Modal,{isOpen:n,onClose:w,children:y.jsx(A.Modal.Panel,{children:y.jsxs(A.Modal.Container,{children:[y.jsx(A.Modal.Container.Header,{children:y.jsx(A.Modal.Title,{children:"Edit brand group"})}),y.jsxs(A.Modal.Container.Content,{className:"yst-space-y-4",children:[y.jsxs("div",{children:[y.jsx("label",{htmlFor:"groupName",className:"yst-mb-2 yst-block yst-text-sm yst-font-medium",children:"Group name"}),y.jsx(A.TextInput,{id:"groupName",value:f,onChange:function(_){return h(_.target.value)},placeholder:"Enter group name",className:"yst-w-full"})]}),y.jsxs("div",{children:[y.jsx(A.TagField,{readOnly:!0,id:"groupedBrands",label:"Brands in group (".concat(p.length,")"),tags:p.map(function(_){var O=s.find(function(E){return String(E.id)===_});return O?O.type==="group"?"Group: ".concat(O.name):O.name||"":""}).filter(Boolean),onRemoveTag:function(_){var O=p.find(function(E){var T=s.find(function(B){return String(B.id)===E});if(!T)return!1;var M=T.type==="group"?"Group: ".concat(T.name):T.name||"";return M===_});O&&x(O)},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(A.Modal.Container.Footer,{className:"yst-pt-4",children:y.jsxs("div",{className:"yst-flex yst-justify-end yst-gap-2",children:[y.jsx(A.Button,{variant:"secondary",onClick:w,disabled:C,children:"Cancel"}),y.jsx(A.Button,{variant:"primary",onClick:k,disabled:!f.trim()||p.length===0||C,children:C?"Saving...":"Save group"})]})})]})})})};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 qm(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?qm(Object(n),!0).forEach(function(r){sx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qm(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sx(e,t,n){return(t=BL(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BL(e){var t=qL(e,"string");return _a(t)=="symbol"?t:t+""}function qL(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 zL(e){return GL(e)||UL(e)||ox(e)||HL()}function HL(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1286
1286
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UL(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function GL(e){if(Array.isArray(e))return gf(e)}function Un(e,t){return WL(e)||VL(e,t)||ox(e,t)||KL()}function KL(){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 ox(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 VL(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 WL(e){if(Array.isArray(e))return e}var QL=function(){var t,n=fn(),r=q.useState(!1),i=Un(r,2),s=i[0],o=i[1],a=q.useState({}),l=Un(a,2),u=l[0],c=l[1],d=q.useState(""),f=Un(d,2),h=f[0],g=f[1],m=q.useState(1),p=Un(m,2),v=p[0],b=p[1],S=q.useState({}),C=Un(S,2),w=C[0],k=C[1],x=q.useState(!1),_=Un(x,2),O=_[0],E=_[1],T=q.useState(!1),M=Un(T,2),B=M[0],R=M[1],j=q.useState(null),P=Un(j,2),I=P[0],G=P[1],V=Nn(),F=V.brandId;function U(X){return String(X.id)}var z=Z5(F,{query:{enabled:!!F}}),Q=z.data,N=z.isLoading,te=10,J=(Q==null||(t=Q.data)===null||t===void 0?void 0:t.associatedBrands.filter(function(X){var se,ie;return h?((se=(ie=X.name)===null||ie===void 0?void 0:ie.toLowerCase())!==null&&se!==void 0?se:"").includes(h.toLowerCase()):!0}))||[],ge=Math.ceil(J.length/te),re=(v-1)*te,Se=zL(J).sort(function(X,se){return X.type==="group"&&se.type!=="group"?-1:X.type!=="group"&&se.type==="group"?1:0}),ye=Se.slice(re,re+te),ze=function(se){var ie=J.find(function(Ce){return U(Ce)===se});ie&&ie.type==="group"&&(G(ie),R(!0))},le=Object.entries(w).filter(function(X){var se=Un(X,2),ie=se[1];return ie}).map(function(X){var se=Un(X,1),ie=se[0];return ie}),He=function(){E(!0)},lt=function(se){g(se.target.value),b(1)},dt=function(se){k(function(ie){return zm(zm({},ie),{},sx({},se,!ie[se]))})},Ne=function(){n("/")},Fe=function(){k({}),c({}),o(!1)},Z=function(){E(!1)},Te=function(){k({}),b(1),g("")},tt=function(){R(!1),G(null)},$e=function(se,ie){return se in u?!!u[se]:!ie.isHidden},ue=[{Header:"Brand name",accessor:"name",Cell:function(se){var ie=se.value,Ce=se.row;return y.jsx("span",{className:"yst-font-medium yst-text-slate-900",children:y.jsxs("div",{className:"yst-flex yst-items-center yst-gap-2",children:[y.jsx(A.Checkbox,{id:"brand-checkbox-".concat(Ce.id),checked:!!w[U(Ce)],onChange:function(){return dt(U(Ce))},value:U(Ce),label:Ce.isSelf?y.jsx(Uu,{children:ie}):ie,name:"brand-checkbox-".concat(Ce.id),disabled:!$e(U(Ce),Ce)}),Ce.type==="group"&&y.jsx(Q6,{className:"yst-h-4 yst-w-4 yst-text-slate-400"})]})})},LoadingComponent:function(se){var ie=se.id,Ce=ie===void 0?"":ie;return y.jsxs("div",{className:"yst-flex",children:[y.jsx(A.Checkbox,{id:"loading-row-checkbox-".concat(Ce),value:"loading",label:"",disabled:!0,name:"brand-checkbox-".concat(Ce)})," ",y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-32",id:"loading-row-skeleton-".concat(Ce)})]})}},{Header:"Actions",accessor:"id",Cell:function(se){var ie=se.value,Ce=se.row;return y.jsx(y.Fragment,{children:Ce.type==="group"?y.jsxs(A.Button,{variant:"tertiary",size:"small",onClick:function(){return ze(String(ie!=null?ie:""))},className:"yst-gap-1.5 yst-px-0",disabled:!$e(U(Ce),Ce),children:[y.jsx(h2,{className:"yst-h-4 yst-w-4"}),"Edit group"]}):void 0})},LoadingComponent:function(){return y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-24"})}}];return y.jsxs(A.Paper,{className:"yst-mx-auto yst-max-w-2xl",children:[y.jsx(ix,{title:"Brand list ".concat(""),children:y.jsx("p",{children:"These are the brands found in responses to your example prompts. Group related brands to improve your analysis. You can rename or exclude irrelevant brands, and new brands will be added automatically if they appear in future analysis runs."})}),y.jsxs(A.Paper.Content,{children:[y.jsx("div",{className:"yst-mb-6",children:y.jsx(A.TextInput,{id:"brand-search",label:"Search brands",placeholder:"Search brands",value:h,onChange:lt})}),y.jsx("div",{className:"yst-mb-6",children:y.jsxs(A.Table,{columns:ue,className:"yst-w-full",variant:"minimal",children:[y.jsx(A.Table.Head,{children:y.jsx(A.Table.Row,{children:ue.map(function(X){return y.jsx(A.Table.Header,{children:X.Header},X.accessor)})})}),y.jsx(A.Table.Body,{children:N?[1,2,3].map(function(X,se){return y.jsx(A.Table.Row,{children:ue.map(function(ie,Ce){return y.jsx(A.Table.Cell,{children:y.jsx(ie.LoadingComponent,{id:"skeleton-".concat(se,"-").concat(Ce)},ie.accessor)},"cell-".concat(Ce))})},se)}):ye.length===0?y.jsx(A.Table.Row,{children:y.jsx(A.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(A.Button,{variant:"secondary",size:"small",onClick:function(){g(""),b(1)},className:"yst-mt-4",children:"Clear search"})]})})}):ye.map(function(X){return y.jsx(A.Table.Row,{children:ue.map(function(se){return y.jsx(A.Table.Cell,{children:se.Cell?se.Cell({value:X[se.accessor],row:X}):X[se.accessor]},se.accessor)})},X.id)})})]})}),y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-between",children:[y.jsxs(A.Button,{variant:"secondary",onClick:He,className:"yst-mb-0 yst-gap-2",disabled:le.length<2,children:[y.jsx(o6,{})," Group brands"]}),y.jsx(A.Pagination,{variant:"text",current:v,total:ge,onNavigate:b,className:"yst-flex-row",screenReaderTextPrevious:"Previous page",screenReaderTextNext:"Next page"})]})]}),y.jsx(If,{children:y.jsx("div",{className:"yst-flex yst-items-center yst-justify-end yst-gap-4",children:s?y.jsxs(y.Fragment,{children:[y.jsx(A.Button,{variant:"secondary",className:"yst-mb-0",onClick:Fe,children:"Discard changes"}),y.jsx(A.Button,{variant:"primary",className:"yst-mb-0",onClick:Ne,children:"Save changes"})]}):y.jsx(A.Button,{as:oi,to:"/brands/".concat(F),variant:"tertiary",className:"yst-mb-0",children:"Return to analysis"})})}),y.jsx(FL,{isOpen:O,onClose:Z,brandId:F,brandsToGroup:J.filter(function(X){return le.includes(U(X))}),onGroupCreated:Te}),y.jsx($L,{isOpen:B,onClose:tt,groupToEdit:I,allBrands:J})]})};const YL=Object.freeze(Object.defineProperty({__proto__:null,default:QL},Symbol.toStringTag,{value:"Module"}));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.
1288
- 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 Hm(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)?Hm(e,t):void 0}}function Hm(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.onClose,i=Gt(),s=q.useState(""),o=XL(s,2),a=o[0],l=o[1],u=E4({mutation:{onSuccess:function(){i.clear(),r()}}}),c=u.mutate,d=u.isPending;return q.useEffect(function(){n&&l("")},[n]),y.jsx(Gu,{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(A.TextField,{id:"delete-all-confirmation",label:"To confirm, please type DELETE ALL:",value:a,onChange:function(f){return l(f.target.value)}}),y.jsx("p",{children:y.jsx("em",{children:"This is to make sure you understand this action is permanent."})})]}),confirmText:"Yes, delete all data",cancelText:"No, go back"})};function 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 en(b,"_invoke",function(S,C,w){var k,x,_,O=0,E=w||[],T=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(j,P){return k=j,x=0,_=e,M.n=P,o}};function B(R,j){for(x=R,_=j,t=0;!T&&O&&!P&&t<E.length;t++){var P,I=E[t],G=M.p,V=I[2];R>3?(P=V===j)&&(_=I[(x=I[4])?5:(x=3,3)],I[4]=I[5]=e):I[0]<=G&&((P=R<2&&G<I[1])?(x=0,M.v=j,M.n=I[1]):G<V&&(P=R<3||I[0]>j||j>V)&&(I[4]=R,I[5]=j,M.n=V,x=0))}if(P||R>1)return o;throw T=!0,j}return function(R,j,P){if(O>1)throw TypeError("Generator is already running");for(T&&j===1&&B(j,P),x=j,_=P;(t=x<2?e:_)||!T;){k||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(O=2,k){if(x||(R="next"),t=k[R]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=k.return)&&t.call(k),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);k=e}else if((t=(T=M.n<0)?_:S.call(C,M))!==o)break}catch(I){k=e,x=1,_=I}finally{O=1}}return{value:t,done:T}}}(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]"}),(yf=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 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 rD(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 iD(e,t){return lD(e)||aD(e,t)||oD(e,t)||sD()}function sD(){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 oD(e,t){if(e){if(typeof e=="string")return Gm(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)?Gm(e,t):void 0}}function Gm(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 aD(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 lD(e){if(Array.isArray(e))return e}var uD=function(t){var n=t.isOpen,r=t.brandId,i=t.onClose,s=t.brandName,o=Gt(),a=q.useState(""),l=iD(a,2),u=l[0],c=l[1],d=h4({mutation:{onSuccess:function(){var g=rD(yf().m(function p(){return yf().w(function(v){for(;;)switch(v.n){case 0:return v.n=1,Promise.all([o.invalidateQueries({queryKey:Xn()}),o.invalidateQueries({queryKey:qu()})]);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 q.useEffect(function(){n&&c("")},[n]),y.jsx(Gu,{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(A.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 ka(e){"@babel/helpers - typeof";return ka=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},ka(e)}function Uo(){/*! 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 k,x,_,O=0,E=w||[],T=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(j,P){return k=j,x=0,_=e,M.n=P,o}};function B(R,j){for(x=R,_=j,t=0;!T&&O&&!P&&t<E.length;t++){var P,I=E[t],G=M.p,V=I[2];R>3?(P=V===j)&&(_=I[(x=I[4])?5:(x=3,3)],I[4]=I[5]=e):I[0]<=G&&((P=R<2&&G<I[1])?(x=0,M.v=j,M.n=I[1]):G<V&&(P=R<3||I[0]>j||j>V)&&(I[4]=R,I[5]=j,M.n=V,x=0))}if(P||R>1)return o;throw T=!0,j}return function(R,j,P){if(O>1)throw TypeError("Generator is already running");for(T&&j===1&&B(j,P),x=j,_=P;(t=x<2?e:_)||!T;){k||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(O=2,k){if(x||(R="next"),t=k[R]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=k.return)&&t.call(k),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);k=e}else if((t=(T=M.n<0)?_:S.call(C,M))!==o)break}catch(I){k=e,x=1,_=I}finally{O=1}}return{value:t,done:T}}}(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]"}),(Uo=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 Km(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $r(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Km(Object(n),!0).forEach(function(r){cD(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Km(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cD(e,t,n){return(t=dD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dD(e){var t=fD(e,"string");return ka(t)=="symbol"?t:t+""}function fD(e,t){if(ka(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ka(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vm(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 Wm(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){Vm(s,r,i,o,a,"next",l)}function a(l){Vm(s,r,i,o,a,"throw",l)}o(void 0)})}}function hD(e,t){return pD(e)||mD(e,t)||yD(e,t)||gD()}function gD(){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 yD(e,t){if(e){if(typeof e=="string")return Qm(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)?Qm(e,t):void 0}}function Qm(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 mD(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 pD(e){if(Array.isArray(e))return e}var vD=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=Ga(),g=h.setBrandId,m=q.useState(!1),p=hD(m,2),v=p[0],b=p[1],S=Gt(),C=zu({query:{select:function(j){var P=j.data;return P},staleTime:5*1e3,refetchOnWindowFocus:!0,refetchInterval:30*1e3}}),w=C.data,k=u2({mutation:{onMutate:function(){var R=Wm(Uo().m(function P(I){var G,V,F;return Uo().w(function(U){for(;;)switch(U.n){case 0:return G=I.brandId,V=I.data,U.n=1,S.cancelQueries({queryKey:Xn()});case 1:return F=S.getQueryData(Xn()),S.setQueryData(Xn(),function(z){var Q,N;return z&&$r($r({},z),{},{data:$r($r({},z.data),{},{brands:((Q=(N=z.data)===null||N===void 0?void 0:N.brands)!==null&&Q!==void 0?Q:[]).map(function(te){return te.id===G?$r($r({},te),{},{settings:$r($r({},te.settings),{},{enableAutomaticAnalysis:V.enableAutomaticAnalysis})}):te})})})}),U.a(2,{previous:F})}},P)}));function j(P){return R.apply(this,arguments)}return j}(),onSuccess:function(){if(i&&i.settings&&i.settings.enableAutomaticAnalysis===!1)return b(!1);b(!M)},onError:function(j,P,I){I!=null&&I.previous&&S.setQueryData(Xn(),I.previous)},onSettled:function(){var R=Wm(Uo().m(function P(){return Uo().w(function(I){for(;;)switch(I.n){case 0:return I.n=1,Promise.all([S.invalidateQueries({queryKey:Xn()}),S.invalidateQueries({queryKey:qu()}),S.invalidateQueries({queryKey:Bu(a)}),S.invalidateQueries({queryKey:pr(a,"latest")}),S.invalidateQueries({queryKey:Zn(a,"latest")}),S.invalidateQueries({queryKey:pr(a,c)}),S.invalidateQueries({queryKey:Zn(a,c)})]);case 1:return I.a(2)}},P)}));function j(){return R.apply(this,arguments)}return j}()}}),x=k.mutate,_=k.isPending,O=function(j){x({brandId:a,data:{enableAutomaticAnalysis:j}})},E=function(j){if(j){if(!T)return b(!0);if(!M)return O(!0);b(!0)}else O(!1)},T=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=P2(i==null?void 0:i.firstNextAnalysisOpportunity),B=(i==null?void 0:i.setupStatus)==="pendingQuerySelection";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(A.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(A.SkeletonLoader,{className:"yst-h-6 yst-w-32"}):i==null?void 0:i.name,B&&y.jsx("div",{children:y.jsx(A.Link,{variant:"primary",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-font-normal yst-italic yst-text-slate-500",children:["Next analysis:"," ",Fd(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(A.SkeletonLoader,{className:"yst-h-6 yst-w-24"}):y.jsxs(A.Button,{size:"small",variant:"tertiary",className:"yst-gap-1 yst-text-red-600 *:hover:yst-text-red-700",onClick:function(){i!=null&&i.id&&o(i.id)},disabled:(i==null?void 0:i.id)==="loading",children:[y.jsx(Df,{})," Delete brand"]})})]}),y.jsx(A.Modal,{isOpen:v,onClose:function(){return b(!1)},position:"center",as:"div",className:Oe({"yst-mx-auto yst-max-w-xl":T}),children:T?y.jsx(A.Modal.Panel,{children:M?y.jsxs(y.Fragment,{children:[y.jsx(A.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(A.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Start brand analysis now?"})}),y.jsxs(A.Modal.Container.Content,{className:"yst-mb-4 yst-space-y-3",children:[y.jsx("p",{children:"Activating this brand will immediately start a new analysis."}),y.jsx("p",{children:"This will use one of your weekly analyses included in your subscription."})]}),y.jsxs(A.Modal.Container.Footer,{className:"yst-mt-3 yst-flex yst-justify-end yst-gap-2",children:[y.jsx(A.Button,{variant:"secondary",onClick:function(){return b(!1)},children:"Cancel"}),y.jsx(A.Button,{variant:"primary",onClick:function(){O(!0)},isLoading:_,children:"Yes, start analysis"})]})]}):y.jsxs(y.Fragment,{children:[y.jsx(A.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(A.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Automatic analysis enabled"})}),y.jsxs(A.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:Fd(i==null?void 0:i.nextScheduledAnalysis)||"the next analysis cycle"}),"."]})]}),y.jsx(A.Modal.Container.Footer,{className:"yst-mt-3 yst-flex yst-justify-end yst-gap-2",children:y.jsx(A.Button,{variant:"primary",onClick:function(){return b(!1)},children:"Got it"})})]})}):y.jsxs(A.Modal.Panel,{children:[y.jsx("div",{className:"yst-flex yst-items-start yst-justify-stretch yst-gap-4",children:y.jsxs("div",{className:"yst-flex-1",children:[y.jsx(A.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(A.Modal.Title,{as:"h3",className:"yst-text-center yst-text-lg yst-font-medium",children:"You've reached your active brand limit"})}),y.jsx(A.Modal.Container.Content,{children:y.jsx("p",{className:"yst-text-center",children:"Each subscription lets you activate 1 brand. Add another subscription or deactivate an existing brand to activate this brand."})})]})}),y.jsx(A.Modal.Container.Footer,{children:y.jsxs("div",{className:"yst-flex yst-flex-col yst-justify-stretch yst-gap-2",children:[d&&y.jsxs(A.Button,{variant:"upsell",className:"yst-flex yst-gap-1",onClick:d,children:[y.jsx(g2,{}),"Add a subscription"]}),y.jsx(A.Button,{variant:"tertiary",className:"",onClick:function(){return b(!1)},children:"Manage active brands"})]})})]})})]})},Ym,Xm,Zm;function ed(e,t){return SD(e)||wD(e,t)||xD(e,t)||bD()}function bD(){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 xD(e,t){if(e){if(typeof e=="string")return Jm(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)?Jm(e,t):void 0}}function Jm(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 SD(e){if(Array.isArray(e))return e}function _h(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var ep=Wa(Ym||(Ym=_h(["xl:yst-w-1/3"]))),tp=Wa(Xm||(Xm=_h(["xl:yst-w-2/3"]))),np=Wa(Zm||(Zm=_h(["yst-flex yst-flex-col yst-gap-8 xl:yst-flex-row"]))),CD=function(){var t,n,r,i,s=q.useState(!1),o=ed(s,2),a=o[0],l=o[1],u=q.useState(!1),c=ed(u,2),d=c[0],f=c[1],h=q.useState(null),g=ed(h,2),m=g[0],p=g[1],v=zu({query:{select:function(x){var _=x.data;return _}}}),b=v.data,S=Yi({query:{select:function(x){var _=x.data;return _==null?void 0:_.brands},staleTime:5*1e3,refetchOnWindowFocus:!0,refetchInterval:30*1e3}}),C=S.data,w=C==null?void 0:C.find(function(k){return k.id===m});return y.jsxs("form",{children:[y.jsxs(A.Card,{children:[y.jsx(Cb,{title:"Settings",description:"Manage your brand settings and data. You can update analysis preferences or delete brands from your account."}),y.jsxs(A.Card.Content,{children:[y.jsxs(np,{children:[y.jsxs(ep,{className:"yst-space-y-2",children:[y.jsx(A.Title,{size:"4",children:"Brands"}),y.jsxs("p",{children:["You have"," ",y.jsxs("b",{children:[(t=b==null?void 0:b.activeSubscriptions)!==null&&t!==void 0?t:"—"," 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(tp,{children:[C&&y.jsxs("p",{className:"yst-flex yst-w-full yst-max-w-2xl yst-flex-1 yst-flex-row yst-items-center yst-justify-start yst-gap-2 yst-border-b-[1px] yst-border-b-slate-200 yst-py-4 yst-font-medium yst-text-slate-800",children:["Active brands: ",(r=b==null?void 0:b.numberOfActiveBrands)!==null&&r!==void 0?r:"—"," of"," ",(i=b==null?void 0:b.maxNumberOfActiveBrands)!==null&&i!==void 0?i:"—"]}),C&&C.length===0&&y.jsxs("p",{className:"yst-mt-4 yst-text-slate-500",children:["No brands found. Please"," ",y.jsx(A.Link,{as:oi,to:"/setup",children:"add a brand"})," ","to start analyzing."]}),(C!=null?C:[{id:"loading",name:"Loading..."}]).map(function(k,x,_){return y.jsx(vD,{brand:k,isLast:x===_.length-1,onDelete:function(O){p(O),l(!0)}},k.id)})]})]}),y.jsx(Qa,{}),y.jsxs(np,{children:[y.jsxs(ep,{className:"yst-space-y-2",children:[y.jsx(A.Title,{size:"4",children:"Delete all data"}),y.jsx("p",{children:"Permanently delete all brands, analysis results, and query history from your account."})]}),y.jsxs(tp,{className:"yst-space-y-4",children:[y.jsxs(A.Button,{variant:"error",onClick:function(){f(!0)},disabled:(C==null?void 0:C.length)===0,children:[y.jsx(Df,{})," 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(uD,{isOpen:a,onClose:function(){l(!1),p(null)},brandId:m||"",brandName:w==null?void 0:w.name}),y.jsx(nD,{isOpen:d,onClose:function(){f(!1)}})]})};const _D=Object.freeze(Object.defineProperty({__proto__:null,default:CD},Symbol.toStringTag,{value:"Module"}));function Cu(e){"@babel/helpers - typeof";return Cu=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},Cu(e)}var mf=[{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."}],kD=function(t){return mf.find(function(n){return!!Us(n.path,t)})||mf[0]};function OD(){var e=It(),t=kD(e.pathname);return y.jsxs(A.Paper,{className:"yst-mx-auto yst-max-w-2xl",children:[y.jsx(ix,{title:y.jsx(ax,{currentStep:t,steps:mf}),description:t.description}),y.jsx(A.Paper.Content,{children:y.jsx(Gs,{})})]})}var ax=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:Cu(r)==="object"?r.id:r}),"/",Array.isArray(i)?i.length:i]}),y.jsx("span",{children:Cu(r)==="object"?r.title:n||"Step ".concat(r)})]})};const ED=Object.freeze(Object.defineProperty({__proto__:null,SetupPaperTitle:ax,default:OD},Symbol.toStringTag,{value:"Module"}));var lx=function(t){var n=t.onBack,r=t.variant,i=r===void 0?"ai":r,s=t.buttonText,o=t.onButtonClick,a=t.isButtonDisabled,l=a===void 0?!1:a,u=t.isLoading,c=u===void 0?!1:u;return y.jsx(If,{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(A.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(A.Button,{onClick:o,variant:i==="ai"?"primary":i,className:"yst-gap-1.5",style:i==="ai"?{background:"linear-gradient(102deg, #A61E69 0%, #6366F1 100%)",color:"#fff"}:{},disabled:l,type:"submit",isLoading:c,children:[i==="ai"&&y.jsx(l6,{}),s]})})]})})},AD=[{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"}],TD=[{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"}],td=[].concat(AD,TD,[{value:"OTHER",label:"Other"}]),PD=[{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"}],jD=[{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"}],MD=[].concat(PD,jD);function ei(e){"@babel/helpers - typeof";return ei=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},ei(e)}function rp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ip(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rp(Object(n),!0).forEach(function(r){ux(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rp(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ux(e,t,n){return(t=$D(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $D(e){var t=LD(e,"string");return ei(t)=="symbol"?t:t+""}function LD(e,t){if(ei(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ei(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pf(){/*! 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 k,x,_,O=0,E=w||[],T=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(j,P){return k=j,x=0,_=e,M.n=P,o}};function B(R,j){for(x=R,_=j,t=0;!T&&O&&!P&&t<E.length;t++){var P,I=E[t],G=M.p,V=I[2];R>3?(P=V===j)&&(_=I[(x=I[4])?5:(x=3,3)],I[4]=I[5]=e):I[0]<=G&&((P=R<2&&G<I[1])?(x=0,M.v=j,M.n=I[1]):G<V&&(P=R<3||I[0]>j||j>V)&&(I[4]=R,I[5]=j,M.n=V,x=0))}if(P||R>1)return o;throw T=!0,j}return function(R,j,P){if(O>1)throw TypeError("Generator is already running");for(T&&j===1&&B(j,P),x=j,_=P;(t=x<2?e:_)||!T;){k||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(O=2,k){if(x||(R="next"),t=k[R]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=k.return)&&t.call(k),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);k=e}else if((t=(T=M.n<0)?_:S.call(C,M))!==o)break}catch(I){k=e,x=1,_=I}finally{O=1}}return{value:t,done:T}}}(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]"}),(pf=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 sp(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 DD(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){sp(s,r,i,o,a,"next",l)}function a(l){sp(s,r,i,o,a,"throw",l)}o(void 0)})}}function is(e,t){return FD(e)||ND(e,t)||RD(e,t)||ID()}function ID(){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 RD(e,t){if(e){if(typeof e=="string")return op(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?op(e,t):void 0}}function op(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ND(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 FD(e){if(Array.isArray(e))return e}var BD=function(){var t=fn(),n=Ga(),r=Gt(),i=q.useState(),s=is(i,2),o=s[0],a=s[1],l=q.useState(!1),u=is(l,2),c=u[0],d=u[1],f=q.useState({name:"",url:"",description:"",language:"en",isLocal:!1,country:void 0,region:""}),h=is(f,2),g=h[0],m=h[1],p=q.useState(null),v=is(p,2),b=v[0],S=v[1],C=q.useState(""),w=is(C,2),k=w[0],x=w[1],_=q.useMemo(function(){var z;if(!g.country)return"";var Q=td.find(function(N){return N.value===g.country});return(z=Q==null?void 0:Q.label)!==null&&z!==void 0?z:""},[g.country]),O=q.useMemo(function(){var z=k.trim().toLowerCase();return z?td.filter(function(Q){var N=Q.label.toLowerCase().includes(z),te=Q.value.toLowerCase().includes(z);return N||te}):td},[k]),E=l4({mutation:{onSuccess:function(){var z=DD(pf().m(function N(te){var J;return pf().w(function(ge){for(;;)switch(ge.n){case 0:return J=te.data.id,ge.n=1,Promise.all([r.invalidateQueries({queryKey:qu()}),r.invalidateQueries({queryKey:Xn()})]);case 1:J&&n.setBrandId(J),te!=null&&te.status&&te.status>=200&&te.status<300&&J&&(n.setBrandId(J),a(J));case 2:return ge.a(2)}},N)}));function Q(N){return z.apply(this,arguments)}return Q}(),onError:function(){d(!1)}}}),T=E.mutate,M=E.isPending,B=E.error,R=Yi({query:{enabled:!!o,select:function(Q){var N=Q.data;return N==null?void 0:N.brands},refetchInterval:function(Q){var N;return((Q==null||(N=Q.state)===null||N===void 0||(N=N.data)===null||N===void 0||(N=N.data)===null||N===void 0?void 0:N.brands)||[]).find(function(te){return te.id===o})?!1:2*1e3}}}),j=R.data;q.useEffect(function(){o&&j!==null&&j!==void 0&&j.find(function(z){return z.id===o})&&t("/setup/".concat(o,"/queries"),{replace:!0})},[o,j,t]);var P=function(Q,N){m(function(te){return ip(ip({},te),{},ux({},Q,N))})},I=function(Q){x(Q.target.value)},G=function(Q){P("country",Q!=null?Q:void 0),x("")},V=function(Q){if(Q.preventDefault(),S(null),g.description.length>250){S("Your brand description is too long. Please keep it within the 250-character limit."),d(!1);return}d(!0);var N=g.url;N&&!/^https?:\/\//i.test(N)&&(N="https://".concat(N)),T({data:{name:g.name,url:N,description:g.description,focusLanguage:g.language,country:g.country,regionOrCity:g.region}})};function F(z){return ei(z)==="object"&&z!==null&&"response"in z&&ei(z.response)==="object"&&z.response!==void 0&&"data"in z.response}var U=F(B)?B.response.data.errors:void 0;return y.jsxs("form",{onSubmit:V,children:[y.jsxs("div",{className:"yst-space-y-6",children:[y.jsx(A.Title,{size:"2",children:"Brand info"}),!!B&&y.jsx(A.Alert,{variant:"error",title:"Error",isVisible:!!B,children:y.jsx("ul",{children:U&&ei(U)==="object"?Object.entries(U).flatMap(function(z){var Q=is(z,2),N=Q[0],te=Q[1];return Array.isArray(te)?te.map(function(J,ge){return y.jsx("li",{children:J},"".concat(N,"-").concat(ge))}):null}):"There was an error creating the brand."})}),b&&y.jsx(A.Alert,{variant:"error",title:"Error",isVisible:!!b,children:y.jsx("ul",{children:y.jsx("li",{children:"Your brand description is too long. Please keep it within the 250-character limit."})})}),y.jsx(A.TextField,{id:"name",label:"Brand name",value:g.name,onChange:function(z){return P("name",z.target.value)}}),y.jsx(A.TextField,{id:"url",label:"Website URL (optional)",placeholder:"Example: https://yourwebsite.com",value:g.url,onChange:function(z){return P("url",z.target.value)}}),y.jsxs("div",{id:"brand-description-textarea",children:[y.jsx(A.TextareaField,{id:"brand-description",label:"Brand description",value:g.description,onChange:function(z){var Q=z.target.value;P("description",Q)},...g.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-mt-1 yst-flex",children:[y.jsxs("div",{className:"yst-flex-grow yst-flex-col",children:[g.description.length>250&&y.jsx("div",{className:"yst-mb-2 yst-text-red-500",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-ml-6 yst-mt-[-4px] yst-text-xs",{"yst-text-slate-500":g.description.length<=250,"yst-text-red-500":g.description.length>250}),children:[g.description.length,"/250"]})]})]}),y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(A.Select,{className:"yst-max-w-sm",id:"language-select",label:"Target language",value:g.language,onChange:function(z){return P("language",z)},options:MD.map(function(z){return{label:z.label,value:z.value}})}),y.jsx("p",{children:"The main language your brand uses to communicate or create content."})]})]}),y.jsx(Qa,{}),y.jsxs("div",{className:"yst-space-y-6",children:[y.jsx(A.Title,{size:"2",children:"Location info"}),y.jsx("p",{children:"Specify a location to enhance the accuracy of the analysis."}),y.jsx(A.Autocomplete,{className:"yst-max-w-sm",id:"country-select",label:"Target country (optional)",value:g.country||null,nullable:!0,placeholder:"Search countries...",onQueryChange:I,onChange:G,selectedLabel:_,children:O.map(function(z){return y.jsx(A.Autocomplete.Option,{value:z.value,children:z.label},z.value)})}),g.country&&y.jsx(A.TextField,{id:"region",label:"Target city, state, or region (optional)",value:g.region,onChange:function(z){return P("region",z.target.value)},description:`Enter a city, state, or region to narrow down the analysis. For
1293
- example: California, Bavaria, or Paris.`})]}),y.jsx(lx,{onBack:function(){return t(-1)},buttonText:"Generate queries",isButtonDisabled:M||!!o||c,isLoading:M||!!o})]})};const qD=Object.freeze(Object.defineProperty({__proto__:null,default:BD},Symbol.toStringTag,{value:"Module"})),ap=e=>D.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},D.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"}),D.createElement("defs",null,D.createElement("linearGradient",{id:"paint0_linear_3891_2757",x1:1.99951,y1:2,x2:15.3308,y2:3.72773,gradientUnits:"userSpaceOnUse"},D.createElement("stop",{stopColor:"#A61E69"}),D.createElement("stop",{offset:1,stopColor:"#6366F1"}))));function Oa(e){"@babel/helpers - typeof";return Oa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oa(e)}function zD(e){return GD(e)||UD(e)||cx(e)||HD()}function HD(){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 UD(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function GD(e){if(Array.isArray(e))return bf(e)}function lp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Lr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lp(Object(n),!0).forEach(function(r){KD(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lp(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function KD(e,t,n){return(t=VD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VD(e){var t=WD(e,"string");return Oa(t)=="symbol"?t:t+""}function WD(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 vf(){/*! 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 k,x,_,O=0,E=w||[],T=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(j,P){return k=j,x=0,_=e,M.n=P,o}};function B(R,j){for(x=R,_=j,t=0;!T&&O&&!P&&t<E.length;t++){var P,I=E[t],G=M.p,V=I[2];R>3?(P=V===j)&&(_=I[(x=I[4])?5:(x=3,3)],I[4]=I[5]=e):I[0]<=G&&((P=R<2&&G<I[1])?(x=0,M.v=j,M.n=I[1]):G<V&&(P=R<3||I[0]>j||j>V)&&(I[4]=R,I[5]=j,M.n=V,x=0))}if(P||R>1)return o;throw T=!0,j}return function(R,j,P){if(O>1)throw TypeError("Generator is already running");for(T&&j===1&&B(j,P),x=j,_=P;(t=x<2?e:_)||!T;){k||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(O=2,k){if(x||(R="next"),t=k[R]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=k.return)&&t.call(k),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);k=e}else if((t=(T=M.n<0)?_:S.call(C,M))!==o)break}catch(I){k=e,x=1,_=I}finally{O=1}}return{value:t,done:T}}}(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]"}),(vf=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 up(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 QD(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){up(s,r,i,o,a,"next",l)}function a(l){up(s,r,i,o,a,"throw",l)}o(void 0)})}}function gi(e,t){return ZD(e)||XD(e,t)||cx(e,t)||YD()}function YD(){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 cx(e,t){if(e){if(typeof e=="string")return bf(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)?bf(e,t):void 0}}function bf(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 XD(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 ZD(e){if(Array.isArray(e))return e}var us=5,Go="Generating...",JD="Re-generating...",eI=100,tI=["******************************","***********************","*******************************************************","***********************************************","***************************************************************","*******************************************************","*******************************************************","***********************************************"],nI=Array.from({length:us},function(e,t){return{id:"query-".concat(t),text:Go,isRegenerating:!0}}),rI=function(){var t,n=ku(),r=n.brandId,i="/setup/".concat(r,"/analysis"),s=fn(),o=Gt(),a=q.useState(nI),l=gi(a,2),u=l[0],c=l[1],d=q.useState(!1),f=gi(d,2),h=f[0],g=f[1],m=q.useState([]),p=gi(m,2),v=p[0],b=p[1],S=q.useState([]),C=gi(S,2),w=C[0],k=C[1],x=q.useState(!1),_=gi(x,2),O=_[0],E=_[1],T=q.useState(null),M=gi(T,2),B=M[0],R=M[1],j=q.useState(!1),P=gi(j,2),I=P[0],G=P[1],V=S4(r||"",{query:{enabled:!!r}}),F=V.data,U=V.isRefetching,z=V.isError,Q=V.refetch,N=iu(r||"",{query:{enabled:!!r}}),te=N.data,J=q.useCallback(function(ue){var X;if(!(te!=null&&(X=te.data)!==null&&X!==void 0&&X.name))return!1;var se=te.data.name.toLowerCase().trim();return se?ue.toLowerCase().includes(se):!1},[te==null||(t=te.data)===null||t===void 0?void 0:t.name]),ge=q.useCallback(function(){return u.some(function(ue){return J(ue.text)})},[u,J]),re=function(){G(!1)},Se=function(){G(!1),r&&le({brandId:r,data:{queries:u.map(function(X){return X.text})}})},ye=function(){G(!1);var X=u.findIndex(function(se){return J(se.text)});X!==-1&&setTimeout(function(){var se=document.getElementById("query-text-".concat(X));se&&(se.focus(),se.select())},eI)},ze=v4({mutation:{onSuccess:function(){var ue=QD(vf().m(function se(ie){return vf().w(function(Ce){for(;;)switch(Ce.n){case 0:if(R(null),!(ie!=null&&ie.status&&ie.status>=200&&ie.status<300)){Ce.n=2;break}return Ce.n=1,Promise.all([o.invalidateQueries({queryKey:Bu(r||"")}),o.invalidateQueries({queryKey:Xn()})]);case 1:s(i);case 2:return Ce.a(2)}},se)}));function X(se){return ue.apply(this,arguments)}return X}(),onError:function(X){var se,ie;if((X==null||(se=X.response)===null||se===void 0||(se=se.data)===null||se===void 0?void 0:se.message)==="Cannot update queries for a brand that has existing analyses."){s(i,{replace:!0});return}var Ce=(X==null||(ie=X.response)===null||ie===void 0||(ie=ie.data)===null||ie===void 0?void 0:ie.message)||(X==null?void 0:X.message)||"An unexpected error occurred.";R(Ce)}}}),le=ze.mutate,He=ze.isPending;q.useEffect(function(){r||s("/setup",{replace:!0})},[r,s]),q.useEffect(function(){var ue;if(F!=null&&(ue=F.data)!==null&&ue!==void 0&&ue.queries&&Array.isArray(F.data.queries)){var X=F.data.queries.slice(0,us);c(X.map(function(se,ie){return{id:"query-".concat(ie),text:se,isRegenerating:!1}})),k(F.data.queries.slice(us))}else z&&(c(Array.from({length:us},function(se,ie){return{id:"query-".concat(ie),text:"",isRegenerating:!1}})),k([]))},[F,z]),q.useEffect(function(){var ue;if(O&&F!==null&&F!==void 0&&(ue=F.data)!==null&&ue!==void 0&&ue.queries&&Array.isArray(F.data.queries)&&!U){var X=F.data.queries.slice(0,us),se=v.map(Number);c(function(ie){return ie.map(function(Ce,gt){var we=se.indexOf(gt);return Lr(Lr({},Ce),{},{text:we>=0&&X[we]?X[we]:Ce.text,isRegenerating:!1})})}),E(!1),b([])}},[F,U,O,v]);var lt=q.useCallback(function(ue,X){var se=new Set(X);return w.filter(function(ie){return!se.has(ie)}).slice(0,ue)},[w]),dt=q.useMemo(function(){return U||u.length===0||u.some(function(ue){return ue.isRegenerating||ue.text===Go&&!z||ue.text.trim()===""})||h},[U,u,h,z]),Ne=U||u.some(function(ue){return ue.text===Go})&&!z,Fe=q.useCallback(function(ue){var X=ue.toString();b(function(se){return se.includes(X)?se.filter(function(ie){return ie!==X}):[].concat(zD(se),[X])})},[]),Z=q.useCallback(function(ue,X){c(function(se){return se.map(function(ie,Ce){return Ce===ue?Lr(Lr({},ie),{},{text:X}):ie})})},[]),Te=function(){g(!h),b([])},tt=q.useCallback(function(){if(!(U||v.length===0)){c(function(ie){return ie.map(function(Ce,gt){return Lr(Lr({},Ce),{},{isRegenerating:v.includes(gt.toString())})})});var ue=u.map(function(ie){return ie.text}),X=v.length,se=lt(X,ue);se.length===X?(c(function(ie){return ie.map(function(Ce,gt){var we=v.indexOf(gt.toString());return we>=0?Lr(Lr({},Ce),{},{text:se[we],isRegenerating:!1}):Ce})}),k(function(ie){var Ce=new Set(se);return ie.filter(function(gt){return!Ce.has(gt)})}),b([])):(E(!0),Q())}},[U,v,Q,u,lt]),$e=q.useCallback(function(ue){if(ue.preventDefault(),!!r){if(ge()){G(!0);return}le({brandId:r,data:{queries:u.map(function(X){return X.text})}})}},[r,u,le,ge]);return y.jsxs("div",{children:[B&&y.jsx(A.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(A.Title,{size:"2",className:"yst-mb-2",children:"Your queries"}),y.jsxs("div",{className:"yst-space-y-4",children:[y.jsx("p",{children:"You can edit your queries or regenerate new ones with AI."}),y.jsx("div",{className:Oe("yst-flex yst-gap-2",h?"yst-justify-end":"yst-justify-start"),children:h?y.jsxs(y.Fragment,{children:[y.jsx(A.Button,{size:"small",variant:"secondary",onClick:Te,children:"Done"}),y.jsxs(A.Button,{variant:"secondary",size:"small",onClick:tt,className:"yst-gap-1",isLoading:U,disabled:U||v.length===0,children:[y.jsx(ap,{"aria-hidden":"true"}),"Regenerate selected queries"]})]}):y.jsxs(A.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?tI.map(function(ue,X){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(A.SkeletonLoader,{children:ue||"Example placeholder query for demonstration purposes."})},"placeholder-query-".concat(X))}):u.slice(0,us).map(function(ue,X){var se=ue.isRegenerating?ue.text===Go?Go:JD: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(A.Checkbox,{id:"query-regenerate-".concat(X),name:"query-regenerate-".concat(X),value:X.toString(),checked:v.includes(X.toString()),onChange:function(){return Fe(X)},disabled:U})}),y.jsx("div",{className:"yst-flex-1",children:y.jsx(A.TextField,{id:"query-text-".concat(X),label:"Query ".concat(X+1),type:"text",value:se,onChange:function(ie){ue.isRegenerating||Z(X,ie.target.value)},placeholder:"Enter your query...",className:"yst-w-full",disabled:ue.isRegenerating,required:!0,minLength:3,maxLength:255,validation:J(ue.text)?{variant:"warning",message:"For more accurate insights, avoid using your brand name in the query."}:void 0})})]})},ue.id)})}),y.jsx(lx,{buttonText:"Run analysis (~ 5 minutes)",isButtonDisabled:dt,isLoading:He})]}),y.jsx(A.Modal,{isOpen:I,onClose:re,position:"center",as:"div",children:y.jsx(A.Modal.Panel,{children:y.jsxs("div",{className:"yst-flex yst-items-start yst-justify-stretch yst-gap-4",children:[y.jsx("div",{children:y.jsx("span",{className:"yst-inline-flex yst-h-10 yst-w-10 yst-items-center yst-justify-center yst-rounded-full yst-bg-amber-100",children:y.jsx(f2,{className:"yst-h-6 yst-w-6 yst-text-amber-600"})})}),y.jsxs("div",{className:"yst-flex-1",children:[y.jsx(A.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(A.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Brand name detected in your queries"})}),y.jsxs(A.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(A.Modal.Container.Footer,{className:"yst-flex yst-justify-end yst-gap-3",children:[y.jsxs(A.Button,{onClick:Se,variant:"secondary",className:"yst-gap-1.5",disabled:He,isLoading:He,children:[y.jsx(ap,{}),"Run analysis anyway"]}),y.jsx(A.Button,{variant:"primary",onClick:ye,children:"Review and edit queries"})]})]})]})})})]})};const iI=Object.freeze(Object.defineProperty({__proto__:null,default:rI},Symbol.toStringTag,{value:"Module"}));var sI=["min","max","progress","className"];function oI(e,t){if(e==null)return{};var n,r,i=aI(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 aI(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 dx=q.forwardRef(function(e,t){var n=e.min,r=e.max,i=e.progress,s=e.className,o=oI(e,sI),a=q.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,"%")}})})})});dx.displayName="ProgressBarGradient";var ss=[{labelAbove:"Running queries...",label:"Running queries",threshold:99},{labelAbove:"Done!",label:"Building analysis",threshold:100}],fx=function(t){var n=t.progress,r=n===void 0?0:n,i=t.className,s=i===void 0?"":i,o=function(){for(var u=0;u<ss.length;u++)if(r<=ss[u].threshold)return ss[u];return ss[ss.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(A.Spinner,{}):y.jsx(p2,{className:"yst-text-green-400"}),y.jsx("span",{className:"yst-text-sm yst-font-medium yst-italic",children:a.labelAbove})]}),y.jsx(dx,{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:ss.map(function(l){return y.jsx("span",{children:y.jsx(Uu,{disabled:a.label!==l.label,children:l.label})},l.label)})})]})};fx.propTypes={progress:Nd.number,className:Nd.string};var lI=function(t){switch(t){case"pending":case"processing":return 2*1e3;case"completed":return!1;default:return 10*1e3}},uI=function(){var t,n,r,i=fn(),s=Gt(),o=ku(),a=Nn(),l=a.brandId,u=o.brandId||l,c=iu(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,k=C==null||(w=C.state)===null||w===void 0||(w=w.data)===null||w===void 0?void 0:w.data;return lI(k==null?void 0:k.status)}}}),h=f.data,g=h==null?void 0:h.id,m=g?"/brands/".concat(u,"/analysis/").concat(g):"/brands/".concat(u);q.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&&S7(d.nextScheduledAnalysis,5)&&!S&&i("/brands/".concat(u),{replace:!0})},[d==null?void 0:d.nextScheduledAnalysis,u,i,h==null?void 0:h.status]),q.useEffect(function(){((d==null?void 0:d.setupStatus)==="completed"||(d==null?void 0:d.setupStatus)==="scheduledFirstAnalysis"&&d!==null&&d!==void 0&&d.firstNextAnalysisOpportunity&&!P2(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(fx,{progress:b}),y.jsx(Qa,{}),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,k=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(p2,{className:"yst-h-5 yst-w-5 yst-text-green-400"}):y.jsx(A.Spinner,{}),y.jsx("span",{className:"yst-flex-1 yst-text-sm",children:k})]},"result-item-".concat(k))})})]}),y.jsx("div",{className:"yst-mb-[-2rem] yst-ml-[-2rem] yst-mr-[-2rem] yst-mt-8 yst-flex yst-justify-end yst-gap-4 yst-rounded-bl-lg yst-rounded-br-lg yst-border-t yst-border-slate-200 yst-bg-slate-50 yst-px-8 yst-py-6",children:y.jsx(A.Button,{as:oi,to:m,onClick:function(S){if(b!==100){S.preventDefault();return}s.clear()},disabled:b!==100,children:"Continue →"})})]})};const cI=Object.freeze(Object.defineProperty({__proto__:null,default:uI},Symbol.toStringTag,{value:"Module"}));exports.AIInsightsClient=tT;exports.setApiBaseUrl=s2;
1287
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ox(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 VL(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 WL(e){if(Array.isArray(e))return e}var QL=function(){var t,n=fn(),r=q.useState(!1),i=Un(r,2),s=i[0],o=i[1],a=q.useState({}),l=Un(a,2),u=l[0],c=l[1],d=q.useState(""),f=Un(d,2),h=f[0],g=f[1],m=q.useState(1),p=Un(m,2),v=p[0],b=p[1],S=q.useState({}),C=Un(S,2),w=C[0],k=C[1],x=q.useState(!1),_=Un(x,2),O=_[0],E=_[1],T=q.useState(!1),M=Un(T,2),B=M[0],R=M[1],j=q.useState(null),P=Un(j,2),I=P[0],G=P[1],W=Nn(),F=W.brandId;function U(X){return String(X.id)}var z=Z5(F,{query:{enabled:!!F}}),V=z.data,N=z.isLoading,te=10,J=(V==null||(t=V.data)===null||t===void 0?void 0:t.associatedBrands.filter(function(X){var se,ie;return h?((se=(ie=X.name)===null||ie===void 0?void 0:ie.toLowerCase())!==null&&se!==void 0?se:"").includes(h.toLowerCase()):!0}))||[],ge=Math.ceil(J.length/te),re=(v-1)*te,Se=zL(J).sort(function(X,se){return X.type==="group"&&se.type!=="group"?-1:X.type!=="group"&&se.type==="group"?1:0}),ye=Se.slice(re,re+te),ze=function(se){var ie=J.find(function(Ce){return U(Ce)===se});ie&&ie.type==="group"&&(G(ie),R(!0))},le=Object.entries(w).filter(function(X){var se=Un(X,2),ie=se[1];return ie}).map(function(X){var se=Un(X,1),ie=se[0];return ie}),He=function(){E(!0)},lt=function(se){g(se.target.value),b(1)},dt=function(se){k(function(ie){return zm(zm({},ie),{},sx({},se,!ie[se]))})},Ne=function(){n("/")},Fe=function(){k({}),c({}),o(!1)},Z=function(){E(!1)},Te=function(){k({}),b(1),g("")},tt=function(){R(!1),G(null)},$e=function(se,ie){return se in u?!!u[se]:!ie.isHidden},ue=[{Header:"Brand name",accessor:"name",Cell:function(se){var ie=se.value,Ce=se.row;return y.jsx("span",{className:"yst-font-medium yst-text-slate-900",children:y.jsxs("div",{className:"yst-flex yst-items-center yst-gap-2",children:[y.jsx(A.Checkbox,{id:"brand-checkbox-".concat(Ce.id),checked:!!w[U(Ce)],onChange:function(){return dt(U(Ce))},value:U(Ce),label:Ce.isSelf?y.jsx(Uu,{children:ie}):ie,name:"brand-checkbox-".concat(Ce.id),disabled:!$e(U(Ce),Ce)}),Ce.type==="group"&&y.jsx(Q6,{className:"yst-h-4 yst-w-4 yst-text-slate-400"})]})})},LoadingComponent:function(se){var ie=se.id,Ce=ie===void 0?"":ie;return y.jsxs("div",{className:"yst-flex",children:[y.jsx(A.Checkbox,{id:"loading-row-checkbox-".concat(Ce),value:"loading",label:"",disabled:!0,name:"brand-checkbox-".concat(Ce)})," ",y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-32",id:"loading-row-skeleton-".concat(Ce)})]})}},{Header:"Actions",accessor:"id",Cell:function(se){var ie=se.value,Ce=se.row;return y.jsx(y.Fragment,{children:Ce.type==="group"?y.jsxs(A.Button,{variant:"tertiary",size:"small",onClick:function(){return ze(String(ie!=null?ie:""))},className:"yst-gap-1.5 yst-px-0",disabled:!$e(U(Ce),Ce),children:[y.jsx(h2,{className:"yst-h-4 yst-w-4"}),"Edit group"]}):void 0})},LoadingComponent:function(){return y.jsx(A.SkeletonLoader,{className:"yst-h-6 yst-w-24"})}}];return y.jsxs(A.Paper,{className:"yst-mx-auto yst-max-w-2xl",children:[y.jsx(ix,{title:"Brand list ".concat(""),children:y.jsx("p",{children:"These are the brands found in responses to your example prompts. Group related brands to improve your analysis. You can rename or exclude irrelevant brands, and new brands will be added automatically if they appear in future analysis runs."})}),y.jsxs(A.Paper.Content,{children:[y.jsx("div",{className:"yst-mb-6",children:y.jsx(A.TextInput,{id:"brand-search",label:"Search brands",placeholder:"Search brands",value:h,onChange:lt})}),y.jsx("div",{className:"yst-mb-6",children:y.jsxs(A.Table,{columns:ue,className:"yst-w-full",variant:"minimal",children:[y.jsx(A.Table.Head,{children:y.jsx(A.Table.Row,{children:ue.map(function(X){return y.jsx(A.Table.Header,{children:X.Header},X.accessor)})})}),y.jsx(A.Table.Body,{children:N?[1,2,3].map(function(X,se){return y.jsx(A.Table.Row,{children:ue.map(function(ie,Ce){return y.jsx(A.Table.Cell,{children:y.jsx(ie.LoadingComponent,{id:"skeleton-".concat(se,"-").concat(Ce)},ie.accessor)},"cell-".concat(Ce))})},se)}):ye.length===0?y.jsx(A.Table.Row,{children:y.jsx(A.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(A.Button,{variant:"secondary",size:"small",onClick:function(){g(""),b(1)},className:"yst-mt-4",children:"Clear search"})]})})}):ye.map(function(X){return y.jsx(A.Table.Row,{children:ue.map(function(se){return y.jsx(A.Table.Cell,{children:se.Cell?se.Cell({value:X[se.accessor],row:X}):X[se.accessor]},se.accessor)})},X.id)})})]})}),y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-between",children:[y.jsxs(A.Button,{variant:"secondary",onClick:He,className:"yst-mb-0 yst-gap-2",disabled:le.length<2,children:[y.jsx(o6,{})," Group brands"]}),y.jsx(A.Pagination,{variant:"text",current:v,total:ge,onNavigate:b,className:"yst-flex-row",screenReaderTextPrevious:"Previous page",screenReaderTextNext:"Next page"})]})]}),y.jsx(If,{children:y.jsx("div",{className:"yst-flex yst-items-center yst-justify-end yst-gap-4",children:s?y.jsxs(y.Fragment,{children:[y.jsx(A.Button,{variant:"secondary",className:"yst-mb-0",onClick:Fe,children:"Discard changes"}),y.jsx(A.Button,{variant:"primary",className:"yst-mb-0",onClick:Ne,children:"Save changes"})]}):y.jsx(A.Button,{as:oi,to:"/brands/".concat(F),variant:"tertiary",className:"yst-mb-0",children:"Return to analysis"})})}),y.jsx(FL,{isOpen:O,onClose:Z,brandId:F,brandsToGroup:J.filter(function(X){return le.includes(U(X))}),onGroupCreated:Te}),y.jsx($L,{isOpen:B,onClose:tt,groupToEdit:I,allBrands:J})]})};const YL=Object.freeze(Object.defineProperty({__proto__:null,default:QL},Symbol.toStringTag,{value:"Module"}));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.
1288
+ 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 Hm(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)?Hm(e,t):void 0}}function Hm(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.onClose,i=Gt(),s=q.useState(""),o=XL(s,2),a=o[0],l=o[1],u=E4({mutation:{onSuccess:function(){i.clear(),r()}}}),c=u.mutate,d=u.isPending;return q.useEffect(function(){n&&l("")},[n]),y.jsx(Gu,{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(A.TextField,{id:"delete-all-confirmation",label:"To confirm, please type DELETE ALL:",value:a,onChange:function(f){return l(f.target.value)}}),y.jsx("p",{children:y.jsx("em",{children:"This is to make sure you understand this action is permanent."})})]}),confirmText:"Yes, delete all data",cancelText:"No, go back"})};function 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 en(b,"_invoke",function(S,C,w){var k,x,_,O=0,E=w||[],T=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(j,P){return k=j,x=0,_=e,M.n=P,o}};function B(R,j){for(x=R,_=j,t=0;!T&&O&&!P&&t<E.length;t++){var P,I=E[t],G=M.p,W=I[2];R>3?(P=W===j)&&(_=I[(x=I[4])?5:(x=3,3)],I[4]=I[5]=e):I[0]<=G&&((P=R<2&&G<I[1])?(x=0,M.v=j,M.n=I[1]):G<W&&(P=R<3||I[0]>j||j>W)&&(I[4]=R,I[5]=j,M.n=W,x=0))}if(P||R>1)return o;throw T=!0,j}return function(R,j,P){if(O>1)throw TypeError("Generator is already running");for(T&&j===1&&B(j,P),x=j,_=P;(t=x<2?e:_)||!T;){k||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(O=2,k){if(x||(R="next"),t=k[R]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=k.return)&&t.call(k),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);k=e}else if((t=(T=M.n<0)?_:S.call(C,M))!==o)break}catch(I){k=e,x=1,_=I}finally{O=1}}return{value:t,done:T}}}(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]"}),(yf=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 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 rD(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 iD(e,t){return lD(e)||aD(e,t)||oD(e,t)||sD()}function sD(){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 oD(e,t){if(e){if(typeof e=="string")return Gm(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)?Gm(e,t):void 0}}function Gm(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 aD(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 lD(e){if(Array.isArray(e))return e}var uD=function(t){var n=t.isOpen,r=t.brandId,i=t.onClose,s=t.brandName,o=Gt(),a=q.useState(""),l=iD(a,2),u=l[0],c=l[1],d=h4({mutation:{onSuccess:function(){var g=rD(yf().m(function p(){return yf().w(function(v){for(;;)switch(v.n){case 0:return v.n=1,Promise.all([o.invalidateQueries({queryKey:Xn()}),o.invalidateQueries({queryKey:qu()})]);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 q.useEffect(function(){n&&c("")},[n]),y.jsx(Gu,{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(A.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 ka(e){"@babel/helpers - typeof";return ka=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},ka(e)}function Uo(){/*! 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 k,x,_,O=0,E=w||[],T=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(j,P){return k=j,x=0,_=e,M.n=P,o}};function B(R,j){for(x=R,_=j,t=0;!T&&O&&!P&&t<E.length;t++){var P,I=E[t],G=M.p,W=I[2];R>3?(P=W===j)&&(_=I[(x=I[4])?5:(x=3,3)],I[4]=I[5]=e):I[0]<=G&&((P=R<2&&G<I[1])?(x=0,M.v=j,M.n=I[1]):G<W&&(P=R<3||I[0]>j||j>W)&&(I[4]=R,I[5]=j,M.n=W,x=0))}if(P||R>1)return o;throw T=!0,j}return function(R,j,P){if(O>1)throw TypeError("Generator is already running");for(T&&j===1&&B(j,P),x=j,_=P;(t=x<2?e:_)||!T;){k||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(O=2,k){if(x||(R="next"),t=k[R]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=k.return)&&t.call(k),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);k=e}else if((t=(T=M.n<0)?_:S.call(C,M))!==o)break}catch(I){k=e,x=1,_=I}finally{O=1}}return{value:t,done:T}}}(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]"}),(Uo=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 Km(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $r(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Km(Object(n),!0).forEach(function(r){cD(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Km(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cD(e,t,n){return(t=dD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dD(e){var t=fD(e,"string");return ka(t)=="symbol"?t:t+""}function fD(e,t){if(ka(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ka(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vm(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 Wm(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){Vm(s,r,i,o,a,"next",l)}function a(l){Vm(s,r,i,o,a,"throw",l)}o(void 0)})}}function hD(e,t){return pD(e)||mD(e,t)||yD(e,t)||gD()}function gD(){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 yD(e,t){if(e){if(typeof e=="string")return Qm(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)?Qm(e,t):void 0}}function Qm(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 mD(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 pD(e){if(Array.isArray(e))return e}var vD=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=Ga(),g=h.setBrandId,m=q.useState(!1),p=hD(m,2),v=p[0],b=p[1],S=Gt(),C=zu({query:{select:function(j){var P=j.data;return P},staleTime:5*1e3,refetchOnWindowFocus:!0,refetchInterval:30*1e3}}),w=C.data,k=u2({mutation:{onMutate:function(){var R=Wm(Uo().m(function P(I){var G,W,F;return Uo().w(function(U){for(;;)switch(U.n){case 0:return G=I.brandId,W=I.data,U.n=1,S.cancelQueries({queryKey:Xn()});case 1:return F=S.getQueryData(Xn()),S.setQueryData(Xn(),function(z){var V,N;return z&&$r($r({},z),{},{data:$r($r({},z.data),{},{brands:((V=(N=z.data)===null||N===void 0?void 0:N.brands)!==null&&V!==void 0?V:[]).map(function(te){return te.id===G?$r($r({},te),{},{settings:$r($r({},te.settings),{},{enableAutomaticAnalysis:W.enableAutomaticAnalysis})}):te})})})}),U.a(2,{previous:F})}},P)}));function j(P){return R.apply(this,arguments)}return j}(),onSuccess:function(){if(i&&i.settings&&i.settings.enableAutomaticAnalysis===!1)return b(!1);b(!M)},onError:function(j,P,I){I!=null&&I.previous&&S.setQueryData(Xn(),I.previous)},onSettled:function(){var R=Wm(Uo().m(function P(){return Uo().w(function(I){for(;;)switch(I.n){case 0:return I.n=1,Promise.all([S.invalidateQueries({queryKey:Xn()}),S.invalidateQueries({queryKey:qu()}),S.invalidateQueries({queryKey:Bu(a)}),S.invalidateQueries({queryKey:pr(a,"latest")}),S.invalidateQueries({queryKey:Zn(a,"latest")}),S.invalidateQueries({queryKey:pr(a,c)}),S.invalidateQueries({queryKey:Zn(a,c)})]);case 1:return I.a(2)}},P)}));function j(){return R.apply(this,arguments)}return j}()}}),x=k.mutate,_=k.isPending,O=function(j){x({brandId:a,data:{enableAutomaticAnalysis:j}})},E=function(j){if(j){if(!T)return b(!0);if(!M)return O(!0);b(!0)}else O(!1)},T=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=P2(i==null?void 0:i.firstNextAnalysisOpportunity),B=(i==null?void 0:i.setupStatus)==="pendingQuerySelection";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(A.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(A.SkeletonLoader,{className:"yst-h-6 yst-w-32"}):i==null?void 0:i.name,B&&y.jsx("div",{children:y.jsx(A.Link,{variant:"primary",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-font-normal yst-italic yst-text-slate-500",children:["Next analysis:"," ",Fd(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(A.SkeletonLoader,{className:"yst-h-6 yst-w-24"}):y.jsxs(A.Button,{size:"small",variant:"tertiary",className:"yst-gap-1 yst-text-red-600 *:hover:yst-text-red-700",onClick:function(){i!=null&&i.id&&o(i.id)},disabled:(i==null?void 0:i.id)==="loading",children:[y.jsx(Df,{})," Delete brand"]})})]}),y.jsx(A.Modal,{isOpen:v,onClose:function(){return b(!1)},position:"center",as:"div",className:Oe({"yst-mx-auto yst-max-w-xl":T}),children:T?y.jsx(A.Modal.Panel,{children:M?y.jsxs(y.Fragment,{children:[y.jsx(A.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(A.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Start brand analysis now?"})}),y.jsxs(A.Modal.Container.Content,{className:"yst-mb-4 yst-space-y-3",children:[y.jsx("p",{children:"Activating this brand will immediately start a new analysis."}),y.jsx("p",{children:"This will use one of your weekly analyses included in your subscription."})]}),y.jsxs(A.Modal.Container.Footer,{className:"yst-mt-3 yst-flex yst-justify-end yst-gap-2",children:[y.jsx(A.Button,{variant:"secondary",onClick:function(){return b(!1)},children:"Cancel"}),y.jsx(A.Button,{variant:"primary",onClick:function(){O(!0)},isLoading:_,children:"Yes, start analysis"})]})]}):y.jsxs(y.Fragment,{children:[y.jsx(A.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(A.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Automatic analysis enabled"})}),y.jsxs(A.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:Fd(i==null?void 0:i.nextScheduledAnalysis)||"the next analysis cycle"}),"."]})]}),y.jsx(A.Modal.Container.Footer,{className:"yst-mt-3 yst-flex yst-justify-end yst-gap-2",children:y.jsx(A.Button,{variant:"primary",onClick:function(){return b(!1)},children:"Got it"})})]})}):y.jsxs(A.Modal.Panel,{children:[y.jsx("div",{className:"yst-flex yst-items-start yst-justify-stretch yst-gap-4",children:y.jsxs("div",{className:"yst-flex-1",children:[y.jsx(A.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(A.Modal.Title,{as:"h3",className:"yst-text-center yst-text-lg yst-font-medium",children:"You've reached your active brand limit"})}),y.jsx(A.Modal.Container.Content,{children:y.jsx("p",{className:"yst-text-center",children:"Each subscription lets you activate 1 brand. Add another subscription or deactivate an existing brand to activate this brand."})})]})}),y.jsx(A.Modal.Container.Footer,{children:y.jsxs("div",{className:"yst-flex yst-flex-col yst-justify-stretch yst-gap-2",children:[d&&y.jsxs(A.Button,{variant:"upsell",className:"yst-flex yst-gap-1",onClick:d,children:[y.jsx(g2,{}),"Add a subscription"]}),y.jsx(A.Button,{variant:"tertiary",className:"",onClick:function(){return b(!1)},children:"Manage active brands"})]})})]})})]})},Ym,Xm,Zm;function ed(e,t){return SD(e)||wD(e,t)||xD(e,t)||bD()}function bD(){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 xD(e,t){if(e){if(typeof e=="string")return Jm(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)?Jm(e,t):void 0}}function Jm(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 SD(e){if(Array.isArray(e))return e}function _h(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var ep=Wa(Ym||(Ym=_h(["xl:yst-w-1/3"]))),tp=Wa(Xm||(Xm=_h(["xl:yst-w-2/3"]))),np=Wa(Zm||(Zm=_h(["yst-flex yst-flex-col yst-gap-8 xl:yst-flex-row"]))),CD=function(){var t,n,r,i,s=q.useState(!1),o=ed(s,2),a=o[0],l=o[1],u=q.useState(!1),c=ed(u,2),d=c[0],f=c[1],h=q.useState(null),g=ed(h,2),m=g[0],p=g[1],v=zu({query:{select:function(x){var _=x.data;return _}}}),b=v.data,S=Yi({query:{select:function(x){var _=x.data;return _==null?void 0:_.brands},staleTime:5*1e3,refetchOnWindowFocus:!0,refetchInterval:30*1e3}}),C=S.data,w=C==null?void 0:C.find(function(k){return k.id===m});return y.jsxs("form",{children:[y.jsxs(A.Card,{children:[y.jsx(Cb,{title:"Settings",description:"Manage your brand settings and data. You can update analysis preferences or delete brands from your account."}),y.jsxs(A.Card.Content,{children:[y.jsxs(np,{children:[y.jsxs(ep,{className:"yst-space-y-2",children:[y.jsx(A.Title,{size:"4",children:"Brands"}),y.jsxs("p",{children:["You have"," ",y.jsxs("b",{children:[(t=b==null?void 0:b.activeSubscriptions)!==null&&t!==void 0?t:"—"," 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(tp,{children:[C&&y.jsxs("p",{className:"yst-flex yst-w-full yst-max-w-2xl yst-flex-1 yst-flex-row yst-items-center yst-justify-start yst-gap-2 yst-border-b-[1px] yst-border-b-slate-200 yst-py-4 yst-font-medium yst-text-slate-800",children:["Active brands: ",(r=b==null?void 0:b.numberOfActiveBrands)!==null&&r!==void 0?r:"—"," of"," ",(i=b==null?void 0:b.maxNumberOfActiveBrands)!==null&&i!==void 0?i:"—"]}),C&&C.length===0&&y.jsxs("p",{className:"yst-mt-4 yst-text-slate-500",children:["No brands found. Please"," ",y.jsx(A.Link,{as:oi,to:"/setup",children:"add a brand"})," ","to start analyzing."]}),(C!=null?C:[{id:"loading",name:"Loading..."}]).map(function(k,x,_){return y.jsx(vD,{brand:k,isLast:x===_.length-1,onDelete:function(O){p(O),l(!0)}},k.id)})]})]}),y.jsx(Qa,{}),y.jsxs(np,{children:[y.jsxs(ep,{className:"yst-space-y-2",children:[y.jsx(A.Title,{size:"4",children:"Delete all data"}),y.jsx("p",{children:"Permanently delete all brands, analysis results, and query history from your account."})]}),y.jsxs(tp,{className:"yst-space-y-4",children:[y.jsxs(A.Button,{variant:"error",onClick:function(){f(!0)},disabled:(C==null?void 0:C.length)===0,children:[y.jsx(Df,{})," 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(uD,{isOpen:a,onClose:function(){l(!1),p(null)},brandId:m||"",brandName:w==null?void 0:w.name}),y.jsx(nD,{isOpen:d,onClose:function(){f(!1)}})]})};const _D=Object.freeze(Object.defineProperty({__proto__:null,default:CD},Symbol.toStringTag,{value:"Module"}));function Cu(e){"@babel/helpers - typeof";return Cu=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},Cu(e)}var mf=[{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."}],kD=function(t){return mf.find(function(n){return!!Us(n.path,t)})||mf[0]};function OD(){var e=It(),t=kD(e.pathname);return y.jsxs(A.Paper,{className:"yst-mx-auto yst-max-w-2xl",children:[y.jsx(ix,{title:y.jsx(ax,{currentStep:t,steps:mf}),description:t.description}),y.jsx(A.Paper.Content,{children:y.jsx(Gs,{})})]})}var ax=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:Cu(r)==="object"?r.id:r}),"/",Array.isArray(i)?i.length:i]}),y.jsx("span",{children:Cu(r)==="object"?r.title:n||"Step ".concat(r)})]})};const ED=Object.freeze(Object.defineProperty({__proto__:null,SetupPaperTitle:ax,default:OD},Symbol.toStringTag,{value:"Module"}));var lx=function(t){var n=t.onBack,r=t.variant,i=r===void 0?"ai":r,s=t.buttonText,o=t.onButtonClick,a=t.isButtonDisabled,l=a===void 0?!1:a,u=t.isLoading,c=u===void 0?!1:u;return y.jsx(If,{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(A.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(A.Button,{onClick:o,variant:i==="ai"?"primary":i,className:"yst-gap-1.5",style:i==="ai"?{background:"linear-gradient(102deg, #A61E69 0%, #6366F1 100%)",color:"#fff"}:{},disabled:l,type:"submit",isLoading:c,children:[i==="ai"&&y.jsx(l6,{}),s]})})]})})},AD=[{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"}],TD=[{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"}],td=[].concat(AD,TD,[{value:"OTHER",label:"Other"}]),PD=[{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"}],jD=[{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"}],MD=[].concat(PD,jD);function ei(e){"@babel/helpers - typeof";return ei=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},ei(e)}function rp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ip(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rp(Object(n),!0).forEach(function(r){ux(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rp(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ux(e,t,n){return(t=$D(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $D(e){var t=LD(e,"string");return ei(t)=="symbol"?t:t+""}function LD(e,t){if(ei(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ei(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pf(){/*! 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 k,x,_,O=0,E=w||[],T=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(j,P){return k=j,x=0,_=e,M.n=P,o}};function B(R,j){for(x=R,_=j,t=0;!T&&O&&!P&&t<E.length;t++){var P,I=E[t],G=M.p,W=I[2];R>3?(P=W===j)&&(_=I[(x=I[4])?5:(x=3,3)],I[4]=I[5]=e):I[0]<=G&&((P=R<2&&G<I[1])?(x=0,M.v=j,M.n=I[1]):G<W&&(P=R<3||I[0]>j||j>W)&&(I[4]=R,I[5]=j,M.n=W,x=0))}if(P||R>1)return o;throw T=!0,j}return function(R,j,P){if(O>1)throw TypeError("Generator is already running");for(T&&j===1&&B(j,P),x=j,_=P;(t=x<2?e:_)||!T;){k||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(O=2,k){if(x||(R="next"),t=k[R]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=k.return)&&t.call(k),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);k=e}else if((t=(T=M.n<0)?_:S.call(C,M))!==o)break}catch(I){k=e,x=1,_=I}finally{O=1}}return{value:t,done:T}}}(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]"}),(pf=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 sp(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 DD(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){sp(s,r,i,o,a,"next",l)}function a(l){sp(s,r,i,o,a,"throw",l)}o(void 0)})}}function is(e,t){return FD(e)||ND(e,t)||RD(e,t)||ID()}function ID(){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 RD(e,t){if(e){if(typeof e=="string")return op(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?op(e,t):void 0}}function op(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ND(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 FD(e){if(Array.isArray(e))return e}var BD=function(){var t=fn(),n=Ga(),r=Gt(),i=q.useState(),s=is(i,2),o=s[0],a=s[1],l=q.useState(!1),u=is(l,2),c=u[0],d=u[1],f=q.useState({name:"",url:"",description:"",language:"en",isLocal:!1,country:void 0,region:""}),h=is(f,2),g=h[0],m=h[1],p=q.useState(null),v=is(p,2),b=v[0],S=v[1],C=q.useState(""),w=is(C,2),k=w[0],x=w[1],_=q.useMemo(function(){var z;if(!g.country)return"";var V=td.find(function(N){return N.value===g.country});return(z=V==null?void 0:V.label)!==null&&z!==void 0?z:""},[g.country]),O=q.useMemo(function(){var z=k.trim().toLowerCase();return z?td.filter(function(V){var N=V.label.toLowerCase().includes(z),te=V.value.toLowerCase().includes(z);return N||te}):td},[k]),E=l4({mutation:{onSuccess:function(){var z=DD(pf().m(function N(te){var J;return pf().w(function(ge){for(;;)switch(ge.n){case 0:return J=te.data.id,ge.n=1,Promise.all([r.invalidateQueries({queryKey:qu()}),r.invalidateQueries({queryKey:Xn()})]);case 1:J&&n.setBrandId(J),te!=null&&te.status&&te.status>=200&&te.status<300&&J&&(n.setBrandId(J),a(J));case 2:return ge.a(2)}},N)}));function V(N){return z.apply(this,arguments)}return V}(),onError:function(){d(!1)}}}),T=E.mutate,M=E.isPending,B=E.error,R=Yi({query:{enabled:!!o,select:function(V){var N=V.data;return N==null?void 0:N.brands},refetchInterval:function(V){var N;return((V==null||(N=V.state)===null||N===void 0||(N=N.data)===null||N===void 0||(N=N.data)===null||N===void 0?void 0:N.brands)||[]).find(function(te){return te.id===o})?!1:2*1e3}}}),j=R.data;q.useEffect(function(){o&&j!==null&&j!==void 0&&j.find(function(z){return z.id===o})&&t("/setup/".concat(o,"/queries"),{replace:!0})},[o,j,t]);var P=function(V,N){m(function(te){return ip(ip({},te),{},ux({},V,N))})},I=function(V){x(V.target.value)},G=function(V){P("country",V!=null?V:void 0),x("")},W=function(V){if(V.preventDefault(),S(null),g.description.length>250){S("Your brand description is too long. Please keep it within the 250-character limit."),d(!1);return}d(!0);var N=g.url;N&&!/^https?:\/\//i.test(N)&&(N="https://".concat(N)),T({data:{name:g.name,url:N,description:g.description,focusLanguage:g.language,country:g.country,regionOrCity:g.region}})};function F(z){return ei(z)==="object"&&z!==null&&"response"in z&&ei(z.response)==="object"&&z.response!==void 0&&"data"in z.response}var U=F(B)?B.response.data.errors:void 0;return y.jsxs("form",{onSubmit:W,children:[y.jsxs("div",{className:"yst-space-y-6",children:[y.jsx(A.Title,{size:"2",children:"Brand info"}),!!B&&y.jsx(A.Alert,{variant:"error",title:"Error",isVisible:!!B,children:y.jsx("ul",{children:U&&ei(U)==="object"?Object.entries(U).flatMap(function(z){var V=is(z,2),N=V[0],te=V[1];return Array.isArray(te)?te.map(function(J,ge){return y.jsx("li",{children:J},"".concat(N,"-").concat(ge))}):null}):"There was an error creating the brand."})}),b&&y.jsx(A.Alert,{variant:"error",title:"Error",isVisible:!!b,children:y.jsx("ul",{children:y.jsx("li",{children:"Your brand description is too long. Please keep it within the 250-character limit."})})}),y.jsx(A.TextField,{id:"name",label:"Brand name",value:g.name,onChange:function(z){return P("name",z.target.value)},maxLength:255}),y.jsx(A.TextField,{id:"url",label:"Website URL (optional)",placeholder:"Example: https://yourwebsite.com",value:g.url,maxLength:247,onChange:function(z){return P("url",z.target.value)}}),y.jsxs("div",{id:"brand-description-textarea",children:[y.jsx(A.TextareaField,{id:"brand-description",label:"Brand description",value:g.description,onChange:function(z){var V=z.target.value;P("description",V)},...g.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-mt-1 yst-flex",children:[y.jsxs("div",{className:"yst-flex-grow yst-flex-col",children:[g.description.length>250&&y.jsx("div",{className:"yst-mb-2 yst-text-red-500",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-ml-6 yst-mt-[-4px] yst-text-xs",{"yst-text-slate-500":g.description.length<=250,"yst-text-red-500":g.description.length>250}),children:[g.description.length,"/250"]})]})]}),y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(A.Select,{className:"yst-max-w-sm",id:"language-select",label:"Target language",value:g.language,onChange:function(z){return P("language",z)},options:MD.map(function(z){return{label:z.label,value:z.value}})}),y.jsx("p",{children:"The main language your brand uses to communicate or create content."})]})]}),y.jsx(Qa,{}),y.jsxs("div",{className:"yst-space-y-6",children:[y.jsx(A.Title,{size:"2",children:"Location info"}),y.jsx("p",{children:"Specify a location to enhance the accuracy of the analysis."}),y.jsx(A.Autocomplete,{className:"yst-max-w-sm",id:"country-select",label:"Target country (optional)",value:g.country||null,nullable:!0,placeholder:"Search countries...",onQueryChange:I,onChange:G,selectedLabel:_,children:O.map(function(z){return y.jsx(A.Autocomplete.Option,{value:z.value,children:z.label},z.value)})}),g.country&&y.jsx(A.TextField,{id:"region",label:"Target city, state, or region (optional)",value:g.region,onChange:function(z){return P("region",z.target.value)},description:`Enter a city, state, or region to narrow down the analysis. For
1293
+ example: California, Bavaria, or Paris.`,maxLength:255})]}),y.jsx(lx,{onBack:function(){return t(-1)},buttonText:"Generate queries",isButtonDisabled:M||!!o||c,isLoading:M||!!o})]})};const qD=Object.freeze(Object.defineProperty({__proto__:null,default:BD},Symbol.toStringTag,{value:"Module"})),ap=e=>D.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},D.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"}),D.createElement("defs",null,D.createElement("linearGradient",{id:"paint0_linear_3891_2757",x1:1.99951,y1:2,x2:15.3308,y2:3.72773,gradientUnits:"userSpaceOnUse"},D.createElement("stop",{stopColor:"#A61E69"}),D.createElement("stop",{offset:1,stopColor:"#6366F1"}))));function Oa(e){"@babel/helpers - typeof";return Oa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oa(e)}function zD(e){return GD(e)||UD(e)||cx(e)||HD()}function HD(){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 UD(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function GD(e){if(Array.isArray(e))return bf(e)}function lp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Lr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lp(Object(n),!0).forEach(function(r){KD(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lp(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function KD(e,t,n){return(t=VD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VD(e){var t=WD(e,"string");return Oa(t)=="symbol"?t:t+""}function WD(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 vf(){/*! 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 k,x,_,O=0,E=w||[],T=!1,M={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(j,P){return k=j,x=0,_=e,M.n=P,o}};function B(R,j){for(x=R,_=j,t=0;!T&&O&&!P&&t<E.length;t++){var P,I=E[t],G=M.p,W=I[2];R>3?(P=W===j)&&(_=I[(x=I[4])?5:(x=3,3)],I[4]=I[5]=e):I[0]<=G&&((P=R<2&&G<I[1])?(x=0,M.v=j,M.n=I[1]):G<W&&(P=R<3||I[0]>j||j>W)&&(I[4]=R,I[5]=j,M.n=W,x=0))}if(P||R>1)return o;throw T=!0,j}return function(R,j,P){if(O>1)throw TypeError("Generator is already running");for(T&&j===1&&B(j,P),x=j,_=P;(t=x<2?e:_)||!T;){k||(x?x<3?(x>1&&(M.n=-1),B(x,_)):M.n=_:M.v=_);try{if(O=2,k){if(x||(R="next"),t=k[R]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,x<2&&(x=0)}else x===1&&(t=k.return)&&t.call(k),x<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),x=1);k=e}else if((t=(T=M.n<0)?_:S.call(C,M))!==o)break}catch(I){k=e,x=1,_=I}finally{O=1}}return{value:t,done:T}}}(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]"}),(vf=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 up(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 QD(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){up(s,r,i,o,a,"next",l)}function a(l){up(s,r,i,o,a,"throw",l)}o(void 0)})}}function gi(e,t){return ZD(e)||XD(e,t)||cx(e,t)||YD()}function YD(){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 cx(e,t){if(e){if(typeof e=="string")return bf(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)?bf(e,t):void 0}}function bf(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 XD(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 ZD(e){if(Array.isArray(e))return e}var us=5,Go="Generating...",JD="Re-generating...",eI=100,tI=["******************************","***********************","*******************************************************","***********************************************","***************************************************************","*******************************************************","*******************************************************","***********************************************"],nI=Array.from({length:us},function(e,t){return{id:"query-".concat(t),text:Go,isRegenerating:!0}}),rI=function(){var t,n=ku(),r=n.brandId,i="/setup/".concat(r,"/analysis"),s=fn(),o=Gt(),a=q.useState(nI),l=gi(a,2),u=l[0],c=l[1],d=q.useState(!1),f=gi(d,2),h=f[0],g=f[1],m=q.useState([]),p=gi(m,2),v=p[0],b=p[1],S=q.useState([]),C=gi(S,2),w=C[0],k=C[1],x=q.useState(!1),_=gi(x,2),O=_[0],E=_[1],T=q.useState(null),M=gi(T,2),B=M[0],R=M[1],j=q.useState(!1),P=gi(j,2),I=P[0],G=P[1],W=S4(r||"",{query:{enabled:!!r}}),F=W.data,U=W.isRefetching,z=W.isError,V=W.refetch,N=iu(r||"",{query:{enabled:!!r}}),te=N.data,J=q.useCallback(function(ue){var X;if(!(te!=null&&(X=te.data)!==null&&X!==void 0&&X.name))return!1;var se=te.data.name.toLowerCase().trim();return se?ue.toLowerCase().includes(se):!1},[te==null||(t=te.data)===null||t===void 0?void 0:t.name]),ge=q.useCallback(function(){return u.some(function(ue){return J(ue.text)})},[u,J]),re=function(){G(!1)},Se=function(){G(!1),r&&le({brandId:r,data:{queries:u.map(function(X){return X.text})}})},ye=function(){G(!1);var X=u.findIndex(function(se){return J(se.text)});X!==-1&&setTimeout(function(){var se=document.getElementById("query-text-".concat(X));se&&(se.focus(),se.select())},eI)},ze=v4({mutation:{onSuccess:function(){var ue=QD(vf().m(function se(ie){return vf().w(function(Ce){for(;;)switch(Ce.n){case 0:if(R(null),!(ie!=null&&ie.status&&ie.status>=200&&ie.status<300)){Ce.n=2;break}return Ce.n=1,Promise.all([o.invalidateQueries({queryKey:Bu(r||"")}),o.invalidateQueries({queryKey:Xn()})]);case 1:s(i);case 2:return Ce.a(2)}},se)}));function X(se){return ue.apply(this,arguments)}return X}(),onError:function(X){var se,ie;if((X==null||(se=X.response)===null||se===void 0||(se=se.data)===null||se===void 0?void 0:se.message)==="Cannot update queries for a brand that has existing analyses."){s(i,{replace:!0});return}var Ce=(X==null||(ie=X.response)===null||ie===void 0||(ie=ie.data)===null||ie===void 0?void 0:ie.message)||(X==null?void 0:X.message)||"An unexpected error occurred.";R(Ce)}}}),le=ze.mutate,He=ze.isPending;q.useEffect(function(){r||s("/setup",{replace:!0})},[r,s]),q.useEffect(function(){var ue;if(F!=null&&(ue=F.data)!==null&&ue!==void 0&&ue.queries&&Array.isArray(F.data.queries)){var X=F.data.queries.slice(0,us);c(X.map(function(se,ie){return{id:"query-".concat(ie),text:se,isRegenerating:!1}})),k(F.data.queries.slice(us))}else z&&(c(Array.from({length:us},function(se,ie){return{id:"query-".concat(ie),text:"",isRegenerating:!1}})),k([]))},[F,z]),q.useEffect(function(){var ue;if(O&&F!==null&&F!==void 0&&(ue=F.data)!==null&&ue!==void 0&&ue.queries&&Array.isArray(F.data.queries)&&!U){var X=F.data.queries.slice(0,us),se=v.map(Number);c(function(ie){return ie.map(function(Ce,gt){var we=se.indexOf(gt);return Lr(Lr({},Ce),{},{text:we>=0&&X[we]?X[we]:Ce.text,isRegenerating:!1})})}),E(!1),b([])}},[F,U,O,v]);var lt=q.useCallback(function(ue,X){var se=new Set(X);return w.filter(function(ie){return!se.has(ie)}).slice(0,ue)},[w]),dt=q.useMemo(function(){return U||u.length===0||u.some(function(ue){return ue.isRegenerating||ue.text===Go&&!z||ue.text.trim()===""})||h},[U,u,h,z]),Ne=U||u.some(function(ue){return ue.text===Go})&&!z,Fe=q.useCallback(function(ue){var X=ue.toString();b(function(se){return se.includes(X)?se.filter(function(ie){return ie!==X}):[].concat(zD(se),[X])})},[]),Z=q.useCallback(function(ue,X){c(function(se){return se.map(function(ie,Ce){return Ce===ue?Lr(Lr({},ie),{},{text:X}):ie})})},[]),Te=function(){g(!h),b([])},tt=q.useCallback(function(){if(!(U||v.length===0)){c(function(ie){return ie.map(function(Ce,gt){return Lr(Lr({},Ce),{},{isRegenerating:v.includes(gt.toString())})})});var ue=u.map(function(ie){return ie.text}),X=v.length,se=lt(X,ue);se.length===X?(c(function(ie){return ie.map(function(Ce,gt){var we=v.indexOf(gt.toString());return we>=0?Lr(Lr({},Ce),{},{text:se[we],isRegenerating:!1}):Ce})}),k(function(ie){var Ce=new Set(se);return ie.filter(function(gt){return!Ce.has(gt)})}),b([])):(E(!0),V())}},[U,v,V,u,lt]),$e=q.useCallback(function(ue){if(ue.preventDefault(),!!r){if(ge()){G(!0);return}le({brandId:r,data:{queries:u.map(function(X){return X.text})}})}},[r,u,le,ge]);return y.jsxs("div",{children:[B&&y.jsx(A.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(A.Title,{size:"2",className:"yst-mb-2",children:"Your queries"}),y.jsxs("div",{className:"yst-space-y-4",children:[y.jsx("p",{children:"You can edit your queries or regenerate new ones with AI."}),y.jsx("div",{className:Oe("yst-flex yst-gap-2",h?"yst-justify-end":"yst-justify-start"),children:h?y.jsxs(y.Fragment,{children:[y.jsx(A.Button,{size:"small",variant:"secondary",onClick:Te,children:"Done"}),y.jsxs(A.Button,{variant:"secondary",size:"small",onClick:tt,className:"yst-gap-1",isLoading:U,disabled:U||v.length===0,children:[y.jsx(ap,{"aria-hidden":"true"}),"Regenerate selected queries"]})]}):y.jsxs(A.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?tI.map(function(ue,X){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(A.SkeletonLoader,{children:ue||"Example placeholder query for demonstration purposes."})},"placeholder-query-".concat(X))}):u.slice(0,us).map(function(ue,X){var se=ue.isRegenerating?ue.text===Go?Go:JD: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(A.Checkbox,{id:"query-regenerate-".concat(X),name:"query-regenerate-".concat(X),value:X.toString(),checked:v.includes(X.toString()),onChange:function(){return Fe(X)},disabled:U})}),y.jsx("div",{className:"yst-flex-1",children:y.jsx(A.TextField,{id:"query-text-".concat(X),label:"Query ".concat(X+1),type:"text",value:se,onChange:function(ie){ue.isRegenerating||Z(X,ie.target.value)},placeholder:"Enter your query...",className:"yst-w-full",disabled:ue.isRegenerating,required:!0,minLength:3,maxLength:255,validation:J(ue.text)?{variant:"warning",message:"For more accurate insights, avoid using your brand name in the query."}:void 0})})]})},ue.id)})}),y.jsx(lx,{buttonText:"Run analysis (~ 5 minutes)",isButtonDisabled:dt,isLoading:He})]}),y.jsx(A.Modal,{isOpen:I,onClose:re,position:"center",as:"div",children:y.jsx(A.Modal.Panel,{children:y.jsxs("div",{className:"yst-flex yst-items-start yst-justify-stretch yst-gap-4",children:[y.jsx("div",{children:y.jsx("span",{className:"yst-inline-flex yst-h-10 yst-w-10 yst-items-center yst-justify-center yst-rounded-full yst-bg-amber-100",children:y.jsx(f2,{className:"yst-h-6 yst-w-6 yst-text-amber-600"})})}),y.jsxs("div",{className:"yst-flex-1",children:[y.jsx(A.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(A.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Brand name detected in your queries"})}),y.jsxs(A.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(A.Modal.Container.Footer,{className:"yst-flex yst-justify-end yst-gap-3",children:[y.jsxs(A.Button,{onClick:Se,variant:"secondary",className:"yst-gap-1.5",disabled:He,isLoading:He,children:[y.jsx(ap,{}),"Run analysis anyway"]}),y.jsx(A.Button,{variant:"primary",onClick:ye,children:"Review and edit queries"})]})]})]})})})]})};const iI=Object.freeze(Object.defineProperty({__proto__:null,default:rI},Symbol.toStringTag,{value:"Module"}));var sI=["min","max","progress","className"];function oI(e,t){if(e==null)return{};var n,r,i=aI(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 aI(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 dx=q.forwardRef(function(e,t){var n=e.min,r=e.max,i=e.progress,s=e.className,o=oI(e,sI),a=q.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,"%")}})})})});dx.displayName="ProgressBarGradient";var ss=[{labelAbove:"Running queries...",label:"Running queries",threshold:99},{labelAbove:"Done!",label:"Building analysis",threshold:100}],fx=function(t){var n=t.progress,r=n===void 0?0:n,i=t.className,s=i===void 0?"":i,o=function(){for(var u=0;u<ss.length;u++)if(r<=ss[u].threshold)return ss[u];return ss[ss.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(A.Spinner,{}):y.jsx(p2,{className:"yst-text-green-400"}),y.jsx("span",{className:"yst-text-sm yst-font-medium yst-italic",children:a.labelAbove})]}),y.jsx(dx,{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:ss.map(function(l){return y.jsx("span",{children:y.jsx(Uu,{disabled:a.label!==l.label,children:l.label})},l.label)})})]})};fx.propTypes={progress:Nd.number,className:Nd.string};var lI=function(t){switch(t){case"pending":case"processing":return 2*1e3;case"completed":return!1;default:return 10*1e3}},uI=function(){var t,n,r,i=fn(),s=Gt(),o=ku(),a=Nn(),l=a.brandId,u=o.brandId||l,c=iu(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,k=C==null||(w=C.state)===null||w===void 0||(w=w.data)===null||w===void 0?void 0:w.data;return lI(k==null?void 0:k.status)}}}),h=f.data,g=h==null?void 0:h.id,m=g?"/brands/".concat(u,"/analysis/").concat(g):"/brands/".concat(u);q.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&&S7(d.nextScheduledAnalysis,5)&&!S&&i("/brands/".concat(u),{replace:!0})},[d==null?void 0:d.nextScheduledAnalysis,u,i,h==null?void 0:h.status]),q.useEffect(function(){((d==null?void 0:d.setupStatus)==="completed"||(d==null?void 0:d.setupStatus)==="scheduledFirstAnalysis"&&d!==null&&d!==void 0&&d.firstNextAnalysisOpportunity&&!P2(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(fx,{progress:b}),y.jsx(Qa,{}),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,k=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(p2,{className:"yst-h-5 yst-w-5 yst-text-green-400"}):y.jsx(A.Spinner,{}),y.jsx("span",{className:"yst-flex-1 yst-text-sm",children:k})]},"result-item-".concat(k))})})]}),y.jsx("div",{className:"yst-mb-[-2rem] yst-ml-[-2rem] yst-mr-[-2rem] yst-mt-8 yst-flex yst-justify-end yst-gap-4 yst-rounded-bl-lg yst-rounded-br-lg yst-border-t yst-border-slate-200 yst-bg-slate-50 yst-px-8 yst-py-6",children:y.jsx(A.Button,{as:oi,to:m,onClick:function(S){if(b!==100){S.preventDefault();return}s.clear()},disabled:b!==100,children:"Continue →"})})]})};const cI=Object.freeze(Object.defineProperty({__proto__:null,default:uI},Symbol.toStringTag,{value:"Module"}));exports.AIInsightsClient=tT;exports.setApiBaseUrl=s2;
1296
1296
  //# sourceMappingURL=ai-insights-client.cjs.js.map