@liip/liipgpt 3.1.17 → 3.1.18
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 +1 -1
- package/chat/liipgpt-chat.iife.js +1 -1
- package/configurator/_app/env.js +1 -1
- package/configurator/_app/immutable/chunks/{BVuPMbGu.js → 4yWnyhXY.js} +1 -1
- package/configurator/_app/immutable/chunks/{9Ri5SrzG.js → B8VSv01B.js} +1 -1
- package/configurator/_app/immutable/chunks/{CFrVHYfl.js → BwsrFPnM.js} +1 -1
- package/configurator/_app/immutable/chunks/{11LAQsV1.js → CGpx2Nxd.js} +1 -1
- package/configurator/_app/immutable/chunks/CU3mOPb1.js +1 -0
- package/configurator/_app/immutable/chunks/{BPKLyzZe.js → CatOjdNm.js} +1 -1
- package/configurator/_app/immutable/chunks/{rj88a1W2.js → CydIole4.js} +1 -1
- package/configurator/_app/immutable/chunks/{Bp-vfgGT.js → DxNos853.js} +2 -2
- package/configurator/_app/immutable/chunks/{BIb6tluX.js → R_738Kr0.js} +1 -1
- package/configurator/_app/immutable/entry/{app.EW2frvxg.js → app.DMgh-ewt.js} +2 -2
- package/configurator/_app/immutable/entry/start.BXM-5TbF.js +1 -0
- package/configurator/_app/immutable/nodes/{0.CAt21WI4.js → 0.B0o15SYh.js} +1 -1
- package/configurator/_app/immutable/nodes/{1.ZlvwJCC4.js → 1.DBBf6rHz.js} +1 -1
- package/configurator/_app/immutable/nodes/{2.kCef25yX.js → 2.RErkUClX.js} +3 -3
- package/configurator/_app/immutable/nodes/{3.Cru6NvPq.js → 3.AYCcUUAN.js} +1 -1
- package/configurator/_app/version.json +1 -1
- package/configurator/index.html +6 -6
- package/configurator/sidebar.html +6 -6
- package/package.json +1 -1
- package/configurator/_app/immutable/chunks/BBPlH51V.js +0 -1
- package/configurator/_app/immutable/entry/start.llWVWKWx.js +0 -1
|
@@ -379,4 +379,4 @@ Please report this to https://github.com/markedjs/marked.`,t){const n="<p>An err
|
|
|
379
379
|
<p>
|
|
380
380
|
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>
|
|
381
381
|
</p>
|
|
382
|
-
`,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.",ariaAnswerGood:"Évaluer cette réponse comme bonne",ariaAnswerBad:"Évaluer cette réponse comme mauvaise",ariaReferenceSource:"Source:",ariaGiveFeedback:"Donner un feedback détaillé sur la réponse",ariaLanguageChanged:"Langue française sélectionnée.",ariaLightSelected:"Mode clair activé.",ariaDarkSelected:"Mode sombre activé.",ariaSettings:"Paramètres du chat",ariaSettingsRegion:"Ajustez vos préférences de chat",ariaReferencesRegion:"Références pour la question actuelle",ariaFlyoutRegion:"Chatbot",ariaSelected:"sélectionné",ariaUnselected:"non sélectionné",ariaAllSelected:"Tous les éléments sélectionnés",ariaAllUnselected:"Tous les éléments non sélectionnés",ariaAllReseted:"Éléments par défaut sélectionnés",hideSettings:"Masquer les paramètres",showSettings:"Paramètres",chooseAtLeastOneOption:"Veuillez choisir au moins une option",selectAll:"Tout sélectionner",selectNone:"Tout désélectionner",resetToDefaults:"Réinitialiser",messageTooLong:"Votre message doit être plus court que {questionLengthLimit} caractères. Actuellement, il fait {questionLength} caractères"}},Gf=Object.freeze(Object.defineProperty({__proto__:null,translations:yr},Symbol.toStringTag,{value:"Module"})),Wf=t=>{t=t??yr;const e={};return t.de&&(e.de=yn(yr.de,t.de)),t.en&&(e.en=yn(yr.en,t.en)),t.fr&&(e.fr=yn(yr.fr,t.fr)),t.it&&(e.it=yn(yr.it,t.it)),e},Pl=t=>{let e;t.theme?.fineGrained?e=Zf(t.theme?.fineGrained):e=Hf(t?.theme??{});const r=Wf(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??zf,forceConsent:t.forceConsent??!1};return t.classification&&(n.classification=t.classification),t.menu&&(n.menu=t.menu),n},Dl={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é."}},Nl={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"}},Oi=structuredClone(er.fineGrained.light);Oi.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 $l=structuredClone(er.fineGrained.dark);$l.tokens.colors=Oi.tokens.colors;const Qf=Object.freeze(Object.defineProperty({__proto__:null,theme:{fineGrained:{light:Oi,dark:$l}}},Symbol.toStringTag,{value:"Module"})),zl=t=>t.split("/").pop().split(".")[0],Yf=Object.assign({"./default/fallback-dev.theme.ts":Qf,"./default/fallback.theme.ts":qf}),Mi=new Map;Object.entries(Yf).forEach(([t,e])=>{const{error:r,data:n}=yl.safeParse(e?.theme);if(r){console.error(`Invalid theme in ${t}:`,r);return}Mi.set(zl(t),n)});const v0=t=>{const e=Mi.get(t);return e||(console.error(`Theme ${t} not found`),er)};Array.from(Mi.keys());const Kf=Object.assign({"./default/fallback.translations.ts":Gf}),Pi=new Map;Object.entries(Kf).forEach(([t,e])=>{const{error:r,data:n}=xl.safeParse(e?.translations);if(r){console.error(`Invalid translations in ${t}:`,r);return}Pi.set(zl(t),n)});const b0=t=>{const e=Pi.get(t);return e||(console.error(`Theme ${t} not found`),yr)};Array.from(Pi.keys());const Xf="en",Fl=(t,e)=>e.includes(t),da=(t,e)=>{if(Fl(t,e))return t;const r=Jf();return Fl(r,e)?r:Xf},Jf=()=>navigator.language.split("-")[0],jl=(t,e)=>{localStorage.setItem("liipgpt:selectedLanguage",t),e&&(e.lang=t)},Bl=t=>da(localStorage.getItem("liipgpt:selectedLanguage"),t);var Di,Ul;function ep(){return Ul||(Ul=1,Di=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}),Di}var tp=ep();const rp=Ll(tp),np=typeof document<"u";let ql=0;class ap{#e=oe(ht([]));get toasts(){return T(this.#e)}set toasts(e){G(this.#e,e,!0)}#t=oe(ht([]));get heights(){return T(this.#t)}set heights(e){G(this.#t,e,!0)}#a=e=>{const r=this.toasts.findIndex(n=>n.id===e);return r===-1?null:r};addToast=e=>{np&&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:ql++,i=e.dismissable===void 0?!0:e.dismissable,o=e.type===void 0?"default":e.type;return Ot(()=>{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=>(Ot(()=>{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=ip(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||ql++;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 ip(t){return t&&typeof t=="object"&&"status"in t?`HTTP error! Status: ${t.status}`:`Error! ${t}`}const ot=new ap;function op(t,e){return ot.create({message:t,...e})}const Ni=Object.assign(op,{success:ot.success,info:ot.info,warning:ot.warning,error:ot.error,custom:ot.custom,message:ot.message,promise:ot.promise,dismiss:ot.dismiss,loading:ot.loading,getActiveToasts:()=>ot.toasts.filter(t=>!t.dismiss)}),sp=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)},lp=(t,e)=>{const r={};return e.forEach(n=>{r[n]=t[n]}),r},cp=console.warn,up=()=>{},Vl=(t,e)=>Ot(()=>{console.warn=up;const r=e?lp(t,e):t,n=ou(r);return console.warn=cp,n}),dp=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=sp(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 Vl(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 Ot(()=>r.call(this.self,...a));const i=Vl(a);this.sendStart(e,i);try{const o=Ot(()=>r.call(this.self,...a));return dp(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 fp=(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 pp(){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 $i(){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 Hl(){return typeof window>"u"?!1:!!(window.MediaRecorder&&$i())}class Zl{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(!Hl()||!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=$i();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 Hl()}static getSupportedMediaType(){return $i()}}const gp=t=>(localStorage.setItem("liipgpt-color-scheme",t),zi(["light","dark"])),Gl=()=>{const t=localStorage.getItem("liipgpt-color-scheme");return t==="light"||t==="dark"?t:"system"},zi=t=>{let e=Gl();return e==="system"&&(e=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),t.includes(e)?e:t[0]??"light"},mp=[{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)}],Wl=t=>{for(const e of mp)if(e.check(t))return e.type},Fi="liipgpt:selectorValues",ji="liipgpt:selectorKnownDefaults",Ql=()=>{try{const t=it.getItem(Fi),e=it.getItem(ji);return t?{values:JSON.parse(t),knownDefaults:e?JSON.parse(e):{}}:null}catch{return null}},vp=t=>{const e={};for(const r of t)e[r.settingName]=r.defaultValues??(r.allowEmpty?[]:[r.values[0]]).filter(Boolean);return e},Yl=(t,e)=>{try{const r=vp(e);it.setItem(Fi,JSON.stringify(t)),it.setItem(ji,JSON.stringify(r))}catch(r){console.error("Failed to save selector values:",r)}},bp=t=>{try{const e=Ql();if(!e)return;delete e.values[t],delete e.knownDefaults[t],it.setItem(Fi,JSON.stringify(e.values)),it.setItem(ji,JSON.stringify(e.knownDefaults))}catch(e){console.error("Failed to clear selector saved state:",e)}},kp=t=>{const e=Ql(),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 yp extends Error{constructor(e){super(e),this.name="UnreachableError"}}const Kl=(t,e)=>{const n=new URLSearchParams(window.location.search).get("q");return n?{name:"chat-page",query:n}:t&&!e?{name:"consent-page"}:{name:"start-page"}};class wp{#e=oe(ht({}));get data(){return T(this.#e)}set data(e){G(this.#e,e,!0)}#t=oe(ht({}));get targets(){return T(this.#t)}set targets(e){G(this.#t,e,!0)}#a=oe(!1);get initialized(){return T(this.#a)}set initialized(e){G(this.#a,e,!0)}#l=oe(0);get currentAudioVolume(){return T(this.#l)}set currentAudioVolume(e){G(this.#l,e,!0)}ariaLiveMessagesClearingTimeoutDuration=350;#u=oe(null);get currentAudioRecorder(){return T(this.#u)}set currentAudioRecorder(e){G(this.#u,e,!0)}#i=oe(!1);get isTranscribing(){return T(this.#i)}set isTranscribing(e){G(this.#i,e,!0)}#r=X(()=>{if(!this.initialized)return[];const e=this.data.chatConfig.menu;return e?e[this.data.language]??[]:[]});get menu(){return T(this.#r)}set menu(e){G(this.#r,e)}#o=X(()=>this.initialized?this.data.chatConfig.translations[this.data.language]??{}:{});get t(){return T(this.#o)}set t(e){G(this.#o,e)}#s=X(()=>this.initialized?Dl[this.data.language]??{}:Dl.en??{});get errorTranslations(){return T(this.#s)}set errorTranslations(e){G(this.#s,e)}#n=X(()=>this.initialized?Nl[this.data.language]??{}:Nl.en??{});get piiTranslations(){return T(this.#n)}set piiTranslations(e){G(this.#n,e)}#c=X(()=>this.initialized?this.data.currentColorScheme:"light");get colorScheme(){return T(this.#c)}set colorScheme(e){G(this.#c,e)}#d=X(()=>this.initialized?this.data.chatConfig.fullTheme[this.data.currentColorScheme]:{});get themeBase(){return T(this.#d)}set themeBase(e){G(this.#d,e)}#f=X(()=>this.themeBase.tokens);get theme(){return T(this.#f)}set theme(e){G(this.#f,e)}#h=X(()=>{if(!this.initialized)return[];const e=[];for(const r of this.data.chatConfig.selectorsConfig){if(r.allowEmpty)continue;(this.data.selectorValues[r.settingName]||[]).length===0&&e.push(r.settingName)}return e});get selectorsWithErrors(){return T(this.#h)}set selectorsWithErrors(e){G(this.#h,e)}}const m=new wp;let Xe,st,Xl;fp({name:"chat-logic",state:m,excludeInDevTools:["onInput"]},{async init(t){st=t;const e=st.speechRecognitionApiKey||void 0;Xe=new $f({apiUrl:st.apiUrl,apiKey:st.apiKey,speechRecognitionApiKey:e,strict:!0});try{const r=await Xe.getChatConfig();window.CHAT_CONFIG_OVERRIDE&&Object.assign(r,window.CHAT_CONFIG_OVERRIDE);const a=(await Xe.getMetadata()).mode==="maintenance";a&&this.showErrorToast("maintenance");const i=Pl(r);st.inlineLayout!==void 0&&(i.inlineLayout=st.inlineLayout);let o;st.lang?o=da(st.lang,i.supportedLanguages):o=Bl(i.supportedLanguages),jl(o,m.targets.mainElement);const s=await this.getPredefinedQuestions(o),c=[];if(i.renderKatex){const h=await import("https://esm.sh/marked-katex-extension@5.1.5").catch(g=>{console.error("Couldn't load marked-katex-extension:",g)});h&&(Xe.setMarkedExtensions(h.default({nonStandard:!0,output:"mathml"})),c.push("https://cdn.jsdelivr.net/npm/katex@0.16.22/dist/katex.min.css"))}const l=Object.keys(i.fullTheme);let d=!1;if(i.forceConsent)try{d=it.getItem("liipgpt:termsAccepted")==="true"}catch(h){console.warn("Failed to load terms acceptance from storage:",h)}m.data={currentConversationState:"idle",chatConfig:i,language:o,predefinedQuestions:s,isInMaintenance:a,history:[],selectedColorScheme:Gl(),has2ColorSchemes:l.length===2,currentColorScheme:zi(l),conversationFeedbackId:void 0,conversationFeedbackIsOpen:!1,openedPopup:void 0,props:st,flyoutIsOpen:!1,questionHasPii:void 0,chatInputValue:"",selectorValues:kp(i.selectorsConfig),selectorsIsOpen:!1,currentReferencesAsideId:void 0,ariaLiveStatusMessage:void 0,ariaLiveStatusMessageClearingTimeout:void 0,wasReferencesAsideClosed:!1,isAsideMobile:!0,route:Kl(i.forceConsent??!1,d),additionalStylesheets:c,hasOpenedOverlays:!1,isInlineLayoutContained:!1,termsAccepted:d},window.LIIPGPT_LISTENERS?.route?.(m.data.route),window.LIIPGPT_LISTENERS?.conversation?.(m.data.currentConversationState),m.data.selectorsIsOpen=m.data.chatConfig.showExpandedSelectors??!1,m.initialized=!0,this.checkForOpenedPopup(),window.addEventListener("hashchange",()=>{this.checkForOpenedPopup()}),this.goto(Kl(i.forceConsent??!1,d))}catch(r){throw Ni.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){m.targets[t]=e},goto(t){if(!rp(m.data.route,t))switch(m.data.route=t,window.LIIPGPT_LISTENERS?.route?.(t),t.name){case"consent-page":break;case"start-page":t.prefill&&(m.data.chatInputValue=t.prefill);break;case"chat-page":if(m.data.chatInputValue=t.query,this.onSubmit(),m.data.chatConfig.addQueryToUrlParams){const e=new URLSearchParams(window.location.search);e.set("q",t.query),history.pushState(null,"",`?${e.toString()}`)}break}},getSelectorConfig(t){const e=m.data.chatConfig.selectorsConfig.find(r=>r.settingName===t);if(!e)throw new Error(`Setting ${t} not found`);return e},getPrettifiedSelectorValues(){const t=Object.entries(m.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}m.data.selectorValues[t]=e,Yl(m.data.selectorValues,m.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 bp(t),m.data.selectorValues[t]=r,Yl(m.data.selectorValues,m.data.chatConfig.selectorsConfig),r},async getPredefinedQuestions(t){try{return Xe.getPredefinedQuestions({url:window.location.origin+window.location.pathname,language:t})}catch(e){return console.warn("Failed to load predefined questions:",e),[]}},setColorScheme(t){m.data.selectedColorScheme=t,m.data.currentColorScheme=gp(t),this.setAriaLiveStatusMessage(t==="dark"?m.t.ariaDarkSelected:m.t.ariaLightSelected)},async abort(){await Xl?.abort()},changeConversationState(t){m.data.currentConversationState=t,window.LIIPGPT_LISTENERS?.conversation?.(t)},onInput(t){m.data.chatConfig.blockPII&&(m.data.questionHasPii=Wl(t)),m.data.chatInputValue=t},onSubmit(t=!1){if(m.data.questionHasPii){console.warn("Question contains PII, not submitting:",m.data.questionHasPii);return}const e=m.data.chatConfig.questionPrefix?`${m.data.chatConfig.questionPrefix} ${m.data.chatInputValue}`:m.data.chatInputValue,r=m.data.history.push({type:"user",time:new Date().toISOString(),message:m.data.chatInputValue});m.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:st.features?st.features.trim().split(","):["formatting"],onError:d=>{this.showErrorToast(d),window.LIIPGPT_LISTENERS?.error?.(d),(d==="pii-detected"||d==="blocked")&&this.editLatestQuestion()},lang:m.data.language,selectorValues:this.getPrettifiedSelectorValues()},a=(d,p)=>{try{const h=new URL(d),g=new URL(p);return h.origin===g.origin&&h.pathname===g.pathname}catch{return!1}},i=m.data.chatConfig.sendReferrer??"all";if(["all","own","location"].includes(i)){const d=i==="location"||m.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"&&!m.data.props.flyout&&p&&!p.startsWith(window.location.origin);n.referrer=p&&!h?p:void 0}m.data.currentConversationId||(m.data.currentConversationId=Xe.createConversationId());const o=Xe.chat(m.data.currentConversationId,e,n);Xl=o,m.data.lastChatResponseId=o.id,m.data.currentConversationState!=="searching"&&this.changeConversationState("searching"),this.setAriaLiveStatusMessage(m.t.ariaQuestionSent);let s=!1,c;const l=!!m.data.currentReferencesAsideId;(t&&l||!t&&m.data.chatConfig.showReferencesByDefault)&&(m.data.isAsideMobile||this.openReferencesAside(o.id)),o.subscribe(d=>{if(m.data.history[r]&&(m.data.history[r]={question:m.data.chatInputValue,...d}),m.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()}`))}m.data.chatConfig.showReferencesByDefault&&!m.data.wasReferencesAsideClosed&&m.data.currentReferencesAsideId!==d.id&&!m.data.isAsideMobile&&this.openReferencesAside(d.id),d.state==="streaming"&&m.data.currentConversationState!=="answering"&&this.changeConversationState("answering"),d.state==="done"&&(this.changeConversationState("idle"),s||(s=!0,this.setAriaLiveStatusMessage(`${m.t.ariaAnswerReady} ... ${d.message.text} ... ${m.t.ariaAnswerFinished}`)),m.data.currentReferencesAsideId&&m.data.history[r].references.used.length>0?(clearTimeout(c),c=setTimeout(()=>{this.openReferencesAside(d.id)},100)):this.closeReferencesAside())}),m.data.chatInputValue=""},async onStartSpeechRecognition(){try{if(!await pp()){this.showErrorToast("speech-not-supported");return}if(await navigator.mediaDevices.getUserMedia({audio:!0}),Zl.isSupported())m.data.chatInputValue="",m.currentAudioRecorder=new Zl({onDataAvailable:async e=>{m.isTranscribing=!0,await this.handleTranscription(e)},onError:()=>{this.showErrorToast("speech-microphone-access-denied"),m.currentAudioRecorder=null,m.isTranscribing=!1},onVolumeChange:e=>{m.currentAudioVolume=e}}),m.currentAudioRecorder.start();else{this.showErrorToast("speech-not-supported");return}}catch(t){throw this.showErrorToast("speech-microphone-access-denied"),m.currentAudioRecorder=null,m.isTranscribing=!1,t}},editLatestQuestion(){const t=m.data.history.findLastIndex(r=>r?.type==="user");if(t===-1){console.error("No last user question, available");return}const e=m.data.history.splice(t)[0];m.data.chatInputValue=e.message},onStopSpeechRecognition(){if(m.currentAudioRecorder){const t=m.currentAudioRecorder;m.currentAudioRecorder=null,t.stop()}m.currentAudioVolume=0},async handleTranscription(t){if(!t){console.warn("No audio data received");return}try{const e=await Xe.transcribeAudio(t,{lang:m.data.language});if(e.error){this.showErrorToast("speech-transcription-failed");return}if(e.transcript.trim()){if(m.data.chatConfig.blockPII&&(m.data.questionHasPii=Wl(e.transcript.trim()),m.data.questionHasPii))return;m.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{m.currentAudioRecorder=null,m.isTranscribing=!1,m.currentAudioVolume=0}},async onStartConversation(t){await this.abort(),m.data.history=[],m.data.currentConversationId=Xe.createConversationId(),this.goto({name:"chat-page",query:t})},async onNewConversation(){if(await this.abort(),m.data.currentConversationId=void 0,m.data.currentReferencesAsideId=void 0,m.data.history=[],m.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){Ni.success(m.t[t],{unstyled:!0,duration:3e3,classes:{toast:"toast"}})},showErrorToast(t){Ni.error(m.errorTranslations[t],{unstyled:!0,duration:3e3,classes:{toast:"toast"}})},async submitFeedback(t){try{const e=m.data.conversationFeedbackId||m.data.lastChatResponseId;if(!e)throw new yp("Tried to give feedback with no id.");const r=m.data.history.find(n=>n.type==="bot"&&n.id===e);await Xe.feedback(e,r?.question??"",t),setTimeout(()=>{this.showSuccessToast("thankYouForFeedback")},500)}catch(e){console.error("Feedback failed:",e),this.showErrorToast("feedback-failed")}},toggleReferencesAside(t){m.data.currentReferencesAsideId===t?this.closeReferencesAside():this.openReferencesAside(t)},openReferencesAside(t){m.data.currentReferencesAsideId=t,this.setOpenOverlay(!0)},closeReferencesAside(){m.data.currentReferencesAsideId=void 0,m.data.wasReferencesAsideClosed=!0,this.setOpenOverlay(!1)},setAsideMobile(t){m.data.isAsideMobile=t},openFlyout(){m.data.flyoutIsOpen=!0},closeFlyout(){m.data.flyoutIsOpen=!1},openConversationFeedback(){m.data.conversationFeedbackIsOpen=!0,this.setOpenOverlay(!0)},openMessageFeedback(t){m.data.conversationFeedbackId=t},closeFeedback(){m.data.conversationFeedbackIsOpen=!1,m.data.conversationFeedbackId=void 0,this.setOpenOverlay(!1)},setOpenOverlay(t){m.data.hasOpenedOverlays=t},setAriaLiveStatusMessage(t){m.data.ariaLiveStatusMessage=t,clearTimeout(m.data.ariaLiveStatusMessageClearingTimeout),m.data.ariaLiveStatusMessageClearingTimeout=setTimeout(()=>{m.data.ariaLiveStatusMessage=""},m.ariaLiveMessagesClearingTimeoutDuration)},closePopup(){window.location.hash=""},checkForOpenedPopup(){const t=window.location.hash.slice(1),e=m.t.popups?.find(r=>r.hash===t);e?m.data.openedPopup=e:m.data.openedPopup=void 0},async thumbs(t,e){try{const r=m.data.history.find(n=>n.type==="bot"&&n.id===t);e==="up"?await Xe.thumbsUp(t,r?.question??""):await Xe.thumbsDown(t,r?.question??""),this.showSuccessToast("thankYouForFeedback")}catch(r){console.error("Feedback failed:",r),this.showErrorToast("feedback-failed")}},async onLanguageChange(t){if(m.data.language=da(t,m.data.chatConfig.supportedLanguages),jl(m.data.language,m.targets.mainElement),m.data.predefinedQuestions=await this.getPredefinedQuestions(m.data.language),this.setAriaLiveStatusMessage(m.t.ariaLanguageChanged),m.data.chatConfig.reflectLanguageInPath){const e=new URL(window.location.href);e.pathname=`/${m.data.language}`,window.history.replaceState({},"",e.toString())}},async acceptTerms(){m.data.termsAccepted=!0;try{it.setItem("liipgpt:termsAccepted","true")}catch(t){console.warn("Failed to save terms acceptance to storage:",t)}this.closePopup(),this.closeFlyout(),await Ou(),this.goto({name:"start-page"})}});const _p='@layer base,utilities,components;/*! tailwindcss v4.1.11 | MIT License | https://tailwindcss.com */@layer base{*,:after,:before,::backdrop,::file-selector-button{box-sizing:border-box;margin:0;padding:0;border:0 solid}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea,::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::-moz-placeholder{opacity:1}::placeholder{opacity:1}@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px){::-moz-placeholder{color:currentcolor}@supports (color: color-mix(in lab,red,red)){{color:color-mix(in oklab,currentcolor 50%,transparent)}}::placeholder{color:currentcolor}@supports (color: color-mix(in lab,red,red)){{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]),::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer base{.chat-app{--spacer-1: .0625rem;--spacer-2: .125rem;--spacer-3: .1875rem;--spacer-4: .25rem;--spacer-5: .3125rem;--spacer-6: .375rem;--spacer-8: .5rem;--spacer-10: .625rem;--spacer-12: .75rem;--spacer-16: 1rem;--spacer-20: 1.25rem;--spacer-24: 1.5rem;--spacer-28: 1.75rem;--spacer-32: 2rem;--spacer-40: 2.5rem;--spacer-48: 3rem;--spacer-56: 3.5rem;--spacer-64: 4rem;--spacer-72: 4.5rem;--spacer-80: 5rem;--spacer-120: 7.5rem;--spacer-r-8: clamp(.375rem, .3182rem + .2841cqw, .5rem);--spacer-r-12: clamp(.625rem, .5682rem + .2841cqw, .75rem);--spacer-r-16: clamp(.75rem, .6364rem + .5682cqw, 1rem);--spacer-r-20: clamp(.875rem, .7045rem + .8523cqw, 1.25rem);--spacer-r-24: clamp(1rem, .7727rem + 1.1364cqw, 1.5rem);--spacer-r-28: clamp(1.125rem, .8409rem + 1.4205cqw, 1.75rem);--spacer-r-32: clamp(1.25rem, .9091rem + 1.7045cqw, 2rem);--spacer-r-40: clamp(1.5rem, 1.0455rem + 2.2727cqw, 2.5rem);--spacer-r-48: clamp(1.625rem, 1rem + 3.125cqw, 3rem);--spacer-r-56: clamp(1.75rem, .9545rem + 3.9773cqw, 3.5rem);--spacer-r-64: clamp(2rem, 1.0909rem + 4.5455cqw, 4rem);--spacer-r-80: clamp(3rem, 2.0909rem + 4.5455cqw, 5rem);--spacer-r-96: clamp(3.5rem, 2.3636rem + 5.6818cqw, 6rem);--spacer-r-120: clamp(4rem, 2.4091rem + 7.9545cqw, 7.5rem);--default-transition-duration: .2s;--default-transition-timing-function: ease-in-out;--z-index-flyout: 10000;--z-index-dialog: 600;--z-index-loader: 500;--z-index-reference-number: 400;--z-index-footer: 300;--z-index-header: 200;--z-index-tooltip: 100;--z-index-tooltip-hover: 101;--z-index-local-overlay: 10;--ease-out-quart: cubic-bezier(.165, .84, .44, 1);--ease-in-quart: cubic-bezier(.895, .03, .685, .22);--ease-in-out-quart: cubic-bezier(.77, 0, .175, 1);--fly-in-id: 0;--btn-padding-x: var(--spacer-r-20);--btn-padding-y: var(--spacer-r-8);--btn-icon-size: var(--spacer-24);--btn-submit-size: 2.5em;--last-bot-message-min-height: 0}}@value container-xs,container-sm,container-md,container-lg,container-inner-xs,container-inner-sm,container-inner-md,container-inner-lg from "./viewports.css";@layer base{.chat-app :where(h1,.h1,h2,.h2,h3,.h3,h4,.h4,h5,.h5,h6,.h6){font-weight:var(--base-font-weight-title);line-height:var(--base-line-height-tight)}.chat-app :where(b,strong){font-weight:var(--base-font-weight-bold)}.chat-app :where(button){cursor:pointer}.chat-app :where(input[type=text],input[type=email],input[type=search],input[type=password],textarea){width:100%;padding:var(--input-padding);border-width:var(--input-border-width);border-radius:var(--input-border-radius);border-color:var(--input-border-color);background:var(--input-background);box-shadow:var(--input-box-shadow, none);color:var(--input-color)}.chat-app :where(input[type=text],input[type=email],input[type=search],input[type=password],textarea)::-moz-placeholder{color:var(--input-placeholder-color);opacity:var(--input-placeholder-opacity)}.chat-app :where(input[type=text],input[type=email],input[type=search],input[type=password],textarea)::placeholder{color:var(--input-placeholder-color);opacity:var(--input-placeholder-opacity)}.chat-app :where(input[type=radio],input[type=checkbox]){margin:0}.chat-app :where(*:focus-visible){border-radius:var(--btn-primary-border-radius);outline-color:var(--body-focus-color);outline-style:var(--body-focus-style);outline-width:var(--body-focus-width);outline-offset:var(--body-focus-offset)}.chat-app *::-moz-selection{background:var(--body-selection-background);color:var(--body-selection-color)}.chat-app *::selection{background:var(--body-selection-background);color:var(--body-selection-color)}.chat-app ::-webkit-scrollbar{width:8px;height:8px}.chat-app ::-webkit-scrollbar-track{background:transparent}.chat-app ::-webkit-scrollbar-thumb{border-radius:4px;background-color:#0000004d;-webkit-transition:background-color .2s;transition:background-color .2s}.chat-app ::-webkit-scrollbar-thumb:hover{background-color:#00000080}.chat-app *{scrollbar-color:rgba(0,0,0,.3) transparent;scrollbar-width:thin}.chat-app ::-webkit-scrollbar-thumb{visibility:hidden}.chat-app *:hover::-webkit-scrollbar-thumb,.chat-app *:active::-webkit-scrollbar-thumb,.chat-app *:focus::-webkit-scrollbar-thumb{visibility:visible}}@layer utilities{.chat-app :where(.expand-interaction){position:relative}.chat-app :where(.expand-interaction):after{position:absolute;inset:0;background-color:transparent;content:""}.chat-app :where(.sr-only){position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.chat-app :where(.transition-colors){transition-duration:var(--default-transition-duration);transition-property:color,background-color,border-color,box-shadow;transition-timing-function:var(--default-transition-timing-function)}.chat-app :where(.transition){transition-duration:var(--default-transition-duration);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter;transition-timing-function:var(--default-transition-timing-function)}.chat-app :where(.skip-link){position:absolute;width:0px;height:0px;overflow:hidden;color:var(--anchor-color);font-weight:700;font-size:var(--base-font-size-xs)}.chat-app :where(.skip-link):focus-visible{position:static;width:auto;height:auto}.chat-app :where(.fly-in){--fly-in-id: 0;--fly-in-duration: .4s;--fly-out-duration: .2s;--fly-in-delay: .3s;--fly-in-delay-additional: .1s;--fly-in-y: var(--spacer-r-64);transform:translateY(var(--fly-in-y));opacity:0;transition-delay:0s,1s;transition-duration:var(--fly-out-duration);transition-property:opacity,transform;transition-timing-function:ease,var(--ease-out-quart)}.chat-app :where(.mounted .fly-in){transform:translateY(0);opacity:1;transition-delay:calc(var(--fly-in-delay) + var(--fly-in-id) * var(--fly-in-delay-additional));transition-duration:var(--fly-in-duration)}.chat-app :where(.truncate){display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-app :where(.line-clamp){display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1}.chat-app :where(.line-clamp--2){-webkit-line-clamp:2}.chat-app :where(.line-clamp--6){-webkit-line-clamp:6}.chat-app :where(.container){width:100%;max-width:var(--container-max-width, 1024px);margin:0 auto;padding-right:var(--spacer-16);padding-left:var(--spacer-16)}@container chat-container (min-width: 640px){.chat-app :where(.container){padding-right:var(--spacer-32);padding-left:var(--spacer-32)}}@container chat-container (min-width: 768px){.chat-app :where(.container){padding-right:var(--spacer-48);padding-left:var(--spacer-48)}}.chat-app :where(h1){font-size:var(--base-font-size-h1)}.chat-app :where(h2){font-size:var(--base-font-size-h2)}.chat-app :where(h3){font-size:var(--base-font-size-h3)}.chat-app :where(h4,h5,h6){font-size:var(--body-font-size)}.chat-app :where(.h1){font-size:var(--base-font-size-h1)}.chat-app :where(.h2){font-size:var(--base-font-size-h2)}.chat-app :where(.h3){font-size:var(--base-font-size-h3)}.chat-app :where(.h4,.h5,.h6){font-size:var(--body-font-size)}.chat-app :where(.text-container)>:where(p,ul,ol,img,table){display:block;margin-bottom:var(--spacer-r-24)}.chat-app :where(.text-container)>:where(div){margin:var(--spacer-r-40) 0}.chat-app :where(.text-container)>:where(h1,.h1){margin-bottom:var(--spacer-r-28)}.chat-app :where(.text-container)>:where(h2,.h2,h3,.h3,h4,.h4,h5,.h5,h6,.h6){margin-bottom:var(--spacer-r-20)}.chat-app :where(.text-container)>:where(h1,.h1,h2,.h2,h3,.h3,h4,.h4,h5,.h5,h6,.h6){margin-top:var(--spacer-r-40)}.chat-app :where(.text-container)>:where(ul:not(.no-list-styling),ol:not(.no-list-styling))>:where(li){margin-bottom:var(--spacer-12)}.chat-app :where(.text-container)>:where(ul:not(.no-list-styling),ol:not(.no-list-styling))>:where(li):last-child{margin-bottom:0}.chat-app :where(.text-container)>:where(ol){padding-left:1.5em;list-style-position:outside;list-style-type:decimal}.chat-app :where(.text-container)>:where(ul:not(.no-list-styling))>:where(li){position:relative;padding-left:1em}.chat-app :where(.text-container)>:where(ul:not(.no-list-styling))>:where(li):before{position:absolute;top:0;left:0;content:"•";font-size:.9em}.chat-app :where(.text-container)>:where(hr){height:1px;margin:var(--spacer-r-40) 0;border:none;background-color:var(--color-grey-700);background-color:var(--hr-color)}.chat-app :where(.text-container) :where(a:not(.button,.no-link-styling,.reference)){color:var(--anchor-color);font-weight:var(--anchor-font-weight, var(--base-font-weight-normal));-webkit-text-decoration:var(--anchor-text-decoration, underline);text-decoration:var(--anchor-text-decoration, underline);text-underline-offset:var(--anchor-text-underline-offset, .15em);transition-duration:var(--default-transition-duration);transition-property:color,background-color,border-color;transition-timing-function:var(--default-transition-timing-function)}.chat-app :where(.text-container) :where(a:not(.button,.no-link-styling,.reference)):hover{color:var(--anchor-hover-color)}.chat-app :where(.text-container) :where(table){display:block;width:100%;overflow-x:auto;border-collapse:collapse;border-spacing:0;-webkit-overflow-scrolling:touch}.chat-app :where(.text-container) :where(th){width:1000px;padding:var(--spacer-12) var(--spacer-16) var(--spacer-12) 0;border-bottom:1px solid var(--color-grey-300);line-height:var(--base-line-height-tight);text-align:left;vertical-align:bottom}.chat-app :where(.text-container) :where(td){padding:var(--spacer-12) var(--spacer-16) var(--spacer-12) 0;border-bottom:1px solid var(--color-grey-300);vertical-align:top}.chat-app :where(.text-container) :where(tr:last-child td){border-bottom:none}.chat-app :where(.text-container) :where(*:first-child){margin-top:0}.chat-app :where(.text-container) :where(*:last-child){margin-bottom:0}.chat-app :where(.animated-height){transition:height .5s var(--ease-in-out-quart)}.chat-app :where(.display-contents){display:contents}.chat-app :where(.absolute){position:absolute!important}}@layer base{.svg{width:var(--spacer-r-24);height:auto}.svg svg{display:block;width:100%;height:auto;overflow:visible}}@layer components{.chat-app{display:contents}.chat-app__container{container-name:chat-container;container-type:inline-size;display:flex;height:100%;overflow:hidden;transform:translateZ(0)}.chat-app__container>:where(*){color:var(--body-color);font-style:normal;font-weight:var(--base-font-weight-normal);font-size:var(--base-font-size-body);line-height:var(--base-line-height-default);font-family:var(--font-family);font-optical-sizing:auto}.chat-app__container.chat-app__container--inline-layout-contained{height:90svh;scroll-margin-top:10svh}@media (min-width: 768px){.chat-app__container.chat-app__container--inline-layout-contained{height:100svh;scroll-margin-top:0}}.chat-app__main{container-name:chat-inner-container;container-type:inline-size;display:flex;flex-direction:column;width:100%;height:100%;overflow-x:hidden;overflow-y:auto;overscroll-behavior-x:none;overscroll-behavior-y:contain;background:var(--body-background);scrollbar-gutter:stable;touch-action:pan-y}.chat-app__container--inline-layout .chat-app__main{overscroll-behavior-y:auto}.chat-app__loader-container{display:flex;z-index:var(--z-index-loader);position:relative;align-items:center;justify-content:center;width:100%;height:100%}.chat-app__portals{display:contents}.chat-app__header{z-index:var(--z-index-header);position:sticky;top:0;background:var(--body-background)}.chat-app__header--unsticked{position:relative}.chat-app__header-content{--btn-padding-x: var(--btn-padding-y);display:flex;position:relative;-moz-column-gap:var(--spacer-r-12);column-gap:var(--spacer-r-12);flex-wrap:wrap;align-items:center;justify-content:flex-end;margin-right:calc(var(--btn-padding-x) * -1);margin-left:calc(var(--btn-padding-x) * -1);padding-top:var(--spacer-10);padding-bottom:var(--spacer-10)}.chat-app__header-content>:where(*){z-index:0;position:relative;pointer-events:auto}.chat-app__header-content:after{position:absolute;right:var(--btn-padding-x);bottom:0;left:var(--btn-padding-x);border-bottom:1px solid transparent;content:"";transition:border-color .1s ease-in-out}.chat-app__header-content.has-border:after{border-color:var(--base-line-color)}.chat-app__header-new-conversation{position:relative;margin-right:auto}@container chat-container (min-width: 640px){.chat-app__header-new-conversation .tooltip{display:none}}.chat-app__header--with-logo :where(.chat-app__header-content){margin-left:0}.chat-app__header--with-logo :where(.chat-app__header-new-conversation){margin-right:unset;margin-left:auto}.chat-app__header-logo{margin-right:auto}.chat-app__header-logo :where(svg){width:auto;height:var(--spacer-28)}.chat-app__body{display:flex;position:relative;flex-grow:1;flex-direction:column;width:100%}.chat-app__page-transition{display:flex;flex-grow:1;flex-direction:column;width:100%;height:100%}.chat-app__aside{--duration-in: .65s;--duration-out: .5s;visibility:hidden;position:relative;top:0;bottom:0;flex-grow:1;width:0;transition-delay:0s,var(--duration-out);transition-duration:var(--duration-out),0s;transition-property:width,visibility;transition-timing-function:var(--ease-in-out-quart),linear}.chat-app__aside.open{visibility:visible;width:var(--aside-width);transition-delay:0s;transition-duration:var(--duration-in),0s;transition-timing-function:var(--ease-out-quart),linear}.chat-app__aside .tooltip{--background-color: var(--btn-secondary-hover-background)}.chat-app__aside-container{position:relative;width:var(--aside-width);height:100%;overflow-y:auto;overscroll-behavior:contain;border-left-width:var(--aside-border-width);border-color:var(--aside-border-color);background:var(--aside-background);scrollbar-gutter:stable}.chat-app__container--inline-layout .chat-app__aside-container{overscroll-behavior-y:auto}.chat-app__aside-header,.chat-app__sheet-header{display:flex;z-index:var(--z-index-header);position:sticky;top:0;flex-wrap:no-wrap;align-items:center;justify-content:space-between;padding:var(--spacer-12) var(--spacer-12) var(--spacer-12) var(--spacer-24);gap:var(--spacer-24);border-bottom-width:var(--aside-header-border-width);border-color:var(--aside-header-border-color);background:var(--aside-background);color:var(--aside-header-color)}.chat-app__sheet-close{position:relative}.chat-app__sheet-overlay{z-index:var(--z-index-dialog);position:fixed;inset:0;background:var(--aside-background-overlay)}.chat-app__sheet-content{z-index:var(--z-index-flyout);position:fixed;top:0;right:0;width:100%;max-width:var(--aside-width);height:100%;overflow-y:auto;overscroll-behavior:contain;border-left-width:var(--aside-border-width);border-color:var(--aside-border-color);background:var(--aside-background);scrollbar-gutter:stable}.chat-app__container--inline-layout .chat-app__sheet-content{overscroll-behavior-y:auto}:is(.chat-app__aside-close,.chat-app__sheet-close) :where(.btn){background-color:transparent}.chat-app__aside-title,.chat-app__sheet-title{font-size:var(--base-font-size-sm)}.chat-app__close-button{z-index:var(--z-index-flyout)}}@layer components{.open-button{--open-button-avatar-height: var(--spacer-r-80);--open-button-avatar-width: var(--spacer-r-80);--open-button-duration: .4s;--open-button-delay: .3s;--open-button-ease: ease-in-out;display:flex;flex-direction:row;align-items:flex-end;cursor:pointer;transition:opacity .15s ease-out}.open-button--expanded{opacity:0;pointer-events:none}.open-button__text{display:flex;position:absolute;right:100%;bottom:50%;flex-direction:column;align-items:flex-start;justify-content:center;margin-right:calc(var(--open-button-avatar-width) * -.5);padding-top:var(--spacer-r-12);padding-right:0;padding-bottom:var(--spacer-r-12);padding-left:0;overflow:hidden;transform:translateY(50%);border-width:var(--open-button-border-width);border-radius:var(--open-button-border-radius);border-color:var(--open-button-border-color);background:var(--open-button-background);box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a;color:var(--open-button-color);text-align:left;transition:transform var(--open-button-duration) var(--open-button-ease),padding-right var(--open-button-duration) var(--open-button-delay) var(--open-button-ease)}.open-button:hover .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:hover .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:hover .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}}}',xp=new RegExp("([\\p{Ll}\\d])(\\p{Lu})","gu"),Sp=new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])","gu"),Tp=new RegExp("(\\d)(\\p{Ll})","gu"),Ep=new RegExp("(\\p{L})(\\d)","gu"),Cp=/[^\p{L}\d]+/giu,ha="$1\0$2",Ap="";function Rp(t,e){let r=t.trim();r=r.replace(xp,ha).replace(Sp,ha),e?.separateNumbers&&(r=r.replace(Tp,ha).replace(Ep,ha)),r=r.replace(Cp,"\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 Ip(t,e){return Mp(t,e?.prefixCharacters)+Rp(t,e).map(Op(e?.locale)).join(e?.delimiter??" ")}function Lp(t,e){return Ip(t,{delimiter:"-",...e})}function Op(t){return t===!1?e=>e.toLowerCase():e=>e.toLocaleLowerCase(t)}function Mp(t,e=Ap){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 fa=Lp,Pp=640,Dp=1024;let pa=null;const Np=()=>{if(pa)return pa;if(!globalThis.document)return 16;const t=globalThis.document.querySelector(":root");return pa=Number(getComputedStyle(t).fontSize.slice(0,-2)),pa},$p=({minRem:t,maxRem:e})=>{const r=Np(),n=Pp/r,a=Dp/r,i=(e-t)/(a-n),o=-n*i+t;return`clamp( ${t}rem, ${o}rem + ${i*100}cqw, ${e}rem )`},Jl=t=>typeof t=="string"?t:typeof t=="number"?String(t):typeof t=="object"?t.minRem===t.maxRem?`${t.minRem}rem`:$p(t):"",Bi=(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+=`--${fa(t)}-${fa(i)}:${Jl(o)}; `)}),a},ec=(t,e)=>Object.entries(e).map(([r,n])=>`--${t}-${fa(r)}:${Jl(n)}`).join("; ")+"; ",zp=(t,e)=>{let r="";return r+=Bi(t,e,["background","borderWidth","borderColor","boxShadow","borderRadius","color"],!0),e.hover&&(r+=Bi(`${t}-hover`,e.hover,["background","borderWidth","borderColor","boxShadow","color"])),e.focus&&(r+=Bi(`${t}-focus`,e.focus,["background","borderWidth","borderColor","boxShadow","color"])),e.custom&&(r+=ec(t,e.custom)),r},Fp=(t,e)=>Object.entries(e).map(([r,n])=>`--color-${t}-${r}:${n}`).join("; ")+"; ",jp=t=>`--font-family: ${t?.family||"inherit"};`,Bp=t=>{const e=jp(t.font),r=Object.entries(t.colors).map(([i,o])=>Fp(i,o)).join(""),n=ec("base",t.base),a=Object.entries(t.components).map(([i,o])=>zp(fa(i),o)).join("");return`.chat-app {${e} ${r} ${n} ${a}};`};var Je=typeof window<"u"?window:{screen:{},navigator:{}},jr=(Je.matchMedia||function(){return{matches:!1}}).bind(Je),Up={get passive(){return!0}},tc=function(){};Je.addEventListener&&Je.addEventListener("p",tc,Up),Je.removeEventListener&&Je.removeEventListener("p",tc,!1);var Ui="ontouchstart"in Je,qp="TouchEvent"in Je,Vp=Ui||qp&&jr("(any-pointer: coarse)").matches,rc=(Je.navigator.maxTouchPoints||0)>0||Vp,nc=Je.navigator.userAgent||"",Hp=jr("(pointer: coarse)").matches&&/iPad|Macintosh/.test(nc)&&Math.min(Je.screen.width||0,Je.screen.height||0)>=768,ac=(jr("(pointer: coarse)").matches||!jr("(pointer: fine)").matches&&Ui)&&!/Windows.*Firefox/.test(nc),Zp=jr("(any-pointer: fine)").matches||jr("(any-hover: hover)").matches||Hp||!Ui,ic=rc&&(Zp||!ac)?"hybrid":rc?"touchOnly":"mouseOnly",Gp=ic==="mouseOnly"?"mouse":ic==="touchOnly"||ac?"touch":"mouse";function oc(t,e){xr(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,"class",7),d=Xa(e,["$$slots","$$events","$$legacy","$$host","href","target","onclick","className","isStandalone","children","type","class"]);const p=X(()=>r()?"a":"button"),h=X(()=>[...Array.isArray(i())?i():i()?[i()]:[],...l()?[l()]:[]]);var g=nt(),v=Ee(g);return as(v,()=>T(p),!1,(b,R)=>{ds(b,k=>({...d,onclick:r()?void 0:a(),type:r()?void 0:c(),href:r(),role:r()?"link":"button",target:r()?n():void 0,class:T(h),[Ir]:k}),[()=>({"open-button--standalone":o()})]);var y=nt(),w=Ee(y);ts(w,s),ae(R,y)}),ae(t,g),Sr({get href(){return r()},set href(b){r(b),J()},get target(){return n()},set target(b){n(b),J()},get onclick(){return a()},set onclick(b){a(b),J()},get className(){return i()},set className(b=[]){i(b),J()},get isStandalone(){return o()},set isStandalone(b=!1){o(b),J()},get children(){return s()},set children(b){s(b),J()},get type(){return c()},set type(b="button"){c(b),J()},get class(){return l()},set class(b){l(b),J()}})}on(oc,{href:{},target:{},onclick:{},className:{},isStandalone:{},children:{},type:{},class:{}},[],[],!0);function wn(t,e){xr(e,!0);let r=se(e,"css",7),n=Xa(e,["$$slots","$$events","$$legacy","$$host","css"]);const a=c=>{Mo(()=>{r()&&(c.innerHTML=r())})};var i=nt(),o=Ee(i);{var s=c=>{var l=nt(),d=Ee(l);as(d,()=>"style",!1,(p,h)=>{td(p,g=>a?.(g)),ds(p,()=>({...n}))}),ae(c,l)};Yt(o,c=>{r()&&c(s)})}return ae(t,i),Sr({get css(){return r()},set css(c){r(c),J()}})}on(wn,{css:{}},[],[],!0);var Wp=gt('<div class="open-button__title"><!></div>'),Qp=gt('<div class="open-button__mask"><div class="open-button__description"><!></div></div>'),Yp=gt('<div class="open-button__text"><!> <!></div>'),Kp=gt('<div class="sr-only"> </div>'),Xp=gt('<!> <div class="svg svg--avatar open-button__avatar" aria-hidden="true"><!></div>',1),Jp=gt('<link rel="stylesheet"/>'),e0=gt("<!> <!>",1),t0=gt('<!> <!> <!> <main class="chat-app"><!></main>',1);function sc(t,e){xr(e,!0);const r=(P,z)=>{let K=()=>z?.().chatConfig,ee=()=>z?.().language;const te=X(()=>{const{openButtonTitle:we,openButtonDescription:ce}=K().translations[ee()];return{openButtonTitle:we,openButtonDescription:ce}}),Z=X(()=>K().fullTheme[T(n)].tokens.svgs);{let we=X(()=>K().buttonHref?void 0:s()?"true":"false"),ce=X(()=>K().buttonHref?void 0:"true"),Ve=X(()=>K().buttonHref?void 0:o()),lt=X(()=>["open-button",e.buttonClass,m.data.flyoutIsOpen?"open-button--expanded":void 0]);oc(P,{get href(){return K().buttonHref},get onclick(){return e.onclick},onmouseenter:y,onmouseleave:w,get"aria-expanded"(){return T(we)},get"aria-haspopup"(){return T(ce)},get"aria-controls"(){return T(Ve)},get style(){return e.buttonStyle},get className(){return T(lt)},get isStandalone(){return T(p)},children:(Ft,tr)=>{var yt=Xp(),rr=Ee(yt);{var nr=jt=>{var Q=Yp(),wt=Rt(Q);{var xn=_t=>{var ct=Wp(),et=Rt(ct);Ga(et,()=>T(te).openButtonTitle),Et(ct),ae(_t,ct)};Yt(wt,_t=>{T(te).openButtonTitle&&_t(xn)})}var ga=Wt(wt,2);{var Sn=_t=>{var ct=Qp(),et=Rt(ct),Br=Rt(et);Ga(Br,()=>T(te).openButtonDescription),Et(et),ms(et,ut=>G(v,ut),()=>T(v)),Et(ct),ms(ct,ut=>G(g,ut),()=>T(g)),ae(_t,ct)};Yt(ga,_t=>{T(te).openButtonDescription&&Gp==="mouse"&&_t(Sn)})}Et(Q),ae(jt,Q)},ne=jt=>{var Q=Kp(),wt=Rt(Q,!0);Et(Q),Fn(()=>Xo(wt,m.t.ariaOpenChat)),ae(jt,Q)};Yt(rr,jt=>{T(te).openButtonTitle||T(te).openButtonDescription?jt(nr):jt(ne,!1)})}var _n=Wt(rr,2),he=Rt(_n);Ga(he,()=>T(Z).avatar),Et(_n),ae(Ft,yt)},$$slots:{default:!0}})}};let n=oe("light"),a=se(e,"host",7),i=se(e,"onError",7),o=se(e,"flyoutId",7),s=se(e,"flyoutIsOpen",7),c=Xa(e,["$$slots","$$events","$$legacy","$$host","host","onError","flyoutId","flyoutIsOpen"]);const l=async P=>{const K=await(await fetch(`${P}/chatconfig`)).json();return Cl.parse(K)},d=async({forceTheme:P,lang:z,apiUrl:K})=>{const ee=window.CHAT_CONFIG_OVERRIDE?window.CHAT_CONFIG_OVERRIDE:await l(K),te=Pl(ee);let Z;z?Z=da(z,te.supportedLanguages):Z=Bl(te.supportedLanguages);const we=Object.keys(te.fullTheme),ce=zi(we);return{chatConfig:te,language:Z,colorScheme:ce}};let p=X(()=>!!a()),h=oe(!1),g=oe(void 0),v=oe(void 0),b=X(()=>T(v)?.offsetWidth??0),R=X(()=>T(v)?.offsetHeight??0);function y(){!T(v)||!T(g)||(T(g).style.width=`${T(b)}px`,T(g).style.height=`${T(R)}px`)}function w(){!T(h)&&T(g)&&(T(g).style.width="0",T(g).style.height="0")}let k=X(()=>d(c).catch(P=>i()(P)));Mo(()=>{T(k).then(P=>{G(n,P.colorScheme,!0)}).catch(()=>{})});var S=nt();zu(P=>{var z=nt(),K=Ee(z);{var ee=te=>{var Z=nt(),we=Ee(Z);rs(we,()=>T(k),null,(ce,Ve)=>{var lt=e0();const Ft=X(()=>T(Ve).chatConfig.fullTheme[T(Ve).colorScheme]);var tr=Ee(lt);Xu(tr,17,()=>T(Ft).fontURLs??[],Yu,(rr,nr)=>{var ne=Jp();Fn(()=>Ka(ne,"href",T(nr))),ae(rr,ne)});var yt=Wt(tr,2);wn(yt,{id:"font-css",get css(){return T(Ft).fontCSS}}),ae(ce,lt)}),ae(te,Z)};Yt(K,te=>{T(p)&&te(ee)})}ae(P,z)});var L=Ee(S);return rs(L,()=>T(k),P=>{},(P,z)=>{var K=nt();const ee=X(()=>T(z).chatConfig.fullTheme[T(n)]);var te=Ee(K);{var Z=ce=>{var Ve=t0(),lt=Ee(Ve);{let nr=X(()=>Bp(T(ee).tokens));wn(lt,{id:"theme-css",get css(){return T(nr)}})}var Ft=Wt(lt,2);wn(Ft,{id:"app-css",get css(){return _p}});var tr=Wt(Ft,2);wn(tr,{id:"custom-css",get css(){return T(ee).customCSS}});var yt=Wt(tr,2),rr=Rt(yt);r(rr,()=>T(z)),Et(yt),ae(ce,Ve)},we=ce=>{r(ce,()=>T(z))};Yt(te,ce=>{T(p)?ce(Z):ce(we,!1)})}ae(P,K)}),ae(t,S),Sr({get host(){return a()},set host(P){a(P),J()},get onError(){return i()},set onError(P){i(P),J()},get flyoutId(){return o()},set flyoutId(P){o(P),J()},get flyoutIsOpen(){return s()},set flyoutIsOpen(P){s(P),J()}})}on(sc,{host:{},onError:{},flyoutId:{},flyoutIsOpen:{}},[],[],!0);function lc(t,e){xr(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=X(()=>({onclick:r(),buttonClass:n(),buttonStyle:a(),apiUrl:i(),forceTheme:o(),lang:s()}));return bs(t,{silent:!0,body:(d,p=ir)=>{sc(d,md({host:e.$$host,get onError(){return p()}},()=>T(c)))},$$slots:{body:!0}}),Sr({get onclick(){return r()},set onclick(l){r(l),J()},get buttonClass(){return n()},set buttonClass(l){n(l),J()},get buttonStyle(){return a()},set buttonStyle(l){a(l),J()},get apiUrl(){return i()},set apiUrl(l){i(l),J()},get forceTheme(){return o()},set forceTheme(l){o(l),J()},get lang(){return s()},set lang(l){s(l),J()}})}return customElements.define("liipgpt-button",on(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)),Wr.LiipGPTButton=lc,Object.defineProperty(Wr,Symbol.toStringTag,{value:"Module"}),Wr}({});
|
|
382
|
+
`,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.",ariaAnswerGood:"Évaluer cette réponse comme bonne",ariaAnswerBad:"Évaluer cette réponse comme mauvaise",ariaReferenceSource:"Source:",ariaGiveFeedback:"Donner un feedback détaillé sur la réponse",ariaLanguageChanged:"Langue française sélectionnée.",ariaLightSelected:"Mode clair activé.",ariaDarkSelected:"Mode sombre activé.",ariaSettings:"Paramètres du chat",ariaSettingsRegion:"Ajustez vos préférences de chat",ariaReferencesRegion:"Références pour la question actuelle",ariaFlyoutRegion:"Chatbot",ariaSelected:"sélectionné",ariaUnselected:"non sélectionné",ariaAllSelected:"Tous les éléments sélectionnés",ariaAllUnselected:"Tous les éléments non sélectionnés",ariaAllReseted:"Éléments par défaut sélectionnés",hideSettings:"Masquer les paramètres",showSettings:"Paramètres",chooseAtLeastOneOption:"Veuillez choisir au moins une option",selectAll:"Tout sélectionner",selectNone:"Tout désélectionner",resetToDefaults:"Réinitialiser",messageTooLong:"Votre message doit être plus court que {questionLengthLimit} caractères. Actuellement, il fait {questionLength} caractères"}},Gf=Object.freeze(Object.defineProperty({__proto__:null,translations:yr},Symbol.toStringTag,{value:"Module"})),Wf=t=>{t=t??yr;const e={};return t.de&&(e.de=yn(yr.de,t.de)),t.en&&(e.en=yn(yr.en,t.en)),t.fr&&(e.fr=yn(yr.fr,t.fr)),t.it&&(e.it=yn(yr.it,t.it)),e},Pl=t=>{let e;t.theme?.fineGrained?e=Zf(t.theme?.fineGrained):e=Hf(t?.theme??{});const r=Wf(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??zf,forceConsent:t.forceConsent??!1};return t.classification&&(n.classification=t.classification),t.menu&&(n.menu=t.menu),n},Dl={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é."}},Nl={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"}},Oi=structuredClone(er.fineGrained.light);Oi.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 $l=structuredClone(er.fineGrained.dark);$l.tokens.colors=Oi.tokens.colors;const Qf=Object.freeze(Object.defineProperty({__proto__:null,theme:{fineGrained:{light:Oi,dark:$l}}},Symbol.toStringTag,{value:"Module"})),zl=t=>t.split("/").pop().split(".")[0],Yf=Object.assign({"./default/fallback-dev.theme.ts":Qf,"./default/fallback.theme.ts":qf}),Mi=new Map;Object.entries(Yf).forEach(([t,e])=>{const{error:r,data:n}=yl.safeParse(e?.theme);if(r){console.error(`Invalid theme in ${t}:`,r);return}Mi.set(zl(t),n)});const v0=t=>{const e=Mi.get(t);return e||(console.error(`Theme ${t} not found`),er)};Array.from(Mi.keys());const Kf=Object.assign({"./default/fallback.translations.ts":Gf}),Pi=new Map;Object.entries(Kf).forEach(([t,e])=>{const{error:r,data:n}=xl.safeParse(e?.translations);if(r){console.error(`Invalid translations in ${t}:`,r);return}Pi.set(zl(t),n)});const b0=t=>{const e=Pi.get(t);return e||(console.error(`Theme ${t} not found`),yr)};Array.from(Pi.keys());const Xf="en",Fl=(t,e)=>e.includes(t),da=(t,e)=>{if(Fl(t,e))return t;const r=Jf();return Fl(r,e)?r:Xf},Jf=()=>navigator.language.split("-")[0],jl=(t,e)=>{localStorage.setItem("liipgpt:selectedLanguage",t),e&&(e.lang=t)},Bl=t=>da(localStorage.getItem("liipgpt:selectedLanguage"),t);var Di,Ul;function ep(){return Ul||(Ul=1,Di=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}),Di}var tp=ep();const rp=Ll(tp),np=typeof document<"u";let ql=0;class ap{#e=oe(ht([]));get toasts(){return T(this.#e)}set toasts(e){G(this.#e,e,!0)}#t=oe(ht([]));get heights(){return T(this.#t)}set heights(e){G(this.#t,e,!0)}#a=e=>{const r=this.toasts.findIndex(n=>n.id===e);return r===-1?null:r};addToast=e=>{np&&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:ql++,i=e.dismissable===void 0?!0:e.dismissable,o=e.type===void 0?"default":e.type;return Ot(()=>{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=>(Ot(()=>{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=ip(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||ql++;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 ip(t){return t&&typeof t=="object"&&"status"in t?`HTTP error! Status: ${t.status}`:`Error! ${t}`}const ot=new ap;function op(t,e){return ot.create({message:t,...e})}const Ni=Object.assign(op,{success:ot.success,info:ot.info,warning:ot.warning,error:ot.error,custom:ot.custom,message:ot.message,promise:ot.promise,dismiss:ot.dismiss,loading:ot.loading,getActiveToasts:()=>ot.toasts.filter(t=>!t.dismiss)}),sp=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)},lp=(t,e)=>{const r={};return e.forEach(n=>{r[n]=t[n]}),r},cp=console.warn,up=()=>{},Vl=(t,e)=>Ot(()=>{console.warn=up;const r=e?lp(t,e):t,n=ou(r);return console.warn=cp,n}),dp=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=sp(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 Vl(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 Ot(()=>r.call(this.self,...a));const i=Vl(a);this.sendStart(e,i);try{const o=Ot(()=>r.call(this.self,...a));return dp(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 fp=(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 pp(){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 $i(){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 Hl(){return typeof window>"u"?!1:!!(window.MediaRecorder&&$i())}class Zl{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(!Hl()||!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=$i();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 Hl()}static getSupportedMediaType(){return $i()}}const gp=t=>(localStorage.setItem("liipgpt-color-scheme",t),zi(["light","dark"])),Gl=()=>{const t=localStorage.getItem("liipgpt-color-scheme");return t==="light"||t==="dark"?t:"system"},zi=t=>{let e=Gl();return e==="system"&&(e=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),t.includes(e)?e:t[0]??"light"},mp=[{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)}],Wl=t=>{for(const e of mp)if(e.check(t))return e.type},Fi="liipgpt:selectorValues",ji="liipgpt:selectorKnownDefaults",Ql=()=>{try{const t=it.getItem(Fi),e=it.getItem(ji);return t?{values:JSON.parse(t),knownDefaults:e?JSON.parse(e):{}}:null}catch{return null}},vp=t=>{const e={};for(const r of t)e[r.settingName]=r.defaultValues??(r.allowEmpty?[]:[r.values[0]]).filter(Boolean);return e},Yl=(t,e)=>{try{const r=vp(e);it.setItem(Fi,JSON.stringify(t)),it.setItem(ji,JSON.stringify(r))}catch(r){console.error("Failed to save selector values:",r)}},bp=t=>{try{const e=Ql();if(!e)return;delete e.values[t],delete e.knownDefaults[t],it.setItem(Fi,JSON.stringify(e.values)),it.setItem(ji,JSON.stringify(e.knownDefaults))}catch(e){console.error("Failed to clear selector saved state:",e)}},kp=t=>{const e=Ql(),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 yp extends Error{constructor(e){super(e),this.name="UnreachableError"}}const Kl=(t,e)=>{const n=new URLSearchParams(window.location.search).get("q");return n?{name:"chat-page",query:n}:t&&!e?{name:"consent-page"}:{name:"start-page"}};class wp{#e=oe(ht({}));get data(){return T(this.#e)}set data(e){G(this.#e,e,!0)}#t=oe(ht({}));get targets(){return T(this.#t)}set targets(e){G(this.#t,e,!0)}#a=oe(!1);get initialized(){return T(this.#a)}set initialized(e){G(this.#a,e,!0)}#l=oe(0);get currentAudioVolume(){return T(this.#l)}set currentAudioVolume(e){G(this.#l,e,!0)}ariaLiveMessagesClearingTimeoutDuration=350;#u=oe(null);get currentAudioRecorder(){return T(this.#u)}set currentAudioRecorder(e){G(this.#u,e,!0)}#i=oe(!1);get isTranscribing(){return T(this.#i)}set isTranscribing(e){G(this.#i,e,!0)}#r=X(()=>{if(!this.initialized)return[];const e=this.data.chatConfig.menu;return e?e[this.data.language]??[]:[]});get menu(){return T(this.#r)}set menu(e){G(this.#r,e)}#o=X(()=>this.initialized?this.data.chatConfig.translations[this.data.language]??{}:{});get t(){return T(this.#o)}set t(e){G(this.#o,e)}#s=X(()=>this.initialized?Dl[this.data.language]??{}:Dl.en??{});get errorTranslations(){return T(this.#s)}set errorTranslations(e){G(this.#s,e)}#n=X(()=>this.initialized?Nl[this.data.language]??{}:Nl.en??{});get piiTranslations(){return T(this.#n)}set piiTranslations(e){G(this.#n,e)}#c=X(()=>this.initialized?this.data.currentColorScheme:"light");get colorScheme(){return T(this.#c)}set colorScheme(e){G(this.#c,e)}#d=X(()=>this.initialized?this.data.chatConfig.fullTheme[this.data.currentColorScheme]:{});get themeBase(){return T(this.#d)}set themeBase(e){G(this.#d,e)}#f=X(()=>this.themeBase.tokens);get theme(){return T(this.#f)}set theme(e){G(this.#f,e)}#h=X(()=>{if(!this.initialized)return[];const e=[];for(const r of this.data.chatConfig.selectorsConfig){if(r.allowEmpty)continue;(this.data.selectorValues[r.settingName]||[]).length===0&&e.push(r.settingName)}return e});get selectorsWithErrors(){return T(this.#h)}set selectorsWithErrors(e){G(this.#h,e)}}const m=new wp;let Xe,st,Xl;fp({name:"chat-logic",state:m,excludeInDevTools:["onInput"]},{async init(t){st=t;const e=st.speechRecognitionApiKey||void 0;Xe=new $f({apiUrl:st.apiUrl,apiKey:st.apiKey,speechRecognitionApiKey:e,strict:!0});try{const r=await Xe.getChatConfig();window.CHAT_CONFIG_OVERRIDE&&Object.assign(r,window.CHAT_CONFIG_OVERRIDE);const a=(await Xe.getMetadata()).mode==="maintenance";a&&this.showErrorToast("maintenance");const i=Pl(r);st.inlineLayout!==void 0&&(i.inlineLayout=st.inlineLayout);let o;st.lang?o=da(st.lang,i.supportedLanguages):o=Bl(i.supportedLanguages),jl(o,m.targets.mainElement);const s=await this.getPredefinedQuestions(o),c=[];if(i.renderKatex){const h=await import("https://esm.sh/marked-katex-extension@5.1.5").catch(g=>{console.error("Couldn't load marked-katex-extension:",g)});h&&(Xe.setMarkedExtensions(h.default({nonStandard:!0,output:"mathml"})),c.push("https://cdn.jsdelivr.net/npm/katex@0.16.22/dist/katex.min.css"))}const l=Object.keys(i.fullTheme);let d=!1;if(i.forceConsent)try{d=it.getItem("liipgpt:termsAccepted")==="true"}catch(h){console.warn("Failed to load terms acceptance from storage:",h)}m.data={currentConversationState:"idle",chatConfig:i,language:o,predefinedQuestions:s,isInMaintenance:a,history:[],selectedColorScheme:Gl(),has2ColorSchemes:l.length===2,currentColorScheme:zi(l),conversationFeedbackId:void 0,conversationFeedbackIsOpen:!1,openedPopup:void 0,props:st,flyoutIsOpen:!1,questionHasPii:void 0,chatInputValue:"",selectorValues:kp(i.selectorsConfig),selectorsIsOpen:!1,currentReferencesAsideId:void 0,ariaLiveStatusMessage:void 0,ariaLiveStatusMessageClearingTimeout:void 0,wasReferencesAsideClosed:!1,isAsideMobile:!0,route:Kl(i.forceConsent??!1,d),additionalStylesheets:c,hasOpenedOverlays:!1,isInlineLayoutContained:!1,termsAccepted:d},window.LIIPGPT_LISTENERS?.route?.(m.data.route),window.LIIPGPT_LISTENERS?.conversation?.(m.data.currentConversationState),m.data.selectorsIsOpen=m.data.chatConfig.showExpandedSelectors??!1,m.initialized=!0,this.checkForOpenedPopup(),window.addEventListener("hashchange",()=>{this.checkForOpenedPopup()}),this.goto(Kl(i.forceConsent??!1,d),!0)}catch(r){throw Ni.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){m.targets[t]=e},goto(t,e=!1){if(!(!e&&rp(m.data.route,t)))switch(m.data.route=t,window.LIIPGPT_LISTENERS?.route?.(t),t.name){case"consent-page":break;case"start-page":t.prefill&&(m.data.chatInputValue=t.prefill);break;case"chat-page":if(m.data.chatInputValue=t.query,this.onSubmit(),m.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=m.data.chatConfig.selectorsConfig.find(r=>r.settingName===t);if(!e)throw new Error(`Setting ${t} not found`);return e},getPrettifiedSelectorValues(){const t=Object.entries(m.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}m.data.selectorValues[t]=e,Yl(m.data.selectorValues,m.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 bp(t),m.data.selectorValues[t]=r,Yl(m.data.selectorValues,m.data.chatConfig.selectorsConfig),r},async getPredefinedQuestions(t){try{return Xe.getPredefinedQuestions({url:window.location.origin+window.location.pathname,language:t})}catch(e){return console.warn("Failed to load predefined questions:",e),[]}},setColorScheme(t){m.data.selectedColorScheme=t,m.data.currentColorScheme=gp(t),this.setAriaLiveStatusMessage(t==="dark"?m.t.ariaDarkSelected:m.t.ariaLightSelected)},async abort(){await Xl?.abort()},changeConversationState(t){m.data.currentConversationState=t,window.LIIPGPT_LISTENERS?.conversation?.(t)},onInput(t){m.data.chatConfig.blockPII&&(m.data.questionHasPii=Wl(t)),m.data.chatInputValue=t},onSubmit(t=!1){if(m.data.questionHasPii){console.warn("Question contains PII, not submitting:",m.data.questionHasPii);return}const e=m.data.chatConfig.questionPrefix?`${m.data.chatConfig.questionPrefix} ${m.data.chatInputValue}`:m.data.chatInputValue,r=m.data.history.push({type:"user",time:new Date().toISOString(),message:m.data.chatInputValue});m.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:st.features?st.features.trim().split(","):["formatting"],onError:d=>{this.showErrorToast(d),window.LIIPGPT_LISTENERS?.error?.(d),(d==="pii-detected"||d==="blocked")&&this.editLatestQuestion()},lang:m.data.language,selectorValues:this.getPrettifiedSelectorValues()},a=(d,p)=>{try{const h=new URL(d),g=new URL(p);return h.origin===g.origin&&h.pathname===g.pathname}catch{return!1}},i=m.data.chatConfig.sendReferrer??"all";if(["all","own","location"].includes(i)){const d=i==="location"||m.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"&&!m.data.props.flyout&&p&&!p.startsWith(window.location.origin);n.referrer=p&&!h?p:void 0}m.data.currentConversationId||(m.data.currentConversationId=Xe.createConversationId());const o=Xe.chat(m.data.currentConversationId,e,n);Xl=o,m.data.lastChatResponseId=o.id,m.data.currentConversationState!=="searching"&&this.changeConversationState("searching"),this.setAriaLiveStatusMessage(m.t.ariaQuestionSent);let s=!1,c;const l=!!m.data.currentReferencesAsideId;(t&&l||!t&&m.data.chatConfig.showReferencesByDefault)&&(m.data.isAsideMobile||this.openReferencesAside(o.id)),o.subscribe(d=>{if(m.data.history[r]&&(m.data.history[r]={question:m.data.chatInputValue,...d}),m.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()}`))}m.data.chatConfig.showReferencesByDefault&&!m.data.wasReferencesAsideClosed&&m.data.currentReferencesAsideId!==d.id&&!m.data.isAsideMobile&&this.openReferencesAside(d.id),d.state==="streaming"&&m.data.currentConversationState!=="answering"&&this.changeConversationState("answering"),d.state==="done"&&(this.changeConversationState("idle"),s||(s=!0,this.setAriaLiveStatusMessage(`${m.t.ariaAnswerReady} ... ${d.message.text} ... ${m.t.ariaAnswerFinished}`)),m.data.currentReferencesAsideId&&m.data.history[r].references.used.length>0?(clearTimeout(c),c=setTimeout(()=>{this.openReferencesAside(d.id)},100)):this.closeReferencesAside())}),m.data.chatInputValue=""},async onStartSpeechRecognition(){try{if(!await pp()){this.showErrorToast("speech-not-supported");return}if(await navigator.mediaDevices.getUserMedia({audio:!0}),Zl.isSupported())m.data.chatInputValue="",m.currentAudioRecorder=new Zl({onDataAvailable:async e=>{m.isTranscribing=!0,await this.handleTranscription(e)},onError:()=>{this.showErrorToast("speech-microphone-access-denied"),m.currentAudioRecorder=null,m.isTranscribing=!1},onVolumeChange:e=>{m.currentAudioVolume=e}}),m.currentAudioRecorder.start();else{this.showErrorToast("speech-not-supported");return}}catch(t){throw this.showErrorToast("speech-microphone-access-denied"),m.currentAudioRecorder=null,m.isTranscribing=!1,t}},editLatestQuestion(){const t=m.data.history.findLastIndex(r=>r?.type==="user");if(t===-1){console.error("No last user question, available");return}const e=m.data.history.splice(t)[0];m.data.chatInputValue=e.message},onStopSpeechRecognition(){if(m.currentAudioRecorder){const t=m.currentAudioRecorder;m.currentAudioRecorder=null,t.stop()}m.currentAudioVolume=0},async handleTranscription(t){if(!t){console.warn("No audio data received");return}try{const e=await Xe.transcribeAudio(t,{lang:m.data.language});if(e.error){this.showErrorToast("speech-transcription-failed");return}if(e.transcript.trim()){if(m.data.chatConfig.blockPII&&(m.data.questionHasPii=Wl(e.transcript.trim()),m.data.questionHasPii))return;m.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{m.currentAudioRecorder=null,m.isTranscribing=!1,m.currentAudioVolume=0}},async onStartConversation(t){await this.abort(),m.data.history=[],m.data.currentConversationId=Xe.createConversationId(),this.goto({name:"chat-page",query:t})},async onNewConversation(){if(await this.abort(),m.data.currentConversationId=void 0,m.data.currentReferencesAsideId=void 0,m.data.history=[],m.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){Ni.success(m.t[t],{unstyled:!0,duration:3e3,classes:{toast:"toast"}})},showErrorToast(t){Ni.error(m.errorTranslations[t],{unstyled:!0,duration:3e3,classes:{toast:"toast"}})},async submitFeedback(t){try{const e=m.data.conversationFeedbackId||m.data.lastChatResponseId;if(!e)throw new yp("Tried to give feedback with no id.");const r=m.data.history.find(n=>n.type==="bot"&&n.id===e);await Xe.feedback(e,r?.question??"",t),setTimeout(()=>{this.showSuccessToast("thankYouForFeedback")},500)}catch(e){console.error("Feedback failed:",e),this.showErrorToast("feedback-failed")}},toggleReferencesAside(t){m.data.currentReferencesAsideId===t?this.closeReferencesAside():this.openReferencesAside(t)},openReferencesAside(t){m.data.currentReferencesAsideId=t,this.setOpenOverlay(!0)},closeReferencesAside(){m.data.currentReferencesAsideId=void 0,m.data.wasReferencesAsideClosed=!0,this.setOpenOverlay(!1)},setAsideMobile(t){m.data.isAsideMobile=t},openFlyout(){m.data.flyoutIsOpen=!0},closeFlyout(){m.data.flyoutIsOpen=!1},openConversationFeedback(){m.data.conversationFeedbackIsOpen=!0,this.setOpenOverlay(!0)},openMessageFeedback(t){m.data.conversationFeedbackId=t},closeFeedback(){m.data.conversationFeedbackIsOpen=!1,m.data.conversationFeedbackId=void 0,this.setOpenOverlay(!1)},setOpenOverlay(t){m.data.hasOpenedOverlays=t},setAriaLiveStatusMessage(t){m.data.ariaLiveStatusMessage=t,clearTimeout(m.data.ariaLiveStatusMessageClearingTimeout),m.data.ariaLiveStatusMessageClearingTimeout=setTimeout(()=>{m.data.ariaLiveStatusMessage=""},m.ariaLiveMessagesClearingTimeoutDuration)},closePopup(){window.location.hash=""},checkForOpenedPopup(){const t=window.location.hash.slice(1),e=m.t.popups?.find(r=>r.hash===t);e?m.data.openedPopup=e:m.data.openedPopup=void 0},async thumbs(t,e){try{const r=m.data.history.find(n=>n.type==="bot"&&n.id===t);e==="up"?await Xe.thumbsUp(t,r?.question??""):await Xe.thumbsDown(t,r?.question??""),this.showSuccessToast("thankYouForFeedback")}catch(r){console.error("Feedback failed:",r),this.showErrorToast("feedback-failed")}},async onLanguageChange(t){if(m.data.language=da(t,m.data.chatConfig.supportedLanguages),jl(m.data.language,m.targets.mainElement),m.data.predefinedQuestions=await this.getPredefinedQuestions(m.data.language),this.setAriaLiveStatusMessage(m.t.ariaLanguageChanged),m.data.chatConfig.reflectLanguageInPath){const e=new URL(window.location.href);e.pathname=`/${m.data.language}`,window.history.replaceState({},"",e.toString())}},async acceptTerms(){m.data.termsAccepted=!0;try{it.setItem("liipgpt:termsAccepted","true")}catch(t){console.warn("Failed to save terms acceptance to storage:",t)}this.closePopup(),this.closeFlyout(),await Ou(),this.goto({name:"start-page"})}});const _p='@layer base,utilities,components;/*! tailwindcss v4.1.11 | MIT License | https://tailwindcss.com */@layer base{*,:after,:before,::backdrop,::file-selector-button{box-sizing:border-box;margin:0;padding:0;border:0 solid}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea,::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::-moz-placeholder{opacity:1}::placeholder{opacity:1}@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px){::-moz-placeholder{color:currentcolor}@supports (color: color-mix(in lab,red,red)){{color:color-mix(in oklab,currentcolor 50%,transparent)}}::placeholder{color:currentcolor}@supports (color: color-mix(in lab,red,red)){{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]),::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer base{.chat-app{--spacer-1: .0625rem;--spacer-2: .125rem;--spacer-3: .1875rem;--spacer-4: .25rem;--spacer-5: .3125rem;--spacer-6: .375rem;--spacer-8: .5rem;--spacer-10: .625rem;--spacer-12: .75rem;--spacer-16: 1rem;--spacer-20: 1.25rem;--spacer-24: 1.5rem;--spacer-28: 1.75rem;--spacer-32: 2rem;--spacer-40: 2.5rem;--spacer-48: 3rem;--spacer-56: 3.5rem;--spacer-64: 4rem;--spacer-72: 4.5rem;--spacer-80: 5rem;--spacer-120: 7.5rem;--spacer-r-8: clamp(.375rem, .3182rem + .2841cqw, .5rem);--spacer-r-12: clamp(.625rem, .5682rem + .2841cqw, .75rem);--spacer-r-16: clamp(.75rem, .6364rem + .5682cqw, 1rem);--spacer-r-20: clamp(.875rem, .7045rem + .8523cqw, 1.25rem);--spacer-r-24: clamp(1rem, .7727rem + 1.1364cqw, 1.5rem);--spacer-r-28: clamp(1.125rem, .8409rem + 1.4205cqw, 1.75rem);--spacer-r-32: clamp(1.25rem, .9091rem + 1.7045cqw, 2rem);--spacer-r-40: clamp(1.5rem, 1.0455rem + 2.2727cqw, 2.5rem);--spacer-r-48: clamp(1.625rem, 1rem + 3.125cqw, 3rem);--spacer-r-56: clamp(1.75rem, .9545rem + 3.9773cqw, 3.5rem);--spacer-r-64: clamp(2rem, 1.0909rem + 4.5455cqw, 4rem);--spacer-r-80: clamp(3rem, 2.0909rem + 4.5455cqw, 5rem);--spacer-r-96: clamp(3.5rem, 2.3636rem + 5.6818cqw, 6rem);--spacer-r-120: clamp(4rem, 2.4091rem + 7.9545cqw, 7.5rem);--default-transition-duration: .2s;--default-transition-timing-function: ease-in-out;--z-index-flyout: 10000;--z-index-dialog: 600;--z-index-loader: 500;--z-index-reference-number: 400;--z-index-footer: 300;--z-index-header: 200;--z-index-tooltip: 100;--z-index-tooltip-hover: 101;--z-index-local-overlay: 10;--ease-out-quart: cubic-bezier(.165, .84, .44, 1);--ease-in-quart: cubic-bezier(.895, .03, .685, .22);--ease-in-out-quart: cubic-bezier(.77, 0, .175, 1);--fly-in-id: 0;--btn-padding-x: var(--spacer-r-20);--btn-padding-y: var(--spacer-r-8);--btn-icon-size: var(--spacer-24);--btn-submit-size: 2.5em;--last-bot-message-min-height: 0}}@value container-xs,container-sm,container-md,container-lg,container-inner-xs,container-inner-sm,container-inner-md,container-inner-lg from "./viewports.css";@layer base{.chat-app :where(h1,.h1,h2,.h2,h3,.h3,h4,.h4,h5,.h5,h6,.h6){font-weight:var(--base-font-weight-title);line-height:var(--base-line-height-tight)}.chat-app :where(b,strong){font-weight:var(--base-font-weight-bold)}.chat-app :where(button){cursor:pointer}.chat-app :where(input[type=text],input[type=email],input[type=search],input[type=password],textarea){width:100%;padding:var(--input-padding);border-width:var(--input-border-width);border-radius:var(--input-border-radius);border-color:var(--input-border-color);background:var(--input-background);box-shadow:var(--input-box-shadow, none);color:var(--input-color)}.chat-app :where(input[type=text],input[type=email],input[type=search],input[type=password],textarea)::-moz-placeholder{color:var(--input-placeholder-color);opacity:var(--input-placeholder-opacity)}.chat-app :where(input[type=text],input[type=email],input[type=search],input[type=password],textarea)::placeholder{color:var(--input-placeholder-color);opacity:var(--input-placeholder-opacity)}.chat-app :where(input[type=radio],input[type=checkbox]){margin:0}.chat-app :where(*:focus-visible){border-radius:var(--btn-primary-border-radius);outline-color:var(--body-focus-color);outline-style:var(--body-focus-style);outline-width:var(--body-focus-width);outline-offset:var(--body-focus-offset)}.chat-app *::-moz-selection{background:var(--body-selection-background);color:var(--body-selection-color)}.chat-app *::selection{background:var(--body-selection-background);color:var(--body-selection-color)}.chat-app ::-webkit-scrollbar{width:8px;height:8px}.chat-app ::-webkit-scrollbar-track{background:transparent}.chat-app ::-webkit-scrollbar-thumb{border-radius:4px;background-color:#0000004d;-webkit-transition:background-color .2s;transition:background-color .2s}.chat-app ::-webkit-scrollbar-thumb:hover{background-color:#00000080}.chat-app *{scrollbar-color:rgba(0,0,0,.3) transparent;scrollbar-width:thin}.chat-app ::-webkit-scrollbar-thumb{visibility:hidden}.chat-app *:hover::-webkit-scrollbar-thumb,.chat-app *:active::-webkit-scrollbar-thumb,.chat-app *:focus::-webkit-scrollbar-thumb{visibility:visible}}@layer utilities{.chat-app :where(.expand-interaction){position:relative}.chat-app :where(.expand-interaction):after{position:absolute;inset:0;background-color:transparent;content:""}.chat-app :where(.sr-only){position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.chat-app :where(.transition-colors){transition-duration:var(--default-transition-duration);transition-property:color,background-color,border-color,box-shadow;transition-timing-function:var(--default-transition-timing-function)}.chat-app :where(.transition){transition-duration:var(--default-transition-duration);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter;transition-timing-function:var(--default-transition-timing-function)}.chat-app :where(.skip-link){position:absolute;width:0px;height:0px;overflow:hidden;color:var(--anchor-color);font-weight:700;font-size:var(--base-font-size-xs)}.chat-app :where(.skip-link):focus-visible{position:static;width:auto;height:auto}.chat-app :where(.fly-in){--fly-in-id: 0;--fly-in-duration: .4s;--fly-out-duration: .2s;--fly-in-delay: .3s;--fly-in-delay-additional: .1s;--fly-in-y: var(--spacer-r-64);transform:translateY(var(--fly-in-y));opacity:0;transition-delay:0s,1s;transition-duration:var(--fly-out-duration);transition-property:opacity,transform;transition-timing-function:ease,var(--ease-out-quart)}.chat-app :where(.mounted .fly-in){transform:translateY(0);opacity:1;transition-delay:calc(var(--fly-in-delay) + var(--fly-in-id) * var(--fly-in-delay-additional));transition-duration:var(--fly-in-duration)}.chat-app :where(.truncate){display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-app :where(.line-clamp){display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1}.chat-app :where(.line-clamp--2){-webkit-line-clamp:2}.chat-app :where(.line-clamp--6){-webkit-line-clamp:6}.chat-app :where(.container){width:100%;max-width:var(--container-max-width, 1024px);margin:0 auto;padding-right:var(--spacer-16);padding-left:var(--spacer-16)}@container chat-container (min-width: 640px){.chat-app :where(.container){padding-right:var(--spacer-32);padding-left:var(--spacer-32)}}@container chat-container (min-width: 768px){.chat-app :where(.container){padding-right:var(--spacer-48);padding-left:var(--spacer-48)}}.chat-app :where(h1){font-size:var(--base-font-size-h1)}.chat-app :where(h2){font-size:var(--base-font-size-h2)}.chat-app :where(h3){font-size:var(--base-font-size-h3)}.chat-app :where(h4,h5,h6){font-size:var(--body-font-size)}.chat-app :where(.h1){font-size:var(--base-font-size-h1)}.chat-app :where(.h2){font-size:var(--base-font-size-h2)}.chat-app :where(.h3){font-size:var(--base-font-size-h3)}.chat-app :where(.h4,.h5,.h6){font-size:var(--body-font-size)}.chat-app :where(.text-container)>:where(p,ul,ol,img,table){display:block;margin-bottom:var(--spacer-r-24)}.chat-app :where(.text-container)>:where(div){margin:var(--spacer-r-40) 0}.chat-app :where(.text-container)>:where(h1,.h1){margin-bottom:var(--spacer-r-28)}.chat-app :where(.text-container)>:where(h2,.h2,h3,.h3,h4,.h4,h5,.h5,h6,.h6){margin-bottom:var(--spacer-r-20)}.chat-app :where(.text-container)>:where(h1,.h1,h2,.h2,h3,.h3,h4,.h4,h5,.h5,h6,.h6){margin-top:var(--spacer-r-40)}.chat-app :where(.text-container)>:where(ul:not(.no-list-styling),ol:not(.no-list-styling))>:where(li){margin-bottom:var(--spacer-12)}.chat-app :where(.text-container)>:where(ul:not(.no-list-styling),ol:not(.no-list-styling))>:where(li):last-child{margin-bottom:0}.chat-app :where(.text-container)>:where(ol){padding-left:1.5em;list-style-position:outside;list-style-type:decimal}.chat-app :where(.text-container)>:where(ul:not(.no-list-styling))>:where(li){position:relative;padding-left:1em}.chat-app :where(.text-container)>:where(ul:not(.no-list-styling))>:where(li):before{position:absolute;top:0;left:0;content:"•";font-size:.9em}.chat-app :where(.text-container)>:where(hr){height:1px;margin:var(--spacer-r-40) 0;border:none;background-color:var(--color-grey-700);background-color:var(--hr-color)}.chat-app :where(.text-container) :where(a:not(.button,.no-link-styling,.reference)){color:var(--anchor-color);font-weight:var(--anchor-font-weight, var(--base-font-weight-normal));-webkit-text-decoration:var(--anchor-text-decoration, underline);text-decoration:var(--anchor-text-decoration, underline);text-underline-offset:var(--anchor-text-underline-offset, .15em);transition-duration:var(--default-transition-duration);transition-property:color,background-color,border-color;transition-timing-function:var(--default-transition-timing-function)}.chat-app :where(.text-container) :where(a:not(.button,.no-link-styling,.reference)):hover{color:var(--anchor-hover-color)}.chat-app :where(.text-container) :where(table){display:block;width:100%;overflow-x:auto;border-collapse:collapse;border-spacing:0;-webkit-overflow-scrolling:touch}.chat-app :where(.text-container) :where(th){width:1000px;padding:var(--spacer-12) var(--spacer-16) var(--spacer-12) 0;border-bottom:1px solid var(--color-grey-300);line-height:var(--base-line-height-tight);text-align:left;vertical-align:bottom}.chat-app :where(.text-container) :where(td){padding:var(--spacer-12) var(--spacer-16) var(--spacer-12) 0;border-bottom:1px solid var(--color-grey-300);vertical-align:top}.chat-app :where(.text-container) :where(tr:last-child td){border-bottom:none}.chat-app :where(.text-container) :where(*:first-child){margin-top:0}.chat-app :where(.text-container) :where(*:last-child){margin-bottom:0}.chat-app :where(.animated-height){transition:height .5s var(--ease-in-out-quart)}.chat-app :where(.display-contents){display:contents}.chat-app :where(.absolute){position:absolute!important}}@layer base{.svg{width:var(--spacer-r-24);height:auto}.svg svg{display:block;width:100%;height:auto;overflow:visible}}@layer components{.chat-app{display:contents}.chat-app__container{container-name:chat-container;container-type:inline-size;display:flex;height:100%;overflow:hidden;transform:translateZ(0)}.chat-app__container>:where(*){color:var(--body-color);font-style:normal;font-weight:var(--base-font-weight-normal);font-size:var(--base-font-size-body);line-height:var(--base-line-height-default);font-family:var(--font-family);font-optical-sizing:auto}.chat-app__container.chat-app__container--inline-layout-contained{height:90svh;scroll-margin-top:10svh}@media (min-width: 768px){.chat-app__container.chat-app__container--inline-layout-contained{height:100svh;scroll-margin-top:0}}.chat-app__main{container-name:chat-inner-container;container-type:inline-size;display:flex;flex-direction:column;width:100%;height:100%;overflow-x:hidden;overflow-y:auto;overscroll-behavior-x:none;overscroll-behavior-y:contain;background:var(--body-background);scrollbar-gutter:stable;touch-action:pan-y}.chat-app__container--inline-layout .chat-app__main{overscroll-behavior-y:auto}.chat-app__loader-container{display:flex;z-index:var(--z-index-loader);position:relative;align-items:center;justify-content:center;width:100%;height:100%}.chat-app__portals{display:contents}.chat-app__header{z-index:var(--z-index-header);position:sticky;top:0;background:var(--body-background)}.chat-app__header--unsticked{position:relative}.chat-app__header-content{--btn-padding-x: var(--btn-padding-y);display:flex;position:relative;-moz-column-gap:var(--spacer-r-12);column-gap:var(--spacer-r-12);flex-wrap:wrap;align-items:center;justify-content:flex-end;margin-right:calc(var(--btn-padding-x) * -1);margin-left:calc(var(--btn-padding-x) * -1);padding-top:var(--spacer-10);padding-bottom:var(--spacer-10)}.chat-app__header-content>:where(*){z-index:0;position:relative;pointer-events:auto}.chat-app__header-content:after{position:absolute;right:var(--btn-padding-x);bottom:0;left:var(--btn-padding-x);border-bottom:1px solid transparent;content:"";transition:border-color .1s ease-in-out}.chat-app__header-content.has-border:after{border-color:var(--base-line-color)}.chat-app__header-new-conversation{position:relative;margin-right:auto}@container chat-container (min-width: 640px){.chat-app__header-new-conversation .tooltip{display:none}}.chat-app__header--with-logo :where(.chat-app__header-content){margin-left:0}.chat-app__header--with-logo :where(.chat-app__header-new-conversation){margin-right:unset;margin-left:auto}.chat-app__header-logo{margin-right:auto}.chat-app__header-logo :where(svg){width:auto;height:var(--spacer-28)}.chat-app__body{display:flex;position:relative;flex-grow:1;flex-direction:column;width:100%}.chat-app__page-transition{display:flex;flex-grow:1;flex-direction:column;width:100%;height:100%}.chat-app__aside{--duration-in: .65s;--duration-out: .5s;visibility:hidden;position:relative;top:0;bottom:0;flex-grow:1;width:0;transition-delay:0s,var(--duration-out);transition-duration:var(--duration-out),0s;transition-property:width,visibility;transition-timing-function:var(--ease-in-out-quart),linear}.chat-app__aside.open{visibility:visible;width:var(--aside-width);transition-delay:0s;transition-duration:var(--duration-in),0s;transition-timing-function:var(--ease-out-quart),linear}.chat-app__aside .tooltip{--background-color: var(--btn-secondary-hover-background)}.chat-app__aside-container{position:relative;width:var(--aside-width);height:100%;overflow-y:auto;overscroll-behavior:contain;border-left-width:var(--aside-border-width);border-color:var(--aside-border-color);background:var(--aside-background);scrollbar-gutter:stable}.chat-app__container--inline-layout .chat-app__aside-container{overscroll-behavior-y:auto}.chat-app__aside-header,.chat-app__sheet-header{display:flex;z-index:var(--z-index-header);position:sticky;top:0;flex-wrap:no-wrap;align-items:center;justify-content:space-between;padding:var(--spacer-12) var(--spacer-12) var(--spacer-12) var(--spacer-24);gap:var(--spacer-24);border-bottom-width:var(--aside-header-border-width);border-color:var(--aside-header-border-color);background:var(--aside-background);color:var(--aside-header-color)}.chat-app__sheet-close{position:relative}.chat-app__sheet-overlay{z-index:var(--z-index-dialog);position:fixed;inset:0;background:var(--aside-background-overlay)}.chat-app__sheet-content{z-index:var(--z-index-flyout);position:fixed;top:0;right:0;width:100%;max-width:var(--aside-width);height:100%;overflow-y:auto;overscroll-behavior:contain;border-left-width:var(--aside-border-width);border-color:var(--aside-border-color);background:var(--aside-background);scrollbar-gutter:stable}.chat-app__container--inline-layout .chat-app__sheet-content{overscroll-behavior-y:auto}:is(.chat-app__aside-close,.chat-app__sheet-close) :where(.btn){background-color:transparent}.chat-app__aside-title,.chat-app__sheet-title{font-size:var(--base-font-size-sm)}.chat-app__close-button{z-index:var(--z-index-flyout)}}@layer components{.open-button{--open-button-avatar-height: var(--spacer-r-80);--open-button-avatar-width: var(--spacer-r-80);--open-button-duration: .4s;--open-button-delay: .3s;--open-button-ease: ease-in-out;display:flex;flex-direction:row;align-items:flex-end;cursor:pointer;transition:opacity .15s ease-out}.open-button--expanded{opacity:0;pointer-events:none}.open-button__text{display:flex;position:absolute;right:100%;bottom:50%;flex-direction:column;align-items:flex-start;justify-content:center;margin-right:calc(var(--open-button-avatar-width) * -.5);padding-top:var(--spacer-r-12);padding-right:0;padding-bottom:var(--spacer-r-12);padding-left:0;overflow:hidden;transform:translateY(50%);border-width:var(--open-button-border-width);border-radius:var(--open-button-border-radius);border-color:var(--open-button-border-color);background:var(--open-button-background);box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a;color:var(--open-button-color);text-align:left;transition:transform var(--open-button-duration) var(--open-button-ease),padding-right var(--open-button-duration) var(--open-button-delay) var(--open-button-ease)}.open-button:hover .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:hover .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:hover .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}}}',xp=new RegExp("([\\p{Ll}\\d])(\\p{Lu})","gu"),Sp=new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])","gu"),Tp=new RegExp("(\\d)(\\p{Ll})","gu"),Ep=new RegExp("(\\p{L})(\\d)","gu"),Cp=/[^\p{L}\d]+/giu,ha="$1\0$2",Ap="";function Rp(t,e){let r=t.trim();r=r.replace(xp,ha).replace(Sp,ha),e?.separateNumbers&&(r=r.replace(Tp,ha).replace(Ep,ha)),r=r.replace(Cp,"\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 Ip(t,e){return Mp(t,e?.prefixCharacters)+Rp(t,e).map(Op(e?.locale)).join(e?.delimiter??" ")}function Lp(t,e){return Ip(t,{delimiter:"-",...e})}function Op(t){return t===!1?e=>e.toLowerCase():e=>e.toLocaleLowerCase(t)}function Mp(t,e=Ap){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 fa=Lp,Pp=640,Dp=1024;let pa=null;const Np=()=>{if(pa)return pa;if(!globalThis.document)return 16;const t=globalThis.document.querySelector(":root");return pa=Number(getComputedStyle(t).fontSize.slice(0,-2)),pa},$p=({minRem:t,maxRem:e})=>{const r=Np(),n=Pp/r,a=Dp/r,i=(e-t)/(a-n),o=-n*i+t;return`clamp( ${t}rem, ${o}rem + ${i*100}cqw, ${e}rem )`},Jl=t=>typeof t=="string"?t:typeof t=="number"?String(t):typeof t=="object"?t.minRem===t.maxRem?`${t.minRem}rem`:$p(t):"",Bi=(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+=`--${fa(t)}-${fa(i)}:${Jl(o)}; `)}),a},ec=(t,e)=>Object.entries(e).map(([r,n])=>`--${t}-${fa(r)}:${Jl(n)}`).join("; ")+"; ",zp=(t,e)=>{let r="";return r+=Bi(t,e,["background","borderWidth","borderColor","boxShadow","borderRadius","color"],!0),e.hover&&(r+=Bi(`${t}-hover`,e.hover,["background","borderWidth","borderColor","boxShadow","color"])),e.focus&&(r+=Bi(`${t}-focus`,e.focus,["background","borderWidth","borderColor","boxShadow","color"])),e.custom&&(r+=ec(t,e.custom)),r},Fp=(t,e)=>Object.entries(e).map(([r,n])=>`--color-${t}-${r}:${n}`).join("; ")+"; ",jp=t=>`--font-family: ${t?.family||"inherit"};`,Bp=t=>{const e=jp(t.font),r=Object.entries(t.colors).map(([i,o])=>Fp(i,o)).join(""),n=ec("base",t.base),a=Object.entries(t.components).map(([i,o])=>zp(fa(i),o)).join("");return`.chat-app {${e} ${r} ${n} ${a}};`};var Je=typeof window<"u"?window:{screen:{},navigator:{}},jr=(Je.matchMedia||function(){return{matches:!1}}).bind(Je),Up={get passive(){return!0}},tc=function(){};Je.addEventListener&&Je.addEventListener("p",tc,Up),Je.removeEventListener&&Je.removeEventListener("p",tc,!1);var Ui="ontouchstart"in Je,qp="TouchEvent"in Je,Vp=Ui||qp&&jr("(any-pointer: coarse)").matches,rc=(Je.navigator.maxTouchPoints||0)>0||Vp,nc=Je.navigator.userAgent||"",Hp=jr("(pointer: coarse)").matches&&/iPad|Macintosh/.test(nc)&&Math.min(Je.screen.width||0,Je.screen.height||0)>=768,ac=(jr("(pointer: coarse)").matches||!jr("(pointer: fine)").matches&&Ui)&&!/Windows.*Firefox/.test(nc),Zp=jr("(any-pointer: fine)").matches||jr("(any-hover: hover)").matches||Hp||!Ui,ic=rc&&(Zp||!ac)?"hybrid":rc?"touchOnly":"mouseOnly",Gp=ic==="mouseOnly"?"mouse":ic==="touchOnly"||ac?"touch":"mouse";function oc(t,e){xr(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,"class",7),d=Xa(e,["$$slots","$$events","$$legacy","$$host","href","target","onclick","className","isStandalone","children","type","class"]);const p=X(()=>r()?"a":"button"),h=X(()=>[...Array.isArray(i())?i():i()?[i()]:[],...l()?[l()]:[]]);var g=nt(),v=Ee(g);return as(v,()=>T(p),!1,(b,R)=>{ds(b,k=>({...d,onclick:r()?void 0:a(),type:r()?void 0:c(),href:r(),role:r()?"link":"button",target:r()?n():void 0,class:T(h),[Ir]:k}),[()=>({"open-button--standalone":o()})]);var y=nt(),w=Ee(y);ts(w,s),ae(R,y)}),ae(t,g),Sr({get href(){return r()},set href(b){r(b),J()},get target(){return n()},set target(b){n(b),J()},get onclick(){return a()},set onclick(b){a(b),J()},get className(){return i()},set className(b=[]){i(b),J()},get isStandalone(){return o()},set isStandalone(b=!1){o(b),J()},get children(){return s()},set children(b){s(b),J()},get type(){return c()},set type(b="button"){c(b),J()},get class(){return l()},set class(b){l(b),J()}})}on(oc,{href:{},target:{},onclick:{},className:{},isStandalone:{},children:{},type:{},class:{}},[],[],!0);function wn(t,e){xr(e,!0);let r=se(e,"css",7),n=Xa(e,["$$slots","$$events","$$legacy","$$host","css"]);const a=c=>{Mo(()=>{r()&&(c.innerHTML=r())})};var i=nt(),o=Ee(i);{var s=c=>{var l=nt(),d=Ee(l);as(d,()=>"style",!1,(p,h)=>{td(p,g=>a?.(g)),ds(p,()=>({...n}))}),ae(c,l)};Yt(o,c=>{r()&&c(s)})}return ae(t,i),Sr({get css(){return r()},set css(c){r(c),J()}})}on(wn,{css:{}},[],[],!0);var Wp=gt('<div class="open-button__title"><!></div>'),Qp=gt('<div class="open-button__mask"><div class="open-button__description"><!></div></div>'),Yp=gt('<div class="open-button__text"><!> <!></div>'),Kp=gt('<div class="sr-only"> </div>'),Xp=gt('<!> <div class="svg svg--avatar open-button__avatar" aria-hidden="true"><!></div>',1),Jp=gt('<link rel="stylesheet"/>'),e0=gt("<!> <!>",1),t0=gt('<!> <!> <!> <main class="chat-app"><!></main>',1);function sc(t,e){xr(e,!0);const r=(P,z)=>{let K=()=>z?.().chatConfig,ee=()=>z?.().language;const te=X(()=>{const{openButtonTitle:we,openButtonDescription:ce}=K().translations[ee()];return{openButtonTitle:we,openButtonDescription:ce}}),Z=X(()=>K().fullTheme[T(n)].tokens.svgs);{let we=X(()=>K().buttonHref?void 0:s()?"true":"false"),ce=X(()=>K().buttonHref?void 0:"true"),Ve=X(()=>K().buttonHref?void 0:o()),lt=X(()=>["open-button",e.buttonClass,m.data.flyoutIsOpen?"open-button--expanded":void 0]);oc(P,{get href(){return K().buttonHref},get onclick(){return e.onclick},onmouseenter:y,onmouseleave:w,get"aria-expanded"(){return T(we)},get"aria-haspopup"(){return T(ce)},get"aria-controls"(){return T(Ve)},get style(){return e.buttonStyle},get className(){return T(lt)},get isStandalone(){return T(p)},children:(Ft,tr)=>{var yt=Xp(),rr=Ee(yt);{var nr=jt=>{var Q=Yp(),wt=Rt(Q);{var xn=_t=>{var ct=Wp(),et=Rt(ct);Ga(et,()=>T(te).openButtonTitle),Et(ct),ae(_t,ct)};Yt(wt,_t=>{T(te).openButtonTitle&&_t(xn)})}var ga=Wt(wt,2);{var Sn=_t=>{var ct=Qp(),et=Rt(ct),Br=Rt(et);Ga(Br,()=>T(te).openButtonDescription),Et(et),ms(et,ut=>G(v,ut),()=>T(v)),Et(ct),ms(ct,ut=>G(g,ut),()=>T(g)),ae(_t,ct)};Yt(ga,_t=>{T(te).openButtonDescription&&Gp==="mouse"&&_t(Sn)})}Et(Q),ae(jt,Q)},ne=jt=>{var Q=Kp(),wt=Rt(Q,!0);Et(Q),Fn(()=>Xo(wt,m.t.ariaOpenChat)),ae(jt,Q)};Yt(rr,jt=>{T(te).openButtonTitle||T(te).openButtonDescription?jt(nr):jt(ne,!1)})}var _n=Wt(rr,2),he=Rt(_n);Ga(he,()=>T(Z).avatar),Et(_n),ae(Ft,yt)},$$slots:{default:!0}})}};let n=oe("light"),a=se(e,"host",7),i=se(e,"onError",7),o=se(e,"flyoutId",7),s=se(e,"flyoutIsOpen",7),c=Xa(e,["$$slots","$$events","$$legacy","$$host","host","onError","flyoutId","flyoutIsOpen"]);const l=async P=>{const K=await(await fetch(`${P}/chatconfig`)).json();return Cl.parse(K)},d=async({forceTheme:P,lang:z,apiUrl:K})=>{const ee=window.CHAT_CONFIG_OVERRIDE?window.CHAT_CONFIG_OVERRIDE:await l(K),te=Pl(ee);let Z;z?Z=da(z,te.supportedLanguages):Z=Bl(te.supportedLanguages);const we=Object.keys(te.fullTheme),ce=zi(we);return{chatConfig:te,language:Z,colorScheme:ce}};let p=X(()=>!!a()),h=oe(!1),g=oe(void 0),v=oe(void 0),b=X(()=>T(v)?.offsetWidth??0),R=X(()=>T(v)?.offsetHeight??0);function y(){!T(v)||!T(g)||(T(g).style.width=`${T(b)}px`,T(g).style.height=`${T(R)}px`)}function w(){!T(h)&&T(g)&&(T(g).style.width="0",T(g).style.height="0")}let k=X(()=>d(c).catch(P=>i()(P)));Mo(()=>{T(k).then(P=>{G(n,P.colorScheme,!0)}).catch(()=>{})});var S=nt();zu(P=>{var z=nt(),K=Ee(z);{var ee=te=>{var Z=nt(),we=Ee(Z);rs(we,()=>T(k),null,(ce,Ve)=>{var lt=e0();const Ft=X(()=>T(Ve).chatConfig.fullTheme[T(Ve).colorScheme]);var tr=Ee(lt);Xu(tr,17,()=>T(Ft).fontURLs??[],Yu,(rr,nr)=>{var ne=Jp();Fn(()=>Ka(ne,"href",T(nr))),ae(rr,ne)});var yt=Wt(tr,2);wn(yt,{id:"font-css",get css(){return T(Ft).fontCSS}}),ae(ce,lt)}),ae(te,Z)};Yt(K,te=>{T(p)&&te(ee)})}ae(P,z)});var L=Ee(S);return rs(L,()=>T(k),P=>{},(P,z)=>{var K=nt();const ee=X(()=>T(z).chatConfig.fullTheme[T(n)]);var te=Ee(K);{var Z=ce=>{var Ve=t0(),lt=Ee(Ve);{let nr=X(()=>Bp(T(ee).tokens));wn(lt,{id:"theme-css",get css(){return T(nr)}})}var Ft=Wt(lt,2);wn(Ft,{id:"app-css",get css(){return _p}});var tr=Wt(Ft,2);wn(tr,{id:"custom-css",get css(){return T(ee).customCSS}});var yt=Wt(tr,2),rr=Rt(yt);r(rr,()=>T(z)),Et(yt),ae(ce,Ve)},we=ce=>{r(ce,()=>T(z))};Yt(te,ce=>{T(p)?ce(Z):ce(we,!1)})}ae(P,K)}),ae(t,S),Sr({get host(){return a()},set host(P){a(P),J()},get onError(){return i()},set onError(P){i(P),J()},get flyoutId(){return o()},set flyoutId(P){o(P),J()},get flyoutIsOpen(){return s()},set flyoutIsOpen(P){s(P),J()}})}on(sc,{host:{},onError:{},flyoutId:{},flyoutIsOpen:{}},[],[],!0);function lc(t,e){xr(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=X(()=>({onclick:r(),buttonClass:n(),buttonStyle:a(),apiUrl:i(),forceTheme:o(),lang:s()}));return bs(t,{silent:!0,body:(d,p=ir)=>{sc(d,md({host:e.$$host,get onError(){return p()}},()=>T(c)))},$$slots:{body:!0}}),Sr({get onclick(){return r()},set onclick(l){r(l),J()},get buttonClass(){return n()},set buttonClass(l){n(l),J()},get buttonStyle(){return a()},set buttonStyle(l){a(l),J()},get apiUrl(){return i()},set apiUrl(l){i(l),J()},get forceTheme(){return o()},set forceTheme(l){o(l),J()},get lang(){return s()},set lang(l){s(l),J()}})}return customElements.define("liipgpt-button",on(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)),Wr.LiipGPTButton=lc,Object.defineProperty(Wr,Symbol.toStringTag,{value:"Module"}),Wr}({});
|
|
@@ -507,7 +507,7 @@ Please report this to https://github.com/markedjs/marked.`,t){const n="<p>An err
|
|
|
507
507
|
.sonner-loading-bar {transition:none !important;
|
|
508
508
|
animation: none !important;}
|
|
509
509
|
}.sonner-loader {position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);transform-origin:center;transition:opacity 200ms,
|
|
510
|
-
transform 200ms;}.sonner-loader[data-visible='false'] {opacity:0;transform:scale(0.8) translate(-50%, -50%);}`};function Jp(t,e){fe(e,!0),Xi(t,H_);function r(Q){return Q!=="system"?Q:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Vc:Cs}let n=v(e,"invert",7,!1),o=v(e,"position",7,"bottom-right"),a=v(e,"hotkey",23,()=>["altKey","KeyT"]),i=v(e,"expand",7,!1),s=v(e,"closeButton",7,!1),c=v(e,"offset",7,Bc),l=v(e,"mobileOffset",7,jc),d=v(e,"theme",7,"light"),m=v(e,"richColors",7,!1),p=v(e,"duration",7,Qp),b=v(e,"visibleToasts",7,Yp),h=v(e,"toastOptions",23,()=>({})),f=v(e,"dir",7,"auto"),y=v(e,"gap",7,Xp),w=v(e,"loadingIcon",7),S=v(e,"successIcon",7),x=v(e,"errorIcon",7),C=v(e,"warningIcon",7),A=v(e,"closeIcon",7),O=v(e,"infoIcon",7),T=v(e,"containerAriaLabel",7,"Notifications"),M=v(e,"class",7),q=v(e,"closeButtonAriaLabel",7,"Close toast"),V=v(e,"onblur",7),D=v(e,"onfocus",7),U=v(e,"onmouseenter",7),H=v(e,"onmousemove",7),z=v(e,"onmouseleave",7),X=v(e,"ondragend",7),re=v(e,"onpointerdown",7),te=v(e,"onpointerup",7),ne=it(e,["$$slots","$$events","$$legacy","$$host","invert","position","hotkey","expand","closeButton","offset","mobileOffset","theme","richColors","duration","visibleToasts","toastOptions","dir","gap","loadingIcon","successIcon","errorIcon","warningIcon","closeIcon","infoIcon","containerAriaLabel","class","closeButtonAriaLabel","onblur","onfocus","onmouseenter","onmousemove","onmouseleave","ondragend","onpointerdown","onpointerup"]);function oe(){if(f()!=="auto")return f();if(typeof window>"u"||typeof document>"u")return"ltr";const Q=document.documentElement.getAttribute("dir");return Q==="auto"||!Q?(Rt(()=>f(window.getComputedStyle(document.documentElement).direction??"ltr")),f()):(Rt(()=>f(Q)),Q)}const ae=I(()=>Array.from(new Set([o(),...Pt.toasts.filter(Q=>Q.position).map(Q=>Q.position)].filter(Boolean))));let ee=J(!1),$=J(!1),le=J(Yt(r(d()))),Y=J(void 0),ce=J(null),we=J(!1);const G=I(()=>a().join("+").replace(/Key/g,"").replace(/Digit/g,""));Ie(()=>{Pt.toasts.length<=1&&E(ee,!1)}),Ie(()=>{const Q=Pt.toasts.filter(me=>me.dismiss&&!me.delete);if(Q.length>0){const me=Pt.toasts.map(Le=>Q.find(Fe=>Fe.id===Le.id)?{...Le,delete:!0}:Le);Pt.toasts=me}}),Ie(()=>()=>{u(Y)&&u(ce)&&(u(ce).focus({preventScroll:!0}),E(ce,null),E(we,!1))}),Ro(()=>(Pt.reset(),Nt(document,"keydown",me=>{a().every(ie=>me[ie]||me.code===ie)&&(E(ee,!0),u(Y)?.focus()),me.code==="Escape"&&(document.activeElement===u(Y)||u(Y)?.contains(document.activeElement))&&E(ee,!1)}))),Ie(()=>{if(d()!=="system"&&E(le,d()),typeof window<"u"){d()==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?E(le,Vc):E(le,Cs));const Q=window.matchMedia("(prefers-color-scheme: dark)"),me=({matches:Le})=>{E(le,Le?Vc:Cs,!0)};"addEventListener"in Q?Q.addEventListener("change",me):Q.addListener(me)}});const Pe=Q=>{V()?.(Q),u(we)&&!Q.currentTarget.contains(Q.relatedTarget)&&(E(we,!1),u(ce)&&(u(ce).focus({preventScroll:!0}),E(ce,null)))},Se=Q=>{D()?.(Q),!(Q.target instanceof HTMLElement&&Q.target.dataset.dismissable==="false")&&(u(we)||(E(we,!0),E(ce,Q.relatedTarget,!0)))},ze=Q=>{re()?.(Q),!(Q.target instanceof HTMLElement&&Q.target.dataset.dismissable==="false")&&E($,!0)},Ne=Q=>{U()?.(Q),E(ee,!0)},je=Q=>{z()?.(Q),u($)||E(ee,!1)},Be=Q=>{H()?.(Q),E(ee,!0)},Ue=Q=>{X()?.(Q),E(ee,!1)},De=Q=>{te()?.(Q),E($,!1)};d_.set(new g_);var Qe=U_();ye(Qe,"tabindex",-1);var et=R(Qe);{var lt=Q=>{var me=B(),Le=L(me);Ht(Le,18,()=>u(ae),ie=>ie,(ie,Fe,ht,We)=>{var tt=V_();const wt=I(()=>{const[ft,yt]=Fe.split("-");return{y:ft,x:yt}}),He=I(()=>j_(c(),l()));Me(tt,(ft,yt)=>({tabindex:-1,dir:ft,class:M(),"data-sonner-toaster":!0,"data-sonner-theme":u(le),"data-y-position":u(wt).y,"data-x-position":u(wt).x,style:e.style,onblur:Pe,onfocus:Se,onmouseenter:Ne,onmousemove:Be,onmouseleave:je,ondragend:Ue,onpointerdown:ze,onpointerup:De,...ne,[aa]:yt}),[oe,()=>({"--front-toast-height":`${Pt.heights[0]?.height}px`,"--width":`${B_}px`,"--gap":`${y()}px`,"--offset-top":u(He)["--offset-top"],"--offset-right":u(He)["--offset-right"],"--offset-bottom":u(He)["--offset-bottom"],"--offset-left":u(He)["--offset-left"],"--mobile-offset-top":u(He)["--mobile-offset-top"],"--mobile-offset-right":u(He)["--mobile-offset-right"],"--mobile-offset-bottom":u(He)["--mobile-offset-bottom"],"--mobile-offset-left":u(He)["--mobile-offset-left"]})],void 0,"svelte-214svo"),Ht(tt,23,()=>Pt.toasts.filter(ft=>!ft.position&&u(ht)===0||ft.position===Fe),ft=>ft.id,(ft,yt,jt,qt)=>{{const Ft=at=>{var Ct=B(),sr=L(Ct);{var Sr=ct=>{var ot=B(),Lt=L(ot);ge(Lt,()=>S()??Ae),_(ct,ot)},Fr=ct=>{var ot=B(),Lt=L(ot);{var zr=rt=>{Wp(rt)};W(Lt,rt=>{S()!==null&&rt(zr)},!0)}_(ct,ot)};W(sr,ct=>{S()?ct(Sr):ct(Fr,!1)})}_(at,Ct)},St=at=>{var Ct=B(),sr=L(Ct);{var Sr=ct=>{var ot=B(),Lt=L(ot);ge(Lt,()=>x()??Ae),_(ct,ot)},Fr=ct=>{var ot=B(),Lt=L(ot);{var zr=rt=>{Kp(rt)};W(Lt,rt=>{x()!==null&&rt(zr)},!0)}_(ct,ot)};W(sr,ct=>{x()?ct(Sr):ct(Fr,!1)})}_(at,Ct)},Ve=at=>{var Ct=B(),sr=L(Ct);{var Sr=ct=>{var ot=B(),Lt=L(ot);ge(Lt,()=>C()??Ae),_(ct,ot)},Fr=ct=>{var ot=B(),Lt=L(ot);{var zr=rt=>{Gp(rt)};W(Lt,rt=>{C()!==null&&rt(zr)},!0)}_(ct,ot)};W(sr,ct=>{C()?ct(Sr):ct(Fr,!1)})}_(at,Ct)},ir=at=>{var Ct=B(),sr=L(Ct);{var Sr=ct=>{var ot=B(),Lt=L(ot);ge(Lt,()=>O()??Ae),_(ct,ot)},Fr=ct=>{var ot=B(),Lt=L(ot);{var zr=rt=>{$p(rt)};W(Lt,rt=>{O()!==null&&rt(zr)},!0)}_(ct,ot)};W(sr,ct=>{O()?ct(Sr):ct(Fr,!1)})}_(at,Ct)},yr=at=>{var Ct=B(),sr=L(Ct);{var Sr=ct=>{var ot=B(),Lt=L(ot);ge(Lt,()=>A()??Ae),_(ct,ot)},Fr=ct=>{var ot=B(),Lt=L(ot);{var zr=rt=>{Zp(rt)};W(Lt,rt=>{A()!==null&&rt(zr)},!0)}_(ct,ot)};W(sr,ct=>{A()?ct(Sr):ct(Fr,!1)})}_(at,Ct)};let nr=I(()=>h()?.duration??p()),Dr=I(()=>h()?.class??""),wr=I(()=>h()?.descriptionClass||""),oo=I(()=>h()?.style??""),de=I(()=>h().classes||{}),$e=I(()=>h().unstyled??!1),_t=I(()=>h()?.cancelButtonStyle??""),Ke=I(()=>h()?.actionButtonStyle??""),At=I(()=>h()?.closeButtonAriaLabel??q());qp(ft,{get index(){return u(jt)},get toast(){return u(yt)},get defaultRichColors(){return m()},get duration(){return u(nr)},get class(){return u(Dr)},get descriptionClass(){return u(wr)},get invert(){return n()},get visibleToasts(){return b()},get closeButton(){return s()},get interacting(){return u($)},get position(){return Fe},get style(){return u(oo)},get classes(){return u(de)},get unstyled(){return u($e)},get cancelButtonStyle(){return u(_t)},get actionButtonStyle(){return u(Ke)},get closeButtonAriaLabel(){return u(At)},get expandByDefault(){return i()},get expanded(){return u(ee)},get loadingIcon(){return w()},successIcon:Ft,errorIcon:St,warningIcon:Ve,infoIcon:ir,closeIcon:yr,$$slots:{successIcon:!0,errorIcon:!0,warningIcon:!0,infoIcon:!0,closeIcon:!0}})}}),P(tt),Bt(tt,ft=>E(Y,ft),()=>u(Y)),he(()=>tt.dir=tt.dir),_(ie,tt)}),_(Q,me)};W(et,Q=>{Pt.toasts.length>0&&Q(lt)})}return P(Qe),he(()=>ye(Qe,"aria-label",`${T()??""} ${u(G)??""}`)),_(t,Qe),pe({get invert(){return n()},set invert(Q=!1){n(Q),g()},get position(){return o()},set position(Q="bottom-right"){o(Q),g()},get hotkey(){return a()},set hotkey(Q=["altKey","KeyT"]){a(Q),g()},get expand(){return i()},set expand(Q=!1){i(Q),g()},get closeButton(){return s()},set closeButton(Q=!1){s(Q),g()},get offset(){return c()},set offset(Q=Bc){c(Q),g()},get mobileOffset(){return l()},set mobileOffset(Q=jc){l(Q),g()},get theme(){return d()},set theme(Q="light"){d(Q),g()},get richColors(){return m()},set richColors(Q=!1){m(Q),g()},get duration(){return p()},set duration(Q=Qp){p(Q),g()},get visibleToasts(){return b()},set visibleToasts(Q=Yp){b(Q),g()},get toastOptions(){return h()},set toastOptions(Q={}){h(Q),g()},get dir(){return f()},set dir(Q="auto"){f(Q),g()},get gap(){return y()},set gap(Q=Xp){y(Q),g()},get loadingIcon(){return w()},set loadingIcon(Q){w(Q),g()},get successIcon(){return S()},set successIcon(Q){S(Q),g()},get errorIcon(){return x()},set errorIcon(Q){x(Q),g()},get warningIcon(){return C()},set warningIcon(Q){C(Q),g()},get closeIcon(){return A()},set closeIcon(Q){A(Q),g()},get infoIcon(){return O()},set infoIcon(Q){O(Q),g()},get containerAriaLabel(){return T()},set containerAriaLabel(Q="Notifications"){T(Q),g()},get class(){return M()},set class(Q){M(Q),g()},get closeButtonAriaLabel(){return q()},set closeButtonAriaLabel(Q="Close toast"){q(Q),g()},get onblur(){return V()},set onblur(Q){V(Q),g()},get onfocus(){return D()},set onfocus(Q){D(Q),g()},get onmouseenter(){return U()},set onmouseenter(Q){U(Q),g()},get onmousemove(){return H()},set onmousemove(Q){H(Q),g()},get onmouseleave(){return z()},set onmouseleave(Q){z(Q),g()},get ondragend(){return X()},set ondragend(Q){X(Q),g()},get onpointerdown(){return re()},set onpointerdown(Q){re(Q),g()},get onpointerup(){return te()},set onpointerup(Q){te(Q),g()}})}ue(Jp,{invert:{},position:{},hotkey:{},expand:{},closeButton:{},offset:{},mobileOffset:{},theme:{},richColors:{},duration:{},visibleToasts:{},toastOptions:{},dir:{},gap:{},loadingIcon:{},successIcon:{},errorIcon:{},warningIcon:{},closeIcon:{},infoIcon:{},containerAriaLabel:{},class:{},closeButtonAriaLabel:{},onblur:{},onfocus:{},onmouseenter:{},onmousemove:{},onmouseleave:{},ondragend:{},onpointerdown:{},onpointerup:{}},[],[],!0);const q_=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)},W_=(t,e)=>{const r={};return e.forEach(n=>{r[n]=t[n]}),r},K_=console.warn,G_=()=>{},eg=(t,e)=>Rt(()=>{console.warn=G_;const r=e?W_(t,e):t,n=Li(r);return console.warn=K_,n}),$_=t=>t&&typeof t.then=="function";class Z_{config;self;devtools;stateKeys;constructor(e,r){this.config=e,this.self=r,typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__&&(this.stateKeys=q_(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 eg(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"?(...o)=>{if(!n)return Rt(()=>r.call(this.self,...o));const a=eg(o);this.sendStart(e,a);try{const i=Rt(()=>r.call(this.self,...o));return $_(i)?i.then(s=>(this.sendSuccess(e,a,s),s),s=>{throw this.sendError(e,a,s),s}):(this.sendSuccess(e,a,i),i)}catch(i){throw this.sendError(e,a,i),i}}:r}}const Y_=(t,e)=>{const r={},n=new Z_(t,r);return Object.keys(e).forEach(o=>{if(o==="state"||o==="name")return;const a=e[o];r[o]=n.createProxyFunction(o,a)}),r};async function Q_(){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 Uc(){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 tg(){return typeof window>"u"?!1:!!(window.MediaRecorder&&Uc())}function X_(){if(typeof window>"u")return!1;if("ontouchstart"in window||navigator.maxTouchPoints>0)return!0;const t=navigator.msMaxTouchPoints;return!!("msMaxTouchPoints"in navigator&&t&&t>0)}function ri(){return typeof window>"u"?!1:!!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||X_())}class Hc{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(!tg()||!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=Uc();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 o=new Error(`MediaRecorder error: ${n}`);this.options.onError?.(o),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 a=0;a<this.dataArray.length;a++)e+=this.dataArray[a]*this.dataArray[a];let n=Math.sqrt(e/this.dataArray.length)/255;n=Math.pow(n*3,.7);const o=Math.min(100,Math.max(0,Math.round(n*100)));this.options.onVolumeChange?.(o)},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 tg()}static getSupportedMediaType(){return Uc()}}const J_=t=>(localStorage.setItem("liipgpt-color-scheme",t),qc(["light","dark"])),rg=()=>{const t=localStorage.getItem("liipgpt-color-scheme");return t==="light"||t==="dark"?t:"system"},qc=t=>{let e=rg();return e==="system"&&(e=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),t.includes(e)?e:t[0]??"light"},e1=[{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)}],ng=t=>{for(const e of e1)if(e.check(t))return e.type},Wc="liipgpt:selectorValues",Kc="liipgpt:selectorKnownDefaults",og=()=>{try{const t=yn.getItem(Wc),e=yn.getItem(Kc);return t?{values:JSON.parse(t),knownDefaults:e?JSON.parse(e):{}}:null}catch{return null}},t1=t=>{const e={};for(const r of t)e[r.settingName]=r.defaultValues??(r.allowEmpty?[]:[r.values[0]]).filter(Boolean);return e},ag=(t,e)=>{try{const r=t1(e);yn.setItem(Wc,JSON.stringify(t)),yn.setItem(Kc,JSON.stringify(r))}catch(r){console.error("Failed to save selector values:",r)}},r1=t=>{try{const e=og();if(!e)return;delete e.values[t],delete e.knownDefaults[t],yn.setItem(Wc,JSON.stringify(e.values)),yn.setItem(Kc,JSON.stringify(e.knownDefaults))}catch(e){console.error("Failed to clear selector saved state:",e)}},n1=t=>{const e=og(),r=t.map(n=>{const o=n.defaultValues??(n.allowEmpty?[]:[n.values[0]]).filter(Boolean);if(!e?.values[n.settingName])return[n.settingName,o];const a=e.values[n.settingName],i=e.knownDefaults[n.settingName]||[],s=a.filter(p=>n.values.includes(p)),c=i.filter(p=>!o.includes(p)),l=s.filter(p=>!c.includes(p)),d=o.filter(p=>!i.includes(p)&&!l.includes(p)),m=[...l,...d];return m.length===0&&!n.allowEmpty?[n.settingName,o]:[n.settingName,m]});return Object.fromEntries(r)};class o1 extends Error{constructor(e){super(e),this.name="UnreachableError"}}const ig=(t,e)=>{const n=new URLSearchParams(window.location.search).get("q");return n?{name:"chat-page",query:n}:t&&!e?{name:"consent-page"}:{name:"start-page"}};class a1{#e=J(Yt({}));get data(){return u(this.#e)}set data(e){E(this.#e,e,!0)}#t=J(Yt({}));get targets(){return u(this.#t)}set targets(e){E(this.#t,e,!0)}#r=J(!1);get initialized(){return u(this.#r)}set initialized(e){E(this.#r,e,!0)}#n=J(0);get currentAudioVolume(){return u(this.#n)}set currentAudioVolume(e){E(this.#n,e,!0)}ariaLiveMessagesClearingTimeoutDuration=350;#o=J(null);get currentAudioRecorder(){return u(this.#o)}set currentAudioRecorder(e){E(this.#o,e,!0)}#a=J(!1);get isTranscribing(){return u(this.#a)}set isTranscribing(e){E(this.#a,e,!0)}#i=I(()=>{if(!this.initialized)return[];const e=this.data.chatConfig.menu;return e?e[this.data.language]??[]:[]});get menu(){return u(this.#i)}set menu(e){E(this.#i,e)}#s=I(()=>this.initialized?this.data.chatConfig.translations[this.data.language]??{}:{});get t(){return u(this.#s)}set t(e){E(this.#s,e)}#c=I(()=>this.initialized?Rp[this.data.language]??{}:Rp.en??{});get errorTranslations(){return u(this.#c)}set errorTranslations(e){E(this.#c,e)}#l=I(()=>this.initialized?Mp[this.data.language]??{}:Mp.en??{});get piiTranslations(){return u(this.#l)}set piiTranslations(e){E(this.#l,e)}#u=I(()=>this.initialized?this.data.currentColorScheme:"light");get colorScheme(){return u(this.#u)}set colorScheme(e){E(this.#u,e)}#d=I(()=>this.initialized?this.data.chatConfig.fullTheme[this.data.currentColorScheme]:{});get themeBase(){return u(this.#d)}set themeBase(e){E(this.#d,e)}#f=I(()=>this.themeBase.tokens);get theme(){return u(this.#f)}set theme(e){E(this.#f,e)}#h=I(()=>{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 u(this.#h)}set selectorsWithErrors(e){E(this.#h,e)}}const k=new a1;let ln,wn,sg;const Je=Y_({name:"chat-logic",state:k,excludeInDevTools:["onInput"]},{async init(t){wn=t;const e=wn.speechRecognitionApiKey||void 0;ln=new Fw({apiUrl:wn.apiUrl,apiKey:wn.apiKey,speechRecognitionApiKey:e,strict:!0});try{const r=await ln.getChatConfig();window.CHAT_CONFIG_OVERRIDE&&Object.assign(r,window.CHAT_CONFIG_OVERRIDE);const o=(await ln.getMetadata()).mode==="maintenance";o&&this.showErrorToast("maintenance");const a=Pp(r);wn.inlineLayout!==void 0&&(a.inlineLayout=wn.inlineLayout);let i;wn.lang?i=ks(wn.lang,a.supportedLanguages):i=zp(a.supportedLanguages),Fp(i,k.targets.mainElement);const s=await this.getPredefinedQuestions(i),c=[];if(a.renderKatex){const p=await import("https://esm.sh/marked-katex-extension@5.1.5").catch(b=>{console.error("Couldn't load marked-katex-extension:",b)});p&&(ln.setMarkedExtensions(p.default({nonStandard:!0,output:"mathml"})),c.push("https://cdn.jsdelivr.net/npm/katex@0.16.22/dist/katex.min.css"))}const l=Object.keys(a.fullTheme);let d=!1;if(a.forceConsent)try{d=yn.getItem("liipgpt:termsAccepted")==="true"}catch(p){console.warn("Failed to load terms acceptance from storage:",p)}k.data={currentConversationState:"idle",chatConfig:a,language:i,predefinedQuestions:s,isInMaintenance:o,history:[],selectedColorScheme:rg(),has2ColorSchemes:l.length===2,currentColorScheme:qc(l),conversationFeedbackId:void 0,conversationFeedbackIsOpen:!1,openedPopup:void 0,props:wn,flyoutIsOpen:!1,questionHasPii:void 0,chatInputValue:"",selectorValues:n1(a.selectorsConfig),selectorsIsOpen:!1,currentReferencesAsideId:void 0,ariaLiveStatusMessage:void 0,ariaLiveStatusMessageClearingTimeout:void 0,wasReferencesAsideClosed:!1,isAsideMobile:!0,route:ig(a.forceConsent??!1,d),additionalStylesheets:c,hasOpenedOverlays:!1,isInlineLayoutContained:!1,termsAccepted:d},window.LIIPGPT_LISTENERS?.route?.(k.data.route),window.LIIPGPT_LISTENERS?.conversation?.(k.data.currentConversationState),k.data.selectorsIsOpen=k.data.chatConfig.showExpandedSelectors??!1,k.initialized=!0,this.checkForOpenedPopup(),window.addEventListener("hashchange",()=>{this.checkForOpenedPopup()}),this.goto(ig(a.forceConsent??!1,d))}catch(r){throw zc.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){k.targets[t]=e},goto(t){if(!t_(k.data.route,t))switch(k.data.route=t,window.LIIPGPT_LISTENERS?.route?.(t),t.name){case"consent-page":break;case"start-page":t.prefill&&(k.data.chatInputValue=t.prefill);break;case"chat-page":if(k.data.chatInputValue=t.query,this.onSubmit(),k.data.chatConfig.addQueryToUrlParams){const e=new URLSearchParams(window.location.search);e.set("q",t.query),history.pushState(null,"",`?${e.toString()}`)}break}},getSelectorConfig(t){const e=k.data.chatConfig.selectorsConfig.find(r=>r.settingName===t);if(!e)throw new Error(`Setting ${t} not found`);return e},getPrettifiedSelectorValues(){const t=Object.entries(k.data.selectorValues).map(([e,r])=>{let n;try{n=this.getSelectorConfig(e)}catch(o){console.error(`Error getting selector config for ${e}: ${o}`);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}k.data.selectorValues[t]=e,ag(k.data.selectorValues,k.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 r1(t),k.data.selectorValues[t]=r,ag(k.data.selectorValues,k.data.chatConfig.selectorsConfig),r},async getPredefinedQuestions(t){try{return ln.getPredefinedQuestions({url:window.location.origin+window.location.pathname,language:t})}catch(e){return console.warn("Failed to load predefined questions:",e),[]}},setColorScheme(t){k.data.selectedColorScheme=t,k.data.currentColorScheme=J_(t),this.setAriaLiveStatusMessage(t==="dark"?k.t.ariaDarkSelected:k.t.ariaLightSelected)},async abort(){await sg?.abort()},changeConversationState(t){k.data.currentConversationState=t,window.LIIPGPT_LISTENERS?.conversation?.(t)},onInput(t){k.data.chatConfig.blockPII&&(k.data.questionHasPii=ng(t)),k.data.chatInputValue=t},onSubmit(t=!1){if(k.data.questionHasPii){console.warn("Question contains PII, not submitting:",k.data.questionHasPii);return}const e=k.data.chatConfig.questionPrefix?`${k.data.chatConfig.questionPrefix} ${k.data.chatInputValue}`:k.data.chatInputValue,r=k.data.history.push({type:"user",time:new Date().toISOString(),message:k.data.chatInputValue});k.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:wn.features?wn.features.trim().split(","):["formatting"],onError:d=>{this.showErrorToast(d),window.LIIPGPT_LISTENERS?.error?.(d),(d==="pii-detected"||d==="blocked")&&this.editLatestQuestion()},lang:k.data.language,selectorValues:this.getPrettifiedSelectorValues()},o=(d,m)=>{try{const p=new URL(d),b=new URL(m);return p.origin===b.origin&&p.pathname===b.pathname}catch{return!1}},a=k.data.chatConfig.sendReferrer??"all";if(["all","own","location"].includes(a)){const d=a==="location"||k.data.props.flyout;let m;d?m=`${window.location.protocol}//${window.location.host}${window.location.pathname}`:m=o(document.referrer,window.location.href)?null:document.referrer;const p=a==="own"&&!k.data.props.flyout&&m&&!m.startsWith(window.location.origin);n.referrer=m&&!p?m:void 0}k.data.currentConversationId||(k.data.currentConversationId=ln.createConversationId());const i=ln.chat(k.data.currentConversationId,e,n);sg=i,k.data.lastChatResponseId=i.id,k.data.currentConversationState!=="searching"&&this.changeConversationState("searching"),this.setAriaLiveStatusMessage(k.t.ariaQuestionSent);let s=!1,c;const l=!!k.data.currentReferencesAsideId;(t&&l||!t&&k.data.chatConfig.showReferencesByDefault)&&(k.data.isAsideMobile||this.openReferencesAside(i.id)),i.subscribe(d=>{if(k.data.history[r]&&(k.data.history[r]={question:k.data.chatInputValue,...d}),k.data.chatConfig.addRetrievalQuestionToUrlParams&&d.retrievalQuestion){const m=new URLSearchParams(window.location.search);m.get("search")!==d.retrievalQuestion&&(m.set("search",d.retrievalQuestion),history.replaceState(null,"",`?${m.toString()}`))}k.data.chatConfig.showReferencesByDefault&&!k.data.wasReferencesAsideClosed&&k.data.currentReferencesAsideId!==d.id&&!k.data.isAsideMobile&&this.openReferencesAside(d.id),d.state==="streaming"&&k.data.currentConversationState!=="answering"&&this.changeConversationState("answering"),d.state==="done"&&(this.changeConversationState("idle"),s||(s=!0,this.setAriaLiveStatusMessage(`${k.t.ariaAnswerReady} ... ${d.message.text} ... ${k.t.ariaAnswerFinished}`)),k.data.currentReferencesAsideId&&k.data.history[r].references.used.length>0?(clearTimeout(c),c=setTimeout(()=>{this.openReferencesAside(d.id)},100)):this.closeReferencesAside())}),k.data.chatInputValue=""},async onStartSpeechRecognition(){try{if(!await Q_()){this.showErrorToast("speech-not-supported");return}if(await navigator.mediaDevices.getUserMedia({audio:!0}),Hc.isSupported())k.data.chatInputValue="",k.currentAudioRecorder=new Hc({onDataAvailable:async e=>{k.isTranscribing=!0,await this.handleTranscription(e)},onError:()=>{this.showErrorToast("speech-microphone-access-denied"),k.currentAudioRecorder=null,k.isTranscribing=!1},onVolumeChange:e=>{k.currentAudioVolume=e}}),k.currentAudioRecorder.start();else{this.showErrorToast("speech-not-supported");return}}catch(t){throw this.showErrorToast("speech-microphone-access-denied"),k.currentAudioRecorder=null,k.isTranscribing=!1,t}},editLatestQuestion(){const t=k.data.history.findLastIndex(r=>r?.type==="user");if(t===-1){console.error("No last user question, available");return}const e=k.data.history.splice(t)[0];k.data.chatInputValue=e.message},onStopSpeechRecognition(){if(k.currentAudioRecorder){const t=k.currentAudioRecorder;k.currentAudioRecorder=null,t.stop()}k.currentAudioVolume=0},async handleTranscription(t){if(!t){console.warn("No audio data received");return}try{const e=await ln.transcribeAudio(t,{lang:k.data.language});if(e.error){this.showErrorToast("speech-transcription-failed");return}if(e.transcript.trim()){if(k.data.chatConfig.blockPII&&(k.data.questionHasPii=ng(e.transcript.trim()),k.data.questionHasPii))return;k.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{k.currentAudioRecorder=null,k.isTranscribing=!1,k.currentAudioVolume=0}},async onStartConversation(t){await this.abort(),k.data.history=[],k.data.currentConversationId=ln.createConversationId(),this.goto({name:"chat-page",query:t})},async onNewConversation(){if(await this.abort(),k.data.currentConversationId=void 0,k.data.currentReferencesAsideId=void 0,k.data.history=[],k.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){zc.success(k.t[t],{unstyled:!0,duration:3e3,classes:{toast:"toast"}})},showErrorToast(t){zc.error(k.errorTranslations[t],{unstyled:!0,duration:3e3,classes:{toast:"toast"}})},async submitFeedback(t){try{const e=k.data.conversationFeedbackId||k.data.lastChatResponseId;if(!e)throw new o1("Tried to give feedback with no id.");const r=k.data.history.find(n=>n.type==="bot"&&n.id===e);await ln.feedback(e,r?.question??"",t),setTimeout(()=>{this.showSuccessToast("thankYouForFeedback")},500)}catch(e){console.error("Feedback failed:",e),this.showErrorToast("feedback-failed")}},toggleReferencesAside(t){k.data.currentReferencesAsideId===t?this.closeReferencesAside():this.openReferencesAside(t)},openReferencesAside(t){k.data.currentReferencesAsideId=t,this.setOpenOverlay(!0)},closeReferencesAside(){k.data.currentReferencesAsideId=void 0,k.data.wasReferencesAsideClosed=!0,this.setOpenOverlay(!1)},setAsideMobile(t){k.data.isAsideMobile=t},openFlyout(){k.data.flyoutIsOpen=!0},closeFlyout(){k.data.flyoutIsOpen=!1},openConversationFeedback(){k.data.conversationFeedbackIsOpen=!0,this.setOpenOverlay(!0)},openMessageFeedback(t){k.data.conversationFeedbackId=t},closeFeedback(){k.data.conversationFeedbackIsOpen=!1,k.data.conversationFeedbackId=void 0,this.setOpenOverlay(!1)},setOpenOverlay(t){k.data.hasOpenedOverlays=t},setAriaLiveStatusMessage(t){k.data.ariaLiveStatusMessage=t,clearTimeout(k.data.ariaLiveStatusMessageClearingTimeout),k.data.ariaLiveStatusMessageClearingTimeout=setTimeout(()=>{k.data.ariaLiveStatusMessage=""},k.ariaLiveMessagesClearingTimeoutDuration)},closePopup(){window.location.hash=""},checkForOpenedPopup(){const t=window.location.hash.slice(1),e=k.t.popups?.find(r=>r.hash===t);e?k.data.openedPopup=e:k.data.openedPopup=void 0},async thumbs(t,e){try{const r=k.data.history.find(n=>n.type==="bot"&&n.id===t);e==="up"?await ln.thumbsUp(t,r?.question??""):await ln.thumbsDown(t,r?.question??""),this.showSuccessToast("thankYouForFeedback")}catch(r){console.error("Feedback failed:",r),this.showErrorToast("feedback-failed")}},async onLanguageChange(t){if(k.data.language=ks(t,k.data.chatConfig.supportedLanguages),Fp(k.data.language,k.targets.mainElement),k.data.predefinedQuestions=await this.getPredefinedQuestions(k.data.language),this.setAriaLiveStatusMessage(k.t.ariaLanguageChanged),k.data.chatConfig.reflectLanguageInPath){const e=new URL(window.location.href);e.pathname=`/${k.data.language}`,window.history.replaceState({},"",e.toString())}},async acceptTerms(){k.data.termsAccepted=!0;try{yn.setItem("liipgpt:termsAccepted","true")}catch(t){console.warn("Failed to save terms acceptance to storage:",t)}this.closePopup(),this.closeFlyout(),await Po(),this.goto({name:"start-page"})}}),Gc=(t,e)=>{const r=window.LIIPGPT_LISTENERS?.elements?.[e];if(!r)return;const n=Object.entries(r).filter(([o,a])=>typeof a=="function"&&!["init","destroy"].includes(o));Ie(()=>(r.init?.(t),n.forEach(([o,a])=>{t.addEventListener(o,a)}),()=>{n.forEach(([o,a])=>{t.removeEventListener(o,a)}),r.destroy?.(t)}))},Qn=(t,e)=>{e&&Je.setTarget(e,t)};var i1=j('<div role="status" class="sr-only"> </div>');function lg(t,e){fe(e,!1),pf();var r=i1(),n=R(r,!0);P(r),he(()=>xe(n,k.data.ariaLiveStatusMessage)),_(t,r),pe()}ue(lg,{},[],[],!0);var s1=j('<div aria-hidden="true"><!></div>');function kt(t,e){fe(e,!0);let r=v(e,"name",7),n=v(e,"class",7);var o=s1(),a=R(o);return Xt(a,()=>k.theme.svgs[r()]),P(o),he(()=>ut(o,1,`svg svg--${r()??""} ${n()??""}`)),_(t,o),pe({get name(){return r()},set name(i){r(i),g()},get class(){return n()},set class(i){n(i),g()}})}ue(kt,{name:{},class:{}},[],[],!0);const ni="data-disable-tooltip-on-focus";function va(t,e){let r=null,n;function o(){e.text&&(r||(r=document.createElement("span"),r.ariaHidden="true",r.textContent=e.text,r.className=`tooltip tooltip-${e.position||"top"} tooltip-hidden`,t.appendChild(r),r.getBoundingClientRect()),r.classList.remove("tooltip-hidden"),a())}function a(){if(!r)return;const l=t.getBoundingClientRect(),d=r.getBoundingClientRect();let m,p;switch(e.position){case"bottom":m=l.height+5,p=l.width/2-d.width/2;break;case"bottom-right":m=l.height+5,p=l.width-d.width;break;case"bottom-left":m=l.height+5,p=0;break;case"left":m=l.height/2-d.height/2,p=-d.width-5;break;case"right":m=l.height/2-d.height/2,p=l.width+5;break;case"top":default:m=-d.height-5,p=l.width/2-d.width/2;break}const b=l.left+p,h=b+d.width,f=window.innerWidth;if(h>f){const y=h-f;if(p-=y+10,e.position==="top"||e.position==="bottom"){const w=y+10;r.style.setProperty("--tooltip-arrow-offset",`${w}px`)}}if(b<0&&(p-=b-10,e.position==="top"||e.position==="bottom")){const y=b-10;r.style.setProperty("--tooltip-arrow-offset",`${y}px`)}r.style.top=`${m}px`,r.style.left=`${p}px`}function i(){n=window.setTimeout(()=>{o()},e.delay||200)}function s(l){const d=l.target;d&&!d.hasAttribute(ni)?i():d.removeAttribute(ni)}function c(){clearTimeout(n),r&&(r.classList.add("tooltip-hidden"),r.addEventListener("transitionend",()=>{r?.remove(),r=null},{once:!0}))}return t.classList.add("tooltip-container"),t.setAttribute("tabindex","0"),t.addEventListener("mouseenter",i),t.addEventListener("focus",s),t.addEventListener("mouseleave",c),t.addEventListener("blur",c),t.addEventListener("click",c),{update(l){e=l},destroy(){c(),t.classList.remove("tooltip-container"),t.removeEventListener("mouseenter",i),t.removeEventListener("focus",s),t.removeEventListener("mouseleave",c),t.removeEventListener("blur",c),t.removeEventListener("click",c)}}}var l1=j('<button><span class="sr-only"> </span> <span><!></span></button>');function Ts(t,e){fe(e,!0);let r=v(e,"class",7),n=v(e,"tooltip",7),o=v(e,"label",7),a=v(e,"onclick",7),i=v(e,"icon",7),s=it(e,["$$slots","$$events","$$legacy","$$host","class","tooltip","label","onclick","icon"]);var c=l1();Me(c,()=>({onclick:a(),...s}));var l=R(c),d=R(l,!0);P(l);var m=Z(l,2),p=R(m);return kt(p,{get name(){return i()}}),P(m),P(c),Wt(c,(b,h)=>va?.(b,h),()=>({text:n(),position:"top",delay:300})),he(()=>{xe(d,o()),ut(m,1,ar(r()))}),_(t,c),pe({get class(){return r()},set class(b){r(b),g()},get tooltip(){return n()},set tooltip(b){n(b),g()},get label(){return o()},set label(b){o(b),g()},get onclick(){return a()},set onclick(b){a(b),g()},get icon(){return i()},set icon(b){i(b),g()}})}ue(Ts,{class:{},tooltip:{},label:{},onclick:{},icon:{}},[],[],!0);function $c(t,e){fe(e,!0);let r=v(e,"href",7),n=v(e,"target",7),o=v(e,"onclick",7),a=v(e,"className",23,()=>[]),i=v(e,"isStandalone",7,!1),s=v(e,"children",7),c=v(e,"type",7,"button"),l=v(e,"class",7),d=it(e,["$$slots","$$events","$$legacy","$$host","href","target","onclick","className","isStandalone","children","type","class"]);const m=I(()=>r()?"a":"button"),p=I(()=>[...Array.isArray(a())?a():a()?[a()]:[],...l()?[l()]:[]]);var b=B(),h=L(b);return Vl(h,()=>u(m),!1,(f,y)=>{Me(f,x=>({...d,onclick:r()?void 0:o(),type:r()?void 0:c(),href:r(),role:r()?"link":"button",target:r()?n():void 0,class:u(p),[oa]:x}),[()=>({"open-button--standalone":i()})]);var w=B(),S=L(w);ge(S,s),_(y,w)}),_(t,b),pe({get href(){return r()},set href(f){r(f),g()},get target(){return n()},set target(f){n(f),g()},get onclick(){return o()},set onclick(f){o(f),g()},get className(){return a()},set className(f=[]){a(f),g()},get isStandalone(){return i()},set isStandalone(f=!1){i(f),g()},get children(){return s()},set children(f){s(f),g()},get type(){return c()},set type(f="button"){c(f),g()},get class(){return l()},set class(f){l(f),g()}})}ue($c,{href:{},target:{},onclick:{},className:{},isStandalone:{},children:{},type:{},class:{}},[],[],!0);const c1=Ye({caption:N().optional(),buttons:hr(Ye({label:N(),href:N().url().optional(),value:N(),variant:mo(["primary","secondary","tertiary"]).optional(),icon:N().optional(),target:N().optional()}))});var u1=j('<p class="embed-buttons__caption"><!></p>'),d1=j('<span class="btn__label"><!></span> <!>',1),h1=j('<div class="embed-buttons"><!> <div class="embed-buttons__buttons"></div></div>');function cg(t,e){fe(e,!0);let r=v(e,"data",7);var n=h1(),o=R(n);{var a=s=>{var c=u1(),l=R(c);Xt(l,()=>r().caption),P(c),_(s,c)};W(o,s=>{r().caption&&s(a)})}var i=Z(o,2);return Ht(i,21,()=>r().buttons,dr,(s,c)=>{{let l=I(()=>["btn",`btn--${u(c).variant??"primary"}`]);$c(s,{get href(){return u(c).href},get target(){return u(c).target},get className(){return u(l)},children:(d,m)=>{var p=d1(),b=L(p),h=R(b);Xt(h,()=>u(c).label),P(b);var f=Z(b,2);{var y=w=>{kt(w,{get name(){return u(c).icon}})};W(f,w=>{u(c).icon&&w(y)})}_(d,p)},$$slots:{default:!0}})}}),P(i),P(n),_(t,n),pe({get data(){return r()},set data(s){r(s),g()}})}ue(cg,{data:{}},[],[],!0);const f1=Object.freeze(Object.defineProperty({__proto__:null,dataSchema:c1,default:cg},Symbol.toStringTag,{value:"Module"}));function p1(t){return typeof t=="function"}function oi(t){return t!==null&&typeof t=="object"}const g1=["string","number","bigint","boolean"];function Zc(t){return t==null||g1.includes(typeof t)?!0:Array.isArray(t)?t.every(e=>Zc(e)):typeof t=="object"?Object.getPrototypeOf(t)===Object.prototype:!1}const ma=Symbol("box"),As=Symbol("is-writable");function K(t,e){const r=I(t);return e?{[ma]:!0,[As]:!0,get current(){return u(r)},set current(n){e(n)}}:{[ma]:!0,get current(){return t()}}}function ai(t){return oi(t)&&ma in t}function Yc(t){return ai(t)&&As in t}function ug(t){return ai(t)?t:p1(t)?K(t):Pn(t)}function v1(t){return Object.entries(t).reduce((e,[r,n])=>ai(n)?(Yc(n)?Object.defineProperty(e,r,{get(){return n.current},set(o){n.current=o}}):Object.defineProperty(e,r,{get(){return n.current}}),e):Object.assign(e,{[r]:n}),{})}function m1(t){return Yc(t)?{[ma]:!0,get current(){return t.current}}:t}function Pn(t){let e=J(Yt(t));return{[ma]:!0,[As]:!0,get current(){return u(e)},set current(r){E(e,r,!0)}}}function Fo(t){let e=J(Yt(t));return{[ma]:!0,[As]:!0,get current(){return u(e)},set current(r){E(e,r,!0)}}}Fo.from=ug,Fo.with=K,Fo.flatten=v1,Fo.readonly=m1,Fo.isBox=ai,Fo.isWritableBox=Yc;function dg(...t){return function(e){for(const r of t)if(r){if(e.defaultPrevented)return;typeof r=="function"?r.call(this,e):r.current?.call(this,e)}}}var ba={},Qc,hg;function b1(){if(hg)return Qc;hg=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,r=/^\s*/,n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,i=/^[;\s]*/,s=/^\s+|\s+$/g,c=`
|
|
510
|
+
transform 200ms;}.sonner-loader[data-visible='false'] {opacity:0;transform:scale(0.8) translate(-50%, -50%);}`};function Jp(t,e){fe(e,!0),Xi(t,H_);function r(Q){return Q!=="system"?Q:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Vc:Cs}let n=v(e,"invert",7,!1),o=v(e,"position",7,"bottom-right"),a=v(e,"hotkey",23,()=>["altKey","KeyT"]),i=v(e,"expand",7,!1),s=v(e,"closeButton",7,!1),c=v(e,"offset",7,Bc),l=v(e,"mobileOffset",7,jc),d=v(e,"theme",7,"light"),m=v(e,"richColors",7,!1),p=v(e,"duration",7,Qp),b=v(e,"visibleToasts",7,Yp),h=v(e,"toastOptions",23,()=>({})),f=v(e,"dir",7,"auto"),y=v(e,"gap",7,Xp),w=v(e,"loadingIcon",7),S=v(e,"successIcon",7),x=v(e,"errorIcon",7),C=v(e,"warningIcon",7),A=v(e,"closeIcon",7),O=v(e,"infoIcon",7),T=v(e,"containerAriaLabel",7,"Notifications"),M=v(e,"class",7),q=v(e,"closeButtonAriaLabel",7,"Close toast"),V=v(e,"onblur",7),D=v(e,"onfocus",7),U=v(e,"onmouseenter",7),H=v(e,"onmousemove",7),z=v(e,"onmouseleave",7),X=v(e,"ondragend",7),re=v(e,"onpointerdown",7),te=v(e,"onpointerup",7),ne=it(e,["$$slots","$$events","$$legacy","$$host","invert","position","hotkey","expand","closeButton","offset","mobileOffset","theme","richColors","duration","visibleToasts","toastOptions","dir","gap","loadingIcon","successIcon","errorIcon","warningIcon","closeIcon","infoIcon","containerAriaLabel","class","closeButtonAriaLabel","onblur","onfocus","onmouseenter","onmousemove","onmouseleave","ondragend","onpointerdown","onpointerup"]);function oe(){if(f()!=="auto")return f();if(typeof window>"u"||typeof document>"u")return"ltr";const Q=document.documentElement.getAttribute("dir");return Q==="auto"||!Q?(Rt(()=>f(window.getComputedStyle(document.documentElement).direction??"ltr")),f()):(Rt(()=>f(Q)),Q)}const ae=I(()=>Array.from(new Set([o(),...Pt.toasts.filter(Q=>Q.position).map(Q=>Q.position)].filter(Boolean))));let ee=J(!1),$=J(!1),le=J(Yt(r(d()))),Y=J(void 0),ce=J(null),we=J(!1);const G=I(()=>a().join("+").replace(/Key/g,"").replace(/Digit/g,""));Ie(()=>{Pt.toasts.length<=1&&E(ee,!1)}),Ie(()=>{const Q=Pt.toasts.filter(me=>me.dismiss&&!me.delete);if(Q.length>0){const me=Pt.toasts.map(Le=>Q.find(Fe=>Fe.id===Le.id)?{...Le,delete:!0}:Le);Pt.toasts=me}}),Ie(()=>()=>{u(Y)&&u(ce)&&(u(ce).focus({preventScroll:!0}),E(ce,null),E(we,!1))}),Ro(()=>(Pt.reset(),Nt(document,"keydown",me=>{a().every(ie=>me[ie]||me.code===ie)&&(E(ee,!0),u(Y)?.focus()),me.code==="Escape"&&(document.activeElement===u(Y)||u(Y)?.contains(document.activeElement))&&E(ee,!1)}))),Ie(()=>{if(d()!=="system"&&E(le,d()),typeof window<"u"){d()==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?E(le,Vc):E(le,Cs));const Q=window.matchMedia("(prefers-color-scheme: dark)"),me=({matches:Le})=>{E(le,Le?Vc:Cs,!0)};"addEventListener"in Q?Q.addEventListener("change",me):Q.addListener(me)}});const Pe=Q=>{V()?.(Q),u(we)&&!Q.currentTarget.contains(Q.relatedTarget)&&(E(we,!1),u(ce)&&(u(ce).focus({preventScroll:!0}),E(ce,null)))},Se=Q=>{D()?.(Q),!(Q.target instanceof HTMLElement&&Q.target.dataset.dismissable==="false")&&(u(we)||(E(we,!0),E(ce,Q.relatedTarget,!0)))},ze=Q=>{re()?.(Q),!(Q.target instanceof HTMLElement&&Q.target.dataset.dismissable==="false")&&E($,!0)},Ne=Q=>{U()?.(Q),E(ee,!0)},je=Q=>{z()?.(Q),u($)||E(ee,!1)},Be=Q=>{H()?.(Q),E(ee,!0)},Ue=Q=>{X()?.(Q),E(ee,!1)},De=Q=>{te()?.(Q),E($,!1)};d_.set(new g_);var Qe=U_();ye(Qe,"tabindex",-1);var et=R(Qe);{var lt=Q=>{var me=B(),Le=L(me);Ht(Le,18,()=>u(ae),ie=>ie,(ie,Fe,ht,We)=>{var tt=V_();const wt=I(()=>{const[ft,yt]=Fe.split("-");return{y:ft,x:yt}}),He=I(()=>j_(c(),l()));Me(tt,(ft,yt)=>({tabindex:-1,dir:ft,class:M(),"data-sonner-toaster":!0,"data-sonner-theme":u(le),"data-y-position":u(wt).y,"data-x-position":u(wt).x,style:e.style,onblur:Pe,onfocus:Se,onmouseenter:Ne,onmousemove:Be,onmouseleave:je,ondragend:Ue,onpointerdown:ze,onpointerup:De,...ne,[aa]:yt}),[oe,()=>({"--front-toast-height":`${Pt.heights[0]?.height}px`,"--width":`${B_}px`,"--gap":`${y()}px`,"--offset-top":u(He)["--offset-top"],"--offset-right":u(He)["--offset-right"],"--offset-bottom":u(He)["--offset-bottom"],"--offset-left":u(He)["--offset-left"],"--mobile-offset-top":u(He)["--mobile-offset-top"],"--mobile-offset-right":u(He)["--mobile-offset-right"],"--mobile-offset-bottom":u(He)["--mobile-offset-bottom"],"--mobile-offset-left":u(He)["--mobile-offset-left"]})],void 0,"svelte-214svo"),Ht(tt,23,()=>Pt.toasts.filter(ft=>!ft.position&&u(ht)===0||ft.position===Fe),ft=>ft.id,(ft,yt,jt,qt)=>{{const Ft=at=>{var Ct=B(),sr=L(Ct);{var Sr=ct=>{var ot=B(),Lt=L(ot);ge(Lt,()=>S()??Ae),_(ct,ot)},Fr=ct=>{var ot=B(),Lt=L(ot);{var zr=rt=>{Wp(rt)};W(Lt,rt=>{S()!==null&&rt(zr)},!0)}_(ct,ot)};W(sr,ct=>{S()?ct(Sr):ct(Fr,!1)})}_(at,Ct)},St=at=>{var Ct=B(),sr=L(Ct);{var Sr=ct=>{var ot=B(),Lt=L(ot);ge(Lt,()=>x()??Ae),_(ct,ot)},Fr=ct=>{var ot=B(),Lt=L(ot);{var zr=rt=>{Kp(rt)};W(Lt,rt=>{x()!==null&&rt(zr)},!0)}_(ct,ot)};W(sr,ct=>{x()?ct(Sr):ct(Fr,!1)})}_(at,Ct)},Ve=at=>{var Ct=B(),sr=L(Ct);{var Sr=ct=>{var ot=B(),Lt=L(ot);ge(Lt,()=>C()??Ae),_(ct,ot)},Fr=ct=>{var ot=B(),Lt=L(ot);{var zr=rt=>{Gp(rt)};W(Lt,rt=>{C()!==null&&rt(zr)},!0)}_(ct,ot)};W(sr,ct=>{C()?ct(Sr):ct(Fr,!1)})}_(at,Ct)},ir=at=>{var Ct=B(),sr=L(Ct);{var Sr=ct=>{var ot=B(),Lt=L(ot);ge(Lt,()=>O()??Ae),_(ct,ot)},Fr=ct=>{var ot=B(),Lt=L(ot);{var zr=rt=>{$p(rt)};W(Lt,rt=>{O()!==null&&rt(zr)},!0)}_(ct,ot)};W(sr,ct=>{O()?ct(Sr):ct(Fr,!1)})}_(at,Ct)},yr=at=>{var Ct=B(),sr=L(Ct);{var Sr=ct=>{var ot=B(),Lt=L(ot);ge(Lt,()=>A()??Ae),_(ct,ot)},Fr=ct=>{var ot=B(),Lt=L(ot);{var zr=rt=>{Zp(rt)};W(Lt,rt=>{A()!==null&&rt(zr)},!0)}_(ct,ot)};W(sr,ct=>{A()?ct(Sr):ct(Fr,!1)})}_(at,Ct)};let nr=I(()=>h()?.duration??p()),Dr=I(()=>h()?.class??""),wr=I(()=>h()?.descriptionClass||""),oo=I(()=>h()?.style??""),de=I(()=>h().classes||{}),$e=I(()=>h().unstyled??!1),_t=I(()=>h()?.cancelButtonStyle??""),Ke=I(()=>h()?.actionButtonStyle??""),At=I(()=>h()?.closeButtonAriaLabel??q());qp(ft,{get index(){return u(jt)},get toast(){return u(yt)},get defaultRichColors(){return m()},get duration(){return u(nr)},get class(){return u(Dr)},get descriptionClass(){return u(wr)},get invert(){return n()},get visibleToasts(){return b()},get closeButton(){return s()},get interacting(){return u($)},get position(){return Fe},get style(){return u(oo)},get classes(){return u(de)},get unstyled(){return u($e)},get cancelButtonStyle(){return u(_t)},get actionButtonStyle(){return u(Ke)},get closeButtonAriaLabel(){return u(At)},get expandByDefault(){return i()},get expanded(){return u(ee)},get loadingIcon(){return w()},successIcon:Ft,errorIcon:St,warningIcon:Ve,infoIcon:ir,closeIcon:yr,$$slots:{successIcon:!0,errorIcon:!0,warningIcon:!0,infoIcon:!0,closeIcon:!0}})}}),P(tt),Bt(tt,ft=>E(Y,ft),()=>u(Y)),he(()=>tt.dir=tt.dir),_(ie,tt)}),_(Q,me)};W(et,Q=>{Pt.toasts.length>0&&Q(lt)})}return P(Qe),he(()=>ye(Qe,"aria-label",`${T()??""} ${u(G)??""}`)),_(t,Qe),pe({get invert(){return n()},set invert(Q=!1){n(Q),g()},get position(){return o()},set position(Q="bottom-right"){o(Q),g()},get hotkey(){return a()},set hotkey(Q=["altKey","KeyT"]){a(Q),g()},get expand(){return i()},set expand(Q=!1){i(Q),g()},get closeButton(){return s()},set closeButton(Q=!1){s(Q),g()},get offset(){return c()},set offset(Q=Bc){c(Q),g()},get mobileOffset(){return l()},set mobileOffset(Q=jc){l(Q),g()},get theme(){return d()},set theme(Q="light"){d(Q),g()},get richColors(){return m()},set richColors(Q=!1){m(Q),g()},get duration(){return p()},set duration(Q=Qp){p(Q),g()},get visibleToasts(){return b()},set visibleToasts(Q=Yp){b(Q),g()},get toastOptions(){return h()},set toastOptions(Q={}){h(Q),g()},get dir(){return f()},set dir(Q="auto"){f(Q),g()},get gap(){return y()},set gap(Q=Xp){y(Q),g()},get loadingIcon(){return w()},set loadingIcon(Q){w(Q),g()},get successIcon(){return S()},set successIcon(Q){S(Q),g()},get errorIcon(){return x()},set errorIcon(Q){x(Q),g()},get warningIcon(){return C()},set warningIcon(Q){C(Q),g()},get closeIcon(){return A()},set closeIcon(Q){A(Q),g()},get infoIcon(){return O()},set infoIcon(Q){O(Q),g()},get containerAriaLabel(){return T()},set containerAriaLabel(Q="Notifications"){T(Q),g()},get class(){return M()},set class(Q){M(Q),g()},get closeButtonAriaLabel(){return q()},set closeButtonAriaLabel(Q="Close toast"){q(Q),g()},get onblur(){return V()},set onblur(Q){V(Q),g()},get onfocus(){return D()},set onfocus(Q){D(Q),g()},get onmouseenter(){return U()},set onmouseenter(Q){U(Q),g()},get onmousemove(){return H()},set onmousemove(Q){H(Q),g()},get onmouseleave(){return z()},set onmouseleave(Q){z(Q),g()},get ondragend(){return X()},set ondragend(Q){X(Q),g()},get onpointerdown(){return re()},set onpointerdown(Q){re(Q),g()},get onpointerup(){return te()},set onpointerup(Q){te(Q),g()}})}ue(Jp,{invert:{},position:{},hotkey:{},expand:{},closeButton:{},offset:{},mobileOffset:{},theme:{},richColors:{},duration:{},visibleToasts:{},toastOptions:{},dir:{},gap:{},loadingIcon:{},successIcon:{},errorIcon:{},warningIcon:{},closeIcon:{},infoIcon:{},containerAriaLabel:{},class:{},closeButtonAriaLabel:{},onblur:{},onfocus:{},onmouseenter:{},onmousemove:{},onmouseleave:{},ondragend:{},onpointerdown:{},onpointerup:{}},[],[],!0);const q_=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)},W_=(t,e)=>{const r={};return e.forEach(n=>{r[n]=t[n]}),r},K_=console.warn,G_=()=>{},eg=(t,e)=>Rt(()=>{console.warn=G_;const r=e?W_(t,e):t,n=Li(r);return console.warn=K_,n}),$_=t=>t&&typeof t.then=="function";class Z_{config;self;devtools;stateKeys;constructor(e,r){this.config=e,this.self=r,typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__&&(this.stateKeys=q_(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 eg(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"?(...o)=>{if(!n)return Rt(()=>r.call(this.self,...o));const a=eg(o);this.sendStart(e,a);try{const i=Rt(()=>r.call(this.self,...o));return $_(i)?i.then(s=>(this.sendSuccess(e,a,s),s),s=>{throw this.sendError(e,a,s),s}):(this.sendSuccess(e,a,i),i)}catch(i){throw this.sendError(e,a,i),i}}:r}}const Y_=(t,e)=>{const r={},n=new Z_(t,r);return Object.keys(e).forEach(o=>{if(o==="state"||o==="name")return;const a=e[o];r[o]=n.createProxyFunction(o,a)}),r};async function Q_(){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 Uc(){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 tg(){return typeof window>"u"?!1:!!(window.MediaRecorder&&Uc())}function X_(){if(typeof window>"u")return!1;if("ontouchstart"in window||navigator.maxTouchPoints>0)return!0;const t=navigator.msMaxTouchPoints;return!!("msMaxTouchPoints"in navigator&&t&&t>0)}function ri(){return typeof window>"u"?!1:!!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||X_())}class Hc{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(!tg()||!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=Uc();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 o=new Error(`MediaRecorder error: ${n}`);this.options.onError?.(o),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 a=0;a<this.dataArray.length;a++)e+=this.dataArray[a]*this.dataArray[a];let n=Math.sqrt(e/this.dataArray.length)/255;n=Math.pow(n*3,.7);const o=Math.min(100,Math.max(0,Math.round(n*100)));this.options.onVolumeChange?.(o)},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 tg()}static getSupportedMediaType(){return Uc()}}const J_=t=>(localStorage.setItem("liipgpt-color-scheme",t),qc(["light","dark"])),rg=()=>{const t=localStorage.getItem("liipgpt-color-scheme");return t==="light"||t==="dark"?t:"system"},qc=t=>{let e=rg();return e==="system"&&(e=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),t.includes(e)?e:t[0]??"light"},e1=[{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)}],ng=t=>{for(const e of e1)if(e.check(t))return e.type},Wc="liipgpt:selectorValues",Kc="liipgpt:selectorKnownDefaults",og=()=>{try{const t=yn.getItem(Wc),e=yn.getItem(Kc);return t?{values:JSON.parse(t),knownDefaults:e?JSON.parse(e):{}}:null}catch{return null}},t1=t=>{const e={};for(const r of t)e[r.settingName]=r.defaultValues??(r.allowEmpty?[]:[r.values[0]]).filter(Boolean);return e},ag=(t,e)=>{try{const r=t1(e);yn.setItem(Wc,JSON.stringify(t)),yn.setItem(Kc,JSON.stringify(r))}catch(r){console.error("Failed to save selector values:",r)}},r1=t=>{try{const e=og();if(!e)return;delete e.values[t],delete e.knownDefaults[t],yn.setItem(Wc,JSON.stringify(e.values)),yn.setItem(Kc,JSON.stringify(e.knownDefaults))}catch(e){console.error("Failed to clear selector saved state:",e)}},n1=t=>{const e=og(),r=t.map(n=>{const o=n.defaultValues??(n.allowEmpty?[]:[n.values[0]]).filter(Boolean);if(!e?.values[n.settingName])return[n.settingName,o];const a=e.values[n.settingName],i=e.knownDefaults[n.settingName]||[],s=a.filter(p=>n.values.includes(p)),c=i.filter(p=>!o.includes(p)),l=s.filter(p=>!c.includes(p)),d=o.filter(p=>!i.includes(p)&&!l.includes(p)),m=[...l,...d];return m.length===0&&!n.allowEmpty?[n.settingName,o]:[n.settingName,m]});return Object.fromEntries(r)};class o1 extends Error{constructor(e){super(e),this.name="UnreachableError"}}const ig=(t,e)=>{const n=new URLSearchParams(window.location.search).get("q");return n?{name:"chat-page",query:n}:t&&!e?{name:"consent-page"}:{name:"start-page"}};class a1{#e=J(Yt({}));get data(){return u(this.#e)}set data(e){E(this.#e,e,!0)}#t=J(Yt({}));get targets(){return u(this.#t)}set targets(e){E(this.#t,e,!0)}#r=J(!1);get initialized(){return u(this.#r)}set initialized(e){E(this.#r,e,!0)}#n=J(0);get currentAudioVolume(){return u(this.#n)}set currentAudioVolume(e){E(this.#n,e,!0)}ariaLiveMessagesClearingTimeoutDuration=350;#o=J(null);get currentAudioRecorder(){return u(this.#o)}set currentAudioRecorder(e){E(this.#o,e,!0)}#a=J(!1);get isTranscribing(){return u(this.#a)}set isTranscribing(e){E(this.#a,e,!0)}#i=I(()=>{if(!this.initialized)return[];const e=this.data.chatConfig.menu;return e?e[this.data.language]??[]:[]});get menu(){return u(this.#i)}set menu(e){E(this.#i,e)}#s=I(()=>this.initialized?this.data.chatConfig.translations[this.data.language]??{}:{});get t(){return u(this.#s)}set t(e){E(this.#s,e)}#c=I(()=>this.initialized?Rp[this.data.language]??{}:Rp.en??{});get errorTranslations(){return u(this.#c)}set errorTranslations(e){E(this.#c,e)}#l=I(()=>this.initialized?Mp[this.data.language]??{}:Mp.en??{});get piiTranslations(){return u(this.#l)}set piiTranslations(e){E(this.#l,e)}#u=I(()=>this.initialized?this.data.currentColorScheme:"light");get colorScheme(){return u(this.#u)}set colorScheme(e){E(this.#u,e)}#d=I(()=>this.initialized?this.data.chatConfig.fullTheme[this.data.currentColorScheme]:{});get themeBase(){return u(this.#d)}set themeBase(e){E(this.#d,e)}#f=I(()=>this.themeBase.tokens);get theme(){return u(this.#f)}set theme(e){E(this.#f,e)}#h=I(()=>{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 u(this.#h)}set selectorsWithErrors(e){E(this.#h,e)}}const k=new a1;let ln,wn,sg;const Je=Y_({name:"chat-logic",state:k,excludeInDevTools:["onInput"]},{async init(t){wn=t;const e=wn.speechRecognitionApiKey||void 0;ln=new Fw({apiUrl:wn.apiUrl,apiKey:wn.apiKey,speechRecognitionApiKey:e,strict:!0});try{const r=await ln.getChatConfig();window.CHAT_CONFIG_OVERRIDE&&Object.assign(r,window.CHAT_CONFIG_OVERRIDE);const o=(await ln.getMetadata()).mode==="maintenance";o&&this.showErrorToast("maintenance");const a=Pp(r);wn.inlineLayout!==void 0&&(a.inlineLayout=wn.inlineLayout);let i;wn.lang?i=ks(wn.lang,a.supportedLanguages):i=zp(a.supportedLanguages),Fp(i,k.targets.mainElement);const s=await this.getPredefinedQuestions(i),c=[];if(a.renderKatex){const p=await import("https://esm.sh/marked-katex-extension@5.1.5").catch(b=>{console.error("Couldn't load marked-katex-extension:",b)});p&&(ln.setMarkedExtensions(p.default({nonStandard:!0,output:"mathml"})),c.push("https://cdn.jsdelivr.net/npm/katex@0.16.22/dist/katex.min.css"))}const l=Object.keys(a.fullTheme);let d=!1;if(a.forceConsent)try{d=yn.getItem("liipgpt:termsAccepted")==="true"}catch(p){console.warn("Failed to load terms acceptance from storage:",p)}k.data={currentConversationState:"idle",chatConfig:a,language:i,predefinedQuestions:s,isInMaintenance:o,history:[],selectedColorScheme:rg(),has2ColorSchemes:l.length===2,currentColorScheme:qc(l),conversationFeedbackId:void 0,conversationFeedbackIsOpen:!1,openedPopup:void 0,props:wn,flyoutIsOpen:!1,questionHasPii:void 0,chatInputValue:"",selectorValues:n1(a.selectorsConfig),selectorsIsOpen:!1,currentReferencesAsideId:void 0,ariaLiveStatusMessage:void 0,ariaLiveStatusMessageClearingTimeout:void 0,wasReferencesAsideClosed:!1,isAsideMobile:!0,route:ig(a.forceConsent??!1,d),additionalStylesheets:c,hasOpenedOverlays:!1,isInlineLayoutContained:!1,termsAccepted:d},window.LIIPGPT_LISTENERS?.route?.(k.data.route),window.LIIPGPT_LISTENERS?.conversation?.(k.data.currentConversationState),k.data.selectorsIsOpen=k.data.chatConfig.showExpandedSelectors??!1,k.initialized=!0,this.checkForOpenedPopup(),window.addEventListener("hashchange",()=>{this.checkForOpenedPopup()}),this.goto(ig(a.forceConsent??!1,d),!0)}catch(r){throw zc.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){k.targets[t]=e},goto(t,e=!1){if(!(!e&&t_(k.data.route,t)))switch(k.data.route=t,window.LIIPGPT_LISTENERS?.route?.(t),t.name){case"consent-page":break;case"start-page":t.prefill&&(k.data.chatInputValue=t.prefill);break;case"chat-page":if(k.data.chatInputValue=t.query,this.onSubmit(),k.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=k.data.chatConfig.selectorsConfig.find(r=>r.settingName===t);if(!e)throw new Error(`Setting ${t} not found`);return e},getPrettifiedSelectorValues(){const t=Object.entries(k.data.selectorValues).map(([e,r])=>{let n;try{n=this.getSelectorConfig(e)}catch(o){console.error(`Error getting selector config for ${e}: ${o}`);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}k.data.selectorValues[t]=e,ag(k.data.selectorValues,k.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 r1(t),k.data.selectorValues[t]=r,ag(k.data.selectorValues,k.data.chatConfig.selectorsConfig),r},async getPredefinedQuestions(t){try{return ln.getPredefinedQuestions({url:window.location.origin+window.location.pathname,language:t})}catch(e){return console.warn("Failed to load predefined questions:",e),[]}},setColorScheme(t){k.data.selectedColorScheme=t,k.data.currentColorScheme=J_(t),this.setAriaLiveStatusMessage(t==="dark"?k.t.ariaDarkSelected:k.t.ariaLightSelected)},async abort(){await sg?.abort()},changeConversationState(t){k.data.currentConversationState=t,window.LIIPGPT_LISTENERS?.conversation?.(t)},onInput(t){k.data.chatConfig.blockPII&&(k.data.questionHasPii=ng(t)),k.data.chatInputValue=t},onSubmit(t=!1){if(k.data.questionHasPii){console.warn("Question contains PII, not submitting:",k.data.questionHasPii);return}const e=k.data.chatConfig.questionPrefix?`${k.data.chatConfig.questionPrefix} ${k.data.chatInputValue}`:k.data.chatInputValue,r=k.data.history.push({type:"user",time:new Date().toISOString(),message:k.data.chatInputValue});k.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:wn.features?wn.features.trim().split(","):["formatting"],onError:d=>{this.showErrorToast(d),window.LIIPGPT_LISTENERS?.error?.(d),(d==="pii-detected"||d==="blocked")&&this.editLatestQuestion()},lang:k.data.language,selectorValues:this.getPrettifiedSelectorValues()},o=(d,m)=>{try{const p=new URL(d),b=new URL(m);return p.origin===b.origin&&p.pathname===b.pathname}catch{return!1}},a=k.data.chatConfig.sendReferrer??"all";if(["all","own","location"].includes(a)){const d=a==="location"||k.data.props.flyout;let m;d?m=`${window.location.protocol}//${window.location.host}${window.location.pathname}`:m=o(document.referrer,window.location.href)?null:document.referrer;const p=a==="own"&&!k.data.props.flyout&&m&&!m.startsWith(window.location.origin);n.referrer=m&&!p?m:void 0}k.data.currentConversationId||(k.data.currentConversationId=ln.createConversationId());const i=ln.chat(k.data.currentConversationId,e,n);sg=i,k.data.lastChatResponseId=i.id,k.data.currentConversationState!=="searching"&&this.changeConversationState("searching"),this.setAriaLiveStatusMessage(k.t.ariaQuestionSent);let s=!1,c;const l=!!k.data.currentReferencesAsideId;(t&&l||!t&&k.data.chatConfig.showReferencesByDefault)&&(k.data.isAsideMobile||this.openReferencesAside(i.id)),i.subscribe(d=>{if(k.data.history[r]&&(k.data.history[r]={question:k.data.chatInputValue,...d}),k.data.chatConfig.addRetrievalQuestionToUrlParams&&d.retrievalQuestion){const m=new URLSearchParams(window.location.search);m.get("search")!==d.retrievalQuestion&&(m.set("search",d.retrievalQuestion),history.replaceState(null,"",`?${m.toString()}`))}k.data.chatConfig.showReferencesByDefault&&!k.data.wasReferencesAsideClosed&&k.data.currentReferencesAsideId!==d.id&&!k.data.isAsideMobile&&this.openReferencesAside(d.id),d.state==="streaming"&&k.data.currentConversationState!=="answering"&&this.changeConversationState("answering"),d.state==="done"&&(this.changeConversationState("idle"),s||(s=!0,this.setAriaLiveStatusMessage(`${k.t.ariaAnswerReady} ... ${d.message.text} ... ${k.t.ariaAnswerFinished}`)),k.data.currentReferencesAsideId&&k.data.history[r].references.used.length>0?(clearTimeout(c),c=setTimeout(()=>{this.openReferencesAside(d.id)},100)):this.closeReferencesAside())}),k.data.chatInputValue=""},async onStartSpeechRecognition(){try{if(!await Q_()){this.showErrorToast("speech-not-supported");return}if(await navigator.mediaDevices.getUserMedia({audio:!0}),Hc.isSupported())k.data.chatInputValue="",k.currentAudioRecorder=new Hc({onDataAvailable:async e=>{k.isTranscribing=!0,await this.handleTranscription(e)},onError:()=>{this.showErrorToast("speech-microphone-access-denied"),k.currentAudioRecorder=null,k.isTranscribing=!1},onVolumeChange:e=>{k.currentAudioVolume=e}}),k.currentAudioRecorder.start();else{this.showErrorToast("speech-not-supported");return}}catch(t){throw this.showErrorToast("speech-microphone-access-denied"),k.currentAudioRecorder=null,k.isTranscribing=!1,t}},editLatestQuestion(){const t=k.data.history.findLastIndex(r=>r?.type==="user");if(t===-1){console.error("No last user question, available");return}const e=k.data.history.splice(t)[0];k.data.chatInputValue=e.message},onStopSpeechRecognition(){if(k.currentAudioRecorder){const t=k.currentAudioRecorder;k.currentAudioRecorder=null,t.stop()}k.currentAudioVolume=0},async handleTranscription(t){if(!t){console.warn("No audio data received");return}try{const e=await ln.transcribeAudio(t,{lang:k.data.language});if(e.error){this.showErrorToast("speech-transcription-failed");return}if(e.transcript.trim()){if(k.data.chatConfig.blockPII&&(k.data.questionHasPii=ng(e.transcript.trim()),k.data.questionHasPii))return;k.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{k.currentAudioRecorder=null,k.isTranscribing=!1,k.currentAudioVolume=0}},async onStartConversation(t){await this.abort(),k.data.history=[],k.data.currentConversationId=ln.createConversationId(),this.goto({name:"chat-page",query:t})},async onNewConversation(){if(await this.abort(),k.data.currentConversationId=void 0,k.data.currentReferencesAsideId=void 0,k.data.history=[],k.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){zc.success(k.t[t],{unstyled:!0,duration:3e3,classes:{toast:"toast"}})},showErrorToast(t){zc.error(k.errorTranslations[t],{unstyled:!0,duration:3e3,classes:{toast:"toast"}})},async submitFeedback(t){try{const e=k.data.conversationFeedbackId||k.data.lastChatResponseId;if(!e)throw new o1("Tried to give feedback with no id.");const r=k.data.history.find(n=>n.type==="bot"&&n.id===e);await ln.feedback(e,r?.question??"",t),setTimeout(()=>{this.showSuccessToast("thankYouForFeedback")},500)}catch(e){console.error("Feedback failed:",e),this.showErrorToast("feedback-failed")}},toggleReferencesAside(t){k.data.currentReferencesAsideId===t?this.closeReferencesAside():this.openReferencesAside(t)},openReferencesAside(t){k.data.currentReferencesAsideId=t,this.setOpenOverlay(!0)},closeReferencesAside(){k.data.currentReferencesAsideId=void 0,k.data.wasReferencesAsideClosed=!0,this.setOpenOverlay(!1)},setAsideMobile(t){k.data.isAsideMobile=t},openFlyout(){k.data.flyoutIsOpen=!0},closeFlyout(){k.data.flyoutIsOpen=!1},openConversationFeedback(){k.data.conversationFeedbackIsOpen=!0,this.setOpenOverlay(!0)},openMessageFeedback(t){k.data.conversationFeedbackId=t},closeFeedback(){k.data.conversationFeedbackIsOpen=!1,k.data.conversationFeedbackId=void 0,this.setOpenOverlay(!1)},setOpenOverlay(t){k.data.hasOpenedOverlays=t},setAriaLiveStatusMessage(t){k.data.ariaLiveStatusMessage=t,clearTimeout(k.data.ariaLiveStatusMessageClearingTimeout),k.data.ariaLiveStatusMessageClearingTimeout=setTimeout(()=>{k.data.ariaLiveStatusMessage=""},k.ariaLiveMessagesClearingTimeoutDuration)},closePopup(){window.location.hash=""},checkForOpenedPopup(){const t=window.location.hash.slice(1),e=k.t.popups?.find(r=>r.hash===t);e?k.data.openedPopup=e:k.data.openedPopup=void 0},async thumbs(t,e){try{const r=k.data.history.find(n=>n.type==="bot"&&n.id===t);e==="up"?await ln.thumbsUp(t,r?.question??""):await ln.thumbsDown(t,r?.question??""),this.showSuccessToast("thankYouForFeedback")}catch(r){console.error("Feedback failed:",r),this.showErrorToast("feedback-failed")}},async onLanguageChange(t){if(k.data.language=ks(t,k.data.chatConfig.supportedLanguages),Fp(k.data.language,k.targets.mainElement),k.data.predefinedQuestions=await this.getPredefinedQuestions(k.data.language),this.setAriaLiveStatusMessage(k.t.ariaLanguageChanged),k.data.chatConfig.reflectLanguageInPath){const e=new URL(window.location.href);e.pathname=`/${k.data.language}`,window.history.replaceState({},"",e.toString())}},async acceptTerms(){k.data.termsAccepted=!0;try{yn.setItem("liipgpt:termsAccepted","true")}catch(t){console.warn("Failed to save terms acceptance to storage:",t)}this.closePopup(),this.closeFlyout(),await Po(),this.goto({name:"start-page"})}}),Gc=(t,e)=>{const r=window.LIIPGPT_LISTENERS?.elements?.[e];if(!r)return;const n=Object.entries(r).filter(([o,a])=>typeof a=="function"&&!["init","destroy"].includes(o));Ie(()=>(r.init?.(t),n.forEach(([o,a])=>{t.addEventListener(o,a)}),()=>{n.forEach(([o,a])=>{t.removeEventListener(o,a)}),r.destroy?.(t)}))},Qn=(t,e)=>{e&&Je.setTarget(e,t)};var i1=j('<div role="status" class="sr-only"> </div>');function lg(t,e){fe(e,!1),pf();var r=i1(),n=R(r,!0);P(r),he(()=>xe(n,k.data.ariaLiveStatusMessage)),_(t,r),pe()}ue(lg,{},[],[],!0);var s1=j('<div aria-hidden="true"><!></div>');function kt(t,e){fe(e,!0);let r=v(e,"name",7),n=v(e,"class",7);var o=s1(),a=R(o);return Xt(a,()=>k.theme.svgs[r()]),P(o),he(()=>ut(o,1,`svg svg--${r()??""} ${n()??""}`)),_(t,o),pe({get name(){return r()},set name(i){r(i),g()},get class(){return n()},set class(i){n(i),g()}})}ue(kt,{name:{},class:{}},[],[],!0);const ni="data-disable-tooltip-on-focus";function va(t,e){let r=null,n;function o(){e.text&&(r||(r=document.createElement("span"),r.ariaHidden="true",r.textContent=e.text,r.className=`tooltip tooltip-${e.position||"top"} tooltip-hidden`,t.appendChild(r),r.getBoundingClientRect()),r.classList.remove("tooltip-hidden"),a())}function a(){if(!r)return;const l=t.getBoundingClientRect(),d=r.getBoundingClientRect();let m,p;switch(e.position){case"bottom":m=l.height+5,p=l.width/2-d.width/2;break;case"bottom-right":m=l.height+5,p=l.width-d.width;break;case"bottom-left":m=l.height+5,p=0;break;case"left":m=l.height/2-d.height/2,p=-d.width-5;break;case"right":m=l.height/2-d.height/2,p=l.width+5;break;case"top":default:m=-d.height-5,p=l.width/2-d.width/2;break}const b=l.left+p,h=b+d.width,f=window.innerWidth;if(h>f){const y=h-f;if(p-=y+10,e.position==="top"||e.position==="bottom"){const w=y+10;r.style.setProperty("--tooltip-arrow-offset",`${w}px`)}}if(b<0&&(p-=b-10,e.position==="top"||e.position==="bottom")){const y=b-10;r.style.setProperty("--tooltip-arrow-offset",`${y}px`)}r.style.top=`${m}px`,r.style.left=`${p}px`}function i(){n=window.setTimeout(()=>{o()},e.delay||200)}function s(l){const d=l.target;d&&!d.hasAttribute(ni)?i():d.removeAttribute(ni)}function c(){clearTimeout(n),r&&(r.classList.add("tooltip-hidden"),r.addEventListener("transitionend",()=>{r?.remove(),r=null},{once:!0}))}return t.classList.add("tooltip-container"),t.setAttribute("tabindex","0"),t.addEventListener("mouseenter",i),t.addEventListener("focus",s),t.addEventListener("mouseleave",c),t.addEventListener("blur",c),t.addEventListener("click",c),{update(l){e=l},destroy(){c(),t.classList.remove("tooltip-container"),t.removeEventListener("mouseenter",i),t.removeEventListener("focus",s),t.removeEventListener("mouseleave",c),t.removeEventListener("blur",c),t.removeEventListener("click",c)}}}var l1=j('<button><span class="sr-only"> </span> <span><!></span></button>');function Ts(t,e){fe(e,!0);let r=v(e,"class",7),n=v(e,"tooltip",7),o=v(e,"label",7),a=v(e,"onclick",7),i=v(e,"icon",7),s=it(e,["$$slots","$$events","$$legacy","$$host","class","tooltip","label","onclick","icon"]);var c=l1();Me(c,()=>({onclick:a(),...s}));var l=R(c),d=R(l,!0);P(l);var m=Z(l,2),p=R(m);return kt(p,{get name(){return i()}}),P(m),P(c),Wt(c,(b,h)=>va?.(b,h),()=>({text:n(),position:"top",delay:300})),he(()=>{xe(d,o()),ut(m,1,ar(r()))}),_(t,c),pe({get class(){return r()},set class(b){r(b),g()},get tooltip(){return n()},set tooltip(b){n(b),g()},get label(){return o()},set label(b){o(b),g()},get onclick(){return a()},set onclick(b){a(b),g()},get icon(){return i()},set icon(b){i(b),g()}})}ue(Ts,{class:{},tooltip:{},label:{},onclick:{},icon:{}},[],[],!0);function $c(t,e){fe(e,!0);let r=v(e,"href",7),n=v(e,"target",7),o=v(e,"onclick",7),a=v(e,"className",23,()=>[]),i=v(e,"isStandalone",7,!1),s=v(e,"children",7),c=v(e,"type",7,"button"),l=v(e,"class",7),d=it(e,["$$slots","$$events","$$legacy","$$host","href","target","onclick","className","isStandalone","children","type","class"]);const m=I(()=>r()?"a":"button"),p=I(()=>[...Array.isArray(a())?a():a()?[a()]:[],...l()?[l()]:[]]);var b=B(),h=L(b);return Vl(h,()=>u(m),!1,(f,y)=>{Me(f,x=>({...d,onclick:r()?void 0:o(),type:r()?void 0:c(),href:r(),role:r()?"link":"button",target:r()?n():void 0,class:u(p),[oa]:x}),[()=>({"open-button--standalone":i()})]);var w=B(),S=L(w);ge(S,s),_(y,w)}),_(t,b),pe({get href(){return r()},set href(f){r(f),g()},get target(){return n()},set target(f){n(f),g()},get onclick(){return o()},set onclick(f){o(f),g()},get className(){return a()},set className(f=[]){a(f),g()},get isStandalone(){return i()},set isStandalone(f=!1){i(f),g()},get children(){return s()},set children(f){s(f),g()},get type(){return c()},set type(f="button"){c(f),g()},get class(){return l()},set class(f){l(f),g()}})}ue($c,{href:{},target:{},onclick:{},className:{},isStandalone:{},children:{},type:{},class:{}},[],[],!0);const c1=Ye({caption:N().optional(),buttons:hr(Ye({label:N(),href:N().url().optional(),value:N(),variant:mo(["primary","secondary","tertiary"]).optional(),icon:N().optional(),target:N().optional()}))});var u1=j('<p class="embed-buttons__caption"><!></p>'),d1=j('<span class="btn__label"><!></span> <!>',1),h1=j('<div class="embed-buttons"><!> <div class="embed-buttons__buttons"></div></div>');function cg(t,e){fe(e,!0);let r=v(e,"data",7);var n=h1(),o=R(n);{var a=s=>{var c=u1(),l=R(c);Xt(l,()=>r().caption),P(c),_(s,c)};W(o,s=>{r().caption&&s(a)})}var i=Z(o,2);return Ht(i,21,()=>r().buttons,dr,(s,c)=>{{let l=I(()=>["btn",`btn--${u(c).variant??"primary"}`]);$c(s,{get href(){return u(c).href},get target(){return u(c).target},get className(){return u(l)},children:(d,m)=>{var p=d1(),b=L(p),h=R(b);Xt(h,()=>u(c).label),P(b);var f=Z(b,2);{var y=w=>{kt(w,{get name(){return u(c).icon}})};W(f,w=>{u(c).icon&&w(y)})}_(d,p)},$$slots:{default:!0}})}}),P(i),P(n),_(t,n),pe({get data(){return r()},set data(s){r(s),g()}})}ue(cg,{data:{}},[],[],!0);const f1=Object.freeze(Object.defineProperty({__proto__:null,dataSchema:c1,default:cg},Symbol.toStringTag,{value:"Module"}));function p1(t){return typeof t=="function"}function oi(t){return t!==null&&typeof t=="object"}const g1=["string","number","bigint","boolean"];function Zc(t){return t==null||g1.includes(typeof t)?!0:Array.isArray(t)?t.every(e=>Zc(e)):typeof t=="object"?Object.getPrototypeOf(t)===Object.prototype:!1}const ma=Symbol("box"),As=Symbol("is-writable");function K(t,e){const r=I(t);return e?{[ma]:!0,[As]:!0,get current(){return u(r)},set current(n){e(n)}}:{[ma]:!0,get current(){return t()}}}function ai(t){return oi(t)&&ma in t}function Yc(t){return ai(t)&&As in t}function ug(t){return ai(t)?t:p1(t)?K(t):Pn(t)}function v1(t){return Object.entries(t).reduce((e,[r,n])=>ai(n)?(Yc(n)?Object.defineProperty(e,r,{get(){return n.current},set(o){n.current=o}}):Object.defineProperty(e,r,{get(){return n.current}}),e):Object.assign(e,{[r]:n}),{})}function m1(t){return Yc(t)?{[ma]:!0,get current(){return t.current}}:t}function Pn(t){let e=J(Yt(t));return{[ma]:!0,[As]:!0,get current(){return u(e)},set current(r){E(e,r,!0)}}}function Fo(t){let e=J(Yt(t));return{[ma]:!0,[As]:!0,get current(){return u(e)},set current(r){E(e,r,!0)}}}Fo.from=ug,Fo.with=K,Fo.flatten=v1,Fo.readonly=m1,Fo.isBox=ai,Fo.isWritableBox=Yc;function dg(...t){return function(e){for(const r of t)if(r){if(e.defaultPrevented)return;typeof r=="function"?r.call(this,e):r.current?.call(this,e)}}}var ba={},Qc,hg;function b1(){if(hg)return Qc;hg=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,r=/^\s*/,n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,i=/^[;\s]*/,s=/^\s+|\s+$/g,c=`
|
|
511
511
|
`,l="/",d="*",m="",p="comment",b="declaration";Qc=function(f,y){if(typeof f!="string")throw new TypeError("First argument must be a string");if(!f)return[];y=y||{};var w=1,S=1;function x(H){var z=H.match(e);z&&(w+=z.length);var X=H.lastIndexOf(c);S=~X?H.length-X:S+H.length}function C(){var H={line:w,column:S};return function(z){return z.position=new A(H),M(),z}}function A(H){this.start=H,this.end={line:w,column:S},this.source=y.source}A.prototype.content=f;function O(H){var z=new Error(y.source+":"+w+":"+S+": "+H);if(z.reason=H,z.filename=y.source,z.line=w,z.column=S,z.source=f,!y.silent)throw z}function T(H){var z=H.exec(f);if(z){var X=z[0];return x(X),f=f.slice(X.length),z}}function M(){T(r)}function q(H){var z;for(H=H||[];z=V();)z!==!1&&H.push(z);return H}function V(){var H=C();if(!(l!=f.charAt(0)||d!=f.charAt(1))){for(var z=2;m!=f.charAt(z)&&(d!=f.charAt(z)||l!=f.charAt(z+1));)++z;if(z+=2,m===f.charAt(z-1))return O("End of comment missing");var X=f.slice(2,z-2);return S+=2,x(X),f=f.slice(z),S+=2,H({type:p,comment:X})}}function D(){var H=C(),z=T(n);if(z){if(V(),!T(o))return O("property missing ':'");var X=T(a),re=H({type:b,property:h(z[0].replace(t,m)),value:X?h(X[0].replace(t,m)):m});return T(i),re}}function U(){var H=[];q(H);for(var z;z=D();)z!==!1&&(H.push(z),q(H));return H}return M(),U()};function h(f){return f?f.replace(s,m):m}return Qc}var fg;function y1(){if(fg)return ba;fg=1;var t=ba&&ba.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(ba,"__esModule",{value:!0}),ba.default=r;var e=t(b1());function r(n,o){var a=null;if(!n||typeof n!="string")return a;var i=(0,e.default)(n),s=typeof o=="function";return i.forEach(function(c){if(c.type==="declaration"){var l=c.property,d=c.value;s?o(l,d,c):d&&(a=a||{},a[l]=d)}}),a}return ba}var w1=y1();const pg=Ic(w1),_1=pg.default||pg,x1=/\d/,k1=["-","_","/","."];function S1(t=""){if(!x1.test(t))return t!==t.toLowerCase()}function C1(t){const e=[];let r="",n,o;for(const a of t){const i=k1.includes(a);if(i===!0){e.push(r),r="",n=void 0;continue}const s=S1(a);if(o===!1){if(n===!1&&s===!0){e.push(r),r=a,n=s;continue}if(n===!0&&s===!1&&r.length>1){const c=r.at(-1);e.push(r.slice(0,Math.max(0,r.length-1))),r=c+a,n=s;continue}}r+=a,n=s,o=i}return e.push(r),e}function gg(t){return t?C1(t).map(e=>A1(e)).join(""):""}function T1(t){return E1(gg(t||""))}function A1(t){return t?t[0].toUpperCase()+t.slice(1):""}function E1(t){return t?t[0].toLowerCase()+t.slice(1):""}function ii(t){if(!t)return{};const e={};function r(n,o){if(n.startsWith("-moz-")||n.startsWith("-webkit-")||n.startsWith("-ms-")||n.startsWith("-o-")){e[gg(n)]=o;return}if(n.startsWith("--")){e[n]=o;return}e[T1(n)]=o}return _1(t,r),e}function zo(...t){return(...e)=>{for(const r of t)typeof r=="function"&&r(...e)}}function O1(t,e){const r=RegExp(t,"g");return n=>{if(typeof n!="string")throw new TypeError(`expected an argument of type string, but got ${typeof n}`);return n.match(r)?n.replace(r,e):n}}const I1=O1(/[A-Z]/,t=>`-${t.toLowerCase()}`);function P1(t){if(!t||typeof t!="object"||Array.isArray(t))throw new TypeError(`expected an argument of type object, but got ${typeof t}`);return Object.keys(t).map(e=>`${I1(e)}: ${t[e]};`).join(`
|
|
512
512
|
`)}function Xc(t={}){return P1(t).replace(`
|
|
513
513
|
`," ")}const R1=["onabort","onanimationcancel","onanimationend","onanimationiteration","onanimationstart","onauxclick","onbeforeinput","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncompositionend","oncompositionstart","oncompositionupdate","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onfocusin","onfocusout","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onselectionchange","onselectstart","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitioncancel","ontransitionend","ontransitionrun","ontransitionstart","onvolumechange","onwaiting","onwebkitanimationend","onwebkitanimationiteration","onwebkitanimationstart","onwebkittransitionend","onwheel"],M1=new Set(R1);function L1(t){return M1.has(t)}function dt(...t){const e={...t[0]};for(let r=1;r<t.length;r++){const n=t[r];if(n){for(const o of Object.keys(n)){const a=e[o],i=n[o],s=typeof a=="function",c=typeof i=="function";if(s&&L1(o)){const l=a,d=i;e[o]=dg(l,d)}else if(s&&c)e[o]=zo(a,i);else if(o==="class"){const l=Zc(a),d=Zc(i);l&&d?e[o]=Ji(a,i):l?e[o]=Ji(a):d&&(e[o]=Ji(i))}else if(o==="style"){const l=typeof a=="object",d=typeof i=="object",m=typeof a=="string",p=typeof i=="string";if(l&&d)e[o]={...a,...i};else if(l&&p){const b=ii(i);e[o]={...a,...b}}else if(m&&d){const b=ii(a);e[o]={...b,...i}}else if(m&&p){const b=ii(a),h=ii(i);e[o]={...b,...h}}else l?e[o]=a:d?e[o]=i:m?e[o]=a:p&&(e[o]=i)}else e[o]=i!==void 0?i:a}for(const o of Object.getOwnPropertySymbols(n)){const a=e[o],i=n[o];e[o]=i!==void 0?i:a}}}return typeof e.style=="object"&&(e.style=Xc(e.style).replaceAll(`
|