@toa.io/extensions.configuration 1.0.0-alpha.314 → 1.0.0-alpha.315
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/components/configuration.values/types/toa.d.ts +12 -12
- package/package.json +4 -4
- package/ui/dist/_app/immutable/chunks/{C3h54RHo.js → BbdD8cVe.js} +2 -2
- package/ui/dist/_app/immutable/chunks/{B8af84MO.js → BgP_g0Vq.js} +1 -1
- package/ui/dist/_app/immutable/chunks/{BnyV9QNx.js → BgeYVt0O.js} +1 -1
- package/ui/dist/_app/immutable/chunks/{Kw-EzFjI.js → CrAWEwWl.js} +1 -1
- package/ui/dist/_app/immutable/chunks/{CpNauhBO.js → XpAw51oI.js} +1 -1
- package/ui/dist/_app/immutable/entry/{app.CurspA6Q.js → app.s9-wduk8.js} +2 -2
- package/ui/dist/_app/immutable/entry/start.Zw5Ep8Bk.js +1 -0
- package/ui/dist/_app/immutable/nodes/{0.Cpw9_S3E.js → 0.DkkBq6e1.js} +1 -1
- package/ui/dist/_app/immutable/nodes/{1.DauwrCza.js → 1.CVG_C4Sr.js} +1 -1
- package/ui/dist/_app/immutable/nodes/{2.-nSjIoHV.js → 2.DzcEonXR.js} +1 -1
- package/ui/dist/_app/immutable/nodes/{3.C6AXHXih.js → 3.B8P9lr3Z.js} +1 -1
- package/ui/dist/_app/immutable/nodes/{4.C8koQGqn.js → 4.DPXR3wrG.js} +1 -1
- package/ui/dist/_app/version.json +1 -1
- package/ui/dist/index.html +10 -10
- package/ui/dist/_app/immutable/entry/start.CHoTSRjf.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Written by `toa types`. Every run rewrites it.
|
|
2
2
|
// What a manifest does not state belongs in a file of your own.
|
|
3
3
|
|
|
4
|
-
import type {
|
|
4
|
+
import type { Query, RemoteError } from '@toa.io/core/types'
|
|
5
5
|
import type { Readable } from 'node:stream'
|
|
6
6
|
|
|
7
7
|
export interface Entity {
|
|
@@ -69,15 +69,15 @@ export type ResetInput = {
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
export interface Component {
|
|
72
|
-
get: (request: { input: GetInput, task?: boolean }
|
|
73
|
-
fetch: (request: { input: FetchInput, task?: boolean }
|
|
74
|
-
list: (request: { input?: null, task?: boolean }
|
|
75
|
-
create: (request: { input: CreateInput, task?: boolean }
|
|
76
|
-
reset: (request: { input: ResetInput, task?: boolean }
|
|
77
|
-
assign: (request: { input?: null, query?: Query<Entity>, task?: boolean }
|
|
78
|
-
ensure: (request: { input?: null, query?: Query<Entity>, task?: boolean }
|
|
79
|
-
enumerate: (request: { input?: null, query?: Query<Entity>, task?: boolean }
|
|
80
|
-
observe: (request: { input?: null, query?: Query<Entity>, task?: boolean }
|
|
81
|
-
stream: (request: { input?: null, query?: Query<Entity>, task?: boolean }
|
|
82
|
-
terminate: (request: { input?: null, query?: Query<Entity>, task?: boolean }
|
|
72
|
+
get: (request: { input: GetInput, task?: boolean }) => Promise<GetOutput>
|
|
73
|
+
fetch: (request: { input: FetchInput, task?: boolean }) => Promise<FetchOutput>
|
|
74
|
+
list: (request: { input?: null, task?: boolean }) => Promise<ListOutput>
|
|
75
|
+
create: (request: { input: CreateInput, task?: boolean }) => Promise<unknown | RemoteError<"UNKNOWN_COMPONENT" | "INVALID_CONFIGURATION">>
|
|
76
|
+
reset: (request: { input: ResetInput, task?: boolean }) => Promise<unknown | RemoteError<"UNKNOWN_COMPONENT">>
|
|
77
|
+
assign: (request: { input?: null, query?: Query<Entity>, task?: boolean }) => Promise<Entity>
|
|
78
|
+
ensure: (request: { input?: null, query?: Query<Entity>, task?: boolean }) => Promise<Entity>
|
|
79
|
+
enumerate: (request: { input?: null, query?: Query<Entity>, task?: boolean }) => Promise<Entity[]>
|
|
80
|
+
observe: (request: { input?: null, query?: Query<Entity>, task?: boolean }) => Promise<Entity | null>
|
|
81
|
+
stream: (request: { input?: null, query?: Query<Entity>, task?: boolean }) => Promise<Readable>
|
|
82
|
+
terminate: (request: { input?: null, query?: Query<Entity>, task?: boolean }) => Promise<Entity>
|
|
83
83
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toa.io/extensions.configuration",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.315",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Toa Configuration",
|
|
6
6
|
"author": "temich <tema.gurtovoy@gmail.com>",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"prepack": "npm run build:ui",
|
|
33
33
|
"features": "TSX_TSCONFIG_PATH=features/steps/tsconfig.json NODE_OPTIONS=--import=tsx cucumber-js"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "d88ed286bf44bf95b5f3d9db6e7d4621261dbb99",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@toa.io/core": "1.0.0-alpha.
|
|
38
|
-
"@toa.io/definitions": "1.0.0-alpha.
|
|
37
|
+
"@toa.io/core": "1.0.0-alpha.315",
|
|
38
|
+
"@toa.io/definitions": "1.0.0-alpha.315",
|
|
39
39
|
"@toa.io/generic": "1.0.0-alpha.311",
|
|
40
40
|
"@toa.io/schemas": "1.0.0-alpha.311",
|
|
41
41
|
"openspan": "1.0.0-alpha.305"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{$ as e,A as t,At as n,C as r,Ct as i,I as a,L as o,M as s,Mt as c,N as l,S as u,St as d,T as f,V as p,_t as m,a as h,b as g,bt as _,ct as v,dt as y,et as b,ft as ee,gt as x,ht as S,i as C,j as w,jt as te,kt as T,nt as E,o as D,u as ne,v as re,vt as O}from"./B8XvKDKK.js";import{s as ie}from"./Kw-EzFjI.js";import"./xihTtKlq.js";var ae=class{store;values;request;revalidate;stale;timestamp=0;constructor(e){this.store=O(null),this.values=e.values,this.request=e.get,this.revalidate=e.revalidate??A.revalidate,this.stale=e.stale??A.stale,e.persist!==void 0&&this.persist(e.persist),e.bind!==void 0&&this.bind(e.bind)}subscribe(e,t){return this.sync(),this.store.subscribe(e,t)}add(e){this.values?.set(e.id,e),this.store.update(t=>t===null||t instanceof Error?[e]:t.find(t=>t.id===e.id)===void 0?[e,...t]:t)}get(e,t){if(this.values===void 0)throw Error(`Collection: values is not defined`);return this.values.get(e,t)}extract(e){if(this.values===void 0)throw Error(`Collection: values is not defined`);return this.values.extract(e)}delete(e){this.values?.delete(e),this.store.update(t=>t===null||t instanceof Error?t:t.filter(t=>t.id!==e))}set(e,t){this.store.update(n=>{if(n===null||n instanceof Error)return[e];let r=n.findIndex(t=>t.id===e.id);return r===-1?t?.add===!0?[e,...n]:n:(n[r]=e,n)}),this.values?.set(e.id,e)}update(e,t,n){if(this.values===void 0)throw Error(`Collection: values is not defined`);let r=this.values.extract(e);if(r===null)return;let i=t(r)??r;this.set(i,n)}sync(){return(this.timestamp===0||this.timestamp+this.revalidate<Date.now())&&(this.stale||this.clear(),this.refresh()),this}async fetch(){return await this.refresh(),this}replace(e){let t=e;if(this.store.set(t),this.timestamp=Date.now(),this.values!==void 0)for(let e of t)this.values.set(e.id,e)}async refresh(){if(this.request===void 0)return;this.timestamp=Date.now();let e=await this.request();e instanceof Error?this.store.set(e):this.replace(e)}persist(e){if(typeof window>`u`)return;let t=this.load(e);if(t!==null&&(this.store.set(t),this.values?.persistent===!1))for(let e of t)this.values.set(e.id,e);this.store.subscribe(t=>{t instanceof Error||(t===null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(t)))})}load(e){if(typeof window>`u`)return null;let t=localStorage.getItem(e);if(t===null)return null;try{let n=JSON.parse(t);return Array.isArray(n)?n:(console.error(`Storage value for ${e} is not an array:`,n),null)}catch(t){return console.error(`Invalid storage value for ${e}`,t),null}}bind(e){e.subscribe(e=>{e===null&&this.clear()})}clear(){this.store.set(null),this.values?.clear(),this.timestamp=0}};function k(e){return new ae(e)}var A={revalidate:3e5,stale:!1},oe=class{persistent;values={};fetch;revalidate;permanent;stale;persist;ready=!1;dumping=null;constructor(e){this.fetch=e.get,this.revalidate=e.revalidate??j.revalidate,this.permanent=e.permanent??j.permanent,this.stale=e.stale??j.stale,this.persist=e.persist,this.persistent=this.persist!==void 0,this.load(),e.bind!==void 0&&this.bind(e.bind)}set(e,t,n){let r=t,i=this.values[e]??(this.values[e]=this.create(r));return n?.stash===!0?this.stash(e):delete i.stash,i.store.set(r),!(r instanceof Error)&&this.ready&&n?.stash!==!0&&this.dump(),this.values[e].store}reset(e){let t=this.values[e]?.stash;return t===void 0?this.extract(e):(t===null?this.delete(e):this.set(e,t),t)}get(e,t){this.ready=!0;let n=this.values[e]??=this.create();return this.fetch===void 0||t?.fetch===!1||(n.timestamp===0||n.timestamp+this.revalidate<Date.now())&&(this.stale||n.store.set(null),n.timestamp=Date.now(),this.fetch(e).then(t=>this.set(e,t))),n.store}extract(e){if(this.values[e]===void 0)return null;let t=x(this.values[e].store);return t instanceof Error?null:t}delete(e){if(!(e in this.values))return;let t=this.values[e];t.store.set(null),t.timestamp=0,delete t.stash,this.dump()}clear(){for(let e of Object.keys(this.values))this.delete(e);this.ready=!1}create(e){return{store:O(e??null),timestamp:this.permanent&&e!==void 0?Date.now():0}}stash(e){let t=this.values[e];if(t.stash!==void 0){console.warn(`Stash overlap, skipping`);return}let n=this.get(e,{fetch:!1});t.stash??=x(n)}dump(e=!0){if(this.persist===void 0||typeof window>`u`)return;if(e){this.dumping??=setTimeout(()=>this.dump(!1),se);return}this.dumping=null;let t={};for(let[e,n]of Object.entries(this.values)){let r=n.stash??x(n.store);r!==null&&!(r instanceof Error)&&(t[e]=r)}Object.keys(t).length===0?localStorage.removeItem(this.persist):localStorage.setItem(this.persist,JSON.stringify(t))}load(){if(this.persist===void 0||typeof window>`u`)return;let e=localStorage.getItem(this.persist);if(e!==null)try{let t=JSON.parse(e);if(typeof t!=`object`||!t){console.error(`Storage value for ${this.persist} is not an object:`,t);return}for(let[e,n]of Object.entries(t))this.set(e,n)}catch(e){console.error(`Invalid storage value for ${this.persist}`,e)}}bind(e){e.subscribe(e=>{e===null&&this.clear()})}},se=100,j={revalidate:3e5,permanent:!1,stale:!1};function ce(e={}){return new oe(e)}var le=class{store;default;request;revalidate;timestamp=0;constructor(e){this.default=e.default??null,this.request=e.get,this.revalidate=e.revalidate??fe.revalidate,this.store=e.persist===void 0||typeof window>`u`?O(this.default):ue(e.persist,this.default,e.session),e.bind&&this.bind(e.bind)}set(e){this.store.set(e)}update(e){this.store.update(t=>e(t))}subscribe(e,t){return this.sync(),this.store.subscribe(e,t)}extract(){return x(this.store)}sync(){this.request!==void 0&&this.timestamp+this.revalidate<Date.now()&&this.refresh()}async refresh(){if(this.request===void 0)return;this.timestamp=Date.now();let e=await this.request();e instanceof Error||this.set(e)}bind(e){e.subscribe(e=>{e===null&&this.store.set(this.default)})}};function M(e={}){return new le(e)}function ue(e,t,n){let r=O(de(e)??t),i=n?`sessionStorage`:`localStorage`;return r.subscribe(t=>{t===null?window[i].removeItem(e):window[i].setItem(e,JSON.stringify(t))}),r}function de(e){let t=window.localStorage.getItem(e);if(t===null)return null;try{return JSON.parse(t)}catch(t){return console.error(`Invalid storage value for ${e}`,t),null}}var fe={revalidate:3e5};function pe(e,t){return new Promise(n=>{let r=!1,i=null;i=e.subscribe(e=>{t(e)&&(i?.(),r=!0,n(e))}),r&&i?.()})}function me(e){return pe(e,e=>e!==null&&!(e instanceof Error))}function he(e){let t=x(e);if(t===null||t instanceof Error)throw Error(`Store contains null or an error`);return t}var ge={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`},_e=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},ve=Symbol(`lucide-context`),ye=()=>_(ve),be=new Set([`$$slots`,`$$events`,`$$legacy`,`name`,`color`,`size`,`strokeWidth`,`absoluteStrokeWidth`,`iconNode`,`children`]),xe=l(`<svg><!><!></svg>`);function N(a,o){i(o,!0);let s=ye()??{},c=C(o,`color`,19,()=>s.color??`currentColor`),l=C(o,`size`,19,()=>s.size??24),f=C(o,`strokeWidth`,19,()=>s.strokeWidth??2),m=C(o,`absoluteStrokeWidth`,19,()=>s.absoluteStrokeWidth??!1),_=C(o,`iconNode`,19,()=>[]),y=h(o,be),ee=v(()=>m()?Number(f())*24/Number(l()):f());var x=xe();ne(x,e=>({...ge,...e,...y,width:l(),height:l(),stroke:c(),"stroke-width":p(ee),class:[`lucide-icon lucide`,s.class,o.name&&`lucide-${o.name}`,o.class]}),[()=>!o.children&&!_e(y)&&{"aria-hidden":`true`}]);var S=e(x);u(S,17,_,r,(e,n)=>{var r=v(()=>te(p(n),2));let i=()=>p(r)[0],a=()=>p(r)[1];var o=w(),s=b(o);re(s,i,!0,(e,t)=>{ne(e,()=>({...a()}))}),t(e,o)});var D=E(S);g(D,()=>o.children??n),T(x),t(a,x),d()}var Se=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ce(e,t){let n=h(t,Se),r=[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`}]];N(e,D({name:`loader-circle`},()=>n,{get iconNode(){return r}}))}var we=new Set([`$$slots`,`$$events`,`$$legacy`]);function Te(e,t){let n=h(t,we),r=[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`}],[`path`,{d:`M3 3v5h5`}]];N(e,D({name:`rotate-ccw`},()=>n,{get iconNode(){return r}}))}var Ee=s(`<div class="m-auto flex flex-col items-center gap-4"><span class="text-destructive">Something went terribly wrong</span> <button class="p-4 border border-muted-foreground hover:bg-muted cursor-pointer rounded-md flex items-center gap-2"><!></button></div>`);function De(n,r){let i=()=>ee(r.store,`$store`,a),[a,s]=y(),c=C(r,`silent`,3,!1);var l=w(),u=b(l),d=e=>{var n=w(),i=b(n),a=e=>{var n=w(),i=b(n);g(i,()=>r.waiting),t(e,n)},o=e=>{Ce(e,{class:`animate-spin m-auto text-muted-foreground`})};f(i,e=>{r.waiting?e(a):c()||e(o,1)}),t(e,n)},p=n=>{var a=w(),s=b(a),l=e=>{var n=w(),a=b(n);g(a,()=>r.error,i),t(e,n)},u=n=>{var r=Ee(),i=E(e(r),2);Te(e(i),{size:16}),T(i),T(r),o(`click`,i,()=>window.location.reload()),t(n,r)};f(s,e=>{r.error?e(l):c()||e(u,1)}),t(n,a)},m=e=>{var n=w(),a=b(n);g(a,()=>r.awaited,i),t(e,n)};f(u,e=>{i()===null?e(d):i()instanceof Error?e(p,1):e(m,-1)}),t(n,l),s()}a([`click`]);var P=M({persist:`auth:account`}),F=M({persist:`auth:challenge`,bind:P}),Oe=M({persist:`auth:method`}),I=O(!1),ke=O(!1),Ae=S([F,P,I],([e,t,n])=>e!==null&&t!==null&&n===!1);function je(e){P.extract()?.id!==e.id&&P.set(null),P.set(e)}function L(e){return{all:e||=new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(e){e(n)}),(r=e.get(`*`))&&r.slice().map(function(e){e(t,n)})}}}var R=c((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Err=void 0,e.Err=class extends Error{code;name=`Error`;message=``;cause;constructor(e,t){super(),this.code=e,delete this.stack,Object.defineProperty(this,"name",{enumerable:!1}),typeof t==`string`?(this.message=t,Object.defineProperty(this,"cause",{enumerable:!1})):(Object.defineProperty(this,"message",{enumerable:!1}),Object.defineProperty(this,"cause",{enumerable:t!==void 0,value:t}))}}}))();async function Me(e,t){if(!e.ok||!e.body||e.bodyUsed)return e;let n=e.headers.get(`content-type`);if(!n||!~n.indexOf(`multipart/`))return e;let r=n.indexOf(`boundary=`),i=`-`;if(~r){let e=r+9,t=n.indexOf(`;`,e);i=n.slice(e,t>-1?t:void 0).trim().replace(/"/g,``)}return async function*(e,t,n){let r,i,a,o=new TextDecoder(`utf8`),s=e.getReader(),c=!n||!n.multiple,l=t.length,u=``,d=[];try{let e;e:for(;!(e=await s.read()).done;){let n=o.decode(e.value,{stream:!0});r=u.length,u+=n;let s=n.indexOf(t);for(~s?r+=s:r=u.indexOf(t),d=[];~r;){let e=u.slice(0,r),n=u.slice(r+l);if(i){let t=e.indexOf(`\r
|
|
1
|
+
import{$ as e,A as t,At as n,C as r,Ct as i,I as a,L as o,M as s,Mt as c,N as l,S as u,St as d,T as f,V as p,_t as m,a as h,b as g,bt as _,ct as v,dt as y,et as b,ft as ee,gt as x,ht as S,i as C,j as w,jt as te,kt as T,nt as E,o as D,u as ne,v as re,vt as O}from"./B8XvKDKK.js";import{s as ie}from"./CrAWEwWl.js";import"./xihTtKlq.js";var ae=class{store;values;request;revalidate;stale;timestamp=0;constructor(e){this.store=O(null),this.values=e.values,this.request=e.get,this.revalidate=e.revalidate??A.revalidate,this.stale=e.stale??A.stale,e.persist!==void 0&&this.persist(e.persist),e.bind!==void 0&&this.bind(e.bind)}subscribe(e,t){return this.sync(),this.store.subscribe(e,t)}add(e){this.values?.set(e.id,e),this.store.update(t=>t===null||t instanceof Error?[e]:t.find(t=>t.id===e.id)===void 0?[e,...t]:t)}get(e,t){if(this.values===void 0)throw Error(`Collection: values is not defined`);return this.values.get(e,t)}extract(e){if(this.values===void 0)throw Error(`Collection: values is not defined`);return this.values.extract(e)}delete(e){this.values?.delete(e),this.store.update(t=>t===null||t instanceof Error?t:t.filter(t=>t.id!==e))}set(e,t){this.store.update(n=>{if(n===null||n instanceof Error)return[e];let r=n.findIndex(t=>t.id===e.id);return r===-1?t?.add===!0?[e,...n]:n:(n[r]=e,n)}),this.values?.set(e.id,e)}update(e,t,n){if(this.values===void 0)throw Error(`Collection: values is not defined`);let r=this.values.extract(e);if(r===null)return;let i=t(r)??r;this.set(i,n)}sync(){return(this.timestamp===0||this.timestamp+this.revalidate<Date.now())&&(this.stale||this.clear(),this.refresh()),this}async fetch(){return await this.refresh(),this}replace(e){let t=e;if(this.store.set(t),this.timestamp=Date.now(),this.values!==void 0)for(let e of t)this.values.set(e.id,e)}async refresh(){if(this.request===void 0)return;this.timestamp=Date.now();let e=await this.request();e instanceof Error?this.store.set(e):this.replace(e)}persist(e){if(typeof window>`u`)return;let t=this.load(e);if(t!==null&&(this.store.set(t),this.values?.persistent===!1))for(let e of t)this.values.set(e.id,e);this.store.subscribe(t=>{t instanceof Error||(t===null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(t)))})}load(e){if(typeof window>`u`)return null;let t=localStorage.getItem(e);if(t===null)return null;try{let n=JSON.parse(t);return Array.isArray(n)?n:(console.error(`Storage value for ${e} is not an array:`,n),null)}catch(t){return console.error(`Invalid storage value for ${e}`,t),null}}bind(e){e.subscribe(e=>{e===null&&this.clear()})}clear(){this.store.set(null),this.values?.clear(),this.timestamp=0}};function k(e){return new ae(e)}var A={revalidate:3e5,stale:!1},oe=class{persistent;values={};fetch;revalidate;permanent;stale;persist;ready=!1;dumping=null;constructor(e){this.fetch=e.get,this.revalidate=e.revalidate??j.revalidate,this.permanent=e.permanent??j.permanent,this.stale=e.stale??j.stale,this.persist=e.persist,this.persistent=this.persist!==void 0,this.load(),e.bind!==void 0&&this.bind(e.bind)}set(e,t,n){let r=t,i=this.values[e]??(this.values[e]=this.create(r));return n?.stash===!0?this.stash(e):delete i.stash,i.store.set(r),!(r instanceof Error)&&this.ready&&n?.stash!==!0&&this.dump(),this.values[e].store}reset(e){let t=this.values[e]?.stash;return t===void 0?this.extract(e):(t===null?this.delete(e):this.set(e,t),t)}get(e,t){this.ready=!0;let n=this.values[e]??=this.create();return this.fetch===void 0||t?.fetch===!1||(n.timestamp===0||n.timestamp+this.revalidate<Date.now())&&(this.stale||n.store.set(null),n.timestamp=Date.now(),this.fetch(e).then(t=>this.set(e,t))),n.store}extract(e){if(this.values[e]===void 0)return null;let t=x(this.values[e].store);return t instanceof Error?null:t}delete(e){if(!(e in this.values))return;let t=this.values[e];t.store.set(null),t.timestamp=0,delete t.stash,this.dump()}clear(){for(let e of Object.keys(this.values))this.delete(e);this.ready=!1}create(e){return{store:O(e??null),timestamp:this.permanent&&e!==void 0?Date.now():0}}stash(e){let t=this.values[e];if(t.stash!==void 0){console.warn(`Stash overlap, skipping`);return}let n=this.get(e,{fetch:!1});t.stash??=x(n)}dump(e=!0){if(this.persist===void 0||typeof window>`u`)return;if(e){this.dumping??=setTimeout(()=>this.dump(!1),se);return}this.dumping=null;let t={};for(let[e,n]of Object.entries(this.values)){let r=n.stash??x(n.store);r!==null&&!(r instanceof Error)&&(t[e]=r)}Object.keys(t).length===0?localStorage.removeItem(this.persist):localStorage.setItem(this.persist,JSON.stringify(t))}load(){if(this.persist===void 0||typeof window>`u`)return;let e=localStorage.getItem(this.persist);if(e!==null)try{let t=JSON.parse(e);if(typeof t!=`object`||!t){console.error(`Storage value for ${this.persist} is not an object:`,t);return}for(let[e,n]of Object.entries(t))this.set(e,n)}catch(e){console.error(`Invalid storage value for ${this.persist}`,e)}}bind(e){e.subscribe(e=>{e===null&&this.clear()})}},se=100,j={revalidate:3e5,permanent:!1,stale:!1};function ce(e={}){return new oe(e)}var le=class{store;default;request;revalidate;timestamp=0;constructor(e){this.default=e.default??null,this.request=e.get,this.revalidate=e.revalidate??fe.revalidate,this.store=e.persist===void 0||typeof window>`u`?O(this.default):ue(e.persist,this.default,e.session),e.bind&&this.bind(e.bind)}set(e){this.store.set(e)}update(e){this.store.update(t=>e(t))}subscribe(e,t){return this.sync(),this.store.subscribe(e,t)}extract(){return x(this.store)}sync(){this.request!==void 0&&this.timestamp+this.revalidate<Date.now()&&this.refresh()}async refresh(){if(this.request===void 0)return;this.timestamp=Date.now();let e=await this.request();e instanceof Error||this.set(e)}bind(e){e.subscribe(e=>{e===null&&this.store.set(this.default)})}};function M(e={}){return new le(e)}function ue(e,t,n){let r=O(de(e)??t),i=n?`sessionStorage`:`localStorage`;return r.subscribe(t=>{t===null?window[i].removeItem(e):window[i].setItem(e,JSON.stringify(t))}),r}function de(e){let t=window.localStorage.getItem(e);if(t===null)return null;try{return JSON.parse(t)}catch(t){return console.error(`Invalid storage value for ${e}`,t),null}}var fe={revalidate:3e5};function pe(e,t){return new Promise(n=>{let r=!1,i=null;i=e.subscribe(e=>{t(e)&&(i?.(),r=!0,n(e))}),r&&i?.()})}function me(e){return pe(e,e=>e!==null&&!(e instanceof Error))}function he(e){let t=x(e);if(t===null||t instanceof Error)throw Error(`Store contains null or an error`);return t}var ge={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`},_e=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},ve=Symbol(`lucide-context`),ye=()=>_(ve),be=new Set([`$$slots`,`$$events`,`$$legacy`,`name`,`color`,`size`,`strokeWidth`,`absoluteStrokeWidth`,`iconNode`,`children`]),xe=l(`<svg><!><!></svg>`);function N(a,o){i(o,!0);let s=ye()??{},c=C(o,`color`,19,()=>s.color??`currentColor`),l=C(o,`size`,19,()=>s.size??24),f=C(o,`strokeWidth`,19,()=>s.strokeWidth??2),m=C(o,`absoluteStrokeWidth`,19,()=>s.absoluteStrokeWidth??!1),_=C(o,`iconNode`,19,()=>[]),y=h(o,be),ee=v(()=>m()?Number(f())*24/Number(l()):f());var x=xe();ne(x,e=>({...ge,...e,...y,width:l(),height:l(),stroke:c(),"stroke-width":p(ee),class:[`lucide-icon lucide`,s.class,o.name&&`lucide-${o.name}`,o.class]}),[()=>!o.children&&!_e(y)&&{"aria-hidden":`true`}]);var S=e(x);u(S,17,_,r,(e,n)=>{var r=v(()=>te(p(n),2));let i=()=>p(r)[0],a=()=>p(r)[1];var o=w(),s=b(o);re(s,i,!0,(e,t)=>{ne(e,()=>({...a()}))}),t(e,o)});var D=E(S);g(D,()=>o.children??n),T(x),t(a,x),d()}var Se=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ce(e,t){let n=h(t,Se),r=[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`}]];N(e,D({name:`loader-circle`},()=>n,{get iconNode(){return r}}))}var we=new Set([`$$slots`,`$$events`,`$$legacy`]);function Te(e,t){let n=h(t,we),r=[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`}],[`path`,{d:`M3 3v5h5`}]];N(e,D({name:`rotate-ccw`},()=>n,{get iconNode(){return r}}))}var Ee=s(`<div class="m-auto flex flex-col items-center gap-4"><span class="text-destructive">Something went terribly wrong</span> <button class="p-4 border border-muted-foreground hover:bg-muted cursor-pointer rounded-md flex items-center gap-2"><!></button></div>`);function De(n,r){let i=()=>ee(r.store,`$store`,a),[a,s]=y(),c=C(r,`silent`,3,!1);var l=w(),u=b(l),d=e=>{var n=w(),i=b(n),a=e=>{var n=w(),i=b(n);g(i,()=>r.waiting),t(e,n)},o=e=>{Ce(e,{class:`animate-spin m-auto text-muted-foreground`})};f(i,e=>{r.waiting?e(a):c()||e(o,1)}),t(e,n)},p=n=>{var a=w(),s=b(a),l=e=>{var n=w(),a=b(n);g(a,()=>r.error,i),t(e,n)},u=n=>{var r=Ee(),i=E(e(r),2);Te(e(i),{size:16}),T(i),T(r),o(`click`,i,()=>window.location.reload()),t(n,r)};f(s,e=>{r.error?e(l):c()||e(u,1)}),t(n,a)},m=e=>{var n=w(),a=b(n);g(a,()=>r.awaited,i),t(e,n)};f(u,e=>{i()===null?e(d):i()instanceof Error?e(p,1):e(m,-1)}),t(n,l),s()}a([`click`]);var P=M({persist:`auth:account`}),F=M({persist:`auth:challenge`,bind:P}),Oe=M({persist:`auth:method`}),I=O(!1),ke=O(!1),Ae=S([F,P,I],([e,t,n])=>e!==null&&t!==null&&n===!1);function je(e){P.extract()?.id!==e.id&&P.set(null),P.set(e)}function L(e){return{all:e||=new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(e){e(n)}),(r=e.get(`*`))&&r.slice().map(function(e){e(t,n)})}}}var R=c((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Err=void 0,e.Err=class extends Error{code;name=`Error`;message=``;cause;constructor(e,t){super(),this.code=e,delete this.stack,Object.defineProperty(this,"name",{enumerable:!1}),typeof t==`string`?(this.message=t,Object.defineProperty(this,"cause",{enumerable:!1})):(Object.defineProperty(this,"message",{enumerable:!1}),Object.defineProperty(this,"cause",{enumerable:t!==void 0,value:t}))}}}))();async function Me(e,t){if(!e.ok||!e.body||e.bodyUsed)return e;let n=e.headers.get(`content-type`);if(!n||!~n.indexOf(`multipart/`))return e;let r=n.indexOf(`boundary=`),i=`-`;if(~r){let e=r+9,t=n.indexOf(`;`,e);i=n.slice(e,t>-1?t:void 0).trim().replace(/"/g,``)}return async function*(e,t,n){let r,i,a,o=new TextDecoder(`utf8`),s=e.getReader(),c=!n||!n.multiple,l=t.length,u=``,d=[];try{let e;e:for(;!(e=await s.read()).done;){let n=o.decode(e.value,{stream:!0});r=u.length,u+=n;let s=n.indexOf(t);for(~s?r+=s:r=u.indexOf(t),d=[];~r;){let e=u.slice(0,r),n=u.slice(r+l);if(i){let t=e.indexOf(`\r
|
|
2
2
|
\r
|
|
3
3
|
`)+4,r=e.lastIndexOf(`\r
|
|
4
4
|
`,t),i=!1,o=e.slice(t,r>-1?void 0:r),s=String(e.slice(0,t)).trim().split(`\r
|
|
5
5
|
`),l={},u=s.length;for(;a=s[--u];a=a.split(`: `),l[a.shift().toLowerCase()]=a.join(`: `));if(a=l[`content-type`],a&&~a.indexOf(`application/json`))try{o=JSON.parse(o),i=!0}catch{}if(a={headers:l,body:o,json:i},c?yield a:d.push(a),n.slice(0,2)===`--`)break e}else t=`\r
|
|
6
|
-
`+t,i=l+=2;u=n,r=u.indexOf(t)}d.length&&(yield d)}}finally{d.length&&(yield d),await s.cancel()}}(e.body,`--${i}`,t)}var Ne=Object.defineProperty,Pe=(e,t)=>{for(var n in t)Ne(e,n,{get:t[n],enumerable:!0})},Fe=Symbol(`meta`);function Ie(e){return e[Fe]??null}function Le(e,t){Object.defineProperty(e,Fe,{value:t,writable:!1,enumerable:!1,configurable:!1})}var Re=class{origin;events;sleep;fetch=fetch.bind(globalThis);challenge=null;constructor(e){this.origin=e.origin,this.events=e.events,e.sleep!==void 0&&(this.sleep=JSON.stringify(e.sleep))}async json(e,t){let n=this.setup(t),r=await this.request(e,n),i=r.headers.get(`content-type`)===`application/json`?await r.json():await r.text();return typeof i==`object`&&i&&Le(i,{status:r.status,headers:r.headers}),r.ok?(this.events.emit(`response`,{status:r.status,headers:r.headers}),i):(this.events.emit(`error`,{code:r.status,body:i}),new R.Err(r.status,i))}async multipart(e,t){let n=this.setup(t),r=await this.request(e,n);if(!r.ok)return new R.Err(r.status,{body:await r.text()});let i=await Me(r),a=await i.next();if(n.debug&&console.debug(`Multipart ACK`,{path:e,body:a.value.body}),JSON.parse(a.value.body)!==`ACK`)throw Error(`No ACK`);return(async function*(){for await(let t of i){n.debug&&console.debug(`Multipart chunk`,{path:e,body:t.body});let r=JSON.parse(t.body);if(r===`FIN`)return;yield r}})()}async octets(e,t){let n=await this.multipart(e,t);if(n instanceof Error)return n;let r=(await n.next()).value,i=L();return(async()=>{await new Promise(e=>setTimeout(e,0));for await(let r of n){let n=r.status===`completed`?r.error?new R.Err(r.error.code??`UNKNOWN`,r.error.message):r.output:new R.Err(`EXCEPTION`);t?.debug&&console.debug(`Emitting octets step`,{path:e,step:r.step,payload:n}),i.emit(r.step,n)}i.off(`*`)})(),[r,i]}authenticate(e){this.challenge=e}use(e){this.fetch=e}setup(e){if(e??={},e.headers??={},e.headers.accept??=`application/json`,this.sleep!==void 0&&(e.headers.sleep=this.sleep),e.credentials===`include`&&e.headers.authorization===void 0){if(this.challenge===null)throw Error(`Credentials must be set before sending authenticated request`);e.headers.authorization=this.challenge,delete e.credentials}return e.body!==void 0&&(e.method??=`POST`,e.body instanceof File||e.body instanceof ReadableStream?(e.duplex=`half`,e.headers[`content-type`]??=e.body.type??`application/octet-stream`):(e.body=JSON.stringify(e.body),e.headers[`content-type`]??=`application/json`)),e}async request(e,t){let n=new URL(e,this.origin),r=await this.fetch(n.href,t),i=r.headers.get(`authorization`);return i!==null&&(this.challenge=i,this.events.emit(`challenge`,i)),r}},ze=class{agent;path;init;constructor(e){this.agent=e.agent,this.path=e.path,this.init=e.init}async json(e,t){return await this.request(`json`,e,t)}async octets(e,t){return await this.request(`octets`,e,t)}async multipart(e,t){return await this.request(`multipart`,e,t)}async request(e,t,n){let r=typeof t==`string`?t:``;n=typeof t==`string`?n:t;let i=this.abs(r),a=Object.assign({},this.init,n);if(e===`json`)return await this.agent.json(i,a);if(e===`octets`)return await this.agent.octets(i,a);if(e===`multipart`)return await this.agent.multipart(i,a);throw Error(`Invalid method: ${e}`)}abs(e){let t=new URL(this.path,`https://void`),n=new URL(e,t);return n.pathname.endsWith(`/`)||(n.pathname+=`/`),n.pathname+n.search}},Be=class{events;agent;constructor(e){this.events=L(),this.agent=new Re({origin:e.origin,events:this.events,sleep:e.sleep})}resource(e,t){return new ze({agent:this.agent,path:e,init:t})}authenticate(e){this.agent.authenticate(e)}use(e){this.agent.use(e)}};function Ve(e){return typeof e==`string`&&(e={origin:e}),new Be(e)}Pe({},{format:()=>Ue,test:()=>He});function He(e){return/^[[(]\d+\.\.\d+[\])]{1}$/.test(e)}function Ue(e,t){let[n,r]=t.slice(1,-1).split(`..`);return[`${e}${t.startsWith(`(`)?`>`:`>=`}${n}`,`${e}${t.endsWith(`)`)?`<`:`<=`}${r}`]}var We={title:`Configuration`,description:`The configuration of a Toa application`},Ge=8e3,Ke=(()=>{if(typeof window>`u`)return``;let{protocol:e,hostname:t,origin:n}=window.location;return qe(t)?`${e}//${t}:${Ge}`:n})();function qe(e){return e===`localhost`||e===`127.0.0.1`||e===`[::1]`||e.startsWith(`192.168.`)||e.startsWith(`172.16.`)||e.startsWith(`10.`)}var Je=`1`;(()=>{let e=new Date(Number.parseInt(ie)),t=e.getFullYear(),n=new Date(t,0,1).getTime(),r=new Date(t+1,0,1).getTime();return`${Je}.${(t+(e.getTime()-n)/(r-n)).toFixed(4)}`})();var z=Ve({origin:Ke,sleep:void 0});console.info(`Origin connected`,Ke,`no sleep`);var Ye=z.resource(`/identity/`);async function B(e){let t={method:`GET`};return e!==void 0&&(t.headers={authorization:e},t.credentials=`include`),Ye.json(t)}var Xe=z.resource(`/identity/basic/`,{credentials:`include`});async function Ze(e,t){return await Xe.json(e,{method:`POST`,body:t})}var V=z.resource(`/accounts/otp/`);async function H(e,t){return typeof e==`string`?await V.json(e,{method:`POST`,body:t,credentials:`include`}):await V.json({method:`POST`,body:e})}var U=z.resource(`/identity/passkeys/`);async function W(e,t){return typeof e==`string`?await U.json(e,{method:`POST`,body:t,credentials:`include`}):await U.json({method:`POST`,body:e})}var Qe=z.resource(`/identity/federation/`,{credentials:`include`});async function $e(e,t){return await Qe.json(e,{method:`POST`,body:t})}async function G(){let e=F.extract();if(e===null)return;let t=await B(e);if(t instanceof Error)return t;je(t)}function K(e,t){return e instanceof Error?e:(je(e),Oe.set(t),e)}var et=M({persist:`auth:oidc:nonce`});function tt(e,t){let{client:n,endpoint:r,type:i,scope:a}=e;if(n===void 0||n===``)throw Error(`Client ID is required`);let o=nt(),s=new URLSearchParams({client_id:n,redirect_uri:window.location.origin+`/`,response_type:i,response_mode:`fragment`,scope:a,state:btoa(JSON.stringify({idp:t})),nonce:o});et.set(o),window.location.href=r+`?`+s}function nt(){return window.crypto?.randomUUID?.()??Math.random().toString(16).slice(2)}var rt=globalThis.__sveltekit_1iqil03.env,it={apple:{iss:`https://appleid.apple.com`,endpoint:`https://appleid.apple.com/auth/authorize`,type:`code`,scope:`openid`,client:rt.PUBLIC_APPLE_CLIENT_ID},google:{iss:`https://accounts.google.com`,endpoint:`https://accounts.google.com/o/oauth2/v2/auth`,type:`id_token`,scope:`openid profile`,client:rt.PUBLIC_GOOGLE_CLIENT_ID}};async function at(e){await ot();let t=await new Promise(t=>{window.google.accounts.oauth2.initCodeClient({client_id:e.client,scope:e.scope,ux_mode:`popup`,state:btoa(JSON.stringify({idp:`google`})),redirect_uri:window.location.origin+`/`,callback:async e=>{t(e)}}).requestCode()});return t?.code===void 0?Error(`NO_RESPONSE`,{cause:t}):t.code}function ot(){return new Promise((e,t)=>{if(window.google?.accounts?.oauth2!==void 0)return e(void 0);let n=document.createElement(`script`);n.src=`https://accounts.google.com/gsi/client`,n.async=!0,n.onload=()=>e(void 0),n.onerror=t,document.head.appendChild(n)})}var q=typeof window<`u`&&window;async function st(e){await ct(e);let t=await q.AppleID.auth.signIn().catch(e=>e);return t instanceof Error?t:t?.authorization===void 0?Error(`No authentication response received`,{cause:t}):t.authorization.code}function ct(e){if(q.AppleID===void 0)return new Promise((t,n)=>{let r=document.createElement(`script`);r.src=`https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js`,r.async=!0,r.onload=()=>{q.AppleID.auth.init({clientId:e.client,scope:e.scope,redirectURI:window.location.origin,state:btoa(JSON.stringify({idp:`apple`})),usePopup:!0}),t(void 0)},r.onerror=n,document.head.appendChild(r)})}var lt={apple:st,google:at};async function ut(e,t){let n=await dt(e);return n instanceof Error?n:t===void 0?pt(e,n):ft(t,n)}async function dt(e){let t=lt[e]??tt,n=it[e],r=await t(n,e);if(r instanceof Error)return console.error(`Authentication failed`,r),r;if(r===void 0)throw Error(`No authentication code received, redirect flow is not supported`);let i={code:r,iss:n.iss,for:window.location.origin};return btoa(JSON.stringify(i))}async function ft(e,t){let n=await $e(e,{scheme:`code`,credentials:t});if(n instanceof Error)return n;G()}async function pt(e,t){return K(await B(`Code `+t),e)}function mt(){P.set(null)}async function ht(e,t){return K(await B(`Basic `+btoa(`${e}:${t}`)),`password`)}async function gt(e,t){return await Ze(e,t)}async function _t(e,t){let n=await gt(e,t);if(n instanceof Error)return n;G()}async function vt(e){return H({email:e})}async function yt(e,t){return await H(e,{email:t})}async function bt(e,t){return K(await B(`OTP `+btoa(`${e}:${t}`)),`password`)}var xt=z.resource(`/identity/passkeys/challenges/`);async function St(e,t){let n={type:e};return t===void 0?await xt.json(`.`,{method:`POST`,body:n}):await xt.json(t,{method:`POST`,body:n})}var Ct=z.resource(`/identity/passkeys/`);async function wt(e){return await Ct.json(e,{credentials:`include`})}async function Tt(){return await wt((await me(P)).id)}k({get:Tt,persist:`identity:passkeys`,bind:P,stale:!0});function J(e){let t=(e+`=`.repeat((4-e.length%4)%4)).replace(/-/g,`+`).replace(/_/g,`/`),n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r.buffer}function Et(e){return new TextEncoder().encode(e).buffer}function Y(e){return btoa(String.fromCharCode(...new Uint8Array(e))).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}function Dt({id:e,transports:t}){return{id:J(e),type:`public-key`,transports:t}}async function Ot(e,t){let n={challenge:J(t.challenge),timeout:t.timeout,authenticatorSelection:t.authenticatorSelection,pubKeyCredParams:t.pubKeyCredParams,rp:{name:`app`},user:{id:Et(e.id),name:e.name,displayName:e.name},excludeCredentials:t.excludeCredentials.map(Dt)};return await navigator.credentials.create({publicKey:n}).catch(e=>e)}async function kt(e){let t={timeout:e.timeout,challenge:J(e.challenge),allowCredentials:e.allowCredentials.map(Dt),userVerification:e.userVerification};return await navigator.credentials.get({publicKey:t})}async function At(e,t){let n=await St(`creation`,t);if(n instanceof Error)return n;let r=await Ot({id:n.identity,name:e},n);if(r instanceof Error)return r;if(r===null)throw Error(`No credential is created`);return{key:jt(r,e),identity:n.identity}}function jt(e,t){let n=e.response,r=n.getAuthenticatorData(),i=n.getTransports(),a=n.getPublicKeyAlgorithm(),o=n.getPublicKey(),s=e.getClientExtensionResults();if(o===null)throw Error(`No public key is created`);return{id:e.id,type:e.type,response:{attestationObject:Y(n.attestationObject),clientDataJSON:Y(n.clientDataJSON),authenticatorData:Y(r),transports:i,publicKeyAlgorithm:a,publicKey:Y(o)},authenticatorAttachment:e.authenticatorAttachment,clientExtensionResults:s,label:t}}async function Mt(e){let t=await St(`request`,e);if(t instanceof Error)return t;let n=Date.now(),r=await kt(t).catch(e=>e);return r instanceof Error?r.name===`NotAllowedError`&&Date.now()-n<50?new Pt:r:r===null?Error(`No credential given`):Nt(r)}function Nt(e){let t=e.response;return{id:e.id,type:e.type,response:{authenticatorData:Y(t.authenticatorData),clientDataJSON:Y(t.clientDataJSON),signature:Y(t.signature),userHandle:t.userHandle===null?null:Y(t.userHandle)},authenticatorAttachment:e.authenticatorAttachment,clientExtensionResults:e.getClientExtensionResults()}}var Pt=class extends Error{constructor(){super(),this.name=this.constructor.name}},Ft=typeof window>`u`||window.PublicKeyCredential!==void 0;async function It(e,t){let n=await At(e,t);if(n instanceof Error)return console.error(`Credential creation failed`,n),n;let r=await W(n.identity,n.key);if(r instanceof Error)return console.error(`Credential registration failed`,r),r;let i=F.extract();return i===null?Error(`Unauthenticated`):K(await B(i),`passkey`)}async function Lt(e){let t=await Mt(e);if(t instanceof Error)return console.error(`Credential request failed`,t),t;let n=await W(t);if(n instanceof Error)return console.error(`Credential verification failed`,n),n;let r=F.extract();return r===null?Error(`Unauthenticated`):K(await B(r),`passkey`)}function Rt(){}function zt(e){if(!(e.type===`popstate`&&e.event.hasUAVisualTransition)&&document.startViewTransition!==void 0)return new Promise(t=>{let n=document.startViewTransition({types:[`route`],update:async()=>{Bt(),t(),await e.complete}});n.finished.then(Vt,Vt),n.ready.catch(Rt)})}var X=null;function Bt(){if(X===null)return;let e=X.el.style.viewTransitionName===X.name;X.el.style.viewTransitionName=e?``:X.name,X.el.style.viewTransitionClass=e?``:X.classes??``}function Vt(){X!==null&&X.el.style.viewTransitionName===X.name&&(Ht(X),X=null)}function Ht(e){e.el.style.viewTransitionName=``,e.el.style.viewTransitionClass=``}O(!1),navigator.userAgent.toLowerCase().includes(`windows`);var Ut=/mac ?os|ios|ipad ?os/i.test(navigator.userAgentData?.platform??``)||/(Mac|iPhone|iPad|iPod)/.test(navigator.userAgent);/android/i.test(navigator.userAgent),/(iPhone|iPad|iPod)/.test(navigator.userAgent),/^((?!chrome|android).)*safari/i.test(navigator.userAgent),`ontouchstart`in window,window.matchMedia(`(display-mode: standalone)`).matches,/PWAShell/i.test(navigator.userAgent),navigator.userAgent.match(/PWAShell\/(\S+)/)?.[1];var Wt=!(`ontouchstart`in window);[`en-US`,`en-LR`,`en-MM`].includes(navigator.language),[`en-US`,`en-GB`,`en-CA`,`en-AU`,`en-NZ`,`en-IE`,`en-IN`,`en-LR`,`en-MM`].includes(navigator.language);function Gt(e=navigator.userAgent){return[/FBAN|FBAV|FB_IAB/i,/Instagram/i,/Twitter/i,/Line/i,/LinkedIn/i,/Snapchat/i,/WhatsApp/i,/WeChat/i,/Messenger/i,/QQ/i,/Reddit/i,/Puffin/i,/TikTok/i,/musical.ly/i,/YouTube/i,/Pinterest/i,/Discord/i,/Telegram/i,/Viber/i,/Slack/i,/Signal/i,/KakaoTalk/i,/Baidu/i].some(t=>t.test(e))||(()=>{let t=RegExp(`(${[`WebView`,`(iPhone|iPod|iPad)(?!.*Safari/)`,`Android.*(wv)`,`(AppleWebKit)(?!.*Safari)`].join(`|`)})`,`ig`);return e.match(t)!==null})()||`TelegramWebviewProxy`in window||`TelegramWebviewProxyProto`in window||`TelegramWebview`in window}Gt(navigator.userAgent);var Kt=new URLSearchParams;new URLSearchParams;function qt(e){return Kt.get(e)}function Jt(e,t=24){return m(e,n=>{let r=Date.now(),i=setInterval(()=>a(),1e3/t);function a(){let t=e-(Date.now()-r);t>0?n(t):(n(0),clearInterval(i))}return a(),()=>clearInterval(i)})}var Yt={"en-US":{native:`English`,locale:`en-US`,dir:`ltr`,nav:{signout:`Sign out`,filter:`Filter components`}}},Xt=[`en-US`];function Zt(e){return Xt.some(t=>t.startsWith(e))}function Z(e){return Xt.find(t=>t.startsWith(e))??`en-US`}var Q=c((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.format=o,e.parse=s;var t=/^[\u0009\u0020-\u007e\u0080-\u00ff]*$/,n=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,r=/[\\"]/g,i=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,a=(()=>{let e=function(){};return e.prototype=Object.create(null),e})();function o(e){let{type:t,parameters:r}=e;if(!t||!i.test(t))throw TypeError(`Invalid type: ${t}`);let a=t;if(r)for(let e of Object.keys(r)){if(!n.test(e))throw TypeError(`Invalid parameter name: ${e}`);a+=`; ${e}=${y(r[e])}`}return a}function s(e,t){let n=t?.comma===!0?m:65536,r=e.length,i=_(e,t?.start??0,r),o=i;i=g(e,i,r,n);let s=v(e,o,i),c=e.slice(o,s).toLowerCase();return t?.parameters===!1?{type:c,index:i,parameters:new a}:h(e,c,i,r,n)}var c=32,l=9,u=59,d=61,f=34,p=92,m=44;function h(e,t,n,r,i){let o=new a;parameter:for(;n<r&&e.charCodeAt(n)!==i;){n=_(e,n+1,r);let t=n;for(;n<r;){let a=e.charCodeAt(n);if(a===i)break parameter;if(a===u)continue parameter;if(a===d){let a=v(e,t,n),s=e.slice(t,a).toLowerCase();if(n=_(e,n+1,r),n<r&&e.charCodeAt(n)===f){n++;let t=``;for(;n<r;){let a=e.charCodeAt(n++);if(a===f){n=g(e,n,r,i),o[s]===void 0&&(o[s]=t);break}if(a===p&&n<r){t+=e[n++];continue}t+=String.fromCharCode(a)}continue parameter}let c=n;if(n=g(e,n,r,i),o[s]===void 0){let t=v(e,c,n);o[s]=e.slice(c,t)}continue parameter}n++}}return{type:t,index:n,parameters:o}}function g(e,t,n,r){for(;t<n;){let n=e.charCodeAt(t);if(n===u||n===r)break;t++}return t}function _(e,t,n){for(;t<n;){let n=e.charCodeAt(t);if(n!==c&&n!==l)break;t++}return t}function v(e,t,n){for(;n>t;){let t=e.charCodeAt(n-1);if(t!==c&&t!==l)break;n--}return n}function y(e){if(n.test(e))return e;if(t.test(e))return`"${e.replace(r,`\\$&`)}"`;throw TypeError(`Invalid parameter value: ${e}`)}})),$=c(((e,t)=>{var n=Q();t.exports=r;function r(e){for(var t=[],r=0;r<e.length;){var a=i(e,r),o=n.parse(e,{comma:!0,start:a});o.type=e.slice(a,a+o.type.length),t.push(o),r=o.index+1}return t}function i(e,t){for(var n=t;e.charCodeAt(n)===32||e.charCodeAt(n)===9;)n++;return n}})),Qt=c(((e,t)=>{var n=$();t.exports=s,t.exports.preferredCharsets=s;function r(e){for(var t=n(e),r=0,a=0;r<t.length;r++){var o=i(t[r],r);o&&(t[a++]=o)}return t.length=a,t}function i(e,t){return e.type?{charset:e.type,q:e.parameters.q?parseFloat(e.parameters.q):1,i:t}:null}function a(e,t,n){for(var r={o:-1,q:0,s:0},i=0;i<t.length;i++){var a=o(e,t[i],n);a&&(r.s-a.s||r.q-a.q||r.o-a.o)<0&&(r=a)}return r}function o(e,t,n){var r=0;if(t.charset.toLowerCase()===e.toLowerCase())r|=1;else if(t.charset!==`*`)return null;return{i:n,o:t.i,q:t.q,s:r}}function s(e,t){var n=r(e===void 0?`*`:e||``);if(!t)return n.filter(u).sort(c).map(l);var i=t.map(function(e,t){return a(e,n,t)});return i.filter(u).sort(c).map(function(e){return t[i.indexOf(e)]})}function c(e,t){return t.q-e.q||t.s-e.s||e.o-t.o||e.i-t.i||0}function l(e){return e.charset}function u(e){return e.q>0}})),$t=c(((e,t)=>{var n=$();t.exports=s,t.exports.preferredEncodings=s;function r(e){for(var t=n(e),r=!1,a=1,s=0,c=0;s<t.length;s++){var l=i(t[s],s);l&&(t[c++]=l,r||=o(`identity`,l),a=Math.min(a,l.q||1))}return r||(t[c++]={encoding:`identity`,q:a,i:s}),t.length=c,t}function i(e,t){return e.type?{encoding:e.type,q:e.parameters.q?parseFloat(e.parameters.q):1,i:t}:null}function a(e,t,n){for(var r={encoding:e,o:-1,q:0,s:0},i=0;i<t.length;i++){var a=o(e,t[i],n);a&&(r.s-a.s||r.q-a.q||r.o-a.o)<0&&(r=a)}return r}function o(e,t,n){var r=0;if(t.encoding.toLowerCase()===e.toLowerCase())r|=1;else if(t.encoding!==`*`)return null;return{encoding:e,i:n,o:t.i,q:t.q,s:r}}function s(e,t,n){var i=r(e||``),o=n?function(e,t){if(e.q!==t.q)return t.q-e.q;var r=n.indexOf(e.encoding),i=n.indexOf(t.encoding);return r===-1&&i===-1?t.s-e.s||e.o-t.o||e.i-t.i:r!==-1&&i!==-1?r-i:r===-1?1:-1}:c;if(!t)return i.filter(u).sort(o).map(l);var s=t.map(function(e,t){return a(e,i,t)});return s.filter(u).sort(o).map(function(e){return t[s.indexOf(e)]})}function c(e,t){return t.q-e.q||t.s-e.s||e.o-t.o||e.i-t.i}function l(e){return e.encoding}function u(e){return e.q>0}})),en=c(((e,t)=>{var n=Q(),r=$();t.exports=c,t.exports.preferredLanguages=c;function i(e){for(var t=r(e),n=0,i=0;n<t.length;n++){var o=a(t[n],n);o&&(t[i++]=o)}return t.length=i,t}function a(e,t){if(!e.type)return null;var n=e.type.indexOf(`-`);return{prefix:n===-1?e.type:e.type.slice(0,n),suffix:n===-1?void 0:e.type.slice(n+1),q:e.parameters.q?parseFloat(e.parameters.q):1,i:t,full:e.type}}function o(e,t,n){for(var r={o:-1,q:0,s:0},i=0;i<t.length;i++){var a=s(e,t[i],n);a&&(r.s-a.s||r.q-a.q||r.o-a.o)<0&&(r=a)}return r}function s(e,t,r){var i=a(n.parse(e),0);if(!i)return null;var o=0;if(t.full.toLowerCase()===i.full.toLowerCase())o|=4;else if(t.prefix.toLowerCase()===i.full.toLowerCase())o|=2;else if(t.full.toLowerCase()===i.prefix.toLowerCase())o|=1;else if(t.full!==`*`)return null;return{i:r,o:t.i,q:t.q,s:o}}function c(e,t){var n=i(e===void 0?`*`:e||``);if(!t)return n.filter(d).sort(l).map(u);var r=t.map(function(e,t){return o(e,n,t)});return r.filter(d).sort(l).map(function(e){return t[r.indexOf(e)]})}function l(e,t){return t.q-e.q||t.s-e.s||e.o-t.o||e.i-t.i||0}function u(e){return e.full}function d(e){return e.q>0}})),tn=c(((e,t)=>{var n=Q(),r=$();t.exports=c,t.exports.preferredMediaTypes=c;function i(e){for(var t=r(e),n=0,i=0;n<t.length;n++){var o=a(t[n],n);o&&(t[i++]=o)}return t.length=i,t}function a(e,t){var n=e.type.indexOf(`/`);if(n===-1)return null;var r=e.parameters.q?parseFloat(e.parameters.q):1;return delete e.parameters.q,{type:e.type.slice(0,n),subtype:e.type.slice(n+1),params:e.parameters,q:r,i:t}}function o(e,t,n){for(var r={o:-1,q:0,s:0},i=0;i<t.length;i++){var a=s(e,t[i],n);a&&(r.s-a.s||r.q-a.q||r.o-a.o)<0&&(r=a)}return r}function s(e,t,r){var i=a(n.parse(e),0),o=0;if(!i)return null;if(t.type.toLowerCase()==i.type.toLowerCase())o|=4;else if(t.type!=`*`)return null;if(t.subtype.toLowerCase()==i.subtype.toLowerCase())o|=2;else if(t.subtype!=`*`)return null;var s=Object.keys(t.params);if(s.length>0){if(s.every(function(e){return t.params[e]==`*`||(t.params[e]||``).toLowerCase()==(i.params[e]||``).toLowerCase()}))o|=1;else return null}return{i:r,o:t.i,q:t.q,s:o}}function c(e,t){var n=i(e===void 0?`*/*`:e||``);if(!t)return n.filter(d).sort(l).map(u);var r=t.map(function(e,t){return o(e,n,t)});return r.filter(d).sort(l).map(function(e){return t[r.indexOf(e)]})}function l(e,t){return t.q-e.q||t.s-e.s||e.o-t.o||e.i-t.i||0}function u(e){return e.type+`/`+e.subtype}function d(e){return e.q>0}}));c(((e,t)=>{var n=Qt(),r=$t(),i=en(),a=tn();t.exports=o,t.exports.Negotiator=o;function o(e){if(!(this instanceof o))return new o(e);this.request=e}o.prototype.charset=function(e){var t=this.charsets(e);return t&&t[0]},o.prototype.charsets=function(e){return n(this.request.headers[`accept-charset`],e)},o.prototype.encoding=function(e,t){var n=this.encodings(e,t);return n&&n[0]},o.prototype.encodings=function(e,t){var n=t||{};return r(this.request.headers[`accept-encoding`],e,n.preferred)},o.prototype.language=function(e){var t=this.languages(e);return t&&t[0]},o.prototype.languages=function(e){return i(this.request.headers[`accept-language`],e)},o.prototype.mediaType=function(e){var t=this.mediaTypes(e);return t&&t[0]},o.prototype.mediaTypes=function(e){return a(this.request.headers.accept,e)},o.prototype.preferredCharset=o.prototype.charset,o.prototype.preferredCharsets=o.prototype.charsets,o.prototype.preferredEncoding=o.prototype.encoding,o.prototype.preferredEncodings=o.prototype.encodings,o.prototype.preferredLanguage=o.prototype.language,o.prototype.preferredLanguages=o.prototype.languages,o.prototype.preferredMediaType=o.prototype.mediaType,o.prototype.preferredMediaTypes=o.prototype.mediaTypes}))();var nn=`en-US`,rn=M({persist:`intl:selected`}),an=S([P,rn],([e,t])=>t?Z(t):on()||(e?.locale!==void 0&&Zt(e.locale)?Z(e.locale):nn));S(P,e=>e?.grammar??`none`);function on(){if(typeof navigator<`u`){for(let e of navigator.languages)if(Zt(e))return Z(e)}return null}var sn=S(an,e=>Yt[e]);export{De as A,L as C,ke as D,F as E,ce as F,k as I,Ce as M,N,Oe as O,he as P,Ie as S,Ae as T,ut as _,Ut as a,z as b,Lt as c,yt as d,vt as f,mt as g,ht as h,qt as i,Te as j,I as k,It as l,_t as m,an as n,Wt as o,bt as p,Jt as r,zt as s,sn as t,Ft as u,it as v,P as w,We as x,G as y};
|
|
6
|
+
`+t,i=l+=2;u=n,r=u.indexOf(t)}d.length&&(yield d)}}finally{d.length&&(yield d),await s.cancel()}}(e.body,`--${i}`,t)}var Ne=Object.defineProperty,Pe=(e,t)=>{for(var n in t)Ne(e,n,{get:t[n],enumerable:!0})},Fe=Symbol(`meta`);function Ie(e){return e[Fe]??null}function Le(e,t){Object.defineProperty(e,Fe,{value:t,writable:!1,enumerable:!1,configurable:!1})}var Re=class{origin;events;sleep;fetch=fetch.bind(globalThis);challenge=null;constructor(e){this.origin=e.origin,this.events=e.events,e.sleep!==void 0&&(this.sleep=JSON.stringify(e.sleep))}async json(e,t){let n=this.setup(t),r=await this.request(e,n),i=r.headers.get(`content-type`)===`application/json`?await r.json():await r.text();return typeof i==`object`&&i&&Le(i,{status:r.status,headers:r.headers}),r.ok?(this.events.emit(`response`,{status:r.status,headers:r.headers}),i):(this.events.emit(`error`,{code:r.status,body:i}),new R.Err(r.status,i))}async multipart(e,t){let n=this.setup(t),r=await this.request(e,n);if(!r.ok)return new R.Err(r.status,{body:await r.text()});let i=await Me(r),a=await i.next();if(n.debug&&console.debug(`Multipart ACK`,{path:e,body:a.value.body}),JSON.parse(a.value.body)!==`ACK`)throw Error(`No ACK`);return(async function*(){for await(let t of i){n.debug&&console.debug(`Multipart chunk`,{path:e,body:t.body});let r=JSON.parse(t.body);if(r===`FIN`)return;yield r}})()}async octets(e,t){let n=await this.multipart(e,t);if(n instanceof Error)return n;let r=(await n.next()).value,i=L();return(async()=>{await new Promise(e=>setTimeout(e,0));for await(let r of n){let n=r.status===`completed`?r.error?new R.Err(r.error.code??`UNKNOWN`,r.error.message):r.output:new R.Err(`EXCEPTION`);t?.debug&&console.debug(`Emitting octets step`,{path:e,step:r.step,payload:n}),i.emit(r.step,n)}i.off(`*`)})(),[r,i]}authenticate(e){this.challenge=e}use(e){this.fetch=e}setup(e){if(e??={},e.headers??={},e.headers.accept??=`application/json`,this.sleep!==void 0&&(e.headers.sleep=this.sleep),e.credentials===`include`&&e.headers.authorization===void 0){if(this.challenge===null)throw Error(`Credentials must be set before sending authenticated request`);e.headers.authorization=this.challenge,delete e.credentials}return e.body!==void 0&&(e.method??=`POST`,e.body instanceof File||e.body instanceof ReadableStream?(e.duplex=`half`,e.headers[`content-type`]??=e.body.type??`application/octet-stream`):(e.body=JSON.stringify(e.body),e.headers[`content-type`]??=`application/json`)),e}async request(e,t){let n=new URL(e,this.origin),r=await this.fetch(n.href,t),i=r.headers.get(`authorization`);return i!==null&&(this.challenge=i,this.events.emit(`challenge`,i)),r}},ze=class{agent;path;init;constructor(e){this.agent=e.agent,this.path=e.path,this.init=e.init}async json(e,t){return await this.request(`json`,e,t)}async octets(e,t){return await this.request(`octets`,e,t)}async multipart(e,t){return await this.request(`multipart`,e,t)}async request(e,t,n){let r=typeof t==`string`?t:``;n=typeof t==`string`?n:t;let i=this.abs(r),a=Object.assign({},this.init,n);if(e===`json`)return await this.agent.json(i,a);if(e===`octets`)return await this.agent.octets(i,a);if(e===`multipart`)return await this.agent.multipart(i,a);throw Error(`Invalid method: ${e}`)}abs(e){let t=new URL(this.path,`https://void`),n=new URL(e,t);return n.pathname.endsWith(`/`)||(n.pathname+=`/`),n.pathname+n.search}},Be=class{events;agent;constructor(e){this.events=L(),this.agent=new Re({origin:e.origin,events:this.events,sleep:e.sleep})}resource(e,t){return new ze({agent:this.agent,path:e,init:t})}authenticate(e){this.agent.authenticate(e)}use(e){this.agent.use(e)}};function Ve(e){return typeof e==`string`&&(e={origin:e}),new Be(e)}Pe({},{format:()=>Ue,test:()=>He});function He(e){return/^[[(]\d+\.\.\d+[\])]{1}$/.test(e)}function Ue(e,t){let[n,r]=t.slice(1,-1).split(`..`);return[`${e}${t.startsWith(`(`)?`>`:`>=`}${n}`,`${e}${t.endsWith(`)`)?`<`:`<=`}${r}`]}var We={title:`Configuration`,description:`The configuration of a Toa application`},Ge=8e3,Ke=(()=>{if(typeof window>`u`)return``;let{protocol:e,hostname:t,origin:n}=window.location;return qe(t)?`${e}//${t}:${Ge}`:n})();function qe(e){return e===`localhost`||e===`127.0.0.1`||e===`[::1]`||e.startsWith(`192.168.`)||e.startsWith(`172.16.`)||e.startsWith(`10.`)}var Je=`1`;(()=>{let e=new Date(Number.parseInt(ie)),t=e.getFullYear(),n=new Date(t,0,1).getTime(),r=new Date(t+1,0,1).getTime();return`${Je}.${(t+(e.getTime()-n)/(r-n)).toFixed(4)}`})();var z=Ve({origin:Ke,sleep:void 0});console.info(`Origin connected`,Ke,`no sleep`);var Ye=z.resource(`/identity/`);async function B(e){let t={method:`GET`};return e!==void 0&&(t.headers={authorization:e},t.credentials=`include`),Ye.json(t)}var Xe=z.resource(`/identity/basic/`,{credentials:`include`});async function Ze(e,t){return await Xe.json(e,{method:`POST`,body:t})}var V=z.resource(`/accounts/otp/`);async function H(e,t){return typeof e==`string`?await V.json(e,{method:`POST`,body:t,credentials:`include`}):await V.json({method:`POST`,body:e})}var U=z.resource(`/identity/passkeys/`);async function W(e,t){return typeof e==`string`?await U.json(e,{method:`POST`,body:t,credentials:`include`}):await U.json({method:`POST`,body:e})}var Qe=z.resource(`/identity/federation/`,{credentials:`include`});async function $e(e,t){return await Qe.json(e,{method:`POST`,body:t})}async function G(){let e=F.extract();if(e===null)return;let t=await B(e);if(t instanceof Error)return t;je(t)}function K(e,t){return e instanceof Error?e:(je(e),Oe.set(t),e)}var et=M({persist:`auth:oidc:nonce`});function tt(e,t){let{client:n,endpoint:r,type:i,scope:a}=e;if(n===void 0||n===``)throw Error(`Client ID is required`);let o=nt(),s=new URLSearchParams({client_id:n,redirect_uri:window.location.origin+`/`,response_type:i,response_mode:`fragment`,scope:a,state:btoa(JSON.stringify({idp:t})),nonce:o});et.set(o),window.location.href=r+`?`+s}function nt(){return window.crypto?.randomUUID?.()??Math.random().toString(16).slice(2)}var rt=globalThis.__sveltekit_13usql5.env,it={apple:{iss:`https://appleid.apple.com`,endpoint:`https://appleid.apple.com/auth/authorize`,type:`code`,scope:`openid`,client:rt.PUBLIC_APPLE_CLIENT_ID},google:{iss:`https://accounts.google.com`,endpoint:`https://accounts.google.com/o/oauth2/v2/auth`,type:`id_token`,scope:`openid profile`,client:rt.PUBLIC_GOOGLE_CLIENT_ID}};async function at(e){await ot();let t=await new Promise(t=>{window.google.accounts.oauth2.initCodeClient({client_id:e.client,scope:e.scope,ux_mode:`popup`,state:btoa(JSON.stringify({idp:`google`})),redirect_uri:window.location.origin+`/`,callback:async e=>{t(e)}}).requestCode()});return t?.code===void 0?Error(`NO_RESPONSE`,{cause:t}):t.code}function ot(){return new Promise((e,t)=>{if(window.google?.accounts?.oauth2!==void 0)return e(void 0);let n=document.createElement(`script`);n.src=`https://accounts.google.com/gsi/client`,n.async=!0,n.onload=()=>e(void 0),n.onerror=t,document.head.appendChild(n)})}var q=typeof window<`u`&&window;async function st(e){await ct(e);let t=await q.AppleID.auth.signIn().catch(e=>e);return t instanceof Error?t:t?.authorization===void 0?Error(`No authentication response received`,{cause:t}):t.authorization.code}function ct(e){if(q.AppleID===void 0)return new Promise((t,n)=>{let r=document.createElement(`script`);r.src=`https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js`,r.async=!0,r.onload=()=>{q.AppleID.auth.init({clientId:e.client,scope:e.scope,redirectURI:window.location.origin,state:btoa(JSON.stringify({idp:`apple`})),usePopup:!0}),t(void 0)},r.onerror=n,document.head.appendChild(r)})}var lt={apple:st,google:at};async function ut(e,t){let n=await dt(e);return n instanceof Error?n:t===void 0?pt(e,n):ft(t,n)}async function dt(e){let t=lt[e]??tt,n=it[e],r=await t(n,e);if(r instanceof Error)return console.error(`Authentication failed`,r),r;if(r===void 0)throw Error(`No authentication code received, redirect flow is not supported`);let i={code:r,iss:n.iss,for:window.location.origin};return btoa(JSON.stringify(i))}async function ft(e,t){let n=await $e(e,{scheme:`code`,credentials:t});if(n instanceof Error)return n;G()}async function pt(e,t){return K(await B(`Code `+t),e)}function mt(){P.set(null)}async function ht(e,t){return K(await B(`Basic `+btoa(`${e}:${t}`)),`password`)}async function gt(e,t){return await Ze(e,t)}async function _t(e,t){let n=await gt(e,t);if(n instanceof Error)return n;G()}async function vt(e){return H({email:e})}async function yt(e,t){return await H(e,{email:t})}async function bt(e,t){return K(await B(`OTP `+btoa(`${e}:${t}`)),`password`)}var xt=z.resource(`/identity/passkeys/challenges/`);async function St(e,t){let n={type:e};return t===void 0?await xt.json(`.`,{method:`POST`,body:n}):await xt.json(t,{method:`POST`,body:n})}var Ct=z.resource(`/identity/passkeys/`);async function wt(e){return await Ct.json(e,{credentials:`include`})}async function Tt(){return await wt((await me(P)).id)}k({get:Tt,persist:`identity:passkeys`,bind:P,stale:!0});function J(e){let t=(e+`=`.repeat((4-e.length%4)%4)).replace(/-/g,`+`).replace(/_/g,`/`),n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r.buffer}function Et(e){return new TextEncoder().encode(e).buffer}function Y(e){return btoa(String.fromCharCode(...new Uint8Array(e))).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}function Dt({id:e,transports:t}){return{id:J(e),type:`public-key`,transports:t}}async function Ot(e,t){let n={challenge:J(t.challenge),timeout:t.timeout,authenticatorSelection:t.authenticatorSelection,pubKeyCredParams:t.pubKeyCredParams,rp:{name:`app`},user:{id:Et(e.id),name:e.name,displayName:e.name},excludeCredentials:t.excludeCredentials.map(Dt)};return await navigator.credentials.create({publicKey:n}).catch(e=>e)}async function kt(e){let t={timeout:e.timeout,challenge:J(e.challenge),allowCredentials:e.allowCredentials.map(Dt),userVerification:e.userVerification};return await navigator.credentials.get({publicKey:t})}async function At(e,t){let n=await St(`creation`,t);if(n instanceof Error)return n;let r=await Ot({id:n.identity,name:e},n);if(r instanceof Error)return r;if(r===null)throw Error(`No credential is created`);return{key:jt(r,e),identity:n.identity}}function jt(e,t){let n=e.response,r=n.getAuthenticatorData(),i=n.getTransports(),a=n.getPublicKeyAlgorithm(),o=n.getPublicKey(),s=e.getClientExtensionResults();if(o===null)throw Error(`No public key is created`);return{id:e.id,type:e.type,response:{attestationObject:Y(n.attestationObject),clientDataJSON:Y(n.clientDataJSON),authenticatorData:Y(r),transports:i,publicKeyAlgorithm:a,publicKey:Y(o)},authenticatorAttachment:e.authenticatorAttachment,clientExtensionResults:s,label:t}}async function Mt(e){let t=await St(`request`,e);if(t instanceof Error)return t;let n=Date.now(),r=await kt(t).catch(e=>e);return r instanceof Error?r.name===`NotAllowedError`&&Date.now()-n<50?new Pt:r:r===null?Error(`No credential given`):Nt(r)}function Nt(e){let t=e.response;return{id:e.id,type:e.type,response:{authenticatorData:Y(t.authenticatorData),clientDataJSON:Y(t.clientDataJSON),signature:Y(t.signature),userHandle:t.userHandle===null?null:Y(t.userHandle)},authenticatorAttachment:e.authenticatorAttachment,clientExtensionResults:e.getClientExtensionResults()}}var Pt=class extends Error{constructor(){super(),this.name=this.constructor.name}},Ft=typeof window>`u`||window.PublicKeyCredential!==void 0;async function It(e,t){let n=await At(e,t);if(n instanceof Error)return console.error(`Credential creation failed`,n),n;let r=await W(n.identity,n.key);if(r instanceof Error)return console.error(`Credential registration failed`,r),r;let i=F.extract();return i===null?Error(`Unauthenticated`):K(await B(i),`passkey`)}async function Lt(e){let t=await Mt(e);if(t instanceof Error)return console.error(`Credential request failed`,t),t;let n=await W(t);if(n instanceof Error)return console.error(`Credential verification failed`,n),n;let r=F.extract();return r===null?Error(`Unauthenticated`):K(await B(r),`passkey`)}function Rt(){}function zt(e){if(!(e.type===`popstate`&&e.event.hasUAVisualTransition)&&document.startViewTransition!==void 0)return new Promise(t=>{let n=document.startViewTransition({types:[`route`],update:async()=>{Bt(),t(),await e.complete}});n.finished.then(Vt,Vt),n.ready.catch(Rt)})}var X=null;function Bt(){if(X===null)return;let e=X.el.style.viewTransitionName===X.name;X.el.style.viewTransitionName=e?``:X.name,X.el.style.viewTransitionClass=e?``:X.classes??``}function Vt(){X!==null&&X.el.style.viewTransitionName===X.name&&(Ht(X),X=null)}function Ht(e){e.el.style.viewTransitionName=``,e.el.style.viewTransitionClass=``}O(!1),navigator.userAgent.toLowerCase().includes(`windows`);var Ut=/mac ?os|ios|ipad ?os/i.test(navigator.userAgentData?.platform??``)||/(Mac|iPhone|iPad|iPod)/.test(navigator.userAgent);/android/i.test(navigator.userAgent),/(iPhone|iPad|iPod)/.test(navigator.userAgent),/^((?!chrome|android).)*safari/i.test(navigator.userAgent),`ontouchstart`in window,window.matchMedia(`(display-mode: standalone)`).matches,/PWAShell/i.test(navigator.userAgent),navigator.userAgent.match(/PWAShell\/(\S+)/)?.[1];var Wt=!(`ontouchstart`in window);[`en-US`,`en-LR`,`en-MM`].includes(navigator.language),[`en-US`,`en-GB`,`en-CA`,`en-AU`,`en-NZ`,`en-IE`,`en-IN`,`en-LR`,`en-MM`].includes(navigator.language);function Gt(e=navigator.userAgent){return[/FBAN|FBAV|FB_IAB/i,/Instagram/i,/Twitter/i,/Line/i,/LinkedIn/i,/Snapchat/i,/WhatsApp/i,/WeChat/i,/Messenger/i,/QQ/i,/Reddit/i,/Puffin/i,/TikTok/i,/musical.ly/i,/YouTube/i,/Pinterest/i,/Discord/i,/Telegram/i,/Viber/i,/Slack/i,/Signal/i,/KakaoTalk/i,/Baidu/i].some(t=>t.test(e))||(()=>{let t=RegExp(`(${[`WebView`,`(iPhone|iPod|iPad)(?!.*Safari/)`,`Android.*(wv)`,`(AppleWebKit)(?!.*Safari)`].join(`|`)})`,`ig`);return e.match(t)!==null})()||`TelegramWebviewProxy`in window||`TelegramWebviewProxyProto`in window||`TelegramWebview`in window}Gt(navigator.userAgent);var Kt=new URLSearchParams;new URLSearchParams;function qt(e){return Kt.get(e)}function Jt(e,t=24){return m(e,n=>{let r=Date.now(),i=setInterval(()=>a(),1e3/t);function a(){let t=e-(Date.now()-r);t>0?n(t):(n(0),clearInterval(i))}return a(),()=>clearInterval(i)})}var Yt={"en-US":{native:`English`,locale:`en-US`,dir:`ltr`,nav:{signout:`Sign out`,filter:`Filter components`}}},Xt=[`en-US`];function Zt(e){return Xt.some(t=>t.startsWith(e))}function Z(e){return Xt.find(t=>t.startsWith(e))??`en-US`}var Q=c((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.format=o,e.parse=s;var t=/^[\u0009\u0020-\u007e\u0080-\u00ff]*$/,n=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,r=/[\\"]/g,i=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,a=(()=>{let e=function(){};return e.prototype=Object.create(null),e})();function o(e){let{type:t,parameters:r}=e;if(!t||!i.test(t))throw TypeError(`Invalid type: ${t}`);let a=t;if(r)for(let e of Object.keys(r)){if(!n.test(e))throw TypeError(`Invalid parameter name: ${e}`);a+=`; ${e}=${y(r[e])}`}return a}function s(e,t){let n=t?.comma===!0?m:65536,r=e.length,i=_(e,t?.start??0,r),o=i;i=g(e,i,r,n);let s=v(e,o,i),c=e.slice(o,s).toLowerCase();return t?.parameters===!1?{type:c,index:i,parameters:new a}:h(e,c,i,r,n)}var c=32,l=9,u=59,d=61,f=34,p=92,m=44;function h(e,t,n,r,i){let o=new a;parameter:for(;n<r&&e.charCodeAt(n)!==i;){n=_(e,n+1,r);let t=n;for(;n<r;){let a=e.charCodeAt(n);if(a===i)break parameter;if(a===u)continue parameter;if(a===d){let a=v(e,t,n),s=e.slice(t,a).toLowerCase();if(n=_(e,n+1,r),n<r&&e.charCodeAt(n)===f){n++;let t=``;for(;n<r;){let a=e.charCodeAt(n++);if(a===f){n=g(e,n,r,i),o[s]===void 0&&(o[s]=t);break}if(a===p&&n<r){t+=e[n++];continue}t+=String.fromCharCode(a)}continue parameter}let c=n;if(n=g(e,n,r,i),o[s]===void 0){let t=v(e,c,n);o[s]=e.slice(c,t)}continue parameter}n++}}return{type:t,index:n,parameters:o}}function g(e,t,n,r){for(;t<n;){let n=e.charCodeAt(t);if(n===u||n===r)break;t++}return t}function _(e,t,n){for(;t<n;){let n=e.charCodeAt(t);if(n!==c&&n!==l)break;t++}return t}function v(e,t,n){for(;n>t;){let t=e.charCodeAt(n-1);if(t!==c&&t!==l)break;n--}return n}function y(e){if(n.test(e))return e;if(t.test(e))return`"${e.replace(r,`\\$&`)}"`;throw TypeError(`Invalid parameter value: ${e}`)}})),$=c(((e,t)=>{var n=Q();t.exports=r;function r(e){for(var t=[],r=0;r<e.length;){var a=i(e,r),o=n.parse(e,{comma:!0,start:a});o.type=e.slice(a,a+o.type.length),t.push(o),r=o.index+1}return t}function i(e,t){for(var n=t;e.charCodeAt(n)===32||e.charCodeAt(n)===9;)n++;return n}})),Qt=c(((e,t)=>{var n=$();t.exports=s,t.exports.preferredCharsets=s;function r(e){for(var t=n(e),r=0,a=0;r<t.length;r++){var o=i(t[r],r);o&&(t[a++]=o)}return t.length=a,t}function i(e,t){return e.type?{charset:e.type,q:e.parameters.q?parseFloat(e.parameters.q):1,i:t}:null}function a(e,t,n){for(var r={o:-1,q:0,s:0},i=0;i<t.length;i++){var a=o(e,t[i],n);a&&(r.s-a.s||r.q-a.q||r.o-a.o)<0&&(r=a)}return r}function o(e,t,n){var r=0;if(t.charset.toLowerCase()===e.toLowerCase())r|=1;else if(t.charset!==`*`)return null;return{i:n,o:t.i,q:t.q,s:r}}function s(e,t){var n=r(e===void 0?`*`:e||``);if(!t)return n.filter(u).sort(c).map(l);var i=t.map(function(e,t){return a(e,n,t)});return i.filter(u).sort(c).map(function(e){return t[i.indexOf(e)]})}function c(e,t){return t.q-e.q||t.s-e.s||e.o-t.o||e.i-t.i||0}function l(e){return e.charset}function u(e){return e.q>0}})),$t=c(((e,t)=>{var n=$();t.exports=s,t.exports.preferredEncodings=s;function r(e){for(var t=n(e),r=!1,a=1,s=0,c=0;s<t.length;s++){var l=i(t[s],s);l&&(t[c++]=l,r||=o(`identity`,l),a=Math.min(a,l.q||1))}return r||(t[c++]={encoding:`identity`,q:a,i:s}),t.length=c,t}function i(e,t){return e.type?{encoding:e.type,q:e.parameters.q?parseFloat(e.parameters.q):1,i:t}:null}function a(e,t,n){for(var r={encoding:e,o:-1,q:0,s:0},i=0;i<t.length;i++){var a=o(e,t[i],n);a&&(r.s-a.s||r.q-a.q||r.o-a.o)<0&&(r=a)}return r}function o(e,t,n){var r=0;if(t.encoding.toLowerCase()===e.toLowerCase())r|=1;else if(t.encoding!==`*`)return null;return{encoding:e,i:n,o:t.i,q:t.q,s:r}}function s(e,t,n){var i=r(e||``),o=n?function(e,t){if(e.q!==t.q)return t.q-e.q;var r=n.indexOf(e.encoding),i=n.indexOf(t.encoding);return r===-1&&i===-1?t.s-e.s||e.o-t.o||e.i-t.i:r!==-1&&i!==-1?r-i:r===-1?1:-1}:c;if(!t)return i.filter(u).sort(o).map(l);var s=t.map(function(e,t){return a(e,i,t)});return s.filter(u).sort(o).map(function(e){return t[s.indexOf(e)]})}function c(e,t){return t.q-e.q||t.s-e.s||e.o-t.o||e.i-t.i}function l(e){return e.encoding}function u(e){return e.q>0}})),en=c(((e,t)=>{var n=Q(),r=$();t.exports=c,t.exports.preferredLanguages=c;function i(e){for(var t=r(e),n=0,i=0;n<t.length;n++){var o=a(t[n],n);o&&(t[i++]=o)}return t.length=i,t}function a(e,t){if(!e.type)return null;var n=e.type.indexOf(`-`);return{prefix:n===-1?e.type:e.type.slice(0,n),suffix:n===-1?void 0:e.type.slice(n+1),q:e.parameters.q?parseFloat(e.parameters.q):1,i:t,full:e.type}}function o(e,t,n){for(var r={o:-1,q:0,s:0},i=0;i<t.length;i++){var a=s(e,t[i],n);a&&(r.s-a.s||r.q-a.q||r.o-a.o)<0&&(r=a)}return r}function s(e,t,r){var i=a(n.parse(e),0);if(!i)return null;var o=0;if(t.full.toLowerCase()===i.full.toLowerCase())o|=4;else if(t.prefix.toLowerCase()===i.full.toLowerCase())o|=2;else if(t.full.toLowerCase()===i.prefix.toLowerCase())o|=1;else if(t.full!==`*`)return null;return{i:r,o:t.i,q:t.q,s:o}}function c(e,t){var n=i(e===void 0?`*`:e||``);if(!t)return n.filter(d).sort(l).map(u);var r=t.map(function(e,t){return o(e,n,t)});return r.filter(d).sort(l).map(function(e){return t[r.indexOf(e)]})}function l(e,t){return t.q-e.q||t.s-e.s||e.o-t.o||e.i-t.i||0}function u(e){return e.full}function d(e){return e.q>0}})),tn=c(((e,t)=>{var n=Q(),r=$();t.exports=c,t.exports.preferredMediaTypes=c;function i(e){for(var t=r(e),n=0,i=0;n<t.length;n++){var o=a(t[n],n);o&&(t[i++]=o)}return t.length=i,t}function a(e,t){var n=e.type.indexOf(`/`);if(n===-1)return null;var r=e.parameters.q?parseFloat(e.parameters.q):1;return delete e.parameters.q,{type:e.type.slice(0,n),subtype:e.type.slice(n+1),params:e.parameters,q:r,i:t}}function o(e,t,n){for(var r={o:-1,q:0,s:0},i=0;i<t.length;i++){var a=s(e,t[i],n);a&&(r.s-a.s||r.q-a.q||r.o-a.o)<0&&(r=a)}return r}function s(e,t,r){var i=a(n.parse(e),0),o=0;if(!i)return null;if(t.type.toLowerCase()==i.type.toLowerCase())o|=4;else if(t.type!=`*`)return null;if(t.subtype.toLowerCase()==i.subtype.toLowerCase())o|=2;else if(t.subtype!=`*`)return null;var s=Object.keys(t.params);if(s.length>0){if(s.every(function(e){return t.params[e]==`*`||(t.params[e]||``).toLowerCase()==(i.params[e]||``).toLowerCase()}))o|=1;else return null}return{i:r,o:t.i,q:t.q,s:o}}function c(e,t){var n=i(e===void 0?`*/*`:e||``);if(!t)return n.filter(d).sort(l).map(u);var r=t.map(function(e,t){return o(e,n,t)});return r.filter(d).sort(l).map(function(e){return t[r.indexOf(e)]})}function l(e,t){return t.q-e.q||t.s-e.s||e.o-t.o||e.i-t.i||0}function u(e){return e.type+`/`+e.subtype}function d(e){return e.q>0}}));c(((e,t)=>{var n=Qt(),r=$t(),i=en(),a=tn();t.exports=o,t.exports.Negotiator=o;function o(e){if(!(this instanceof o))return new o(e);this.request=e}o.prototype.charset=function(e){var t=this.charsets(e);return t&&t[0]},o.prototype.charsets=function(e){return n(this.request.headers[`accept-charset`],e)},o.prototype.encoding=function(e,t){var n=this.encodings(e,t);return n&&n[0]},o.prototype.encodings=function(e,t){var n=t||{};return r(this.request.headers[`accept-encoding`],e,n.preferred)},o.prototype.language=function(e){var t=this.languages(e);return t&&t[0]},o.prototype.languages=function(e){return i(this.request.headers[`accept-language`],e)},o.prototype.mediaType=function(e){var t=this.mediaTypes(e);return t&&t[0]},o.prototype.mediaTypes=function(e){return a(this.request.headers.accept,e)},o.prototype.preferredCharset=o.prototype.charset,o.prototype.preferredCharsets=o.prototype.charsets,o.prototype.preferredEncoding=o.prototype.encoding,o.prototype.preferredEncodings=o.prototype.encodings,o.prototype.preferredLanguage=o.prototype.language,o.prototype.preferredLanguages=o.prototype.languages,o.prototype.preferredMediaType=o.prototype.mediaType,o.prototype.preferredMediaTypes=o.prototype.mediaTypes}))();var nn=`en-US`,rn=M({persist:`intl:selected`}),an=S([P,rn],([e,t])=>t?Z(t):on()||(e?.locale!==void 0&&Zt(e.locale)?Z(e.locale):nn));S(P,e=>e?.grammar??`none`);function on(){if(typeof navigator<`u`){for(let e of navigator.languages)if(Zt(e))return Z(e)}return null}var sn=S(an,e=>Yt[e]);export{De as A,L as C,ke as D,F as E,ce as F,k as I,Ce as M,N,Oe as O,he as P,Ie as S,Ae as T,ut as _,Ut as a,z as b,Lt as c,yt as d,vt as f,mt as g,ht as h,qt as i,Te as j,I as k,It as l,_t as m,an as n,Wt as o,bt as p,Jt as r,zt as s,sn as t,Ft as u,it as v,P as w,We as x,G as y};
|