@kizenapps/cli 1.1.2 → 1.4.0-fcc7387
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.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/viewer/assets/{AppDetailPage-BorvgFPN.js → AppDetailPage-bXSN_SkL.js} +1 -1
- package/dist/viewer/assets/{BootstrapContext-D5ZnMrOp.js → BootstrapContext-BJMPPV2t.js} +1 -1
- package/dist/viewer/assets/Card-DRaOqhzt.js +1 -0
- package/dist/viewer/assets/{CodeStepsPage-DnL8JwSJ.js → CodeStepsPage-BzLWCjg6.js} +1 -1
- package/dist/viewer/assets/{CodeViewer-C9aVhzG7.js → CodeViewer-sTHrPWAx.js} +1 -1
- package/dist/viewer/assets/{ConfigurationPage-CAdaFi9y.js → ConfigurationPage-DHbuiVlX.js} +1 -1
- package/dist/viewer/assets/{DevSidebar-DS8UU-G8.js → DevSidebar-C8F2KFXY.js} +1 -1
- package/dist/viewer/assets/{IconReferencePage-bTBpdJEd.js → IconReferencePage-BDKMGmeG.js} +1 -1
- package/dist/viewer/assets/{SandboxPage-CU6fvI8A.js → SandboxPage-CMq8Xrjk.js} +1 -1
- package/dist/viewer/assets/SidebarContext-CENlTk-2.js +1 -0
- package/dist/viewer/assets/{SourceBrowserPage-BBZcr3MI.js → SourceBrowserPage-Clg_fH0I.js} +1 -1
- package/dist/viewer/assets/{Tooltip-tpqNw0op.js → Tooltip-9-UcK9bz.js} +1 -1
- package/dist/viewer/assets/{VersionsPage-D6QScnTb.js → VersionsPage-BRfN-13x.js} +1 -1
- package/dist/viewer/assets/{WhenBadge-DZrl6k94.js → WhenBadge-DY21YMpA.js} +1 -1
- package/dist/viewer/assets/api-DJcHZP2k.js +10 -0
- package/dist/viewer/assets/{bundleQuery-CjbA01rb.js → bundleQuery-Bjqi6ox2.js} +1 -1
- package/dist/viewer/assets/{calendarSource.worker-DGRTJYHs.js → calendarSource.worker-2UhvqVzo.js} +4 -4
- package/dist/viewer/assets/{configStorage-aLI-65re.js → configStorage-fNlYS08a.js} +1 -1
- package/dist/viewer/assets/{fa-core-BoBqCOD3.js → fa-core-B7dAyAZA.js} +1 -1
- package/dist/viewer/assets/{fa-pro-icons-j8-_MCQ7.js → fa-pro-icons-DtrKpGj8.js} +1 -1
- package/dist/viewer/assets/floatingFrame.worker-BPvRqAU5.js +23 -0
- package/dist/viewer/assets/{generic.worker-Bzr3c9PO.js → generic.worker-CaEdS_L8.js} +4 -4
- package/dist/viewer/assets/index-BqEAhAQ_.css +2 -0
- package/dist/viewer/assets/index-ZdHVsbQr.js +5 -0
- package/dist/viewer/assets/{react-csXWLXSE.js → react-j0eBFjQW.js} +1 -1
- package/dist/viewer/assets/{recordDetail.worker-B-1qFS5m.js → recordDetail.worker-DIZ1eFYu.js} +6 -6
- package/dist/viewer/assets/rolldown-runtime-Dw2cE7zH.js +1 -0
- package/dist/viewer/assets/storageKeys-CSWy3aiP.js +1 -0
- package/dist/viewer/assets/useCriticalExceptionDialog-4AtgdUhp.js +40 -0
- package/dist/viewer/assets/{useLocalStorage-CyZiO78q.js → useLocalStorage-BTxXC7un.js} +1 -1
- package/dist/viewer/assets/{useNavigate-BblEmQ3O.js → useNavigate-AMIImip9.js} +1 -1
- package/dist/viewer/assets/{useQuery-5OkVbV1s.js → useQuery-CHCkzQbK.js} +1 -1
- package/dist/viewer/assets/{validIcons-BzGQ4tWD.js → validIcons-LvIGHq2c.js} +1 -1
- package/dist/viewer/index.html +13 -13
- package/package.json +12 -2
- package/dist/viewer/assets/Card-BpDJPrPZ.js +0 -1
- package/dist/viewer/assets/SidebarContext-Cn8QRb77.js +0 -1
- package/dist/viewer/assets/api-DtXiAEKW.js +0 -10
- package/dist/viewer/assets/floatingFrame.worker-CKAMagoG.js +0 -23
- package/dist/viewer/assets/index-Cp0A29vq.js +0 -5
- package/dist/viewer/assets/index-DtzraybB.css +0 -2
- package/dist/viewer/assets/rolldown-runtime-DF2fYuay.js +0 -1
- package/dist/viewer/assets/storageKeys-C6c8YF5Y.js +0 -1
- package/dist/viewer/assets/useCriticalExceptionDialog-C8PL9Dxt.js +0 -5
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DevSidebar-DS8UU-G8.js","assets/rolldown-runtime-DF2fYuay.js","assets/fa-core-BoBqCOD3.js","assets/storageKeys-C6c8YF5Y.js","assets/Tooltip-tpqNw0op.js","assets/react-csXWLXSE.js","assets/AppDetailPage-BorvgFPN.js","assets/useQuery-5OkVbV1s.js","assets/bundleQuery-CjbA01rb.js","assets/formatBytes-C9lOTtsO.js","assets/Card-BpDJPrPZ.js","assets/validIcons-BzGQ4tWD.js","assets/fa-pro-icons-j8-_MCQ7.js","assets/SandboxPage-CU6fvI8A.js","assets/api-DtXiAEKW.js","assets/useCriticalExceptionDialog-C8PL9Dxt.js","assets/BootstrapContext-D5ZnMrOp.js","assets/SidebarContext-Cn8QRb77.js","assets/WhenBadge-DZrl6k94.js","assets/useLocalStorage-CyZiO78q.js","assets/configStorage-aLI-65re.js","assets/ConfigurationPage-CAdaFi9y.js","assets/CodeViewer-C9aVhzG7.js","assets/CodeViewer-DdKuH37F.css","assets/VersionsPage-D6QScnTb.js","assets/IconReferencePage-bTBpdJEd.js","assets/CodeStepsPage-DnL8JwSJ.js","assets/useNavigate-BblEmQ3O.js","assets/SourceBrowserPage-BBZcr3MI.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{n as e}from"./rolldown-runtime-DF2fYuay.js";import{A as t,C as n,E as r,_ as i,c as a,f as o,g as s,h as c,j as l,k as u,l as d,n as f,r as p,t as m,v as h,w as g}from"./fa-core-BoBqCOD3.js";import{n as _,t as v}from"./react-csXWLXSE.js";import{a as y,i as b,n as x,r as S,t as C}from"./useNavigate-BblEmQ3O.js";import{_ as w,a as T,b as E,c as D,d as O,f as k,g as A,h as j,i as M,l as ee,m as te,n as ne,o as N,p as P,r as re,s as ie,t as ae,u as oe,v as F,x as I,y as se}from"./bundleQuery-CjbA01rb.js";import{I as ce,M as le,N as L,O as R,d as ue,f as de,t as z,v as B,w as fe}from"./useQuery-5OkVbV1s.js";import{a as pe,i as me,o as he,r as ge,s as _e,t as ve}from"./BootstrapContext-D5ZnMrOp.js";import{t as V,u as ye}from"./storageKeys-C6c8YF5Y.js";import{n as be,t as H}from"./api-DtXiAEKW.js";import{t as xe}from"./SidebarContext-Cn8QRb77.js";import{t as Se}from"./Card-BpDJPrPZ.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function Ce(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var U=4,we=5;function Te(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function Ee(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=Te(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function De(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e,l=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;s<o;){let e=Ee(r,s,t),o,u=s,d=e[5];switch(s=d+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=ke(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=ke(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.dynamic?.find(e=>!e.skipOnParamError&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=Ae(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.skipOnParamError&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=Ae(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=Ae(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=ke(n.fullPath??n.from);e.kind=we,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=ke(n.fullPath??n.from);e.kind=U,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=n.options?.params?.parse??null,i.skipOnParamError=l,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)De(e,t,r,s,i,a,o)}function Oe(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function W(e){if(e.pathless)for(let t of e.pathless)W(t);if(e.static)for(let t of e.static.values())W(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())W(t);if(e.dynamic?.length){e.dynamic.sort(Oe);for(let t of e.dynamic)W(t)}if(e.optional?.length){e.optional.sort(Oe);for(let t of e.optional)W(t)}if(e.wildcard?.length){e.wildcard.sort(Oe);for(let t of e.wildcard)W(t)}}function ke(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Ae(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:i}}function je(e,t){let n=ke(`/`),r=new Uint16Array(6);for(let t of e)De(!1,r,t,1,n,0);W(n),t.masksTree=n,t.flatCache=Ce(1e3)}function Me(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=Le(e,t.masksTree);return t.flatCache.set(e,r),r}function Ne(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=ke(`/`),De(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),Le(r,o,n)}function Pe(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=Le(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=ze(a.route)),t.matchCache.set(r,a),a}function Fe(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function Ie(e,t=!1,n){let r=ke(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return De(t,i,e,1,r,0,e=>{if(n?.(e,s),e.id in a&&D(),a[e.id]=e,s!==0&&e.path){let t=Fe(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),W(r),{processedTree:{segmentTree:r,singleCache:Ce(1e3),matchCache:Ce(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function Le(e,t,n=!1){let r=e.split(`/`),i=Ve(e,r,t,n);if(!i)return null;let[a]=Re(e,r,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function Re(e,t,n){let r=Be(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===U)break;if(u.kind===we){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function ze(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Be(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Ve(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!se(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}],c=null,l=null,u=null;for(;s.length;){let n=s.pop(),{node:i,index:d,skipped:f,depth:p,statics:m,dynamics:h,optionals:g}=n,{extract:_,rawParams:v,parsedParams:y}=n;if(i.skipOnParamError){if(!He(e,t,n))continue;v=n.rawParams,_=n.extract,y=n.parsedParams}r&&i.route&&i.kind!==U&&Ue(l,n)&&(l=n);let b=d===o;if(b&&(i.route&&!a&&Ue(u,n)&&(u=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let x=b?void 0:t[d],S;if(b&&i.index){let n={node:i.index,index:d,skipped:f,depth:p+1,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y},r=!0;if(i.index.skipOnParamError&&(He(e,t,n)||(r=!1)),r){if(m===o&&!h&&!g&&!f)return n;Ue(u,n)&&(u=n)}}if(i.wildcard&&Ue(c,n))for(let n of i.wildcard){let{prefix:r,suffix:i}=n;if(r&&(b||!(n.caseSensitive?x:S??=x.toLowerCase()).startsWith(r)))continue;if(i){if(b)continue;let e=t.slice(d).join(`/`).slice(-i.length);if((n.caseSensitive?e:e.toLowerCase())!==i)continue}let a={node:n,index:o,skipped:f,depth:p,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y};if(!(n.skipOnParamError&&!He(e,t,a))){c=a;break}}if(i.optional){let e=f|1<<p,t=p+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];s.push({node:r,index:d,skipped:e,depth:t,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?x:S??=x.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:d+1,skipped:f,depth:t,statics:m,dynamics:h,optionals:g+1,extract:_,rawParams:v,parsedParams:y})}}if(!b&&i.dynamic&&x)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?x:S??=x.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:d+1,skipped:f,depth:p+1,statics:m,dynamics:h+1,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b&&i.staticInsensitive){let e=i.staticInsensitive.get(S??=x.toLowerCase());e&&s.push({node:e,index:d+1,skipped:f,depth:p+1,statics:m+1,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b&&i.static){let e=i.static.get(x);e&&s.push({node:e,index:d+1,skipped:f,depth:p+1,statics:m+1,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(i.pathless){let e=p+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:d,skipped:f,depth:e,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}}}if(u&&c)return Ue(c,u)?u:c;if(u)return u;if(c)return c;if(r&&l){let n=l.index;for(let e=0;e<l.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return l.rawParams??=Object.create(null),l.rawParams[`**`]=decodeURIComponent(r),l}return null}function He(e,t,n){try{let[r,i]=Re(e,t,n);n.rawParams=r,n.extract=i;let a=n.node.parse(r);return n.parsedParams=Object.assign(Object.create(null),n.parsedParams,a),!0}catch{return null}}function Ue(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===U)>(e.node.kind===U)||t.node.kind===U==(e.node.kind===U)&&t.depth>e.depth))):!0}function We(e){return Ge(e.filter(e=>e!==void 0).join(`/`))}function Ge(e){return e.replace(/\/{2,}/g,`/`)}function Ke(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function G(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function qe(e){return G(Ke(e))}function Je(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function Ye(e,t,n){return Je(e,n)===Je(t,n)}function Xe({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&se(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.pop():r===`.`||s.push(r)}}s.length>1&&(se(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c,l=``;for(let e=0;e<s.length;e++){e>0&&(l+=`/`);let t=s[e];if(!t)continue;c=Ee(t,0,c);let n=c[0];if(n===0){l+=t;continue}let r=c[5],i=t.substring(0,c[1]),a=t.substring(c[4],r),o=t.substring(c[2],c[3]);n===1?l+=i||a?`${i}{$${o}}${a}`:`$${o}`:n===2?l+=i||a?`${i}{$}${a}`:`$`:l+=`${i}{-$${o}}${a}`}l=Ge(l);let u=l||`/`;return o&&r&&r.set(o,u),u}function Ze(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function Qe(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>et(e,n)).join(`/`):et(r,n):r}function $e({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=Ee(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=Qe(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=Qe(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=Qe(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function et(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function K(e){return e?.isNotFound===!0}function tt(){try{return typeof window<`u`&&typeof window.sessionStorage==`object`?window.sessionStorage:void 0}catch{return}}var nt=`tsr-scroll-restoration-v1_3`;function rt(){let e=tt();if(!e)return null;let t={};try{let n=JSON.parse(e.getItem(`tsr-scroll-restoration-v1_3`)||`{}`);w(n)&&(t=n)}catch{}return{get state(){return t},set:e=>{t=j(e,t)||t},persist:()=>{try{e.setItem(nt,JSON.stringify(t))}catch{}}}}var it=rt(),at=e=>e.state.__TSR_key||e.href;function ot(e){let t=[],n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(` > `)}`.toLowerCase()}var st=!1,ct=`window`,lt=`data-scroll-restoration-id`;function ut(e,t){if(!it)return;let n=it;if((t??e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!n)return;e.isScrollRestorationSetup=!0,st=!1;let r=e.options.getScrollRestorationKey||at,i=new Map;window.history.scrollRestoration=`manual`;let a=t=>{if(!(st||!e.isScrollRestoring))if(t.target===document||t.target===window)i.set(ct,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{let e=t.target;i.set(e,{scrollX:e.scrollLeft||0,scrollY:e.scrollTop||0})}},o=t=>{if(!e.isScrollRestoring||!t||i.size===0||!n)return;let r=n.state[t]||={};for(let[e,t]of i){let n;if(e===ct)n=ct;else if(e.isConnected){let t=e.getAttribute(lt);n=t?`[${lt}="${t}"]`:ot(e)}n&&(r[n]=t)}};document.addEventListener(`scroll`,a,!0),e.subscribe(`onBeforeLoad`,e=>{o(e.fromLocation?r(e.fromLocation):void 0),i.clear()}),window.addEventListener(`pagehide`,()=>{o(r(e.stores.resolvedLocation.get()??e.stores.location.get())),n.persist()}),e.subscribe(`onRendered`,t=>{let a=r(t.toLocation),o=e.options.scrollRestorationBehavior,s=e.options.scrollToTopSelectors;if(i.clear(),!e.resetNextScroll){e.resetNextScroll=!0;return}if(!(typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))){st=!0;try{let t=e.isScrollRestoring?n.state[a]:void 0,r=!1;if(t)for(let e in t){let n=t[e];if(!w(n))continue;let{scrollX:i,scrollY:a}=n;if(!(!Number.isFinite(i)||!Number.isFinite(a))){if(e===ct)window.scrollTo({top:a,left:i,behavior:o}),r=!0;else if(e){let t;try{t=document.querySelector(e)}catch{continue}t&&(t.scrollLeft=i,t.scrollTop=a,r=!0)}}}if(!r){let t=e.history.location.hash.slice(1);if(t){let e=window.history.state?.__hashScrollIntoViewOptions??!0;if(e){let n=document.getElementById(t);n&&n.scrollIntoView(e)}}else{let e={top:0,left:0,behavior:o};if(window.scrollTo(e),s)for(let t of s){if(t===ct)continue;let n=typeof t==`function`?t():document.querySelector(t);n&&n.scrollTo(e)}}}}finally{st=!1}e.isScrollRestoring&&n.set(e=>(e[a]||={},e))}})}function dt(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function ft(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function pt(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=ft(r):Array.isArray(t)?t.push(ft(r)):n[e]=[t,ft(r)]}return n}var mt=gt(JSON.parse),ht=_t(JSON.stringify,JSON.parse);function gt(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=pt(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function _t(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=dt(e,r);return t?`?${t}`:``}}var vt=`__root__`;function yt(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function q(e){return e instanceof Response&&!!e.options}function bt(e){return{input:({url:t})=>{for(let n of e)t=St(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Ct(e[n],t);return t}}}function xt(e){let t=qe(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:t})=>{let r=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return r===i?t.pathname=`/`:r.startsWith(a)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=We([`/`,t,e.pathname]),e)}}function St(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Ct(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function wt(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,o=new Map,s=new Map,c=new Map,l=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),f=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),h=n(e.statusCode),g=n(e.redirect),_=n([]),v=n([]),y=n([]),b=r(()=>Tt(o,_.get())),x=r(()=>Tt(s,v.get())),S=r(()=>Tt(c,y.get())),C=r(()=>_.get()[0]),w=r(()=>_.get().some(e=>o.get(e)?.get().status===`pending`)),T=r(()=>({locationHref:p.get().href,resolvedLocationHref:m.get()?.href,status:l.get()})),E=r(()=>({status:l.get(),loadedAt:u.get(),isLoading:d.get(),isTransitioning:f.get(),matches:b.get(),location:p.get(),resolvedLocation:m.get(),statusCode:h.get(),redirect:g.get()})),D=Ce(64);function O(e){let t=D.get(e);return t||(t=r(()=>{let t=_.get();for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.get()}}),D.set(e,t)),t}let k={status:l,loadedAt:u,isLoading:d,isTransitioning:f,location:p,resolvedLocation:m,statusCode:h,redirect:g,matchesId:_,pendingIds:v,cachedIds:y,matches:b,pendingMatches:x,cachedMatches:S,firstId:C,hasPending:w,matchRouteDeps:T,matchStores:o,pendingMatchStores:s,cachedMatchStores:c,__store:E,getRouteMatchStore:O,setMatches:A,setPending:j,setCached:M};A(e.matches),a?.(k);function A(e){Et(e,o,_,n,i)}function j(e){Et(e,s,v,n,i)}function M(e){Et(e,c,y,n,i)}return k}function Tt(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.get())}return n}function Et(e,t,n,r,i){let a=e.map(e=>e.id),o=new Set(a);i(()=>{for(let e of t.keys())o.has(e)||t.delete(e);for(let n of e){let e=t.get(n.id);if(!e){let e=r(n);e.routeId=n.routeId,t.set(n.id,e);continue}e.routeId=n.routeId,e.get()!==n&&e.set(n)}oe(n.get(),a)||n.set(a)})}var Dt=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Ot=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),kt=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),At=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},jt=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},Mt=(e,t,n)=>{if(!(!q(n)&&!K(n)))throw q(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:q(n)?`redirected`:K(n)?`notFound`:r.status===`pending`?`success`:r.status,context:At(e,t.index),isFetching:!1,error:n})),K(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),q(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},Nt=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Pt=(e,t,n)=>{let r=At(e,n);e.updateMatch(t,e=>({...e,context:r}))},Ft=(e,t,n,r)=>{let{id:i,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,Mt(e,e.router.getMatch(i),n);try{o.options.onError?.(n)}catch(t){n=t,Mt(e,e.router.getMatch(i),n)}e.updateMatch(i,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!q(n)&&!K(n)&&(e.serialError??=n)},It=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!kt(e,t)&&(n.options.loader||n.options.beforeLoad||qt(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{Dt(e)},i);r._nonReactive.pendingTimeout=t}},Lt=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;It(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&Mt(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},Rt=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=O(()=>{a?.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&Ft(e,n,o,`PARSE_PARAMS`),s&&Ft(e,n,s,`VALIDATE_SEARCH`),It(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},d=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),d()});return}i._nonReactive.beforeLoadPromise=O();let f={...At(e,n,!1),...i.__routeContext},{search:p,params:m,cause:h}=i,g=kt(e,t),_={search:p,abortController:c,params:m,preload:g,context:f,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?`preload`:h,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},v=r=>{if(r===void 0){e.router.batch(()=>{u(),d()});return}(q(r)||K(r))&&(u(),Ft(e,n,r,`BEFORE_LOAD`)),e.router.batch(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},y;try{if(y=r.options.beforeLoad(_),F(y))return u(),y.catch(t=>{Ft(e,n,t,`BEFORE_LOAD`)}).then(v)}catch(t){u(),Ft(e,n,t,`BEFORE_LOAD`)}v(y)},zt=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>Rt(e,n,t,i),s=()=>{if(Nt(e,n))return;let t=Lt(e,n,i);return F(t)?t.then(o):o()};return a()},Bt=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},Vt=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=At(e,r),d=kt(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},Ht=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{Kt(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(Vt(e,t,n,r,i)),l=!!s&&F(c);if((l||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=l?await c:c;Mt(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let u=a._nonReactive.minPendingPromise;u&&await u,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:At(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let o=t;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:At(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,K(t)&&await i.options.notFoundComponent?.preload?.(),Mt(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,Mt(e,e.router.getMatch(n),t)}!q(o)&&!K(o)&&await Kt(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:At(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),Mt(e,r,t)}},Ut=async(e,t,n)=>{async function r(r,a,c,l,d){let f=Date.now()-a.updatedAt,p=r?d.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:d.options.staleTime??e.router.options.defaultStaleTime??0,m=d.options.shouldReload,h=typeof m==`function`?m(Vt(e,t,i,n,d)):m,{status:g,invalid:_}=l,v=f>=p&&(!!e.forceStaleReload||l.cause===`enter`||c!==void 0&&c!==l.id);o=g===`success`&&(_||(h??v)),r&&d.options.preload===!1||(o&&!e.sync&&u?(s=!0,(async()=>{try{await Ht(e,t,i,n,d);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){q(t)&&await e.router.navigate(t.options)}})()):g!==`success`||o?await Ht(e,t,i,n,d):Pt(e,i,n))}let{id:i,routeId:a}=e.matches[n],o=!1,s=!1,c=e.router.looseRoutesById[a],l=c.options.loader,u=((typeof l==`function`?void 0:l?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(Nt(e,i)){if(!e.router.getMatch(i))return e.matches[n];Pt(e,i,n)}else{let t=e.router.getMatch(i),o=e.router.stores.matchesId.get()[n],s=(o&&e.router.stores.matchStores.get(o)||null)?.routeId===a?o:e.router.stores.matches.get().find(e=>e.routeId===a)?.id,l=kt(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&u)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&Mt(e,n,a),n.status===`pending`&&await r(l,t,s,n,c)}else{let n=l&&!e.router.stores.matchStores.has(i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=O(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(l,t,s,a,c)}}let d=e.router.getMatch(i);s||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,s||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;let f=s?d.isFetching:!1;return f!==d.isFetching||d.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:f,invalid:!1})),e.router.getMatch(i)):d};async function Wt(e){let t=e,n=[];Ot(t.router)&&Dt(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=zt(t,e);F(n)&&await n}catch(e){if(q(e))throw e;if(K(e))r=e;else if(!t.preload)throw e;break}if(t.serialError||t.firstBadMatchIndex!=null)break}let i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?jt(t,r):void 0,o=r&&t.preload?0:a===void 0?i:Math.min(a+1,i),s,c;for(let e=0;e<o;e++)n.push(Ut(t,n,e));try{await Promise.all(n)}catch{let e=await Promise.allSettled(n);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(q(e))throw e;K(e)?s??=e:c??=e}if(c!==void 0)throw c}let l=s??(r&&!t.preload?r:void 0),u=t.firstBadMatchIndex===void 0?t.matches.length-1:t.firstBadMatchIndex;if(!l&&r&&t.preload)return t.matches;if(l){let e=jt(t,l);e===void 0&&D();let n=t.matches[e],r=t.router.looseRoutesById[n.routeId],i=t.router.options?.defaultNotFoundComponent;!r.options.notFoundComponent&&i&&(r.options.notFoundComponent=i),l.routeId=n.routeId;let a=n.routeId===t.router.routeTree.id;t.updateMatch(n.id,e=>({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:l},isFetching:!1})),u=e,await Kt(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Kt(e,[`errorComponent`])}for(let e=0;e<=u;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=Bt(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let d=Dt(t);if(F(d)&&await d,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function Gt(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function Kt(e,t=Jt){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===Jt?(()=>{if(e._componentsPromise===void 0){let t=Gt(e,Jt);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Gt(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function qt(e){for(let t of Jt)if(e.options[t]?.preload)return!0;return!1}var Jt=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`],Yt=`__TSR_index`,Xt=`popstate`,Zt=`beforeunload`;function Qt(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=nn(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[Yt];i=$t(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[Yt];i=$t(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[Yt]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function $t(e,t){t||={};let n=rn();return{...t,key:n,__TSR_key:n,[Yt]:e}}function en(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>nn(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=rn();t.history.replaceState({[Yt]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=nn(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[Yt]-l.state[Yt],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=Qt({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Zt,S,{capture:!0}),t.removeEventListener(Xt,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Zt,S,{capture:!0}),t.addEventListener(Xt,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function tn(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function nn(e,t){let n=tn(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=rn();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[Yt]:0,key:a,__TSR_key:a}}}function rn(){return(Math.random()+1).toString(36).substring(7)}function an(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var on=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Ze(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=en()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=Ce(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=wt(ln(this.latestLocation),e),ut(this)}let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=qe(o);t&&t!==`/`&&e.push(xt({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:bt(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a)`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=Ie(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&je(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:k(e).path,external:!1,searchStr:o,search:E(t?.search,i),hash:k(r.slice(1)).path,state:I(t?.state,a)}}let o=new URL(i,this.origin),s=St(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:k(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:E(t?.search,c),hash:k(s.hash.slice(1)).path,state:I(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>Xe({base:e,to:Ge(t),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>dn({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.get().forEach(e=>{if(this.stores.pendingMatchStores.has(e))return;let t=this.stores.matchStores.get(e)?.get();t&&(t.status===`pending`||t.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=this.resolvePathWithBase(i,`.`),o=r.search,s=Object.assign(Object.create(null),r.params),c=t.to?this.resolvePathWithBase(a,`${t.to}`):this.resolvePathWithBase(a,`.`),l=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?s:Object.assign(s,j(t.params,s)),u=this.getMatchedRoutes(c),d=u.matchedRoutes;if((!u.foundRoute||u.foundRoute.path!==`/`&&u.routeParams[`**`])&&this.options.notFoundRoute&&(d=[...d,this.options.notFoundRoute]),Object.keys(l).length>0)for(let e of d){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(l,t(l))}catch{}}let f=e.leaveParams?c:k($e({path:c,params:l,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,p=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};d.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,un(t.options.validateSearch,{...e,...p}))}catch{}}),p=e}p=fn({search:p,dest:t,destRoutes:d,_includeValidateSearch:e._includeValidateSearch}),p=E(o,p);let m=this.options.stringifySearch(p),h=t.hash===!0?n.hash:t.hash?j(t.hash,n.hash):void 0,g=h?`#${h}`:``,_=t.state===!0?n.state:t.state?j(t.state,n.state):{};_=I(n.state,_);let v=`${f}${m}${g}`,y,b,x=!1;if(this.rewrite){let e=new URL(v,this.origin),t=Ct(this.rewrite,e);y=e.href.replace(e.origin,``),t.origin===this.origin?b=t.pathname+t.search+t.hash:(b=t.href,x=!0)}else y=te(v),b=y;return{publicHref:b,href:y,pathname:f,search:p,searchStr:m,state:_,hash:h??``,external:x,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=Me(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?Object.create(null):(s??!0)===!0?n:Object.assign(n,j(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=P(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},i=G(this.latestLocation.href)===G(n.href),a=this.commitLocationPromise;if(this.commitLocationPromise=O(()=>{a?.resolve(),a=void 0}),i&&r())this.load();else{let{maskedLocation:r,hashScrollIntoView:i,...a}=n;r&&(a={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...a,search:a.searchStr,state:{...a.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(a.unmaskOnReload??this.options.unmaskOnReload??!1)&&(a.state.__tempKey=this.tempLocationKey)),a.state.__hashScrollIntoViewOptions=i??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,this.history[n.replace?`replace`:`push`](a.publicHref,a.state,{ignoreBlocker:t})}return this.resetNextScroll=n.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=nn(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=St(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(A(t,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation),t=this.stores.cachedMatches.get().filter(t=>!e.some(e=>e.id===t.id));this.batch(()=>{this.stores.status.set(`pending`),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(e),this.stores.setCached(t)})},this.load=async e=>{let t,n,r,i=this.stores.resolvedLocation.get()??this.stores.location.get();for(r=new Promise(a=>{this.startTransition(async()=>{try{this.beforeLoad();let t=this.latestLocation,n=an(t,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:`onBeforeNavigate`,...n}),this.emit({type:`onBeforeLoad`,...n}),await Wt({router:this,sync:e?.sync,forceStaleReload:i.href===t.href,matches:this.stores.pendingMatches.get(),location:t,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=null,t=null,n=null,r=null;this.batch(()=>{let i=this.stores.pendingMatches.get(),a=i.length,o=this.stores.matches.get();e=a?o.filter(e=>!this.stores.pendingMatchStores.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStores.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.matchStores.values())e.routeId&&c.add(e.routeId);t=a?o.filter(e=>!s.has(e.routeId)):null,n=a?i.filter(e=>!c.has(e.routeId)):null,r=a?i.filter(e=>c.has(e.routeId)):o,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),a&&(this.stores.setMatches(i),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,i]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]])if(e)for(let t of e)this.looseRoutesById[t.routeId].options[i]?.(t)})})}})}catch(e){q(e)?(t=e,this.navigate({...t.options,replace:!0,ignoreBlocker:!0})):K(e)&&(n=e);let r=t?t.status:n?404:this.stores.matches.get().some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.set(r),this.stores.redirect.set(t)})}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),a()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.stores.matches.get().some(e=>e.status===`error`)&&(a=500),a!==void 0&&this.stores.statusCode.set(a)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(an(r,i)):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.stores.pendingMatchStores.get(e);if(n){n.set(t);return}let r=this.stores.matchStores.get(e);if(r){r.set(t);return}let i=this.stores.cachedMatchStores.get(e);if(i){let n=t(i.get());n.status===`redirected`?this.stores.cachedMatchStores.delete(e)&&this.stores.cachedIds.set(t=>t.filter(t=>t!==e)):i.set(n)}})},this.getMatch=e=>this.stores.cachedMatchStores.get(e)?.get()??this.stores.pendingMatchStores.get(e)?.get()??this.stores.matchStores.get(e)?.get(),this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(t)),this.stores.setCached(this.stores.cachedMatches.get().map(t)),this.stores.setPending(this.stores.pendingMatches.get().map(t))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&A(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.stores.setCached([]):this.stores.setCached(this.stores.cachedMatches.get().filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{let n=this.looseRoutesById[t.routeId];if(!n.options.loader)return!0;let r=(t.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return t.status===`error`?!0:e-t.updatedAt>=r}})},this.loadRouteChunk=Kt,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),i=new Set([...r,...this.stores.cachedIds.get()]),a=n.filter(e=>!i.has(e.id));if(a.length){let e=this.stores.cachedMatches.get();this.stores.setCached([...e,...a])}try{return n=await Wt({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(q(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});K(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.stores.status.get()!==`pending`)return!1;let i=(t?.pending===void 0?!this.stores.isLoading.get():t.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=Ne(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!P(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?P(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??ht,parseSearch:e.parseSearch??mt,protocolAllowlist:e.protocolAllowlist??ee}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i,parsedParams:a}=n,{matchedRoutes:o}=n,s=!1;(r?r.path!==`/`&&i[`**`]:G(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:s=!0);let c=s?mn(this.options.notFoundMode,o):void 0,l=Array(o.length),u=new Map;for(let e of this.stores.matchStores.values())e.routeId&&u.set(e.routeId,e.get());for(let n=0;n<o.length;n++){let r=o[n],s=l[n-1],d,f,p;{let n=s?.search??e.search,i=s?._strictSearch??void 0;try{let e=un(r.options.validateSearch,{...n})??void 0;d={...n,...e},f={...i,...e},p=void 0}catch(e){let r=e;if(e instanceof sn||(r=new sn(e.message,{cause:e})),t?.throwOnError)throw r;d=n,f={},p=r}}let m=r.options.loaderDeps?.({search:d})??``,h=m?JSON.stringify(m):``,{interpolatedPath:g,usedParams:_}=$e({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),v=r.id+g+h,y=this.getMatch(v),b=u.get(r.id),x=y?._strictParams??_,S;if(!y)try{hn(r,_,a,x)}catch(e){if(S=K(e)||q(e)?e:new cn(e.message,{cause:e}),t?.throwOnError)throw S}Object.assign(i,x);let C=b?`stay`:`enter`,w;if(y)w={...y,cause:C,params:b?.params??i,_strictParams:x,search:E(b?b.search:y.search,d),_strictSearch:f};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||qt(r)?`pending`:`success`;w={id:v,ssr:r.options.ssr,index:n,routeId:r.id,params:b?.params??i,_strictParams:x,pathname:g,updatedAt:Date.now(),search:b?E(b.search,d):d,_strictSearch:f,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:S,__routeContext:void 0,_nonReactive:{loadPromise:O()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:C,loaderDeps:b?I(b.loaderDeps,m):m,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t?.preload||(w.globalNotFound=c===r.id),w.searchError=p;let T=this.getParentContext(s);w.context={...T,...w.__routeContext,...w.__beforeLoadContext},l[n]=w}for(let t=0;t<l.length;t++){let n=l[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=u.get(n.routeId);if(n.params=o?E(o.params,i):i,!a){let i=l[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:l,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return l}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=se(t),a={...e.search};for(let e of t)try{Object.assign(a,un(e.options.validateSearch,a))}catch{}let o=se(this.stores.matchesId.get()),s=o&&this.stores.matchStores.get(o)?.get(),c=s&&s.routeId===i.id&&s.pathname===e.pathname,l;if(c)l=s.params;else{let e=Object.assign(Object.create(null),n);for(let i of t)try{hn(i,n,r??{},e)}catch{}l=e}return{matchedRoutes:t,fullPath:i.fullPath,search:a,params:l}}},sn=class extends Error{},cn=class extends Error{};function ln(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function un(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new sn(`Async validation not supported`);if(n.issues)throw new sn(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function dn({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=G(e),a,o,s=Pe(i,n,!0);return s&&(a=s.route,Object.assign(r,s.rawParams),o=Object.assign(Object.create(null),s.parsedParams)),{matchedRoutes:s?.branch||[t.__root__],routeParams:r,foundRoute:a,parsedParams:o}}function fn({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return pn(n)(e,t,r??!1)}function pn(e){let t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(let n of e)`search`in n.options?n.options.search?.middlewares&&t.middlewares.push(...n.options.search.middlewares):(n.options.preSearchFilters||n.options.postSearchFilters)&&t.middlewares.push(({search:e,next:t})=>{let r=e;`preSearchFilters`in n.options&&n.options.preSearchFilters&&(r=n.options.preSearchFilters.reduce((e,t)=>t(e),e));let i=t(r);return`postSearchFilters`in n.options&&n.options.postSearchFilters?n.options.postSearchFilters.reduce((e,t)=>t(e),i):i}),n.options.validateSearch&&t.middlewares.push(({search:e,next:r})=>{let i=r(e);if(!t._includeValidateSearch)return i;try{return{...i,...un(n.options.validateSearch,i)??void 0}}catch{return i}});t.middlewares.push(({search:e})=>{let n=t.dest;return n.search?n.search===!0?e:j(n.search,e):{}});let n=(e,t,r)=>{if(e>=r.length)return t;let i=r[e];return i({search:t,next:t=>n(e+1,t,r)})};return function(e,r,i){return t.dest=r,t._includeValidateSearch=i,n(0,e,t.middlewares)}}function mn(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return vt}function hn(e,t,n,r){let i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(let e in t)e in n&&(r[e]=n[e]);else{let e=i(r);Object.assign(r,e)}}var gn=`Error preloading route! ☝️`,_n=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=vt:this.parentRoute||D();let r=n?vt:t?.path;r&&r!==`/`&&(r=Ke(r));let i=t?.id||r,a=n?vt:We([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=We([`/`,a]));let o=a===`__root__`?`/`:We([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=G(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>yt({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},vn=class extends _n{constructor(e){super(e)}};function yn(e){if(typeof document<`u`&&document.querySelector){let t=e.stores.location.get(),n=t.state.__hashScrollIntoViewOptions??!0;if(n&&t.hash!==``){let e=document.getElementById(t.hash);e&&e.scrollIntoView(n)}}}var J=e(l(),1),Y=t();function bn(e){let t=e.errorComponent??Sn;return(0,Y.jsx)(xn,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?J.createElement(t,{error:n,reset:r}):e.children})}var xn=class extends J.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function Sn({error:e}){let[t,n]=J.useState(!1);return(0,Y.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,Y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,Y.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,Y.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,Y.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,Y.jsx)(`div`,{children:(0,Y.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,Y.jsx)(`code`,{children:e.message}):null})}):null]})}function Cn({children:e,fallback:t=null}){return wn()?(0,Y.jsx)(J.Fragment,{children:e}):(0,Y.jsx)(J.Fragment,{children:t})}function wn(){return J.useSyncExternalStore(Tn,()=>!0,()=>!1)}function Tn(){return()=>{}}var X=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(X||{});function En({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function Dn(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var On=[],kn=0,{link:An,unlink:jn,propagate:Mn,checkDirty:Nn,shallowPropagate:Pn}=En({update(e){return e._update()},notify(e){On[In++]=e,e.flags&=~X.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=X.Mutable|X.Dirty,zn(e))}}),Fn=0,In=0,Z,Ln=0;function Rn(e){try{++Ln,e()}finally{--Ln||Bn()}}function zn(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=jn(n,e)}function Bn(){if(!(Ln>0)){for(;Fn<In;){let e=On[Fn];On[Fn++]=void 0,e.notify()}Fn=0,In=0}}function Vn(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?X.None:X.Mutable,get(){return Z!==void 0&&An(i,Z,kn),i._snapshot},subscribe(e){let t=Dn(e),n={current:!1},r=Hn(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Z,o=t?.compare??Object.is;if(n)Z=i,++kn,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=X.Mutable|X.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{Z=a,n&&(i.flags&=~X.RecursedCheck),zn(i)}}};return n?(i.flags=X.Mutable|X.Dirty,i.get=function(){let e=i.flags;if(e&X.Dirty||e&X.Pending&&Nn(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&Pn(e)}}else e&X.Pending&&(i.flags=e&~X.Pending);return Z!==void 0&&An(i,Z,kn),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(Mn(e),Pn(e),Bn())}},i}function Hn(e){let t=()=>{let t=Z;Z=n,++kn,n.depsTail=void 0,n.flags=X.Watching|X.RecursedCheck;try{return e()}finally{Z=t,n.flags&=~X.RecursedCheck,zn(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:X.Watching|X.RecursedCheck,notify(){let e=this.flags;e&X.Dirty||e&X.Pending&&Nn(this.deps,this)?t():this.flags=X.Watching},stop(){this.flags=X.None,this.depsTail=void 0,zn(this)}};return t(),n}function Un(e){return re({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Wn(e){let{select:t,...n}=e;return re({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function Gn(e){return re({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Kn(e){return re({...e,select:t=>e.select?e.select(t.context):t.context})}var qn=_();function Jn(e,t){let n=N(),r=x(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:l,preloadIntentProximity:u,hashScrollIntoView:d,replace:f,startTransition:p,resetScroll:m,viewTransition:h,children:g,target:_,disabled:v,style:y,className:b,onClick:C,onBlur:w,onFocus:T,onMouseEnter:E,onMouseLeave:D,onTouchStart:O,ignoreBlocker:k,params:ee,search:te,hash:ne,state:re,mask:ie,reloadDocument:ae,unsafeRelative:oe,from:F,_fromLocation:I,...se}=e,ce=wn(),le=J.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),L=M(n.stores.location,e=>e,(e,t)=>e.href===t.href),R=J.useMemo(()=>{let e={_fromLocation:L,...le};return n.buildLocation(e)},[n,L,le]),ue=R.maskedLocation?R.maskedLocation.publicHref:R.publicHref,de=R.maskedLocation?R.maskedLocation.external:R.external,z=J.useMemo(()=>rr(ue,de,n.history,v),[v,de,ue,n.history]),B=J.useMemo(()=>{if(z?.external)return A(z.href,n.protocolAllowlist)?void 0:z.href;if(!ir(s)&&!(typeof s!=`string`||s.indexOf(`:`)===-1))try{return new URL(s),A(s,n.protocolAllowlist)?void 0:s}catch{}},[s,z,n.protocolAllowlist]),fe=J.useMemo(()=>{if(B)return!1;if(o?.exact){if(!Ye(L.pathname,R.pathname,n.basepath))return!1}else{let e=Je(L.pathname,n.basepath),t=Je(R.pathname,n.basepath);if(!(e.startsWith(t)&&(e.length===t.length||e[t.length]===`/`)))return!1}return(o?.includeSearch??!0)&&!P(L.search,R.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?ce&&L.hash===R.hash:!0},[o?.exact,o?.explicitUndefined,o?.includeHash,o?.includeSearch,L,B,ce,R.hash,R.pathname,R.search,n.basepath]),pe=fe?j(i,{})??Xn:Yn,me=fe?Yn:j(a,{})??Yn,he=[b,pe.className,me.className].filter(Boolean).join(` `),ge=(y||pe.style||me.style)&&{...y,...pe.style,...me.style},[_e,ve]=J.useState(!1),V=J.useRef(!1),ye=e.reloadDocument||B?!1:c??n.options.defaultPreload,be=l??n.options.defaultPreloadDelay??0,H=J.useCallback(()=>{n.preloadRoute({...le,_builtLocation:R}).catch(e=>{console.warn(e),console.warn(gn)})},[n,le,R]);S(r,J.useCallback(e=>{e?.isIntersecting&&H()},[H]),tr,{disabled:!!v||ye!==`viewport`}),J.useEffect(()=>{V.current||!v&&ye===`render`&&(H(),V.current=!0)},[v,H,ye]);let xe=e=>{let t=e.currentTarget.getAttribute(`target`),r=_===void 0?t:_;if(!v&&!or(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,qn.flushSync)(()=>{ve(!0)});let t=n.subscribe(`onResolved`,()=>{t(),ve(!1)});n.navigate({...le,replace:f,resetScroll:m,hashScrollIntoView:d,startTransition:p,viewTransition:h,ignoreBlocker:k})}};if(B)return{...se,ref:r,href:B,...g&&{children:g},..._&&{target:_},...v&&{disabled:v},...y&&{style:y},...b&&{className:b},...C&&{onClick:C},...w&&{onBlur:w},...T&&{onFocus:T},...E&&{onMouseEnter:E},...D&&{onMouseLeave:D},...O&&{onTouchStart:O}};let Se=e=>{if(v||ye!==`intent`)return;if(!be){H();return}let t=e.currentTarget;if(er.has(t))return;let n=setTimeout(()=>{er.delete(t),H()},be);er.set(t,n)},Ce=e=>{v||ye!==`intent`||H()},U=e=>{if(v||!ye||!be)return;let t=e.currentTarget,n=er.get(t);n&&(clearTimeout(n),er.delete(t))};return{...se,...pe,...me,href:z?.href,ref:r,onClick:nr([C,xe]),onBlur:nr([w,U]),onFocus:nr([T,Se]),onMouseEnter:nr([E,Se]),onMouseLeave:nr([D,U]),onTouchStart:nr([O,Ce]),disabled:!!v,target:_,...ge&&{style:ge},...he&&{className:he},...v&&Zn,...fe&&Qn,...ce&&_e&&$n}}var Yn={},Xn={className:`active`},Zn={role:`link`,"aria-disabled":!0},Qn={"data-status":`active`,"aria-current":`page`},$n={"data-transitioning":`transitioning`},er=new WeakMap,tr={rootMargin:`100px`},nr=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function rr(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function ir(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var ar=J.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=Jn(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return J.createElement(`a`,t,o)}return J.createElement(n,a,o)});function or(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var sr=class extends _n{constructor(e){super(e),this.useMatch=e=>re({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Kn({...e,from:this.id}),this.useSearch=e=>Gn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>ne({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Wn({...e,from:this.id}),this.useLoaderData=e=>Un({...e,from:this.id}),this.useNavigate=()=>C({from:this.fullPath}),this.Link=J.forwardRef((e,t)=>(0,Y.jsx)(ar,{ref:t,from:this.fullPath,...e}))}};function Q(e){return new sr(e)}var cr=class extends vn{constructor(e){super(e),this.useMatch=e=>re({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Kn({...e,from:this.id}),this.useSearch=e=>Gn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>ne({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Wn({...e,from:this.id}),this.useLoaderData=e=>Un({...e,from:this.id}),this.useNavigate=()=>C({from:this.fullPath}),this.Link=J.forwardRef((e,t)=>(0,Y.jsx)(ar,{ref:t,from:this.fullPath,...e}))}};function lr(e){return new cr(e)}function ur(e){let t=N(),n=`not-found-${M(t.stores.location,e=>e.pathname)}-${M(t.stores.status,e=>e)}`;return(0,Y.jsx)(bn,{getResetKey:()=>n,onCatch:(t,n)=>{if(K(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(K(t))return e.fallback?.(t);throw t},children:e.children})}function dr(){return(0,Y.jsx)(`p`,{children:`Not Found`})}function fr(e){return(0,Y.jsx)(Y.Fragment,{children:e.children})}function pr(e,t,n){return t.options.notFoundComponent?(0,Y.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,Y.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,Y.jsx)(dr,{})}var mr=J.memo(function({matchId:e}){let t=N(),n=t.stores.matchStores.get(e);n||D();let r=M(t.stores.loadedAt,e=>e),i=M(n,e=>e);return(0,Y.jsx)(hr,{router:t,matchId:e,resetKey:r,matchState:J.useMemo(()=>{let e=i.routeId,n=t.routesById[e].parentRoute?.id;return{routeId:e,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:n}},[i._displayPending,i.routeId,i.ssr,t.routesById])})});function hr({router:e,matchId:t,resetKey:n,matchState:r}){let i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,o=a?(0,Y.jsx)(a,{}):null,s=i.options.errorComponent??e.options.defaultErrorComponent,c=i.options.onCatch??e.options.defaultOnCatch,l=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,u=r.ssr===!1||r.ssr===`data-only`,d=(!i.isRoot||i.options.wrapInSuspense||u)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||u))?J.Suspense:fr,f=s?bn:fr,p=l?ur:fr;return(0,Y.jsxs)(i.isRoot?i.options.shellComponent??fr:fr,{children:[(0,Y.jsx)(T.Provider,{value:t,children:(0,Y.jsx)(d,{fallback:o,children:(0,Y.jsx)(f,{getResetKey:()=>n,errorComponent:s||Sn,onCatch:(e,t)=>{if(K(e))throw e.routeId??=r.routeId,e;c?.(e,t)},children:(0,Y.jsx)(p,{fallback:e=>{if(e.routeId??=r.routeId,!l||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!i.isRoot)throw e;return J.createElement(l,e)},children:u||r._displayPending?(0,Y.jsx)(Cn,{fallback:o,children:(0,Y.jsx)(_r,{matchId:t})}):(0,Y.jsx)(_r,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(gr,{resetKey:n}),(e.options.scrollRestoration,null)]}):null]})}function gr({resetKey:e}){let t=N(),n=J.useRef(void 0);return b(()=>{let e=t.latestLocation.href;(n.current===void 0||n.current!==e)&&(t.emit({type:`onRendered`,...an(t.stores.location.get(),t.stores.resolvedLocation.get())}),n.current=e)},[t.latestLocation.state.__TSR_key,e,t]),null}var _r=J.memo(function({matchId:e}){let t=N(),n=(e,n)=>t.getMatch(e.id)?._nonReactive[n]??e._nonReactive[n],r=t.stores.matchStores.get(e);r||D();let i=M(r,e=>e),a=i.routeId,o=t.routesById[a],s=J.useMemo(()=>{let e=(t.routesById[a].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:a,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return e?JSON.stringify(e):void 0},[a,i.loaderDeps,i._strictParams,i._strictSearch,t.options.defaultRemountDeps,t.routesById]),c=J.useMemo(()=>{let e=o.options.component??t.options.defaultComponent;return e?(0,Y.jsx)(e,{},s):(0,Y.jsx)(vr,{})},[s,o.options.component,t.options.defaultComponent]);if(i._displayPending)throw n(i,`displayPendingPromise`);if(i._forcePending)throw n(i,`minPendingPromise`);if(i.status===`pending`){let e=o.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let n=t.getMatch(i.id);if(n&&!n._nonReactive.minPendingPromise){let t=O();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw n(i,`loadPromise`)}if(i.status===`notFound`)return K(i.error)||D(),pr(t,o,i.error);if(i.status===`redirected`)throw q(i.error)||D(),n(i,`loadPromise`);if(i.status===`error`)throw i.error;return c}),vr=J.memo(function(){let e=N(),t=J.useContext(T),n,r=!1,i;{let a=t?e.stores.matchStores.get(t):void 0;[n,r]=M(a,e=>[e?.routeId,e?.globalNotFound??!1]),i=M(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let a=n?e.routesById[n]:void 0,o=e.options.defaultPendingComponent?(0,Y.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return a||D(),pr(e,a,void 0);if(!i)return null;let s=(0,Y.jsx)(mr,{matchId:i});return n===`__root__`?(0,Y.jsx)(J.Suspense,{fallback:o,children:s}):s});function yr(){let e=N(),t=J.useRef({router:e,mounted:!1}),[n,r]=J.useState(!1),i=M(e.stores.isLoading,e=>e),a=M(e.stores.hasPending,e=>e),o=y(i),s=i||n||a,c=y(s),l=i||a,u=y(l);return e.startTransition=e=>{r(!0),J.startTransition(()=>{e(),r(!1)})},J.useEffect(()=>{let t=e.history.subscribe(e.load),n=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return G(e.latestLocation.publicHref)!==G(n.publicHref)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),b(()=>{typeof window<`u`&&e.ssr||t.current.router===e&&t.current.mounted||(t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(e){console.error(e)}})())},[e]),b(()=>{o&&!i&&e.emit({type:`onLoad`,...an(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,i]),b(()=>{u&&!l&&e.emit({type:`onBeforeRouteMount`,...an(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,u,e]),b(()=>{if(c&&!s){let t=an(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:`onResolved`,...t}),Rn(()=>{e.stores.status.set(`idle`),e.stores.resolvedLocation.set(e.stores.location.get())}),t.hrefChanged&&yn(e)}},[s,c,e]),null}function br(){let e=N(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,Y.jsx)(t,{}):null,r=(0,Y.jsxs)(typeof document<`u`&&e.ssr?fr:J.Suspense,{fallback:n,children:[(0,Y.jsx)(yr,{}),(0,Y.jsx)(xr,{})]});return e.options.InnerWrap?(0,Y.jsx)(e.options.InnerWrap,{children:r}):r}function xr(){let e=N(),t=M(e.stores.firstId,e=>e),n=M(e.stores.loadedAt,e=>e),r=t?(0,Y.jsx)(mr,{matchId:t}):null;return(0,Y.jsx)(T.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,Y.jsx)(bn,{getResetKey:()=>n,errorComponent:Sn,onCatch:void 0,children:r})})}var Sr=e=>({createMutableStore:Vn,createReadonlyStore:Vn,batch:Rn}),Cr=e=>new wr(e),wr=class extends on{constructor(e){super(e,Sr)}};function Tr({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,Y.jsx)(ie.Provider,{value:e,children:t});return e.options.Wrap?(0,Y.jsx)(e.options.Wrap,{children:r}):r}function Er({router:e,...t}){return(0,Y.jsx)(Tr,{router:e,...t,children:(0,Y.jsx)(br,{})})}function Dr(e){let t=N({warn:e?.router===void 0}),n=e?.router||t,r=(0,J.useRef)(void 0);return M(n.stores.__store,t=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){let n=I(r.current,e.select(t));return r.current=n,n}return e.select(t)}return t})}var Or=class extends ce{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),le(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&fe(t.mutationKey)!==fe(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??_e();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){B.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function kr(e,t){let n=de(t),[r]=J.useState(()=>new Or(n,e));J.useEffect(()=>{r.setOptions(e)},[r,e]);let i=J.useSyncExternalStore(J.useCallback(e=>r.subscribe(B.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=J.useCallback((e,t)=>{r.mutate(e,t).catch(R)},[r]);if(i.error&&L(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Ar=v();function jr(e){let{apiKey:t,userId:n,businessId:r,environment:i}=e;return{queryKey:[`bootstrap`,i,t,n,r],enabled:!!(t&&n&&r),queryFn:async()=>{let e=await fetch(`/api/proxy/auth/bootstrap`,{headers:{"x-proxy-target":be[i],"X-API-KEY":t,"X-USER-ID":n,"X-BUSINESS-ID":r}});if(!e.ok)throw Error(`Bootstrap failed: ${String(e.status)} ${e.statusText}`);return e.json()},retry:!1}}function Mr(e){let{apiKey:t,userId:n,businessId:r,environment:i}=e;return{queryKey:[`businessPluginApps`,i,t,n,r],enabled:!!(t&&n&&r),queryFn:async()=>{let e=await fetch(`/api/proxy/external-integrations/business-plugin-apps`,{headers:{"x-proxy-target":be[i],"X-API-KEY":t,"X-USER-ID":n,"X-BUSINESS-ID":r}});if(!e.ok)throw Error(`businessPluginApps failed: ${String(e.status)} ${e.statusText}`);return e.json()},retry:!1}}var Nr=2e3,Pr=1e3,Fr=1e3,Ir=1e4,Lr=500;function Rr(){let e=de(),[t,n]=(0,J.useState)([]),[r,i]=(0,J.useState)([]),[a,o]=(0,J.useState)([]),[s,c]=(0,J.useState)(null),[l,u]=(0,J.useState)({status:`idle`,visible:!1,logs:[],error:null}),d=(0,J.useRef)(null),f=(0,J.useRef)(null),p=(0,J.useCallback)(()=>{d.current!==null&&(clearTimeout(d.current),d.current=null),f.current!==null&&(clearTimeout(f.current),f.current=null)},[]),m=(0,J.useCallback)(()=>{p(),u({status:`idle`,visible:!1,logs:[],error:null})},[p]);return(0,J.useEffect)(()=>{let t=null,r=null,a=Fr,s=!1,l=t=>{let r;try{r=JSON.parse(t.data)}catch{return}if(r.type===`rebuild`)e.invalidateQueries({queryKey:[`bundle`]}),e.invalidateQueries({queryKey:[`source-tree`]}),e.invalidateQueries({queryKey:[`source-file`]});else if(r.type===`log`)n(e=>[...e,r.message].slice(-Lr));else if(r.type===`proxy-log`){let e=r.entry??{kind:`info`,message:r.message??``};i(t=>[...t,e].slice(-Lr))}else if(r.type===`console-message`){let e=[`log`,`warn`,`error`,`info`].includes(r.level)?r.level:`log`;o(t=>[...t,{level:e,args:r.args}].slice(-Lr))}else r.type===`venv-install-start`?(p(),u({status:`installing`,visible:!1,logs:[],error:null}),d.current=setTimeout(()=>{d.current=null,u(e=>e.status===`installing`?{...e,visible:!0}:e)},Nr)):r.type===`venv-install-log`?u(e=>({...e,logs:[...e.logs,{line:r.line,stream:r.stream}].slice(-Lr)})):r.type===`venv-install-complete`?(d.current!==null&&(clearTimeout(d.current),d.current=null),u(e=>e.visible?{...e,status:`complete`}:{status:`idle`,visible:!1,logs:[],error:null}),f.current=setTimeout(()=>{f.current=null,u({status:`idle`,visible:!1,logs:[],error:null})},Pr)):r.type===`venv-install-error`?(d.current!==null&&(clearTimeout(d.current),d.current=null),u(e=>({status:`error`,visible:!0,logs:e.logs,error:r.message}))):c(r.credentials)},m=()=>{if(s||r!==null)return;let e=a;a=Math.min(a*2,Ir),r=setTimeout(()=>{r=null,h()},e)},h=()=>{if(s)return;let e=window.location.protocol===`https:`?`wss:`:`ws:`,n=new WebSocket(`${e}//${window.location.host}`);t=n,n.addEventListener(`open`,()=>{a=Fr}),n.addEventListener(`message`,l),n.addEventListener(`close`,()=>{t===n&&(t=null),m()}),n.addEventListener(`error`,()=>{n.close()})},g=()=>{s||t!==null&&t.readyState===WebSocket.OPEN||(a=Fr,r!==null&&(clearTimeout(r),r=null),!(t!==null&&t.readyState===WebSocket.CONNECTING)&&h())},_=()=>{document.visibilityState===`visible`&&g()};return window.addEventListener(`online`,g),document.addEventListener(`visibilitychange`,_),h(),()=>{s=!0,r!==null&&(clearTimeout(r),r=null),p(),window.removeEventListener(`online`,g),document.removeEventListener(`visibilitychange`,_),t?.close(),t=null}},[e,p]),{buildLogs:t,proxyLogs:r,consoleLogs:a,clearConsoleLogs:()=>{o([])},serverCredentials:s,venvInstall:l,dismissVenvInstall:m}}var zr=({state:e,onDismiss:t})=>{let n=(0,J.useRef)(null);(0,J.useEffect)(()=>{let e=n.current;e&&(e.scrollTop=e.scrollHeight)},[e.logs]);let r=e.status===`complete`?`Environment ready`:e.status===`error`?`Install failed`:`Setting up Python environment`,i=e.status===`complete`?`Done — running your step now.`:e.status===`error`?`pip install did not complete successfully. See log for details.`:`Installing pip packages for local execution. This only happens once per project.`,a=e.status===`complete`?`green`:e.status===`error`?`red`:`blue-pulse`;return(0,Y.jsx)(me,{open:e.visible,size:`xl`,ariaModal:!0,onBackdropClick:e.status===`error`?t:void 0,header:(0,Y.jsx)(pe,{title:r,statusDot:a}),footer:e.status===`error`?(0,Y.jsx)(`button`,{onClick:t,className:`rounded bg-neutral-900 px-3 py-1.5 text-[12px] text-white transition-colors hover:bg-neutral-700`,children:`Close`}):void 0,children:(0,Y.jsxs)(`div`,{className:`px-5 py-4`,children:[(0,Y.jsx)(`p`,{className:`m-0 mb-3 text-[12px] text-neutral-600`,children:i}),(0,Y.jsx)(`div`,{ref:n,className:`max-h-72 overflow-y-auto rounded border border-black/10 bg-neutral-950 px-3 py-2 text-[11px] leading-relaxed text-neutral-100`,children:e.logs.length===0?(0,Y.jsx)(`span`,{className:`text-neutral-500`,children:`Waiting for pip output…`}):e.logs.map((e,t)=>(0,Y.jsx)(`div`,{className:e.stream===`stderr`?`text-amber-300`:`text-neutral-100`,children:e.line||`\xA0`},t))}),e.status===`error`&&e.error&&(0,Y.jsx)(`p`,{className:`mt-3 whitespace-pre-wrap break-words text-[12px] text-red-600`,children:e.error})]})})},Br=({bundle:e,currentApiName:t})=>{let n=C(),r=(0,J.useRef)(null),[i,a]=(0,J.useState)(!1);(0,J.useEffect)(()=>{if(!i)return;let e=e=>{let t=r.current;t&&e.target instanceof Node&&t.contains(e.target)||a(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[i]);let o=t?e.find(e=>e.api_name===t):void 0,s=o?o.name:`Select app…`;return e.length<=1?(0,Y.jsx)(`span`,{className:`max-w-[220px] truncate px-1 text-[12px] font-medium text-neutral-700`,children:e[0]?.name??s}):(0,Y.jsxs)(`div`,{ref:r,className:`relative`,children:[(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>{a(e=>!e)},className:`flex items-center gap-1.5 rounded-full border border-black/10 bg-white px-3 py-1 text-[12px] font-medium text-neutral-700 hover:border-black/20 hover:text-neutral-900`,"aria-haspopup":`listbox`,"aria-expanded":i,children:[(0,Y.jsx)(`span`,{className:`max-w-[220px] truncate`,children:s}),(0,Y.jsx)(u,{icon:p,className:`text-[10px] text-neutral-400`})]}),(0,Y.jsx)(ge,{anchorRef:r,open:i,children:(0,Y.jsx)(`ul`,{role:`listbox`,className:`py-1`,children:e.map(e=>{let r=e.api_name,i=r===t;return(0,Y.jsx)(`li`,{role:`option`,"aria-selected":i,className:`cursor-pointer truncate px-3 py-2 text-[12px] hover:bg-neutral-100 ${i?`bg-neutral-100 font-semibold text-neutral-900`:`text-neutral-700`}`,onClick:()=>{n({to:`/$apiName/summary`,params:{apiName:r}}),a(!1)},children:e.name},r)})})})]})},Vr=[{id:`summary`,label:`Summary`,icon:f,order:0},{id:`sandbox`,label:`Sandbox`,icon:o,order:1},{id:`configuration`,label:`Configuration`,icon:c,order:2},{id:`source`,label:`App Source`,icon:a,order:4}],Hr={id:`code-steps`,label:`Code Steps`,icon:i,order:3},Ur=[{id:`versions`,label:`Version History`,icon:d,order:5},{id:`icons`,label:`Icon Reference`,icon:s,order:6}],Wr=({currentApiName:e,currentSubPage:t,hasCodeSteps:n})=>{let r=C(),i=[...Vr,...n?[Hr]:[],...Ur].sort((e,t)=>e.order-t.order),a=t?.split(`/`)[0];return(0,Y.jsx)(`div`,{className:`sticky top-0 z-[9] flex items-center gap-1 overflow-x-auto border-b border-black/10 bg-white/85 px-3 backdrop-blur-sm lg:px-5`,children:i.map(t=>{let n=t.id===a;return(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>{r({to:`/${e}/${t.id}`})},className:`flex shrink-0 items-center gap-1.5 border-b-2 px-3 py-2 text-[12px] font-medium transition-colors ${n?`text-neutral-900 border-neutral-900`:`text-neutral-500 hover:text-neutral-800 border-transparent`}`,"aria-current":n?`page`:void 0,children:[(0,Y.jsx)(u,{icon:t.icon,className:`text-[11px]`}),(0,Y.jsx)(`span`,{className:`hidden lg:inline`,children:t.label})]},t.id)})})},Gr=class extends J.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(`ErrorBoundary caught:`,e,t.componentStack)}render(){if(this.state.error!==null){let{fallback:e}=this.props;return typeof e==`function`?e(this.state.error):e}return this.props.children}},Kr=`modulepreload`,qr=function(e){return`/`+e},Jr={},Yr=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=qr(t,n),t in Jr)return;Jr[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:Kr,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Xr=(0,J.lazy)(()=>Yr(()=>import(`./DevSidebar-DS8UU-G8.js`).then(e=>({default:e.DevSidebar})),__vite__mapDeps([0,1,2,3,4,5]))),Zr=window.open.bind(window),Qr=416,$r=280,ei=800,ti={apiKey:``,userId:``,businessId:``,environment:`go`},ni=class extends Error{constructor(){super(`Plugin app with this API name does not exist.`),this.name=`PluginNotPublishedError`}},ri=e=>{if(typeof e!=`object`||!e)return!1;let t=e.plugin_app_api_name;return Array.isArray(t)?t.some(e=>typeof e==`string`&&e.includes(`does not exist`)):!1},ii=()=>{let{buildLogs:e,proxyLogs:t,consoleLogs:i,clearConsoleLogs:a,serverCredentials:o,venvInstall:s,dismissVenvInstall:c}=Rr(),[l,d]=(0,J.useState)(()=>localStorage.getItem(V.sidebarOpen)===`true`),[f,p]=(0,J.useState)(()=>localStorage.getItem(V.scriptRunnerLogging)===`true`),[_,v]=(0,J.useState)(!1),[y,b]=(0,J.useState)(()=>{let e=parseInt(localStorage.getItem(V.sidebarWidth)??``,10);return isNaN(e)?Qr:Math.min(ei,Math.max($r,e))}),x=()=>{d(e=>{let t=!e;return localStorage.setItem(V.sidebarOpen,String(t)),t})},S=()=>{p(e=>{let t=!e;return localStorage.setItem(V.scriptRunnerLogging,String(t)),t})},C=(0,J.useCallback)(e=>{b(e),localStorage.setItem(V.sidebarWidth,String(e))},[]),[w,T]=(0,J.useState)(()=>{try{return{...ti,...JSON.parse(localStorage.getItem(V.credentials)??`{}`)}}catch{return ti}});(0,J.useEffect)(()=>{fetch(`/api/credentials`).then(e=>e.json()).then(e=>{if(e.apiKey){let t={...ti,...e};T(t),localStorage.setItem(V.credentials,JSON.stringify(t))}}).catch(()=>{})},[]),(0,J.useEffect)(()=>{if(!o)return;let e={...ti,...o};T(e),localStorage.setItem(V.credentials,JSON.stringify(e))},[o]);let E=e=>{T(e),localStorage.setItem(V.credentials,JSON.stringify(e))},{data:D,isLoading:O,isError:k}=z(ae),{data:A,isError:j,isLoading:M}=z(jr(w)),{data:ee}=z(Mr(w)),te=de(),ne=kr({mutationFn:async({apiName:e,hasExistingEntry:t,nextDisabled:n})=>{let r={"x-proxy-target":be[w.environment],"X-API-KEY":w.apiKey,"X-USER-ID":w.userId,"X-BUSINESS-ID":w.businessId,"Content-Type":`application/json`},i=t?await fetch(`/api/proxy/external-integrations/business-plugin-apps/${e}`,{method:`PATCH`,headers:r,body:JSON.stringify({disabled:n})}):await fetch(`/api/proxy/external-integrations/business-plugin-apps`,{method:`POST`,headers:r,body:JSON.stringify({plugin_app_api_name:e,disabled:!1,config:{}})});if(!i.ok){let e=n?`uninstall`:`install`;if(i.status===400&&e===`install`){let t=await i.json().catch(()=>null);throw ri(t)?new ni:Error(`${e} failed: ${String(i.status)} ${i.statusText} ${JSON.stringify(t)}`)}let t=await i.text().catch(()=>``);throw Error(`${e} failed: ${String(i.status)} ${i.statusText} ${t}`)}},onError:e=>{e instanceof ni&&v(!0)},onSuccess:async()=>{await fetch(`/api/proxy-cache/clear`).catch(()=>{}),await Promise.all([te.invalidateQueries({queryKey:[`bootstrap`]}),te.invalidateQueries({queryKey:[`businessPluginApps`]})])}}),{location:N}=Dr(),P=/^\/([^/]+)\/.+/.exec(N.pathname)?.[1],re=/^\/[^/]+\/([^/]+)/.exec(N.pathname)?.[1];(0,J.useEffect)(()=>{N.pathname!==`/`&&fetch(`/api/last-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:N.pathname})})},[N.pathname]);let ie=((P?D?.find(e=>e.api_name===P):void 0)?.artifacts.automation_action_configs.length??0)>0,oe=!!P&&!!D?.some(e=>e.api_name===P),F=P?ee?.find(e=>e.plugin_app.api_name===P):void 0,I=!!F&&!F.disabled,se=!!A&&!!ee&&oe,ce=ne.isPending?I?`uninstalling…`:`installing…`:I?`Uninstall Plugin`:`Install Plugin`,le=ne.isPending?`cursor-wait opacity-50`:``,L=O?`loading`:k?`error`:D?`loaded`:`empty`,R=M?`authenticating`:j?`auth error`:A?`authenticated`:`no auth`,ue=O?`bg-neutral-100 text-neutral-400`:k?`bg-red-100 text-red-700`:D?`bg-green-100 text-green-700`:`bg-yellow-100 text-yellow-700`,B=M?`bg-neutral-100 text-neutral-400`:j?`bg-red-100 text-red-700`:A?`bg-green-100 text-green-700`:`bg-yellow-100 text-yellow-700`;return(0,Y.jsx)(ye.Provider,{value:w,children:(0,Y.jsx)(xe.Provider,{value:l?y:0,children:(0,Y.jsx)(ve.Provider,{value:A,children:(0,Y.jsxs)(`div`,{className:`flex h-screen flex-col overflow-hidden font-mono`,children:[(0,Y.jsxs)(`div`,{className:`sticky top-0 z-10 flex flex-wrap items-center gap-2 sm:gap-3 border-b border-black/10 bg-white/85 px-3 py-2 sm:px-5 sm:py-3 backdrop-blur-sm`,children:[(0,Y.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Y.jsx)(`img`,{src:`/mark.svg`,alt:`Kizen`,className:`h-5 w-5`})}),D&&D.length>0&&(0,Y.jsx)(Br,{bundle:D,currentApiName:P}),(0,Y.jsx)(`div`,{className:`flex-1`}),(0,Y.jsxs)(`button`,{onClick:()=>{window.location.reload()},className:`flex items-center gap-1.5 rounded-full border border-black/10 bg-white px-3 py-1 text-[11px] font-medium text-neutral-500 hover:border-black/20 hover:text-neutral-800`,"aria-label":`Refresh page`,children:[(0,Y.jsx)(u,{icon:g}),(0,Y.jsx)(`span`,{className:`hidden lg:inline`,children:`Refresh`})]}),(0,Y.jsxs)(`button`,{onClick:()=>{Zr(H[w.environment],`_blank`,`noopener,height=900`)},className:`flex items-center gap-1.5 rounded-full border border-black/10 bg-white px-3 py-1 text-[11px] font-medium text-neutral-500 hover:border-black/20 hover:text-neutral-800`,"aria-label":`Open Kizen`,children:[(0,Y.jsx)(u,{icon:h}),(0,Y.jsx)(`span`,{className:`hidden lg:inline`,children:`Open Kizen`})]}),(0,Y.jsxs)(`button`,{onClick:S,className:`flex items-center gap-1.5 rounded-full border border-black/10 bg-white px-3 py-1 text-[11px] font-medium text-neutral-500 hover:border-black/20 hover:text-neutral-800`,"aria-label":`Toggle script runner debug logging`,children:[(0,Y.jsx)(u,{icon:m}),(0,Y.jsx)(`span`,{className:`hidden lg:inline`,children:`Script Runner Logging`}),(0,Y.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${f?`bg-green-500`:`bg-neutral-300`}`})]}),(0,Y.jsxs)(`button`,{onClick:x,className:`flex items-center gap-1.5 rounded-full border border-black/10 bg-white px-3 py-1 text-[11px] font-medium text-neutral-500 hover:border-black/20 hover:text-neutral-800`,"aria-label":`Toggle dev tools`,children:[(0,Y.jsx)(u,{icon:r}),(0,Y.jsx)(`span`,{className:`hidden lg:inline`,children:`DevTools`}),(0,Y.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${l?`bg-green-500`:`bg-neutral-300`}`})]}),se&&P&&(0,Y.jsxs)(`button`,{type:`button`,disabled:ne.isPending,onClick:()=>{ne.mutate({apiName:P,hasExistingEntry:!!F,nextDisabled:I})},className:`flex items-center gap-1.5 rounded-full border border-black/10 bg-white px-3 py-1 text-[11px] font-medium text-neutral-500 transition-colors hover:border-black/20 hover:text-neutral-800 ${le}`,"aria-label":ce,children:[(0,Y.jsx)(u,{icon:n}),(0,Y.jsx)(`span`,{className:`hidden lg:inline`,children:ce}),(0,Y.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${I?`bg-green-500`:`bg-neutral-300`}`})]}),(0,Y.jsx)(`span`,{className:`hidden sm:inline rounded px-2 py-0.5 text-[11px] font-semibold tracking-wide ${ue}`,children:L}),(0,Y.jsx)(`span`,{className:`hidden sm:inline rounded px-2 py-0.5 text-[11px] font-semibold tracking-wide ${B}`,children:R})]}),P&&(0,Y.jsx)(Wr,{currentApiName:P,currentSubPage:re,hasCodeSteps:ie}),(0,Y.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,Y.jsx)(`div`,{className:`flex-1 overflow-y-auto p-6`,style:{backgroundImage:`
|
|
3
|
-
linear-gradient(rgba(0,0,0,0.025) 1px, transparent 1px),
|
|
4
|
-
linear-gradient(90deg, rgba(0,0,0,0.025) 1px, transparent 1px)
|
|
5
|
-
`,backgroundSize:`24px 24px`},children:(0,Y.jsx)(Gr,{fallback:e=>(0,Y.jsxs)(`div`,{className:`mx-auto max-w-md rounded border border-red-200 bg-red-50 p-4 text-[12px] text-red-800`,children:[(0,Y.jsx)(`p`,{className:`m-0 font-semibold`,children:`Failed to render this view.`}),(0,Y.jsx)(`p`,{className:`m-0 mt-1 text-red-700`,children:e.message}),(0,Y.jsx)(`p`,{className:`m-0 mt-2 text-red-600`,children:`Reload the page to recover.`})]}),children:(0,Y.jsx)(J.Suspense,{fallback:null,children:(0,Y.jsx)(vr,{})})})}),l&&(0,Y.jsx)(Gr,{fallback:(0,Y.jsxs)(`aside`,{className:`flex w-[280px] shrink-0 flex-col border-l border-black/10 bg-white p-4 text-[12px] text-red-800`,children:[(0,Y.jsx)(`p`,{className:`m-0 font-semibold`,children:`DevTools failed to load.`}),(0,Y.jsx)(`p`,{className:`m-0 mt-1 text-red-700`,children:`Reload the page to try again.`})]}),children:(0,Y.jsx)(J.Suspense,{fallback:null,children:(0,Y.jsx)(Xr,{onClose:x,buildLogs:e,proxyLogs:t,consoleLogs:i,onClearConsole:()=>{a()},credentials:w,onCredentialsChange:E,width:y,onWidthChange:C})})})]}),(0,Y.jsx)(zr,{state:s,onDismiss:c}),(0,Y.jsx)(me,{open:_,size:`md`,onBackdropClick:()=>{v(!1),ne.reset()},header:(0,Y.jsx)(pe,{title:`App not published`}),footer:(0,Y.jsx)(`button`,{onClick:()=>{v(!1),ne.reset()},className:`rounded bg-neutral-900 px-3 py-1.5 text-[12px] text-white transition-colors hover:bg-neutral-700`,children:`OK`}),children:(0,Y.jsxs)(`div`,{className:`px-5 py-4`,children:[(0,Y.jsx)(`p`,{className:`m-0 text-[13px] text-neutral-700`,children:`This app must have been published at least once in order to install in your business.`}),(0,Y.jsx)(`p`,{className:`m-0 text-[13px] text-neutral-700`,children:`After the initial publish, you can enable the app in your business and try again.`})]})})]})})})})},ai=()=>{let{data:e,isLoading:t,isError:n}=z(ae),r=C();return(0,J.useEffect)(()=>{let t=e?.[0];t&&r({to:`/$apiName/summary`,params:{apiName:t.api_name}})},[e,r]),t?(0,Y.jsx)(Se,{children:(0,Y.jsx)(`p`,{className:`m-0 text-[13px] text-neutral-400`,children:`Fetching bundle.json…`})}):n?(0,Y.jsx)(Se,{children:(0,Y.jsx)(`p`,{className:`m-0 text-[13px] text-red-700`,children:`Could not load bundle.json. Make sure the dev server is running from a plugin directory.`})}):!e||e.length===0?(0,Y.jsx)(Se,{children:(0,Y.jsxs)(`p`,{className:`m-0 text-[13px] text-yellow-700`,children:[`bundle.json is empty. Run`,` `,(0,Y.jsx)(`code`,{className:`rounded bg-neutral-100 px-1 py-0.5`,children:`appbuilder build`}),` to generate it.`]})}):null},oi=(0,J.lazy)(()=>Yr(()=>import(`./AppDetailPage-BorvgFPN.js`).then(e=>({default:e.AppDetailPage})),__vite__mapDeps([6,2,1,7,8,9,10,11,12]))),si=(0,J.lazy)(()=>Yr(()=>import(`./SandboxPage-CU6fvI8A.js`).then(e=>({default:e.SandboxPage})),__vite__mapDeps([13,1,2,14,3,15,7,16,5,8,17,10,4,18,19,20,11,12]))),ci=(0,J.lazy)(()=>Yr(()=>import(`./ConfigurationPage-CAdaFi9y.js`).then(e=>({default:e.ConfigurationPage})),__vite__mapDeps([21,1,2,14,3,15,7,16,5,8,22,23,10,20]))),li=(0,J.lazy)(()=>Yr(()=>import(`./VersionsPage-D6QScnTb.js`).then(e=>({default:e.VersionsPage})),__vite__mapDeps([24,1,2,7,8,10]))),ui=(0,J.lazy)(()=>Yr(()=>import(`./IconReferencePage-bTBpdJEd.js`).then(e=>({default:e.IconReferencePage})),__vite__mapDeps([25,1,2,10,11,12]))),di=(0,J.lazy)(()=>Yr(()=>import(`./CodeStepsPage-DnL8JwSJ.js`).then(e=>({default:e.CodeStepsPage})),__vite__mapDeps([26,1,2,14,3,7,8,27,22,23,10,18,4,5,19,20]))),fi=(0,J.lazy)(()=>Yr(()=>import(`./SourceBrowserPage-BBZcr3MI.js`).then(e=>({default:e.SourceBrowserPage})),__vite__mapDeps([28,1,2,7,22,23,9,19]))),$=lr({component:ii}),pi=Q({getParentRoute:()=>$,path:`/`,component:ai}),mi=Q({getParentRoute:()=>$,path:`/$apiName/summary`,component:oi}),hi=Q({getParentRoute:()=>$,path:`/$apiName/sandbox`,component:si}),gi=Q({getParentRoute:()=>$,path:`/$apiName/configuration`,component:ci}),_i=Q({getParentRoute:()=>$,path:`/$apiName/versions`,component:li}),vi=Q({getParentRoute:()=>$,path:`/$apiName/icons`,component:ui}),yi=Q({getParentRoute:()=>$,path:`/$apiName/code-steps`,component:di}),bi=Q({getParentRoute:()=>$,path:`/$apiName/code-steps/$stepApiName`,component:di}),xi=Q({getParentRoute:()=>$,path:`/$apiName/source`,component:fi}),Si=Cr({routeTree:$.addChildren([pi,mi,hi,gi,_i,vi,yi,bi,xi])}),Ci=document.getElementById(`root`),wi=new he;if(Ci===null)throw Error(`Root element not found`);(0,Ar.createRoot)(Ci).render((0,Y.jsx)(J.StrictMode,{children:(0,Y.jsx)(ue,{client:wi,children:(0,Y.jsx)(Er,{router:Si})})}));
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */
|
|
2
|
-
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-900:oklch(40.8% .123 38.172);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-yellow-50:oklch(98.7% .026 102.212);--color-yellow-100:oklch(97.3% .071 103.193);--color-yellow-300:oklch(90.5% .182 98.111);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-700:oklch(55.4% .135 66.442);--color-yellow-900:oklch(42.1% .095 57.708);--color-green-50:oklch(98.2% .018 155.826);--color-green-100:oklch(96.2% .044 156.743);--color-green-300:oklch(87.1% .15 154.449);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-green-900:oklch(39.3% .095 152.535);--color-emerald-100:oklch(95% .052 163.051);--color-blue-50:oklch(97% .014 254.604);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-blue-900:oklch(37.9% .146 265.522);--color-violet-50:oklch(96.9% .016 293.756);--color-violet-300:oklch(81.1% .111 293.571);--color-violet-600:oklch(54.1% .281 293.009);--color-violet-900:oklch(38% .189 293.745);--color-purple-100:oklch(94.6% .033 307.174);--color-purple-600:oklch(55.8% .288 302.321);--color-neutral-50:oklch(98.5% 0 0);--color-neutral-100:oklch(97% 0 0);--color-neutral-200:oklch(92.2% 0 0);--color-neutral-300:oklch(87% 0 0);--color-neutral-400:oklch(70.8% 0 0);--color-neutral-500:oklch(55.6% 0 0);--color-neutral-600:oklch(43.9% 0 0);--color-neutral-700:oklch(37.1% 0 0);--color-neutral-800:oklch(26.9% 0 0);--color-neutral-900:oklch(20.5% 0 0);--color-neutral-950:oklch(14.5% 0 0);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-xl:36rem;--container-2xl:42rem;--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-tight:1.25;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-lg:.5rem;--radius-xl:.75rem;--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.inset-y-0{inset-block:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.-top-0\.5{top:calc(var(--spacing) * -.5)}.top-0{top:calc(var(--spacing) * 0)}.top-1\/2{top:50%}.top-4{top:calc(var(--spacing) * 4)}.-right-0\.5{right:calc(var(--spacing) * -.5)}.right-0{right:calc(var(--spacing) * 0)}.right-2{right:calc(var(--spacing) * 2)}.left-0{left:calc(var(--spacing) * 0)}.left-1\/2{left:50%}.left-2\.5{left:calc(var(--spacing) * 2.5)}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\[9\]{z-index:9}.z-\[99999\]{z-index:99999}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.-m-6{margin:calc(var(--spacing) * -6)}.m-0{margin:calc(var(--spacing) * 0)}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mr-1{margin-right:calc(var(--spacing) * 1)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-0\.5{margin-left:calc(var(--spacing) * .5)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-1\.5{margin-left:calc(var(--spacing) * 1.5)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.table{display:table}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-8{height:calc(var(--spacing) * 8)}.h-10{height:calc(var(--spacing) * 10)}.h-\[500px\]{height:500px}.h-\[calc\(100\%\+3rem\)\]{height:calc(100% + 3rem)}.h-full{height:100%}.h-screen{height:100vh}.max-h-40{max-height:calc(var(--spacing) * 40)}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-72{max-height:calc(var(--spacing) * 72)}.max-h-\[40vh\]{max-height:40vh}.max-h-\[60px\]{max-height:60px}.max-h-\[60vh\]{max-height:60vh}.max-h-\[70vh\]{max-height:70vh}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-32{min-height:calc(var(--spacing) * 32)}.min-h-\[300px\]{min-height:300px}.w-1{width:calc(var(--spacing) * 1)}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-8{width:calc(var(--spacing) * 8)}.w-10{width:calc(var(--spacing) * 10)}.w-12{width:calc(var(--spacing) * 12)}.w-14{width:calc(var(--spacing) * 14)}.w-28{width:calc(var(--spacing) * 28)}.w-32{width:calc(var(--spacing) * 32)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-\[280px\]{width:280px}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-\[220px\]{max-width:220px}.max-w-full{max-width:100%}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xl{max-width:var(--container-xl)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing) * 0)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.-translate-x-1\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-col-resize{cursor:col-resize}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-help{cursor:help}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.cursor-wait{cursor:wait}.resize{resize:both}.resize-y{resize:vertical}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-\[1fr_1fr_auto\]{grid-template-columns:1fr 1fr auto}.grid-cols-\[100px_1fr\]{grid-template-columns:100px 1fr}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-black\/5>:not(:last-child)){border-color:#0000000d}@supports (color:color-mix(in lab, red, red)){:where(.divide-black\/5>:not(:last-child)){border-color:color-mix(in oklab, var(--color-black) 5%, transparent)}}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-amber-200\/60{border-color:#fee68599}@supports (color:color-mix(in lab, red, red)){.border-amber-200\/60{border-color:color-mix(in oklab, var(--color-amber-200) 60%, transparent)}}.border-black\/5{border-color:#0000000d}@supports (color:color-mix(in lab, red, red)){.border-black\/5{border-color:color-mix(in oklab, var(--color-black) 5%, transparent)}}.border-black\/8{border-color:#00000014}@supports (color:color-mix(in lab, red, red)){.border-black\/8{border-color:color-mix(in oklab, var(--color-black) 8%, transparent)}}.border-black\/10{border-color:#0000001a}@supports (color:color-mix(in lab, red, red)){.border-black\/10{border-color:color-mix(in oklab, var(--color-black) 10%, transparent)}}.border-black\/20{border-color:#0003}@supports (color:color-mix(in lab, red, red)){.border-black\/20{border-color:color-mix(in oklab, var(--color-black) 20%, transparent)}}.border-blue-100{border-color:var(--color-blue-100)}.border-neutral-300{border-color:var(--color-neutral-300)}.border-neutral-700{border-color:var(--color-neutral-700)}.border-neutral-800{border-color:var(--color-neutral-800)}.border-neutral-900{border-color:var(--color-neutral-900)}.border-red-200{border-color:var(--color-red-200)}.border-red-300{border-color:var(--color-red-300)}.border-transparent{border-color:#0000}.border-white{border-color:var(--color-white)}.bg-amber-50{background-color:var(--color-amber-50)}.bg-amber-100{background-color:var(--color-amber-100)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-900\/60{background-color:#7b330699}@supports (color:color-mix(in lab, red, red)){.bg-amber-900\/60{background-color:color-mix(in oklab, var(--color-amber-900) 60%, transparent)}}.bg-black\/30{background-color:#0000004d}@supports (color:color-mix(in lab, red, red)){.bg-black\/30{background-color:color-mix(in oklab, var(--color-black) 30%, transparent)}}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-100{background-color:var(--color-blue-100)}.bg-blue-500{background-color:var(--color-blue-500)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-blue-900\/60{background-color:#1c398e99}@supports (color:color-mix(in lab, red, red)){.bg-blue-900\/60{background-color:color-mix(in oklab, var(--color-blue-900) 60%, transparent)}}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-green-50{background-color:var(--color-green-50)}.bg-green-100{background-color:var(--color-green-100)}.bg-green-400\/60{background-color:#05df7299}@supports (color:color-mix(in lab, red, red)){.bg-green-400\/60{background-color:color-mix(in oklab, var(--color-green-400) 60%, transparent)}}.bg-green-500{background-color:var(--color-green-500)}.bg-green-900\/60{background-color:#0d542b99}@supports (color:color-mix(in lab, red, red)){.bg-green-900\/60{background-color:color-mix(in oklab, var(--color-green-900) 60%, transparent)}}.bg-neutral-50{background-color:var(--color-neutral-50)}.bg-neutral-50\/60{background-color:#fafafa99}@supports (color:color-mix(in lab, red, red)){.bg-neutral-50\/60{background-color:color-mix(in oklab, var(--color-neutral-50) 60%, transparent)}}.bg-neutral-100{background-color:var(--color-neutral-100)}.bg-neutral-200{background-color:var(--color-neutral-200)}.bg-neutral-300{background-color:var(--color-neutral-300)}.bg-neutral-400{background-color:var(--color-neutral-400)}.bg-neutral-700{background-color:var(--color-neutral-700)}.bg-neutral-800{background-color:var(--color-neutral-800)}.bg-neutral-800\/40{background-color:#26262666}@supports (color:color-mix(in lab, red, red)){.bg-neutral-800\/40{background-color:color-mix(in oklab, var(--color-neutral-800) 40%, transparent)}}.bg-neutral-900{background-color:var(--color-neutral-900)}.bg-neutral-950{background-color:var(--color-neutral-950)}.bg-orange-900\/60{background-color:#7e2a0c99}@supports (color:color-mix(in lab, red, red)){.bg-orange-900\/60{background-color:color-mix(in oklab, var(--color-orange-900) 60%, transparent)}}.bg-purple-100{background-color:var(--color-purple-100)}.bg-red-50{background-color:var(--color-red-50)}.bg-red-100{background-color:var(--color-red-100)}.bg-red-400\/60{background-color:#ff656899}@supports (color:color-mix(in lab, red, red)){.bg-red-400\/60{background-color:color-mix(in oklab, var(--color-red-400) 60%, transparent)}}.bg-red-500{background-color:var(--color-red-500)}.bg-red-900\/60{background-color:#82181a99}@supports (color:color-mix(in lab, red, red)){.bg-red-900\/60{background-color:color-mix(in oklab, var(--color-red-900) 60%, transparent)}}.bg-transparent{background-color:#0000}.bg-violet-50{background-color:var(--color-violet-50)}.bg-violet-900\/60{background-color:#4d179a99}@supports (color:color-mix(in lab, red, red)){.bg-violet-900\/60{background-color:color-mix(in oklab, var(--color-violet-900) 60%, transparent)}}.bg-white{background-color:var(--color-white)}.bg-white\/60{background-color:#fff9}@supports (color:color-mix(in lab, red, red)){.bg-white\/60{background-color:color-mix(in oklab, var(--color-white) 60%, transparent)}}.bg-white\/70{background-color:#ffffffb3}@supports (color:color-mix(in lab, red, red)){.bg-white\/70{background-color:color-mix(in oklab, var(--color-white) 70%, transparent)}}.bg-white\/80{background-color:#fffc}@supports (color:color-mix(in lab, red, red)){.bg-white\/80{background-color:color-mix(in oklab, var(--color-white) 80%, transparent)}}.bg-white\/85{background-color:#ffffffd9}@supports (color:color-mix(in lab, red, red)){.bg-white\/85{background-color:color-mix(in oklab, var(--color-white) 85%, transparent)}}.bg-white\/90{background-color:#ffffffe6}@supports (color:color-mix(in lab, red, red)){.bg-white\/90{background-color:color-mix(in oklab, var(--color-white) 90%, transparent)}}.bg-yellow-50{background-color:var(--color-yellow-50)}.bg-yellow-100{background-color:var(--color-yellow-100)}.bg-yellow-400\/60{background-color:#fac80099}@supports (color:color-mix(in lab, red, red)){.bg-yellow-400\/60{background-color:color-mix(in oklab, var(--color-yellow-400) 60%, transparent)}}.bg-yellow-900\/60{background-color:#733e0a99}@supports (color:color-mix(in lab, red, red)){.bg-yellow-900\/60{background-color:color-mix(in oklab, var(--color-yellow-900) 60%, transparent)}}.bg-\[url\(\'data\:image\/svg\+xml\;utf8\,\<svg\%20xmlns\=\%22http\:\/\/www\.w3\.org\/2000\/svg\%22\%20width\=\%2216\%22\%20height\=\%2216\%22\>\<rect\%20width\=\%228\%22\%20height\=\%228\%22\%20fill\=\%22\%23f3f4f6\%22\/\>\<rect\%20x\=\%228\%22\%20y\=\%228\%22\%20width\=\%228\%22\%20height\=\%228\%22\%20fill\=\%22\%23f3f4f6\%22\/\>\<\/svg\>\'\)\]{background-image:url(data:image/svg+xml;utf8,<svg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%2216%22%20height=%2216%22><rect%20width=%228%22%20height=%228%22%20fill=%22%23f3f4f6%22/><rect%20x=%228%22%20y=%228%22%20width=%228%22%20height=%228%22%20fill=%22%23f3f4f6%22/></svg>)}.object-cover{object-fit:cover}.\!p-0{padding:calc(var(--spacing) * 0)!important}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.px-0\.5{padding-inline:calc(var(--spacing) * .5)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-px{padding-block:1px}.pt-2{padding-top:calc(var(--spacing) * 2)}.pr-1{padding-right:calc(var(--spacing) * 1)}.pr-2\.5{padding-right:calc(var(--spacing) * 2.5)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-7{padding-left:calc(var(--spacing) * 7)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-\[8px\]{font-size:8px}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[12px\]{font-size:12px}.text-\[13px\]{font-size:13px}.text-\[14px\]{font-size:14px}.text-\[15px\]{font-size:15px}.text-\[16px\]{font-size:16px}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-\[20px\]{--tw-leading:20px;line-height:20px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-pre{white-space:pre}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-300{color:var(--color-amber-300)}.text-amber-500{color:var(--color-amber-500)}.text-amber-600{color:var(--color-amber-600)}.text-amber-700{color:var(--color-amber-700)}.text-amber-800{color:var(--color-amber-800)}.text-blue-300{color:var(--color-blue-300)}.text-blue-400{color:var(--color-blue-400)}.text-blue-600{color:var(--color-blue-600)}.text-blue-700{color:var(--color-blue-700)}.text-green-300{color:var(--color-green-300)}.text-green-600{color:var(--color-green-600)}.text-green-700{color:var(--color-green-700)}.text-neutral-100{color:var(--color-neutral-100)}.text-neutral-200{color:var(--color-neutral-200)}.text-neutral-300{color:var(--color-neutral-300)}.text-neutral-400{color:var(--color-neutral-400)}.text-neutral-500{color:var(--color-neutral-500)}.text-neutral-600{color:var(--color-neutral-600)}.text-neutral-700{color:var(--color-neutral-700)}.text-neutral-800{color:var(--color-neutral-800)}.text-neutral-900{color:var(--color-neutral-900)}.text-orange-300{color:var(--color-orange-300)}.text-purple-600{color:var(--color-purple-600)}.text-red-300{color:var(--color-red-300)}.text-red-400{color:var(--color-red-400)}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-red-800{color:var(--color-red-800)}.text-violet-300{color:var(--color-violet-300)}.text-violet-600{color:var(--color-violet-600)}.text-white{color:var(--color-white)}.text-white\/70{color:#ffffffb3}@supports (color:color-mix(in lab, red, red)){.text-white\/70{color:color-mix(in oklab, var(--color-white) 70%, transparent)}}.text-yellow-300{color:var(--color-yellow-300)}.text-yellow-400{color:var(--color-yellow-400)}.text-yellow-700{color:var(--color-yellow-700)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.accent-blue-600{accent-color:var(--color-blue-600)}.accent-neutral-600{accent-color:var(--color-neutral-600)}.accent-neutral-800{accent-color:var(--color-neutral-800)}.opacity-30{opacity:.3}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.select-none{-webkit-user-select:none;user-select:none}.placeholder\:text-neutral-300::placeholder{color:var(--color-neutral-300)}@media (hover:hover){.hover\:border-black\/20:hover{border-color:#0003}@supports (color:color-mix(in lab, red, red)){.hover\:border-black\/20:hover{border-color:color-mix(in oklab, var(--color-black) 20%, transparent)}}.hover\:border-green-300:hover{border-color:var(--color-green-300)}.hover\:bg-black\/5:hover{background-color:#0000000d}@supports (color:color-mix(in lab, red, red)){.hover\:bg-black\/5:hover{background-color:color-mix(in oklab, var(--color-black) 5%, transparent)}}.hover\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\:bg-neutral-50:hover{background-color:var(--color-neutral-50)}.hover\:bg-neutral-100:hover{background-color:var(--color-neutral-100)}.hover\:bg-neutral-600:hover{background-color:var(--color-neutral-600)}.hover\:bg-neutral-700:hover{background-color:var(--color-neutral-700)}.hover\:bg-neutral-800\/50:hover{background-color:#26262680}@supports (color:color-mix(in lab, red, red)){.hover\:bg-neutral-800\/50:hover{background-color:color-mix(in oklab, var(--color-neutral-800) 50%, transparent)}}.hover\:text-green-700:hover{color:var(--color-green-700)}.hover\:text-neutral-200:hover{color:var(--color-neutral-200)}.hover\:text-neutral-300:hover{color:var(--color-neutral-300)}.hover\:text-neutral-600:hover{color:var(--color-neutral-600)}.hover\:text-neutral-700:hover{color:var(--color-neutral-700)}.hover\:text-neutral-800:hover{color:var(--color-neutral-800)}.hover\:text-neutral-900:hover{color:var(--color-neutral-900)}.hover\:text-red-500:hover{color:var(--color-red-500)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-70:hover{opacity:.7}}.focus\:border-blue-300:focus{border-color:var(--color-blue-300)}.focus\:border-neutral-400:focus{border-color:var(--color-neutral-400)}.focus\:border-neutral-500:focus{border-color:var(--color-neutral-500)}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-blue-400:focus{--tw-ring-color:var(--color-blue-400)}.focus\:ring-neutral-400:focus{--tw-ring-color:var(--color-neutral-400)}.focus\:ring-red-400:focus{--tw-ring-color:var(--color-red-400)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.active\:cursor-grabbing:active{cursor:grabbing}.active\:bg-blue-800:active{background-color:var(--color-blue-800)}.active\:bg-neutral-100:active{background-color:var(--color-neutral-100)}.active\:bg-neutral-500:active{background-color:var(--color-neutral-500)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:cursor-wait:disabled{cursor:wait}.disabled\:bg-neutral-50:disabled{background-color:var(--color-neutral-50)}.disabled\:text-neutral-400:disabled{color:var(--color-neutral-400)}.disabled\:opacity-50:disabled{opacity:.5}@media (width>=40rem){.sm\:inline{display:inline}.sm\:gap-3{gap:calc(var(--spacing) * 3)}.sm\:px-5{padding-inline:calc(var(--spacing) * 5)}.sm\:py-3{padding-block:calc(var(--spacing) * 3)}}@media (width>=48rem){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (width>=64rem){.lg\:inline{display:inline}.lg\:min-w-0{min-width:calc(var(--spacing) * 0)}.lg\:flex-1{flex:1}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}.lg\:items-start{align-items:flex-start}.lg\:px-5{padding-inline:calc(var(--spacing) * 5)}}@media (width>=80rem){.xl\:min-w-0{min-width:calc(var(--spacing) * 0)}.xl\:flex-1{flex:1}.xl\:flex-row{flex-direction:row}.xl\:items-start{align-items:flex-start}}}.fc-kizen .fc-daygrid-more-link{color:#737373;font-family:ui-monospace,Menlo,Consolas,Liberation Mono,monospace;font-size:10px}.fc-kizen .fc-col-header-cell-cushion{text-transform:uppercase;letter-spacing:.1em;color:#a3a3a3;font-family:ui-monospace,Menlo,Consolas,Liberation Mono,monospace;font-size:10px;font-weight:600;text-decoration:none}.fc-kizen .fc-daygrid-day-number{color:#737373;font-family:ui-monospace,Menlo,Consolas,Liberation Mono,monospace;font-size:11px;text-decoration:none}.fc-kizen .fc-day-today .fc-daygrid-day-number{color:#171717;font-weight:700}.fc-kizen .fc-popover-title{font-family:ui-monospace,Menlo,Consolas,Liberation Mono,monospace;font-size:11px}.fc-kizen .fc-timegrid-slot-label-cushion,.fc-kizen .fc-timegrid-axis-cushion{color:#a3a3a3;text-transform:uppercase;font-family:ui-monospace,Menlo,Consolas,Liberation Mono,monospace;font-size:10px}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));export{c as n,o as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DF2fYuay.js";import{j as t}from"./fa-core-BoBqCOD3.js";var n=e(t(),1),r=[`go`,`fmo`,`staging`,`integration`,`test1`],i=(0,n.createContext)({apiKey:``,userId:``,businessId:``,environment:`go`}),a=()=>(0,n.useContext)(i),o={credentials:`devtools-credentials`,sidebarOpen:`devtools-sidebar-open`,sidebarWidth:`devtools-sidebar-width`,credsPanelOpen:`devtools-creds-open`,routesPanelOpen:`devtools-routes-open`,consolePanelOpen:`devtools-console-open`,proxyPanelOpen:`devtools-proxy-open`,buildPanelOpen:`devtools-build-open`,scriptRunnerLogging:`kizen-flag-script-runner-logging`,sandboxFramesEnabled:`frames-enabled`},s=e=>`kizen-plugin-config:${e}`,c=e=>`kizen-plugin-user-config:${e}`,l=e=>`calendar-harness-selection:${e}`,u=(e,t)=>`kizen-sandbox:${e}:service:${t}:requestHistory`,d=e=>e?`:${e}`:``,f=(e,t=``)=>`kizen-sandbox:${e}:selectedObject${d(t)}`,p=(e,t=``)=>`kizen-sandbox:${e}:selectedEntity${d(t)}`,m=e=>`kizen-sandbox:${e}:objectSettings:selectedObject`,h=e=>`floating-frame-pos-${e}`;export{c as a,f as c,a as d,r as f,s as i,u as l,l as n,m as o,h as r,p as s,o as t,i as u};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DF2fYuay.js";import{A as t,j as n,k as r,y as i}from"./fa-core-BoBqCOD3.js";import{n as a}from"./react-csXWLXSE.js";import{A as o,I as s,M as c,O as l,a as u,c as d,d as f,f as p,i as m,l as h,n as g,o as _,p as v,r as y,s as b,u as x,v as S}from"./useQuery-5OkVbV1s.js";import{a as C,i as w,n as T,o as E,r as D}from"./BootstrapContext-D5ZnMrOp.js";import{C as O,S as k,_ as A,b as j,c as M,d as N,f as P,g as F,h as I,i as L,l as R,m as ee,p as z,r as te,u as B,v as V,w as ne,x as H,y as re}from"./api-DtXiAEKW.js";function U(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}function W(e,t,n){let r=e.slice(0);return r[t]=n,r}var ie=class extends s{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#p(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,S.batch(()=>{let e=this.#i,t=this.#f(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!c(e,n)});!o&&!s||(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(U(e,n).forEach(e=>{e.destroy()}),U(n,e).forEach(e=>{e.subscribe(t=>{this.#p(e,t)})})),this.#m()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#f(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){return t.map((n,r)=>{let i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(!this.#a||this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=o(this.#a,t(e))),this.#a}return e}#f(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new v(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#p(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=W(this.#t,n,t),this.#m())}#m(){if(this.hasListeners()){let e=this.#a,t=this.#u(this.#t,this.#l);e!==this.#d(t,this.#r?.combine)&&S.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},G=e(n(),1);function ae({queries:e,...t},n){let r=p(n),i=h(),a=d(),o=G.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:`optimistic`,t}),[e,r,i]);o.forEach(e=>{g(e),u(e,a,r.getQueryCache().get(e.queryHash))}),b(a);let[s]=G.useState(()=>new ie(r,o,t)),[c,f,x]=s.getOptimisticResult(o,t.combine),C=!i&&t.subscribed!==!1;G.useSyncExternalStore(G.useCallback(e=>C?s.subscribe(S.batchCalls(e)):l,[s,C]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),G.useEffect(()=>{s.setQueries(o,t)},[o,t,s]);let w=c.some((e,t)=>m(o[t],e))?c.flatMap((e,t)=>{let n=o[t];return n&&m(n,e)?y(n,new v(r,n),a):[]}):[];if(w.length>0)throw Promise.all(w);let T=c.find((e,t)=>{let n=o[t];return n&&_({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(T?.error)throw T.error;return f(x())}var oe=`integration:${re.RUN_FRAME_SCRIPT}`,se={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`}},ce=(e,t,n)=>{let r,i=se[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function le(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var ue={date:le({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:le({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:le({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},de={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},fe=(e,t,n,r)=>de[e];function K(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}var pe={ordinalNumber:(e,t)=>{let 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`},era:K({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:K({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:K({values:{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`]},defaultWidth:`wide`}),day:K({values:{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`]},defaultWidth:`wide`}),dayPeriod:K({values:{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`}},defaultWidth:`wide`,formattingValues:{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`}},defaultFormattingWidth:`wide`})};function me(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?ge(s,e=>e.test(o)):he(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function he(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function ge(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function _e(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var ve={code:`en-US`,formatDistance:ce,formatLong:ue,formatRelative:fe,localize:pe,match:{ordinalNumber:_e({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:me({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:me({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:me({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{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]},defaultParseWidth:`any`}),day:me({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{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]},defaultParseWidth:`any`}),dayPeriod:me({matchPatterns:{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},defaultMatchWidth:`any`,parsePatterns:{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}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}},ye={};function be(){return ye}var xe=365.2425,Se=6048e5,Ce=864e5,we=3600*24;we*7,we*xe/12*3;var Te=Symbol.for(`constructDateFrom`);function q(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&Te in e?e[Te](t):e instanceof Date?new e.constructor(t):new Date(t)}function J(e,t){return q(t||e,e)}function Ee(e){let t=J(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 De(e,...t){let n=q.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function Oe(e,t){let n=J(e,t?.in);return n.setHours(0,0,0,0),n}function ke(e,t,n){let[r,i]=De(n?.in,e,t),a=Oe(r),o=Oe(i),s=+a-Ee(a),c=+o-Ee(o);return Math.round((s-c)/Ce)}function Ae(e,t){let n=J(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function je(e,t){let n=J(e,t?.in);return ke(n,Ae(n))+1}function Me(e,t){let n=be(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=J(e,t?.in),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function Ne(e,t){return Me(e,{...t,weekStartsOn:1})}function Pe(e,t){let n=J(e,t?.in),r=n.getFullYear(),i=q(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);let a=Ne(i),o=q(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);let s=Ne(o);return n.getTime()>=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function Fe(e,t){let n=Pe(e,t),r=q(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Ne(r)}function Ie(e,t){let n=J(e,t?.in),r=Ne(n)-+Fe(n);return Math.round(r/Se)+1}function Le(e,t){let n=J(e,t?.in),r=n.getFullYear(),i=be(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=q(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=Me(o,t),c=q(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=Me(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function Re(e,t){let n=be(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=Le(e,t),a=q(t?.in||e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),Me(a,t)}function ze(e,t){let n=J(e,t?.in),r=Me(n,t)-+Re(n,t);return Math.round(r/Se)+1}function Y(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}var Be={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return Y(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):Y(n+1,2)},d(e,t){return Y(e.getDate(),t.length)},a(e,t){let 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];default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return Y(e.getHours()%12||12,t.length)},H(e,t){return Y(e.getHours(),t.length)},m(e,t){return Y(e.getMinutes(),t.length)},s(e,t){return Y(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return Y(Math.trunc(r*10**(n-3)),t.length)}},Ve={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},He={G:function(e,t,n){let r=+(e.getFullYear()>0);switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return Be.y(e,t)},Y:function(e,t,n,r){let i=Le(e,r),a=i>0?i:1-i;return t===`YY`?Y(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):Y(a,t.length)},R:function(e,t){return Y(Pe(e),t.length)},u:function(e,t){return Y(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return Y(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`});default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return Y(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`});default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return Be.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`});default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return Y(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`});default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=ze(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):Y(i,t.length)},I:function(e,t,n){let r=Ie(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):Y(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):Be.d(e,t)},D:function(e,t,n){let r=je(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):Y(r,t.length)},E:function(e,t,n){let 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`});default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return Y(a,2);case`eo`:return n.ordinalNumber(a,{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`});default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return Y(a,t.length);case`co`:return n.ordinalNumber(a,{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`});default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return Y(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`});default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(r,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(r,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?Ve.noon:r===0?Ve.midnight: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`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?Ve.evening:r>=12?Ve.afternoon:r>=4?Ve.morning:Ve.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`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return Be.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):Be.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):Y(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):Y(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):Be.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):Be.s(e,t)},S:function(e,t){return Be.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return We(r);case`XXXX`:case`XX`:return Ge(r);default:return Ge(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return We(r);case`xxxx`:case`xx`:return Ge(r);default:return Ge(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+Ue(r,`:`);default:return`GMT`+Ge(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+Ue(r,`:`);default:return`GMT`+Ge(r,`:`)}},t:function(e,t,n){return Y(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return Y(+e,t.length)}};function Ue(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+Y(a,2)}function We(e,t){return e%60==0?(e>0?`-`:`+`)+Y(Math.abs(e)/60,2):Ge(e,t)}function Ge(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Y(Math.trunc(r/60),2),a=Y(r%60,2);return n+i+t+a}var Ke=(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`});default:return t.date({width:`full`})}},qe=(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`});default:return t.time({width:`full`})}},Je={p:qe,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Ke(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,Ke(r,t)).replace(`{{time}}`,qe(i,t))}},Ye=/^D+$/,Xe=/^Y+$/,Ze=[`D`,`DD`,`YY`,`YYYY`];function Qe(e){return Ye.test(e)}function $e(e){return Xe.test(e)}function et(e,t,n){let r=tt(e,t,n);if(console.warn(r),Ze.includes(e))throw RangeError(r)}function tt(e,t,n){let 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`}function nt(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function rt(e){return!(!nt(e)&&typeof e!=`number`||isNaN(+J(e)))}var it=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,at=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ot=/^'([^]*?)'?$/,st=/''/g,ct=/[a-zA-Z]/;function lt(e,t,n){let r=be(),i=n?.locale??r.locale??ve,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=J(e,n?.in);if(!rt(s))throw RangeError(`Invalid time value`);let c=t.match(at).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=Je[t];return n(e,i.formatLong)}return e}).join(``).match(it).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:ut(e)};if(He[t])return{isToken:!0,value:e};if(t.match(ct))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&$e(a)||!n?.useAdditionalDayOfYearTokens&&Qe(a))&&et(a,t,String(e));let o=He[a[0]];return o(s,a,i.localize,l)}).join(``)}function ut(e){let t=e.match(ot);return t?t[1].replace(st,`'`):e}function dt(e,t){let n=J(e,t?.in);return n.setHours(23,59,59,999),n}function ft(){return Object.assign({},be())}function pt(e,t,n){let r=ft(),i=gt(e,n.timeZone,n.locale??r.locale);return`formatToParts`in i?mt(i,t):ht(i,t)}function mt(e,t){let n=e.formatToParts(t);for(let e=n.length-1;e>=0;--e)if(n[e].type===`timeZoneName`)return n[e].value}function ht(e,t){let n=e.format(t).replace(/\u200E/g,``),r=/ [\w-+ ]+$/.exec(n);return r?r[0].substr(1):``}function gt(e,t,n){return new Intl.DateTimeFormat(n?[n.code,`en-US`]:void 0,{timeZone:t,timeZoneName:e})}function _t(e,t){let n=wt(t);return`formatToParts`in n?yt(n,e):bt(n,e)}var vt={year:0,month:1,day:2,hour:3,minute:4,second:5};function yt(e,t){try{let n=e.formatToParts(t),r=[];for(let e=0;e<n.length;e++){let t=vt[n[e].type];t!==void 0&&(r[t]=parseInt(n[e].value,10))}return r}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function bt(e,t){let n=e.format(t),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[parseInt(r[3],10),parseInt(r[1],10),parseInt(r[2],10),parseInt(r[4],10),parseInt(r[5],10),parseInt(r[6],10)]}var xt={},St=new Intl.DateTimeFormat(`en-US`,{hourCycle:`h23`,timeZone:`America/New_York`,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}).format(new Date(`2014-06-25T04:00:00.123Z`)),Ct=St===`06/25/2014, 00:00:00`||St===`06/25/2014 00:00:00`;function wt(e){return xt[e]||(xt[e]=Ct?new Intl.DateTimeFormat(`en-US`,{hourCycle:`h23`,timeZone:e,year:`numeric`,month:`numeric`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}):new Intl.DateTimeFormat(`en-US`,{hour12:!1,timeZone:e,year:`numeric`,month:`numeric`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`})),xt[e]}function Tt(e,t,n,r,i,a,o){let s=new Date(0);return s.setUTCFullYear(e,t,n),s.setUTCHours(r,i,a,o),s}var Et=36e5,Dt=6e4,Ot={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function kt(e,t,n){if(!e)return 0;let r=Ot.timezoneZ.exec(e);if(r)return 0;let i,a;if(r=Ot.timezoneHH.exec(e),r)return i=parseInt(r[1],10),Nt(i)?-(i*Et):NaN;if(r=Ot.timezoneHHMM.exec(e),r){i=parseInt(r[2],10);let e=parseInt(r[3],10);return Nt(i,e)?(a=Math.abs(i)*Et+e*Dt,r[1]===`+`?-a:a):NaN}if(Ft(e)){t=new Date(t||Date.now());let r=jt(n?t:At(t),e);return-(n?r:Mt(t,r,e))}return NaN}function At(e){return Tt(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function jt(e,t){let n=_t(e,t),r=Tt(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime(),i=e.getTime(),a=i%1e3;return i-=a>=0?a:1e3+a,r-i}function Mt(e,t,n){let r=e.getTime()-t,i=jt(new Date(r),n);if(t===i)return t;r-=i-t;let a=jt(new Date(r),n);return i===a?i:Math.max(i,a)}function Nt(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}var Pt={};function Ft(e){if(Pt[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Pt[e]=!0,!0}catch{return!1}}var It=60*1e3,Lt={X:function(e,t,n){let r=Rt(n.timeZone,e);if(r===0)return`Z`;switch(t){case`X`:return Vt(r);case`XXXX`:case`XX`:return Bt(r);default:return Bt(r,`:`)}},x:function(e,t,n){let r=Rt(n.timeZone,e);switch(t){case`x`:return Vt(r);case`xxxx`:case`xx`:return Bt(r);default:return Bt(r,`:`)}},O:function(e,t,n){let r=Rt(n.timeZone,e);switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+Ht(r,`:`);default:return`GMT`+Bt(r,`:`)}},z:function(e,t,n){switch(t){case`z`:case`zz`:case`zzz`:return pt(`short`,e,n);default:return pt(`long`,e,n)}}};function Rt(e,t){let n=e?kt(e,t,!0)/It:t?.getTimezoneOffset()??0;if(Number.isNaN(n))throw RangeError(`Invalid time zone specified: `+e);return n}function zt(e,t){let n=e<0?`-`:``,r=Math.abs(e).toString();for(;r.length<t;)r=`0`+r;return n+r}function Bt(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=zt(Math.floor(r/60),2),a=zt(Math.floor(r%60),2);return n+i+t+a}function Vt(e,t){return e%60==0?(e>0?`-`:`+`)+zt(Math.abs(e)/60,2):Bt(e,t)}function Ht(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.floor(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+zt(a,2)}function Ut(e){let t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e-+t}var Wt=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Gt=36e5,Kt=6e4,qt=2,X={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Wt};function Jt(e,t={}){if(arguments.length<1)throw TypeError(`1 argument required, but only `+arguments.length+` present`);if(e===null)return new Date(NaN);let n=t.additionalDigits==null?qt:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw RangeError(`additionalDigits must be 0, 1 or 2`);if(e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`)return new Date(e.getTime());if(typeof e==`number`||Object.prototype.toString.call(e)===`[object Number]`)return new Date(e);if(Object.prototype.toString.call(e)!==`[object String]`)return new Date(NaN);let r=Yt(e),{year:i,restDateString:a}=Xt(r.date,n),o=Zt(a,i);if(o===null||isNaN(o.getTime()))return new Date(NaN);if(o){let e=o.getTime(),n=0,i;if(r.time&&(n=Qt(r.time),n===null||isNaN(n)))return new Date(NaN);if(r.timeZone||t.timeZone){if(i=kt(r.timeZone||t.timeZone,new Date(e+n)),isNaN(i))return new Date(NaN)}else i=Ut(new Date(e+n)),i=Ut(new Date(e+n+i));return new Date(e+n+i)}else return new Date(NaN)}function Yt(e){let t={},n=X.dateTimePattern.exec(e),r;if(n?(t.date=n[1],r=n[3]):(n=X.datePattern.exec(e),n?(t.date=n[1],r=n[2]):(t.date=null,r=e)),r){let e=X.timeZone.exec(r);e?(t.time=r.replace(e[1],``),t.timeZone=e[1].trim()):t.time=r}return t}function Xt(e,t){if(e){let n=X.YYY[t],r=X.YYYYY[t],i=X.YYYY.exec(e)||r.exec(e);if(i){let t=i[1];return{year:parseInt(t,10),restDateString:e.slice(t.length)}}if(i=X.YY.exec(e)||n.exec(e),i){let t=i[1];return{year:parseInt(t,10)*100,restDateString:e.slice(t.length)}}}return{year:null}}function Zt(e,t){if(t===null)return null;let n,r,i;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let a=X.MM.exec(e);if(a)return n=new Date(0),r=parseInt(a[1],10)-1,rn(t,r)?(n.setUTCFullYear(t,r),n):new Date(NaN);if(a=X.DDD.exec(e),a){n=new Date(0);let e=parseInt(a[1],10);return an(t,e)?(n.setUTCFullYear(t,0,e),n):new Date(NaN)}if(a=X.MMDD.exec(e),a){n=new Date(0),r=parseInt(a[1],10)-1;let e=parseInt(a[2],10);return rn(t,r,e)?(n.setUTCFullYear(t,r,e),n):new Date(NaN)}if(a=X.Www.exec(e),a)return i=parseInt(a[1],10)-1,on(i)?$t(t,i):new Date(NaN);if(a=X.WwwD.exec(e),a){i=parseInt(a[1],10)-1;let e=parseInt(a[2],10)-1;return on(i,e)?$t(t,i,e):new Date(NaN)}return null}function Qt(e){let t,n,r=X.HH.exec(e);if(r)return t=parseFloat(r[1].replace(`,`,`.`)),sn(t)?t%24*Gt:NaN;if(r=X.HHMM.exec(e),r)return t=parseInt(r[1],10),n=parseFloat(r[2].replace(`,`,`.`)),sn(t,n)?t%24*Gt+n*Kt:NaN;if(r=X.HHMMSS.exec(e),r){t=parseInt(r[1],10),n=parseInt(r[2],10);let e=parseFloat(r[3].replace(`,`,`.`));return sn(t,n,e)?t%24*Gt+n*Kt+e*1e3:NaN}return null}function $t(e,t,n){t||=0,n||=0;let r=new Date(0);r.setUTCFullYear(e,0,4);let i=r.getUTCDay()||7,a=t*7+n+1-i;return r.setUTCDate(r.getUTCDate()+a),r}var en=[31,28,31,30,31,30,31,31,30,31,30,31],tn=[31,29,31,30,31,30,31,31,30,31,30,31];function nn(e){return e%400==0||e%4==0&&e%100!=0}function rn(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;let r=nn(e);if(r&&n>tn[t]||!r&&n>en[t])return!1}return!0}function an(e,t){if(t<1)return!1;let n=nn(e);return!(n&&t>366||!n&&t>365)}function on(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function sn(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}var cn=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function ln(e,t,n={}){t=String(t);let r=t.match(cn);if(r){let i=Jt(n.originalDate||e,n);t=r.reduce(function(e,t){if(t[0]===`'`)return e;let r=e.indexOf(t),a=e[r-1]===`'`,o=e.replace(t,`'`+Lt[t[0]](i,t,n)+`'`);return a?o.substring(0,r-1)+o.substring(r+1):o},t)}return lt(e,t,n)}function un(e,t,n){e=Jt(e,n);let r=kt(t,e,!0),i=new Date(e.getTime()-r),a=new Date(0);return a.setFullYear(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()),a.setHours(i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds()),a}function dn(e,t,n,r){return r={...r,timeZone:t,originalDate:e},ln(un(e,t,{timeZone:r.timeZone}),n,r)}var Z=t(),fn=a(),pn=(0,G.createContext)(null),mn=({children:e})=>{let t=(0,G.useRef)({}),n=(0,G.useCallback)(()=>{Object.keys(t.current).forEach(e=>{t.current[e]?.forEach(e=>{e()}),t.current[e]=[]})},[]);return(0,G.useEffect)(()=>()=>{n()},[n]),(0,Z.jsx)(pn.Provider,{value:{terminators:t,cleanupWorkers:n},children:e})},hn=()=>{let e=(0,G.useContext)(pn);if(!e)throw Error(`useTerminators must be used within a TerminatorsWrapper`);return e},gn=(0,G.createContext)(null),_n=({children:e})=>{let[t,n]=(0,G.useState)({}),r=(0,G.useCallback)((e,t)=>{n(n=>({...n,[e]:{...n[e],...t}}))},[]);return(0,Z.jsx)(gn.Provider,{value:{sessionData:t,setSessionData:r},children:e})},vn=()=>{let e=(0,G.useContext)(gn);if(!e)throw Error(`useSessionData must be used within a SessionDataWrapper`);return e},yn=(0,G.createContext)(null),bn=({children:e,bootstrapPlugins:t=[],userConfigs:n=[],user:r,teamMember:i,business:a,clientObject:o,appPath:s})=>{let[c,l]=(0,G.useState)(!1),[u,d]=(0,G.useState)({}),f=(0,G.useMemo)(()=>Object.values(u).some(e=>e.waitingOnRouteScript),[u]),p=(0,G.useMemo)(()=>t.reduce((e,t)=>({...e,[t.api_name]:t.id}),{}),[t]),m=(0,G.useMemo)(()=>n.reduce((e,t)=>({...e,[t.api_name]:t.config}),{}),[n]),h=(0,G.useCallback)(()=>{l(!0)},[]);return(0,Z.jsx)(yn.Provider,{value:{installedPluginAPINamesToIds:p,userConfigsByApiName:m,user:r,teamMember:i,business:a,clientObject:o,appPath:s,onInitialBootstrap:h,setRouteScriptRunState:d},children:e({waitingOnRouteScript:f,hasFinishedBootstrapping:c})})},xn=()=>{let e=(0,G.useContext)(yn);if(!e)throw Error(`useAppState must be used within an AppStateWrapper`);return e},Sn=(0,G.createContext)(null),Cn=({children:e})=>{let[t,n]=(0,G.useState)({}),r=(0,G.useCallback)(e=>t=>{n(n=>({...n,[e]:t(n[e]??{indicator:`none`,hidden:!1,pending:!1})}))},[]),i=(0,G.useCallback)(e=>!e||!t[e]?{indicator:`none`,hidden:!1,pending:!1}:{...t[e]},[t]),a=(0,G.useMemo)(()=>{let e=Object.keys(t);return e.length>0&&e.some(e=>t[e]?.indicator===`block`)},[t]);return(0,Z.jsx)(Sn.Provider,{value:{getRunnerStateUpdater:r,getRunnerState:i},children:e(a)})},wn=()=>{let e=(0,G.useContext)(Sn);if(!e)throw Error(`useRunnerState must be used within a RunnerStateWrapper`);return e},Tn=(0,G.createContext)(null),En=({children:e,showing:t,showPrompt:n,show:r,onConfirm:i,onHide:a})=>{let[o,s]=(0,G.useState)([]),[c,l]=(0,G.useState)([]),[u,d]=(0,G.useState)([]),f=(0,G.useRef)(void 0),p=(0,G.useRef)(void 0),m=(0,G.useCallback)((e,t)=>{s(n=>[...n,{config:e,cb:t}])},[]),h=(0,G.useCallback)((e,t)=>{l(n=>[...n,{objectId:e,cb:t}])},[]),g=(0,G.useCallback)((e,t,n)=>{d(r=>[...r,{objectId:e,relatedEntityId:t,cb:n}])},[]),_=(0,G.useCallback)(e=>{c[0]?.cb(e),l(e=>e.slice(1))},[c]),v=(0,G.useCallback)(e=>{u[0]?.cb(e),d(e=>e.slice(1))},[u]);(0,G.useEffect)(()=>{o.length>0&&!t&&(f.current=o[0]?.config,p.current=o[0]?.cb,n())},[o,t,n]);let y=(0,G.useCallback)(()=>{f.current=void 0,p.current=void 0,s(e=>e.slice(1))},[]),b=(0,G.useMemo)(()=>({props:{show:r,onConfirm:e=>{i(),p.current&&p.current({canceled:!1,values:e}),y()},onHide:(e,...t)=>{a(...t),p.current&&p.current({canceled:!0,values:{},eventSource:e}),y()}},config:f.current??{}}),[i,a,r,y]);return(0,Z.jsx)(Tn.Provider,{value:{modalState:b,showModal:m,showCreateRecordModal:h,showCreateRelatedRecordModal:g,onCreateRecordComplete:_,onCreateRelatedRecordComplete:v},children:e({showPluginModal:b.props.show,pluginApiName:b.config.pluginApiName??``,handleShowModal:m,handleShowCreateRecordModal:h,handleShowCreateRelatedRecordModal:g,derivedModalState:b,handleCreateRecordComplete:_,handleCreateRelatedRecordComplete:v,showCreateRecordModal:c.length>0,createRecordModalObjectId:c[0]?.objectId??``,showCreateRelatedRecordModal:u.length>0,createRelatedRecordModalObjectId:u[0]?.objectId??``,createRelatedRecordModalRelatedEntityId:u[0]?.relatedEntityId??``})})},Dn=()=>{let e=(0,G.useContext)(Tn);if(!e)throw Error(`useModals must be used within a ModalsWrapper`);return e},On=(0,G.createContext)(null),kn=({children:e,monitoringExceptionHelper:t})=>{let n=(0,G.useCallback)((e,n)=>{t(e,{extra:n})},[t]);return(0,Z.jsx)(On.Provider,{value:{sendException:n},children:e})},An=()=>{let e=(0,G.useContext)(On);if(!e)throw Error(`useMonitoring must be used within an MonitoringWrapper`);return e},jn=(0,G.createContext)(null),Mn=({children:e,onNavigate:t})=>{let n=(0,G.useCallback)(e=>{t(e,{replace:!1})},[t]),r=(0,G.useCallback)(e=>{t(e,{replace:!0})},[t]);return(0,Z.jsx)(jn.Provider,{value:{push:n,replace:r},children:e})},Nn=()=>{let e=(0,G.useContext)(jn);if(!e)throw Error(`useHistory must be used within an HistoryWrapper`);return e},Pn=(0,G.createContext)(null),Fn=({children:e,performRequest:t,createFileId:n,performFileUpload:r,getPendingCacheCount:i,invalidateCache:a})=>(0,Z.jsx)(Pn.Provider,{value:{performRequest:t,createFileId:n,performFileUpload:r,getPendingCacheCount:i,invalidateCache:a},children:e}),In=()=>{let e=(0,G.useContext)(Pn);if(!e)throw Error(`useNetwork must be used within a NetworkWrapper`);return e},Ln=e=>e,Rn=(0,G.createContext)({t:Ln}),zn=e=>{let{children:t,t:n=Ln}=e;return(0,Z.jsx)(Rn.Provider,{value:{t:n},children:t})},Q=()=>(0,G.useContext)(Rn),Bn=(e,t)=>{if(!Array.isArray(e))throw Error(`Return value must be an array`);t.required.forEach(t=>{e.forEach((e,n)=>{if(!(t.key in e))throw Error(`Missing required field: ${t.key} in result row ${String(n)}`);let r=typeof e[t.key];if(r!==t.type)throw Error(`Invalid type for field: ${t.key} in result row ${String(n)}. Expected ${t.type}, got ${r}`)})}),t.optional.forEach(t=>{e.forEach((e,n)=>{if(t.key in e){let r=typeof e[t.key];if(r!==t.type)throw Error(`Invalid type for field: ${t.key} in result row ${String(n)}. Expected ${t.type}, got ${r}`)}})})},Vn=({onError:e,showToast:t,clearToasts:n})=>{let{t:r}=Q(),[i,a]=(0,G.useState)(!1),[o,s]=(0,G.useState)(void 0),{terminators:c}=hn(),{sessionData:l,setSessionData:u}=vn(),{installedPluginAPINamesToIds:d,userConfigsByApiName:f,user:p,teamMember:m,business:h,clientObject:g,appPath:_}=xn(),{getRunnerState:v,getRunnerStateUpdater:y}=wn(),{showModal:b,showCreateRecordModal:x}=Dn(),{sendException:S}=An(),C=Nn(),{performRequest:w,createFileId:T,performFileUpload:E,getPendingCacheCount:D,invalidateCache:O}=In(),k=(0,G.useCallback)(t=>n=>{e?.(n);let r=n?.message??`Unknown plugin error`;S(Error(r),{error:n,workerName:`calendarSource`,pluginApiName:t?.plugin_api_name??``})},[e,S]);return[(0,G.useCallback)(async(i,o,v,S)=>{let A=``,j=V(o);s(j);try{let e=d[o.plugin_api_name];A=JSON.stringify({...v,pluginId:e,__kizen_user_config:f[o.plugin_api_name]})}catch{k(o)({message:r(`Arguments passed to the script are invalid`)})}let M=!1,N=await I({user:p,teamMember:m,business:h,onError:k(o),setLoadingState:a,scriptBody:i,clientObject:g,onStateChange:e=>{y(j)(t=>({...t,...e}))},workerName:`calendarSource`,args:A,pushHistory:C.push,onShowToast:t,onClearToasts:n,terminators:c,plugin:o,sessionData:l,setSessionData:u,onShowModal:b,onShowCreateRecordModal:x,onShowCreateRelatedRecordModal:()=>{},onNetworkError:e=>{e?.status===503&&(M=!0)},appPath:_,onNetworkRequest:w,createFileId:T,performFileUpload:E,getPendingCacheCount:D,invalidateCache:O});try{S&&Bn(N,S)}catch(t){e?.(t)}return{result:N,authError:M}},[p,m,d,h,g,C,t,n,c,l,u,b,x,k,y,f,e,w,T,_,E,D,O,r]),{...v(o),pending:i}]},Hn=(0,G.createContext)(null),Un=({children:e,showToast:t,clearToasts:n})=>(0,Z.jsx)(Hn.Provider,{value:{showToast:t,clearToasts:n},children:e}),Wn=()=>{let e=(0,G.useContext)(Hn);if(!e)throw Error(`useToast must be used within a ToastWrapper`);return e},Gn=async(e,t,n,r)=>{let{result:i,authError:a}=await n(e,t,r,{required:[{key:`id`,type:`string`},{key:`name`,type:`string`}],optional:[{key:`description`,type:`string`}]});return Array.isArray(i)?{result:i,authError:a}:(console.warn(`Expected calendar source script to return an array, but got:`,i),{result:[],authError:a})},Kn=async(e,t,n,r)=>{let{result:i,authError:a}=await n(e,t,r,{required:[{key:`id`,type:`string`},{key:`calendar_id`,type:`string`},{key:`title`,type:`string`},{key:`start_time`,type:`number`},{key:`end_time`,type:`number`}],optional:[{key:`description`,type:`string`},{key:`url`,type:`string`},{key:`activity_id`,type:`string`},{key:`all_day`,type:`boolean`},{key:`busy`,type:`boolean`}]});return Array.isArray(i)?{result:i,authError:a}:(console.warn(`Expected calendar event script to return an array, but got:`,i),{result:[],authError:a})},qn=(e,t,n={})=>{let{showToast:r,clearToasts:i}=Wn(),{t:a}=Q(),[o]=Vn({onError:e=>{r({message:`${a(`Error fetching calendar options.`)} ${e?.message??``}`,variant:`failure`})},showToast:r,clearToasts:i}),s=ae({queries:t.map(t=>({queryKey:H.CALENDAR_SOURCE_CALENDAR_LIST(t.plugin_api_name,t.api_name),queryFn:async()=>{let e=n[t.plugin_api_name]?.business_config??{},{result:r,authError:i}=await Gn(t.calendars_script,t,o,e);return{source:t,calendars:r,authError:i}},enabled:e&&!!t.calendars_script}))}),c=s.some(e=>e.isLoading);return{calendars:(0,G.useMemo)(()=>c||!e?{}:s.reduce((e,t)=>{if(!t.data?.source.plugin_api_name||typeof t.data.source.plugin_api_name!=`string`)return e;let n=t.data.source.plugin_api_name;return e[n]??=[],e[n].push(...t.data.calendars.map(e=>({calendar:e,source:t.data.source}))),e},{}),[s,c,e]),errorServices:(0,G.useMemo)(()=>s.filter(e=>e.data?.authError).map(e=>e.data?.source.plugin_api_name),[s]),isLoading:c}},Jn=`yyyy-MM-dd'T'HH:mm:ssXXX`,Yn=e=>{if(!/^\d{4}-\d{2}-\d{2}$/.test(e))throw Error(`Invalid date string: ${e}. Expected format: YYYY-MM-DD`);let[t,n,r]=e.split(`-`).map(Number);return new Date(t,n-1,r)},Xn=(e,t)=>dn(e,t,Jn),Zn=(e,t,n={})=>{let r=Intl.DateTimeFormat().resolvedOptions().timeZone,i=Xn(Oe(Yn(t.rangeStart)),r),a=Xn(dt(Yn(t.rangeEnd)),r),{showToast:o,clearToasts:s}=Wn(),{t:c}=Q(),[l]=Vn({onError:e=>{o({message:`${c(`Error fetching calendar events.`)} ${e?.message??``}`,variant:`failure`})},showToast:o,clearToasts:s}),u=ae({queries:e.map(({calendar:e,source:r})=>({queryKey:H.CALENDAR_SOURCE_EVENTS(r.plugin_api_name,r.api_name,e.id,t),queryFn:async()=>{let t=n[r.plugin_api_name]?.business_config??{},{result:o,authError:s}=await Kn(r.events_script,r,l,{...t,calendar:{calendar_id:e.id,range_start:i,range_end:a}});return{calendarId:e.id,events:o,authError:s}}}))}),d=u.some(e=>e.isLoading),f=(0,G.useMemo)(()=>e.reduce((e,{calendar:t,source:n})=>(e[t.id]={source:n,calendar:t},e),{}),[e]);return{events:(0,G.useMemo)(()=>d?{}:u.reduce((e,t)=>(t.data?.calendarId&&(e[t.data.calendarId]=t.data.events),e),{}),[u,d]),sources:f,isLoading:d}},Qn=({onError:e,scriptUIRef:t,plugin:n,onChangeMinimized:r})=>{let{terminators:i}=hn(),{sessionData:a,setSessionData:o}=vn(),{installedPluginAPINamesToIds:s,userConfigsByApiName:c,user:l,teamMember:u,business:d,clientObject:f,appPath:p}=xn(),{showModal:m,showCreateRecordModal:h,showCreateRelatedRecordModal:g}=Dn(),{sendException:_}=An(),{showToast:v,clearToasts:y}=Wn(),b=Nn(),{performRequest:x,createFileId:S,performFileUpload:C,getPendingCacheCount:w,invalidateCache:T}=In(),{t:E}=Q(),[D,O]=(0,G.useState)(!1),[k,A]=(0,G.useState)({indicator:`none`,hidden:!0,triggerHidden:!1,hideHeader:!1}),j=(0,G.useRef)(!1),[M,N]=(0,G.useState)(!1);D&&!j.current&&(j.current=!0),!D&&j.current&&!M&&N(!0);let P=(0,G.useCallback)(t=>{e?.(t);let r=t?.message??`Unknown plugin error`;_(Error(r),{error:t,workerName:`floatingFrame`,pluginApiName:n.plugin_api_name})},[e,n,_]);return[(0,G.useCallback)((e,_)=>{let D=``;try{let e=s[n.plugin_api_name];D=JSON.stringify({..._,pluginId:e,__kizen_user_config:c[n.plugin_api_name]})}catch{P({message:E(`Arguments passed to the script are invalid`)})}return I({user:l,teamMember:u,business:d,onError:P,setLoadingState:(...e)=>{(0,fn.flushSync)(()=>{O(...e)})},scriptBody:e,clientObject:f,scriptUIRef:t,onStateChange:e=>{let{minimized:t,...n}=e;typeof t==`boolean`&&r?.(t),A(e=>({...e,...n}))},workerName:`floatingFramePlugin`,args:D,pushHistory:b.push,plugin:n,onShowToast:v,onClearToasts:y,terminators:i,sessionData:a,setSessionData:o,onShowModal:m,onShowCreateRecordModal:h,onShowCreateRelatedRecordModal:g,appPath:p,onNetworkRequest:x,createFileId:S,performFileUpload:C,getPendingCacheCount:w,invalidateCache:T})},[l,u,d,s,f,t,b,n,r,v,y,i,a,o,P,A,c,m,h,g,x,p,S,C,w,T,E]),{...k,pending:M?!1:D}]},$n=({onError:e,scriptUIRef:t,plugin:n})=>{let{terminators:r}=hn(),{sessionData:i,setSessionData:a}=vn(),{installedPluginAPINamesToIds:o,userConfigsByApiName:s,user:c,teamMember:l,business:u,clientObject:d,appPath:f}=xn(),{getRunnerState:p,getRunnerStateUpdater:m}=wn(),{showModal:h,showCreateRecordModal:g}=Dn(),{sendException:_}=An(),{showToast:v,clearToasts:y}=Wn(),b=Nn(),{performRequest:x,createFileId:S,performFileUpload:C,getPendingCacheCount:w,invalidateCache:T}=In(),{t:E}=Q(),[D,O]=(0,G.useState)(!1),[k,A]=(0,G.useState)(void 0),j=(0,G.useCallback)((t,r)=>{e?.(t);let i=t?.message??`Unknown plugin error`;_(Error(i),{error:t,workerName:`genericPlugin`,pluginApiName:n?.plugin_api_name??r?.plugin_api_name??``})},[e,n,_]);return[(0,G.useCallback)((e,p,_)=>{let D=``,k=V(_);A(k);try{let e=o[n?.plugin_api_name??_?.plugin_api_name??``];D=JSON.stringify({...p,pluginId:e,__kizen_user_config:s[n?.plugin_api_name??_?.plugin_api_name??``]})}catch{j({message:E(`Arguments passed to the script are invalid`)})}return I({user:c,teamMember:l,business:u,onError:j,setLoadingState:O,scriptBody:e,clientObject:d,scriptUIRef:t,onStateChange:e=>{m(k)(t=>({...t,...e}))},workerName:`genericPlugin`,args:D,pushHistory:b.push,onShowToast:v,onClearToasts:y,terminators:r,plugin:n,executionPlugin:_,sessionData:i,setSessionData:a,onShowModal:h,onShowCreateRecordModal:g,onShowCreateRelatedRecordModal:()=>{},appPath:f,onNetworkRequest:x,createFileId:S,performFileUpload:C,getPendingCacheCount:w,invalidateCache:T})},[c,l,o,u,d,t,b,v,y,r,n,i,a,j,m,s,h,g,x,f,S,C,w,T,E]),{...p(k),pending:D}]},er=({entityId:e,objectId:t,onError:n,scriptUIRef:r,onReleaseBlockingScript:i})=>{let{terminators:a}=hn(),{sessionData:o,setSessionData:s}=vn(),{installedPluginAPINamesToIds:c,userConfigsByApiName:l,user:u,teamMember:d,business:f,clientObject:p,appPath:m}=xn(),{getRunnerState:h,getRunnerStateUpdater:g}=wn(),{showModal:_,showCreateRecordModal:v,showCreateRelatedRecordModal:y}=Dn(),{sendException:b}=An(),{showToast:x,clearToasts:S}=Wn(),C=Nn(),{performRequest:w,createFileId:T,performFileUpload:E,getPendingCacheCount:D,invalidateCache:O}=In(),{t:k}=Q(),[A,j]=(0,G.useState)(!1),[M,N]=(0,G.useState)(void 0),P=(0,G.useCallback)((r,i)=>{n?.(r);let a=r?.message??`Unknown plugin error`;b(Error(a),{error:r,workerName:`recordDetail`,pluginApiName:i?.plugin_api_name??``,objectId:t,entityId:e})},[n,t,e,b]);return[(0,G.useCallback)((n,h,b,A)=>{let M=``;try{let e=c[b?.plugin_api_name??``];M=JSON.stringify({...h,pluginId:e,__kizen_user_config:l[b?.plugin_api_name??``]})}catch{P({message:k(`Arguments passed to the script are invalid`)},b)}let F=V(b);return N(F),I({user:u,teamMember:d,business:f,onReleaseBlockingScript:i,onError:e=>{P(e,b)},setLoadingState:j,scriptBody:n,clientObject:p,scriptUIRef:r,onStateChange:e=>{g(F)(t=>({...t,...e}))},workerName:`recordDetail`,args:M,context:A??{entityId:e,objectId:t},pushHistory:C.push,onShowToast:x,onClearToasts:S,terminators:a,executionPlugin:b,sessionData:o,setSessionData:s,onShowModal:_,onShowCreateRecordModal:v,onShowCreateRelatedRecordModal:y,appPath:m,onNetworkRequest:w,createFileId:T,performFileUpload:E,getPendingCacheCount:D,invalidateCache:O})},[u,d,c,f,e,t,p,r,C,x,S,a,o,s,_,v,y,i,P,g,l,w,m,T,E,D,O,k]),{...h(M),pending:A}]},tr=(e,t)=>{let{showToast:n}=Wn(),{t:r}=Q(),i=(0,G.useRef)(null),a=(0,G.useRef)(null),o=e?.css,s=(0,G.useMemo)(()=>{let t=e?.html;return t?A.sanitize(t):null},[e]),c=(0,G.useMemo)(()=>e?.event_scripts??{},[e]),[l,{pending:u}]=$n({onError:e=>{n({message:`${r(`Script could not be executed:`)} ${e?.message??`Unknown Error`}`,variant:`failure`})},scriptUIRef:i,plugin:e}),d=(0,G.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),!u){let n=e.target.getAttribute(`data-script`);n&&c[n]&&l(c[n],t)}},[u,l,c,t]);return(0,G.useEffect)(()=>{let e=a.current;return e&&e.addEventListener(`click`,d),()=>{e&&e.removeEventListener(`click`,d)}},[d,e]),{scopedCss:`
|
|
2
|
-
@scope {
|
|
3
|
-
${o??``}
|
|
4
|
-
}
|
|
5
|
-
`,sanitizedHtml:s,outputUIRef:i,interactableScriptRef:a}},nr=(e,t,n,r,i={})=>{let a=(0,G.useMemo)(()=>t?.event_scripts??{},[t]),o=(0,G.useCallback)(t=>{if(t.preventDefault(),t.stopPropagation(),!r){let n=t.target.getAttribute(`data-script`);n&&a[n]&&e(a[n],{...i})}},[r,e,a,i]);(0,G.useEffect)(()=>{let e=n?.current;return e&&e.addEventListener(`click`,o),()=>{e&&e.removeEventListener(`click`,o)}},[o,t,n])},rr=(e,t,n)=>{let r=e?.iframe_url,i=e?.script,a=e?.callback,o=e?.args,{showToast:s}=Wn(),{t:c}=Q(),l=(0,G.useRef)(null),[u,{pending:d}]=$n({onError:e=>{s({message:`${c(`Plugin error:`)} ${e?.message??``}`,variant:`failure`})},scriptUIRef:l,plugin:e}),f=(0,G.useMemo)(()=>{let e=new URLSearchParams(t);return{...Object.fromEntries(e),...o}},[t,o]),{outputUIRef:p,scopedCss:m,sanitizedHtml:h,interactableScriptRef:g}=tr(e,f);nr(u,e,l,d);let _=(0,G.useRef)(!1);(0,G.useEffect)(()=>{!r&&!_.current&&i&&!n&&(_.current=!0,u(i,f))},[r,u,i,f,n]);let v=(0,G.useCallback)(e=>{let t=e.data;if(t?.type===`kizen:plugin_callback`){let e=t.query;a&&u(a,e)}},[u,a]);return(0,G.useEffect)(()=>(window.addEventListener(`message`,v),()=>{window.removeEventListener(`message`,v)}),[v]),{scriptUIRef:l,outputUIRef:p,scopedCss:m,sanitizedHtml:h,interactableScriptRef:g,iframeURL:r,pending:d}},ir=(0,G.createContext)(null),ar=({children:e})=>{let[t,n]=(0,G.useState)([]),[r,i]=(0,G.useState)(!1),a=(0,G.useCallback)((e,t)=>{n(n=>{let r=[e,...n.filter(t=>t!==e)];return t?.(r),r})},[]),o=(0,G.useMemo)(()=>[...t].reverse().reduce((e,t,n)=>({...e,[t]:n}),{}),[t]);return(0,G.useEffect)(()=>{let e=new MutationObserver(()=>{document.querySelector(`div[role="dialog"]`)?i(!0):i(!1)});return e.observe(document.body,{childList:!0}),()=>{e.disconnect()}},[]),(0,Z.jsx)(ir.Provider,{value:{touchFloatingFrame:a,floatingFrameOffset:o},children:e(r)})},or=()=>{let e=(0,G.useContext)(ir);if(!e)throw Error(`useFloatingFrame must be used within a FloatingFrameWrapper`);return e},sr=[`^/$`,`^/login*`,`/settings/mine$`,`/settings/others$`,`/create-new-business$`,`^/choose-business*`,`^/inactive-business$`,`^/reset$`,`/welcome$`,`/embed/*`,`/create-new-business$`,`/businessbuilder`],cr=[`https://js.stripe.com`],lr=(e,t,n,r)=>e<n?t<r?`top-left`:`top-right`:t<r?`bottom-left`:`bottom-right`,ur=e=>{let{currentWindow:t,pathname:n,id:r,frameHeaderSize:i,defaultPositionGap:a=0,viewportHeight:o=window.innerHeight,hiddenByModal:s,updateEmployeeConfig:c}=e,l=(0,G.useRef)(null),u=(0,G.useRef)(!1),{showToast:d}=Wn(),{t:f}=Q(),{installedPluginAPINamesToIds:p,clientObject:m}=xn(),{touchFloatingFrame:h,floatingFrameOffset:g}=or(),_=g[r]??-1,v=t.minimized_style===`none`,y=t.minimized_style===`circle`||v,b=t.default_position===`bottom-right-fixed`,x=t.default_position===`bottom-left-fixed`,S=b||x,C=t.minimized_config?.icon??`action-drag-handle`,w=t.minimized_config?.color??`blue`,T=(0,G.useMemo)(()=>{let e=n.split(`/`),t=e[1],r=e[2];if(t===`client`)return{objectId:m?.id,entityId:r};if(t===`custom-objects`)return{objectId:r,entityId:e[3]}},[m,n]),E=(0,G.useMemo)(()=>{let e=t.match,r=t.ignore;return!!(e?.length&&!e.some(e=>new RegExp(e).test(n))||sr.concat(r??[]).filter(Boolean).some(e=>{try{return new RegExp(e).test(n)}catch{return!1}}))},[t,n]),D=t.plugin_api_name?p[t.plugin_api_name]:``,[O,k]=(0,G.useState)(()=>t.employee_config?.[r]?.minimized??!1),A=t.script,j=t.type,M=t.args,N=t.message_handler,P=t.width??0,[F,I]=(0,G.useState)(()=>{let e=window.innerHeight;return Math.min(t.height??0,e-i)}),[L,R]=(0,G.useState)(null),ee=t.default_position,z=(0,G.useCallback)(e=>{let n=t.employee_config?.[r]?.position;if(!n?.quadrant){let t=window.innerWidth-P,r=window.innerHeight-F-i;if(O&&!e&&(r=window.innerHeight-i),n)try{let e=n;return e.left>t&&(e.left=t),e.top>r&&(e.top=r),e.left<0&&(e.left=a),e.top<0&&(e.top=a),e}catch{}let o=t;return ee===`bottom-left`&&(o=a),{left:o,top:r-a}}else if(n.quadrant===`top-left`){let e=n.deltas?.left??0,t=n.deltas?.top??0;return{...n,left:e,top:t}}else if(n.quadrant===`top-right`){let e=window.innerWidth-P-(n.deltas?.right??0),t=n.deltas?.top??0;return{...n,left:e,top:t}}else if(n.quadrant===`bottom-left`){let e=n.deltas?.left??0,t=window.innerHeight-(O?0:F)-(n.deltas?.bottom??0)-i;return{...n,left:e,top:t}}else{let e=window.innerWidth-P-(n.deltas?.right??0),t=window.innerHeight-(O?0:F)-(n.deltas?.bottom??0)-i;return{...n,left:e,top:t}}},[t,r,ee,O,P,F,i,a]),te=(0,G.useCallback)(e=>{let t=z(e),n=[`bottom-right`,`bottom-left`].includes(t.quadrant??``)&&O?0:F;return t.left<0?t.left=0:t.left>window.innerWidth-P&&(t.left=window.innerWidth-P),t.top<0?t.top=0:t.top>window.innerHeight-n&&(t.top=window.innerHeight-n),t},[z,P,F,O]);(0,G.useEffect)(()=>{let e=t.height??0;if(e>o){I(o-i);let e=z(!0);e.top=0,R(e)}else I(e)},[t.height,z,o,i]);let[B,V]=(0,G.useState)(O),[ne,H]=(0,G.useState)(O&&y),re=F*5e-4*1e3,U=e=>{k(e),e&&y?setTimeout(()=>{H(e)},re):y&&H(e),s?setTimeout(()=>{V(e)},re):V(e),(L?.quadrant===`bottom-left`||L?.quadrant===`bottom-right`)&&R(e?e=>e?{...e,top:e.top+F}:null:e=>{if(!e)return null;let t=window.innerHeight,n=e.top>=0&&e.top+F<=t;return{...e,top:n?e.top:e.top-F}}),c?.(r,O,L)({minimized:e})},[W,{pending:ie,hidden:ae,indicator:se,triggerHidden:ce,hideHeader:le}]=Qn({onError:e=>{d({message:`${f(`Plugin error:`)} ${e?.message??``}`,variant:`failure`})},scriptUIRef:l,plugin:t,onChangeMinimized:e=>{U(e)}}),ue=(0,G.useMemo)(()=>le&&S,[le,S]),de=(0,G.useMemo)(()=>{if(!L)return`top`;let{left:e,top:t}=L;return window.innerWidth-(e+P)<40?`left`:t<40?`bottom`:`top`},[L,P]),fe=(0,G.useCallback)(()=>{let e=x?`left`:`right`,n=`${t.plugin_api_name}-${t.api_name}-trigger-${e}`;return document.getElementById(n)},[x,t]),K=(0,G.useCallback)(()=>{if(!S)return;let e=fe();if(!e)return;let t=e.getBoundingClientRect(),n=O?0:F,r=ue?0:i,o=t.top-(n+r)-a,s=x?t.left:t.right-P,c=n+r,l=Math.max(0,window.innerWidth-P),u=Math.max(0,window.innerHeight-c);s=Math.min(Math.max(0,s),l),o=Math.min(Math.max(0,o),u),R({left:s,top:o,quadrant:x?`bottom-left`:`bottom-right`,deltas:{top:o,left:s,right:window.innerWidth-(s+P),bottom:window.innerHeight-(o+c)}})},[S,x,F,O,P,ue,fe,i,a]);(0,G.useEffect)(()=>{S&&K()},[S,F,O,K]),(0,G.useEffect)(()=>{if(!S)return;K();let e=new ResizeObserver(()=>{K()});return e.observe(document.body),()=>{e.disconnect()}},[S,K]),(0,G.useEffect)(()=>{!u.current&&A&&j===`script`&&!E&&(u.current=!0,W(A,{...M}))},[W,A,j,M,E]),(0,G.useEffect)(()=>{let e=e=>{let n=e;if(n?.detail?.recipient?.frame===t.api_name){let e=n.detail;if(e.recipient?.plugin!==t.plugin_api_name)return;e.recipient.script&&t.event_scripts?.[e.recipient.script]&&W(t.event_scripts[e.recipient.script]??``,{...e.args,...M,...T})}};return window.addEventListener(oe,e),()=>{window.removeEventListener(oe,e)}},[t,W,M,T]);let[pe,me]=(0,G.useState)(!1),he=(e,t)=>{me(!1),h(r);let n=window.innerWidth,i=window.innerHeight;if(t.node){let e=t.node.getBoundingClientRect(),a=e.left,o=e.top,s=o+e.height,l=a+e.width,u=o,d=i-s,f=a,p=n-l,m={left:a,right:l,top:o,quadrant:lr(u,f,d,p),deltas:{top:u,bottom:d,left:f,right:p}};R(m),c?.(r,O,L)({position:m})}};(0,G.useEffect)(()=>{let e=()=>{S?K():R(te(!1))};return window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e)}},[S,K,te]),nr(W,t,l,ie,M),(0,G.useEffect)(()=>{let e=e=>{e.source!==window&&N&&!cr.includes(e.origin)&&W(N,{...M,eventData:e.data})};return window.addEventListener(`message`,e),()=>{window.removeEventListener(`message`,e)}},[W,M,N]);let{outputUIRef:ge,scopedCss:_e,sanitizedHtml:ve,interactableScriptRef:ye}=tr(t,{}),be=B?ae||E||s:ae||E,xe=`floating-window-parent--${r}`,Se=`floating-drag-handle--${r}`,Ce=`floating-window-content--${r}`,we=t.employee_config?.[r]?.position?.quadrant?.split(`-`)[1]===`right`?`right`:`left`;x?we=`left`:b&&(we=`right`);let Te=t.minimized_config?.customIcon,q=null;return Te?.startsWith(`data:image/`)&&(q=({className:e=``})=>(0,Z.jsx)(`img`,{src:Te,alt:t.title||`Open Frame`,className:`object-cover select-none pointer-events-none ${e}`})),L||R(te(!1)),{circleProps:{id:r,side:we,circleIcon:C,CustomIcon:q,circleColor:w,onClick:()=>{U(!O)},hidden:!!(be||E||v||ce)},parentProps:{className:xe,dragging:pe,hidden:be||ne||E||v},draggableProps:{onStop:he,onStart:()=>{me(!0)},bounds:`.${xe}`,handle:`.${Se}`,defaultPosition:{x:L?.left??0,y:L?.top??0},position:{x:L?.left??0,y:L?.top??0},disabled:S},floatProps:{pending:ie,width:P,dragging:pe,height:F,isCircle:y&&O},contentProps:{className:Ce,dragging:pe,solid:!0},minimized:O,pending:ie,indicator:se,hideHeader:ue,isFixed:S,isCircle:y,outputUIRef:ge,scopedCss:_e,sanitizedHtml:ve,interactableScriptRef:ye,tooltipPosition:de,currentPluginId:D,setMinimized:U,dragHandleClassName:Se,height:F,script:A,dragging:pe,frameOffset:_,scriptUIRef:l}},dr=()=>{(0,G.useEffect)(()=>{let e=null,t=t=>{if(!t.detail?.location)return;let n=B(t.detail.location);n!==e&&(e=n,document.querySelectorAll(`iframe[id^=${j}-]`).forEach(e=>{let n=null;try{n=new URL(e.src,window.location.href).origin}catch(e){N(`script-runner-logging`)&&console.warn(`Failed to parse iframe src for location change message target origin:`,e),n=null}n&&e.contentWindow?.postMessage({action:k,location:t.detail?.location},n)}))};return window.addEventListener(O,t),()=>{window.removeEventListener(O,t)}},[])},fr=[],pr=[],mr=new E,hr=({children:e})=>(0,G.useContext)(x)?(0,Z.jsx)(Z.Fragment,{children:e}):(0,Z.jsx)(f,{client:mr,children:e}),gr=e=>{let{children:t,bootstrapPlugins:n,userConfigs:r,user:i,teamMember:a,business:o,clientObject:s,onNavigate:c,modal:l,monitoringExceptionHelper:u,showToast:d,clearToasts:f,performRequest:p,appPath:m,hideFramesOnModal:h=!0,createFileId:g,performFileUpload:_,t:v,invalidateCache:y,getPendingCacheCount:b}=e;return dr(),(0,Z.jsx)(hr,{children:(0,Z.jsx)(bn,{bootstrapPlugins:n??fr,userConfigs:r??pr,user:i,teamMember:a,business:o,clientObject:s,appPath:m,children:({hasFinishedBootstrapping:e,waitingOnRouteScript:n})=>(0,Z.jsx)(zn,{t:v,children:(0,Z.jsx)(Cn,{children:r=>(0,Z.jsx)(Mn,{onNavigate:c,children:(0,Z.jsx)(En,{...l,children:i=>(0,Z.jsx)(kn,{monitoringExceptionHelper:u,children:(0,Z.jsx)(_n,{children:(0,Z.jsx)(mn,{children:(0,Z.jsx)(Un,{showToast:d,clearToasts:f,children:(0,Z.jsx)(ar,{children:a=>(0,Z.jsx)(Fn,{performRequest:p,createFileId:g,performFileUpload:_,invalidateCache:y,getPendingCacheCount:b,children:t({...i,showLoadingIndicator:r,hasFinishedBootstrapping:e,waitingOnRouteScript:n,hiddenByModal:h?a:!1})})})})})})})})})})})})})},_r=(0,G.createContext)(null),vr=_r.Provider,yr=(e,t)=>{if(e===`custom_object`)return t?.id},br=(e,t)=>{if(e.type===`custom_object`)return e.allow_multiple?(t?.value??[]).length>0:!!t?.value?.id;if(e.type===`field`)return e.allow_multiple?(t?.value??[]).length>0:!!t?.value?.value;if(e.type===`text`)return!!(t?.value??``).trim();if(e.type===`number`){let e=Number(t?.value);return!!t?.value&&!isNaN(e)}else if(e.type===`select`)return e.allow_multiple?(t?.value??[]).length>0:!!t?.value?.value;else if(e.type===`boolean`)return!!t?.value;return!1},xr=e=>{let t=(e.fields??[]).filter(e=>e.type===`custom_object`),n=(e.fields??[]).filter(e=>e.type===`container`).flatMap(e=>xr(e)),r=e.actions?.filter(e=>e.hint_object_name)??[];return[...t,...n,...r.map(e=>({...R(e),match_hint:e.hint_object_name??``}))]},Sr=e=>{let t=(e.fields??[]).filter(e=>e.type===`field`),n=(e.fields??[]).filter(e=>e.type===`container`).flatMap(e=>Sr(e));return[...t,...n]},Cr=({children:e,config:t,value:n,onStateChange:r,disabledKeys:i,templateAssociationsByActionApiName:a,getObjectByAPIName:o,getCustomObjectDetails:s})=>{let[c,l]=(0,G.useState)(n??{}),u=(0,G.useMemo)(()=>M(t),[t]),d=(0,G.useMemo)(()=>u.reduce((e,t)=>({...e,[t.key]:{type:t.type,value:t.default}}),{}),[u]),f=(0,G.useMemo)(()=>{let e={...Object.entries(a??{}).reduce((e,[t,n])=>{let r=`action__${t}`,i=n.map(e=>({id:e.custom_object.id??``,objectName:e.custom_object.object_name??`Unknown Object`}));return i.length>0&&n.length>0&&n[0]&&(e[r]={type:`custom_object`,value:i,config:R(n[0].browser_js_action_template)}),e},{}),...c};return i?.forEach(t=>{e[t]&&(e[t]=void 0)}),e},[c,a,i]),p=(0,G.useRef)(!!n),m=(0,G.useRef)({}),[h,g]=(0,G.useState)(!n),[_,v]=(0,G.useState)({}),[y,b]=(0,G.useState)({}),[x,S]=(0,G.useState)(!1),C=(0,G.useRef)(null),[w,T]=(0,G.useState)({}),[E,D]=(0,G.useState)(!1),[O,k]=(0,G.useState)(!0),A=(0,G.useRef)({}),j=(0,G.useCallback)((e,t)=>{A.current[e]=t},[]),N=(0,G.useCallback)(e=>{typeof e==`function`?l(t=>{let n=e(t);return m.current=n,r?.(n),n}):(m.current=e,l(e),r?.(e)),T({})},[r]),F=(0,G.useCallback)((e,t)=>{if(e.startsWith(`{{`)&&e.endsWith(`}}`)){let n=e.slice(2,-2).trim();return yr(t[n]?.type,t[n]?.value)}return e},[]),I=(0,G.useCallback)(e=>F(e,f),[f,F]),{clientObject:L}=xn(),ee=(0,G.useCallback)(async e=>e===`client_client`&&L?[{id:L.id,object_name:L.objectName}]:await o(e),[L,o]),z=(0,G.useCallback)(async()=>{let e=xr(t);for(let t of e){if(!t.match_hint)continue;let e=await ee(t.match_hint);if(e?.[0]){let n={id:e[0].id,objectName:e[0].object_name};N(e=>({...e,[t.key]:{type:`custom_object`,value:t.allow_multiple?[n]:n}}))}}},[t,N,ee]),te=(0,G.useCallback)(()=>Sr(t),[t]),B=(0,G.useCallback)(async(e,t)=>{let n=te(),r={};for(let i of n){if(!i.object_id)continue;let n=t??F(i.object_id,m.current);if(e&&!i.object_id.includes(e))continue;if(!r[n]&&n)try{r[n]=await s(n)}catch{}let a=r[n];if(a){let e=a.fields.find(e=>e.name===i.match_hint);e&&N(t=>({...t,[i.key]:{type:`field`,value:{value:e.id,label:e.displayName},associatedObject:{id:n,name:a.objectName}}}))}}},[F,te,N,s]),V=(0,G.useCallback)(async e=>{let n=xr(t).find(t=>t.key===e);if(n?.match_hint){let t=``,r=(await ee(n.match_hint))?.[0];r&&(t=r.id,N(t=>({...t,[e]:{type:`custom_object`,value:{id:r.id,objectName:r.object_name}}})),t&&B(void 0,t))}},[t,N,B,ee]),ne=(0,G.useCallback)(async()=>{await z(),await B(),g(!1)},[z,B]),H=(0,G.useCallback)(()=>Sr(t),[t]),re=(0,G.useCallback)(e=>B(e),[B]),U=(0,G.useCallback)(()=>{C.current&&=(clearTimeout(C.current),null),C.current=setTimeout(()=>{S(!0)},500)},[]),W=(0,G.useCallback)(async(e,t)=>{U(),v(e=>({...e,[t]:!0})),D(!0);let n=await P(e,{...d,...f});return b(e=>(e[t]===!1&&typeof n==`boolean`&&n&&(f[t]||V(t)),{...e,[t]:n})),v(e=>({...e,[t]:!1})),n},[f,U,V,d]);p.current||(p.current=!0,ne());let ie=(0,G.useCallback)(e=>y[e]===!1,[y]),ae=(0,G.useCallback)(e=>_[e]===!0,[_]),oe=(0,G.useCallback)(e=>{if(w[e])return{message:w[e],showMessage:!0,error:!0}},[w]),se=(0,G.useMemo)(()=>{let e=(t.fields??[]).filter(e=>e.type===`container`).map(e=>e.when),n=u.map(e=>e.when);return[...e,...n].filter(Boolean)},[t,u]),ce=(0,G.useMemo)(()=>u.reduce((e,t)=>(e[t.key]=t,e),{}),[u]),le=(0,G.useCallback)((e,t,n)=>{t.add(e);let r=ce[e];r?.dependencies?.length&&r.dependencies.forEach(e=>{n.has(e)||(n.add(e),le(e,t,n))})},[ce]),ue=(0,G.useMemo)(()=>u.map(e=>{let t=new Set,n=e.dependencies??[],r=new Set;return n.forEach(e=>{le(e,t,r)}),{...e,dependencies:Array.from(t)}}),[u,le]),de=(0,G.useCallback)(e=>{ue.filter(t=>t.dependencies.length===0?!1:t.dependencies.includes(e)&&t.key!==e).forEach(e=>{A.current[e.key]?.()})},[ue]),fe=(0,G.useCallback)(async()=>{let e=(await Promise.all(u.map(async e=>e.when?await P(e.when,{...d,...f})?e:null:e))).filter(Boolean),t=0;for(let n of e)n&&n.required&&!br(n,f[n.key])?(T(e=>({...e,[n.key]:`This field is required`})),t++):n?.validation_pattern?new RegExp(n.validation_pattern).test(f[n.key]?.value??n.default??``)||(T(e=>({...e,[n.key]:`Value must match the pattern ${n.validation_pattern??``}`})),t++):n&&T(e=>({...e,[n.key]:void 0}));return{isValid:t===0,includedKeys:e.map(e=>e?.key).filter(e=>!!e)}},[f,u,d]);(0,G.useEffect)(()=>{U()},[U]);let K=Object.values(_).filter(Boolean).length;return!E&&se.length===0&&D(!0),E&&O&&K===0&&k(!1),(0,Z.jsx)(vr,{value:{state:f,setState:N,interpolateValue:I,getNestedFields:H,reInferFieldsForObject:re,inferencePending:h,evaluateExpression:W,shouldHideField:ie,shouldDisableField:ae,expressionsIdle:x,getFieldErrorState:oe,validateForm:fe,waitingExpressionCount:K,initialExpressionsPending:O,flattenedFields:u,flattenedFieldsByKey:ce,afterFieldChange:de,registerFieldResetter:j,disabledKeys:i??[]},children:e})},wr=()=>{let e=(0,G.useContext)(_r);if(!e)throw Error(`useSetupAssistant must be used within a SetupAssistantController`);return e};function Tr(e,t=!1){let n=wr(),{evaluateExpression:r,shouldHideField:i,getFieldErrorState:a,disabledKeys:o}=n;(0,G.useEffect)(()=>{e.when&&r(e.when,e.key)},[e.when,e.key,r]);let s=i(e.key),c=o.includes(e.key)||t,l=a(e.key);return{...n,shouldHide:s,isDisabled:c,errorState:l}}var Er=({field:e,disabled:t=!1})=>{let{state:n,setState:r,afterFieldChange:i,registerFieldResetter:a,isDisabled:o,shouldHide:s,errorState:c}=Tr(e,t),l=n[e.key]?.value??e.default??!1,u=l===!0||l===`true`,d=(0,G.useCallback)(t=>{r(n=>({...n,[e.key]:{type:`boolean`,value:t}})),i(e.key)},[e.key,r,i]);return(0,G.useEffect)(()=>{a(e.key,()=>{d(void 0)})},[e.key,a,d]),s?null:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsxs)(`label`,{className:`flex items-center gap-2 cursor-pointer`,children:[(0,Z.jsx)(`input`,{type:`checkbox`,checked:u,onChange:e=>{d(e.target.checked)},disabled:o,className:`h-3.5 w-3.5 cursor-pointer accent-blue-600`}),(0,Z.jsxs)(`span`,{className:`text-[13px] ${o?`text-neutral-400`:`text-neutral-700`}`,children:[e.label,e.required&&(0,Z.jsx)(`span`,{className:`text-red-500 ml-0.5`,children:`*`})]}),e.tooltip&&(0,Z.jsx)(`span`,{className:`text-[11px] text-neutral-400`,title:e.tooltip,children:`?`})]}),c?.showMessage&&c.message&&(0,Z.jsx)(`span`,{className:`text-[11px] text-red-500`,children:c.message})]})},Dr=({field:e,pluginApiName:t,disabled:n=!1})=>{let{shouldHide:r}=Tr(e,n),i=e.columns??1;return r?null:(0,Z.jsxs)(`div`,{children:[e.label&&(0,Z.jsx)(`h3`,{className:`text-[14px] font-semibold text-neutral-800 mb-3 mt-4`,children:e.label}),(0,Z.jsx)(`div`,{className:`gap-4`,style:{display:`grid`,gridTemplateColumns:`repeat(${String(i)}, 1fr)`},children:e.fields?.map(e=>(0,Z.jsx)(Ir,{field:e,pluginApiName:t,disabled:n},e.key))})]})},$=({field:e})=>e.label?(0,Z.jsxs)(`label`,{className:`text-[12px] font-medium text-neutral-600`,children:[e.label,e.required&&(0,Z.jsx)(`span`,{className:`text-red-500 ml-0.5`,children:`*`}),e.tooltip&&(0,Z.jsx)(`span`,{className:`ml-1 text-neutral-400 cursor-help`,title:e.tooltip,children:`?`})]}):null,Or=({label:e,value:t,onChange:n,onSelect:a,options:o,loading:s,placeholder:c,disabled:l,keepOpenOnSelect:u})=>{let[d,f]=(0,G.useState)(!1),p=(0,G.useRef)(null);return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e&&(0,Z.jsx)(`label`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-500`,children:e}),(0,Z.jsxs)(`div`,{ref:p,className:`relative`,children:[(0,Z.jsx)(r,{icon:i,className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-[10px] text-neutral-400`}),(0,Z.jsx)(`input`,{type:`text`,className:`w-full rounded border border-black/10 bg-white py-1.5 pl-7 pr-2.5 font-mono text-[12px] text-neutral-800 focus:border-neutral-400 focus:outline-none disabled:opacity-50`,value:t,placeholder:c,disabled:l,onChange:e=>{n(e.target.value)},onFocus:()=>{f(!0)},onBlur:()=>{f(!1)}})]}),(0,Z.jsxs)(D,{anchorRef:p,open:d,children:[s&&(0,Z.jsx)(`div`,{className:`px-3 py-2 text-[12px] text-neutral-400`,children:`Loading…`}),!s&&o.length===0&&t.length===0&&(0,Z.jsx)(`div`,{className:`px-3 py-2 text-[12px] text-neutral-400`,children:`Start typing to search…`}),!s&&o.length===0&&t.length>0&&(0,Z.jsx)(`div`,{className:`px-3 py-2 text-[12px] text-neutral-400`,children:`No results`}),!s&&o.map(e=>(0,Z.jsx)(`div`,{className:`cursor-pointer px-3 py-2 text-[12px] text-neutral-800 hover:bg-neutral-100`,onClick:()=>{a(e.id,e.label),u||f(!1)},children:e.label},e.id))]})]})},kr=({field:e,disabled:t=!1})=>{let{state:n,setState:r,getNestedFields:i,reInferFieldsForObject:a,shouldDisableField:o,registerFieldResetter:s,afterFieldChange:c,isDisabled:l,shouldHide:u,errorState:d}=Tr(e,t),f=o(e.key)||l,[p,m]=(0,G.useState)(``),[h,g]=(0,G.useState)([]),[_,v]=(0,G.useState)(!1),y=(0,G.useRef)(null),b=L(),x=T(),S=(0,G.useCallback)(async e=>{v(!0);try{let t=new URLSearchParams({page_size:`20`});e&&t.set(`search`,e);let n=await(await b(`/custom-objects?${t.toString()}`)).json(),r=(Array.isArray(n)?n:n.results??[]).map(e=>({id:e.id,label:e.object_name})),i=x?.business.client_object;i?.access&&(!e||i.object_name.toLowerCase().includes(e.toLowerCase()))&&r.unshift({id:i.id,label:i.object_name}),g(r)}catch{}finally{v(!1)}},[b,x]),C=e.allow_multiple?n[e.key]?.value??[]:[],w=(0,G.useCallback)((t,i)=>{let a=n[e.key]?.value??[];a.some(e=>e.id===t)||(r(n=>({...n,[e.key]:{type:`custom_object`,value:[...a,{id:t,objectName:i}]}})),c(e.key),m(``))},[n,e.key,r,c]),E=(0,G.useCallback)(t=>{let i=n[e.key]?.value??[];r(n=>({...n,[e.key]:{type:`custom_object`,value:i.filter(e=>e.id!==t)}})),c(e.key)},[n,e.key,r,c]),D=e.allow_multiple?void 0:n[e.key]?.value,O=(0,G.useRef)(!1);(0,G.useEffect)(()=>{!e.allow_multiple&&D?.objectName&&!O.current&&(m(D.objectName),O.current=!0)},[e.allow_multiple,D]);let k=(0,G.useCallback)(t=>{m(t),D&&(r(t=>Object.fromEntries(Object.entries(t).filter(([t])=>t!==e.key))),c(e.key)),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{S(t)},300)},[D,e.key,r,c,S]),A=(0,G.useCallback)((t,n)=>{m(n),r(r=>({...r,[e.key]:{type:`custom_object`,value:{id:t,objectName:n}}}));let o=i().filter(t=>t.object_id?.includes(e.key));for(let e of o)r(t=>Object.fromEntries(Object.entries(t).filter(([t])=>t!==e.key)));a(e.key),c(e.key)},[e.key,r,i,a,c]),j=(0,G.useCallback)(t=>{e.allow_multiple?(m(t),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{S(t)},300)):k(t)},[e.allow_multiple,k,S]),M=(0,G.useCallback)((t,n)=>{e.allow_multiple?w(t,n):A(t,n)},[e.allow_multiple,w,A]);if((0,G.useEffect)(()=>{s(e.key,()=>{r(t=>Object.fromEntries(Object.entries(t).filter(([t])=>t!==e.key))),m(``),O.current=!1})},[e.key,s,r]),u)return null;if(e.allow_multiple){let t=h.filter(e=>!C.some(t=>t.id===e.id));return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)($,{field:e}),C.length>0&&(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-1 mb-1`,children:C.map(e=>(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded bg-neutral-100 px-2 py-0.5 text-[11px] text-neutral-700`,children:[e.objectName,(0,Z.jsx)(`button`,{type:`button`,onClick:()=>{E(e.id)},disabled:f,className:`text-neutral-400 hover:text-neutral-600`,"aria-label":`Remove ${e.objectName}`,children:`×`})]},e.id))}),(0,Z.jsx)(Or,{value:p,onChange:j,onSelect:M,options:t,loading:_,placeholder:e.placeholder??`Search for objects...`,disabled:f,keepOpenOnSelect:!0}),d?.showMessage&&d.message&&(0,Z.jsx)(`span`,{className:`text-[11px] text-red-500`,children:d.message})]})}return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)($,{field:e}),(0,Z.jsxs)(`div`,{className:`relative`,children:[(0,Z.jsx)(Or,{value:p,onChange:j,onSelect:M,options:h,loading:_,placeholder:e.placeholder??`Search for an object...`,disabled:f}),D&&(0,Z.jsx)(`button`,{type:`button`,onClick:()=>{r(t=>Object.fromEntries(Object.entries(t).filter(([t])=>t!==e.key))),m(``),O.current=!1,c(e.key)},disabled:f,className:`absolute right-2 top-1/2 -translate-y-1/2 text-[11px] text-neutral-400 hover:text-neutral-600`,"aria-label":`Clear selection`,children:`×`})]}),d?.showMessage&&d.message&&(0,Z.jsx)(`span`,{className:`text-[11px] text-red-500`,children:d.message})]})},Ar=({field:e})=>{let{shouldHide:t}=Tr(e);return t?null:(0,Z.jsx)(`div`,{className:`text-[13px] text-neutral-500 leading-relaxed`,children:e.content})},jr=({field:e,disabled:t=!1})=>{let{interpolateValue:n,state:r,setState:i,registerFieldResetter:a,afterFieldChange:o,isDisabled:s,shouldHide:c,errorState:l}=Tr(e,t),u=n(e.object_id??``),[d,f]=(0,G.useState)([]),[p,m]=(0,G.useState)(``),[h,g]=(0,G.useState)(!1),[_,v]=(0,G.useState)(null),y=L();(0,G.useEffect)(()=>{!u||u===_||c||(async()=>{g(!0);try{m((await(await y(`/custom-objects/${u}`)).json()).object_name??``);let e=await(await y(`/custom-objects/${u}/fields`)).json();f((Array.isArray(e)?e:e.results??[]).map(e=>({label:e.display_name,value:e.id}))),v(u)}catch{}finally{g(!1)}})()},[u,_,y,e.key,c]);let b=r[e.key]?.value,x=(0,G.useCallback)(t=>{i(n=>({...n,[e.key]:{type:`field`,value:t,associatedObject:{id:u,name:p}}})),o(e.key)},[e.key,i,u,p,o]);if((0,G.useEffect)(()=>{a(e.key,()=>{i(t=>Object.fromEntries(Object.entries(t).filter(([t])=>t!==e.key)))})},[e.key,a,i]),c)return null;let S=!u||s;if(e.allow_multiple){let t=Array.isArray(b)?b:[];return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)($,{field:e}),(0,Z.jsx)(`div`,{className:`rounded border p-2 text-[13px] ${l?.error?`border-red-300`:`border-black/10`} ${S?`bg-neutral-50`:`bg-white`}`,children:h&&d.length===0?(0,Z.jsx)(`span`,{className:`text-neutral-400 text-[12px]`,children:`Loading fields...`}):u?d.length===0?(0,Z.jsx)(`span`,{className:`text-neutral-400 text-[12px]`,children:`No fields available`}):(0,Z.jsx)(`div`,{className:`flex flex-col gap-1 max-h-48 overflow-y-auto transition-opacity ${h?`opacity-60`:``}`,children:d.map(e=>{let n=t.some(t=>t.value===e.value);return(0,Z.jsxs)(`label`,{className:`flex items-center gap-2 cursor-pointer`,children:[(0,Z.jsx)(`input`,{type:`checkbox`,checked:n,disabled:S,onChange:()=>{x(n?t.filter(t=>t.value!==e.value):[...t,e])},className:`h-3 w-3 accent-blue-600`}),(0,Z.jsx)(`span`,{className:`text-[12px]`,children:e.label})]},e.value)})}):(0,Z.jsx)(`span`,{className:`text-neutral-400 text-[12px]`,children:`Select an object first`})}),l?.showMessage&&l.message&&(0,Z.jsx)(`span`,{className:`text-[11px] text-red-500`,children:l.message})]})}let C=b&&!Array.isArray(b)?b.value:``;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)($,{field:e}),h&&d.length===0?(0,Z.jsx)(`div`,{className:`w-full rounded border border-black/10 px-2 py-1.5 text-[12px] text-neutral-400 bg-neutral-50`,children:`Loading fields...`}):(0,Z.jsxs)(`select`,{value:C,onChange:e=>{let t=d.find(t=>t.value===e.target.value);t&&x(t)},disabled:S,className:`w-full rounded border px-2 py-1.5 text-[13px] font-mono focus:outline-none focus:ring-1 transition-opacity ${l?.error?`border-red-300 focus:ring-red-400`:`border-black/10 focus:ring-blue-400`} ${S?`bg-neutral-50 text-neutral-400`:`bg-white`} ${h?`opacity-60`:``}`,children:[(0,Z.jsx)(`option`,{value:``,children:u?`Choose a field`:`Select an object first`}),d.map(e=>(0,Z.jsx)(`option`,{value:e.value,children:e.label},e.value))]}),l?.showMessage&&l.message&&(0,Z.jsx)(`span`,{className:`text-[11px] text-red-500`,children:l.message})]})},Mr=({field:e,disabled:t=!1})=>{let{state:n,setState:r,afterFieldChange:i,registerFieldResetter:a,isDisabled:o,shouldHide:s,errorState:c}=Tr(e,t),l=n[e.key]?.value??e.default??``,[u,d]=(0,G.useState)(String(l)),f=(0,G.useCallback)(t=>{r(n=>({...n,[e.key]:{type:`number`,value:t}})),i(e.key)},[e.key,r,i]);return(0,G.useEffect)(()=>{a(e.key,()=>{d(``),f(``)})},[e.key,a,f]),(0,G.useEffect)(()=>{let e=setTimeout(()=>{f(u)},300);return()=>{clearTimeout(e)}},[u,f]),s?null:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)($,{field:e}),(0,Z.jsx)(`input`,{type:`number`,value:u,onChange:e=>{d(e.target.value)},placeholder:e.placeholder??e.default??`Enter a number`,disabled:o,className:`rounded border px-2 py-1.5 text-[13px] font-mono focus:outline-none focus:ring-1 ${c?.error?`border-red-300 focus:ring-red-400`:`border-black/10 focus:ring-blue-400`} ${o?`bg-neutral-50 text-neutral-400`:`bg-white`}`}),c?.showMessage&&c.message&&(0,Z.jsx)(`span`,{className:`text-[11px] text-red-500`,children:c.message})]})},Nr=(0,G.createContext)(()=>{}),Pr=()=>(0,G.useContext)(Nr),Fr={container:Dr,custom_object:kr,field:jr,text:({field:e,disabled:t=!1})=>{let{state:n,setState:r,afterFieldChange:i,registerFieldResetter:a,isDisabled:o,shouldHide:s,errorState:c}=Tr(e,t),[l,u]=(0,G.useState)(n[e.key]?.value??e.default??``),d=(0,G.useCallback)(t=>{r(n=>({...n,[e.key]:{type:`text`,value:t}})),i(e.key)},[e.key,r,i]);return(0,G.useEffect)(()=>{a(e.key,()=>{u(``),d(``)})},[e.key,a,d]),(0,G.useEffect)(()=>{let e=setTimeout(()=>{d(l)},300);return()=>{clearTimeout(e)}},[l,d]),s?null:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)($,{field:e}),(0,Z.jsx)(`input`,{type:`text`,value:l,onChange:e=>{u(e.target.value)},placeholder:e.placeholder??e.default??`Enter text`,disabled:o,className:`rounded border px-2 py-1.5 text-[13px] font-mono focus:outline-none focus:ring-1 ${c?.error?`border-red-300 focus:ring-red-400`:`border-black/10 focus:ring-blue-400`} ${o?`bg-neutral-50 text-neutral-400`:`bg-white`}`}),c?.showMessage&&c.message&&(0,Z.jsx)(`span`,{className:`text-[11px] text-red-500`,children:c.message})]})},description:Ar,number:Mr,select:({field:e,pluginApiName:t,disabled:n=!1})=>{let{state:r,setState:i,inferencePending:a,initialExpressionsPending:o,expressionsIdle:s,afterFieldChange:c,registerFieldResetter:l,isDisabled:u,shouldHide:d,errorState:f}=Tr(e,n),p=Pr(),m=!a&&!o&&s,[h,g]=(0,G.useState)({}),[_,v]=(0,G.useState)(!1),y=(0,G.useRef)(new Set),b=(0,G.useRef)(void 0),[x,S]=(0,G.useState)(``),[C,w]=(0,G.useState)(``),[T,E]=(0,G.useState)(!1),O=(0,G.useRef)(null),k=!!(e.getFetchUrl||e.optionMapper),A=r[e.key]?.value,j=L(),M=(0,G.useMemo)(()=>ne(j),[j]),N=(0,G.useCallback)(t=>{i(n=>({...n,[e.key]:{type:`select`,value:t}})),c(e.key)},[c,e.key,i]);(0,G.useEffect)(()=>{l(e.key,()=>{i(t=>Object.fromEntries(Object.entries(t).filter(([t])=>t!==e.key))),S(``),w(``)})},[e.key,l,i]),(0,G.useEffect)(()=>{if(!e.typeahead)return;let t=setTimeout(()=>{w(x)},300);return()=>{clearTimeout(t)}},[x,e.typeahead]);let P=(0,G.useMemo)(()=>e.typeahead?{...r,search:C}:r,[r,C,e.typeahead]),I=(0,G.useMemo)(()=>{let t=Object.fromEntries(Object.entries(P).filter(([t])=>t!==e.key));return JSON.stringify(t)},[P,e.key]),R=(0,G.useCallback)(async(e,t,n,r)=>{if(t.startsWith(`/`))return te(M)(e,t,{headers:n,...r!=null&&{body:r}});let i=await fetch(t,{method:e,headers:n,...r!=null&&{body:r}});if(!i.ok)throw Error(`Error fetching options`);return i.json()},[M]),B=(0,G.useCallback)(async(n,r)=>{if(y.current.has(r))return;y.current.add(r),v(!0);let i=e.fetchMethod??`GET`,a=b.current;if(e.getContextUrl&&a===void 0)try{let r={__kizen_state:{value:{...n,pluginApiName:t}}},o=await F(e.getContextUrl,r);if(o){let t={"Content-Type":`application/json`},n=null;if(e.getHeaders&&(t=await z(e.getHeaders,r)),i===`POST`&&e.getBody){let t=await z(e.getBody,r);n=JSON.stringify(t)}a=await R(i,o,t,n)}}catch(t){p({variant:`failure`,message:`Error fetching options for ${e.label??e.key}: ${t instanceof Error?t.message:`Unknown error`}`}),y.current.delete(r),v(!1);return}b.current=a;try{let o={__kizen_state:{value:{...n,context:a,pluginApiName:t}}},s;if(e.getFetchUrl){let t=await F(e.getFetchUrl,o);if(t){let n={"Content-Type":`application/json`},r=null;if(e.getHeaders&&(n=await z(e.getHeaders,o)),i===`POST`&&e.getBody){let t=await z(e.getBody,o);r=JSON.stringify(t)}s=await R(i,t,n,r)}}if(e.optionMapper){let i=await ee(e.optionMapper,{__kizen_state:{value:{...n,result:s,context:a,pluginApiName:t}}});g(e=>({...e,[r]:structuredClone(i)}))}else if(Array.isArray(s))g(e=>({...e,[r]:s}));else throw Error(`API result is not an array`)}catch{g(e=>({...e,[r]:[]}))}finally{v(!1)}},[e,t,R,p]);(0,G.useEffect)(()=>{!k||!m||d||e.typeahead||B(P,I)},[k,m,I,P,e.typeahead,d,B]),(0,G.useEffect)(()=>{!k||!m||d||!e.typeahead||!T||!C||B(P,I)},[k,m,I,P,e.typeahead,T,C,d,B]),(0,G.useEffect)(()=>{!k||!e.autoSelect||e.typeahead||u||d||!m||B(P,I)},[k,e.autoSelect,e.typeahead,u,d,m,B,P,I]);let V=(0,G.useMemo)(()=>h[I]??[],[h,I]);if((0,G.useEffect)(()=>{!k||!e.autoSelect||e.typeahead||u||d||A||V.length===1&&V[0]&&(e.allow_multiple?N([V[0]]):N(V[0]))},[k,e.autoSelect,e.typeahead,e.allow_multiple,u,d,A,V,N]),d)return null;let H=k?V:e.options??[];if(e.allow_multiple){let t=Array.isArray(A)?A:[];return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)($,{field:e}),(0,Z.jsx)(`div`,{className:`rounded border p-2 text-[13px] ${f?.error?`border-red-300`:`border-black/10`} ${u?`bg-neutral-50`:`bg-white`}`,children:_&&H.length===0?(0,Z.jsx)(`span`,{className:`text-neutral-400 text-[12px]`,children:`Loading options...`}):H.length===0?(0,Z.jsx)(`span`,{className:`text-neutral-400 text-[12px]`,children:`No options available`}):(0,Z.jsx)(`div`,{className:`flex flex-col gap-1 max-h-48 overflow-y-auto transition-opacity ${_?`opacity-60`:``}`,children:H.map(e=>{let n=t.some(t=>t.value===e.value);return(0,Z.jsxs)(`label`,{className:`flex items-center gap-2 cursor-pointer`,children:[(0,Z.jsx)(`input`,{type:`checkbox`,checked:n,disabled:u,onChange:()=>{N(n?t.filter(t=>t.value!==e.value):[...t,e])},className:`h-3 w-3 accent-blue-600`}),(0,Z.jsx)(`span`,{className:`text-[12px]`,children:e.label})]},e.value)})})}),f?.showMessage&&f.message&&(0,Z.jsx)(`span`,{className:`text-[11px] text-red-500`,children:f.message})]})}if(e.typeahead){let t=A&&!Array.isArray(A)?A.label:``;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)($,{field:e}),(0,Z.jsxs)(`div`,{ref:O,className:`relative`,children:[(0,Z.jsx)(`input`,{type:`text`,value:t&&!T?t:x,placeholder:e.placeholder??`Search...`,disabled:u,onChange:t=>{S(t.target.value),A&&(i(t=>Object.fromEntries(Object.entries(t).filter(([t])=>t!==e.key))),c(e.key))},onFocus:()=>{E(!0),t&&S(t)},onBlur:()=>{E(!1)},className:`w-full rounded border px-2 py-1.5 text-[13px] font-mono focus:outline-none focus:ring-1 ${f?.error?`border-red-300 focus:ring-red-400`:`border-black/10 focus:ring-blue-400`} ${u?`bg-neutral-50 text-neutral-400`:`bg-white`}`}),t&&!T&&(0,Z.jsx)(`button`,{type:`button`,onClick:()=>{i(t=>Object.fromEntries(Object.entries(t).filter(([t])=>t!==e.key))),S(``),w(``),c(e.key)},disabled:u,className:`absolute right-2 top-1/2 -translate-y-1/2 text-[11px] text-neutral-400 hover:text-neutral-600`,"aria-label":`Clear selection`,children:`×`})]}),(0,Z.jsxs)(D,{anchorRef:O,open:T,children:[_&&(0,Z.jsx)(`div`,{className:`px-3 py-2 text-[12px] text-neutral-400`,children:`Loading...`}),!_&&H.length===0&&x.length===0&&(0,Z.jsx)(`div`,{className:`px-3 py-2 text-[12px] text-neutral-400`,children:`Start typing to search...`}),!_&&H.length===0&&x.length>0&&(0,Z.jsx)(`div`,{className:`px-3 py-2 text-[12px] text-neutral-400`,children:`No results`}),!_&&H.map(e=>(0,Z.jsx)(`div`,{className:`cursor-pointer px-3 py-2 text-[12px] text-neutral-800 hover:bg-neutral-100`,onClick:()=>{N(e),S(e.label),E(!1)},children:e.label},e.value))]}),f?.showMessage&&f.message&&(0,Z.jsx)(`span`,{className:`text-[11px] text-red-500`,children:f.message})]})}let re=A&&!Array.isArray(A)?H.findIndex(e=>JSON.stringify(e.value)===JSON.stringify(A.value)):-1;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)($,{field:e}),_&&H.length===0?(0,Z.jsx)(`div`,{className:`w-full rounded border border-black/10 px-2 py-1.5 text-[12px] text-neutral-400 bg-neutral-50`,children:`Loading options...`}):(0,Z.jsxs)(`select`,{value:re>=0?String(re):``,onChange:e=>{let t=H[Number(e.target.value)];t&&N(t)},disabled:u,className:`w-full rounded border px-2 py-1.5 text-[13px] font-mono focus:outline-none focus:ring-1 transition-opacity ${f?.error?`border-red-300 focus:ring-red-400`:`border-black/10 focus:ring-blue-400`} ${u?`bg-neutral-50 text-neutral-400`:`bg-white`} ${_?`opacity-60`:``}`,children:[(0,Z.jsx)(`option`,{value:``,children:e.placeholder??`Choose an option`}),H.map((e,t)=>(0,Z.jsx)(`option`,{value:String(t),children:e.label},e.label))]}),f?.showMessage&&f.message&&(0,Z.jsx)(`span`,{className:`text-[11px] text-red-500`,children:f.message})]})},boolean:Er},Ir=({field:e,pluginApiName:t,disabled:n=!1})=>{let r=Fr[e.type];return(0,Z.jsx)(r,{field:e,pluginApiName:t,disabled:n})},Lr=()=>{let e=L(),t=T();return{getObjectByAPIName:(0,G.useCallback)(async n=>{try{let t=await(await e(`/api/custom-objects?filters=${encodeURIComponent(JSON.stringify({api_name:n}))}`)).json(),r=Array.isArray(t)?t:t.results;if(r&&r.length>0)return r}catch{}let r=t?.business.client_object;if(r?.access&&r.name===n)return[{id:r.id,object_name:r.object_name}]},[e,t]),getCustomObjectDetails:(0,G.useCallback)(async t=>{try{let[n,r]=await Promise.all([e(`/api/custom-objects/${t}`),e(`/api/custom-objects/${t}/fields`)]),i=await n.json(),a=await r.json(),o=Array.isArray(a)?a:a.results??[];return{id:t,objectName:i.object_name??``,fields:o.map(e=>({id:e.id,name:e.name,displayName:e.display_name}))}}catch{return{id:t,objectName:``,fields:[]}}},[e])}},Rr=({state:e,onDismiss:t})=>{let n=e.error?.message??`Unknown error`,r=e.context?.workerName,i=e.context?.pluginApiName;return(0,Z.jsx)(w,{open:e.visible,size:`xl`,ariaModal:!0,fontMono:!1,onBackdropClick:t,header:(0,Z.jsx)(C,{title:`Critical Exception`,statusDot:`red`}),footer:(0,Z.jsx)(`button`,{onClick:t,className:`rounded bg-neutral-900 px-3 py-1.5 text-[12px] text-white transition-colors hover:bg-neutral-700`,children:`Dismiss`}),children:(0,Z.jsxs)(`div`,{className:`px-5 py-4`,children:[(0,Z.jsx)(`p`,{className:`m-0 mb-3 text-[12px] leading-relaxed text-neutral-700`,children:`This error will be logged in Kizen's monitoring stack. Did you mean to throw it, or would you prefer to handle the error in your application code with a toast or other messaging?`}),(r??i)&&(0,Z.jsxs)(`div`,{className:`mb-3 flex flex-wrap gap-2 text-[11px] text-neutral-600`,children:[r&&(0,Z.jsxs)(`span`,{className:`rounded bg-neutral-100 px-2 py-0.5 font-mono`,children:[`worker: `,r]}),i&&(0,Z.jsxs)(`span`,{className:`rounded bg-neutral-100 px-2 py-0.5 font-mono`,children:[`plugin: `,i]})]}),(0,Z.jsx)(`div`,{className:`mb-2 text-[11px] font-semibold uppercase tracking-wide text-neutral-500`,children:`Error`}),(0,Z.jsx)(`div`,{className:`whitespace-pre-wrap break-words rounded border border-black/10 bg-neutral-950 px-3 py-2 font-mono text-[11px] leading-relaxed text-amber-300`,children:n})]})})};function zr(){let[e,t]=(0,G.useState)({visible:!1});return{onMonitoringException:(0,G.useCallback)((e,n)=>{let r={};n.extra.workerName!==void 0&&(r.workerName=n.extra.workerName),n.extra.pluginApiName!==void 0&&(r.pluginApiName=n.extra.pluginApiName),t({visible:!0,error:e,context:r})},[]),dialog:(0,Z.jsx)(Rr,{state:e,onDismiss:(0,G.useCallback)(()=>{t(e=>({...e,visible:!1}))},[])})}}export{Or as a,rr as c,ur as d,$n as f,Nr as i,Zn as l,wr as m,Lr as n,gr as o,er as p,Ir as r,Cr as s,zr as t,qn as u};
|