@toa.io/extensions.configuration 1.0.0-alpha.310 → 1.0.0-alpha.311

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toa.io/extensions.configuration",
3
- "version": "1.0.0-alpha.310",
3
+ "version": "1.0.0-alpha.311",
4
4
  "type": "module",
5
5
  "description": "Toa Configuration",
6
6
  "author": "temich <tema.gurtovoy@gmail.com>",
@@ -32,12 +32,12 @@
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": "d952c57f77279729e26d52d50c6df47138ad0a4f",
35
+ "gitHead": "4f45061964e275296a27ff8ff39f757ce27d4008",
36
36
  "dependencies": {
37
- "@toa.io/core": "1.0.0-alpha.310",
38
- "@toa.io/definitions": "1.0.0-alpha.310",
39
- "@toa.io/generic": "1.0.0-alpha.310",
40
- "@toa.io/schemas": "1.0.0-alpha.310",
37
+ "@toa.io/core": "1.0.0-alpha.311",
38
+ "@toa.io/definitions": "1.0.0-alpha.311",
39
+ "@toa.io/generic": "1.0.0-alpha.311",
40
+ "@toa.io/schemas": "1.0.0-alpha.311",
41
41
  "openspan": "1.0.0-alpha.305"
42
42
  }
43
43
  }
