@liip/liipgpt 3.2.2 → 3.2.4
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/button/liipgpt-button.iife.js +8 -8
- package/chat/liipgpt-chat.iife.js +28 -28
- package/config/index.cjs +2 -1
- package/config/index.d.ts +3 -0
- package/config/index.js +2 -1
- package/configurator/_app/env.js +1 -1
- package/configurator/_app/immutable/chunks/AjvNvpcS.js +143 -0
- package/configurator/_app/immutable/chunks/{CcwBRphY.js → B2WYFJPx.js} +1 -1
- package/configurator/_app/immutable/chunks/CH59pkDp.js +1 -0
- package/configurator/_app/immutable/chunks/{DiV0gc-1.js → CwoM9ZsT.js} +1 -1
- package/configurator/_app/immutable/chunks/{3j9KoXVE.js → DNPn_ns0.js} +11 -11
- package/configurator/_app/immutable/chunks/{C-RdMYBf.js → DUzWHrw7.js} +1 -1
- package/configurator/_app/immutable/chunks/{gDSICh8W.js → DsuhXmiJ.js} +1 -1
- package/configurator/_app/immutable/chunks/{Cd9U58JI.js → DtizvAR3.js} +1 -1
- package/configurator/_app/immutable/chunks/o0VLopO-.js +1 -0
- package/configurator/_app/immutable/entry/{app.CBMrX7pl.js → app.r6kVRVEe.js} +2 -2
- package/configurator/_app/immutable/entry/start.zygD77td.js +1 -0
- package/configurator/_app/immutable/nodes/{0.DCoCRnyp.js → 0.Cb7Wwl1_.js} +5 -3
- package/configurator/_app/immutable/nodes/{1.B4EK-3E3.js → 1.BNEGtkzm.js} +1 -1
- package/configurator/_app/immutable/nodes/{2.C-S8DGUM.js → 2.vvNnVFR_.js} +10 -8
- package/configurator/_app/immutable/nodes/{3.CqG4zRvq.js → 3.DnT0Omxv.js} +1 -1
- package/configurator/_app/version.json +1 -1
- package/configurator/index.html +6 -6
- package/configurator/sidebar.html +6 -6
- package/index.cjs +2 -1
- package/index.d.ts +10 -0
- package/index.js +2 -1
- package/package.json +1 -1
- package/configurator/_app/immutable/chunks/3HhYhk9n.js +0 -143
- package/configurator/_app/immutable/chunks/4dkgDADx.js +0 -1
- package/configurator/_app/immutable/chunks/Bs4vwfVG.js +0 -1
- package/configurator/_app/immutable/entry/start.B0QGdK3g.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var LiipGPTButton=function(rn){"use strict";const Mc="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(Mc);const Pc=1,Nc=2,Dc=16,$c=1,zc=4,Fc=8,jc=16,Bc=1,Uc=2,Ra="[",Nn="[!",Ia="]",fr={},de=Symbol(),qc="http://www.w3.org/1999/xhtml",Vc="http://www.w3.org/2000/svg",Hc="@attach",lo=!1;var nn=Array.isArray,Zc=Array.prototype.indexOf,La=Array.from,Dn=Object.keys,Or=Object.defineProperty,Nt=Object.getOwnPropertyDescriptor,Gc=Object.getOwnPropertyDescriptors,co=Object.prototype,Wc=Array.prototype,Oa=Object.getPrototypeOf,uo=Object.isExtensible;function an(t){return typeof t=="function"}const pr=()=>{};function ho(t){return typeof t?.then=="function"}function fo(t){for(var e=0;e<t.length;e++)t[e]()}function Qc(){var t,e,r=new Promise((n,a)=>{t=n,e=a});return{promise:r,resolve:t,reject:e}}const Ze=2,Ma=4,Pa=8,on=16,Dt=32,gr=64,Na=128,Ge=256,$n=512,ge=1024,We=2048,mr=4096,ht=8192,vr=16384,Da=32768,Mr=65536,po=1<<17,go=1<<18,zn=1<<19,mo=1<<20,$a=1<<21,za=1<<22,br=1<<23,Jt=Symbol("$state"),Fa=Symbol("legacy props"),Yc=Symbol(""),ja=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Kc=1,vo=3,kr=8;function Xc(){throw new Error("https://svelte.dev/e/await_outside_boundary")}function bo(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Jc(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function eu(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function tu(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function ru(t){throw new Error("https://svelte.dev/e/effect_orphan")}function nu(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function au(){throw new Error("https://svelte.dev/e/hydration_failed")}function iu(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function ou(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function su(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function lu(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function sn(t){console.warn("https://svelte.dev/e/hydration_mismatch")}function cu(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}let M=!1;function xe(t){M=t}let q;function me(t){if(t===null)throw sn(),fr;return q=t}function wt(){return me(Qe(q))}function $t(t){if(M){if(Qe(q)!==null)throw sn(),fr;q=t}}function ko(t=1){if(M){for(var e=t,r=q;e--;)r=Qe(r);q=r}}function ln(){for(var t=0,e=q;;){if(e.nodeType===kr){var r=e.data;if(r===Ia){if(t===0)return e;t-=1}else(r===Ra||r===Nn)&&(t+=1)}var n=Qe(e);e.remove(),e=n}}function yo(t){if(!t||t.nodeType!==kr)throw sn(),fr;return t.data}function wo(t){return t===this.v}function _o(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function xo(t){return!_o(t,this.v)}let uu=!1;const du=[];function hu(t,e=!1){return Fn(t,new Map,"",du)}function Fn(t,e,r,n,a=null){if(typeof t=="object"&&t!==null){var i=e.get(t);if(i!==void 0)return i;if(t instanceof Map)return new Map(t);if(t instanceof Set)return new Set(t);if(nn(t)){var o=Array(t.length);e.set(t,o),a!==null&&e.set(a,o);for(var s=0;s<t.length;s+=1){var c=t[s];s in t&&(o[s]=Fn(c,e,r,n))}return o}if(Oa(t)===co){o={},e.set(t,o),a!==null&&e.set(a,o);for(var l in t)o[l]=Fn(t[l],e,r,n);return o}if(t instanceof Date)return structuredClone(t);if(typeof t.toJSON=="function")return Fn(t.toJSON(),e,r,n,t)}if(t instanceof EventTarget)return t;try{return structuredClone(t)}catch{return t}}let Ie=null;function er(t){Ie=t}function Pr(t,e=!1,r){Ie={p:Ie,c:null,e:null,s:t,x:null,l:null}}function Nr(t){var e=Ie,r=e.e;if(r!==null){e.e=null;for(var n of r)qo(n)}return t!==void 0&&(e.x=t),Ie=e.p,t??{}}function So(){return!0}const fu=new WeakMap;function pu(t){var e=j;if(e===null)return H.f|=br,t;if((e.f&Da)===0){if((e.f&Na)===0)throw!e.parent&&t instanceof Error&&To(t),t;e.b.error(t)}else jn(t,e)}function jn(t,e){for(;e!==null;){if((e.f&Na)!==0)try{e.b.error(t);return}catch{}e=e.parent}throw t instanceof Error&&To(t),t}function To(t){const e=fu.get(t);e&&(Or(t,"message",{value:e.message}),Or(t,"stack",{value:e.stack}))}let cn=[],Ba=[];function Eo(){var t=cn;cn=[],fo(t)}function gu(){var t=Ba;Ba=[],fo(t)}function yr(t){cn.length===0&&queueMicrotask(Eo),cn.push(t)}function mu(){cn.length>0&&Eo(),Ba.length>0&&gu()}function vu(t){let e=0,r=zt(0),n;return()=>{Iu()&&(_(r),Ga(()=>(e===0&&(n=pt(()=>t(()=>Vn(r)))),e+=1,()=>{yr(()=>{e-=1,e===0&&(n?.(),n=void 0)})})))}}var bu=Mr|zn|Na;function ku(t,e,r){new yu(t,e,r)}class yu{pending=!1;parent;#e;#t;#a;#l;#u;#i=null;#r=null;#o=null;#s=null;#n=0;#c=!1;#d=null;#f=()=>{this.#d&&rr(this.#d,this.#n)};#h=vu(()=>(this.#d=zt(this.#n),()=>{this.#d=null}));constructor(e,r,n){this.#e=e,this.#a=r,this.#l=n,this.#t=q,this.parent=j.b,this.pending=!!this.#a.pending,this.#u=Bt(()=>{j.b=this,M&&wt();const a=this.#a.pending;if(M&&a)this.#r=he(()=>a(this.#e)),queueMicrotask(()=>{this.#i=this.#p(()=>(wr.ensure(),he(()=>this.#l(this.#e)))),this.#n>0?this.#g():(St(this.#r,()=>{this.#r=null}),this.pending=!1)});else{try{this.#i=he(()=>n(this.#e))}catch(i){this.error(i)}this.#n>0?this.#g():this.pending=!1}},bu),M&&(this.#e=q)}has_pending_snippet(){return!!this.#a.pending}#p(e){var r=j,n=H,a=Ie;nt(this.#u),Ee(this.#u),er(this.#u.ctx);try{return e()}finally{nt(r),Ee(n),er(a)}}#g(){const e=this.#a.pending;this.#i!==null&&(this.#s=document.createDocumentFragment(),wu(this.#i,this.#s)),this.#r===null&&(this.#r=he(()=>e(this.#e)))}#m(e){this.#n+=e,this.#n===0&&(this.pending=!1,this.#r&&St(this.#r,()=>{this.#r=null}),this.#s&&(this.#e.before(this.#s),this.#s=null))}update_pending_count(e){this.has_pending_snippet()?this.#m(e):this.parent&&this.parent.#m(e),qa.add(this.#f)}get_effect_pending(){return this.#h(),_(this.#d)}error(e){var r=this.#a.onerror;let n=this.#a.failed;const a=()=>{this.#n=0,this.#o!==null&&St(this.#o,()=>{this.#o=null}),this.pending=!0,this.#i=this.#p(()=>(this.#c=!1,he(()=>this.#l(this.#e)))),this.#n>0?this.#g():this.pending=!1};if(this.#c||!r&&!n)throw e;var i=H;try{Ee(null),r?.(e,a)}finally{Ee(i)}this.#i&&(ve(this.#i),this.#i=null),this.#r&&(ve(this.#r),this.#r=null),this.#o&&(ve(this.#o),this.#o=null),M&&(me(this.#t),ko(),me(ln())),n&&yr(()=>{this.#o=this.#p(()=>{this.#c=!0;try{return he(()=>{n(this.#e,()=>e,()=>a)})}catch(o){return jn(o,this.#u.parent),null}finally{this.#c=!1}})})}}function wu(t,e){for(var r=t.nodes_start,n=t.nodes_end;r!==null;){var a=r===n?null:Qe(r);e.append(r),r=a}}function _u(){for(var t=j.b;t!==null&&!t.has_pending_snippet();)t=t.parent;return t===null&&Xc(),t}function Bn(t){var e=Ze|We,r=H!==null&&(H.f&Ze)!==0?H:null;return j===null||r!==null&&(r.f&Ge)!==0?e|=Ge:j.f|=zn,{ctx:Ie,deps:null,effects:null,equals:wo,f:e,fn:t,reactions:null,rv:0,v:de,wv:0,parent:r??j,ac:null}}function xu(t,e){let r=j;r===null&&Jc();var n=r.b,a=void 0,i=zt(de),o=null,s=!H;return Mu(()=>{try{var c=t()}catch(v){c=Promise.reject(v)}var l=()=>c;a=o?.then(l,l)??Promise.resolve(c),o=a;var u=qe,p=n.pending;s&&(n.update_pending_count(1),p||u.increment());const h=(v,m=void 0)=>{o=null,p||u.activate(),m?m!==ja&&(i.f|=br,rr(i,m)):((i.f&br)!==0&&(i.f^=br),rr(i,v)),s&&(n.update_pending_count(-1),p||u.decrement()),Lo()};if(a.then(h,v=>h(null,v||"unknown")),u)return()=>{queueMicrotask(()=>u.neuter())}}),new Promise(c=>{function l(u){function p(){u===a?c(i):l(a)}u.then(p,p)}l(a)})}function X(t){const e=Bn(t);return Xo(e),e}function Co(t){const e=Bn(t);return e.equals=xo,e}function Ao(t){var e=t.effects;if(e!==null){t.effects=null;for(var r=0;r<e.length;r+=1)ve(e[r])}}function Su(t){for(var e=t.parent;e!==null;){if((e.f&Ze)===0)return e;e=e.parent}return null}function Ua(t){var e,r=j;nt(Su(t));try{Ao(t),e=rs(t)}finally{nt(r)}return e}function Ro(t){var e=Ua(t);if(t.equals(e)||(t.v=e,t.wv=es()),!xr)if(Dr!==null)Dr.set(t,t.v);else{var r=(ar||(t.f&Ge)!==0)&&t.deps!==null?mr:ge;Se(t,r)}}function Io(t,e,r){const n=Bn;if(e.length===0){r(t.map(n));return}var a=qe,i=j,o=Tu(),s=_u();Promise.all(e.map(c=>xu(c))).then(c=>{a?.activate(),o();try{r([...t.map(n),...c])}catch(l){(i.f&vr)===0&&jn(l,i)}a?.deactivate(),Lo()}).catch(c=>{s.error(c)})}function Tu(){var t=j,e=H,r=Ie;return function(){nt(t),Ee(e),er(r)}}function Lo(){nt(null),Ee(null),er(null)}const Un=new Set;let qe=null,Dr=null,qa=new Set,$r=[],qn=null,Va=!1;class wr{#e=new Map;#t=new Map;#a=new Set;#l=0;#u=null;#i=!1;#r=[];#o=[];#s=[];#n=[];#c=[];skipped_effects=new Set;#d(e){$r=[];var r=null;if(Un.size>1){r=new Map,Dr=new Map;for(const[i,o]of this.#e)r.set(i,{v:i.v,wv:i.wv}),i.v=o;for(const i of Un)if(i!==this)for(const[o,s]of i.#t)r.has(o)||(r.set(o,{v:o.v,wv:o.wv}),o.v=s)}for(const i of e)this.#f(i);if(this.#r.length===0&&this.#l===0){var n=this.#s,a=this.#n;this.#s=[],this.#n=[],this.#c=[],this.#h(),Oo(n),Oo(a),this.#u?.resolve()}else{for(const i of this.#s)Se(i,ge);for(const i of this.#n)Se(i,ge);for(const i of this.#c)Se(i,ge)}if(r){for(const[i,{v:o,wv:s}]of r)i.wv<=s&&(i.v=o);Dr=null}for(const i of this.#r)dn(i);for(const i of this.#o)dn(i);this.#r=[],this.#o=[]}#f(e){e.f^=ge;for(var r=e.first;r!==null;){var n=r.f,a=(n&(Dt|gr))!==0,i=a&&(n&ge)!==0,o=i||(n&ht)!==0||this.skipped_effects.has(r);if(!o&&r.fn!==null){if(a)r.f^=ge;else if((n&Ma)!==0)this.#n.push(r);else if(Wn(r))if((n&za)!==0){var s=r.b?.pending?this.#o:this.#r;s.push(r)}else(r.f&on)!==0&&this.#c.push(r),dn(r);var c=r.first;if(c!==null){r=c;continue}}var l=r.parent;for(r=r.next;r===null&&l!==null;)r=l.next,l=l.parent}}capture(e,r){this.#t.has(e)||this.#t.set(e,r),this.#e.set(e,e.v)}activate(){qe=this}deactivate(){qe=null;for(const e of qa)if(qa.delete(e),e(),qe!==null)break}neuter(){this.#i=!0}flush(){$r.length>0?this.flush_effects():this.#h(),qe===this&&(this.#l===0&&Un.delete(this),this.deactivate())}flush_effects(){var e=Fr;Va=!0;try{var r=0;for(Yo(!0);$r.length>0;){if(r++>1e3){var n,a;Eu()}this.#d($r),_r.clear()}}finally{Va=!1,Yo(e),qn=null}}#h(){if(!this.#i)for(const e of this.#a)e();this.#a.clear()}increment(){this.#l+=1}decrement(){if(this.#l-=1,this.#l===0){for(const e of this.#s)Se(e,We),tr(e);for(const e of this.#n)Se(e,We),tr(e);for(const e of this.#c)Se(e,We),tr(e);this.#s=[],this.#n=[],this.flush()}else this.deactivate()}add_callback(e){this.#a.add(e)}settled(){return(this.#u??=Qc()).promise}static ensure(e=!0){if(qe===null){const r=qe=new wr;Un.add(qe),e&&queueMicrotask(()=>{qe===r&&r.flush()})}return qe}}function ee(t){var e;const r=wr.ensure(!1);for(;;){if(mu(),$r.length===0)return r===qe&&r.flush(),qn=null,e;r.flush_effects()}}function Eu(){try{nu()}catch(t){jn(t,qn)}}function Oo(t){var e=t.length;if(e!==0){for(var r=0;r<e;r++){var n=t[r];if((n.f&(vr|ht))===0&&Wn(n)){var a=Gn;if(dn(n),n.deps===null&&n.first===null&&n.nodes_start===null&&(n.teardown===null?Go(n):n.fn=null),Gn>a&&(n.f&mo)!==0)break}}for(;r<e;r+=1)tr(t[r])}}function tr(t){for(var e=qn=t;e.parent!==null;){e=e.parent;var r=e.f;if(Va&&e===j&&(r&on)!==0)return;if((r&(gr|Dt))!==0){if((r&ge)===0)return;e.f^=ge}}$r.push(e)}const _r=new Map;function zt(t,e){var r={f:0,v:t,reactions:null,equals:wo,rv:0,wv:0};return r}function J(t,e){const r=zt(t);return Xo(r),r}function Mo(t,e=!1,r=!0){const n=zt(t);return e||(n.equals=xo),n}function P(t,e,r=!1){H!==null&&(!ft||(H.f&po)!==0)&&So()&&(H.f&(Ze|on|za|po))!==0&&!Ut?.includes(t)&&lu();let n=r?_t(e):e;return rr(t,n)}function rr(t,e){if(!t.equals(e)){var r=t.v;xr?_r.set(t,e):_r.set(t,r),t.v=e,wr.ensure().capture(t,r),(t.f&Ze)!==0&&((t.f&We)!==0&&Ua(t),Se(t,(t.f&Ge)===0?ge:mr)),t.wv=es(),Po(t,We),j!==null&&(j.f&ge)!==0&&(j.f&(Dt|gr))===0&&(at===null?Nu([t]):at.push(t))}return e}function Vn(t){P(t,t.v+1)}function Po(t,e){var r=t.reactions;if(r!==null)for(var n=r.length,a=0;a<n;a++){var i=r[a],o=i.f;(o&We)===0&&(Se(i,e),(o&(ge|Ge))!==0&&((o&Ze)!==0?Po(i,mr):tr(i)))}}function _t(t){if(typeof t!="object"||t===null||Jt in t)return t;const e=Oa(t);if(e!==co&&e!==Wc)return t;var r=new Map,n=nn(t),a=J(0),i=Sr,o=s=>{if(Sr===i)return s();var c=H,l=Sr;Ee(null),Jo(i);var u=s();return Ee(c),Jo(l),u};return n&&r.set("length",J(t.length)),new Proxy(t,{defineProperty(s,c,l){(!("value"in l)||l.configurable===!1||l.enumerable===!1||l.writable===!1)&&ou();var u=r.get(c);return u===void 0?u=o(()=>{var p=J(l.value);return r.set(c,p),p}):P(u,l.value,!0),!0},deleteProperty(s,c){var l=r.get(c);if(l===void 0){if(c in s){const u=o(()=>J(de));r.set(c,u),Vn(a)}}else P(l,de),Vn(a);return!0},get(s,c,l){if(c===Jt)return t;var u=r.get(c),p=c in s;if(u===void 0&&(!p||Nt(s,c)?.writable)&&(u=o(()=>{var v=_t(p?s[c]:de),m=J(v);return m}),r.set(c,u)),u!==void 0){var h=_(u);return h===de?void 0:h}return Reflect.get(s,c,l)},getOwnPropertyDescriptor(s,c){var l=Reflect.getOwnPropertyDescriptor(s,c);if(l&&"value"in l){var u=r.get(c);u&&(l.value=_(u))}else if(l===void 0){var p=r.get(c),h=p?.v;if(p!==void 0&&h!==de)return{enumerable:!0,configurable:!0,value:h,writable:!0}}return l},has(s,c){if(c===Jt)return!0;var l=r.get(c),u=l!==void 0&&l.v!==de||Reflect.has(s,c);if(l!==void 0||j!==null&&(!u||Nt(s,c)?.writable)){l===void 0&&(l=o(()=>{var h=u?_t(s[c]):de,v=J(h);return v}),r.set(c,l));var p=_(l);if(p===de)return!1}return u},set(s,c,l,u){var p=r.get(c),h=c in s;if(n&&c==="length")for(var v=l;v<p.v;v+=1){var m=r.get(v+"");m!==void 0?P(m,de):v in s&&(m=o(()=>J(de)),r.set(v+"",m))}if(p===void 0)(!h||Nt(s,c)?.writable)&&(p=o(()=>J(void 0)),P(p,_t(l)),r.set(c,p));else{h=p.v!==de;var b=o(()=>_t(l));P(p,b)}var C=Reflect.getOwnPropertyDescriptor(s,c);if(C?.set&&C.set.call(u,l),!h){if(n&&typeof c=="string"){var y=r.get("length"),k=Number(c);Number.isInteger(k)&&k>=y.v&&P(y,k+1)}Vn(a)}return!0},ownKeys(s){_(a);var c=Reflect.ownKeys(s).filter(p=>{var h=r.get(p);return h===void 0||h.v!==de});for(var[l,u]of r)u.v!==de&&!(l in s)&&c.push(l);return c},setPrototypeOf(){su()}})}function No(t){try{if(t!==null&&typeof t=="object"&&Jt in t)return t[Jt]}catch{}return t}function Cu(t,e){return Object.is(No(t),No(e))}var Ha,Do,$o,zo;function Za(){if(Ha===void 0){Ha=window,Do=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,r=Text.prototype;$o=Nt(e,"firstChild").get,zo=Nt(e,"nextSibling").get,uo(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),uo(r)&&(r.__t=void 0)}}function Ft(t=""){return document.createTextNode(t)}function rt(t){return $o.call(t)}function Qe(t){return zo.call(t)}function jt(t,e){if(!M)return rt(t);var r=rt(q);if(r===null)r=q.appendChild(Ft());else if(e&&r.nodeType!==vo){var n=Ft();return r?.before(n),me(n),n}return me(r),r}function Le(t,e){if(!M){var r=rt(t);return r instanceof Comment&&r.data===""?Qe(r):r}return q}function nr(t,e=1,r=!1){let n=M?q:t;for(var a;e--;)a=n,n=Qe(n);if(!M)return n;if(r&&n?.nodeType!==vo){var i=Ft();return n===null?a?.after(i):n.before(i),me(i),i}return me(n),n}function Fo(t){t.textContent=""}function jo(){return!1}function Au(t){j===null&&H===null&&ru(),H!==null&&(H.f&Ge)!==0&&j===null&&tu(),xr&&eu()}function Ru(t,e){var r=e.last;r===null?e.last=e.first=t:(r.next=t,t.prev=r,e.last=t)}function xt(t,e,r,n=!0){var a=j;a!==null&&(a.f&ht)!==0&&(t|=ht);var i={ctx:Ie,deps:null,nodes_start:null,nodes_end:null,f:t|We,first:null,fn:e,last:null,next:null,parent:a,b:a&&a.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(r)try{dn(i),i.f|=Da}catch(c){throw ve(i),c}else e!==null&&tr(i);var o=r&&i.deps===null&&i.first===null&&i.nodes_start===null&&i.teardown===null&&(i.f&zn)===0;if(!o&&n&&(a!==null&&Ru(i,a),H!==null&&(H.f&Ze)!==0)){var s=H;(s.effects??=[]).push(i)}return i}function Iu(){return H!==null&&!ft}function Bo(t){const e=xt(Pa,null,!1);return Se(e,ge),e.teardown=t,e}function Uo(t){Au();var e=j.f,r=!H&&(e&Dt)!==0&&(e&Da)===0;if(r){var n=Ie;(n.e??=[]).push(t)}else return qo(t)}function qo(t){return xt(Ma|mo,t,!1)}function Lu(t){wr.ensure();const e=xt(gr,t,!0);return()=>{ve(e)}}function Ou(t){wr.ensure();const e=xt(gr,t,!0);return(r={})=>new Promise(n=>{r.outro?St(e,()=>{ve(e),n(void 0)}):(ve(e),n(void 0))})}function Hn(t){return xt(Ma,t,!1)}function Mu(t){return xt(za|zn,t,!0)}function Ga(t,e=0){return xt(Pa|e,t,!0)}function Zn(t,e=[],r=[]){Io(e,r,n=>{xt(Pa,()=>t(...n.map(_)),!0)})}function Bt(t,e=0){var r=xt(on|e,t,!0);return r}function he(t,e=!0){return xt(Dt,t,!0,e)}function Vo(t){var e=t.teardown;if(e!==null){const r=xr,n=H;Ko(!0),Ee(null);try{e.call(null)}finally{Ko(r),Ee(n)}}}function Ho(t,e=!1){var r=t.first;for(t.first=t.last=null;r!==null;){r.ac?.abort(ja);var n=r.next;(r.f&gr)!==0?r.parent=null:ve(r,e),r=n}}function Pu(t){for(var e=t.first;e!==null;){var r=e.next;(e.f&Dt)===0&&ve(e),e=r}}function ve(t,e=!0){var r=!1;(e||(t.f&go)!==0)&&t.nodes_start!==null&&t.nodes_end!==null&&(Zo(t.nodes_start,t.nodes_end),r=!0),Ho(t,e&&!r),Qn(t,0),Se(t,vr);var n=t.transitions;if(n!==null)for(const i of n)i.stop();Vo(t);var a=t.parent;a!==null&&a.first!==null&&Go(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes_start=t.nodes_end=t.ac=null}function Zo(t,e){for(;t!==null;){var r=t===e?null:Qe(t);t.remove(),t=r}}function Go(t){var e=t.parent,r=t.prev,n=t.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),e!==null&&(e.first===t&&(e.first=n),e.last===t&&(e.last=r))}function St(t,e){var r=[];Wa(t,r,!0),Wo(r,()=>{ve(t),e&&e()})}function Wo(t,e){var r=t.length;if(r>0){var n=()=>--r||e();for(var a of t)a.out(n)}else e()}function Wa(t,e,r){if((t.f&ht)===0){if(t.f^=ht,t.transitions!==null)for(const o of t.transitions)(o.is_global||r)&&e.push(o);for(var n=t.first;n!==null;){var a=n.next,i=(n.f&Mr)!==0||(n.f&Dt)!==0;Wa(n,e,i?r:!1),n=a}}}function zr(t){Qo(t,!0)}function Qo(t,e){if((t.f&ht)!==0){t.f^=ht,(t.f&ge)===0&&(Se(t,We),tr(t));for(var r=t.first;r!==null;){var n=r.next,a=(r.f&Mr)!==0||(r.f&Dt)!==0;Qo(r,a?e:!1),r=n}if(t.transitions!==null)for(const i of t.transitions)(i.is_global||e)&&i.in()}}let Fr=!1;function Yo(t){Fr=t}let xr=!1;function Ko(t){xr=t}let H=null,ft=!1;function Ee(t){H=t}let j=null;function nt(t){j=t}let Ut=null;function Xo(t){H!==null&&(Ut===null?Ut=[t]:Ut.push(t))}let Oe=null,Ye=0,at=null;function Nu(t){at=t}let Gn=1,un=0,Sr=un;function Jo(t){Sr=t}let ar=!1;function es(){return++Gn}function Wn(t){var e=t.f;if((e&We)!==0)return!0;if((e&mr)!==0){var r=t.deps,n=(e&Ge)!==0;if(r!==null){var a,i,o=(e&$n)!==0,s=n&&j!==null&&!ar,c=r.length;if((o||s)&&(j===null||(j.f&vr)===0)){var l=t,u=l.parent;for(a=0;a<c;a++)i=r[a],(o||!i?.reactions?.includes(l))&&(i.reactions??=[]).push(l);o&&(l.f^=$n),s&&u!==null&&(u.f&Ge)===0&&(l.f^=Ge)}for(a=0;a<c;a++)if(i=r[a],Wn(i)&&Ro(i),i.wv>t.wv)return!0}(!n||j!==null&&!ar)&&Se(t,ge)}return!1}function ts(t,e,r=!0){var n=t.reactions;if(n!==null&&!Ut?.includes(t))for(var a=0;a<n.length;a++){var i=n[a];(i.f&Ze)!==0?ts(i,e,!1):e===i&&(r?Se(i,We):(i.f&ge)!==0&&Se(i,mr),tr(i))}}function rs(t){var e=Oe,r=Ye,n=at,a=H,i=ar,o=Ut,s=Ie,c=ft,l=Sr,u=t.f;Oe=null,Ye=0,at=null,ar=(u&Ge)!==0&&(ft||!Fr||H===null),H=(u&(Dt|gr))===0?t:null,Ut=null,er(t.ctx),ft=!1,Sr=++un,t.ac!==null&&(t.ac.abort(ja),t.ac=null);try{t.f|=$a;var p=(0,t.fn)(),h=t.deps;if(Oe!==null){var v;if(Qn(t,Ye),h!==null&&Ye>0)for(h.length=Ye+Oe.length,v=0;v<Oe.length;v++)h[Ye+v]=Oe[v];else t.deps=h=Oe;if(!ar||(u&Ze)!==0&&t.reactions!==null)for(v=Ye;v<h.length;v++)(h[v].reactions??=[]).push(t)}else h!==null&&Ye<h.length&&(Qn(t,Ye),h.length=Ye);if(So()&&at!==null&&!ft&&h!==null&&(t.f&(Ze|mr|We))===0)for(v=0;v<at.length;v++)ts(at[v],t);return a!==null&&a!==t&&(un++,at!==null&&(n===null?n=at:n.push(...at))),(t.f&br)!==0&&(t.f^=br),p}catch(m){return pu(m)}finally{t.f^=$a,Oe=e,Ye=r,at=n,H=a,ar=i,Ut=o,er(s),ft=c,Sr=l}}function Du(t,e){let r=e.reactions;if(r!==null){var n=Zc.call(r,t);if(n!==-1){var a=r.length-1;a===0?r=e.reactions=null:(r[n]=r[a],r.pop())}}r===null&&(e.f&Ze)!==0&&(Oe===null||!Oe.includes(e))&&(Se(e,mr),(e.f&(Ge|$n))===0&&(e.f^=$n),Ao(e),Qn(e,0))}function Qn(t,e){var r=t.deps;if(r!==null)for(var n=e;n<r.length;n++)Du(t,r[n])}function dn(t){var e=t.f;if((e&vr)===0){Se(t,ge);var r=j,n=Fr;j=t,Fr=!0;try{(e&on)!==0?Pu(t):Ho(t),Vo(t);var a=rs(t);t.teardown=typeof a=="function"?a:null,t.wv=Gn;var i;lo&&uu&&(t.f&We)!==0&&t.deps}finally{Fr=n,j=r}}}async function ns(){await Promise.resolve(),ee()}function _(t){var e=t.f,r=(e&Ze)!==0;if(H!==null&&!ft){var n=j!==null&&(j.f&vr)!==0;if(!n&&!Ut?.includes(t)){var a=H.deps;if((H.f&$a)!==0)t.rv<un&&(t.rv=un,Oe===null&&a!==null&&a[Ye]===t?Ye++:Oe===null?Oe=[t]:(!ar||!Oe.includes(t))&&Oe.push(t));else{(H.deps??=[]).push(t);var i=t.reactions;i===null?t.reactions=[H]:i.includes(H)||i.push(H)}}}else if(r&&t.deps===null&&t.effects===null){var o=t,s=o.parent;s!==null&&(s.f&Ge)===0&&(o.f^=Ge)}if(xr){if(_r.has(t))return _r.get(t);if(r){o=t;var c=o.v;return((o.f&ge)!==0||as(o))&&(c=Ua(o)),_r.set(o,c),c}}else if(r){if(o=t,Dr?.has(o))return Dr.get(o);Wn(o)&&Ro(o)}if((t.f&br)!==0)throw t.v;return t.v}function as(t){if(t.v===de)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(_r.has(e)||(e.f&Ze)!==0&&as(e))return!0;return!1}function pt(t){var e=ft;try{return ft=!0,t()}finally{ft=e}}const $u=-7169;function Se(t,e){t.f=t.f&$u|e}function zu(t,e){if(e){const r=document.body;t.autofocus=!0,yr(()=>{document.activeElement===r&&t.focus()})}}function Fu(t){var e=H,r=j;Ee(null),nt(null);try{return t()}finally{Ee(e),nt(r)}}const is=new Set,Qa=new Set;function os(t,e,r,n={}){function a(i){if(n.capture||hn.call(e,i),!i.cancelBubble)return Fu(()=>r?.call(this,i))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?yr(()=>{e.addEventListener(t,a,n)}):e.addEventListener(t,a,n),a}function ju(t,e,r,n,a){var i={capture:n,passive:a},o=os(t,e,r,i);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&Bo(()=>{e.removeEventListener(t,o,i)})}function ss(t){for(var e=0;e<t.length;e++)is.add(t[e]);for(var r of Qa)r(t)}function hn(t){var e=this,r=e.ownerDocument,n=t.type,a=t.composedPath?.()||[],i=a[0]||t.target,o=0,s=t.__root;if(s){var c=a.indexOf(s);if(c!==-1&&(e===document||e===window)){t.__root=e;return}var l=a.indexOf(e);if(l===-1)return;c<=l&&(o=c)}if(i=a[o]||t.target,i!==e){Or(t,"currentTarget",{configurable:!0,get(){return i||r}});var u=H,p=j;Ee(null),nt(null);try{for(var h,v=[];i!==null;){var m=i.assignedSlot||i.parentNode||i.host||null;try{var b=i["__"+n];if(b!=null&&(!i.disabled||t.target===i))if(nn(b)){var[C,...y]=b;C.apply(i,[t,...y])}else b.call(i,t)}catch(k){h?v.push(k):h=k}if(t.cancelBubble||m===e||m===null)break;i=m}if(h){for(let k of v)queueMicrotask(()=>{throw k});throw h}}finally{t.__root=e,delete t.currentTarget,Ee(u),nt(p)}}}let it;function Bu(){it=void 0}function Uu(t){let e=null,r=M;var n;if(M){for(e=q,it===void 0&&(it=rt(document.head));it!==null&&(it.nodeType!==kr||it.data!==Ra);)it=Qe(it);it===null?xe(!1):it=me(Qe(it))}M||(n=document.head.appendChild(Ft()));try{Bt(()=>t(n),go)}finally{r&&(xe(!0),it=q,me(e))}}function ls(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function qt(t,e){var r=j;r.nodes_start===null&&(r.nodes_start=t,r.nodes_end=e)}function Tt(t,e){var r=(e&Bc)!==0,n=(e&Uc)!==0,a,i=!t.startsWith("<!>");return()=>{if(M)return qt(q,null),q;a===void 0&&(a=ls(i?t:"<!>"+t),r||(a=rt(a)));var o=n||Do?document.importNode(a,!0):a.cloneNode(!0);if(r){var s=rt(o),c=o.lastChild;qt(s,c)}else qt(o,o);return o}}function gt(){if(M)return qt(q,null),q;var t=document.createDocumentFragment(),e=document.createComment(""),r=Ft();return t.append(e,r),qt(e,r),t}function ie(t,e){if(M){j.nodes_end=q,wt();return}t!==null&&t.before(e)}function qu(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const Vu=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Hu(t){return Vu.includes(t)}const Zu={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function Gu(t){return t=t.toLowerCase(),Zu[t]??t}const Wu=["touchstart","touchmove"];function Qu(t){return Wu.includes(t)}const Yu=["textarea","script","style","title"];function Ku(t){return Yu.includes(t)}function cs(t,e){var r=e==null?"":typeof e=="object"?e+"":e;r!==(t.__t??=t.nodeValue)&&(t.__t=r,t.nodeValue=r+"")}function us(t,e){return ds(t,e)}function Xu(t,e){Za(),e.intro=e.intro??!1;const r=e.target,n=M,a=q;try{for(var i=rt(r);i&&(i.nodeType!==kr||i.data!==Ra);)i=Qe(i);if(!i)throw fr;xe(!0),me(i),wt();const o=ds(t,{...e,anchor:i});if(q===null||q.nodeType!==kr||q.data!==Ia)throw sn(),fr;return xe(!1),o}catch(o){if(o===fr)return e.recover===!1&&au(),Za(),Fo(r),xe(!1),us(t,e);throw o}finally{xe(n),me(a),Bu()}}const jr=new Map;function ds(t,{target:e,anchor:r,props:n={},events:a,context:i,intro:o=!0}){Za();var s=new Set,c=p=>{for(var h=0;h<p.length;h++){var v=p[h];if(!s.has(v)){s.add(v);var m=Qu(v);e.addEventListener(v,hn,{passive:m});var b=jr.get(v);b===void 0?(document.addEventListener(v,hn,{passive:m}),jr.set(v,1)):jr.set(v,b+1)}}};c(La(is)),Qa.add(c);var l=void 0,u=Ou(()=>{var p=r??e.appendChild(Ft());return he(()=>{if(i){Pr({});var h=Ie;h.c=i}a&&(n.$$events=a),M&&qt(p,null),l=t(p,n)||{},M&&(j.nodes_end=q),i&&Nr()}),()=>{for(var h of s){e.removeEventListener(h,hn);var v=jr.get(h);--v===0?(document.removeEventListener(h,hn),jr.delete(h)):jr.set(h,v)}Qa.delete(c),p!==r&&p.parentNode?.removeChild(p)}});return Ya.set(l,u),l}let Ya=new WeakMap;function Ju(t,e){const r=Ya.get(t);return r?(Ya.delete(t),r(e)):Promise.resolve()}function hs(t,e,...r){var n=t,a=pr,i;Bt(()=>{a!==(a=e())&&(i&&(ve(i),i=null),i=he(()=>a(n,...r)))},Mr),M&&(n=q)}function ed(t){Ie===null&&bo(),Uo(()=>{const e=pt(t);if(typeof e=="function")return e})}function td(t){Ie===null&&bo(),ed(()=>()=>pt(t))}const Ka=0,Yn=1,Xa=2;function fs(t,e,r,n,a){M&&wt();var i=t,o=Ie,s=de,c,l,u,p=zt(void 0),h=zt(void 0),v=!1;function m(C,y){v=!0,y&&(nt(b),Ee(b),er(o));try{C===Ka&&r&&(c?zr(c):c=he(()=>r(i))),C===Yn&&n&&(l?zr(l):l=he(()=>n(i,p))),C!==Ka&&c&&St(c,()=>c=null),C!==Yn&&l&&St(l,()=>l=null),C!==Xa&&u&&St(u,()=>u=null)}finally{y&&(er(null),Ee(null),nt(null),ee())}}var b=Bt(()=>{if(s===(s=e()))return;let C=M&&ho(s)===(i.data===Nn);if(C&&(i=ln(),me(i),xe(!1),C=!0),ho(s)){var y=s;v=!1,y.then(k=>{y===s&&(rr(p,k),m(Yn,!0))},k=>{if(y===s)throw rr(h,k),m(Xa,!0),h.v}),M?r&&(c=he(()=>r(i))):yr(()=>{v||m(Ka,!0)})}else rr(p,s),m(Yn,!1);return C&&xe(!0),()=>s=de});M&&(i=q)}function ir(t,e,r=!1){M&&wt();var n=t,a=null,i=null,o=de,s=r?Mr:0,c=!1;const l=(v,m=!0)=>{c=!0,h(m,v)};var u=null;function p(){u!==null&&(u.lastChild.remove(),n.before(u),u=null);var v=o?a:i,m=o?i:a;v&&zr(v),m&&St(m,()=>{o?i=null:a=null})}const h=(v,m)=>{if(o===(o=v))return;let b=!1;if(M){const R=yo(n)===Nn;!!o===R&&(n=ln(),me(n),xe(!1),b=!0)}var C=jo(),y=n;if(C&&(u=document.createDocumentFragment(),u.append(y=Ft())),o?a??=m&&he(()=>m(y)):i??=m&&he(()=>m(y)),C){var k=qe,w=o?a:i,T=o?i:a;w&&k.skipped_effects.delete(w),T&&k.skipped_effects.add(T),k.add_callback(p)}else p();b&&xe(!0)};Bt(()=>{c=!1,e(l),c||h(null,null)},s),M&&(n=q)}function rd(t,e){return e}function nd(t,e,r){for(var n=t.items,a=[],i=e.length,o=0;o<i;o++)Wa(e[o].e,a,!0);var s=i>0&&a.length===0&&r!==null;if(s){var c=r.parentNode;Fo(c),c.append(r),n.clear(),Et(t,e[0].prev,e[i-1].next)}Wo(a,()=>{for(var l=0;l<i;l++){var u=e[l];s||(n.delete(u.k),Et(t,u.prev,u.next)),ve(u.e,!s)}})}function ad(t,e,r,n,a,i=null){var o=t,s={flags:e,items:new Map,first:null};M&&wt();var c=null,l=!1,u=new Map,p=Co(()=>{var b=r();return nn(b)?b:b==null?[]:La(b)}),h,v;function m(){id(v,h,s,u,o,a,e,n,r),i!==null&&(h.length===0?c?zr(c):c=he(()=>i(o)):c!==null&&St(c,()=>{c=null}))}Bt(()=>{v??=j,h=_(p);var b=h.length;if(l&&b===0)return;l=b===0;let C=!1;if(M){var y=yo(o)===Nn;y!==(b===0)&&(o=ln(),me(o),xe(!1),C=!0)}if(M){for(var k=null,w,T=0;T<b;T++){if(q.nodeType===kr&&q.data===Ia){o=q,C=!0,xe(!1);break}var R=h[T],U=n(R,T);w=Ja(q,s,k,null,R,U,T,a,e,r),s.items.set(U,w),k=w}b>0&&me(ln())}if(M)b===0&&i&&(c=he(()=>i(o)));else if(jo()){var Q=new Set,Fe=qe;for(T=0;T<b;T+=1){R=h[T],U=n(R,T);var le=s.items.get(U)??u.get(U);le?ps(le,R,T):(w=Ja(null,s,null,null,R,U,T,a,e,r,!0),u.set(U,w)),Q.add(U)}for(const[ur,ne]of s.items)Q.has(ur)||Fe.skipped_effects.add(ne.e);Fe.add_callback(m)}else m();C&&xe(!0),_(p)}),M&&(o=q)}function id(t,e,r,n,a,i,o,s,c){var l=e.length,u=r.items,p=r.first,h=p,v,m=null,b=[],C=[],y,k,w,T;for(T=0;T<l;T+=1){if(y=e[T],k=s(y,T),w=u.get(k),w===void 0){var R=n.get(k);if(R!==void 0){n.delete(k),u.set(k,R);var U=m?m.next:h;Et(r,m,R),Et(r,R,U),ei(R,U,a),m=R}else{var Q=h?h.e.nodes_start:a;m=Ja(Q,r,m,m===null?r.first:m.next,y,k,T,i,o,c)}u.set(k,m),b=[],C=[],h=m.next;continue}if(ps(w,y,T),(w.e.f&ht)!==0&&zr(w.e),w!==h){if(v!==void 0&&v.has(w)){if(b.length<C.length){var Fe=C[0],le;m=Fe.prev;var ur=b[0],ne=b[b.length-1];for(le=0;le<b.length;le+=1)ei(b[le],Fe,a);for(le=0;le<C.length;le+=1)v.delete(C[le]);Et(r,ur.prev,ne.next),Et(r,m,ur),Et(r,ne,Fe),h=Fe,m=ne,T-=1,b=[],C=[]}else v.delete(w),ei(w,h,a),Et(r,w.prev,w.next),Et(r,w,m===null?r.first:m.next),Et(r,m,w),m=w;continue}for(b=[],C=[];h!==null&&h.k!==k;)(h.e.f&ht)===0&&(v??=new Set).add(h),C.push(h),h=h.next;if(h===null)continue;w=h}b.push(w),m=w,h=w.next}if(h!==null||v!==void 0){for(var Qt=v===void 0?[]:La(v);h!==null;)(h.e.f&ht)===0&&Qt.push(h),h=h.next;var dr=Qt.length;if(dr>0){var hr=null;nd(r,Qt,hr)}}t.first=r.first&&r.first.e,t.last=m&&m.e;for(var Xr of n.values())ve(Xr.e);n.clear()}function ps(t,e,r,n){rr(t.v,e),t.i=r}function Ja(t,e,r,n,a,i,o,s,c,l,u){var p=(c&Pc)!==0,h=(c&Dc)===0,v=p?h?Mo(a,!1,!1):zt(a):a,m=(c&Nc)===0?o:zt(o),b={i:m,v,k:i,a:null,e:null,prev:r,next:n};try{if(t===null){var C=document.createDocumentFragment();C.append(t=Ft())}return b.e=he(()=>s(t,v,m,l),M),b.e.prev=r&&r.e,b.e.next=n&&n.e,r===null?u||(e.first=b):(r.next=b,r.e.next=b.e),n!==null&&(n.prev=b,n.e.prev=b.e),b}finally{}}function ei(t,e,r){for(var n=t.next?t.next.e.nodes_start:r,a=e?e.e.nodes_start:r,i=t.e.nodes_start;i!==null&&i!==n;){var o=Qe(i);a.before(i),i=o}}function Et(t,e,r){e===null?t.first=r:(e.next=r,e.e.next=r&&r.e),r!==null&&(r.prev=e,r.e.prev=e&&e.e)}function ti(t,e,r=!1,n=!1,a=!1){var i=t,o="";Zn(()=>{var s=j;if(o===(o=e()??"")){M&&wt();return}if(s.nodes_start!==null&&(Zo(s.nodes_start,s.nodes_end),s.nodes_start=s.nodes_end=null),o!==""){if(M){q.data;for(var c=wt(),l=c;c!==null&&(c.nodeType!==kr||c.data!=="");)l=c,c=Qe(c);if(c===null)throw sn(),fr;qt(q,l),i=me(c);return}var u=o+"";r?u=`<svg>${u}</svg>`:n&&(u=`<math>${u}</math>`);var p=ls(u);if((r||n)&&(p=rt(p)),qt(rt(p),p.lastChild),r||n)for(;rt(p);)i.before(rt(p));else i.before(p)}})}function gs(t,e,r,n,a,i){let o=M;M&&wt();var s,c,l=null;M&&q.nodeType===Kc&&(l=q,wt());var u=M?q:t,p;Bt(()=>{const h=e()||null;var v=h==="svg"?Vc:null;h!==s&&(p&&(h===null?St(p,()=>{p=null,c=null}):h===c?zr(p):ve(p)),h&&h!==c&&(p=he(()=>{if(l=M?l:v?document.createElementNS(v,h):document.createElement(h),qt(l,l),n){M&&Ku(h)&&l.append(document.createComment(""));var m=M?rt(l):l.appendChild(Ft());M&&(m===null?xe(!1):me(m)),n(l,m)}j.nodes_end=l,u.before(l)})),s=h,s&&(c=s))},Mr),o&&(xe(!0),me(u))}function od(t,e){yr(()=>{var r=t.getRootNode(),n=r.host?r:r.head??r.ownerDocument.head;if(!n.querySelector("#"+e.hash)){const a=document.createElement("style");a.id=e.hash,a.textContent=e.code,n.appendChild(a)}})}function ms(t,e,r){Hn(()=>{var n=pt(()=>e(t,r?.())||{});if(n?.destroy)return()=>n.destroy()})}function sd(t,e){var r=void 0,n;Bt(()=>{r!==(r=e())&&(n&&(ve(n),n=null),r&&(n=he(()=>{Hn(()=>r(t))})))})}function vs(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(r=vs(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function ld(){for(var t,e,r=0,n="",a=arguments.length;r<a;r++)(t=arguments[r])&&(e=vs(t))&&(n&&(n+=" "),n+=e);return n}function cd(t){return typeof t=="object"?ld(t):t??""}const bs=[...`
|
|
2
|
-
\r\f \v\uFEFF`];function ud(t,e,r){var n=t==null?"":""+t;if(r){for(var a in r)if(r[a])n=n?n+" "+a:a;else if(n.length)for(var i=a.length,o=0;(o=n.indexOf(a,o))>=0;){var s=o+i;(o===0||bs.includes(n[o-1]))&&(s===n.length||bs.includes(n[s]))?n=(o===0?"":n.substring(0,o))+n.substring(s+1):o=s}}return n===""?null:n}function ks(t,e=!1){var r=e?" !important;":";",n="";for(var a in t){var i=t[a];i!=null&&i!==""&&(n+=" "+a+": "+i+r)}return n}function ri(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function dd(t,e){if(e){var r="",n,a;if(Array.isArray(e)?(n=e[0],a=e[1]):n=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var i=!1,o=0,s=!1,c=[];n&&c.push(...Object.keys(n).map(ri)),a&&c.push(...Object.keys(a).map(ri));var l=0,u=-1;const b=t.length;for(var p=0;p<b;p++){var h=t[p];if(s?h==="/"&&t[p-1]==="*"&&(s=!1):i?i===h&&(i=!1):h==="/"&&t[p+1]==="*"?s=!0:h==='"'||h==="'"?i=h:h==="("?o++:h===")"&&o--,!s&&i===!1&&o===0){if(h===":"&&u===-1)u=p;else if(h===";"||p===b-1){if(u!==-1){var v=ri(t.substring(l,u).trim());if(!c.includes(v)){h!==";"&&p++;var m=t.substring(l,p).trim();r+=" "+m+";"}}l=p+1,u=-1}}}}return n&&(r+=ks(n)),a&&(r+=ks(a,!0)),r=r.trim(),r===""?null:r}return t==null?null:String(t)}function hd(t,e,r,n,a,i){var o=t.__className;if(M||o!==r||o===void 0){var s=ud(r,n,i);(!M||s!==t.getAttribute("class"))&&(s==null?t.removeAttribute("class"):e?t.className=s:t.setAttribute("class",s)),t.__className=r}else if(i&&a!==i)for(var c in i){var l=!!i[c];(a==null||l!==!!a[c])&&t.classList.toggle(c,l)}return i}function ni(t,e={},r,n){for(var a in r){var i=r[a];e[a]!==i&&(r[a]==null?t.style.removeProperty(a):t.style.setProperty(a,i,n))}}function fd(t,e,r,n){var a=t.__style;if(M||a!==e){var i=dd(e,n);(!M||i!==t.getAttribute("style"))&&(i==null?t.removeAttribute("style"):t.style.cssText=i),t.__style=e}else n&&(Array.isArray(n)?(ni(t,r?.[0],n[0]),ni(t,r?.[1],n[1],"important")):ni(t,r,n));return n}function ai(t,e,r=!1){if(t.multiple){if(e==null)return;if(!nn(e))return cu();for(var n of t.options)n.selected=e.includes(ys(n));return}for(n of t.options){var a=ys(n);if(Cu(a,e)){n.selected=!0;return}}(!r||e!==void 0)&&(t.selectedIndex=-1)}function pd(t){var e=new MutationObserver(()=>{ai(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Bo(()=>{e.disconnect()})}function ys(t){return"__value"in t?t.__value:t.value}const Br=Symbol("class"),fn=Symbol("style"),ws=Symbol("is custom element"),_s=Symbol("is html");function gd(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function ii(t,e,r,n){var a=Ss(t);M&&(a[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")||a[e]!==(a[e]=r)&&(e==="loading"&&(t[Yc]=r),r==null?t.removeAttribute(e):typeof r!="string"&&Es(t).includes(e)?t[e]=r:t.setAttribute(e,r))}function md(t,e,r,n,a=!1){var i=Ss(t),o=i[ws],s=!i[_s];let c=M&&o;c&&xe(!1);var l=e||{},u=t.tagName==="OPTION";for(var p in e)p in r||(r[p]=null);r.class?r.class=cd(r.class):r[Br]&&(r.class=null),r[fn]&&(r.style??=null);var h=Es(t);for(const w in r){let T=r[w];if(u&&w==="value"&&T==null){t.value=t.__value="",l[w]=T;continue}if(w==="class"){var v=t.namespaceURI==="http://www.w3.org/1999/xhtml";hd(t,v,T,n,e?.[Br],r[Br]),l[w]=T,l[Br]=r[Br];continue}if(w==="style"){fd(t,T,e?.[fn],r[fn]),l[w]=T,l[fn]=r[fn];continue}var m=l[w];if(!(T===m&&!(T===void 0&&t.hasAttribute(w)))){l[w]=T;var b=w[0]+w[1];if(b!=="$$")if(b==="on"){const R={},U="$$"+w;let Q=w.slice(2);var C=Hu(Q);if(qu(Q)&&(Q=Q.slice(0,-7),R.capture=!0),!C&&m){if(T!=null)continue;t.removeEventListener(Q,l[U],R),l[U]=null}if(T!=null)if(C)t[`__${Q}`]=T,ss([Q]);else{let Fe=function(le){l[w].call(this,le)};l[U]=os(Q,t,Fe,R)}else C&&(t[`__${Q}`]=void 0)}else if(w==="style")ii(t,w,T);else if(w==="autofocus")zu(t,!!T);else if(!o&&(w==="__value"||w==="value"&&T!=null))t.value=t.__value=T;else if(w==="selected"&&u)gd(t,T);else{var y=w;s||(y=Gu(y));var k=y==="defaultValue"||y==="defaultChecked";if(T==null&&!o&&!k)if(i[w]=null,y==="value"||y==="checked"){let R=t;const U=e===void 0;if(y==="value"){let Q=R.defaultValue;R.removeAttribute(y),R.defaultValue=Q,R.value=R.__value=U?Q:null}else{let Q=R.defaultChecked;R.removeAttribute(y),R.defaultChecked=Q,R.checked=U?Q:!1}}else t.removeAttribute(w);else k||h.includes(y)&&(o||typeof T!="string")?t[y]=T:typeof T!="function"&&ii(t,y,T)}}}return c&&xe(!0),l}function xs(t,e,r=[],n=[],a,i=!1){Io(r,n,o=>{var s=void 0,c={},l=t.nodeName==="SELECT",u=!1;if(Bt(()=>{var h=e(...o.map(_)),v=md(t,s,h,a,i);u&&l&&"value"in h&&ai(t,h.value);for(let b of Object.getOwnPropertySymbols(c))h[b]||ve(c[b]);for(let b of Object.getOwnPropertySymbols(h)){var m=h[b];b.description===Hc&&(!s||m!==s[b])&&(c[b]&&ve(c[b]),c[b]=he(()=>sd(t,()=>m))),v[b]=m}s=v}),l){var p=t;Hn(()=>{ai(p,s.value,!0),pd(p)})}u=!0})}function Ss(t){return t.__attributes??={[ws]:t.nodeName.includes("-"),[_s]:t.namespaceURI===qc}}var Ts=new Map;function Es(t){var e=Ts.get(t.nodeName);if(e)return e;Ts.set(t.nodeName,e=[]);for(var r,n=t,a=Element.prototype;a!==n;){r=Gc(n);for(var i in r)r[i].set&&e.push(i);n=Oa(n)}return e}function Cs(t,e){return t===e||t?.[Jt]===e}function As(t={},e,r,n){return Hn(()=>{var a,i;return Ga(()=>{a=i,i=[],pt(()=>{t!==r(...i)&&(e(t,...i),a&&Cs(r(...a),t)&&e(null,...a))})}),()=>{yr(()=>{i&&Cs(r(...i),t)&&e(null,...i)})}}),t}const Ur=[];function vd(t,e=pr){let r=null;const n=new Set;function a(s){if(_o(t,s)&&(t=s,r)){const c=!Ur.length;for(const l of n)l[1](),Ur.push(l,t);if(c){for(let l=0;l<Ur.length;l+=2)Ur[l][0](Ur[l+1]);Ur.length=0}}}function i(s){a(s(t))}function o(s,c=pr){const l=[s,c];return n.add(l),n.size===1&&(r=e(a,i)||pr),s(t),()=>{n.delete(l),n.size===0&&r&&(r(),r=null)}}return{set:a,update:i,subscribe:o}}let Kn=!1;function bd(t){var e=Kn;try{return Kn=!1,[t(),Kn]}finally{Kn=e}}const kd={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return!1},getOwnPropertyDescriptor(t,e){if(!t.exclude.includes(e)&&e in t.props)return{enumerable:!0,configurable:!0,value:t.props[e]}},has(t,e){return t.exclude.includes(e)?!1:e in t.props},ownKeys(t){return Reflect.ownKeys(t.props).filter(e=>!t.exclude.includes(e))}};function oi(t,e,r){return new Proxy({props:t,exclude:e},kd)}const yd={get(t,e){let r=t.props.length;for(;r--;){let n=t.props[r];if(an(n)&&(n=n()),typeof n=="object"&&n!==null&&e in n)return n[e]}},set(t,e,r){let n=t.props.length;for(;n--;){let a=t.props[n];an(a)&&(a=a());const i=Nt(a,e);if(i&&i.set)return i.set(r),!0}return!1},getOwnPropertyDescriptor(t,e){let r=t.props.length;for(;r--;){let n=t.props[r];if(an(n)&&(n=n()),typeof n=="object"&&n!==null&&e in n){const a=Nt(n,e);return a&&!a.configurable&&(a.configurable=!0),a}}},has(t,e){if(e===Jt||e===Fa)return!1;for(let r of t.props)if(an(r)&&(r=r()),r!=null&&e in r)return!0;return!1},ownKeys(t){const e=[];for(let r of t.props)if(an(r)&&(r=r()),!!r){for(const n in r)e.includes(n)||e.push(n);for(const n of Object.getOwnPropertySymbols(r))e.includes(n)||e.push(n)}return e}};function wd(...t){return new Proxy({props:t},yd)}function oe(t,e,r,n){var a=(r&Fc)!==0,i=(r&jc)!==0,o=n,s=!0,c=()=>(s&&(s=!1,o=i?pt(n):n),o),l;if(a){var u=Jt in t||Fa in t;l=Nt(t,e)?.set??(u&&e in t?k=>t[e]=k:void 0)}var p,h=!1;a?[p,h]=bd(()=>t[e]):p=t[e],p===void 0&&n!==void 0&&(p=c(),l&&(iu(),l(p)));var v;if(v=()=>{var k=t[e];return k===void 0?c():(s=!0,k)},(r&zc)===0)return v;if(l){var m=t.$$legacy;return function(k,w){return arguments.length>0?((!w||m||h)&&l(w?v():k),k):v()}}var b=!1,C=((r&$c)!==0?Bn:Co)(()=>(b=!1,v()));a&&_(C);var y=j;return function(k,w){if(arguments.length>0){const T=w?_(C):a?_t(k):k;return P(C,T),b=!0,o!==void 0&&(o=T),k}return xr&&b||(y.f&vr)!==0?C.v:_(C)}}function _d(t){return new xd(t)}class xd{#e;#t;constructor(e){var r=new Map,n=(i,o)=>{var s=Mo(o,!1,!1);return r.set(i,s),s};const a=new Proxy({...e.props||{},$$events:{}},{get(i,o){return _(r.get(o)??n(o,Reflect.get(i,o)))},has(i,o){return o===Fa?!0:(_(r.get(o)??n(o,Reflect.get(i,o))),Reflect.has(i,o))},set(i,o,s){return P(r.get(o)??n(o,s),s),Reflect.set(i,o,s)}});this.#t=(e.hydrate?Xu:us)(e.component,{target:e.target,anchor:e.anchor,props:a,context:e.context,intro:e.intro??!1,recover:e.recover}),(!e?.props?.$$host||e.sync===!1)&&ee(),this.#e=a.$$events;for(const i of Object.keys(this.#t))i==="$set"||i==="$destroy"||i==="$on"||Or(this,i,{get(){return this.#t[i]},set(o){this.#t[i]=o},enumerable:!0});this.#t.$set=i=>{Object.assign(a,i)},this.#t.$destroy=()=>{Ju(this.#t)}}$set(e){this.#t.$set(e)}$on(e,r){this.#e[e]=this.#e[e]||[];const n=(...a)=>r.call(this,...a);return this.#e[e].push(n),()=>{this.#e[e]=this.#e[e].filter(a=>a!==n)}}$destroy(){this.#t.$destroy()}}let Rs;typeof HTMLElement=="function"&&(Rs=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;constructor(t,e,r){super(),this.$$ctor=t,this.$$s=e,r&&this.attachShadow({mode:"open"})}addEventListener(t,e,r){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){const n=this.$$c.$on(t,e);this.$$l_u.set(e,n)}super.addEventListener(t,e,r)}removeEventListener(t,e,r){if(super.removeEventListener(t,e,r),this.$$c){const n=this.$$l_u.get(e);n&&(n(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(n){return a=>{const i=document.createElement("slot");n!=="default"&&(i.name=n),ie(a,i)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const e={},r=Sd(this);for(const n of this.$$s)n in r&&(n==="default"&&!this.$$d.children?(this.$$d.children=t(n),e.default=!0):e[n]=t(n));for(const n of this.attributes){const a=this.$$g_p(n.name);a in this.$$d||(this.$$d[a]=Xn(a,n.value,this.$$p_d,"toProp"))}for(const n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=_d({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:e,$$host:this}}),this.$$me=Lu(()=>{Ga(()=>{this.$$r=!0;for(const n of Dn(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];const a=Xn(n,this.$$d[n],this.$$p_d,"toAttribute");a==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,a)}this.$$r=!1})});for(const n in this.$$l)for(const a of this.$$l[n]){const i=this.$$c.$on(n,a);this.$$l_u.set(a,i)}this.$$l={}}}attributeChangedCallback(t,e,r){this.$$r||(t=this.$$g_p(t),this.$$d[t]=Xn(t,r,this.$$p_d,"toProp"),this.$$c?.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return Dn(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});function Xn(t,e,r,n){const a=r[t]?.type;if(e=a==="Boolean"&&typeof e!="boolean"?e!=null:e,!n||!r[t])return e;if(n==="toAttribute")switch(a){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(a){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function Sd(t){const e={};return t.childNodes.forEach(r=>{e[r.slot||"default"]=!0}),e}function pn(t,e,r,n,a,i){let o=class extends Rs{constructor(){super(t,r,a),this.$$p_d=e}static get observedAttributes(){return Dn(e).map(s=>(e[s].attribute||s).toLowerCase())}};return Dn(e).forEach(s=>{Or(o.prototype,s,{get(){return this.$$c&&s in this.$$c?this.$$c[s]:this.$$d[s]},set(c){c=Xn(s,c,e),this.$$d[s]=c;var l=this.$$c;if(l){var u=Nt(l,s)?.get;u?l[s]=c:l.$set({[s]:c})}}})}),n.forEach(s=>{Or(o.prototype,s,{get(){return this.$$c?.[s]}})}),t.element=o,o}var Td=(t,e)=>e()(),Ed=Tt('<div class="chat-app__container"><div class="error-message svelte-4thrqu">Server is unreachable, please try later... <button class="error-message__retry-button svelte-4thrqu">Retry</button></div></div>'),Cd=Tt(" <!>",1);const Ad={hash:"svelte-4thrqu",code:`
|
|
1
|
+
var LiipGPTButton=function(rn){"use strict";const Mc="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(Mc);const Pc=1,Nc=2,Dc=16,$c=1,zc=4,Fc=8,Bc=16,jc=1,Uc=2,Ra="[",Nn="[!",Ia="]",fr={},de=Symbol(),qc="http://www.w3.org/1999/xhtml",Vc="http://www.w3.org/2000/svg",Hc="@attach",lo=!1;var nn=Array.isArray,Zc=Array.prototype.indexOf,La=Array.from,Dn=Object.keys,Or=Object.defineProperty,Nt=Object.getOwnPropertyDescriptor,Gc=Object.getOwnPropertyDescriptors,co=Object.prototype,Wc=Array.prototype,Oa=Object.getPrototypeOf,uo=Object.isExtensible;function an(t){return typeof t=="function"}const pr=()=>{};function ho(t){return typeof t?.then=="function"}function fo(t){for(var e=0;e<t.length;e++)t[e]()}function Qc(){var t,e,r=new Promise((n,a)=>{t=n,e=a});return{promise:r,resolve:t,reject:e}}const Ze=2,Ma=4,Pa=8,on=16,Dt=32,gr=64,Na=128,Ge=256,$n=512,ge=1024,We=2048,mr=4096,ht=8192,vr=16384,Da=32768,Mr=65536,po=1<<17,go=1<<18,zn=1<<19,mo=1<<20,$a=1<<21,za=1<<22,br=1<<23,Jt=Symbol("$state"),Fa=Symbol("legacy props"),Yc=Symbol(""),Ba=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Kc=1,vo=3,kr=8;function Xc(){throw new Error("https://svelte.dev/e/await_outside_boundary")}function bo(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Jc(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function eu(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function tu(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function ru(t){throw new Error("https://svelte.dev/e/effect_orphan")}function nu(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function au(){throw new Error("https://svelte.dev/e/hydration_failed")}function iu(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function ou(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function su(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function lu(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function sn(t){console.warn("https://svelte.dev/e/hydration_mismatch")}function cu(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}let M=!1;function xe(t){M=t}let q;function me(t){if(t===null)throw sn(),fr;return q=t}function wt(){return me(Qe(q))}function $t(t){if(M){if(Qe(q)!==null)throw sn(),fr;q=t}}function ko(t=1){if(M){for(var e=t,r=q;e--;)r=Qe(r);q=r}}function ln(){for(var t=0,e=q;;){if(e.nodeType===kr){var r=e.data;if(r===Ia){if(t===0)return e;t-=1}else(r===Ra||r===Nn)&&(t+=1)}var n=Qe(e);e.remove(),e=n}}function yo(t){if(!t||t.nodeType!==kr)throw sn(),fr;return t.data}function wo(t){return t===this.v}function _o(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function xo(t){return!_o(t,this.v)}let uu=!1;const du=[];function hu(t,e=!1){return Fn(t,new Map,"",du)}function Fn(t,e,r,n,a=null){if(typeof t=="object"&&t!==null){var i=e.get(t);if(i!==void 0)return i;if(t instanceof Map)return new Map(t);if(t instanceof Set)return new Set(t);if(nn(t)){var o=Array(t.length);e.set(t,o),a!==null&&e.set(a,o);for(var s=0;s<t.length;s+=1){var c=t[s];s in t&&(o[s]=Fn(c,e,r,n))}return o}if(Oa(t)===co){o={},e.set(t,o),a!==null&&e.set(a,o);for(var l in t)o[l]=Fn(t[l],e,r,n);return o}if(t instanceof Date)return structuredClone(t);if(typeof t.toJSON=="function")return Fn(t.toJSON(),e,r,n,t)}if(t instanceof EventTarget)return t;try{return structuredClone(t)}catch{return t}}let Ie=null;function er(t){Ie=t}function Pr(t,e=!1,r){Ie={p:Ie,c:null,e:null,s:t,x:null,l:null}}function Nr(t){var e=Ie,r=e.e;if(r!==null){e.e=null;for(var n of r)qo(n)}return t!==void 0&&(e.x=t),Ie=e.p,t??{}}function So(){return!0}const fu=new WeakMap;function pu(t){var e=B;if(e===null)return H.f|=br,t;if((e.f&Da)===0){if((e.f&Na)===0)throw!e.parent&&t instanceof Error&&To(t),t;e.b.error(t)}else Bn(t,e)}function Bn(t,e){for(;e!==null;){if((e.f&Na)!==0)try{e.b.error(t);return}catch{}e=e.parent}throw t instanceof Error&&To(t),t}function To(t){const e=fu.get(t);e&&(Or(t,"message",{value:e.message}),Or(t,"stack",{value:e.stack}))}let cn=[],ja=[];function Eo(){var t=cn;cn=[],fo(t)}function gu(){var t=ja;ja=[],fo(t)}function yr(t){cn.length===0&&queueMicrotask(Eo),cn.push(t)}function mu(){cn.length>0&&Eo(),ja.length>0&&gu()}function vu(t){let e=0,r=zt(0),n;return()=>{Iu()&&(_(r),Ga(()=>(e===0&&(n=pt(()=>t(()=>Vn(r)))),e+=1,()=>{yr(()=>{e-=1,e===0&&(n?.(),n=void 0)})})))}}var bu=Mr|zn|Na;function ku(t,e,r){new yu(t,e,r)}class yu{pending=!1;parent;#e;#t;#a;#l;#u;#i=null;#r=null;#o=null;#s=null;#n=0;#c=!1;#d=null;#f=()=>{this.#d&&rr(this.#d,this.#n)};#h=vu(()=>(this.#d=zt(this.#n),()=>{this.#d=null}));constructor(e,r,n){this.#e=e,this.#a=r,this.#l=n,this.#t=q,this.parent=B.b,this.pending=!!this.#a.pending,this.#u=jt(()=>{B.b=this,M&&wt();const a=this.#a.pending;if(M&&a)this.#r=he(()=>a(this.#e)),queueMicrotask(()=>{this.#i=this.#p(()=>(wr.ensure(),he(()=>this.#l(this.#e)))),this.#n>0?this.#g():(St(this.#r,()=>{this.#r=null}),this.pending=!1)});else{try{this.#i=he(()=>n(this.#e))}catch(i){this.error(i)}this.#n>0?this.#g():this.pending=!1}},bu),M&&(this.#e=q)}has_pending_snippet(){return!!this.#a.pending}#p(e){var r=B,n=H,a=Ie;nt(this.#u),Ee(this.#u),er(this.#u.ctx);try{return e()}finally{nt(r),Ee(n),er(a)}}#g(){const e=this.#a.pending;this.#i!==null&&(this.#s=document.createDocumentFragment(),wu(this.#i,this.#s)),this.#r===null&&(this.#r=he(()=>e(this.#e)))}#m(e){this.#n+=e,this.#n===0&&(this.pending=!1,this.#r&&St(this.#r,()=>{this.#r=null}),this.#s&&(this.#e.before(this.#s),this.#s=null))}update_pending_count(e){this.has_pending_snippet()?this.#m(e):this.parent&&this.parent.#m(e),qa.add(this.#f)}get_effect_pending(){return this.#h(),_(this.#d)}error(e){var r=this.#a.onerror;let n=this.#a.failed;const a=()=>{this.#n=0,this.#o!==null&&St(this.#o,()=>{this.#o=null}),this.pending=!0,this.#i=this.#p(()=>(this.#c=!1,he(()=>this.#l(this.#e)))),this.#n>0?this.#g():this.pending=!1};if(this.#c||!r&&!n)throw e;var i=H;try{Ee(null),r?.(e,a)}finally{Ee(i)}this.#i&&(ve(this.#i),this.#i=null),this.#r&&(ve(this.#r),this.#r=null),this.#o&&(ve(this.#o),this.#o=null),M&&(me(this.#t),ko(),me(ln())),n&&yr(()=>{this.#o=this.#p(()=>{this.#c=!0;try{return he(()=>{n(this.#e,()=>e,()=>a)})}catch(o){return Bn(o,this.#u.parent),null}finally{this.#c=!1}})})}}function wu(t,e){for(var r=t.nodes_start,n=t.nodes_end;r!==null;){var a=r===n?null:Qe(r);e.append(r),r=a}}function _u(){for(var t=B.b;t!==null&&!t.has_pending_snippet();)t=t.parent;return t===null&&Xc(),t}function jn(t){var e=Ze|We,r=H!==null&&(H.f&Ze)!==0?H:null;return B===null||r!==null&&(r.f&Ge)!==0?e|=Ge:B.f|=zn,{ctx:Ie,deps:null,effects:null,equals:wo,f:e,fn:t,reactions:null,rv:0,v:de,wv:0,parent:r??B,ac:null}}function xu(t,e){let r=B;r===null&&Jc();var n=r.b,a=void 0,i=zt(de),o=null,s=!H;return Mu(()=>{try{var c=t()}catch(v){c=Promise.reject(v)}var l=()=>c;a=o?.then(l,l)??Promise.resolve(c),o=a;var u=qe,p=n.pending;s&&(n.update_pending_count(1),p||u.increment());const h=(v,m=void 0)=>{o=null,p||u.activate(),m?m!==Ba&&(i.f|=br,rr(i,m)):((i.f&br)!==0&&(i.f^=br),rr(i,v)),s&&(n.update_pending_count(-1),p||u.decrement()),Lo()};if(a.then(h,v=>h(null,v||"unknown")),u)return()=>{queueMicrotask(()=>u.neuter())}}),new Promise(c=>{function l(u){function p(){u===a?c(i):l(a)}u.then(p,p)}l(a)})}function X(t){const e=jn(t);return Xo(e),e}function Co(t){const e=jn(t);return e.equals=xo,e}function Ao(t){var e=t.effects;if(e!==null){t.effects=null;for(var r=0;r<e.length;r+=1)ve(e[r])}}function Su(t){for(var e=t.parent;e!==null;){if((e.f&Ze)===0)return e;e=e.parent}return null}function Ua(t){var e,r=B;nt(Su(t));try{Ao(t),e=rs(t)}finally{nt(r)}return e}function Ro(t){var e=Ua(t);if(t.equals(e)||(t.v=e,t.wv=es()),!xr)if(Dr!==null)Dr.set(t,t.v);else{var r=(ar||(t.f&Ge)!==0)&&t.deps!==null?mr:ge;Se(t,r)}}function Io(t,e,r){const n=jn;if(e.length===0){r(t.map(n));return}var a=qe,i=B,o=Tu(),s=_u();Promise.all(e.map(c=>xu(c))).then(c=>{a?.activate(),o();try{r([...t.map(n),...c])}catch(l){(i.f&vr)===0&&Bn(l,i)}a?.deactivate(),Lo()}).catch(c=>{s.error(c)})}function Tu(){var t=B,e=H,r=Ie;return function(){nt(t),Ee(e),er(r)}}function Lo(){nt(null),Ee(null),er(null)}const Un=new Set;let qe=null,Dr=null,qa=new Set,$r=[],qn=null,Va=!1;class wr{#e=new Map;#t=new Map;#a=new Set;#l=0;#u=null;#i=!1;#r=[];#o=[];#s=[];#n=[];#c=[];skipped_effects=new Set;#d(e){$r=[];var r=null;if(Un.size>1){r=new Map,Dr=new Map;for(const[i,o]of this.#e)r.set(i,{v:i.v,wv:i.wv}),i.v=o;for(const i of Un)if(i!==this)for(const[o,s]of i.#t)r.has(o)||(r.set(o,{v:o.v,wv:o.wv}),o.v=s)}for(const i of e)this.#f(i);if(this.#r.length===0&&this.#l===0){var n=this.#s,a=this.#n;this.#s=[],this.#n=[],this.#c=[],this.#h(),Oo(n),Oo(a),this.#u?.resolve()}else{for(const i of this.#s)Se(i,ge);for(const i of this.#n)Se(i,ge);for(const i of this.#c)Se(i,ge)}if(r){for(const[i,{v:o,wv:s}]of r)i.wv<=s&&(i.v=o);Dr=null}for(const i of this.#r)dn(i);for(const i of this.#o)dn(i);this.#r=[],this.#o=[]}#f(e){e.f^=ge;for(var r=e.first;r!==null;){var n=r.f,a=(n&(Dt|gr))!==0,i=a&&(n&ge)!==0,o=i||(n&ht)!==0||this.skipped_effects.has(r);if(!o&&r.fn!==null){if(a)r.f^=ge;else if((n&Ma)!==0)this.#n.push(r);else if(Wn(r))if((n&za)!==0){var s=r.b?.pending?this.#o:this.#r;s.push(r)}else(r.f&on)!==0&&this.#c.push(r),dn(r);var c=r.first;if(c!==null){r=c;continue}}var l=r.parent;for(r=r.next;r===null&&l!==null;)r=l.next,l=l.parent}}capture(e,r){this.#t.has(e)||this.#t.set(e,r),this.#e.set(e,e.v)}activate(){qe=this}deactivate(){qe=null;for(const e of qa)if(qa.delete(e),e(),qe!==null)break}neuter(){this.#i=!0}flush(){$r.length>0?this.flush_effects():this.#h(),qe===this&&(this.#l===0&&Un.delete(this),this.deactivate())}flush_effects(){var e=Fr;Va=!0;try{var r=0;for(Yo(!0);$r.length>0;){if(r++>1e3){var n,a;Eu()}this.#d($r),_r.clear()}}finally{Va=!1,Yo(e),qn=null}}#h(){if(!this.#i)for(const e of this.#a)e();this.#a.clear()}increment(){this.#l+=1}decrement(){if(this.#l-=1,this.#l===0){for(const e of this.#s)Se(e,We),tr(e);for(const e of this.#n)Se(e,We),tr(e);for(const e of this.#c)Se(e,We),tr(e);this.#s=[],this.#n=[],this.flush()}else this.deactivate()}add_callback(e){this.#a.add(e)}settled(){return(this.#u??=Qc()).promise}static ensure(e=!0){if(qe===null){const r=qe=new wr;Un.add(qe),e&&queueMicrotask(()=>{qe===r&&r.flush()})}return qe}}function ee(t){var e;const r=wr.ensure(!1);for(;;){if(mu(),$r.length===0)return r===qe&&r.flush(),qn=null,e;r.flush_effects()}}function Eu(){try{nu()}catch(t){Bn(t,qn)}}function Oo(t){var e=t.length;if(e!==0){for(var r=0;r<e;r++){var n=t[r];if((n.f&(vr|ht))===0&&Wn(n)){var a=Gn;if(dn(n),n.deps===null&&n.first===null&&n.nodes_start===null&&(n.teardown===null?Go(n):n.fn=null),Gn>a&&(n.f&mo)!==0)break}}for(;r<e;r+=1)tr(t[r])}}function tr(t){for(var e=qn=t;e.parent!==null;){e=e.parent;var r=e.f;if(Va&&e===B&&(r&on)!==0)return;if((r&(gr|Dt))!==0){if((r&ge)===0)return;e.f^=ge}}$r.push(e)}const _r=new Map;function zt(t,e){var r={f:0,v:t,reactions:null,equals:wo,rv:0,wv:0};return r}function J(t,e){const r=zt(t);return Xo(r),r}function Mo(t,e=!1,r=!0){const n=zt(t);return e||(n.equals=xo),n}function P(t,e,r=!1){H!==null&&(!ft||(H.f&po)!==0)&&So()&&(H.f&(Ze|on|za|po))!==0&&!Ut?.includes(t)&&lu();let n=r?_t(e):e;return rr(t,n)}function rr(t,e){if(!t.equals(e)){var r=t.v;xr?_r.set(t,e):_r.set(t,r),t.v=e,wr.ensure().capture(t,r),(t.f&Ze)!==0&&((t.f&We)!==0&&Ua(t),Se(t,(t.f&Ge)===0?ge:mr)),t.wv=es(),Po(t,We),B!==null&&(B.f&ge)!==0&&(B.f&(Dt|gr))===0&&(at===null?Nu([t]):at.push(t))}return e}function Vn(t){P(t,t.v+1)}function Po(t,e){var r=t.reactions;if(r!==null)for(var n=r.length,a=0;a<n;a++){var i=r[a],o=i.f;(o&We)===0&&(Se(i,e),(o&(ge|Ge))!==0&&((o&Ze)!==0?Po(i,mr):tr(i)))}}function _t(t){if(typeof t!="object"||t===null||Jt in t)return t;const e=Oa(t);if(e!==co&&e!==Wc)return t;var r=new Map,n=nn(t),a=J(0),i=Sr,o=s=>{if(Sr===i)return s();var c=H,l=Sr;Ee(null),Jo(i);var u=s();return Ee(c),Jo(l),u};return n&&r.set("length",J(t.length)),new Proxy(t,{defineProperty(s,c,l){(!("value"in l)||l.configurable===!1||l.enumerable===!1||l.writable===!1)&&ou();var u=r.get(c);return u===void 0?u=o(()=>{var p=J(l.value);return r.set(c,p),p}):P(u,l.value,!0),!0},deleteProperty(s,c){var l=r.get(c);if(l===void 0){if(c in s){const u=o(()=>J(de));r.set(c,u),Vn(a)}}else P(l,de),Vn(a);return!0},get(s,c,l){if(c===Jt)return t;var u=r.get(c),p=c in s;if(u===void 0&&(!p||Nt(s,c)?.writable)&&(u=o(()=>{var v=_t(p?s[c]:de),m=J(v);return m}),r.set(c,u)),u!==void 0){var h=_(u);return h===de?void 0:h}return Reflect.get(s,c,l)},getOwnPropertyDescriptor(s,c){var l=Reflect.getOwnPropertyDescriptor(s,c);if(l&&"value"in l){var u=r.get(c);u&&(l.value=_(u))}else if(l===void 0){var p=r.get(c),h=p?.v;if(p!==void 0&&h!==de)return{enumerable:!0,configurable:!0,value:h,writable:!0}}return l},has(s,c){if(c===Jt)return!0;var l=r.get(c),u=l!==void 0&&l.v!==de||Reflect.has(s,c);if(l!==void 0||B!==null&&(!u||Nt(s,c)?.writable)){l===void 0&&(l=o(()=>{var h=u?_t(s[c]):de,v=J(h);return v}),r.set(c,l));var p=_(l);if(p===de)return!1}return u},set(s,c,l,u){var p=r.get(c),h=c in s;if(n&&c==="length")for(var v=l;v<p.v;v+=1){var m=r.get(v+"");m!==void 0?P(m,de):v in s&&(m=o(()=>J(de)),r.set(v+"",m))}if(p===void 0)(!h||Nt(s,c)?.writable)&&(p=o(()=>J(void 0)),P(p,_t(l)),r.set(c,p));else{h=p.v!==de;var b=o(()=>_t(l));P(p,b)}var C=Reflect.getOwnPropertyDescriptor(s,c);if(C?.set&&C.set.call(u,l),!h){if(n&&typeof c=="string"){var y=r.get("length"),k=Number(c);Number.isInteger(k)&&k>=y.v&&P(y,k+1)}Vn(a)}return!0},ownKeys(s){_(a);var c=Reflect.ownKeys(s).filter(p=>{var h=r.get(p);return h===void 0||h.v!==de});for(var[l,u]of r)u.v!==de&&!(l in s)&&c.push(l);return c},setPrototypeOf(){su()}})}function No(t){try{if(t!==null&&typeof t=="object"&&Jt in t)return t[Jt]}catch{}return t}function Cu(t,e){return Object.is(No(t),No(e))}var Ha,Do,$o,zo;function Za(){if(Ha===void 0){Ha=window,Do=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,r=Text.prototype;$o=Nt(e,"firstChild").get,zo=Nt(e,"nextSibling").get,uo(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),uo(r)&&(r.__t=void 0)}}function Ft(t=""){return document.createTextNode(t)}function rt(t){return $o.call(t)}function Qe(t){return zo.call(t)}function Bt(t,e){if(!M)return rt(t);var r=rt(q);if(r===null)r=q.appendChild(Ft());else if(e&&r.nodeType!==vo){var n=Ft();return r?.before(n),me(n),n}return me(r),r}function Le(t,e){if(!M){var r=rt(t);return r instanceof Comment&&r.data===""?Qe(r):r}return q}function nr(t,e=1,r=!1){let n=M?q:t;for(var a;e--;)a=n,n=Qe(n);if(!M)return n;if(r&&n?.nodeType!==vo){var i=Ft();return n===null?a?.after(i):n.before(i),me(i),i}return me(n),n}function Fo(t){t.textContent=""}function Bo(){return!1}function Au(t){B===null&&H===null&&ru(),H!==null&&(H.f&Ge)!==0&&B===null&&tu(),xr&&eu()}function Ru(t,e){var r=e.last;r===null?e.last=e.first=t:(r.next=t,t.prev=r,e.last=t)}function xt(t,e,r,n=!0){var a=B;a!==null&&(a.f&ht)!==0&&(t|=ht);var i={ctx:Ie,deps:null,nodes_start:null,nodes_end:null,f:t|We,first:null,fn:e,last:null,next:null,parent:a,b:a&&a.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(r)try{dn(i),i.f|=Da}catch(c){throw ve(i),c}else e!==null&&tr(i);var o=r&&i.deps===null&&i.first===null&&i.nodes_start===null&&i.teardown===null&&(i.f&zn)===0;if(!o&&n&&(a!==null&&Ru(i,a),H!==null&&(H.f&Ze)!==0)){var s=H;(s.effects??=[]).push(i)}return i}function Iu(){return H!==null&&!ft}function jo(t){const e=xt(Pa,null,!1);return Se(e,ge),e.teardown=t,e}function Uo(t){Au();var e=B.f,r=!H&&(e&Dt)!==0&&(e&Da)===0;if(r){var n=Ie;(n.e??=[]).push(t)}else return qo(t)}function qo(t){return xt(Ma|mo,t,!1)}function Lu(t){wr.ensure();const e=xt(gr,t,!0);return()=>{ve(e)}}function Ou(t){wr.ensure();const e=xt(gr,t,!0);return(r={})=>new Promise(n=>{r.outro?St(e,()=>{ve(e),n(void 0)}):(ve(e),n(void 0))})}function Hn(t){return xt(Ma,t,!1)}function Mu(t){return xt(za|zn,t,!0)}function Ga(t,e=0){return xt(Pa|e,t,!0)}function Zn(t,e=[],r=[]){Io(e,r,n=>{xt(Pa,()=>t(...n.map(_)),!0)})}function jt(t,e=0){var r=xt(on|e,t,!0);return r}function he(t,e=!0){return xt(Dt,t,!0,e)}function Vo(t){var e=t.teardown;if(e!==null){const r=xr,n=H;Ko(!0),Ee(null);try{e.call(null)}finally{Ko(r),Ee(n)}}}function Ho(t,e=!1){var r=t.first;for(t.first=t.last=null;r!==null;){r.ac?.abort(Ba);var n=r.next;(r.f&gr)!==0?r.parent=null:ve(r,e),r=n}}function Pu(t){for(var e=t.first;e!==null;){var r=e.next;(e.f&Dt)===0&&ve(e),e=r}}function ve(t,e=!0){var r=!1;(e||(t.f&go)!==0)&&t.nodes_start!==null&&t.nodes_end!==null&&(Zo(t.nodes_start,t.nodes_end),r=!0),Ho(t,e&&!r),Qn(t,0),Se(t,vr);var n=t.transitions;if(n!==null)for(const i of n)i.stop();Vo(t);var a=t.parent;a!==null&&a.first!==null&&Go(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes_start=t.nodes_end=t.ac=null}function Zo(t,e){for(;t!==null;){var r=t===e?null:Qe(t);t.remove(),t=r}}function Go(t){var e=t.parent,r=t.prev,n=t.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),e!==null&&(e.first===t&&(e.first=n),e.last===t&&(e.last=r))}function St(t,e){var r=[];Wa(t,r,!0),Wo(r,()=>{ve(t),e&&e()})}function Wo(t,e){var r=t.length;if(r>0){var n=()=>--r||e();for(var a of t)a.out(n)}else e()}function Wa(t,e,r){if((t.f&ht)===0){if(t.f^=ht,t.transitions!==null)for(const o of t.transitions)(o.is_global||r)&&e.push(o);for(var n=t.first;n!==null;){var a=n.next,i=(n.f&Mr)!==0||(n.f&Dt)!==0;Wa(n,e,i?r:!1),n=a}}}function zr(t){Qo(t,!0)}function Qo(t,e){if((t.f&ht)!==0){t.f^=ht,(t.f&ge)===0&&(Se(t,We),tr(t));for(var r=t.first;r!==null;){var n=r.next,a=(r.f&Mr)!==0||(r.f&Dt)!==0;Qo(r,a?e:!1),r=n}if(t.transitions!==null)for(const i of t.transitions)(i.is_global||e)&&i.in()}}let Fr=!1;function Yo(t){Fr=t}let xr=!1;function Ko(t){xr=t}let H=null,ft=!1;function Ee(t){H=t}let B=null;function nt(t){B=t}let Ut=null;function Xo(t){H!==null&&(Ut===null?Ut=[t]:Ut.push(t))}let Oe=null,Ye=0,at=null;function Nu(t){at=t}let Gn=1,un=0,Sr=un;function Jo(t){Sr=t}let ar=!1;function es(){return++Gn}function Wn(t){var e=t.f;if((e&We)!==0)return!0;if((e&mr)!==0){var r=t.deps,n=(e&Ge)!==0;if(r!==null){var a,i,o=(e&$n)!==0,s=n&&B!==null&&!ar,c=r.length;if((o||s)&&(B===null||(B.f&vr)===0)){var l=t,u=l.parent;for(a=0;a<c;a++)i=r[a],(o||!i?.reactions?.includes(l))&&(i.reactions??=[]).push(l);o&&(l.f^=$n),s&&u!==null&&(u.f&Ge)===0&&(l.f^=Ge)}for(a=0;a<c;a++)if(i=r[a],Wn(i)&&Ro(i),i.wv>t.wv)return!0}(!n||B!==null&&!ar)&&Se(t,ge)}return!1}function ts(t,e,r=!0){var n=t.reactions;if(n!==null&&!Ut?.includes(t))for(var a=0;a<n.length;a++){var i=n[a];(i.f&Ze)!==0?ts(i,e,!1):e===i&&(r?Se(i,We):(i.f&ge)!==0&&Se(i,mr),tr(i))}}function rs(t){var e=Oe,r=Ye,n=at,a=H,i=ar,o=Ut,s=Ie,c=ft,l=Sr,u=t.f;Oe=null,Ye=0,at=null,ar=(u&Ge)!==0&&(ft||!Fr||H===null),H=(u&(Dt|gr))===0?t:null,Ut=null,er(t.ctx),ft=!1,Sr=++un,t.ac!==null&&(t.ac.abort(Ba),t.ac=null);try{t.f|=$a;var p=(0,t.fn)(),h=t.deps;if(Oe!==null){var v;if(Qn(t,Ye),h!==null&&Ye>0)for(h.length=Ye+Oe.length,v=0;v<Oe.length;v++)h[Ye+v]=Oe[v];else t.deps=h=Oe;if(!ar||(u&Ze)!==0&&t.reactions!==null)for(v=Ye;v<h.length;v++)(h[v].reactions??=[]).push(t)}else h!==null&&Ye<h.length&&(Qn(t,Ye),h.length=Ye);if(So()&&at!==null&&!ft&&h!==null&&(t.f&(Ze|mr|We))===0)for(v=0;v<at.length;v++)ts(at[v],t);return a!==null&&a!==t&&(un++,at!==null&&(n===null?n=at:n.push(...at))),(t.f&br)!==0&&(t.f^=br),p}catch(m){return pu(m)}finally{t.f^=$a,Oe=e,Ye=r,at=n,H=a,ar=i,Ut=o,er(s),ft=c,Sr=l}}function Du(t,e){let r=e.reactions;if(r!==null){var n=Zc.call(r,t);if(n!==-1){var a=r.length-1;a===0?r=e.reactions=null:(r[n]=r[a],r.pop())}}r===null&&(e.f&Ze)!==0&&(Oe===null||!Oe.includes(e))&&(Se(e,mr),(e.f&(Ge|$n))===0&&(e.f^=$n),Ao(e),Qn(e,0))}function Qn(t,e){var r=t.deps;if(r!==null)for(var n=e;n<r.length;n++)Du(t,r[n])}function dn(t){var e=t.f;if((e&vr)===0){Se(t,ge);var r=B,n=Fr;B=t,Fr=!0;try{(e&on)!==0?Pu(t):Ho(t),Vo(t);var a=rs(t);t.teardown=typeof a=="function"?a:null,t.wv=Gn;var i;lo&&uu&&(t.f&We)!==0&&t.deps}finally{Fr=n,B=r}}}async function ns(){await Promise.resolve(),ee()}function _(t){var e=t.f,r=(e&Ze)!==0;if(H!==null&&!ft){var n=B!==null&&(B.f&vr)!==0;if(!n&&!Ut?.includes(t)){var a=H.deps;if((H.f&$a)!==0)t.rv<un&&(t.rv=un,Oe===null&&a!==null&&a[Ye]===t?Ye++:Oe===null?Oe=[t]:(!ar||!Oe.includes(t))&&Oe.push(t));else{(H.deps??=[]).push(t);var i=t.reactions;i===null?t.reactions=[H]:i.includes(H)||i.push(H)}}}else if(r&&t.deps===null&&t.effects===null){var o=t,s=o.parent;s!==null&&(s.f&Ge)===0&&(o.f^=Ge)}if(xr){if(_r.has(t))return _r.get(t);if(r){o=t;var c=o.v;return((o.f&ge)!==0||as(o))&&(c=Ua(o)),_r.set(o,c),c}}else if(r){if(o=t,Dr?.has(o))return Dr.get(o);Wn(o)&&Ro(o)}if((t.f&br)!==0)throw t.v;return t.v}function as(t){if(t.v===de)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(_r.has(e)||(e.f&Ze)!==0&&as(e))return!0;return!1}function pt(t){var e=ft;try{return ft=!0,t()}finally{ft=e}}const $u=-7169;function Se(t,e){t.f=t.f&$u|e}function zu(t,e){if(e){const r=document.body;t.autofocus=!0,yr(()=>{document.activeElement===r&&t.focus()})}}function Fu(t){var e=H,r=B;Ee(null),nt(null);try{return t()}finally{Ee(e),nt(r)}}const is=new Set,Qa=new Set;function os(t,e,r,n={}){function a(i){if(n.capture||hn.call(e,i),!i.cancelBubble)return Fu(()=>r?.call(this,i))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?yr(()=>{e.addEventListener(t,a,n)}):e.addEventListener(t,a,n),a}function Bu(t,e,r,n,a){var i={capture:n,passive:a},o=os(t,e,r,i);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&jo(()=>{e.removeEventListener(t,o,i)})}function ss(t){for(var e=0;e<t.length;e++)is.add(t[e]);for(var r of Qa)r(t)}function hn(t){var e=this,r=e.ownerDocument,n=t.type,a=t.composedPath?.()||[],i=a[0]||t.target,o=0,s=t.__root;if(s){var c=a.indexOf(s);if(c!==-1&&(e===document||e===window)){t.__root=e;return}var l=a.indexOf(e);if(l===-1)return;c<=l&&(o=c)}if(i=a[o]||t.target,i!==e){Or(t,"currentTarget",{configurable:!0,get(){return i||r}});var u=H,p=B;Ee(null),nt(null);try{for(var h,v=[];i!==null;){var m=i.assignedSlot||i.parentNode||i.host||null;try{var b=i["__"+n];if(b!=null&&(!i.disabled||t.target===i))if(nn(b)){var[C,...y]=b;C.apply(i,[t,...y])}else b.call(i,t)}catch(k){h?v.push(k):h=k}if(t.cancelBubble||m===e||m===null)break;i=m}if(h){for(let k of v)queueMicrotask(()=>{throw k});throw h}}finally{t.__root=e,delete t.currentTarget,Ee(u),nt(p)}}}let it;function ju(){it=void 0}function Uu(t){let e=null,r=M;var n;if(M){for(e=q,it===void 0&&(it=rt(document.head));it!==null&&(it.nodeType!==kr||it.data!==Ra);)it=Qe(it);it===null?xe(!1):it=me(Qe(it))}M||(n=document.head.appendChild(Ft()));try{jt(()=>t(n),go)}finally{r&&(xe(!0),it=q,me(e))}}function ls(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function qt(t,e){var r=B;r.nodes_start===null&&(r.nodes_start=t,r.nodes_end=e)}function Tt(t,e){var r=(e&jc)!==0,n=(e&Uc)!==0,a,i=!t.startsWith("<!>");return()=>{if(M)return qt(q,null),q;a===void 0&&(a=ls(i?t:"<!>"+t),r||(a=rt(a)));var o=n||Do?document.importNode(a,!0):a.cloneNode(!0);if(r){var s=rt(o),c=o.lastChild;qt(s,c)}else qt(o,o);return o}}function gt(){if(M)return qt(q,null),q;var t=document.createDocumentFragment(),e=document.createComment(""),r=Ft();return t.append(e,r),qt(e,r),t}function ie(t,e){if(M){B.nodes_end=q,wt();return}t!==null&&t.before(e)}function qu(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const Vu=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Hu(t){return Vu.includes(t)}const Zu={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function Gu(t){return t=t.toLowerCase(),Zu[t]??t}const Wu=["touchstart","touchmove"];function Qu(t){return Wu.includes(t)}const Yu=["textarea","script","style","title"];function Ku(t){return Yu.includes(t)}function cs(t,e){var r=e==null?"":typeof e=="object"?e+"":e;r!==(t.__t??=t.nodeValue)&&(t.__t=r,t.nodeValue=r+"")}function us(t,e){return ds(t,e)}function Xu(t,e){Za(),e.intro=e.intro??!1;const r=e.target,n=M,a=q;try{for(var i=rt(r);i&&(i.nodeType!==kr||i.data!==Ra);)i=Qe(i);if(!i)throw fr;xe(!0),me(i),wt();const o=ds(t,{...e,anchor:i});if(q===null||q.nodeType!==kr||q.data!==Ia)throw sn(),fr;return xe(!1),o}catch(o){if(o===fr)return e.recover===!1&&au(),Za(),Fo(r),xe(!1),us(t,e);throw o}finally{xe(n),me(a),ju()}}const Br=new Map;function ds(t,{target:e,anchor:r,props:n={},events:a,context:i,intro:o=!0}){Za();var s=new Set,c=p=>{for(var h=0;h<p.length;h++){var v=p[h];if(!s.has(v)){s.add(v);var m=Qu(v);e.addEventListener(v,hn,{passive:m});var b=Br.get(v);b===void 0?(document.addEventListener(v,hn,{passive:m}),Br.set(v,1)):Br.set(v,b+1)}}};c(La(is)),Qa.add(c);var l=void 0,u=Ou(()=>{var p=r??e.appendChild(Ft());return he(()=>{if(i){Pr({});var h=Ie;h.c=i}a&&(n.$$events=a),M&&qt(p,null),l=t(p,n)||{},M&&(B.nodes_end=q),i&&Nr()}),()=>{for(var h of s){e.removeEventListener(h,hn);var v=Br.get(h);--v===0?(document.removeEventListener(h,hn),Br.delete(h)):Br.set(h,v)}Qa.delete(c),p!==r&&p.parentNode?.removeChild(p)}});return Ya.set(l,u),l}let Ya=new WeakMap;function Ju(t,e){const r=Ya.get(t);return r?(Ya.delete(t),r(e)):Promise.resolve()}function hs(t,e,...r){var n=t,a=pr,i;jt(()=>{a!==(a=e())&&(i&&(ve(i),i=null),i=he(()=>a(n,...r)))},Mr),M&&(n=q)}function ed(t){Ie===null&&bo(),Uo(()=>{const e=pt(t);if(typeof e=="function")return e})}function td(t){Ie===null&&bo(),ed(()=>()=>pt(t))}const Ka=0,Yn=1,Xa=2;function fs(t,e,r,n,a){M&&wt();var i=t,o=Ie,s=de,c,l,u,p=zt(void 0),h=zt(void 0),v=!1;function m(C,y){v=!0,y&&(nt(b),Ee(b),er(o));try{C===Ka&&r&&(c?zr(c):c=he(()=>r(i))),C===Yn&&n&&(l?zr(l):l=he(()=>n(i,p))),C!==Ka&&c&&St(c,()=>c=null),C!==Yn&&l&&St(l,()=>l=null),C!==Xa&&u&&St(u,()=>u=null)}finally{y&&(er(null),Ee(null),nt(null),ee())}}var b=jt(()=>{if(s===(s=e()))return;let C=M&&ho(s)===(i.data===Nn);if(C&&(i=ln(),me(i),xe(!1),C=!0),ho(s)){var y=s;v=!1,y.then(k=>{y===s&&(rr(p,k),m(Yn,!0))},k=>{if(y===s)throw rr(h,k),m(Xa,!0),h.v}),M?r&&(c=he(()=>r(i))):yr(()=>{v||m(Ka,!0)})}else rr(p,s),m(Yn,!1);return C&&xe(!0),()=>s=de});M&&(i=q)}function ir(t,e,r=!1){M&&wt();var n=t,a=null,i=null,o=de,s=r?Mr:0,c=!1;const l=(v,m=!0)=>{c=!0,h(m,v)};var u=null;function p(){u!==null&&(u.lastChild.remove(),n.before(u),u=null);var v=o?a:i,m=o?i:a;v&&zr(v),m&&St(m,()=>{o?i=null:a=null})}const h=(v,m)=>{if(o===(o=v))return;let b=!1;if(M){const R=yo(n)===Nn;!!o===R&&(n=ln(),me(n),xe(!1),b=!0)}var C=Bo(),y=n;if(C&&(u=document.createDocumentFragment(),u.append(y=Ft())),o?a??=m&&he(()=>m(y)):i??=m&&he(()=>m(y)),C){var k=qe,w=o?a:i,T=o?i:a;w&&k.skipped_effects.delete(w),T&&k.skipped_effects.add(T),k.add_callback(p)}else p();b&&xe(!0)};jt(()=>{c=!1,e(l),c||h(null,null)},s),M&&(n=q)}function rd(t,e){return e}function nd(t,e,r){for(var n=t.items,a=[],i=e.length,o=0;o<i;o++)Wa(e[o].e,a,!0);var s=i>0&&a.length===0&&r!==null;if(s){var c=r.parentNode;Fo(c),c.append(r),n.clear(),Et(t,e[0].prev,e[i-1].next)}Wo(a,()=>{for(var l=0;l<i;l++){var u=e[l];s||(n.delete(u.k),Et(t,u.prev,u.next)),ve(u.e,!s)}})}function ad(t,e,r,n,a,i=null){var o=t,s={flags:e,items:new Map,first:null};M&&wt();var c=null,l=!1,u=new Map,p=Co(()=>{var b=r();return nn(b)?b:b==null?[]:La(b)}),h,v;function m(){id(v,h,s,u,o,a,e,n,r),i!==null&&(h.length===0?c?zr(c):c=he(()=>i(o)):c!==null&&St(c,()=>{c=null}))}jt(()=>{v??=B,h=_(p);var b=h.length;if(l&&b===0)return;l=b===0;let C=!1;if(M){var y=yo(o)===Nn;y!==(b===0)&&(o=ln(),me(o),xe(!1),C=!0)}if(M){for(var k=null,w,T=0;T<b;T++){if(q.nodeType===kr&&q.data===Ia){o=q,C=!0,xe(!1);break}var R=h[T],U=n(R,T);w=Ja(q,s,k,null,R,U,T,a,e,r),s.items.set(U,w),k=w}b>0&&me(ln())}if(M)b===0&&i&&(c=he(()=>i(o)));else if(Bo()){var Q=new Set,Fe=qe;for(T=0;T<b;T+=1){R=h[T],U=n(R,T);var le=s.items.get(U)??u.get(U);le?ps(le,R,T):(w=Ja(null,s,null,null,R,U,T,a,e,r,!0),u.set(U,w)),Q.add(U)}for(const[ur,ne]of s.items)Q.has(ur)||Fe.skipped_effects.add(ne.e);Fe.add_callback(m)}else m();C&&xe(!0),_(p)}),M&&(o=q)}function id(t,e,r,n,a,i,o,s,c){var l=e.length,u=r.items,p=r.first,h=p,v,m=null,b=[],C=[],y,k,w,T;for(T=0;T<l;T+=1){if(y=e[T],k=s(y,T),w=u.get(k),w===void 0){var R=n.get(k);if(R!==void 0){n.delete(k),u.set(k,R);var U=m?m.next:h;Et(r,m,R),Et(r,R,U),ei(R,U,a),m=R}else{var Q=h?h.e.nodes_start:a;m=Ja(Q,r,m,m===null?r.first:m.next,y,k,T,i,o,c)}u.set(k,m),b=[],C=[],h=m.next;continue}if(ps(w,y,T),(w.e.f&ht)!==0&&zr(w.e),w!==h){if(v!==void 0&&v.has(w)){if(b.length<C.length){var Fe=C[0],le;m=Fe.prev;var ur=b[0],ne=b[b.length-1];for(le=0;le<b.length;le+=1)ei(b[le],Fe,a);for(le=0;le<C.length;le+=1)v.delete(C[le]);Et(r,ur.prev,ne.next),Et(r,m,ur),Et(r,ne,Fe),h=Fe,m=ne,T-=1,b=[],C=[]}else v.delete(w),ei(w,h,a),Et(r,w.prev,w.next),Et(r,w,m===null?r.first:m.next),Et(r,m,w),m=w;continue}for(b=[],C=[];h!==null&&h.k!==k;)(h.e.f&ht)===0&&(v??=new Set).add(h),C.push(h),h=h.next;if(h===null)continue;w=h}b.push(w),m=w,h=w.next}if(h!==null||v!==void 0){for(var Qt=v===void 0?[]:La(v);h!==null;)(h.e.f&ht)===0&&Qt.push(h),h=h.next;var dr=Qt.length;if(dr>0){var hr=null;nd(r,Qt,hr)}}t.first=r.first&&r.first.e,t.last=m&&m.e;for(var Xr of n.values())ve(Xr.e);n.clear()}function ps(t,e,r,n){rr(t.v,e),t.i=r}function Ja(t,e,r,n,a,i,o,s,c,l,u){var p=(c&Pc)!==0,h=(c&Dc)===0,v=p?h?Mo(a,!1,!1):zt(a):a,m=(c&Nc)===0?o:zt(o),b={i:m,v,k:i,a:null,e:null,prev:r,next:n};try{if(t===null){var C=document.createDocumentFragment();C.append(t=Ft())}return b.e=he(()=>s(t,v,m,l),M),b.e.prev=r&&r.e,b.e.next=n&&n.e,r===null?u||(e.first=b):(r.next=b,r.e.next=b.e),n!==null&&(n.prev=b,n.e.prev=b.e),b}finally{}}function ei(t,e,r){for(var n=t.next?t.next.e.nodes_start:r,a=e?e.e.nodes_start:r,i=t.e.nodes_start;i!==null&&i!==n;){var o=Qe(i);a.before(i),i=o}}function Et(t,e,r){e===null?t.first=r:(e.next=r,e.e.next=r&&r.e),r!==null&&(r.prev=e,r.e.prev=e&&e.e)}function ti(t,e,r=!1,n=!1,a=!1){var i=t,o="";Zn(()=>{var s=B;if(o===(o=e()??"")){M&&wt();return}if(s.nodes_start!==null&&(Zo(s.nodes_start,s.nodes_end),s.nodes_start=s.nodes_end=null),o!==""){if(M){q.data;for(var c=wt(),l=c;c!==null&&(c.nodeType!==kr||c.data!=="");)l=c,c=Qe(c);if(c===null)throw sn(),fr;qt(q,l),i=me(c);return}var u=o+"";r?u=`<svg>${u}</svg>`:n&&(u=`<math>${u}</math>`);var p=ls(u);if((r||n)&&(p=rt(p)),qt(rt(p),p.lastChild),r||n)for(;rt(p);)i.before(rt(p));else i.before(p)}})}function gs(t,e,r,n,a,i){let o=M;M&&wt();var s,c,l=null;M&&q.nodeType===Kc&&(l=q,wt());var u=M?q:t,p;jt(()=>{const h=e()||null;var v=h==="svg"?Vc:null;h!==s&&(p&&(h===null?St(p,()=>{p=null,c=null}):h===c?zr(p):ve(p)),h&&h!==c&&(p=he(()=>{if(l=M?l:v?document.createElementNS(v,h):document.createElement(h),qt(l,l),n){M&&Ku(h)&&l.append(document.createComment(""));var m=M?rt(l):l.appendChild(Ft());M&&(m===null?xe(!1):me(m)),n(l,m)}B.nodes_end=l,u.before(l)})),s=h,s&&(c=s))},Mr),o&&(xe(!0),me(u))}function od(t,e){yr(()=>{var r=t.getRootNode(),n=r.host?r:r.head??r.ownerDocument.head;if(!n.querySelector("#"+e.hash)){const a=document.createElement("style");a.id=e.hash,a.textContent=e.code,n.appendChild(a)}})}function ms(t,e,r){Hn(()=>{var n=pt(()=>e(t,r?.())||{});if(n?.destroy)return()=>n.destroy()})}function sd(t,e){var r=void 0,n;jt(()=>{r!==(r=e())&&(n&&(ve(n),n=null),r&&(n=he(()=>{Hn(()=>r(t))})))})}function vs(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(r=vs(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function ld(){for(var t,e,r=0,n="",a=arguments.length;r<a;r++)(t=arguments[r])&&(e=vs(t))&&(n&&(n+=" "),n+=e);return n}function cd(t){return typeof t=="object"?ld(t):t??""}const bs=[...`
|
|
2
|
+
\r\f \v\uFEFF`];function ud(t,e,r){var n=t==null?"":""+t;if(r){for(var a in r)if(r[a])n=n?n+" "+a:a;else if(n.length)for(var i=a.length,o=0;(o=n.indexOf(a,o))>=0;){var s=o+i;(o===0||bs.includes(n[o-1]))&&(s===n.length||bs.includes(n[s]))?n=(o===0?"":n.substring(0,o))+n.substring(s+1):o=s}}return n===""?null:n}function ks(t,e=!1){var r=e?" !important;":";",n="";for(var a in t){var i=t[a];i!=null&&i!==""&&(n+=" "+a+": "+i+r)}return n}function ri(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function dd(t,e){if(e){var r="",n,a;if(Array.isArray(e)?(n=e[0],a=e[1]):n=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var i=!1,o=0,s=!1,c=[];n&&c.push(...Object.keys(n).map(ri)),a&&c.push(...Object.keys(a).map(ri));var l=0,u=-1;const b=t.length;for(var p=0;p<b;p++){var h=t[p];if(s?h==="/"&&t[p-1]==="*"&&(s=!1):i?i===h&&(i=!1):h==="/"&&t[p+1]==="*"?s=!0:h==='"'||h==="'"?i=h:h==="("?o++:h===")"&&o--,!s&&i===!1&&o===0){if(h===":"&&u===-1)u=p;else if(h===";"||p===b-1){if(u!==-1){var v=ri(t.substring(l,u).trim());if(!c.includes(v)){h!==";"&&p++;var m=t.substring(l,p).trim();r+=" "+m+";"}}l=p+1,u=-1}}}}return n&&(r+=ks(n)),a&&(r+=ks(a,!0)),r=r.trim(),r===""?null:r}return t==null?null:String(t)}function hd(t,e,r,n,a,i){var o=t.__className;if(M||o!==r||o===void 0){var s=ud(r,n,i);(!M||s!==t.getAttribute("class"))&&(s==null?t.removeAttribute("class"):e?t.className=s:t.setAttribute("class",s)),t.__className=r}else if(i&&a!==i)for(var c in i){var l=!!i[c];(a==null||l!==!!a[c])&&t.classList.toggle(c,l)}return i}function ni(t,e={},r,n){for(var a in r){var i=r[a];e[a]!==i&&(r[a]==null?t.style.removeProperty(a):t.style.setProperty(a,i,n))}}function fd(t,e,r,n){var a=t.__style;if(M||a!==e){var i=dd(e,n);(!M||i!==t.getAttribute("style"))&&(i==null?t.removeAttribute("style"):t.style.cssText=i),t.__style=e}else n&&(Array.isArray(n)?(ni(t,r?.[0],n[0]),ni(t,r?.[1],n[1],"important")):ni(t,r,n));return n}function ai(t,e,r=!1){if(t.multiple){if(e==null)return;if(!nn(e))return cu();for(var n of t.options)n.selected=e.includes(ys(n));return}for(n of t.options){var a=ys(n);if(Cu(a,e)){n.selected=!0;return}}(!r||e!==void 0)&&(t.selectedIndex=-1)}function pd(t){var e=new MutationObserver(()=>{ai(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),jo(()=>{e.disconnect()})}function ys(t){return"__value"in t?t.__value:t.value}const jr=Symbol("class"),fn=Symbol("style"),ws=Symbol("is custom element"),_s=Symbol("is html");function gd(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function ii(t,e,r,n){var a=Ss(t);M&&(a[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")||a[e]!==(a[e]=r)&&(e==="loading"&&(t[Yc]=r),r==null?t.removeAttribute(e):typeof r!="string"&&Es(t).includes(e)?t[e]=r:t.setAttribute(e,r))}function md(t,e,r,n,a=!1){var i=Ss(t),o=i[ws],s=!i[_s];let c=M&&o;c&&xe(!1);var l=e||{},u=t.tagName==="OPTION";for(var p in e)p in r||(r[p]=null);r.class?r.class=cd(r.class):r[jr]&&(r.class=null),r[fn]&&(r.style??=null);var h=Es(t);for(const w in r){let T=r[w];if(u&&w==="value"&&T==null){t.value=t.__value="",l[w]=T;continue}if(w==="class"){var v=t.namespaceURI==="http://www.w3.org/1999/xhtml";hd(t,v,T,n,e?.[jr],r[jr]),l[w]=T,l[jr]=r[jr];continue}if(w==="style"){fd(t,T,e?.[fn],r[fn]),l[w]=T,l[fn]=r[fn];continue}var m=l[w];if(!(T===m&&!(T===void 0&&t.hasAttribute(w)))){l[w]=T;var b=w[0]+w[1];if(b!=="$$")if(b==="on"){const R={},U="$$"+w;let Q=w.slice(2);var C=Hu(Q);if(qu(Q)&&(Q=Q.slice(0,-7),R.capture=!0),!C&&m){if(T!=null)continue;t.removeEventListener(Q,l[U],R),l[U]=null}if(T!=null)if(C)t[`__${Q}`]=T,ss([Q]);else{let Fe=function(le){l[w].call(this,le)};l[U]=os(Q,t,Fe,R)}else C&&(t[`__${Q}`]=void 0)}else if(w==="style")ii(t,w,T);else if(w==="autofocus")zu(t,!!T);else if(!o&&(w==="__value"||w==="value"&&T!=null))t.value=t.__value=T;else if(w==="selected"&&u)gd(t,T);else{var y=w;s||(y=Gu(y));var k=y==="defaultValue"||y==="defaultChecked";if(T==null&&!o&&!k)if(i[w]=null,y==="value"||y==="checked"){let R=t;const U=e===void 0;if(y==="value"){let Q=R.defaultValue;R.removeAttribute(y),R.defaultValue=Q,R.value=R.__value=U?Q:null}else{let Q=R.defaultChecked;R.removeAttribute(y),R.defaultChecked=Q,R.checked=U?Q:!1}}else t.removeAttribute(w);else k||h.includes(y)&&(o||typeof T!="string")?t[y]=T:typeof T!="function"&&ii(t,y,T)}}}return c&&xe(!0),l}function xs(t,e,r=[],n=[],a,i=!1){Io(r,n,o=>{var s=void 0,c={},l=t.nodeName==="SELECT",u=!1;if(jt(()=>{var h=e(...o.map(_)),v=md(t,s,h,a,i);u&&l&&"value"in h&&ai(t,h.value);for(let b of Object.getOwnPropertySymbols(c))h[b]||ve(c[b]);for(let b of Object.getOwnPropertySymbols(h)){var m=h[b];b.description===Hc&&(!s||m!==s[b])&&(c[b]&&ve(c[b]),c[b]=he(()=>sd(t,()=>m))),v[b]=m}s=v}),l){var p=t;Hn(()=>{ai(p,s.value,!0),pd(p)})}u=!0})}function Ss(t){return t.__attributes??={[ws]:t.nodeName.includes("-"),[_s]:t.namespaceURI===qc}}var Ts=new Map;function Es(t){var e=Ts.get(t.nodeName);if(e)return e;Ts.set(t.nodeName,e=[]);for(var r,n=t,a=Element.prototype;a!==n;){r=Gc(n);for(var i in r)r[i].set&&e.push(i);n=Oa(n)}return e}function Cs(t,e){return t===e||t?.[Jt]===e}function As(t={},e,r,n){return Hn(()=>{var a,i;return Ga(()=>{a=i,i=[],pt(()=>{t!==r(...i)&&(e(t,...i),a&&Cs(r(...a),t)&&e(null,...a))})}),()=>{yr(()=>{i&&Cs(r(...i),t)&&e(null,...i)})}}),t}const Ur=[];function vd(t,e=pr){let r=null;const n=new Set;function a(s){if(_o(t,s)&&(t=s,r)){const c=!Ur.length;for(const l of n)l[1](),Ur.push(l,t);if(c){for(let l=0;l<Ur.length;l+=2)Ur[l][0](Ur[l+1]);Ur.length=0}}}function i(s){a(s(t))}function o(s,c=pr){const l=[s,c];return n.add(l),n.size===1&&(r=e(a,i)||pr),s(t),()=>{n.delete(l),n.size===0&&r&&(r(),r=null)}}return{set:a,update:i,subscribe:o}}let Kn=!1;function bd(t){var e=Kn;try{return Kn=!1,[t(),Kn]}finally{Kn=e}}const kd={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return!1},getOwnPropertyDescriptor(t,e){if(!t.exclude.includes(e)&&e in t.props)return{enumerable:!0,configurable:!0,value:t.props[e]}},has(t,e){return t.exclude.includes(e)?!1:e in t.props},ownKeys(t){return Reflect.ownKeys(t.props).filter(e=>!t.exclude.includes(e))}};function oi(t,e,r){return new Proxy({props:t,exclude:e},kd)}const yd={get(t,e){let r=t.props.length;for(;r--;){let n=t.props[r];if(an(n)&&(n=n()),typeof n=="object"&&n!==null&&e in n)return n[e]}},set(t,e,r){let n=t.props.length;for(;n--;){let a=t.props[n];an(a)&&(a=a());const i=Nt(a,e);if(i&&i.set)return i.set(r),!0}return!1},getOwnPropertyDescriptor(t,e){let r=t.props.length;for(;r--;){let n=t.props[r];if(an(n)&&(n=n()),typeof n=="object"&&n!==null&&e in n){const a=Nt(n,e);return a&&!a.configurable&&(a.configurable=!0),a}}},has(t,e){if(e===Jt||e===Fa)return!1;for(let r of t.props)if(an(r)&&(r=r()),r!=null&&e in r)return!0;return!1},ownKeys(t){const e=[];for(let r of t.props)if(an(r)&&(r=r()),!!r){for(const n in r)e.includes(n)||e.push(n);for(const n of Object.getOwnPropertySymbols(r))e.includes(n)||e.push(n)}return e}};function wd(...t){return new Proxy({props:t},yd)}function oe(t,e,r,n){var a=(r&Fc)!==0,i=(r&Bc)!==0,o=n,s=!0,c=()=>(s&&(s=!1,o=i?pt(n):n),o),l;if(a){var u=Jt in t||Fa in t;l=Nt(t,e)?.set??(u&&e in t?k=>t[e]=k:void 0)}var p,h=!1;a?[p,h]=bd(()=>t[e]):p=t[e],p===void 0&&n!==void 0&&(p=c(),l&&(iu(),l(p)));var v;if(v=()=>{var k=t[e];return k===void 0?c():(s=!0,k)},(r&zc)===0)return v;if(l){var m=t.$$legacy;return function(k,w){return arguments.length>0?((!w||m||h)&&l(w?v():k),k):v()}}var b=!1,C=((r&$c)!==0?jn:Co)(()=>(b=!1,v()));a&&_(C);var y=B;return function(k,w){if(arguments.length>0){const T=w?_(C):a?_t(k):k;return P(C,T),b=!0,o!==void 0&&(o=T),k}return xr&&b||(y.f&vr)!==0?C.v:_(C)}}function _d(t){return new xd(t)}class xd{#e;#t;constructor(e){var r=new Map,n=(i,o)=>{var s=Mo(o,!1,!1);return r.set(i,s),s};const a=new Proxy({...e.props||{},$$events:{}},{get(i,o){return _(r.get(o)??n(o,Reflect.get(i,o)))},has(i,o){return o===Fa?!0:(_(r.get(o)??n(o,Reflect.get(i,o))),Reflect.has(i,o))},set(i,o,s){return P(r.get(o)??n(o,s),s),Reflect.set(i,o,s)}});this.#t=(e.hydrate?Xu:us)(e.component,{target:e.target,anchor:e.anchor,props:a,context:e.context,intro:e.intro??!1,recover:e.recover}),(!e?.props?.$$host||e.sync===!1)&&ee(),this.#e=a.$$events;for(const i of Object.keys(this.#t))i==="$set"||i==="$destroy"||i==="$on"||Or(this,i,{get(){return this.#t[i]},set(o){this.#t[i]=o},enumerable:!0});this.#t.$set=i=>{Object.assign(a,i)},this.#t.$destroy=()=>{Ju(this.#t)}}$set(e){this.#t.$set(e)}$on(e,r){this.#e[e]=this.#e[e]||[];const n=(...a)=>r.call(this,...a);return this.#e[e].push(n),()=>{this.#e[e]=this.#e[e].filter(a=>a!==n)}}$destroy(){this.#t.$destroy()}}let Rs;typeof HTMLElement=="function"&&(Rs=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;constructor(t,e,r){super(),this.$$ctor=t,this.$$s=e,r&&this.attachShadow({mode:"open"})}addEventListener(t,e,r){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){const n=this.$$c.$on(t,e);this.$$l_u.set(e,n)}super.addEventListener(t,e,r)}removeEventListener(t,e,r){if(super.removeEventListener(t,e,r),this.$$c){const n=this.$$l_u.get(e);n&&(n(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(n){return a=>{const i=document.createElement("slot");n!=="default"&&(i.name=n),ie(a,i)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const e={},r=Sd(this);for(const n of this.$$s)n in r&&(n==="default"&&!this.$$d.children?(this.$$d.children=t(n),e.default=!0):e[n]=t(n));for(const n of this.attributes){const a=this.$$g_p(n.name);a in this.$$d||(this.$$d[a]=Xn(a,n.value,this.$$p_d,"toProp"))}for(const n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=_d({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:e,$$host:this}}),this.$$me=Lu(()=>{Ga(()=>{this.$$r=!0;for(const n of Dn(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];const a=Xn(n,this.$$d[n],this.$$p_d,"toAttribute");a==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,a)}this.$$r=!1})});for(const n in this.$$l)for(const a of this.$$l[n]){const i=this.$$c.$on(n,a);this.$$l_u.set(a,i)}this.$$l={}}}attributeChangedCallback(t,e,r){this.$$r||(t=this.$$g_p(t),this.$$d[t]=Xn(t,r,this.$$p_d,"toProp"),this.$$c?.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return Dn(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});function Xn(t,e,r,n){const a=r[t]?.type;if(e=a==="Boolean"&&typeof e!="boolean"?e!=null:e,!n||!r[t])return e;if(n==="toAttribute")switch(a){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(a){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function Sd(t){const e={};return t.childNodes.forEach(r=>{e[r.slot||"default"]=!0}),e}function pn(t,e,r,n,a,i){let o=class extends Rs{constructor(){super(t,r,a),this.$$p_d=e}static get observedAttributes(){return Dn(e).map(s=>(e[s].attribute||s).toLowerCase())}};return Dn(e).forEach(s=>{Or(o.prototype,s,{get(){return this.$$c&&s in this.$$c?this.$$c[s]:this.$$d[s]},set(c){c=Xn(s,c,e),this.$$d[s]=c;var l=this.$$c;if(l){var u=Nt(l,s)?.get;u?l[s]=c:l.$set({[s]:c})}}})}),n.forEach(s=>{Or(o.prototype,s,{get(){return this.$$c?.[s]}})}),t.element=o,o}var Td=(t,e)=>e()(),Ed=Tt('<div class="chat-app__container"><div class="error-message svelte-4thrqu">Server is unreachable, please try later... <button class="error-message__retry-button svelte-4thrqu">Retry</button></div></div>'),Cd=Tt(" <!>",1);const Ad={hash:"svelte-4thrqu",code:`
|
|
3
3
|
/* These styles are inline, because at this point theme loading has failed. */.error-message.svelte-4thrqu {display:table;z-index:1000;width:auto;margin:2rem auto;padding:2rem;border-radius:2px;background:white;color:oklch(27.8% 0.033 256.848);font-family:-apple-system,
|
|
4
4
|
BlinkMacSystemFont,
|
|
5
5
|
avenir next,
|
|
@@ -12,9 +12,9 @@ var LiipGPTButton=function(rn){"use strict";const Mc="5";typeof window<"u"&&((wi
|
|
|
12
12
|
roboto,
|
|
13
13
|
noto,
|
|
14
14
|
arial,
|
|
15
|
-
sans-serif;}.error-message__retry-button.svelte-4thrqu {border:none;outline:none;background:none;font-size:1rem;text-decoration:underline;&:active {outline:none;}}`};function Is(t,e){Pr(e,!0),od(t,Ad);const r=(l,u=pr,p=pr)=>{ko();var h=Cd(),v=Le(h),m=nr(v);{var b=y=>{},C=y=>{var k=Ed(),w=
|
|
16
|
-
`,u())??""]),ie(l,h)};let n=oe(e,"body",7),a=oe(e,"silent",7),i=J(void 0);const o=l=>{P(i,{error:l},!0)};var s=gt(),c=Le(s);return ku(c,{get failed(){return r}},l=>{var u=gt(),p=Le(u);{var h=m=>{r(m,()=>_(i).error,()=>()=>{P(i,void 0)})},v=m=>{var b=gt(),C=Le(b);hs(C,n,()=>o),ie(m,b)};ir(p,m=>{_(i)?m(h):m(v,!1)})}ie(l,u)}),ie(t,s),Nr({get body(){return n()},set body(l){n(l),ee()},get silent(){return a()},set silent(l){a(l),ee()}})}ss(["click"]),pn(Is,{body:{},silent:{}},[],[],!0);/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:Ls,setPrototypeOf:Os,isFrozen:Rd,getPrototypeOf:Id,getOwnPropertyDescriptor:Ld}=Object;let{freeze:Me,seal:ot,create:Ms}=Object,{apply:si,construct:li}=typeof Reflect<"u"&&Reflect;Me||(Me=function(e){return e}),ot||(ot=function(e){return e}),si||(si=function(e,r,n){return e.apply(r,n)}),li||(li=function(e,r){return new e(...r)});const Jn=Ne(Array.prototype.forEach),Od=Ne(Array.prototype.lastIndexOf),Ps=Ne(Array.prototype.pop),gn=Ne(Array.prototype.push),Md=Ne(Array.prototype.splice),ea=Ne(String.prototype.toLowerCase),ci=Ne(String.prototype.toString),Ns=Ne(String.prototype.match),mn=Ne(String.prototype.replace),Pd=Ne(String.prototype.indexOf),Nd=Ne(String.prototype.trim),mt=Ne(Object.prototype.hasOwnProperty),Pe=Ne(RegExp.prototype.test),vn=Dd(TypeError);function Ne(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];return si(t,e,n)}}function Dd(t){return function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return li(t,r)}}function V(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ea;Os&&Os(t,null);let n=e.length;for(;n--;){let a=e[n];if(typeof a=="string"){const i=r(a);i!==a&&(Rd(e)||(e[n]=i),a=i)}t[a]=!0}return t}function $d(t){for(let e=0;e<t.length;e++)mt(t,e)||(t[e]=null);return t}function Vt(t){const e=Ms(null);for(const[r,n]of Ls(t))mt(t,r)&&(Array.isArray(n)?e[r]=$d(n):n&&typeof n=="object"&&n.constructor===Object?e[r]=Vt(n):e[r]=n);return e}function bn(t,e){for(;t!==null;){const n=Ld(t,e);if(n){if(n.get)return Ne(n.get);if(typeof n.value=="function")return Ne(n.value)}t=Id(t)}function r(){return null}return r}const Ds=Me(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ui=Me(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),di=Me(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),zd=Me(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),hi=Me(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Fd=Me(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),$s=Me(["#text"]),zs=Me(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),fi=Me(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Fs=Me(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ta=Me(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),jd=ot(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Bd=ot(/<%[\w\W]*|[\w\W]*%>/gm),Ud=ot(/\$\{[\w\W]*/gm),qd=ot(/^data-[\-\w.\u00B7-\uFFFF]+$/),Vd=ot(/^aria-[\-\w]+$/),js=ot(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Hd=ot(/^(?:\w+script|data):/i),Zd=ot(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Bs=ot(/^html$/i),Gd=ot(/^[a-z][.\w]*(-[.\w]+)+$/i);var Us=Object.freeze({__proto__:null,ARIA_ATTR:Vd,ATTR_WHITESPACE:Zd,CUSTOM_ELEMENT:Gd,DATA_ATTR:qd,DOCTYPE_NAME:Bs,ERB_EXPR:Bd,IS_ALLOWED_URI:js,IS_SCRIPT_OR_DATA:Hd,MUSTACHE_EXPR:jd,TMPLIT_EXPR:Ud});const kn={element:1,text:3,progressingInstruction:7,comment:8,document:9},Wd=function(){return typeof window>"u"?null:window},Qd=function(e,r){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const a="data-tt-policy-suffix";r&&r.hasAttribute(a)&&(n=r.getAttribute(a));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},qs=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Vs(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Wd();const e=O=>Vs(O);if(e.version="3.2.6",e.removed=[],!t||!t.document||t.document.nodeType!==kn.document||!t.Element)return e.isSupported=!1,e;let{document:r}=t;const n=r,a=n.currentScript,{DocumentFragment:i,HTMLTemplateElement:o,Node:s,Element:c,NodeFilter:l,NamedNodeMap:u=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:p,DOMParser:h,trustedTypes:v}=t,m=c.prototype,b=bn(m,"cloneNode"),C=bn(m,"remove"),y=bn(m,"nextSibling"),k=bn(m,"childNodes"),w=bn(m,"parentNode");if(typeof o=="function"){const O=r.createElement("template");O.content&&O.content.ownerDocument&&(r=O.content.ownerDocument)}let T,R="";const{implementation:U,createNodeIterator:Q,createDocumentFragment:Fe,getElementsByTagName:le}=r,{importNode:ur}=n;let ne=qs();e.isSupported=typeof Ls=="function"&&typeof w=="function"&&U&&U.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Qt,ERB_EXPR:dr,TMPLIT_EXPR:hr,DATA_ATTR:Xr,ARIA_ATTR:Ki,IS_SCRIPT_OR_DATA:Xi,ATTR_WHITESPACE:_a,CUSTOM_ELEMENT:Ji}=Us;let{IS_ALLOWED_URI:xa}=Us,ce=null;const In=V({},[...Ds,...ui,...di,...hi,...$s]);let fe=null;const F=V({},[...zs,...fi,...Fs,...ta]);let $=Object.seal(Ms(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),G=null,je=null,be=!0,se=!0,Be=!1,ke=!0,ye=!1,we=!0,ae=!1,Je=!1,Ue=!1,dt=!1,Yt=!1,It=!1,Ln=!0,Sa=!1;const eo="user-content-";let Jr=!0,Ir=!1,et={},Ve=null;const Lr=V({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ta=null;const Ea=V({},["audio","video","img","source","image","track"]);let On=null;const Lt=V({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),tt="http://www.w3.org/1998/Math/MathML",Ot="http://www.w3.org/2000/svg",yt="http://www.w3.org/1999/xhtml";let Mt=yt,to=!1,ro=null;const s0=V({},[tt,Ot,yt],ci);let Ca=V({},["mi","mo","mn","ms","mtext"]),Aa=V({},["annotation-xml"]);const l0=V({},["title","style","font","a","script"]);let Mn=null;const c0=["application/xhtml+xml","text/html"],u0="text/html";let _e=null,en=null;const d0=r.createElement("form"),wc=function(f){return f instanceof RegExp||f instanceof Function},no=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(en&&en===f)){if((!f||typeof f!="object")&&(f={}),f=Vt(f),Mn=c0.indexOf(f.PARSER_MEDIA_TYPE)===-1?u0:f.PARSER_MEDIA_TYPE,_e=Mn==="application/xhtml+xml"?ci:ea,ce=mt(f,"ALLOWED_TAGS")?V({},f.ALLOWED_TAGS,_e):In,fe=mt(f,"ALLOWED_ATTR")?V({},f.ALLOWED_ATTR,_e):F,ro=mt(f,"ALLOWED_NAMESPACES")?V({},f.ALLOWED_NAMESPACES,ci):s0,On=mt(f,"ADD_URI_SAFE_ATTR")?V(Vt(Lt),f.ADD_URI_SAFE_ATTR,_e):Lt,Ta=mt(f,"ADD_DATA_URI_TAGS")?V(Vt(Ea),f.ADD_DATA_URI_TAGS,_e):Ea,Ve=mt(f,"FORBID_CONTENTS")?V({},f.FORBID_CONTENTS,_e):Lr,G=mt(f,"FORBID_TAGS")?V({},f.FORBID_TAGS,_e):Vt({}),je=mt(f,"FORBID_ATTR")?V({},f.FORBID_ATTR,_e):Vt({}),et=mt(f,"USE_PROFILES")?f.USE_PROFILES:!1,be=f.ALLOW_ARIA_ATTR!==!1,se=f.ALLOW_DATA_ATTR!==!1,Be=f.ALLOW_UNKNOWN_PROTOCOLS||!1,ke=f.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ye=f.SAFE_FOR_TEMPLATES||!1,we=f.SAFE_FOR_XML!==!1,ae=f.WHOLE_DOCUMENT||!1,dt=f.RETURN_DOM||!1,Yt=f.RETURN_DOM_FRAGMENT||!1,It=f.RETURN_TRUSTED_TYPE||!1,Ue=f.FORCE_BODY||!1,Ln=f.SANITIZE_DOM!==!1,Sa=f.SANITIZE_NAMED_PROPS||!1,Jr=f.KEEP_CONTENT!==!1,Ir=f.IN_PLACE||!1,xa=f.ALLOWED_URI_REGEXP||js,Mt=f.NAMESPACE||yt,Ca=f.MATHML_TEXT_INTEGRATION_POINTS||Ca,Aa=f.HTML_INTEGRATION_POINTS||Aa,$=f.CUSTOM_ELEMENT_HANDLING||{},f.CUSTOM_ELEMENT_HANDLING&&wc(f.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&($.tagNameCheck=f.CUSTOM_ELEMENT_HANDLING.tagNameCheck),f.CUSTOM_ELEMENT_HANDLING&&wc(f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&($.attributeNameCheck=f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),f.CUSTOM_ELEMENT_HANDLING&&typeof f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&($.allowCustomizedBuiltInElements=f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ye&&(se=!1),Yt&&(dt=!0),et&&(ce=V({},$s),fe=[],et.html===!0&&(V(ce,Ds),V(fe,zs)),et.svg===!0&&(V(ce,ui),V(fe,fi),V(fe,ta)),et.svgFilters===!0&&(V(ce,di),V(fe,fi),V(fe,ta)),et.mathMl===!0&&(V(ce,hi),V(fe,Fs),V(fe,ta))),f.ADD_TAGS&&(ce===In&&(ce=Vt(ce)),V(ce,f.ADD_TAGS,_e)),f.ADD_ATTR&&(fe===F&&(fe=Vt(fe)),V(fe,f.ADD_ATTR,_e)),f.ADD_URI_SAFE_ATTR&&V(On,f.ADD_URI_SAFE_ATTR,_e),f.FORBID_CONTENTS&&(Ve===Lr&&(Ve=Vt(Ve)),V(Ve,f.FORBID_CONTENTS,_e)),Jr&&(ce["#text"]=!0),ae&&V(ce,["html","head","body"]),ce.table&&(V(ce,["tbody"]),delete G.tbody),f.TRUSTED_TYPES_POLICY){if(typeof f.TRUSTED_TYPES_POLICY.createHTML!="function")throw vn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof f.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw vn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=f.TRUSTED_TYPES_POLICY,R=T.createHTML("")}else T===void 0&&(T=Qd(v,a)),T!==null&&typeof R=="string"&&(R=T.createHTML(""));Me&&Me(f),en=f}},_c=V({},[...ui,...di,...zd]),xc=V({},[...hi,...Fd]),h0=function(f){let S=w(f);(!S||!S.tagName)&&(S={namespaceURI:Mt,tagName:"template"});const L=ea(f.tagName),te=ea(S.tagName);return ro[f.namespaceURI]?f.namespaceURI===Ot?S.namespaceURI===yt?L==="svg":S.namespaceURI===tt?L==="svg"&&(te==="annotation-xml"||Ca[te]):!!_c[L]:f.namespaceURI===tt?S.namespaceURI===yt?L==="math":S.namespaceURI===Ot?L==="math"&&Aa[te]:!!xc[L]:f.namespaceURI===yt?S.namespaceURI===Ot&&!Aa[te]||S.namespaceURI===tt&&!Ca[te]?!1:!xc[L]&&(l0[L]||!_c[L]):!!(Mn==="application/xhtml+xml"&&ro[f.namespaceURI]):!1},Pt=function(f){gn(e.removed,{element:f});try{w(f).removeChild(f)}catch{C(f)}},tn=function(f,S){try{gn(e.removed,{attribute:S.getAttributeNode(f),from:S})}catch{gn(e.removed,{attribute:null,from:S})}if(S.removeAttribute(f),f==="is")if(dt||Yt)try{Pt(S)}catch{}else try{S.setAttribute(f,"")}catch{}},Sc=function(f){let S=null,L=null;if(Ue)f="<remove></remove>"+f;else{const pe=Ns(f,/^[\r\n\t ]+/);L=pe&&pe[0]}Mn==="application/xhtml+xml"&&Mt===yt&&(f='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+f+"</body></html>");const te=T?T.createHTML(f):f;if(Mt===yt)try{S=new h().parseFromString(te,Mn)}catch{}if(!S||!S.documentElement){S=U.createDocument(Mt,"template",null);try{S.documentElement.innerHTML=to?R:te}catch{}}const Ae=S.body||S.documentElement;return f&&L&&Ae.insertBefore(r.createTextNode(L),Ae.childNodes[0]||null),Mt===yt?le.call(S,ae?"html":"body")[0]:ae?S.documentElement:Ae},Tc=function(f){return Q.call(f.ownerDocument||f,f,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},ao=function(f){return f instanceof p&&(typeof f.nodeName!="string"||typeof f.textContent!="string"||typeof f.removeChild!="function"||!(f.attributes instanceof u)||typeof f.removeAttribute!="function"||typeof f.setAttribute!="function"||typeof f.namespaceURI!="string"||typeof f.insertBefore!="function"||typeof f.hasChildNodes!="function")},Ec=function(f){return typeof s=="function"&&f instanceof s};function Kt(O,f,S){Jn(O,L=>{L.call(e,f,S,en)})}const Cc=function(f){let S=null;if(Kt(ne.beforeSanitizeElements,f,null),ao(f))return Pt(f),!0;const L=_e(f.nodeName);if(Kt(ne.uponSanitizeElement,f,{tagName:L,allowedTags:ce}),we&&f.hasChildNodes()&&!Ec(f.firstElementChild)&&Pe(/<[/\w!]/g,f.innerHTML)&&Pe(/<[/\w!]/g,f.textContent)||f.nodeType===kn.progressingInstruction||we&&f.nodeType===kn.comment&&Pe(/<[/\w]/g,f.data))return Pt(f),!0;if(!ce[L]||G[L]){if(!G[L]&&Rc(L)&&($.tagNameCheck instanceof RegExp&&Pe($.tagNameCheck,L)||$.tagNameCheck instanceof Function&&$.tagNameCheck(L)))return!1;if(Jr&&!Ve[L]){const te=w(f)||f.parentNode,Ae=k(f)||f.childNodes;if(Ae&&te){const pe=Ae.length;for(let He=pe-1;He>=0;--He){const Xt=b(Ae[He],!0);Xt.__removalCount=(f.__removalCount||0)+1,te.insertBefore(Xt,y(f))}}}return Pt(f),!0}return f instanceof c&&!h0(f)||(L==="noscript"||L==="noembed"||L==="noframes")&&Pe(/<\/no(script|embed|frames)/i,f.innerHTML)?(Pt(f),!0):(ye&&f.nodeType===kn.text&&(S=f.textContent,Jn([Qt,dr,hr],te=>{S=mn(S,te," ")}),f.textContent!==S&&(gn(e.removed,{element:f.cloneNode()}),f.textContent=S)),Kt(ne.afterSanitizeElements,f,null),!1)},Ac=function(f,S,L){if(Ln&&(S==="id"||S==="name")&&(L in r||L in d0))return!1;if(!(se&&!je[S]&&Pe(Xr,S))){if(!(be&&Pe(Ki,S))){if(!fe[S]||je[S]){if(!(Rc(f)&&($.tagNameCheck instanceof RegExp&&Pe($.tagNameCheck,f)||$.tagNameCheck instanceof Function&&$.tagNameCheck(f))&&($.attributeNameCheck instanceof RegExp&&Pe($.attributeNameCheck,S)||$.attributeNameCheck instanceof Function&&$.attributeNameCheck(S))||S==="is"&&$.allowCustomizedBuiltInElements&&($.tagNameCheck instanceof RegExp&&Pe($.tagNameCheck,L)||$.tagNameCheck instanceof Function&&$.tagNameCheck(L))))return!1}else if(!On[S]){if(!Pe(xa,mn(L,_a,""))){if(!((S==="src"||S==="xlink:href"||S==="href")&&f!=="script"&&Pd(L,"data:")===0&&Ta[f])){if(!(Be&&!Pe(Xi,mn(L,_a,"")))){if(L)return!1}}}}}}return!0},Rc=function(f){return f!=="annotation-xml"&&Ns(f,Ji)},Ic=function(f){Kt(ne.beforeSanitizeAttributes,f,null);const{attributes:S}=f;if(!S||ao(f))return;const L={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:fe,forceKeepAttr:void 0};let te=S.length;for(;te--;){const Ae=S[te],{name:pe,namespaceURI:He,value:Xt}=Ae,Pn=_e(pe),io=Xt;let Re=pe==="value"?io:Nd(io);if(L.attrName=Pn,L.attrValue=Re,L.keepAttr=!0,L.forceKeepAttr=void 0,Kt(ne.uponSanitizeAttribute,f,L),Re=L.attrValue,Sa&&(Pn==="id"||Pn==="name")&&(tn(pe,f),Re=eo+Re),we&&Pe(/((--!?|])>)|<\/(style|title)/i,Re)){tn(pe,f);continue}if(L.forceKeepAttr)continue;if(!L.keepAttr){tn(pe,f);continue}if(!ke&&Pe(/\/>/i,Re)){tn(pe,f);continue}ye&&Jn([Qt,dr,hr],Oc=>{Re=mn(Re,Oc," ")});const Lc=_e(f.nodeName);if(!Ac(Lc,Pn,Re)){tn(pe,f);continue}if(T&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!He)switch(v.getAttributeType(Lc,Pn)){case"TrustedHTML":{Re=T.createHTML(Re);break}case"TrustedScriptURL":{Re=T.createScriptURL(Re);break}}if(Re!==io)try{He?f.setAttributeNS(He,pe,Re):f.setAttribute(pe,Re),ao(f)?Pt(f):Ps(e.removed)}catch{tn(pe,f)}}Kt(ne.afterSanitizeAttributes,f,null)},f0=function O(f){let S=null;const L=Tc(f);for(Kt(ne.beforeSanitizeShadowDOM,f,null);S=L.nextNode();)Kt(ne.uponSanitizeShadowNode,S,null),Cc(S),Ic(S),S.content instanceof i&&O(S.content);Kt(ne.afterSanitizeShadowDOM,f,null)};return e.sanitize=function(O){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},S=null,L=null,te=null,Ae=null;if(to=!O,to&&(O="<!-->"),typeof O!="string"&&!Ec(O))if(typeof O.toString=="function"){if(O=O.toString(),typeof O!="string")throw vn("dirty is not a string, aborting")}else throw vn("toString is not a function");if(!e.isSupported)return O;if(Je||no(f),e.removed=[],typeof O=="string"&&(Ir=!1),Ir){if(O.nodeName){const Xt=_e(O.nodeName);if(!ce[Xt]||G[Xt])throw vn("root node is forbidden and cannot be sanitized in-place")}}else if(O instanceof s)S=Sc("<!---->"),L=S.ownerDocument.importNode(O,!0),L.nodeType===kn.element&&L.nodeName==="BODY"||L.nodeName==="HTML"?S=L:S.appendChild(L);else{if(!dt&&!ye&&!ae&&O.indexOf("<")===-1)return T&&It?T.createHTML(O):O;if(S=Sc(O),!S)return dt?null:It?R:""}S&&Ue&&Pt(S.firstChild);const pe=Tc(Ir?O:S);for(;te=pe.nextNode();)Cc(te),Ic(te),te.content instanceof i&&f0(te.content);if(Ir)return O;if(dt){if(Yt)for(Ae=Fe.call(S.ownerDocument);S.firstChild;)Ae.appendChild(S.firstChild);else Ae=S;return(fe.shadowroot||fe.shadowrootmode)&&(Ae=ur.call(n,Ae,!0)),Ae}let He=ae?S.outerHTML:S.innerHTML;return ae&&ce["!doctype"]&&S.ownerDocument&&S.ownerDocument.doctype&&S.ownerDocument.doctype.name&&Pe(Bs,S.ownerDocument.doctype.name)&&(He="<!DOCTYPE "+S.ownerDocument.doctype.name+`>
|
|
17
|
-
`+He),ye&&Jn([Qt,dr,hr],Xt=>{He=mn(He,Xt," ")}),T&&It?T.createHTML(He):He},e.setConfig=function(){let O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};no(O),Je=!0},e.clearConfig=function(){en=null,Je=!1},e.isValidAttribute=function(O,f,S){en||no({});const L=_e(O),
|
|
15
|
+
sans-serif;}.error-message__retry-button.svelte-4thrqu {border:none;outline:none;background:none;font-size:1rem;text-decoration:underline;&:active {outline:none;}}`};function Is(t,e){Pr(e,!0),od(t,Ad);const r=(l,u=pr,p=pr)=>{ko();var h=Cd(),v=Le(h),m=nr(v);{var b=y=>{},C=y=>{var k=Ed(),w=Bt(k),T=nr(Bt(w));T.__click=[Td,p],$t(w),$t(k),ie(y,k)};ir(m,y=>{a()?y(b):y(C,!1)})}Zn(y=>cs(v,`${y??""} `),[()=>console.error(`Panic, uncaught error:
|
|
16
|
+
`,u())??""]),ie(l,h)};let n=oe(e,"body",7),a=oe(e,"silent",7),i=J(void 0);const o=l=>{P(i,{error:l},!0)};var s=gt(),c=Le(s);return ku(c,{get failed(){return r}},l=>{var u=gt(),p=Le(u);{var h=m=>{r(m,()=>_(i).error,()=>()=>{P(i,void 0)})},v=m=>{var b=gt(),C=Le(b);hs(C,n,()=>o),ie(m,b)};ir(p,m=>{_(i)?m(h):m(v,!1)})}ie(l,u)}),ie(t,s),Nr({get body(){return n()},set body(l){n(l),ee()},get silent(){return a()},set silent(l){a(l),ee()}})}ss(["click"]),pn(Is,{body:{},silent:{}},[],[],!0);/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:Ls,setPrototypeOf:Os,isFrozen:Rd,getPrototypeOf:Id,getOwnPropertyDescriptor:Ld}=Object;let{freeze:Me,seal:ot,create:Ms}=Object,{apply:si,construct:li}=typeof Reflect<"u"&&Reflect;Me||(Me=function(e){return e}),ot||(ot=function(e){return e}),si||(si=function(e,r,n){return e.apply(r,n)}),li||(li=function(e,r){return new e(...r)});const Jn=Ne(Array.prototype.forEach),Od=Ne(Array.prototype.lastIndexOf),Ps=Ne(Array.prototype.pop),gn=Ne(Array.prototype.push),Md=Ne(Array.prototype.splice),ea=Ne(String.prototype.toLowerCase),ci=Ne(String.prototype.toString),Ns=Ne(String.prototype.match),mn=Ne(String.prototype.replace),Pd=Ne(String.prototype.indexOf),Nd=Ne(String.prototype.trim),mt=Ne(Object.prototype.hasOwnProperty),Pe=Ne(RegExp.prototype.test),vn=Dd(TypeError);function Ne(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];return si(t,e,n)}}function Dd(t){return function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return li(t,r)}}function V(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ea;Os&&Os(t,null);let n=e.length;for(;n--;){let a=e[n];if(typeof a=="string"){const i=r(a);i!==a&&(Rd(e)||(e[n]=i),a=i)}t[a]=!0}return t}function $d(t){for(let e=0;e<t.length;e++)mt(t,e)||(t[e]=null);return t}function Vt(t){const e=Ms(null);for(const[r,n]of Ls(t))mt(t,r)&&(Array.isArray(n)?e[r]=$d(n):n&&typeof n=="object"&&n.constructor===Object?e[r]=Vt(n):e[r]=n);return e}function bn(t,e){for(;t!==null;){const n=Ld(t,e);if(n){if(n.get)return Ne(n.get);if(typeof n.value=="function")return Ne(n.value)}t=Id(t)}function r(){return null}return r}const Ds=Me(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ui=Me(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),di=Me(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),zd=Me(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),hi=Me(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Fd=Me(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),$s=Me(["#text"]),zs=Me(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),fi=Me(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Fs=Me(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ta=Me(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Bd=ot(/\{\{[\w\W]*|[\w\W]*\}\}/gm),jd=ot(/<%[\w\W]*|[\w\W]*%>/gm),Ud=ot(/\$\{[\w\W]*/gm),qd=ot(/^data-[\-\w.\u00B7-\uFFFF]+$/),Vd=ot(/^aria-[\-\w]+$/),Bs=ot(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Hd=ot(/^(?:\w+script|data):/i),Zd=ot(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),js=ot(/^html$/i),Gd=ot(/^[a-z][.\w]*(-[.\w]+)+$/i);var Us=Object.freeze({__proto__:null,ARIA_ATTR:Vd,ATTR_WHITESPACE:Zd,CUSTOM_ELEMENT:Gd,DATA_ATTR:qd,DOCTYPE_NAME:js,ERB_EXPR:jd,IS_ALLOWED_URI:Bs,IS_SCRIPT_OR_DATA:Hd,MUSTACHE_EXPR:Bd,TMPLIT_EXPR:Ud});const kn={element:1,text:3,progressingInstruction:7,comment:8,document:9},Wd=function(){return typeof window>"u"?null:window},Qd=function(e,r){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const a="data-tt-policy-suffix";r&&r.hasAttribute(a)&&(n=r.getAttribute(a));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},qs=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Vs(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Wd();const e=O=>Vs(O);if(e.version="3.2.6",e.removed=[],!t||!t.document||t.document.nodeType!==kn.document||!t.Element)return e.isSupported=!1,e;let{document:r}=t;const n=r,a=n.currentScript,{DocumentFragment:i,HTMLTemplateElement:o,Node:s,Element:c,NodeFilter:l,NamedNodeMap:u=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:p,DOMParser:h,trustedTypes:v}=t,m=c.prototype,b=bn(m,"cloneNode"),C=bn(m,"remove"),y=bn(m,"nextSibling"),k=bn(m,"childNodes"),w=bn(m,"parentNode");if(typeof o=="function"){const O=r.createElement("template");O.content&&O.content.ownerDocument&&(r=O.content.ownerDocument)}let T,R="";const{implementation:U,createNodeIterator:Q,createDocumentFragment:Fe,getElementsByTagName:le}=r,{importNode:ur}=n;let ne=qs();e.isSupported=typeof Ls=="function"&&typeof w=="function"&&U&&U.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Qt,ERB_EXPR:dr,TMPLIT_EXPR:hr,DATA_ATTR:Xr,ARIA_ATTR:Ki,IS_SCRIPT_OR_DATA:Xi,ATTR_WHITESPACE:_a,CUSTOM_ELEMENT:Ji}=Us;let{IS_ALLOWED_URI:xa}=Us,ce=null;const In=V({},[...Ds,...ui,...di,...hi,...$s]);let fe=null;const F=V({},[...zs,...fi,...Fs,...ta]);let $=Object.seal(Ms(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),G=null,Be=null,be=!0,se=!0,je=!1,ke=!0,ye=!1,we=!0,ae=!1,Je=!1,Ue=!1,dt=!1,Yt=!1,It=!1,Ln=!0,Sa=!1;const eo="user-content-";let Jr=!0,Ir=!1,et={},Ve=null;const Lr=V({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ta=null;const Ea=V({},["audio","video","img","source","image","track"]);let On=null;const Lt=V({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),tt="http://www.w3.org/1998/Math/MathML",Ot="http://www.w3.org/2000/svg",yt="http://www.w3.org/1999/xhtml";let Mt=yt,to=!1,ro=null;const s0=V({},[tt,Ot,yt],ci);let Ca=V({},["mi","mo","mn","ms","mtext"]),Aa=V({},["annotation-xml"]);const l0=V({},["title","style","font","a","script"]);let Mn=null;const c0=["application/xhtml+xml","text/html"],u0="text/html";let _e=null,en=null;const d0=r.createElement("form"),wc=function(f){return f instanceof RegExp||f instanceof Function},no=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(en&&en===f)){if((!f||typeof f!="object")&&(f={}),f=Vt(f),Mn=c0.indexOf(f.PARSER_MEDIA_TYPE)===-1?u0:f.PARSER_MEDIA_TYPE,_e=Mn==="application/xhtml+xml"?ci:ea,ce=mt(f,"ALLOWED_TAGS")?V({},f.ALLOWED_TAGS,_e):In,fe=mt(f,"ALLOWED_ATTR")?V({},f.ALLOWED_ATTR,_e):F,ro=mt(f,"ALLOWED_NAMESPACES")?V({},f.ALLOWED_NAMESPACES,ci):s0,On=mt(f,"ADD_URI_SAFE_ATTR")?V(Vt(Lt),f.ADD_URI_SAFE_ATTR,_e):Lt,Ta=mt(f,"ADD_DATA_URI_TAGS")?V(Vt(Ea),f.ADD_DATA_URI_TAGS,_e):Ea,Ve=mt(f,"FORBID_CONTENTS")?V({},f.FORBID_CONTENTS,_e):Lr,G=mt(f,"FORBID_TAGS")?V({},f.FORBID_TAGS,_e):Vt({}),Be=mt(f,"FORBID_ATTR")?V({},f.FORBID_ATTR,_e):Vt({}),et=mt(f,"USE_PROFILES")?f.USE_PROFILES:!1,be=f.ALLOW_ARIA_ATTR!==!1,se=f.ALLOW_DATA_ATTR!==!1,je=f.ALLOW_UNKNOWN_PROTOCOLS||!1,ke=f.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ye=f.SAFE_FOR_TEMPLATES||!1,we=f.SAFE_FOR_XML!==!1,ae=f.WHOLE_DOCUMENT||!1,dt=f.RETURN_DOM||!1,Yt=f.RETURN_DOM_FRAGMENT||!1,It=f.RETURN_TRUSTED_TYPE||!1,Ue=f.FORCE_BODY||!1,Ln=f.SANITIZE_DOM!==!1,Sa=f.SANITIZE_NAMED_PROPS||!1,Jr=f.KEEP_CONTENT!==!1,Ir=f.IN_PLACE||!1,xa=f.ALLOWED_URI_REGEXP||Bs,Mt=f.NAMESPACE||yt,Ca=f.MATHML_TEXT_INTEGRATION_POINTS||Ca,Aa=f.HTML_INTEGRATION_POINTS||Aa,$=f.CUSTOM_ELEMENT_HANDLING||{},f.CUSTOM_ELEMENT_HANDLING&&wc(f.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&($.tagNameCheck=f.CUSTOM_ELEMENT_HANDLING.tagNameCheck),f.CUSTOM_ELEMENT_HANDLING&&wc(f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&($.attributeNameCheck=f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),f.CUSTOM_ELEMENT_HANDLING&&typeof f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&($.allowCustomizedBuiltInElements=f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ye&&(se=!1),Yt&&(dt=!0),et&&(ce=V({},$s),fe=[],et.html===!0&&(V(ce,Ds),V(fe,zs)),et.svg===!0&&(V(ce,ui),V(fe,fi),V(fe,ta)),et.svgFilters===!0&&(V(ce,di),V(fe,fi),V(fe,ta)),et.mathMl===!0&&(V(ce,hi),V(fe,Fs),V(fe,ta))),f.ADD_TAGS&&(ce===In&&(ce=Vt(ce)),V(ce,f.ADD_TAGS,_e)),f.ADD_ATTR&&(fe===F&&(fe=Vt(fe)),V(fe,f.ADD_ATTR,_e)),f.ADD_URI_SAFE_ATTR&&V(On,f.ADD_URI_SAFE_ATTR,_e),f.FORBID_CONTENTS&&(Ve===Lr&&(Ve=Vt(Ve)),V(Ve,f.FORBID_CONTENTS,_e)),Jr&&(ce["#text"]=!0),ae&&V(ce,["html","head","body"]),ce.table&&(V(ce,["tbody"]),delete G.tbody),f.TRUSTED_TYPES_POLICY){if(typeof f.TRUSTED_TYPES_POLICY.createHTML!="function")throw vn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof f.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw vn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=f.TRUSTED_TYPES_POLICY,R=T.createHTML("")}else T===void 0&&(T=Qd(v,a)),T!==null&&typeof R=="string"&&(R=T.createHTML(""));Me&&Me(f),en=f}},_c=V({},[...ui,...di,...zd]),xc=V({},[...hi,...Fd]),h0=function(f){let S=w(f);(!S||!S.tagName)&&(S={namespaceURI:Mt,tagName:"template"});const L=ea(f.tagName),re=ea(S.tagName);return ro[f.namespaceURI]?f.namespaceURI===Ot?S.namespaceURI===yt?L==="svg":S.namespaceURI===tt?L==="svg"&&(re==="annotation-xml"||Ca[re]):!!_c[L]:f.namespaceURI===tt?S.namespaceURI===yt?L==="math":S.namespaceURI===Ot?L==="math"&&Aa[re]:!!xc[L]:f.namespaceURI===yt?S.namespaceURI===Ot&&!Aa[re]||S.namespaceURI===tt&&!Ca[re]?!1:!xc[L]&&(l0[L]||!_c[L]):!!(Mn==="application/xhtml+xml"&&ro[f.namespaceURI]):!1},Pt=function(f){gn(e.removed,{element:f});try{w(f).removeChild(f)}catch{C(f)}},tn=function(f,S){try{gn(e.removed,{attribute:S.getAttributeNode(f),from:S})}catch{gn(e.removed,{attribute:null,from:S})}if(S.removeAttribute(f),f==="is")if(dt||Yt)try{Pt(S)}catch{}else try{S.setAttribute(f,"")}catch{}},Sc=function(f){let S=null,L=null;if(Ue)f="<remove></remove>"+f;else{const pe=Ns(f,/^[\r\n\t ]+/);L=pe&&pe[0]}Mn==="application/xhtml+xml"&&Mt===yt&&(f='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+f+"</body></html>");const re=T?T.createHTML(f):f;if(Mt===yt)try{S=new h().parseFromString(re,Mn)}catch{}if(!S||!S.documentElement){S=U.createDocument(Mt,"template",null);try{S.documentElement.innerHTML=to?R:re}catch{}}const Ae=S.body||S.documentElement;return f&&L&&Ae.insertBefore(r.createTextNode(L),Ae.childNodes[0]||null),Mt===yt?le.call(S,ae?"html":"body")[0]:ae?S.documentElement:Ae},Tc=function(f){return Q.call(f.ownerDocument||f,f,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},ao=function(f){return f instanceof p&&(typeof f.nodeName!="string"||typeof f.textContent!="string"||typeof f.removeChild!="function"||!(f.attributes instanceof u)||typeof f.removeAttribute!="function"||typeof f.setAttribute!="function"||typeof f.namespaceURI!="string"||typeof f.insertBefore!="function"||typeof f.hasChildNodes!="function")},Ec=function(f){return typeof s=="function"&&f instanceof s};function Kt(O,f,S){Jn(O,L=>{L.call(e,f,S,en)})}const Cc=function(f){let S=null;if(Kt(ne.beforeSanitizeElements,f,null),ao(f))return Pt(f),!0;const L=_e(f.nodeName);if(Kt(ne.uponSanitizeElement,f,{tagName:L,allowedTags:ce}),we&&f.hasChildNodes()&&!Ec(f.firstElementChild)&&Pe(/<[/\w!]/g,f.innerHTML)&&Pe(/<[/\w!]/g,f.textContent)||f.nodeType===kn.progressingInstruction||we&&f.nodeType===kn.comment&&Pe(/<[/\w]/g,f.data))return Pt(f),!0;if(!ce[L]||G[L]){if(!G[L]&&Rc(L)&&($.tagNameCheck instanceof RegExp&&Pe($.tagNameCheck,L)||$.tagNameCheck instanceof Function&&$.tagNameCheck(L)))return!1;if(Jr&&!Ve[L]){const re=w(f)||f.parentNode,Ae=k(f)||f.childNodes;if(Ae&&re){const pe=Ae.length;for(let He=pe-1;He>=0;--He){const Xt=b(Ae[He],!0);Xt.__removalCount=(f.__removalCount||0)+1,re.insertBefore(Xt,y(f))}}}return Pt(f),!0}return f instanceof c&&!h0(f)||(L==="noscript"||L==="noembed"||L==="noframes")&&Pe(/<\/no(script|embed|frames)/i,f.innerHTML)?(Pt(f),!0):(ye&&f.nodeType===kn.text&&(S=f.textContent,Jn([Qt,dr,hr],re=>{S=mn(S,re," ")}),f.textContent!==S&&(gn(e.removed,{element:f.cloneNode()}),f.textContent=S)),Kt(ne.afterSanitizeElements,f,null),!1)},Ac=function(f,S,L){if(Ln&&(S==="id"||S==="name")&&(L in r||L in d0))return!1;if(!(se&&!Be[S]&&Pe(Xr,S))){if(!(be&&Pe(Ki,S))){if(!fe[S]||Be[S]){if(!(Rc(f)&&($.tagNameCheck instanceof RegExp&&Pe($.tagNameCheck,f)||$.tagNameCheck instanceof Function&&$.tagNameCheck(f))&&($.attributeNameCheck instanceof RegExp&&Pe($.attributeNameCheck,S)||$.attributeNameCheck instanceof Function&&$.attributeNameCheck(S))||S==="is"&&$.allowCustomizedBuiltInElements&&($.tagNameCheck instanceof RegExp&&Pe($.tagNameCheck,L)||$.tagNameCheck instanceof Function&&$.tagNameCheck(L))))return!1}else if(!On[S]){if(!Pe(xa,mn(L,_a,""))){if(!((S==="src"||S==="xlink:href"||S==="href")&&f!=="script"&&Pd(L,"data:")===0&&Ta[f])){if(!(je&&!Pe(Xi,mn(L,_a,"")))){if(L)return!1}}}}}}return!0},Rc=function(f){return f!=="annotation-xml"&&Ns(f,Ji)},Ic=function(f){Kt(ne.beforeSanitizeAttributes,f,null);const{attributes:S}=f;if(!S||ao(f))return;const L={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:fe,forceKeepAttr:void 0};let re=S.length;for(;re--;){const Ae=S[re],{name:pe,namespaceURI:He,value:Xt}=Ae,Pn=_e(pe),io=Xt;let Re=pe==="value"?io:Nd(io);if(L.attrName=Pn,L.attrValue=Re,L.keepAttr=!0,L.forceKeepAttr=void 0,Kt(ne.uponSanitizeAttribute,f,L),Re=L.attrValue,Sa&&(Pn==="id"||Pn==="name")&&(tn(pe,f),Re=eo+Re),we&&Pe(/((--!?|])>)|<\/(style|title)/i,Re)){tn(pe,f);continue}if(L.forceKeepAttr)continue;if(!L.keepAttr){tn(pe,f);continue}if(!ke&&Pe(/\/>/i,Re)){tn(pe,f);continue}ye&&Jn([Qt,dr,hr],Oc=>{Re=mn(Re,Oc," ")});const Lc=_e(f.nodeName);if(!Ac(Lc,Pn,Re)){tn(pe,f);continue}if(T&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!He)switch(v.getAttributeType(Lc,Pn)){case"TrustedHTML":{Re=T.createHTML(Re);break}case"TrustedScriptURL":{Re=T.createScriptURL(Re);break}}if(Re!==io)try{He?f.setAttributeNS(He,pe,Re):f.setAttribute(pe,Re),ao(f)?Pt(f):Ps(e.removed)}catch{tn(pe,f)}}Kt(ne.afterSanitizeAttributes,f,null)},f0=function O(f){let S=null;const L=Tc(f);for(Kt(ne.beforeSanitizeShadowDOM,f,null);S=L.nextNode();)Kt(ne.uponSanitizeShadowNode,S,null),Cc(S),Ic(S),S.content instanceof i&&O(S.content);Kt(ne.afterSanitizeShadowDOM,f,null)};return e.sanitize=function(O){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},S=null,L=null,re=null,Ae=null;if(to=!O,to&&(O="<!-->"),typeof O!="string"&&!Ec(O))if(typeof O.toString=="function"){if(O=O.toString(),typeof O!="string")throw vn("dirty is not a string, aborting")}else throw vn("toString is not a function");if(!e.isSupported)return O;if(Je||no(f),e.removed=[],typeof O=="string"&&(Ir=!1),Ir){if(O.nodeName){const Xt=_e(O.nodeName);if(!ce[Xt]||G[Xt])throw vn("root node is forbidden and cannot be sanitized in-place")}}else if(O instanceof s)S=Sc("<!---->"),L=S.ownerDocument.importNode(O,!0),L.nodeType===kn.element&&L.nodeName==="BODY"||L.nodeName==="HTML"?S=L:S.appendChild(L);else{if(!dt&&!ye&&!ae&&O.indexOf("<")===-1)return T&&It?T.createHTML(O):O;if(S=Sc(O),!S)return dt?null:It?R:""}S&&Ue&&Pt(S.firstChild);const pe=Tc(Ir?O:S);for(;re=pe.nextNode();)Cc(re),Ic(re),re.content instanceof i&&f0(re.content);if(Ir)return O;if(dt){if(Yt)for(Ae=Fe.call(S.ownerDocument);S.firstChild;)Ae.appendChild(S.firstChild);else Ae=S;return(fe.shadowroot||fe.shadowrootmode)&&(Ae=ur.call(n,Ae,!0)),Ae}let He=ae?S.outerHTML:S.innerHTML;return ae&&ce["!doctype"]&&S.ownerDocument&&S.ownerDocument.doctype&&S.ownerDocument.doctype.name&&Pe(js,S.ownerDocument.doctype.name)&&(He="<!DOCTYPE "+S.ownerDocument.doctype.name+`>
|
|
17
|
+
`+He),ye&&Jn([Qt,dr,hr],Xt=>{He=mn(He,Xt," ")}),T&&It?T.createHTML(He):He},e.setConfig=function(){let O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};no(O),Je=!0},e.clearConfig=function(){en=null,Je=!1},e.isValidAttribute=function(O,f,S){en||no({});const L=_e(O),re=_e(f);return Ac(L,re,S)},e.addHook=function(O,f){typeof f=="function"&&gn(ne[O],f)},e.removeHook=function(O,f){if(f!==void 0){const S=Od(ne[O],f);return S===-1?void 0:Md(ne[O],S,1)[0]}return Ps(ne[O])},e.removeHooks=function(O){ne[O]=[]},e.removeAllHooks=function(){ne=qs()},e}var Yd=Vs();function pi(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Tr=pi();function Hs(t){Tr=t}var yn={exec:()=>null};function Y(t,e=""){let r=typeof t=="string"?t:t.source;const n={replace:(a,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(De.caret,"$1"),r=r.replace(a,o),n},getRegex:()=>new RegExp(r,e)};return n}var De={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},Kd=/^(?:[ \t]*(?:\n|$))+/,Xd=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Jd=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,wn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,eh=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,gi=/(?:[*+-]|\d{1,9}[.)])/,Zs=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Gs=Y(Zs).replace(/bull/g,gi).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),th=Y(Zs).replace(/bull/g,gi).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),mi=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,rh=/^[^\n]+/,vi=/(?!\s*\])(?:\\.|[^\[\]\\])+/,nh=Y(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",vi).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ah=Y(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,gi).getRegex(),ra="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",bi=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ih=Y("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",bi).replace("tag",ra).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ws=Y(mi).replace("hr",wn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ra).getRegex(),oh=Y(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ws).getRegex(),ki={blockquote:oh,code:Xd,def:nh,fences:Jd,heading:eh,hr:wn,html:ih,lheading:Gs,list:ah,newline:Kd,paragraph:Ws,table:yn,text:rh},Qs=Y("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",wn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ra).getRegex(),sh={...ki,lheading:th,table:Qs,paragraph:Y(mi).replace("hr",wn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Qs).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ra).getRegex()},lh={...ki,html:Y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",bi).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:yn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Y(mi).replace("hr",wn).replace("heading",` *#{1,6} *[^
|
|
18
18
|
]`).replace("lheading",Gs).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ch=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,uh=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ys=/^( {2,}|\\)\n(?!\s*$)/,dh=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,na=/[\p{P}\p{S}]/u,yi=/[\s\p{P}\p{S}]/u,Ks=/[^\s\p{P}\p{S}]/u,hh=Y(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,yi).getRegex(),Xs=/(?!~)[\p{P}\p{S}]/u,fh=/(?!~)[\s\p{P}\p{S}]/u,ph=/(?:[^\s\p{P}\p{S}]|~)/u,gh=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Js=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,mh=Y(Js,"u").replace(/punct/g,na).getRegex(),vh=Y(Js,"u").replace(/punct/g,Xs).getRegex(),el="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",bh=Y(el,"gu").replace(/notPunctSpace/g,Ks).replace(/punctSpace/g,yi).replace(/punct/g,na).getRegex(),kh=Y(el,"gu").replace(/notPunctSpace/g,ph).replace(/punctSpace/g,fh).replace(/punct/g,Xs).getRegex(),yh=Y("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ks).replace(/punctSpace/g,yi).replace(/punct/g,na).getRegex(),wh=Y(/\\(punct)/,"gu").replace(/punct/g,na).getRegex(),_h=Y(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),xh=Y(bi).replace("(?:-->|$)","-->").getRegex(),Sh=Y("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",xh).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),aa=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Th=Y(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",aa).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),tl=Y(/^!?\[(label)\]\[(ref)\]/).replace("label",aa).replace("ref",vi).getRegex(),rl=Y(/^!?\[(ref)\](?:\[\])?/).replace("ref",vi).getRegex(),Eh=Y("reflink|nolink(?!\\()","g").replace("reflink",tl).replace("nolink",rl).getRegex(),wi={_backpedal:yn,anyPunctuation:wh,autolink:_h,blockSkip:gh,br:Ys,code:uh,del:yn,emStrongLDelim:mh,emStrongRDelimAst:bh,emStrongRDelimUnd:yh,escape:ch,link:Th,nolink:rl,punctuation:hh,reflink:tl,reflinkSearch:Eh,tag:Sh,text:dh,url:yn},Ch={...wi,link:Y(/^!?\[(label)\]\((.*?)\)/).replace("label",aa).getRegex(),reflink:Y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",aa).getRegex()},_i={...wi,emStrongRDelimAst:kh,emStrongLDelim:vh,url:Y(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Ah={..._i,br:Y(Ys).replace("{2,}","*").getRegex(),text:Y(_i.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ia={normal:ki,gfm:sh,pedantic:lh},_n={normal:wi,gfm:_i,breaks:Ah,pedantic:Ch},Rh={"&":"&","<":"<",">":">",'"':""","'":"'"},nl=t=>Rh[t];function Ct(t,e){if(e){if(De.escapeTest.test(t))return t.replace(De.escapeReplace,nl)}else if(De.escapeTestNoEncode.test(t))return t.replace(De.escapeReplaceNoEncode,nl);return t}function al(t){try{t=encodeURI(t).replace(De.percentDecode,"%")}catch{return null}return t}function il(t,e){const r=t.replace(De.findPipe,(i,o,s)=>{let c=!1,l=o;for(;--l>=0&&s[l]==="\\";)c=!c;return c?"|":" |"}),n=r.split(De.splitPipe);let a=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;a<n.length;a++)n[a]=n[a].trim().replace(De.slashPipe,"|");return n}function xn(t,e,r){const n=t.length;if(n===0)return"";let a=0;for(;a<n&&t.charAt(n-a-1)===e;)a++;return t.slice(0,n-a)}function Ih(t,e){if(t.indexOf(e[1])===-1)return-1;let r=0;for(let n=0;n<t.length;n++)if(t[n]==="\\")n++;else if(t[n]===e[0])r++;else if(t[n]===e[1]&&(r--,r<0))return n;return r>0?-2:-1}function ol(t,e,r,n,a){const i=e.href,o=e.title||null,s=t[1].replace(a.other.outputLinkReplace,"$1");n.state.inLink=!0;const c={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:i,title:o,text:s,tokens:n.inlineTokens(s)};return n.state.inLink=!1,c}function Lh(t,e,r){const n=t.match(r.other.indentCodeCompensation);if(n===null)return e;const a=n[1];return e.split(`
|
|
19
19
|
`).map(i=>{const o=i.match(r.other.beginningSpace);if(o===null)return i;const[s]=o;return s.length>=a.length?i.slice(a.length):i}).join(`
|
|
20
20
|
`)}var oa=class{options;rules;lexer;constructor(t){this.options=t||Tr}space(t){const e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){const e=this.rules.block.code.exec(t);if(e){const r=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?r:xn(r,`
|
|
@@ -69,11 +69,11 @@ ${t}</tr>
|
|
|
69
69
|
`}tablecell(t){const e=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+`</${r}>
|
|
70
70
|
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Ct(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:r}){const n=this.parser.parseInline(r),a=al(t);if(a===null)return n;t=a;let i='<a href="'+t+'"';return e&&(i+=' title="'+Ct(e)+'"'),i+=">"+n+"</a>",i}image({href:t,title:e,text:r,tokens:n}){n&&(r=this.parser.parseInline(n,this.parser.textRenderer));const a=al(t);if(a===null)return Ct(r);t=a;let i=`<img src="${t}" alt="${r}"`;return e&&(i+=` title="${Ct(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Ct(t.text)}},xi=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},Zt=class so{options;renderer;textRenderer;constructor(e){this.options=e||Tr,this.options.renderer=this.options.renderer||new sa,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new xi}static parse(e,r){return new so(r).parse(e)}static parseInline(e,r){return new so(r).parseInline(e)}parse(e,r=!0){let n="";for(let a=0;a<e.length;a++){const i=e[a];if(this.options.extensions?.renderers?.[i.type]){const s=i,c=this.options.extensions.renderers[s.type].call({parser:this},s);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(s.type)){n+=c||"";continue}}const o=i;switch(o.type){case"space":{n+=this.renderer.space(o);continue}case"hr":{n+=this.renderer.hr(o);continue}case"heading":{n+=this.renderer.heading(o);continue}case"code":{n+=this.renderer.code(o);continue}case"table":{n+=this.renderer.table(o);continue}case"blockquote":{n+=this.renderer.blockquote(o);continue}case"list":{n+=this.renderer.list(o);continue}case"html":{n+=this.renderer.html(o);continue}case"paragraph":{n+=this.renderer.paragraph(o);continue}case"text":{let s=o,c=this.renderer.text(s);for(;a+1<e.length&&e[a+1].type==="text";)s=e[++a],c+=`
|
|
71
71
|
`+this.renderer.text(s);r?n+=this.renderer.paragraph({type:"paragraph",raw:c,text:c,tokens:[{type:"text",raw:c,text:c,escaped:!0}]}):n+=c;continue}default:{const s='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return n}parseInline(e,r=this.renderer){let n="";for(let a=0;a<e.length;a++){const i=e[a];if(this.options.extensions?.renderers?.[i.type]){const s=this.options.extensions.renderers[i.type].call({parser:this},i);if(s!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=s||"";continue}}const o=i;switch(o.type){case"escape":{n+=r.text(o);break}case"html":{n+=r.html(o);break}case"link":{n+=r.link(o);break}case"image":{n+=r.image(o);break}case"strong":{n+=r.strong(o);break}case"em":{n+=r.em(o);break}case"codespan":{n+=r.codespan(o);break}case"br":{n+=r.br(o);break}case"del":{n+=r.del(o);break}case"text":{n+=r.text(o);break}default:{const s='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return n}},la=class{options;block;constructor(t){this.options=t||Tr}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?Ht.lex:Ht.lexInline}provideParser(){return this.block?Zt.parse:Zt.parseInline}},sl=class{defaults=pi();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Zt;Renderer=sa;TextRenderer=xi;Lexer=Ht;Tokenizer=oa;Hooks=la;constructor(...t){this.use(...t)}walkTokens(t,e){let r=[];for(const n of t)switch(r=r.concat(e.call(this,n)),n.type){case"table":{const a=n;for(const i of a.header)r=r.concat(this.walkTokens(i.tokens,e));for(const i of a.rows)for(const o of i)r=r.concat(this.walkTokens(o.tokens,e));break}case"list":{const a=n;r=r.concat(this.walkTokens(a.items,e));break}default:{const a=n;this.defaults.extensions?.childTokens?.[a.type]?this.defaults.extensions.childTokens[a.type].forEach(i=>{const o=a[i].flat(1/0);r=r.concat(this.walkTokens(o,e))}):a.tokens&&(r=r.concat(this.walkTokens(a.tokens,e)))}}return r}use(...t){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{const n={...r};if(n.async=this.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){const i=e.renderers[a.name];i?e.renderers[a.name]=function(...o){let s=a.renderer.apply(this,o);return s===!1&&(s=i.apply(this,o)),s}:e.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const i=e[a.level];i?i.unshift(a.tokenizer):e[a.level]=[a.tokenizer],a.start&&(a.level==="block"?e.startBlock?e.startBlock.push(a.start):e.startBlock=[a.start]:a.level==="inline"&&(e.startInline?e.startInline.push(a.start):e.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(e.childTokens[a.name]=a.childTokens)}),n.extensions=e),r.renderer){const a=this.defaults.renderer||new sa(this.defaults);for(const i in r.renderer){if(!(i in a))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;const o=i,s=r.renderer[o],c=a[o];a[o]=(...l)=>{let u=s.apply(a,l);return u===!1&&(u=c.apply(a,l)),u||""}}n.renderer=a}if(r.tokenizer){const a=this.defaults.tokenizer||new oa(this.defaults);for(const i in r.tokenizer){if(!(i in a))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;const o=i,s=r.tokenizer[o],c=a[o];a[o]=(...l)=>{let u=s.apply(a,l);return u===!1&&(u=c.apply(a,l)),u}}n.tokenizer=a}if(r.hooks){const a=this.defaults.hooks||new la;for(const i in r.hooks){if(!(i in a))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;const o=i,s=r.hooks[o],c=a[o];la.passThroughHooks.has(i)?a[o]=l=>{if(this.defaults.async)return Promise.resolve(s.call(a,l)).then(p=>c.call(a,p));const u=s.call(a,l);return c.call(a,u)}:a[o]=(...l)=>{let u=s.apply(a,l);return u===!1&&(u=c.apply(a,l)),u}}n.hooks=a}if(r.walkTokens){const a=this.defaults.walkTokens,i=r.walkTokens;n.walkTokens=function(o){let s=[];return s.push(i.call(this,o)),a&&(s=s.concat(a.call(this,o))),s}}this.defaults={...this.defaults,...n}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return Ht.lex(t,e??this.defaults)}parser(t,e){return Zt.parse(t,e??this.defaults)}parseMarkdown(t){return(r,n)=>{const a={...n},i={...this.defaults,...a},o=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&a.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=t);const s=i.hooks?i.hooks.provideLexer():t?Ht.lex:Ht.lexInline,c=i.hooks?i.hooks.provideParser():t?Zt.parse:Zt.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(r):r).then(l=>s(l,i)).then(l=>i.hooks?i.hooks.processAllTokens(l):l).then(l=>i.walkTokens?Promise.all(this.walkTokens(l,i.walkTokens)).then(()=>l):l).then(l=>c(l,i)).then(l=>i.hooks?i.hooks.postprocess(l):l).catch(o);try{i.hooks&&(r=i.hooks.preprocess(r));let l=s(r,i);i.hooks&&(l=i.hooks.processAllTokens(l)),i.walkTokens&&this.walkTokens(l,i.walkTokens);let u=c(l,i);return i.hooks&&(u=i.hooks.postprocess(u)),u}catch(l){return o(l)}}}onError(t,e){return r=>{if(r.message+=`
|
|
72
|
-
Please report this to https://github.com/markedjs/marked.`,t){const n="<p>An error occurred:</p><pre>"+Ct(r.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(r);throw r}}},Er=new sl;function K(t,e){return Er.parse(t,e)}K.options=K.setOptions=function(t){return Er.setOptions(t),K.defaults=Er.defaults,Hs(K.defaults),K},K.getDefaults=pi,K.defaults=Tr,K.use=function(...t){return Er.use(...t),K.defaults=Er.defaults,Hs(K.defaults),K},K.walkTokens=function(t,e){return Er.walkTokens(t,e)},K.parseInline=Er.parseInline,K.Parser=Zt,K.parser=Zt.parse,K.Renderer=sa,K.TextRenderer=xi,K.Lexer=Ht,K.lexer=Ht.lex,K.Tokenizer=oa,K.Hooks=la,K.parse=K,K.options,K.setOptions,K.use,K.walkTokens,K.parseInline,Zt.parse,Ht.lex;const ll=t=>(Object.getOwnPropertyNames(t).forEach(e=>{const r=t[e];r&&typeof r=="object"&&ll(r)}),Object.freeze(t)),cl=ll({all:[],used:[],unused:[]}),Oh=t=>{const e=Yd(t);return e.addHook("uponSanitizeElement",function(r,n){const a=n.tagName||r.nodeName.toLowerCase();a.startsWith("liipgpt-")&&(n.allowedTags[a]=!0)}),e};class ul{marked;currentReferences=cl;lastUsedIndex=0;DomPurity;constructor(e={}){this.marked=new sl({async:!1,breaks:!0}).use(this.createFootnoteExtension(),...e.extensions??[]),this.DomPurity=Oh(e.window)}createFootnoteExtension=()=>{const e=this;return{extensions:[{name:"footnote",level:"inline",start(r){return r.match(/\[\^(\d+)\]/)?.index},tokenizer(r){const a=/^\[\^(\d+)\]/.exec(r);if(a){const[i,o]=a;return{type:"footnote",raw:i,refNumber:o}}},renderer(r){if(r.type==="footnote"){const n=parseInt(r.refNumber)-1,a=e.currentReferences.all[n];if(!a)return console.error("Could not find ref with index:",n),"";let i;return a?.referenceIndex.used?i=a.referenceIndex.used:(e.currentReferences.used.push(a),e.lastUsedIndex++,i=e.lastUsedIndex,a.referenceIndex.used=i),` <liipgpt-reference-number data-all-index="${n}" data-used-index="${i}" data-source="${JSON.stringify(a).replace(/"/g,""")}"></liipgpt-reference-number>`}}}]}};parse(e){return this.DomPurity.sanitize(this.marked.parse(e),{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0,mathMl:!0},FORBID_TAGS:["hr"]})}toHTML(e,r){this.currentReferences=r;const n=this.parse(e);return this.currentReferences=cl,n}}function Mh(){let t,e;return{promise:new Promise((n,a)=>{e=n,t=a}),reject:t,resolve:e}}class dl{promise;resolve;reject;constructor(){const{promise:e,resolve:r,reject:n}=Mh();this.promise=e,this.resolve=r,this.reject=n}then(e,r){return this.promise.then(e,r)}catch(e){return this.promise.catch(e)}finally(e){return this.promise.finally(e)}toPromise(){return this.promise}[Symbol.toStringTag]="Flag"}class Si{hasValue=new dl;currentValue;setValue(e){this.currentValue=e,this.hasValue.resolve()}cleanup(e){this.hasValue.reject(e)}getCurrentValue(){return this.currentValue}async toPromise(){return await this.hasValue,this.currentValue}then(e,r){return this.toPromise().then(e,r)}catch(e){return this.toPromise().catch(e)}finally(e){return this.toPromise().finally(e)}[Symbol.toStringTag]="FutureValue"}const Ph=t=>{try{return new URL(t).hostname}catch{return t}};function Nh(t){return t.replace(/<[^>]*>/g,"").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')}const Dh=({url:t,considered:e,title:r,description:n,summary:a})=>{const i=Ph(t);return{url:t,considered:e,referenceIndex:{},score:0,metadata:{},display:{card:{title:r,description:n||a,badge:t},listItem:{title:r,badge:i}}}};class $h{constructor(e){this.options=e,this.store=vd({id:e.id,state:"loading",errors:[],type:"bot",time:new Date().toISOString(),message:{markdown:"",html:"",text:""},references:{all:[],used:[],unused:[]},retrievalQuestion:e.userQuestion})}store;content=new Si;backendSendsMappedRefs=!1;pushError(e){this.options.onError?.(e),this.store.update(r=>({...r,errors:[...r.errors,e]}))}updateRequestId(e){this.store.update(r=>({...r,id:e}))}updateText(e){this.store.update(r=>{const n=r.message.markdown+e,a=this.options.markdownRenderer.toHTML(n,r.references);return{...r,state:"streaming",message:{markdown:n,html:a,text:""}}})}finishMessage(){this.store.update(e=>{const r={...e,state:"done"};return r.references.unused=r.references.all.filter(n=>n.referenceIndex.used===void 0),r.message.text=Nh(r.message.html),this.options?.onFinish?.(r),this.content.setValue(r),r})}addReference(e){this.store.update(r=>{const n=r.references.all,a=n.length,i=[...n,{...e,referenceIndex:{all:a}}];return{...r,references:{used:r.references.used,all:i}}})}addMappedReference(e){this.backendSendsMappedRefs=!0,this.addReference(e)}addOldReference(e){this.backendSendsMappedRefs||this.addReference(Dh(e))}updateRetrievalQuestion(e){this.store.update(r=>({...r,retrievalQuestion:e}))}getReadableStore(){return{subscribe:this.store.subscribe}}getPromise(){return this.content.toPromise()}}var W;(function(t){t.assertEqual=a=>{};function e(a){}t.assertIs=e;function r(a){throw new Error}t.assertNever=r,t.arrayToEnum=a=>{const i={};for(const o of a)i[o]=o;return i},t.getValidEnumValues=a=>{const i=t.objectKeys(a).filter(s=>typeof a[a[s]]!="number"),o={};for(const s of i)o[s]=a[s];return t.objectValues(o)},t.objectValues=a=>t.objectKeys(a).map(function(i){return a[i]}),t.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&i.push(o);return i},t.find=(a,i)=>{for(const o of a)if(i(o))return o},t.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,i=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=n,t.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(W||(W={}));var hl;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(hl||(hl={}));const A=W.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),or=t=>{switch(typeof t){case"undefined":return A.undefined;case"string":return A.string;case"number":return Number.isNaN(t)?A.nan:A.number;case"boolean":return A.boolean;case"function":return A.function;case"bigint":return A.bigint;case"symbol":return A.symbol;case"object":return Array.isArray(t)?A.array:t===null?A.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?A.promise:typeof Map<"u"&&t instanceof Map?A.map:typeof Set<"u"&&t instanceof Set?A.set:typeof Date<"u"&&t instanceof Date?A.date:A.object;default:return A.unknown}},x=W.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Gt extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){const r=e||function(i){return i.message},n={_errors:[]},a=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let s=n,c=0;for(;c<o.path.length;){const l=o.path[c];c===o.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(r(o))):s[l]=s[l]||{_errors:[]},s=s[l],c++}}};return a(this),n}static assert(e){if(!(e instanceof Gt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,W.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},n=[];for(const a of this.issues)if(a.path.length>0){const i=a.path[0];r[i]=r[i]||[],r[i].push(e(a))}else n.push(e(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Gt.create=t=>new Gt(t);const Ti=(t,e)=>{let r;switch(t.code){case x.invalid_type:t.received===A.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case x.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,W.jsonStringifyReplacer)}`;break;case x.unrecognized_keys:r=`Unrecognized key(s) in object: ${W.joinValues(t.keys,", ")}`;break;case x.invalid_union:r="Invalid input";break;case x.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${W.joinValues(t.options)}`;break;case x.invalid_enum_value:r=`Invalid enum value. Expected ${W.joinValues(t.options)}, received '${t.received}'`;break;case x.invalid_arguments:r="Invalid function arguments";break;case x.invalid_return_type:r="Invalid function return type";break;case x.invalid_date:r="Invalid date";break;case x.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:W.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case x.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case x.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case x.custom:r="Invalid input";break;case x.invalid_intersection_types:r="Intersection results could not be merged";break;case x.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case x.not_finite:r="Number must be finite";break;default:r=e.defaultError,W.assertNever(t)}return{message:r}};let zh=Ti;function Fh(){return zh}const jh=t=>{const{data:e,path:r,errorMaps:n,issueData:a}=t,i=[...r,...a.path||[]],o={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let s="";const c=n.filter(l=>!!l).slice().reverse();for(const l of c)s=l(o,{data:e,defaultError:s}).message;return{...a,path:i,message:s}};function E(t,e){const r=Fh(),n=jh({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Ti?void 0:Ti].filter(a=>!!a)});t.common.issues.push(n)}class $e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const n=[];for(const a of r){if(a.status==="aborted")return D;a.status==="dirty"&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){const n=[];for(const a of r){const i=await a.key,o=await a.value;n.push({key:i,value:o})}return $e.mergeObjectSync(e,n)}static mergeObjectSync(e,r){const n={};for(const a of r){const{key:i,value:o}=a;if(i.status==="aborted"||o.status==="aborted")return D;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(n[i.value]=o.value)}return{status:e.value,value:n}}}const D=Object.freeze({status:"aborted"}),Sn=t=>({status:"dirty",value:t}),st=t=>({status:"valid",value:t}),fl=t=>t.status==="aborted",pl=t=>t.status==="dirty",qr=t=>t.status==="valid",ca=t=>typeof Promise<"u"&&t instanceof Promise;var I;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(I||(I={}));class At{constructor(e,r,n,a){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const gl=(t,e)=>{if(qr(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Gt(t.common.issues);return this._error=r,this._error}}};function B(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:n,description:a}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(o,s)=>{const{message:c}=t;return o.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:c??n??s.defaultError}:o.code!=="invalid_type"?{message:s.defaultError}:{message:c??r??s.defaultError}},description:a}}class Z{get description(){return this._def.description}_getType(e){return or(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:or(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new $e,ctx:{common:e.parent.common,data:e.data,parsedType:or(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(ca(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){const n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:or(e)},a=this._parseSync({data:e,path:n.path,parent:n});return gl(n,a)}"~validate"(e){const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:or(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:r});return qr(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>qr(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){const n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){const n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:or(e)},a=this._parse({data:e,path:n.path,parent:n}),i=await(ca(a)?a:Promise.resolve(a));return gl(n,i)}refine(e,r){const n=a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r;return this._refinement((a,i)=>{const o=e(a),s=()=>i.addIssue({code:x.custom,...n(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(e,r){return this._refinement((n,a)=>e(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(e){return new Gr({schema:this,typeName:N.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return lr.create(this,this._def)}nullable(){return Wr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Rt.create(this)}promise(){return pa.create(this,this._def)}or(e){return da.create([this,e],this._def)}and(e){return ha.create(this,e,this._def)}transform(e){return new Gr({...B(this._def),schema:this,typeName:N.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new Ii({...B(this._def),innerType:this,defaultValue:r,typeName:N.ZodDefault})}brand(){return new uf({typeName:N.ZodBranded,type:this,...B(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new Li({...B(this._def),innerType:this,catchValue:r,typeName:N.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Oi.create(this,e)}readonly(){return Mi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Bh=/^c[^\s-]{8,}$/i,Uh=/^[0-9a-z]+$/,qh=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Vh=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Hh=/^[a-z0-9_-]{21}$/i,Zh=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Gh=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Wh=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Qh="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ei;const Yh=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Kh=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Xh=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Jh=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ef=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,tf=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ml="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",rf=new RegExp(`^${ml}$`);function vl(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function nf(t){return new RegExp(`^${vl(t)}$`)}function af(t){let e=`${ml}T${vl(t)}`;const r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function of(t,e){return!!((e==="v4"||!e)&&Yh.test(t)||(e==="v6"||!e)&&Xh.test(t))}function sf(t,e){if(!Zh.test(t))return!1;try{const[r]=t.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function lf(t,e){return!!((e==="v4"||!e)&&Kh.test(t)||(e==="v6"||!e)&&Jh.test(t))}class Wt extends Z{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==A.string){const i=this._getOrReturnCtx(e);return E(i,{code:x.invalid_type,expected:A.string,received:i.parsedType}),D}const n=new $e;let a;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(a=this._getOrReturnCtx(e,a),E(a,{code:x.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(a=this._getOrReturnCtx(e,a),E(a,{code:x.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const o=e.data.length>i.value,s=e.data.length<i.value;(o||s)&&(a=this._getOrReturnCtx(e,a),o?E(a,{code:x.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):s&&E(a,{code:x.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")Wh.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"email",code:x.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Ei||(Ei=new RegExp(Qh,"u")),Ei.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"emoji",code:x.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")Vh.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"uuid",code:x.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")Hh.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"nanoid",code:x.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")Bh.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"cuid",code:x.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")Uh.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"cuid2",code:x.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")qh.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"ulid",code:x.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),E(a,{validation:"url",code:x.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"regex",code:x.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(e,a),E(a,{code:x.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(a=this._getOrReturnCtx(e,a),E(a,{code:x.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(a=this._getOrReturnCtx(e,a),E(a,{code:x.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?af(i).test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{code:x.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?rf.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{code:x.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?nf(i).test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{code:x.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?Gh.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"duration",code:x.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?of(e.data,i.version)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"ip",code:x.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?sf(e.data,i.alg)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"jwt",code:x.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?lf(e.data,i.version)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"cidr",code:x.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?ef.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"base64",code:x.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?tf.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"base64url",code:x.invalid_string,message:i.message}),n.dirty()):W.assertNever(i);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(a=>e.test(a),{validation:r,code:x.invalid_string,...I.errToObj(n)})}_addCheck(e){return new Wt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...I.errToObj(e)})}url(e){return this._addCheck({kind:"url",...I.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...I.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...I.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...I.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...I.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...I.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...I.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...I.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...I.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...I.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...I.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...I.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...I.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...I.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...I.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...I.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...I.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...I.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...I.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...I.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...I.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...I.errToObj(r)})}nonempty(e){return this.min(1,I.errToObj(e))}trim(){return new Wt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Wt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Wt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}Wt.create=t=>new Wt({checks:[],typeName:N.ZodString,coerce:t?.coerce??!1,...B(t)});function cf(t,e){const r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,a=r>n?r:n,i=Number.parseInt(t.toFixed(a).replace(".","")),o=Number.parseInt(e.toFixed(a).replace(".",""));return i%o/10**a}class Vr extends Z{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==A.number){const i=this._getOrReturnCtx(e);return E(i,{code:x.invalid_type,expected:A.number,received:i.parsedType}),D}let n;const a=new $e;for(const i of this._def.checks)i.kind==="int"?W.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),E(n,{code:x.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),E(n,{code:x.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),E(n,{code:x.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?cf(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),E(n,{code:x.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),E(n,{code:x.not_finite,message:i.message}),a.dirty()):W.assertNever(i);return{status:a.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,I.toString(r))}gt(e,r){return this.setLimit("min",e,!1,I.toString(r))}lte(e,r){return this.setLimit("max",e,!0,I.toString(r))}lt(e,r){return this.setLimit("max",e,!1,I.toString(r))}setLimit(e,r,n,a){return new Vr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:I.toString(a)}]})}_addCheck(e){return new Vr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:I.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:I.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:I.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:I.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:I.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:I.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:I.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:I.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:I.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&W.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}}Vr.create=t=>new Vr({checks:[],typeName:N.ZodNumber,coerce:t?.coerce||!1,...B(t)});class Tn extends Z{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==A.bigint)return this._getInvalidInput(e);let n;const a=new $e;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),E(n,{code:x.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),E(n,{code:x.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),E(n,{code:x.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):W.assertNever(i);return{status:a.value,value:e.data}}_getInvalidInput(e){const r=this._getOrReturnCtx(e);return E(r,{code:x.invalid_type,expected:A.bigint,received:r.parsedType}),D}gte(e,r){return this.setLimit("min",e,!0,I.toString(r))}gt(e,r){return this.setLimit("min",e,!1,I.toString(r))}lte(e,r){return this.setLimit("max",e,!0,I.toString(r))}lt(e,r){return this.setLimit("max",e,!1,I.toString(r))}setLimit(e,r,n,a){return new Tn({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:I.toString(a)}]})}_addCheck(e){return new Tn({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:I.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:I.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:I.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:I.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:I.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}Tn.create=t=>new Tn({checks:[],typeName:N.ZodBigInt,coerce:t?.coerce??!1,...B(t)});class Ci extends Z{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==A.boolean){const n=this._getOrReturnCtx(e);return E(n,{code:x.invalid_type,expected:A.boolean,received:n.parsedType}),D}return st(e.data)}}Ci.create=t=>new Ci({typeName:N.ZodBoolean,coerce:t?.coerce||!1,...B(t)});class ua extends Z{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==A.date){const i=this._getOrReturnCtx(e);return E(i,{code:x.invalid_type,expected:A.date,received:i.parsedType}),D}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return E(i,{code:x.invalid_date}),D}const n=new $e;let a;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(a=this._getOrReturnCtx(e,a),E(a,{code:x.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(a=this._getOrReturnCtx(e,a),E(a,{code:x.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):W.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ua({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:I.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:I.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}ua.create=t=>new ua({checks:[],coerce:t?.coerce||!1,typeName:N.ZodDate,...B(t)});class bl extends Z{_parse(e){if(this._getType(e)!==A.symbol){const n=this._getOrReturnCtx(e);return E(n,{code:x.invalid_type,expected:A.symbol,received:n.parsedType}),D}return st(e.data)}}bl.create=t=>new bl({typeName:N.ZodSymbol,...B(t)});class kl extends Z{_parse(e){if(this._getType(e)!==A.undefined){const n=this._getOrReturnCtx(e);return E(n,{code:x.invalid_type,expected:A.undefined,received:n.parsedType}),D}return st(e.data)}}kl.create=t=>new kl({typeName:N.ZodUndefined,...B(t)});class yl extends Z{_parse(e){if(this._getType(e)!==A.null){const n=this._getOrReturnCtx(e);return E(n,{code:x.invalid_type,expected:A.null,received:n.parsedType}),D}return st(e.data)}}yl.create=t=>new yl({typeName:N.ZodNull,...B(t)});class wl extends Z{constructor(){super(...arguments),this._any=!0}_parse(e){return st(e.data)}}wl.create=t=>new wl({typeName:N.ZodAny,...B(t)});class _l extends Z{constructor(){super(...arguments),this._unknown=!0}_parse(e){return st(e.data)}}_l.create=t=>new _l({typeName:N.ZodUnknown,...B(t)});class sr extends Z{_parse(e){const r=this._getOrReturnCtx(e);return E(r,{code:x.invalid_type,expected:A.never,received:r.parsedType}),D}}sr.create=t=>new sr({typeName:N.ZodNever,...B(t)});class xl extends Z{_parse(e){if(this._getType(e)!==A.undefined){const n=this._getOrReturnCtx(e);return E(n,{code:x.invalid_type,expected:A.void,received:n.parsedType}),D}return st(e.data)}}xl.create=t=>new xl({typeName:N.ZodVoid,...B(t)});class Rt extends Z{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),a=this._def;if(r.parsedType!==A.array)return E(r,{code:x.invalid_type,expected:A.array,received:r.parsedType}),D;if(a.exactLength!==null){const o=r.data.length>a.exactLength.value,s=r.data.length<a.exactLength.value;(o||s)&&(E(r,{code:o?x.too_big:x.too_small,minimum:s?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(E(r,{code:x.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(E(r,{code:x.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,s)=>a.type._parseAsync(new At(r,o,r.path,s)))).then(o=>$e.mergeArray(n,o));const i=[...r.data].map((o,s)=>a.type._parseSync(new At(r,o,r.path,s)));return $e.mergeArray(n,i)}get element(){return this._def.type}min(e,r){return new Rt({...this._def,minLength:{value:e,message:I.toString(r)}})}max(e,r){return new Rt({...this._def,maxLength:{value:e,message:I.toString(r)}})}length(e,r){return new Rt({...this._def,exactLength:{value:e,message:I.toString(r)}})}nonempty(e){return this.min(1,e)}}Rt.create=(t,e)=>new Rt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:N.ZodArray,...B(e)});function Hr(t){if(t instanceof ue){const e={};for(const r in t.shape){const n=t.shape[r];e[r]=lr.create(Hr(n))}return new ue({...t._def,shape:()=>e})}else return t instanceof Rt?new Rt({...t._def,type:Hr(t.element)}):t instanceof lr?lr.create(Hr(t.unwrap())):t instanceof Wr?Wr.create(Hr(t.unwrap())):t instanceof Cr?Cr.create(t.items.map(e=>Hr(e))):t}class ue extends Z{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=W.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==A.object){const l=this._getOrReturnCtx(e);return E(l,{code:x.invalid_type,expected:A.object,received:l.parsedType}),D}const{status:n,ctx:a}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof sr&&this._def.unknownKeys==="strip"))for(const l in a.data)o.includes(l)||s.push(l);const c=[];for(const l of o){const u=i[l],p=a.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new At(a,p,a.path,l)),alwaysSet:l in a.data})}if(this._def.catchall instanceof sr){const l=this._def.unknownKeys;if(l==="passthrough")for(const u of s)c.push({key:{status:"valid",value:u},value:{status:"valid",value:a.data[u]}});else if(l==="strict")s.length>0&&(E(a,{code:x.unrecognized_keys,keys:s}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const u of s){const p=a.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new At(a,p,a.path,u)),alwaysSet:u in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const l=[];for(const u of c){const p=await u.key,h=await u.value;l.push({key:p,value:h,alwaysSet:u.alwaysSet})}return l}).then(l=>$e.mergeObjectSync(n,l)):$e.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return I.errToObj,new ue({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{const a=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:I.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new ue({...this._def,unknownKeys:"strip"})}passthrough(){return new ue({...this._def,unknownKeys:"passthrough"})}extend(e){return new ue({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ue({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:N.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new ue({...this._def,catchall:e})}pick(e){const r={};for(const n of W.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new ue({...this._def,shape:()=>r})}omit(e){const r={};for(const n of W.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new ue({...this._def,shape:()=>r})}deepPartial(){return Hr(this)}partial(e){const r={};for(const n of W.objectKeys(this.shape)){const a=this.shape[n];e&&!e[n]?r[n]=a:r[n]=a.optional()}return new ue({...this._def,shape:()=>r})}required(e){const r={};for(const n of W.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof lr;)i=i._def.innerType;r[n]=i}return new ue({...this._def,shape:()=>r})}keyof(){return El(W.objectKeys(this.shape))}}ue.create=(t,e)=>new ue({shape:()=>t,unknownKeys:"strip",catchall:sr.create(),typeName:N.ZodObject,...B(e)}),ue.strictCreate=(t,e)=>new ue({shape:()=>t,unknownKeys:"strict",catchall:sr.create(),typeName:N.ZodObject,...B(e)}),ue.lazycreate=(t,e)=>new ue({shape:t,unknownKeys:"strip",catchall:sr.create(),typeName:N.ZodObject,...B(e)});class da extends Z{_parse(e){const{ctx:r}=this._processInputParams(e),n=this._def.options;function a(i){for(const s of i)if(s.result.status==="valid")return s.result;for(const s of i)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;const o=i.map(s=>new Gt(s.ctx.common.issues));return E(r,{code:x.invalid_union,unionErrors:o}),D}if(r.common.async)return Promise.all(n.map(async i=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(a);{let i;const o=[];for(const c of n){const l={...r,common:{...r.common,issues:[]},parent:null},u=c._parseSync({data:r.data,path:r.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!i&&(i={result:u,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;const s=o.map(c=>new Gt(c));return E(r,{code:x.invalid_union,unionErrors:s}),D}}get options(){return this._def.options}}da.create=(t,e)=>new da({options:t,typeName:N.ZodUnion,...B(e)});function Ai(t,e){const r=or(t),n=or(e);if(t===e)return{valid:!0,data:t};if(r===A.object&&n===A.object){const a=W.objectKeys(e),i=W.objectKeys(t).filter(s=>a.indexOf(s)!==-1),o={...t,...e};for(const s of i){const c=Ai(t[s],e[s]);if(!c.valid)return{valid:!1};o[s]=c.data}return{valid:!0,data:o}}else if(r===A.array&&n===A.array){if(t.length!==e.length)return{valid:!1};const a=[];for(let i=0;i<t.length;i++){const o=t[i],s=e[i],c=Ai(o,s);if(!c.valid)return{valid:!1};a.push(c.data)}return{valid:!0,data:a}}else return r===A.date&&n===A.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class ha extends Z{_parse(e){const{status:r,ctx:n}=this._processInputParams(e),a=(i,o)=>{if(fl(i)||fl(o))return D;const s=Ai(i.value,o.value);return s.valid?((pl(i)||pl(o))&&r.dirty(),{status:r.value,value:s.data}):(E(n,{code:x.invalid_intersection_types}),D)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,o])=>a(i,o)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}ha.create=(t,e,r)=>new ha({left:t,right:e,typeName:N.ZodIntersection,...B(r)});class Cr extends Z{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==A.array)return E(n,{code:x.invalid_type,expected:A.array,received:n.parsedType}),D;if(n.data.length<this._def.items.length)return E(n,{code:x.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),D;!this._def.rest&&n.data.length>this._def.items.length&&(E(n,{code:x.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const i=[...n.data].map((o,s)=>{const c=this._def.items[s]||this._def.rest;return c?c._parse(new At(n,o,n.path,s)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>$e.mergeArray(r,o)):$e.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new Cr({...this._def,rest:e})}}Cr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Cr({items:t,typeName:N.ZodTuple,rest:null,...B(e)})};class fa extends Z{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==A.object)return E(n,{code:x.invalid_type,expected:A.object,received:n.parsedType}),D;const a=[],i=this._def.keyType,o=this._def.valueType;for(const s in n.data)a.push({key:i._parse(new At(n,s,n.path,s)),value:o._parse(new At(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?$e.mergeObjectAsync(r,a):$e.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof Z?new fa({keyType:e,valueType:r,typeName:N.ZodRecord,...B(n)}):new fa({keyType:Wt.create(),valueType:e,typeName:N.ZodRecord,...B(r)})}}class Sl extends Z{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==A.map)return E(n,{code:x.invalid_type,expected:A.map,received:n.parsedType}),D;const a=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([s,c],l)=>({key:a._parse(new At(n,s,n.path,[l,"key"])),value:i._parse(new At(n,c,n.path,[l,"value"]))}));if(n.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const c of o){const l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return D;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),s.set(l.value,u.value)}return{status:r.value,value:s}})}else{const s=new Map;for(const c of o){const l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return D;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),s.set(l.value,u.value)}return{status:r.value,value:s}}}}Sl.create=(t,e,r)=>new Sl({valueType:e,keyType:t,typeName:N.ZodMap,...B(r)});class En extends Z{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==A.set)return E(n,{code:x.invalid_type,expected:A.set,received:n.parsedType}),D;const a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(E(n,{code:x.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(E(n,{code:x.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());const i=this._def.valueType;function o(c){const l=new Set;for(const u of c){if(u.status==="aborted")return D;u.status==="dirty"&&r.dirty(),l.add(u.value)}return{status:r.value,value:l}}const s=[...n.data.values()].map((c,l)=>i._parse(new At(n,c,n.path,l)));return n.common.async?Promise.all(s).then(c=>o(c)):o(s)}min(e,r){return new En({...this._def,minSize:{value:e,message:I.toString(r)}})}max(e,r){return new En({...this._def,maxSize:{value:e,message:I.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}En.create=(t,e)=>new En({valueType:t,minSize:null,maxSize:null,typeName:N.ZodSet,...B(e)});class Tl extends Z{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}Tl.create=(t,e)=>new Tl({getter:t,typeName:N.ZodLazy,...B(e)});class Ri extends Z{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return E(r,{received:r.data,code:x.invalid_literal,expected:this._def.value}),D}return{status:"valid",value:e.data}}get value(){return this._def.value}}Ri.create=(t,e)=>new Ri({value:t,typeName:N.ZodLiteral,...B(e)});function El(t,e){return new Zr({values:t,typeName:N.ZodEnum,...B(e)})}class Zr extends Z{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),n=this._def.values;return E(r,{expected:W.joinValues(n),received:r.parsedType,code:x.invalid_type}),D}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const r=this._getOrReturnCtx(e),n=this._def.values;return E(r,{received:r.data,code:x.invalid_enum_value,options:n}),D}return st(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return Zr.create(e,{...this._def,...r})}exclude(e,r=this._def){return Zr.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}}Zr.create=El;class Cl extends Z{_parse(e){const r=W.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==A.string&&n.parsedType!==A.number){const a=W.objectValues(r);return E(n,{expected:W.joinValues(a),received:n.parsedType,code:x.invalid_type}),D}if(this._cache||(this._cache=new Set(W.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const a=W.objectValues(r);return E(n,{received:n.data,code:x.invalid_enum_value,options:a}),D}return st(e.data)}get enum(){return this._def.values}}Cl.create=(t,e)=>new Cl({values:t,typeName:N.ZodNativeEnum,...B(e)});class pa extends Z{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==A.promise&&r.common.async===!1)return E(r,{code:x.invalid_type,expected:A.promise,received:r.parsedType}),D;const n=r.parsedType===A.promise?r.data:Promise.resolve(r.data);return st(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}}pa.create=(t,e)=>new pa({type:t,typeName:N.ZodPromise,...B(e)});class Gr extends Z{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===N.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:n}=this._processInputParams(e),a=this._def.effect||null,i={addIssue:o=>{E(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const o=a.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async s=>{if(r.value==="aborted")return D;const c=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return c.status==="aborted"?D:c.status==="dirty"||r.value==="dirty"?Sn(c.value):c});{if(r.value==="aborted")return D;const s=this._def.schema._parseSync({data:o,path:n.path,parent:n});return s.status==="aborted"?D:s.status==="dirty"||r.value==="dirty"?Sn(s.value):s}}if(a.type==="refinement"){const o=s=>{const c=a.refinement(s,i);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){const s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?D:(s.status==="dirty"&&r.dirty(),o(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?D:(s.status==="dirty"&&r.dirty(),o(s.value).then(()=>({status:r.value,value:s.value}))))}if(a.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!qr(o))return D;const s=a.transform(o.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>qr(o)?Promise.resolve(a.transform(o.value,i)).then(s=>({status:r.value,value:s})):D);W.assertNever(a)}}Gr.create=(t,e,r)=>new Gr({schema:t,typeName:N.ZodEffects,effect:e,...B(r)}),Gr.createWithPreprocess=(t,e,r)=>new Gr({schema:e,effect:{type:"preprocess",transform:t},typeName:N.ZodEffects,...B(r)});class lr extends Z{_parse(e){return this._getType(e)===A.undefined?st(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}lr.create=(t,e)=>new lr({innerType:t,typeName:N.ZodOptional,...B(e)});class Wr extends Z{_parse(e){return this._getType(e)===A.null?st(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Wr.create=(t,e)=>new Wr({innerType:t,typeName:N.ZodNullable,...B(e)});class Ii extends Z{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===A.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}Ii.create=(t,e)=>new Ii({innerType:t,typeName:N.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...B(e)});class Li extends Z{_parse(e){const{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ca(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Gt(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Gt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Li.create=(t,e)=>new Li({innerType:t,typeName:N.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...B(e)});class Al extends Z{_parse(e){if(this._getType(e)!==A.nan){const n=this._getOrReturnCtx(e);return E(n,{code:x.invalid_type,expected:A.nan,received:n.parsedType}),D}return{status:"valid",value:e.data}}}Al.create=t=>new Al({typeName:N.ZodNaN,...B(t)});class uf extends Z{_parse(e){const{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class Oi extends Z{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?D:i.status==="dirty"?(r.dirty(),Sn(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?D:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(e,r){return new Oi({in:e,out:r,typeName:N.ZodPipeline})}}class Mi extends Z{_parse(e){const r=this._def.innerType._parse(e),n=a=>(qr(a)&&(a.value=Object.freeze(a.value)),a);return ca(r)?r.then(a=>n(a)):n(r)}unwrap(){return this._def.innerType}}Mi.create=(t,e)=>new Mi({innerType:t,typeName:N.ZodReadonly,...B(e)});var N;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(N||(N={}));const d=Wt.create,Ke=Vr.create,re=Ci.create;sr.create;const Ce=Rt.create,z=ue.create,Cn=da.create;ha.create,Cr.create;const lt=fa.create,df=Ri.create,Ar=Zr.create;pa.create,lr.create,Wr.create;var Pi={inherit:"inherit",current:"currentcolor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"oklch(98.4% 0.003 247.858)",100:"oklch(96.8% 0.007 247.896)",200:"oklch(92.9% 0.013 255.508)",300:"oklch(86.9% 0.022 252.894)",400:"oklch(70.4% 0.04 256.788)",500:"oklch(55.4% 0.046 257.417)",600:"oklch(44.6% 0.043 257.281)",700:"oklch(37.2% 0.044 257.287)",800:"oklch(27.9% 0.041 260.031)",900:"oklch(20.8% 0.042 265.755)",950:"oklch(12.9% 0.042 264.695)"},gray:{50:"oklch(98.5% 0.002 247.839)",100:"oklch(96.7% 0.003 264.542)",200:"oklch(92.8% 0.006 264.531)",300:"oklch(87.2% 0.01 258.338)",400:"oklch(70.7% 0.022 261.325)",500:"oklch(55.1% 0.027 264.364)",600:"oklch(44.6% 0.03 256.802)",700:"oklch(37.3% 0.034 259.733)",800:"oklch(27.8% 0.033 256.848)",900:"oklch(21% 0.034 264.665)",950:"oklch(13% 0.028 261.692)"},zinc:{50:"oklch(98.5% 0 0)",100:"oklch(96.7% 0.001 286.375)",200:"oklch(92% 0.004 286.32)",300:"oklch(87.1% 0.006 286.286)",400:"oklch(70.5% 0.015 286.067)",500:"oklch(55.2% 0.016 285.938)",600:"oklch(44.2% 0.017 285.786)",700:"oklch(37% 0.013 285.805)",800:"oklch(27.4% 0.006 286.033)",900:"oklch(21% 0.006 285.885)",950:"oklch(14.1% 0.005 285.823)"},neutral:{50:"oklch(98.5% 0 0)",100:"oklch(97% 0 0)",200:"oklch(92.2% 0 0)",300:"oklch(87% 0 0)",400:"oklch(70.8% 0 0)",500:"oklch(55.6% 0 0)",600:"oklch(43.9% 0 0)",700:"oklch(37.1% 0 0)",800:"oklch(26.9% 0 0)",900:"oklch(20.5% 0 0)",950:"oklch(14.5% 0 0)"},stone:{50:"oklch(98.5% 0.001 106.423)",100:"oklch(97% 0.001 106.424)",200:"oklch(92.3% 0.003 48.717)",300:"oklch(86.9% 0.005 56.366)",400:"oklch(70.9% 0.01 56.259)",500:"oklch(55.3% 0.013 58.071)",600:"oklch(44.4% 0.011 73.639)",700:"oklch(37.4% 0.01 67.558)",800:"oklch(26.8% 0.007 34.298)",900:"oklch(21.6% 0.006 56.043)",950:"oklch(14.7% 0.004 49.25)"},red:{50:"oklch(97.1% 0.013 17.38)",100:"oklch(93.6% 0.032 17.717)",200:"oklch(88.5% 0.062 18.334)",300:"oklch(80.8% 0.114 19.571)",400:"oklch(70.4% 0.191 22.216)",500:"oklch(63.7% 0.237 25.331)",600:"oklch(57.7% 0.245 27.325)",700:"oklch(50.5% 0.213 27.518)",800:"oklch(44.4% 0.177 26.899)",900:"oklch(39.6% 0.141 25.723)",950:"oklch(25.8% 0.092 26.042)"},orange:{50:"oklch(98% 0.016 73.684)",100:"oklch(95.4% 0.038 75.164)",200:"oklch(90.1% 0.076 70.697)",300:"oklch(83.7% 0.128 66.29)",400:"oklch(75% 0.183 55.934)",500:"oklch(70.5% 0.213 47.604)",600:"oklch(64.6% 0.222 41.116)",700:"oklch(55.3% 0.195 38.402)",800:"oklch(47% 0.157 37.304)",900:"oklch(40.8% 0.123 38.172)",950:"oklch(26.6% 0.079 36.259)"},amber:{50:"oklch(98.7% 0.022 95.277)",100:"oklch(96.2% 0.059 95.617)",200:"oklch(92.4% 0.12 95.746)",300:"oklch(87.9% 0.169 91.605)",400:"oklch(82.8% 0.189 84.429)",500:"oklch(76.9% 0.188 70.08)",600:"oklch(66.6% 0.179 58.318)",700:"oklch(55.5% 0.163 48.998)",800:"oklch(47.3% 0.137 46.201)",900:"oklch(41.4% 0.112 45.904)",950:"oklch(27.9% 0.077 45.635)"},yellow:{50:"oklch(98.7% 0.026 102.212)",100:"oklch(97.3% 0.071 103.193)",200:"oklch(94.5% 0.129 101.54)",300:"oklch(90.5% 0.182 98.111)",400:"oklch(85.2% 0.199 91.936)",500:"oklch(79.5% 0.184 86.047)",600:"oklch(68.1% 0.162 75.834)",700:"oklch(55.4% 0.135 66.442)",800:"oklch(47.6% 0.114 61.907)",900:"oklch(42.1% 0.095 57.708)",950:"oklch(28.6% 0.066 53.813)"},lime:{50:"oklch(98.6% 0.031 120.757)",100:"oklch(96.7% 0.067 122.328)",200:"oklch(93.8% 0.127 124.321)",300:"oklch(89.7% 0.196 126.665)",400:"oklch(84.1% 0.238 128.85)",500:"oklch(76.8% 0.233 130.85)",600:"oklch(64.8% 0.2 131.684)",700:"oklch(53.2% 0.157 131.589)",800:"oklch(45.3% 0.124 130.933)",900:"oklch(40.5% 0.101 131.063)",950:"oklch(27.4% 0.072 132.109)"},green:{50:"oklch(98.2% 0.018 155.826)",100:"oklch(96.2% 0.044 156.743)",200:"oklch(92.5% 0.084 155.995)",300:"oklch(87.1% 0.15 154.449)",400:"oklch(79.2% 0.209 151.711)",500:"oklch(72.3% 0.219 149.579)",600:"oklch(62.7% 0.194 149.214)",700:"oklch(52.7% 0.154 150.069)",800:"oklch(44.8% 0.119 151.328)",900:"oklch(39.3% 0.095 152.535)",950:"oklch(26.6% 0.065 152.934)"},emerald:{50:"oklch(97.9% 0.021 166.113)",100:"oklch(95% 0.052 163.051)",200:"oklch(90.5% 0.093 164.15)",300:"oklch(84.5% 0.143 164.978)",400:"oklch(76.5% 0.177 163.223)",500:"oklch(69.6% 0.17 162.48)",600:"oklch(59.6% 0.145 163.225)",700:"oklch(50.8% 0.118 165.612)",800:"oklch(43.2% 0.095 166.913)",900:"oklch(37.8% 0.077 168.94)",950:"oklch(26.2% 0.051 172.552)"},teal:{50:"oklch(98.4% 0.014 180.72)",100:"oklch(95.3% 0.051 180.801)",200:"oklch(91% 0.096 180.426)",300:"oklch(85.5% 0.138 181.071)",400:"oklch(77.7% 0.152 181.912)",500:"oklch(70.4% 0.14 182.503)",600:"oklch(60% 0.118 184.704)",700:"oklch(51.1% 0.096 186.391)",800:"oklch(43.7% 0.078 188.216)",900:"oklch(38.6% 0.063 188.416)",950:"oklch(27.7% 0.046 192.524)"},cyan:{50:"oklch(98.4% 0.019 200.873)",100:"oklch(95.6% 0.045 203.388)",200:"oklch(91.7% 0.08 205.041)",300:"oklch(86.5% 0.127 207.078)",400:"oklch(78.9% 0.154 211.53)",500:"oklch(71.5% 0.143 215.221)",600:"oklch(60.9% 0.126 221.723)",700:"oklch(52% 0.105 223.128)",800:"oklch(45% 0.085 224.283)",900:"oklch(39.8% 0.07 227.392)",950:"oklch(30.2% 0.056 229.695)"},sky:{50:"oklch(97.7% 0.013 236.62)",100:"oklch(95.1% 0.026 236.824)",200:"oklch(90.1% 0.058 230.902)",300:"oklch(82.8% 0.111 230.318)",400:"oklch(74.6% 0.16 232.661)",500:"oklch(68.5% 0.169 237.323)",600:"oklch(58.8% 0.158 241.966)",700:"oklch(50% 0.134 242.749)",800:"oklch(44.3% 0.11 240.79)",900:"oklch(39.1% 0.09 240.876)",950:"oklch(29.3% 0.066 243.157)"},blue:{50:"oklch(97% 0.014 254.604)",100:"oklch(93.2% 0.032 255.585)",200:"oklch(88.2% 0.059 254.128)",300:"oklch(80.9% 0.105 251.813)",400:"oklch(70.7% 0.165 254.624)",500:"oklch(62.3% 0.214 259.815)",600:"oklch(54.6% 0.245 262.881)",700:"oklch(48.8% 0.243 264.376)",800:"oklch(42.4% 0.199 265.638)",900:"oklch(37.9% 0.146 265.522)",950:"oklch(28.2% 0.091 267.935)"},indigo:{50:"oklch(96.2% 0.018 272.314)",100:"oklch(93% 0.034 272.788)",200:"oklch(87% 0.065 274.039)",300:"oklch(78.5% 0.115 274.713)",400:"oklch(67.3% 0.182 276.935)",500:"oklch(58.5% 0.233 277.117)",600:"oklch(51.1% 0.262 276.966)",700:"oklch(45.7% 0.24 277.023)",800:"oklch(39.8% 0.195 277.366)",900:"oklch(35.9% 0.144 278.697)",950:"oklch(25.7% 0.09 281.288)"},violet:{50:"oklch(96.9% 0.016 293.756)",100:"oklch(94.3% 0.029 294.588)",200:"oklch(89.4% 0.057 293.283)",300:"oklch(81.1% 0.111 293.571)",400:"oklch(70.2% 0.183 293.541)",500:"oklch(60.6% 0.25 292.717)",600:"oklch(54.1% 0.281 293.009)",700:"oklch(49.1% 0.27 292.581)",800:"oklch(43.2% 0.232 292.759)",900:"oklch(38% 0.189 293.745)",950:"oklch(28.3% 0.141 291.089)"},purple:{50:"oklch(97.7% 0.014 308.299)",100:"oklch(94.6% 0.033 307.174)",200:"oklch(90.2% 0.063 306.703)",300:"oklch(82.7% 0.119 306.383)",400:"oklch(71.4% 0.203 305.504)",500:"oklch(62.7% 0.265 303.9)",600:"oklch(55.8% 0.288 302.321)",700:"oklch(49.6% 0.265 301.924)",800:"oklch(43.8% 0.218 303.724)",900:"oklch(38.1% 0.176 304.987)",950:"oklch(29.1% 0.149 302.717)"},fuchsia:{50:"oklch(97.7% 0.017 320.058)",100:"oklch(95.2% 0.037 318.852)",200:"oklch(90.3% 0.076 319.62)",300:"oklch(83.3% 0.145 321.434)",400:"oklch(74% 0.238 322.16)",500:"oklch(66.7% 0.295 322.15)",600:"oklch(59.1% 0.293 322.896)",700:"oklch(51.8% 0.253 323.949)",800:"oklch(45.2% 0.211 324.591)",900:"oklch(40.1% 0.17 325.612)",950:"oklch(29.3% 0.136 325.661)"},pink:{50:"oklch(97.1% 0.014 343.198)",100:"oklch(94.8% 0.028 342.258)",200:"oklch(89.9% 0.061 343.231)",300:"oklch(82.3% 0.12 346.018)",400:"oklch(71.8% 0.202 349.761)",500:"oklch(65.6% 0.241 354.308)",600:"oklch(59.2% 0.249 0.584)",700:"oklch(52.5% 0.223 3.958)",800:"oklch(45.9% 0.187 3.815)",900:"oklch(40.8% 0.153 2.432)",950:"oklch(28.4% 0.109 3.907)"},rose:{50:"oklch(96.9% 0.015 12.422)",100:"oklch(94.1% 0.03 12.58)",200:"oklch(89.2% 0.058 10.001)",300:"oklch(81% 0.117 11.638)",400:"oklch(71.2% 0.194 13.428)",500:"oklch(64.5% 0.246 16.439)",600:"oklch(58.6% 0.253 17.585)",700:"oklch(51.4% 0.222 16.935)",800:"oklch(45.5% 0.188 13.697)",900:"oklch(41% 0.159 10.272)",950:"oklch(27.1% 0.105 12.094)"}};const ze=z({minRem:Ke(),maxRem:Ke()}).or(d()),ga=z({0:d().optional(),50:d(),100:d(),200:d(),300:d(),400:d(),500:d(),600:d(),700:d(),800:d(),900:d(),950:d(),1e3:d().optional()}),Ni=z({color:d().optional(),background:d().optional(),borderWidth:d().optional(),borderColor:d().optional(),boxShadow:d().optional()}),hf=z({borderRadius:ze.optional(),custom:lt(d(),Cn([d(),Ke()])).optional(),hover:Ni.optional(),focus:Ni.optional()}).and(Ni),ff=z({family:d().optional()}),pf=lt(Ar(["predefinedQuestion","edit","newConversation","voteUp","voteDown","retry","message","messageLoading","thread","submit","abort","expand","help","attach","record","reward","share","audio","copy","dismiss","menu","info","menuClose","chevronDown","chevronUp","chevronTopDown","chevronDownSmall","internalLink","externalLink","liip","avatar","avatarLarge","openChat","speechInput","listUnordered","lightMode","darkMode","avatarLarge","settings","settingsClose","sources","model","checkbox","warning","headerLogo"]),d()),gf=z({font:ff.optional(),colors:z({brand:ga,accent:ga.optional(),highlight:ga,grey:ga}),base:z({fontSizeXs:ze.optional(),fontSizeSm:ze.optional(),fontSizeBody:ze.optional(),fontSizeH3:ze.optional(),fontSizeH2:ze.optional(),fontSizeH1:ze.optional(),fontWeightNormal:d().optional(),fontWeightBold:d().optional(),fontWeightTitle:d().optional(),lineHeightDefault:d().optional(),lineHeightSnug:d().optional(),lineHeightTight:d().optional(),borderRadius:ze.optional(),lineColor:d().optional(),boxShadow:d().optional()}),components:lt(d(),hf),svgs:pf}),ma=z({customCSS:d().optional(),fontCSS:d().optional(),fontURLs:d().array().optional(),tokens:gf});z({light:ma,dark:ma});const mf=z({light:ma,dark:ma}).deepPartial(),Rl=z({50:d(),100:d(),200:d(),300:d(),400:d(),500:d(),600:d(),700:d(),800:d(),900:d(),950:d()}),Il=Ar(["slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"]),Ll=Cn([Rl,Il]),vf=Cn([Rl.and(z({0:d(),1e3:d()})),Il]),Ol=z({avatarImageUrl:d().optional(),colors:z({brand:Ll.optional(),highlight:Ll.optional(),grey:vf.optional(),background:d().optional(),text:d().optional(),anchor:z({default:d().optional(),hover:d().optional()}).optional()}).optional(),font:z({family:d().optional(),urls:Ce(d()).optional(),sizeXs:ze.optional(),sizeSm:ze.optional(),sizeBody:ze.optional(),sizeH3:ze.optional(),sizeH2:ze.optional(),sizeH1:ze.optional(),weightNormal:d().optional(),weightBold:d().optional(),weightTitle:d().optional()}).optional(),borderRadius:ze.optional(),fineGrained:mf.optional()}),bf=z({blocked:d(),maintenance:d(),"rate-limit":d(),"server-error":d(),"too-short":d(),"too-long":d(),"quota-reached":d(),aborted:d(),"sse-error":d(),"client-error":d(),"unexpected-call":d(),"incomplete-error":d(),"feedback-failed":d(),"speech-not-supported":d(),"speech-transcription-failed":d(),"speech-no-text-detected":d(),"speech-microphone-access-denied":d(),"pii-detected":d()}),kf=z({email:d(),creditCard:d(),ahv:d(),phoneSwiss:d(),phoneInternational:d(),swissPassport:d(),longNumber:d()}),Ml=z({name:d(),namePlural:d().optional(),intro:d().optional(),placeholder:d(),values:lt(d(),d())}),yf=z({action:d(),label:d(),type:Ar(["primary","secondary"]).optional()}),wf=z({hash:d(),title:d(),content:d(),actions:Ce(yf).optional()}),Pl=z({introductionTitle:d(),introductionDisclaimer:d().optional(),termsInvitationToConsent:d().optional(),chatInputPlaceholder:d(),chatInputPlaceholderListening:d().optional(),chatInputSubmit:d(),chatInputAbort:d(),chatInputStartListening:d(),chatInputStopListening:d(),referenceLink:d(),referencesDisplay:d(),referencesHide:d(),referencesTitle:d(),referencesFurtherTitle:d(),newChat:d(),maintenanceModeError:d(),messageBotLoading:d(),messageBotError:d(),messageBotDefaultError:d(),noResultsFound:d(),chatFooterText:d().optional(),scrollToBottom:d(),openButtonTitle:d().optional(),openButtonDescription:d().optional(),openMenu:d(),openInfo:d(),aboutThisChat:d().optional(),closeMenu:d(),closeChat:d(),close:d(),send:d(),thankYouForFeedback:d(),giveFeedback:d(),sendFeedback:d(),feedbackFormTitle:d(),feedbackFormMessage:d(),feedbackFormMessagePlaceholder:d(),feedbackFormEmail:d(),feedbackFormEmailPlaceholder:d(),askQuestionAgain:d(),answerGood:d(),answerBad:d(),classificationSubmit:d(),classificationThankYou:d(),classificationTitle:d(),selectLanguage:d(),languageChanged:d(),selectColorTheme:d(),lightMode:d(),darkMode:d(),ariaMainNavigation:d(),ariaMainNavigationRegion:d(),ariaGotoMainNavigation:d(),ariaAskQuestion:d(),ariaAskQuestionRegion:d(),ariaNotifications:d(),ariaPredefinedQuestions:d(),ariaPredefinedQuestionsRegion:d(),ariaChatHistory:d(),ariaOpenChat:d(),ariaQuestionFromYou:d(),ariaAnswerFromBot:d(),ariaLastAnswerNavigation:d(),ariaQuestionSent:d(),ariaAnswerReady:d(),ariaAnswerFinished:d(),ariaAskQuestionAgain:d(),ariaAnswerGood:d(),ariaAnswerBad:d(),ariaReferenceSource:d(),ariaGiveFeedback:d(),ariaLanguageChanged:d(),ariaLightSelected:d(),ariaDarkSelected:d(),ariaSettings:d(),ariaSettingsRegion:d(),ariaReferencesRegion:d(),ariaFlyoutRegion:d(),ariaSelected:d(),ariaUnselected:d(),ariaAllSelected:d(),ariaAllUnselected:d(),ariaAllReseted:d(),popups:Ce(wf).optional(),termsAcceptButton:d().optional(),termsReadButton:d().optional(),selectors:lt(d(),Ml).optional(),hideSettings:d(),showSettings:d(),chooseAtLeastOneOption:d(),selectAll:d(),selectNone:d(),resetToDefaults:d(),messageTooLong:d()}),Qr=Ar(["en","de","fr","it"]),Nl=lt(Qr,Pl.partial().extend({selectors:lt(d(),Ml).optional()}));lt(Qr,bf),lt(Qr,kf);const Dl=z({label:d(),options:Ce(z({label:d(),value:Ke()}))}),_f=z({label:d(),icon:d(),url:d(),target:Ar(["_blank","_self"]).optional()}),xf=z({label:d().nullable(),question:d()}),$l=z({impact:Dl.optional(),quality:Dl.optional()});z({classification:$l.optional()});const Sf=z({predefinedQuestions:Ce(xf)}),zl=Cn([z({maintenance:df(!0)}),z({id:d(),cID:d()})]);lt(Qr,Pl);const Tf=z({settingName:d(),iconName:d(),settingIntro:d().optional(),type:Ar(["single-select","multi-select"]),allowEmpty:re(),values:Ce(d()),defaultValues:Ce(d()).optional()}),Fl=z({showPredefinedQuestions:re(),showOverallFeedbackButton:re(),showOverallFeedbackEmail:re(),showCloseChatButton:re(),showContextMenu:re(),showContextInfo:re(),showReferencesByDefault:re(),showExpandedSelectors:re(),showTextFeedback:re(),inlineLayout:re(),allowAudioInput:re(),blockPII:re(),questionPrefix:d(),menu:lt(Qr,Ce(_f)).optional(),supportedLanguages:Ce(Qr),classification:$l.optional(),theme:Ol,translations:Nl,buttonHref:d().optional(),addQueryToUrlParams:re().optional(),addRetrievalQuestionToUrlParams:re().optional(),renderKatex:re().optional(),reflectLanguageInPath:re().optional(),sendReferrer:Ar(["all","own","none","location"]).optional(),selectorsConfig:Ce(Tf).default([]),questionLengthLimit:Ke().optional(),forceConsent:re().optional(),askQuestionAgain:re()}).partial().and(z({theme:z({name:d().optional()}).optional()}));class Ef{constructor(e){this.chatResponseData=e,this.id=this.chatResponseData.id}id;async isReadyForFeedback(){return await this.chatResponseData.readyForFeedback.toPromise(),!0}subscribe(e,r){return this.chatResponseData.readableStore.subscribe(e,r)}getContent(){return this.chatResponseData.content.toPromise()}abort(){return this.chatResponseData.abort()}async thumbsUp(){await this.isReadyForFeedback(),await this.chatResponseData.liipgptClientPrimitive.thumbsUp(this.id,this.chatResponseData.question)}async thumbsDown(){await this.isReadyForFeedback(),await this.chatResponseData.liipgptClientPrimitive.thumbsDown(this.id,this.chatResponseData.question)}async feedback(e){await this.isReadyForFeedback(),await this.chatResponseData.liipgptClientPrimitive.feedback(this.id,this.chatResponseData.question,e)}}const Te=[];for(let t=0;t<256;++t)Te.push((t+256).toString(16).slice(1));function Cf(t,e=0){return(Te[t[e+0]]+Te[t[e+1]]+Te[t[e+2]]+Te[t[e+3]]+"-"+Te[t[e+4]]+Te[t[e+5]]+"-"+Te[t[e+6]]+Te[t[e+7]]+"-"+Te[t[e+8]]+Te[t[e+9]]+"-"+Te[t[e+10]]+Te[t[e+11]]+Te[t[e+12]]+Te[t[e+13]]+Te[t[e+14]]+Te[t[e+15]]).toLowerCase()}let Di;const Af=new Uint8Array(16);function Rf(){if(!Di){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Di=crypto.getRandomValues.bind(crypto)}return Di(Af)}const jl={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function If(t,e,r){t=t||{};const n=t.random??t.rng?.()??Rf();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,Cf(n)}function Bl(t,e,r){return jl.randomUUID&&!t?jl.randomUUID():If(t)}const Yr=new Map;class Lf{get length(){return Yr.size}clear(){Yr.clear()}getItem(e){return Yr.get(e)||null}key(e){return Array.from(Yr.keys())[e]||null}removeItem(e){Yr.delete(e)}setItem(e,r){Yr.set(e,String(r))}}const vt=globalThis.localStorage??new Lf,Of=async t=>{try{const e=vt.getItem("liipgpt:uID")||vt.getItem("uID"),r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({referrer:globalThis?.document?.referrer||null,uID:e})},n=await t.fetchData("/login",zl,{},r).catch(a=>(console.log("Failed to /login use /log",a),t.fetchData("/log",zl,{},r)));if("maintenance"in n&&n.maintenance)return{mode:"maintenance"};if(!("id"in n))throw new Error("Invalid response format: missing user id");return vt.setItem("liipgpt:uID",n.id),{mode:"ready",userId:n.id}}catch(e){throw console.error("Failed to fetch user data:",e),e}};var Xe=function(t,e){if(!(this instanceof Xe))return new Xe(t,e);this.url=t,e=e||{},this.headers=e.headers||{},this.payload=e.payload!==void 0?e.payload:"",this.method=e.method||this.payload&&"POST"||"GET",this.withCredentials=!!e.withCredentials,this.debug=!!e.debug,this.autoReconnect=e.autoReconnect!==void 0?e.autoReconnect:!1,this.reconnectDelay=e.reconnectDelay!==void 0?e.reconnectDelay:3e3,this.maxRetries=e.maxRetries!==void 0?e.maxRetries:null,this.retryCount=0,this.reconnectTimer=null,this.useLastEventId=e.useLastEventId!==void 0?e.useLastEventId:!0,this.FIELD_SEPARATOR=":",this.listeners={},this.xhr=null,this.readyState=Xe.INITIALIZING,this.progress=0,this.chunk="",this.lastEventId="",this.addEventListener=function(r,n){this.listeners[r]===void 0&&(this.listeners[r]=[]),this.listeners[r].indexOf(n)===-1&&this.listeners[r].push(n)},this.removeEventListener=function(r,n){if(this.listeners[r]===void 0)return;const a=[];this.listeners[r].forEach(function(i){i!==n&&a.push(i)}),a.length===0?delete this.listeners[r]:this.listeners[r]=a},this.dispatchEvent=function(r){if(!r)return!0;this.debug&&console.debug(r),r.source=this;const n="on"+r.type;return this.hasOwnProperty(n)&&(this[n].call(this,r),r.defaultPrevented)?!1:this.listeners[r.type]?this.listeners[r.type].every(function(a){return a(r),!r.defaultPrevented}):!0},this._markClosed=function(){if(this.xhr=null,this.progress=0,this.chunk="",this._setReadyState(Xe.CLOSED),this.autoReconnect){if(this.maxRetries!==null&&this.retryCount>=this.maxRetries){this.debug&&console.debug(`SSE max retries (${this.maxRetries}) reached, stopping reconnection attempts`),this.autoReconnect=!1,this.close();return}this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.debug&&console.debug(`SSE will attempt to reconnect in ${this.reconnectDelay}ms (attempt ${this.retryCount+1}${this.maxRetries?"/"+this.maxRetries:""})`),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.retryCount++,this.stream()},this.reconnectDelay)}},this._setReadyState=function(r){const n=new CustomEvent("readystatechange");n.readyState=r,this.readyState=r,this.dispatchEvent(n)},this._onStreamFailure=function(r){const n=new CustomEvent("error");n.responseCode=r.currentTarget.status,n.data=r.currentTarget.response,this.dispatchEvent(n),this._markClosed()},this._onStreamAbort=function(){this.dispatchEvent(new CustomEvent("abort")),this._markClosed()},this._onStreamProgress=function(r){if(!this.xhr)return;if(this.xhr.status<200||this.xhr.status>=300){this._onStreamFailure(r);return}this.retryCount=0;const n=this.xhr.responseText.substring(this.progress);this.progress+=n.length;const a=(this.chunk+n).split(/(\r\n\r\n|\r\r|\n\n)/g),i=a.pop();a.forEach((function(o){o.trim().length>0&&this.dispatchEvent(this._parseEventChunk(o))}).bind(this)),this.chunk=i},this._onStreamLoaded=function(r){this._onStreamProgress(r),this.dispatchEvent(this._parseEventChunk(this.chunk)),this.chunk="",this._markClosed()},this._parseEventChunk=function(r){if(!r||r.length===0)return null;this.debug&&console.debug(r);const n={id:null,retry:null,data:null,event:null};if(r.split(/\n|\r\n|\r/).forEach((function(i){const o=i.indexOf(this.FIELD_SEPARATOR);let s,c;if(o>0){const l=i[o+1]===" "?2:1;s=i.substring(0,o),c=i.substring(o+l)}else if(o<0)s=i,c="";else return;s in n&&(s==="data"&&n[s]!==null?n.data+=`
|
|
72
|
+
Please report this to https://github.com/markedjs/marked.`,t){const n="<p>An error occurred:</p><pre>"+Ct(r.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(r);throw r}}},Er=new sl;function K(t,e){return Er.parse(t,e)}K.options=K.setOptions=function(t){return Er.setOptions(t),K.defaults=Er.defaults,Hs(K.defaults),K},K.getDefaults=pi,K.defaults=Tr,K.use=function(...t){return Er.use(...t),K.defaults=Er.defaults,Hs(K.defaults),K},K.walkTokens=function(t,e){return Er.walkTokens(t,e)},K.parseInline=Er.parseInline,K.Parser=Zt,K.parser=Zt.parse,K.Renderer=sa,K.TextRenderer=xi,K.Lexer=Ht,K.lexer=Ht.lex,K.Tokenizer=oa,K.Hooks=la,K.parse=K,K.options,K.setOptions,K.use,K.walkTokens,K.parseInline,Zt.parse,Ht.lex;const ll=t=>(Object.getOwnPropertyNames(t).forEach(e=>{const r=t[e];r&&typeof r=="object"&&ll(r)}),Object.freeze(t)),cl=ll({all:[],used:[],unused:[]}),Oh=t=>{const e=Yd(t);return e.addHook("uponSanitizeElement",function(r,n){const a=n.tagName||r.nodeName.toLowerCase();a.startsWith("liipgpt-")&&(n.allowedTags[a]=!0)}),e};class ul{marked;currentReferences=cl;lastUsedIndex=0;DomPurity;constructor(e={}){this.marked=new sl({async:!1,breaks:!0}).use(this.createFootnoteExtension(),...e.extensions??[]),this.DomPurity=Oh(e.window)}createFootnoteExtension=()=>{const e=this;return{extensions:[{name:"footnote",level:"inline",start(r){return r.match(/\[\^(\d+)\]/)?.index},tokenizer(r){const a=/^\[\^(\d+)\]/.exec(r);if(a){const[i,o]=a;return{type:"footnote",raw:i,refNumber:o}}},renderer(r){if(r.type==="footnote"){const n=parseInt(r.refNumber)-1,a=e.currentReferences.all[n];if(!a)return console.error("Could not find ref with index:",n),"";let i;return a?.referenceIndex.used?i=a.referenceIndex.used:(e.currentReferences.used.push(a),e.lastUsedIndex++,i=e.lastUsedIndex,a.referenceIndex.used=i),` <liipgpt-reference-number data-all-index="${n}" data-used-index="${i}" data-source="${JSON.stringify(a).replace(/"/g,""")}"></liipgpt-reference-number>`}}}]}};parse(e){return this.DomPurity.sanitize(this.marked.parse(e),{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0,mathMl:!0},FORBID_TAGS:["hr"]})}toHTML(e,r){this.currentReferences=r;const n=this.parse(e);return this.currentReferences=cl,n}}function Mh(){let t,e;return{promise:new Promise((n,a)=>{e=n,t=a}),reject:t,resolve:e}}class dl{promise;resolve;reject;constructor(){const{promise:e,resolve:r,reject:n}=Mh();this.promise=e,this.resolve=r,this.reject=n}then(e,r){return this.promise.then(e,r)}catch(e){return this.promise.catch(e)}finally(e){return this.promise.finally(e)}toPromise(){return this.promise}[Symbol.toStringTag]="Flag"}class Si{hasValue=new dl;currentValue;setValue(e){this.currentValue=e,this.hasValue.resolve()}cleanup(e){this.hasValue.reject(e)}getCurrentValue(){return this.currentValue}async toPromise(){return await this.hasValue,this.currentValue}then(e,r){return this.toPromise().then(e,r)}catch(e){return this.toPromise().catch(e)}finally(e){return this.toPromise().finally(e)}[Symbol.toStringTag]="FutureValue"}const Ph=t=>{try{return new URL(t).hostname}catch{return t}};function Nh(t){return t.replace(/<[^>]*>/g,"").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')}const Dh=({url:t,considered:e,title:r,description:n,summary:a})=>{const i=Ph(t);return{url:t,considered:e,referenceIndex:{},score:0,metadata:{},display:{card:{title:r,description:n||a,badge:t},listItem:{title:r,badge:i}}}};class $h{constructor(e){this.options=e,this.store=vd({id:e.id,state:"loading",errors:[],type:"bot",time:new Date().toISOString(),message:{markdown:"",html:"",text:""},references:{all:[],used:[],unused:[]},retrievalQuestion:e.userQuestion})}store;content=new Si;backendSendsMappedRefs=!1;pushError(e){this.options.onError?.(e),this.store.update(r=>({...r,errors:[...r.errors,e]}))}updateRequestId(e){this.store.update(r=>({...r,id:e}))}updateText(e){this.store.update(r=>{const n=r.message.markdown+e,a=this.options.markdownRenderer.toHTML(n,r.references);return{...r,state:"streaming",message:{markdown:n,html:a,text:""}}})}finishMessage(){this.store.update(e=>{const r={...e,state:"done"};return r.references.unused=r.references.all.filter(n=>n.referenceIndex.used===void 0),r.message.text=Nh(r.message.html),this.options?.onFinish?.(r),this.content.setValue(r),r})}addReference(e){this.store.update(r=>{const n=r.references.all,a=n.length,i=[...n,{...e,referenceIndex:{all:a}}];return{...r,references:{used:r.references.used,all:i}}})}addMappedReference(e){this.backendSendsMappedRefs=!0,this.addReference(e)}addOldReference(e){this.backendSendsMappedRefs||this.addReference(Dh(e))}updateRetrievalQuestion(e){this.store.update(r=>({...r,retrievalQuestion:e}))}getReadableStore(){return{subscribe:this.store.subscribe}}getPromise(){return this.content.toPromise()}}var W;(function(t){t.assertEqual=a=>{};function e(a){}t.assertIs=e;function r(a){throw new Error}t.assertNever=r,t.arrayToEnum=a=>{const i={};for(const o of a)i[o]=o;return i},t.getValidEnumValues=a=>{const i=t.objectKeys(a).filter(s=>typeof a[a[s]]!="number"),o={};for(const s of i)o[s]=a[s];return t.objectValues(o)},t.objectValues=a=>t.objectKeys(a).map(function(i){return a[i]}),t.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&i.push(o);return i},t.find=(a,i)=>{for(const o of a)if(i(o))return o},t.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,i=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=n,t.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(W||(W={}));var hl;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(hl||(hl={}));const A=W.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),or=t=>{switch(typeof t){case"undefined":return A.undefined;case"string":return A.string;case"number":return Number.isNaN(t)?A.nan:A.number;case"boolean":return A.boolean;case"function":return A.function;case"bigint":return A.bigint;case"symbol":return A.symbol;case"object":return Array.isArray(t)?A.array:t===null?A.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?A.promise:typeof Map<"u"&&t instanceof Map?A.map:typeof Set<"u"&&t instanceof Set?A.set:typeof Date<"u"&&t instanceof Date?A.date:A.object;default:return A.unknown}},x=W.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Gt extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){const r=e||function(i){return i.message},n={_errors:[]},a=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let s=n,c=0;for(;c<o.path.length;){const l=o.path[c];c===o.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(r(o))):s[l]=s[l]||{_errors:[]},s=s[l],c++}}};return a(this),n}static assert(e){if(!(e instanceof Gt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,W.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},n=[];for(const a of this.issues)if(a.path.length>0){const i=a.path[0];r[i]=r[i]||[],r[i].push(e(a))}else n.push(e(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Gt.create=t=>new Gt(t);const Ti=(t,e)=>{let r;switch(t.code){case x.invalid_type:t.received===A.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case x.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,W.jsonStringifyReplacer)}`;break;case x.unrecognized_keys:r=`Unrecognized key(s) in object: ${W.joinValues(t.keys,", ")}`;break;case x.invalid_union:r="Invalid input";break;case x.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${W.joinValues(t.options)}`;break;case x.invalid_enum_value:r=`Invalid enum value. Expected ${W.joinValues(t.options)}, received '${t.received}'`;break;case x.invalid_arguments:r="Invalid function arguments";break;case x.invalid_return_type:r="Invalid function return type";break;case x.invalid_date:r="Invalid date";break;case x.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:W.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case x.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case x.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case x.custom:r="Invalid input";break;case x.invalid_intersection_types:r="Intersection results could not be merged";break;case x.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case x.not_finite:r="Number must be finite";break;default:r=e.defaultError,W.assertNever(t)}return{message:r}};let zh=Ti;function Fh(){return zh}const Bh=t=>{const{data:e,path:r,errorMaps:n,issueData:a}=t,i=[...r,...a.path||[]],o={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let s="";const c=n.filter(l=>!!l).slice().reverse();for(const l of c)s=l(o,{data:e,defaultError:s}).message;return{...a,path:i,message:s}};function E(t,e){const r=Fh(),n=Bh({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Ti?void 0:Ti].filter(a=>!!a)});t.common.issues.push(n)}class $e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const n=[];for(const a of r){if(a.status==="aborted")return D;a.status==="dirty"&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){const n=[];for(const a of r){const i=await a.key,o=await a.value;n.push({key:i,value:o})}return $e.mergeObjectSync(e,n)}static mergeObjectSync(e,r){const n={};for(const a of r){const{key:i,value:o}=a;if(i.status==="aborted"||o.status==="aborted")return D;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(n[i.value]=o.value)}return{status:e.value,value:n}}}const D=Object.freeze({status:"aborted"}),Sn=t=>({status:"dirty",value:t}),st=t=>({status:"valid",value:t}),fl=t=>t.status==="aborted",pl=t=>t.status==="dirty",qr=t=>t.status==="valid",ca=t=>typeof Promise<"u"&&t instanceof Promise;var I;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(I||(I={}));class At{constructor(e,r,n,a){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const gl=(t,e)=>{if(qr(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Gt(t.common.issues);return this._error=r,this._error}}};function j(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:n,description:a}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(o,s)=>{const{message:c}=t;return o.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:c??n??s.defaultError}:o.code!=="invalid_type"?{message:s.defaultError}:{message:c??r??s.defaultError}},description:a}}class Z{get description(){return this._def.description}_getType(e){return or(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:or(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new $e,ctx:{common:e.parent.common,data:e.data,parsedType:or(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(ca(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){const n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:or(e)},a=this._parseSync({data:e,path:n.path,parent:n});return gl(n,a)}"~validate"(e){const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:or(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:r});return qr(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>qr(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){const n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){const n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:or(e)},a=this._parse({data:e,path:n.path,parent:n}),i=await(ca(a)?a:Promise.resolve(a));return gl(n,i)}refine(e,r){const n=a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r;return this._refinement((a,i)=>{const o=e(a),s=()=>i.addIssue({code:x.custom,...n(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(e,r){return this._refinement((n,a)=>e(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(e){return new Gr({schema:this,typeName:N.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return lr.create(this,this._def)}nullable(){return Wr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Rt.create(this)}promise(){return pa.create(this,this._def)}or(e){return da.create([this,e],this._def)}and(e){return ha.create(this,e,this._def)}transform(e){return new Gr({...j(this._def),schema:this,typeName:N.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new Ii({...j(this._def),innerType:this,defaultValue:r,typeName:N.ZodDefault})}brand(){return new uf({typeName:N.ZodBranded,type:this,...j(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new Li({...j(this._def),innerType:this,catchValue:r,typeName:N.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Oi.create(this,e)}readonly(){return Mi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const jh=/^c[^\s-]{8,}$/i,Uh=/^[0-9a-z]+$/,qh=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Vh=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Hh=/^[a-z0-9_-]{21}$/i,Zh=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Gh=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Wh=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Qh="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ei;const Yh=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Kh=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Xh=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Jh=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ef=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,tf=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ml="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",rf=new RegExp(`^${ml}$`);function vl(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function nf(t){return new RegExp(`^${vl(t)}$`)}function af(t){let e=`${ml}T${vl(t)}`;const r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function of(t,e){return!!((e==="v4"||!e)&&Yh.test(t)||(e==="v6"||!e)&&Xh.test(t))}function sf(t,e){if(!Zh.test(t))return!1;try{const[r]=t.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function lf(t,e){return!!((e==="v4"||!e)&&Kh.test(t)||(e==="v6"||!e)&&Jh.test(t))}class Wt extends Z{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==A.string){const i=this._getOrReturnCtx(e);return E(i,{code:x.invalid_type,expected:A.string,received:i.parsedType}),D}const n=new $e;let a;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(a=this._getOrReturnCtx(e,a),E(a,{code:x.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(a=this._getOrReturnCtx(e,a),E(a,{code:x.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const o=e.data.length>i.value,s=e.data.length<i.value;(o||s)&&(a=this._getOrReturnCtx(e,a),o?E(a,{code:x.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):s&&E(a,{code:x.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")Wh.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"email",code:x.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Ei||(Ei=new RegExp(Qh,"u")),Ei.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"emoji",code:x.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")Vh.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"uuid",code:x.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")Hh.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"nanoid",code:x.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")jh.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"cuid",code:x.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")Uh.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"cuid2",code:x.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")qh.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"ulid",code:x.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),E(a,{validation:"url",code:x.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"regex",code:x.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(e,a),E(a,{code:x.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(a=this._getOrReturnCtx(e,a),E(a,{code:x.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(a=this._getOrReturnCtx(e,a),E(a,{code:x.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?af(i).test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{code:x.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?rf.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{code:x.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?nf(i).test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{code:x.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?Gh.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"duration",code:x.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?of(e.data,i.version)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"ip",code:x.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?sf(e.data,i.alg)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"jwt",code:x.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?lf(e.data,i.version)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"cidr",code:x.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?ef.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"base64",code:x.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?tf.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"base64url",code:x.invalid_string,message:i.message}),n.dirty()):W.assertNever(i);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(a=>e.test(a),{validation:r,code:x.invalid_string,...I.errToObj(n)})}_addCheck(e){return new Wt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...I.errToObj(e)})}url(e){return this._addCheck({kind:"url",...I.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...I.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...I.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...I.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...I.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...I.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...I.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...I.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...I.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...I.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...I.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...I.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...I.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...I.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...I.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...I.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...I.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...I.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...I.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...I.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...I.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...I.errToObj(r)})}nonempty(e){return this.min(1,I.errToObj(e))}trim(){return new Wt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Wt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Wt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}Wt.create=t=>new Wt({checks:[],typeName:N.ZodString,coerce:t?.coerce??!1,...j(t)});function cf(t,e){const r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,a=r>n?r:n,i=Number.parseInt(t.toFixed(a).replace(".","")),o=Number.parseInt(e.toFixed(a).replace(".",""));return i%o/10**a}class Vr extends Z{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==A.number){const i=this._getOrReturnCtx(e);return E(i,{code:x.invalid_type,expected:A.number,received:i.parsedType}),D}let n;const a=new $e;for(const i of this._def.checks)i.kind==="int"?W.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),E(n,{code:x.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),E(n,{code:x.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),E(n,{code:x.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?cf(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),E(n,{code:x.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),E(n,{code:x.not_finite,message:i.message}),a.dirty()):W.assertNever(i);return{status:a.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,I.toString(r))}gt(e,r){return this.setLimit("min",e,!1,I.toString(r))}lte(e,r){return this.setLimit("max",e,!0,I.toString(r))}lt(e,r){return this.setLimit("max",e,!1,I.toString(r))}setLimit(e,r,n,a){return new Vr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:I.toString(a)}]})}_addCheck(e){return new Vr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:I.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:I.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:I.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:I.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:I.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:I.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:I.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:I.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:I.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&W.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}}Vr.create=t=>new Vr({checks:[],typeName:N.ZodNumber,coerce:t?.coerce||!1,...j(t)});class Tn extends Z{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==A.bigint)return this._getInvalidInput(e);let n;const a=new $e;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),E(n,{code:x.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),E(n,{code:x.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),E(n,{code:x.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):W.assertNever(i);return{status:a.value,value:e.data}}_getInvalidInput(e){const r=this._getOrReturnCtx(e);return E(r,{code:x.invalid_type,expected:A.bigint,received:r.parsedType}),D}gte(e,r){return this.setLimit("min",e,!0,I.toString(r))}gt(e,r){return this.setLimit("min",e,!1,I.toString(r))}lte(e,r){return this.setLimit("max",e,!0,I.toString(r))}lt(e,r){return this.setLimit("max",e,!1,I.toString(r))}setLimit(e,r,n,a){return new Tn({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:I.toString(a)}]})}_addCheck(e){return new Tn({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:I.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:I.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:I.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:I.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:I.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}Tn.create=t=>new Tn({checks:[],typeName:N.ZodBigInt,coerce:t?.coerce??!1,...j(t)});class Ci extends Z{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==A.boolean){const n=this._getOrReturnCtx(e);return E(n,{code:x.invalid_type,expected:A.boolean,received:n.parsedType}),D}return st(e.data)}}Ci.create=t=>new Ci({typeName:N.ZodBoolean,coerce:t?.coerce||!1,...j(t)});class ua extends Z{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==A.date){const i=this._getOrReturnCtx(e);return E(i,{code:x.invalid_type,expected:A.date,received:i.parsedType}),D}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return E(i,{code:x.invalid_date}),D}const n=new $e;let a;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(a=this._getOrReturnCtx(e,a),E(a,{code:x.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(a=this._getOrReturnCtx(e,a),E(a,{code:x.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):W.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ua({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:I.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:I.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}ua.create=t=>new ua({checks:[],coerce:t?.coerce||!1,typeName:N.ZodDate,...j(t)});class bl extends Z{_parse(e){if(this._getType(e)!==A.symbol){const n=this._getOrReturnCtx(e);return E(n,{code:x.invalid_type,expected:A.symbol,received:n.parsedType}),D}return st(e.data)}}bl.create=t=>new bl({typeName:N.ZodSymbol,...j(t)});class kl extends Z{_parse(e){if(this._getType(e)!==A.undefined){const n=this._getOrReturnCtx(e);return E(n,{code:x.invalid_type,expected:A.undefined,received:n.parsedType}),D}return st(e.data)}}kl.create=t=>new kl({typeName:N.ZodUndefined,...j(t)});class yl extends Z{_parse(e){if(this._getType(e)!==A.null){const n=this._getOrReturnCtx(e);return E(n,{code:x.invalid_type,expected:A.null,received:n.parsedType}),D}return st(e.data)}}yl.create=t=>new yl({typeName:N.ZodNull,...j(t)});class wl extends Z{constructor(){super(...arguments),this._any=!0}_parse(e){return st(e.data)}}wl.create=t=>new wl({typeName:N.ZodAny,...j(t)});class _l extends Z{constructor(){super(...arguments),this._unknown=!0}_parse(e){return st(e.data)}}_l.create=t=>new _l({typeName:N.ZodUnknown,...j(t)});class sr extends Z{_parse(e){const r=this._getOrReturnCtx(e);return E(r,{code:x.invalid_type,expected:A.never,received:r.parsedType}),D}}sr.create=t=>new sr({typeName:N.ZodNever,...j(t)});class xl extends Z{_parse(e){if(this._getType(e)!==A.undefined){const n=this._getOrReturnCtx(e);return E(n,{code:x.invalid_type,expected:A.void,received:n.parsedType}),D}return st(e.data)}}xl.create=t=>new xl({typeName:N.ZodVoid,...j(t)});class Rt extends Z{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),a=this._def;if(r.parsedType!==A.array)return E(r,{code:x.invalid_type,expected:A.array,received:r.parsedType}),D;if(a.exactLength!==null){const o=r.data.length>a.exactLength.value,s=r.data.length<a.exactLength.value;(o||s)&&(E(r,{code:o?x.too_big:x.too_small,minimum:s?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(E(r,{code:x.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(E(r,{code:x.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,s)=>a.type._parseAsync(new At(r,o,r.path,s)))).then(o=>$e.mergeArray(n,o));const i=[...r.data].map((o,s)=>a.type._parseSync(new At(r,o,r.path,s)));return $e.mergeArray(n,i)}get element(){return this._def.type}min(e,r){return new Rt({...this._def,minLength:{value:e,message:I.toString(r)}})}max(e,r){return new Rt({...this._def,maxLength:{value:e,message:I.toString(r)}})}length(e,r){return new Rt({...this._def,exactLength:{value:e,message:I.toString(r)}})}nonempty(e){return this.min(1,e)}}Rt.create=(t,e)=>new Rt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:N.ZodArray,...j(e)});function Hr(t){if(t instanceof ue){const e={};for(const r in t.shape){const n=t.shape[r];e[r]=lr.create(Hr(n))}return new ue({...t._def,shape:()=>e})}else return t instanceof Rt?new Rt({...t._def,type:Hr(t.element)}):t instanceof lr?lr.create(Hr(t.unwrap())):t instanceof Wr?Wr.create(Hr(t.unwrap())):t instanceof Cr?Cr.create(t.items.map(e=>Hr(e))):t}class ue extends Z{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=W.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==A.object){const l=this._getOrReturnCtx(e);return E(l,{code:x.invalid_type,expected:A.object,received:l.parsedType}),D}const{status:n,ctx:a}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof sr&&this._def.unknownKeys==="strip"))for(const l in a.data)o.includes(l)||s.push(l);const c=[];for(const l of o){const u=i[l],p=a.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new At(a,p,a.path,l)),alwaysSet:l in a.data})}if(this._def.catchall instanceof sr){const l=this._def.unknownKeys;if(l==="passthrough")for(const u of s)c.push({key:{status:"valid",value:u},value:{status:"valid",value:a.data[u]}});else if(l==="strict")s.length>0&&(E(a,{code:x.unrecognized_keys,keys:s}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const u of s){const p=a.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new At(a,p,a.path,u)),alwaysSet:u in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const l=[];for(const u of c){const p=await u.key,h=await u.value;l.push({key:p,value:h,alwaysSet:u.alwaysSet})}return l}).then(l=>$e.mergeObjectSync(n,l)):$e.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return I.errToObj,new ue({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{const a=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:I.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new ue({...this._def,unknownKeys:"strip"})}passthrough(){return new ue({...this._def,unknownKeys:"passthrough"})}extend(e){return new ue({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ue({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:N.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new ue({...this._def,catchall:e})}pick(e){const r={};for(const n of W.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new ue({...this._def,shape:()=>r})}omit(e){const r={};for(const n of W.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new ue({...this._def,shape:()=>r})}deepPartial(){return Hr(this)}partial(e){const r={};for(const n of W.objectKeys(this.shape)){const a=this.shape[n];e&&!e[n]?r[n]=a:r[n]=a.optional()}return new ue({...this._def,shape:()=>r})}required(e){const r={};for(const n of W.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof lr;)i=i._def.innerType;r[n]=i}return new ue({...this._def,shape:()=>r})}keyof(){return El(W.objectKeys(this.shape))}}ue.create=(t,e)=>new ue({shape:()=>t,unknownKeys:"strip",catchall:sr.create(),typeName:N.ZodObject,...j(e)}),ue.strictCreate=(t,e)=>new ue({shape:()=>t,unknownKeys:"strict",catchall:sr.create(),typeName:N.ZodObject,...j(e)}),ue.lazycreate=(t,e)=>new ue({shape:t,unknownKeys:"strip",catchall:sr.create(),typeName:N.ZodObject,...j(e)});class da extends Z{_parse(e){const{ctx:r}=this._processInputParams(e),n=this._def.options;function a(i){for(const s of i)if(s.result.status==="valid")return s.result;for(const s of i)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;const o=i.map(s=>new Gt(s.ctx.common.issues));return E(r,{code:x.invalid_union,unionErrors:o}),D}if(r.common.async)return Promise.all(n.map(async i=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(a);{let i;const o=[];for(const c of n){const l={...r,common:{...r.common,issues:[]},parent:null},u=c._parseSync({data:r.data,path:r.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!i&&(i={result:u,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;const s=o.map(c=>new Gt(c));return E(r,{code:x.invalid_union,unionErrors:s}),D}}get options(){return this._def.options}}da.create=(t,e)=>new da({options:t,typeName:N.ZodUnion,...j(e)});function Ai(t,e){const r=or(t),n=or(e);if(t===e)return{valid:!0,data:t};if(r===A.object&&n===A.object){const a=W.objectKeys(e),i=W.objectKeys(t).filter(s=>a.indexOf(s)!==-1),o={...t,...e};for(const s of i){const c=Ai(t[s],e[s]);if(!c.valid)return{valid:!1};o[s]=c.data}return{valid:!0,data:o}}else if(r===A.array&&n===A.array){if(t.length!==e.length)return{valid:!1};const a=[];for(let i=0;i<t.length;i++){const o=t[i],s=e[i],c=Ai(o,s);if(!c.valid)return{valid:!1};a.push(c.data)}return{valid:!0,data:a}}else return r===A.date&&n===A.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class ha extends Z{_parse(e){const{status:r,ctx:n}=this._processInputParams(e),a=(i,o)=>{if(fl(i)||fl(o))return D;const s=Ai(i.value,o.value);return s.valid?((pl(i)||pl(o))&&r.dirty(),{status:r.value,value:s.data}):(E(n,{code:x.invalid_intersection_types}),D)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,o])=>a(i,o)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}ha.create=(t,e,r)=>new ha({left:t,right:e,typeName:N.ZodIntersection,...j(r)});class Cr extends Z{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==A.array)return E(n,{code:x.invalid_type,expected:A.array,received:n.parsedType}),D;if(n.data.length<this._def.items.length)return E(n,{code:x.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),D;!this._def.rest&&n.data.length>this._def.items.length&&(E(n,{code:x.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const i=[...n.data].map((o,s)=>{const c=this._def.items[s]||this._def.rest;return c?c._parse(new At(n,o,n.path,s)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>$e.mergeArray(r,o)):$e.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new Cr({...this._def,rest:e})}}Cr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Cr({items:t,typeName:N.ZodTuple,rest:null,...j(e)})};class fa extends Z{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==A.object)return E(n,{code:x.invalid_type,expected:A.object,received:n.parsedType}),D;const a=[],i=this._def.keyType,o=this._def.valueType;for(const s in n.data)a.push({key:i._parse(new At(n,s,n.path,s)),value:o._parse(new At(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?$e.mergeObjectAsync(r,a):$e.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof Z?new fa({keyType:e,valueType:r,typeName:N.ZodRecord,...j(n)}):new fa({keyType:Wt.create(),valueType:e,typeName:N.ZodRecord,...j(r)})}}class Sl extends Z{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==A.map)return E(n,{code:x.invalid_type,expected:A.map,received:n.parsedType}),D;const a=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([s,c],l)=>({key:a._parse(new At(n,s,n.path,[l,"key"])),value:i._parse(new At(n,c,n.path,[l,"value"]))}));if(n.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const c of o){const l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return D;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),s.set(l.value,u.value)}return{status:r.value,value:s}})}else{const s=new Map;for(const c of o){const l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return D;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),s.set(l.value,u.value)}return{status:r.value,value:s}}}}Sl.create=(t,e,r)=>new Sl({valueType:e,keyType:t,typeName:N.ZodMap,...j(r)});class En extends Z{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==A.set)return E(n,{code:x.invalid_type,expected:A.set,received:n.parsedType}),D;const a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(E(n,{code:x.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(E(n,{code:x.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());const i=this._def.valueType;function o(c){const l=new Set;for(const u of c){if(u.status==="aborted")return D;u.status==="dirty"&&r.dirty(),l.add(u.value)}return{status:r.value,value:l}}const s=[...n.data.values()].map((c,l)=>i._parse(new At(n,c,n.path,l)));return n.common.async?Promise.all(s).then(c=>o(c)):o(s)}min(e,r){return new En({...this._def,minSize:{value:e,message:I.toString(r)}})}max(e,r){return new En({...this._def,maxSize:{value:e,message:I.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}En.create=(t,e)=>new En({valueType:t,minSize:null,maxSize:null,typeName:N.ZodSet,...j(e)});class Tl extends Z{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}Tl.create=(t,e)=>new Tl({getter:t,typeName:N.ZodLazy,...j(e)});class Ri extends Z{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return E(r,{received:r.data,code:x.invalid_literal,expected:this._def.value}),D}return{status:"valid",value:e.data}}get value(){return this._def.value}}Ri.create=(t,e)=>new Ri({value:t,typeName:N.ZodLiteral,...j(e)});function El(t,e){return new Zr({values:t,typeName:N.ZodEnum,...j(e)})}class Zr extends Z{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),n=this._def.values;return E(r,{expected:W.joinValues(n),received:r.parsedType,code:x.invalid_type}),D}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const r=this._getOrReturnCtx(e),n=this._def.values;return E(r,{received:r.data,code:x.invalid_enum_value,options:n}),D}return st(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return Zr.create(e,{...this._def,...r})}exclude(e,r=this._def){return Zr.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}}Zr.create=El;class Cl extends Z{_parse(e){const r=W.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==A.string&&n.parsedType!==A.number){const a=W.objectValues(r);return E(n,{expected:W.joinValues(a),received:n.parsedType,code:x.invalid_type}),D}if(this._cache||(this._cache=new Set(W.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const a=W.objectValues(r);return E(n,{received:n.data,code:x.invalid_enum_value,options:a}),D}return st(e.data)}get enum(){return this._def.values}}Cl.create=(t,e)=>new Cl({values:t,typeName:N.ZodNativeEnum,...j(e)});class pa extends Z{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==A.promise&&r.common.async===!1)return E(r,{code:x.invalid_type,expected:A.promise,received:r.parsedType}),D;const n=r.parsedType===A.promise?r.data:Promise.resolve(r.data);return st(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}}pa.create=(t,e)=>new pa({type:t,typeName:N.ZodPromise,...j(e)});class Gr extends Z{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===N.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:n}=this._processInputParams(e),a=this._def.effect||null,i={addIssue:o=>{E(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const o=a.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async s=>{if(r.value==="aborted")return D;const c=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return c.status==="aborted"?D:c.status==="dirty"||r.value==="dirty"?Sn(c.value):c});{if(r.value==="aborted")return D;const s=this._def.schema._parseSync({data:o,path:n.path,parent:n});return s.status==="aborted"?D:s.status==="dirty"||r.value==="dirty"?Sn(s.value):s}}if(a.type==="refinement"){const o=s=>{const c=a.refinement(s,i);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){const s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?D:(s.status==="dirty"&&r.dirty(),o(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?D:(s.status==="dirty"&&r.dirty(),o(s.value).then(()=>({status:r.value,value:s.value}))))}if(a.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!qr(o))return D;const s=a.transform(o.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>qr(o)?Promise.resolve(a.transform(o.value,i)).then(s=>({status:r.value,value:s})):D);W.assertNever(a)}}Gr.create=(t,e,r)=>new Gr({schema:t,typeName:N.ZodEffects,effect:e,...j(r)}),Gr.createWithPreprocess=(t,e,r)=>new Gr({schema:e,effect:{type:"preprocess",transform:t},typeName:N.ZodEffects,...j(r)});class lr extends Z{_parse(e){return this._getType(e)===A.undefined?st(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}lr.create=(t,e)=>new lr({innerType:t,typeName:N.ZodOptional,...j(e)});class Wr extends Z{_parse(e){return this._getType(e)===A.null?st(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Wr.create=(t,e)=>new Wr({innerType:t,typeName:N.ZodNullable,...j(e)});class Ii extends Z{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===A.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}Ii.create=(t,e)=>new Ii({innerType:t,typeName:N.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...j(e)});class Li extends Z{_parse(e){const{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ca(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Gt(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Gt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Li.create=(t,e)=>new Li({innerType:t,typeName:N.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...j(e)});class Al extends Z{_parse(e){if(this._getType(e)!==A.nan){const n=this._getOrReturnCtx(e);return E(n,{code:x.invalid_type,expected:A.nan,received:n.parsedType}),D}return{status:"valid",value:e.data}}}Al.create=t=>new Al({typeName:N.ZodNaN,...j(t)});class uf extends Z{_parse(e){const{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class Oi extends Z{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?D:i.status==="dirty"?(r.dirty(),Sn(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?D:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(e,r){return new Oi({in:e,out:r,typeName:N.ZodPipeline})}}class Mi extends Z{_parse(e){const r=this._def.innerType._parse(e),n=a=>(qr(a)&&(a.value=Object.freeze(a.value)),a);return ca(r)?r.then(a=>n(a)):n(r)}unwrap(){return this._def.innerType}}Mi.create=(t,e)=>new Mi({innerType:t,typeName:N.ZodReadonly,...j(e)});var N;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(N||(N={}));const d=Wt.create,Ke=Vr.create,te=Ci.create;sr.create;const Ce=Rt.create,z=ue.create,Cn=da.create;ha.create,Cr.create;const lt=fa.create,df=Ri.create,Ar=Zr.create;pa.create,lr.create,Wr.create;var Pi={inherit:"inherit",current:"currentcolor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"oklch(98.4% 0.003 247.858)",100:"oklch(96.8% 0.007 247.896)",200:"oklch(92.9% 0.013 255.508)",300:"oklch(86.9% 0.022 252.894)",400:"oklch(70.4% 0.04 256.788)",500:"oklch(55.4% 0.046 257.417)",600:"oklch(44.6% 0.043 257.281)",700:"oklch(37.2% 0.044 257.287)",800:"oklch(27.9% 0.041 260.031)",900:"oklch(20.8% 0.042 265.755)",950:"oklch(12.9% 0.042 264.695)"},gray:{50:"oklch(98.5% 0.002 247.839)",100:"oklch(96.7% 0.003 264.542)",200:"oklch(92.8% 0.006 264.531)",300:"oklch(87.2% 0.01 258.338)",400:"oklch(70.7% 0.022 261.325)",500:"oklch(55.1% 0.027 264.364)",600:"oklch(44.6% 0.03 256.802)",700:"oklch(37.3% 0.034 259.733)",800:"oklch(27.8% 0.033 256.848)",900:"oklch(21% 0.034 264.665)",950:"oklch(13% 0.028 261.692)"},zinc:{50:"oklch(98.5% 0 0)",100:"oklch(96.7% 0.001 286.375)",200:"oklch(92% 0.004 286.32)",300:"oklch(87.1% 0.006 286.286)",400:"oklch(70.5% 0.015 286.067)",500:"oklch(55.2% 0.016 285.938)",600:"oklch(44.2% 0.017 285.786)",700:"oklch(37% 0.013 285.805)",800:"oklch(27.4% 0.006 286.033)",900:"oklch(21% 0.006 285.885)",950:"oklch(14.1% 0.005 285.823)"},neutral:{50:"oklch(98.5% 0 0)",100:"oklch(97% 0 0)",200:"oklch(92.2% 0 0)",300:"oklch(87% 0 0)",400:"oklch(70.8% 0 0)",500:"oklch(55.6% 0 0)",600:"oklch(43.9% 0 0)",700:"oklch(37.1% 0 0)",800:"oklch(26.9% 0 0)",900:"oklch(20.5% 0 0)",950:"oklch(14.5% 0 0)"},stone:{50:"oklch(98.5% 0.001 106.423)",100:"oklch(97% 0.001 106.424)",200:"oklch(92.3% 0.003 48.717)",300:"oklch(86.9% 0.005 56.366)",400:"oklch(70.9% 0.01 56.259)",500:"oklch(55.3% 0.013 58.071)",600:"oklch(44.4% 0.011 73.639)",700:"oklch(37.4% 0.01 67.558)",800:"oklch(26.8% 0.007 34.298)",900:"oklch(21.6% 0.006 56.043)",950:"oklch(14.7% 0.004 49.25)"},red:{50:"oklch(97.1% 0.013 17.38)",100:"oklch(93.6% 0.032 17.717)",200:"oklch(88.5% 0.062 18.334)",300:"oklch(80.8% 0.114 19.571)",400:"oklch(70.4% 0.191 22.216)",500:"oklch(63.7% 0.237 25.331)",600:"oklch(57.7% 0.245 27.325)",700:"oklch(50.5% 0.213 27.518)",800:"oklch(44.4% 0.177 26.899)",900:"oklch(39.6% 0.141 25.723)",950:"oklch(25.8% 0.092 26.042)"},orange:{50:"oklch(98% 0.016 73.684)",100:"oklch(95.4% 0.038 75.164)",200:"oklch(90.1% 0.076 70.697)",300:"oklch(83.7% 0.128 66.29)",400:"oklch(75% 0.183 55.934)",500:"oklch(70.5% 0.213 47.604)",600:"oklch(64.6% 0.222 41.116)",700:"oklch(55.3% 0.195 38.402)",800:"oklch(47% 0.157 37.304)",900:"oklch(40.8% 0.123 38.172)",950:"oklch(26.6% 0.079 36.259)"},amber:{50:"oklch(98.7% 0.022 95.277)",100:"oklch(96.2% 0.059 95.617)",200:"oklch(92.4% 0.12 95.746)",300:"oklch(87.9% 0.169 91.605)",400:"oklch(82.8% 0.189 84.429)",500:"oklch(76.9% 0.188 70.08)",600:"oklch(66.6% 0.179 58.318)",700:"oklch(55.5% 0.163 48.998)",800:"oklch(47.3% 0.137 46.201)",900:"oklch(41.4% 0.112 45.904)",950:"oklch(27.9% 0.077 45.635)"},yellow:{50:"oklch(98.7% 0.026 102.212)",100:"oklch(97.3% 0.071 103.193)",200:"oklch(94.5% 0.129 101.54)",300:"oklch(90.5% 0.182 98.111)",400:"oklch(85.2% 0.199 91.936)",500:"oklch(79.5% 0.184 86.047)",600:"oklch(68.1% 0.162 75.834)",700:"oklch(55.4% 0.135 66.442)",800:"oklch(47.6% 0.114 61.907)",900:"oklch(42.1% 0.095 57.708)",950:"oklch(28.6% 0.066 53.813)"},lime:{50:"oklch(98.6% 0.031 120.757)",100:"oklch(96.7% 0.067 122.328)",200:"oklch(93.8% 0.127 124.321)",300:"oklch(89.7% 0.196 126.665)",400:"oklch(84.1% 0.238 128.85)",500:"oklch(76.8% 0.233 130.85)",600:"oklch(64.8% 0.2 131.684)",700:"oklch(53.2% 0.157 131.589)",800:"oklch(45.3% 0.124 130.933)",900:"oklch(40.5% 0.101 131.063)",950:"oklch(27.4% 0.072 132.109)"},green:{50:"oklch(98.2% 0.018 155.826)",100:"oklch(96.2% 0.044 156.743)",200:"oklch(92.5% 0.084 155.995)",300:"oklch(87.1% 0.15 154.449)",400:"oklch(79.2% 0.209 151.711)",500:"oklch(72.3% 0.219 149.579)",600:"oklch(62.7% 0.194 149.214)",700:"oklch(52.7% 0.154 150.069)",800:"oklch(44.8% 0.119 151.328)",900:"oklch(39.3% 0.095 152.535)",950:"oklch(26.6% 0.065 152.934)"},emerald:{50:"oklch(97.9% 0.021 166.113)",100:"oklch(95% 0.052 163.051)",200:"oklch(90.5% 0.093 164.15)",300:"oklch(84.5% 0.143 164.978)",400:"oklch(76.5% 0.177 163.223)",500:"oklch(69.6% 0.17 162.48)",600:"oklch(59.6% 0.145 163.225)",700:"oklch(50.8% 0.118 165.612)",800:"oklch(43.2% 0.095 166.913)",900:"oklch(37.8% 0.077 168.94)",950:"oklch(26.2% 0.051 172.552)"},teal:{50:"oklch(98.4% 0.014 180.72)",100:"oklch(95.3% 0.051 180.801)",200:"oklch(91% 0.096 180.426)",300:"oklch(85.5% 0.138 181.071)",400:"oklch(77.7% 0.152 181.912)",500:"oklch(70.4% 0.14 182.503)",600:"oklch(60% 0.118 184.704)",700:"oklch(51.1% 0.096 186.391)",800:"oklch(43.7% 0.078 188.216)",900:"oklch(38.6% 0.063 188.416)",950:"oklch(27.7% 0.046 192.524)"},cyan:{50:"oklch(98.4% 0.019 200.873)",100:"oklch(95.6% 0.045 203.388)",200:"oklch(91.7% 0.08 205.041)",300:"oklch(86.5% 0.127 207.078)",400:"oklch(78.9% 0.154 211.53)",500:"oklch(71.5% 0.143 215.221)",600:"oklch(60.9% 0.126 221.723)",700:"oklch(52% 0.105 223.128)",800:"oklch(45% 0.085 224.283)",900:"oklch(39.8% 0.07 227.392)",950:"oklch(30.2% 0.056 229.695)"},sky:{50:"oklch(97.7% 0.013 236.62)",100:"oklch(95.1% 0.026 236.824)",200:"oklch(90.1% 0.058 230.902)",300:"oklch(82.8% 0.111 230.318)",400:"oklch(74.6% 0.16 232.661)",500:"oklch(68.5% 0.169 237.323)",600:"oklch(58.8% 0.158 241.966)",700:"oklch(50% 0.134 242.749)",800:"oklch(44.3% 0.11 240.79)",900:"oklch(39.1% 0.09 240.876)",950:"oklch(29.3% 0.066 243.157)"},blue:{50:"oklch(97% 0.014 254.604)",100:"oklch(93.2% 0.032 255.585)",200:"oklch(88.2% 0.059 254.128)",300:"oklch(80.9% 0.105 251.813)",400:"oklch(70.7% 0.165 254.624)",500:"oklch(62.3% 0.214 259.815)",600:"oklch(54.6% 0.245 262.881)",700:"oklch(48.8% 0.243 264.376)",800:"oklch(42.4% 0.199 265.638)",900:"oklch(37.9% 0.146 265.522)",950:"oklch(28.2% 0.091 267.935)"},indigo:{50:"oklch(96.2% 0.018 272.314)",100:"oklch(93% 0.034 272.788)",200:"oklch(87% 0.065 274.039)",300:"oklch(78.5% 0.115 274.713)",400:"oklch(67.3% 0.182 276.935)",500:"oklch(58.5% 0.233 277.117)",600:"oklch(51.1% 0.262 276.966)",700:"oklch(45.7% 0.24 277.023)",800:"oklch(39.8% 0.195 277.366)",900:"oklch(35.9% 0.144 278.697)",950:"oklch(25.7% 0.09 281.288)"},violet:{50:"oklch(96.9% 0.016 293.756)",100:"oklch(94.3% 0.029 294.588)",200:"oklch(89.4% 0.057 293.283)",300:"oklch(81.1% 0.111 293.571)",400:"oklch(70.2% 0.183 293.541)",500:"oklch(60.6% 0.25 292.717)",600:"oklch(54.1% 0.281 293.009)",700:"oklch(49.1% 0.27 292.581)",800:"oklch(43.2% 0.232 292.759)",900:"oklch(38% 0.189 293.745)",950:"oklch(28.3% 0.141 291.089)"},purple:{50:"oklch(97.7% 0.014 308.299)",100:"oklch(94.6% 0.033 307.174)",200:"oklch(90.2% 0.063 306.703)",300:"oklch(82.7% 0.119 306.383)",400:"oklch(71.4% 0.203 305.504)",500:"oklch(62.7% 0.265 303.9)",600:"oklch(55.8% 0.288 302.321)",700:"oklch(49.6% 0.265 301.924)",800:"oklch(43.8% 0.218 303.724)",900:"oklch(38.1% 0.176 304.987)",950:"oklch(29.1% 0.149 302.717)"},fuchsia:{50:"oklch(97.7% 0.017 320.058)",100:"oklch(95.2% 0.037 318.852)",200:"oklch(90.3% 0.076 319.62)",300:"oklch(83.3% 0.145 321.434)",400:"oklch(74% 0.238 322.16)",500:"oklch(66.7% 0.295 322.15)",600:"oklch(59.1% 0.293 322.896)",700:"oklch(51.8% 0.253 323.949)",800:"oklch(45.2% 0.211 324.591)",900:"oklch(40.1% 0.17 325.612)",950:"oklch(29.3% 0.136 325.661)"},pink:{50:"oklch(97.1% 0.014 343.198)",100:"oklch(94.8% 0.028 342.258)",200:"oklch(89.9% 0.061 343.231)",300:"oklch(82.3% 0.12 346.018)",400:"oklch(71.8% 0.202 349.761)",500:"oklch(65.6% 0.241 354.308)",600:"oklch(59.2% 0.249 0.584)",700:"oklch(52.5% 0.223 3.958)",800:"oklch(45.9% 0.187 3.815)",900:"oklch(40.8% 0.153 2.432)",950:"oklch(28.4% 0.109 3.907)"},rose:{50:"oklch(96.9% 0.015 12.422)",100:"oklch(94.1% 0.03 12.58)",200:"oklch(89.2% 0.058 10.001)",300:"oklch(81% 0.117 11.638)",400:"oklch(71.2% 0.194 13.428)",500:"oklch(64.5% 0.246 16.439)",600:"oklch(58.6% 0.253 17.585)",700:"oklch(51.4% 0.222 16.935)",800:"oklch(45.5% 0.188 13.697)",900:"oklch(41% 0.159 10.272)",950:"oklch(27.1% 0.105 12.094)"}};const ze=z({minRem:Ke(),maxRem:Ke()}).or(d()),ga=z({0:d().optional(),50:d(),100:d(),200:d(),300:d(),400:d(),500:d(),600:d(),700:d(),800:d(),900:d(),950:d(),1e3:d().optional()}),Ni=z({color:d().optional(),background:d().optional(),borderWidth:d().optional(),borderColor:d().optional(),boxShadow:d().optional()}),hf=z({borderRadius:ze.optional(),custom:lt(d(),Cn([d(),Ke()])).optional(),hover:Ni.optional(),focus:Ni.optional()}).and(Ni),ff=z({family:d().optional()}),pf=lt(Ar(["predefinedQuestion","edit","newConversation","voteUp","voteDown","retry","message","messageLoading","thread","submit","abort","expand","help","attach","record","reward","share","audio","copy","dismiss","menu","info","menuClose","chevronDown","chevronUp","chevronTopDown","chevronDownSmall","internalLink","externalLink","liip","avatar","avatarLarge","openChat","speechInput","listUnordered","lightMode","darkMode","avatarLarge","settings","settingsClose","sources","model","checkbox","warning","headerLogo"]),d()),gf=z({font:ff.optional(),colors:z({brand:ga,accent:ga.optional(),highlight:ga,grey:ga}),base:z({fontSizeXs:ze.optional(),fontSizeSm:ze.optional(),fontSizeBody:ze.optional(),fontSizeH3:ze.optional(),fontSizeH2:ze.optional(),fontSizeH1:ze.optional(),fontWeightNormal:d().optional(),fontWeightBold:d().optional(),fontWeightTitle:d().optional(),lineHeightDefault:d().optional(),lineHeightSnug:d().optional(),lineHeightTight:d().optional(),borderRadius:ze.optional(),lineColor:d().optional(),boxShadow:d().optional()}),components:lt(d(),hf),svgs:pf}),ma=z({customCSS:d().optional(),fontCSS:d().optional(),fontURLs:d().array().optional(),tokens:gf});z({light:ma,dark:ma});const mf=z({light:ma,dark:ma}).deepPartial(),Rl=z({50:d(),100:d(),200:d(),300:d(),400:d(),500:d(),600:d(),700:d(),800:d(),900:d(),950:d()}),Il=Ar(["slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"]),Ll=Cn([Rl,Il]),vf=Cn([Rl.and(z({0:d(),1e3:d()})),Il]),Ol=z({avatarImageUrl:d().optional(),colors:z({brand:Ll.optional(),highlight:Ll.optional(),grey:vf.optional(),background:d().optional(),text:d().optional(),anchor:z({default:d().optional(),hover:d().optional()}).optional()}).optional(),font:z({family:d().optional(),urls:Ce(d()).optional(),sizeXs:ze.optional(),sizeSm:ze.optional(),sizeBody:ze.optional(),sizeH3:ze.optional(),sizeH2:ze.optional(),sizeH1:ze.optional(),weightNormal:d().optional(),weightBold:d().optional(),weightTitle:d().optional()}).optional(),borderRadius:ze.optional(),fineGrained:mf.optional()}),bf=z({blocked:d(),maintenance:d(),"rate-limit":d(),"server-error":d(),"too-short":d(),"too-long":d(),"quota-reached":d(),aborted:d(),"sse-error":d(),"client-error":d(),"unexpected-call":d(),"incomplete-error":d(),"feedback-failed":d(),"speech-not-supported":d(),"speech-transcription-failed":d(),"speech-no-text-detected":d(),"speech-microphone-access-denied":d(),"pii-detected":d()}),kf=z({email:d(),creditCard:d(),ahv:d(),phoneSwiss:d(),phoneInternational:d(),swissPassport:d(),longNumber:d()}),Ml=z({name:d(),namePlural:d().optional(),intro:d().optional(),placeholder:d(),values:lt(d(),d())}),yf=z({action:d(),label:d(),type:Ar(["primary","secondary"]).optional()}),wf=z({hash:d(),title:d(),content:d(),actions:Ce(yf).optional()}),Pl=z({introductionTitle:d(),introductionDisclaimer:d().optional(),termsInvitationToConsent:d().optional(),chatInputPlaceholder:d(),chatInputPlaceholderListening:d().optional(),chatInputSubmit:d(),chatInputAbort:d(),chatInputStartListening:d(),chatInputStopListening:d(),referenceLink:d(),referencesDisplay:d(),referencesHide:d(),referencesTitle:d(),referencesFurtherTitle:d(),newChat:d(),maintenanceModeError:d(),messageBotLoading:d(),messageBotError:d(),messageBotDefaultError:d(),noResultsFound:d(),chatFooterText:d().optional(),scrollToBottom:d(),openButtonTitle:d().optional(),openButtonDescription:d().optional(),openMenu:d(),openInfo:d(),aboutThisChat:d().optional(),closeMenu:d(),closeChat:d(),close:d(),send:d(),thankYouForFeedback:d(),giveFeedback:d(),sendFeedback:d(),feedbackFormTitle:d(),feedbackFormMessage:d(),feedbackFormMessagePlaceholder:d(),feedbackFormEmail:d(),feedbackFormEmailPlaceholder:d(),askQuestionAgain:d(),answerGood:d(),answerBad:d(),classificationSubmit:d(),classificationThankYou:d(),classificationTitle:d(),selectLanguage:d(),languageChanged:d(),selectColorTheme:d(),lightMode:d(),darkMode:d(),ariaMainNavigation:d(),ariaMainNavigationRegion:d(),ariaGotoMainNavigation:d(),ariaAskQuestion:d(),ariaAskQuestionRegion:d(),ariaNotifications:d(),ariaPredefinedQuestions:d(),ariaPredefinedQuestionsRegion:d(),ariaChatHistory:d(),ariaOpenChat:d(),ariaQuestionFromYou:d(),ariaAnswerFromBot:d(),ariaLastAnswerNavigation:d(),ariaQuestionSent:d(),ariaAnswerReady:d(),ariaAnswerFinished:d(),ariaAskQuestionAgain:d(),ariaAnswerGood:d(),ariaAnswerBad:d(),ariaReferenceSource:d(),ariaGiveFeedback:d(),ariaLanguageChanged:d(),ariaLightSelected:d(),ariaDarkSelected:d(),ariaSettings:d(),ariaSettingsRegion:d(),ariaReferencesRegion:d(),ariaFlyoutRegion:d(),ariaSelected:d(),ariaUnselected:d(),ariaAllSelected:d(),ariaAllUnselected:d(),ariaAllReseted:d(),popups:Ce(wf).optional(),termsAcceptButton:d().optional(),termsReadButton:d().optional(),selectors:lt(d(),Ml).optional(),hideSettings:d(),showSettings:d(),chooseAtLeastOneOption:d(),selectAll:d(),selectNone:d(),resetToDefaults:d(),messageTooLong:d()}),Qr=Ar(["en","de","fr","it"]),Nl=lt(Qr,Pl.partial().extend({selectors:lt(d(),Ml).optional()}));lt(Qr,bf),lt(Qr,kf);const Dl=z({label:d(),options:Ce(z({label:d(),value:Ke()}))}),_f=z({label:d(),icon:d(),url:d(),target:Ar(["_blank","_self"]).optional()}),xf=z({label:d().nullable(),question:d()}),$l=z({impact:Dl.optional(),quality:Dl.optional()});z({classification:$l.optional()});const Sf=z({predefinedQuestions:Ce(xf)}),zl=Cn([z({maintenance:df(!0)}),z({id:d(),cID:d()})]);lt(Qr,Pl);const Tf=z({settingName:d(),iconName:d(),settingIntro:d().optional(),type:Ar(["single-select","multi-select"]),allowEmpty:te(),values:Ce(d()),defaultValues:Ce(d()).optional()}),Fl=z({showPredefinedQuestions:te(),showOverallFeedbackButton:te(),showOverallFeedbackEmail:te(),showCloseChatButton:te(),showContextMenu:te(),showContextInfo:te(),showReferencesByDefault:te(),showExpandedSelectors:te(),showTextFeedback:te(),inlineLayout:te(),allowAudioInput:te(),blockPII:te(),questionPrefix:d(),menu:lt(Qr,Ce(_f)).optional(),supportedLanguages:Ce(Qr),classification:$l.optional(),theme:Ol,translations:Nl,buttonHref:d().optional(),addQueryToUrlParams:te().optional(),addRetrievalQuestionToUrlParams:te().optional(),renderKatex:te().optional(),reflectLanguageInPath:te().optional(),sendReferrer:Ar(["all","own","none","location"]).optional(),selectorsConfig:Ce(Tf).default([]),questionLengthLimit:Ke().optional(),forceConsent:te().optional(),askQuestionAgain:te(),enableBackdrop:te().optional()}).partial().and(z({theme:z({name:d().optional()}).optional()}));class Ef{constructor(e){this.chatResponseData=e,this.id=this.chatResponseData.id}id;async isReadyForFeedback(){return await this.chatResponseData.readyForFeedback.toPromise(),!0}subscribe(e,r){return this.chatResponseData.readableStore.subscribe(e,r)}getContent(){return this.chatResponseData.content.toPromise()}abort(){return this.chatResponseData.abort()}async thumbsUp(){await this.isReadyForFeedback(),await this.chatResponseData.liipgptClientPrimitive.thumbsUp(this.id,this.chatResponseData.question)}async thumbsDown(){await this.isReadyForFeedback(),await this.chatResponseData.liipgptClientPrimitive.thumbsDown(this.id,this.chatResponseData.question)}async feedback(e){await this.isReadyForFeedback(),await this.chatResponseData.liipgptClientPrimitive.feedback(this.id,this.chatResponseData.question,e)}}const Te=[];for(let t=0;t<256;++t)Te.push((t+256).toString(16).slice(1));function Cf(t,e=0){return(Te[t[e+0]]+Te[t[e+1]]+Te[t[e+2]]+Te[t[e+3]]+"-"+Te[t[e+4]]+Te[t[e+5]]+"-"+Te[t[e+6]]+Te[t[e+7]]+"-"+Te[t[e+8]]+Te[t[e+9]]+"-"+Te[t[e+10]]+Te[t[e+11]]+Te[t[e+12]]+Te[t[e+13]]+Te[t[e+14]]+Te[t[e+15]]).toLowerCase()}let Di;const Af=new Uint8Array(16);function Rf(){if(!Di){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Di=crypto.getRandomValues.bind(crypto)}return Di(Af)}const Bl={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function If(t,e,r){t=t||{};const n=t.random??t.rng?.()??Rf();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,Cf(n)}function jl(t,e,r){return Bl.randomUUID&&!t?Bl.randomUUID():If(t)}const Yr=new Map;class Lf{get length(){return Yr.size}clear(){Yr.clear()}getItem(e){return Yr.get(e)||null}key(e){return Array.from(Yr.keys())[e]||null}removeItem(e){Yr.delete(e)}setItem(e,r){Yr.set(e,String(r))}}const vt=globalThis.localStorage??new Lf,Of=async t=>{try{const e=vt.getItem("liipgpt:uID")||vt.getItem("uID"),r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({referrer:globalThis?.document?.referrer||null,uID:e})},n=await t.fetchData("/login",zl,{},r).catch(a=>(console.log("Failed to /login use /log",a),t.fetchData("/log",zl,{},r)));if("maintenance"in n&&n.maintenance)return{mode:"maintenance"};if(!("id"in n))throw new Error("Invalid response format: missing user id");return vt.setItem("liipgpt:uID",n.id),{mode:"ready",userId:n.id}}catch(e){throw console.error("Failed to fetch user data:",e),e}};var Xe=function(t,e){if(!(this instanceof Xe))return new Xe(t,e);this.url=t,e=e||{},this.headers=e.headers||{},this.payload=e.payload!==void 0?e.payload:"",this.method=e.method||this.payload&&"POST"||"GET",this.withCredentials=!!e.withCredentials,this.debug=!!e.debug,this.autoReconnect=e.autoReconnect!==void 0?e.autoReconnect:!1,this.reconnectDelay=e.reconnectDelay!==void 0?e.reconnectDelay:3e3,this.maxRetries=e.maxRetries!==void 0?e.maxRetries:null,this.retryCount=0,this.reconnectTimer=null,this.useLastEventId=e.useLastEventId!==void 0?e.useLastEventId:!0,this.FIELD_SEPARATOR=":",this.listeners={},this.xhr=null,this.readyState=Xe.INITIALIZING,this.progress=0,this.chunk="",this.lastEventId="",this.addEventListener=function(r,n){this.listeners[r]===void 0&&(this.listeners[r]=[]),this.listeners[r].indexOf(n)===-1&&this.listeners[r].push(n)},this.removeEventListener=function(r,n){if(this.listeners[r]===void 0)return;const a=[];this.listeners[r].forEach(function(i){i!==n&&a.push(i)}),a.length===0?delete this.listeners[r]:this.listeners[r]=a},this.dispatchEvent=function(r){if(!r)return!0;this.debug&&console.debug(r),r.source=this;const n="on"+r.type;return this.hasOwnProperty(n)&&(this[n].call(this,r),r.defaultPrevented)?!1:this.listeners[r.type]?this.listeners[r.type].every(function(a){return a(r),!r.defaultPrevented}):!0},this._markClosed=function(){if(this.xhr=null,this.progress=0,this.chunk="",this._setReadyState(Xe.CLOSED),this.autoReconnect){if(this.maxRetries!==null&&this.retryCount>=this.maxRetries){this.debug&&console.debug(`SSE max retries (${this.maxRetries}) reached, stopping reconnection attempts`),this.autoReconnect=!1,this.close();return}this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.debug&&console.debug(`SSE will attempt to reconnect in ${this.reconnectDelay}ms (attempt ${this.retryCount+1}${this.maxRetries?"/"+this.maxRetries:""})`),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.retryCount++,this.stream()},this.reconnectDelay)}},this._setReadyState=function(r){const n=new CustomEvent("readystatechange");n.readyState=r,this.readyState=r,this.dispatchEvent(n)},this._onStreamFailure=function(r){const n=new CustomEvent("error");n.responseCode=r.currentTarget.status,n.data=r.currentTarget.response,this.dispatchEvent(n),this._markClosed()},this._onStreamAbort=function(){this.dispatchEvent(new CustomEvent("abort")),this._markClosed()},this._onStreamProgress=function(r){if(!this.xhr)return;if(this.xhr.status<200||this.xhr.status>=300){this._onStreamFailure(r);return}this.retryCount=0;const n=this.xhr.responseText.substring(this.progress);this.progress+=n.length;const a=(this.chunk+n).split(/(\r\n\r\n|\r\r|\n\n)/g),i=a.pop();a.forEach((function(o){o.trim().length>0&&this.dispatchEvent(this._parseEventChunk(o))}).bind(this)),this.chunk=i},this._onStreamLoaded=function(r){this._onStreamProgress(r),this.dispatchEvent(this._parseEventChunk(this.chunk)),this.chunk="",this._markClosed()},this._parseEventChunk=function(r){if(!r||r.length===0)return null;this.debug&&console.debug(r);const n={id:null,retry:null,data:null,event:null};if(r.split(/\n|\r\n|\r/).forEach((function(i){const o=i.indexOf(this.FIELD_SEPARATOR);let s,c;if(o>0){const l=i[o+1]===" "?2:1;s=i.substring(0,o),c=i.substring(o+l)}else if(o<0)s=i,c="";else return;s in n&&(s==="data"&&n[s]!==null?n.data+=`
|
|
73
73
|
`+c:n[s]=c)}).bind(this)),n.data===null)return null;n.id!==null&&(this.lastEventId=n.id);const a=new CustomEvent(n.event||"message");return a.id=n.id,a.data=n.data||"",a.lastEventId=this.lastEventId,a},this._onReadyStateChange=function(){if(this.xhr&&this.xhr.readyState===XMLHttpRequest.HEADERS_RECEIVED){const r={},n=this.xhr.getAllResponseHeaders().trim().split(`\r
|
|
74
74
|
`);for(const i of n){const[o,...s]=i.split(":"),c=s.join(":").trim();r[o.trim().toLowerCase()]=r[o.trim().toLowerCase()]||[],r[o.trim().toLowerCase()].push(c)}const a=new CustomEvent("open");a.responseCode=this.xhr.status,a.headers=r,this.dispatchEvent(a),this._setReadyState(Xe.OPEN)}},this.stream=function(){if(!this.xhr){this._setReadyState(Xe.CONNECTING),this.xhr=new XMLHttpRequest,this.xhr.addEventListener("progress",this._onStreamProgress.bind(this)),this.xhr.addEventListener("load",this._onStreamLoaded.bind(this)),this.xhr.addEventListener("readystatechange",this._onReadyStateChange.bind(this)),this.xhr.addEventListener("error",this._onStreamFailure.bind(this)),this.xhr.addEventListener("abort",this._onStreamAbort.bind(this)),this.xhr.open(this.method,this.url);for(let r in this.headers)this.xhr.setRequestHeader(r,this.headers[r]);this.useLastEventId&&this.lastEventId.length>0&&this.xhr.setRequestHeader("Last-Event-ID",this.lastEventId),this.xhr.withCredentials=this.withCredentials,this.xhr.send(this.payload)}},this.close=function(){this.readyState!==Xe.CLOSED&&(this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.autoReconnect=!1,this.xhr.abort())},(e.start===void 0||e.start)&&this.stream()};Xe.INITIALIZING=-1,Xe.CONNECTING=0,Xe.OPEN=1,Xe.CLOSED=2,typeof rn<"u"&&(rn.SSE=Xe);class Mf{constructor(e,r,n){this.options=r,this.payload=n;const a={headers:{"content-type":"application/json"}};n&&(a.payload=JSON.stringify(n)),r.apiKey&&(a.headers["api-key"]=r.apiKey),this.eventSource=new(r.EventSource??Xe)(e,a),this.eventSource.onmessage=i=>{try{const o=JSON.parse(i.data);r.onMessage(o)}catch(o){r.onError(new CustomEvent("parse-error",{detail:o}))}},this.eventSource.onerror=i=>{r.onError(i),this.isClosed()&&this.close()}}eventSource;triggeredOnClose=!1;isClosed(){return this.eventSource.readyState===EventSource.CLOSED}close(){this.isClosed()||this.eventSource.close(),this.triggeredOnClose||(this.triggeredOnClose=!0,this.options.onClose())}}const Ul=t=>Object.fromEntries(Object.entries(t).filter(([e,r])=>r!=null));class Pf{constructor(e){this.options=e}getDefaultHeaders(e={}){const r={"Content-Type":"application/json",...e};return this.options.apiKey&&(r["api-key"]=this.options.apiKey),r}get speechRecognitionApiKey(){return this.options.speechRecognitionApiKey}async subscribeSse(e,r={},n){const a=Ul(r);return this.options.apiKey&&(n.apiKey=this.options.apiKey),new Mf(`${this.options.apiUrl}${e}`,n,a)}async fetchData(e,r,n={},a={}){const i=`${this.options.apiUrl}${e}?${new URLSearchParams(Ul(n)).toString()}`,o={...a,headers:this.getDefaultHeaders(a?.headers)},s=await fetch(i,o);if(!s.ok){const h=await s.text();throw new Error(`API request failed: ${s.status} - ${h}`)}const c=await s.json(),{success:l,data:u,error:p}=r.safeParse(c);if(this.options.strict){if(!l)throw console.error(`Server response has wrong type:
|
|
75
75
|
`,{error:p,url:i,opts:o,data:c}),new Error(`Server response has wrong type: ${p.message}`);return u}else return l||console.warn(`Server response has wrong type:
|
|
76
|
-
`,{error:p,url:i,opts:o,data:c}),c}async postData(e,r){const n=await fetch(`${this.options.apiUrl}${e}`,{method:"POST",headers:this.getDefaultHeaders(),body:JSON.stringify(r)});if(!n.ok){const a=await n.text();throw new Error(`${n.status} - ${a}`)}return n}async postFormData(e,r){const n=await fetch(`${this.options.apiUrl}${e}`,{method:"POST",body:r});if(!n.ok){const a=await n.text();throw new Error(`${n.status} - ${a}`)}return n}}const Nf=Cn([d(),Ke(),re(),Ce(d()),Ce(Ke()),Ce(re())]),Df=z({title:d(),description:d().optional(),badge:d().optional(),breadcrumbs:Ce(d()).optional(),previewImage:d().optional(),date:d().datetime().optional()}),$f=z({url:d().url(),score:Ke(),metadata:lt(d(),Nf),language:d().optional()}).merge(Df),zf=z({url:d().url(),title:d(),considered:re(),orgMetadata:z({authors:Ce(d())}),type:d(),date:d().datetime(),similarity:Ke(),content:d(),fromFullTextSearch:re(),rerank:z({index:Ke().int(),adjustment:Ke(),score:Ke(),similarityOld:Ke()})}).deepPartial().or($f),Ff=z({links:Ce(zf)}),jf=t=>{if("metadata"in t)return t;console.warn("Please upgrade your backend you are currently using an old api feature.");const e=t.orgMetadata??{};t?.fromFullTextSearch&&(e.fromFullTextSearch=t?.fromFullTextSearch),t?.rerank&&(e.rerank=t?.rerank);let r=[],n=t.title??"";if(t.title&&t.title.includes(" > ")){const a=t.title.split(" > ");n=a.pop()??"",r=a}return{url:t.url??"",title:n,score:t.similarity||0,breadcrumbs:r,metadata:e,description:t.content,date:t.date}};class Bf{constructor(e){this.results=e}}class Uf{internalData;renderers=new Map;markedExtensions=[];constructor(e){const r={apiUrl:e.apiUrl,apiKey:e.apiKey,speechRecognitionApiKey:e.speechRecognitionApiKey,strict:e.strict??!1,EventSource:e.EventSource??EventSource},n=new Pf(r);this.internalData={restClient:n,metadata:Of(n),searchResponseMap:new Map,chatResponseMap:new Map,conversationMap:new Map}}setMarkedExtensions(...e){this.markedExtensions=e}getMetadata(){return this.internalData.metadata}createConversationId(){const e=Bl();return this.renderers.set(e,new ul({extensions:this.markedExtensions})),e}chat(e,r,n={}){const a=new Si,i=Bl(),o=new dl,s=this.renderers.get(e)??new ul({extensions:this.markedExtensions}),c=new $h({id:i,onError:h=>{n.onError?.(h)},onFinish:h=>{a.setValue(h)},markdownRenderer:s,userQuestion:r}),l=async()=>{await o,(await u).close()},u=new Si;(async()=>{const h=await this.internalData.metadata;if(h.mode==="maintenance")throw new Error("Can not chat in maintenance mode");const v=await this.internalData.restClient.subscribeSse("/assistant/sse",{query:r,uID:h.userId,cID:e,rID:i,lang:n.lang,feature:n.features?.join(","),referrer:n.referrer,...n.selectorValues??{},chat:"true",version:"2"},{onClose:()=>{c.finishMessage(),o.resolve(),a.cleanup()},onMessage:m=>{const b=m;switch(b.type){case"error":c.pushError(b.error);break;case"id":b.for==="request"&&i!==b.id&&console.warn(`Unexpected request id "${b.id}" expected "${i}"`),b.for==="conversation"&&e!==b.id&&console.warn(`Unexpected conversation id "${b.id}" expected "${e}"`);break;case"state":b.state==="history-entry-initialized"&&o.resolve();break;case"text":c.updateText(b.text);break;case"done":case"answer-done":c.finishMessage(),o.resolve(),u.then(C=>C.close());break;case"unexpected-call":console.error("unexpected-call:",b),c.pushError("unexpected-call");break;case"mapped-reference":c.addMappedReference(b.reference);break;case"reference":c.addOldReference(b.reference);break;case"retrieval-question":c.updateRetrievalQuestion(b.question);break}n.onMessage?.(b)},onError:m=>{console.error(" sse-error:",m),!("data"in m&&!m.data&&"responseCode"in m&&m.responseCode===0)&&c.pushError("sse-error")}});u.setValue(v)})();const p=new Ef({question:r,id:i,content:a,readableStore:c.getReadableStore(),readyForFeedback:o,abort:l,liipgptClientPrimitive:this});return this.internalData.chatResponseMap.set(p.id,p),p}async thumbs(e,r,n){if((await this.internalData.metadata).mode!=="ready")throw new Error("Can not post feedback unless we are in ready mode");const i={feedback:n,rID:e,query:r};await this.internalData.restClient.postData("/quickfeedback",i)}thumbsUp(e,r){return this.thumbs(e,r,"positive")}thumbsDown(e,r){return this.thumbs(e,r,"negative")}async feedback(e,r,n){const a=await this.internalData.metadata;if(a.mode!=="ready")throw new Error("Can not post feedback unless we are in ready mode");if(n.message){const i={body:n.message,email:n.email,rID:e,uID:a.userId,query:r};await this.internalData.restClient.postData("/feedback",i)}n.classification&&await this.internalData.restClient.postData("/classification",{impact:n.classification.impact,quality:n.classification.quality,rID:e})}async search(e,r={}){const n=await this.internalData.metadata,a=n.mode==="ready"?n.userId:void 0,{links:i}=await this.internalData.restClient.fetchData("/assistant/search",Ff,{modelId:r.model,lang:r.language,query:e,mapResults:"true",uID:a}),o=i.map(jf);return new Bf(o)}async getChatConfig(){return this.internalData.restClient.fetchData("/chatconfig",Fl)}async getPredefinedQuestions(e){return(await this.internalData.restClient.fetchData("/topics/questions",Sf,e)).predefinedQuestions}async transcribeAudio(e,r={}){const n=await this.internalData.metadata,a=r.lang||"de-CH";if(n.mode==="maintenance")throw new Error("Can not transcribe audio in maintenance mode");try{const o=(u=>u.includes("mp4")?"mp4":u.includes("webm")?"webm":(u.includes("wav"),"wav"))(e.type),s=new FormData;return s.append("file",e,`audio.${o}`),s.append("lang",a),s.append("type",e.type),{transcript:await(await this.internalData.restClient.postFormData(`/speech?key=${this.internalData.restClient.speechRecognitionApiKey||""}&lang=${a}`,s)).text()||"",error:void 0}}catch(i){return console.error("Error transcribing audio:",i),{transcript:"",error:i instanceof Error?i.message:"Unknown error"}}}}const qf=600;function ql(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var $i,Vl;function Vf(){if(Vl)return $i;Vl=1;var t=function(k){return e(k)&&!r(k)};function e(y){return!!y&&typeof y=="object"}function r(y){var k=Object.prototype.toString.call(y);return k==="[object RegExp]"||k==="[object Date]"||i(y)}var n=typeof Symbol=="function"&&Symbol.for,a=n?Symbol.for("react.element"):60103;function i(y){return y.$$typeof===a}function o(y){return Array.isArray(y)?[]:{}}function s(y,k){return k.clone!==!1&&k.isMergeableObject(y)?b(o(y),y,k):y}function c(y,k,w){return y.concat(k).map(function(T){return s(T,w)})}function l(y,k){if(!k.customMerge)return b;var w=k.customMerge(y);return typeof w=="function"?w:b}function u(y){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(y).filter(function(k){return Object.propertyIsEnumerable.call(y,k)}):[]}function p(y){return Object.keys(y).concat(u(y))}function h(y,k){try{return k in y}catch{return!1}}function v(y,k){return h(y,k)&&!(Object.hasOwnProperty.call(y,k)&&Object.propertyIsEnumerable.call(y,k))}function m(y,k,w){var T={};return w.isMergeableObject(y)&&p(y).forEach(function(R){T[R]=s(y[R],w)}),p(k).forEach(function(R){v(y,R)||(h(y,R)&&w.isMergeableObject(k[R])?T[R]=l(R,w)(y[R],k[R],w):T[R]=s(k[R],w))}),T}function b(y,k,w){w=w||{},w.arrayMerge=w.arrayMerge||c,w.isMergeableObject=w.isMergeableObject||t,w.cloneUnlessOtherwiseSpecified=s;var T=Array.isArray(k),R=Array.isArray(y),U=T===R;return U?T?w.arrayMerge(y,k,w):m(y,k,w):s(k,w)}b.all=function(k,w){if(!Array.isArray(k))throw new Error("first argument should be an array");return k.reduce(function(T,R){return b(T,R,w)},{})};var C=b;return $i=C,$i}var Hf=Vf();const An=ql(Hf),Zf=t=>t===null||typeof t!="object",zi=t=>{if(Zf(t))return t;if(Array.isArray(t))return t.map(zi);const e=Object.entries(t).filter(([r,n])=>n!==void 0).map(([r,n])=>[r,zi(n)]);return Object.fromEntries(e)},va=(t,e)=>{const r=zi(e);return An(t,r)},Hl={tokens:{font:{family:"-apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif"},colors:{brand:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#2d3748",900:"#1a202c",950:"#171923"},highlight:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#2d3748",900:"#1a202c",950:"#171923"},grey:{0:"#ffffff",50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#2d3748",900:"#1a202c",950:"#171923",1e3:"#000000"}},base:{fontSizeXs:{minRem:.75,maxRem:.875},fontSizeSm:{minRem:1,maxRem:1},fontSizeBody:{minRem:1,maxRem:1.25},fontSizeH3:{minRem:1.125,maxRem:1.5},fontSizeH2:{minRem:1.25,maxRem:1.75},fontSizeH1:{minRem:1.5,maxRem:2},fontWeightNormal:"400",fontWeightBold:"700",fontWeightTitle:"700",lineHeightDefault:"1.5",lineHeightSnug:"1.375",lineHeightTight:"1.25",borderRadius:{minRem:.5,maxRem:.75},lineColor:"color-mix(in srgb, var(--color-brand-950) 20%, transparent)",boxShadow:"0px 0px 2px rgba(0, 0, 0, 0.15), 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)"},components:{body:{background:"var(--color-grey-0)",color:"var(--color-grey-900)",focus:{color:"var(--color-highlight-500)"},custom:{selectionColor:"var(--color-grey-0)",selectionBackground:"var(--color-brand-700)",focusWidth:"var(--spacer-3)",focusOffset:"var(--spacer-2)",focusStyle:"solid"}},container:{custom:{maxWidth:"1024px"}},avatar:{color:"var(--color-brand-400)",background:"var(--color-grey-100)"},anchor:{color:"var(--color-brand-700)",hover:{color:"var(--color-brand-950)"}},btnPrimary:{color:"var(--color-grey-0)",background:"var(--color-brand-700)",borderRadius:"var(--base-border-radius)",hover:{background:"var(--color-brand-900)"}},btnSecondary:{color:"var(--color-brand-700)",background:"var(--color-brand-100)",borderRadius:"var(--base-border-radius)",hover:{color:"var(--color-grey-1000)",background:"var(--color-brand-200)"}},btnTertiary:{color:"var(--anchor-color)",background:"transparent",borderRadius:"var(--base-border-radius)",hover:{color:"var(--anchor-hover-color)"}},card:{color:"var(--color-grey-900)",background:"var(--color-grey-100)",borderRadius:"var(--base-border-radius)",boxShadow:"none",hover:{color:"var(--color-grey-1000)",background:"var(--color-brand-100)"},custom:{iconColor:"var(--anchor-color)",iconHoverColor:"var(--anchor-hover-color)"}},input:{background:"var(--color-grey-0)",borderColor:"var(--color-grey-300)",borderWidth:"1px",borderRadius:"var(--base-border-radius)",custom:{padding:"var(--spacer-r-16) var(--spacer-r-20)",placeholderColor:"var(--color-grey-500)",placeholderOpacity:"1"}},label:{color:"var(--color-grey-600)"},hr:{color:"var(--base-line-color)"},checkbox:{color:"transparent",background:"var(--color-grey-0)",borderColor:"var(--color-grey-300)",borderWidth:"1px",borderRadius:"0.2em",custom:{checkedColor:"var(--btn-primary-color)",checkedBorderColor:"var(--color-brand-700)",checkedBackground:"var(--color-brand-700)"}},radio:{color:"transparent",background:"var(--color-grey-0)",borderColor:"var(--color-grey-300)",borderWidth:"1px",custom:{checkedColor:"var(--btn-primary-color)",checkedBorderColor:"var(--color-brand-700)",checkedBackground:"var(--color-brand-700)"}},contextBox:{color:"var(--card-color)",background:"var(--card-background)",borderColor:"var(--card-border-color)",borderWidth:"var(--card-border-width)",borderRadius:"var(--card-border-radius)",boxShadow:"var(--base-box-shadow)",custom:{transitionDuration:200,transitionDelay:200,transitionY:8,titleColor:"var(--color-grey-1000)",titleFontWeight:"var(--base-font-weight-bold)",separatorColor:"var(--base-line-color)",errorColor:"var(--message-error-color)"}},contextBoxMenuItem:{background:"transparent",color:"var(--body-color)",borderRadius:"calc(var(--base-border-radius) / 2)",hover:{color:"var(--btn-secondary-hover-color)",background:"var(--btn-secondary-hover-background)"},custom:{activeColor:"var(--btn-secondary-hover-color)",activeBackground:"var(--btn-secondary-hover-background)"}},chatFooter:{color:"var(--color-grey-400)",background:"var(--body-background)",borderRadius:"var(--base-border-radius)",boxShadow:"0px -10px 20px 5px color-mix(in srgb, var(--body-background) 90%, transparent)"},chatInput:{color:"var(--color-grey-700)",background:"var(--card-background)",borderRadius:"var(--base-border-radius)",borderColor:"transparent",borderWidth:"3px",hover:{background:"var(--card-hover-background)"},focus:{borderColor:"var(--body-focus-color)"}},chatInputSubmit:{color:"var(--btn-primary-color)",background:"var(--btn-primary-background)",borderRadius:"calc(var(--base-border-radius) / 1.25)",hover:{color:"var(--btn-primary-hover-color)",background:"var(--btn-primary-hover-background)"},custom:{strokeWidth:"2",deactivatedBackground:"var(--color-grey-500)",deactivatedOpacity:"0.25",deactivatedScale:"0.8",deactivatedBorderColor:"var(--color-grey-500)"}},chatInputNotification:{background:"#DD135A",color:"var(--color-grey-0)",borderColor:"#DD135A",borderWidth:"1px",borderRadius:"var(--chat-input-border-radius)"},dialog:{background:"var(--card-background)",color:"var(--body-color)",borderColor:"var(--card-border-color)",borderWidth:"var(--card-border-width)",borderRadius:"var(--card-border-radius)",boxShadow:"var(--base-box-shadow)",custom:{transitionDuration:200,transitionDelay:0,transitionY:30,backgroundOverlay:"rgba(0, 0, 0, 0.25)",headerBorderBottomColor:"var(--base-line-color)"}},aside:{background:"var(--card-background)",custom:{width:"400px",containerWidthForMobileLayout:1024,backgroundOverlay:"rgba(0, 0, 0, 0.4)",headerColor:"var(--card-color)",headerBorderColor:"var(--base-line-color)",headerBorderWidth:"1px"}},message:{color:"var(--body-color)",custom:{errorColor:"#C91658",transitionDuration:300,transitionDelay:0,transitionY:30,transitionBotLoadingDelay:300}},messageOptions:{borderColor:"var(--base-line-color)",borderWidth:"1px",custom:{transitionDuration:300,transitionDelay:0,transitionY:30}},messageUser:{color:"var(--body-color)",background:"var(--card-background)",boxShadow:"var(--card-box-shadow)",borderRadius:"var(--card-border-radius)"},openButton:{color:"var(--card-color)",background:"var(--card-background)",borderColor:"var(--card-background)",borderWidth:"0",borderRadius:"calc(var(--base-border-radius) / 2)",hover:{color:"var(--card-hover-color)",background:"var(--card-hover-background)"},custom:{hideTitleWhenCollapsed:0,autoExpandScrollThreshold:100,autoCollapseDelay:5e3,autoExpandOnce:0}},referencesToggle:{color:"var(--color-brand-700)",hover:{color:"var(--anchor-hover-color)"}},referenceNumberTrigger:{color:"var(--btn-secondary-color)",background:"var(--btn-secondary-background)",borderRadius:"calc(var(--base-border-radius) / 2)",hover:{color:"var(--btn-secondary-hover-color)",background:"var(--btn-secondary-hover-background)"},custom:{padding:"0.25em"}},referenceDomain:{color:"var(--color-brand-700)",hover:{color:"var(--color-brand-800)"},custom:{padding:"0px"}},referenceNumberContent:{color:"var(--card-color)",background:"var(--card-background)",borderColor:"var(--card-border-color)",borderWidth:"var(--card-border-width)",borderRadius:"var(--card-border-radius)",hover:{color:"var(--card-hover-color)",background:"var(--card-hover-background)",borderColor:"var(--card-hover-border-color)",borderWidth:"var(--card-hover-border-width)"},boxShadow:"var(--base-box-shadow)",custom:{width:"95cqi",maxWidth:"450px",transitionDuration:200,transitionDelay:200,transitionY:8}},reference:{color:"var(--card-color)",background:"var(--card-background)",borderColor:"var(--card-border-color)",borderWidth:"var(--card-border-width)",borderRadius:"var(--card-border-radius)",hover:{color:"var(--card-hover-color)",background:"var(--body-background)",borderColor:"var(--card-hover-border-color)",borderWidth:"var(--card-hover-border-width)"}},referenceDescription:{color:"var(--reference-color)",hover:{color:"var(--reference-hover-color)"}},referenceNumber:{color:"var(--reference-number-trigger-color)",background:"var(--body-background)",borderColor:"var(--reference-number-trigger-border-color)",borderWidth:"var(--reference-number-trigger-border-width)",borderRadius:"var(--reference-number-trigger-border-radius)",hover:{color:"var(--reference-number-trigger-color)",background:"var(--reference-number-trigger-background)",borderColor:"var(--reference-number-trigger-border-color)",borderWidth:"var(--reference-number-trigger-border-width)"},custom:{padding:"var(--reference-number-trigger-padding)"}},toast:{background:"var(--card-background)",color:"var(--body-color)",boxShadow:"var(--base-box-shadow)",borderRadius:"var(--card-border-radius)",custom:{iconSuccessColor:"#22c55e",iconErrorColor:"#ef4444",iconWarningColor:"#f97316",iconInfoColor:"#3b82f6"}},tooltip:{background:"var(--color-grey-200)",color:"var(--body-color)",borderRadius:"calc(var(--base-border-radius) / 2)"},flyout:{custom:{backdropEnabled:0,backdropColor:"var(--color-brand-800)",backdropOpacity:"0.4",backdropDelayIn:"0",backdropDurationIn:"200",backdropDelayOut:"0",backdropDurationOut:"150",backdropBaseScaleIn:"1",backdropBaseScaleOut:"1",backdropTransformOrigin:"center",backdropScaleDirection:"scale"}}},svgs:{predefinedQuestion:`
|
|
76
|
+
`,{error:p,url:i,opts:o,data:c}),c}async postData(e,r){const n=await fetch(`${this.options.apiUrl}${e}`,{method:"POST",headers:this.getDefaultHeaders(),body:JSON.stringify(r)});if(!n.ok){const a=await n.text();throw new Error(`${n.status} - ${a}`)}return n}async postFormData(e,r){const n=await fetch(`${this.options.apiUrl}${e}`,{method:"POST",body:r});if(!n.ok){const a=await n.text();throw new Error(`${n.status} - ${a}`)}return n}}const Nf=Cn([d(),Ke(),te(),Ce(d()),Ce(Ke()),Ce(te())]),Df=z({title:d(),description:d().optional(),badge:d().optional(),breadcrumbs:Ce(d()).optional(),previewImage:d().optional(),date:d().datetime().optional()}),$f=z({url:d().url(),score:Ke(),metadata:lt(d(),Nf),language:d().optional()}).merge(Df),zf=z({url:d().url(),title:d(),considered:te(),orgMetadata:z({authors:Ce(d())}),type:d(),date:d().datetime(),similarity:Ke(),content:d(),fromFullTextSearch:te(),rerank:z({index:Ke().int(),adjustment:Ke(),score:Ke(),similarityOld:Ke()})}).deepPartial().or($f),Ff=z({links:Ce(zf)}),Bf=t=>{if("metadata"in t)return t;console.warn("Please upgrade your backend you are currently using an old api feature.");const e=t.orgMetadata??{};t?.fromFullTextSearch&&(e.fromFullTextSearch=t?.fromFullTextSearch),t?.rerank&&(e.rerank=t?.rerank);let r=[],n=t.title??"";if(t.title&&t.title.includes(" > ")){const a=t.title.split(" > ");n=a.pop()??"",r=a}return{url:t.url??"",title:n,score:t.similarity||0,breadcrumbs:r,metadata:e,description:t.content,date:t.date}};class jf{constructor(e){this.results=e}}class Uf{internalData;renderers=new Map;markedExtensions=[];constructor(e){const r={apiUrl:e.apiUrl,apiKey:e.apiKey,speechRecognitionApiKey:e.speechRecognitionApiKey,strict:e.strict??!1,EventSource:e.EventSource??EventSource},n=new Pf(r);this.internalData={restClient:n,metadata:Of(n),searchResponseMap:new Map,chatResponseMap:new Map,conversationMap:new Map}}setMarkedExtensions(...e){this.markedExtensions=e}getMetadata(){return this.internalData.metadata}createConversationId(){const e=jl();return this.renderers.set(e,new ul({extensions:this.markedExtensions})),e}chat(e,r,n={}){const a=new Si,i=jl(),o=new dl,s=this.renderers.get(e)??new ul({extensions:this.markedExtensions}),c=new $h({id:i,onError:h=>{n.onError?.(h)},onFinish:h=>{a.setValue(h)},markdownRenderer:s,userQuestion:r}),l=async()=>{await o,(await u).close()},u=new Si;(async()=>{const h=await this.internalData.metadata;if(h.mode==="maintenance")throw new Error("Can not chat in maintenance mode");const v=await this.internalData.restClient.subscribeSse("/assistant/sse",{query:r,uID:h.userId,cID:e,rID:i,lang:n.lang,feature:n.features?.join(","),referrer:n.referrer,...n.selectorValues??{},chat:"true",version:"2"},{onClose:()=>{c.finishMessage(),o.resolve(),a.cleanup()},onMessage:m=>{const b=m;switch(b.type){case"error":c.pushError(b.error);break;case"id":b.for==="request"&&i!==b.id&&console.warn(`Unexpected request id "${b.id}" expected "${i}"`),b.for==="conversation"&&e!==b.id&&console.warn(`Unexpected conversation id "${b.id}" expected "${e}"`);break;case"state":b.state==="history-entry-initialized"&&o.resolve();break;case"text":c.updateText(b.text);break;case"done":case"answer-done":c.finishMessage(),o.resolve(),u.then(C=>C.close());break;case"unexpected-call":console.error("unexpected-call:",b),c.pushError("unexpected-call");break;case"mapped-reference":c.addMappedReference(b.reference);break;case"reference":c.addOldReference(b.reference);break;case"retrieval-question":c.updateRetrievalQuestion(b.question);break}n.onMessage?.(b)},onError:m=>{console.error(" sse-error:",m),!("data"in m&&!m.data&&"responseCode"in m&&m.responseCode===0)&&c.pushError("sse-error")}});u.setValue(v)})();const p=new Ef({question:r,id:i,content:a,readableStore:c.getReadableStore(),readyForFeedback:o,abort:l,liipgptClientPrimitive:this});return this.internalData.chatResponseMap.set(p.id,p),p}async thumbs(e,r,n){if((await this.internalData.metadata).mode!=="ready")throw new Error("Can not post feedback unless we are in ready mode");const i={feedback:n,rID:e,query:r};await this.internalData.restClient.postData("/quickfeedback",i)}thumbsUp(e,r){return this.thumbs(e,r,"positive")}thumbsDown(e,r){return this.thumbs(e,r,"negative")}async feedback(e,r,n){const a=await this.internalData.metadata;if(a.mode!=="ready")throw new Error("Can not post feedback unless we are in ready mode");if(n.message){const i={body:n.message,email:n.email,rID:e,uID:a.userId,query:r};await this.internalData.restClient.postData("/feedback",i)}n.classification&&await this.internalData.restClient.postData("/classification",{impact:n.classification.impact,quality:n.classification.quality,rID:e})}async search(e,r={}){const n=await this.internalData.metadata,a=n.mode==="ready"?n.userId:void 0,{links:i}=await this.internalData.restClient.fetchData("/assistant/search",Ff,{modelId:r.model,lang:r.language,query:e,mapResults:"true",uID:a}),o=i.map(Bf);return new jf(o)}async getChatConfig(){return this.internalData.restClient.fetchData("/chatconfig",Fl)}async getPredefinedQuestions(e){return(await this.internalData.restClient.fetchData("/topics/questions",Sf,e)).predefinedQuestions}async transcribeAudio(e,r={}){const n=await this.internalData.metadata,a=r.lang||"de-CH";if(n.mode==="maintenance")throw new Error("Can not transcribe audio in maintenance mode");try{const o=(u=>u.includes("mp4")?"mp4":u.includes("webm")?"webm":(u.includes("wav"),"wav"))(e.type),s=new FormData;return s.append("file",e,`audio.${o}`),s.append("lang",a),s.append("type",e.type),{transcript:await(await this.internalData.restClient.postFormData(`/speech?key=${this.internalData.restClient.speechRecognitionApiKey||""}&lang=${a}`,s)).text()||"",error:void 0}}catch(i){return console.error("Error transcribing audio:",i),{transcript:"",error:i instanceof Error?i.message:"Unknown error"}}}}const qf=600;function ql(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var $i,Vl;function Vf(){if(Vl)return $i;Vl=1;var t=function(k){return e(k)&&!r(k)};function e(y){return!!y&&typeof y=="object"}function r(y){var k=Object.prototype.toString.call(y);return k==="[object RegExp]"||k==="[object Date]"||i(y)}var n=typeof Symbol=="function"&&Symbol.for,a=n?Symbol.for("react.element"):60103;function i(y){return y.$$typeof===a}function o(y){return Array.isArray(y)?[]:{}}function s(y,k){return k.clone!==!1&&k.isMergeableObject(y)?b(o(y),y,k):y}function c(y,k,w){return y.concat(k).map(function(T){return s(T,w)})}function l(y,k){if(!k.customMerge)return b;var w=k.customMerge(y);return typeof w=="function"?w:b}function u(y){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(y).filter(function(k){return Object.propertyIsEnumerable.call(y,k)}):[]}function p(y){return Object.keys(y).concat(u(y))}function h(y,k){try{return k in y}catch{return!1}}function v(y,k){return h(y,k)&&!(Object.hasOwnProperty.call(y,k)&&Object.propertyIsEnumerable.call(y,k))}function m(y,k,w){var T={};return w.isMergeableObject(y)&&p(y).forEach(function(R){T[R]=s(y[R],w)}),p(k).forEach(function(R){v(y,R)||(h(y,R)&&w.isMergeableObject(k[R])?T[R]=l(R,w)(y[R],k[R],w):T[R]=s(k[R],w))}),T}function b(y,k,w){w=w||{},w.arrayMerge=w.arrayMerge||c,w.isMergeableObject=w.isMergeableObject||t,w.cloneUnlessOtherwiseSpecified=s;var T=Array.isArray(k),R=Array.isArray(y),U=T===R;return U?T?w.arrayMerge(y,k,w):m(y,k,w):s(k,w)}b.all=function(k,w){if(!Array.isArray(k))throw new Error("first argument should be an array");return k.reduce(function(T,R){return b(T,R,w)},{})};var C=b;return $i=C,$i}var Hf=Vf();const An=ql(Hf),Zf=t=>t===null||typeof t!="object",zi=t=>{if(Zf(t))return t;if(Array.isArray(t))return t.map(zi);const e=Object.entries(t).filter(([r,n])=>n!==void 0).map(([r,n])=>[r,zi(n)]);return Object.fromEntries(e)},va=(t,e)=>{const r=zi(e);return An(t,r)},Hl={tokens:{font:{family:"-apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif"},colors:{brand:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#2d3748",900:"#1a202c",950:"#171923"},highlight:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#2d3748",900:"#1a202c",950:"#171923"},grey:{0:"#ffffff",50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#2d3748",900:"#1a202c",950:"#171923",1e3:"#000000"}},base:{fontSizeXs:{minRem:.75,maxRem:.875},fontSizeSm:{minRem:1,maxRem:1},fontSizeBody:{minRem:1,maxRem:1.25},fontSizeH3:{minRem:1.125,maxRem:1.5},fontSizeH2:{minRem:1.25,maxRem:1.75},fontSizeH1:{minRem:1.5,maxRem:2},fontWeightNormal:"400",fontWeightBold:"700",fontWeightTitle:"700",lineHeightDefault:"1.5",lineHeightSnug:"1.375",lineHeightTight:"1.25",borderRadius:{minRem:.5,maxRem:.75},lineColor:"color-mix(in srgb, var(--color-brand-950) 20%, transparent)",boxShadow:"0px 0px 2px rgba(0, 0, 0, 0.15), 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)"},components:{body:{background:"var(--color-grey-0)",color:"var(--color-grey-900)",focus:{color:"var(--color-highlight-500)"},custom:{selectionColor:"var(--color-grey-0)",selectionBackground:"var(--color-brand-700)",focusWidth:"var(--spacer-3)",focusOffset:"var(--spacer-2)",focusStyle:"solid"}},container:{custom:{maxWidth:"1024px"}},avatar:{color:"var(--color-brand-400)",background:"var(--color-grey-100)"},anchor:{color:"var(--color-brand-700)",hover:{color:"var(--color-brand-950)"}},btnPrimary:{color:"var(--color-grey-0)",background:"var(--color-brand-700)",borderRadius:"var(--base-border-radius)",hover:{background:"var(--color-brand-900)"}},btnSecondary:{color:"var(--color-brand-700)",background:"var(--color-brand-100)",borderRadius:"var(--base-border-radius)",hover:{color:"var(--color-grey-1000)",background:"var(--color-brand-200)"}},btnTertiary:{color:"var(--anchor-color)",background:"transparent",borderRadius:"var(--base-border-radius)",hover:{color:"var(--anchor-hover-color)"}},card:{color:"var(--color-grey-900)",background:"var(--color-grey-100)",borderRadius:"var(--base-border-radius)",boxShadow:"none",hover:{color:"var(--color-grey-1000)",background:"var(--color-brand-100)"},custom:{iconColor:"var(--anchor-color)",iconHoverColor:"var(--anchor-hover-color)"}},input:{background:"var(--color-grey-0)",borderColor:"var(--color-grey-300)",borderWidth:"1px",borderRadius:"var(--base-border-radius)",custom:{padding:"var(--spacer-r-16) var(--spacer-r-20)",placeholderColor:"var(--color-grey-500)",placeholderOpacity:"1"}},label:{color:"var(--color-grey-600)"},hr:{color:"var(--base-line-color)"},checkbox:{color:"transparent",background:"var(--color-grey-0)",borderColor:"var(--color-grey-300)",borderWidth:"1px",borderRadius:"0.2em",custom:{checkedColor:"var(--btn-primary-color)",checkedBorderColor:"var(--color-brand-700)",checkedBackground:"var(--color-brand-700)"}},radio:{color:"transparent",background:"var(--color-grey-0)",borderColor:"var(--color-grey-300)",borderWidth:"1px",custom:{checkedColor:"var(--btn-primary-color)",checkedBorderColor:"var(--color-brand-700)",checkedBackground:"var(--color-brand-700)"}},contextBox:{color:"var(--card-color)",background:"var(--card-background)",borderColor:"var(--card-border-color)",borderWidth:"var(--card-border-width)",borderRadius:"var(--card-border-radius)",boxShadow:"var(--base-box-shadow)",custom:{transitionDuration:200,transitionDelay:200,transitionY:8,titleColor:"var(--color-grey-1000)",titleFontWeight:"var(--base-font-weight-bold)",separatorColor:"var(--base-line-color)",errorColor:"var(--message-error-color)"}},contextBoxMenuItem:{background:"transparent",color:"var(--body-color)",borderRadius:"calc(var(--base-border-radius) / 2)",hover:{color:"var(--btn-secondary-hover-color)",background:"var(--btn-secondary-hover-background)"},custom:{activeColor:"var(--btn-secondary-hover-color)",activeBackground:"var(--btn-secondary-hover-background)"}},chatFooter:{color:"var(--color-grey-400)",background:"var(--body-background)",borderRadius:"var(--base-border-radius)",boxShadow:"0px -10px 20px 5px color-mix(in srgb, var(--body-background) 90%, transparent)"},chatInput:{color:"var(--color-grey-700)",background:"var(--card-background)",borderRadius:"var(--base-border-radius)",borderColor:"transparent",borderWidth:"3px",hover:{background:"var(--card-hover-background)"},focus:{borderColor:"var(--body-focus-color)"}},chatInputSubmit:{color:"var(--btn-primary-color)",background:"var(--btn-primary-background)",borderRadius:"calc(var(--base-border-radius) / 1.25)",hover:{color:"var(--btn-primary-hover-color)",background:"var(--btn-primary-hover-background)"},custom:{strokeWidth:"2",deactivatedBackground:"var(--color-grey-500)",deactivatedOpacity:"0.25",deactivatedScale:"0.8",deactivatedBorderColor:"var(--color-grey-500)"}},chatInputNotification:{background:"#DD135A",color:"var(--color-grey-0)",borderColor:"#DD135A",borderWidth:"1px",borderRadius:"var(--chat-input-border-radius)"},dialog:{background:"var(--card-background)",color:"var(--body-color)",borderColor:"var(--card-border-color)",borderWidth:"var(--card-border-width)",borderRadius:"var(--card-border-radius)",boxShadow:"var(--base-box-shadow)",custom:{transitionDuration:200,transitionDelay:0,transitionY:30,backgroundOverlay:"rgba(0, 0, 0, 0.25)",headerBorderBottomColor:"var(--base-line-color)"}},aside:{background:"var(--card-background)",custom:{width:"400px",containerWidthForMobileLayout:1024,backgroundOverlay:"rgba(0, 0, 0, 0.4)",headerColor:"var(--card-color)",headerBorderColor:"var(--base-line-color)",headerBorderWidth:"1px"}},message:{color:"var(--body-color)",custom:{errorColor:"#C91658",transitionDuration:300,transitionDelay:0,transitionY:30,transitionBotLoadingDelay:300}},messageOptions:{borderColor:"var(--base-line-color)",borderWidth:"1px",custom:{transitionDuration:300,transitionDelay:0,transitionY:30}},messageUser:{color:"var(--body-color)",background:"var(--card-background)",boxShadow:"var(--card-box-shadow)",borderRadius:"var(--card-border-radius)"},openButton:{color:"var(--card-color)",background:"var(--card-background)",borderColor:"var(--card-background)",borderWidth:"0",borderRadius:"calc(var(--base-border-radius) / 2)",hover:{color:"var(--card-hover-color)",background:"var(--card-hover-background)"},custom:{hideTitleWhenCollapsed:0,autoExpandScrollThreshold:100,autoCollapseDelay:5e3,autoExpandOnce:0}},referencesToggle:{color:"var(--color-brand-700)",hover:{color:"var(--anchor-hover-color)"}},referenceNumberTrigger:{color:"var(--btn-secondary-color)",background:"var(--btn-secondary-background)",borderRadius:"calc(var(--base-border-radius) / 2)",hover:{color:"var(--btn-secondary-hover-color)",background:"var(--btn-secondary-hover-background)"},custom:{padding:"0.25em"}},referenceDomain:{color:"var(--color-brand-700)",hover:{color:"var(--color-brand-800)"},custom:{padding:"0px"}},referenceNumberContent:{color:"var(--card-color)",background:"var(--card-background)",borderColor:"var(--card-border-color)",borderWidth:"var(--card-border-width)",borderRadius:"var(--card-border-radius)",hover:{color:"var(--card-hover-color)",background:"var(--card-hover-background)",borderColor:"var(--card-hover-border-color)",borderWidth:"var(--card-hover-border-width)"},boxShadow:"var(--base-box-shadow)",custom:{width:"95cqi",maxWidth:"450px",transitionDuration:200,transitionDelay:200,transitionY:8}},reference:{color:"var(--card-color)",background:"var(--card-background)",borderColor:"var(--card-border-color)",borderWidth:"var(--card-border-width)",borderRadius:"var(--card-border-radius)",hover:{color:"var(--card-hover-color)",background:"var(--body-background)",borderColor:"var(--card-hover-border-color)",borderWidth:"var(--card-hover-border-width)"}},referenceDescription:{color:"var(--reference-color)",hover:{color:"var(--reference-hover-color)"}},referenceNumber:{color:"var(--reference-number-trigger-color)",background:"var(--body-background)",borderColor:"var(--reference-number-trigger-border-color)",borderWidth:"var(--reference-number-trigger-border-width)",borderRadius:"var(--reference-number-trigger-border-radius)",hover:{color:"var(--reference-number-trigger-color)",background:"var(--reference-number-trigger-background)",borderColor:"var(--reference-number-trigger-border-color)",borderWidth:"var(--reference-number-trigger-border-width)"},custom:{padding:"var(--reference-number-trigger-padding)"}},toast:{background:"var(--card-background)",color:"var(--body-color)",boxShadow:"var(--base-box-shadow)",borderRadius:"var(--card-border-radius)",custom:{iconSuccessColor:"#22c55e",iconErrorColor:"#ef4444",iconWarningColor:"#f97316",iconInfoColor:"#3b82f6"}},tooltip:{background:"var(--color-grey-200)",color:"var(--body-color)",borderRadius:"calc(var(--base-border-radius) / 2)"},flyout:{custom:{backdropColor:"var(--color-brand-800)",backdropOpacity:"0.4",backdropDelayIn:"0",backdropDurationIn:"200",backdropDelayOut:"0",backdropDurationOut:"150",backdropBaseScaleIn:"1",backdropBaseScaleOut:"1",backdropTransformOrigin:"center",backdropScaleDirection:"scale"}}},svgs:{predefinedQuestion:`
|
|
77
77
|
<svg viewBox="0 0 24 24" >
|
|
78
78
|
<path d="M11 3.5A10.5 10.5 0 0 0 0.5 14v1.5" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
|
|
79
79
|
<path d="M0.5 15.498a5 5 0 1 0 10 0 5 5 0 1 0 -10 0" fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
|
|
@@ -386,4 +386,4 @@ Please report this to https://github.com/markedjs/marked.`,t){const n="<p>An err
|
|
|
386
386
|
<p>
|
|
387
387
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec mauris diam, vestibulum vitae cursus et, hendrerit sed dolor. Sed quis nisl quis ipsum tempus hendrerit. <a href="https://www.liipgpt.ch/" target="_blank">Plus d'informations</a>
|
|
388
388
|
</p>
|
|
389
|
-
`,ariaMainNavigation:"Navigation principale",ariaMainNavigationRegion:"Navigation principale: liens, changement de langue, mode couleur",ariaGotoMainNavigation:"Aller à la navigation principale",ariaAskQuestion:"Saisie texte",ariaAskQuestionRegion:"Poser une question",ariaNotifications:"Notifications",ariaPredefinedQuestions:"Questions prédéfinies",ariaPredefinedQuestionsRegion:"Essayez nos questions d'exemple",ariaChatHistory:"Historique du chat",ariaOpenChat:"Ouvrir le chat",ariaQuestionFromYou:"Votre question:",ariaAnswerFromBot:"Réponse de l'Assistant:",ariaLastAnswerNavigation:"Navigation et options pour la dernière réponse",ariaQuestionSent:"Question envoyée. Génération de la réponse en cours...",ariaAnswerReady:"Réponse prête.",ariaAnswerFinished:"Réponse terminée. Posez une autre question ou naviguez en arrière pour consulter l'historique du chat, donner un avis ou voir les références liées à la réponse.",ariaAskQuestionAgain:"Copier la dernière question dans le champ de saisie pour la reposer",ariaAnswerGood:"Évaluer cette réponse comme bonne",ariaAnswerBad:"Évaluer cette réponse comme mauvaise",ariaReferenceSource:"Source:",ariaGiveFeedback:"Donner un feedback détaillé sur la réponse",ariaLanguageChanged:"Langue française sélectionnée.",ariaLightSelected:"Mode clair activé.",ariaDarkSelected:"Mode sombre activé.",ariaSettings:"Paramètres du chat",ariaSettingsRegion:"Ajustez vos préférences de chat",ariaReferencesRegion:"Références pour la question actuelle",ariaFlyoutRegion:"Chatbot",ariaSelected:"sélectionné",ariaUnselected:"non sélectionné",ariaAllSelected:"Tous les éléments sélectionnés",ariaAllUnselected:"Tous les éléments non sélectionnés",ariaAllReseted:"Éléments par défaut sélectionnés",hideSettings:"Masquer les paramètres",showSettings:"Paramètres",chooseAtLeastOneOption:"Veuillez choisir au moins une option",selectAll:"Tout sélectionner",selectNone:"Tout désélectionner",resetToDefaults:"Réinitialiser",messageTooLong:"Votre message doit être plus court que {questionLengthLimit} caractères. Actuellement, il fait {questionLength} caractères"}},Xf=Object.freeze(Object.defineProperty({__proto__:null,translations:Rr},Symbol.toStringTag,{value:"Module"})),Jf=t=>{t=t??Rr;const e={};return t.de&&(e.de=An(Rr.de,t.de)),t.en&&(e.en=An(Rr.en,t.en)),t.fr&&(e.fr=An(Rr.fr,t.fr)),t.it&&(e.it=An(Rr.it,t.it)),e},Zl=t=>{let e;t.theme?.fineGrained?e=Kf(t.theme?.fineGrained):e=Yf(t?.theme??{});const r=Jf(t?.translations),n={...t,showPredefinedQuestions:t.showPredefinedQuestions??!0,showOverallFeedbackButton:t.showOverallFeedbackButton??!1,showOverallFeedbackEmail:t.showOverallFeedbackEmail??!0,showCloseChatButton:t.showCloseChatButton??!1,showContextInfo:t.showContextInfo??!1,showContextMenu:t.showContextMenu??!1,showReferencesByDefault:t.showReferencesByDefault??!1,showTextFeedback:t.showTextFeedback??!0,showExpandedSelectors:t.showExpandedSelectors??!1,inlineLayout:t.inlineLayout??!1,questionPrefix:t.questionPrefix??"",blockPII:t.blockPII??!1,allowAudioInput:t.allowAudioInput??!1,supportedLanguages:t.supportedLanguages??Object.keys(r),fullTheme:e,translations:r,buttonHref:t.buttonHref,addQueryToUrlParams:t.addQueryToUrlParams??!0,addRetrievalQuestionToUrlParams:t.addRetrievalQuestionToUrlParams??!1,renderKatex:t.renderKatex??!1,sendReferrer:t.sendReferrer??"all",selectorsConfig:t.selectorsConfig??[],questionLengthLimit:t.questionLengthLimit??qf,forceConsent:t.forceConsent??!1,askQuestionAgain:t.askQuestionAgain??!1};return t.classification&&(n.classification=t.classification),t.menu&&(n.menu=t.menu),n},Gl={de:{aborted:"Verbindung zum Server wurde unerwartet unterbrochen. Bitte versuchen Sie es erneut.","client-error":"Ein unbekannter Fehler ist aufgetreten. Bitte versuchen Sie es erneut.","server-error":"Ein unbekannter Fehler ist aufgetreten. Bitte versuchen Sie es erneut.","sse-error":"Ein unbekannter Fehler ist aufgetreten. Bitte versuchen Sie es erneut.",blocked:"Ihre Anfrage wurde blockiert.","pii-detected":"Es wurden persönliche Daten erkannt. Bitte entfernen Sie diese und versuchen Sie es erneut.","incomplete-error":"Ein unbekannter Fehler ist aufgetreten. Die Antwort könnte unvollständig sein.","unexpected-call":"Ein unbekannter Fehler ist aufgetreten. Die Antwort könnte unvollständig sein.","quota-reached":"Kontingent überschritten. Bitte versuchen Sie es später erneut.","rate-limit":"Kontingent überschritten. Bitte versuchen Sie es später erneut.",maintenance:"Der Chat ist derzeit nicht verfügbar. Bitte versuchen Sie es später erneut.","too-long":"Ihre Frage war zu lang, versuchen Sie es mit einer Kürzeren.","too-short":"Ihre Frage war zu kurz, versuchen Sie es mit einer Längeren.","feedback-failed":"Feedback senden fehlgeschlagen. Bitte versuchen Sie es erneut.","speech-not-supported":"Spracherkennung wird nicht unterstützt.","speech-transcription-failed":"Sprachtranskription fehlgeschlagen.","speech-no-text-detected":"Kein Text in der Spracheingabe erkannt.","speech-microphone-access-denied":"Mikrofonzugriff verweigert."},en:{aborted:"Connection to the server was unexpectedly interrupted. Please try again.","client-error":"An unknown error has occurred. Please try again.","server-error":"An unknown error has occurred. Please try again.","sse-error":"An unknown error has occurred. Please try again.",blocked:"Your request has been blocked.","pii-detected":"Personal data has been detected. Please remove it and try again.","incomplete-error":"An unknown error has occurred. The response might be incomplete.","unexpected-call":"An unknown error has occurred. The response might be incomplete.","quota-reached":"Quota exceeded. Please try again later.","rate-limit":"Quota exceeded. Please try again later.",maintenance:"The chat is currently unavailable. Please try again later.","too-long":"Your question was too long, try a shorter one.","too-short":"Your question was too short, try a longer one.","feedback-failed":"Failed to send feedback. Please try again.","speech-not-supported":"Speech recognition is not supported.","speech-transcription-failed":"Speech transcription failed.","speech-no-text-detected":"No text detected in speech input.","speech-microphone-access-denied":"Microphone access denied."},it:{aborted:"La connessione al server è stata interrotta inaspettatamente. Si prega di riprovare.","client-error":"Si è verificato un errore sconosciuto. Si prega di riprovare.","server-error":"Si è verificato un errore sconosciuto. Si prega di riprovare.","sse-error":"Si è verificato un errore sconosciuto. Si prega di riprovare.",blocked:"La tua richiesta è stata bloccata.","pii-detected":"Sono stati rilevati dati personali. Si prega di rimuoverli e riprovare.","incomplete-error":"Si è verificato un errore sconosciuto. La risposta potrebbe essere incompleta.","unexpected-call":"Si è verificato un errore sconosciuto. La risposta potrebbe essere incompleta.","quota-reached":"Quota superata. Si prega di riprovare più tardi.","rate-limit":"Quota superata. Si prega di riprovare più tardi.",maintenance:"La chat non è attualmente disponibile. Si prega di riprovare più tardi.","too-long":"La tua domanda era troppo lunga, prova con una più breve.","too-short":"La tua domanda era troppo breve, prova con una più lunga.","feedback-failed":"Invio del feedback non riuscito. Si prega di riprovare.","speech-not-supported":"Il riconoscimento vocale non è supportato.","speech-transcription-failed":"Trascrizione vocale fallita.","speech-no-text-detected":"Nessun testo rilevato nell'input vocale.","speech-microphone-access-denied":"Accesso al microfono negato."},fr:{aborted:"La connexion au serveur a été interrompue de façon inattendue. Veuillez réessayer.","client-error":"Une erreur inconnue s'est produite. Veuillez réessayer.","server-error":"Une erreur inconnue s'est produite. Veuillez réessayer.","sse-error":"Une erreur inconnue s'est produite. Veuillez réessayer.","pii-detected":"Des données personnelles ont été détectées. Veuillez les supprimer et réessayer.",blocked:"Votre demande a été bloquée.","incomplete-error":"Une erreur inconnue s'est produite. La réponse pourrait être incomplète.","unexpected-call":"Une erreur inconnue s'est produite. La réponse pourrait être incomplète.","quota-reached":"Quota dépassé. Veuillez réessayer plus tard.","rate-limit":"Quota dépassé. Veuillez réessayer plus tard.",maintenance:"Le chat est actuellement indisponible. Veuillez réessayer plus tard.","too-long":"Votre question était trop longue, essayez d'en poser une plus courte.","too-short":"Votre question était trop courte, essayez d'en poser une plus longue.","feedback-failed":"Échec de l'envoi du feedback. Veuillez réessayer.","speech-not-supported":"La reconnaissance vocale n'est pas prise en charge.","speech-transcription-failed":"Échec de la transcription vocale.","speech-no-text-detected":"Aucun texte détecté dans l'entrée vocale.","speech-microphone-access-denied":"Accès au microphone refusé."}},Wl={de:{email:"Bitte keine E-Mail Adressen eingeben",creditCard:"Bitte keine Kreditkarteninformationen eingeben",ahv:"Bitte keine AHV-Nummern eingeben",phoneSwiss:"Bitte keine Telefonnummern eingeben",phoneInternational:"Bitte keine Telefonnummern eingeben",swissPassport:"Bitte keine Passinformationen eingeben",longNumber:"Bitte keine langen Nummern eingeben"},en:{email:"Please do not enter email addresses",creditCard:"Please do not enter credit card information",ahv:"Please do not enter AHV numbers",phoneSwiss:"Please do not enter phone numbers",phoneInternational:"Please do not enter phone numbers",swissPassport:"Please do not enter passport information",longNumber:"Please do not enter long numbers"},it:{email:"Si prega di non inserire indirizzi email",creditCard:"Si prega di non inserire informazioni sulla carta di credito",ahv:"Si prega di non inserire numeri AVS",phoneSwiss:"Si prega di non inserire numeri di telefono",phoneInternational:"Si prega di non inserire numeri di telefono",swissPassport:"Si prega di non inserire informazioni sul passaporto",longNumber:"Si prega di non inserire numeri lunghi"},fr:{email:"Veuillez ne pas saisir d'adresses e-mail",creditCard:"Veuillez ne pas saisir d'informations de carte de crédit",ahv:"Veuillez ne pas saisir de numéros AVS",phoneSwiss:"Veuillez ne pas saisir de numéros de téléphone",phoneInternational:"Veuillez ne pas saisir de numéros de téléphone",swissPassport:"Veuillez ne pas saisir d'informations de passeport",longNumber:"Veuillez ne pas saisir de longs numéros"}},ji=structuredClone(cr.fineGrained.light);ji.tokens.colors={brand:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#037ABA",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},highlight:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},grey:{0:"#ffffff",50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#2d3748",900:"#1a202c",950:"#171923",1e3:"#000000"}};const Ql=structuredClone(cr.fineGrained.dark);Ql.tokens.colors=ji.tokens.colors;const ep=Object.freeze(Object.defineProperty({__proto__:null,theme:{fineGrained:{light:ji,dark:Ql}}},Symbol.toStringTag,{value:"Module"})),Yl=t=>t.split("/").pop().split(".")[0],tp=Object.assign({"./default/fallback-dev.theme.ts":ep,"./default/fallback.theme.ts":Wf}),Bi=new Map;Object.entries(tp).forEach(([t,e])=>{const{error:r,data:n}=Ol.safeParse(e?.theme);if(r){console.error(`Invalid theme in ${t}:`,r);return}Bi.set(Yl(t),n)});const w0=t=>{const e=Bi.get(t);return e||(console.error(`Theme ${t} not found`),cr)};Array.from(Bi.keys());const rp=Object.assign({"./default/fallback.translations.ts":Xf}),Ui=new Map;Object.entries(rp).forEach(([t,e])=>{const{error:r,data:n}=Nl.safeParse(e?.translations);if(r){console.error(`Invalid translations in ${t}:`,r);return}Ui.set(Yl(t),n)});const _0=t=>{const e=Ui.get(t);return e||(console.error(`Theme ${t} not found`),Rr)};Array.from(Ui.keys());const np="en",Kl=(t,e)=>e.includes(t),ba=(t,e)=>{if(Kl(t,e))return t;const r=ap();return Kl(r,e)?r:np},ap=()=>navigator.language.split("-")[0],Xl=(t,e)=>{localStorage.setItem("liipgpt:selectedLanguage",t),e&&(e.lang=t)},Jl=t=>ba(localStorage.getItem("liipgpt:selectedLanguage"),t);var qi,ec;function ip(){return ec||(ec=1,qi=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,a,i;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(a=n;a--!==0;)if(!t(e[a],r[a]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(r).length)return!1;for(a=n;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[a]))return!1;for(a=n;a--!==0;){var o=i[a];if(!t(e[o],r[o]))return!1}return!0}return e!==e&&r!==r}),qi}var op=ip();const sp=ql(op),lp=typeof document<"u";let tc=0;class cp{#e=J(_t([]));get toasts(){return _(this.#e)}set toasts(e){P(this.#e,e,!0)}#t=J(_t([]));get heights(){return _(this.#t)}set heights(e){P(this.#t,e,!0)}#a=e=>{const r=this.toasts.findIndex(n=>n.id===e);return r===-1?null:r};addToast=e=>{lp&&this.toasts.unshift(e)};updateToast=({id:e,data:r,type:n,message:a})=>{const i=this.toasts.findIndex(s=>s.id===e),o=this.toasts[i];this.toasts[i]={...o,...r,id:e,title:a,type:n,updated:!0}};create=e=>{const{message:r,...n}=e,a=typeof e?.id=="number"||e.id&&e.id?.length>0?e.id:tc++,i=e.dismissable===void 0?!0:e.dismissable,o=e.type===void 0?"default":e.type;return pt(()=>{this.toasts.find(c=>c.id===a)?this.updateToast({id:a,data:e,type:o,message:r,dismissable:i}):this.addToast({...n,id:a,title:r,dismissable:i,type:o})}),a};dismiss=e=>(pt(()=>{if(e===void 0){this.toasts=this.toasts.map(n=>({...n,dismiss:!0}));return}const r=this.toasts.findIndex(n=>n.id===e);this.toasts[r]&&(this.toasts[r]={...this.toasts[r],dismiss:!0})}),e);remove=e=>{if(e===void 0){this.toasts=[];return}const r=this.#a(e);if(r!==null)return this.toasts.splice(r,1),e};message=(e,r)=>this.create({...r,type:"default",message:e});error=(e,r)=>this.create({...r,type:"error",message:e});success=(e,r)=>this.create({...r,type:"success",message:e});info=(e,r)=>this.create({...r,type:"info",message:e});warning=(e,r)=>this.create({...r,type:"warning",message:e});loading=(e,r)=>this.create({...r,type:"loading",message:e});promise=(e,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:e,type:"loading",message:typeof r.loading=="string"?r.loading:r.loading()}));const a=e instanceof Promise?e:e();let i=n!==void 0;return a.then(o=>{if(typeof o=="object"&&o&&"ok"in o&&typeof o.ok=="boolean"&&!o.ok){i=!1;const s=up(o);this.create({id:n,type:"error",message:s})}else if(r.success!==void 0){i=!1;const s=typeof r.success=="function"?r.success(o):r.success;this.create({id:n,type:"success",message:s})}}).catch(o=>{if(r.error!==void 0){i=!1;const s=typeof r.error=="function"?r.error(o):r.error;this.create({id:n,type:"error",message:s})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),r.finally?.()}),n};custom=(e,r)=>{const n=r?.id||tc++;return this.create({component:e,id:n,...r}),n};removeHeight=e=>{this.heights=this.heights.filter(r=>r.toastId!==e)};setHeight=e=>{const r=this.#a(e.toastId);if(r===null){this.heights.push(e);return}this.heights[r]=e};reset=()=>{this.toasts=[],this.heights=[]}}function up(t){return t&&typeof t=="object"&&"status"in t?`HTTP error! Status: ${t.status}`:`Error! ${t}`}const bt=new cp;function dp(t,e){return bt.create({message:t,...e})}const Vi=Object.assign(dp,{success:bt.success,info:bt.info,warning:bt.warning,error:bt.error,custom:bt.custom,message:bt.message,promise:bt.promise,dismiss:bt.dismiss,loading:bt.loading,getActiveToasts:()=>bt.toasts.filter(t=>!t.dismiss)}),hp=t=>{const e=new Set;Object.getOwnPropertyNames(t).forEach(n=>e.add(n));let r=Object.getPrototypeOf(t);for(;r&&r!==Object.prototype;)Object.getOwnPropertyNames(r).forEach(n=>e.add(n)),r=Object.getPrototypeOf(r);return Array.from(e)},fp=(t,e)=>{const r={};return e.forEach(n=>{r[n]=t[n]}),r},pp=console.warn,gp=()=>{},rc=(t,e)=>pt(()=>{console.warn=gp;const r=e?fp(t,e):t,n=hu(r);return console.warn=pp,n}),mp=t=>t&&typeof t.then=="function";class vp{config;self;devtools;stateKeys;constructor(e,r){this.config=e,this.self=r,typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__&&(this.stateKeys=hp(this.config.state),this.devtools=window.__REDUX_DEVTOOLS_EXTENSION__.connect({name:this.config.name??"updatelogic"}),this.devtools.init(this.createStateSnapshot()),this.devtools.subscribe(n=>{n.type==="DISPATCH"&&n.state}))}createStateSnapshot(){return rc(this.config.state,this.stateKeys)}sendStart(e,r){this.devtools.send({type:`→ ${e}`,args:r},this.createStateSnapshot())}sendError(e,r,n){this.devtools.send({type:`❌ ${e}`,args:r,error:n},this.createStateSnapshot())}sendSuccess(e,r,n){this.devtools.send({type:`✓ ${e}`,args:r,return:n},this.createStateSnapshot())}isIncluded(e){return this.config.excludeInDevTools?!this.config.excludeInDevTools.includes(e):!0}createProxyFunction(e,r){const n=this.devtools&&this.isIncluded(e);return typeof r=="function"?(...a)=>{if(!n)return pt(()=>r.call(this.self,...a));const i=rc(a);this.sendStart(e,i);try{const o=pt(()=>r.call(this.self,...a));return mp(o)?o.then(s=>(this.sendSuccess(e,i,s),s),s=>{throw this.sendError(e,i,s),s}):(this.sendSuccess(e,i,o),o)}catch(o){throw this.sendError(e,i,o),o}}:r}}const bp=(t,e)=>{const r={},n=new vp(t,r);return Object.keys(e).forEach(a=>{if(a==="state"||a==="name")return;const i=e[a];r[a]=n.createProxyFunction(a,i)}),r};async function kp(){if(typeof navigator>"u"||!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return!1;try{return(await navigator.mediaDevices.enumerateDevices()).some(e=>e.kind==="audioinput")}catch(t){return console.error("Error checking for microphone:",t),!1}}function Hi(){return typeof window>"u"||!window.MediaRecorder?null:MediaRecorder.isTypeSupported("audio/mp4")?"audio/mp4":MediaRecorder.isTypeSupported("audio/webm")?"audio/webm":MediaRecorder.isTypeSupported("audio/wav")?"audio/wav":null}function nc(){return typeof window>"u"?!1:!!(window.MediaRecorder&&Hi())}class ac{mediaRecorder=null;audioChunks=[];started=!1;starting=!1;stream=null;options;audioContext=null;analyser=null;dataArray=null;volumeUpdateInterval=null;constructor(e={}){this.options=e}async start(){if(this.started||this.starting){console.warn("AudioRecorder: Start already in progress or already started");return}if(!nc()||!navigator.mediaDevices){const e=new Error("MediaRecorder not supported or no microphone access");throw this.options.onError?.(e),e}try{if(this.starting=!0,this.stream=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},video:!1}),!this.starting){this.stopStream(this.stream);return}this.mediaRecorder&&this.mediaRecorder.state!=="inactive"&&(console.warn("AudioRecorder: MediaRecorder already active, stopping previous recording"),this.mediaRecorder.stop(),this.cleanup()),this.started=!0,this.starting=!1;const e=Hi();if(!e)throw new Error("No supported media type found");const r={mimeType:e};this.mediaRecorder=new MediaRecorder(this.stream,r),this.audioChunks=[],this.mediaRecorder.ondataavailable=n=>{n.data.size>0&&this.audioChunks.push(n.data)},this.mediaRecorder.onstop=async()=>{const n=this.audioChunks.length>0?new Blob(this.audioChunks,{type:e}):null;await this.options.onDataAvailable?.(n),this.options.onStop?.(),this.cleanup()},this.mediaRecorder.onerror=n=>{const a=new Error(`MediaRecorder error: ${n}`);this.options.onError?.(a),this.cleanup()},this.mediaRecorder.start(),this.setupVolumeAnalysis(this.stream),this.options.onStart?.()}catch(e){this.started=!1,this.starting=!1;const r=e instanceof Error?e:new Error(String(e));throw this.options.onError?.(r),r}}stop(){this.started=!1,this.starting=!1,this.volumeUpdateInterval&&(clearInterval(this.volumeUpdateInterval),this.volumeUpdateInterval=null),this.mediaRecorder&&this.mediaRecorder.state!=="inactive"?this.mediaRecorder.stop():(this.stream&&this.stopStream(this.stream),this.cleanup())}setupVolumeAnalysis(e){if(this.options.onVolumeChange)try{this.audioContext=new AudioContext,this.analyser=this.audioContext.createAnalyser(),this.analyser.fftSize=256,this.analyser.smoothingTimeConstant=.8;const r=this.analyser.frequencyBinCount;this.dataArray=new Uint8Array(r),this.audioContext.createMediaStreamSource(e).connect(this.analyser),this.startVolumeMonitoring()}catch(r){console.warn("Failed to set up volume analysis:",r)}}startVolumeMonitoring(){!this.analyser||!this.dataArray||!this.options.onVolumeChange||(this.volumeUpdateInterval=window.setInterval(()=>{if(!this.analyser||!this.dataArray||!this.started)return;this.analyser.getByteFrequencyData(this.dataArray);let e=0;for(let i=0;i<this.dataArray.length;i++)e+=this.dataArray[i]*this.dataArray[i];let n=Math.sqrt(e/this.dataArray.length)/255;n=Math.pow(n*3,.7);const a=Math.min(100,Math.max(0,Math.round(n*100)));this.options.onVolumeChange?.(a)},100))}get recording(){return this.started&&this.mediaRecorder?.state==="recording"}get isStarting(){return this.starting}stopStream(e){e.getTracks().forEach(r=>r.stop())}cleanup(){this.volumeUpdateInterval&&(clearInterval(this.volumeUpdateInterval),this.volumeUpdateInterval=null),this.audioContext&&(this.audioContext.close().catch(console.warn),this.audioContext=null),this.analyser=null,this.dataArray=null,this.stream&&(this.stopStream(this.stream),this.stream=null),this.mediaRecorder=null,this.audioChunks=[],this.started=!1,this.starting=!1}static isSupported(){return nc()}static getSupportedMediaType(){return Hi()}}const yp=t=>(localStorage.setItem("liipgpt-color-scheme",t),Zi(["light","dark"])),ic=()=>{const t=localStorage.getItem("liipgpt-color-scheme");return t==="light"||t==="dark"?t:"system"},Zi=t=>{let e=ic();return e==="system"&&(e=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),t.includes(e)?e:t[0]??"light"},wp=[{type:"email",check:t=>/\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}\b/.test(t)},{type:"creditCard",check:t=>/\b(?:\d[ -]*?){13,16}\b/.test(t)},{type:"ahv",check:t=>/\b756\.\d{4}\.\d{4}\.\d{2}\b/.test(t)},{type:"phoneSwiss",check:t=>/\b0(?:\s*\d){2}(?:\s*\/\s*)?(?:\s*\d){7,}\b/.test(t)},{type:"phoneInternational",check:t=>/(?:\+|00)(?:\s*\d){10,}\b/.test(t)},{type:"swissPassport",check:t=>/\b[A-HJ-NP-Z](?=.*\d)[A-HJ-NP-Z0-9]{7}\b/.test(t)},{type:"longNumber",check:t=>/\b\d{9,}\b/.test(t)}],oc=t=>{for(const e of wp)if(e.check(t))return e.type},Gi="liipgpt:selectorValues",Wi="liipgpt:selectorKnownDefaults",sc=()=>{try{const t=vt.getItem(Gi),e=vt.getItem(Wi);return t?{values:JSON.parse(t),knownDefaults:e?JSON.parse(e):{}}:null}catch{return null}},_p=t=>{const e={};for(const r of t)e[r.settingName]=r.defaultValues??(r.allowEmpty?[]:[r.values[0]]).filter(Boolean);return e},lc=(t,e)=>{try{const r=_p(e);vt.setItem(Gi,JSON.stringify(t)),vt.setItem(Wi,JSON.stringify(r))}catch(r){console.error("Failed to save selector values:",r)}},xp=t=>{try{const e=sc();if(!e)return;delete e.values[t],delete e.knownDefaults[t],vt.setItem(Gi,JSON.stringify(e.values)),vt.setItem(Wi,JSON.stringify(e.knownDefaults))}catch(e){console.error("Failed to clear selector saved state:",e)}},Sp=t=>{const e=sc(),r=t.map(n=>{const a=n.defaultValues??(n.allowEmpty?[]:[n.values[0]]).filter(Boolean);if(!e?.values[n.settingName])return[n.settingName,a];const i=e.values[n.settingName],o=e.knownDefaults[n.settingName]||[],s=i.filter(h=>n.values.includes(h)),c=o.filter(h=>!a.includes(h)),l=s.filter(h=>!c.includes(h)),u=a.filter(h=>!o.includes(h)&&!l.includes(h)),p=[...l,...u];return p.length===0&&!n.allowEmpty?[n.settingName,a]:[n.settingName,p]});return Object.fromEntries(r)};class Tp extends Error{constructor(e){super(e),this.name="UnreachableError"}}const cc=(t,e)=>{const n=new URLSearchParams(window.location.search).get("q");return n?{name:"chat-page",query:n}:t&&!e?{name:"consent-page"}:{name:"start-page"}};class Ep{#e=J(_t({}));get data(){return _(this.#e)}set data(e){P(this.#e,e,!0)}#t=J(_t({}));get targets(){return _(this.#t)}set targets(e){P(this.#t,e,!0)}#a=J(!1);get initialized(){return _(this.#a)}set initialized(e){P(this.#a,e,!0)}#l=J(0);get currentAudioVolume(){return _(this.#l)}set currentAudioVolume(e){P(this.#l,e,!0)}ariaLiveMessagesClearingTimeoutDuration=350;#u=J(null);get currentAudioRecorder(){return _(this.#u)}set currentAudioRecorder(e){P(this.#u,e,!0)}#i=J(!1);get isTranscribing(){return _(this.#i)}set isTranscribing(e){P(this.#i,e,!0)}#r=X(()=>{if(!this.initialized)return[];const e=this.data.chatConfig.menu;return e?e[this.data.language]??[]:[]});get menu(){return _(this.#r)}set menu(e){P(this.#r,e)}#o=X(()=>this.initialized?this.data.chatConfig.translations[this.data.language]??{}:{});get t(){return _(this.#o)}set t(e){P(this.#o,e)}#s=X(()=>this.initialized?Gl[this.data.language]??{}:Gl.en??{});get errorTranslations(){return _(this.#s)}set errorTranslations(e){P(this.#s,e)}#n=X(()=>this.initialized?Wl[this.data.language]??{}:Wl.en??{});get piiTranslations(){return _(this.#n)}set piiTranslations(e){P(this.#n,e)}#c=X(()=>this.initialized?this.data.currentColorScheme:"light");get colorScheme(){return _(this.#c)}set colorScheme(e){P(this.#c,e)}#d=X(()=>this.initialized?this.data.chatConfig.fullTheme[this.data.currentColorScheme]:{});get themeBase(){return _(this.#d)}set themeBase(e){P(this.#d,e)}#f=X(()=>this.themeBase.tokens);get theme(){return _(this.#f)}set theme(e){P(this.#f,e)}#h=X(()=>{if(!this.initialized)return[];const e=[];for(const r of this.data.chatConfig.selectorsConfig){if(r.allowEmpty)continue;(this.data.selectorValues[r.settingName]||[]).length===0&&e.push(r.settingName)}return e});get selectorsWithErrors(){return _(this.#h)}set selectorsWithErrors(e){P(this.#h,e)}}const g=new Ep;let ct,kt,uc;bp({name:"chat-logic",state:g,excludeInDevTools:["onInput"]},{async init(t){kt=t;const e=kt.speechRecognitionApiKey||void 0;ct=new Uf({apiUrl:kt.apiUrl,apiKey:kt.apiKey,speechRecognitionApiKey:e,strict:!0});try{const r=await ct.getChatConfig();window.CHAT_CONFIG_OVERRIDE&&Object.assign(r,window.CHAT_CONFIG_OVERRIDE);const a=(await ct.getMetadata()).mode==="maintenance";a&&this.showErrorToast("maintenance");const i=Zl(r);kt.inlineLayout!==void 0&&(i.inlineLayout=kt.inlineLayout);let o;kt.lang?o=ba(kt.lang,i.supportedLanguages):o=Jl(i.supportedLanguages),Xl(o,g.targets.mainElement);const s=await this.getPredefinedQuestions(o),c=[];if(i.renderKatex){const h=await import("https://esm.sh/marked-katex-extension@5.1.5").catch(v=>{console.error("Couldn't load marked-katex-extension:",v)});h&&(ct.setMarkedExtensions(h.default({nonStandard:!0,output:"mathml"})),c.push("https://cdn.jsdelivr.net/npm/katex@0.16.22/dist/katex.min.css"))}const l=Object.keys(i.fullTheme);let u=!1;if(i.forceConsent)try{u=vt.getItem("liipgpt:termsAccepted")==="true"}catch(h){console.warn("Failed to load terms acceptance from storage:",h)}g.data={currentConversationState:"idle",chatConfig:i,language:o,predefinedQuestions:s,isInMaintenance:a,history:[],selectedColorScheme:ic(),has2ColorSchemes:l.length===2,currentColorScheme:Zi(l),conversationFeedbackId:void 0,conversationFeedbackIsOpen:!1,openedPopup:void 0,props:kt,flyoutIsOpen:!1,questionHasPii:void 0,chatInputValue:"",selectorValues:Sp(i.selectorsConfig),selectorsIsOpen:!1,currentReferencesAsideId:void 0,ariaLiveStatusMessage:void 0,ariaLiveStatusMessageClearingTimeout:void 0,wasReferencesAsideClosed:!1,isAsideMobile:!0,route:cc(i.forceConsent??!1,u),additionalStylesheets:c,hasOpenedOverlays:!1,isInlineLayoutContained:!1,termsAccepted:u},window.LIIPGPT_LISTENERS?.route?.(g.data.route),window.LIIPGPT_LISTENERS?.conversation?.(g.data.currentConversationState),g.data.selectorsIsOpen=g.data.chatConfig.showExpandedSelectors??!1,g.initialized=!0,this.checkForOpenedPopup(),window.addEventListener("hashchange",()=>{this.checkForOpenedPopup()}),this.goto(cc(i.forceConsent??!1,u),!0)}catch(r){throw Vi.error(r instanceof Error?r.message:"Failed to load the chatbot. Please reload the page.",{duration:1e4,unstyled:!0,classes:{toast:"toast"}}),r}},setTarget(t,e){g.targets[t]=e},goto(t,e=!1){if(!(!e&&sp(g.data.route,t)))switch(g.data.route=t,window.LIIPGPT_LISTENERS?.route?.(t),t.name){case"consent-page":break;case"start-page":t.prefill&&(g.data.chatInputValue=t.prefill);break;case"chat-page":if(g.data.chatInputValue=t.query,this.onSubmit(),g.data.chatConfig.addQueryToUrlParams){const r=new URLSearchParams(window.location.search);r.set("q",t.query),history.pushState(null,"",`?${r.toString()}`)}break}},getSelectorConfig(t){const e=g.data.chatConfig.selectorsConfig.find(r=>r.settingName===t);if(!e)throw new Error(`Setting ${t} not found`);return e},getPrettifiedSelectorValues(){const t=Object.entries(g.data.selectorValues).map(([e,r])=>{let n;try{n=this.getSelectorConfig(e)}catch(a){console.error(`Error getting selector config for ${e}: ${a}`);return}return n.type==="single-select"?[e,r[0]]:[e,r]}).filter(e=>!!e);return Object.fromEntries(t)},setSelectorValue(t,e){const r=this.getSelectorConfig(t);if(!r){console.warn(`Trying to set setting ${t} but it is not defined in the chat config`);return}if(r.type==="single-select"&&e.length>1){console.warn(`Trying to set multiple values for single-select setting ${t}`);return}g.data.selectorValues[t]=e,lc(g.data.selectorValues,g.data.chatConfig.selectorsConfig)},resetSelectorToDefaults(t){const e=this.getSelectorConfig(t);if(!e){console.warn(`Trying to reset setting ${t} but it is not defined in the chat config`);return}const r=e.defaultValues??(e.allowEmpty?[]:[e.values[0]]).filter(Boolean);return xp(t),g.data.selectorValues[t]=r,lc(g.data.selectorValues,g.data.chatConfig.selectorsConfig),r},async getPredefinedQuestions(t){try{return ct.getPredefinedQuestions({url:window.location.origin+window.location.pathname,language:t})}catch(e){return console.warn("Failed to load predefined questions:",e),[]}},setColorScheme(t){g.data.selectedColorScheme=t,g.data.currentColorScheme=yp(t),this.setAriaLiveStatusMessage(t==="dark"?g.t.ariaDarkSelected:g.t.ariaLightSelected)},async abort(){await uc?.abort()},changeConversationState(t){g.data.currentConversationState=t,window.LIIPGPT_LISTENERS?.conversation?.(t)},onInput(t){g.data.chatConfig.blockPII&&(g.data.questionHasPii=oc(t)),g.data.chatInputValue=t},onSubmit(t=!1){if(g.data.questionHasPii){console.warn("Question contains PII, not submitting:",g.data.questionHasPii);return}const e=g.data.chatConfig.questionPrefix?`${g.data.chatConfig.questionPrefix} ${g.data.chatInputValue}`:g.data.chatInputValue,r=g.data.history.push({type:"user",time:new Date().toISOString(),message:g.data.chatInputValue});g.data.history.push({id:"UNRESOLVED",state:"loading",errors:[],type:"bot",time:new Date().toISOString(),message:{markdown:"",html:"",text:""},references:{all:[],used:[],unused:[]}});const n={features:kt.features?kt.features.trim().split(","):["formatting"],onError:u=>{this.showErrorToast(u),window.LIIPGPT_LISTENERS?.error?.(u),(u==="pii-detected"||u==="blocked")&&this.editLatestQuestion()},lang:g.data.language,selectorValues:this.getPrettifiedSelectorValues()},a=(u,p)=>{try{const h=new URL(u),v=new URL(p);return h.origin===v.origin&&h.pathname===v.pathname}catch{return!1}},i=g.data.chatConfig.sendReferrer??"all";if(["all","own","location"].includes(i)){const u=i==="location"||g.data.props.flyout;let p;u?p=`${window.location.protocol}//${window.location.host}${window.location.pathname}`:p=a(document.referrer,window.location.href)?null:document.referrer;const h=i==="own"&&!g.data.props.flyout&&p&&!p.startsWith(window.location.origin);n.referrer=p&&!h?p:void 0}g.data.currentConversationId||(g.data.currentConversationId=ct.createConversationId());const o=ct.chat(g.data.currentConversationId,e,n);uc=o,g.data.lastChatResponseId=o.id,g.data.currentConversationState!=="searching"&&this.changeConversationState("searching"),this.setAriaLiveStatusMessage(g.t.ariaQuestionSent);let s=!1,c;const l=!!g.data.currentReferencesAsideId;(t&&l||!t&&g.data.chatConfig.showReferencesByDefault)&&(g.data.isAsideMobile||this.openReferencesAside(o.id)),o.subscribe(u=>{if(g.data.history[r]&&(g.data.history[r]={question:g.data.chatInputValue,...u}),g.data.chatConfig.addRetrievalQuestionToUrlParams&&u.retrievalQuestion){const p=new URLSearchParams(window.location.search);p.get("search")!==u.retrievalQuestion&&(p.set("search",u.retrievalQuestion),history.replaceState(null,"",`?${p.toString()}`))}g.data.chatConfig.showReferencesByDefault&&!g.data.wasReferencesAsideClosed&&g.data.currentReferencesAsideId!==u.id&&!g.data.isAsideMobile&&this.openReferencesAside(u.id),u.state==="streaming"&&g.data.currentConversationState!=="answering"&&this.changeConversationState("answering"),u.state==="done"&&(this.changeConversationState("idle"),s||(s=!0,this.setAriaLiveStatusMessage(`${g.t.ariaAnswerReady} ... ${u.message.text} ... ${g.t.ariaAnswerFinished}`)),g.data.currentReferencesAsideId&&g.data.history[r].references.used.length>0?(clearTimeout(c),c=setTimeout(()=>{this.openReferencesAside(u.id)},100)):this.closeReferencesAside())}),g.data.chatInputValue=""},async onStartSpeechRecognition(){try{if(!await kp()){this.showErrorToast("speech-not-supported");return}if(await navigator.mediaDevices.getUserMedia({audio:!0}),ac.isSupported())g.data.chatInputValue="",g.currentAudioRecorder=new ac({onDataAvailable:async e=>{g.isTranscribing=!0,await this.handleTranscription(e)},onError:()=>{this.showErrorToast("speech-microphone-access-denied"),g.currentAudioRecorder=null,g.isTranscribing=!1},onVolumeChange:e=>{g.currentAudioVolume=e}}),g.currentAudioRecorder.start();else{this.showErrorToast("speech-not-supported");return}}catch(t){throw this.showErrorToast("speech-microphone-access-denied"),g.currentAudioRecorder=null,g.isTranscribing=!1,t}},editLatestQuestion(){const t=g.data.history.findLastIndex(r=>r?.type==="user");if(t===-1){console.error("No last user question, available");return}const e=g.data.history.splice(t)[0];g.data.chatInputValue=e.message},onStopSpeechRecognition(){if(g.currentAudioRecorder){const t=g.currentAudioRecorder;g.currentAudioRecorder=null,t.stop()}g.currentAudioVolume=0},async handleTranscription(t){if(!t){console.warn("No audio data received");return}try{const e=await ct.transcribeAudio(t,{lang:g.data.language});if(e.error){this.showErrorToast("speech-transcription-failed");return}if(e.transcript.trim()){if(g.data.chatConfig.blockPII&&(g.data.questionHasPii=oc(e.transcript.trim()),g.data.questionHasPii))return;g.data.chatInputValue=e.transcript.trim()}else this.showErrorToast("speech-no-text-detected")}catch(e){console.error("Speech transcription error:",e),this.showErrorToast("speech-transcription-failed")}finally{g.currentAudioRecorder=null,g.isTranscribing=!1,g.currentAudioVolume=0}},async onStartConversation(t){await this.abort(),g.data.history=[],g.data.currentConversationId=ct.createConversationId(),this.goto({name:"chat-page",query:t})},async onNewConversation(){if(await this.abort(),g.data.currentConversationId=void 0,g.data.currentReferencesAsideId=void 0,g.data.history=[],g.data.chatConfig.addQueryToUrlParams){const t=new URLSearchParams(window.location.search);t.delete("q"),history.pushState(null,"",`?${t.toString()}`)}this.goto({name:"start-page"})},showSuccessToast(t){Vi.success(g.t[t],{unstyled:!0,duration:3e3,classes:{toast:"toast"}})},showErrorToast(t){Vi.error(g.errorTranslations[t],{unstyled:!0,duration:3e3,classes:{toast:"toast"}})},async submitFeedback(t){try{const e=g.data.conversationFeedbackId||g.data.lastChatResponseId;if(!e)throw new Tp("Tried to give feedback with no id.");const r=g.data.history.find(n=>n.type==="bot"&&n.id===e);await ct.feedback(e,r?.question??"",t),setTimeout(()=>{this.showSuccessToast("thankYouForFeedback")},500)}catch(e){console.error("Feedback failed:",e),this.showErrorToast("feedback-failed")}},toggleReferencesAside(t){g.data.currentReferencesAsideId===t?this.closeReferencesAside():this.openReferencesAside(t)},openReferencesAside(t){g.data.currentReferencesAsideId=t,this.setOpenOverlay(!0)},closeReferencesAside(){g.data.currentReferencesAsideId=void 0,g.data.wasReferencesAsideClosed=!0,this.setOpenOverlay(!1)},setAsideMobile(t){g.data.isAsideMobile=t},openFlyout(){g.data.flyoutIsOpen=!0},closeFlyout(){g.data.flyoutIsOpen=!1},openConversationFeedback(){g.data.conversationFeedbackIsOpen=!0,this.setOpenOverlay(!0)},openMessageFeedback(t){g.data.conversationFeedbackId=t},closeFeedback(){g.data.conversationFeedbackIsOpen=!1,g.data.conversationFeedbackId=void 0,this.setOpenOverlay(!1)},setOpenOverlay(t){g.data.hasOpenedOverlays=t},setAriaLiveStatusMessage(t){g.data.ariaLiveStatusMessage=t,clearTimeout(g.data.ariaLiveStatusMessageClearingTimeout),g.data.ariaLiveStatusMessageClearingTimeout=setTimeout(()=>{g.data.ariaLiveStatusMessage=""},g.ariaLiveMessagesClearingTimeoutDuration)},closePopup(){window.location.hash=""},checkForOpenedPopup(){const t=window.location.hash.slice(1),e=g.t.popups?.find(r=>r.hash===t);e?g.data.openedPopup=e:g.data.openedPopup=void 0},async thumbs(t,e){try{const r=g.data.history.find(n=>n.type==="bot"&&n.id===t);e==="up"?await ct.thumbsUp(t,r?.question??""):await ct.thumbsDown(t,r?.question??""),this.showSuccessToast("thankYouForFeedback")}catch(r){console.error("Feedback failed:",r),this.showErrorToast("feedback-failed")}},async onLanguageChange(t){if(g.data.language=ba(t,g.data.chatConfig.supportedLanguages),Xl(g.data.language,g.targets.mainElement),g.data.predefinedQuestions=await this.getPredefinedQuestions(g.data.language),this.setAriaLiveStatusMessage(g.t.ariaLanguageChanged),g.data.chatConfig.reflectLanguageInPath){const e=new URL(window.location.href);e.pathname=`/${g.data.language}`,window.history.replaceState({},"",e.toString())}},async acceptTerms(){g.data.termsAccepted=!0;try{vt.setItem("liipgpt:termsAccepted","true")}catch(t){console.warn("Failed to save terms acceptance to storage:",t)}this.closePopup(),this.closeFlyout(),await ns(),this.goto({name:"start-page"})},updateChatInput(t){g.data.chatInputValue=t}});const Cp='@layer base,utilities,components;/*! tailwindcss v4.1.11 | MIT License | https://tailwindcss.com */@layer base{*,:after,:before,::backdrop,::file-selector-button{box-sizing:border-box;margin:0;padding:0;border:0 solid}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea,::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::-moz-placeholder{opacity:1}::placeholder{opacity:1}@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px){::-moz-placeholder{color:currentcolor}@supports (color: color-mix(in lab,red,red)){{color:color-mix(in oklab,currentcolor 50%,transparent)}}::placeholder{color:currentcolor}@supports (color: color-mix(in lab,red,red)){{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]),::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer base{.chat-app{--spacer-1: .0625rem;--spacer-2: .125rem;--spacer-3: .1875rem;--spacer-4: .25rem;--spacer-5: .3125rem;--spacer-6: .375rem;--spacer-8: .5rem;--spacer-10: .625rem;--spacer-12: .75rem;--spacer-16: 1rem;--spacer-20: 1.25rem;--spacer-24: 1.5rem;--spacer-28: 1.75rem;--spacer-32: 2rem;--spacer-40: 2.5rem;--spacer-48: 3rem;--spacer-56: 3.5rem;--spacer-64: 4rem;--spacer-72: 4.5rem;--spacer-80: 5rem;--spacer-120: 7.5rem;--spacer-r-8: clamp(.375rem, .3182rem + .2841cqw, .5rem);--spacer-r-12: clamp(.625rem, .5682rem + .2841cqw, .75rem);--spacer-r-16: clamp(.75rem, .6364rem + .5682cqw, 1rem);--spacer-r-20: clamp(.875rem, .7045rem + .8523cqw, 1.25rem);--spacer-r-24: clamp(1rem, .7727rem + 1.1364cqw, 1.5rem);--spacer-r-28: clamp(1.125rem, .8409rem + 1.4205cqw, 1.75rem);--spacer-r-32: clamp(1.25rem, .9091rem + 1.7045cqw, 2rem);--spacer-r-40: clamp(1.5rem, 1.0455rem + 2.2727cqw, 2.5rem);--spacer-r-48: clamp(1.625rem, 1rem + 3.125cqw, 3rem);--spacer-r-56: clamp(1.75rem, .9545rem + 3.9773cqw, 3.5rem);--spacer-r-64: clamp(2rem, 1.0909rem + 4.5455cqw, 4rem);--spacer-r-80: clamp(3rem, 2.0909rem + 4.5455cqw, 5rem);--spacer-r-96: clamp(3.5rem, 2.3636rem + 5.6818cqw, 6rem);--spacer-r-120: clamp(4rem, 2.4091rem + 7.9545cqw, 7.5rem);--default-transition-duration: .2s;--default-transition-timing-function: ease-in-out;--z-index-flyout: 10000;--z-index-dialog: 600;--z-index-loader: 500;--z-index-reference-number: 400;--z-index-footer: 300;--z-index-header: 200;--z-index-tooltip: 100;--z-index-tooltip-hover: 101;--z-index-local-overlay: 10;--ease-out-quart: cubic-bezier(.165, .84, .44, 1);--ease-in-quart: cubic-bezier(.895, .03, .685, .22);--ease-in-out-quart: cubic-bezier(.77, 0, .175, 1);--fly-in-id: 0;--btn-padding-x: var(--spacer-r-20);--btn-padding-y: var(--spacer-r-8);--btn-icon-size: var(--spacer-24);--btn-submit-size: 2.5em;--last-bot-message-min-height: 0}}@value container-xs,container-sm,container-md,container-lg,container-inner-xs,container-inner-sm,container-inner-md,container-inner-lg from "./viewports.css";@layer base{.chat-app :where(h1,.h1,h2,.h2,h3,.h3,h4,.h4,h5,.h5,h6,.h6){font-weight:var(--base-font-weight-title);line-height:var(--base-line-height-tight)}.chat-app :where(b,strong){font-weight:var(--base-font-weight-bold)}.chat-app :where(button){cursor:pointer}.chat-app :where(input[type=text],input[type=email],input[type=search],input[type=password],textarea){width:100%;padding:var(--input-padding);border-width:var(--input-border-width);border-radius:var(--input-border-radius);border-color:var(--input-border-color);background:var(--input-background);box-shadow:var(--input-box-shadow, none);color:var(--input-color)}.chat-app :where(input[type=text],input[type=email],input[type=search],input[type=password],textarea)::-moz-placeholder{color:var(--input-placeholder-color);opacity:var(--input-placeholder-opacity)}.chat-app :where(input[type=text],input[type=email],input[type=search],input[type=password],textarea)::placeholder{color:var(--input-placeholder-color);opacity:var(--input-placeholder-opacity)}.chat-app :where(input[type=radio],input[type=checkbox]){margin:0}.chat-app :where(*:focus-visible){border-radius:var(--btn-primary-border-radius);outline-color:var(--body-focus-color);outline-style:var(--body-focus-style);outline-width:var(--body-focus-width);outline-offset:var(--body-focus-offset)}.chat-app *::-moz-selection{background:var(--body-selection-background);color:var(--body-selection-color)}.chat-app *::selection{background:var(--body-selection-background);color:var(--body-selection-color)}.chat-app ::-webkit-scrollbar{width:8px;height:8px}.chat-app ::-webkit-scrollbar-track{background:transparent}.chat-app ::-webkit-scrollbar-thumb{border-radius:4px;background-color:#0000004d;-webkit-transition:background-color .2s;transition:background-color .2s}.chat-app ::-webkit-scrollbar-thumb:hover{background-color:#00000080}.chat-app *{scrollbar-color:rgba(0,0,0,.3) transparent;scrollbar-width:thin}.chat-app ::-webkit-scrollbar-thumb{visibility:hidden}.chat-app *:hover::-webkit-scrollbar-thumb,.chat-app *:active::-webkit-scrollbar-thumb,.chat-app *:focus::-webkit-scrollbar-thumb{visibility:visible}}@layer utilities{.chat-app :where(.expand-interaction){position:relative}.chat-app :where(.expand-interaction):after{position:absolute;inset:0;background-color:transparent;content:""}.chat-app :where(.sr-only){position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.chat-app :where(.transition-colors){transition-duration:var(--default-transition-duration);transition-property:color,background-color,border-color,box-shadow;transition-timing-function:var(--default-transition-timing-function)}.chat-app :where(.transition){transition-duration:var(--default-transition-duration);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter;transition-timing-function:var(--default-transition-timing-function)}.chat-app :where(.skip-link){position:absolute;width:0px;height:0px;overflow:hidden;color:var(--anchor-color);font-weight:700;font-size:var(--base-font-size-xs)}.chat-app :where(.skip-link):focus-visible{position:static;width:auto;height:auto}.chat-app :where(.fly-in){--fly-in-id: 0;--fly-in-duration: .4s;--fly-out-duration: .2s;--fly-in-delay: .3s;--fly-in-delay-additional: .1s;--fly-in-y: var(--spacer-r-64);transform:translateY(var(--fly-in-y));opacity:0;transition-delay:0s,1s;transition-duration:var(--fly-out-duration);transition-property:opacity,transform;transition-timing-function:ease,var(--ease-out-quart)}.chat-app :where(.mounted .fly-in){transform:translateY(0);opacity:1;transition-delay:calc(var(--fly-in-delay) + var(--fly-in-id) * var(--fly-in-delay-additional));transition-duration:var(--fly-in-duration)}.chat-app :where(.truncate){display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-app :where(.line-clamp){display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1}.chat-app :where(.line-clamp--2){-webkit-line-clamp:2}.chat-app :where(.line-clamp--6){-webkit-line-clamp:6}.chat-app :where(.container){width:100%;max-width:var(--container-max-width, 1024px);margin:0 auto;padding-right:var(--spacer-16);padding-left:var(--spacer-16)}@container chat-container (min-width: 640px){.chat-app :where(.container){padding-right:var(--spacer-32);padding-left:var(--spacer-32)}}@container chat-container (min-width: 768px){.chat-app :where(.container){padding-right:var(--spacer-48);padding-left:var(--spacer-48)}}.chat-app :where(h1){font-size:var(--base-font-size-h1)}.chat-app :where(h2){font-size:var(--base-font-size-h2)}.chat-app :where(h3){font-size:var(--base-font-size-h3)}.chat-app :where(h4,h5,h6){font-size:var(--body-font-size)}.chat-app :where(.h1){font-size:var(--base-font-size-h1)}.chat-app :where(.h2){font-size:var(--base-font-size-h2)}.chat-app :where(.h3){font-size:var(--base-font-size-h3)}.chat-app :where(.h4,.h5,.h6){font-size:var(--body-font-size)}.chat-app :where(.text-container)>:where(p,ul,ol,img,table){display:block;margin-bottom:var(--spacer-r-24)}.chat-app :where(.text-container)>:where(div){margin:var(--spacer-r-40) 0}.chat-app :where(.text-container)>:where(h1,.h1){margin-bottom:var(--spacer-r-28)}.chat-app :where(.text-container)>:where(h2,.h2,h3,.h3,h4,.h4,h5,.h5,h6,.h6){margin-bottom:var(--spacer-r-20)}.chat-app :where(.text-container)>:where(h1,.h1,h2,.h2,h3,.h3,h4,.h4,h5,.h5,h6,.h6){margin-top:var(--spacer-r-40)}.chat-app :where(.text-container)>:where(ul:not(.no-list-styling),ol:not(.no-list-styling))>:where(li){margin-bottom:var(--spacer-12)}.chat-app :where(.text-container)>:where(ul:not(.no-list-styling),ol:not(.no-list-styling))>:where(li):last-child{margin-bottom:0}.chat-app :where(.text-container)>:where(ol){padding-left:1.5em;list-style-position:outside;list-style-type:decimal}.chat-app :where(.text-container)>:where(ul:not(.no-list-styling))>:where(li){position:relative;padding-left:1em}.chat-app :where(.text-container)>:where(ul:not(.no-list-styling))>:where(li):before{position:absolute;top:0;left:0;content:"•";font-size:.9em}.chat-app :where(.text-container)>:where(hr){height:1px;margin:var(--spacer-r-40) 0;border:none;background-color:var(--color-grey-700);background-color:var(--hr-color)}.chat-app :where(.text-container) :where(a:not(.button,.no-link-styling,.reference)){color:var(--anchor-color);font-weight:var(--anchor-font-weight, var(--base-font-weight-normal));-webkit-text-decoration:var(--anchor-text-decoration, underline);text-decoration:var(--anchor-text-decoration, underline);text-underline-offset:var(--anchor-text-underline-offset, .15em);transition-duration:var(--default-transition-duration);transition-property:color,background-color,border-color;transition-timing-function:var(--default-transition-timing-function)}.chat-app :where(.text-container) :where(a:not(.button,.no-link-styling,.reference)):hover{color:var(--anchor-hover-color)}.chat-app :where(.text-container) :where(table){display:block;width:100%;overflow-x:auto;border-collapse:collapse;border-spacing:0;-webkit-overflow-scrolling:touch}.chat-app :where(.text-container) :where(th){width:1000px;padding:var(--spacer-12) var(--spacer-16) var(--spacer-12) 0;border-bottom:1px solid var(--color-grey-300);line-height:var(--base-line-height-tight);text-align:left;vertical-align:bottom}.chat-app :where(.text-container) :where(td){padding:var(--spacer-12) var(--spacer-16) var(--spacer-12) 0;border-bottom:1px solid var(--color-grey-300);vertical-align:top}.chat-app :where(.text-container) :where(tr:last-child td){border-bottom:none}.chat-app :where(.text-container) :where(*:first-child){margin-top:0}.chat-app :where(.text-container) :where(*:last-child){margin-bottom:0}.chat-app :where(.animated-height){transition:height .5s var(--ease-in-out-quart)}.chat-app :where(.display-contents){display:contents}.chat-app :where(.absolute){position:absolute!important}}@layer base{.svg{width:var(--spacer-r-24);height:auto}.svg svg{display:block;width:100%;height:auto;overflow:visible}}@layer components{.chat-app{display:contents}.chat-app__container{container-name:chat-container;container-type:inline-size;display:flex;height:100%;overflow:hidden;transform:translateZ(0)}.chat-app__container>:where(*){color:var(--body-color);font-style:normal;font-weight:var(--base-font-weight-normal);font-size:var(--base-font-size-body);line-height:var(--base-line-height-default);font-family:var(--font-family);font-optical-sizing:auto}.chat-app__container.chat-app__container--inline-layout-contained{height:90svh;scroll-margin-top:10svh}@media (min-width: 768px){.chat-app__container.chat-app__container--inline-layout-contained{height:100svh;scroll-margin-top:0}}.chat-app__main{container-name:chat-inner-container;container-type:inline-size;display:flex;flex-direction:column;width:100%;height:100%;overflow-x:hidden;overflow-y:auto;overscroll-behavior-x:none;overscroll-behavior-y:contain;background:var(--body-background);scrollbar-gutter:stable;touch-action:pan-y}.chat-app__container--inline-layout .chat-app__main{overscroll-behavior-y:auto}.chat-app__loader-container{display:flex;z-index:var(--z-index-loader);position:relative;align-items:center;justify-content:center;width:100%;height:100%}.chat-app__portals{display:contents}.chat-app__header{z-index:var(--z-index-header);position:sticky;top:0;background:var(--body-background)}.chat-app__header--unsticked{position:relative}.chat-app__header-content{--btn-padding-x: var(--btn-padding-y);display:flex;position:relative;-moz-column-gap:var(--spacer-r-12);column-gap:var(--spacer-r-12);flex-wrap:wrap;align-items:center;justify-content:flex-end;margin-right:calc(var(--btn-padding-x) * -1);margin-left:calc(var(--btn-padding-x) * -1);padding-top:var(--spacer-10);padding-bottom:var(--spacer-10)}.chat-app__header-content>:where(*){z-index:0;position:relative;pointer-events:auto}.chat-app__header-content:after{position:absolute;right:var(--btn-padding-x);bottom:0;left:var(--btn-padding-x);border-bottom:1px solid transparent;content:"";transition:border-color .1s ease-in-out}.chat-app__header-content.has-border:after{border-color:var(--base-line-color)}.chat-app__header-new-conversation{position:relative;margin-right:auto}@container chat-container (min-width: 640px){.chat-app__header-new-conversation .tooltip{display:none}}.chat-app__header--with-logo :where(.chat-app__header-content){margin-left:0}.chat-app__header--with-logo :where(.chat-app__header-new-conversation){margin-right:unset;margin-left:auto}.chat-app__header-logo{margin-right:auto}.chat-app__header-logo :where(svg){width:auto;height:var(--spacer-28)}.chat-app__body{display:flex;position:relative;flex-grow:1;flex-direction:column;width:100%}.chat-app__page-transition{display:flex;flex-grow:1;flex-direction:column;width:100%;height:100%}.chat-app__aside{--duration-in: .65s;--duration-out: .5s;visibility:hidden;position:relative;top:0;bottom:0;flex-grow:1;width:0;transition-delay:0s,var(--duration-out);transition-duration:var(--duration-out),0s;transition-property:width,visibility;transition-timing-function:var(--ease-in-out-quart),linear}.chat-app__aside.open{visibility:visible;width:var(--aside-width);transition-delay:0s;transition-duration:var(--duration-in),0s;transition-timing-function:var(--ease-out-quart),linear}.chat-app__aside .tooltip{--background-color: var(--btn-secondary-hover-background)}.chat-app__aside-container{position:relative;width:var(--aside-width);height:100%;overflow-y:auto;overscroll-behavior:contain;border-left-width:var(--aside-border-width);border-color:var(--aside-border-color);background:var(--aside-background);scrollbar-gutter:stable}.chat-app__container--inline-layout .chat-app__aside-container{overscroll-behavior-y:auto}.chat-app__aside-header,.chat-app__sheet-header{display:flex;z-index:var(--z-index-header);position:sticky;top:0;flex-wrap:no-wrap;align-items:center;justify-content:space-between;padding:var(--spacer-12) var(--spacer-12) var(--spacer-12) var(--spacer-24);gap:var(--spacer-24);border-bottom-width:var(--aside-header-border-width);border-color:var(--aside-header-border-color);background:var(--aside-background);color:var(--aside-header-color)}.chat-app__sheet-close{position:relative}.chat-app__sheet-overlay{z-index:var(--z-index-dialog);position:fixed;inset:0;background:var(--aside-background-overlay)}.chat-app__sheet-content{z-index:var(--z-index-flyout);position:fixed;top:0;right:0;width:100%;max-width:var(--aside-width);height:100%;overflow-y:auto;overscroll-behavior:contain;border-left-width:var(--aside-border-width);border-color:var(--aside-border-color);background:var(--aside-background);scrollbar-gutter:stable}.chat-app__container--inline-layout .chat-app__sheet-content{overscroll-behavior-y:auto}:is(.chat-app__aside-close,.chat-app__sheet-close) :where(.btn){background-color:transparent}.chat-app__aside-title,.chat-app__sheet-title{font-size:var(--base-font-size-sm)}.chat-app__close-button{z-index:var(--z-index-flyout)}}@layer components{.open-button{--open-button-avatar-height: var(--spacer-r-80);--open-button-avatar-width: var(--spacer-r-80);--open-button-duration: .4s;--open-button-delay: .3s;--open-button-ease: ease-in-out;display:flex;flex-direction:row;align-items:flex-end;cursor:pointer;transition:opacity .15s ease-out}.open-button--expanded{opacity:0;pointer-events:none}.open-button__text{display:flex;position:absolute;right:100%;bottom:50%;flex-direction:column;align-items:flex-start;justify-content:center;margin-right:calc(var(--open-button-avatar-width) * -.5);padding-top:var(--spacer-r-12);padding-right:0;padding-bottom:var(--spacer-r-12);padding-left:0;overflow:hidden;transform:translateY(50%);border-width:var(--open-button-border-width);border-radius:var(--open-button-border-radius);border-color:var(--open-button-border-color);background:var(--open-button-background);box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a;color:var(--open-button-color);text-align:left;transition:transform var(--open-button-duration) var(--open-button-ease),padding-right var(--open-button-duration) var(--open-button-delay) var(--open-button-ease)}.open-button:is(:hover,.open-button--programmatic-expand) .open-button__text{transform:translateY(0);background:var(--open-button-hover-background, var(--open-button-background));color:var(--open-button-hover-color, var(--open-button-color));opacity:1;transition:transform var(--open-button-duration) var(--open-button-delay) var(--open-button-ease)}.open-button__title{max-width:240px;padding:0 calc(var(--open-button-avatar-width) * .5 + var(--spacer-r-12)) 0 var(--spacer-r-12);font-weight:700;white-space:pre}.open-button__mask{width:0;height:0;overflow:hidden;transition:width var(--open-button-duration) var(--open-button-delay) var(--open-button-ease),height var(--open-button-duration) var(--open-button-ease)}.open-button:is(:hover,.open-button--programmatic-expand) .open-button__mask{transition:width var(--open-button-duration) var(--open-button-ease),height var(--open-button-duration) var(--open-button-delay) var(--open-button-ease)}.open-button__description{position:relative;width:50cqw;max-width:260px;padding:0 calc(var(--open-button-avatar-width) * .5 + var(--spacer-r-12)) 0 var(--spacer-r-12);text-wrap:balance}.open-button__avatar{z-index:var(--z-index-local-overlay);position:relative;width:var(--open-button-avatar-width);height:var(--open-button-avatar-height);overflow:clip;border-radius:var(--spacer-r-80);filter:drop-shadow(0 4px 6px rgba(0,0,0,.15));transition:transform .2s var(--open-button-ease)}.open-button:is(:hover,.open-button--programmatic-expand) .open-button__avatar{transform:scale(1.05)}.open-button__link-icon{display:none;position:absolute;right:0;width:var(--spacer-r-80);height:var(--spacer-r-80);padding:var(--spacer-r-20);color:var(--open-button-color)}:where(.open-button--standalone){position:fixed;right:var(--spacer-r-16);bottom:var(--spacer-r-16)}@media (prefers-reduced-motion: reduce){.open-button__text,.open-button__mask,.open-button:hover .open-button__text,.open-button:hover .open-button__mask{transition:none!important}.open-button__avatar,.open-button:hover .open-button__avatar{filter:none!important;transition:none!important}}.open-button--hide-title-when-collapsed .open-button__text{visibility:hidden;opacity:0;transition:transform var(--open-button-duration) var(--open-button-ease),padding-right var(--open-button-duration) var(--open-button-delay) var(--open-button-ease),opacity var(--open-button-duration) var(--open-button-delay) var(--open-button-ease),visibility 0s linear calc(var(--open-button-duration) + var(--open-button-delay))}.open-button--hide-title-when-collapsed:is(:hover,.open-button--programmatic-expand) .open-button__text{visibility:visible;transform:translateY(0);background:var(--open-button-hover-background, var(--open-button-background));color:var(--open-button-hover-color, var(--open-button-color));opacity:1;transition:transform var(--open-button-duration) var(--open-button-delay) var(--open-button-ease),opacity var(--open-button-duration) var(--open-button-ease),visibility 0s linear 0s}}',Ap=new RegExp("([\\p{Ll}\\d])(\\p{Lu})","gu"),Rp=new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])","gu"),Ip=new RegExp("(\\d)(\\p{Ll})","gu"),Lp=new RegExp("(\\p{L})(\\d)","gu"),Op=/[^\p{L}\d]+/giu,ka="$1\0$2",Mp="";function Pp(t,e){let r=t.trim();r=r.replace(Ap,ka).replace(Rp,ka),e?.separateNumbers&&(r=r.replace(Ip,ka).replace(Lp,ka)),r=r.replace(Op,"\0");let n=0,a=r.length;for(;r.charAt(n)==="\0";)n++;if(n===a)return[];for(;r.charAt(a-1)==="\0";)a--;return r.slice(n,a).split(/\0/g)}function Np(t,e){return zp(t,e?.prefixCharacters)+Pp(t,e).map($p(e?.locale)).join(e?.delimiter??" ")}function Dp(t,e){return Np(t,{delimiter:"-",...e})}function $p(t){return t===!1?e=>e.toLowerCase():e=>e.toLocaleLowerCase(t)}function zp(t,e=Mp){let r="";for(let n=0;n<t.length;n++){const a=t.charAt(n);if(e.includes(a))r+=a;else break}return r}const ya=Dp,Fp=640,jp=1024;let wa=null;const Bp=()=>{if(wa)return wa;if(!globalThis.document)return 16;const t=globalThis.document.querySelector(":root");return wa=Number(getComputedStyle(t).fontSize.slice(0,-2)),wa},Up=({minRem:t,maxRem:e})=>{const r=Bp(),n=Fp/r,a=jp/r,i=(e-t)/(a-n),o=-n*i+t;return`clamp( ${t}rem, ${o}rem + ${i*100}cqw, ${e}rem )`},dc=t=>typeof t=="string"?t:typeof t=="number"?String(t):typeof t=="object"?t.minRem===t.maxRem?`${t.minRem}rem`:Up(t):"",Qi=(t,e,r,n=!1)=>{let a="";return r.forEach(i=>{let o=e[i];n&&!o&&i==="borderWidth"&&(o="0px"),n&&!o&&i==="borderColor"&&(o="transparent"),o&&(a+=`--${ya(t)}-${ya(i)}:${dc(o)}; `)}),a},hc=(t,e)=>Object.entries(e).map(([r,n])=>`--${t}-${ya(r)}:${dc(n)}`).join("; ")+"; ",qp=(t,e)=>{let r="";return r+=Qi(t,e,["background","borderWidth","borderColor","boxShadow","borderRadius","color"],!0),e.hover&&(r+=Qi(`${t}-hover`,e.hover,["background","borderWidth","borderColor","boxShadow","color"])),e.focus&&(r+=Qi(`${t}-focus`,e.focus,["background","borderWidth","borderColor","boxShadow","color"])),e.custom&&(r+=hc(t,e.custom)),r},Vp=(t,e)=>Object.entries(e).map(([r,n])=>`--color-${t}-${r}:${n}`).join("; ")+"; ",Hp=t=>`--font-family: ${t?.family||"inherit"};`,Zp=t=>{const e=Hp(t.font),r=Object.entries(t.colors).map(([i,o])=>Vp(i,o)).join(""),n=hc("base",t.base),a=Object.entries(t.components).map(([i,o])=>qp(ya(i),o)).join("");return`.chat-app {${e} ${r} ${n} ${a}};`};var ut=typeof window<"u"?window:{screen:{},navigator:{}},Kr=(ut.matchMedia||function(){return{matches:!1}}).bind(ut),Gp={get passive(){return!0}},fc=function(){};ut.addEventListener&&ut.addEventListener("p",fc,Gp),ut.removeEventListener&&ut.removeEventListener("p",fc,!1);var Yi="ontouchstart"in ut,Wp="TouchEvent"in ut,Qp=Yi||Wp&&Kr("(any-pointer: coarse)").matches,pc=(ut.navigator.maxTouchPoints||0)>0||Qp,gc=ut.navigator.userAgent||"",Yp=Kr("(pointer: coarse)").matches&&/iPad|Macintosh/.test(gc)&&Math.min(ut.screen.width||0,ut.screen.height||0)>=768,mc=(Kr("(pointer: coarse)").matches||!Kr("(pointer: fine)").matches&&Yi)&&!/Windows.*Firefox/.test(gc),Kp=Kr("(any-pointer: fine)").matches||Kr("(any-hover: hover)").matches||Yp||!Yi,vc=pc&&(Kp||!mc)?"hybrid":pc?"touchOnly":"mouseOnly",Xp=vc==="mouseOnly"?"mouse":vc==="touchOnly"||mc?"touch":"mouse";function bc(t,e){Pr(e,!0);let r=oe(e,"href",7),n=oe(e,"target",7),a=oe(e,"onclick",7),i=oe(e,"className",23,()=>[]),o=oe(e,"isStandalone",7,!1),s=oe(e,"children",7),c=oe(e,"type",7,"button"),l=oe(e,"use",7),u=oe(e,"class",7),p=oi(e,["$$slots","$$events","$$legacy","$$host","href","target","onclick","className","isStandalone","children","type","use","class"]);const h=X(()=>r()?"a":"button"),v=X(()=>[...Array.isArray(i())?i():i()?[i()]:[],...u()?[u()]:[]]),m=()=>({}),b=X(()=>l()??m);var C=gt(),y=Le(C);return gs(y,()=>_(h),!1,(k,w)=>{ms(k,U=>_(b)?.(U)),xs(k,U=>({...p,onclick:r()?void 0:a(),type:r()?void 0:c(),href:r(),role:r()?"link":"button",target:r()?n():void 0,class:_(v),[Br]:U}),[()=>({"open-button--standalone":o()})]);var T=gt(),R=Le(T);hs(R,s),ie(w,T)}),ie(t,C),Nr({get href(){return r()},set href(k){r(k),ee()},get target(){return n()},set target(k){n(k),ee()},get onclick(){return a()},set onclick(k){a(k),ee()},get className(){return i()},set className(k=[]){i(k),ee()},get isStandalone(){return o()},set isStandalone(k=!1){o(k),ee()},get children(){return s()},set children(k){s(k),ee()},get type(){return c()},set type(k="button"){c(k),ee()},get use(){return l()},set use(k){l(k),ee()},get class(){return u()},set class(k){u(k),ee()}})}pn(bc,{href:{},target:{},onclick:{},className:{},isStandalone:{},children:{},type:{},use:{},class:{}},[],[],!0);function Rn(t,e){Pr(e,!0);let r=oe(e,"css",7),n=oi(e,["$$slots","$$events","$$legacy","$$host","css"]);const a=c=>{Uo(()=>{r()&&(c.innerHTML=r())})};var i=gt(),o=Le(i);{var s=c=>{var l=gt(),u=Le(l);gs(u,()=>"style",!1,(p,h)=>{ms(p,v=>a?.(v)),xs(p,()=>({...n}))}),ie(c,l)};ir(o,c=>{r()&&c(s)})}return ie(t,i),Nr({get css(){return r()},set css(c){r(c),ee()}})}pn(Rn,{css:{}},[],[],!0);var Jp=Tt('<div class="open-button__title"><!></div>'),e0=Tt('<div class="open-button__mask"><div class="open-button__description"><!></div></div>'),t0=Tt('<div class="open-button__text"><!> <!></div>'),r0=Tt('<div class="sr-only"> </div>'),n0=Tt('<!> <div class="svg svg--avatar open-button__avatar" aria-hidden="true"><!></div>',1),a0=Tt('<link rel="stylesheet"/>'),i0=Tt("<!> <!>",1),o0=Tt('<!> <!> <!> <main class="chat-app"><!></main>',1);function kc(t,e){Pr(e,!0);const r=(F,$)=>{let G=()=>$?.().chatConfig,je=()=>$?.().language,be=()=>$?.().colorScheme;const se=X(()=>{const{openButtonTitle:we,openButtonDescription:ae}=G().translations[je()];return{openButtonTitle:we,openButtonDescription:ae}}),Be=X(()=>G().fullTheme[be()].tokens.svgs),ke=X(()=>G().fullTheme[be()]?.tokens.components.openButton?.custom),ye=X(()=>!!_(ke)?.hideTitleWhenCollapsed);{let we=X(()=>G().buttonHref?void 0:s()?"true":"false"),ae=X(()=>G().buttonHref?void 0:"true"),Je=X(()=>G().buttonHref?void 0:o()),Ue=X(()=>["open-button",e.buttonClass,g.data.flyoutIsOpen?"open-button--expanded":void 0,_(ye)?"open-button--hide-title-when-collapsed":void 0]);bc(F,{get href(){return G().buttonHref},onclick:xa,onmouseenter:_a,onmouseleave:Ji,use:Qt,get"aria-expanded"(){return _(we)},get"aria-haspopup"(){return _(ae)},get"aria-controls"(){return _(Je)},get style(){return e.buttonStyle},get className(){return _(Ue)},get isStandalone(){return _(h)},children:(dt,Yt)=>{var It=n0(),Ln=Le(It);{var Sa=et=>{var Ve=t0(),Lr=jt(Ve);{var Ta=Lt=>{var tt=Jp(),Ot=jt(tt);ti(Ot,()=>_(se).openButtonTitle),$t(tt),ie(Lt,tt)};ir(Lr,Lt=>{_(se).openButtonTitle&&Lt(Ta)})}var Ea=nr(Lr,2);{var On=Lt=>{var tt=e0(),Ot=jt(tt),yt=jt(Ot);ti(yt,()=>_(se).openButtonDescription),$t(Ot),As(Ot,Mt=>P(k,Mt),()=>_(k)),$t(tt),As(tt,Mt=>P(y,Mt),()=>_(y)),ie(Lt,tt)};ir(Ea,Lt=>{_(se).openButtonDescription&&Xp==="mouse"&&Lt(On)})}$t(Ve),ie(et,Ve)},eo=et=>{var Ve=r0(),Lr=jt(Ve,!0);$t(Ve),Zn(()=>cs(Lr,g.t.ariaOpenChat)),ie(et,Ve)};ir(Ln,et=>{_(se).openButtonTitle||_(se).openButtonDescription?et(Sa):et(eo,!1)})}var Jr=nr(Ln,2),Ir=jt(Jr);ti(Ir,()=>_(Be).avatar),$t(Jr),ie(dt,It)},$$slots:{default:!0}})}};let n=J("light"),a=oe(e,"host",7),i=oe(e,"onError",7),o=oe(e,"flyoutId",7),s=oe(e,"flyoutIsOpen",7),c=oi(e,["$$slots","$$events","$$legacy","$$host","host","onError","flyoutId","flyoutIsOpen"]);const l=async F=>{const G=await(await fetch(`${F}/chatconfig`)).json();return Fl.parse(G)},u=async({forceTheme:F,lang:$,apiUrl:G})=>{const je=window.CHAT_CONFIG_OVERRIDE?window.CHAT_CONFIG_OVERRIDE:await l(G),be=Zl(je);let se;$?se=ba($,be.supportedLanguages):se=Jl(be.supportedLanguages);const Be=Object.keys(be.fullTheme),ke=Zi(Be);return{chatConfig:be,language:se,colorScheme:ke}},p=(F,$)=>{if(F==null)return $;if(typeof F=="string"){const G=F.trim().toLowerCase();return!(G===""||G==="0"||G==="false"||G==="no")}return typeof F=="number"?F!==0:typeof F=="boolean"?F:$};let h=X(()=>!!a()),v=J(!1),m=J(!1),b=J(!1),C=J(void 0),y=J(void 0),k=J(void 0),w=X(()=>_(k)?.offsetWidth??0),T=X(()=>_(k)?.offsetHeight??0),R=J(void 0),U=J(!1),Q,Fe=J(!0);function le(){return _(R)?(clearTimeout(_(R)),P(R,void 0),!0):!1}async function ur(F){P(n,F.colorScheme,!0),Q?.(),le(),P(U,!1);const $=F.chatConfig.fullTheme[_(n)]?.tokens.components.openButton?.custom??{},G=$.autoExpandScrollThreshold,je=Number($.autoCollapseDelay??0),be=Number.isNaN(je)?0:Math.max(0,je),se=p($.autoExpandOnce,!1),Be=(()=>{if(G==null)return 100;if(typeof G=="string"){if(G.trim().toLowerCase()==="none")return 0;const Ue=Number(G);return Number.isNaN(Ue)?100:Ue}const ae=Number(G);return Number.isNaN(ae)?100:ae})();if(Number.isNaN(Be)||Be<0)return;const ke=`liipgpt-auto-expand-${e.apiUrl}`;let ye=!1;if(typeof window<"u")try{ye=window.localStorage.getItem(ke)==="true"}catch(ae){console.warn("LiipGPT: unable to read auto-expand flag",ae)}P(b,ye,!0);const we=()=>{if(!(window.scrollY/window.innerHeight*100>=Be)){P(Fe,!0);return}if(!(_(m)||s())&&!(se&&(ye||_(b)))&&_(Fe)){if(P(Fe,!1),P(m,!0),P(b,!0),Ki(),se&&typeof window<"u")try{window.localStorage.setItem(ke,"true")}catch(Ue){console.warn("LiipGPT: unable to persist auto-expand flag",Ue)}P(R,setTimeout(()=>{_(U)||(Xi(),P(m,!1)),P(R,void 0)},be),!0)}};window.addEventListener("scroll",we,{passive:!0}),Be===0&&(await ns(),we()),Q=()=>{window.removeEventListener("scroll",we)}}function ne(){le(),P(m,!1),P(U,!1)}function Qt(F){P(C,F,!0)}function dr(){Q?.(),le()}td(dr);function hr(){!_(k)||!_(y)||(_(y).style.width=`${_(w)}px`,_(y).style.height=`${_(T)}px`)}function Xr(){_(y)&&(_(y).style.width="0",_(y).style.height="0")}function Ki(){_(C)&&(_(C).classList.add("open-button--programmatic-expand"),hr())}function Xi(){_(C)&&(_(C).classList.remove("open-button--programmatic-expand"),Xr())}function _a(){le()&&P(U,!0),hr()}function Ji(){le(),_(U)&&(P(m,!1),P(U,!1),_(C)?.classList.remove("open-button--programmatic-expand")),_(v)||Xr()}function xa(F){ne(),e.onclick?.(F)}let ce=X(()=>u(c).then(async F=>(await ur(F),F)).catch(F=>i()(F)));var In=gt();ju("beforeunload",Ha,dr),Uu(F=>{var $=gt(),G=Le($);{var je=be=>{var se=gt(),Be=Le(se);fs(Be,()=>_(ce),null,(ke,ye)=>{var we=i0();const ae=X(()=>_(ye).chatConfig.fullTheme[_(ye).colorScheme]);var Je=Le(we);ad(Je,17,()=>_(ae).fontURLs??[],rd,(dt,Yt)=>{var It=a0();Zn(()=>ii(It,"href",_(Yt))),ie(dt,It)});var Ue=nr(Je,2);Rn(Ue,{id:"font-css",get css(){return _(ae).fontCSS}}),ie(ke,we)}),ie(be,se)};ir(G,be=>{_(h)&&be(je)})}ie(F,$)});var fe=Le(In);return fs(fe,()=>_(ce),F=>{},(F,$)=>{var G=gt();const je=X(()=>_($).chatConfig.fullTheme[_(n)]);var be=Le(G);{var se=ke=>{var ye=o0(),we=Le(ye);{let Yt=X(()=>Zp(_(je).tokens));Rn(we,{id:"theme-css",get css(){return _(Yt)}})}var ae=nr(we,2);Rn(ae,{id:"app-css",get css(){return Cp}});var Je=nr(ae,2);Rn(Je,{id:"custom-css",get css(){return _(je).customCSS}});var Ue=nr(Je,2),dt=jt(Ue);r(dt,()=>_($)),$t(Ue),ie(ke,ye)},Be=ke=>{r(ke,()=>_($))};ir(be,ke=>{_(h)?ke(se):ke(Be,!1)})}ie(F,G)}),ie(t,In),Nr({get host(){return a()},set host(F){a(F),ee()},get onError(){return i()},set onError(F){i(F),ee()},get flyoutId(){return o()},set flyoutId(F){o(F),ee()},get flyoutIsOpen(){return s()},set flyoutIsOpen(F){s(F),ee()}})}pn(kc,{host:{},onError:{},flyoutId:{},flyoutIsOpen:{}},[],[],!0);function yc(t,e){Pr(e,!0);let r=oe(e,"onclick",7),n=oe(e,"buttonClass",7),a=oe(e,"buttonStyle",7),i=oe(e,"apiUrl",7),o=oe(e,"forceTheme",7),s=oe(e,"lang",7),c=X(()=>({onclick:r(),buttonClass:n(),buttonStyle:a(),apiUrl:i(),forceTheme:o(),lang:s()}));return Is(t,{silent:!0,body:(u,p=pr)=>{kc(u,wd({host:e.$$host,get onError(){return p()}},()=>_(c)))},$$slots:{body:!0}}),Nr({get onclick(){return r()},set onclick(l){r(l),ee()},get buttonClass(){return n()},set buttonClass(l){n(l),ee()},get buttonStyle(){return a()},set buttonStyle(l){a(l),ee()},get apiUrl(){return i()},set apiUrl(l){i(l),ee()},get forceTheme(){return o()},set forceTheme(l){o(l),ee()},get lang(){return s()},set lang(l){s(l),ee()}})}return customElements.define("liipgpt-button",pn(yc,{forceTheme:{attribute:"force-theme",type:"String"},buttonClass:{attribute:"button-class",type:"String"},buttonStyle:{attribute:"button-style",type:"String"},apiUrl:{attribute:"api-url",type:"String"},lang:{attribute:"lang",type:"String"},onclick:{}},[],[],!0)),rn.LiipGPTButton=yc,Object.defineProperty(rn,Symbol.toStringTag,{value:"Module"}),rn}({});
|
|
389
|
+
`,ariaMainNavigation:"Navigation principale",ariaMainNavigationRegion:"Navigation principale: liens, changement de langue, mode couleur",ariaGotoMainNavigation:"Aller à la navigation principale",ariaAskQuestion:"Saisie texte",ariaAskQuestionRegion:"Poser une question",ariaNotifications:"Notifications",ariaPredefinedQuestions:"Questions prédéfinies",ariaPredefinedQuestionsRegion:"Essayez nos questions d'exemple",ariaChatHistory:"Historique du chat",ariaOpenChat:"Ouvrir le chat",ariaQuestionFromYou:"Votre question:",ariaAnswerFromBot:"Réponse de l'Assistant:",ariaLastAnswerNavigation:"Navigation et options pour la dernière réponse",ariaQuestionSent:"Question envoyée. Génération de la réponse en cours...",ariaAnswerReady:"Réponse prête.",ariaAnswerFinished:"Réponse terminée. Posez une autre question ou naviguez en arrière pour consulter l'historique du chat, donner un avis ou voir les références liées à la réponse.",ariaAskQuestionAgain:"Copier la dernière question dans le champ de saisie pour la reposer",ariaAnswerGood:"Évaluer cette réponse comme bonne",ariaAnswerBad:"Évaluer cette réponse comme mauvaise",ariaReferenceSource:"Source:",ariaGiveFeedback:"Donner un feedback détaillé sur la réponse",ariaLanguageChanged:"Langue française sélectionnée.",ariaLightSelected:"Mode clair activé.",ariaDarkSelected:"Mode sombre activé.",ariaSettings:"Paramètres du chat",ariaSettingsRegion:"Ajustez vos préférences de chat",ariaReferencesRegion:"Références pour la question actuelle",ariaFlyoutRegion:"Chatbot",ariaSelected:"sélectionné",ariaUnselected:"non sélectionné",ariaAllSelected:"Tous les éléments sélectionnés",ariaAllUnselected:"Tous les éléments non sélectionnés",ariaAllReseted:"Éléments par défaut sélectionnés",hideSettings:"Masquer les paramètres",showSettings:"Paramètres",chooseAtLeastOneOption:"Veuillez choisir au moins une option",selectAll:"Tout sélectionner",selectNone:"Tout désélectionner",resetToDefaults:"Réinitialiser",messageTooLong:"Votre message doit être plus court que {questionLengthLimit} caractères. Actuellement, il fait {questionLength} caractères"}},Xf=Object.freeze(Object.defineProperty({__proto__:null,translations:Rr},Symbol.toStringTag,{value:"Module"})),Jf=t=>{t=t??Rr;const e={};return t.de&&(e.de=An(Rr.de,t.de)),t.en&&(e.en=An(Rr.en,t.en)),t.fr&&(e.fr=An(Rr.fr,t.fr)),t.it&&(e.it=An(Rr.it,t.it)),e},Zl=t=>{let e;t.theme?.fineGrained?e=Kf(t.theme?.fineGrained):e=Yf(t?.theme??{});const r=Jf(t?.translations),n={...t,showPredefinedQuestions:t.showPredefinedQuestions??!0,showOverallFeedbackButton:t.showOverallFeedbackButton??!1,showOverallFeedbackEmail:t.showOverallFeedbackEmail??!0,showCloseChatButton:t.showCloseChatButton??!1,showContextInfo:t.showContextInfo??!1,showContextMenu:t.showContextMenu??!1,showReferencesByDefault:t.showReferencesByDefault??!1,showTextFeedback:t.showTextFeedback??!0,showExpandedSelectors:t.showExpandedSelectors??!1,inlineLayout:t.inlineLayout??!1,questionPrefix:t.questionPrefix??"",blockPII:t.blockPII??!1,allowAudioInput:t.allowAudioInput??!1,supportedLanguages:t.supportedLanguages??Object.keys(r),fullTheme:e,translations:r,buttonHref:t.buttonHref,addQueryToUrlParams:t.addQueryToUrlParams??!0,addRetrievalQuestionToUrlParams:t.addRetrievalQuestionToUrlParams??!1,renderKatex:t.renderKatex??!1,sendReferrer:t.sendReferrer??"all",selectorsConfig:t.selectorsConfig??[],questionLengthLimit:t.questionLengthLimit??qf,forceConsent:t.forceConsent??!1,askQuestionAgain:t.askQuestionAgain??!1,enableBackdrop:t.enableBackdrop??!1};return t.classification&&(n.classification=t.classification),t.menu&&(n.menu=t.menu),n},Gl={de:{aborted:"Verbindung zum Server wurde unerwartet unterbrochen. Bitte versuchen Sie es erneut.","client-error":"Ein unbekannter Fehler ist aufgetreten. Bitte versuchen Sie es erneut.","server-error":"Ein unbekannter Fehler ist aufgetreten. Bitte versuchen Sie es erneut.","sse-error":"Ein unbekannter Fehler ist aufgetreten. Bitte versuchen Sie es erneut.",blocked:"Ihre Anfrage wurde blockiert.","pii-detected":"Es wurden persönliche Daten erkannt. Bitte entfernen Sie diese und versuchen Sie es erneut.","incomplete-error":"Ein unbekannter Fehler ist aufgetreten. Die Antwort könnte unvollständig sein.","unexpected-call":"Ein unbekannter Fehler ist aufgetreten. Die Antwort könnte unvollständig sein.","quota-reached":"Kontingent überschritten. Bitte versuchen Sie es später erneut.","rate-limit":"Kontingent überschritten. Bitte versuchen Sie es später erneut.",maintenance:"Der Chat ist derzeit nicht verfügbar. Bitte versuchen Sie es später erneut.","too-long":"Ihre Frage war zu lang, versuchen Sie es mit einer Kürzeren.","too-short":"Ihre Frage war zu kurz, versuchen Sie es mit einer Längeren.","feedback-failed":"Feedback senden fehlgeschlagen. Bitte versuchen Sie es erneut.","speech-not-supported":"Spracherkennung wird nicht unterstützt.","speech-transcription-failed":"Sprachtranskription fehlgeschlagen.","speech-no-text-detected":"Kein Text in der Spracheingabe erkannt.","speech-microphone-access-denied":"Mikrofonzugriff verweigert."},en:{aborted:"Connection to the server was unexpectedly interrupted. Please try again.","client-error":"An unknown error has occurred. Please try again.","server-error":"An unknown error has occurred. Please try again.","sse-error":"An unknown error has occurred. Please try again.",blocked:"Your request has been blocked.","pii-detected":"Personal data has been detected. Please remove it and try again.","incomplete-error":"An unknown error has occurred. The response might be incomplete.","unexpected-call":"An unknown error has occurred. The response might be incomplete.","quota-reached":"Quota exceeded. Please try again later.","rate-limit":"Quota exceeded. Please try again later.",maintenance:"The chat is currently unavailable. Please try again later.","too-long":"Your question was too long, try a shorter one.","too-short":"Your question was too short, try a longer one.","feedback-failed":"Failed to send feedback. Please try again.","speech-not-supported":"Speech recognition is not supported.","speech-transcription-failed":"Speech transcription failed.","speech-no-text-detected":"No text detected in speech input.","speech-microphone-access-denied":"Microphone access denied."},it:{aborted:"La connessione al server è stata interrotta inaspettatamente. Si prega di riprovare.","client-error":"Si è verificato un errore sconosciuto. Si prega di riprovare.","server-error":"Si è verificato un errore sconosciuto. Si prega di riprovare.","sse-error":"Si è verificato un errore sconosciuto. Si prega di riprovare.",blocked:"La tua richiesta è stata bloccata.","pii-detected":"Sono stati rilevati dati personali. Si prega di rimuoverli e riprovare.","incomplete-error":"Si è verificato un errore sconosciuto. La risposta potrebbe essere incompleta.","unexpected-call":"Si è verificato un errore sconosciuto. La risposta potrebbe essere incompleta.","quota-reached":"Quota superata. Si prega di riprovare più tardi.","rate-limit":"Quota superata. Si prega di riprovare più tardi.",maintenance:"La chat non è attualmente disponibile. Si prega di riprovare più tardi.","too-long":"La tua domanda era troppo lunga, prova con una più breve.","too-short":"La tua domanda era troppo breve, prova con una più lunga.","feedback-failed":"Invio del feedback non riuscito. Si prega di riprovare.","speech-not-supported":"Il riconoscimento vocale non è supportato.","speech-transcription-failed":"Trascrizione vocale fallita.","speech-no-text-detected":"Nessun testo rilevato nell'input vocale.","speech-microphone-access-denied":"Accesso al microfono negato."},fr:{aborted:"La connexion au serveur a été interrompue de façon inattendue. Veuillez réessayer.","client-error":"Une erreur inconnue s'est produite. Veuillez réessayer.","server-error":"Une erreur inconnue s'est produite. Veuillez réessayer.","sse-error":"Une erreur inconnue s'est produite. Veuillez réessayer.","pii-detected":"Des données personnelles ont été détectées. Veuillez les supprimer et réessayer.",blocked:"Votre demande a été bloquée.","incomplete-error":"Une erreur inconnue s'est produite. La réponse pourrait être incomplète.","unexpected-call":"Une erreur inconnue s'est produite. La réponse pourrait être incomplète.","quota-reached":"Quota dépassé. Veuillez réessayer plus tard.","rate-limit":"Quota dépassé. Veuillez réessayer plus tard.",maintenance:"Le chat est actuellement indisponible. Veuillez réessayer plus tard.","too-long":"Votre question était trop longue, essayez d'en poser une plus courte.","too-short":"Votre question était trop courte, essayez d'en poser une plus longue.","feedback-failed":"Échec de l'envoi du feedback. Veuillez réessayer.","speech-not-supported":"La reconnaissance vocale n'est pas prise en charge.","speech-transcription-failed":"Échec de la transcription vocale.","speech-no-text-detected":"Aucun texte détecté dans l'entrée vocale.","speech-microphone-access-denied":"Accès au microphone refusé."}},Wl={de:{email:"Bitte keine E-Mail Adressen eingeben",creditCard:"Bitte keine Kreditkarteninformationen eingeben",ahv:"Bitte keine AHV-Nummern eingeben",phoneSwiss:"Bitte keine Telefonnummern eingeben",phoneInternational:"Bitte keine Telefonnummern eingeben",swissPassport:"Bitte keine Passinformationen eingeben",longNumber:"Bitte keine langen Nummern eingeben"},en:{email:"Please do not enter email addresses",creditCard:"Please do not enter credit card information",ahv:"Please do not enter AHV numbers",phoneSwiss:"Please do not enter phone numbers",phoneInternational:"Please do not enter phone numbers",swissPassport:"Please do not enter passport information",longNumber:"Please do not enter long numbers"},it:{email:"Si prega di non inserire indirizzi email",creditCard:"Si prega di non inserire informazioni sulla carta di credito",ahv:"Si prega di non inserire numeri AVS",phoneSwiss:"Si prega di non inserire numeri di telefono",phoneInternational:"Si prega di non inserire numeri di telefono",swissPassport:"Si prega di non inserire informazioni sul passaporto",longNumber:"Si prega di non inserire numeri lunghi"},fr:{email:"Veuillez ne pas saisir d'adresses e-mail",creditCard:"Veuillez ne pas saisir d'informations de carte de crédit",ahv:"Veuillez ne pas saisir de numéros AVS",phoneSwiss:"Veuillez ne pas saisir de numéros de téléphone",phoneInternational:"Veuillez ne pas saisir de numéros de téléphone",swissPassport:"Veuillez ne pas saisir d'informations de passeport",longNumber:"Veuillez ne pas saisir de longs numéros"}},Bi=structuredClone(cr.fineGrained.light);Bi.tokens.colors={brand:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#037ABA",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},highlight:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},grey:{0:"#ffffff",50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#2d3748",900:"#1a202c",950:"#171923",1e3:"#000000"}};const Ql=structuredClone(cr.fineGrained.dark);Ql.tokens.colors=Bi.tokens.colors;const ep=Object.freeze(Object.defineProperty({__proto__:null,theme:{fineGrained:{light:Bi,dark:Ql}}},Symbol.toStringTag,{value:"Module"})),Yl=t=>t.split("/").pop().split(".")[0],tp=Object.assign({"./default/fallback-dev.theme.ts":ep,"./default/fallback.theme.ts":Wf}),ji=new Map;Object.entries(tp).forEach(([t,e])=>{const{error:r,data:n}=Ol.safeParse(e?.theme);if(r){console.error(`Invalid theme in ${t}:`,r);return}ji.set(Yl(t),n)});const w0=t=>{const e=ji.get(t);return e||(console.error(`Theme ${t} not found`),cr)};Array.from(ji.keys());const rp=Object.assign({"./default/fallback.translations.ts":Xf}),Ui=new Map;Object.entries(rp).forEach(([t,e])=>{const{error:r,data:n}=Nl.safeParse(e?.translations);if(r){console.error(`Invalid translations in ${t}:`,r);return}Ui.set(Yl(t),n)});const _0=t=>{const e=Ui.get(t);return e||(console.error(`Theme ${t} not found`),Rr)};Array.from(Ui.keys());const np="en",Kl=(t,e)=>e.includes(t),ba=(t,e)=>{if(Kl(t,e))return t;const r=ap();return Kl(r,e)?r:np},ap=()=>navigator.language.split("-")[0],Xl=(t,e)=>{localStorage.setItem("liipgpt:selectedLanguage",t),e&&(e.lang=t)},Jl=t=>ba(localStorage.getItem("liipgpt:selectedLanguage"),t);var qi,ec;function ip(){return ec||(ec=1,qi=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,a,i;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(a=n;a--!==0;)if(!t(e[a],r[a]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(r).length)return!1;for(a=n;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[a]))return!1;for(a=n;a--!==0;){var o=i[a];if(!t(e[o],r[o]))return!1}return!0}return e!==e&&r!==r}),qi}var op=ip();const sp=ql(op),lp=typeof document<"u";let tc=0;class cp{#e=J(_t([]));get toasts(){return _(this.#e)}set toasts(e){P(this.#e,e,!0)}#t=J(_t([]));get heights(){return _(this.#t)}set heights(e){P(this.#t,e,!0)}#a=e=>{const r=this.toasts.findIndex(n=>n.id===e);return r===-1?null:r};addToast=e=>{lp&&this.toasts.unshift(e)};updateToast=({id:e,data:r,type:n,message:a})=>{const i=this.toasts.findIndex(s=>s.id===e),o=this.toasts[i];this.toasts[i]={...o,...r,id:e,title:a,type:n,updated:!0}};create=e=>{const{message:r,...n}=e,a=typeof e?.id=="number"||e.id&&e.id?.length>0?e.id:tc++,i=e.dismissable===void 0?!0:e.dismissable,o=e.type===void 0?"default":e.type;return pt(()=>{this.toasts.find(c=>c.id===a)?this.updateToast({id:a,data:e,type:o,message:r,dismissable:i}):this.addToast({...n,id:a,title:r,dismissable:i,type:o})}),a};dismiss=e=>(pt(()=>{if(e===void 0){this.toasts=this.toasts.map(n=>({...n,dismiss:!0}));return}const r=this.toasts.findIndex(n=>n.id===e);this.toasts[r]&&(this.toasts[r]={...this.toasts[r],dismiss:!0})}),e);remove=e=>{if(e===void 0){this.toasts=[];return}const r=this.#a(e);if(r!==null)return this.toasts.splice(r,1),e};message=(e,r)=>this.create({...r,type:"default",message:e});error=(e,r)=>this.create({...r,type:"error",message:e});success=(e,r)=>this.create({...r,type:"success",message:e});info=(e,r)=>this.create({...r,type:"info",message:e});warning=(e,r)=>this.create({...r,type:"warning",message:e});loading=(e,r)=>this.create({...r,type:"loading",message:e});promise=(e,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:e,type:"loading",message:typeof r.loading=="string"?r.loading:r.loading()}));const a=e instanceof Promise?e:e();let i=n!==void 0;return a.then(o=>{if(typeof o=="object"&&o&&"ok"in o&&typeof o.ok=="boolean"&&!o.ok){i=!1;const s=up(o);this.create({id:n,type:"error",message:s})}else if(r.success!==void 0){i=!1;const s=typeof r.success=="function"?r.success(o):r.success;this.create({id:n,type:"success",message:s})}}).catch(o=>{if(r.error!==void 0){i=!1;const s=typeof r.error=="function"?r.error(o):r.error;this.create({id:n,type:"error",message:s})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),r.finally?.()}),n};custom=(e,r)=>{const n=r?.id||tc++;return this.create({component:e,id:n,...r}),n};removeHeight=e=>{this.heights=this.heights.filter(r=>r.toastId!==e)};setHeight=e=>{const r=this.#a(e.toastId);if(r===null){this.heights.push(e);return}this.heights[r]=e};reset=()=>{this.toasts=[],this.heights=[]}}function up(t){return t&&typeof t=="object"&&"status"in t?`HTTP error! Status: ${t.status}`:`Error! ${t}`}const bt=new cp;function dp(t,e){return bt.create({message:t,...e})}const Vi=Object.assign(dp,{success:bt.success,info:bt.info,warning:bt.warning,error:bt.error,custom:bt.custom,message:bt.message,promise:bt.promise,dismiss:bt.dismiss,loading:bt.loading,getActiveToasts:()=>bt.toasts.filter(t=>!t.dismiss)}),hp=t=>{const e=new Set;Object.getOwnPropertyNames(t).forEach(n=>e.add(n));let r=Object.getPrototypeOf(t);for(;r&&r!==Object.prototype;)Object.getOwnPropertyNames(r).forEach(n=>e.add(n)),r=Object.getPrototypeOf(r);return Array.from(e)},fp=(t,e)=>{const r={};return e.forEach(n=>{r[n]=t[n]}),r},pp=console.warn,gp=()=>{},rc=(t,e)=>pt(()=>{console.warn=gp;const r=e?fp(t,e):t,n=hu(r);return console.warn=pp,n}),mp=t=>t&&typeof t.then=="function";class vp{config;self;devtools;stateKeys;constructor(e,r){this.config=e,this.self=r,typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__&&(this.stateKeys=hp(this.config.state),this.devtools=window.__REDUX_DEVTOOLS_EXTENSION__.connect({name:this.config.name??"updatelogic"}),this.devtools.init(this.createStateSnapshot()),this.devtools.subscribe(n=>{n.type==="DISPATCH"&&n.state}))}createStateSnapshot(){return rc(this.config.state,this.stateKeys)}sendStart(e,r){this.devtools.send({type:`→ ${e}`,args:r},this.createStateSnapshot())}sendError(e,r,n){this.devtools.send({type:`❌ ${e}`,args:r,error:n},this.createStateSnapshot())}sendSuccess(e,r,n){this.devtools.send({type:`✓ ${e}`,args:r,return:n},this.createStateSnapshot())}isIncluded(e){return this.config.excludeInDevTools?!this.config.excludeInDevTools.includes(e):!0}createProxyFunction(e,r){const n=this.devtools&&this.isIncluded(e);return typeof r=="function"?(...a)=>{if(!n)return pt(()=>r.call(this.self,...a));const i=rc(a);this.sendStart(e,i);try{const o=pt(()=>r.call(this.self,...a));return mp(o)?o.then(s=>(this.sendSuccess(e,i,s),s),s=>{throw this.sendError(e,i,s),s}):(this.sendSuccess(e,i,o),o)}catch(o){throw this.sendError(e,i,o),o}}:r}}const bp=(t,e)=>{const r={},n=new vp(t,r);return Object.keys(e).forEach(a=>{if(a==="state"||a==="name")return;const i=e[a];r[a]=n.createProxyFunction(a,i)}),r};async function kp(){if(typeof navigator>"u"||!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return!1;try{return(await navigator.mediaDevices.enumerateDevices()).some(e=>e.kind==="audioinput")}catch(t){return console.error("Error checking for microphone:",t),!1}}function Hi(){return typeof window>"u"||!window.MediaRecorder?null:MediaRecorder.isTypeSupported("audio/mp4")?"audio/mp4":MediaRecorder.isTypeSupported("audio/webm")?"audio/webm":MediaRecorder.isTypeSupported("audio/wav")?"audio/wav":null}function nc(){return typeof window>"u"?!1:!!(window.MediaRecorder&&Hi())}class ac{mediaRecorder=null;audioChunks=[];started=!1;starting=!1;stream=null;options;audioContext=null;analyser=null;dataArray=null;volumeUpdateInterval=null;constructor(e={}){this.options=e}async start(){if(this.started||this.starting){console.warn("AudioRecorder: Start already in progress or already started");return}if(!nc()||!navigator.mediaDevices){const e=new Error("MediaRecorder not supported or no microphone access");throw this.options.onError?.(e),e}try{if(this.starting=!0,this.stream=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},video:!1}),!this.starting){this.stopStream(this.stream);return}this.mediaRecorder&&this.mediaRecorder.state!=="inactive"&&(console.warn("AudioRecorder: MediaRecorder already active, stopping previous recording"),this.mediaRecorder.stop(),this.cleanup()),this.started=!0,this.starting=!1;const e=Hi();if(!e)throw new Error("No supported media type found");const r={mimeType:e};this.mediaRecorder=new MediaRecorder(this.stream,r),this.audioChunks=[],this.mediaRecorder.ondataavailable=n=>{n.data.size>0&&this.audioChunks.push(n.data)},this.mediaRecorder.onstop=async()=>{const n=this.audioChunks.length>0?new Blob(this.audioChunks,{type:e}):null;await this.options.onDataAvailable?.(n),this.options.onStop?.(),this.cleanup()},this.mediaRecorder.onerror=n=>{const a=new Error(`MediaRecorder error: ${n}`);this.options.onError?.(a),this.cleanup()},this.mediaRecorder.start(),this.setupVolumeAnalysis(this.stream),this.options.onStart?.()}catch(e){this.started=!1,this.starting=!1;const r=e instanceof Error?e:new Error(String(e));throw this.options.onError?.(r),r}}stop(){this.started=!1,this.starting=!1,this.volumeUpdateInterval&&(clearInterval(this.volumeUpdateInterval),this.volumeUpdateInterval=null),this.mediaRecorder&&this.mediaRecorder.state!=="inactive"?this.mediaRecorder.stop():(this.stream&&this.stopStream(this.stream),this.cleanup())}setupVolumeAnalysis(e){if(this.options.onVolumeChange)try{this.audioContext=new AudioContext,this.analyser=this.audioContext.createAnalyser(),this.analyser.fftSize=256,this.analyser.smoothingTimeConstant=.8;const r=this.analyser.frequencyBinCount;this.dataArray=new Uint8Array(r),this.audioContext.createMediaStreamSource(e).connect(this.analyser),this.startVolumeMonitoring()}catch(r){console.warn("Failed to set up volume analysis:",r)}}startVolumeMonitoring(){!this.analyser||!this.dataArray||!this.options.onVolumeChange||(this.volumeUpdateInterval=window.setInterval(()=>{if(!this.analyser||!this.dataArray||!this.started)return;this.analyser.getByteFrequencyData(this.dataArray);let e=0;for(let i=0;i<this.dataArray.length;i++)e+=this.dataArray[i]*this.dataArray[i];let n=Math.sqrt(e/this.dataArray.length)/255;n=Math.pow(n*3,.7);const a=Math.min(100,Math.max(0,Math.round(n*100)));this.options.onVolumeChange?.(a)},100))}get recording(){return this.started&&this.mediaRecorder?.state==="recording"}get isStarting(){return this.starting}stopStream(e){e.getTracks().forEach(r=>r.stop())}cleanup(){this.volumeUpdateInterval&&(clearInterval(this.volumeUpdateInterval),this.volumeUpdateInterval=null),this.audioContext&&(this.audioContext.close().catch(console.warn),this.audioContext=null),this.analyser=null,this.dataArray=null,this.stream&&(this.stopStream(this.stream),this.stream=null),this.mediaRecorder=null,this.audioChunks=[],this.started=!1,this.starting=!1}static isSupported(){return nc()}static getSupportedMediaType(){return Hi()}}const yp=t=>(localStorage.setItem("liipgpt-color-scheme",t),Zi(["light","dark"])),ic=()=>{const t=localStorage.getItem("liipgpt-color-scheme");return t==="light"||t==="dark"?t:"system"},Zi=t=>{let e=ic();return e==="system"&&(e=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),t.includes(e)?e:t[0]??"light"},wp=[{type:"email",check:t=>/\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}\b/.test(t)},{type:"creditCard",check:t=>/\b(?:\d[ -]*?){13,16}\b/.test(t)},{type:"ahv",check:t=>/\b756\.\d{4}\.\d{4}\.\d{2}\b/.test(t)},{type:"phoneSwiss",check:t=>/\b0(?:\s*\d){2}(?:\s*\/\s*)?(?:\s*\d){7,}\b/.test(t)},{type:"phoneInternational",check:t=>/(?:\+|00)(?:\s*\d){10,}\b/.test(t)},{type:"swissPassport",check:t=>/\b[A-HJ-NP-Z](?=.*\d)[A-HJ-NP-Z0-9]{7}\b/.test(t)},{type:"longNumber",check:t=>/\b\d{9,}\b/.test(t)}],oc=t=>{for(const e of wp)if(e.check(t))return e.type},Gi="liipgpt:selectorValues",Wi="liipgpt:selectorKnownDefaults",sc=()=>{try{const t=vt.getItem(Gi),e=vt.getItem(Wi);return t?{values:JSON.parse(t),knownDefaults:e?JSON.parse(e):{}}:null}catch{return null}},_p=t=>{const e={};for(const r of t)e[r.settingName]=r.defaultValues??(r.allowEmpty?[]:[r.values[0]]).filter(Boolean);return e},lc=(t,e)=>{try{const r=_p(e);vt.setItem(Gi,JSON.stringify(t)),vt.setItem(Wi,JSON.stringify(r))}catch(r){console.error("Failed to save selector values:",r)}},xp=t=>{try{const e=sc();if(!e)return;delete e.values[t],delete e.knownDefaults[t],vt.setItem(Gi,JSON.stringify(e.values)),vt.setItem(Wi,JSON.stringify(e.knownDefaults))}catch(e){console.error("Failed to clear selector saved state:",e)}},Sp=t=>{const e=sc(),r=t.map(n=>{const a=n.defaultValues??(n.allowEmpty?[]:[n.values[0]]).filter(Boolean);if(!e?.values[n.settingName])return[n.settingName,a];const i=e.values[n.settingName],o=e.knownDefaults[n.settingName]||[],s=i.filter(h=>n.values.includes(h)),c=o.filter(h=>!a.includes(h)),l=s.filter(h=>!c.includes(h)),u=a.filter(h=>!o.includes(h)&&!l.includes(h)),p=[...l,...u];return p.length===0&&!n.allowEmpty?[n.settingName,a]:[n.settingName,p]});return Object.fromEntries(r)};class Tp extends Error{constructor(e){super(e),this.name="UnreachableError"}}const cc=(t,e)=>{const n=new URLSearchParams(window.location.search).get("q");return n?{name:"chat-page",query:n}:t&&!e?{name:"consent-page"}:{name:"start-page"}};class Ep{#e=J(_t({}));get data(){return _(this.#e)}set data(e){P(this.#e,e,!0)}#t=J(_t({}));get targets(){return _(this.#t)}set targets(e){P(this.#t,e,!0)}#a=J(!1);get initialized(){return _(this.#a)}set initialized(e){P(this.#a,e,!0)}#l=J(0);get currentAudioVolume(){return _(this.#l)}set currentAudioVolume(e){P(this.#l,e,!0)}ariaLiveMessagesClearingTimeoutDuration=350;#u=J(null);get currentAudioRecorder(){return _(this.#u)}set currentAudioRecorder(e){P(this.#u,e,!0)}#i=J(!1);get isTranscribing(){return _(this.#i)}set isTranscribing(e){P(this.#i,e,!0)}#r=X(()=>{if(!this.initialized)return[];const e=this.data.chatConfig.menu;return e?e[this.data.language]??[]:[]});get menu(){return _(this.#r)}set menu(e){P(this.#r,e)}#o=X(()=>this.initialized?this.data.chatConfig.translations[this.data.language]??{}:{});get t(){return _(this.#o)}set t(e){P(this.#o,e)}#s=X(()=>this.initialized?Gl[this.data.language]??{}:Gl.en??{});get errorTranslations(){return _(this.#s)}set errorTranslations(e){P(this.#s,e)}#n=X(()=>this.initialized?Wl[this.data.language]??{}:Wl.en??{});get piiTranslations(){return _(this.#n)}set piiTranslations(e){P(this.#n,e)}#c=X(()=>this.initialized?this.data.currentColorScheme:"light");get colorScheme(){return _(this.#c)}set colorScheme(e){P(this.#c,e)}#d=X(()=>this.initialized?this.data.chatConfig.fullTheme[this.data.currentColorScheme]:{});get themeBase(){return _(this.#d)}set themeBase(e){P(this.#d,e)}#f=X(()=>this.themeBase.tokens);get theme(){return _(this.#f)}set theme(e){P(this.#f,e)}#h=X(()=>{if(!this.initialized)return[];const e=[];for(const r of this.data.chatConfig.selectorsConfig){if(r.allowEmpty)continue;(this.data.selectorValues[r.settingName]||[]).length===0&&e.push(r.settingName)}return e});get selectorsWithErrors(){return _(this.#h)}set selectorsWithErrors(e){P(this.#h,e)}}const g=new Ep;let ct,kt,uc;bp({name:"chat-logic",state:g,excludeInDevTools:["onInput"]},{async init(t){kt=t;const e=kt.speechRecognitionApiKey||void 0;ct=new Uf({apiUrl:kt.apiUrl,apiKey:kt.apiKey,speechRecognitionApiKey:e,strict:!0});try{const r=await ct.getChatConfig();window.CHAT_CONFIG_OVERRIDE&&Object.assign(r,window.CHAT_CONFIG_OVERRIDE);const a=(await ct.getMetadata()).mode==="maintenance";a&&this.showErrorToast("maintenance");const i=Zl(r);kt.inlineLayout!==void 0&&(i.inlineLayout=kt.inlineLayout);let o;kt.lang?o=ba(kt.lang,i.supportedLanguages):o=Jl(i.supportedLanguages),Xl(o,g.targets.mainElement);const s=await this.getPredefinedQuestions(o),c=[];if(i.renderKatex){const h=await import("https://esm.sh/marked-katex-extension@5.1.5").catch(v=>{console.error("Couldn't load marked-katex-extension:",v)});h&&(ct.setMarkedExtensions(h.default({nonStandard:!0,output:"mathml"})),c.push("https://cdn.jsdelivr.net/npm/katex@0.16.22/dist/katex.min.css"))}const l=Object.keys(i.fullTheme);let u=!1;if(i.forceConsent)try{u=vt.getItem("liipgpt:termsAccepted")==="true"}catch(h){console.warn("Failed to load terms acceptance from storage:",h)}g.data={currentConversationState:"idle",chatConfig:i,language:o,predefinedQuestions:s,isInMaintenance:a,history:[],selectedColorScheme:ic(),has2ColorSchemes:l.length===2,currentColorScheme:Zi(l),conversationFeedbackId:void 0,conversationFeedbackIsOpen:!1,openedPopup:void 0,props:kt,flyoutIsOpen:!1,questionHasPii:void 0,chatInputValue:"",selectorValues:Sp(i.selectorsConfig),selectorsIsOpen:!1,currentReferencesAsideId:void 0,ariaLiveStatusMessage:void 0,ariaLiveStatusMessageClearingTimeout:void 0,wasReferencesAsideClosed:!1,isAsideMobile:!0,route:cc(i.forceConsent??!1,u),additionalStylesheets:c,hasOpenedOverlays:!1,isInlineLayoutContained:!1,termsAccepted:u},window.LIIPGPT_LISTENERS?.route?.(g.data.route),window.LIIPGPT_LISTENERS?.conversation?.(g.data.currentConversationState),g.data.selectorsIsOpen=g.data.chatConfig.showExpandedSelectors??!1,g.initialized=!0,this.checkForOpenedPopup(),window.addEventListener("hashchange",()=>{this.checkForOpenedPopup()}),this.goto(cc(i.forceConsent??!1,u),!0)}catch(r){throw Vi.error(r instanceof Error?r.message:"Failed to load the chatbot. Please reload the page.",{duration:1e4,unstyled:!0,classes:{toast:"toast"}}),r}},setTarget(t,e){g.targets[t]=e},goto(t,e=!1){if(!(!e&&sp(g.data.route,t)))switch(g.data.route=t,window.LIIPGPT_LISTENERS?.route?.(t),t.name){case"consent-page":break;case"start-page":t.prefill&&(g.data.chatInputValue=t.prefill);break;case"chat-page":if(g.data.chatInputValue=t.query,this.onSubmit(),g.data.chatConfig.addQueryToUrlParams){const r=new URLSearchParams(window.location.search);r.set("q",t.query),history.pushState(null,"",`?${r.toString()}`)}break}},getSelectorConfig(t){const e=g.data.chatConfig.selectorsConfig.find(r=>r.settingName===t);if(!e)throw new Error(`Setting ${t} not found`);return e},getPrettifiedSelectorValues(){const t=Object.entries(g.data.selectorValues).map(([e,r])=>{let n;try{n=this.getSelectorConfig(e)}catch(a){console.error(`Error getting selector config for ${e}: ${a}`);return}return n.type==="single-select"?[e,r[0]]:[e,r]}).filter(e=>!!e);return Object.fromEntries(t)},setSelectorValue(t,e){const r=this.getSelectorConfig(t);if(!r){console.warn(`Trying to set setting ${t} but it is not defined in the chat config`);return}if(r.type==="single-select"&&e.length>1){console.warn(`Trying to set multiple values for single-select setting ${t}`);return}g.data.selectorValues[t]=e,lc(g.data.selectorValues,g.data.chatConfig.selectorsConfig)},resetSelectorToDefaults(t){const e=this.getSelectorConfig(t);if(!e){console.warn(`Trying to reset setting ${t} but it is not defined in the chat config`);return}const r=e.defaultValues??(e.allowEmpty?[]:[e.values[0]]).filter(Boolean);return xp(t),g.data.selectorValues[t]=r,lc(g.data.selectorValues,g.data.chatConfig.selectorsConfig),r},async getPredefinedQuestions(t){try{return ct.getPredefinedQuestions({url:window.location.origin+window.location.pathname,language:t})}catch(e){return console.warn("Failed to load predefined questions:",e),[]}},setColorScheme(t){g.data.selectedColorScheme=t,g.data.currentColorScheme=yp(t),this.setAriaLiveStatusMessage(t==="dark"?g.t.ariaDarkSelected:g.t.ariaLightSelected)},async abort(){await uc?.abort()},changeConversationState(t){g.data.currentConversationState=t,window.LIIPGPT_LISTENERS?.conversation?.(t)},onInput(t){g.data.chatConfig.blockPII&&(g.data.questionHasPii=oc(t)),g.data.chatInputValue=t},onSubmit(t=!1){if(g.data.questionHasPii){console.warn("Question contains PII, not submitting:",g.data.questionHasPii);return}const e=g.data.chatConfig.questionPrefix?`${g.data.chatConfig.questionPrefix} ${g.data.chatInputValue}`:g.data.chatInputValue,r=g.data.history.push({type:"user",time:new Date().toISOString(),message:g.data.chatInputValue});g.data.history.push({id:"UNRESOLVED",state:"loading",errors:[],type:"bot",time:new Date().toISOString(),message:{markdown:"",html:"",text:""},references:{all:[],used:[],unused:[]}});const n={features:kt.features?kt.features.trim().split(","):["formatting"],onError:u=>{this.showErrorToast(u),window.LIIPGPT_LISTENERS?.error?.(u),(u==="pii-detected"||u==="blocked")&&this.editLatestQuestion()},lang:g.data.language,selectorValues:this.getPrettifiedSelectorValues()},a=(u,p)=>{try{const h=new URL(u),v=new URL(p);return h.origin===v.origin&&h.pathname===v.pathname}catch{return!1}},i=g.data.chatConfig.sendReferrer??"all";if(["all","own","location"].includes(i)){const u=i==="location"||g.data.props.flyout;let p;u?p=`${window.location.protocol}//${window.location.host}${window.location.pathname}`:p=a(document.referrer,window.location.href)?null:document.referrer;const h=i==="own"&&!g.data.props.flyout&&p&&!p.startsWith(window.location.origin);n.referrer=p&&!h?p:void 0}g.data.currentConversationId||(g.data.currentConversationId=ct.createConversationId());const o=ct.chat(g.data.currentConversationId,e,n);uc=o,g.data.lastChatResponseId=o.id,g.data.currentConversationState!=="searching"&&this.changeConversationState("searching"),this.setAriaLiveStatusMessage(g.t.ariaQuestionSent);let s=!1,c;const l=!!g.data.currentReferencesAsideId;(t&&l||!t&&g.data.chatConfig.showReferencesByDefault)&&(g.data.isAsideMobile||this.openReferencesAside(o.id)),o.subscribe(u=>{if(g.data.history[r]&&(g.data.history[r]={question:g.data.chatInputValue,...u}),g.data.chatConfig.addRetrievalQuestionToUrlParams&&u.retrievalQuestion){const p=new URLSearchParams(window.location.search);p.get("search")!==u.retrievalQuestion&&(p.set("search",u.retrievalQuestion),history.replaceState(null,"",`?${p.toString()}`))}g.data.chatConfig.showReferencesByDefault&&!g.data.wasReferencesAsideClosed&&g.data.currentReferencesAsideId!==u.id&&!g.data.isAsideMobile&&this.openReferencesAside(u.id),u.state==="streaming"&&g.data.currentConversationState!=="answering"&&this.changeConversationState("answering"),u.state==="done"&&(this.changeConversationState("idle"),s||(s=!0,this.setAriaLiveStatusMessage(`${g.t.ariaAnswerReady} ... ${u.message.text} ... ${g.t.ariaAnswerFinished}`)),g.data.currentReferencesAsideId&&g.data.history[r].references.used.length>0?(clearTimeout(c),c=setTimeout(()=>{this.openReferencesAside(u.id)},100)):this.closeReferencesAside())}),g.data.chatInputValue=""},async onStartSpeechRecognition(){try{if(!await kp()){this.showErrorToast("speech-not-supported");return}if(await navigator.mediaDevices.getUserMedia({audio:!0}),ac.isSupported())g.data.chatInputValue="",g.currentAudioRecorder=new ac({onDataAvailable:async e=>{g.isTranscribing=!0,await this.handleTranscription(e)},onError:()=>{this.showErrorToast("speech-microphone-access-denied"),g.currentAudioRecorder=null,g.isTranscribing=!1},onVolumeChange:e=>{g.currentAudioVolume=e}}),g.currentAudioRecorder.start();else{this.showErrorToast("speech-not-supported");return}}catch(t){throw this.showErrorToast("speech-microphone-access-denied"),g.currentAudioRecorder=null,g.isTranscribing=!1,t}},editLatestQuestion(){const t=g.data.history.findLastIndex(r=>r?.type==="user");if(t===-1){console.error("No last user question, available");return}const e=g.data.history.splice(t)[0];g.data.chatInputValue=e.message},onStopSpeechRecognition(){if(g.currentAudioRecorder){const t=g.currentAudioRecorder;g.currentAudioRecorder=null,t.stop()}g.currentAudioVolume=0},async handleTranscription(t){if(!t){console.warn("No audio data received");return}try{const e=await ct.transcribeAudio(t,{lang:g.data.language});if(e.error){this.showErrorToast("speech-transcription-failed");return}if(e.transcript.trim()){if(g.data.chatConfig.blockPII&&(g.data.questionHasPii=oc(e.transcript.trim()),g.data.questionHasPii))return;g.data.chatInputValue=e.transcript.trim()}else this.showErrorToast("speech-no-text-detected")}catch(e){console.error("Speech transcription error:",e),this.showErrorToast("speech-transcription-failed")}finally{g.currentAudioRecorder=null,g.isTranscribing=!1,g.currentAudioVolume=0}},async onStartConversation(t){await this.abort(),g.data.history=[],g.data.currentConversationId=ct.createConversationId(),this.goto({name:"chat-page",query:t})},async onNewConversation(){if(await this.abort(),g.data.currentConversationId=void 0,g.data.currentReferencesAsideId=void 0,g.data.history=[],g.data.chatConfig.addQueryToUrlParams){const t=new URLSearchParams(window.location.search);t.delete("q"),history.pushState(null,"",`?${t.toString()}`)}this.goto({name:"start-page"})},showSuccessToast(t){Vi.success(g.t[t],{unstyled:!0,duration:3e3,classes:{toast:"toast"}})},showErrorToast(t){Vi.error(g.errorTranslations[t],{unstyled:!0,duration:3e3,classes:{toast:"toast"}})},async submitFeedback(t){try{const e=g.data.conversationFeedbackId||g.data.lastChatResponseId;if(!e)throw new Tp("Tried to give feedback with no id.");const r=g.data.history.find(n=>n.type==="bot"&&n.id===e);await ct.feedback(e,r?.question??"",t),setTimeout(()=>{this.showSuccessToast("thankYouForFeedback")},500)}catch(e){console.error("Feedback failed:",e),this.showErrorToast("feedback-failed")}},toggleReferencesAside(t){g.data.currentReferencesAsideId===t?this.closeReferencesAside():this.openReferencesAside(t)},openReferencesAside(t){g.data.currentReferencesAsideId=t,this.setOpenOverlay(!0)},closeReferencesAside(){g.data.currentReferencesAsideId=void 0,g.data.wasReferencesAsideClosed=!0,this.setOpenOverlay(!1)},setAsideMobile(t){g.data.isAsideMobile=t},openFlyout(){g.data.flyoutIsOpen=!0},closeFlyout(){g.data.flyoutIsOpen=!1},openConversationFeedback(){g.data.conversationFeedbackIsOpen=!0,this.setOpenOverlay(!0)},openMessageFeedback(t){g.data.conversationFeedbackId=t},closeFeedback(){g.data.conversationFeedbackIsOpen=!1,g.data.conversationFeedbackId=void 0,this.setOpenOverlay(!1)},setOpenOverlay(t){g.data.hasOpenedOverlays=t},setAriaLiveStatusMessage(t){g.data.ariaLiveStatusMessage=t,clearTimeout(g.data.ariaLiveStatusMessageClearingTimeout),g.data.ariaLiveStatusMessageClearingTimeout=setTimeout(()=>{g.data.ariaLiveStatusMessage=""},g.ariaLiveMessagesClearingTimeoutDuration)},closePopup(){window.location.hash=""},checkForOpenedPopup(){const t=window.location.hash.slice(1),e=g.t.popups?.find(r=>r.hash===t);e?g.data.openedPopup=e:g.data.openedPopup=void 0},async thumbs(t,e){try{const r=g.data.history.find(n=>n.type==="bot"&&n.id===t);e==="up"?await ct.thumbsUp(t,r?.question??""):await ct.thumbsDown(t,r?.question??""),this.showSuccessToast("thankYouForFeedback")}catch(r){console.error("Feedback failed:",r),this.showErrorToast("feedback-failed")}},async onLanguageChange(t){if(g.data.language=ba(t,g.data.chatConfig.supportedLanguages),Xl(g.data.language,g.targets.mainElement),g.data.predefinedQuestions=await this.getPredefinedQuestions(g.data.language),this.setAriaLiveStatusMessage(g.t.ariaLanguageChanged),g.data.chatConfig.reflectLanguageInPath){const e=new URL(window.location.href);e.pathname=`/${g.data.language}`,window.history.replaceState({},"",e.toString())}},async acceptTerms(){g.data.termsAccepted=!0;try{vt.setItem("liipgpt:termsAccepted","true")}catch(t){console.warn("Failed to save terms acceptance to storage:",t)}this.closePopup(),this.closeFlyout(),await ns(),this.goto({name:"start-page"})},updateChatInput(t){g.data.chatInputValue=t}});const Cp='@layer base,utilities,components;/*! tailwindcss v4.1.11 | MIT License | https://tailwindcss.com */@layer base{*,:after,:before,::backdrop,::file-selector-button{box-sizing:border-box;margin:0;padding:0;border:0 solid}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea,::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::-moz-placeholder{opacity:1}::placeholder{opacity:1}@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px){::-moz-placeholder{color:currentcolor}@supports (color: color-mix(in lab,red,red)){{color:color-mix(in oklab,currentcolor 50%,transparent)}}::placeholder{color:currentcolor}@supports (color: color-mix(in lab,red,red)){{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]),::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer base{.chat-app{--spacer-1: .0625rem;--spacer-2: .125rem;--spacer-3: .1875rem;--spacer-4: .25rem;--spacer-5: .3125rem;--spacer-6: .375rem;--spacer-8: .5rem;--spacer-10: .625rem;--spacer-12: .75rem;--spacer-16: 1rem;--spacer-20: 1.25rem;--spacer-24: 1.5rem;--spacer-28: 1.75rem;--spacer-32: 2rem;--spacer-40: 2.5rem;--spacer-48: 3rem;--spacer-56: 3.5rem;--spacer-64: 4rem;--spacer-72: 4.5rem;--spacer-80: 5rem;--spacer-120: 7.5rem;--spacer-r-8: clamp(.375rem, .3182rem + .2841cqw, .5rem);--spacer-r-12: clamp(.625rem, .5682rem + .2841cqw, .75rem);--spacer-r-16: clamp(.75rem, .6364rem + .5682cqw, 1rem);--spacer-r-20: clamp(.875rem, .7045rem + .8523cqw, 1.25rem);--spacer-r-24: clamp(1rem, .7727rem + 1.1364cqw, 1.5rem);--spacer-r-28: clamp(1.125rem, .8409rem + 1.4205cqw, 1.75rem);--spacer-r-32: clamp(1.25rem, .9091rem + 1.7045cqw, 2rem);--spacer-r-40: clamp(1.5rem, 1.0455rem + 2.2727cqw, 2.5rem);--spacer-r-48: clamp(1.625rem, 1rem + 3.125cqw, 3rem);--spacer-r-56: clamp(1.75rem, .9545rem + 3.9773cqw, 3.5rem);--spacer-r-64: clamp(2rem, 1.0909rem + 4.5455cqw, 4rem);--spacer-r-80: clamp(3rem, 2.0909rem + 4.5455cqw, 5rem);--spacer-r-96: clamp(3.5rem, 2.3636rem + 5.6818cqw, 6rem);--spacer-r-120: clamp(4rem, 2.4091rem + 7.9545cqw, 7.5rem);--default-transition-duration: .2s;--default-transition-timing-function: ease-in-out;--z-index-flyout: 10000;--z-index-dialog: 600;--z-index-loader: 500;--z-index-reference-number: 400;--z-index-footer: 300;--z-index-header: 200;--z-index-tooltip: 100;--z-index-tooltip-hover: 101;--z-index-local-overlay: 10;--ease-out-quart: cubic-bezier(.165, .84, .44, 1);--ease-in-quart: cubic-bezier(.895, .03, .685, .22);--ease-in-out-quart: cubic-bezier(.77, 0, .175, 1);--fly-in-id: 0;--btn-padding-x: var(--spacer-r-20);--btn-padding-y: var(--spacer-r-8);--btn-icon-size: var(--spacer-24);--btn-submit-size: 2.5em;--last-bot-message-min-height: 0}}@value container-xs,container-sm,container-md,container-lg,container-inner-xs,container-inner-sm,container-inner-md,container-inner-lg from "./viewports.css";@layer base{.chat-app :where(h1,.h1,h2,.h2,h3,.h3,h4,.h4,h5,.h5,h6,.h6){font-weight:var(--base-font-weight-title);line-height:var(--base-line-height-tight)}.chat-app :where(b,strong){font-weight:var(--base-font-weight-bold)}.chat-app :where(button){cursor:pointer}.chat-app :where(input[type=text],input[type=email],input[type=search],input[type=password],textarea){width:100%;padding:var(--input-padding);border-width:var(--input-border-width);border-radius:var(--input-border-radius);border-color:var(--input-border-color);background:var(--input-background);box-shadow:var(--input-box-shadow, none);color:var(--input-color)}.chat-app :where(input[type=text],input[type=email],input[type=search],input[type=password],textarea)::-moz-placeholder{color:var(--input-placeholder-color);opacity:var(--input-placeholder-opacity)}.chat-app :where(input[type=text],input[type=email],input[type=search],input[type=password],textarea)::placeholder{color:var(--input-placeholder-color);opacity:var(--input-placeholder-opacity)}.chat-app :where(input[type=radio],input[type=checkbox]){margin:0}.chat-app :where(*:focus-visible){border-radius:var(--btn-primary-border-radius);outline-color:var(--body-focus-color);outline-style:var(--body-focus-style);outline-width:var(--body-focus-width);outline-offset:var(--body-focus-offset)}.chat-app *::-moz-selection{background:var(--body-selection-background);color:var(--body-selection-color)}.chat-app *::selection{background:var(--body-selection-background);color:var(--body-selection-color)}.chat-app ::-webkit-scrollbar{width:8px;height:8px}.chat-app ::-webkit-scrollbar-track{background:transparent}.chat-app ::-webkit-scrollbar-thumb{border-radius:4px;background-color:#0000004d;-webkit-transition:background-color .2s;transition:background-color .2s}.chat-app ::-webkit-scrollbar-thumb:hover{background-color:#00000080}.chat-app *{scrollbar-color:rgba(0,0,0,.3) transparent;scrollbar-width:thin}.chat-app ::-webkit-scrollbar-thumb{visibility:hidden}.chat-app *:hover::-webkit-scrollbar-thumb,.chat-app *:active::-webkit-scrollbar-thumb,.chat-app *:focus::-webkit-scrollbar-thumb{visibility:visible}}@layer utilities{.chat-app :where(.expand-interaction){position:relative}.chat-app :where(.expand-interaction):after{position:absolute;inset:0;background-color:transparent;content:""}.chat-app :where(.sr-only){position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.chat-app :where(.transition-colors){transition-duration:var(--default-transition-duration);transition-property:color,background-color,border-color,box-shadow;transition-timing-function:var(--default-transition-timing-function)}.chat-app :where(.transition){transition-duration:var(--default-transition-duration);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter;transition-timing-function:var(--default-transition-timing-function)}.chat-app :where(.skip-link){position:absolute;width:0px;height:0px;overflow:hidden;color:var(--anchor-color);font-weight:700;font-size:var(--base-font-size-xs)}.chat-app :where(.skip-link):focus-visible{position:static;width:auto;height:auto}.chat-app :where(.fly-in){--fly-in-id: 0;--fly-in-duration: .4s;--fly-out-duration: .2s;--fly-in-delay: .3s;--fly-in-delay-additional: .1s;--fly-in-y: var(--spacer-r-64);transform:translateY(var(--fly-in-y));opacity:0;transition-delay:0s,1s;transition-duration:var(--fly-out-duration);transition-property:opacity,transform;transition-timing-function:ease,var(--ease-out-quart)}.chat-app :where(.mounted .fly-in){transform:translateY(0);opacity:1;transition-delay:calc(var(--fly-in-delay) + var(--fly-in-id) * var(--fly-in-delay-additional));transition-duration:var(--fly-in-duration)}.chat-app :where(.truncate){display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-app :where(.line-clamp){display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1}.chat-app :where(.line-clamp--2){-webkit-line-clamp:2}.chat-app :where(.line-clamp--6){-webkit-line-clamp:6}.chat-app :where(.container){width:100%;max-width:var(--container-max-width, 1024px);margin:0 auto;padding-right:var(--spacer-16);padding-left:var(--spacer-16)}@container chat-container (min-width: 640px){.chat-app :where(.container){padding-right:var(--spacer-32);padding-left:var(--spacer-32)}}@container chat-container (min-width: 768px){.chat-app :where(.container){padding-right:var(--spacer-48);padding-left:var(--spacer-48)}}.chat-app :where(h1){font-size:var(--base-font-size-h1)}.chat-app :where(h2){font-size:var(--base-font-size-h2)}.chat-app :where(h3){font-size:var(--base-font-size-h3)}.chat-app :where(h4,h5,h6){font-size:var(--body-font-size)}.chat-app :where(.h1){font-size:var(--base-font-size-h1)}.chat-app :where(.h2){font-size:var(--base-font-size-h2)}.chat-app :where(.h3){font-size:var(--base-font-size-h3)}.chat-app :where(.h4,.h5,.h6){font-size:var(--body-font-size)}.chat-app :where(.text-container)>:where(p,ul,ol,img,table){display:block;margin-bottom:var(--spacer-r-24)}.chat-app :where(.text-container)>:where(div){margin:var(--spacer-r-40) 0}.chat-app :where(.text-container)>:where(h1,.h1){margin-bottom:var(--spacer-r-28)}.chat-app :where(.text-container)>:where(h2,.h2,h3,.h3,h4,.h4,h5,.h5,h6,.h6){margin-bottom:var(--spacer-r-20)}.chat-app :where(.text-container)>:where(h1,.h1,h2,.h2,h3,.h3,h4,.h4,h5,.h5,h6,.h6){margin-top:var(--spacer-r-40)}.chat-app :where(.text-container)>:where(ul:not(.no-list-styling),ol:not(.no-list-styling))>:where(li){margin-bottom:var(--spacer-12)}.chat-app :where(.text-container)>:where(ul:not(.no-list-styling),ol:not(.no-list-styling))>:where(li):last-child{margin-bottom:0}.chat-app :where(.text-container)>:where(ol){padding-left:1.5em;list-style-position:outside;list-style-type:decimal}.chat-app :where(.text-container)>:where(ul:not(.no-list-styling))>:where(li){position:relative;padding-left:1em}.chat-app :where(.text-container)>:where(ul:not(.no-list-styling))>:where(li):before{position:absolute;top:0;left:0;content:"•";font-size:.9em}.chat-app :where(.text-container)>:where(hr){height:1px;margin:var(--spacer-r-40) 0;border:none;background-color:var(--color-grey-700);background-color:var(--hr-color)}.chat-app :where(.text-container) :where(a:not(.button,.no-link-styling,.reference)){color:var(--anchor-color);font-weight:var(--anchor-font-weight, var(--base-font-weight-normal));-webkit-text-decoration:var(--anchor-text-decoration, underline);text-decoration:var(--anchor-text-decoration, underline);text-underline-offset:var(--anchor-text-underline-offset, .15em);transition-duration:var(--default-transition-duration);transition-property:color,background-color,border-color;transition-timing-function:var(--default-transition-timing-function)}.chat-app :where(.text-container) :where(a:not(.button,.no-link-styling,.reference)):hover{color:var(--anchor-hover-color)}.chat-app :where(.text-container) :where(table){display:block;width:100%;overflow-x:auto;border-collapse:collapse;border-spacing:0;-webkit-overflow-scrolling:touch}.chat-app :where(.text-container) :where(th){width:1000px;padding:var(--spacer-12) var(--spacer-16) var(--spacer-12) 0;border-bottom:1px solid var(--color-grey-300);line-height:var(--base-line-height-tight);text-align:left;vertical-align:bottom}.chat-app :where(.text-container) :where(td){padding:var(--spacer-12) var(--spacer-16) var(--spacer-12) 0;border-bottom:1px solid var(--color-grey-300);vertical-align:top}.chat-app :where(.text-container) :where(tr:last-child td){border-bottom:none}.chat-app :where(.text-container) :where(*:first-child){margin-top:0}.chat-app :where(.text-container) :where(*:last-child){margin-bottom:0}.chat-app :where(.animated-height){transition:height .5s var(--ease-in-out-quart)}.chat-app :where(.display-contents){display:contents}.chat-app :where(.absolute){position:absolute!important}}@layer base{.svg{width:var(--spacer-r-24);height:auto}.svg svg{display:block;width:100%;height:auto;overflow:visible}}@layer components{.chat-app{display:contents}.chat-app__container{container-name:chat-container;container-type:inline-size;display:flex;height:100%;overflow:hidden;transform:translateZ(0)}.chat-app__container>:where(*){color:var(--body-color);font-style:normal;font-weight:var(--base-font-weight-normal);font-size:var(--base-font-size-body);line-height:var(--base-line-height-default);font-family:var(--font-family);font-optical-sizing:auto}.chat-app__container.chat-app__container--inline-layout-contained{height:90svh;scroll-margin-top:10svh}@media (min-width: 768px){.chat-app__container.chat-app__container--inline-layout-contained{height:100svh;scroll-margin-top:0}}.chat-app__main{container-name:chat-inner-container;container-type:inline-size;display:flex;flex-direction:column;width:100%;height:100%;overflow-x:hidden;overflow-y:auto;overscroll-behavior-x:none;overscroll-behavior-y:contain;background:var(--body-background);scrollbar-gutter:stable;touch-action:pan-y}.chat-app__container--inline-layout .chat-app__main{overscroll-behavior-y:auto}.chat-app__loader-container{display:flex;z-index:var(--z-index-loader);position:relative;align-items:center;justify-content:center;width:100%;height:100%}.chat-app__portals{display:contents}.chat-app__header{z-index:var(--z-index-header);position:sticky;top:0;background:var(--body-background)}.chat-app__header--unsticked{position:relative}.chat-app__header-content{--btn-padding-x: var(--btn-padding-y);display:flex;position:relative;-moz-column-gap:var(--spacer-r-12);column-gap:var(--spacer-r-12);flex-wrap:wrap;align-items:center;justify-content:flex-end;margin-right:calc(var(--btn-padding-x) * -1);margin-left:calc(var(--btn-padding-x) * -1);padding-top:var(--spacer-10);padding-bottom:var(--spacer-10)}.chat-app__header-content>:where(*){z-index:0;position:relative;pointer-events:auto}.chat-app__header-content:after{position:absolute;right:var(--btn-padding-x);bottom:0;left:var(--btn-padding-x);border-bottom:1px solid transparent;content:"";transition:border-color .1s ease-in-out}.chat-app__header-content.has-border:after{border-color:var(--base-line-color)}.chat-app__header-new-conversation{position:relative;margin-right:auto}@container chat-container (min-width: 640px){.chat-app__header-new-conversation .tooltip{display:none}}.chat-app__header--with-logo :where(.chat-app__header-content){margin-left:0}.chat-app__header--with-logo :where(.chat-app__header-new-conversation){margin-right:unset;margin-left:auto}.chat-app__header-logo{margin-right:auto}.chat-app__header-logo :where(svg){width:auto;height:var(--spacer-28)}.chat-app__body{display:flex;position:relative;flex-grow:1;flex-direction:column;width:100%}.chat-app__page-transition{display:flex;flex-grow:1;flex-direction:column;width:100%;height:100%}.chat-app__aside{--duration-in: .65s;--duration-out: .5s;visibility:hidden;position:relative;top:0;bottom:0;flex-grow:1;width:0;transition-delay:0s,var(--duration-out);transition-duration:var(--duration-out),0s;transition-property:width,visibility;transition-timing-function:var(--ease-in-out-quart),linear}.chat-app__aside.open{visibility:visible;width:var(--aside-width);transition-delay:0s;transition-duration:var(--duration-in),0s;transition-timing-function:var(--ease-out-quart),linear}.chat-app__aside .tooltip{--background-color: var(--btn-secondary-hover-background)}.chat-app__aside-container{position:relative;width:var(--aside-width);height:100%;overflow-y:auto;overscroll-behavior:contain;border-left-width:var(--aside-border-width);border-color:var(--aside-border-color);background:var(--aside-background);scrollbar-gutter:stable}.chat-app__container--inline-layout .chat-app__aside-container{overscroll-behavior-y:auto}.chat-app__aside-header,.chat-app__sheet-header{display:flex;z-index:var(--z-index-header);position:sticky;top:0;flex-wrap:no-wrap;align-items:center;justify-content:space-between;padding:var(--spacer-12) var(--spacer-12) var(--spacer-12) var(--spacer-24);gap:var(--spacer-24);border-bottom-width:var(--aside-header-border-width);border-color:var(--aside-header-border-color);background:var(--aside-background);color:var(--aside-header-color)}.chat-app__sheet-close{position:relative}.chat-app__sheet-overlay{z-index:var(--z-index-dialog);position:fixed;inset:0;background:var(--aside-background-overlay)}.chat-app__sheet-content{z-index:var(--z-index-flyout);position:fixed;top:0;right:0;width:100%;max-width:var(--aside-width);height:100%;overflow-y:auto;overscroll-behavior:contain;border-left-width:var(--aside-border-width);border-color:var(--aside-border-color);background:var(--aside-background);scrollbar-gutter:stable}.chat-app__container--inline-layout .chat-app__sheet-content{overscroll-behavior-y:auto}:is(.chat-app__aside-close,.chat-app__sheet-close) :where(.btn){background-color:transparent}.chat-app__aside-title,.chat-app__sheet-title{font-size:var(--base-font-size-sm)}.chat-app__close-button{z-index:var(--z-index-flyout)}}@layer components{.open-button{--open-button-avatar-height: var(--spacer-r-80);--open-button-avatar-width: var(--spacer-r-80);--open-button-duration: .4s;--open-button-delay: .3s;--open-button-ease: ease-in-out;display:flex;flex-direction:row;align-items:flex-end;cursor:pointer;transition:opacity .15s ease-out}.open-button--expanded{opacity:0;pointer-events:none}.open-button__text{display:flex;position:absolute;right:100%;bottom:50%;flex-direction:column;align-items:flex-start;justify-content:center;margin-right:calc(var(--open-button-avatar-width) * -.5);padding-top:var(--spacer-r-12);padding-right:0;padding-bottom:var(--spacer-r-12);padding-left:0;overflow:hidden;transform:translateY(50%);border-width:var(--open-button-border-width);border-radius:var(--open-button-border-radius);border-color:var(--open-button-border-color);background:var(--open-button-background);box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a;color:var(--open-button-color);text-align:left;transition:transform var(--open-button-duration) var(--open-button-ease),padding-right var(--open-button-duration) var(--open-button-delay) var(--open-button-ease)}.open-button:is(:hover,.open-button--programmatic-expand) .open-button__text{transform:translateY(0);background:var(--open-button-hover-background, var(--open-button-background));color:var(--open-button-hover-color, var(--open-button-color));opacity:1;transition:transform var(--open-button-duration) var(--open-button-delay) var(--open-button-ease)}.open-button__title{max-width:240px;padding:0 calc(var(--open-button-avatar-width) * .5 + var(--spacer-r-12)) 0 var(--spacer-r-12);font-weight:700;white-space:pre}.open-button__mask{width:0;height:0;overflow:hidden;transition:width var(--open-button-duration) var(--open-button-delay) var(--open-button-ease),height var(--open-button-duration) var(--open-button-ease)}.open-button:is(:hover,.open-button--programmatic-expand) .open-button__mask{transition:width var(--open-button-duration) var(--open-button-ease),height var(--open-button-duration) var(--open-button-delay) var(--open-button-ease)}.open-button__description{position:relative;width:50cqw;max-width:260px;padding:0 calc(var(--open-button-avatar-width) * .5 + var(--spacer-r-12)) 0 var(--spacer-r-12);text-wrap:balance}.open-button__avatar{z-index:var(--z-index-local-overlay);position:relative;width:var(--open-button-avatar-width);height:var(--open-button-avatar-height);overflow:clip;border-radius:var(--spacer-r-80);filter:drop-shadow(0 4px 6px rgba(0,0,0,.15));transition:transform .2s var(--open-button-ease)}.open-button:is(:hover,.open-button--programmatic-expand) .open-button__avatar{transform:scale(1.05)}.open-button__link-icon{display:none;position:absolute;right:0;width:var(--spacer-r-80);height:var(--spacer-r-80);padding:var(--spacer-r-20);color:var(--open-button-color)}:where(.open-button--standalone){position:fixed;right:var(--spacer-r-16);bottom:var(--spacer-r-16)}@media (prefers-reduced-motion: reduce){.open-button__text,.open-button__mask,.open-button:hover .open-button__text,.open-button:hover .open-button__mask{transition:none!important}.open-button__avatar,.open-button:hover .open-button__avatar{filter:none!important;transition:none!important}}.open-button--hide-title-when-collapsed .open-button__text{visibility:hidden;opacity:0;transition:transform var(--open-button-duration) var(--open-button-ease),padding-right var(--open-button-duration) var(--open-button-delay) var(--open-button-ease),opacity var(--open-button-duration) var(--open-button-delay) var(--open-button-ease),visibility 0s linear calc(var(--open-button-duration) + var(--open-button-delay))}.open-button--hide-title-when-collapsed:is(:hover,.open-button--programmatic-expand) .open-button__text{visibility:visible;transform:translateY(0);background:var(--open-button-hover-background, var(--open-button-background));color:var(--open-button-hover-color, var(--open-button-color));opacity:1;transition:transform var(--open-button-duration) var(--open-button-delay) var(--open-button-ease),opacity var(--open-button-duration) var(--open-button-ease),visibility 0s linear 0s}}',Ap=new RegExp("([\\p{Ll}\\d])(\\p{Lu})","gu"),Rp=new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])","gu"),Ip=new RegExp("(\\d)(\\p{Ll})","gu"),Lp=new RegExp("(\\p{L})(\\d)","gu"),Op=/[^\p{L}\d]+/giu,ka="$1\0$2",Mp="";function Pp(t,e){let r=t.trim();r=r.replace(Ap,ka).replace(Rp,ka),e?.separateNumbers&&(r=r.replace(Ip,ka).replace(Lp,ka)),r=r.replace(Op,"\0");let n=0,a=r.length;for(;r.charAt(n)==="\0";)n++;if(n===a)return[];for(;r.charAt(a-1)==="\0";)a--;return r.slice(n,a).split(/\0/g)}function Np(t,e){return zp(t,e?.prefixCharacters)+Pp(t,e).map($p(e?.locale)).join(e?.delimiter??" ")}function Dp(t,e){return Np(t,{delimiter:"-",...e})}function $p(t){return t===!1?e=>e.toLowerCase():e=>e.toLocaleLowerCase(t)}function zp(t,e=Mp){let r="";for(let n=0;n<t.length;n++){const a=t.charAt(n);if(e.includes(a))r+=a;else break}return r}const ya=Dp,Fp=640,Bp=1024;let wa=null;const jp=()=>{if(wa)return wa;if(!globalThis.document)return 16;const t=globalThis.document.querySelector(":root");return wa=Number(getComputedStyle(t).fontSize.slice(0,-2)),wa},Up=({minRem:t,maxRem:e})=>{const r=jp(),n=Fp/r,a=Bp/r,i=(e-t)/(a-n),o=-n*i+t;return`clamp( ${t}rem, ${o}rem + ${i*100}cqw, ${e}rem )`},dc=t=>typeof t=="string"?t:typeof t=="number"?String(t):typeof t=="object"?t.minRem===t.maxRem?`${t.minRem}rem`:Up(t):"",Qi=(t,e,r,n=!1)=>{let a="";return r.forEach(i=>{let o=e[i];n&&!o&&i==="borderWidth"&&(o="0px"),n&&!o&&i==="borderColor"&&(o="transparent"),o&&(a+=`--${ya(t)}-${ya(i)}:${dc(o)}; `)}),a},hc=(t,e)=>Object.entries(e).map(([r,n])=>`--${t}-${ya(r)}:${dc(n)}`).join("; ")+"; ",qp=(t,e)=>{let r="";return r+=Qi(t,e,["background","borderWidth","borderColor","boxShadow","borderRadius","color"],!0),e.hover&&(r+=Qi(`${t}-hover`,e.hover,["background","borderWidth","borderColor","boxShadow","color"])),e.focus&&(r+=Qi(`${t}-focus`,e.focus,["background","borderWidth","borderColor","boxShadow","color"])),e.custom&&(r+=hc(t,e.custom)),r},Vp=(t,e)=>Object.entries(e).map(([r,n])=>`--color-${t}-${r}:${n}`).join("; ")+"; ",Hp=t=>`--font-family: ${t?.family||"inherit"};`,Zp=t=>{const e=Hp(t.font),r=Object.entries(t.colors).map(([i,o])=>Vp(i,o)).join(""),n=hc("base",t.base),a=Object.entries(t.components).map(([i,o])=>qp(ya(i),o)).join("");return`.chat-app {${e} ${r} ${n} ${a}};`};var ut=typeof window<"u"?window:{screen:{},navigator:{}},Kr=(ut.matchMedia||function(){return{matches:!1}}).bind(ut),Gp={get passive(){return!0}},fc=function(){};ut.addEventListener&&ut.addEventListener("p",fc,Gp),ut.removeEventListener&&ut.removeEventListener("p",fc,!1);var Yi="ontouchstart"in ut,Wp="TouchEvent"in ut,Qp=Yi||Wp&&Kr("(any-pointer: coarse)").matches,pc=(ut.navigator.maxTouchPoints||0)>0||Qp,gc=ut.navigator.userAgent||"",Yp=Kr("(pointer: coarse)").matches&&/iPad|Macintosh/.test(gc)&&Math.min(ut.screen.width||0,ut.screen.height||0)>=768,mc=(Kr("(pointer: coarse)").matches||!Kr("(pointer: fine)").matches&&Yi)&&!/Windows.*Firefox/.test(gc),Kp=Kr("(any-pointer: fine)").matches||Kr("(any-hover: hover)").matches||Yp||!Yi,vc=pc&&(Kp||!mc)?"hybrid":pc?"touchOnly":"mouseOnly",Xp=vc==="mouseOnly"?"mouse":vc==="touchOnly"||mc?"touch":"mouse";function bc(t,e){Pr(e,!0);let r=oe(e,"href",7),n=oe(e,"target",7),a=oe(e,"onclick",7),i=oe(e,"className",23,()=>[]),o=oe(e,"isStandalone",7,!1),s=oe(e,"children",7),c=oe(e,"type",7,"button"),l=oe(e,"use",7),u=oe(e,"class",7),p=oi(e,["$$slots","$$events","$$legacy","$$host","href","target","onclick","className","isStandalone","children","type","use","class"]);const h=X(()=>r()?"a":"button"),v=X(()=>[...Array.isArray(i())?i():i()?[i()]:[],...u()?[u()]:[]]),m=()=>({}),b=X(()=>l()??m);var C=gt(),y=Le(C);return gs(y,()=>_(h),!1,(k,w)=>{ms(k,U=>_(b)?.(U)),xs(k,U=>({...p,onclick:r()?void 0:a(),type:r()?void 0:c(),href:r(),role:r()?"link":"button",target:r()?n():void 0,class:_(v),[jr]:U}),[()=>({"open-button--standalone":o()})]);var T=gt(),R=Le(T);hs(R,s),ie(w,T)}),ie(t,C),Nr({get href(){return r()},set href(k){r(k),ee()},get target(){return n()},set target(k){n(k),ee()},get onclick(){return a()},set onclick(k){a(k),ee()},get className(){return i()},set className(k=[]){i(k),ee()},get isStandalone(){return o()},set isStandalone(k=!1){o(k),ee()},get children(){return s()},set children(k){s(k),ee()},get type(){return c()},set type(k="button"){c(k),ee()},get use(){return l()},set use(k){l(k),ee()},get class(){return u()},set class(k){u(k),ee()}})}pn(bc,{href:{},target:{},onclick:{},className:{},isStandalone:{},children:{},type:{},use:{},class:{}},[],[],!0);function Rn(t,e){Pr(e,!0);let r=oe(e,"css",7),n=oi(e,["$$slots","$$events","$$legacy","$$host","css"]);const a=c=>{Uo(()=>{r()&&(c.innerHTML=r())})};var i=gt(),o=Le(i);{var s=c=>{var l=gt(),u=Le(l);gs(u,()=>"style",!1,(p,h)=>{ms(p,v=>a?.(v)),xs(p,()=>({...n}))}),ie(c,l)};ir(o,c=>{r()&&c(s)})}return ie(t,i),Nr({get css(){return r()},set css(c){r(c),ee()}})}pn(Rn,{css:{}},[],[],!0);var Jp=Tt('<div class="open-button__title"><!></div>'),e0=Tt('<div class="open-button__mask"><div class="open-button__description"><!></div></div>'),t0=Tt('<div class="open-button__text"><!> <!></div>'),r0=Tt('<div class="sr-only"> </div>'),n0=Tt('<!> <div class="svg svg--avatar open-button__avatar" aria-hidden="true"><!></div>',1),a0=Tt('<link rel="stylesheet"/>'),i0=Tt("<!> <!>",1),o0=Tt('<!> <!> <!> <main class="chat-app"><!></main>',1);function kc(t,e){Pr(e,!0);const r=(F,$)=>{let G=()=>$?.().chatConfig,Be=()=>$?.().language,be=()=>$?.().colorScheme;const se=X(()=>{const{openButtonTitle:we,openButtonDescription:ae}=G().translations[Be()];return{openButtonTitle:we,openButtonDescription:ae}}),je=X(()=>G().fullTheme[be()].tokens.svgs),ke=X(()=>G().fullTheme[be()]?.tokens.components.openButton?.custom),ye=X(()=>!!_(ke)?.hideTitleWhenCollapsed);{let we=X(()=>G().buttonHref?void 0:s()?"true":"false"),ae=X(()=>G().buttonHref?void 0:"true"),Je=X(()=>G().buttonHref?void 0:o()),Ue=X(()=>["open-button",e.buttonClass,g.data.flyoutIsOpen?"open-button--expanded":void 0,_(ye)?"open-button--hide-title-when-collapsed":void 0]);bc(F,{get href(){return G().buttonHref},onclick:xa,onmouseenter:_a,onmouseleave:Ji,use:Qt,get"aria-expanded"(){return _(we)},get"aria-haspopup"(){return _(ae)},get"aria-controls"(){return _(Je)},get style(){return e.buttonStyle},get className(){return _(Ue)},get isStandalone(){return _(h)},children:(dt,Yt)=>{var It=n0(),Ln=Le(It);{var Sa=et=>{var Ve=t0(),Lr=Bt(Ve);{var Ta=Lt=>{var tt=Jp(),Ot=Bt(tt);ti(Ot,()=>_(se).openButtonTitle),$t(tt),ie(Lt,tt)};ir(Lr,Lt=>{_(se).openButtonTitle&&Lt(Ta)})}var Ea=nr(Lr,2);{var On=Lt=>{var tt=e0(),Ot=Bt(tt),yt=Bt(Ot);ti(yt,()=>_(se).openButtonDescription),$t(Ot),As(Ot,Mt=>P(k,Mt),()=>_(k)),$t(tt),As(tt,Mt=>P(y,Mt),()=>_(y)),ie(Lt,tt)};ir(Ea,Lt=>{_(se).openButtonDescription&&Xp==="mouse"&&Lt(On)})}$t(Ve),ie(et,Ve)},eo=et=>{var Ve=r0(),Lr=Bt(Ve,!0);$t(Ve),Zn(()=>cs(Lr,g.t.ariaOpenChat)),ie(et,Ve)};ir(Ln,et=>{_(se).openButtonTitle||_(se).openButtonDescription?et(Sa):et(eo,!1)})}var Jr=nr(Ln,2),Ir=Bt(Jr);ti(Ir,()=>_(je).avatar),$t(Jr),ie(dt,It)},$$slots:{default:!0}})}};let n=J("light"),a=oe(e,"host",7),i=oe(e,"onError",7),o=oe(e,"flyoutId",7),s=oe(e,"flyoutIsOpen",7),c=oi(e,["$$slots","$$events","$$legacy","$$host","host","onError","flyoutId","flyoutIsOpen"]);const l=async F=>{const G=await(await fetch(`${F}/chatconfig`)).json();return Fl.parse(G)},u=async({forceTheme:F,lang:$,apiUrl:G})=>{const Be=window.CHAT_CONFIG_OVERRIDE?window.CHAT_CONFIG_OVERRIDE:await l(G),be=Zl(Be);let se;$?se=ba($,be.supportedLanguages):se=Jl(be.supportedLanguages);const je=Object.keys(be.fullTheme),ke=Zi(je);return{chatConfig:be,language:se,colorScheme:ke}},p=(F,$)=>{if(F==null)return $;if(typeof F=="string"){const G=F.trim().toLowerCase();return!(G===""||G==="0"||G==="false"||G==="no")}return typeof F=="number"?F!==0:typeof F=="boolean"?F:$};let h=X(()=>!!a()),v=J(!1),m=J(!1),b=J(!1),C=J(void 0),y=J(void 0),k=J(void 0),w=X(()=>_(k)?.offsetWidth??0),T=X(()=>_(k)?.offsetHeight??0),R=J(void 0),U=J(!1),Q,Fe=J(!0);function le(){return _(R)?(clearTimeout(_(R)),P(R,void 0),!0):!1}async function ur(F){P(n,F.colorScheme,!0),Q?.(),le(),P(U,!1);const $=F.chatConfig.fullTheme[_(n)]?.tokens.components.openButton?.custom??{},G=$.autoExpandScrollThreshold,Be=Number($.autoCollapseDelay??0),be=Number.isNaN(Be)?0:Math.max(0,Be),se=p($.autoExpandOnce,!1),je=(()=>{if(G==null)return 100;if(typeof G=="string"){if(G.trim().toLowerCase()==="none")return 0;const Ue=Number(G);return Number.isNaN(Ue)?100:Ue}const ae=Number(G);return Number.isNaN(ae)?100:ae})();if(Number.isNaN(je)||je<0)return;const ke=`liipgpt-auto-expand-${e.apiUrl}`;let ye=!1;if(typeof window<"u")try{ye=window.localStorage.getItem(ke)==="true"}catch(ae){console.warn("LiipGPT: unable to read auto-expand flag",ae)}P(b,ye,!0);const we=()=>{if(!(window.scrollY/window.innerHeight*100>=je)){P(Fe,!0);return}if(!(_(m)||s())&&!(se&&(ye||_(b)))&&_(Fe)){if(P(Fe,!1),P(m,!0),P(b,!0),Ki(),se&&typeof window<"u")try{window.localStorage.setItem(ke,"true")}catch(Ue){console.warn("LiipGPT: unable to persist auto-expand flag",Ue)}P(R,setTimeout(()=>{_(U)||(Xi(),P(m,!1)),P(R,void 0)},be),!0)}};window.addEventListener("scroll",we,{passive:!0}),je===0&&(await ns(),we()),Q=()=>{window.removeEventListener("scroll",we)}}function ne(){le(),P(m,!1),P(U,!1)}function Qt(F){P(C,F,!0)}function dr(){Q?.(),le()}td(dr);function hr(){!_(k)||!_(y)||(_(y).style.width=`${_(w)}px`,_(y).style.height=`${_(T)}px`)}function Xr(){_(y)&&(_(y).style.width="0",_(y).style.height="0")}function Ki(){_(C)&&(_(C).classList.add("open-button--programmatic-expand"),hr())}function Xi(){_(C)&&(_(C).classList.remove("open-button--programmatic-expand"),Xr())}function _a(){le()&&P(U,!0),hr()}function Ji(){le(),_(U)&&(P(m,!1),P(U,!1),_(C)?.classList.remove("open-button--programmatic-expand")),_(v)||Xr()}function xa(F){ne(),e.onclick?.(F)}let ce=X(()=>u(c).then(async F=>(await ur(F),F)).catch(F=>i()(F)));var In=gt();Bu("beforeunload",Ha,dr),Uu(F=>{var $=gt(),G=Le($);{var Be=be=>{var se=gt(),je=Le(se);fs(je,()=>_(ce),null,(ke,ye)=>{var we=i0();const ae=X(()=>_(ye).chatConfig.fullTheme[_(ye).colorScheme]);var Je=Le(we);ad(Je,17,()=>_(ae).fontURLs??[],rd,(dt,Yt)=>{var It=a0();Zn(()=>ii(It,"href",_(Yt))),ie(dt,It)});var Ue=nr(Je,2);Rn(Ue,{id:"font-css",get css(){return _(ae).fontCSS}}),ie(ke,we)}),ie(be,se)};ir(G,be=>{_(h)&&be(Be)})}ie(F,$)});var fe=Le(In);return fs(fe,()=>_(ce),F=>{},(F,$)=>{var G=gt();const Be=X(()=>_($).chatConfig.fullTheme[_(n)]);var be=Le(G);{var se=ke=>{var ye=o0(),we=Le(ye);{let Yt=X(()=>Zp(_(Be).tokens));Rn(we,{id:"theme-css",get css(){return _(Yt)}})}var ae=nr(we,2);Rn(ae,{id:"app-css",get css(){return Cp}});var Je=nr(ae,2);Rn(Je,{id:"custom-css",get css(){return _(Be).customCSS}});var Ue=nr(Je,2),dt=Bt(Ue);r(dt,()=>_($)),$t(Ue),ie(ke,ye)},je=ke=>{r(ke,()=>_($))};ir(be,ke=>{_(h)?ke(se):ke(je,!1)})}ie(F,G)}),ie(t,In),Nr({get host(){return a()},set host(F){a(F),ee()},get onError(){return i()},set onError(F){i(F),ee()},get flyoutId(){return o()},set flyoutId(F){o(F),ee()},get flyoutIsOpen(){return s()},set flyoutIsOpen(F){s(F),ee()}})}pn(kc,{host:{},onError:{},flyoutId:{},flyoutIsOpen:{}},[],[],!0);function yc(t,e){Pr(e,!0);let r=oe(e,"onclick",7),n=oe(e,"buttonClass",7),a=oe(e,"buttonStyle",7),i=oe(e,"apiUrl",7),o=oe(e,"forceTheme",7),s=oe(e,"lang",7),c=X(()=>({onclick:r(),buttonClass:n(),buttonStyle:a(),apiUrl:i(),forceTheme:o(),lang:s()}));return Is(t,{silent:!0,body:(u,p=pr)=>{kc(u,wd({host:e.$$host,get onError(){return p()}},()=>_(c)))},$$slots:{body:!0}}),Nr({get onclick(){return r()},set onclick(l){r(l),ee()},get buttonClass(){return n()},set buttonClass(l){n(l),ee()},get buttonStyle(){return a()},set buttonStyle(l){a(l),ee()},get apiUrl(){return i()},set apiUrl(l){i(l),ee()},get forceTheme(){return o()},set forceTheme(l){o(l),ee()},get lang(){return s()},set lang(l){s(l),ee()}})}return customElements.define("liipgpt-button",pn(yc,{forceTheme:{attribute:"force-theme",type:"String"},buttonClass:{attribute:"button-class",type:"String"},buttonStyle:{attribute:"button-style",type:"String"},apiUrl:{attribute:"api-url",type:"String"},lang:{attribute:"lang",type:"String"},onclick:{}},[],[],!0)),rn.LiipGPTButton=yc,Object.defineProperty(rn,Symbol.toStringTag,{value:"Module"}),rn}({});
|