@liip/liipgpt 3.3.2 → 3.3.3
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 +15 -15
- package/chat/liipgpt-chat.iife.js +41 -41
- package/configurator/_app/env.js +1 -1
- package/configurator/_app/immutable/chunks/{Dzs3iOAP.js → 3Jx_2Hd6.js} +1 -1
- package/configurator/_app/immutable/chunks/{C8ORMuNm.js → B6FwuxF-.js} +1 -1
- package/configurator/_app/immutable/chunks/{Bwlnp1Fv.js → BXEdQL9F.js} +1 -1
- package/configurator/_app/immutable/chunks/{tg4KZpKp.js → Bjule0iI.js} +1 -1
- package/configurator/_app/immutable/chunks/C7PQ7vvk.js +1 -0
- package/configurator/_app/immutable/chunks/{BHyoBcMB.js → CCVb_64a.js} +1 -1
- package/configurator/_app/immutable/chunks/CKh0DCID.js +116 -0
- package/configurator/_app/immutable/chunks/{KwlzJn94.js → DzvSdHYT.js} +1 -1
- package/configurator/_app/immutable/chunks/{bzMFxNOM.js → w58EqJ4L.js} +1 -1
- package/configurator/_app/immutable/entry/{app.wS03Lw9v.js → app.DaWMcPqV.js} +2 -2
- package/configurator/_app/immutable/entry/start.B28NnTz6.js +1 -0
- package/configurator/_app/immutable/nodes/{0.B1_BHoHM.js → 0.DMFk0iPH.js} +1 -1
- package/configurator/_app/immutable/nodes/{1.Qf-3txMY.js → 1.Dc_xA0Gn.js} +1 -1
- package/configurator/_app/immutable/nodes/{2.QF2vvVAB.js → 2.DlerhEWH.js} +3 -3
- package/configurator/_app/immutable/nodes/{3.y9o-F-NC.js → 3.BMx6bP8s.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 +56 -27
- package/index.js +56 -27
- package/package.json +1 -1
- package/configurator/_app/immutable/chunks/DEfNJr1d.js +0 -1
- package/configurator/_app/immutable/chunks/DShclvIF.js +0 -116
- package/configurator/_app/immutable/entry/start.DC6usZVj.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var LiipGPTButton=function(sn){"use strict";const Vc="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(Vc);const Hc=1,Zc=2,Gc=16,Wc=1,Qc=4,Yc=8,Kc=16,Xc=1,Jc=2,Da="[",zn="[!",$a="]",vr={},he=Symbol(),eu="http://www.w3.org/1999/xhtml",tu="http://www.w3.org/2000/svg",ru="@attach",wo=!1;var ln=Array.isArray,nu=Array.prototype.indexOf,za=Array.from,Fn=Object.keys,Fr=Object.defineProperty,$t=Object.getOwnPropertyDescriptor,au=Object.getOwnPropertyDescriptors,_o=Object.prototype,iu=Array.prototype,Fa=Object.getPrototypeOf,xo=Object.isExtensible;function cn(t){return typeof t=="function"}const br=()=>{};function So(t){return typeof t?.then=="function"}function To(t){for(var e=0;e<t.length;e++)t[e]()}function ou(){var t,e,r=new Promise((n,a)=>{t=n,e=a});return{promise:r,resolve:t,reject:e}}const We=2,Ba=4,ja=8,un=16,zt=32,kr=64,Ua=128,Qe=256,Bn=512,ve=1024,Ye=2048,yr=4096,pt=8192,wr=16384,qa=32768,Br=65536,Co=1<<17,Eo=1<<18,jn=1<<19,Ao=1<<20,Va=1<<21,Ha=1<<22,_r=1<<23,ar=Symbol("$state"),Za=Symbol("legacy props"),su=Symbol(""),Ga=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},lu=1,Ro=3,xr=8;function cu(){throw new Error("https://svelte.dev/e/await_outside_boundary")}function Io(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function uu(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function du(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function hu(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function fu(t){throw new Error("https://svelte.dev/e/effect_orphan")}function pu(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function gu(){throw new Error("https://svelte.dev/e/hydration_failed")}function mu(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function vu(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function bu(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function ku(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function dn(t){console.warn("https://svelte.dev/e/hydration_mismatch")}function yu(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}let N=!1;function Te(t){N=t}let q;function be(t){if(t===null)throw dn(),vr;return q=t}function xt(){return be(Ke(q))}function Ft(t){if(N){if(Ke(q)!==null)throw dn(),vr;q=t}}function Lo(t=1){if(N){for(var e=t,r=q;e--;)r=Ke(r);q=r}}function hn(){for(var t=0,e=q;;){if(e.nodeType===xr){var r=e.data;if(r===$a){if(t===0)return e;t-=1}else(r===Da||r===zn)&&(t+=1)}var n=Ke(e);e.remove(),e=n}}function Oo(t){if(!t||t.nodeType!==xr)throw dn(),vr;return t.data}function Mo(t){return t===this.v}function No(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Po(t){return!No(t,this.v)}let wu=!1;const _u=[];function xu(t,e=!1){return Un(t,new Map,"",_u)}function Un(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(ln(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]=Un(c,e,r,n))}return o}if(Fa(t)===_o){o={},e.set(t,o),a!==null&&e.set(a,o);for(var l in t)o[l]=Un(t[l],e,r,n);return o}if(t instanceof Date)return structuredClone(t);if(typeof t.toJSON=="function")return Un(t.toJSON(),e,r,n,t)}if(t instanceof EventTarget)return t;try{return structuredClone(t)}catch{return t}}let Le=null;function ir(t){Le=t}function jr(t,e=!1,r){Le={p:Le,c:null,e:null,s:t,x:null,l:null}}function Ur(t){var e=Le,r=e.e;if(r!==null){e.e=null;for(var n of r)ts(n)}return t!==void 0&&(e.x=t),Le=e.p,t??{}}function Do(){return!0}const Su=new WeakMap;function Tu(t){var e=j;if(e===null)return H.f|=_r,t;if((e.f&qa)===0){if((e.f&Ua)===0)throw!e.parent&&t instanceof Error&&$o(t),t;e.b.error(t)}else qn(t,e)}function qn(t,e){for(;e!==null;){if((e.f&Ua)!==0)try{e.b.error(t);return}catch{}e=e.parent}throw t instanceof Error&&$o(t),t}function $o(t){const e=Su.get(t);e&&(Fr(t,"message",{value:e.message}),Fr(t,"stack",{value:e.stack}))}let fn=[],Wa=[];function zo(){var t=fn;fn=[],To(t)}function Cu(){var t=Wa;Wa=[],To(t)}function Sr(t){fn.length===0&&queueMicrotask(zo),fn.push(t)}function Eu(){fn.length>0&&zo(),Wa.length>0&&Cu()}function Au(t){let e=0,r=Bt(0),n;return()=>{ju()&&(_(r),ei(()=>(e===0&&(n=mt(()=>t(()=>Gn(r)))),e+=1,()=>{Sr(()=>{e-=1,e===0&&(n?.(),n=void 0)})})))}}var Ru=Br|jn|Ua;function Iu(t,e,r){new Lu(t,e,r)}class Lu{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&&sr(this.#d,this.#n)};#h=Au(()=>(this.#d=Bt(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=qt(()=>{j.b=this,N&&xt();const a=this.#a.pending;if(N&&a)this.#r=fe(()=>a(this.#e)),queueMicrotask(()=>{this.#i=this.#p(()=>(Tr.ensure(),fe(()=>this.#l(this.#e)))),this.#n>0?this.#g():(Ct(this.#r,()=>{this.#r=null}),this.pending=!1)});else{try{this.#i=fe(()=>n(this.#e))}catch(i){this.error(i)}this.#n>0?this.#g():this.pending=!1}},Ru),N&&(this.#e=q)}has_pending_snippet(){return!!this.#a.pending}#p(e){var r=j,n=H,a=Le;ot(this.#u),Ae(this.#u),ir(this.#u.ctx);try{return e()}finally{ot(r),Ae(n),ir(a)}}#g(){const e=this.#a.pending;this.#i!==null&&(this.#s=document.createDocumentFragment(),Ou(this.#i,this.#s)),this.#r===null&&(this.#r=fe(()=>e(this.#e)))}#m(e){this.#n+=e,this.#n===0&&(this.pending=!1,this.#r&&Ct(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),Ya.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&&Ct(this.#o,()=>{this.#o=null}),this.pending=!0,this.#i=this.#p(()=>(this.#c=!1,fe(()=>this.#l(this.#e)))),this.#n>0?this.#g():this.pending=!1};if(this.#c||!r&&!n)throw e;var i=H;try{Ae(null),r?.(e,a)}finally{Ae(i)}this.#i&&(ke(this.#i),this.#i=null),this.#r&&(ke(this.#r),this.#r=null),this.#o&&(ke(this.#o),this.#o=null),N&&(be(this.#t),Lo(),be(hn())),n&&Sr(()=>{this.#o=this.#p(()=>{this.#c=!0;try{return fe(()=>{n(this.#e,()=>e,()=>a)})}catch(o){return qn(o,this.#u.parent),null}finally{this.#c=!1}})})}}function Ou(t,e){for(var r=t.nodes_start,n=t.nodes_end;r!==null;){var a=r===n?null:Ke(r);e.append(r),r=a}}function Mu(){for(var t=j.b;t!==null&&!t.has_pending_snippet();)t=t.parent;return t===null&&cu(),t}function Vn(t){var e=We|Ye,r=H!==null&&(H.f&We)!==0?H:null;return j===null||r!==null&&(r.f&Qe)!==0?e|=Qe:j.f|=jn,{ctx:Le,deps:null,effects:null,equals:Mo,f:e,fn:t,reactions:null,rv:0,v:he,wv:0,parent:r??j,ac:null}}function Nu(t,e){let r=j;r===null&&uu();var n=r.b,a=void 0,i=Bt(he),o=null,s=!H;return Vu(()=>{try{var c=t()}catch(v){c=Promise.reject(v)}var l=()=>c;a=o?.then(l,l)??Promise.resolve(c),o=a;var d=He,p=n.pending;s&&(n.update_pending_count(1),p||d.increment());const h=(v,m=void 0)=>{o=null,p||d.activate(),m?m!==Ga&&(i.f|=_r,sr(i,m)):((i.f&_r)!==0&&(i.f^=_r),sr(i,v)),s&&(n.update_pending_count(-1),p||d.decrement()),qo()};if(a.then(h,v=>h(null,v||"unknown")),d)return()=>{queueMicrotask(()=>d.neuter())}}),new Promise(c=>{function l(d){function p(){d===a?c(i):l(a)}d.then(p,p)}l(a)})}function ee(t){const e=Vn(t);return us(e),e}function Fo(t){const e=Vn(t);return e.equals=Po,e}function Bo(t){var e=t.effects;if(e!==null){t.effects=null;for(var r=0;r<e.length;r+=1)ke(e[r])}}function Pu(t){for(var e=t.parent;e!==null;){if((e.f&We)===0)return e;e=e.parent}return null}function Qa(t){var e,r=j;ot(Pu(t));try{Bo(t),e=ps(t)}finally{ot(r)}return e}function jo(t){var e=Qa(t);if(t.equals(e)||(t.v=e,t.wv=hs()),!Er)if(qr!==null)qr.set(t,t.v);else{var r=(cr||(t.f&Qe)!==0)&&t.deps!==null?yr:ve;Ce(t,r)}}function Uo(t,e,r){const n=Vn;if(e.length===0){r(t.map(n));return}var a=He,i=j,o=Du(),s=Mu();Promise.all(e.map(c=>Nu(c))).then(c=>{a?.activate(),o();try{r([...t.map(n),...c])}catch(l){(i.f&wr)===0&&qn(l,i)}a?.deactivate(),qo()}).catch(c=>{s.error(c)})}function Du(){var t=j,e=H,r=Le;return function(){ot(t),Ae(e),ir(r)}}function qo(){ot(null),Ae(null),ir(null)}const Hn=new Set;let He=null,qr=null,Ya=new Set,Vr=[],Zn=null,Ka=!1;class Tr{#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){Vr=[];var r=null;if(Hn.size>1){r=new Map,qr=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 Hn)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(),Vo(n),Vo(a),this.#u?.resolve()}else{for(const i of this.#s)Ce(i,ve);for(const i of this.#n)Ce(i,ve);for(const i of this.#c)Ce(i,ve)}if(r){for(const[i,{v:o,wv:s}]of r)i.wv<=s&&(i.v=o);qr=null}for(const i of this.#r)gn(i);for(const i of this.#o)gn(i);this.#r=[],this.#o=[]}#f(e){e.f^=ve;for(var r=e.first;r!==null;){var n=r.f,a=(n&(zt|kr))!==0,i=a&&(n&ve)!==0,o=i||(n&pt)!==0||this.skipped_effects.has(r);if(!o&&r.fn!==null){if(a)r.f^=ve;else if((n&Ba)!==0)this.#n.push(r);else if(Kn(r))if((n&Ha)!==0){var s=r.b?.pending?this.#o:this.#r;s.push(r)}else(r.f&un)!==0&&this.#c.push(r),gn(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(){He=this}deactivate(){He=null;for(const e of Ya)if(Ya.delete(e),e(),He!==null)break}neuter(){this.#i=!0}flush(){Vr.length>0?this.flush_effects():this.#h(),He===this&&(this.#l===0&&Hn.delete(this),this.deactivate())}flush_effects(){var e=Zr;Ka=!0;try{var r=0;for(ls(!0);Vr.length>0;){if(r++>1e3){var n,a;$u()}this.#d(Vr),Cr.clear()}}finally{Ka=!1,ls(e),Zn=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)Ce(e,Ye),or(e);for(const e of this.#n)Ce(e,Ye),or(e);for(const e of this.#c)Ce(e,Ye),or(e);this.#s=[],this.#n=[],this.flush()}else this.deactivate()}add_callback(e){this.#a.add(e)}settled(){return(this.#u??=ou()).promise}static ensure(e=!0){if(He===null){const r=He=new Tr;Hn.add(He),e&&queueMicrotask(()=>{He===r&&r.flush()})}return He}}function re(t){var e;const r=Tr.ensure(!1);for(;;){if(Eu(),Vr.length===0)return r===He&&r.flush(),Zn=null,e;r.flush_effects()}}function $u(){try{pu()}catch(t){qn(t,Zn)}}function Vo(t){var e=t.length;if(e!==0){for(var r=0;r<e;r++){var n=t[r];if((n.f&(wr|pt))===0&&Kn(n)){var a=Yn;if(gn(n),n.deps===null&&n.first===null&&n.nodes_start===null&&(n.teardown===null?is(n):n.fn=null),Yn>a&&(n.f&Ao)!==0)break}}for(;r<e;r+=1)or(t[r])}}function or(t){for(var e=Zn=t;e.parent!==null;){e=e.parent;var r=e.f;if(Ka&&e===j&&(r&un)!==0)return;if((r&(kr|zt))!==0){if((r&ve)===0)return;e.f^=ve}}Vr.push(e)}const Cr=new Map;function Bt(t,e){var r={f:0,v:t,reactions:null,equals:Mo,rv:0,wv:0};return r}function te(t,e){const r=Bt(t);return us(r),r}function Ho(t,e=!1,r=!0){const n=Bt(t);return e||(n.equals=Po),n}function $(t,e,r=!1){H!==null&&(!gt||(H.f&Co)!==0)&&Do()&&(H.f&(We|un|Ha|Co))!==0&&!Vt?.includes(t)&&ku();let n=r?St(e):e;return sr(t,n)}function sr(t,e){if(!t.equals(e)){var r=t.v;Er?Cr.set(t,e):Cr.set(t,r),t.v=e,Tr.ensure().capture(t,r),(t.f&We)!==0&&((t.f&Ye)!==0&&Qa(t),Ce(t,(t.f&Qe)===0?ve:yr)),t.wv=hs(),Zo(t,Ye),j!==null&&(j.f&ve)!==0&&(j.f&(zt|kr))===0&&(st===null?Zu([t]):st.push(t))}return e}function Gn(t){$(t,t.v+1)}function Zo(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&Ye)===0&&(Ce(i,e),(o&(ve|Qe))!==0&&((o&We)!==0?Zo(i,yr):or(i)))}}function St(t){if(typeof t!="object"||t===null||ar in t)return t;const e=Fa(t);if(e!==_o&&e!==iu)return t;var r=new Map,n=ln(t),a=te(0),i=Ar,o=s=>{if(Ar===i)return s();var c=H,l=Ar;Ae(null),ds(i);var d=s();return Ae(c),ds(l),d};return n&&r.set("length",te(t.length)),new Proxy(t,{defineProperty(s,c,l){(!("value"in l)||l.configurable===!1||l.enumerable===!1||l.writable===!1)&&vu();var d=r.get(c);return d===void 0?d=o(()=>{var p=te(l.value);return r.set(c,p),p}):$(d,l.value,!0),!0},deleteProperty(s,c){var l=r.get(c);if(l===void 0){if(c in s){const d=o(()=>te(he));r.set(c,d),Gn(a)}}else $(l,he),Gn(a);return!0},get(s,c,l){if(c===ar)return t;var d=r.get(c),p=c in s;if(d===void 0&&(!p||$t(s,c)?.writable)&&(d=o(()=>{var v=St(p?s[c]:he),m=te(v);return m}),r.set(c,d)),d!==void 0){var h=_(d);return h===he?void 0:h}return Reflect.get(s,c,l)},getOwnPropertyDescriptor(s,c){var l=Reflect.getOwnPropertyDescriptor(s,c);if(l&&"value"in l){var d=r.get(c);d&&(l.value=_(d))}else if(l===void 0){var p=r.get(c),h=p?.v;if(p!==void 0&&h!==he)return{enumerable:!0,configurable:!0,value:h,writable:!0}}return l},has(s,c){if(c===ar)return!0;var l=r.get(c),d=l!==void 0&&l.v!==he||Reflect.has(s,c);if(l!==void 0||j!==null&&(!d||$t(s,c)?.writable)){l===void 0&&(l=o(()=>{var h=d?St(s[c]):he,v=te(h);return v}),r.set(c,l));var p=_(l);if(p===he)return!1}return d},set(s,c,l,d){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?$(m,he):v in s&&(m=o(()=>te(he)),r.set(v+"",m))}if(p===void 0)(!h||$t(s,c)?.writable)&&(p=o(()=>te(void 0)),$(p,St(l)),r.set(c,p));else{h=p.v!==he;var b=o(()=>St(l));$(p,b)}var A=Reflect.getOwnPropertyDescriptor(s,c);if(A?.set&&A.set.call(d,l),!h){if(n&&typeof c=="string"){var y=r.get("length"),k=Number(c);Number.isInteger(k)&&k>=y.v&&$(y,k+1)}Gn(a)}return!0},ownKeys(s){_(a);var c=Reflect.ownKeys(s).filter(p=>{var h=r.get(p);return h===void 0||h.v!==he});for(var[l,d]of r)d.v!==he&&!(l in s)&&c.push(l);return c},setPrototypeOf(){bu()}})}function Go(t){try{if(t!==null&&typeof t=="object"&&ar in t)return t[ar]}catch{}return t}function zu(t,e){return Object.is(Go(t),Go(e))}var Xa,Wo,Qo,Yo;function Ja(){if(Xa===void 0){Xa=window,Wo=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,r=Text.prototype;Qo=$t(e,"firstChild").get,Yo=$t(e,"nextSibling").get,xo(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),xo(r)&&(r.__t=void 0)}}function jt(t=""){return document.createTextNode(t)}function it(t){return Qo.call(t)}function Ke(t){return Yo.call(t)}function Ut(t,e){if(!N)return it(t);var r=it(q);if(r===null)r=q.appendChild(jt());else if(e&&r.nodeType!==Ro){var n=jt();return r?.before(n),be(n),n}return be(r),r}function Oe(t,e){if(!N){var r=it(t);return r instanceof Comment&&r.data===""?Ke(r):r}return q}function lr(t,e=1,r=!1){let n=N?q:t;for(var a;e--;)a=n,n=Ke(n);if(!N)return n;if(r&&n?.nodeType!==Ro){var i=jt();return n===null?a?.after(i):n.before(i),be(i),i}return be(n),n}function Ko(t){t.textContent=""}function Xo(){return!1}function Fu(t){j===null&&H===null&&fu(),H!==null&&(H.f&Qe)!==0&&j===null&&hu(),Er&&du()}function Bu(t,e){var r=e.last;r===null?e.last=e.first=t:(r.next=t,t.prev=r,e.last=t)}function Tt(t,e,r,n=!0){var a=j;a!==null&&(a.f&pt)!==0&&(t|=pt);var i={ctx:Le,deps:null,nodes_start:null,nodes_end:null,f:t|Ye,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{gn(i),i.f|=qa}catch(c){throw ke(i),c}else e!==null&&or(i);var o=r&&i.deps===null&&i.first===null&&i.nodes_start===null&&i.teardown===null&&(i.f&jn)===0;if(!o&&n&&(a!==null&&Bu(i,a),H!==null&&(H.f&We)!==0)){var s=H;(s.effects??=[]).push(i)}return i}function ju(){return H!==null&&!gt}function Jo(t){const e=Tt(ja,null,!1);return Ce(e,ve),e.teardown=t,e}function es(t){Fu();var e=j.f,r=!H&&(e&zt)!==0&&(e&qa)===0;if(r){var n=Le;(n.e??=[]).push(t)}else return ts(t)}function ts(t){return Tt(Ba|Ao,t,!1)}function Uu(t){Tr.ensure();const e=Tt(kr,t,!0);return()=>{ke(e)}}function qu(t){Tr.ensure();const e=Tt(kr,t,!0);return(r={})=>new Promise(n=>{r.outro?Ct(e,()=>{ke(e),n(void 0)}):(ke(e),n(void 0))})}function Wn(t){return Tt(Ba,t,!1)}function Vu(t){return Tt(Ha|jn,t,!0)}function ei(t,e=0){return Tt(ja|e,t,!0)}function Qn(t,e=[],r=[]){Uo(e,r,n=>{Tt(ja,()=>t(...n.map(_)),!0)})}function qt(t,e=0){var r=Tt(un|e,t,!0);return r}function fe(t,e=!0){return Tt(zt,t,!0,e)}function rs(t){var e=t.teardown;if(e!==null){const r=Er,n=H;cs(!0),Ae(null);try{e.call(null)}finally{cs(r),Ae(n)}}}function ns(t,e=!1){var r=t.first;for(t.first=t.last=null;r!==null;){r.ac?.abort(Ga);var n=r.next;(r.f&kr)!==0?r.parent=null:ke(r,e),r=n}}function Hu(t){for(var e=t.first;e!==null;){var r=e.next;(e.f&zt)===0&&ke(e),e=r}}function ke(t,e=!0){var r=!1;(e||(t.f&Eo)!==0)&&t.nodes_start!==null&&t.nodes_end!==null&&(as(t.nodes_start,t.nodes_end),r=!0),ns(t,e&&!r),Xn(t,0),Ce(t,wr);var n=t.transitions;if(n!==null)for(const i of n)i.stop();rs(t);var a=t.parent;a!==null&&a.first!==null&&is(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes_start=t.nodes_end=t.ac=null}function as(t,e){for(;t!==null;){var r=t===e?null:Ke(t);t.remove(),t=r}}function is(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 Ct(t,e){var r=[];ti(t,r,!0),os(r,()=>{ke(t),e&&e()})}function os(t,e){var r=t.length;if(r>0){var n=()=>--r||e();for(var a of t)a.out(n)}else e()}function ti(t,e,r){if((t.f&pt)===0){if(t.f^=pt,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&Br)!==0||(n.f&zt)!==0;ti(n,e,i?r:!1),n=a}}}function Hr(t){ss(t,!0)}function ss(t,e){if((t.f&pt)!==0){t.f^=pt,(t.f&ve)===0&&(Ce(t,Ye),or(t));for(var r=t.first;r!==null;){var n=r.next,a=(r.f&Br)!==0||(r.f&zt)!==0;ss(r,a?e:!1),r=n}if(t.transitions!==null)for(const i of t.transitions)(i.is_global||e)&&i.in()}}let Zr=!1;function ls(t){Zr=t}let Er=!1;function cs(t){Er=t}let H=null,gt=!1;function Ae(t){H=t}let j=null;function ot(t){j=t}let Vt=null;function us(t){H!==null&&(Vt===null?Vt=[t]:Vt.push(t))}let Me=null,Xe=0,st=null;function Zu(t){st=t}let Yn=1,pn=0,Ar=pn;function ds(t){Ar=t}let cr=!1;function hs(){return++Yn}function Kn(t){var e=t.f;if((e&Ye)!==0)return!0;if((e&yr)!==0){var r=t.deps,n=(e&Qe)!==0;if(r!==null){var a,i,o=(e&Bn)!==0,s=n&&j!==null&&!cr,c=r.length;if((o||s)&&(j===null||(j.f&wr)===0)){var l=t,d=l.parent;for(a=0;a<c;a++)i=r[a],(o||!i?.reactions?.includes(l))&&(i.reactions??=[]).push(l);o&&(l.f^=Bn),s&&d!==null&&(d.f&Qe)===0&&(l.f^=Qe)}for(a=0;a<c;a++)if(i=r[a],Kn(i)&&jo(i),i.wv>t.wv)return!0}(!n||j!==null&&!cr)&&Ce(t,ve)}return!1}function fs(t,e,r=!0){var n=t.reactions;if(n!==null&&!Vt?.includes(t))for(var a=0;a<n.length;a++){var i=n[a];(i.f&We)!==0?fs(i,e,!1):e===i&&(r?Ce(i,Ye):(i.f&ve)!==0&&Ce(i,yr),or(i))}}function ps(t){var e=Me,r=Xe,n=st,a=H,i=cr,o=Vt,s=Le,c=gt,l=Ar,d=t.f;Me=null,Xe=0,st=null,cr=(d&Qe)!==0&&(gt||!Zr||H===null),H=(d&(zt|kr))===0?t:null,Vt=null,ir(t.ctx),gt=!1,Ar=++pn,t.ac!==null&&(t.ac.abort(Ga),t.ac=null);try{t.f|=Va;var p=(0,t.fn)(),h=t.deps;if(Me!==null){var v;if(Xn(t,Xe),h!==null&&Xe>0)for(h.length=Xe+Me.length,v=0;v<Me.length;v++)h[Xe+v]=Me[v];else t.deps=h=Me;if(!cr||(d&We)!==0&&t.reactions!==null)for(v=Xe;v<h.length;v++)(h[v].reactions??=[]).push(t)}else h!==null&&Xe<h.length&&(Xn(t,Xe),h.length=Xe);if(Do()&&st!==null&&!gt&&h!==null&&(t.f&(We|yr|Ye))===0)for(v=0;v<st.length;v++)fs(st[v],t);return a!==null&&a!==t&&(pn++,st!==null&&(n===null?n=st:n.push(...st))),(t.f&_r)!==0&&(t.f^=_r),p}catch(m){return Tu(m)}finally{t.f^=Va,Me=e,Xe=r,st=n,H=a,cr=i,Vt=o,ir(s),gt=c,Ar=l}}function Gu(t,e){let r=e.reactions;if(r!==null){var n=nu.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&We)!==0&&(Me===null||!Me.includes(e))&&(Ce(e,yr),(e.f&(Qe|Bn))===0&&(e.f^=Bn),Bo(e),Xn(e,0))}function Xn(t,e){var r=t.deps;if(r!==null)for(var n=e;n<r.length;n++)Gu(t,r[n])}function gn(t){var e=t.f;if((e&wr)===0){Ce(t,ve);var r=j,n=Zr;j=t,Zr=!0;try{(e&un)!==0?Hu(t):ns(t),rs(t);var a=ps(t);t.teardown=typeof a=="function"?a:null,t.wv=Yn;var i;wo&&wu&&(t.f&Ye)!==0&&t.deps}finally{Zr=n,j=r}}}async function gs(){await Promise.resolve(),re()}function _(t){var e=t.f,r=(e&We)!==0;if(H!==null&&!gt){var n=j!==null&&(j.f&wr)!==0;if(!n&&!Vt?.includes(t)){var a=H.deps;if((H.f&Va)!==0)t.rv<pn&&(t.rv=pn,Me===null&&a!==null&&a[Xe]===t?Xe++:Me===null?Me=[t]:(!cr||!Me.includes(t))&&Me.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&Qe)===0&&(o.f^=Qe)}if(Er){if(Cr.has(t))return Cr.get(t);if(r){o=t;var c=o.v;return((o.f&ve)!==0||ms(o))&&(c=Qa(o)),Cr.set(o,c),c}}else if(r){if(o=t,qr?.has(o))return qr.get(o);Kn(o)&&jo(o)}if((t.f&_r)!==0)throw t.v;return t.v}function ms(t){if(t.v===he)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(Cr.has(e)||(e.f&We)!==0&&ms(e))return!0;return!1}function mt(t){var e=gt;try{return gt=!0,t()}finally{gt=e}}const Wu=-7169;function Ce(t,e){t.f=t.f&Wu|e}function Qu(t,e){if(e){const r=document.body;t.autofocus=!0,Sr(()=>{document.activeElement===r&&t.focus()})}}function Yu(t){var e=H,r=j;Ae(null),ot(null);try{return t()}finally{Ae(e),ot(r)}}const vs=new Set,ri=new Set;function bs(t,e,r,n={}){function a(i){if(n.capture||mn.call(e,i),!i.cancelBubble)return Yu(()=>r?.call(this,i))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?Sr(()=>{e.addEventListener(t,a,n)}):e.addEventListener(t,a,n),a}function Ku(t,e,r,n,a){var i={capture:n,passive:a},o=bs(t,e,r,i);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&Jo(()=>{e.removeEventListener(t,o,i)})}function ks(t){for(var e=0;e<t.length;e++)vs.add(t[e]);for(var r of ri)r(t)}function mn(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){Fr(t,"currentTarget",{configurable:!0,get(){return i||r}});var d=H,p=j;Ae(null),ot(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(ln(b)){var[A,...y]=b;A.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,Ae(d),ot(p)}}}let lt;function Xu(){lt=void 0}function Ju(t){let e=null,r=N;var n;if(N){for(e=q,lt===void 0&&(lt=it(document.head));lt!==null&&(lt.nodeType!==xr||lt.data!==Da);)lt=Ke(lt);lt===null?Te(!1):lt=be(Ke(lt))}N||(n=document.head.appendChild(jt()));try{qt(()=>t(n),Eo)}finally{r&&(Te(!0),lt=q,be(e))}}function ys(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function Ht(t,e){var r=j;r.nodes_start===null&&(r.nodes_start=t,r.nodes_end=e)}function Et(t,e){var r=(e&Xc)!==0,n=(e&Jc)!==0,a,i=!t.startsWith("<!>");return()=>{if(N)return Ht(q,null),q;a===void 0&&(a=ys(i?t:"<!>"+t),r||(a=it(a)));var o=n||Wo?document.importNode(a,!0):a.cloneNode(!0);if(r){var s=it(o),c=o.lastChild;Ht(s,c)}else Ht(o,o);return o}}function vt(){if(N)return Ht(q,null),q;var t=document.createDocumentFragment(),e=document.createComment(""),r=jt();return t.append(e,r),Ht(e,r),t}function oe(t,e){if(N){j.nodes_end=q,xt();return}t!==null&&t.before(e)}function ed(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const td=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function rd(t){return td.includes(t)}const nd={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 ad(t){return t=t.toLowerCase(),nd[t]??t}const id=["touchstart","touchmove"];function od(t){return id.includes(t)}const sd=["textarea","script","style","title"];function ld(t){return sd.includes(t)}function ws(t,e){var r=e==null?"":typeof e=="object"?e+"":e;r!==(t.__t??=t.nodeValue)&&(t.__t=r,t.nodeValue=r+"")}function _s(t,e){return xs(t,e)}function cd(t,e){Ja(),e.intro=e.intro??!1;const r=e.target,n=N,a=q;try{for(var i=it(r);i&&(i.nodeType!==xr||i.data!==Da);)i=Ke(i);if(!i)throw vr;Te(!0),be(i),xt();const o=xs(t,{...e,anchor:i});if(q===null||q.nodeType!==xr||q.data!==$a)throw dn(),vr;return Te(!1),o}catch(o){if(o===vr)return e.recover===!1&&gu(),Ja(),Ko(r),Te(!1),_s(t,e);throw o}finally{Te(n),be(a),Xu()}}const Gr=new Map;function xs(t,{target:e,anchor:r,props:n={},events:a,context:i,intro:o=!0}){Ja();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=od(v);e.addEventListener(v,mn,{passive:m});var b=Gr.get(v);b===void 0?(document.addEventListener(v,mn,{passive:m}),Gr.set(v,1)):Gr.set(v,b+1)}}};c(za(vs)),ri.add(c);var l=void 0,d=qu(()=>{var p=r??e.appendChild(jt());return fe(()=>{if(i){jr({});var h=Le;h.c=i}a&&(n.$$events=a),N&&Ht(p,null),l=t(p,n)||{},N&&(j.nodes_end=q),i&&Ur()}),()=>{for(var h of s){e.removeEventListener(h,mn);var v=Gr.get(h);--v===0?(document.removeEventListener(h,mn),Gr.delete(h)):Gr.set(h,v)}ri.delete(c),p!==r&&p.parentNode?.removeChild(p)}});return ni.set(l,d),l}let ni=new WeakMap;function ud(t,e){const r=ni.get(t);return r?(ni.delete(t),r(e)):Promise.resolve()}function Ss(t,e,...r){var n=t,a=br,i;qt(()=>{a!==(a=e())&&(i&&(ke(i),i=null),i=fe(()=>a(n,...r)))},Br),N&&(n=q)}function dd(t){Le===null&&Io(),es(()=>{const e=mt(t);if(typeof e=="function")return e})}function hd(t){Le===null&&Io(),dd(()=>()=>mt(t))}const ai=0,Jn=1,ii=2;function Ts(t,e,r,n,a){N&&xt();var i=t,o=Le,s=he,c,l,d,p=Bt(void 0),h=Bt(void 0),v=!1;function m(A,y){v=!0,y&&(ot(b),Ae(b),ir(o));try{A===ai&&r&&(c?Hr(c):c=fe(()=>r(i))),A===Jn&&n&&(l?Hr(l):l=fe(()=>n(i,p))),A!==ai&&c&&Ct(c,()=>c=null),A!==Jn&&l&&Ct(l,()=>l=null),A!==ii&&d&&Ct(d,()=>d=null)}finally{y&&(ir(null),Ae(null),ot(null),re())}}var b=qt(()=>{if(s===(s=e()))return;let A=N&&So(s)===(i.data===zn);if(A&&(i=hn(),be(i),Te(!1),A=!0),So(s)){var y=s;v=!1,y.then(k=>{y===s&&(sr(p,k),m(Jn,!0))},k=>{if(y===s)throw sr(h,k),m(ii,!0),h.v}),N?r&&(c=fe(()=>r(i))):Sr(()=>{v||m(ai,!0)})}else sr(p,s),m(Jn,!1);return A&&Te(!0),()=>s=he});N&&(i=q)}function ur(t,e,r=!1){N&&xt();var n=t,a=null,i=null,o=he,s=r?Br:0,c=!1;const l=(v,m=!0)=>{c=!0,h(m,v)};var d=null;function p(){d!==null&&(d.lastChild.remove(),n.before(d),d=null);var v=o?a:i,m=o?i:a;v&&Hr(v),m&&Ct(m,()=>{o?i=null:a=null})}const h=(v,m)=>{if(o===(o=v))return;let b=!1;if(N){const I=Oo(n)===zn;!!o===I&&(n=hn(),be(n),Te(!1),b=!0)}var A=Xo(),y=n;if(A&&(d=document.createDocumentFragment(),d.append(y=jt())),o?a??=m&&fe(()=>m(y)):i??=m&&fe(()=>m(y)),A){var k=He,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&&Te(!0)};qt(()=>{c=!1,e(l),c||h(null,null)},s),N&&(n=q)}function fd(t,e){return e}function pd(t,e,r){for(var n=t.items,a=[],i=e.length,o=0;o<i;o++)ti(e[o].e,a,!0);var s=i>0&&a.length===0&&r!==null;if(s){var c=r.parentNode;Ko(c),c.append(r),n.clear(),At(t,e[0].prev,e[i-1].next)}os(a,()=>{for(var l=0;l<i;l++){var d=e[l];s||(n.delete(d.k),At(t,d.prev,d.next)),ke(d.e,!s)}})}function gd(t,e,r,n,a,i=null){var o=t,s={flags:e,items:new Map,first:null};N&&xt();var c=null,l=!1,d=new Map,p=Fo(()=>{var b=r();return ln(b)?b:b==null?[]:za(b)}),h,v;function m(){md(v,h,s,d,o,a,e,n,r),i!==null&&(h.length===0?c?Hr(c):c=fe(()=>i(o)):c!==null&&Ct(c,()=>{c=null}))}qt(()=>{v??=j,h=_(p);var b=h.length;if(l&&b===0)return;l=b===0;let A=!1;if(N){var y=Oo(o)===zn;y!==(b===0)&&(o=hn(),be(o),Te(!1),A=!0)}if(N){for(var k=null,w,T=0;T<b;T++){if(q.nodeType===xr&&q.data===$a){o=q,A=!0,Te(!1);break}var I=h[T],U=n(I,T);w=oi(q,s,k,null,I,U,T,a,e,r),s.items.set(U,w),k=w}b>0&&be(hn())}if(N)b===0&&i&&(c=fe(()=>i(o)));else if(Xo()){var Q=new Set,je=He;for(T=0;T<b;T+=1){I=h[T],U=n(I,T);var ce=s.items.get(U)??d.get(U);ce?Cs(ce,I,T):(w=oi(null,s,null,null,I,U,T,a,e,r,!0),d.set(U,w)),Q.add(U)}for(const[pr,ae]of s.items)Q.has(pr)||je.skipped_effects.add(ae.e);je.add_callback(m)}else m();A&&Te(!0),_(p)}),N&&(o=q)}function md(t,e,r,n,a,i,o,s,c){var l=e.length,d=r.items,p=r.first,h=p,v,m=null,b=[],A=[],y,k,w,T;for(T=0;T<l;T+=1){if(y=e[T],k=s(y,T),w=d.get(k),w===void 0){var I=n.get(k);if(I!==void 0){n.delete(k),d.set(k,I);var U=m?m.next:h;At(r,m,I),At(r,I,U),si(I,U,a),m=I}else{var Q=h?h.e.nodes_start:a;m=oi(Q,r,m,m===null?r.first:m.next,y,k,T,i,o,c)}d.set(k,m),b=[],A=[],h=m.next;continue}if(Cs(w,y,T),(w.e.f&pt)!==0&&Hr(w.e),w!==h){if(v!==void 0&&v.has(w)){if(b.length<A.length){var je=A[0],ce;m=je.prev;var pr=b[0],ae=b[b.length-1];for(ce=0;ce<b.length;ce+=1)si(b[ce],je,a);for(ce=0;ce<A.length;ce+=1)v.delete(A[ce]);At(r,pr.prev,ae.next),At(r,m,pr),At(r,ae,je),h=je,m=ae,T-=1,b=[],A=[]}else v.delete(w),si(w,h,a),At(r,w.prev,w.next),At(r,w,m===null?r.first:m.next),At(r,m,w),m=w;continue}for(b=[],A=[];h!==null&&h.k!==k;)(h.e.f&pt)===0&&(v??=new Set).add(h),A.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 er=v===void 0?[]:za(v);h!==null;)(h.e.f&pt)===0&&er.push(h),h=h.next;var gr=er.length;if(gr>0){var mr=null;pd(r,er,mr)}}t.first=r.first&&r.first.e,t.last=m&&m.e;for(var rn of n.values())ke(rn.e);n.clear()}function Cs(t,e,r,n){sr(t.v,e),t.i=r}function oi(t,e,r,n,a,i,o,s,c,l,d){var p=(c&Hc)!==0,h=(c&Gc)===0,v=p?h?Ho(a,!1,!1):Bt(a):a,m=(c&Zc)===0?o:Bt(o),b={i:m,v,k:i,a:null,e:null,prev:r,next:n};try{if(t===null){var A=document.createDocumentFragment();A.append(t=jt())}return b.e=fe(()=>s(t,v,m,l),N),b.e.prev=r&&r.e,b.e.next=n&&n.e,r===null?d||(e.first=b):(r.next=b,r.e.next=b.e),n!==null&&(n.prev=b,n.e.prev=b.e),b}finally{}}function si(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=Ke(i);a.before(i),i=o}}function At(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 li(t,e,r=!1,n=!1,a=!1){var i=t,o="";Qn(()=>{var s=j;if(o===(o=e()??"")){N&&xt();return}if(s.nodes_start!==null&&(as(s.nodes_start,s.nodes_end),s.nodes_start=s.nodes_end=null),o!==""){if(N){q.data;for(var c=xt(),l=c;c!==null&&(c.nodeType!==xr||c.data!=="");)l=c,c=Ke(c);if(c===null)throw dn(),vr;Ht(q,l),i=be(c);return}var d=o+"";r?d=`<svg>${d}</svg>`:n&&(d=`<math>${d}</math>`);var p=ys(d);if((r||n)&&(p=it(p)),Ht(it(p),p.lastChild),r||n)for(;it(p);)i.before(it(p));else i.before(p)}})}function Es(t,e,r,n,a,i){let o=N;N&&xt();var s,c,l=null;N&&q.nodeType===lu&&(l=q,xt());var d=N?q:t,p;qt(()=>{const h=e()||null;var v=h==="svg"?tu:null;h!==s&&(p&&(h===null?Ct(p,()=>{p=null,c=null}):h===c?Hr(p):ke(p)),h&&h!==c&&(p=fe(()=>{if(l=N?l:v?document.createElementNS(v,h):document.createElement(h),Ht(l,l),n){N&&ld(h)&&l.append(document.createComment(""));var m=N?it(l):l.appendChild(jt());N&&(m===null?Te(!1):be(m)),n(l,m)}j.nodes_end=l,d.before(l)})),s=h,s&&(c=s))},Br),o&&(Te(!0),be(d))}function vd(t,e){Sr(()=>{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 As(t,e,r){Wn(()=>{var n=mt(()=>e(t,r?.())||{});if(n?.destroy)return()=>n.destroy()})}function bd(t,e){var r=void 0,n;qt(()=>{r!==(r=e())&&(n&&(ke(n),n=null),r&&(n=fe(()=>{Wn(()=>r(t))})))})}function Rs(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=Rs(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function kd(){for(var t,e,r=0,n="",a=arguments.length;r<a;r++)(t=arguments[r])&&(e=Rs(t))&&(n&&(n+=" "),n+=e);return n}function yd(t){return typeof t=="object"?kd(t):t??""}const Is=[...`
|
|
2
|
-
\r\f \v\uFEFF`];function wd(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||Is.includes(n[o-1]))&&(s===n.length||Is.includes(n[s]))?n=(o===0?"":n.substring(0,o))+n.substring(s+1):o=s}}return n===""?null:n}function Ls(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 ci(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function _d(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(ci)),a&&c.push(...Object.keys(a).map(ci));var l=0,d=-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===":"&&d===-1)d=p;else if(h===";"||p===b-1){if(d!==-1){var v=ci(t.substring(l,d).trim());if(!c.includes(v)){h!==";"&&p++;var m=t.substring(l,p).trim();r+=" "+m+";"}}l=p+1,d=-1}}}}return n&&(r+=Ls(n)),a&&(r+=Ls(a,!0)),r=r.trim(),r===""?null:r}return t==null?null:String(t)}function xd(t,e,r,n,a,i){var o=t.__className;if(N||o!==r||o===void 0){var s=wd(r,n,i);(!N||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 ui(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 Sd(t,e,r,n){var a=t.__style;if(N||a!==e){var i=_d(e,n);(!N||i!==t.getAttribute("style"))&&(i==null?t.removeAttribute("style"):t.style.cssText=i),t.__style=e}else n&&(Array.isArray(n)?(ui(t,r?.[0],n[0]),ui(t,r?.[1],n[1],"important")):ui(t,r,n));return n}function di(t,e,r=!1){if(t.multiple){if(e==null)return;if(!ln(e))return yu();for(var n of t.options)n.selected=e.includes(Os(n));return}for(n of t.options){var a=Os(n);if(zu(a,e)){n.selected=!0;return}}(!r||e!==void 0)&&(t.selectedIndex=-1)}function Td(t){var e=new MutationObserver(()=>{di(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Jo(()=>{e.disconnect()})}function Os(t){return"__value"in t?t.__value:t.value}const Wr=Symbol("class"),vn=Symbol("style"),Ms=Symbol("is custom element"),Ns=Symbol("is html");function Cd(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function hi(t,e,r,n){var a=Ds(t);N&&(a[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")||a[e]!==(a[e]=r)&&(e==="loading"&&(t[su]=r),r==null?t.removeAttribute(e):typeof r!="string"&&zs(t).includes(e)?t[e]=r:t.setAttribute(e,r))}function Ed(t,e,r,n,a=!1){var i=Ds(t),o=i[Ms],s=!i[Ns];let c=N&&o;c&&Te(!1);var l=e||{},d=t.tagName==="OPTION";for(var p in e)p in r||(r[p]=null);r.class?r.class=yd(r.class):r[Wr]&&(r.class=null),r[vn]&&(r.style??=null);var h=zs(t);for(const w in r){let T=r[w];if(d&&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";xd(t,v,T,n,e?.[Wr],r[Wr]),l[w]=T,l[Wr]=r[Wr];continue}if(w==="style"){Sd(t,T,e?.[vn],r[vn]),l[w]=T,l[vn]=r[vn];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 I={},U="$$"+w;let Q=w.slice(2);var A=rd(Q);if(ed(Q)&&(Q=Q.slice(0,-7),I.capture=!0),!A&&m){if(T!=null)continue;t.removeEventListener(Q,l[U],I),l[U]=null}if(T!=null)if(A)t[`__${Q}`]=T,ks([Q]);else{let je=function(ce){l[w].call(this,ce)};l[U]=bs(Q,t,je,I)}else A&&(t[`__${Q}`]=void 0)}else if(w==="style")hi(t,w,T);else if(w==="autofocus")Qu(t,!!T);else if(!o&&(w==="__value"||w==="value"&&T!=null))t.value=t.__value=T;else if(w==="selected"&&d)Cd(t,T);else{var y=w;s||(y=ad(y));var k=y==="defaultValue"||y==="defaultChecked";if(T==null&&!o&&!k)if(i[w]=null,y==="value"||y==="checked"){let I=t;const U=e===void 0;if(y==="value"){let Q=I.defaultValue;I.removeAttribute(y),I.defaultValue=Q,I.value=I.__value=U?Q:null}else{let Q=I.defaultChecked;I.removeAttribute(y),I.defaultChecked=Q,I.checked=U?Q:!1}}else t.removeAttribute(w);else k||h.includes(y)&&(o||typeof T!="string")?t[y]=T:typeof T!="function"&&hi(t,y,T)}}}return c&&Te(!0),l}function Ps(t,e,r=[],n=[],a,i=!1){Uo(r,n,o=>{var s=void 0,c={},l=t.nodeName==="SELECT",d=!1;if(qt(()=>{var h=e(...o.map(_)),v=Ed(t,s,h,a,i);d&&l&&"value"in h&&di(t,h.value);for(let b of Object.getOwnPropertySymbols(c))h[b]||ke(c[b]);for(let b of Object.getOwnPropertySymbols(h)){var m=h[b];b.description===ru&&(!s||m!==s[b])&&(c[b]&&ke(c[b]),c[b]=fe(()=>bd(t,()=>m))),v[b]=m}s=v}),l){var p=t;Wn(()=>{di(p,s.value,!0),Td(p)})}d=!0})}function Ds(t){return t.__attributes??={[Ms]:t.nodeName.includes("-"),[Ns]:t.namespaceURI===eu}}var $s=new Map;function zs(t){var e=$s.get(t.nodeName);if(e)return e;$s.set(t.nodeName,e=[]);for(var r,n=t,a=Element.prototype;a!==n;){r=au(n);for(var i in r)r[i].set&&e.push(i);n=Fa(n)}return e}function Fs(t,e){return t===e||t?.[ar]===e}function Bs(t={},e,r,n){return Wn(()=>{var a,i;return ei(()=>{a=i,i=[],mt(()=>{t!==r(...i)&&(e(t,...i),a&&Fs(r(...a),t)&&e(null,...a))})}),()=>{Sr(()=>{i&&Fs(r(...i),t)&&e(null,...i)})}}),t}const Qr=[];function Ad(t,e=br){let r=null;const n=new Set;function a(s){if(No(t,s)&&(t=s,r)){const c=!Qr.length;for(const l of n)l[1](),Qr.push(l,t);if(c){for(let l=0;l<Qr.length;l+=2)Qr[l][0](Qr[l+1]);Qr.length=0}}}function i(s){a(s(t))}function o(s,c=br){const l=[s,c];return n.add(l),n.size===1&&(r=e(a,i)||br),s(t),()=>{n.delete(l),n.size===0&&r&&(r(),r=null)}}return{set:a,update:i,subscribe:o}}let ea=!1;function Rd(t){var e=ea;try{return ea=!1,[t(),ea]}finally{ea=e}}const Id={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 fi(t,e,r){return new Proxy({props:t,exclude:e},Id)}const Ld={get(t,e){let r=t.props.length;for(;r--;){let n=t.props[r];if(cn(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];cn(a)&&(a=a());const i=$t(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(cn(n)&&(n=n()),typeof n=="object"&&n!==null&&e in n){const a=$t(n,e);return a&&!a.configurable&&(a.configurable=!0),a}}},has(t,e){if(e===ar||e===Za)return!1;for(let r of t.props)if(cn(r)&&(r=r()),r!=null&&e in r)return!0;return!1},ownKeys(t){const e=[];for(let r of t.props)if(cn(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 Od(...t){return new Proxy({props:t},Ld)}function se(t,e,r,n){var a=(r&Yc)!==0,i=(r&Kc)!==0,o=n,s=!0,c=()=>(s&&(s=!1,o=i?mt(n):n),o),l;if(a){var d=ar in t||Za in t;l=$t(t,e)?.set??(d&&e in t?k=>t[e]=k:void 0)}var p,h=!1;a?[p,h]=Rd(()=>t[e]):p=t[e],p===void 0&&n!==void 0&&(p=c(),l&&(mu(),l(p)));var v;if(v=()=>{var k=t[e];return k===void 0?c():(s=!0,k)},(r&Qc)===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,A=((r&Wc)!==0?Vn:Fo)(()=>(b=!1,v()));a&&_(A);var y=j;return function(k,w){if(arguments.length>0){const T=w?_(A):a?St(k):k;return $(A,T),b=!0,o!==void 0&&(o=T),k}return Er&&b||(y.f&wr)!==0?A.v:_(A)}}function Md(t){return new Nd(t)}class Nd{#e;#t;constructor(e){var r=new Map,n=(i,o)=>{var s=Ho(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===Za?!0:(_(r.get(o)??n(o,Reflect.get(i,o))),Reflect.has(i,o))},set(i,o,s){return $(r.get(o)??n(o,s),s),Reflect.set(i,o,s)}});this.#t=(e.hydrate?cd:_s)(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)&&re(),this.#e=a.$$events;for(const i of Object.keys(this.#t))i==="$set"||i==="$destroy"||i==="$on"||Fr(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=()=>{ud(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 js;typeof HTMLElement=="function"&&(js=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),oe(a,i)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const e={},r=Pd(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]=ta(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=Md({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:e,$$host:this}}),this.$$me=Uu(()=>{ei(()=>{this.$$r=!0;for(const n of Fn(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];const a=ta(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]=ta(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 Fn(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});function ta(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 Pd(t){const e={};return t.childNodes.forEach(r=>{e[r.slot||"default"]=!0}),e}function bn(t,e,r,n,a,i){let o=class extends js{constructor(){super(t,r,a),this.$$p_d=e}static get observedAttributes(){return Fn(e).map(s=>(e[s].attribute||s).toLowerCase())}};return Fn(e).forEach(s=>{Fr(o.prototype,s,{get(){return this.$$c&&s in this.$$c?this.$$c[s]:this.$$d[s]},set(c){c=ta(s,c,e),this.$$d[s]=c;var l=this.$$c;if(l){var d=$t(l,s)?.get;d?l[s]=c:l.$set({[s]:c})}}})}),n.forEach(s=>{Fr(o.prototype,s,{get(){return this.$$c?.[s]}})}),t.element=o,o}var Dd=(t,e)=>e()(),$d=Et('<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>'),zd=Et(" <!>",1);const Fd={hash:"svelte-4thrqu",code:`
|
|
1
|
+
var LiipGPTButton=function(sn){"use strict";const Gc="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(Gc);const Wc=1,Qc=2,Yc=16,Kc=1,Xc=4,Jc=8,eu=16,tu=1,ru=2,Da="[",zn="[!",$a="]",vr={},he=Symbol(),nu="http://www.w3.org/1999/xhtml",au="http://www.w3.org/2000/svg",iu="@attach",wo=!1;var ln=Array.isArray,ou=Array.prototype.indexOf,za=Array.from,Fn=Object.keys,Fr=Object.defineProperty,$t=Object.getOwnPropertyDescriptor,su=Object.getOwnPropertyDescriptors,_o=Object.prototype,lu=Array.prototype,Fa=Object.getPrototypeOf,xo=Object.isExtensible;function cn(t){return typeof t=="function"}const br=()=>{};function So(t){return typeof t?.then=="function"}function To(t){for(var e=0;e<t.length;e++)t[e]()}function cu(){var t,e,r=new Promise((n,a)=>{t=n,e=a});return{promise:r,resolve:t,reject:e}}const We=2,Ba=4,ja=8,un=16,zt=32,kr=64,Ua=128,Qe=256,Bn=512,ve=1024,Ye=2048,yr=4096,pt=8192,wr=16384,qa=32768,Br=65536,Eo=1<<17,Co=1<<18,jn=1<<19,Ao=1<<20,Va=1<<21,Ha=1<<22,_r=1<<23,ar=Symbol("$state"),Za=Symbol("legacy props"),uu=Symbol(""),Ga=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},du=1,Ro=3,xr=8;function hu(){throw new Error("https://svelte.dev/e/await_outside_boundary")}function Io(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function fu(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function pu(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function gu(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function mu(t){throw new Error("https://svelte.dev/e/effect_orphan")}function vu(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function bu(){throw new Error("https://svelte.dev/e/hydration_failed")}function ku(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function yu(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function wu(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function _u(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function dn(t){console.warn("https://svelte.dev/e/hydration_mismatch")}function xu(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}let N=!1;function Te(t){N=t}let q;function be(t){if(t===null)throw dn(),vr;return q=t}function xt(){return be(Ke(q))}function Ft(t){if(N){if(Ke(q)!==null)throw dn(),vr;q=t}}function Lo(t=1){if(N){for(var e=t,r=q;e--;)r=Ke(r);q=r}}function hn(){for(var t=0,e=q;;){if(e.nodeType===xr){var r=e.data;if(r===$a){if(t===0)return e;t-=1}else(r===Da||r===zn)&&(t+=1)}var n=Ke(e);e.remove(),e=n}}function Oo(t){if(!t||t.nodeType!==xr)throw dn(),vr;return t.data}function Mo(t){return t===this.v}function No(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Po(t){return!No(t,this.v)}let Su=!1;const Tu=[];function Eu(t,e=!1){return Un(t,new Map,"",Tu)}function Un(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(ln(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]=Un(c,e,r,n))}return o}if(Fa(t)===_o){o={},e.set(t,o),a!==null&&e.set(a,o);for(var l in t)o[l]=Un(t[l],e,r,n);return o}if(t instanceof Date)return structuredClone(t);if(typeof t.toJSON=="function")return Un(t.toJSON(),e,r,n,t)}if(t instanceof EventTarget)return t;try{return structuredClone(t)}catch{return t}}let Le=null;function ir(t){Le=t}function jr(t,e=!1,r){Le={p:Le,c:null,e:null,s:t,x:null,l:null}}function Ur(t){var e=Le,r=e.e;if(r!==null){e.e=null;for(var n of r)ts(n)}return t!==void 0&&(e.x=t),Le=e.p,t??{}}function Do(){return!0}const Cu=new WeakMap;function Au(t){var e=j;if(e===null)return H.f|=_r,t;if((e.f&qa)===0){if((e.f&Ua)===0)throw!e.parent&&t instanceof Error&&$o(t),t;e.b.error(t)}else qn(t,e)}function qn(t,e){for(;e!==null;){if((e.f&Ua)!==0)try{e.b.error(t);return}catch{}e=e.parent}throw t instanceof Error&&$o(t),t}function $o(t){const e=Cu.get(t);e&&(Fr(t,"message",{value:e.message}),Fr(t,"stack",{value:e.stack}))}let fn=[],Wa=[];function zo(){var t=fn;fn=[],To(t)}function Ru(){var t=Wa;Wa=[],To(t)}function Sr(t){fn.length===0&&queueMicrotask(zo),fn.push(t)}function Iu(){fn.length>0&&zo(),Wa.length>0&&Ru()}function Lu(t){let e=0,r=Bt(0),n;return()=>{Vu()&&(_(r),ei(()=>(e===0&&(n=mt(()=>t(()=>Gn(r)))),e+=1,()=>{Sr(()=>{e-=1,e===0&&(n?.(),n=void 0)})})))}}var Ou=Br|jn|Ua;function Mu(t,e,r){new Nu(t,e,r)}class Nu{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&&sr(this.#d,this.#n)};#h=Lu(()=>(this.#d=Bt(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=qt(()=>{j.b=this,N&&xt();const a=this.#a.pending;if(N&&a)this.#r=fe(()=>a(this.#e)),queueMicrotask(()=>{this.#i=this.#p(()=>(Tr.ensure(),fe(()=>this.#l(this.#e)))),this.#n>0?this.#g():(Et(this.#r,()=>{this.#r=null}),this.pending=!1)});else{try{this.#i=fe(()=>n(this.#e))}catch(i){this.error(i)}this.#n>0?this.#g():this.pending=!1}},Ou),N&&(this.#e=q)}has_pending_snippet(){return!!this.#a.pending}#p(e){var r=j,n=H,a=Le;ot(this.#u),Ae(this.#u),ir(this.#u.ctx);try{return e()}finally{ot(r),Ae(n),ir(a)}}#g(){const e=this.#a.pending;this.#i!==null&&(this.#s=document.createDocumentFragment(),Pu(this.#i,this.#s)),this.#r===null&&(this.#r=fe(()=>e(this.#e)))}#m(e){this.#n+=e,this.#n===0&&(this.pending=!1,this.#r&&Et(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),Ya.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&&Et(this.#o,()=>{this.#o=null}),this.pending=!0,this.#i=this.#p(()=>(this.#c=!1,fe(()=>this.#l(this.#e)))),this.#n>0?this.#g():this.pending=!1};if(this.#c||!r&&!n)throw e;var i=H;try{Ae(null),r?.(e,a)}finally{Ae(i)}this.#i&&(ke(this.#i),this.#i=null),this.#r&&(ke(this.#r),this.#r=null),this.#o&&(ke(this.#o),this.#o=null),N&&(be(this.#t),Lo(),be(hn())),n&&Sr(()=>{this.#o=this.#p(()=>{this.#c=!0;try{return fe(()=>{n(this.#e,()=>e,()=>a)})}catch(o){return qn(o,this.#u.parent),null}finally{this.#c=!1}})})}}function Pu(t,e){for(var r=t.nodes_start,n=t.nodes_end;r!==null;){var a=r===n?null:Ke(r);e.append(r),r=a}}function Du(){for(var t=j.b;t!==null&&!t.has_pending_snippet();)t=t.parent;return t===null&&hu(),t}function Vn(t){var e=We|Ye,r=H!==null&&(H.f&We)!==0?H:null;return j===null||r!==null&&(r.f&Qe)!==0?e|=Qe:j.f|=jn,{ctx:Le,deps:null,effects:null,equals:Mo,f:e,fn:t,reactions:null,rv:0,v:he,wv:0,parent:r??j,ac:null}}function $u(t,e){let r=j;r===null&&fu();var n=r.b,a=void 0,i=Bt(he),o=null,s=!H;return Gu(()=>{try{var c=t()}catch(v){c=Promise.reject(v)}var l=()=>c;a=o?.then(l,l)??Promise.resolve(c),o=a;var d=He,p=n.pending;s&&(n.update_pending_count(1),p||d.increment());const h=(v,m=void 0)=>{o=null,p||d.activate(),m?m!==Ga&&(i.f|=_r,sr(i,m)):((i.f&_r)!==0&&(i.f^=_r),sr(i,v)),s&&(n.update_pending_count(-1),p||d.decrement()),qo()};if(a.then(h,v=>h(null,v||"unknown")),d)return()=>{queueMicrotask(()=>d.neuter())}}),new Promise(c=>{function l(d){function p(){d===a?c(i):l(a)}d.then(p,p)}l(a)})}function ee(t){const e=Vn(t);return us(e),e}function Fo(t){const e=Vn(t);return e.equals=Po,e}function Bo(t){var e=t.effects;if(e!==null){t.effects=null;for(var r=0;r<e.length;r+=1)ke(e[r])}}function zu(t){for(var e=t.parent;e!==null;){if((e.f&We)===0)return e;e=e.parent}return null}function Qa(t){var e,r=j;ot(zu(t));try{Bo(t),e=ps(t)}finally{ot(r)}return e}function jo(t){var e=Qa(t);if(t.equals(e)||(t.v=e,t.wv=hs()),!Cr)if(qr!==null)qr.set(t,t.v);else{var r=(cr||(t.f&Qe)!==0)&&t.deps!==null?yr:ve;Ee(t,r)}}function Uo(t,e,r){const n=Vn;if(e.length===0){r(t.map(n));return}var a=He,i=j,o=Fu(),s=Du();Promise.all(e.map(c=>$u(c))).then(c=>{a?.activate(),o();try{r([...t.map(n),...c])}catch(l){(i.f&wr)===0&&qn(l,i)}a?.deactivate(),qo()}).catch(c=>{s.error(c)})}function Fu(){var t=j,e=H,r=Le;return function(){ot(t),Ae(e),ir(r)}}function qo(){ot(null),Ae(null),ir(null)}const Hn=new Set;let He=null,qr=null,Ya=new Set,Vr=[],Zn=null,Ka=!1;class Tr{#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){Vr=[];var r=null;if(Hn.size>1){r=new Map,qr=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 Hn)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(),Vo(n),Vo(a),this.#u?.resolve()}else{for(const i of this.#s)Ee(i,ve);for(const i of this.#n)Ee(i,ve);for(const i of this.#c)Ee(i,ve)}if(r){for(const[i,{v:o,wv:s}]of r)i.wv<=s&&(i.v=o);qr=null}for(const i of this.#r)gn(i);for(const i of this.#o)gn(i);this.#r=[],this.#o=[]}#f(e){e.f^=ve;for(var r=e.first;r!==null;){var n=r.f,a=(n&(zt|kr))!==0,i=a&&(n&ve)!==0,o=i||(n&pt)!==0||this.skipped_effects.has(r);if(!o&&r.fn!==null){if(a)r.f^=ve;else if((n&Ba)!==0)this.#n.push(r);else if(Kn(r))if((n&Ha)!==0){var s=r.b?.pending?this.#o:this.#r;s.push(r)}else(r.f&un)!==0&&this.#c.push(r),gn(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(){He=this}deactivate(){He=null;for(const e of Ya)if(Ya.delete(e),e(),He!==null)break}neuter(){this.#i=!0}flush(){Vr.length>0?this.flush_effects():this.#h(),He===this&&(this.#l===0&&Hn.delete(this),this.deactivate())}flush_effects(){var e=Zr;Ka=!0;try{var r=0;for(ls(!0);Vr.length>0;){if(r++>1e3){var n,a;Bu()}this.#d(Vr),Er.clear()}}finally{Ka=!1,ls(e),Zn=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)Ee(e,Ye),or(e);for(const e of this.#n)Ee(e,Ye),or(e);for(const e of this.#c)Ee(e,Ye),or(e);this.#s=[],this.#n=[],this.flush()}else this.deactivate()}add_callback(e){this.#a.add(e)}settled(){return(this.#u??=cu()).promise}static ensure(e=!0){if(He===null){const r=He=new Tr;Hn.add(He),e&&queueMicrotask(()=>{He===r&&r.flush()})}return He}}function re(t){var e;const r=Tr.ensure(!1);for(;;){if(Iu(),Vr.length===0)return r===He&&r.flush(),Zn=null,e;r.flush_effects()}}function Bu(){try{vu()}catch(t){qn(t,Zn)}}function Vo(t){var e=t.length;if(e!==0){for(var r=0;r<e;r++){var n=t[r];if((n.f&(wr|pt))===0&&Kn(n)){var a=Yn;if(gn(n),n.deps===null&&n.first===null&&n.nodes_start===null&&(n.teardown===null?is(n):n.fn=null),Yn>a&&(n.f&Ao)!==0)break}}for(;r<e;r+=1)or(t[r])}}function or(t){for(var e=Zn=t;e.parent!==null;){e=e.parent;var r=e.f;if(Ka&&e===j&&(r&un)!==0)return;if((r&(kr|zt))!==0){if((r&ve)===0)return;e.f^=ve}}Vr.push(e)}const Er=new Map;function Bt(t,e){var r={f:0,v:t,reactions:null,equals:Mo,rv:0,wv:0};return r}function te(t,e){const r=Bt(t);return us(r),r}function Ho(t,e=!1,r=!0){const n=Bt(t);return e||(n.equals=Po),n}function $(t,e,r=!1){H!==null&&(!gt||(H.f&Eo)!==0)&&Do()&&(H.f&(We|un|Ha|Eo))!==0&&!Vt?.includes(t)&&_u();let n=r?St(e):e;return sr(t,n)}function sr(t,e){if(!t.equals(e)){var r=t.v;Cr?Er.set(t,e):Er.set(t,r),t.v=e,Tr.ensure().capture(t,r),(t.f&We)!==0&&((t.f&Ye)!==0&&Qa(t),Ee(t,(t.f&Qe)===0?ve:yr)),t.wv=hs(),Zo(t,Ye),j!==null&&(j.f&ve)!==0&&(j.f&(zt|kr))===0&&(st===null?Qu([t]):st.push(t))}return e}function Gn(t){$(t,t.v+1)}function Zo(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&Ye)===0&&(Ee(i,e),(o&(ve|Qe))!==0&&((o&We)!==0?Zo(i,yr):or(i)))}}function St(t){if(typeof t!="object"||t===null||ar in t)return t;const e=Fa(t);if(e!==_o&&e!==lu)return t;var r=new Map,n=ln(t),a=te(0),i=Ar,o=s=>{if(Ar===i)return s();var c=H,l=Ar;Ae(null),ds(i);var d=s();return Ae(c),ds(l),d};return n&&r.set("length",te(t.length)),new Proxy(t,{defineProperty(s,c,l){(!("value"in l)||l.configurable===!1||l.enumerable===!1||l.writable===!1)&&yu();var d=r.get(c);return d===void 0?d=o(()=>{var p=te(l.value);return r.set(c,p),p}):$(d,l.value,!0),!0},deleteProperty(s,c){var l=r.get(c);if(l===void 0){if(c in s){const d=o(()=>te(he));r.set(c,d),Gn(a)}}else $(l,he),Gn(a);return!0},get(s,c,l){if(c===ar)return t;var d=r.get(c),p=c in s;if(d===void 0&&(!p||$t(s,c)?.writable)&&(d=o(()=>{var v=St(p?s[c]:he),m=te(v);return m}),r.set(c,d)),d!==void 0){var h=_(d);return h===he?void 0:h}return Reflect.get(s,c,l)},getOwnPropertyDescriptor(s,c){var l=Reflect.getOwnPropertyDescriptor(s,c);if(l&&"value"in l){var d=r.get(c);d&&(l.value=_(d))}else if(l===void 0){var p=r.get(c),h=p?.v;if(p!==void 0&&h!==he)return{enumerable:!0,configurable:!0,value:h,writable:!0}}return l},has(s,c){if(c===ar)return!0;var l=r.get(c),d=l!==void 0&&l.v!==he||Reflect.has(s,c);if(l!==void 0||j!==null&&(!d||$t(s,c)?.writable)){l===void 0&&(l=o(()=>{var h=d?St(s[c]):he,v=te(h);return v}),r.set(c,l));var p=_(l);if(p===he)return!1}return d},set(s,c,l,d){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?$(m,he):v in s&&(m=o(()=>te(he)),r.set(v+"",m))}if(p===void 0)(!h||$t(s,c)?.writable)&&(p=o(()=>te(void 0)),$(p,St(l)),r.set(c,p));else{h=p.v!==he;var b=o(()=>St(l));$(p,b)}var A=Reflect.getOwnPropertyDescriptor(s,c);if(A?.set&&A.set.call(d,l),!h){if(n&&typeof c=="string"){var y=r.get("length"),k=Number(c);Number.isInteger(k)&&k>=y.v&&$(y,k+1)}Gn(a)}return!0},ownKeys(s){_(a);var c=Reflect.ownKeys(s).filter(p=>{var h=r.get(p);return h===void 0||h.v!==he});for(var[l,d]of r)d.v!==he&&!(l in s)&&c.push(l);return c},setPrototypeOf(){wu()}})}function Go(t){try{if(t!==null&&typeof t=="object"&&ar in t)return t[ar]}catch{}return t}function ju(t,e){return Object.is(Go(t),Go(e))}var Xa,Wo,Qo,Yo;function Ja(){if(Xa===void 0){Xa=window,Wo=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,r=Text.prototype;Qo=$t(e,"firstChild").get,Yo=$t(e,"nextSibling").get,xo(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),xo(r)&&(r.__t=void 0)}}function jt(t=""){return document.createTextNode(t)}function it(t){return Qo.call(t)}function Ke(t){return Yo.call(t)}function Ut(t,e){if(!N)return it(t);var r=it(q);if(r===null)r=q.appendChild(jt());else if(e&&r.nodeType!==Ro){var n=jt();return r?.before(n),be(n),n}return be(r),r}function Oe(t,e){if(!N){var r=it(t);return r instanceof Comment&&r.data===""?Ke(r):r}return q}function lr(t,e=1,r=!1){let n=N?q:t;for(var a;e--;)a=n,n=Ke(n);if(!N)return n;if(r&&n?.nodeType!==Ro){var i=jt();return n===null?a?.after(i):n.before(i),be(i),i}return be(n),n}function Ko(t){t.textContent=""}function Xo(){return!1}function Uu(t){j===null&&H===null&&mu(),H!==null&&(H.f&Qe)!==0&&j===null&&gu(),Cr&&pu()}function qu(t,e){var r=e.last;r===null?e.last=e.first=t:(r.next=t,t.prev=r,e.last=t)}function Tt(t,e,r,n=!0){var a=j;a!==null&&(a.f&pt)!==0&&(t|=pt);var i={ctx:Le,deps:null,nodes_start:null,nodes_end:null,f:t|Ye,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{gn(i),i.f|=qa}catch(c){throw ke(i),c}else e!==null&&or(i);var o=r&&i.deps===null&&i.first===null&&i.nodes_start===null&&i.teardown===null&&(i.f&jn)===0;if(!o&&n&&(a!==null&&qu(i,a),H!==null&&(H.f&We)!==0)){var s=H;(s.effects??=[]).push(i)}return i}function Vu(){return H!==null&&!gt}function Jo(t){const e=Tt(ja,null,!1);return Ee(e,ve),e.teardown=t,e}function es(t){Uu();var e=j.f,r=!H&&(e&zt)!==0&&(e&qa)===0;if(r){var n=Le;(n.e??=[]).push(t)}else return ts(t)}function ts(t){return Tt(Ba|Ao,t,!1)}function Hu(t){Tr.ensure();const e=Tt(kr,t,!0);return()=>{ke(e)}}function Zu(t){Tr.ensure();const e=Tt(kr,t,!0);return(r={})=>new Promise(n=>{r.outro?Et(e,()=>{ke(e),n(void 0)}):(ke(e),n(void 0))})}function Wn(t){return Tt(Ba,t,!1)}function Gu(t){return Tt(Ha|jn,t,!0)}function ei(t,e=0){return Tt(ja|e,t,!0)}function Qn(t,e=[],r=[]){Uo(e,r,n=>{Tt(ja,()=>t(...n.map(_)),!0)})}function qt(t,e=0){var r=Tt(un|e,t,!0);return r}function fe(t,e=!0){return Tt(zt,t,!0,e)}function rs(t){var e=t.teardown;if(e!==null){const r=Cr,n=H;cs(!0),Ae(null);try{e.call(null)}finally{cs(r),Ae(n)}}}function ns(t,e=!1){var r=t.first;for(t.first=t.last=null;r!==null;){r.ac?.abort(Ga);var n=r.next;(r.f&kr)!==0?r.parent=null:ke(r,e),r=n}}function Wu(t){for(var e=t.first;e!==null;){var r=e.next;(e.f&zt)===0&&ke(e),e=r}}function ke(t,e=!0){var r=!1;(e||(t.f&Co)!==0)&&t.nodes_start!==null&&t.nodes_end!==null&&(as(t.nodes_start,t.nodes_end),r=!0),ns(t,e&&!r),Xn(t,0),Ee(t,wr);var n=t.transitions;if(n!==null)for(const i of n)i.stop();rs(t);var a=t.parent;a!==null&&a.first!==null&&is(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes_start=t.nodes_end=t.ac=null}function as(t,e){for(;t!==null;){var r=t===e?null:Ke(t);t.remove(),t=r}}function is(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 Et(t,e){var r=[];ti(t,r,!0),os(r,()=>{ke(t),e&&e()})}function os(t,e){var r=t.length;if(r>0){var n=()=>--r||e();for(var a of t)a.out(n)}else e()}function ti(t,e,r){if((t.f&pt)===0){if(t.f^=pt,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&Br)!==0||(n.f&zt)!==0;ti(n,e,i?r:!1),n=a}}}function Hr(t){ss(t,!0)}function ss(t,e){if((t.f&pt)!==0){t.f^=pt,(t.f&ve)===0&&(Ee(t,Ye),or(t));for(var r=t.first;r!==null;){var n=r.next,a=(r.f&Br)!==0||(r.f&zt)!==0;ss(r,a?e:!1),r=n}if(t.transitions!==null)for(const i of t.transitions)(i.is_global||e)&&i.in()}}let Zr=!1;function ls(t){Zr=t}let Cr=!1;function cs(t){Cr=t}let H=null,gt=!1;function Ae(t){H=t}let j=null;function ot(t){j=t}let Vt=null;function us(t){H!==null&&(Vt===null?Vt=[t]:Vt.push(t))}let Me=null,Xe=0,st=null;function Qu(t){st=t}let Yn=1,pn=0,Ar=pn;function ds(t){Ar=t}let cr=!1;function hs(){return++Yn}function Kn(t){var e=t.f;if((e&Ye)!==0)return!0;if((e&yr)!==0){var r=t.deps,n=(e&Qe)!==0;if(r!==null){var a,i,o=(e&Bn)!==0,s=n&&j!==null&&!cr,c=r.length;if((o||s)&&(j===null||(j.f&wr)===0)){var l=t,d=l.parent;for(a=0;a<c;a++)i=r[a],(o||!i?.reactions?.includes(l))&&(i.reactions??=[]).push(l);o&&(l.f^=Bn),s&&d!==null&&(d.f&Qe)===0&&(l.f^=Qe)}for(a=0;a<c;a++)if(i=r[a],Kn(i)&&jo(i),i.wv>t.wv)return!0}(!n||j!==null&&!cr)&&Ee(t,ve)}return!1}function fs(t,e,r=!0){var n=t.reactions;if(n!==null&&!Vt?.includes(t))for(var a=0;a<n.length;a++){var i=n[a];(i.f&We)!==0?fs(i,e,!1):e===i&&(r?Ee(i,Ye):(i.f&ve)!==0&&Ee(i,yr),or(i))}}function ps(t){var e=Me,r=Xe,n=st,a=H,i=cr,o=Vt,s=Le,c=gt,l=Ar,d=t.f;Me=null,Xe=0,st=null,cr=(d&Qe)!==0&&(gt||!Zr||H===null),H=(d&(zt|kr))===0?t:null,Vt=null,ir(t.ctx),gt=!1,Ar=++pn,t.ac!==null&&(t.ac.abort(Ga),t.ac=null);try{t.f|=Va;var p=(0,t.fn)(),h=t.deps;if(Me!==null){var v;if(Xn(t,Xe),h!==null&&Xe>0)for(h.length=Xe+Me.length,v=0;v<Me.length;v++)h[Xe+v]=Me[v];else t.deps=h=Me;if(!cr||(d&We)!==0&&t.reactions!==null)for(v=Xe;v<h.length;v++)(h[v].reactions??=[]).push(t)}else h!==null&&Xe<h.length&&(Xn(t,Xe),h.length=Xe);if(Do()&&st!==null&&!gt&&h!==null&&(t.f&(We|yr|Ye))===0)for(v=0;v<st.length;v++)fs(st[v],t);return a!==null&&a!==t&&(pn++,st!==null&&(n===null?n=st:n.push(...st))),(t.f&_r)!==0&&(t.f^=_r),p}catch(m){return Au(m)}finally{t.f^=Va,Me=e,Xe=r,st=n,H=a,cr=i,Vt=o,ir(s),gt=c,Ar=l}}function Yu(t,e){let r=e.reactions;if(r!==null){var n=ou.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&We)!==0&&(Me===null||!Me.includes(e))&&(Ee(e,yr),(e.f&(Qe|Bn))===0&&(e.f^=Bn),Bo(e),Xn(e,0))}function Xn(t,e){var r=t.deps;if(r!==null)for(var n=e;n<r.length;n++)Yu(t,r[n])}function gn(t){var e=t.f;if((e&wr)===0){Ee(t,ve);var r=j,n=Zr;j=t,Zr=!0;try{(e&un)!==0?Wu(t):ns(t),rs(t);var a=ps(t);t.teardown=typeof a=="function"?a:null,t.wv=Yn;var i;wo&&Su&&(t.f&Ye)!==0&&t.deps}finally{Zr=n,j=r}}}async function gs(){await Promise.resolve(),re()}function _(t){var e=t.f,r=(e&We)!==0;if(H!==null&&!gt){var n=j!==null&&(j.f&wr)!==0;if(!n&&!Vt?.includes(t)){var a=H.deps;if((H.f&Va)!==0)t.rv<pn&&(t.rv=pn,Me===null&&a!==null&&a[Xe]===t?Xe++:Me===null?Me=[t]:(!cr||!Me.includes(t))&&Me.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&Qe)===0&&(o.f^=Qe)}if(Cr){if(Er.has(t))return Er.get(t);if(r){o=t;var c=o.v;return((o.f&ve)!==0||ms(o))&&(c=Qa(o)),Er.set(o,c),c}}else if(r){if(o=t,qr?.has(o))return qr.get(o);Kn(o)&&jo(o)}if((t.f&_r)!==0)throw t.v;return t.v}function ms(t){if(t.v===he)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(Er.has(e)||(e.f&We)!==0&&ms(e))return!0;return!1}function mt(t){var e=gt;try{return gt=!0,t()}finally{gt=e}}const Ku=-7169;function Ee(t,e){t.f=t.f&Ku|e}function Xu(t,e){if(e){const r=document.body;t.autofocus=!0,Sr(()=>{document.activeElement===r&&t.focus()})}}function Ju(t){var e=H,r=j;Ae(null),ot(null);try{return t()}finally{Ae(e),ot(r)}}const vs=new Set,ri=new Set;function bs(t,e,r,n={}){function a(i){if(n.capture||mn.call(e,i),!i.cancelBubble)return Ju(()=>r?.call(this,i))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?Sr(()=>{e.addEventListener(t,a,n)}):e.addEventListener(t,a,n),a}function ed(t,e,r,n,a){var i={capture:n,passive:a},o=bs(t,e,r,i);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&Jo(()=>{e.removeEventListener(t,o,i)})}function ks(t){for(var e=0;e<t.length;e++)vs.add(t[e]);for(var r of ri)r(t)}function mn(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){Fr(t,"currentTarget",{configurable:!0,get(){return i||r}});var d=H,p=j;Ae(null),ot(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(ln(b)){var[A,...y]=b;A.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,Ae(d),ot(p)}}}let lt;function td(){lt=void 0}function rd(t){let e=null,r=N;var n;if(N){for(e=q,lt===void 0&&(lt=it(document.head));lt!==null&&(lt.nodeType!==xr||lt.data!==Da);)lt=Ke(lt);lt===null?Te(!1):lt=be(Ke(lt))}N||(n=document.head.appendChild(jt()));try{qt(()=>t(n),Co)}finally{r&&(Te(!0),lt=q,be(e))}}function ys(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function Ht(t,e){var r=j;r.nodes_start===null&&(r.nodes_start=t,r.nodes_end=e)}function Ct(t,e){var r=(e&tu)!==0,n=(e&ru)!==0,a,i=!t.startsWith("<!>");return()=>{if(N)return Ht(q,null),q;a===void 0&&(a=ys(i?t:"<!>"+t),r||(a=it(a)));var o=n||Wo?document.importNode(a,!0):a.cloneNode(!0);if(r){var s=it(o),c=o.lastChild;Ht(s,c)}else Ht(o,o);return o}}function vt(){if(N)return Ht(q,null),q;var t=document.createDocumentFragment(),e=document.createComment(""),r=jt();return t.append(e,r),Ht(e,r),t}function oe(t,e){if(N){j.nodes_end=q,xt();return}t!==null&&t.before(e)}function nd(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const ad=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function id(t){return ad.includes(t)}const od={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 sd(t){return t=t.toLowerCase(),od[t]??t}const ld=["touchstart","touchmove"];function cd(t){return ld.includes(t)}const ud=["textarea","script","style","title"];function dd(t){return ud.includes(t)}function ws(t,e){var r=e==null?"":typeof e=="object"?e+"":e;r!==(t.__t??=t.nodeValue)&&(t.__t=r,t.nodeValue=r+"")}function _s(t,e){return xs(t,e)}function hd(t,e){Ja(),e.intro=e.intro??!1;const r=e.target,n=N,a=q;try{for(var i=it(r);i&&(i.nodeType!==xr||i.data!==Da);)i=Ke(i);if(!i)throw vr;Te(!0),be(i),xt();const o=xs(t,{...e,anchor:i});if(q===null||q.nodeType!==xr||q.data!==$a)throw dn(),vr;return Te(!1),o}catch(o){if(o===vr)return e.recover===!1&&bu(),Ja(),Ko(r),Te(!1),_s(t,e);throw o}finally{Te(n),be(a),td()}}const Gr=new Map;function xs(t,{target:e,anchor:r,props:n={},events:a,context:i,intro:o=!0}){Ja();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=cd(v);e.addEventListener(v,mn,{passive:m});var b=Gr.get(v);b===void 0?(document.addEventListener(v,mn,{passive:m}),Gr.set(v,1)):Gr.set(v,b+1)}}};c(za(vs)),ri.add(c);var l=void 0,d=Zu(()=>{var p=r??e.appendChild(jt());return fe(()=>{if(i){jr({});var h=Le;h.c=i}a&&(n.$$events=a),N&&Ht(p,null),l=t(p,n)||{},N&&(j.nodes_end=q),i&&Ur()}),()=>{for(var h of s){e.removeEventListener(h,mn);var v=Gr.get(h);--v===0?(document.removeEventListener(h,mn),Gr.delete(h)):Gr.set(h,v)}ri.delete(c),p!==r&&p.parentNode?.removeChild(p)}});return ni.set(l,d),l}let ni=new WeakMap;function fd(t,e){const r=ni.get(t);return r?(ni.delete(t),r(e)):Promise.resolve()}function Ss(t,e,...r){var n=t,a=br,i;qt(()=>{a!==(a=e())&&(i&&(ke(i),i=null),i=fe(()=>a(n,...r)))},Br),N&&(n=q)}function pd(t){Le===null&&Io(),es(()=>{const e=mt(t);if(typeof e=="function")return e})}function gd(t){Le===null&&Io(),pd(()=>()=>mt(t))}const ai=0,Jn=1,ii=2;function Ts(t,e,r,n,a){N&&xt();var i=t,o=Le,s=he,c,l,d,p=Bt(void 0),h=Bt(void 0),v=!1;function m(A,y){v=!0,y&&(ot(b),Ae(b),ir(o));try{A===ai&&r&&(c?Hr(c):c=fe(()=>r(i))),A===Jn&&n&&(l?Hr(l):l=fe(()=>n(i,p))),A!==ai&&c&&Et(c,()=>c=null),A!==Jn&&l&&Et(l,()=>l=null),A!==ii&&d&&Et(d,()=>d=null)}finally{y&&(ir(null),Ae(null),ot(null),re())}}var b=qt(()=>{if(s===(s=e()))return;let A=N&&So(s)===(i.data===zn);if(A&&(i=hn(),be(i),Te(!1),A=!0),So(s)){var y=s;v=!1,y.then(k=>{y===s&&(sr(p,k),m(Jn,!0))},k=>{if(y===s)throw sr(h,k),m(ii,!0),h.v}),N?r&&(c=fe(()=>r(i))):Sr(()=>{v||m(ai,!0)})}else sr(p,s),m(Jn,!1);return A&&Te(!0),()=>s=he});N&&(i=q)}function ur(t,e,r=!1){N&&xt();var n=t,a=null,i=null,o=he,s=r?Br:0,c=!1;const l=(v,m=!0)=>{c=!0,h(m,v)};var d=null;function p(){d!==null&&(d.lastChild.remove(),n.before(d),d=null);var v=o?a:i,m=o?i:a;v&&Hr(v),m&&Et(m,()=>{o?i=null:a=null})}const h=(v,m)=>{if(o===(o=v))return;let b=!1;if(N){const I=Oo(n)===zn;!!o===I&&(n=hn(),be(n),Te(!1),b=!0)}var A=Xo(),y=n;if(A&&(d=document.createDocumentFragment(),d.append(y=jt())),o?a??=m&&fe(()=>m(y)):i??=m&&fe(()=>m(y)),A){var k=He,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&&Te(!0)};qt(()=>{c=!1,e(l),c||h(null,null)},s),N&&(n=q)}function md(t,e){return e}function vd(t,e,r){for(var n=t.items,a=[],i=e.length,o=0;o<i;o++)ti(e[o].e,a,!0);var s=i>0&&a.length===0&&r!==null;if(s){var c=r.parentNode;Ko(c),c.append(r),n.clear(),At(t,e[0].prev,e[i-1].next)}os(a,()=>{for(var l=0;l<i;l++){var d=e[l];s||(n.delete(d.k),At(t,d.prev,d.next)),ke(d.e,!s)}})}function bd(t,e,r,n,a,i=null){var o=t,s={flags:e,items:new Map,first:null};N&&xt();var c=null,l=!1,d=new Map,p=Fo(()=>{var b=r();return ln(b)?b:b==null?[]:za(b)}),h,v;function m(){kd(v,h,s,d,o,a,e,n,r),i!==null&&(h.length===0?c?Hr(c):c=fe(()=>i(o)):c!==null&&Et(c,()=>{c=null}))}qt(()=>{v??=j,h=_(p);var b=h.length;if(l&&b===0)return;l=b===0;let A=!1;if(N){var y=Oo(o)===zn;y!==(b===0)&&(o=hn(),be(o),Te(!1),A=!0)}if(N){for(var k=null,w,T=0;T<b;T++){if(q.nodeType===xr&&q.data===$a){o=q,A=!0,Te(!1);break}var I=h[T],U=n(I,T);w=oi(q,s,k,null,I,U,T,a,e,r),s.items.set(U,w),k=w}b>0&&be(hn())}if(N)b===0&&i&&(c=fe(()=>i(o)));else if(Xo()){var Q=new Set,je=He;for(T=0;T<b;T+=1){I=h[T],U=n(I,T);var ce=s.items.get(U)??d.get(U);ce?Es(ce,I,T):(w=oi(null,s,null,null,I,U,T,a,e,r,!0),d.set(U,w)),Q.add(U)}for(const[pr,ae]of s.items)Q.has(pr)||je.skipped_effects.add(ae.e);je.add_callback(m)}else m();A&&Te(!0),_(p)}),N&&(o=q)}function kd(t,e,r,n,a,i,o,s,c){var l=e.length,d=r.items,p=r.first,h=p,v,m=null,b=[],A=[],y,k,w,T;for(T=0;T<l;T+=1){if(y=e[T],k=s(y,T),w=d.get(k),w===void 0){var I=n.get(k);if(I!==void 0){n.delete(k),d.set(k,I);var U=m?m.next:h;At(r,m,I),At(r,I,U),si(I,U,a),m=I}else{var Q=h?h.e.nodes_start:a;m=oi(Q,r,m,m===null?r.first:m.next,y,k,T,i,o,c)}d.set(k,m),b=[],A=[],h=m.next;continue}if(Es(w,y,T),(w.e.f&pt)!==0&&Hr(w.e),w!==h){if(v!==void 0&&v.has(w)){if(b.length<A.length){var je=A[0],ce;m=je.prev;var pr=b[0],ae=b[b.length-1];for(ce=0;ce<b.length;ce+=1)si(b[ce],je,a);for(ce=0;ce<A.length;ce+=1)v.delete(A[ce]);At(r,pr.prev,ae.next),At(r,m,pr),At(r,ae,je),h=je,m=ae,T-=1,b=[],A=[]}else v.delete(w),si(w,h,a),At(r,w.prev,w.next),At(r,w,m===null?r.first:m.next),At(r,m,w),m=w;continue}for(b=[],A=[];h!==null&&h.k!==k;)(h.e.f&pt)===0&&(v??=new Set).add(h),A.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 er=v===void 0?[]:za(v);h!==null;)(h.e.f&pt)===0&&er.push(h),h=h.next;var gr=er.length;if(gr>0){var mr=null;vd(r,er,mr)}}t.first=r.first&&r.first.e,t.last=m&&m.e;for(var rn of n.values())ke(rn.e);n.clear()}function Es(t,e,r,n){sr(t.v,e),t.i=r}function oi(t,e,r,n,a,i,o,s,c,l,d){var p=(c&Wc)!==0,h=(c&Yc)===0,v=p?h?Ho(a,!1,!1):Bt(a):a,m=(c&Qc)===0?o:Bt(o),b={i:m,v,k:i,a:null,e:null,prev:r,next:n};try{if(t===null){var A=document.createDocumentFragment();A.append(t=jt())}return b.e=fe(()=>s(t,v,m,l),N),b.e.prev=r&&r.e,b.e.next=n&&n.e,r===null?d||(e.first=b):(r.next=b,r.e.next=b.e),n!==null&&(n.prev=b,n.e.prev=b.e),b}finally{}}function si(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=Ke(i);a.before(i),i=o}}function At(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 li(t,e,r=!1,n=!1,a=!1){var i=t,o="";Qn(()=>{var s=j;if(o===(o=e()??"")){N&&xt();return}if(s.nodes_start!==null&&(as(s.nodes_start,s.nodes_end),s.nodes_start=s.nodes_end=null),o!==""){if(N){q.data;for(var c=xt(),l=c;c!==null&&(c.nodeType!==xr||c.data!=="");)l=c,c=Ke(c);if(c===null)throw dn(),vr;Ht(q,l),i=be(c);return}var d=o+"";r?d=`<svg>${d}</svg>`:n&&(d=`<math>${d}</math>`);var p=ys(d);if((r||n)&&(p=it(p)),Ht(it(p),p.lastChild),r||n)for(;it(p);)i.before(it(p));else i.before(p)}})}function Cs(t,e,r,n,a,i){let o=N;N&&xt();var s,c,l=null;N&&q.nodeType===du&&(l=q,xt());var d=N?q:t,p;qt(()=>{const h=e()||null;var v=h==="svg"?au:null;h!==s&&(p&&(h===null?Et(p,()=>{p=null,c=null}):h===c?Hr(p):ke(p)),h&&h!==c&&(p=fe(()=>{if(l=N?l:v?document.createElementNS(v,h):document.createElement(h),Ht(l,l),n){N&&dd(h)&&l.append(document.createComment(""));var m=N?it(l):l.appendChild(jt());N&&(m===null?Te(!1):be(m)),n(l,m)}j.nodes_end=l,d.before(l)})),s=h,s&&(c=s))},Br),o&&(Te(!0),be(d))}function yd(t,e){Sr(()=>{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 As(t,e,r){Wn(()=>{var n=mt(()=>e(t,r?.())||{});if(n?.destroy)return()=>n.destroy()})}function wd(t,e){var r=void 0,n;qt(()=>{r!==(r=e())&&(n&&(ke(n),n=null),r&&(n=fe(()=>{Wn(()=>r(t))})))})}function Rs(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=Rs(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function _d(){for(var t,e,r=0,n="",a=arguments.length;r<a;r++)(t=arguments[r])&&(e=Rs(t))&&(n&&(n+=" "),n+=e);return n}function xd(t){return typeof t=="object"?_d(t):t??""}const Is=[...`
|
|
2
|
+
\r\f \v\uFEFF`];function Sd(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||Is.includes(n[o-1]))&&(s===n.length||Is.includes(n[s]))?n=(o===0?"":n.substring(0,o))+n.substring(s+1):o=s}}return n===""?null:n}function Ls(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 ci(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function Td(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(ci)),a&&c.push(...Object.keys(a).map(ci));var l=0,d=-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===":"&&d===-1)d=p;else if(h===";"||p===b-1){if(d!==-1){var v=ci(t.substring(l,d).trim());if(!c.includes(v)){h!==";"&&p++;var m=t.substring(l,p).trim();r+=" "+m+";"}}l=p+1,d=-1}}}}return n&&(r+=Ls(n)),a&&(r+=Ls(a,!0)),r=r.trim(),r===""?null:r}return t==null?null:String(t)}function Ed(t,e,r,n,a,i){var o=t.__className;if(N||o!==r||o===void 0){var s=Sd(r,n,i);(!N||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 ui(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 Cd(t,e,r,n){var a=t.__style;if(N||a!==e){var i=Td(e,n);(!N||i!==t.getAttribute("style"))&&(i==null?t.removeAttribute("style"):t.style.cssText=i),t.__style=e}else n&&(Array.isArray(n)?(ui(t,r?.[0],n[0]),ui(t,r?.[1],n[1],"important")):ui(t,r,n));return n}function di(t,e,r=!1){if(t.multiple){if(e==null)return;if(!ln(e))return xu();for(var n of t.options)n.selected=e.includes(Os(n));return}for(n of t.options){var a=Os(n);if(ju(a,e)){n.selected=!0;return}}(!r||e!==void 0)&&(t.selectedIndex=-1)}function Ad(t){var e=new MutationObserver(()=>{di(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Jo(()=>{e.disconnect()})}function Os(t){return"__value"in t?t.__value:t.value}const Wr=Symbol("class"),vn=Symbol("style"),Ms=Symbol("is custom element"),Ns=Symbol("is html");function Rd(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function hi(t,e,r,n){var a=Ds(t);N&&(a[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")||a[e]!==(a[e]=r)&&(e==="loading"&&(t[uu]=r),r==null?t.removeAttribute(e):typeof r!="string"&&zs(t).includes(e)?t[e]=r:t.setAttribute(e,r))}function Id(t,e,r,n,a=!1){var i=Ds(t),o=i[Ms],s=!i[Ns];let c=N&&o;c&&Te(!1);var l=e||{},d=t.tagName==="OPTION";for(var p in e)p in r||(r[p]=null);r.class?r.class=xd(r.class):r[Wr]&&(r.class=null),r[vn]&&(r.style??=null);var h=zs(t);for(const w in r){let T=r[w];if(d&&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";Ed(t,v,T,n,e?.[Wr],r[Wr]),l[w]=T,l[Wr]=r[Wr];continue}if(w==="style"){Cd(t,T,e?.[vn],r[vn]),l[w]=T,l[vn]=r[vn];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 I={},U="$$"+w;let Q=w.slice(2);var A=id(Q);if(nd(Q)&&(Q=Q.slice(0,-7),I.capture=!0),!A&&m){if(T!=null)continue;t.removeEventListener(Q,l[U],I),l[U]=null}if(T!=null)if(A)t[`__${Q}`]=T,ks([Q]);else{let je=function(ce){l[w].call(this,ce)};l[U]=bs(Q,t,je,I)}else A&&(t[`__${Q}`]=void 0)}else if(w==="style")hi(t,w,T);else if(w==="autofocus")Xu(t,!!T);else if(!o&&(w==="__value"||w==="value"&&T!=null))t.value=t.__value=T;else if(w==="selected"&&d)Rd(t,T);else{var y=w;s||(y=sd(y));var k=y==="defaultValue"||y==="defaultChecked";if(T==null&&!o&&!k)if(i[w]=null,y==="value"||y==="checked"){let I=t;const U=e===void 0;if(y==="value"){let Q=I.defaultValue;I.removeAttribute(y),I.defaultValue=Q,I.value=I.__value=U?Q:null}else{let Q=I.defaultChecked;I.removeAttribute(y),I.defaultChecked=Q,I.checked=U?Q:!1}}else t.removeAttribute(w);else k||h.includes(y)&&(o||typeof T!="string")?t[y]=T:typeof T!="function"&&hi(t,y,T)}}}return c&&Te(!0),l}function Ps(t,e,r=[],n=[],a,i=!1){Uo(r,n,o=>{var s=void 0,c={},l=t.nodeName==="SELECT",d=!1;if(qt(()=>{var h=e(...o.map(_)),v=Id(t,s,h,a,i);d&&l&&"value"in h&&di(t,h.value);for(let b of Object.getOwnPropertySymbols(c))h[b]||ke(c[b]);for(let b of Object.getOwnPropertySymbols(h)){var m=h[b];b.description===iu&&(!s||m!==s[b])&&(c[b]&&ke(c[b]),c[b]=fe(()=>wd(t,()=>m))),v[b]=m}s=v}),l){var p=t;Wn(()=>{di(p,s.value,!0),Ad(p)})}d=!0})}function Ds(t){return t.__attributes??={[Ms]:t.nodeName.includes("-"),[Ns]:t.namespaceURI===nu}}var $s=new Map;function zs(t){var e=$s.get(t.nodeName);if(e)return e;$s.set(t.nodeName,e=[]);for(var r,n=t,a=Element.prototype;a!==n;){r=su(n);for(var i in r)r[i].set&&e.push(i);n=Fa(n)}return e}function Fs(t,e){return t===e||t?.[ar]===e}function Bs(t={},e,r,n){return Wn(()=>{var a,i;return ei(()=>{a=i,i=[],mt(()=>{t!==r(...i)&&(e(t,...i),a&&Fs(r(...a),t)&&e(null,...a))})}),()=>{Sr(()=>{i&&Fs(r(...i),t)&&e(null,...i)})}}),t}const Qr=[];function Ld(t,e=br){let r=null;const n=new Set;function a(s){if(No(t,s)&&(t=s,r)){const c=!Qr.length;for(const l of n)l[1](),Qr.push(l,t);if(c){for(let l=0;l<Qr.length;l+=2)Qr[l][0](Qr[l+1]);Qr.length=0}}}function i(s){a(s(t))}function o(s,c=br){const l=[s,c];return n.add(l),n.size===1&&(r=e(a,i)||br),s(t),()=>{n.delete(l),n.size===0&&r&&(r(),r=null)}}return{set:a,update:i,subscribe:o}}let ea=!1;function Od(t){var e=ea;try{return ea=!1,[t(),ea]}finally{ea=e}}const Md={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 fi(t,e,r){return new Proxy({props:t,exclude:e},Md)}const Nd={get(t,e){let r=t.props.length;for(;r--;){let n=t.props[r];if(cn(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];cn(a)&&(a=a());const i=$t(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(cn(n)&&(n=n()),typeof n=="object"&&n!==null&&e in n){const a=$t(n,e);return a&&!a.configurable&&(a.configurable=!0),a}}},has(t,e){if(e===ar||e===Za)return!1;for(let r of t.props)if(cn(r)&&(r=r()),r!=null&&e in r)return!0;return!1},ownKeys(t){const e=[];for(let r of t.props)if(cn(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 Pd(...t){return new Proxy({props:t},Nd)}function se(t,e,r,n){var a=(r&Jc)!==0,i=(r&eu)!==0,o=n,s=!0,c=()=>(s&&(s=!1,o=i?mt(n):n),o),l;if(a){var d=ar in t||Za in t;l=$t(t,e)?.set??(d&&e in t?k=>t[e]=k:void 0)}var p,h=!1;a?[p,h]=Od(()=>t[e]):p=t[e],p===void 0&&n!==void 0&&(p=c(),l&&(ku(),l(p)));var v;if(v=()=>{var k=t[e];return k===void 0?c():(s=!0,k)},(r&Xc)===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,A=((r&Kc)!==0?Vn:Fo)(()=>(b=!1,v()));a&&_(A);var y=j;return function(k,w){if(arguments.length>0){const T=w?_(A):a?St(k):k;return $(A,T),b=!0,o!==void 0&&(o=T),k}return Cr&&b||(y.f&wr)!==0?A.v:_(A)}}function Dd(t){return new $d(t)}class $d{#e;#t;constructor(e){var r=new Map,n=(i,o)=>{var s=Ho(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===Za?!0:(_(r.get(o)??n(o,Reflect.get(i,o))),Reflect.has(i,o))},set(i,o,s){return $(r.get(o)??n(o,s),s),Reflect.set(i,o,s)}});this.#t=(e.hydrate?hd:_s)(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)&&re(),this.#e=a.$$events;for(const i of Object.keys(this.#t))i==="$set"||i==="$destroy"||i==="$on"||Fr(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=()=>{fd(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 js;typeof HTMLElement=="function"&&(js=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),oe(a,i)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const e={},r=zd(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]=ta(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=Dd({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:e,$$host:this}}),this.$$me=Hu(()=>{ei(()=>{this.$$r=!0;for(const n of Fn(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];const a=ta(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]=ta(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 Fn(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});function ta(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 zd(t){const e={};return t.childNodes.forEach(r=>{e[r.slot||"default"]=!0}),e}function bn(t,e,r,n,a,i){let o=class extends js{constructor(){super(t,r,a),this.$$p_d=e}static get observedAttributes(){return Fn(e).map(s=>(e[s].attribute||s).toLowerCase())}};return Fn(e).forEach(s=>{Fr(o.prototype,s,{get(){return this.$$c&&s in this.$$c?this.$$c[s]:this.$$d[s]},set(c){c=ta(s,c,e),this.$$d[s]=c;var l=this.$$c;if(l){var d=$t(l,s)?.get;d?l[s]=c:l.$set({[s]:c})}}})}),n.forEach(s=>{Fr(o.prototype,s,{get(){return this.$$c?.[s]}})}),t.element=o,o}var Fd=(t,e)=>e()(),Bd=Ct('<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>'),jd=Ct(" <!>",1);const Ud={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,14 +12,14 @@ var LiipGPTButton=function(sn){"use strict";const Vc="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 Us(t,e){jr(e,!0),
|
|
16
|
-
`,d())??""]),oe(l,h)};let n=se(e,"body",7),a=se(e,"silent",7),i=te(void 0);const o=l=>{$(i,{error:l},!0)};var s=vt(),c=Oe(s);return Iu(c,{get failed(){return r}},l=>{var d=vt(),p=Oe(d);{var h=m=>{r(m,()=>_(i).error,()=>()=>{$(i,void 0)})},v=m=>{var b=vt(),A=Oe(b);Ss(A,n,()=>o),oe(m,b)};ur(p,m=>{_(i)?m(h):m(v,!1)})}oe(l,d)}),oe(t,s),Ur({get body(){return n()},set body(l){n(l),re()},get silent(){return a()},set silent(l){a(l),re()}})}ks(["click"]),bn(Us,{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:qs,setPrototypeOf:Vs,isFrozen:Bd,getPrototypeOf:jd,getOwnPropertyDescriptor:Ud}=Object;let{freeze:Ne,seal:ct,create:Hs}=Object,{apply:pi,construct:gi}=typeof Reflect<"u"&&Reflect;Ne||(Ne=function(e){return e}),ct||(ct=function(e){return e}),pi||(pi=function(e,r,n){return e.apply(r,n)}),gi||(gi=function(e,r){return new e(...r)});const ra=De(Array.prototype.forEach),qd=De(Array.prototype.lastIndexOf),Zs=De(Array.prototype.pop),kn=De(Array.prototype.push),Vd=De(Array.prototype.splice),na=De(String.prototype.toLowerCase),mi=De(String.prototype.toString),Gs=De(String.prototype.match),yn=De(String.prototype.replace),Hd=De(String.prototype.indexOf),Zd=De(String.prototype.trim),bt=De(Object.prototype.hasOwnProperty),Pe=De(RegExp.prototype.test),wn=Gd(TypeError);function De(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 pi(t,e,n)}}function Gd(t){return function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return gi(t,r)}}function V(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:na;Vs&&Vs(t,null);let n=e.length;for(;n--;){let a=e[n];if(typeof a=="string"){const i=r(a);i!==a&&(Bd(e)||(e[n]=i),a=i)}t[a]=!0}return t}function Wd(t){for(let e=0;e<t.length;e++)bt(t,e)||(t[e]=null);return t}function Zt(t){const e=Hs(null);for(const[r,n]of qs(t))bt(t,r)&&(Array.isArray(n)?e[r]=Wd(n):n&&typeof n=="object"&&n.constructor===Object?e[r]=Zt(n):e[r]=n);return e}function _n(t,e){for(;t!==null;){const n=Ud(t,e);if(n){if(n.get)return De(n.get);if(typeof n.value=="function")return De(n.value)}t=jd(t)}function r(){return null}return r}const Ws=Ne(["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"]),vi=Ne(["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"]),bi=Ne(["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"]),Qd=Ne(["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"]),ki=Ne(["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"]),Yd=Ne(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Qs=Ne(["#text"]),Ys=Ne(["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"]),yi=Ne(["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"]),Ks=Ne(["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"]),aa=Ne(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Kd=ct(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Xd=ct(/<%[\w\W]*|[\w\W]*%>/gm),Jd=ct(/\$\{[\w\W]*/gm),eh=ct(/^data-[\-\w.\u00B7-\uFFFF]+$/),th=ct(/^aria-[\-\w]+$/),Xs=ct(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),rh=ct(/^(?:\w+script|data):/i),nh=ct(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Js=ct(/^html$/i),ah=ct(/^[a-z][.\w]*(-[.\w]+)+$/i);var el=Object.freeze({__proto__:null,ARIA_ATTR:th,ATTR_WHITESPACE:nh,CUSTOM_ELEMENT:ah,DATA_ATTR:eh,DOCTYPE_NAME:Js,ERB_EXPR:Xd,IS_ALLOWED_URI:Xs,IS_SCRIPT_OR_DATA:rh,MUSTACHE_EXPR:Kd,TMPLIT_EXPR:Jd});const xn={element:1,text:3,progressingInstruction:7,comment:8,document:9},ih=function(){return typeof window>"u"?null:window},oh=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}},tl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function rl(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ih();const e=M=>rl(M);if(e.version="3.2.6",e.removed=[],!t||!t.document||t.document.nodeType!==xn.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:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:p,DOMParser:h,trustedTypes:v}=t,m=c.prototype,b=_n(m,"cloneNode"),A=_n(m,"remove"),y=_n(m,"nextSibling"),k=_n(m,"childNodes"),w=_n(m,"parentNode");if(typeof o=="function"){const M=r.createElement("template");M.content&&M.content.ownerDocument&&(r=M.content.ownerDocument)}let T,I="";const{implementation:U,createNodeIterator:Q,createDocumentFragment:je,getElementsByTagName:ce}=r,{importNode:pr}=n;let ae=tl();e.isSupported=typeof qs=="function"&&typeof w=="function"&&U&&U.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:er,ERB_EXPR:gr,TMPLIT_EXPR:mr,DATA_ATTR:rn,ARIA_ATTR:co,IS_SCRIPT_OR_DATA:uo,ATTR_WHITESPACE:Ra,CUSTOM_ELEMENT:ho}=el;let{IS_ALLOWED_URI:Ia}=el,ue=null;const Mn=V({},[...Ws,...vi,...bi,...ki,...Qs]);let ge=null;const B=V({},[...Ys,...yi,...Ks,...aa]);let z=Object.seal(Hs(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,Ue=null,ye=!0,le=!0,qe=!1,we=!0,_e=!1,xe=!0,ie=!1,rt=!1,Ve=!1,ft=!1,tr=!1,Ot=!1,Nn=!0,La=!1;const fo="user-content-";let nn=!0,$r=!1,nt={},Ze=null;const zr=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 Oa=null;const Ma=V({},["audio","video","img","source","image","track"]);let Pn=null;const Mt=V({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),at="http://www.w3.org/1998/Math/MathML",Nt="http://www.w3.org/2000/svg",_t="http://www.w3.org/1999/xhtml";let Pt=_t,po=!1,go=null;const Mg=V({},[at,Nt,_t],mi);let Na=V({},["mi","mo","mn","ms","mtext"]),Pa=V({},["annotation-xml"]);const Ng=V({},["title","style","font","a","script"]);let Dn=null;const Pg=["application/xhtml+xml","text/html"],Dg="text/html";let Se=null,an=null;const $g=r.createElement("form"),Oc=function(f){return f instanceof RegExp||f instanceof Function},mo=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(an&&an===f)){if((!f||typeof f!="object")&&(f={}),f=Zt(f),Dn=Pg.indexOf(f.PARSER_MEDIA_TYPE)===-1?Dg:f.PARSER_MEDIA_TYPE,Se=Dn==="application/xhtml+xml"?mi:na,ue=bt(f,"ALLOWED_TAGS")?V({},f.ALLOWED_TAGS,Se):Mn,ge=bt(f,"ALLOWED_ATTR")?V({},f.ALLOWED_ATTR,Se):B,go=bt(f,"ALLOWED_NAMESPACES")?V({},f.ALLOWED_NAMESPACES,mi):Mg,Pn=bt(f,"ADD_URI_SAFE_ATTR")?V(Zt(Mt),f.ADD_URI_SAFE_ATTR,Se):Mt,Oa=bt(f,"ADD_DATA_URI_TAGS")?V(Zt(Ma),f.ADD_DATA_URI_TAGS,Se):Ma,Ze=bt(f,"FORBID_CONTENTS")?V({},f.FORBID_CONTENTS,Se):zr,G=bt(f,"FORBID_TAGS")?V({},f.FORBID_TAGS,Se):Zt({}),Ue=bt(f,"FORBID_ATTR")?V({},f.FORBID_ATTR,Se):Zt({}),nt=bt(f,"USE_PROFILES")?f.USE_PROFILES:!1,ye=f.ALLOW_ARIA_ATTR!==!1,le=f.ALLOW_DATA_ATTR!==!1,qe=f.ALLOW_UNKNOWN_PROTOCOLS||!1,we=f.ALLOW_SELF_CLOSE_IN_ATTR!==!1,_e=f.SAFE_FOR_TEMPLATES||!1,xe=f.SAFE_FOR_XML!==!1,ie=f.WHOLE_DOCUMENT||!1,ft=f.RETURN_DOM||!1,tr=f.RETURN_DOM_FRAGMENT||!1,Ot=f.RETURN_TRUSTED_TYPE||!1,Ve=f.FORCE_BODY||!1,Nn=f.SANITIZE_DOM!==!1,La=f.SANITIZE_NAMED_PROPS||!1,nn=f.KEEP_CONTENT!==!1,$r=f.IN_PLACE||!1,Ia=f.ALLOWED_URI_REGEXP||Xs,Pt=f.NAMESPACE||_t,Na=f.MATHML_TEXT_INTEGRATION_POINTS||Na,Pa=f.HTML_INTEGRATION_POINTS||Pa,z=f.CUSTOM_ELEMENT_HANDLING||{},f.CUSTOM_ELEMENT_HANDLING&&Oc(f.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(z.tagNameCheck=f.CUSTOM_ELEMENT_HANDLING.tagNameCheck),f.CUSTOM_ELEMENT_HANDLING&&Oc(f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(z.attributeNameCheck=f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),f.CUSTOM_ELEMENT_HANDLING&&typeof f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(z.allowCustomizedBuiltInElements=f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),_e&&(le=!1),tr&&(ft=!0),nt&&(ue=V({},Qs),ge=[],nt.html===!0&&(V(ue,Ws),V(ge,Ys)),nt.svg===!0&&(V(ue,vi),V(ge,yi),V(ge,aa)),nt.svgFilters===!0&&(V(ue,bi),V(ge,yi),V(ge,aa)),nt.mathMl===!0&&(V(ue,ki),V(ge,Ks),V(ge,aa))),f.ADD_TAGS&&(ue===Mn&&(ue=Zt(ue)),V(ue,f.ADD_TAGS,Se)),f.ADD_ATTR&&(ge===B&&(ge=Zt(ge)),V(ge,f.ADD_ATTR,Se)),f.ADD_URI_SAFE_ATTR&&V(Pn,f.ADD_URI_SAFE_ATTR,Se),f.FORBID_CONTENTS&&(Ze===zr&&(Ze=Zt(Ze)),V(Ze,f.FORBID_CONTENTS,Se)),nn&&(ue["#text"]=!0),ie&&V(ue,["html","head","body"]),ue.table&&(V(ue,["tbody"]),delete G.tbody),f.TRUSTED_TYPES_POLICY){if(typeof f.TRUSTED_TYPES_POLICY.createHTML!="function")throw wn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof f.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw wn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=f.TRUSTED_TYPES_POLICY,I=T.createHTML("")}else T===void 0&&(T=oh(v,a)),T!==null&&typeof I=="string"&&(I=T.createHTML(""));Ne&&Ne(f),an=f}},Mc=V({},[...vi,...bi,...Qd]),Nc=V({},[...ki,...Yd]),zg=function(f){let S=w(f);(!S||!S.tagName)&&(S={namespaceURI:Pt,tagName:"template"});const O=na(f.tagName),ne=na(S.tagName);return go[f.namespaceURI]?f.namespaceURI===Nt?S.namespaceURI===_t?O==="svg":S.namespaceURI===at?O==="svg"&&(ne==="annotation-xml"||Na[ne]):!!Mc[O]:f.namespaceURI===at?S.namespaceURI===_t?O==="math":S.namespaceURI===Nt?O==="math"&&Pa[ne]:!!Nc[O]:f.namespaceURI===_t?S.namespaceURI===Nt&&!Pa[ne]||S.namespaceURI===at&&!Na[ne]?!1:!Nc[O]&&(Ng[O]||!Mc[O]):!!(Dn==="application/xhtml+xml"&&go[f.namespaceURI]):!1},Dt=function(f){kn(e.removed,{element:f});try{w(f).removeChild(f)}catch{A(f)}},on=function(f,S){try{kn(e.removed,{attribute:S.getAttributeNode(f),from:S})}catch{kn(e.removed,{attribute:null,from:S})}if(S.removeAttribute(f),f==="is")if(ft||tr)try{Dt(S)}catch{}else try{S.setAttribute(f,"")}catch{}},Pc=function(f){let S=null,O=null;if(Ve)f="<remove></remove>"+f;else{const me=Gs(f,/^[\r\n\t ]+/);O=me&&me[0]}Dn==="application/xhtml+xml"&&Pt===_t&&(f='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+f+"</body></html>");const ne=T?T.createHTML(f):f;if(Pt===_t)try{S=new h().parseFromString(ne,Dn)}catch{}if(!S||!S.documentElement){S=U.createDocument(Pt,"template",null);try{S.documentElement.innerHTML=po?I:ne}catch{}}const Re=S.body||S.documentElement;return f&&O&&Re.insertBefore(r.createTextNode(O),Re.childNodes[0]||null),Pt===_t?ce.call(S,ie?"html":"body")[0]:ie?S.documentElement:Re},Dc=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)},vo=function(f){return f instanceof p&&(typeof f.nodeName!="string"||typeof f.textContent!="string"||typeof f.removeChild!="function"||!(f.attributes instanceof d)||typeof f.removeAttribute!="function"||typeof f.setAttribute!="function"||typeof f.namespaceURI!="string"||typeof f.insertBefore!="function"||typeof f.hasChildNodes!="function")},$c=function(f){return typeof s=="function"&&f instanceof s};function rr(M,f,S){ra(M,O=>{O.call(e,f,S,an)})}const zc=function(f){let S=null;if(rr(ae.beforeSanitizeElements,f,null),vo(f))return Dt(f),!0;const O=Se(f.nodeName);if(rr(ae.uponSanitizeElement,f,{tagName:O,allowedTags:ue}),xe&&f.hasChildNodes()&&!$c(f.firstElementChild)&&Pe(/<[/\w!]/g,f.innerHTML)&&Pe(/<[/\w!]/g,f.textContent)||f.nodeType===xn.progressingInstruction||xe&&f.nodeType===xn.comment&&Pe(/<[/\w]/g,f.data))return Dt(f),!0;if(!ue[O]||G[O]){if(!G[O]&&Bc(O)&&(z.tagNameCheck instanceof RegExp&&Pe(z.tagNameCheck,O)||z.tagNameCheck instanceof Function&&z.tagNameCheck(O)))return!1;if(nn&&!Ze[O]){const ne=w(f)||f.parentNode,Re=k(f)||f.childNodes;if(Re&&ne){const me=Re.length;for(let Ge=me-1;Ge>=0;--Ge){const nr=b(Re[Ge],!0);nr.__removalCount=(f.__removalCount||0)+1,ne.insertBefore(nr,y(f))}}}return Dt(f),!0}return f instanceof c&&!zg(f)||(O==="noscript"||O==="noembed"||O==="noframes")&&Pe(/<\/no(script|embed|frames)/i,f.innerHTML)?(Dt(f),!0):(_e&&f.nodeType===xn.text&&(S=f.textContent,ra([er,gr,mr],ne=>{S=yn(S,ne," ")}),f.textContent!==S&&(kn(e.removed,{element:f.cloneNode()}),f.textContent=S)),rr(ae.afterSanitizeElements,f,null),!1)},Fc=function(f,S,O){if(Nn&&(S==="id"||S==="name")&&(O in r||O in $g))return!1;if(!(le&&!Ue[S]&&Pe(rn,S))){if(!(ye&&Pe(co,S))){if(!ge[S]||Ue[S]){if(!(Bc(f)&&(z.tagNameCheck instanceof RegExp&&Pe(z.tagNameCheck,f)||z.tagNameCheck instanceof Function&&z.tagNameCheck(f))&&(z.attributeNameCheck instanceof RegExp&&Pe(z.attributeNameCheck,S)||z.attributeNameCheck instanceof Function&&z.attributeNameCheck(S))||S==="is"&&z.allowCustomizedBuiltInElements&&(z.tagNameCheck instanceof RegExp&&Pe(z.tagNameCheck,O)||z.tagNameCheck instanceof Function&&z.tagNameCheck(O))))return!1}else if(!Pn[S]){if(!Pe(Ia,yn(O,Ra,""))){if(!((S==="src"||S==="xlink:href"||S==="href")&&f!=="script"&&Hd(O,"data:")===0&&Oa[f])){if(!(qe&&!Pe(uo,yn(O,Ra,"")))){if(O)return!1}}}}}}return!0},Bc=function(f){return f!=="annotation-xml"&&Gs(f,ho)},jc=function(f){rr(ae.beforeSanitizeAttributes,f,null);const{attributes:S}=f;if(!S||vo(f))return;const O={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ge,forceKeepAttr:void 0};let ne=S.length;for(;ne--;){const Re=S[ne],{name:me,namespaceURI:Ge,value:nr}=Re,$n=Se(me),bo=nr;let Ie=me==="value"?bo:Zd(bo);if(O.attrName=$n,O.attrValue=Ie,O.keepAttr=!0,O.forceKeepAttr=void 0,rr(ae.uponSanitizeAttribute,f,O),Ie=O.attrValue,La&&($n==="id"||$n==="name")&&(on(me,f),Ie=fo+Ie),xe&&Pe(/((--!?|])>)|<\/(style|title)/i,Ie)){on(me,f);continue}if(O.forceKeepAttr)continue;if(!O.keepAttr){on(me,f);continue}if(!we&&Pe(/\/>/i,Ie)){on(me,f);continue}_e&&ra([er,gr,mr],qc=>{Ie=yn(Ie,qc," ")});const Uc=Se(f.nodeName);if(!Fc(Uc,$n,Ie)){on(me,f);continue}if(T&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!Ge)switch(v.getAttributeType(Uc,$n)){case"TrustedHTML":{Ie=T.createHTML(Ie);break}case"TrustedScriptURL":{Ie=T.createScriptURL(Ie);break}}if(Ie!==bo)try{Ge?f.setAttributeNS(Ge,me,Ie):f.setAttribute(me,Ie),vo(f)?Dt(f):Zs(e.removed)}catch{on(me,f)}}rr(ae.afterSanitizeAttributes,f,null)},Fg=function M(f){let S=null;const O=Dc(f);for(rr(ae.beforeSanitizeShadowDOM,f,null);S=O.nextNode();)rr(ae.uponSanitizeShadowNode,S,null),zc(S),jc(S),S.content instanceof i&&M(S.content);rr(ae.afterSanitizeShadowDOM,f,null)};return e.sanitize=function(M){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},S=null,O=null,ne=null,Re=null;if(po=!M,po&&(M="<!-->"),typeof M!="string"&&!$c(M))if(typeof M.toString=="function"){if(M=M.toString(),typeof M!="string")throw wn("dirty is not a string, aborting")}else throw wn("toString is not a function");if(!e.isSupported)return M;if(rt||mo(f),e.removed=[],typeof M=="string"&&($r=!1),$r){if(M.nodeName){const nr=Se(M.nodeName);if(!ue[nr]||G[nr])throw wn("root node is forbidden and cannot be sanitized in-place")}}else if(M instanceof s)S=Pc("<!---->"),O=S.ownerDocument.importNode(M,!0),O.nodeType===xn.element&&O.nodeName==="BODY"||O.nodeName==="HTML"?S=O:S.appendChild(O);else{if(!ft&&!_e&&!ie&&M.indexOf("<")===-1)return T&&Ot?T.createHTML(M):M;if(S=Pc(M),!S)return ft?null:Ot?I:""}S&&Ve&&Dt(S.firstChild);const me=Dc($r?M:S);for(;ne=me.nextNode();)zc(ne),jc(ne),ne.content instanceof i&&Fg(ne.content);if($r)return M;if(ft){if(tr)for(Re=je.call(S.ownerDocument);S.firstChild;)Re.appendChild(S.firstChild);else Re=S;return(ge.shadowroot||ge.shadowrootmode)&&(Re=pr.call(n,Re,!0)),Re}let Ge=ie?S.outerHTML:S.innerHTML;return ie&&ue["!doctype"]&&S.ownerDocument&&S.ownerDocument.doctype&&S.ownerDocument.doctype.name&&Pe(Js,S.ownerDocument.doctype.name)&&(Ge="<!DOCTYPE "+S.ownerDocument.doctype.name+`>
|
|
17
|
-
`+Ge),_e&&ra([er,gr,mr],nr=>{Ge=yn(Ge,nr," ")}),T&&Ot?T.createHTML(Ge):Ge},e.setConfig=function(){let M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};mo(M),rt=!0},e.clearConfig=function(){an=null,rt=!1},e.isValidAttribute=function(M,f,S){an||mo({});const O=Se(M),ne=Se(f);return
|
|
18
|
-
]`).replace("lheading",il).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},
|
|
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 Us(t,e){jr(e,!0),yd(t,Ud);const r=(l,d=br,p=br)=>{Lo();var h=jd(),v=Oe(h),m=lr(v);{var b=y=>{},A=y=>{var k=Bd(),w=Ut(k),T=lr(Ut(w));T.__click=[Fd,p],Ft(w),Ft(k),oe(y,k)};ur(m,y=>{a()?y(b):y(A,!1)})}Qn(y=>ws(v,`${y??""} `),[()=>console.error(`Panic, uncaught error:
|
|
16
|
+
`,d())??""]),oe(l,h)};let n=se(e,"body",7),a=se(e,"silent",7),i=te(void 0);const o=l=>{$(i,{error:l},!0)};var s=vt(),c=Oe(s);return Mu(c,{get failed(){return r}},l=>{var d=vt(),p=Oe(d);{var h=m=>{r(m,()=>_(i).error,()=>()=>{$(i,void 0)})},v=m=>{var b=vt(),A=Oe(b);Ss(A,n,()=>o),oe(m,b)};ur(p,m=>{_(i)?m(h):m(v,!1)})}oe(l,d)}),oe(t,s),Ur({get body(){return n()},set body(l){n(l),re()},get silent(){return a()},set silent(l){a(l),re()}})}ks(["click"]),bn(Us,{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:qs,setPrototypeOf:Vs,isFrozen:qd,getPrototypeOf:Vd,getOwnPropertyDescriptor:Hd}=Object;let{freeze:Ne,seal:ct,create:Hs}=Object,{apply:pi,construct:gi}=typeof Reflect<"u"&&Reflect;Ne||(Ne=function(e){return e}),ct||(ct=function(e){return e}),pi||(pi=function(e,r,n){return e.apply(r,n)}),gi||(gi=function(e,r){return new e(...r)});const ra=De(Array.prototype.forEach),Zd=De(Array.prototype.lastIndexOf),Zs=De(Array.prototype.pop),kn=De(Array.prototype.push),Gd=De(Array.prototype.splice),na=De(String.prototype.toLowerCase),mi=De(String.prototype.toString),Gs=De(String.prototype.match),yn=De(String.prototype.replace),Wd=De(String.prototype.indexOf),Qd=De(String.prototype.trim),bt=De(Object.prototype.hasOwnProperty),Pe=De(RegExp.prototype.test),wn=Yd(TypeError);function De(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 pi(t,e,n)}}function Yd(t){return function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return gi(t,r)}}function V(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:na;Vs&&Vs(t,null);let n=e.length;for(;n--;){let a=e[n];if(typeof a=="string"){const i=r(a);i!==a&&(qd(e)||(e[n]=i),a=i)}t[a]=!0}return t}function Kd(t){for(let e=0;e<t.length;e++)bt(t,e)||(t[e]=null);return t}function Zt(t){const e=Hs(null);for(const[r,n]of qs(t))bt(t,r)&&(Array.isArray(n)?e[r]=Kd(n):n&&typeof n=="object"&&n.constructor===Object?e[r]=Zt(n):e[r]=n);return e}function _n(t,e){for(;t!==null;){const n=Hd(t,e);if(n){if(n.get)return De(n.get);if(typeof n.value=="function")return De(n.value)}t=Vd(t)}function r(){return null}return r}const Ws=Ne(["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"]),vi=Ne(["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"]),bi=Ne(["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"]),Xd=Ne(["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"]),ki=Ne(["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"]),Jd=Ne(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Qs=Ne(["#text"]),Ys=Ne(["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"]),yi=Ne(["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"]),Ks=Ne(["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"]),aa=Ne(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),eh=ct(/\{\{[\w\W]*|[\w\W]*\}\}/gm),th=ct(/<%[\w\W]*|[\w\W]*%>/gm),rh=ct(/\$\{[\w\W]*/gm),nh=ct(/^data-[\-\w.\u00B7-\uFFFF]+$/),ah=ct(/^aria-[\-\w]+$/),Xs=ct(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ih=ct(/^(?:\w+script|data):/i),oh=ct(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Js=ct(/^html$/i),sh=ct(/^[a-z][.\w]*(-[.\w]+)+$/i);var el=Object.freeze({__proto__:null,ARIA_ATTR:ah,ATTR_WHITESPACE:oh,CUSTOM_ELEMENT:sh,DATA_ATTR:nh,DOCTYPE_NAME:Js,ERB_EXPR:th,IS_ALLOWED_URI:Xs,IS_SCRIPT_OR_DATA:ih,MUSTACHE_EXPR:eh,TMPLIT_EXPR:rh});const xn={element:1,text:3,progressingInstruction:7,comment:8,document:9},lh=function(){return typeof window>"u"?null:window},ch=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}},tl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function rl(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:lh();const e=M=>rl(M);if(e.version="3.2.6",e.removed=[],!t||!t.document||t.document.nodeType!==xn.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:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:p,DOMParser:h,trustedTypes:v}=t,m=c.prototype,b=_n(m,"cloneNode"),A=_n(m,"remove"),y=_n(m,"nextSibling"),k=_n(m,"childNodes"),w=_n(m,"parentNode");if(typeof o=="function"){const M=r.createElement("template");M.content&&M.content.ownerDocument&&(r=M.content.ownerDocument)}let T,I="";const{implementation:U,createNodeIterator:Q,createDocumentFragment:je,getElementsByTagName:ce}=r,{importNode:pr}=n;let ae=tl();e.isSupported=typeof qs=="function"&&typeof w=="function"&&U&&U.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:er,ERB_EXPR:gr,TMPLIT_EXPR:mr,DATA_ATTR:rn,ARIA_ATTR:co,IS_SCRIPT_OR_DATA:uo,ATTR_WHITESPACE:Ra,CUSTOM_ELEMENT:ho}=el;let{IS_ALLOWED_URI:Ia}=el,ue=null;const Mn=V({},[...Ws,...vi,...bi,...ki,...Qs]);let ge=null;const B=V({},[...Ys,...yi,...Ks,...aa]);let z=Object.seal(Hs(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,Ue=null,ye=!0,le=!0,qe=!1,we=!0,_e=!1,xe=!0,ie=!1,rt=!1,Ve=!1,ft=!1,tr=!1,Ot=!1,Nn=!0,La=!1;const fo="user-content-";let nn=!0,$r=!1,nt={},Ze=null;const zr=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 Oa=null;const Ma=V({},["audio","video","img","source","image","track"]);let Pn=null;const Mt=V({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),at="http://www.w3.org/1998/Math/MathML",Nt="http://www.w3.org/2000/svg",_t="http://www.w3.org/1999/xhtml";let Pt=_t,po=!1,go=null;const $0=V({},[at,Nt,_t],mi);let Na=V({},["mi","mo","mn","ms","mtext"]),Pa=V({},["annotation-xml"]);const z0=V({},["title","style","font","a","script"]);let Dn=null;const F0=["application/xhtml+xml","text/html"],B0="text/html";let Se=null,an=null;const j0=r.createElement("form"),Pc=function(f){return f instanceof RegExp||f instanceof Function},mo=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(an&&an===f)){if((!f||typeof f!="object")&&(f={}),f=Zt(f),Dn=F0.indexOf(f.PARSER_MEDIA_TYPE)===-1?B0:f.PARSER_MEDIA_TYPE,Se=Dn==="application/xhtml+xml"?mi:na,ue=bt(f,"ALLOWED_TAGS")?V({},f.ALLOWED_TAGS,Se):Mn,ge=bt(f,"ALLOWED_ATTR")?V({},f.ALLOWED_ATTR,Se):B,go=bt(f,"ALLOWED_NAMESPACES")?V({},f.ALLOWED_NAMESPACES,mi):$0,Pn=bt(f,"ADD_URI_SAFE_ATTR")?V(Zt(Mt),f.ADD_URI_SAFE_ATTR,Se):Mt,Oa=bt(f,"ADD_DATA_URI_TAGS")?V(Zt(Ma),f.ADD_DATA_URI_TAGS,Se):Ma,Ze=bt(f,"FORBID_CONTENTS")?V({},f.FORBID_CONTENTS,Se):zr,G=bt(f,"FORBID_TAGS")?V({},f.FORBID_TAGS,Se):Zt({}),Ue=bt(f,"FORBID_ATTR")?V({},f.FORBID_ATTR,Se):Zt({}),nt=bt(f,"USE_PROFILES")?f.USE_PROFILES:!1,ye=f.ALLOW_ARIA_ATTR!==!1,le=f.ALLOW_DATA_ATTR!==!1,qe=f.ALLOW_UNKNOWN_PROTOCOLS||!1,we=f.ALLOW_SELF_CLOSE_IN_ATTR!==!1,_e=f.SAFE_FOR_TEMPLATES||!1,xe=f.SAFE_FOR_XML!==!1,ie=f.WHOLE_DOCUMENT||!1,ft=f.RETURN_DOM||!1,tr=f.RETURN_DOM_FRAGMENT||!1,Ot=f.RETURN_TRUSTED_TYPE||!1,Ve=f.FORCE_BODY||!1,Nn=f.SANITIZE_DOM!==!1,La=f.SANITIZE_NAMED_PROPS||!1,nn=f.KEEP_CONTENT!==!1,$r=f.IN_PLACE||!1,Ia=f.ALLOWED_URI_REGEXP||Xs,Pt=f.NAMESPACE||_t,Na=f.MATHML_TEXT_INTEGRATION_POINTS||Na,Pa=f.HTML_INTEGRATION_POINTS||Pa,z=f.CUSTOM_ELEMENT_HANDLING||{},f.CUSTOM_ELEMENT_HANDLING&&Pc(f.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(z.tagNameCheck=f.CUSTOM_ELEMENT_HANDLING.tagNameCheck),f.CUSTOM_ELEMENT_HANDLING&&Pc(f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(z.attributeNameCheck=f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),f.CUSTOM_ELEMENT_HANDLING&&typeof f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(z.allowCustomizedBuiltInElements=f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),_e&&(le=!1),tr&&(ft=!0),nt&&(ue=V({},Qs),ge=[],nt.html===!0&&(V(ue,Ws),V(ge,Ys)),nt.svg===!0&&(V(ue,vi),V(ge,yi),V(ge,aa)),nt.svgFilters===!0&&(V(ue,bi),V(ge,yi),V(ge,aa)),nt.mathMl===!0&&(V(ue,ki),V(ge,Ks),V(ge,aa))),f.ADD_TAGS&&(ue===Mn&&(ue=Zt(ue)),V(ue,f.ADD_TAGS,Se)),f.ADD_ATTR&&(ge===B&&(ge=Zt(ge)),V(ge,f.ADD_ATTR,Se)),f.ADD_URI_SAFE_ATTR&&V(Pn,f.ADD_URI_SAFE_ATTR,Se),f.FORBID_CONTENTS&&(Ze===zr&&(Ze=Zt(Ze)),V(Ze,f.FORBID_CONTENTS,Se)),nn&&(ue["#text"]=!0),ie&&V(ue,["html","head","body"]),ue.table&&(V(ue,["tbody"]),delete G.tbody),f.TRUSTED_TYPES_POLICY){if(typeof f.TRUSTED_TYPES_POLICY.createHTML!="function")throw wn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof f.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw wn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=f.TRUSTED_TYPES_POLICY,I=T.createHTML("")}else T===void 0&&(T=ch(v,a)),T!==null&&typeof I=="string"&&(I=T.createHTML(""));Ne&&Ne(f),an=f}},Dc=V({},[...vi,...bi,...Xd]),$c=V({},[...ki,...Jd]),U0=function(f){let S=w(f);(!S||!S.tagName)&&(S={namespaceURI:Pt,tagName:"template"});const O=na(f.tagName),ne=na(S.tagName);return go[f.namespaceURI]?f.namespaceURI===Nt?S.namespaceURI===_t?O==="svg":S.namespaceURI===at?O==="svg"&&(ne==="annotation-xml"||Na[ne]):!!Dc[O]:f.namespaceURI===at?S.namespaceURI===_t?O==="math":S.namespaceURI===Nt?O==="math"&&Pa[ne]:!!$c[O]:f.namespaceURI===_t?S.namespaceURI===Nt&&!Pa[ne]||S.namespaceURI===at&&!Na[ne]?!1:!$c[O]&&(z0[O]||!Dc[O]):!!(Dn==="application/xhtml+xml"&&go[f.namespaceURI]):!1},Dt=function(f){kn(e.removed,{element:f});try{w(f).removeChild(f)}catch{A(f)}},on=function(f,S){try{kn(e.removed,{attribute:S.getAttributeNode(f),from:S})}catch{kn(e.removed,{attribute:null,from:S})}if(S.removeAttribute(f),f==="is")if(ft||tr)try{Dt(S)}catch{}else try{S.setAttribute(f,"")}catch{}},zc=function(f){let S=null,O=null;if(Ve)f="<remove></remove>"+f;else{const me=Gs(f,/^[\r\n\t ]+/);O=me&&me[0]}Dn==="application/xhtml+xml"&&Pt===_t&&(f='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+f+"</body></html>");const ne=T?T.createHTML(f):f;if(Pt===_t)try{S=new h().parseFromString(ne,Dn)}catch{}if(!S||!S.documentElement){S=U.createDocument(Pt,"template",null);try{S.documentElement.innerHTML=po?I:ne}catch{}}const Re=S.body||S.documentElement;return f&&O&&Re.insertBefore(r.createTextNode(O),Re.childNodes[0]||null),Pt===_t?ce.call(S,ie?"html":"body")[0]:ie?S.documentElement:Re},Fc=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)},vo=function(f){return f instanceof p&&(typeof f.nodeName!="string"||typeof f.textContent!="string"||typeof f.removeChild!="function"||!(f.attributes instanceof d)||typeof f.removeAttribute!="function"||typeof f.setAttribute!="function"||typeof f.namespaceURI!="string"||typeof f.insertBefore!="function"||typeof f.hasChildNodes!="function")},Bc=function(f){return typeof s=="function"&&f instanceof s};function rr(M,f,S){ra(M,O=>{O.call(e,f,S,an)})}const jc=function(f){let S=null;if(rr(ae.beforeSanitizeElements,f,null),vo(f))return Dt(f),!0;const O=Se(f.nodeName);if(rr(ae.uponSanitizeElement,f,{tagName:O,allowedTags:ue}),xe&&f.hasChildNodes()&&!Bc(f.firstElementChild)&&Pe(/<[/\w!]/g,f.innerHTML)&&Pe(/<[/\w!]/g,f.textContent)||f.nodeType===xn.progressingInstruction||xe&&f.nodeType===xn.comment&&Pe(/<[/\w]/g,f.data))return Dt(f),!0;if(!ue[O]||G[O]){if(!G[O]&&qc(O)&&(z.tagNameCheck instanceof RegExp&&Pe(z.tagNameCheck,O)||z.tagNameCheck instanceof Function&&z.tagNameCheck(O)))return!1;if(nn&&!Ze[O]){const ne=w(f)||f.parentNode,Re=k(f)||f.childNodes;if(Re&&ne){const me=Re.length;for(let Ge=me-1;Ge>=0;--Ge){const nr=b(Re[Ge],!0);nr.__removalCount=(f.__removalCount||0)+1,ne.insertBefore(nr,y(f))}}}return Dt(f),!0}return f instanceof c&&!U0(f)||(O==="noscript"||O==="noembed"||O==="noframes")&&Pe(/<\/no(script|embed|frames)/i,f.innerHTML)?(Dt(f),!0):(_e&&f.nodeType===xn.text&&(S=f.textContent,ra([er,gr,mr],ne=>{S=yn(S,ne," ")}),f.textContent!==S&&(kn(e.removed,{element:f.cloneNode()}),f.textContent=S)),rr(ae.afterSanitizeElements,f,null),!1)},Uc=function(f,S,O){if(Nn&&(S==="id"||S==="name")&&(O in r||O in j0))return!1;if(!(le&&!Ue[S]&&Pe(rn,S))){if(!(ye&&Pe(co,S))){if(!ge[S]||Ue[S]){if(!(qc(f)&&(z.tagNameCheck instanceof RegExp&&Pe(z.tagNameCheck,f)||z.tagNameCheck instanceof Function&&z.tagNameCheck(f))&&(z.attributeNameCheck instanceof RegExp&&Pe(z.attributeNameCheck,S)||z.attributeNameCheck instanceof Function&&z.attributeNameCheck(S))||S==="is"&&z.allowCustomizedBuiltInElements&&(z.tagNameCheck instanceof RegExp&&Pe(z.tagNameCheck,O)||z.tagNameCheck instanceof Function&&z.tagNameCheck(O))))return!1}else if(!Pn[S]){if(!Pe(Ia,yn(O,Ra,""))){if(!((S==="src"||S==="xlink:href"||S==="href")&&f!=="script"&&Wd(O,"data:")===0&&Oa[f])){if(!(qe&&!Pe(uo,yn(O,Ra,"")))){if(O)return!1}}}}}}return!0},qc=function(f){return f!=="annotation-xml"&&Gs(f,ho)},Vc=function(f){rr(ae.beforeSanitizeAttributes,f,null);const{attributes:S}=f;if(!S||vo(f))return;const O={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ge,forceKeepAttr:void 0};let ne=S.length;for(;ne--;){const Re=S[ne],{name:me,namespaceURI:Ge,value:nr}=Re,$n=Se(me),bo=nr;let Ie=me==="value"?bo:Qd(bo);if(O.attrName=$n,O.attrValue=Ie,O.keepAttr=!0,O.forceKeepAttr=void 0,rr(ae.uponSanitizeAttribute,f,O),Ie=O.attrValue,La&&($n==="id"||$n==="name")&&(on(me,f),Ie=fo+Ie),xe&&Pe(/((--!?|])>)|<\/(style|title)/i,Ie)){on(me,f);continue}if(O.forceKeepAttr)continue;if(!O.keepAttr){on(me,f);continue}if(!we&&Pe(/\/>/i,Ie)){on(me,f);continue}_e&&ra([er,gr,mr],Zc=>{Ie=yn(Ie,Zc," ")});const Hc=Se(f.nodeName);if(!Uc(Hc,$n,Ie)){on(me,f);continue}if(T&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!Ge)switch(v.getAttributeType(Hc,$n)){case"TrustedHTML":{Ie=T.createHTML(Ie);break}case"TrustedScriptURL":{Ie=T.createScriptURL(Ie);break}}if(Ie!==bo)try{Ge?f.setAttributeNS(Ge,me,Ie):f.setAttribute(me,Ie),vo(f)?Dt(f):Zs(e.removed)}catch{on(me,f)}}rr(ae.afterSanitizeAttributes,f,null)},q0=function M(f){let S=null;const O=Fc(f);for(rr(ae.beforeSanitizeShadowDOM,f,null);S=O.nextNode();)rr(ae.uponSanitizeShadowNode,S,null),jc(S),Vc(S),S.content instanceof i&&M(S.content);rr(ae.afterSanitizeShadowDOM,f,null)};return e.sanitize=function(M){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},S=null,O=null,ne=null,Re=null;if(po=!M,po&&(M="<!-->"),typeof M!="string"&&!Bc(M))if(typeof M.toString=="function"){if(M=M.toString(),typeof M!="string")throw wn("dirty is not a string, aborting")}else throw wn("toString is not a function");if(!e.isSupported)return M;if(rt||mo(f),e.removed=[],typeof M=="string"&&($r=!1),$r){if(M.nodeName){const nr=Se(M.nodeName);if(!ue[nr]||G[nr])throw wn("root node is forbidden and cannot be sanitized in-place")}}else if(M instanceof s)S=zc("<!---->"),O=S.ownerDocument.importNode(M,!0),O.nodeType===xn.element&&O.nodeName==="BODY"||O.nodeName==="HTML"?S=O:S.appendChild(O);else{if(!ft&&!_e&&!ie&&M.indexOf("<")===-1)return T&&Ot?T.createHTML(M):M;if(S=zc(M),!S)return ft?null:Ot?I:""}S&&Ve&&Dt(S.firstChild);const me=Fc($r?M:S);for(;ne=me.nextNode();)jc(ne),Vc(ne),ne.content instanceof i&&q0(ne.content);if($r)return M;if(ft){if(tr)for(Re=je.call(S.ownerDocument);S.firstChild;)Re.appendChild(S.firstChild);else Re=S;return(ge.shadowroot||ge.shadowrootmode)&&(Re=pr.call(n,Re,!0)),Re}let Ge=ie?S.outerHTML:S.innerHTML;return ie&&ue["!doctype"]&&S.ownerDocument&&S.ownerDocument.doctype&&S.ownerDocument.doctype.name&&Pe(Js,S.ownerDocument.doctype.name)&&(Ge="<!DOCTYPE "+S.ownerDocument.doctype.name+`>
|
|
17
|
+
`+Ge),_e&&ra([er,gr,mr],nr=>{Ge=yn(Ge,nr," ")}),T&&Ot?T.createHTML(Ge):Ge},e.setConfig=function(){let M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};mo(M),rt=!0},e.clearConfig=function(){an=null,rt=!1},e.isValidAttribute=function(M,f,S){an||mo({});const O=Se(M),ne=Se(f);return Uc(O,ne,S)},e.addHook=function(M,f){typeof f=="function"&&kn(ae[M],f)},e.removeHook=function(M,f){if(f!==void 0){const S=Zd(ae[M],f);return S===-1?void 0:Gd(ae[M],S,1)[0]}return Zs(ae[M])},e.removeHooks=function(M){ae[M]=[]},e.removeAllHooks=function(){ae=tl()},e}var uh=rl();function wi(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Rr=wi();function nl(t){Rr=t}var Sn={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($e.caret,"$1"),r=r.replace(a,o),n},getRegex:()=>new RegExp(r,e)};return n}var $e={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")},dh=/^(?:[ \t]*(?:\n|$))+/,hh=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,fh=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Tn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ph=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,_i=/(?:[*+-]|\d{1,9}[.)])/,al=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,il=Y(al).replace(/bull/g,_i).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(),gh=Y(al).replace(/bull/g,_i).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(),xi=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,mh=/^[^\n]+/,Si=/(?!\s*\])(?:\\.|[^\[\]\\])+/,vh=Y(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Si).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),bh=Y(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,_i).getRegex(),ia="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",Ti=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,kh=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",Ti).replace("tag",ia).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ol=Y(xi).replace("hr",Tn).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",ia).getRegex(),yh=Y(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ol).getRegex(),Ei={blockquote:yh,code:hh,def:vh,fences:fh,heading:ph,hr:Tn,html:kh,lheading:il,list:bh,newline:dh,paragraph:ol,table:Sn,text:mh},sl=Y("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Tn).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",ia).getRegex(),wh={...Ei,lheading:gh,table:sl,paragraph:Y(xi).replace("hr",Tn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",sl).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",ia).getRegex()},_h={...Ei,html:Y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ti).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:Sn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Y(xi).replace("hr",Tn).replace("heading",` *#{1,6} *[^
|
|
18
|
+
]`).replace("lheading",il).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},xh=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Sh=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ll=/^( {2,}|\\)\n(?!\s*$)/,Th=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,oa=/[\p{P}\p{S}]/u,Ci=/[\s\p{P}\p{S}]/u,cl=/[^\s\p{P}\p{S}]/u,Eh=Y(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ci).getRegex(),ul=/(?!~)[\p{P}\p{S}]/u,Ch=/(?!~)[\s\p{P}\p{S}]/u,Ah=/(?:[^\s\p{P}\p{S}]|~)/u,Rh=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,dl=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Ih=Y(dl,"u").replace(/punct/g,oa).getRegex(),Lh=Y(dl,"u").replace(/punct/g,ul).getRegex(),hl="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Oh=Y(hl,"gu").replace(/notPunctSpace/g,cl).replace(/punctSpace/g,Ci).replace(/punct/g,oa).getRegex(),Mh=Y(hl,"gu").replace(/notPunctSpace/g,Ah).replace(/punctSpace/g,Ch).replace(/punct/g,ul).getRegex(),Nh=Y("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,cl).replace(/punctSpace/g,Ci).replace(/punct/g,oa).getRegex(),Ph=Y(/\\(punct)/,"gu").replace(/punct/g,oa).getRegex(),Dh=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(),$h=Y(Ti).replace("(?:-->|$)","-->").getRegex(),zh=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",$h).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),sa=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Fh=Y(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",sa).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),fl=Y(/^!?\[(label)\]\[(ref)\]/).replace("label",sa).replace("ref",Si).getRegex(),pl=Y(/^!?\[(ref)\](?:\[\])?/).replace("ref",Si).getRegex(),Bh=Y("reflink|nolink(?!\\()","g").replace("reflink",fl).replace("nolink",pl).getRegex(),Ai={_backpedal:Sn,anyPunctuation:Ph,autolink:Dh,blockSkip:Rh,br:ll,code:Sh,del:Sn,emStrongLDelim:Ih,emStrongRDelimAst:Oh,emStrongRDelimUnd:Nh,escape:xh,link:Fh,nolink:pl,punctuation:Eh,reflink:fl,reflinkSearch:Bh,tag:zh,text:Th,url:Sn},jh={...Ai,link:Y(/^!?\[(label)\]\((.*?)\)/).replace("label",sa).getRegex(),reflink:Y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",sa).getRegex()},Ri={...Ai,emStrongRDelimAst:Mh,emStrongLDelim:Lh,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.!#$%&'*+\/=?_`{\|}~-]+@)))/},Uh={...Ri,br:Y(ll).replace("{2,}","*").getRegex(),text:Y(Ri.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},la={normal:Ei,gfm:wh,pedantic:_h},En={normal:Ai,gfm:Ri,breaks:Uh,pedantic:jh},qh={"&":"&","<":"<",">":">",'"':""","'":"'"},gl=t=>qh[t];function Rt(t,e){if(e){if($e.escapeTest.test(t))return t.replace($e.escapeReplace,gl)}else if($e.escapeTestNoEncode.test(t))return t.replace($e.escapeReplaceNoEncode,gl);return t}function ml(t){try{t=encodeURI(t).replace($e.percentDecode,"%")}catch{return null}return t}function vl(t,e){const r=t.replace($e.findPipe,(i,o,s)=>{let c=!1,l=o;for(;--l>=0&&s[l]==="\\";)c=!c;return c?"|":" |"}),n=r.split($e.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($e.slashPipe,"|");return n}function Cn(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 Vh(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 bl(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 Hh(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
|
-
`)}var ca=class{options;rules;lexer;constructor(t){this.options=t||Rr}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:
|
|
21
|
-
`)}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const r=e[0],n=
|
|
22
|
-
`)}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){let r=
|
|
20
|
+
`)}var ca=class{options;rules;lexer;constructor(t){this.options=t||Rr}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:Cn(r,`
|
|
21
|
+
`)}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const r=e[0],n=Hh(r,e[3]||"",this.rules);return{type:"code",raw:r,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:n}}}heading(t){const e=this.rules.block.heading.exec(t);if(e){let r=e[2].trim();if(this.rules.other.endingHash.test(r)){const n=Cn(r,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(r=n.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){const e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:Cn(e[0],`
|
|
22
|
+
`)}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){let r=Cn(e[0],`
|
|
23
23
|
`).split(`
|
|
24
24
|
`),n="",a="";const i=[];for(;r.length>0;){let o=!1;const s=[];let c;for(c=0;c<r.length;c++)if(this.rules.other.blockquoteStart.test(r[c]))s.push(r[c]),o=!0;else if(!o)s.push(r[c]);else break;r=r.slice(c);const l=s.join(`
|
|
25
25
|
`),d=l.replace(this.rules.other.blockquoteSetextReplace,`
|
|
@@ -39,7 +39,7 @@ ${d}`:d;const p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.block
|
|
|
39
39
|
`+h}!v&&!h.trim()&&(v=!0),l+=U+`
|
|
40
40
|
`,t=t.substring(U.length+1),p=Q.slice(m)}}a.loose||(o?a.loose=!0:this.rules.other.doubleBlankLine.test(l)&&(o=!0));let b=null,A;this.options.gfm&&(b=this.rules.other.listIsTask.exec(d),b&&(A=b[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:l,task:!!b,checked:A,loose:!1,text:d,tokens:[]}),a.raw+=l}const s=a.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let c=0;c<a.items.length;c++)if(this.lexer.state.top=!1,a.items[c].tokens=this.lexer.blockTokens(a.items[c].text,[]),!a.loose){const l=a.items[c].tokens.filter(p=>p.type==="space"),d=l.length>0&&l.some(p=>this.rules.other.anyLine.test(p.raw));a.loose=d}if(a.loose)for(let c=0;c<a.items.length;c++)a.items[c].loose=!0;return a}}html(t){const e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){const e=this.rules.block.def.exec(t);if(e){const r=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:r,raw:e[0],href:n,title:a}}}table(t){const e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;const r=vl(e[1]),n=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
41
41
|
`):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(r.length===n.length){for(const o of n)this.rules.other.tableAlignRight.test(o)?i.align.push("right"):this.rules.other.tableAlignCenter.test(o)?i.align.push("center"):this.rules.other.tableAlignLeft.test(o)?i.align.push("left"):i.align.push(null);for(let o=0;o<r.length;o++)i.header.push({text:r[o],tokens:this.lexer.inline(r[o]),header:!0,align:i.align[o]});for(const o of a)i.rows.push(vl(o,i.header.length).map((s,c)=>({text:s,tokens:this.lexer.inline(s),header:!1,align:i.align[c]})));return i}}lheading(t){const e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){const e=this.rules.block.paragraph.exec(t);if(e){const r=e[1].charAt(e[1].length-1)===`
|
|
42
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(t){const e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){const e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){const e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){const e=this.rules.inline.link.exec(t);if(e){const r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;const i=
|
|
42
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(t){const e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){const e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){const e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){const e=this.rules.inline.link.exec(t);if(e){const r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;const i=Cn(r.slice(0,-1),"\\");if((r.length-i.length)%2===0)return}else{const i=Vh(e[2],"()");if(i===-2)return;if(i>-1){const s=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,s).trim(),e[3]=""}}let n=e[2],a="";if(this.options.pedantic){const i=this.rules.other.pedanticHrefTitle.exec(n);i&&(n=i[1],a=i[3])}else a=e[3]?e[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?n=n.slice(1):n=n.slice(1,-1)),bl(e,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){const n=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=e[n.toLowerCase()];if(!a){const i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return bl(r,a,r[0],this.lexer,this.rules)}}emStrong(t,e,r=""){let n=this.rules.inline.emStrongLDelim.exec(t);if(!n||n[3]&&r.match(this.rules.other.unicodeAlphaNumeric))return;if(!(n[1]||n[2]||"")||!r||this.rules.inline.punctuation.exec(r)){const i=[...n[0]].length-1;let o,s,c=i,l=0;const d=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*t.length+i);(n=d.exec(e))!=null;){if(o=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!o)continue;if(s=[...o].length,n[3]||n[4]){c+=s;continue}else if((n[5]||n[6])&&i%3&&!((i+s)%3)){l+=s;continue}if(c-=s,c>0)continue;s=Math.min(s,s+c+l);const p=[...n[0]][0].length,h=t.slice(0,i+n.index+p+s);if(Math.min(i,s)%2){const m=h.slice(1,-1);return{type:"em",raw:h,text:m,tokens:this.lexer.inlineTokens(m)}}const v=h.slice(2,-2);return{type:"strong",raw:h,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(t){const e=this.rules.inline.code.exec(t);if(e){let r=e[2].replace(this.rules.other.newLineCharGlobal," ");const n=this.rules.other.nonSpaceChar.test(r),a=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return n&&a&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:e[0],text:r}}}br(t){const e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){const e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){const e=this.rules.inline.autolink.exec(t);if(e){let r,n;return e[2]==="@"?(r=e[1],n="mailto:"+r):(r=e[1],n=r),{type:"link",raw:e[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let r,n;if(e[2]==="@")r=e[0],n="mailto:"+r;else{let a;do a=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(a!==e[0]);r=e[0],e[1]==="www."?n="http://"+e[0]:n=e[0]}return{type:"link",raw:e[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t){const e=this.rules.inline.text.exec(t);if(e){const r=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:r}}}},Gt=class ko{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Rr,this.options.tokenizer=this.options.tokenizer||new ca,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const r={other:$e,block:la.normal,inline:En.normal};this.options.pedantic?(r.block=la.pedantic,r.inline=En.pedantic):this.options.gfm&&(r.block=la.gfm,this.options.breaks?r.inline=En.breaks:r.inline=En.gfm),this.tokenizer.rules=r}static get rules(){return{block:la,inline:En}}static lex(e,r){return new ko(r).lex(e)}static lexInline(e,r){return new ko(r).inlineTokens(e)}lex(e){e=e.replace($e.carriageReturn,`
|
|
43
43
|
`),this.blockTokens(e,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){const n=this.inlineQueue[r];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],n=!1){for(this.options.pedantic&&(e=e.replace($e.tabCharGlobal," ").replace($e.spaceLine,""));e;){let a;if(this.options.extensions?.block?.some(o=>(a=o.call({lexer:this},e,r))?(e=e.substring(a.raw.length),r.push(a),!0):!1))continue;if(a=this.tokenizer.space(e)){e=e.substring(a.raw.length);const o=r.at(-1);a.raw.length===1&&o!==void 0?o.raw+=`
|
|
44
44
|
`:r.push(a);continue}if(a=this.tokenizer.code(e)){e=e.substring(a.raw.length);const o=r.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=`
|
|
45
45
|
`+a.raw,o.text+=`
|
|
@@ -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>${Rt(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=ml(t);if(a===null)return n;t=a;let i='<a href="'+t+'"';return e&&(i+=' title="'+Rt(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=ml(t);if(a===null)return Rt(r);t=a;let i=`<img src="${t}" alt="${r}"`;return e&&(i+=` title="${Rt(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Rt(t.text)}},Ii=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""}},Wt=class yo{options;renderer;textRenderer;constructor(e){this.options=e||Rr,this.options.renderer=this.options.renderer||new ua,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ii}static parse(e,r){return new yo(r).parse(e)}static parseInline(e,r){return new yo(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}},da=class{options;block;constructor(t){this.options=t||Rr}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?Gt.lex:Gt.lexInline}provideParser(){return this.block?Wt.parse:Wt.parseInline}},kl=class{defaults=wi();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Wt;Renderer=ua;TextRenderer=Ii;Lexer=Gt;Tokenizer=ca;Hooks=da;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 ua(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 d=s.apply(a,l);return d===!1&&(d=c.apply(a,l)),d||""}}n.renderer=a}if(r.tokenizer){const a=this.defaults.tokenizer||new ca(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 d=s.apply(a,l);return d===!1&&(d=c.apply(a,l)),d}}n.tokenizer=a}if(r.hooks){const a=this.defaults.hooks||new da;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];da.passThroughHooks.has(i)?a[o]=l=>{if(this.defaults.async)return Promise.resolve(s.call(a,l)).then(p=>c.call(a,p));const d=s.call(a,l);return c.call(a,d)}:a[o]=(...l)=>{let d=s.apply(a,l);return d===!1&&(d=c.apply(a,l)),d}}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 Gt.lex(t,e??this.defaults)}parser(t,e){return Wt.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?Gt.lex:Gt.lexInline,c=i.hooks?i.hooks.provideParser():t?Wt.parse:Wt.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 d=c(l,i);return i.hooks&&(d=i.hooks.postprocess(d)),d}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>"+Rt(r.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(r);throw r}}},Ir=new kl;function X(t,e){return Ir.parse(t,e)}X.options=X.setOptions=function(t){return Ir.setOptions(t),X.defaults=Ir.defaults,nl(X.defaults),X},X.getDefaults=wi,X.defaults=Rr,X.use=function(...t){return Ir.use(...t),X.defaults=Ir.defaults,nl(X.defaults),X},X.walkTokens=function(t,e){return Ir.walkTokens(t,e)},X.parseInline=Ir.parseInline,X.Parser=Wt,X.parser=Wt.parse,X.Renderer=ua,X.TextRenderer=Ii,X.Lexer=Gt,X.lexer=Gt.lex,X.Tokenizer=ca,X.Hooks=da,X.parse=X,X.options,X.setOptions,X.use,X.walkTokens,X.parseInline,Wt.parse,Gt.lex;const yl=t=>(Object.getOwnPropertyNames(t).forEach(e=>{const r=t[e];r&&typeof r=="object"&&yl(r)}),Object.freeze(t)),wl=yl({all:[],used:[],unused:[]}),qh=(t,e)=>{const r=sh(t);return r.addHook("uponSanitizeElement",function(n,a){const i=a.tagName||n.nodeName.toLowerCase();i.startsWith("liipgpt-")&&(a.allowedTags[i]=!0)}),r.addHook("afterSanitizeAttributes",function(n){if(n.tagName!=="A"||!n.getAttribute("href")?.startsWith("http")||(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer"),!e||n.querySelector(".sr-only")))return;const a=n.ownerDocument.createElement("span");a.className="sr-only",a.textContent=` ${e}`,n.appendChild(a)}),r};class _l{marked;currentReferences=wl;lastUsedIndex=0;DomPurity;constructor(e={}){this.marked=new kl({async:!1,breaks:!0}).use(this.createFootnoteExtension(),...e.extensions??[]),this.DomPurity=qh(e.window,e.newTabSrText)}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"],ADD_ATTR:["target"]})}toHTML(e,r){this.currentReferences=r;const n=this.parse(e);return this.currentReferences=wl,n}}function Vh(){let t,e;return{promise:new Promise((n,a)=>{e=n,t=a}),reject:t,resolve:e}}class xl{promise;resolve;reject;constructor(){const{promise:e,resolve:r,reject:n}=Vh();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 Li{hasValue=new xl;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 Hh=t=>{try{return new URL(t).hostname}catch{return t}};function Zh(t){return t.replace(/<[^>]*>/g,"").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')}const Gh=({url:t,considered:e,title:r,description:n,summary:a})=>{const i=Hh(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 Wh{constructor(e){this.options=e,this.store=Ad({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 Li;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=Zh(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(Gh(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 Sl;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Sl||(Sl={}));const E=W.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),dr=t=>{switch(typeof t){case"undefined":return E.undefined;case"string":return E.string;case"number":return Number.isNaN(t)?E.nan:E.number;case"boolean":return E.boolean;case"function":return E.function;case"bigint":return E.bigint;case"symbol":return E.symbol;case"object":return Array.isArray(t)?E.array:t===null?E.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?E.promise:typeof Map<"u"&&t instanceof Map?E.map:typeof Set<"u"&&t instanceof Set?E.set:typeof Date<"u"&&t instanceof Date?E.date:E.object;default:return E.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 Qt 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 Qt))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()}}Qt.create=t=>new Qt(t);const Oi=(t,e)=>{let r;switch(t.code){case x.invalid_type:t.received===E.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 Qh=Oi;function Yh(){return Qh}const Kh=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 C(t,e){const r=Yh(),n=Kh({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Oi?void 0:Oi].filter(a=>!!a)});t.common.issues.push(n)}class ze{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 P;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 ze.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 P;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 P=Object.freeze({status:"aborted"}),An=t=>({status:"dirty",value:t}),ut=t=>({status:"valid",value:t}),Tl=t=>t.status==="aborted",Cl=t=>t.status==="dirty",Yr=t=>t.status==="valid",ha=t=>typeof Promise<"u"&&t instanceof Promise;var L;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(L||(L={}));class It{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 El=(t,e)=>{if(Yr(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 Qt(t.common.issues);return this._error=r,this._error}}};function F(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 dr(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:dr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ze,ctx:{common:e.parent.common,data:e.data,parsedType:dr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(ha(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:dr(e)},a=this._parseSync({data:e,path:n.path,parent:n});return El(n,a)}"~validate"(e){const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:dr(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:r});return Yr(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=>Yr(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:dr(e)},a=this._parse({data:e,path:n.path,parent:n}),i=await(ha(a)?a:Promise.resolve(a));return El(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 Mr({schema:this,typeName:D.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 Xt.create(this,this._def)}nullable(){return Nr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Lt.create(this)}promise(){return ba.create(this,this._def)}or(e){return pa.create([this,e],this._def)}and(e){return ga.create(this,e,this._def)}transform(e){return new Mr({...F(this._def),schema:this,typeName:D.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new ka({...F(this._def),innerType:this,defaultValue:r,typeName:D.ZodDefault})}brand(){return new $l({typeName:D.ZodBranded,type:this,...F(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new ya({...F(this._def),innerType:this,catchValue:r,typeName:D.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return ji.create(this,e)}readonly(){return wa.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Xh=/^c[^\s-]{8,}$/i,Jh=/^[0-9a-z]+$/,ef=/^[0-9A-HJKMNP-TV-Z]{26}$/i,tf=/^[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,rf=/^[a-z0-9_-]{21}$/i,nf=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,af=/^[-+]?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)?)??$/,of=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,sf="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Mi;const lf=/^(?:(?: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])$/,cf=/^(?:(?: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])$/,uf=/^(([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]))$/,df=/^(([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])$/,hf=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ff=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Al="((\\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])))",pf=new RegExp(`^${Al}$`);function Rl(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 gf(t){return new RegExp(`^${Rl(t)}$`)}function mf(t){let e=`${Al}T${Rl(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 vf(t,e){return!!((e==="v4"||!e)&&lf.test(t)||(e==="v6"||!e)&&uf.test(t))}function bf(t,e){if(!nf.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 kf(t,e){return!!((e==="v4"||!e)&&cf.test(t)||(e==="v6"||!e)&&df.test(t))}class Yt extends Z{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==E.string){const i=this._getOrReturnCtx(e);return C(i,{code:x.invalid_type,expected:E.string,received:i.parsedType}),P}const n=new ze;let a;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(a=this._getOrReturnCtx(e,a),C(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),C(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?C(a,{code:x.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):s&&C(a,{code:x.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")of.test(e.data)||(a=this._getOrReturnCtx(e,a),C(a,{validation:"email",code:x.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Mi||(Mi=new RegExp(sf,"u")),Mi.test(e.data)||(a=this._getOrReturnCtx(e,a),C(a,{validation:"emoji",code:x.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")tf.test(e.data)||(a=this._getOrReturnCtx(e,a),C(a,{validation:"uuid",code:x.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")rf.test(e.data)||(a=this._getOrReturnCtx(e,a),C(a,{validation:"nanoid",code:x.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")Xh.test(e.data)||(a=this._getOrReturnCtx(e,a),C(a,{validation:"cuid",code:x.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")Jh.test(e.data)||(a=this._getOrReturnCtx(e,a),C(a,{validation:"cuid2",code:x.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")ef.test(e.data)||(a=this._getOrReturnCtx(e,a),C(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),C(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),C(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),C(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),C(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),C(a,{code:x.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?mf(i).test(e.data)||(a=this._getOrReturnCtx(e,a),C(a,{code:x.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?pf.test(e.data)||(a=this._getOrReturnCtx(e,a),C(a,{code:x.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?gf(i).test(e.data)||(a=this._getOrReturnCtx(e,a),C(a,{code:x.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?af.test(e.data)||(a=this._getOrReturnCtx(e,a),C(a,{validation:"duration",code:x.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?vf(e.data,i.version)||(a=this._getOrReturnCtx(e,a),C(a,{validation:"ip",code:x.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?bf(e.data,i.alg)||(a=this._getOrReturnCtx(e,a),C(a,{validation:"jwt",code:x.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?kf(e.data,i.version)||(a=this._getOrReturnCtx(e,a),C(a,{validation:"cidr",code:x.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?hf.test(e.data)||(a=this._getOrReturnCtx(e,a),C(a,{validation:"base64",code:x.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?ff.test(e.data)||(a=this._getOrReturnCtx(e,a),C(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,...L.errToObj(n)})}_addCheck(e){return new Yt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...L.errToObj(e)})}url(e){return this._addCheck({kind:"url",...L.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...L.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...L.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...L.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...L.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...L.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...L.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...L.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...L.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...L.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...L.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...L.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,...L.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,...L.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...L.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...L.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...L.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...L.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...L.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...L.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...L.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...L.errToObj(r)})}nonempty(e){return this.min(1,L.errToObj(e))}trim(){return new Yt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Yt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Yt({...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}}Yt.create=t=>new Yt({checks:[],typeName:D.ZodString,coerce:t?.coerce??!1,...F(t)});function yf(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 Kr 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)!==E.number){const i=this._getOrReturnCtx(e);return C(i,{code:x.invalid_type,expected:E.number,received:i.parsedType}),P}let n;const a=new ze;for(const i of this._def.checks)i.kind==="int"?W.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),C(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),C(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),C(n,{code:x.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?yf(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),C(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),C(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,L.toString(r))}gt(e,r){return this.setLimit("min",e,!1,L.toString(r))}lte(e,r){return this.setLimit("max",e,!0,L.toString(r))}lt(e,r){return this.setLimit("max",e,!1,L.toString(r))}setLimit(e,r,n,a){return new Kr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:L.toString(a)}]})}_addCheck(e){return new Kr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:L.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:L.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:L.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:L.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:L.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:L.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:L.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:L.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:L.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)}}Kr.create=t=>new Kr({checks:[],typeName:D.ZodNumber,coerce:t?.coerce||!1,...F(t)});class Rn 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)!==E.bigint)return this._getInvalidInput(e);let n;const a=new ze;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),C(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),C(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),C(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 C(r,{code:x.invalid_type,expected:E.bigint,received:r.parsedType}),P}gte(e,r){return this.setLimit("min",e,!0,L.toString(r))}gt(e,r){return this.setLimit("min",e,!1,L.toString(r))}lte(e,r){return this.setLimit("max",e,!0,L.toString(r))}lt(e,r){return this.setLimit("max",e,!1,L.toString(r))}setLimit(e,r,n,a){return new Rn({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:L.toString(a)}]})}_addCheck(e){return new Rn({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:L.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:L.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:L.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:L.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:L.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}}Rn.create=t=>new Rn({checks:[],typeName:D.ZodBigInt,coerce:t?.coerce??!1,...F(t)});class Ni extends Z{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==E.boolean){const n=this._getOrReturnCtx(e);return C(n,{code:x.invalid_type,expected:E.boolean,received:n.parsedType}),P}return ut(e.data)}}Ni.create=t=>new Ni({typeName:D.ZodBoolean,coerce:t?.coerce||!1,...F(t)});class fa extends Z{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==E.date){const i=this._getOrReturnCtx(e);return C(i,{code:x.invalid_type,expected:E.date,received:i.parsedType}),P}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return C(i,{code:x.invalid_date}),P}const n=new ze;let a;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(a=this._getOrReturnCtx(e,a),C(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),C(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 fa({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:L.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:L.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}}fa.create=t=>new fa({checks:[],coerce:t?.coerce||!1,typeName:D.ZodDate,...F(t)});class Il extends Z{_parse(e){if(this._getType(e)!==E.symbol){const n=this._getOrReturnCtx(e);return C(n,{code:x.invalid_type,expected:E.symbol,received:n.parsedType}),P}return ut(e.data)}}Il.create=t=>new Il({typeName:D.ZodSymbol,...F(t)});class Pi extends Z{_parse(e){if(this._getType(e)!==E.undefined){const n=this._getOrReturnCtx(e);return C(n,{code:x.invalid_type,expected:E.undefined,received:n.parsedType}),P}return ut(e.data)}}Pi.create=t=>new Pi({typeName:D.ZodUndefined,...F(t)});class Di extends Z{_parse(e){if(this._getType(e)!==E.null){const n=this._getOrReturnCtx(e);return C(n,{code:x.invalid_type,expected:E.null,received:n.parsedType}),P}return ut(e.data)}}Di.create=t=>new Di({typeName:D.ZodNull,...F(t)});class Ll extends Z{constructor(){super(...arguments),this._any=!0}_parse(e){return ut(e.data)}}Ll.create=t=>new Ll({typeName:D.ZodAny,...F(t)});class Ol extends Z{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ut(e.data)}}Ol.create=t=>new Ol({typeName:D.ZodUnknown,...F(t)});class hr extends Z{_parse(e){const r=this._getOrReturnCtx(e);return C(r,{code:x.invalid_type,expected:E.never,received:r.parsedType}),P}}hr.create=t=>new hr({typeName:D.ZodNever,...F(t)});class Ml extends Z{_parse(e){if(this._getType(e)!==E.undefined){const n=this._getOrReturnCtx(e);return C(n,{code:x.invalid_type,expected:E.void,received:n.parsedType}),P}return ut(e.data)}}Ml.create=t=>new Ml({typeName:D.ZodVoid,...F(t)});class Lt extends Z{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),a=this._def;if(r.parsedType!==E.array)return C(r,{code:x.invalid_type,expected:E.array,received:r.parsedType}),P;if(a.exactLength!==null){const o=r.data.length>a.exactLength.value,s=r.data.length<a.exactLength.value;(o||s)&&(C(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&&(C(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&&(C(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 It(r,o,r.path,s)))).then(o=>ze.mergeArray(n,o));const i=[...r.data].map((o,s)=>a.type._parseSync(new It(r,o,r.path,s)));return ze.mergeArray(n,i)}get element(){return this._def.type}min(e,r){return new Lt({...this._def,minLength:{value:e,message:L.toString(r)}})}max(e,r){return new Lt({...this._def,maxLength:{value:e,message:L.toString(r)}})}length(e,r){return new Lt({...this._def,exactLength:{value:e,message:L.toString(r)}})}nonempty(e){return this.min(1,e)}}Lt.create=(t,e)=>new Lt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:D.ZodArray,...F(e)});function Xr(t){if(t instanceof de){const e={};for(const r in t.shape){const n=t.shape[r];e[r]=Xt.create(Xr(n))}return new de({...t._def,shape:()=>e})}else return t instanceof Lt?new Lt({...t._def,type:Xr(t.element)}):t instanceof Xt?Xt.create(Xr(t.unwrap())):t instanceof Nr?Nr.create(Xr(t.unwrap())):t instanceof Lr?Lr.create(t.items.map(e=>Xr(e))):t}class de 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)!==E.object){const l=this._getOrReturnCtx(e);return C(l,{code:x.invalid_type,expected:E.object,received:l.parsedType}),P}const{status:n,ctx:a}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof hr&&this._def.unknownKeys==="strip"))for(const l in a.data)o.includes(l)||s.push(l);const c=[];for(const l of o){const d=i[l],p=a.data[l];c.push({key:{status:"valid",value:l},value:d._parse(new It(a,p,a.path,l)),alwaysSet:l in a.data})}if(this._def.catchall instanceof hr){const l=this._def.unknownKeys;if(l==="passthrough")for(const d of s)c.push({key:{status:"valid",value:d},value:{status:"valid",value:a.data[d]}});else if(l==="strict")s.length>0&&(C(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 d of s){const p=a.data[d];c.push({key:{status:"valid",value:d},value:l._parse(new It(a,p,a.path,d)),alwaysSet:d in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const l=[];for(const d of c){const p=await d.key,h=await d.value;l.push({key:p,value:h,alwaysSet:d.alwaysSet})}return l}).then(l=>ze.mergeObjectSync(n,l)):ze.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return L.errToObj,new de({...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:L.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new de({...this._def,unknownKeys:"strip"})}passthrough(){return new de({...this._def,unknownKeys:"passthrough"})}extend(e){return new de({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new de({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:D.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new de({...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 de({...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 de({...this._def,shape:()=>r})}deepPartial(){return Xr(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 de({...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 Xt;)i=i._def.innerType;r[n]=i}return new de({...this._def,shape:()=>r})}keyof(){return Pl(W.objectKeys(this.shape))}}de.create=(t,e)=>new de({shape:()=>t,unknownKeys:"strip",catchall:hr.create(),typeName:D.ZodObject,...F(e)}),de.strictCreate=(t,e)=>new de({shape:()=>t,unknownKeys:"strict",catchall:hr.create(),typeName:D.ZodObject,...F(e)}),de.lazycreate=(t,e)=>new de({shape:t,unknownKeys:"strip",catchall:hr.create(),typeName:D.ZodObject,...F(e)});class pa 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 Qt(s.ctx.common.issues));return C(r,{code:x.invalid_union,unionErrors:o}),P}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},d=c._parseSync({data:r.data,path:r.path,parent:l});if(d.status==="valid")return d;d.status==="dirty"&&!i&&(i={result:d,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 Qt(c));return C(r,{code:x.invalid_union,unionErrors:s}),P}}get options(){return this._def.options}}pa.create=(t,e)=>new pa({options:t,typeName:D.ZodUnion,...F(e)});const Kt=t=>t instanceof Fi?Kt(t.schema):t instanceof Mr?Kt(t.innerType()):t instanceof va?[t.value]:t instanceof Or?t.options:t instanceof Bi?W.objectValues(t.enum):t instanceof ka?Kt(t._def.innerType):t instanceof Pi?[void 0]:t instanceof Di?[null]:t instanceof Xt?[void 0,...Kt(t.unwrap())]:t instanceof Nr?[null,...Kt(t.unwrap())]:t instanceof $l||t instanceof wa?Kt(t.unwrap()):t instanceof ya?Kt(t._def.innerType):[];class $i extends Z{_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==E.object)return C(r,{code:x.invalid_type,expected:E.object,received:r.parsedType}),P;const n=this.discriminator,a=r.data[n],i=this.optionsMap.get(a);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(C(r,{code:x.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),P)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){const a=new Map;for(const i of r){const o=Kt(i.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const s of o){if(a.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);a.set(s,i)}}return new $i({typeName:D.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:a,...F(n)})}}function zi(t,e){const r=dr(t),n=dr(e);if(t===e)return{valid:!0,data:t};if(r===E.object&&n===E.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=zi(t[s],e[s]);if(!c.valid)return{valid:!1};o[s]=c.data}return{valid:!0,data:o}}else if(r===E.array&&n===E.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=zi(o,s);if(!c.valid)return{valid:!1};a.push(c.data)}return{valid:!0,data:a}}else return r===E.date&&n===E.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class ga extends Z{_parse(e){const{status:r,ctx:n}=this._processInputParams(e),a=(i,o)=>{if(Tl(i)||Tl(o))return P;const s=zi(i.value,o.value);return s.valid?((Cl(i)||Cl(o))&&r.dirty(),{status:r.value,value:s.data}):(C(n,{code:x.invalid_intersection_types}),P)};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}))}}ga.create=(t,e,r)=>new ga({left:t,right:e,typeName:D.ZodIntersection,...F(r)});class Lr extends Z{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==E.array)return C(n,{code:x.invalid_type,expected:E.array,received:n.parsedType}),P;if(n.data.length<this._def.items.length)return C(n,{code:x.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),P;!this._def.rest&&n.data.length>this._def.items.length&&(C(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 It(n,o,n.path,s)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>ze.mergeArray(r,o)):ze.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new Lr({...this._def,rest:e})}}Lr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Lr({items:t,typeName:D.ZodTuple,rest:null,...F(e)})};class ma 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!==E.object)return C(n,{code:x.invalid_type,expected:E.object,received:n.parsedType}),P;const a=[],i=this._def.keyType,o=this._def.valueType;for(const s in n.data)a.push({key:i._parse(new It(n,s,n.path,s)),value:o._parse(new It(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?ze.mergeObjectAsync(r,a):ze.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof Z?new ma({keyType:e,valueType:r,typeName:D.ZodRecord,...F(n)}):new ma({keyType:Yt.create(),valueType:e,typeName:D.ZodRecord,...F(r)})}}class Nl 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!==E.map)return C(n,{code:x.invalid_type,expected:E.map,received:n.parsedType}),P;const a=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([s,c],l)=>({key:a._parse(new It(n,s,n.path,[l,"key"])),value:i._parse(new It(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,d=await c.value;if(l.status==="aborted"||d.status==="aborted")return P;(l.status==="dirty"||d.status==="dirty")&&r.dirty(),s.set(l.value,d.value)}return{status:r.value,value:s}})}else{const s=new Map;for(const c of o){const l=c.key,d=c.value;if(l.status==="aborted"||d.status==="aborted")return P;(l.status==="dirty"||d.status==="dirty")&&r.dirty(),s.set(l.value,d.value)}return{status:r.value,value:s}}}}Nl.create=(t,e,r)=>new Nl({valueType:e,keyType:t,typeName:D.ZodMap,...F(r)});class In extends Z{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==E.set)return C(n,{code:x.invalid_type,expected:E.set,received:n.parsedType}),P;const a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(C(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&&(C(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 d of c){if(d.status==="aborted")return P;d.status==="dirty"&&r.dirty(),l.add(d.value)}return{status:r.value,value:l}}const s=[...n.data.values()].map((c,l)=>i._parse(new It(n,c,n.path,l)));return n.common.async?Promise.all(s).then(c=>o(c)):o(s)}min(e,r){return new In({...this._def,minSize:{value:e,message:L.toString(r)}})}max(e,r){return new In({...this._def,maxSize:{value:e,message:L.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}In.create=(t,e)=>new In({valueType:t,minSize:null,maxSize:null,typeName:D.ZodSet,...F(e)});class Fi 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})}}Fi.create=(t,e)=>new Fi({getter:t,typeName:D.ZodLazy,...F(e)});class va extends Z{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return C(r,{received:r.data,code:x.invalid_literal,expected:this._def.value}),P}return{status:"valid",value:e.data}}get value(){return this._def.value}}va.create=(t,e)=>new va({value:t,typeName:D.ZodLiteral,...F(e)});function Pl(t,e){return new Or({values:t,typeName:D.ZodEnum,...F(e)})}class Or extends Z{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),n=this._def.values;return C(r,{expected:W.joinValues(n),received:r.parsedType,code:x.invalid_type}),P}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 C(r,{received:r.data,code:x.invalid_enum_value,options:n}),P}return ut(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 Or.create(e,{...this._def,...r})}exclude(e,r=this._def){return Or.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}}Or.create=Pl;class Bi extends Z{_parse(e){const r=W.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==E.string&&n.parsedType!==E.number){const a=W.objectValues(r);return C(n,{expected:W.joinValues(a),received:n.parsedType,code:x.invalid_type}),P}if(this._cache||(this._cache=new Set(W.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const a=W.objectValues(r);return C(n,{received:n.data,code:x.invalid_enum_value,options:a}),P}return ut(e.data)}get enum(){return this._def.values}}Bi.create=(t,e)=>new Bi({values:t,typeName:D.ZodNativeEnum,...F(e)});class ba extends Z{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==E.promise&&r.common.async===!1)return C(r,{code:x.invalid_type,expected:E.promise,received:r.parsedType}),P;const n=r.parsedType===E.promise?r.data:Promise.resolve(r.data);return ut(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}}ba.create=(t,e)=>new ba({type:t,typeName:D.ZodPromise,...F(e)});class Mr extends Z{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===D.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=>{C(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 P;const c=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return c.status==="aborted"?P:c.status==="dirty"||r.value==="dirty"?An(c.value):c});{if(r.value==="aborted")return P;const s=this._def.schema._parseSync({data:o,path:n.path,parent:n});return s.status==="aborted"?P:s.status==="dirty"||r.value==="dirty"?An(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"?P:(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"?P:(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(!Yr(o))return P;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=>Yr(o)?Promise.resolve(a.transform(o.value,i)).then(s=>({status:r.value,value:s})):P);W.assertNever(a)}}Mr.create=(t,e,r)=>new Mr({schema:t,typeName:D.ZodEffects,effect:e,...F(r)}),Mr.createWithPreprocess=(t,e,r)=>new Mr({schema:e,effect:{type:"preprocess",transform:t},typeName:D.ZodEffects,...F(r)});class Xt extends Z{_parse(e){return this._getType(e)===E.undefined?ut(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Xt.create=(t,e)=>new Xt({innerType:t,typeName:D.ZodOptional,...F(e)});class Nr extends Z{_parse(e){return this._getType(e)===E.null?ut(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Nr.create=(t,e)=>new Nr({innerType:t,typeName:D.ZodNullable,...F(e)});class ka extends Z{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===E.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}ka.create=(t,e)=>new ka({innerType:t,typeName:D.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...F(e)});class ya 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 ha(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Qt(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Qt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}ya.create=(t,e)=>new ya({innerType:t,typeName:D.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...F(e)});class Dl extends Z{_parse(e){if(this._getType(e)!==E.nan){const n=this._getOrReturnCtx(e);return C(n,{code:x.invalid_type,expected:E.nan,received:n.parsedType}),P}return{status:"valid",value:e.data}}}Dl.create=t=>new Dl({typeName:D.ZodNaN,...F(t)});class $l 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 ji 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"?P:i.status==="dirty"?(r.dirty(),An(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"?P: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 ji({in:e,out:r,typeName:D.ZodPipeline})}}class wa extends Z{_parse(e){const r=this._def.innerType._parse(e),n=a=>(Yr(a)&&(a.value=Object.freeze(a.value)),a);return ha(r)?r.then(a=>n(a)):n(r)}unwrap(){return this._def.innerType}}wa.create=(t,e)=>new wa({innerType:t,typeName:D.ZodReadonly,...F(e)});var D;(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"})(D||(D={}));const u=Yt.create,pe=Kr.create,K=Ni.create;hr.create;const J=Lt.create,R=de.create,Jt=pa.create,zl=$i.create;ga.create,Lr.create;const Je=ma.create,Fe=va.create,dt=Or.create;ba.create,Xt.create,Nr.create;const wf=Jt([u(),pe(),K(),J(u()),J(pe()),J(K())]),Ui=R({title:u(),description:u().optional(),badge:u().optional(),breadcrumbs:J(u()).optional(),previewImage:u().optional(),date:u().datetime().optional()}),_f=R({url:u().url(),score:pe(),metadata:Je(u(),wf),language:u().optional()}).merge(Ui),xf=R({componentName:Fe("buttons"),data:R({caption:u().optional(),buttons:J(R({label:u(),href:u().url().optional(),value:u(),variant:dt(["primary","secondary","tertiary"]).optional(),icon:u().optional(),target:u().optional()}))})}),Sf=R({componentName:Fe("combobox"),data:R({caption:u().optional(),placeholder:u(),values:J(R({label:u(),value:u()}))})}),Tf=R({componentName:Fe("alva-init"),data:R({})}),Cf=R({componentName:Fe("alva-score-survey"),data:R({})}),Ef=R({type:Fe("component"),id:u().optional(),time:u().optional(),hideAvatar:K().optional(),noSectionPadding:K().optional()}),Af=zl("componentName",[xf,Sf,Tf,Cf]).and(Ef);dt(["start","chat"]),zl("name",[R({name:Fe("start-page"),prefill:u().optional()}),R({name:Fe("consent-page")}),R({name:Fe("chat-page"),query:u()})]);const Rf=R({type:Fe("user"),time:u(),message:u(),id:u().optional()});dt(["idle","searching","answering"]);const If=Jt([u(),pe(),K(),J(u()),J(pe()),J(K())]),qi=R({url:u(),score:pe(),metadata:Je(u(),If),considered:K(),display:R({card:Ui,listItem:Ui})}).extend({referenceIndex:R({all:pe(),used:pe().optional()})}),Lf=R({all:J(qi),used:J(qi),unused:J(qi)}),Of=dt(["pii-detected","blocked","maintenance","rate-limit","server-error","too-short","too-long","quota-reached","aborted"]),Mf=Jt([Of,Fe("sse-error"),Fe("client-error"),Fe("unexpected-call")]),Fl=R({type:Fe("bot"),time:u(),id:u(),message:R({markdown:u(),html:u(),text:u()}),references:Lf,errors:J(Mf),retrievalQuestion:u().optional()}),Nf=Fl.extend({state:dt(["streaming","done"])}),Pf=Fl.extend({state:Fe("loading")}),Df=Jt([Pf,Nf]),Vi=Jt([Df,Rf,Af]);var Hi={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 Be=R({minRem:pe(),maxRem:pe()}).or(u()),_a=R({0:u().optional(),50:u(),100:u(),200:u(),300:u(),400:u(),500:u(),600:u(),700:u(),800:u(),900:u(),950:u(),1e3:u().optional()}),Zi=R({color:u().optional(),background:u().optional(),borderWidth:u().optional(),borderColor:u().optional(),boxShadow:u().optional()}),$f=R({borderRadius:Be.optional(),custom:Je(u(),Jt([u(),pe()])).optional(),hover:Zi.optional(),focus:Zi.optional()}).and(Zi),zf=R({family:u().optional()}),Ff=Je(dt(["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","embedAvatar"]),u()),Bf=R({font:zf.optional(),colors:R({brand:_a,accent:_a.optional(),highlight:_a,grey:_a}),base:R({fontSizeXs:Be.optional(),fontSizeSm:Be.optional(),fontSizeBody:Be.optional(),fontSizeH3:Be.optional(),fontSizeH2:Be.optional(),fontSizeH1:Be.optional(),fontWeightNormal:u().optional(),fontWeightBold:u().optional(),fontWeightTitle:u().optional(),lineHeightDefault:u().optional(),lineHeightSnug:u().optional(),lineHeightTight:u().optional(),borderRadius:Be.optional(),lineColor:u().optional(),boxShadow:u().optional()}),components:Je(u(),$f),svgs:Ff}),xa=R({customCSS:u().optional(),fontCSS:u().optional(),fontURLs:u().array().optional(),tokens:Bf});R({light:xa,dark:xa});const jf=R({light:xa,dark:xa}).deepPartial(),Bl=R({50:u(),100:u(),200:u(),300:u(),400:u(),500:u(),600:u(),700:u(),800:u(),900:u(),950:u()}),jl=dt(["slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"]),Ul=Jt([Bl,jl]),Uf=Jt([Bl.and(R({0:u(),1e3:u()})),jl]),ql=R({avatarImageUrl:u().optional(),colors:R({brand:Ul.optional(),highlight:Ul.optional(),grey:Uf.optional(),background:u().optional(),text:u().optional(),anchor:R({default:u().optional(),hover:u().optional()}).optional()}).optional(),font:R({family:u().optional(),urls:J(u()).optional(),sizeXs:Be.optional(),sizeSm:Be.optional(),sizeBody:Be.optional(),sizeH3:Be.optional(),sizeH2:Be.optional(),sizeH1:Be.optional(),weightNormal:u().optional(),weightBold:u().optional(),weightTitle:u().optional()}).optional(),borderRadius:Be.optional(),fineGrained:jf.optional()}),qf=R({blocked:u(),maintenance:u(),"rate-limit":u(),"server-error":u(),"too-short":u(),"too-long":u(),"quota-reached":u(),aborted:u(),"sse-error":u(),"client-error":u(),"unexpected-call":u(),"incomplete-error":u(),"feedback-failed":u(),"speech-not-supported":u(),"speech-transcription-failed":u(),"speech-no-text-detected":u(),"speech-microphone-access-denied":u(),"pii-detected":u()}),Vf=R({email:u(),creditCard:u(),ahv:u(),phoneSwiss:u(),phoneInternational:u(),swissPassport:u(),longNumber:u()}),Vl=R({name:u(),namePlural:u().optional(),intro:u().optional(),placeholder:u(),values:Je(u(),u())}),Hf=R({action:u(),label:u(),type:dt(["primary","secondary"]).optional()}),Zf=R({hash:u(),title:u(),content:u(),actions:J(Hf).optional()}),Hl=R({introductionTitle:u(),introductionDisclaimer:u().optional(),termsInvitationToConsent:u().optional(),chatInputPlaceholder:u(),chatInputPlaceholderListening:u().optional(),chatInputSubmit:u(),chatInputAbort:u(),chatInputStartListening:u(),chatInputStopListening:u(),referenceLink:u(),referencesDisplay:u(),referencesHide:u(),referencesTitle:u(),referencesFurtherTitle:u(),newChat:u(),maintenanceModeError:u(),messageBotLoading:u(),messageBotError:u(),messageBotDefaultError:u(),noResultsFound:u(),chatFooterText:u().optional(),scrollToBottom:u(),openButtonTitle:u().optional(),openButtonDescription:u().optional(),openMenu:u(),openInfo:u(),aboutThisChat:u().optional(),closeMenu:u(),closeChat:u(),close:u(),send:u(),thankYouForFeedback:u(),giveFeedback:u(),sendFeedback:u(),feedbackFormTitle:u(),feedbackFormMessage:u(),feedbackFormMessagePlaceholder:u(),feedbackFormEmail:u(),feedbackFormEmailPlaceholder:u(),askQuestionAgain:u(),answerGood:u(),answerBad:u(),classificationSubmit:u(),classificationThankYou:u(),classificationTitle:u(),selectLanguage:u(),languageChanged:u(),selectColorTheme:u(),lightMode:u(),darkMode:u(),ariaMainNavigation:u(),ariaMainNavigationRegion:u(),ariaGotoMainNavigation:u(),ariaAskQuestion:u(),ariaAskQuestionRegion:u(),ariaNotifications:u(),ariaPredefinedQuestions:u(),ariaPredefinedQuestionsRegion:u(),ariaChatHistory:u(),ariaOpenChat:u(),ariaQuestionFromYou:u(),ariaAnswerFromBot:u(),ariaLastAnswerNavigation:u(),ariaQuestionSent:u(),ariaAnswerReady:u(),ariaAnswerFinished:u(),ariaAskQuestionAgain:u(),ariaAnswerGood:u(),ariaAnswerBad:u(),ariaReferenceSource:u(),ariaGiveFeedback:u(),ariaLanguageChanged:u(),ariaLightSelected:u(),ariaDarkSelected:u(),ariaSettings:u(),ariaSettingsRegion:u(),ariaReferencesRegion:u(),ariaOpensInNewTab:u(),ariaFlyoutRegion:u(),ariaSelected:u(),ariaUnselected:u(),ariaAllSelected:u(),ariaAllUnselected:u(),ariaAllReseted:u(),popups:J(Zf).optional(),termsAcceptButton:u().optional(),termsReadButton:u().optional(),selectors:Je(u(),Vl).optional(),hideSettings:u(),showSettings:u(),chooseAtLeastOneOption:u(),selectAll:u(),selectNone:u(),resetToDefaults:u(),messageTooLong:u()}),Jr=dt(["en","de","fr","it"]),Zl=Je(Jr,Hl.partial().extend({selectors:Je(u(),Vl).optional()}));Je(Jr,qf),Je(Jr,Vf);const Gl=R({label:u(),options:J(R({label:u(),value:pe()}))}),Gf=R({label:u(),icon:u(),url:u(),target:dt(["_blank","_self"]).optional()}),Wf=R({label:u().nullable(),question:u()}),Wl=R({impact:Gl.optional(),quality:Gl.optional()});R({classification:Wl.optional()});const Qf=R({predefinedQuestions:J(Wf)}),Ql=Jt([R({maintenance:Fe(!0)}),R({id:u(),cID:u()})]);Je(Jr,Hl);const Yf=R({settingName:u(),iconName:u(),settingIntro:u().optional(),type:dt(["single-select","multi-select"]),allowEmpty:K(),values:J(u()),defaultValues:J(u()).optional()}),Yl=R({before:J(Vi).optional(),after:J(Vi).optional()}),Kf=R({init:J(Vi).optional(),bot:Yl.optional(),user:Yl.optional()}),Kl=R({showPredefinedQuestions:K(),showOverallFeedbackButton:K(),showOverallFeedbackEmail:K(),showCloseChatButton:K(),showContextMenu:K(),showContextInfo:K(),showReferencesByDefault:K(),showExpandedSelectors:K(),showTextFeedback:K(),inlineLayout:K(),allowAudioInput:K(),blockPII:K(),questionPrefix:u(),menu:Je(Jr,J(Gf)).optional(),supportedLanguages:J(Jr),classification:Wl.optional(),theme:ql,translations:Zl,buttonHref:u().optional(),addQueryToUrlParams:K().optional(),addRetrievalQuestionToUrlParams:K().optional(),renderKatex:K().optional(),reflectLanguageInPath:K().optional(),sendReferrer:dt(["all","own","none","location"]).optional(),selectorsConfig:J(Yf).default([]),questionLengthLimit:pe().optional(),forceConsent:K().optional(),askQuestionAgain:K(),enableBackdrop:K().optional(),messageAdditions:Kf.optional(),contextVersion:pe().optional()}).partial().and(R({theme:R({name:u().optional()}).optional()}));class Xf{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 Ee=[];for(let t=0;t<256;++t)Ee.push((t+256).toString(16).slice(1));function Jf(t,e=0){return(Ee[t[e+0]]+Ee[t[e+1]]+Ee[t[e+2]]+Ee[t[e+3]]+"-"+Ee[t[e+4]]+Ee[t[e+5]]+"-"+Ee[t[e+6]]+Ee[t[e+7]]+"-"+Ee[t[e+8]]+Ee[t[e+9]]+"-"+Ee[t[e+10]]+Ee[t[e+11]]+Ee[t[e+12]]+Ee[t[e+13]]+Ee[t[e+14]]+Ee[t[e+15]]).toLowerCase()}let Gi;const ep=new Uint8Array(16);function tp(){if(!Gi){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Gi=crypto.getRandomValues.bind(crypto)}return Gi(ep)}const Xl={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function rp(t,e,r){t=t||{};const n=t.random??t.rng?.()??tp();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,Jf(n)}function Wi(t,e,r){return Xl.randomUUID&&!t?Xl.randomUUID():rp(t)}const en=new Map;class np{get length(){return en.size}clear(){en.clear()}getItem(e){return en.get(e)||null}key(e){return Array.from(en.keys())[e]||null}removeItem(e){en.delete(e)}setItem(e,r){en.set(e,String(r))}}const kt=globalThis.localStorage??new np,ap=async t=>{try{const e=kt.getItem("liipgpt:uID")||kt.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",Ql,{},r).catch(a=>(console.log("Failed to /login use /log",a),t.fetchData("/log",Ql,{},r)));if("maintenance"in n&&n.maintenance)return{mode:"maintenance"};if(!("id"in n))throw new Error("Invalid response format: missing user id");return kt.setItem("liipgpt:uID",n.id),{mode:"ready",userId:n.id}}catch(e){throw console.error("Failed to fetch user data:",e),e}};var et=function(t,e){if(!(this instanceof et))return new et(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=et.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(et.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>"+Rt(r.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(r);throw r}}},Ir=new kl;function X(t,e){return Ir.parse(t,e)}X.options=X.setOptions=function(t){return Ir.setOptions(t),X.defaults=Ir.defaults,nl(X.defaults),X},X.getDefaults=wi,X.defaults=Rr,X.use=function(...t){return Ir.use(...t),X.defaults=Ir.defaults,nl(X.defaults),X},X.walkTokens=function(t,e){return Ir.walkTokens(t,e)},X.parseInline=Ir.parseInline,X.Parser=Wt,X.parser=Wt.parse,X.Renderer=ua,X.TextRenderer=Ii,X.Lexer=Gt,X.lexer=Gt.lex,X.Tokenizer=ca,X.Hooks=da,X.parse=X,X.options,X.setOptions,X.use,X.walkTokens,X.parseInline,Wt.parse,Gt.lex;const yl=t=>(Object.getOwnPropertyNames(t).forEach(e=>{const r=t[e];r&&typeof r=="object"&&yl(r)}),Object.freeze(t)),wl=yl({all:[],used:[],unused:[]}),Zh=(t,e)=>{const r=uh(t);return r.addHook("uponSanitizeElement",function(n,a){const i=a.tagName||n.nodeName.toLowerCase();i.startsWith("liipgpt-")&&(a.allowedTags[i]=!0)}),r.addHook("afterSanitizeAttributes",function(n){if(n.tagName!=="A"||!n.getAttribute("href")?.startsWith("http")||(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer"),!e||n.querySelector(".sr-only")))return;const a=n.ownerDocument.createElement("span");a.className="sr-only",a.textContent=` ${e}`,n.appendChild(a)}),r};class _l{marked;currentReferences=wl;lastUsedIndex=0;DomPurity;constructor(e={}){this.marked=new kl({async:!1,breaks:!0}).use(this.createFootnoteExtension(),...e.extensions??[]),this.DomPurity=Zh(e.window,e.newTabSrText)}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"],ADD_ATTR:["target"]})}toHTML(e,r){this.currentReferences=r;const n=this.parse(e);return this.currentReferences=wl,n}}function Gh(){let t,e;return{promise:new Promise((n,a)=>{e=n,t=a}),reject:t,resolve:e}}class xl{promise;resolve;reject;constructor(){const{promise:e,resolve:r,reject:n}=Gh();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 Li{hasValue=new xl;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 Wh=t=>{try{return new URL(t).hostname}catch{return t}};function Qh(t){return t.replace(/<[^>]*>/g,"").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')}const Yh=({url:t,considered:e,title:r,description:n,summary:a})=>{const i=Wh(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 Kh{constructor(e){this.options=e,this.store=Ld({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 Li;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=Qh(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(Yh(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 Sl;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Sl||(Sl={}));const C=W.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),dr=t=>{switch(typeof t){case"undefined":return C.undefined;case"string":return C.string;case"number":return Number.isNaN(t)?C.nan:C.number;case"boolean":return C.boolean;case"function":return C.function;case"bigint":return C.bigint;case"symbol":return C.symbol;case"object":return Array.isArray(t)?C.array:t===null?C.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?C.promise:typeof Map<"u"&&t instanceof Map?C.map:typeof Set<"u"&&t instanceof Set?C.set:typeof Date<"u"&&t instanceof Date?C.date:C.object;default:return C.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 Qt 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 Qt))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()}}Qt.create=t=>new Qt(t);const Oi=(t,e)=>{let r;switch(t.code){case x.invalid_type:t.received===C.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 Xh=Oi;function Jh(){return Xh}const ef=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=Jh(),n=ef({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Oi?void 0:Oi].filter(a=>!!a)});t.common.issues.push(n)}class ze{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 P;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 ze.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 P;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 P=Object.freeze({status:"aborted"}),An=t=>({status:"dirty",value:t}),ut=t=>({status:"valid",value:t}),Tl=t=>t.status==="aborted",El=t=>t.status==="dirty",Yr=t=>t.status==="valid",ha=t=>typeof Promise<"u"&&t instanceof Promise;var L;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(L||(L={}));class It{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 Cl=(t,e)=>{if(Yr(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 Qt(t.common.issues);return this._error=r,this._error}}};function F(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 dr(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:dr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ze,ctx:{common:e.parent.common,data:e.data,parsedType:dr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(ha(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:dr(e)},a=this._parseSync({data:e,path:n.path,parent:n});return Cl(n,a)}"~validate"(e){const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:dr(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:r});return Yr(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=>Yr(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:dr(e)},a=this._parse({data:e,path:n.path,parent:n}),i=await(ha(a)?a:Promise.resolve(a));return Cl(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 Mr({schema:this,typeName:D.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 Xt.create(this,this._def)}nullable(){return Nr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Lt.create(this)}promise(){return ba.create(this,this._def)}or(e){return pa.create([this,e],this._def)}and(e){return ga.create(this,e,this._def)}transform(e){return new Mr({...F(this._def),schema:this,typeName:D.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new ka({...F(this._def),innerType:this,defaultValue:r,typeName:D.ZodDefault})}brand(){return new $l({typeName:D.ZodBranded,type:this,...F(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new ya({...F(this._def),innerType:this,catchValue:r,typeName:D.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return ji.create(this,e)}readonly(){return wa.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const tf=/^c[^\s-]{8,}$/i,rf=/^[0-9a-z]+$/,nf=/^[0-9A-HJKMNP-TV-Z]{26}$/i,af=/^[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,of=/^[a-z0-9_-]{21}$/i,sf=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,lf=/^[-+]?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)?)??$/,cf=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,uf="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Mi;const df=/^(?:(?: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])$/,hf=/^(?:(?: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])$/,ff=/^(([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]))$/,pf=/^(([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])$/,gf=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,mf=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Al="((\\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])))",vf=new RegExp(`^${Al}$`);function Rl(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 bf(t){return new RegExp(`^${Rl(t)}$`)}function kf(t){let e=`${Al}T${Rl(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 yf(t,e){return!!((e==="v4"||!e)&&df.test(t)||(e==="v6"||!e)&&ff.test(t))}function wf(t,e){if(!sf.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 _f(t,e){return!!((e==="v4"||!e)&&hf.test(t)||(e==="v6"||!e)&&pf.test(t))}class Yt extends Z{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==C.string){const i=this._getOrReturnCtx(e);return E(i,{code:x.invalid_type,expected:C.string,received:i.parsedType}),P}const n=new ze;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")cf.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")Mi||(Mi=new RegExp(uf,"u")),Mi.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")af.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")of.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")tf.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")rf.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")nf.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"?kf(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"?vf.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{code:x.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?bf(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"?lf.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"duration",code:x.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?yf(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"?wf(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"?_f(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"?gf.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"base64",code:x.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?mf.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,...L.errToObj(n)})}_addCheck(e){return new Yt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...L.errToObj(e)})}url(e){return this._addCheck({kind:"url",...L.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...L.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...L.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...L.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...L.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...L.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...L.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...L.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...L.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...L.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...L.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...L.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,...L.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,...L.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...L.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...L.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...L.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...L.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...L.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...L.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...L.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...L.errToObj(r)})}nonempty(e){return this.min(1,L.errToObj(e))}trim(){return new Yt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Yt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Yt({...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}}Yt.create=t=>new Yt({checks:[],typeName:D.ZodString,coerce:t?.coerce??!1,...F(t)});function xf(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 Kr 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)!==C.number){const i=this._getOrReturnCtx(e);return E(i,{code:x.invalid_type,expected:C.number,received:i.parsedType}),P}let n;const a=new ze;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"?xf(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,L.toString(r))}gt(e,r){return this.setLimit("min",e,!1,L.toString(r))}lte(e,r){return this.setLimit("max",e,!0,L.toString(r))}lt(e,r){return this.setLimit("max",e,!1,L.toString(r))}setLimit(e,r,n,a){return new Kr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:L.toString(a)}]})}_addCheck(e){return new Kr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:L.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:L.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:L.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:L.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:L.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:L.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:L.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:L.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:L.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)}}Kr.create=t=>new Kr({checks:[],typeName:D.ZodNumber,coerce:t?.coerce||!1,...F(t)});class Rn 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)!==C.bigint)return this._getInvalidInput(e);let n;const a=new ze;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:C.bigint,received:r.parsedType}),P}gte(e,r){return this.setLimit("min",e,!0,L.toString(r))}gt(e,r){return this.setLimit("min",e,!1,L.toString(r))}lte(e,r){return this.setLimit("max",e,!0,L.toString(r))}lt(e,r){return this.setLimit("max",e,!1,L.toString(r))}setLimit(e,r,n,a){return new Rn({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:L.toString(a)}]})}_addCheck(e){return new Rn({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:L.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:L.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:L.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:L.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:L.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}}Rn.create=t=>new Rn({checks:[],typeName:D.ZodBigInt,coerce:t?.coerce??!1,...F(t)});class Ni extends Z{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==C.boolean){const n=this._getOrReturnCtx(e);return E(n,{code:x.invalid_type,expected:C.boolean,received:n.parsedType}),P}return ut(e.data)}}Ni.create=t=>new Ni({typeName:D.ZodBoolean,coerce:t?.coerce||!1,...F(t)});class fa extends Z{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==C.date){const i=this._getOrReturnCtx(e);return E(i,{code:x.invalid_type,expected:C.date,received:i.parsedType}),P}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return E(i,{code:x.invalid_date}),P}const n=new ze;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 fa({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:L.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:L.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}}fa.create=t=>new fa({checks:[],coerce:t?.coerce||!1,typeName:D.ZodDate,...F(t)});class Il extends Z{_parse(e){if(this._getType(e)!==C.symbol){const n=this._getOrReturnCtx(e);return E(n,{code:x.invalid_type,expected:C.symbol,received:n.parsedType}),P}return ut(e.data)}}Il.create=t=>new Il({typeName:D.ZodSymbol,...F(t)});class Pi extends Z{_parse(e){if(this._getType(e)!==C.undefined){const n=this._getOrReturnCtx(e);return E(n,{code:x.invalid_type,expected:C.undefined,received:n.parsedType}),P}return ut(e.data)}}Pi.create=t=>new Pi({typeName:D.ZodUndefined,...F(t)});class Di extends Z{_parse(e){if(this._getType(e)!==C.null){const n=this._getOrReturnCtx(e);return E(n,{code:x.invalid_type,expected:C.null,received:n.parsedType}),P}return ut(e.data)}}Di.create=t=>new Di({typeName:D.ZodNull,...F(t)});class Ll extends Z{constructor(){super(...arguments),this._any=!0}_parse(e){return ut(e.data)}}Ll.create=t=>new Ll({typeName:D.ZodAny,...F(t)});class Ol extends Z{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ut(e.data)}}Ol.create=t=>new Ol({typeName:D.ZodUnknown,...F(t)});class hr extends Z{_parse(e){const r=this._getOrReturnCtx(e);return E(r,{code:x.invalid_type,expected:C.never,received:r.parsedType}),P}}hr.create=t=>new hr({typeName:D.ZodNever,...F(t)});class Ml extends Z{_parse(e){if(this._getType(e)!==C.undefined){const n=this._getOrReturnCtx(e);return E(n,{code:x.invalid_type,expected:C.void,received:n.parsedType}),P}return ut(e.data)}}Ml.create=t=>new Ml({typeName:D.ZodVoid,...F(t)});class Lt extends Z{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),a=this._def;if(r.parsedType!==C.array)return E(r,{code:x.invalid_type,expected:C.array,received:r.parsedType}),P;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 It(r,o,r.path,s)))).then(o=>ze.mergeArray(n,o));const i=[...r.data].map((o,s)=>a.type._parseSync(new It(r,o,r.path,s)));return ze.mergeArray(n,i)}get element(){return this._def.type}min(e,r){return new Lt({...this._def,minLength:{value:e,message:L.toString(r)}})}max(e,r){return new Lt({...this._def,maxLength:{value:e,message:L.toString(r)}})}length(e,r){return new Lt({...this._def,exactLength:{value:e,message:L.toString(r)}})}nonempty(e){return this.min(1,e)}}Lt.create=(t,e)=>new Lt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:D.ZodArray,...F(e)});function Xr(t){if(t instanceof de){const e={};for(const r in t.shape){const n=t.shape[r];e[r]=Xt.create(Xr(n))}return new de({...t._def,shape:()=>e})}else return t instanceof Lt?new Lt({...t._def,type:Xr(t.element)}):t instanceof Xt?Xt.create(Xr(t.unwrap())):t instanceof Nr?Nr.create(Xr(t.unwrap())):t instanceof Lr?Lr.create(t.items.map(e=>Xr(e))):t}class de 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)!==C.object){const l=this._getOrReturnCtx(e);return E(l,{code:x.invalid_type,expected:C.object,received:l.parsedType}),P}const{status:n,ctx:a}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof hr&&this._def.unknownKeys==="strip"))for(const l in a.data)o.includes(l)||s.push(l);const c=[];for(const l of o){const d=i[l],p=a.data[l];c.push({key:{status:"valid",value:l},value:d._parse(new It(a,p,a.path,l)),alwaysSet:l in a.data})}if(this._def.catchall instanceof hr){const l=this._def.unknownKeys;if(l==="passthrough")for(const d of s)c.push({key:{status:"valid",value:d},value:{status:"valid",value:a.data[d]}});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 d of s){const p=a.data[d];c.push({key:{status:"valid",value:d},value:l._parse(new It(a,p,a.path,d)),alwaysSet:d in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const l=[];for(const d of c){const p=await d.key,h=await d.value;l.push({key:p,value:h,alwaysSet:d.alwaysSet})}return l}).then(l=>ze.mergeObjectSync(n,l)):ze.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return L.errToObj,new de({...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:L.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new de({...this._def,unknownKeys:"strip"})}passthrough(){return new de({...this._def,unknownKeys:"passthrough"})}extend(e){return new de({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new de({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:D.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new de({...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 de({...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 de({...this._def,shape:()=>r})}deepPartial(){return Xr(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 de({...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 Xt;)i=i._def.innerType;r[n]=i}return new de({...this._def,shape:()=>r})}keyof(){return Pl(W.objectKeys(this.shape))}}de.create=(t,e)=>new de({shape:()=>t,unknownKeys:"strip",catchall:hr.create(),typeName:D.ZodObject,...F(e)}),de.strictCreate=(t,e)=>new de({shape:()=>t,unknownKeys:"strict",catchall:hr.create(),typeName:D.ZodObject,...F(e)}),de.lazycreate=(t,e)=>new de({shape:t,unknownKeys:"strip",catchall:hr.create(),typeName:D.ZodObject,...F(e)});class pa 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 Qt(s.ctx.common.issues));return E(r,{code:x.invalid_union,unionErrors:o}),P}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},d=c._parseSync({data:r.data,path:r.path,parent:l});if(d.status==="valid")return d;d.status==="dirty"&&!i&&(i={result:d,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 Qt(c));return E(r,{code:x.invalid_union,unionErrors:s}),P}}get options(){return this._def.options}}pa.create=(t,e)=>new pa({options:t,typeName:D.ZodUnion,...F(e)});const Kt=t=>t instanceof Fi?Kt(t.schema):t instanceof Mr?Kt(t.innerType()):t instanceof va?[t.value]:t instanceof Or?t.options:t instanceof Bi?W.objectValues(t.enum):t instanceof ka?Kt(t._def.innerType):t instanceof Pi?[void 0]:t instanceof Di?[null]:t instanceof Xt?[void 0,...Kt(t.unwrap())]:t instanceof Nr?[null,...Kt(t.unwrap())]:t instanceof $l||t instanceof wa?Kt(t.unwrap()):t instanceof ya?Kt(t._def.innerType):[];class $i extends Z{_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==C.object)return E(r,{code:x.invalid_type,expected:C.object,received:r.parsedType}),P;const n=this.discriminator,a=r.data[n],i=this.optionsMap.get(a);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(E(r,{code:x.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),P)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){const a=new Map;for(const i of r){const o=Kt(i.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const s of o){if(a.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);a.set(s,i)}}return new $i({typeName:D.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:a,...F(n)})}}function zi(t,e){const r=dr(t),n=dr(e);if(t===e)return{valid:!0,data:t};if(r===C.object&&n===C.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=zi(t[s],e[s]);if(!c.valid)return{valid:!1};o[s]=c.data}return{valid:!0,data:o}}else if(r===C.array&&n===C.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=zi(o,s);if(!c.valid)return{valid:!1};a.push(c.data)}return{valid:!0,data:a}}else return r===C.date&&n===C.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class ga extends Z{_parse(e){const{status:r,ctx:n}=this._processInputParams(e),a=(i,o)=>{if(Tl(i)||Tl(o))return P;const s=zi(i.value,o.value);return s.valid?((El(i)||El(o))&&r.dirty(),{status:r.value,value:s.data}):(E(n,{code:x.invalid_intersection_types}),P)};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}))}}ga.create=(t,e,r)=>new ga({left:t,right:e,typeName:D.ZodIntersection,...F(r)});class Lr extends Z{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==C.array)return E(n,{code:x.invalid_type,expected:C.array,received:n.parsedType}),P;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"}),P;!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 It(n,o,n.path,s)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>ze.mergeArray(r,o)):ze.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new Lr({...this._def,rest:e})}}Lr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Lr({items:t,typeName:D.ZodTuple,rest:null,...F(e)})};class ma 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!==C.object)return E(n,{code:x.invalid_type,expected:C.object,received:n.parsedType}),P;const a=[],i=this._def.keyType,o=this._def.valueType;for(const s in n.data)a.push({key:i._parse(new It(n,s,n.path,s)),value:o._parse(new It(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?ze.mergeObjectAsync(r,a):ze.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof Z?new ma({keyType:e,valueType:r,typeName:D.ZodRecord,...F(n)}):new ma({keyType:Yt.create(),valueType:e,typeName:D.ZodRecord,...F(r)})}}class Nl 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!==C.map)return E(n,{code:x.invalid_type,expected:C.map,received:n.parsedType}),P;const a=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([s,c],l)=>({key:a._parse(new It(n,s,n.path,[l,"key"])),value:i._parse(new It(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,d=await c.value;if(l.status==="aborted"||d.status==="aborted")return P;(l.status==="dirty"||d.status==="dirty")&&r.dirty(),s.set(l.value,d.value)}return{status:r.value,value:s}})}else{const s=new Map;for(const c of o){const l=c.key,d=c.value;if(l.status==="aborted"||d.status==="aborted")return P;(l.status==="dirty"||d.status==="dirty")&&r.dirty(),s.set(l.value,d.value)}return{status:r.value,value:s}}}}Nl.create=(t,e,r)=>new Nl({valueType:e,keyType:t,typeName:D.ZodMap,...F(r)});class In extends Z{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==C.set)return E(n,{code:x.invalid_type,expected:C.set,received:n.parsedType}),P;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 d of c){if(d.status==="aborted")return P;d.status==="dirty"&&r.dirty(),l.add(d.value)}return{status:r.value,value:l}}const s=[...n.data.values()].map((c,l)=>i._parse(new It(n,c,n.path,l)));return n.common.async?Promise.all(s).then(c=>o(c)):o(s)}min(e,r){return new In({...this._def,minSize:{value:e,message:L.toString(r)}})}max(e,r){return new In({...this._def,maxSize:{value:e,message:L.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}In.create=(t,e)=>new In({valueType:t,minSize:null,maxSize:null,typeName:D.ZodSet,...F(e)});class Fi 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})}}Fi.create=(t,e)=>new Fi({getter:t,typeName:D.ZodLazy,...F(e)});class va 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}),P}return{status:"valid",value:e.data}}get value(){return this._def.value}}va.create=(t,e)=>new va({value:t,typeName:D.ZodLiteral,...F(e)});function Pl(t,e){return new Or({values:t,typeName:D.ZodEnum,...F(e)})}class Or 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}),P}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}),P}return ut(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 Or.create(e,{...this._def,...r})}exclude(e,r=this._def){return Or.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}}Or.create=Pl;class Bi extends Z{_parse(e){const r=W.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==C.string&&n.parsedType!==C.number){const a=W.objectValues(r);return E(n,{expected:W.joinValues(a),received:n.parsedType,code:x.invalid_type}),P}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}),P}return ut(e.data)}get enum(){return this._def.values}}Bi.create=(t,e)=>new Bi({values:t,typeName:D.ZodNativeEnum,...F(e)});class ba extends Z{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==C.promise&&r.common.async===!1)return E(r,{code:x.invalid_type,expected:C.promise,received:r.parsedType}),P;const n=r.parsedType===C.promise?r.data:Promise.resolve(r.data);return ut(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}}ba.create=(t,e)=>new ba({type:t,typeName:D.ZodPromise,...F(e)});class Mr extends Z{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===D.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 P;const c=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return c.status==="aborted"?P:c.status==="dirty"||r.value==="dirty"?An(c.value):c});{if(r.value==="aborted")return P;const s=this._def.schema._parseSync({data:o,path:n.path,parent:n});return s.status==="aborted"?P:s.status==="dirty"||r.value==="dirty"?An(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"?P:(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"?P:(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(!Yr(o))return P;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=>Yr(o)?Promise.resolve(a.transform(o.value,i)).then(s=>({status:r.value,value:s})):P);W.assertNever(a)}}Mr.create=(t,e,r)=>new Mr({schema:t,typeName:D.ZodEffects,effect:e,...F(r)}),Mr.createWithPreprocess=(t,e,r)=>new Mr({schema:e,effect:{type:"preprocess",transform:t},typeName:D.ZodEffects,...F(r)});class Xt extends Z{_parse(e){return this._getType(e)===C.undefined?ut(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Xt.create=(t,e)=>new Xt({innerType:t,typeName:D.ZodOptional,...F(e)});class Nr extends Z{_parse(e){return this._getType(e)===C.null?ut(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Nr.create=(t,e)=>new Nr({innerType:t,typeName:D.ZodNullable,...F(e)});class ka extends Z{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===C.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}ka.create=(t,e)=>new ka({innerType:t,typeName:D.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...F(e)});class ya 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 ha(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Qt(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Qt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}ya.create=(t,e)=>new ya({innerType:t,typeName:D.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...F(e)});class Dl extends Z{_parse(e){if(this._getType(e)!==C.nan){const n=this._getOrReturnCtx(e);return E(n,{code:x.invalid_type,expected:C.nan,received:n.parsedType}),P}return{status:"valid",value:e.data}}}Dl.create=t=>new Dl({typeName:D.ZodNaN,...F(t)});class $l 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 ji 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"?P:i.status==="dirty"?(r.dirty(),An(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"?P: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 ji({in:e,out:r,typeName:D.ZodPipeline})}}class wa extends Z{_parse(e){const r=this._def.innerType._parse(e),n=a=>(Yr(a)&&(a.value=Object.freeze(a.value)),a);return ha(r)?r.then(a=>n(a)):n(r)}unwrap(){return this._def.innerType}}wa.create=(t,e)=>new wa({innerType:t,typeName:D.ZodReadonly,...F(e)});var D;(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"})(D||(D={}));const u=Yt.create,pe=Kr.create,K=Ni.create;hr.create;const J=Lt.create,R=de.create,Jt=pa.create,zl=$i.create;ga.create,Lr.create;const Je=ma.create,Fe=va.create,dt=Or.create;ba.create,Xt.create,Nr.create;const Sf=Jt([u(),pe(),K(),J(u()),J(pe()),J(K())]),Ui=R({title:u(),description:u().optional(),badge:u().optional(),breadcrumbs:J(u()).optional(),previewImage:u().optional(),date:u().datetime().optional()}),Tf=R({url:u().url(),score:pe(),metadata:Je(u(),Sf),language:u().optional()}).merge(Ui),Ef=R({componentName:Fe("buttons"),data:R({caption:u().optional(),buttons:J(R({label:u(),href:u().url().optional(),value:u(),variant:dt(["primary","secondary","tertiary"]).optional(),icon:u().optional(),target:u().optional()}))})}),Cf=R({componentName:Fe("combobox"),data:R({caption:u().optional(),placeholder:u(),values:J(R({label:u(),value:u()}))})}),Af=R({componentName:Fe("alva-init"),data:R({})}),Rf=R({componentName:Fe("alva-score-survey"),data:R({})}),If=R({type:Fe("component"),id:u().optional(),time:u().optional(),hideAvatar:K().optional(),noSectionPadding:K().optional()}),Lf=zl("componentName",[Ef,Cf,Af,Rf]).and(If);dt(["start","chat"]),zl("name",[R({name:Fe("start-page"),prefill:u().optional()}),R({name:Fe("consent-page")}),R({name:Fe("chat-page"),query:u()})]);const Of=R({type:Fe("user"),time:u(),message:u(),id:u().optional()});dt(["idle","searching","answering"]);const Mf=Jt([u(),pe(),K(),J(u()),J(pe()),J(K())]),qi=R({url:u(),score:pe(),metadata:Je(u(),Mf),considered:K(),display:R({card:Ui,listItem:Ui})}).extend({referenceIndex:R({all:pe(),used:pe().optional()})}),Nf=R({all:J(qi),used:J(qi),unused:J(qi)}),Pf=dt(["pii-detected","blocked","maintenance","rate-limit","server-error","too-short","too-long","quota-reached","aborted"]),Df=Jt([Pf,Fe("sse-error"),Fe("client-error"),Fe("unexpected-call")]),Fl=R({type:Fe("bot"),time:u(),id:u(),message:R({markdown:u(),html:u(),text:u()}),references:Nf,errors:J(Df),retrievalQuestion:u().optional()}),$f=Fl.extend({state:dt(["streaming","done"])}),zf=Fl.extend({state:Fe("loading")}),Ff=Jt([zf,$f]),Vi=Jt([Ff,Of,Lf]);var Hi={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 Be=R({minRem:pe(),maxRem:pe()}).or(u()),_a=R({0:u().optional(),50:u(),100:u(),200:u(),300:u(),400:u(),500:u(),600:u(),700:u(),800:u(),900:u(),950:u(),1e3:u().optional()}),Zi=R({color:u().optional(),background:u().optional(),borderWidth:u().optional(),borderColor:u().optional(),boxShadow:u().optional()}),Bf=R({borderRadius:Be.optional(),custom:Je(u(),Jt([u(),pe()])).optional(),hover:Zi.optional(),focus:Zi.optional()}).and(Zi),jf=R({family:u().optional()}),Uf=Je(dt(["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","embedAvatar"]),u()),qf=R({font:jf.optional(),colors:R({brand:_a,accent:_a.optional(),highlight:_a,grey:_a}),base:R({fontSizeXs:Be.optional(),fontSizeSm:Be.optional(),fontSizeBody:Be.optional(),fontSizeH3:Be.optional(),fontSizeH2:Be.optional(),fontSizeH1:Be.optional(),fontWeightNormal:u().optional(),fontWeightBold:u().optional(),fontWeightTitle:u().optional(),lineHeightDefault:u().optional(),lineHeightSnug:u().optional(),lineHeightTight:u().optional(),borderRadius:Be.optional(),lineColor:u().optional(),boxShadow:u().optional()}),components:Je(u(),Bf),svgs:Uf}),xa=R({customCSS:u().optional(),fontCSS:u().optional(),fontURLs:u().array().optional(),tokens:qf});R({light:xa,dark:xa});const Vf=R({light:xa,dark:xa}).deepPartial(),Bl=R({50:u(),100:u(),200:u(),300:u(),400:u(),500:u(),600:u(),700:u(),800:u(),900:u(),950:u()}),jl=dt(["slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"]),Ul=Jt([Bl,jl]),Hf=Jt([Bl.and(R({0:u(),1e3:u()})),jl]),ql=R({avatarImageUrl:u().optional(),colors:R({brand:Ul.optional(),highlight:Ul.optional(),grey:Hf.optional(),background:u().optional(),text:u().optional(),anchor:R({default:u().optional(),hover:u().optional()}).optional()}).optional(),font:R({family:u().optional(),urls:J(u()).optional(),sizeXs:Be.optional(),sizeSm:Be.optional(),sizeBody:Be.optional(),sizeH3:Be.optional(),sizeH2:Be.optional(),sizeH1:Be.optional(),weightNormal:u().optional(),weightBold:u().optional(),weightTitle:u().optional()}).optional(),borderRadius:Be.optional(),fineGrained:Vf.optional()}),Zf=R({blocked:u(),maintenance:u(),"rate-limit":u(),"server-error":u(),"too-short":u(),"too-long":u(),"quota-reached":u(),aborted:u(),"sse-error":u(),"client-error":u(),"unexpected-call":u(),"incomplete-error":u(),"feedback-failed":u(),"speech-not-supported":u(),"speech-transcription-failed":u(),"speech-no-text-detected":u(),"speech-microphone-access-denied":u(),"pii-detected":u()}),Gf=R({email:u(),creditCard:u(),ahv:u(),phoneSwiss:u(),phoneInternational:u(),swissPassport:u(),longNumber:u()}),Vl=R({name:u(),namePlural:u().optional(),intro:u().optional(),placeholder:u(),values:Je(u(),u())}),Wf=R({action:u(),label:u(),type:dt(["primary","secondary"]).optional()}),Qf=R({hash:u(),title:u(),content:u(),actions:J(Wf).optional()}),Hl=R({introductionTitle:u(),introductionDisclaimer:u().optional(),termsInvitationToConsent:u().optional(),chatInputPlaceholder:u(),chatInputPlaceholderListening:u().optional(),chatInputSubmit:u(),chatInputAbort:u(),chatInputStartListening:u(),chatInputStopListening:u(),referenceLink:u(),referencesDisplay:u(),referencesHide:u(),referencesTitle:u(),referencesFurtherTitle:u(),newChat:u(),maintenanceModeError:u(),messageBotLoading:u(),messageBotError:u(),messageBotDefaultError:u(),noResultsFound:u(),chatFooterText:u().optional(),scrollToBottom:u(),openButtonTitle:u().optional(),openButtonDescription:u().optional(),openMenu:u(),openInfo:u(),aboutThisChat:u().optional(),closeMenu:u(),closeChat:u(),close:u(),send:u(),thankYouForFeedback:u(),giveFeedback:u(),sendFeedback:u(),feedbackFormTitle:u(),feedbackFormMessage:u(),feedbackFormMessagePlaceholder:u(),feedbackFormEmail:u(),feedbackFormEmailPlaceholder:u(),askQuestionAgain:u(),answerGood:u(),answerBad:u(),classificationSubmit:u(),classificationThankYou:u(),classificationTitle:u(),selectLanguage:u(),languageChanged:u(),selectColorTheme:u(),lightMode:u(),darkMode:u(),ariaMainNavigation:u(),ariaMainNavigationRegion:u(),ariaGotoMainNavigation:u(),ariaAskQuestion:u(),ariaAskQuestionRegion:u(),ariaNotifications:u(),ariaPredefinedQuestions:u(),ariaPredefinedQuestionsRegion:u(),ariaChatHistory:u(),ariaOpenChat:u(),ariaQuestionFromYou:u(),ariaAnswerFromBot:u(),ariaLastAnswerNavigation:u(),ariaQuestionSent:u(),ariaAnswerReady:u(),ariaAnswerFinished:u(),ariaAskQuestionAgain:u(),ariaAnswerGood:u(),ariaAnswerBad:u(),ariaReferenceSource:u(),ariaGiveFeedback:u(),ariaLanguageChanged:u(),ariaLightSelected:u(),ariaDarkSelected:u(),ariaSettings:u(),ariaSettingsRegion:u(),ariaReferencesRegion:u(),ariaOpensInNewTab:u(),ariaFlyoutRegion:u(),ariaSelected:u(),ariaUnselected:u(),ariaAllSelected:u(),ariaAllUnselected:u(),ariaAllReseted:u(),popups:J(Qf).optional(),termsAcceptButton:u().optional(),termsReadButton:u().optional(),selectors:Je(u(),Vl).optional(),hideSettings:u(),showSettings:u(),chooseAtLeastOneOption:u(),selectAll:u(),selectNone:u(),resetToDefaults:u(),messageTooLong:u()}),Jr=dt(["en","de","fr","it"]),Zl=Je(Jr,Hl.partial().extend({selectors:Je(u(),Vl).optional()}));Je(Jr,Zf),Je(Jr,Gf);const Gl=R({label:u(),options:J(R({label:u(),value:pe()}))}),Yf=R({label:u(),icon:u(),url:u(),target:dt(["_blank","_self"]).optional()}),Kf=R({label:u().nullable(),question:u()}),Wl=R({impact:Gl.optional(),quality:Gl.optional()});R({classification:Wl.optional()});const Xf=R({predefinedQuestions:J(Kf)}),Ql=Jt([R({maintenance:Fe(!0)}),R({id:u(),cID:u()})]);Je(Jr,Hl);const Jf=R({settingName:u(),iconName:u(),settingIntro:u().optional(),type:dt(["single-select","multi-select"]),allowEmpty:K(),values:J(u()),defaultValues:J(u()).optional()}),Yl=R({before:J(Vi).optional(),after:J(Vi).optional()}),ep=R({init:J(Vi).optional(),bot:Yl.optional(),user:Yl.optional()}),Kl=R({showPredefinedQuestions:K(),showOverallFeedbackButton:K(),showOverallFeedbackEmail:K(),showCloseChatButton:K(),showContextMenu:K(),showContextInfo:K(),showReferencesByDefault:K(),showExpandedSelectors:K(),showTextFeedback:K(),inlineLayout:K(),allowAudioInput:K(),blockPII:K(),questionPrefix:u(),menu:Je(Jr,J(Yf)).optional(),supportedLanguages:J(Jr),classification:Wl.optional(),theme:ql,translations:Zl,buttonHref:u().optional(),addQueryToUrlParams:K().optional(),addRetrievalQuestionToUrlParams:K().optional(),renderKatex:K().optional(),reflectLanguageInPath:K().optional(),sendReferrer:dt(["all","own","none","location"]).optional(),selectorsConfig:J(Jf).default([]),questionLengthLimit:pe().optional(),forceConsent:K().optional(),askQuestionAgain:K(),enableBackdrop:K().optional(),messageAdditions:ep.optional(),contextVersion:pe().optional()}).partial().and(R({theme:R({name:u().optional()}).optional()}));class tp{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 Ce=[];for(let t=0;t<256;++t)Ce.push((t+256).toString(16).slice(1));function Xl(t,e=0){return(Ce[t[e+0]]+Ce[t[e+1]]+Ce[t[e+2]]+Ce[t[e+3]]+"-"+Ce[t[e+4]]+Ce[t[e+5]]+"-"+Ce[t[e+6]]+Ce[t[e+7]]+"-"+Ce[t[e+8]]+Ce[t[e+9]]+"-"+Ce[t[e+10]]+Ce[t[e+11]]+Ce[t[e+12]]+Ce[t[e+13]]+Ce[t[e+14]]+Ce[t[e+15]]).toLowerCase()}let Gi;const rp=new Uint8Array(16);function Jl(){if(!Gi){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Gi=crypto.getRandomValues.bind(crypto)}return Gi(rp)}const ec={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function np(t,e,r){t=t||{};const n=t.random??t.rng?.()??Jl();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,Xl(n)}function ap(t,e,r){return ec.randomUUID&&!t?ec.randomUUID():np(t)}const Wi={};function tc(t,e,r){let n;{const a=Date.now(),i=Jl();ip(Wi,a,i),n=op(i,Wi.msecs,Wi.seq,e,r)}return e??Xl(n)}function ip(t,e,r){return t.msecs??=-1/0,t.seq??=0,e>t.msecs?(t.seq=r[6]<<23|r[7]<<16|r[8]<<8|r[9],t.msecs=e):(t.seq=t.seq+1|0,t.seq===0&&t.msecs++),t}function op(t,e,r,n,a=0){if(t.length<16)throw new Error("Random bytes length must be >= 16");if(!n)n=new Uint8Array(16),a=0;else if(a<0||a+16>n.length)throw new RangeError(`UUID byte range ${a}:${a+15} is out of buffer bounds`);return e??=Date.now(),r??=t[6]*127<<24|t[7]<<16|t[8]<<8|t[9],n[a++]=e/1099511627776&255,n[a++]=e/4294967296&255,n[a++]=e/16777216&255,n[a++]=e/65536&255,n[a++]=e/256&255,n[a++]=e&255,n[a++]=112|r>>>28&15,n[a++]=r>>>20&255,n[a++]=128|r>>>14&63,n[a++]=r>>>6&255,n[a++]=r<<2&255|t[10]&3,n[a++]=t[11],n[a++]=t[12],n[a++]=t[13],n[a++]=t[14],n[a++]=t[15],n}const en=new Map;class sp{get length(){return en.size}clear(){en.clear()}getItem(e){return en.get(e)||null}key(e){return Array.from(en.keys())[e]||null}removeItem(e){en.delete(e)}setItem(e,r){en.set(e,String(r))}}const kt=globalThis.localStorage??new sp,lp=async t=>{try{const e=kt.getItem("liipgpt:uID")||kt.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",Ql,{},r).catch(a=>(console.log("Failed to /login use /log",a),t.fetchData("/log",Ql,{},r)));if("maintenance"in n&&n.maintenance)return{mode:"maintenance"};if(!("id"in n))throw new Error("Invalid response format: missing user id");return kt.setItem("liipgpt:uID",n.id),{mode:"ready",userId:n.id}}catch(e){throw console.error("Failed to fetch user data:",e),e}};var et=function(t,e){if(!(this instanceof et))return new et(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=et.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(et.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
|
-
`);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(et.OPEN)}},this.stream=function(){if(!this.xhr){this._setReadyState(et.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!==et.CLOSED&&(this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.autoReconnect=!1,this.xhr.abort())},(e.start===void 0||e.start)&&this.stream()};et.INITIALIZING=-1,et.CONNECTING=0,et.OPEN=1,et.CLOSED=2,typeof sn<"u"&&(sn.SSE=et);class
|
|
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(et.OPEN)}},this.stream=function(){if(!this.xhr){this._setReadyState(et.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!==et.CLOSED&&(this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.autoReconnect=!1,this.xhr.abort())},(e.start===void 0||e.start)&&this.stream()};et.INITIALIZING=-1,et.CONNECTING=0,et.OPEN=1,et.CLOSED=2,typeof sn<"u"&&(sn.SSE=et);class cp{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??et)(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 rc=t=>Object.fromEntries(Object.entries(t).filter(([e,r])=>r!=null));class up{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=rc(r);return this.options.apiKey&&(n.apiKey=this.options.apiKey),new cp(`${this.options.apiUrl}${e}`,n,a)}async fetchData(e,r,n={},a={}){const i=`${this.options.apiUrl}${e}?${new URLSearchParams(rc(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:d,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 d}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 sp=R({url:u().url(),title:u(),considered:K(),orgMetadata:R({authors:J(u())}),type:u(),date:u().datetime(),similarity:pe(),content:u(),fromFullTextSearch:K(),rerank:R({index:pe().int(),adjustment:pe(),score:pe(),similarityOld:pe()})}).deepPartial().or(_f),lp=R({links:J(sp)}),cp=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 up{constructor(e){this.results=e}}class dp{internalData;renderers=new Map;markedExtensions=[];_newTabSrText;constructor(e){const r={apiUrl:e.apiUrl,apiKey:e.apiKey,speechRecognitionApiKey:e.speechRecognitionApiKey,strict:e.strict??!1,EventSource:e.EventSource??EventSource},n=new op(r);this.internalData={restClient:n,metadata:ap(n),searchResponseMap:new Map,chatResponseMap:new Map,conversationMap:new Map}}setMarkedExtensions(...e){this.markedExtensions=e}setNewTabSrText(e){this._newTabSrText=e}getMetadata(){return this.internalData.metadata}createConversationId(){const e=Wi();return this.renderers.set(e,new _l({extensions:this.markedExtensions,newTabSrText:this._newTabSrText})),e}chat(e,r,n={}){const a=new Li,i=Wi(),o=new xl,s=this.renderers.get(e)??new _l({extensions:this.markedExtensions,newTabSrText:this._newTabSrText}),c=new Wh({id:i,onError:h=>{n.onError?.(h)},onFinish:h=>{a.setValue(h)},markdownRenderer:s,userQuestion:r}),l=async()=>{await o,(await d).close()},d=new Li;(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(),d.then(A=>A.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")}});d.setValue(v)})();const p=new Xf({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",lp,{modelId:r.model,lang:r.language,query:e,mapResults:"true",uID:a}),o=i.map(cp);return new up(o)}async getChatConfig(){return this.internalData.restClient.fetchData("/chatconfig",Kl)}async getPredefinedQuestions(e){return(await this.internalData.restClient.fetchData("/topics/questions",Qf,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=(d=>d.includes("mp4")?"mp4":d.includes("webm")?"webm":(d.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 hp=600;function ec(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Qi,tc;function fp(){if(tc)return Qi;tc=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 d(y){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(y).filter(function(k){return Object.propertyIsEnumerable.call(y,k)}):[]}function p(y){return Object.keys(y).concat(d(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(I){T[I]=s(y[I],w)}),p(k).forEach(function(I){v(y,I)||(h(y,I)&&w.isMergeableObject(k[I])?T[I]=l(I,w)(y[I],k[I],w):T[I]=s(k[I],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),I=Array.isArray(y),U=T===I;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,I){return b(T,I,w)},{})};var A=b;return Qi=A,Qi}var pp=fp();const Ln=ec(pp),gp=t=>t===null||typeof t!="object",Yi=t=>{if(gp(t))return t;if(Array.isArray(t))return t.map(Yi);const e=Object.entries(t).filter(([r,n])=>n!==void 0).map(([r,n])=>[r,Yi(n)]);return Object.fromEntries(e)},Sa=(t,e)=>{const r=Yi(e);return Ln(t,r)},rc={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:0,autoCollapseDelay:0,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:`
|
|
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 dp=R({url:u().url(),title:u(),considered:K(),orgMetadata:R({authors:J(u())}),type:u(),date:u().datetime(),similarity:pe(),content:u(),fromFullTextSearch:K(),rerank:R({index:pe().int(),adjustment:pe(),score:pe(),similarityOld:pe()})}).deepPartial().or(Tf),hp=R({links:J(dp)}),fp=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 pp{constructor(e){this.results=e}}class gp{internalData;renderers=new Map;markedExtensions=[];_newTabSrText;constructor(e){const r={apiUrl:e.apiUrl,apiKey:e.apiKey,speechRecognitionApiKey:e.speechRecognitionApiKey,strict:e.strict??!1,EventSource:e.EventSource??EventSource},n=new up(r);this.internalData={restClient:n,metadata:lp(n),searchResponseMap:new Map,chatResponseMap:new Map,conversationMap:new Map}}setMarkedExtensions(...e){this.markedExtensions=e}setNewTabSrText(e){this._newTabSrText=e}getMetadata(){return this.internalData.metadata}createConversationId(){const e=tc();return this.renderers.set(e,new _l({extensions:this.markedExtensions,newTabSrText:this._newTabSrText})),e}chat(e,r,n={}){const a=new Li,i=tc(),o=new xl,s=this.renderers.get(e)??new _l({extensions:this.markedExtensions,newTabSrText:this._newTabSrText}),c=new Kh({id:i,onError:h=>{n.onError?.(h)},onFinish:h=>{a.setValue(h)},markdownRenderer:s,userQuestion:r}),l=async()=>{await o,(await d).close()},d=new Li;(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(),d.then(A=>A.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")}});d.setValue(v)})();const p=new tp({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",hp,{modelId:r.model,lang:r.language,query:e,mapResults:"true",uID:a}),o=i.map(fp);return new pp(o)}async getChatConfig(){return this.internalData.restClient.fetchData("/chatconfig",Kl)}async getPredefinedQuestions(e){return(await this.internalData.restClient.fetchData("/topics/questions",Xf,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=(d=>d.includes("mp4")?"mp4":d.includes("webm")?"webm":(d.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 mp=600;function nc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Qi,ac;function vp(){if(ac)return Qi;ac=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 d(y){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(y).filter(function(k){return Object.propertyIsEnumerable.call(y,k)}):[]}function p(y){return Object.keys(y).concat(d(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(I){T[I]=s(y[I],w)}),p(k).forEach(function(I){v(y,I)||(h(y,I)&&w.isMergeableObject(k[I])?T[I]=l(I,w)(y[I],k[I],w):T[I]=s(k[I],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),I=Array.isArray(y),U=T===I;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,I){return b(T,I,w)},{})};var A=b;return Qi=A,Qi}var bp=vp();const Ln=nc(bp),kp=t=>t===null||typeof t!="object",Yi=t=>{if(kp(t))return t;if(Array.isArray(t))return t.map(Yi);const e=Object.entries(t).filter(([r,n])=>n!==void 0).map(([r,n])=>[r,Yi(n)]);return Object.fromEntries(e)},Sa=(t,e)=>{const r=Yi(e);return Ln(t,r)},ic={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:0,autoCollapseDelay:0,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>
|
|
@@ -358,7 +358,7 @@ Please report this to https://github.com/markedjs/marked.`,t){const n="<p>An err
|
|
|
358
358
|
<path stroke="currentColor" d="M11.998 16.0161c-0.138 0 -0.25 -0.1119 -0.25 -0.25s0.112 -0.25 0.25 -0.25" stroke-width="2"></path>
|
|
359
359
|
<path stroke="currentColor" d="M11.998 16.0161c0.1381 0 0.25 -0.1119 0.25 -0.25s-0.1119 -0.25 -0.25 -0.25" stroke-width="2"></path>
|
|
360
360
|
</svg>
|
|
361
|
-
`,embedAvatar:""}}},
|
|
361
|
+
`,embedAvatar:""}}},yp=Sa(ic,{tokens:{base:{lineColor:"color-mix(in srgb, var(--color-brand-100) 20%, transparent)"},components:{body:{background:"var(--color-grey-900)",color:"var(--color-grey-100)",focus:{color:"var(--color-highlight-400)"},custom:{selectionColor:"var(--color-grey-1000)",selectionBackground:"var(--color-brand-400)"}},avatar:{color:"var(--color-brand-200)",background:"var(--color-grey-800)"},anchor:{color:"var(--color-brand-300)",hover:{color:"var(--color-brand-50)"}},btnPrimary:{color:"var(--color-grey-1000)",background:"var(--color-brand-300)",hover:{background:"var(--color-brand-100)"}},btnSecondary:{color:"var(--color-brand-100)",background:"var(--color-brand-900)",hover:{color:"var(--color-grey-0)",background:"var(--color-brand-800)"}},btnTertiary:{color:"var(--anchor-color)",background:"transparent",borderRadius:"var(--base-border-radius)",hover:{color:"var(--anchor-hover-color)"}},card:{color:"var(--body-color)",background:"var(--color-grey-800)",hover:{color:"var(--color-grey-0)",background:"var(--color-brand-900)"}},input:{background:"var(--color-grey-900)",borderColor:"var(--color-grey-700)",custom:{placeholderColor:"var(--color-grey-400)"}},label:{color:"var(--color-grey-50)"},checkbox:{background:"var(--color-grey-700)",borderColor:"var(--color-grey-500)",custom:{checkedColor:"var(--color-grey-900)",checkedBorderColor:"var(--color-brand-300)",checkedBackground:"var(--color-brand-300)"}},radio:{background:"var(--color-grey-700)",borderColor:"var(--color-grey-500)",custom:{checkedColor:"var(--color-grey-900)",checkedBorderColor:"var(--color-brand-300)",checkedBackground:"var(--color-brand-300)"}},contextBox:{custom:{titleColor:"var(--color-grey-50)"}},referenceDescription:{color:"var(--color-grey-300)",hover:{color:"var(--color-grey-300)"}},chatFooter:{color:"var(--color-grey-500)"},chatInput:{color:"var(--color-grey-100)"},chatInputSubmit:{custom:{deactivatedBackground:"var(--color-grey-400)",deactivatedBorderColor:"var(--color-grey-400)"}},dialog:{custom:{backgroundOverlay:"rgba(0, 0, 0, 0.5)"}},tooltip:{background:"var(--color-grey-1000)"}}}}),fr={fineGrained:{light:ic,dark:yp}},wp=Object.freeze(Object.defineProperty({__proto__:null,theme:fr},Symbol.toStringTag,{value:"Module"})),Ki=t=>typeof t=="string"?Hi[t]:t,_p=t=>{const e=Ki(t?.colors?.brand||Hi.gray),r=Ki(t?.colors?.highlight||e),n={0:"#ffffff",1e3:"#000000",...Ki(t?.colors?.grey||Hi.gray)};let a="";return t.avatarImageUrl?a=`<img src="${t.avatarImageUrl}" alt="Avatar" style="width: 100%; height: 100%; object-fit: cover; border-radius: 50%; aspect-ratio: 1 / 1; display: block; filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.1));" />`:a=fr.fineGrained.light.tokens.svgs.avatar,{fontURLs:t.font?.urls,tokens:{font:{family:t.font?.family},colors:{brand:e,highlight:r,grey:n},base:{fontSizeXs:t.font?.sizeXs,fontSizeSm:t.font?.sizeSm,fontSizeBody:t.font?.sizeBody,fontSizeH3:t.font?.sizeH3,fontSizeH2:t.font?.sizeH2,fontSizeH1:t.font?.sizeH1,fontWeightNormal:t.font?.weightBold,fontWeightBold:t.font?.weightNormal,fontWeightTitle:t.font?.weightTitle,borderRadius:t.borderRadius},components:{body:{background:t.colors?.background,color:t.colors?.text},anchor:{color:t.colors?.anchor?.default,hover:{color:t.colors?.anchor?.hover}}},svgs:{avatar:a}}}},xp=t=>{const e=_p(t);return{light:Sa(fr.fineGrained.light,e)}},Sp=t=>{const e={};return t.dark&&(e.dark=Sa(fr.fineGrained.dark,t.dark)),t.light&&(e.light=Sa(fr.fineGrained.light,t.light)),!t.dark&&!t.light&&(e.light=t.light),e},Pr={de:{askQuestionAgain:"Frage erneut stellen",answerGood:"Gute Antwort",answerBad:"Schlechte Antwort",chatInputPlaceholder:"Fragen Sie mich etwas",chatInputPlaceholderListening:"Ich höre zu...",chatInputSubmit:"Aufforderung senden",chatInputAbort:"Antwort unterbrechen",chatInputStartListening:"Spracherkennung starten",chatInputStopListening:"Spracherkennung beenden",introductionTitle:'Ich bin <span class="liipgpt-gradient-text">LiipGPT</span>. Wie kann ich Ihnen heute helfen?',newChat:"Neuer Chat",maintenanceModeError:"Der Chat ist derzeit nicht verfügbar. Bitte versuchen Sie es später erneut.",messageBotLoading:"Lass mich nachdenken",messageBotError:"Es ist ein Fehler aufgetreten:",messageBotDefaultError:"Unbekannter Fehler",referenceLink:"Link zur Referenz",referencesDisplay:"Referenzen anzeigen",referencesHide:"Referenzen ausblenden",referencesTitle:"Referenzen",referencesFurtherTitle:"Weitere Referenzen",chatFooterText:"",scrollToBottom:"Nach unten scrollen",openMenu:"Menü öffnen",closeMenu:"Menü schließen",closeChat:"Chat schließen",close:"Schließen",openInfo:"Info öffnen",send:"Abschicken",thankYouForFeedback:"Danke für Dein Feedback!",giveFeedback:"Feedback geben",sendFeedback:"Feedback senden",feedbackFormTitle:"Feedback geben, um unseren Chatbot zu verbessern",feedbackFormMessage:"Ihre Nachricht",feedbackFormMessagePlaceholder:"Schreiben Sie hier Ihre Nachricht...",feedbackFormEmail:"E-Mail",feedbackFormEmailPlaceholder:"Ihre E-Mail eingeben...",classificationSubmit:"Abschicken",classificationThankYou:"Danke für Dein Feedback!",classificationTitle:"Bitte bewerten Sie den Einfluss und die Qualität der Antwort",selectLanguage:"Sprache auswählen",languageChanged:"Sprache auf Deutsch geändert.",selectColorTheme:"Farbmodus wählen",lightMode:"Hell",darkMode:"Dunkel",noResultsFound:"Keine Ergebnisse gefunden",aboutThisChat:`
|
|
362
362
|
<p>
|
|
363
363
|
<strong>Dies ist ein Platzhaltertext, um dem Chatbot Kontext zu geben</strong>
|
|
364
364
|
</p>
|
|
@@ -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",ariaOpensInNewTab:"(ouvre dans un nouvel onglet)",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"}},wp=Object.freeze(Object.defineProperty({__proto__:null,translations:Pr},Symbol.toStringTag,{value:"Module"})),_p=t=>{t=t??Pr;const e={};return t.de&&(e.de=Ln(Pr.de,t.de)),t.en&&(e.en=Ln(Pr.en,t.en)),t.fr&&(e.fr=Ln(Pr.fr,t.fr)),t.it&&(e.it=Ln(Pr.it,t.it)),e},xp=t=>({init:t?.init??[],bot:{before:t?.bot?.before??[],after:t?.bot?.after??[]},user:{before:t?.user?.before??[],after:t?.user?.after??[]}}),nc=t=>{let e;t.theme?.fineGrained?e=yp(t.theme?.fineGrained):e=kp(t?.theme??{});const r=_p(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??hp,forceConsent:t.forceConsent??!1,askQuestionAgain:t.askQuestionAgain??!1,enableBackdrop:t.enableBackdrop??!1,messageAdditions:xp(t.messageAdditions??{}),contextVersion:t.contextVersion??0};return t.classification&&(n.classification=t.classification),t.menu&&(n.menu=t.menu),n},ac={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é."}},ic={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"}},Xi=structuredClone(fr.fineGrained.light);Xi.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 oc=structuredClone(fr.fineGrained.dark);oc.tokens.colors=Xi.tokens.colors;const Sp=Object.freeze(Object.defineProperty({__proto__:null,theme:{fineGrained:{light:Xi,dark:oc}}},Symbol.toStringTag,{value:"Module"})),sc=t=>t.split("/").pop().split(".")[0],Tp=Object.assign({"./default/fallback-dev.theme.ts":Sp,"./default/fallback.theme.ts":vp}),Ji=new Map;Object.entries(Tp).forEach(([t,e])=>{const{error:r,data:n}=ql.safeParse(e?.theme);if(r){console.error(`Invalid theme in ${t}:`,r);return}Ji.set(sc(t),n)});const Wg=t=>{const e=Ji.get(t);return e||(console.error(`Theme ${t} not found`),fr)};Array.from(Ji.keys());const Cp=Object.assign({"./default/fallback.translations.ts":wp}),eo=new Map;Object.entries(Cp).forEach(([t,e])=>{const{error:r,data:n}=Zl.safeParse(e?.translations);if(r){console.error(`Invalid translations in ${t}:`,r);return}eo.set(sc(t),n)});const Qg=t=>{const e=eo.get(t);return e||(console.error(`Theme ${t} not found`),Pr)};Array.from(eo.keys());const Ep="en",lc=(t,e)=>e.includes(t),Ta=(t,e)=>{if(lc(t,e))return t;const r=Ap();return lc(r,e)?r:Ep},Ap=()=>navigator.language.split("-")[0],cc=(t,e)=>{localStorage.setItem("liipgpt:selectedLanguage",t),e&&(e.lang=t)},uc=t=>Ta(localStorage.getItem("liipgpt:selectedLanguage"),t);var to,dc;function Rp(){return dc||(dc=1,to=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}),to}var Ip=Rp();const Lp=ec(Ip),Op=typeof document<"u";let hc=0;class Mp{#e=te(St([]));get toasts(){return _(this.#e)}set toasts(e){$(this.#e,e,!0)}#t=te(St([]));get heights(){return _(this.#t)}set heights(e){$(this.#t,e,!0)}#a=e=>{const r=this.toasts.findIndex(n=>n.id===e);return r===-1?null:r};addToast=e=>{Op&&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:hc++,i=e.dismissable===void 0?!0:e.dismissable,o=e.type===void 0?"default":e.type;return mt(()=>{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=>(mt(()=>{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=Np(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||hc++;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 Np(t){return t&&typeof t=="object"&&"status"in t?`HTTP error! Status: ${t.status}`:`Error! ${t}`}const yt=new Mp;function Pp(t,e){return yt.create({message:t,...e})}const ro=Object.assign(Pp,{success:yt.success,info:yt.info,warning:yt.warning,error:yt.error,custom:yt.custom,message:yt.message,promise:yt.promise,dismiss:yt.dismiss,loading:yt.loading,getActiveToasts:()=>yt.toasts.filter(t=>!t.dismiss)}),Dp=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)},$p=(t,e)=>{const r={};return e.forEach(n=>{r[n]=t[n]}),r},zp=console.warn,Fp=()=>{},fc=(t,e)=>mt(()=>{console.warn=Fp;const r=e?$p(t,e):t,n=xu(r);return console.warn=zp,n}),Bp=t=>t&&typeof t.then=="function";class jp{config;self;devtools;stateKeys;constructor(e,r){this.config=e,this.self=r,typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__&&(this.stateKeys=Dp(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 fc(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 mt(()=>r.call(this.self,...a));const i=fc(a);this.sendStart(e,i);try{const o=mt(()=>r.call(this.self,...a));return Bp(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 Up=(t,e)=>{const r={},n=new jp(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 qp(){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 no(){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 pc(){return typeof window>"u"?!1:!!(window.MediaRecorder&&no())}class gc{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(!pc()||!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=no();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 pc()}static getSupportedMediaType(){return no()}}const Vp=t=>(localStorage.setItem("liipgpt-color-scheme",t),ao(["light","dark"])),mc=()=>{const t=localStorage.getItem("liipgpt-color-scheme");return t==="light"||t==="dark"?t:"system"},ao=t=>{let e=mc();return e==="system"&&(e=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),t.includes(e)?e:t[0]??"light"},Hp="liipgpt:context",Zp=()=>localStorage.getItem(Hp),Gp=[{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)}],vc=t=>{for(const e of Gp)if(e.check(t))return e.type},io="liipgpt:selectorValues",oo="liipgpt:selectorKnownDefaults",bc=()=>{try{const t=kt.getItem(io),e=kt.getItem(oo);return t?{values:JSON.parse(t),knownDefaults:e?JSON.parse(e):{}}:null}catch{return null}},Wp=t=>{const e={};for(const r of t)e[r.settingName]=r.defaultValues??(r.allowEmpty?[]:[r.values[0]]).filter(Boolean);return e},kc=(t,e)=>{try{const r=Wp(e);kt.setItem(io,JSON.stringify(t)),kt.setItem(oo,JSON.stringify(r))}catch(r){console.error("Failed to save selector values:",r)}},Qp=t=>{try{const e=bc();if(!e)return;delete e.values[t],delete e.knownDefaults[t],kt.setItem(io,JSON.stringify(e.values)),kt.setItem(oo,JSON.stringify(e.knownDefaults))}catch(e){console.error("Failed to clear selector saved state:",e)}},Yp=t=>{const e=bc(),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)),d=a.filter(h=>!o.includes(h)&&!l.includes(h)),p=[...l,...d];return p.length===0&&!n.allowEmpty?[n.settingName,a]:[n.settingName,p]});return Object.fromEntries(r)};class Kp extends Error{constructor(e){super(e),this.name="UnreachableError"}}const yc=(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"}},Dr=t=>t?t.map(e=>({id:Wi(),...e})):[];class Xp{#e=te(St({}));get data(){return _(this.#e)}set data(e){$(this.#e,e,!0)}#t=te(St({}));get targets(){return _(this.#t)}set targets(e){$(this.#t,e,!0)}#a=te(!1);get initialized(){return _(this.#a)}set initialized(e){$(this.#a,e,!0)}#l=te(0);get currentAudioVolume(){return _(this.#l)}set currentAudioVolume(e){$(this.#l,e,!0)}ariaLiveMessagesClearingTimeoutDuration=350;#u=te(null);get currentAudioRecorder(){return _(this.#u)}set currentAudioRecorder(e){$(this.#u,e,!0)}#i=te(!1);get isTranscribing(){return _(this.#i)}set isTranscribing(e){$(this.#i,e,!0)}#r=ee(()=>{if(!this.initialized)return[];const e=this.data.chatConfig.menu;return e?e[this.data.language]??[]:[]});get menu(){return _(this.#r)}set menu(e){$(this.#r,e)}#o=ee(()=>this.initialized?this.data.chatConfig.translations[this.data.language]??{}:{});get t(){return _(this.#o)}set t(e){$(this.#o,e)}#s=ee(()=>this.initialized?ac[this.data.language]??{}:ac.en??{});get errorTranslations(){return _(this.#s)}set errorTranslations(e){$(this.#s,e)}#n=ee(()=>this.initialized?ic[this.data.language]??{}:ic.en??{});get piiTranslations(){return _(this.#n)}set piiTranslations(e){$(this.#n,e)}#c=ee(()=>this.initialized?this.data.currentColorScheme:"light");get colorScheme(){return _(this.#c)}set colorScheme(e){$(this.#c,e)}#d=ee(()=>this.initialized?this.data.chatConfig.fullTheme[this.data.currentColorScheme]:{});get themeBase(){return _(this.#d)}set themeBase(e){$(this.#d,e)}#f=ee(()=>this.themeBase.tokens);get theme(){return _(this.#f)}set theme(e){$(this.#f,e)}#h=ee(()=>{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){$(this.#h,e)}}const g=new Xp;let tt,wt,wc;Up({name:"chat-logic",state:g,excludeInDevTools:["onInput"]},{async init(t){wt=t;const e=wt.speechRecognitionApiKey||void 0;tt=new dp({apiUrl:wt.apiUrl,apiKey:wt.apiKey,speechRecognitionApiKey:e,strict:!0});try{const r=await tt.getChatConfig();window.CHAT_CONFIG_OVERRIDE&&Object.assign(r,window.CHAT_CONFIG_OVERRIDE);const a=(await tt.getMetadata()).mode==="maintenance";a&&this.showErrorToast("maintenance");const i=nc(r);wt.inlineLayout!==void 0&&(i.inlineLayout=wt.inlineLayout);let o;wt.lang?o=Ta(wt.lang,i.supportedLanguages):o=uc(i.supportedLanguages),cc(o,g.targets.mainElement);const s=await this.getPredefinedQuestions(o),c=i.translations[o]?.ariaOpensInNewTab;c&&tt.setNewTabSrText(c);const l=[];if(i.renderKatex){const v=await import("https://esm.sh/marked-katex-extension@5.1.5").catch(m=>{console.error("Couldn't load marked-katex-extension:",m)});v&&(tt.setMarkedExtensions(v.default({nonStandard:!0,output:"mathml"})),l.push("https://cdn.jsdelivr.net/npm/katex@0.16.22/dist/katex.min.css"))}const d=Object.keys(i.fullTheme);let p=!1;if(i.forceConsent)try{p=kt.getItem("liipgpt:termsAccepted")==="true"}catch(v){console.warn("Failed to load terms acceptance from storage:",v)}g.data={currentConversationState:"idle",chatConfig:i,language:o,predefinedQuestions:s,isInMaintenance:a,history:Dr(i.messageAdditions.init),selectedColorScheme:mc(),has2ColorSchemes:d.length===2,currentColorScheme:ao(d),conversationFeedbackId:void 0,conversationFeedbackIsOpen:!1,openedPopup:void 0,props:wt,flyoutIsOpen:!1,questionHasPii:void 0,chatInputValue:"",selectorValues:Yp(i.selectorsConfig),selectorsIsOpen:!1,currentReferencesAsideId:void 0,ariaLiveStatusMessage:void 0,ariaLiveStatusMessageClearingTimeout:void 0,wasReferencesAsideClosed:!1,isAsideMobile:!0,route:yc(i.forceConsent??!1,p),additionalStylesheets:l,hasOpenedOverlays:!1,isInlineLayoutContained:!1,termsAccepted:p},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(yc(i.forceConsent??!1,p),!0)}catch(r){throw ro.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&&Lp(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,kc(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 Qp(t),g.data.selectorValues[t]=r,kc(g.data.selectorValues,g.data.chatConfig.selectorsConfig),r},async getPredefinedQuestions(t){try{return tt.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=Vp(t),this.setAriaLiveStatusMessage(t==="dark"?g.t.ariaDarkSelected:g.t.ariaLightSelected)},async abort(){await wc?.abort()},changeConversationState(t){g.data.currentConversationState=t,window.LIIPGPT_LISTENERS?.conversation?.(t)},onInput(t){g.data.chatConfig.blockPII&&(g.data.questionHasPii=vc(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;g.data.history.push(...Dr(g.data.chatConfig.messageAdditions.user.before)),g.data.history.push({type:"user",time:new Date().toISOString(),message:g.data.chatInputValue}),g.data.history.push(...Dr(g.data.chatConfig.messageAdditions.user.after));const r=g.data.history.push(...Dr(g.data.chatConfig.messageAdditions.bot.before));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:wt.features?wt.features.trim().split(","):["formatting"],onError:d=>{this.showErrorToast(d),window.LIIPGPT_LISTENERS?.error?.(d),(d==="pii-detected"||d==="blocked")&&this.editLatestQuestion()},lang:g.data.language,selectorValues:{...this.getPrettifiedSelectorValues(),context:Zp()}},a=(d,p)=>{try{const h=new URL(d),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 d=i==="location"||g.data.props.flyout;let p;d?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=tt.createConversationId());const o=tt.chat(g.data.currentConversationId,e,n);wc=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(d=>{if(g.data.history[r]&&(g.data.history[r]={question:g.data.chatInputValue,...d}),g.data.chatConfig.addRetrievalQuestionToUrlParams&&d.retrievalQuestion){const p=new URLSearchParams(window.location.search);p.get("search")!==d.retrievalQuestion&&(p.set("search",d.retrievalQuestion),history.replaceState(null,"",`?${p.toString()}`))}g.data.chatConfig.showReferencesByDefault&&!g.data.wasReferencesAsideClosed&&g.data.currentReferencesAsideId!==d.id&&!g.data.isAsideMobile&&this.openReferencesAside(d.id),d.state==="streaming"&&g.data.currentConversationState!=="answering"&&this.changeConversationState("answering"),d.state==="done"&&(this.changeConversationState("idle"),s||(s=!0,this.setAriaLiveStatusMessage(`${g.t.ariaAnswerReady} ... ${d.message.text} ... ${g.t.ariaAnswerFinished}`),g.data.history.push(...Dr(g.data.chatConfig.messageAdditions.bot.after))),g.data.currentReferencesAsideId&&g.data.history[r].references.used.length>0?(clearTimeout(c),c=setTimeout(()=>{this.openReferencesAside(d.id)},100)):this.closeReferencesAside())}),g.data.chatInputValue=""},async onStartSpeechRecognition(){try{if(!await qp()){this.showErrorToast("speech-not-supported");return}if(await navigator.mediaDevices.getUserMedia({audio:!0}),gc.isSupported())g.data.chatInputValue="",g.currentAudioRecorder=new gc({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 tt.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=vc(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=Dr(g.data.chatConfig.messageAdditions.init),g.data.currentConversationId=tt.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=Dr(g.data.chatConfig.messageAdditions.init),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){ro.success(g.t[t],{unstyled:!0,duration:3e3,classes:{toast:"toast"}})},showErrorToast(t){ro.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 Kp("Tried to give feedback with no id.");const r=g.data.history.find(n=>n.type==="bot"&&n.id===e);await tt.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 tt.thumbsUp(t,r?.question??""):await tt.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=Ta(t,g.data.chatConfig.supportedLanguages),cc(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{kt.setItem("liipgpt:termsAccepted","true")}catch(t){console.warn("Failed to save terms acceptance to storage:",t)}this.closePopup(),await gs(),this.goto({name:"start-page"})},updateChatInput(t){g.data.chatInputValue=t}});const Jp='@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,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}.svg--avatar--hide{visibility:hidden;height:0;margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0}}@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}}',eg=new RegExp("([\\p{Ll}\\d])(\\p{Lu})","gu"),tg=new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])","gu"),rg=new RegExp("(\\d)(\\p{Ll})","gu"),ng=new RegExp("(\\p{L})(\\d)","gu"),ag=/[^\p{L}\d]+/giu,Ca="$1\0$2",ig="";function og(t,e){let r=t.trim();r=r.replace(eg,Ca).replace(tg,Ca),e?.separateNumbers&&(r=r.replace(rg,Ca).replace(ng,Ca)),r=r.replace(ag,"\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 sg(t,e){return ug(t,e?.prefixCharacters)+og(t,e).map(cg(e?.locale)).join(e?.delimiter??" ")}function lg(t,e){return sg(t,{delimiter:"-",...e})}function cg(t){return t===!1?e=>e.toLowerCase():e=>e.toLocaleLowerCase(t)}function ug(t,e=ig){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 Ea=lg,dg=640,hg=1024;let Aa=null;const fg=()=>{if(Aa)return Aa;if(!globalThis.document)return 16;const t=globalThis.document.querySelector(":root");return Aa=Number(getComputedStyle(t).fontSize.slice(0,-2)),Aa},pg=({minRem:t,maxRem:e})=>{const r=fg(),n=dg/r,a=hg/r,i=(e-t)/(a-n),o=-n*i+t;return`clamp( ${t}rem, ${o}rem + ${i*100}cqw, ${e}rem )`},_c=t=>typeof t=="string"?t:typeof t=="number"?String(t):typeof t=="object"?t.minRem===t.maxRem?`${t.minRem}rem`:pg(t):"",so=(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+=`--${Ea(t)}-${Ea(i)}:${_c(o)}; `)}),a},xc=(t,e)=>Object.entries(e).map(([r,n])=>`--${t}-${Ea(r)}:${_c(n)}`).join("; ")+"; ",gg=(t,e)=>{let r="";return r+=so(t,e,["background","borderWidth","borderColor","boxShadow","borderRadius","color"],!0),e.hover&&(r+=so(`${t}-hover`,e.hover,["background","borderWidth","borderColor","boxShadow","color"])),e.focus&&(r+=so(`${t}-focus`,e.focus,["background","borderWidth","borderColor","boxShadow","color"])),e.custom&&(r+=xc(t,e.custom)),r},mg=(t,e)=>Object.entries(e).map(([r,n])=>`--color-${t}-${r}:${n}`).join("; ")+"; ",vg=t=>`--font-family: ${t?.family||"inherit"};`,bg=t=>{const e=vg(t.font),r=Object.entries(t.colors).map(([i,o])=>mg(i,o)).join(""),n=xc("base",t.base),a=Object.entries(t.components).map(([i,o])=>gg(Ea(i),o)).join("");return`.chat-app {${e} ${r} ${n} ${a}};`};var ht=typeof window<"u"?window:{screen:{},navigator:{}},tn=(ht.matchMedia||function(){return{matches:!1}}).bind(ht),kg={get passive(){return!0}},Sc=function(){};ht.addEventListener&&ht.addEventListener("p",Sc,kg),ht.removeEventListener&&ht.removeEventListener("p",Sc,!1);var lo="ontouchstart"in ht,yg="TouchEvent"in ht,wg=lo||yg&&tn("(any-pointer: coarse)").matches,Tc=(ht.navigator.maxTouchPoints||0)>0||wg,Cc=ht.navigator.userAgent||"",_g=tn("(pointer: coarse)").matches&&/iPad|Macintosh/.test(Cc)&&Math.min(ht.screen.width||0,ht.screen.height||0)>=768,Ec=(tn("(pointer: coarse)").matches||!tn("(pointer: fine)").matches&&lo)&&!/Windows.*Firefox/.test(Cc),xg=tn("(any-pointer: fine)").matches||tn("(any-hover: hover)").matches||_g||!lo,Ac=Tc&&(xg||!Ec)?"hybrid":Tc?"touchOnly":"mouseOnly",Sg=Ac==="mouseOnly"?"mouse":Ac==="touchOnly"||Ec?"touch":"mouse";function Rc(t,e){jr(e,!0);let r=se(e,"href",7),n=se(e,"target",7),a=se(e,"onclick",7),i=se(e,"className",23,()=>[]),o=se(e,"isStandalone",7,!1),s=se(e,"children",7),c=se(e,"type",7,"button"),l=se(e,"use",7),d=se(e,"class",7),p=fi(e,["$$slots","$$events","$$legacy","$$host","href","target","onclick","className","isStandalone","children","type","use","class"]);const h=ee(()=>r()?"a":"button"),v=ee(()=>[...Array.isArray(i())?i():i()?[i()]:[],...d()?[d()]:[]]),m=()=>({}),b=ee(()=>l()??m);var A=vt(),y=Oe(A);return Es(y,()=>_(h),!1,(k,w)=>{As(k,U=>_(b)?.(U)),Ps(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),[Wr]:U}),[()=>({"open-button--standalone":o()})]);var T=vt(),I=Oe(T);Ss(I,s),oe(w,T)}),oe(t,A),Ur({get href(){return r()},set href(k){r(k),re()},get target(){return n()},set target(k){n(k),re()},get onclick(){return a()},set onclick(k){a(k),re()},get className(){return i()},set className(k=[]){i(k),re()},get isStandalone(){return o()},set isStandalone(k=!1){o(k),re()},get children(){return s()},set children(k){s(k),re()},get type(){return c()},set type(k="button"){c(k),re()},get use(){return l()},set use(k){l(k),re()},get class(){return d()},set class(k){d(k),re()}})}bn(Rc,{href:{},target:{},onclick:{},className:{},isStandalone:{},children:{},type:{},use:{},class:{}},[],[],!0);function On(t,e){jr(e,!0);let r=se(e,"css",7),n=fi(e,["$$slots","$$events","$$legacy","$$host","css"]);const a=c=>{es(()=>{r()&&(c.innerHTML=r())})};var i=vt(),o=Oe(i);{var s=c=>{var l=vt(),d=Oe(l);Es(d,()=>"style",!1,(p,h)=>{As(p,v=>a?.(v)),Ps(p,()=>({...n}))}),oe(c,l)};ur(o,c=>{r()&&c(s)})}return oe(t,i),Ur({get css(){return r()},set css(c){r(c),re()}})}bn(On,{css:{}},[],[],!0);var Tg=Et('<div class="open-button__title"><!></div>'),Cg=Et('<div class="open-button__mask"><div class="open-button__description"><!></div></div>'),Eg=Et('<div class="open-button__text"><!> <!></div>'),Ag=Et('<div class="sr-only"> </div>'),Rg=Et('<!> <div class="svg svg--avatar open-button__avatar" aria-hidden="true"><!></div>',1),Ig=Et('<link rel="stylesheet"/>'),Lg=Et("<!> <!>",1),Og=Et('<!> <!> <!> <main class="chat-app"><!></main>',1);function Ic(t,e){jr(e,!0);const r=(B,z)=>{let G=()=>z?.().chatConfig,Ue=()=>z?.().language,ye=()=>z?.().colorScheme;const le=ee(()=>{const{openButtonTitle:xe,openButtonDescription:ie}=G().translations[Ue()];return{openButtonTitle:xe,openButtonDescription:ie}}),qe=ee(()=>G().fullTheme[ye()].tokens.svgs),we=ee(()=>G().fullTheme[ye()]?.tokens.components.openButton?.custom),_e=ee(()=>!!_(we)?.hideTitleWhenCollapsed);{let xe=ee(()=>G().buttonHref?void 0:s()?"true":"false"),ie=ee(()=>G().buttonHref?void 0:"true"),rt=ee(()=>G().buttonHref?void 0:o()),Ve=ee(()=>["open-button",e.buttonClass,g.data.flyoutIsOpen?"open-button--expanded":void 0,_(_e)?"open-button--hide-title-when-collapsed":void 0]);Rc(B,{get href(){return G().buttonHref},onclick:Ia,onmouseenter:Ra,onmouseleave:ho,use:er,get"aria-expanded"(){return _(xe)},get"aria-haspopup"(){return _(ie)},get"aria-controls"(){return _(rt)},get style(){return e.buttonStyle},get className(){return _(Ve)},get isStandalone(){return _(h)},children:(ft,tr)=>{var Ot=Rg(),Nn=Oe(Ot);{var La=nt=>{var Ze=Eg(),zr=Ut(Ze);{var Oa=Mt=>{var at=Tg(),Nt=Ut(at);li(Nt,()=>_(le).openButtonTitle),Ft(at),oe(Mt,at)};ur(zr,Mt=>{_(le).openButtonTitle&&Mt(Oa)})}var Ma=lr(zr,2);{var Pn=Mt=>{var at=Cg(),Nt=Ut(at),_t=Ut(Nt);li(_t,()=>_(le).openButtonDescription),Ft(Nt),Bs(Nt,Pt=>$(k,Pt),()=>_(k)),Ft(at),Bs(at,Pt=>$(y,Pt),()=>_(y)),oe(Mt,at)};ur(Ma,Mt=>{_(le).openButtonDescription&&Sg==="mouse"&&Mt(Pn)})}Ft(Ze),oe(nt,Ze)},fo=nt=>{var Ze=Ag(),zr=Ut(Ze,!0);Ft(Ze),Qn(()=>ws(zr,g.t.ariaOpenChat)),oe(nt,Ze)};ur(Nn,nt=>{_(le).openButtonTitle||_(le).openButtonDescription?nt(La):nt(fo,!1)})}var nn=lr(Nn,2),$r=Ut(nn);li($r,()=>_(qe).avatar),Ft(nn),oe(ft,Ot)},$$slots:{default:!0}})}};let n=te("light"),a=se(e,"host",7),i=se(e,"onError",7),o=se(e,"flyoutId",7),s=se(e,"flyoutIsOpen",7),c=fi(e,["$$slots","$$events","$$legacy","$$host","host","onError","flyoutId","flyoutIsOpen"]);const l=async B=>{const G=await(await fetch(`${B}/chatconfig`)).json();return Kl.parse(G)},d=async({forceTheme:B,lang:z,apiUrl:G})=>{const Ue=window.CHAT_CONFIG_OVERRIDE?window.CHAT_CONFIG_OVERRIDE:await l(G),ye=nc(Ue);let le;z?le=Ta(z,ye.supportedLanguages):le=uc(ye.supportedLanguages);const qe=Object.keys(ye.fullTheme),we=ao(qe);return{chatConfig:ye,language:le,colorScheme:we}},p=(B,z)=>{if(B==null)return z;if(typeof B=="string"){const G=B.trim().toLowerCase();return!(G===""||G==="0"||G==="false"||G==="no")}return typeof B=="number"?B!==0:typeof B=="boolean"?B:z};let h=ee(()=>!!a()),v=te(!1),m=te(!1),b=te(!1),A=te(void 0),y=te(void 0),k=te(void 0),w=ee(()=>_(k)?.offsetWidth??0),T=ee(()=>_(k)?.offsetHeight??0),I=te(void 0),U=te(!1),Q,je=te(!0);function ce(){return _(I)?(clearTimeout(_(I)),$(I,void 0),!0):!1}async function pr(B){$(n,B.colorScheme,!0),Q?.(),ce(),$(U,!1);const z=B.chatConfig.fullTheme[_(n)]?.tokens.components.openButton?.custom??{},G=z.autoExpandScrollThreshold,Ue=Number(z.autoCollapseDelay??0),ye=Number.isNaN(Ue)?0:Math.max(0,Ue),le=p(z.autoExpandOnce,!1),qe=(()=>{if(G==null)return 100;if(typeof G=="string"){if(G.trim().toLowerCase()==="none")return 0;const Ve=Number(G);return Number.isNaN(Ve)?100:Ve}const ie=Number(G);return Number.isNaN(ie)?100:ie})();if(Number.isNaN(qe)||qe<=0)return;const we=`liipgpt-auto-expand-${e.apiUrl}`;let _e=!1;if(typeof window<"u")try{_e=window.localStorage.getItem(we)==="true"}catch(ie){console.warn("LiipGPT: unable to read auto-expand flag",ie)}$(b,_e,!0);const xe=()=>{if(!(window.scrollY/window.innerHeight*100>=qe)){$(je,!0);return}if(!(_(m)||s())&&!(le&&(_e||_(b)))&&_(je)){if($(je,!1),$(m,!0),$(b,!0),co(),le&&typeof window<"u")try{window.localStorage.setItem(we,"true")}catch(Ve){console.warn("LiipGPT: unable to persist auto-expand flag",Ve)}$(I,setTimeout(()=>{_(U)||(uo(),$(m,!1)),$(I,void 0)},ye),!0)}};window.addEventListener("scroll",xe,{passive:!0}),qe===0&&(await gs(),xe()),Q=()=>{window.removeEventListener("scroll",xe)}}function ae(){ce(),$(m,!1),$(U,!1)}function er(B){$(A,B,!0)}function gr(){Q?.(),ce()}hd(gr);function mr(){!_(k)||!_(y)||(_(y).style.width=`${_(w)}px`,_(y).style.height=`${_(T)}px`)}function rn(){_(y)&&(_(y).style.width="0",_(y).style.height="0")}function co(){_(A)&&(_(A).classList.add("open-button--programmatic-expand"),mr())}function uo(){_(A)&&(_(A).classList.remove("open-button--programmatic-expand"),rn())}function Ra(){ce()&&$(U,!0),mr()}function ho(){ce(),_(U)&&($(m,!1),$(U,!1),_(A)?.classList.remove("open-button--programmatic-expand")),_(v)||rn()}function Ia(B){ae(),e.onclick?.(B)}let ue=ee(()=>d(c).then(async B=>(await pr(B),B)).catch(B=>i()(B)));var Mn=vt();Ku("beforeunload",Xa,gr),Ju(B=>{var z=vt(),G=Oe(z);{var Ue=ye=>{var le=vt(),qe=Oe(le);Ts(qe,()=>_(ue),null,(we,_e)=>{var xe=Lg();const ie=ee(()=>_(_e).chatConfig.fullTheme[_(_e).colorScheme]);var rt=Oe(xe);gd(rt,17,()=>_(ie).fontURLs??[],fd,(ft,tr)=>{var Ot=Ig();Qn(()=>hi(Ot,"href",_(tr))),oe(ft,Ot)});var Ve=lr(rt,2);On(Ve,{id:"font-css",get css(){return _(ie).fontCSS}}),oe(we,xe)}),oe(ye,le)};ur(G,ye=>{_(h)&&ye(Ue)})}oe(B,z)});var ge=Oe(Mn);return Ts(ge,()=>_(ue),B=>{},(B,z)=>{var G=vt();const Ue=ee(()=>_(z).chatConfig.fullTheme[_(n)]);var ye=Oe(G);{var le=we=>{var _e=Og(),xe=Oe(_e);{let tr=ee(()=>bg(_(Ue).tokens));On(xe,{id:"theme-css",get css(){return _(tr)}})}var ie=lr(xe,2);On(ie,{id:"app-css",get css(){return Jp}});var rt=lr(ie,2);On(rt,{id:"custom-css",get css(){return _(Ue).customCSS}});var Ve=lr(rt,2),ft=Ut(Ve);r(ft,()=>_(z)),Ft(Ve),oe(we,_e)},qe=we=>{r(we,()=>_(z))};ur(ye,we=>{_(h)?we(le):we(qe,!1)})}oe(B,G)}),oe(t,Mn),Ur({get host(){return a()},set host(B){a(B),re()},get onError(){return i()},set onError(B){i(B),re()},get flyoutId(){return o()},set flyoutId(B){o(B),re()},get flyoutIsOpen(){return s()},set flyoutIsOpen(B){s(B),re()}})}bn(Ic,{host:{},onError:{},flyoutId:{},flyoutIsOpen:{}},[],[],!0);function Lc(t,e){jr(e,!0);let r=se(e,"onclick",7),n=se(e,"buttonClass",7),a=se(e,"buttonStyle",7),i=se(e,"apiUrl",7),o=se(e,"forceTheme",7),s=se(e,"lang",7),c=ee(()=>({onclick:r(),buttonClass:n(),buttonStyle:a(),apiUrl:i(),forceTheme:o(),lang:s()}));return Us(t,{silent:!0,body:(d,p=br)=>{Ic(d,Od({host:e.$$host,get onError(){return p()}},()=>_(c)))},$$slots:{body:!0}}),Ur({get onclick(){return r()},set onclick(l){r(l),re()},get buttonClass(){return n()},set buttonClass(l){n(l),re()},get buttonStyle(){return a()},set buttonStyle(l){a(l),re()},get apiUrl(){return i()},set apiUrl(l){i(l),re()},get forceTheme(){return o()},set forceTheme(l){o(l),re()},get lang(){return s()},set lang(l){s(l),re()}})}return customElements.define("liipgpt-button",bn(Lc,{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)),sn.LiipGPTButton=Lc,Object.defineProperty(sn,Symbol.toStringTag,{value:"Module"}),sn}({});
|
|
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",ariaOpensInNewTab:"(ouvre dans un nouvel onglet)",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"}},Tp=Object.freeze(Object.defineProperty({__proto__:null,translations:Pr},Symbol.toStringTag,{value:"Module"})),Ep=t=>{t=t??Pr;const e={};return t.de&&(e.de=Ln(Pr.de,t.de)),t.en&&(e.en=Ln(Pr.en,t.en)),t.fr&&(e.fr=Ln(Pr.fr,t.fr)),t.it&&(e.it=Ln(Pr.it,t.it)),e},Cp=t=>({init:t?.init??[],bot:{before:t?.bot?.before??[],after:t?.bot?.after??[]},user:{before:t?.user?.before??[],after:t?.user?.after??[]}}),oc=t=>{let e;t.theme?.fineGrained?e=Sp(t.theme?.fineGrained):e=xp(t?.theme??{});const r=Ep(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??mp,forceConsent:t.forceConsent??!1,askQuestionAgain:t.askQuestionAgain??!1,enableBackdrop:t.enableBackdrop??!1,messageAdditions:Cp(t.messageAdditions??{}),contextVersion:t.contextVersion??0};return t.classification&&(n.classification=t.classification),t.menu&&(n.menu=t.menu),n},sc={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é."}},lc={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"}},Xi=structuredClone(fr.fineGrained.light);Xi.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 cc=structuredClone(fr.fineGrained.dark);cc.tokens.colors=Xi.tokens.colors;const Ap=Object.freeze(Object.defineProperty({__proto__:null,theme:{fineGrained:{light:Xi,dark:cc}}},Symbol.toStringTag,{value:"Module"})),uc=t=>t.split("/").pop().split(".")[0],Rp=Object.assign({"./default/fallback-dev.theme.ts":Ap,"./default/fallback.theme.ts":wp}),Ji=new Map;Object.entries(Rp).forEach(([t,e])=>{const{error:r,data:n}=ql.safeParse(e?.theme);if(r){console.error(`Invalid theme in ${t}:`,r);return}Ji.set(uc(t),n)});const X0=t=>{const e=Ji.get(t);return e||(console.error(`Theme ${t} not found`),fr)};Array.from(Ji.keys());const Ip=Object.assign({"./default/fallback.translations.ts":Tp}),eo=new Map;Object.entries(Ip).forEach(([t,e])=>{const{error:r,data:n}=Zl.safeParse(e?.translations);if(r){console.error(`Invalid translations in ${t}:`,r);return}eo.set(uc(t),n)});const J0=t=>{const e=eo.get(t);return e||(console.error(`Theme ${t} not found`),Pr)};Array.from(eo.keys());const Lp="en",dc=(t,e)=>e.includes(t),Ta=(t,e)=>{if(dc(t,e))return t;const r=Op();return dc(r,e)?r:Lp},Op=()=>navigator.language.split("-")[0],hc=(t,e)=>{localStorage.setItem("liipgpt:selectedLanguage",t),e&&(e.lang=t)},fc=t=>Ta(localStorage.getItem("liipgpt:selectedLanguage"),t);var to,pc;function Mp(){return pc||(pc=1,to=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}),to}var Np=Mp();const Pp=nc(Np),Dp=typeof document<"u";let gc=0;class $p{#e=te(St([]));get toasts(){return _(this.#e)}set toasts(e){$(this.#e,e,!0)}#t=te(St([]));get heights(){return _(this.#t)}set heights(e){$(this.#t,e,!0)}#a=e=>{const r=this.toasts.findIndex(n=>n.id===e);return r===-1?null:r};addToast=e=>{Dp&&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:gc++,i=e.dismissable===void 0?!0:e.dismissable,o=e.type===void 0?"default":e.type;return mt(()=>{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=>(mt(()=>{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=zp(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||gc++;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 zp(t){return t&&typeof t=="object"&&"status"in t?`HTTP error! Status: ${t.status}`:`Error! ${t}`}const yt=new $p;function Fp(t,e){return yt.create({message:t,...e})}const ro=Object.assign(Fp,{success:yt.success,info:yt.info,warning:yt.warning,error:yt.error,custom:yt.custom,message:yt.message,promise:yt.promise,dismiss:yt.dismiss,loading:yt.loading,getActiveToasts:()=>yt.toasts.filter(t=>!t.dismiss)}),Bp=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)},jp=(t,e)=>{const r={};return e.forEach(n=>{r[n]=t[n]}),r},Up=console.warn,qp=()=>{},mc=(t,e)=>mt(()=>{console.warn=qp;const r=e?jp(t,e):t,n=Eu(r);return console.warn=Up,n}),Vp=t=>t&&typeof t.then=="function";class Hp{config;self;devtools;stateKeys;constructor(e,r){this.config=e,this.self=r,typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__&&(this.stateKeys=Bp(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 mc(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 mt(()=>r.call(this.self,...a));const i=mc(a);this.sendStart(e,i);try{const o=mt(()=>r.call(this.self,...a));return Vp(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 Zp=(t,e)=>{const r={},n=new Hp(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 Gp(){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 no(){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 vc(){return typeof window>"u"?!1:!!(window.MediaRecorder&&no())}class bc{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(!vc()||!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=no();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 vc()}static getSupportedMediaType(){return no()}}const Wp=t=>(localStorage.setItem("liipgpt-color-scheme",t),ao(["light","dark"])),kc=()=>{const t=localStorage.getItem("liipgpt-color-scheme");return t==="light"||t==="dark"?t:"system"},ao=t=>{let e=kc();return e==="system"&&(e=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),t.includes(e)?e:t[0]??"light"},Qp="liipgpt:context",Yp=()=>localStorage.getItem(Qp),Kp=[{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)}],yc=t=>{for(const e of Kp)if(e.check(t))return e.type},io="liipgpt:selectorValues",oo="liipgpt:selectorKnownDefaults",wc=()=>{try{const t=kt.getItem(io),e=kt.getItem(oo);return t?{values:JSON.parse(t),knownDefaults:e?JSON.parse(e):{}}:null}catch{return null}},Xp=t=>{const e={};for(const r of t)e[r.settingName]=r.defaultValues??(r.allowEmpty?[]:[r.values[0]]).filter(Boolean);return e},_c=(t,e)=>{try{const r=Xp(e);kt.setItem(io,JSON.stringify(t)),kt.setItem(oo,JSON.stringify(r))}catch(r){console.error("Failed to save selector values:",r)}},Jp=t=>{try{const e=wc();if(!e)return;delete e.values[t],delete e.knownDefaults[t],kt.setItem(io,JSON.stringify(e.values)),kt.setItem(oo,JSON.stringify(e.knownDefaults))}catch(e){console.error("Failed to clear selector saved state:",e)}},e0=t=>{const e=wc(),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)),d=a.filter(h=>!o.includes(h)&&!l.includes(h)),p=[...l,...d];return p.length===0&&!n.allowEmpty?[n.settingName,a]:[n.settingName,p]});return Object.fromEntries(r)};class t0 extends Error{constructor(e){super(e),this.name="UnreachableError"}}const xc=(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"}},Dr=t=>t?t.map(e=>({id:ap(),...e})):[];class r0{#e=te(St({}));get data(){return _(this.#e)}set data(e){$(this.#e,e,!0)}#t=te(St({}));get targets(){return _(this.#t)}set targets(e){$(this.#t,e,!0)}#a=te(!1);get initialized(){return _(this.#a)}set initialized(e){$(this.#a,e,!0)}#l=te(0);get currentAudioVolume(){return _(this.#l)}set currentAudioVolume(e){$(this.#l,e,!0)}ariaLiveMessagesClearingTimeoutDuration=350;#u=te(null);get currentAudioRecorder(){return _(this.#u)}set currentAudioRecorder(e){$(this.#u,e,!0)}#i=te(!1);get isTranscribing(){return _(this.#i)}set isTranscribing(e){$(this.#i,e,!0)}#r=ee(()=>{if(!this.initialized)return[];const e=this.data.chatConfig.menu;return e?e[this.data.language]??[]:[]});get menu(){return _(this.#r)}set menu(e){$(this.#r,e)}#o=ee(()=>this.initialized?this.data.chatConfig.translations[this.data.language]??{}:{});get t(){return _(this.#o)}set t(e){$(this.#o,e)}#s=ee(()=>this.initialized?sc[this.data.language]??{}:sc.en??{});get errorTranslations(){return _(this.#s)}set errorTranslations(e){$(this.#s,e)}#n=ee(()=>this.initialized?lc[this.data.language]??{}:lc.en??{});get piiTranslations(){return _(this.#n)}set piiTranslations(e){$(this.#n,e)}#c=ee(()=>this.initialized?this.data.currentColorScheme:"light");get colorScheme(){return _(this.#c)}set colorScheme(e){$(this.#c,e)}#d=ee(()=>this.initialized?this.data.chatConfig.fullTheme[this.data.currentColorScheme]:{});get themeBase(){return _(this.#d)}set themeBase(e){$(this.#d,e)}#f=ee(()=>this.themeBase.tokens);get theme(){return _(this.#f)}set theme(e){$(this.#f,e)}#h=ee(()=>{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){$(this.#h,e)}}const g=new r0;let tt,wt,Sc;Zp({name:"chat-logic",state:g,excludeInDevTools:["onInput"]},{async init(t){wt=t;const e=wt.speechRecognitionApiKey||void 0;tt=new gp({apiUrl:wt.apiUrl,apiKey:wt.apiKey,speechRecognitionApiKey:e,strict:!0});try{const r=await tt.getChatConfig();window.CHAT_CONFIG_OVERRIDE&&Object.assign(r,window.CHAT_CONFIG_OVERRIDE);const a=(await tt.getMetadata()).mode==="maintenance";a&&this.showErrorToast("maintenance");const i=oc(r);wt.inlineLayout!==void 0&&(i.inlineLayout=wt.inlineLayout);let o;wt.lang?o=Ta(wt.lang,i.supportedLanguages):o=fc(i.supportedLanguages),hc(o,g.targets.mainElement);const s=await this.getPredefinedQuestions(o),c=i.translations[o]?.ariaOpensInNewTab;c&&tt.setNewTabSrText(c);const l=[];if(i.renderKatex){const v=await import("https://esm.sh/marked-katex-extension@5.1.5").catch(m=>{console.error("Couldn't load marked-katex-extension:",m)});v&&(tt.setMarkedExtensions(v.default({nonStandard:!0,output:"mathml"})),l.push("https://cdn.jsdelivr.net/npm/katex@0.16.22/dist/katex.min.css"))}const d=Object.keys(i.fullTheme);let p=!1;if(i.forceConsent)try{p=kt.getItem("liipgpt:termsAccepted")==="true"}catch(v){console.warn("Failed to load terms acceptance from storage:",v)}g.data={currentConversationState:"idle",chatConfig:i,language:o,predefinedQuestions:s,isInMaintenance:a,history:Dr(i.messageAdditions.init),selectedColorScheme:kc(),has2ColorSchemes:d.length===2,currentColorScheme:ao(d),conversationFeedbackId:void 0,conversationFeedbackIsOpen:!1,openedPopup:void 0,props:wt,flyoutIsOpen:!1,questionHasPii:void 0,chatInputValue:"",selectorValues:e0(i.selectorsConfig),selectorsIsOpen:!1,currentReferencesAsideId:void 0,ariaLiveStatusMessage:void 0,ariaLiveStatusMessageClearingTimeout:void 0,wasReferencesAsideClosed:!1,isAsideMobile:!0,route:xc(i.forceConsent??!1,p),additionalStylesheets:l,hasOpenedOverlays:!1,isInlineLayoutContained:!1,termsAccepted:p},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(xc(i.forceConsent??!1,p),!0)}catch(r){throw ro.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&&Pp(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,_c(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 Jp(t),g.data.selectorValues[t]=r,_c(g.data.selectorValues,g.data.chatConfig.selectorsConfig),r},async getPredefinedQuestions(t){try{return tt.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=Wp(t),this.setAriaLiveStatusMessage(t==="dark"?g.t.ariaDarkSelected:g.t.ariaLightSelected)},async abort(){await Sc?.abort()},changeConversationState(t){g.data.currentConversationState=t,window.LIIPGPT_LISTENERS?.conversation?.(t)},onInput(t){g.data.chatConfig.blockPII&&(g.data.questionHasPii=yc(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;g.data.history.push(...Dr(g.data.chatConfig.messageAdditions.user.before)),g.data.history.push({type:"user",time:new Date().toISOString(),message:g.data.chatInputValue}),g.data.history.push(...Dr(g.data.chatConfig.messageAdditions.user.after));const r=g.data.history.push(...Dr(g.data.chatConfig.messageAdditions.bot.before));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:wt.features?wt.features.trim().split(","):["formatting"],onError:d=>{this.showErrorToast(d),window.LIIPGPT_LISTENERS?.error?.(d),(d==="pii-detected"||d==="blocked")&&this.editLatestQuestion()},lang:g.data.language,selectorValues:{...this.getPrettifiedSelectorValues(),context:Yp()}},a=(d,p)=>{try{const h=new URL(d),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 d=i==="location"||g.data.props.flyout;let p;d?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=tt.createConversationId());const o=tt.chat(g.data.currentConversationId,e,n);Sc=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(d=>{if(g.data.history[r]&&(g.data.history[r]={question:g.data.chatInputValue,...d}),g.data.chatConfig.addRetrievalQuestionToUrlParams&&d.retrievalQuestion){const p=new URLSearchParams(window.location.search);p.get("search")!==d.retrievalQuestion&&(p.set("search",d.retrievalQuestion),history.replaceState(null,"",`?${p.toString()}`))}g.data.chatConfig.showReferencesByDefault&&!g.data.wasReferencesAsideClosed&&g.data.currentReferencesAsideId!==d.id&&!g.data.isAsideMobile&&this.openReferencesAside(d.id),d.state==="streaming"&&g.data.currentConversationState!=="answering"&&this.changeConversationState("answering"),d.state==="done"&&(this.changeConversationState("idle"),s||(s=!0,this.setAriaLiveStatusMessage(`${g.t.ariaAnswerReady} ... ${d.message.text} ... ${g.t.ariaAnswerFinished}`),g.data.history.push(...Dr(g.data.chatConfig.messageAdditions.bot.after))),g.data.currentReferencesAsideId&&g.data.history[r].references.used.length>0?(clearTimeout(c),c=setTimeout(()=>{this.openReferencesAside(d.id)},100)):this.closeReferencesAside())}),g.data.chatInputValue=""},async onStartSpeechRecognition(){try{if(!await Gp()){this.showErrorToast("speech-not-supported");return}if(await navigator.mediaDevices.getUserMedia({audio:!0}),bc.isSupported())g.data.chatInputValue="",g.currentAudioRecorder=new bc({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 tt.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=yc(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=Dr(g.data.chatConfig.messageAdditions.init),g.data.currentConversationId=tt.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=Dr(g.data.chatConfig.messageAdditions.init),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){ro.success(g.t[t],{unstyled:!0,duration:3e3,classes:{toast:"toast"}})},showErrorToast(t){ro.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 t0("Tried to give feedback with no id.");const r=g.data.history.find(n=>n.type==="bot"&&n.id===e);await tt.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 tt.thumbsUp(t,r?.question??""):await tt.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=Ta(t,g.data.chatConfig.supportedLanguages),hc(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{kt.setItem("liipgpt:termsAccepted","true")}catch(t){console.warn("Failed to save terms acceptance to storage:",t)}this.closePopup(),await gs(),this.goto({name:"start-page"})},updateChatInput(t){g.data.chatInputValue=t}});const n0='@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,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}}',a0=new RegExp("([\\p{Ll}\\d])(\\p{Lu})","gu"),i0=new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])","gu"),o0=new RegExp("(\\d)(\\p{Ll})","gu"),s0=new RegExp("(\\p{L})(\\d)","gu"),l0=/[^\p{L}\d]+/giu,Ea="$1\0$2",c0="";function u0(t,e){let r=t.trim();r=r.replace(a0,Ea).replace(i0,Ea),e?.separateNumbers&&(r=r.replace(o0,Ea).replace(s0,Ea)),r=r.replace(l0,"\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 d0(t,e){return p0(t,e?.prefixCharacters)+u0(t,e).map(f0(e?.locale)).join(e?.delimiter??" ")}function h0(t,e){return d0(t,{delimiter:"-",...e})}function f0(t){return t===!1?e=>e.toLowerCase():e=>e.toLocaleLowerCase(t)}function p0(t,e=c0){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 Ca=h0,g0=640,m0=1024;let Aa=null;const v0=()=>{if(Aa)return Aa;if(!globalThis.document)return 16;const t=globalThis.document.querySelector(":root");return Aa=Number(getComputedStyle(t).fontSize.slice(0,-2)),Aa},b0=({minRem:t,maxRem:e})=>{const r=v0(),n=g0/r,a=m0/r,i=(e-t)/(a-n),o=-n*i+t;return`clamp( ${t}rem, ${o}rem + ${i*100}cqw, ${e}rem )`},Tc=t=>typeof t=="string"?t:typeof t=="number"?String(t):typeof t=="object"?t.minRem===t.maxRem?`${t.minRem}rem`:b0(t):"",so=(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+=`--${Ca(t)}-${Ca(i)}:${Tc(o)}; `)}),a},Ec=(t,e)=>Object.entries(e).map(([r,n])=>`--${t}-${Ca(r)}:${Tc(n)}`).join("; ")+"; ",k0=(t,e)=>{let r="";return r+=so(t,e,["background","borderWidth","borderColor","boxShadow","borderRadius","color"],!0),e.hover&&(r+=so(`${t}-hover`,e.hover,["background","borderWidth","borderColor","boxShadow","color"])),e.focus&&(r+=so(`${t}-focus`,e.focus,["background","borderWidth","borderColor","boxShadow","color"])),e.custom&&(r+=Ec(t,e.custom)),r},y0=(t,e)=>Object.entries(e).map(([r,n])=>`--color-${t}-${r}:${n}`).join("; ")+"; ",w0=t=>`--font-family: ${t?.family||"inherit"};`,_0=t=>{const e=w0(t.font),r=Object.entries(t.colors).map(([i,o])=>y0(i,o)).join(""),n=Ec("base",t.base),a=Object.entries(t.components).map(([i,o])=>k0(Ca(i),o)).join("");return`.chat-app {${e} ${r} ${n} ${a}};`};var ht=typeof window<"u"?window:{screen:{},navigator:{}},tn=(ht.matchMedia||function(){return{matches:!1}}).bind(ht),x0={get passive(){return!0}},Cc=function(){};ht.addEventListener&&ht.addEventListener("p",Cc,x0),ht.removeEventListener&&ht.removeEventListener("p",Cc,!1);var lo="ontouchstart"in ht,S0="TouchEvent"in ht,T0=lo||S0&&tn("(any-pointer: coarse)").matches,Ac=(ht.navigator.maxTouchPoints||0)>0||T0,Rc=ht.navigator.userAgent||"",E0=tn("(pointer: coarse)").matches&&/iPad|Macintosh/.test(Rc)&&Math.min(ht.screen.width||0,ht.screen.height||0)>=768,Ic=(tn("(pointer: coarse)").matches||!tn("(pointer: fine)").matches&&lo)&&!/Windows.*Firefox/.test(Rc),C0=tn("(any-pointer: fine)").matches||tn("(any-hover: hover)").matches||E0||!lo,Lc=Ac&&(C0||!Ic)?"hybrid":Ac?"touchOnly":"mouseOnly",A0=Lc==="mouseOnly"?"mouse":Lc==="touchOnly"||Ic?"touch":"mouse";function Oc(t,e){jr(e,!0);let r=se(e,"href",7),n=se(e,"target",7),a=se(e,"onclick",7),i=se(e,"className",23,()=>[]),o=se(e,"isStandalone",7,!1),s=se(e,"children",7),c=se(e,"type",7,"button"),l=se(e,"use",7),d=se(e,"class",7),p=fi(e,["$$slots","$$events","$$legacy","$$host","href","target","onclick","className","isStandalone","children","type","use","class"]);const h=ee(()=>r()?"a":"button"),v=ee(()=>[...Array.isArray(i())?i():i()?[i()]:[],...d()?[d()]:[]]),m=()=>({}),b=ee(()=>l()??m);var A=vt(),y=Oe(A);return Cs(y,()=>_(h),!1,(k,w)=>{As(k,U=>_(b)?.(U)),Ps(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),[Wr]:U}),[()=>({"open-button--standalone":o()})]);var T=vt(),I=Oe(T);Ss(I,s),oe(w,T)}),oe(t,A),Ur({get href(){return r()},set href(k){r(k),re()},get target(){return n()},set target(k){n(k),re()},get onclick(){return a()},set onclick(k){a(k),re()},get className(){return i()},set className(k=[]){i(k),re()},get isStandalone(){return o()},set isStandalone(k=!1){o(k),re()},get children(){return s()},set children(k){s(k),re()},get type(){return c()},set type(k="button"){c(k),re()},get use(){return l()},set use(k){l(k),re()},get class(){return d()},set class(k){d(k),re()}})}bn(Oc,{href:{},target:{},onclick:{},className:{},isStandalone:{},children:{},type:{},use:{},class:{}},[],[],!0);function On(t,e){jr(e,!0);let r=se(e,"css",7),n=fi(e,["$$slots","$$events","$$legacy","$$host","css"]);const a=c=>{es(()=>{r()&&(c.innerHTML=r())})};var i=vt(),o=Oe(i);{var s=c=>{var l=vt(),d=Oe(l);Cs(d,()=>"style",!1,(p,h)=>{As(p,v=>a?.(v)),Ps(p,()=>({...n}))}),oe(c,l)};ur(o,c=>{r()&&c(s)})}return oe(t,i),Ur({get css(){return r()},set css(c){r(c),re()}})}bn(On,{css:{}},[],[],!0);var R0=Ct('<div class="open-button__title"><!></div>'),I0=Ct('<div class="open-button__mask"><div class="open-button__description"><!></div></div>'),L0=Ct('<div class="open-button__text"><!> <!></div>'),O0=Ct('<div class="sr-only"> </div>'),M0=Ct('<!> <div class="svg svg--avatar open-button__avatar" aria-hidden="true"><!></div>',1),N0=Ct('<link rel="stylesheet"/>'),P0=Ct("<!> <!>",1),D0=Ct('<!> <!> <!> <main class="chat-app"><!></main>',1);function Mc(t,e){jr(e,!0);const r=(B,z)=>{let G=()=>z?.().chatConfig,Ue=()=>z?.().language,ye=()=>z?.().colorScheme;const le=ee(()=>{const{openButtonTitle:xe,openButtonDescription:ie}=G().translations[Ue()];return{openButtonTitle:xe,openButtonDescription:ie}}),qe=ee(()=>G().fullTheme[ye()].tokens.svgs),we=ee(()=>G().fullTheme[ye()]?.tokens.components.openButton?.custom),_e=ee(()=>!!_(we)?.hideTitleWhenCollapsed);{let xe=ee(()=>G().buttonHref?void 0:s()?"true":"false"),ie=ee(()=>G().buttonHref?void 0:"true"),rt=ee(()=>G().buttonHref?void 0:o()),Ve=ee(()=>["open-button",e.buttonClass,g.data.flyoutIsOpen?"open-button--expanded":void 0,_(_e)?"open-button--hide-title-when-collapsed":void 0]);Oc(B,{get href(){return G().buttonHref},onclick:Ia,onmouseenter:Ra,onmouseleave:ho,use:er,get"aria-expanded"(){return _(xe)},get"aria-haspopup"(){return _(ie)},get"aria-controls"(){return _(rt)},get style(){return e.buttonStyle},get className(){return _(Ve)},get isStandalone(){return _(h)},children:(ft,tr)=>{var Ot=M0(),Nn=Oe(Ot);{var La=nt=>{var Ze=L0(),zr=Ut(Ze);{var Oa=Mt=>{var at=R0(),Nt=Ut(at);li(Nt,()=>_(le).openButtonTitle),Ft(at),oe(Mt,at)};ur(zr,Mt=>{_(le).openButtonTitle&&Mt(Oa)})}var Ma=lr(zr,2);{var Pn=Mt=>{var at=I0(),Nt=Ut(at),_t=Ut(Nt);li(_t,()=>_(le).openButtonDescription),Ft(Nt),Bs(Nt,Pt=>$(k,Pt),()=>_(k)),Ft(at),Bs(at,Pt=>$(y,Pt),()=>_(y)),oe(Mt,at)};ur(Ma,Mt=>{_(le).openButtonDescription&&A0==="mouse"&&Mt(Pn)})}Ft(Ze),oe(nt,Ze)},fo=nt=>{var Ze=O0(),zr=Ut(Ze,!0);Ft(Ze),Qn(()=>ws(zr,g.t.ariaOpenChat)),oe(nt,Ze)};ur(Nn,nt=>{_(le).openButtonTitle||_(le).openButtonDescription?nt(La):nt(fo,!1)})}var nn=lr(Nn,2),$r=Ut(nn);li($r,()=>_(qe).avatar),Ft(nn),oe(ft,Ot)},$$slots:{default:!0}})}};let n=te("light"),a=se(e,"host",7),i=se(e,"onError",7),o=se(e,"flyoutId",7),s=se(e,"flyoutIsOpen",7),c=fi(e,["$$slots","$$events","$$legacy","$$host","host","onError","flyoutId","flyoutIsOpen"]);const l=async B=>{const G=await(await fetch(`${B}/chatconfig`)).json();return Kl.parse(G)},d=async({forceTheme:B,lang:z,apiUrl:G})=>{const Ue=window.CHAT_CONFIG_OVERRIDE?window.CHAT_CONFIG_OVERRIDE:await l(G),ye=oc(Ue);let le;z?le=Ta(z,ye.supportedLanguages):le=fc(ye.supportedLanguages);const qe=Object.keys(ye.fullTheme),we=ao(qe);return{chatConfig:ye,language:le,colorScheme:we}},p=(B,z)=>{if(B==null)return z;if(typeof B=="string"){const G=B.trim().toLowerCase();return!(G===""||G==="0"||G==="false"||G==="no")}return typeof B=="number"?B!==0:typeof B=="boolean"?B:z};let h=ee(()=>!!a()),v=te(!1),m=te(!1),b=te(!1),A=te(void 0),y=te(void 0),k=te(void 0),w=ee(()=>_(k)?.offsetWidth??0),T=ee(()=>_(k)?.offsetHeight??0),I=te(void 0),U=te(!1),Q,je=te(!0);function ce(){return _(I)?(clearTimeout(_(I)),$(I,void 0),!0):!1}async function pr(B){$(n,B.colorScheme,!0),Q?.(),ce(),$(U,!1);const z=B.chatConfig.fullTheme[_(n)]?.tokens.components.openButton?.custom??{},G=z.autoExpandScrollThreshold,Ue=Number(z.autoCollapseDelay??0),ye=Number.isNaN(Ue)?0:Math.max(0,Ue),le=p(z.autoExpandOnce,!1),qe=(()=>{if(G==null)return 100;if(typeof G=="string"){if(G.trim().toLowerCase()==="none")return 0;const Ve=Number(G);return Number.isNaN(Ve)?100:Ve}const ie=Number(G);return Number.isNaN(ie)?100:ie})();if(Number.isNaN(qe)||qe<=0)return;const we=`liipgpt-auto-expand-${e.apiUrl}`;let _e=!1;if(typeof window<"u")try{_e=window.localStorage.getItem(we)==="true"}catch(ie){console.warn("LiipGPT: unable to read auto-expand flag",ie)}$(b,_e,!0);const xe=()=>{if(!(window.scrollY/window.innerHeight*100>=qe)){$(je,!0);return}if(!(_(m)||s())&&!(le&&(_e||_(b)))&&_(je)){if($(je,!1),$(m,!0),$(b,!0),co(),le&&typeof window<"u")try{window.localStorage.setItem(we,"true")}catch(Ve){console.warn("LiipGPT: unable to persist auto-expand flag",Ve)}$(I,setTimeout(()=>{_(U)||(uo(),$(m,!1)),$(I,void 0)},ye),!0)}};window.addEventListener("scroll",xe,{passive:!0}),qe===0&&(await gs(),xe()),Q=()=>{window.removeEventListener("scroll",xe)}}function ae(){ce(),$(m,!1),$(U,!1)}function er(B){$(A,B,!0)}function gr(){Q?.(),ce()}gd(gr);function mr(){!_(k)||!_(y)||(_(y).style.width=`${_(w)}px`,_(y).style.height=`${_(T)}px`)}function rn(){_(y)&&(_(y).style.width="0",_(y).style.height="0")}function co(){_(A)&&(_(A).classList.add("open-button--programmatic-expand"),mr())}function uo(){_(A)&&(_(A).classList.remove("open-button--programmatic-expand"),rn())}function Ra(){ce()&&$(U,!0),mr()}function ho(){ce(),_(U)&&($(m,!1),$(U,!1),_(A)?.classList.remove("open-button--programmatic-expand")),_(v)||rn()}function Ia(B){ae(),e.onclick?.(B)}let ue=ee(()=>d(c).then(async B=>(await pr(B),B)).catch(B=>i()(B)));var Mn=vt();ed("beforeunload",Xa,gr),rd(B=>{var z=vt(),G=Oe(z);{var Ue=ye=>{var le=vt(),qe=Oe(le);Ts(qe,()=>_(ue),null,(we,_e)=>{var xe=P0();const ie=ee(()=>_(_e).chatConfig.fullTheme[_(_e).colorScheme]);var rt=Oe(xe);bd(rt,17,()=>_(ie).fontURLs??[],md,(ft,tr)=>{var Ot=N0();Qn(()=>hi(Ot,"href",_(tr))),oe(ft,Ot)});var Ve=lr(rt,2);On(Ve,{id:"font-css",get css(){return _(ie).fontCSS}}),oe(we,xe)}),oe(ye,le)};ur(G,ye=>{_(h)&&ye(Ue)})}oe(B,z)});var ge=Oe(Mn);return Ts(ge,()=>_(ue),B=>{},(B,z)=>{var G=vt();const Ue=ee(()=>_(z).chatConfig.fullTheme[_(n)]);var ye=Oe(G);{var le=we=>{var _e=D0(),xe=Oe(_e);{let tr=ee(()=>_0(_(Ue).tokens));On(xe,{id:"theme-css",get css(){return _(tr)}})}var ie=lr(xe,2);On(ie,{id:"app-css",get css(){return n0}});var rt=lr(ie,2);On(rt,{id:"custom-css",get css(){return _(Ue).customCSS}});var Ve=lr(rt,2),ft=Ut(Ve);r(ft,()=>_(z)),Ft(Ve),oe(we,_e)},qe=we=>{r(we,()=>_(z))};ur(ye,we=>{_(h)?we(le):we(qe,!1)})}oe(B,G)}),oe(t,Mn),Ur({get host(){return a()},set host(B){a(B),re()},get onError(){return i()},set onError(B){i(B),re()},get flyoutId(){return o()},set flyoutId(B){o(B),re()},get flyoutIsOpen(){return s()},set flyoutIsOpen(B){s(B),re()}})}bn(Mc,{host:{},onError:{},flyoutId:{},flyoutIsOpen:{}},[],[],!0);function Nc(t,e){jr(e,!0);let r=se(e,"onclick",7),n=se(e,"buttonClass",7),a=se(e,"buttonStyle",7),i=se(e,"apiUrl",7),o=se(e,"forceTheme",7),s=se(e,"lang",7),c=ee(()=>({onclick:r(),buttonClass:n(),buttonStyle:a(),apiUrl:i(),forceTheme:o(),lang:s()}));return Us(t,{silent:!0,body:(d,p=br)=>{Mc(d,Pd({host:e.$$host,get onError(){return p()}},()=>_(c)))},$$slots:{body:!0}}),Ur({get onclick(){return r()},set onclick(l){r(l),re()},get buttonClass(){return n()},set buttonClass(l){n(l),re()},get buttonStyle(){return a()},set buttonStyle(l){a(l),re()},get apiUrl(){return i()},set apiUrl(l){i(l),re()},get forceTheme(){return o()},set forceTheme(l){o(l),re()},get lang(){return s()},set lang(l){s(l),re()}})}return customElements.define("liipgpt-button",bn(Nc,{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)),sn.LiipGPTButton=Nc,Object.defineProperty(sn,Symbol.toStringTag,{value:"Module"}),sn}({});
|