@@ -1,6 +1,6 @@
1
- import{$ as e,A as t,B as n,Dt as r,Et as i,F as a,I as o,M as s,Ot as c,Q as l,S as u,_ as d,_t as f,a as p,bt as m,dt as h,ht as g,i as _,j as v,k as y,kt as b,mt as x,o as S,pt as C,st as w,tt as T,u as E,ut as D,w as O,x as ee,y as k,yt as te}from"./CcD_ISxM.js";import{s as ne}from"./BkLAzDsj.js";import"./xihTtKlq.js";var re=class{store;values;request;revalidate;stale;timestamp=0;constructor(e){this.store=g(null),this.values=e.values,this.request=e.get,this.revalidate=e.revalidate??ie.revalidate,this.stale=e.stale??ie.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 A(e){return new re(e)}var ie={revalidate:3e5,stale:!1},ae=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:g(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),oe);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()})}},oe=100,j={revalidate:3e5,permanent:!1,stale:!1};function se(e={}){return new ae(e)}var ce=class{store;default;request;revalidate;timestamp=0;constructor(e){this.default=e.default??null,this.request=e.get,this.revalidate=e.revalidate??de.revalidate,this.store=e.persist===void 0||typeof window>`u`?g(this.default):le(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 ce(e)}function le(e,t,n){let r=g(ue(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 ue(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 de={revalidate:3e5};function fe(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 pe(e){return fe(e,e=>e!==null&&!(e instanceof Error))}function me(e){let t=x(e);if(t===null||t instanceof Error)throw Error(`Store contains null or an error`);return t}var he={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`},ge=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},_e=Symbol(`lucide-context`),ve=()=>f(_e),ye=new Set([`$$slots`,`$$events`,`$$legacy`,`name`,`color`,`size`,`strokeWidth`,`absoluteStrokeWidth`,`iconNode`,`children`]),be=s(`<svg><!><!></svg>`);function N(a,o){m(o,!0);let s=ve()??{},f=_(o,`color`,19,()=>s.color??`currentColor`),h=_(o,`size`,19,()=>s.size??24),g=_(o,`strokeWidth`,19,()=>s.strokeWidth??2),v=_(o,`absoluteStrokeWidth`,19,()=>s.absoluteStrokeWidth??!1),b=_(o,`iconNode`,19,()=>[]),x=p(o,ye),S=w(()=>v()?Number(g())*24/Number(h()):g());var C=be();E(C,e=>({...he,...e,...x,width:h(),height:h(),stroke:f(),"stroke-width":n(S),class:[`lucide-icon lucide`,s.class,o.name&&`lucide-${o.name}`,o.class]}),[()=>!o.children&&!ge(x)&&{"aria-hidden":`true`}]);var D=l(C);ee(D,17,b,u,(r,i)=>{var a=w(()=>c(n(i),2));let o=()=>n(a)[0],s=()=>n(a)[1];var l=t(),u=e(l);d(u,o,!0,(e,t)=>{E(e,()=>({...s()}))}),y(r,l)});var O=T(D);k(O,()=>o.children??r),i(C),y(a,C),te()}var xe=new Set([`$$slots`,`$$events`,`$$legacy`]);function Se(e,t){let n=p(t,xe),r=[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`}]];N(e,S({name:`loader-circle`},()=>n,{get iconNode(){return r}}))}var Ce=new Set([`$$slots`,`$$events`,`$$legacy`]);function we(e,t){let n=p(t,Ce),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,S({name:`rotate-ccw`},()=>n,{get iconNode(){return r}}))}var Te=v(`<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 Ee(n,r){let a=()=>h(r.store,`$store`,s),[s,c]=D(),u=_(r,`silent`,3,!1);var d=t(),f=e(d),p=n=>{var i=t(),a=e(i),o=n=>{var i=t(),a=e(i);k(a,()=>r.waiting),y(n,i)},s=e=>{Se(e,{class:`animate-spin m-auto text-muted-foreground`})};O(a,e=>{r.waiting?e(o):u()||e(s,1)}),y(n,i)},m=n=>{var s=t(),c=e(s),d=n=>{var i=t(),o=e(i);k(o,()=>r.error,a),y(n,i)},f=e=>{var t=Te(),n=T(l(t),2);we(l(n),{size:16}),i(n),i(t),o(`click`,n,()=>window.location.reload()),y(e,t)};O(c,e=>{r.error?e(d):u()||e(f,1)}),y(n,s)},g=n=>{var i=t(),o=e(i);k(o,()=>r.awaited,a),y(n,i)};O(f,e=>{a()===null?e(p):a()instanceof Error?e(m,1):e(g,-1)}),y(n,d),c()}a([`click`]);var P=M({persist:`auth:account`}),F=M({persist:`auth:challenge`,bind:P}),De=M({persist:`auth:method`}),Oe=g(!1),ke=g(!1),Ae=C([F,P,Oe],([e,t,n])=>e!==null&&t!==null&&n===!1);function je(e){P.extract()?.id!==e.id&&P.set(null),P.set(e)}function I(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 L=b((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,B as n,Dt as r,Et as i,F as a,I as o,M as s,Ot as c,Q as l,S as u,_ as d,_t as f,a as p,bt as m,dt as h,ht as g,i as _,j as v,k as y,kt as b,mt as x,o as S,pt as C,st as w,tt as T,u as E,ut as D,w as O,x as ee,y as k,yt as te}from"./CcD_ISxM.js";import{s as ne}from"./PnrO3qAK.js";import"./xihTtKlq.js";var re=class{store;values;request;revalidate;stale;timestamp=0;constructor(e){this.store=g(null),this.values=e.values,this.request=e.get,this.revalidate=e.revalidate??ie.revalidate,this.stale=e.stale??ie.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 A(e){return new re(e)}var ie={revalidate:3e5,stale:!1},ae=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:g(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),oe);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()})}},oe=100,j={revalidate:3e5,permanent:!1,stale:!1};function se(e={}){return new ae(e)}var ce=class{store;default;request;revalidate;timestamp=0;constructor(e){this.default=e.default??null,this.request=e.get,this.revalidate=e.revalidate??de.revalidate,this.store=e.persist===void 0||typeof window>`u`?g(this.default):le(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 ce(e)}function le(e,t,n){let r=g(ue(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 ue(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 de={revalidate:3e5};function fe(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 pe(e){return fe(e,e=>e!==null&&!(e instanceof Error))}function me(e){let t=x(e);if(t===null||t instanceof Error)throw Error(`Store contains null or an error`);return t}var he={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`},ge=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},_e=Symbol(`lucide-context`),ve=()=>f(_e),ye=new Set([`$$slots`,`$$events`,`$$legacy`,`name`,`color`,`size`,`strokeWidth`,`absoluteStrokeWidth`,`iconNode`,`children`]),be=s(`<svg><!><!></svg>`);function N(a,o){m(o,!0);let s=ve()??{},f=_(o,`color`,19,()=>s.color??`currentColor`),h=_(o,`size`,19,()=>s.size??24),g=_(o,`strokeWidth`,19,()=>s.strokeWidth??2),v=_(o,`absoluteStrokeWidth`,19,()=>s.absoluteStrokeWidth??!1),b=_(o,`iconNode`,19,()=>[]),x=p(o,ye),S=w(()=>v()?Number(g())*24/Number(h()):g());var C=be();E(C,e=>({...he,...e,...x,width:h(),height:h(),stroke:f(),"stroke-width":n(S),class:[`lucide-icon lucide`,s.class,o.name&&`lucide-${o.name}`,o.class]}),[()=>!o.children&&!ge(x)&&{"aria-hidden":`true`}]);var D=l(C);ee(D,17,b,u,(r,i)=>{var a=w(()=>c(n(i),2));let o=()=>n(a)[0],s=()=>n(a)[1];var l=t(),u=e(l);d(u,o,!0,(e,t)=>{E(e,()=>({...s()}))}),y(r,l)});var O=T(D);k(O,()=>o.children??r),i(C),y(a,C),te()}var xe=new Set([`$$slots`,`$$events`,`$$legacy`]);function Se(e,t){let n=p(t,xe),r=[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`}]];N(e,S({name:`loader-circle`},()=>n,{get iconNode(){return r}}))}var Ce=new Set([`$$slots`,`$$events`,`$$legacy`]);function we(e,t){let n=p(t,Ce),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,S({name:`rotate-ccw`},()=>n,{get iconNode(){return r}}))}var Te=v(`<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 Ee(n,r){let a=()=>h(r.store,`$store`,s),[s,c]=D(),u=_(r,`silent`,3,!1);var d=t(),f=e(d),p=n=>{var i=t(),a=e(i),o=n=>{var i=t(),a=e(i);k(a,()=>r.waiting),y(n,i)},s=e=>{Se(e,{class:`animate-spin m-auto text-muted-foreground`})};O(a,e=>{r.waiting?e(o):u()||e(s,1)}),y(n,i)},m=n=>{var s=t(),c=e(s),d=n=>{var i=t(),o=e(i);k(o,()=>r.error,a),y(n,i)},f=e=>{var t=Te(),n=T(l(t),2);we(l(n),{size:16}),i(n),i(t),o(`click`,n,()=>window.location.reload()),y(e,t)};O(c,e=>{r.error?e(d):u()||e(f,1)}),y(n,s)},g=n=>{var i=t(),o=e(i);k(o,()=>r.awaited,a),y(n,i)};O(f,e=>{a()===null?e(p):a()instanceof Error?e(m,1):e(g,-1)}),y(n,d),c()}a([`click`]);var P=M({persist:`auth:account`}),F=M({persist:`auth:challenge`,bind:P}),De=M({persist:`auth:method`}),Oe=g(!1),ke=g(!1),Ae=C([F,P,Oe],([e,t,n])=>e!==null&&t!==null&&n===!1);function je(e){P.extract()?.id!==e.id&&P.set(null),P.set(e)}function I(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 L=b((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 L.Err(r.status,i))}async multipart(e,t){let n=this.setup(t),r=await this.request(e,n);if(!r.ok)return new L.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=I();return(async()=>{await new Promise(e=>setTimeout(e,0));for await(let r of n){let n=r.status===`completed`?r.error?new L.Err(r.error.code??`UNKNOWN`,r.error.message):r.output:new L.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=I(),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(ne)),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 R=Ve({origin:Ke,sleep:void 0});console.info(`Origin connected`,Ke,`no sleep`);var Ye=R.resource(`/accounts/echo/`);async function z(e){let t={method:`GET`};return e!==void 0&&(t.headers={authorization:e},t.credentials=`include`),Ye.json(t)}var Xe=R.resource(`/identity/basic/`,{credentials:`include`});async function Ze(e,t){return await Xe.json(e,{method:`POST`,body:t})}var Qe=R.resource(`/accounts/otp/`);async function B(e,t){return typeof e==`string`?await Qe.json(e,{method:`POST`,body:t,credentials:`include`}):await Qe.json({method:`POST`,body:e})}var V=R.resource(`/accounts/passkeys/`);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 $e=R.resource(`/identity/federation/`,{credentials:`include`});async function et(e,t){return await $e.json(e,{method:`POST`,body:t})}async function U(){let e=F.extract();if(e===null)return;let t=await z(e);if(t instanceof Error)return t;je(t)}function W(e,t){return e instanceof Error?e:(je(e),De.set(t),e)}var tt=M({persist:`auth:oidc:nonce`});function nt(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=rt(),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});tt.set(o),window.location.href=r+`?`+s}function rt(){return window.crypto?.randomUUID?.()??Math.random().toString(16).slice(2)}var G=globalThis.__sveltekit_1e99waj.env,K={apple:{iss:`https://appleid.apple.com`,endpoint:`https://appleid.apple.com/auth/authorize`,type:`code`,scope:`openid`,client:G.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:G.PUBLIC_GOOGLE_CLIENT_ID}};async function it(e){await at();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 at(){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 ot(e){await st(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 st(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 ct={apple:ot,google:it};async function lt(e,t){let n=await ut(e);return n instanceof Error?n:t===void 0?ft(e,n):dt(t,n)}async function ut(e){let t=ct[e]??nt,n=K[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 dt(e,t){let n=await et(e,{scheme:`code`,credentials:t});if(n instanceof Error)return n;U()}async function ft(e,t){return W(await z(`Code `+t),e)}function pt(){P.set(null)}async function mt(e,t){return W(await z(`Basic `+btoa(`${e}:${t}`)),`password`)}async function ht(e,t){return await Ze(e,t)}async function gt(e,t){let n=await ht(e,t);if(n instanceof Error)return n;U()}async function _t(e){return B({email:e})}async function vt(e,t){return await B(e,{email:t})}async function yt(e,t){return W(await z(`OTP `+btoa(`${e}:${t}`)),`password`)}var bt=R.resource(`/identity/passkeys/challenges/`);async function xt(e,t){let n={type:e};return t===void 0?await bt.json(`.`,{method:`POST`,body:n}):await bt.json(t,{method:`POST`,body:n})}var St=R.resource(`/identity/passkeys/`);async function Ct(e){return await St.json(e,{credentials:`include`})}async function wt(){return await Ct((await pe(P)).id)}A({get:wt,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 Tt(e){return new TextEncoder().encode(e).buffer}function Y(e){return btoa(String.fromCharCode(...new Uint8Array(e))).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}function Et({id:e,transports:t}){return{id:J(e),type:`public-key`,transports:t}}async function Dt(e,t){let n={challenge:J(t.challenge),timeout:t.timeout,authenticatorSelection:t.authenticatorSelection,pubKeyCredParams:t.pubKeyCredParams,rp:{name:`app`},user:{id:Tt(e.id),name:e.name,displayName:e.name},excludeCredentials:t.excludeCredentials.map(Et)};return await navigator.credentials.create({publicKey:n}).catch(e=>e)}async function Ot(e){let t={timeout:e.timeout,challenge:J(e.challenge),allowCredentials:e.allowCredentials.map(Et),userVerification:e.userVerification};return await navigator.credentials.get({publicKey:t})}async function kt(e,t){let n=await xt(`creation`,t);if(n instanceof Error)return n;let r=await Dt({id:n.identity,name:e},n);if(r instanceof Error)return r;if(r===null)throw Error(`No credential is created`);return{key:At(r,e),identity:n.identity}}function At(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 jt(e){let t=await xt(`request`,e);if(t instanceof Error)return t;let n=Date.now(),r=await Ot(t).catch(e=>e);return r instanceof Error?r.name===`NotAllowedError`&&Date.now()-n<50?new Nt:r:r===null?Error(`No credential given`):Mt(r)}function Mt(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 Nt=class extends Error{constructor(){super(),this.name=this.constructor.name}},Pt=typeof window>`u`||window.PublicKeyCredential!==void 0;async function Ft(e,t){let n=await kt(e,t);if(n instanceof Error)return console.error(`Credential creation failed`,n),n;let r=await H(n.identity,n.key);return r instanceof Error&&console.error(`Credential registration failed`,r),W(r,`passkey`)}async function It(e){let t=await jt(e);if(t instanceof Error)return console.error(`Credential request failed`,t),t;let n=await H(t);return n instanceof Error&&console.error(`Credential verification failed`,n),W(n,`passkey`)}function Lt(){}function Rt(e){if(!(e.type===`popstate`&&e.event.hasUAVisualTransition)&&document.startViewTransition!==void 0)return new Promise(t=>{let n=document.startViewTransition({types:[`route`],update:async()=>{zt(),t(),await e.complete}});n.finished.then(Bt,Bt),n.ready.catch(Lt)})}var X=null;function zt(){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 Bt(){X!==null&&X.el.style.viewTransitionName===X.name&&(Vt(X),X=null)}function Vt(e){e.el.style.viewTransitionName=``,e.el.style.viewTransitionClass=``}g(!1),navigator.userAgent.toLowerCase().includes(`windows`);var Ht=/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 Ut=!(`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 Wt(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}Wt(navigator.userAgent);var Gt=new URLSearchParams;new URLSearchParams;function Kt(e){return Gt.get(e)}var qt={"en-US":{native:`English`,locale:`en-US`,dir:`ltr`,nav:{signout:`Sign out`,filter:`Filter components`}}},Jt=[`en-US`];function Yt(e){return Jt.some(t=>t.startsWith(e))}function Z(e){return Jt.find(t=>t.startsWith(e))??`en-US`}var Q=b((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}`)}})),$=b(((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}})),Xt=b(((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}})),Zt=b(((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}})),Qt=b(((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}})),$t=b(((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}}));b(((e,t)=>{var n=Xt(),r=Zt(),i=Qt(),a=$t();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 en=`en-US`,tn=M({persist:`intl:selected`}),nn=C([P,tn],([e,t])=>t?Z(t):rn()||(e?.locale!==void 0&&Yt(e.locale)?Z(e.locale):en));C(P,e=>e?.grammar??`none`);function rn(){if(typeof navigator<`u`){for(let e of navigator.languages)if(Yt(e))return Z(e)}return null}var an=C(nn,e=>qt[e]);export{Se as A,P as C,De as D,ke as E,me as M,se as N,Oe as O,A as P,I as S,F as T,K as _,Ut as a,We as b,Ft as c,_t as d,yt as f,lt as g,pt as h,Ht as i,N as j,Ee as k,Pt as l,mt as m,nn as n,Rt as o,gt as p,Kt as r,It as s,an as t,vt as u,U as v,Ae as w,Ie as x,R 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 L.Err(r.status,i))}async multipart(e,t){let n=this.setup(t),r=await this.request(e,n);if(!r.ok)return new L.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=I();return(async()=>{await new Promise(e=>setTimeout(e,0));for await(let r of n){let n=r.status===`completed`?r.error?new L.Err(r.error.code??`UNKNOWN`,r.error.message):r.output:new L.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=I(),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(ne)),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 R=Ve({origin:Ke,sleep:void 0});console.info(`Origin connected`,Ke,`no sleep`);var Ye=R.resource(`/accounts/echo/`);async function z(e){let t={method:`GET`};return e!==void 0&&(t.headers={authorization:e},t.credentials=`include`),Ye.json(t)}var Xe=R.resource(`/identity/basic/`,{credentials:`include`});async function Ze(e,t){return await Xe.json(e,{method:`POST`,body:t})}var Qe=R.resource(`/accounts/otp/`);async function B(e,t){return typeof e==`string`?await Qe.json(e,{method:`POST`,body:t,credentials:`include`}):await Qe.json({method:`POST`,body:e})}var V=R.resource(`/accounts/passkeys/`);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 $e=R.resource(`/identity/federation/`,{credentials:`include`});async function et(e,t){return await $e.json(e,{method:`POST`,body:t})}async function U(){let e=F.extract();if(e===null)return;let t=await z(e);if(t instanceof Error)return t;je(t)}function W(e,t){return e instanceof Error?e:(je(e),De.set(t),e)}var tt=M({persist:`auth:oidc:nonce`});function nt(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=rt(),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});tt.set(o),window.location.href=r+`?`+s}function rt(){return window.crypto?.randomUUID?.()??Math.random().toString(16).slice(2)}var G=globalThis.__sveltekit_1ql3szg.env,K={apple:{iss:`https://appleid.apple.com`,endpoint:`https://appleid.apple.com/auth/authorize`,type:`code`,scope:`openid`,client:G.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:G.PUBLIC_GOOGLE_CLIENT_ID}};async function it(e){await at();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 at(){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 ot(e){await st(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 st(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 ct={apple:ot,google:it};async function lt(e,t){let n=await ut(e);return n instanceof Error?n:t===void 0?ft(e,n):dt(t,n)}async function ut(e){let t=ct[e]??nt,n=K[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 dt(e,t){let n=await et(e,{scheme:`code`,credentials:t});if(n instanceof Error)return n;U()}async function ft(e,t){return W(await z(`Code `+t),e)}function pt(){P.set(null)}async function mt(e,t){return W(await z(`Basic `+btoa(`${e}:${t}`)),`password`)}async function ht(e,t){return await Ze(e,t)}async function gt(e,t){let n=await ht(e,t);if(n instanceof Error)return n;U()}async function _t(e){return B({email:e})}async function vt(e,t){return await B(e,{email:t})}async function yt(e,t){return W(await z(`OTP `+btoa(`${e}:${t}`)),`password`)}var bt=R.resource(`/identity/passkeys/challenges/`);async function xt(e,t){let n={type:e};return t===void 0?await bt.json(`.`,{method:`POST`,body:n}):await bt.json(t,{method:`POST`,body:n})}var St=R.resource(`/identity/passkeys/`);async function Ct(e){return await St.json(e,{credentials:`include`})}async function wt(){return await Ct((await pe(P)).id)}A({get:wt,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 Tt(e){return new TextEncoder().encode(e).buffer}function Y(e){return btoa(String.fromCharCode(...new Uint8Array(e))).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}function Et({id:e,transports:t}){return{id:J(e),type:`public-key`,transports:t}}async function Dt(e,t){let n={challenge:J(t.challenge),timeout:t.timeout,authenticatorSelection:t.authenticatorSelection,pubKeyCredParams:t.pubKeyCredParams,rp:{name:`app`},user:{id:Tt(e.id),name:e.name,displayName:e.name},excludeCredentials:t.excludeCredentials.map(Et)};return await navigator.credentials.create({publicKey:n}).catch(e=>e)}async function Ot(e){let t={timeout:e.timeout,challenge:J(e.challenge),allowCredentials:e.allowCredentials.map(Et),userVerification:e.userVerification};return await navigator.credentials.get({publicKey:t})}async function kt(e,t){let n=await xt(`creation`,t);if(n instanceof Error)return n;let r=await Dt({id:n.identity,name:e},n);if(r instanceof Error)return r;if(r===null)throw Error(`No credential is created`);return{key:At(r,e),identity:n.identity}}function At(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 jt(e){let t=await xt(`request`,e);if(t instanceof Error)return t;let n=Date.now(),r=await Ot(t).catch(e=>e);return r instanceof Error?r.name===`NotAllowedError`&&Date.now()-n<50?new Nt:r:r===null?Error(`No credential given`):Mt(r)}function Mt(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 Nt=class extends Error{constructor(){super(),this.name=this.constructor.name}},Pt=typeof window>`u`||window.PublicKeyCredential!==void 0;async function Ft(e,t){let n=await kt(e,t);if(n instanceof Error)return console.error(`Credential creation failed`,n),n;let r=await H(n.identity,n.key);return r instanceof Error&&console.error(`Credential registration failed`,r),W(r,`passkey`)}async function It(e){let t=await jt(e);if(t instanceof Error)return console.error(`Credential request failed`,t),t;let n=await H(t);return n instanceof Error&&console.error(`Credential verification failed`,n),W(n,`passkey`)}function Lt(){}function Rt(e){if(!(e.type===`popstate`&&e.event.hasUAVisualTransition)&&document.startViewTransition!==void 0)return new Promise(t=>{let n=document.startViewTransition({types:[`route`],update:async()=>{zt(),t(),await e.complete}});n.finished.then(Bt,Bt),n.ready.catch(Lt)})}var X=null;function zt(){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 Bt(){X!==null&&X.el.style.viewTransitionName===X.name&&(Vt(X),X=null)}function Vt(e){e.el.style.viewTransitionName=``,e.el.style.viewTransitionClass=``}g(!1),navigator.userAgent.toLowerCase().includes(`windows`);var Ht=/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 Ut=!(`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 Wt(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}Wt(navigator.userAgent);var Gt=new URLSearchParams;new URLSearchParams;function Kt(e){return Gt.get(e)}var qt={"en-US":{native:`English`,locale:`en-US`,dir:`ltr`,nav:{signout:`Sign out`,filter:`Filter components`}}},Jt=[`en-US`];function Yt(e){return Jt.some(t=>t.startsWith(e))}function Z(e){return Jt.find(t=>t.startsWith(e))??`en-US`}var Q=b((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}`)}})),$=b(((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}})),Xt=b(((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}})),Zt=b(((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}})),Qt=b(((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}})),$t=b(((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}}));b(((e,t)=>{var n=Xt(),r=Zt(),i=Qt(),a=$t();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 en=`en-US`,tn=M({persist:`intl:selected`}),nn=C([P,tn],([e,t])=>t?Z(t):rn()||(e?.locale!==void 0&&Yt(e.locale)?Z(e.locale):en));C(P,e=>e?.grammar??`none`);function rn(){if(typeof navigator<`u`){for(let e of navigator.languages)if(Yt(e))return Z(e)}return null}var an=C(nn,e=>qt[e]);export{Se as A,P as C,De as D,ke as E,me as M,se as N,Oe as O,A as P,I as S,F as T,K as _,Ut as a,We as b,Ft as c,_t as d,yt as f,lt as g,pt as h,Ht as i,N as j,Ee as k,Pt as l,mt as m,nn as n,Rt as o,gt as p,Kt as r,It as s,an as t,vt as u,U as v,Ae as w,Ie as x,R as y};