@liip/liipgpt 3.13.0 → 3.14.0-rc.2

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.
Files changed (77) hide show
  1. package/button/de-BaNjE_3M.js +9 -0
  2. package/button/en-BjftSbKm.js +9 -0
  3. package/button/fr-B1oh1nWw.js +9 -0
  4. package/button/it-Ca-_bxt0.js +9 -0
  5. package/button/liipgpt-button.iife.js +9 -9
  6. package/button/liipgpt-button.js +2 -30
  7. package/chat/button-or-link-KjqNe5XC.js +2 -0
  8. package/chat/chat-logic.svelte-C5-qxoSD.js +62 -0
  9. package/chat/chat-panel-DoyX36Ux.js +167 -0
  10. package/chat/de-CFZ6ZknZ.js +9 -0
  11. package/chat/en-sKi7mJoR.js +9 -0
  12. package/chat/fr-DQD-_4bG.js +9 -0
  13. package/chat/it-DDb48nfd.js +9 -0
  14. package/chat/liipgpt-chat.iife.js +175 -167
  15. package/chat/liipgpt-chat.js +3 -547
  16. package/chat/load-default-translations-BsDQXCPO.js +301 -0
  17. package/configurator/_app/env.js +1 -1
  18. package/configurator/_app/immutable/chunks/6QxjtaMo.js +1 -0
  19. package/configurator/_app/immutable/chunks/7NDngRQo.js +16 -0
  20. package/configurator/_app/immutable/chunks/{BMJ5aYRa.js → B6mcd5gu.js} +1 -1
  21. package/configurator/_app/immutable/chunks/BEfnCtbB2.js +1 -0
  22. package/configurator/_app/immutable/chunks/B_FUTopa.js +8 -0
  23. package/configurator/_app/immutable/chunks/BjxmHIml2.js +1 -0
  24. package/configurator/_app/immutable/chunks/{BJVrdkuG.js → BnXjA2kT.js} +1 -1
  25. package/configurator/_app/immutable/chunks/{CbotzAWM.js → C1vsjZB2.js} +3 -3
  26. package/configurator/_app/immutable/chunks/C9_9vTHd2.js +2 -0
  27. package/configurator/_app/immutable/chunks/CBwwroGv2.js +1 -0
  28. package/configurator/_app/immutable/chunks/CUKdJCx6.js +1 -0
  29. package/configurator/_app/immutable/chunks/ClwMV5T02.js +1 -0
  30. package/configurator/_app/immutable/chunks/D63FM6dK.js +8 -0
  31. package/configurator/_app/immutable/chunks/DFgR2o_I.js +2 -0
  32. package/configurator/_app/immutable/chunks/DIQK1dMk.js +1 -0
  33. package/configurator/_app/immutable/chunks/DSItGtCS.js +8 -0
  34. package/configurator/_app/immutable/chunks/DUR8K4eS.js +1 -0
  35. package/configurator/_app/immutable/chunks/DWlD7QTs2.js +1 -0
  36. package/configurator/_app/immutable/chunks/Di7P1jW32.js +2 -0
  37. package/configurator/_app/immutable/chunks/Do9AxEGi.js +1 -0
  38. package/configurator/_app/immutable/chunks/{k-nJVsgE.js → Dytw-4aS.js} +1 -1
  39. package/configurator/_app/immutable/chunks/HfoaPmLk.js +1 -0
  40. package/configurator/_app/immutable/chunks/IhqdV4A8.js +8 -0
  41. package/configurator/_app/immutable/chunks/pncTt4Yg2.js +151 -0
  42. package/configurator/_app/immutable/chunks/uNnF9TU1.js +1 -0
  43. package/configurator/_app/immutable/chunks/wezic_7b.js +1 -0
  44. package/configurator/_app/immutable/chunks/{Dy0FGVSs.js → zr2aj7F2.js} +1 -1
  45. package/configurator/_app/immutable/entry/{app.BHBkpDs8.js → app.BN6PGfis.js} +2 -2
  46. package/configurator/_app/immutable/entry/start.iFfzR7Rm.js +1 -0
  47. package/configurator/_app/immutable/nodes/{0.DLWEcFHQ.js → 0.CF-EkZ9f.js} +2 -2
  48. package/configurator/_app/immutable/nodes/{1.KI8fWs2N.js → 1.DfSQXnmw.js} +1 -1
  49. package/configurator/_app/immutable/nodes/{2.B59b_gVk.js → 2.3h6m1CY9.js} +5 -5
  50. package/configurator/_app/immutable/nodes/{3.DN70KT-c.js → 3.DTW3YJra.js} +1 -1
  51. package/configurator/_app/version.json +1 -1
  52. package/configurator/index.html +6 -6
  53. package/configurator/sidebar.html +6 -6
  54. package/package.json +1 -1
  55. package/search-summary/de-DSJEm_-6.js +9 -0
  56. package/search-summary/en-DcveItl-.js +9 -0
  57. package/search-summary/fr-DIui1QQv.js +9 -0
  58. package/search-summary/it-DBGHJRn2.js +9 -0
  59. package/search-summary/liipgpt-search-summary.iife.js +16 -16
  60. package/search-summary/liipgpt-search-summary.js +2 -2
  61. package/search-summary/load-chat-config-CWy7GTVl.js +299 -0
  62. package/search-summary/{translations-utils-J0hLe4am.js → translations-utils-i7vxmHnL.js} +1 -1
  63. package/configurator/_app/immutable/chunks/BBWpG1hF.js +0 -1
  64. package/configurator/_app/immutable/chunks/BKRBEPI5.js +0 -143
  65. package/configurator/_app/immutable/chunks/BndQp4ie.js +0 -1
  66. package/configurator/_app/immutable/chunks/C6xrTJ8-.js +0 -1
  67. package/configurator/_app/immutable/chunks/DHHLckcz.js +0 -1
  68. package/configurator/_app/immutable/chunks/DLkzrfsn.js +0 -2
  69. package/configurator/_app/immutable/chunks/DeKAuPLN.js +0 -1
  70. package/configurator/_app/immutable/chunks/DmZKIk3Y.js +0 -1
  71. package/configurator/_app/immutable/chunks/MqTIsSeD.js +0 -1
  72. package/configurator/_app/immutable/chunks/Q68dKsWV.js +0 -16
  73. package/configurator/_app/immutable/chunks/hJTLHSgs.js +0 -29
  74. package/configurator/_app/immutable/entry/start._nmsyr-e.js +0 -1
  75. package/search-summary/load-chat-config-C0gjKjFi.js +0 -327
  76. /package/configurator/_app/immutable/chunks/{CNNudH1c.js → DFocG2Q_2.js} +0 -0
  77. /package/configurator/_app/immutable/chunks/{I5DxyXWx.js → Dq7Zntjw.js} +0 -0
@@ -1,4 +1,4 @@
1
- import{A as e,J as t,Lt as n,Mt as r,Rt as i,U as a,X as o,Y as s,i as c,nt as l,o as u,tt as d,xt as f}from"./DK3lEKRX.js";import{t as p}from"./BBWpG1hF.js";import{t as m}from"./Dy0FGVSs.js";var h=(e,t)=>{let n=new URLSearchParams(m.url.searchParams);t===void 0?n.delete(e):n.set(e,String(t));let r=`?${n.toString()}`;window.top&&window.top.postMessage(`liipgpt-url:`+r,`*`),p(r,{replaceState:!0})},g=e=>{let t=new URLSearchParams(m.url.searchParams);for(let[n,r]of Object.entries(e))r===void 0?t.delete(n):t.set(n,String(r));let n=`?${t.toString()}`;window.top&&window.top.postMessage(`liipgpt-url:`+n,`*`),p(n,{replaceState:!0})},_=o(`<button type="button" class="sidebar-hide svelte-q6hwt7" aria-label="Hide sidebar">Hide sidebar</button>`),v=o(`<button type="button" class="sidebar-reopen svelte-q6hwt7" aria-label="Show sidebar"><span class="sidebar-reopen__label svelte-q6hwt7" aria-hidden="true">Show sidebar</span></button>`),y={hash:`svelte-q6hwt7`,code:`.sidebar-hide.svelte-q6hwt7 {display:block;padding:0.375rem 0.75rem;border:1px solid #e5e7eb;border-radius:0.375rem;background:#fff;color:#4b5563;font-weight:500;font-size:0.75rem;line-height:1.25;font-family:system-ui, sans-serif;cursor:pointer;}.sidebar-hide.svelte-q6hwt7:hover {background:#f3f4f6;color:#111827;}.sidebar-reopen.svelte-q6hwt7 {display:flex;z-index:50;position:fixed;bottom:5rem;left:0;align-items:center;justify-content:center;padding:0.5rem 0.25rem;border:1px solid #e5e7eb;border-left:none;border-radius:0 0.375rem 0.375rem 0;background:#fff;box-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1),
1
+ import{A as e,J as t,Lt as n,Mt as r,Rt as i,U as a,X as o,Y as s,i as c,nt as l,o as u,tt as d,xt as f}from"./DK3lEKRX.js";import{t as p}from"./CUKdJCx6.js";import{t as m}from"./zr2aj7F2.js";var h=(e,t)=>{let n=new URLSearchParams(m.url.searchParams);t===void 0?n.delete(e):n.set(e,String(t));let r=`?${n.toString()}`;window.top&&window.top.postMessage(`liipgpt-url:`+r,`*`),p(r,{replaceState:!0})},g=e=>{let t=new URLSearchParams(m.url.searchParams);for(let[n,r]of Object.entries(e))r===void 0?t.delete(n):t.set(n,String(r));let n=`?${t.toString()}`;window.top&&window.top.postMessage(`liipgpt-url:`+n,`*`),p(n,{replaceState:!0})},_=o(`<button type="button" class="sidebar-hide svelte-q6hwt7" aria-label="Hide sidebar">Hide sidebar</button>`),v=o(`<button type="button" class="sidebar-reopen svelte-q6hwt7" aria-label="Show sidebar"><span class="sidebar-reopen__label svelte-q6hwt7" aria-hidden="true">Show sidebar</span></button>`),y={hash:`svelte-q6hwt7`,code:`.sidebar-hide.svelte-q6hwt7 {display:block;padding:0.375rem 0.75rem;border:1px solid #e5e7eb;border-radius:0.375rem;background:#fff;color:#4b5563;font-weight:500;font-size:0.75rem;line-height:1.25;font-family:system-ui, sans-serif;cursor:pointer;}.sidebar-hide.svelte-q6hwt7:hover {background:#f3f4f6;color:#111827;}.sidebar-reopen.svelte-q6hwt7 {display:flex;z-index:50;position:fixed;bottom:5rem;left:0;align-items:center;justify-content:center;padding:0.5rem 0.25rem;border:1px solid #e5e7eb;border-left:none;border-radius:0 0.375rem 0.375rem 0;background:#fff;box-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1),
2
2
  0 1px 2px -1px rgb(0 0 0 / 0.1);color:#4b5563;font-weight:500;font-size:0.6rem;font-family:system-ui, sans-serif;cursor:pointer;}.sidebar-reopen.svelte-q6hwt7:hover {background:#f3f4f6;color:#111827;}.sidebar-reopen__label.svelte-q6hwt7 {letter-spacing:0.04em;text-orientation:mixed;writing-mode:vertical-rl;}
3
3
 
4
4
  @media (prefers-color-scheme: dark) {.sidebar-hide.svelte-q6hwt7 {border-color:#4b5563;background:#1f2937;color:#d1d5db;}.sidebar-hide.svelte-q6hwt7:hover {background:#374151;color:#f3f4f6;}.sidebar-reopen.svelte-q6hwt7 {border-color:#4b5563;background:#1f2937;color:#d1d5db;}.sidebar-reopen.svelte-q6hwt7:hover {background:#374151;color:#f3f4f6;}
@@ -0,0 +1 @@
1
+ import{B as e,Dt as t,Gt as n,J as r,K as i,Lt as a,Mt as o,Rt as s,St as c,Tt as l,U as u,V as d,W as f,X as p,Y as m,bt as h,ct as ee,i as g,j as te,kt as _,mt as v,n as ne,o as y,ot as b,rt as re,s as ie,u as x,v as ae,xt as S,yt as oe,z as C}from"./DK3lEKRX.js";import{a as se,i as ce,t as le}from"./DFgR2o_I.js";import{n as ue,o as de}from"./BnXjA2kT.js";import{t as w}from"./HfoaPmLk.js";import{t as fe}from"./6QxjtaMo.js";import{n as T,t as E}from"./Dq7Zntjw.js";import{t as pe}from"./BjxmHIml2.js";var me=`@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}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;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-feature-settings:normal;font-variation-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}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{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}: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}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{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{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}.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;--z-index-below:-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}.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,select){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,select)::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 ::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:0 0}.chat-app ::-webkit-scrollbar-thumb{background-color:#0000004d;border-radius:4px;transition:background-color .2s}.chat-app ::-webkit-scrollbar-thumb:hover{background-color:#00000080}.chat-app *{scrollbar-color:#0000004d transparent;scrollbar-width:thin}.chat-app ::-webkit-scrollbar-thumb{visibility:hidden}.chat-app :hover::-webkit-scrollbar-thumb{visibility:visible}.chat-app :active::-webkit-scrollbar-thumb{visibility:visible}.chat-app :focus::-webkit-scrollbar-thumb{visibility:visible}.svg{width:var(--spacer-r-24);height:auto}.svg svg{width:100%;height:auto;display:block;overflow:visible}}@layer utilities{.chat-app :where(.expand-interaction){position:relative}.chat-app :where(.expand-interaction):after{content:"";background-color:#0000;position:absolute;inset:0}.chat-app :where(.sr-only){clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.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){width:0;height:0;color:var(--anchor-color);font-weight:700;font-size:var(--base-font-size-xs);position:absolute;overflow:hidden}.chat-app :where(.skip-link):focus-visible{width:auto;height:auto;position:static}.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){opacity:1;transition-delay:calc(var(--fly-in-delay) + var(--fly-in-id) * var(--fly-in-delay-additional));transition-duration:var(--fly-in-duration);transform:translateY(0)}.chat-app :where(.truncate){text-overflow:ellipsis;white-space:nowrap;display:inline-block;overflow:hidden}.chat-app :where(.line-clamp){-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.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);padding-right:var(--spacer-16);padding-left:var(--spacer-16);margin:0 auto}@container chat-container (width>=640px){.chat-app :where(.container){padding-right:var(--spacer-32);padding-left:var(--spacer-32)}}@container chat-container (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){margin-bottom:var(--spacer-r-24);display:block}.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-type:decimal;list-style-position:outside}.chat-app :where(.text-container)>:where(ul:not(.no-list-styling))>:where(li){padding-left:1em;position:relative}.chat-app :where(.text-container)>:where(ul:not(.no-list-styling))>:where(li):before{content:"•";font-size:.9em;position:absolute;top:0;left:0}.chat-app :where(.text-container)>:where(hr){height:1px;margin:var(--spacer-r-40) 0;background-color:var(--color-grey-700);background-color:var(--hr-color);border:none}.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){border-collapse:collapse;border-spacing:0;-webkit-overflow-scrolling:touch;width:100%;display:block;overflow-x:auto}.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 components{.chat-app{display:contents}.chat-app__container{height:100%;display:flex;overflow:hidden;transform:translateZ(0);container:chat-container/inline-size}.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 (width>=768px){.chat-app__container.chat-app__container--inline-layout-contained{height:100svh;scroll-margin-top:0}}.chat-app__main{overscroll-behavior-x:none;overscroll-behavior-y:contain;background:var(--body-background);scrollbar-gutter:stable;touch-action:pan-y;flex-direction:column;width:100%;height:100%;display:flex;overflow:hidden auto;container:chat-inner-container/inline-size}.chat-app__container--inline-layout .chat-app__main{overscroll-behavior-y:auto}.chat-app__loader-container{z-index:var(--z-index-loader);justify-content:center;align-items:center;width:100%;height:100%;display:flex;position:relative}.chat-app__portals{display:contents}.chat-app__header{z-index:var(--z-index-header);background:var(--body-background);position:sticky;top:0}.chat-app__header--unsticked{position:relative}.chat-app__header-content{--btn-padding-x:var(--btn-padding-y);column-gap:var(--spacer-r-12);min-height:calc(var(--btn-padding-y) * 2 + var(--btn-icon-size) + var(--spacer-10) * 2);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);flex-wrap:wrap;justify-content:flex-end;align-items:center;display:flex;position:relative}.chat-app__header-content>:where(*){z-index:0;pointer-events:auto;position:relative}.chat-app__header-content:after{right:var(--btn-padding-x);bottom:0;left:var(--btn-padding-x);content:"";border-bottom:1px solid #0000;transition:border-color .1s ease-in-out;position:absolute}.chat-app__header-content.has-border:after{border-color:var(--base-line-color)}.chat-app__header-new-conversation{margin-right:auto;position:relative}@container chat-container (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{flex-direction:column;flex-grow:1;width:100%;display:flex;position:relative}.chat-app__page-transition{flex-direction:column;flex-grow:1;width:100%;height:100%;display:flex}.chat-app__aside{--duration-in:.65s;--duration-out:.5s;visibility:hidden;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;flex-grow:1;position:relative;top:0;bottom:0}.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{width:var(--aside-width);overscroll-behavior:contain;border-left-width:var(--aside-border-width);border-color:var(--aside-border-color);background:var(--aside-background);scrollbar-gutter:stable;height:100%;position:relative;overflow-y:auto}.chat-app__container--inline-layout .chat-app__aside-container{overscroll-behavior-y:auto}.chat-app__aside-header,.chat-app__sheet-header{z-index:var(--z-index-header);flex-wrap:no-wrap;padding:var(--spacer-12) var(--spacer-12) var(--spacer-12) var(--spacer-24);justify-content:space-between;align-items:center;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);display:flex;position:sticky;top:0}.chat-app__sheet-close{position:relative}.chat-app__sheet-overlay{z-index:var(--z-index-dialog);background:var(--aside-background-overlay);position:fixed;inset:0}.chat-app__sheet-content{z-index:var(--z-index-flyout);width:100%;max-width:var(--aside-width);overscroll-behavior:contain;border-left-width:var(--aside-border-width);border-color:var(--aside-border-color);background:var(--aside-background);scrollbar-gutter:stable;height:100%;position:fixed;top:0;right:0;overflow-y:auto}.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:#0000}.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)}.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;cursor:pointer;flex-direction:row;align-items:flex-end;transition:opacity .15s ease-out;display:flex}.open-button--expanded{opacity:0;pointer-events:none}.open-button__text{margin-right:calc(var(--open-button-avatar-width) * -.5);padding-top:var(--spacer-r-12);padding-right:0;padding-bottom:var(--spacer-r-12);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);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);flex-direction:column;justify-content:center;align-items:flex-start;padding-left:0;display:flex;position:absolute;bottom:50%;right:100%;overflow:hidden;transform:translateY(50%);box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a}.open-button:is(:hover,.open-button--programmatic-expand) .open-button__text{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);transform:translateY(0)}.open-button__title{max-width:240px;padding:0 calc(var(--open-button-avatar-width) * .5 + var(--spacer-r-12)) 0 var(--spacer-r-12);white-space:pre;font-weight:700}.open-button__mask{width:0;height:0;transition:width var(--open-button-duration) var(--open-button-delay) var(--open-button-ease), height var(--open-button-duration) var(--open-button-ease);overflow:hidden}.open-button:is(:hover,.open-button--programmatic-expand) .open-button__mask{transition:width var(--open-button-duration) var(--open-button-ease), height var(--open-button-duration) var(--open-button-delay) var(--open-button-ease)}.open-button__description{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;position:relative}.open-button__avatar{z-index:var(--z-index-local-overlay);width:var(--open-button-avatar-width);height:var(--open-button-avatar-height);border-radius:var(--spacer-r-80);filter:drop-shadow(0 4px 6px #00000026);transition:transform .2s var(--open-button-ease);position:relative;overflow:clip}.open-button:is(:hover,.open-button--programmatic-expand) .open-button__avatar{transform:scale(1.05)}.open-button__link-icon{width:var(--spacer-r-80);height:var(--spacer-r-80);padding:var(--spacer-r-20);color:var(--open-button-color);display:none;position:absolute;right:0}:where(.open-button--standalone){right:var(--spacer-r-16);bottom:var(--spacer-r-16);position:fixed}@media (prefers-reduced-motion:reduce){.open-button__text,.open-button__mask,.open-button:hover .open-button__text,.open-button:hover .open-button__mask{transition:none!important}.open-button__avatar,.open-button:hover .open-button__avatar{filter:none!important;transition:none!important}}.open-button--hide-title-when-collapsed .open-button__text{visibility:hidden;opacity:0;transition:transform var(--open-button-duration) var(--open-button-ease), padding-right var(--open-button-duration) var(--open-button-delay) var(--open-button-ease), opacity var(--open-button-duration) var(--open-button-delay) var(--open-button-ease), visibility 0s linear calc(var(--open-button-duration) + var(--open-button-delay))}.open-button--hide-title-when-collapsed:is(:hover,.open-button--programmatic-expand) .open-button__text{visibility:visible;background:var(--open-button-hover-background,var(--open-button-background));color:var(--open-button-hover-color,var(--open-button-color));opacity:1;transition:transform var(--open-button-duration) var(--open-button-delay) var(--open-button-ease), opacity var(--open-button-duration) var(--open-button-ease), visibility 0s linear 0s;transform:translateY(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";`,D=typeof window<`u`?window:{screen:{},navigator:{}},O=(D.matchMedia||(function(){return{matches:!1}})).bind(D),k={get passive(){return!0}},A=function(){};D.addEventListener&&D.addEventListener(`p`,A,k),D.removeEventListener&&D.removeEventListener(`p`,A,!1),`PointerEvent`in D;var j=`ontouchstart`in D,M=`TouchEvent`in D,N=j||M&&O(`(any-pointer: coarse)`).matches,P=(D.navigator.maxTouchPoints||0)>0||N,F=D.navigator.userAgent||``,I=O(`(pointer: coarse)`).matches&&/iPad|Macintosh/.test(F)&&Math.min(D.screen.width||0,D.screen.height||0)>=768,L=(O(`(pointer: coarse)`).matches||!O(`(pointer: fine)`).matches&&j)&&!/Windows.*Firefox/.test(F),R=O(`(any-pointer: fine)`).matches||O(`(any-hover: hover)`).matches||I||!j,z=P&&(R||!L)?`hybrid`:P?`touchOnly`:`mouseOnly`,he=z===`mouseOnly`?`mouse`:z===`touchOnly`||L?`touch`:`mouse`,ge=p(`<div class="open-button__title"></div>`),_e=p(`<div class="open-button__mask"><div class="open-button__description"></div></div>`),ve=p(`<div class="open-button__text"><!> <!></div>`),ye=p(`<div class="sr-only"> </div>`),be=p(`<!> <div class="svg svg--avatar open-button__avatar" aria-hidden="true"></div>`,1),xe=p(`<link rel="stylesheet"/>`),Se=p(`<!> <!>`,1),Ce=p(`<!> <!> <!> <main class="chat-app"><!></main>`,1),we=p(`<!> <!>`,1),Te=p(`<!> <!>`,1);function B(p,g){s(g,!0);let D=(e,t)=>{let a=()=>t?.().chatConfig,o=()=>t?.().language,s=()=>t?.().colorScheme,d=_(()=>{let{openButtonTitle:e,openButtonDescription:t}=a().translations[o()];return{openButtonTitle:e,openButtonDescription:t}}),f=_(()=>a().fullTheme[s()].tokens.svgs),p=_(()=>a().fullTheme[s()]?.tokens.components.openButton?.custom),m=_(()=>!!b(p)?.hideTitleWhenCollapsed);{let t=_(()=>a().buttonHref?void 0:M()?`true`:`false`),o=_(()=>a().buttonHref?void 0:`true`),s=_(()=>a().buttonHref?void 0:j()),p=_(()=>[`open-button`,g.buttonClass,w.data.flyoutIsOpen?`open-button--expanded`:void 0,b(m)?`open-button--hide-title-when-collapsed`:void 0]);fe(e,{get href(){return a().buttonHref},onclick:Fe,onmouseenter:Ne,onmouseleave:Pe,use:Ae,get"aria-expanded"(){return b(t)},get"aria-haspopup"(){return b(o)},get"aria-controls"(){return b(s)},get style(){return g.buttonStyle},get className(){return b(p)},get isStandalone(){return b(L)},children:(e,t)=>{var a=be(),o=S(a),s=e=>{var t=ve(),i=h(t),a=e=>{var t=ge();C(t,()=>b(d).openButtonTitle,!0),n(t),r(e,t)};u(i,e=>{b(d).openButtonTitle&&e(a)});var o=c(i,2),s=e=>{var t=_e(),i=h(t);C(i,()=>b(d).openButtonDescription,!0),n(i),x(i,e=>l(U,e),()=>b(U)),n(t),x(t,e=>l(H,e),()=>b(H)),r(e,t)};u(o,e=>{b(d).openButtonDescription&&he===`mouse`&&e(s)}),n(t),r(e,t)},p=e=>{var t=ye(),a=h(t,!0);n(t),v(()=>i(a,w.t.ariaOpenChat)),r(e,t)};u(o,e=>{b(d).openButtonTitle||b(d).openButtonDescription?e(s):e(p,-1)});var m=c(o,2);C(m,()=>b(f).avatar,!0),n(m),r(e,a)},$$slots:{default:!0}})}},O=t(`light`),k=y(g,`host`,7),A=y(g,`onError`,7),j=y(g,`flyoutId`,7),M=y(g,`flyoutIsOpen`,7),N=ie(g,[`$$slots`,`$$events`,`$$legacy`,`$$host`,`host`,`onError`,`flyoutId`,`flyoutIsOpen`]),P=async e=>pe(await(await fetch(`${e}/chatconfig`)).json()),F=async({forceTheme:e,lang:t,apiUrl:n})=>{let r=window.CHAT_CONFIG_OVERRIDE?window.CHAT_CONFIG_OVERRIDE:await P(n),i=ue(t,de(r.supportedLanguages)),a=se(r,await ce([i]));return{chatConfig:a,language:i,colorScheme:le(Object.keys(a.fullTheme))}},I=(e,t)=>{if(e==null)return t;if(typeof e==`string`){let t=e.trim().toLowerCase();return!(t===``||t===`0`||t===`false`||t===`no`)}return typeof e==`number`?e!==0:typeof e==`boolean`?e:t},L=_(()=>!!k()),R=t(!1),z=t(!1),B=t(!1),V=t(void 0),H=t(void 0),U=t(void 0),Ee=_(()=>b(U)?.offsetWidth??0),De=_(()=>b(U)?.offsetHeight??0),W=t(void 0),G=t(!1),K,q=t(!0);function J(){return b(W)?(clearTimeout(b(W)),l(W,void 0),!0):!1}async function Oe(e){l(O,e.colorScheme,!0),K?.(),J(),l(G,!1);let t=e.chatConfig.fullTheme[b(O)]?.tokens.components.openButton?.custom??{},n=t.autoExpandScrollThreshold,r=Number(t.autoCollapseDelay??0),i=Number.isNaN(r)?0:Math.max(0,r),a=I(t.autoExpandOnce,!1),o=(()=>{if(n==null)return 100;if(typeof n==`string`){if(n.trim().toLowerCase()===`none`)return 0;let e=Number(n);return Number.isNaN(e)?100:e}let e=Number(n);return Number.isNaN(e)?100:e})();if(Number.isNaN(o)||o<=0)return;let s=`liipgpt-auto-expand-${g.apiUrl}`,c=!1;if(typeof window<`u`)try{c=window.localStorage.getItem(s)===`true`}catch(e){console.warn(`LiipGPT: unable to read auto-expand flag`,e)}l(B,c,!0);let u=()=>{if(!(window.scrollY/window.innerHeight*100>=o)){l(q,!0);return}if(!(b(z)||M())&&!(a&&(c||b(B)))&&b(q)){if(l(q,!1),l(z,!0),l(B,!0),je(),a&&typeof window<`u`)try{window.localStorage.setItem(s,`true`)}catch(e){console.warn(`LiipGPT: unable to persist auto-expand flag`,e)}l(W,setTimeout(()=>{b(G)||(Me(),l(z,!1)),l(W,void 0)},i),!0)}};window.addEventListener(`scroll`,u,{passive:!0}),o===0&&(await ee(),u()),K=()=>{window.removeEventListener(`scroll`,u)}}function ke(){J(),l(z,!1),l(G,!1)}function Ae(e){l(V,e,!0)}function Y(){K?.(),J()}ne(Y);function X(){!b(U)||!b(H)||(b(H).style.width=`${b(Ee)}px`,b(H).style.height=`${b(De)}px`)}function Z(){b(H)&&(b(H).style.width=`0`,b(H).style.height=`0`)}function je(){b(V)&&(b(V).classList.add(`open-button--programmatic-expand`),X())}function Me(){b(V)&&(b(V).classList.remove(`open-button--programmatic-expand`),Z())}function Ne(){J()&&l(G,!0),X()}function Pe(){J(),b(G)&&(l(z,!1),l(G,!1),b(V)?.classList.remove(`open-button--programmatic-expand`)),b(R)||Z()}function Fe(e){ke(),g.onclick?.(e)}let Q=_(()=>F(N).then(async e=>(await Oe(e),e)).catch(e=>A()(e)));var Ie={get host(){return k()},set host(e){k(e),o()},get onError(){return A()},set onError(e){A(e),o()},get flyoutId(){return j()},set flyoutId(e){j(e),o()},get flyoutIsOpen(){return M()},set flyoutIsOpen(e){M(e),o()}},$=m();return re(`beforeunload`,oe,Y),te(`1k415fq`,t=>{var n=m(),i=S(n),a=t=>{var n=m();f(S(n),()=>b(Q),null,(t,n)=>{let i=_(()=>b(n).chatConfig.fullTheme[b(n).colorScheme]);var a=Se(),o=S(a);e(o,17,()=>b(i).fontURLs??[],d,(e,t)=>{var n=xe();v(()=>ae(n,`href`,b(t))),r(e,n)}),T(c(o,2),{id:`font-css`,get css(){return b(i).fontCSS}}),r(t,a)}),r(t,n)};u(i,e=>{b(L)&&e(a)}),r(t,n)}),f(S($),()=>b(Q),e=>{},(e,t)=>{let i=_(()=>b(t).chatConfig.fullTheme[b(O)]);var a=m(),o=S(a),s=e=>{var a=Ce(),o=S(a);{let e=_(()=>E(b(i).tokens));T(o,{id:`theme-css`,get css(){return b(e)}})}var s=c(o,2);T(s,{id:`app-css`,get css(){return me}});var l=c(s,2);T(l,{id:`custom-css`,get css(){return b(i).customCSS}});var u=c(l,2);D(h(u),()=>b(t)),n(u),r(e,a)},l=e=>{var n=Te(),a=S(n),o=e=>{var t=we(),n=S(t);{let e=_(()=>E(b(i).tokens));T(n,{id:`theme-css`,get css(){return b(e)}})}T(c(n,2),{id:`custom-css`,get css(){return b(i).customCSS}}),r(e,t)};u(a,e=>{w.initialized||e(o)}),D(c(a,2),()=>b(t)),r(e,n)};u(o,e=>{b(L)?e(s):e(l,-1)}),r(e,a)}),r(p,$),a(Ie)}g(B,{host:{},onError:{},flyoutId:{},flyoutIsOpen:{}},[],[],{mode:`open`});export{B as t};
@@ -0,0 +1,8 @@
1
+ import{n as e}from"./CibALFW0.js";var t=e({en:()=>n}),n={askQuestionAgain:`Ask question again`,answerGood:`Good answer`,answerBad:`Bad answer`,chatInputPlaceholder:`Ask me something`,chatInputPlaceholderListening:`I'm listening...`,chatInputSubmit:`Send prompt`,chatInputAbort:`Stop response`,chatInputStartListening:`Start speech recognition`,chatInputStopListening:`Stop speech recognition`,introductionTitle:`I am <span class="liipgpt-gradient-text">LiipGPT</span>. How can I help you out today?`,newChat:`New discussion`,maintenanceModeError:`The chat is currently not available. Please try again later.`,messageBotLoading:`Let me think`,messageBotError:`An error occurred:`,messageBotDefaultError:`Unknown error`,referenceLink:`Link to reference`,referencesDisplay:`Show references`,referencesHide:`Hide references`,referencesTitle:`References`,referencesFurtherTitle:`More references`,chatFooterText:``,scrollToBottom:`Scroll to bottom`,openMenu:`Open menu`,closeMenu:`Close menu`,closeChat:`Close chat`,openInfo:`Open info`,close:`Close`,send:`Send`,thankYouForFeedback:`Thank you for your feedback!`,answerFormThankYou:`Thank you, your request has been sent.`,giveFeedback:`Give feedback`,sendFeedback:`Send feedback`,feedbackFormTitle:`Give feedback to improve our Chatbot`,feedbackFormMessage:`Your message`,feedbackFormMessagePlaceholder:`Write your message here...`,feedbackFormEmail:`E-Mail`,feedbackFormEmailPlaceholder:`Enter your E-Mail`,classificationSubmit:`Submit`,classificationThankYou:`Thank you for your feedback!`,classificationTitle:`Please rate the impact and quality of the answer`,selectLanguage:`Select language`,languageChanged:`Language changed to English.`,selectColorTheme:`Choose color mode`,lightMode:`Light`,darkMode:`Dark`,noResultsFound:`No results found`,aboutThisChat:`
2
+ <p>
3
+ <strong>This is a placeholder text to give context to the chat-bot</strong>
4
+ </p>
5
+ <p>
6
+ 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">More information <span class="sr-only">, (opens in a new tab)</span></a>
7
+ </p>
8
+ `,ariaMainNavigation:`Main navigation`,ariaMainNavigationInfo:`About this chat`,ariaMainNavigationLinks:`Links`,ariaMainNavigationLanguageSwitch:`Language switch`,ariaMainNavigationColorMode:`Color mode`,ariaGotoMainNavigation:`Go to main navigation`,ariaAskQuestion:`Text input`,ariaAskQuestionRegion:`Ask a question`,ariaNotifications:`Notifications`,ariaPredefinedQuestions:`Predefined Questions`,ariaPredefinedQuestionsRegion:`Try our sample questions`,ariaChatHistory:`Chat history`,ariaOpenChat:`Open chat`,ariaQuestionFromYou:`Your question:`,ariaAnswerFromBot:`Answer {n} from Assistant:`,ariaLastAnswerNavigation:`Navigation and options for the last answer`,ariaQuestionSent:`Question sent. Generating answer...`,ariaAnswerReady:`Answer ready.`,ariaAnswerFinished:`Answer complete. Ask a further question or navigate back to review the chat history, provide feedback, or view references linked to the answer.`,ariaAnswerFinishedWithSelectedTopic:`Answer complete. Ask a further question or navigate back to change the selected topic, review the chat history, provide feedback, or view references linked to the answer.`,ariaAskQuestionAgain:`Copy the last question into the chat-input to ask it again`,ariaAnswerGood:`Rate this answer as good`,ariaAnswerBad:`Rate this answer as bad`,ariaReferenceSource:`Source:`,ariaGiveFeedback:`Give detailed feedback on the answer`,ariaAnswerForm:`Open the form for this answer`,ariaLanguageChanged:`Language changed to English.`,ariaLightSelected:`Light mode activated.`,ariaDarkSelected:`Dark mode activated.`,ariaSettings:`Chat settings`,ariaSettingsRegion:`Adjust your chat preferences`,ariaReferencesRegion:`References for the current question`,ariaOpensInNewTab:`(opens in new tab)`,ariaPageTitle:`Chatbot`,ariaCloseWithEsc:`Close this content by pressing the Escape key`,ariaInfoTitle:`About this chatbot`,ariaFlyoutRegion:`Chatbot`,ariaSelected:`selected`,ariaUnselected:`unselected`,ariaAllSelected:`All items selected`,ariaAllUnselected:`All items unselected`,ariaAllReseted:`Default items selected`,ariaChangeTopic:`Change topic`,hideSettings:`Hide settings`,showSettings:`Show settings`,chooseAtLeastOneOption:`Select at least one option`,selectAll:`Select all`,selectNone:`Deselect all`,resetToDefaults:`Reset to defaults`,messageTooLong:`Your message has to be shorter than {questionLengthLimit} characters. Currently it is {questionLength} characters long`,selectedTopic:`Selected topic`,changeTopic:`Change topic`,searchSummaryExpand:`Full answer`,searchSummaryCollapse:`Show less`,searchSummaryOptInDefault:`Enable AI search`,searchSummaryOptOut:`Disable AI search`,searchSummaryError:`Something went wrong.`,searchSummaryDisclaimer:`<p><strong>I am an AI assistant.</strong></p><p>My answers are generated by artificial intelligence and may not always be correct. If you activate me, I will help you find the right information.</p>`,searchSummaryLoading:`Generating answer…`,searchSummaryFollowUpPlaceholder:`Ask a follow-up question…`,searchSummaryFollowUpSubmit:`Continue in chat`,ariaSearchSummaryExpand:`Show full answer`,ariaSearchSummaryCollapse:`Collapse answer`,ariaSearchSummaryOptOut:`Disable AI search`,ariaSearchSummaryFollowUpInput:`Ask a follow-up question`,jsonLdEventDate:`Date`,jsonLdEventLocation:`Location`,jsonLdEventDescription:`Info`,jsonLdEventCtaLabel:`View event`,jsonLdCtaLabel:`Learn more`,jsonLdMapOpenMap:`Open map`,ariaJsonLdMapCanvas:`Map`,ariaJsonLdEventCard:`Event`,ariaJsonLdMapCard:`Location`,ariaJsonLdCtaCard:`Link`};export{t as n,n as t};
@@ -0,0 +1 @@
1
+ import{s as e}from"./BnXjA2kT.js";var t=t=>e.parse(t);export{t};
@@ -1 +1 @@
1
- import{C as e,S as t,T as n,_ as r,a as i,b as a,c as o,d as s,f as ee,g as c,h as l,i as u,m as d,n as f,o as p,p as m,r as h,s as g,t as _,u as v,v as y,w as te,x as ne,y as b}from"./BaFk5JeE.js";var re=n(`ZodMiniISODateTime`,(e,t)=>{te.init(e,t),f.init(e,t)});function x(t){return e(re,t)}var S=[`en`,`de`,`fr`,`it`],C=d({blocked:b(),maintenance:b(),"rate-limit":b(),"server-error":b(),"too-short":b(),"too-long":b(),"quota-reached":b(),aborted:b(),"sse-error":b(),"client-error":b(),"unexpected-call":b(),"incomplete-error":b(),"feedback-failed":b(),"answer-form-failed":b(),"speech-not-supported":b(),"speech-transcription-failed":b(),"speech-no-text-detected":b(),"speech-microphone-access-denied":b(),"pii-detected":b()}),w=d({email:b(),creditCard:b(),ahv:b(),phoneSwiss:b(),phoneInternational:b(),swissPassport:b(),longNumber:b()}),T=d({name:b(),namePlural:l(b()),intro:l(b()),placeholder:b(),values:y(b(),b())}),ie=d({action:b(),label:b(),type:l(u([`primary`,`secondary`]))}),ae=d({hash:b(),title:b(),content:b(),actions:l(i(ie))}),E=d({introductionTitle:b(),introductionDisclaimer:l(b()),termsInvitationToConsent:l(b()),chatInputPlaceholder:b(),chatInputPlaceholderListening:l(b()),chatInputSubmit:b(),chatInputAbort:b(),chatInputStartListening:b(),chatInputStopListening:b(),referenceLink:b(),referencesDisplay:b(),referencesHide:b(),referencesTitle:b(),referencesFurtherTitle:b(),newChat:b(),maintenanceModeError:b(),messageBotLoading:b(),messageBotError:b(),messageBotDefaultError:b(),noResultsFound:b(),chatFooterText:l(b()),scrollToBottom:b(),openButtonTitle:l(b()),openButtonDescription:l(b()),openMenu:b(),openInfo:b(),aboutThisChat:l(b()),closeMenu:b(),closeChat:b(),close:b(),send:b(),thankYouForFeedback:b(),answerFormThankYou:b(),giveFeedback:b(),sendFeedback:b(),feedbackFormTitle:b(),feedbackFormMessage:b(),feedbackFormMessagePlaceholder:b(),feedbackFormEmail:b(),feedbackFormEmailPlaceholder:b(),askQuestionAgain:b(),answerGood:b(),answerBad:b(),classificationSubmit:b(),classificationThankYou:b(),classificationTitle:b(),selectLanguage:b(),languageChanged:b(),selectColorTheme:b(),lightMode:b(),darkMode:b(),ariaMainNavigation:b(),ariaMainNavigationInfo:b(),ariaMainNavigationLinks:b(),ariaMainNavigationLanguageSwitch:b(),ariaMainNavigationColorMode:b(),ariaGotoMainNavigation:b(),ariaAskQuestion:b(),ariaAskQuestionRegion:b(),ariaNotifications:b(),ariaPredefinedQuestions:b(),ariaPredefinedQuestionsRegion:b(),ariaChatHistory:b(),ariaOpenChat:b(),ariaQuestionFromYou:b(),ariaAnswerFromBot:b(),ariaLastAnswerNavigation:b(),ariaQuestionSent:b(),ariaAnswerReady:b(),ariaAnswerFinished:b(),ariaAnswerFinishedWithSelectedTopic:b(),ariaAskQuestionAgain:b(),ariaAnswerGood:b(),ariaAnswerBad:b(),ariaReferenceSource:b(),ariaGiveFeedback:b(),ariaAnswerForm:b(),ariaLanguageChanged:b(),ariaLightSelected:b(),ariaDarkSelected:b(),ariaSettings:b(),ariaSettingsRegion:b(),ariaReferencesRegion:b(),ariaOpensInNewTab:b(),ariaPageTitle:b(),ariaCloseWithEsc:b(),ariaInfoTitle:b(),ariaFlyoutRegion:b(),ariaSelected:b(),ariaUnselected:b(),ariaAllSelected:b(),ariaAllUnselected:b(),ariaAllReseted:b(),ariaChangeTopic:b(),popups:l(i(ae)),termsAcceptButton:l(b()),termsReadButton:l(b()),selectors:l(y(b(),T)),hideSettings:b(),showSettings:b(),chooseAtLeastOneOption:b(),selectAll:b(),selectNone:b(),resetToDefaults:b(),messageTooLong:b(),selectedTopic:b(),changeTopic:b(),searchSummaryExpand:b(),searchSummaryCollapse:b(),searchSummaryOptInDefault:b(),searchSummaryOptOut:b(),searchSummaryError:b(),searchSummaryDisclaimer:l(b()),searchSummaryLoading:b(),searchSummaryFollowUpPlaceholder:b(),searchSummaryFollowUpSubmit:b(),ariaSearchSummaryExpand:b(),ariaSearchSummaryCollapse:b(),ariaSearchSummaryOptOut:b(),ariaSearchSummaryFollowUpInput:b(),jsonLdEventDate:b(),jsonLdEventLocation:b(),jsonLdEventDescription:b(),jsonLdEventCtaLabel:b(),jsonLdCtaLabel:b(),jsonLdMapOpenMap:b(),ariaJsonLdMapCanvas:b(),ariaJsonLdEventCard:b(),ariaJsonLdMapCard:b(),ariaJsonLdCtaCard:b()}),D=u(S),O=r(D,o(c(E),{selectors:l(y(b(),T))}));y(D,C),y(D,w);var k=r(D,b()),A=d({componentName:s(`buttons`),data:d({caption:l(b()),buttons:i(d({label:b(),href:l(t()),value:b(),variant:l(u([`primary`,`secondary`,`tertiary`])),icon:l(b()),target:l(b())}))})}),j=d({componentName:s(`combobox`),data:d({caption:l(k),placeholder:k,values:i(d({label:k,value:b(),metadata:l(y(b(),ne()))})),removeComponentAfterValueSelection:l(p()),selectorKey:l(b())})}),M=d({componentName:s(`alva-init`),data:d({})}),N=d({componentName:s(`alva-score-survey`),data:d({})}),P=d({type:s(`component`),id:l(b()),time:l(b()),hideAvatar:l(p()),noSectionPadding:l(p()),hideChatInput:l(p())}),F=v(g(`componentName`,[A,j,M,N]),P),I=a([b(),m(),p(),i(b()),i(m()),i(p())]),L=d({title:b(),description:l(b()),badge:l(b()),breadcrumbs:l(i(b())),previewImage:l(b()),date:l(x())}),R=o(d({url:t(),score:m(),metadata:y(b(),I),language:l(b())}),L.shape);u([`start`,`chat`]),g(`name`,[d({name:s(`start-page`),prefill:l(b())}),d({name:s(`consent-page`)}),d({name:s(`chat-page`),query:l(b()),predefinedQuestionId:l(b()),switchQuestionId:l(b())})]);var z=d({type:s(`user`),time:b(),message:b(),id:l(b())});u([`idle`,`searching`,`answering`]);var B=a([b(),m(),p(),i(b()),i(m()),i(p())]),V=o(d({citationId:l(b()),url:b(),score:m(),metadata:y(b(),B),considered:p(),display:d({card:L,listItem:L})}),{referenceIndex:d({all:m(),used:l(m())})}),H=d({all:i(V),used:i(V),unused:i(V)}),U=a([u([`pii-detected`,`blocked`,`maintenance`,`rate-limit`,`server-error`,`too-short`,`too-long`,`quota-reached`,`aborted`]),s(`sse-error`),s(`client-error`),s(`unexpected-call`)]),W=d({type:s(`bot`),time:b(),id:b(),message:d({markdown:b(),html:b(),text:b()}),references:H,errors:i(U),retrievalQuestion:l(b()),noFeedback:l(p()),feedback:l(u([`up`,`down`]))}),G=o(W,{state:u([`streaming`,`done`])}),K=a([a([o(W,{state:s(`loading`)}),G]),z,F]),q=i(d({question:b(),answer:b()})),J=d({label:b(),options:i(d({label:b(),value:m()}))}),oe=d({label:b(),icon:b(),url:b(),target:l(u([`_blank`,`_self`]))}),se=d({id:l(b()),label:ee(b()),question:b(),switchQuestionId:l(b())}),ce=u([`quality`,`impact`]),Y=d({impact:l(J),quality:l(J),order:l(i(ce))});d({classification:l(Y)});var le=d({predefinedQuestions:i(se)}),ue=a([d({maintenance:s(!0)}),d({id:b(),cID:b()})]);y(D,E),d({label:b(),placeholder:b(),locked:l(p())});var de=d({settingName:b(),iconName:b(),settingIntro:l(b()),type:u([`single-select`,`multi-select`]),allowEmpty:p(),values:i(b()),defaultValues:l(i(b()))}),fe=d({type:u([`text`,`select`,`checkbox`,`radio`]),name:b(),label:k,placeholder:l(k),required:l(p()),options:l(i(d({value:b(),label:k})))}),pe=d({receiverEmail:b(),triggerLabel:k,title:l(k),caption:l(k),submitLabel:k,fields:i(fe)}),X=d({before:l(i(K)),after:l(i(K))}),me=d({init:l(i(K)),bot:l(X),user:l(X)}),he=v(c(d({forcePredefinedQuestions:l(p()),forceChatPage:l(p()),showOverallFeedbackButton:p(),showOverallFeedbackEmail:p(),showCloseChatButton:p(),showContextMenu:p(),showContextInfo:p(),showReferencesByDefault:p(),referencesLayout:l(u([`aside`,`inline`])),showExpandedSelectors:p(),showTextFeedback:p(),inlineLayout:p(),allowAudioInput:p(),blockPII:p(),questionPrefix:b(),menu:l(r(D,i(oe))),supportedLanguages:i(D),classification:l(Y),answerForm:l(pe),theme:_,translations:O,buttonHref:l(b()),addQueryToUrlParams:l(p()),addRetrievalQuestionToUrlParams:l(p()),renderKatex:l(p()),reflectLanguageInPath:l(p()),sendReferrer:l(u([`all`,`own`,`none`,`location`])),selectorsConfig:h(i(de),[]),questionLengthLimit:l(m()),forceConsent:l(p()),askQuestionAgain:p(),enableBackdrop:l(p()),parentPageContext:d({extractSelectors:l(i(b()))}),messageAdditions:l(me),contextVersion:l(m()),selectedTopicResetPredefinedQuestionId:l(b())})),d({theme:l(d({name:l(b())}))})),Z=(e,t)=>t.includes(e),Q=(e,t)=>{if(Z(e,t))return e;let n=ge();return Z(n,t)?n:`en`},ge=()=>navigator.language.split(`-`)[0],$=(e,t)=>{localStorage.setItem(`liipgpt:selectedLanguage`,e),t&&(t.lang=e)},_e=e=>Q(localStorage.getItem(`liipgpt:selectedLanguage`),e),ve=(e,t,n)=>{if(!e)return``;if(e[t])return e[t];for(let t of n)if(e[t])return e[t];return e.en?e.en:Object.values(e).find(e=>typeof e==`string`&&e.length>0)??``},ye=(e,t)=>Array.from(new Set([e,...t,`en`,...S])),be=(e,t,n,r)=>{for(let i of ye(n,r)){let n=e[i]?.selectors?.[t];if(n)return n}};export{$ as a,ue as c,O as d,x as f,ve as i,q as l,Q as n,he as o,be as r,le as s,_e as t,R as u};
1
+ import{C as e,S as t,T as n,_ as r,a as i,b as a,c as o,d as s,f as ee,g as c,h as l,i as u,m as d,n as f,o as p,p as m,r as h,s as g,t as _,u as v,v as y,w as te,x as ne,y as b}from"./BaFk5JeE.js";var re=n(`ZodMiniISODateTime`,(e,t)=>{te.init(e,t),f.init(e,t)});function x(t){return e(re,t)}var S=[`en`,`de`,`fr`,`it`],C=d({blocked:b(),maintenance:b(),"rate-limit":b(),"server-error":b(),"too-short":b(),"too-long":b(),"quota-reached":b(),aborted:b(),"sse-error":b(),"client-error":b(),"unexpected-call":b(),"incomplete-error":b(),"feedback-failed":b(),"answer-form-failed":b(),"speech-not-supported":b(),"speech-transcription-failed":b(),"speech-no-text-detected":b(),"speech-microphone-access-denied":b(),"pii-detected":b()}),w=d({email:b(),creditCard:b(),ahv:b(),phoneSwiss:b(),phoneInternational:b(),swissPassport:b(),longNumber:b()}),T=d({name:b(),namePlural:l(b()),intro:l(b()),placeholder:b(),values:y(b(),b())}),ie=d({action:b(),label:b(),type:l(u([`primary`,`secondary`]))}),ae=d({hash:b(),title:b(),content:b(),actions:l(i(ie))}),E=d({introductionTitle:b(),introductionDisclaimer:l(b()),termsInvitationToConsent:l(b()),chatInputPlaceholder:b(),chatInputPlaceholderListening:l(b()),chatInputSubmit:b(),chatInputAbort:b(),chatInputStartListening:b(),chatInputStopListening:b(),referenceLink:b(),referencesDisplay:b(),referencesHide:b(),referencesTitle:b(),referencesFurtherTitle:b(),newChat:b(),maintenanceModeError:b(),messageBotLoading:b(),messageBotError:b(),messageBotDefaultError:b(),noResultsFound:b(),chatFooterText:l(b()),scrollToBottom:b(),openButtonTitle:l(b()),openButtonDescription:l(b()),openMenu:b(),openInfo:b(),aboutThisChat:l(b()),closeMenu:b(),closeChat:b(),close:b(),send:b(),thankYouForFeedback:b(),answerFormThankYou:b(),giveFeedback:b(),sendFeedback:b(),feedbackFormTitle:b(),feedbackFormMessage:b(),feedbackFormMessagePlaceholder:b(),feedbackFormEmail:b(),feedbackFormEmailPlaceholder:b(),askQuestionAgain:b(),answerGood:b(),answerBad:b(),classificationSubmit:b(),classificationThankYou:b(),classificationTitle:b(),selectLanguage:b(),languageChanged:b(),selectColorTheme:b(),lightMode:b(),darkMode:b(),ariaMainNavigation:b(),ariaMainNavigationInfo:b(),ariaMainNavigationLinks:b(),ariaMainNavigationLanguageSwitch:b(),ariaMainNavigationColorMode:b(),ariaGotoMainNavigation:b(),ariaAskQuestion:b(),ariaAskQuestionRegion:b(),ariaNotifications:b(),ariaPredefinedQuestions:b(),ariaPredefinedQuestionsRegion:b(),ariaChatHistory:b(),ariaOpenChat:b(),ariaQuestionFromYou:b(),ariaAnswerFromBot:b(),ariaLastAnswerNavigation:b(),ariaQuestionSent:b(),ariaAnswerReady:b(),ariaAnswerFinished:b(),ariaAnswerFinishedWithSelectedTopic:b(),ariaAskQuestionAgain:b(),ariaAnswerGood:b(),ariaAnswerBad:b(),ariaReferenceSource:b(),ariaGiveFeedback:b(),ariaAnswerForm:b(),ariaLanguageChanged:b(),ariaLightSelected:b(),ariaDarkSelected:b(),ariaSettings:b(),ariaSettingsRegion:b(),ariaReferencesRegion:b(),ariaOpensInNewTab:b(),ariaPageTitle:b(),ariaCloseWithEsc:b(),ariaInfoTitle:b(),ariaFlyoutRegion:b(),ariaSelected:b(),ariaUnselected:b(),ariaAllSelected:b(),ariaAllUnselected:b(),ariaAllReseted:b(),ariaChangeTopic:b(),popups:l(i(ae)),termsAcceptButton:l(b()),termsReadButton:l(b()),selectors:l(y(b(),T)),hideSettings:b(),showSettings:b(),chooseAtLeastOneOption:b(),selectAll:b(),selectNone:b(),resetToDefaults:b(),messageTooLong:b(),selectedTopic:b(),changeTopic:b(),searchSummaryExpand:b(),searchSummaryCollapse:b(),searchSummaryOptInDefault:b(),searchSummaryOptOut:b(),searchSummaryError:b(),searchSummaryDisclaimer:l(b()),searchSummaryLoading:b(),searchSummaryFollowUpPlaceholder:b(),searchSummaryFollowUpSubmit:b(),ariaSearchSummaryExpand:b(),ariaSearchSummaryCollapse:b(),ariaSearchSummaryOptOut:b(),ariaSearchSummaryFollowUpInput:b(),jsonLdEventDate:b(),jsonLdEventLocation:b(),jsonLdEventDescription:b(),jsonLdEventCtaLabel:b(),jsonLdCtaLabel:b(),jsonLdMapOpenMap:b(),ariaJsonLdMapCanvas:b(),ariaJsonLdEventCard:b(),ariaJsonLdMapCard:b(),ariaJsonLdCtaCard:b()}),D=u(S),O=r(D,o(c(E),{selectors:l(y(b(),T))}));y(D,C),y(D,w);var k=r(D,b()),A=d({componentName:s(`buttons`),data:d({caption:l(b()),buttons:i(d({label:b(),href:l(t()),value:b(),variant:l(u([`primary`,`secondary`,`tertiary`])),icon:l(b()),target:l(b())}))})}),j=d({componentName:s(`combobox`),data:d({caption:l(k),placeholder:k,values:i(d({label:k,value:b(),metadata:l(y(b(),ne()))})),removeComponentAfterValueSelection:l(p()),selectorKey:l(b())})}),M=d({componentName:s(`alva-init`),data:d({})}),N=d({componentName:s(`alva-score-survey`),data:d({})}),P=d({type:s(`component`),id:l(b()),time:l(b()),hideAvatar:l(p()),noSectionPadding:l(p()),hideChatInput:l(p())}),F=v(g(`componentName`,[A,j,M,N]),P),I=a([b(),m(),p(),i(b()),i(m()),i(p())]),L=d({title:b(),description:l(b()),badge:l(b()),breadcrumbs:l(i(b())),previewImage:l(b()),date:l(x())}),R=o(d({url:t(),score:m(),metadata:y(b(),I),language:l(b())}),L.shape);u([`start`,`chat`]),g(`name`,[d({name:s(`start-page`),prefill:l(b())}),d({name:s(`consent-page`)}),d({name:s(`chat-page`),query:l(b()),predefinedQuestionId:l(b()),switchQuestionId:l(b())})]);var z=d({type:s(`user`),time:b(),message:b(),id:l(b())});u([`idle`,`searching`,`answering`]);var B=a([b(),m(),p(),i(b()),i(m()),i(p())]),V=o(d({citationId:l(b()),url:b(),score:m(),metadata:y(b(),B),considered:p(),display:d({card:L,listItem:L})}),{referenceIndex:d({all:m(),used:l(m())})}),H=d({all:i(V),used:i(V),unused:i(V)}),U=a([u([`pii-detected`,`blocked`,`maintenance`,`rate-limit`,`server-error`,`too-short`,`too-long`,`quota-reached`,`aborted`]),s(`sse-error`),s(`client-error`),s(`unexpected-call`)]),W=d({type:s(`bot`),time:b(),id:b(),message:d({markdown:b(),html:b(),text:b()}),references:H,errors:i(U),retrievalQuestion:l(b()),noFeedback:l(p()),feedback:l(u([`up`,`down`]))}),G=o(W,{state:u([`streaming`,`done`])}),K=a([a([o(W,{state:s(`loading`)}),G]),z,F]),q=i(d({question:b(),answer:b()})),J=d({label:b(),options:i(d({label:b(),value:m()}))}),oe=d({label:b(),icon:b(),url:b(),target:l(u([`_blank`,`_self`]))}),se=d({id:l(b()),label:ee(b()),question:b(),switchQuestionId:l(b())}),ce=u([`quality`,`impact`]),Y=d({impact:l(J),quality:l(J),order:l(i(ce))});d({classification:l(Y)});var le=d({predefinedQuestions:i(se)}),ue=a([d({maintenance:s(!0)}),d({id:b(),cID:b()})]);y(D,E),d({label:b(),placeholder:b(),locked:l(p())});var de=d({settingName:b(),iconName:b(),settingIntro:l(b()),type:u([`single-select`,`multi-select`]),allowEmpty:p(),values:i(b()),defaultValues:l(i(b()))}),fe=d({type:u([`text`,`select`,`checkbox`,`radio`]),name:b(),label:k,placeholder:l(k),required:l(p()),options:l(i(d({value:b(),label:k})))}),pe=d({receiverEmail:b(),triggerLabel:k,title:l(k),caption:l(k),submitLabel:k,fields:i(fe)}),X=d({before:l(i(K)),after:l(i(K))}),me=d({init:l(i(K)),bot:l(X),user:l(X)}),he=v(c(d({forcePredefinedQuestions:l(p()),forceChatPage:l(p()),showOverallFeedbackButton:p(),showOverallFeedbackEmail:p(),showCloseChatButton:p(),showContextMenu:p(),showContextInfo:p(),showReferencesByDefault:p(),referencesLayout:l(u([`aside`,`inline`])),showExpandedSelectors:p(),showTextFeedback:p(),inlineLayout:p(),allowAudioInput:p(),blockPII:p(),questionPrefix:b(),menu:l(r(D,i(oe))),supportedLanguages:i(D),classification:l(Y),answerForm:l(pe),theme:_,translations:O,buttonHref:l(b()),addQueryToUrlParams:l(p()),addRetrievalQuestionToUrlParams:l(p()),renderKatex:l(p()),reflectLanguageInPath:l(p()),sendReferrer:l(u([`all`,`own`,`none`,`location`])),selectorsConfig:h(i(de),[]),questionLengthLimit:l(m()),forceConsent:l(p()),askQuestionAgain:p(),enableBackdrop:l(p()),parentPageContext:d({extractSelectors:l(i(b()))}),messageAdditions:l(me),contextVersion:l(m()),selectedTopicResetPredefinedQuestionId:l(b())})),d({theme:l(d({name:l(b())}))})),Z=(e,t)=>t.includes(e),Q=(e,t)=>{if(Z(e,t))return e;let n=ge();return Z(n,t)?n:`en`},ge=()=>navigator.language.split(`-`)[0],$=(e,t)=>{localStorage.setItem(`liipgpt:selectedLanguage`,e),t&&(t.lang=e)},_e=e=>Q(localStorage.getItem(`liipgpt:selectedLanguage`),e),ve=(e,t)=>e?Q(e,t):_e(t),ye=e=>e??[...S],be=(e,t,n)=>{if(!e)return``;if(e[t])return e[t];for(let t of n)if(e[t])return e[t];return e.en?e.en:Object.values(e).find(e=>typeof e==`string`&&e.length>0)??``},xe=(e,t)=>Array.from(new Set([e,...t,`en`,...S])),Se=(e,t,n,r)=>{for(let i of xe(n,r)){let n=e[i]?.selectors?.[t];if(n)return n}};export{$ as a,le as c,R as d,O as f,be as i,ue as l,x as m,ve as n,ye as o,S as p,Se as r,he as s,Q as t,q as u};
@@ -1,4 +1,4 @@
1
- import{Dt as e,Et as t,Nt as n,Tt as r,it as i,jt as a,ot as o,ut as s,wt as c}from"./DK3lEKRX.js";import{S as l,a as u,b as d,h as f,l as p,m,o as ee,p as h,y as te}from"./BaFk5JeE.js";import{c as ne,f as re,l as g,o as ie,s as ae,u as oe}from"./BJVrdkuG.js";var{entries:se,setPrototypeOf:ce,isFrozen:le,getPrototypeOf:ue,getOwnPropertyDescriptor:_}=Object,{freeze:v,seal:y,create:de}=Object,{apply:fe,construct:pe}=typeof Reflect<`u`&&Reflect;v||=function(e){return e},y||=function(e){return e},fe||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},pe||=function(e){return new e(...[...arguments].slice(1))};var me=S(Array.prototype.forEach),he=S(Array.prototype.lastIndexOf),ge=S(Array.prototype.pop),_e=S(Array.prototype.push),ve=S(Array.prototype.splice),ye=S(String.prototype.toLowerCase),be=S(String.prototype.toString),xe=S(String.prototype.match),Se=S(String.prototype.replace),Ce=S(String.prototype.indexOf),we=S(String.prototype.trim),b=S(Object.prototype.hasOwnProperty),x=S(RegExp.prototype.test),Te=Ee(TypeError);function S(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return fe(e,t,n)}}function Ee(e){return function(){return pe(e,[...arguments])}}function C(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ye;ce&&ce(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(le(t)||(t[r]=e),i=e)}e[i]=!0}return e}function De(e){for(let t=0;t<e.length;t++)b(e,t)||(e[t]=null);return e}function w(e){let t=de(null);for(let[n,r]of se(e))b(e,n)&&(Array.isArray(r)?t[n]=De(r):r&&typeof r==`object`&&r.constructor===Object?t[n]=w(r):t[n]=r);return t}function Oe(e,t){for(;e!==null;){let n=_(e,t);if(n){if(n.get)return S(n.get);if(typeof n.value==`function`)return S(n.value)}e=ue(e)}function n(){return null}return n}var ke=v(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Ae=v(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),je=v([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Me=v([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Ne=v(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Pe=v([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Fe=v([`#text`]),Ie=v(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns.slot`.split(`.`)),Le=v(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Re=v(`accent.accentunder.align.bevelled.close.columnsalign.columnlines.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lspace.lquote.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),ze=v([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Be=y(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ve=y(/<%[\w\W]*|[\w\W]*%>/gm),He=y(/\$\{[\w\W]*/gm),T=y(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ue=y(/^aria-[\-\w]+$/),We=y(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),E=y(/^(?:\w+script|data):/i),Ge=y(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ke=y(/^html$/i),D=y(/^[a-z][.\w]*(-[.\w]+)+$/i),qe=Object.freeze({__proto__:null,ARIA_ATTR:Ue,ATTR_WHITESPACE:Ge,CUSTOM_ELEMENT:D,DATA_ATTR:T,DOCTYPE_NAME:Ke,ERB_EXPR:Ve,IS_ALLOWED_URI:We,IS_SCRIPT_OR_DATA:E,MUSTACHE_EXPR:Be,TMPLIT_EXPR:He}),Je={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ye=function(){return typeof window>`u`?null:window},Xe=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Ze=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Qe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ye(),t=e=>Qe(e);if(t.version=`3.3.3`,t.removed=[],!e||!e.document||e.document.nodeType!==Je.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e,r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:s,Element:c,NodeFilter:l,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:p}=e,m=c.prototype,ee=Oe(m,`cloneNode`),h=Oe(m,`remove`),te=Oe(m,`nextSibling`),ne=Oe(m,`childNodes`),re=Oe(m,`parentNode`);if(typeof o==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let g,ie=``,{implementation:ae,createNodeIterator:oe,createDocumentFragment:ce,getElementsByTagName:le}=n,{importNode:ue}=r,_=Ze();t.isSupported=typeof se==`function`&&typeof re==`function`&&ae&&ae.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:y,ERB_EXPR:fe,TMPLIT_EXPR:pe,DATA_ATTR:S,ARIA_ATTR:Ee,IS_SCRIPT_OR_DATA:De,ATTR_WHITESPACE:Be,CUSTOM_ELEMENT:Ve}=qe,{IS_ALLOWED_URI:He}=qe,T=null,Ue=C({},[...ke,...Ae,...je,...Ne,...Fe]),E=null,Ge=C({},[...Ie,...Le,...Re,...ze]),D=Object.seal(de(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$e=null,et=null,O=Object.seal(de(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),tt=!0,k=!0,A=!1,j=!0,M=!1,nt=!0,N=!1,P=!1,rt=!1,F=!1,it=!1,at=!1,ot=!0,st=!1,ct=!0,I=!1,L={},R=null,z=C({},[`annotation-xml`,`audio`,`colgroup`,`desc`,`foreignobject`,`head`,`iframe`,`math`,`mi`,`mn`,`mo`,`ms`,`mtext`,`noembed`,`noframes`,`noscript`,`plaintext`,`script`,`style`,`svg`,`template`,`thead`,`title`,`video`,`xmp`]),lt=null,ut=C({},[`audio`,`video`,`img`,`source`,`image`,`track`]),dt=null,ft=C({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),pt=`http://www.w3.org/1998/Math/MathML`,mt=`http://www.w3.org/2000/svg`,B=`http://www.w3.org/1999/xhtml`,V=B,ht=!1,gt=null,_t=C({},[pt,mt,B],be),H=C({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),U=C({},[`annotation-xml`]),vt=C({},[`title`,`style`,`font`,`a`,`script`]),yt=null,bt=[`application/xhtml+xml`,`text/html`],W=null,xt=null,St=n.createElement(`form`),Ct=function(e){return e instanceof RegExp||e instanceof Function},wt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(xt&&xt===e)){if((!e||typeof e!=`object`)&&(e={}),e=w(e),yt=bt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,W=yt===`application/xhtml+xml`?be:ye,T=b(e,`ALLOWED_TAGS`)?C({},e.ALLOWED_TAGS,W):Ue,E=b(e,`ALLOWED_ATTR`)?C({},e.ALLOWED_ATTR,W):Ge,gt=b(e,`ALLOWED_NAMESPACES`)?C({},e.ALLOWED_NAMESPACES,be):_t,dt=b(e,`ADD_URI_SAFE_ATTR`)?C(w(ft),e.ADD_URI_SAFE_ATTR,W):ft,lt=b(e,`ADD_DATA_URI_TAGS`)?C(w(ut),e.ADD_DATA_URI_TAGS,W):ut,R=b(e,`FORBID_CONTENTS`)?C({},e.FORBID_CONTENTS,W):z,$e=b(e,`FORBID_TAGS`)?C({},e.FORBID_TAGS,W):w({}),et=b(e,`FORBID_ATTR`)?C({},e.FORBID_ATTR,W):w({}),L=b(e,`USE_PROFILES`)?e.USE_PROFILES:!1,tt=e.ALLOW_ARIA_ATTR!==!1,k=e.ALLOW_DATA_ATTR!==!1,A=e.ALLOW_UNKNOWN_PROTOCOLS||!1,j=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,M=e.SAFE_FOR_TEMPLATES||!1,nt=e.SAFE_FOR_XML!==!1,N=e.WHOLE_DOCUMENT||!1,F=e.RETURN_DOM||!1,it=e.RETURN_DOM_FRAGMENT||!1,at=e.RETURN_TRUSTED_TYPE||!1,rt=e.FORCE_BODY||!1,ot=e.SANITIZE_DOM!==!1,st=e.SANITIZE_NAMED_PROPS||!1,ct=e.KEEP_CONTENT!==!1,I=e.IN_PLACE||!1,He=e.ALLOWED_URI_REGEXP||We,V=e.NAMESPACE||B,H=e.MATHML_TEXT_INTEGRATION_POINTS||H,U=e.HTML_INTEGRATION_POINTS||U,D=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Ct(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(D.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ct(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(D.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements==`boolean`&&(D.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),M&&(k=!1),it&&(F=!0),L&&(T=C({},Fe),E=de(null),L.html===!0&&(C(T,ke),C(E,Ie)),L.svg===!0&&(C(T,Ae),C(E,Le),C(E,ze)),L.svgFilters===!0&&(C(T,je),C(E,Le),C(E,ze)),L.mathMl===!0&&(C(T,Ne),C(E,Re),C(E,ze))),b(e,`ADD_TAGS`)||(O.tagCheck=null),b(e,`ADD_ATTR`)||(O.attributeCheck=null),e.ADD_TAGS&&(typeof e.ADD_TAGS==`function`?O.tagCheck=e.ADD_TAGS:(T===Ue&&(T=w(T)),C(T,e.ADD_TAGS,W))),e.ADD_ATTR&&(typeof e.ADD_ATTR==`function`?O.attributeCheck=e.ADD_ATTR:(E===Ge&&(E=w(E)),C(E,e.ADD_ATTR,W))),e.ADD_URI_SAFE_ATTR&&C(dt,e.ADD_URI_SAFE_ATTR,W),e.FORBID_CONTENTS&&(R===z&&(R=w(R)),C(R,e.FORBID_CONTENTS,W)),e.ADD_FORBID_CONTENTS&&(R===z&&(R=w(R)),C(R,e.ADD_FORBID_CONTENTS,W)),ct&&(T[`#text`]=!0),N&&C(T,[`html`,`head`,`body`]),T.table&&(C(T,[`tbody`]),delete $e.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Te(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Te(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);g=e.TRUSTED_TYPES_POLICY,ie=g.createHTML(``)}else g===void 0&&(g=Xe(p,i)),g!==null&&typeof ie==`string`&&(ie=g.createHTML(``));v&&v(e),xt=e}},Tt=C({},[...Ae,...je,...Me]),Et=C({},[...Ne,...Pe]),Dt=function(e){let t=re(e);(!t||!t.tagName)&&(t={namespaceURI:V,tagName:`template`});let n=ye(e.tagName),r=ye(t.tagName);return gt[e.namespaceURI]?e.namespaceURI===mt?t.namespaceURI===B?n===`svg`:t.namespaceURI===pt?n===`svg`&&(r===`annotation-xml`||H[r]):!!Tt[n]:e.namespaceURI===pt?t.namespaceURI===B?n===`math`:t.namespaceURI===mt?n===`math`&&U[r]:!!Et[n]:e.namespaceURI===B?t.namespaceURI===mt&&!U[r]||t.namespaceURI===pt&&!H[r]?!1:!Et[n]&&(vt[n]||!Tt[n]):!!(yt===`application/xhtml+xml`&&gt[e.namespaceURI]):!1},G=function(e){_e(t.removed,{element:e});try{re(e).removeChild(e)}catch{h(e)}},K=function(e,n){try{_e(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{_e(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(F||it)try{G(n)}catch{}else try{n.setAttribute(e,``)}catch{}},Ot=function(e){let t=null,r=null;if(rt)e=`<remove></remove>`+e;else{let t=xe(e,/^[\r\n\t ]+/);r=t&&t[0]}yt===`application/xhtml+xml`&&V===B&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=g?g.createHTML(e):e;if(V===B)try{t=new f().parseFromString(i,yt)}catch{}if(!t||!t.documentElement){t=ae.createDocument(V,`template`,null);try{t.documentElement.innerHTML=ht?ie:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),V===B?le.call(t,N?`html`:`body`)[0]:N?t.documentElement:a},kt=function(e){return oe.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},At=function(e){return e instanceof d&&(typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||!(e.attributes instanceof u)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`)},jt=function(e){return typeof s==`function`&&e instanceof s};function q(e,n,r){me(e,e=>{e.call(t,n,r,xt)})}let Mt=function(e){let n=null;if(q(_.beforeSanitizeElements,e,null),At(e))return G(e),!0;let r=W(e.nodeName);if(q(_.uponSanitizeElement,e,{tagName:r,allowedTags:T}),nt&&e.hasChildNodes()&&!jt(e.firstElementChild)&&x(/<[/\w!]/g,e.innerHTML)&&x(/<[/\w!]/g,e.textContent)||e.nodeType===Je.progressingInstruction||nt&&e.nodeType===Je.comment&&x(/<[/\w]/g,e.data))return G(e),!0;if(!(O.tagCheck instanceof Function&&O.tagCheck(r))&&(!T[r]||$e[r])){if(!$e[r]&&Pt(r)&&(D.tagNameCheck instanceof RegExp&&x(D.tagNameCheck,r)||D.tagNameCheck instanceof Function&&D.tagNameCheck(r)))return!1;if(ct&&!R[r]){let t=re(e)||e.parentNode,n=ne(e)||e.childNodes;if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=ee(n[i],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,te(e))}}}return G(e),!0}return e instanceof c&&!Dt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&x(/<\/no(script|embed|frames)/i,e.innerHTML)?(G(e),!0):(M&&e.nodeType===Je.text&&(n=e.textContent,me([y,fe,pe],e=>{n=Se(n,e,` `)}),e.textContent!==n&&(_e(t.removed,{element:e.cloneNode()}),e.textContent=n)),q(_.afterSanitizeElements,e,null),!1)},Nt=function(e,t,r){if(et[t]||ot&&(t===`id`||t===`name`)&&(r in n||r in St))return!1;if(!(k&&!et[t]&&x(S,t))&&!(tt&&x(Ee,t))&&!(O.attributeCheck instanceof Function&&O.attributeCheck(t,e))){if(!E[t]||et[t]){if(!(Pt(e)&&(D.tagNameCheck instanceof RegExp&&x(D.tagNameCheck,e)||D.tagNameCheck instanceof Function&&D.tagNameCheck(e))&&(D.attributeNameCheck instanceof RegExp&&x(D.attributeNameCheck,t)||D.attributeNameCheck instanceof Function&&D.attributeNameCheck(t,e))||t===`is`&&D.allowCustomizedBuiltInElements&&(D.tagNameCheck instanceof RegExp&&x(D.tagNameCheck,r)||D.tagNameCheck instanceof Function&&D.tagNameCheck(r))))return!1}else if(!dt[t]&&!x(He,Se(r,Be,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Ce(r,`data:`)===0&&lt[e])&&!(A&&!x(De,Se(r,Be,``)))&&r)return!1}return!0},Pt=function(e){return e!==`annotation-xml`&&xe(e,Ve)},Ft=function(e){q(_.beforeSanitizeAttributes,e,null);let{attributes:n}=e;if(!n||At(e))return;let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:E,forceKeepAttr:void 0},i=n.length;for(;i--;){let{name:a,namespaceURI:o,value:s}=n[i],c=W(a),l=s,u=a===`value`?l:we(l);if(r.attrName=c,r.attrValue=u,r.keepAttr=!0,r.forceKeepAttr=void 0,q(_.uponSanitizeAttribute,e,r),u=r.attrValue,st&&(c===`id`||c===`name`)&&(K(a,e),u=`user-content-`+u),nt&&x(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,u)){K(a,e);continue}if(c===`attributename`&&xe(u,`href`)){K(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){K(a,e);continue}if(!j&&x(/\/>/i,u)){K(a,e);continue}M&&me([y,fe,pe],e=>{u=Se(u,e,` `)});let d=W(e.nodeName);if(!Nt(d,c,u)){K(a,e);continue}if(g&&typeof p==`object`&&typeof p.getAttributeType==`function`&&!o)switch(p.getAttributeType(d,c)){case`TrustedHTML`:u=g.createHTML(u);break;case`TrustedScriptURL`:u=g.createScriptURL(u);break}if(u!==l)try{o?e.setAttributeNS(o,a,u):e.setAttribute(a,u),At(e)?G(e):ge(t.removed)}catch{K(a,e)}}q(_.afterSanitizeAttributes,e,null)},It=function e(t){let n=null,r=kt(t);for(q(_.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)q(_.uponSanitizeShadowNode,n,null),Mt(n),Ft(n),n.content instanceof a&&e(n.content);q(_.afterSanitizeShadowDOM,t,null)};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,o=null,c=null,l=null;if(ht=!e,ht&&(e=`<!-->`),typeof e!=`string`&&!jt(e))if(typeof e.toString==`function`){if(e=e.toString(),typeof e!=`string`)throw Te(`dirty is not a string, aborting`)}else throw Te(`toString is not a function`);if(!t.isSupported)return e;if(P||wt(n),t.removed=[],typeof e==`string`&&(I=!1),I){if(e.nodeName){let t=W(e.nodeName);if(!T[t]||$e[t])throw Te(`root node is forbidden and cannot be sanitized in-place`)}}else if(e instanceof s)i=Ot(`<!---->`),o=i.ownerDocument.importNode(e,!0),o.nodeType===Je.element&&o.nodeName===`BODY`||o.nodeName===`HTML`?i=o:i.appendChild(o);else{if(!F&&!M&&!N&&e.indexOf(`<`)===-1)return g&&at?g.createHTML(e):e;if(i=Ot(e),!i)return F?null:at?ie:``}i&&rt&&G(i.firstChild);let u=kt(I?e:i);for(;c=u.nextNode();)Mt(c),Ft(c),c.content instanceof a&&It(c.content);if(I)return e;if(F){if(it)for(l=ce.call(i.ownerDocument);i.firstChild;)l.appendChild(i.firstChild);else l=i;return(E.shadowroot||E.shadowrootmode)&&(l=ue.call(r,l,!0)),l}let d=N?i.outerHTML:i.innerHTML;return N&&T[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&x(Ke,i.ownerDocument.doctype.name)&&(d=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
1
+ import{Dt as e,Et as t,Nt as n,Tt as r,it as i,jt as a,ot as o,ut as s,wt as c}from"./DK3lEKRX.js";import{S as l,a as u,b as d,h as f,l as p,m,o as ee,p as h,y as te}from"./BaFk5JeE.js";import{c as ne,d as re,l as g,m as ie,s as ae,u as oe}from"./BnXjA2kT.js";var{entries:se,setPrototypeOf:ce,isFrozen:le,getPrototypeOf:ue,getOwnPropertyDescriptor:_}=Object,{freeze:v,seal:y,create:de}=Object,{apply:fe,construct:pe}=typeof Reflect<`u`&&Reflect;v||=function(e){return e},y||=function(e){return e},fe||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},pe||=function(e){return new e(...[...arguments].slice(1))};var me=S(Array.prototype.forEach),he=S(Array.prototype.lastIndexOf),ge=S(Array.prototype.pop),_e=S(Array.prototype.push),ve=S(Array.prototype.splice),ye=S(String.prototype.toLowerCase),be=S(String.prototype.toString),xe=S(String.prototype.match),Se=S(String.prototype.replace),Ce=S(String.prototype.indexOf),we=S(String.prototype.trim),b=S(Object.prototype.hasOwnProperty),x=S(RegExp.prototype.test),Te=Ee(TypeError);function S(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return fe(e,t,n)}}function Ee(e){return function(){return pe(e,[...arguments])}}function C(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ye;ce&&ce(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(le(t)||(t[r]=e),i=e)}e[i]=!0}return e}function De(e){for(let t=0;t<e.length;t++)b(e,t)||(e[t]=null);return e}function w(e){let t=de(null);for(let[n,r]of se(e))b(e,n)&&(Array.isArray(r)?t[n]=De(r):r&&typeof r==`object`&&r.constructor===Object?t[n]=w(r):t[n]=r);return t}function Oe(e,t){for(;e!==null;){let n=_(e,t);if(n){if(n.get)return S(n.get);if(typeof n.value==`function`)return S(n.value)}e=ue(e)}function n(){return null}return n}var ke=v(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Ae=v(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),je=v([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Me=v([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Ne=v(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Pe=v([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Fe=v([`#text`]),Ie=v(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns.slot`.split(`.`)),Le=v(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Re=v(`accent.accentunder.align.bevelled.close.columnsalign.columnlines.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lspace.lquote.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),ze=v([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Be=y(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ve=y(/<%[\w\W]*|[\w\W]*%>/gm),He=y(/\$\{[\w\W]*/gm),T=y(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ue=y(/^aria-[\-\w]+$/),We=y(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),E=y(/^(?:\w+script|data):/i),Ge=y(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ke=y(/^html$/i),D=y(/^[a-z][.\w]*(-[.\w]+)+$/i),qe=Object.freeze({__proto__:null,ARIA_ATTR:Ue,ATTR_WHITESPACE:Ge,CUSTOM_ELEMENT:D,DATA_ATTR:T,DOCTYPE_NAME:Ke,ERB_EXPR:Ve,IS_ALLOWED_URI:We,IS_SCRIPT_OR_DATA:E,MUSTACHE_EXPR:Be,TMPLIT_EXPR:He}),Je={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ye=function(){return typeof window>`u`?null:window},Xe=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Ze=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Qe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ye(),t=e=>Qe(e);if(t.version=`3.3.3`,t.removed=[],!e||!e.document||e.document.nodeType!==Je.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e,r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:s,Element:c,NodeFilter:l,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:p}=e,m=c.prototype,ee=Oe(m,`cloneNode`),h=Oe(m,`remove`),te=Oe(m,`nextSibling`),ne=Oe(m,`childNodes`),re=Oe(m,`parentNode`);if(typeof o==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let g,ie=``,{implementation:ae,createNodeIterator:oe,createDocumentFragment:ce,getElementsByTagName:le}=n,{importNode:ue}=r,_=Ze();t.isSupported=typeof se==`function`&&typeof re==`function`&&ae&&ae.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:y,ERB_EXPR:fe,TMPLIT_EXPR:pe,DATA_ATTR:S,ARIA_ATTR:Ee,IS_SCRIPT_OR_DATA:De,ATTR_WHITESPACE:Be,CUSTOM_ELEMENT:Ve}=qe,{IS_ALLOWED_URI:He}=qe,T=null,Ue=C({},[...ke,...Ae,...je,...Ne,...Fe]),E=null,Ge=C({},[...Ie,...Le,...Re,...ze]),D=Object.seal(de(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$e=null,et=null,O=Object.seal(de(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),tt=!0,k=!0,A=!1,j=!0,M=!1,nt=!0,N=!1,P=!1,rt=!1,F=!1,it=!1,at=!1,ot=!0,st=!1,ct=!0,I=!1,L={},R=null,z=C({},[`annotation-xml`,`audio`,`colgroup`,`desc`,`foreignobject`,`head`,`iframe`,`math`,`mi`,`mn`,`mo`,`ms`,`mtext`,`noembed`,`noframes`,`noscript`,`plaintext`,`script`,`style`,`svg`,`template`,`thead`,`title`,`video`,`xmp`]),lt=null,ut=C({},[`audio`,`video`,`img`,`source`,`image`,`track`]),dt=null,ft=C({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),pt=`http://www.w3.org/1998/Math/MathML`,mt=`http://www.w3.org/2000/svg`,B=`http://www.w3.org/1999/xhtml`,V=B,ht=!1,gt=null,_t=C({},[pt,mt,B],be),H=C({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),U=C({},[`annotation-xml`]),vt=C({},[`title`,`style`,`font`,`a`,`script`]),yt=null,bt=[`application/xhtml+xml`,`text/html`],W=null,xt=null,St=n.createElement(`form`),Ct=function(e){return e instanceof RegExp||e instanceof Function},wt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(xt&&xt===e)){if((!e||typeof e!=`object`)&&(e={}),e=w(e),yt=bt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,W=yt===`application/xhtml+xml`?be:ye,T=b(e,`ALLOWED_TAGS`)?C({},e.ALLOWED_TAGS,W):Ue,E=b(e,`ALLOWED_ATTR`)?C({},e.ALLOWED_ATTR,W):Ge,gt=b(e,`ALLOWED_NAMESPACES`)?C({},e.ALLOWED_NAMESPACES,be):_t,dt=b(e,`ADD_URI_SAFE_ATTR`)?C(w(ft),e.ADD_URI_SAFE_ATTR,W):ft,lt=b(e,`ADD_DATA_URI_TAGS`)?C(w(ut),e.ADD_DATA_URI_TAGS,W):ut,R=b(e,`FORBID_CONTENTS`)?C({},e.FORBID_CONTENTS,W):z,$e=b(e,`FORBID_TAGS`)?C({},e.FORBID_TAGS,W):w({}),et=b(e,`FORBID_ATTR`)?C({},e.FORBID_ATTR,W):w({}),L=b(e,`USE_PROFILES`)?e.USE_PROFILES:!1,tt=e.ALLOW_ARIA_ATTR!==!1,k=e.ALLOW_DATA_ATTR!==!1,A=e.ALLOW_UNKNOWN_PROTOCOLS||!1,j=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,M=e.SAFE_FOR_TEMPLATES||!1,nt=e.SAFE_FOR_XML!==!1,N=e.WHOLE_DOCUMENT||!1,F=e.RETURN_DOM||!1,it=e.RETURN_DOM_FRAGMENT||!1,at=e.RETURN_TRUSTED_TYPE||!1,rt=e.FORCE_BODY||!1,ot=e.SANITIZE_DOM!==!1,st=e.SANITIZE_NAMED_PROPS||!1,ct=e.KEEP_CONTENT!==!1,I=e.IN_PLACE||!1,He=e.ALLOWED_URI_REGEXP||We,V=e.NAMESPACE||B,H=e.MATHML_TEXT_INTEGRATION_POINTS||H,U=e.HTML_INTEGRATION_POINTS||U,D=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Ct(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(D.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ct(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(D.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements==`boolean`&&(D.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),M&&(k=!1),it&&(F=!0),L&&(T=C({},Fe),E=de(null),L.html===!0&&(C(T,ke),C(E,Ie)),L.svg===!0&&(C(T,Ae),C(E,Le),C(E,ze)),L.svgFilters===!0&&(C(T,je),C(E,Le),C(E,ze)),L.mathMl===!0&&(C(T,Ne),C(E,Re),C(E,ze))),b(e,`ADD_TAGS`)||(O.tagCheck=null),b(e,`ADD_ATTR`)||(O.attributeCheck=null),e.ADD_TAGS&&(typeof e.ADD_TAGS==`function`?O.tagCheck=e.ADD_TAGS:(T===Ue&&(T=w(T)),C(T,e.ADD_TAGS,W))),e.ADD_ATTR&&(typeof e.ADD_ATTR==`function`?O.attributeCheck=e.ADD_ATTR:(E===Ge&&(E=w(E)),C(E,e.ADD_ATTR,W))),e.ADD_URI_SAFE_ATTR&&C(dt,e.ADD_URI_SAFE_ATTR,W),e.FORBID_CONTENTS&&(R===z&&(R=w(R)),C(R,e.FORBID_CONTENTS,W)),e.ADD_FORBID_CONTENTS&&(R===z&&(R=w(R)),C(R,e.ADD_FORBID_CONTENTS,W)),ct&&(T[`#text`]=!0),N&&C(T,[`html`,`head`,`body`]),T.table&&(C(T,[`tbody`]),delete $e.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Te(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Te(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);g=e.TRUSTED_TYPES_POLICY,ie=g.createHTML(``)}else g===void 0&&(g=Xe(p,i)),g!==null&&typeof ie==`string`&&(ie=g.createHTML(``));v&&v(e),xt=e}},Tt=C({},[...Ae,...je,...Me]),Et=C({},[...Ne,...Pe]),Dt=function(e){let t=re(e);(!t||!t.tagName)&&(t={namespaceURI:V,tagName:`template`});let n=ye(e.tagName),r=ye(t.tagName);return gt[e.namespaceURI]?e.namespaceURI===mt?t.namespaceURI===B?n===`svg`:t.namespaceURI===pt?n===`svg`&&(r===`annotation-xml`||H[r]):!!Tt[n]:e.namespaceURI===pt?t.namespaceURI===B?n===`math`:t.namespaceURI===mt?n===`math`&&U[r]:!!Et[n]:e.namespaceURI===B?t.namespaceURI===mt&&!U[r]||t.namespaceURI===pt&&!H[r]?!1:!Et[n]&&(vt[n]||!Tt[n]):!!(yt===`application/xhtml+xml`&&gt[e.namespaceURI]):!1},G=function(e){_e(t.removed,{element:e});try{re(e).removeChild(e)}catch{h(e)}},K=function(e,n){try{_e(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{_e(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(F||it)try{G(n)}catch{}else try{n.setAttribute(e,``)}catch{}},Ot=function(e){let t=null,r=null;if(rt)e=`<remove></remove>`+e;else{let t=xe(e,/^[\r\n\t ]+/);r=t&&t[0]}yt===`application/xhtml+xml`&&V===B&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=g?g.createHTML(e):e;if(V===B)try{t=new f().parseFromString(i,yt)}catch{}if(!t||!t.documentElement){t=ae.createDocument(V,`template`,null);try{t.documentElement.innerHTML=ht?ie:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),V===B?le.call(t,N?`html`:`body`)[0]:N?t.documentElement:a},kt=function(e){return oe.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},At=function(e){return e instanceof d&&(typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||!(e.attributes instanceof u)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`)},jt=function(e){return typeof s==`function`&&e instanceof s};function q(e,n,r){me(e,e=>{e.call(t,n,r,xt)})}let Mt=function(e){let n=null;if(q(_.beforeSanitizeElements,e,null),At(e))return G(e),!0;let r=W(e.nodeName);if(q(_.uponSanitizeElement,e,{tagName:r,allowedTags:T}),nt&&e.hasChildNodes()&&!jt(e.firstElementChild)&&x(/<[/\w!]/g,e.innerHTML)&&x(/<[/\w!]/g,e.textContent)||e.nodeType===Je.progressingInstruction||nt&&e.nodeType===Je.comment&&x(/<[/\w]/g,e.data))return G(e),!0;if(!(O.tagCheck instanceof Function&&O.tagCheck(r))&&(!T[r]||$e[r])){if(!$e[r]&&Pt(r)&&(D.tagNameCheck instanceof RegExp&&x(D.tagNameCheck,r)||D.tagNameCheck instanceof Function&&D.tagNameCheck(r)))return!1;if(ct&&!R[r]){let t=re(e)||e.parentNode,n=ne(e)||e.childNodes;if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=ee(n[i],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,te(e))}}}return G(e),!0}return e instanceof c&&!Dt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&x(/<\/no(script|embed|frames)/i,e.innerHTML)?(G(e),!0):(M&&e.nodeType===Je.text&&(n=e.textContent,me([y,fe,pe],e=>{n=Se(n,e,` `)}),e.textContent!==n&&(_e(t.removed,{element:e.cloneNode()}),e.textContent=n)),q(_.afterSanitizeElements,e,null),!1)},Nt=function(e,t,r){if(et[t]||ot&&(t===`id`||t===`name`)&&(r in n||r in St))return!1;if(!(k&&!et[t]&&x(S,t))&&!(tt&&x(Ee,t))&&!(O.attributeCheck instanceof Function&&O.attributeCheck(t,e))){if(!E[t]||et[t]){if(!(Pt(e)&&(D.tagNameCheck instanceof RegExp&&x(D.tagNameCheck,e)||D.tagNameCheck instanceof Function&&D.tagNameCheck(e))&&(D.attributeNameCheck instanceof RegExp&&x(D.attributeNameCheck,t)||D.attributeNameCheck instanceof Function&&D.attributeNameCheck(t,e))||t===`is`&&D.allowCustomizedBuiltInElements&&(D.tagNameCheck instanceof RegExp&&x(D.tagNameCheck,r)||D.tagNameCheck instanceof Function&&D.tagNameCheck(r))))return!1}else if(!dt[t]&&!x(He,Se(r,Be,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Ce(r,`data:`)===0&&lt[e])&&!(A&&!x(De,Se(r,Be,``)))&&r)return!1}return!0},Pt=function(e){return e!==`annotation-xml`&&xe(e,Ve)},Ft=function(e){q(_.beforeSanitizeAttributes,e,null);let{attributes:n}=e;if(!n||At(e))return;let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:E,forceKeepAttr:void 0},i=n.length;for(;i--;){let{name:a,namespaceURI:o,value:s}=n[i],c=W(a),l=s,u=a===`value`?l:we(l);if(r.attrName=c,r.attrValue=u,r.keepAttr=!0,r.forceKeepAttr=void 0,q(_.uponSanitizeAttribute,e,r),u=r.attrValue,st&&(c===`id`||c===`name`)&&(K(a,e),u=`user-content-`+u),nt&&x(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,u)){K(a,e);continue}if(c===`attributename`&&xe(u,`href`)){K(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){K(a,e);continue}if(!j&&x(/\/>/i,u)){K(a,e);continue}M&&me([y,fe,pe],e=>{u=Se(u,e,` `)});let d=W(e.nodeName);if(!Nt(d,c,u)){K(a,e);continue}if(g&&typeof p==`object`&&typeof p.getAttributeType==`function`&&!o)switch(p.getAttributeType(d,c)){case`TrustedHTML`:u=g.createHTML(u);break;case`TrustedScriptURL`:u=g.createScriptURL(u);break}if(u!==l)try{o?e.setAttributeNS(o,a,u):e.setAttribute(a,u),At(e)?G(e):ge(t.removed)}catch{K(a,e)}}q(_.afterSanitizeAttributes,e,null)},It=function e(t){let n=null,r=kt(t);for(q(_.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)q(_.uponSanitizeShadowNode,n,null),Mt(n),Ft(n),n.content instanceof a&&e(n.content);q(_.afterSanitizeShadowDOM,t,null)};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,o=null,c=null,l=null;if(ht=!e,ht&&(e=`<!-->`),typeof e!=`string`&&!jt(e))if(typeof e.toString==`function`){if(e=e.toString(),typeof e!=`string`)throw Te(`dirty is not a string, aborting`)}else throw Te(`toString is not a function`);if(!t.isSupported)return e;if(P||wt(n),t.removed=[],typeof e==`string`&&(I=!1),I){if(e.nodeName){let t=W(e.nodeName);if(!T[t]||$e[t])throw Te(`root node is forbidden and cannot be sanitized in-place`)}}else if(e instanceof s)i=Ot(`<!---->`),o=i.ownerDocument.importNode(e,!0),o.nodeType===Je.element&&o.nodeName===`BODY`||o.nodeName===`HTML`?i=o:i.appendChild(o);else{if(!F&&!M&&!N&&e.indexOf(`<`)===-1)return g&&at?g.createHTML(e):e;if(i=Ot(e),!i)return F?null:at?ie:``}i&&rt&&G(i.firstChild);let u=kt(I?e:i);for(;c=u.nextNode();)Mt(c),Ft(c),c.content instanceof a&&It(c.content);if(I)return e;if(F){if(it)for(l=ce.call(i.ownerDocument);i.firstChild;)l.appendChild(i.firstChild);else l=i;return(E.shadowroot||E.shadowrootmode)&&(l=ue.call(r,l,!0)),l}let d=N?i.outerHTML:i.innerHTML;return N&&T[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&x(Ke,i.ownerDocument.doctype.name)&&(d=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
2
2
  `+d),M&&me([y,fe,pe],e=>{d=Se(d,e,` `)}),g&&at?g.createHTML(d):d},t.setConfig=function(){wt(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),P=!0},t.clearConfig=function(){xt=null,P=!1},t.isValidAttribute=function(e,t,n){return xt||wt({}),Nt(W(e),W(t),n)},t.addHook=function(e,t){typeof t==`function`&&_e(_[e],t)},t.removeHook=function(e,t){if(t!==void 0){let n=he(_[e],t);return n===-1?void 0:ve(_[e],n,1)[0]}return ge(_[e])},t.removeHooks=function(e){_[e]=[]},t.removeAllHooks=function(){_=Ze()},t}var $e=Qe();function et(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var O=et();function tt(e){O=e}var k={exec:()=>null};function A(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(j.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var j={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`)},M=/^(?:[ \t]*(?:\n|$))+/,nt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,N=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,P=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,rt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,F=/(?:[*+-]|\d{1,9}[.)])/,it=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,at=A(it).replace(/bull/g,F).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),ot=A(it).replace(/bull/g,F).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),st=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ct=/^[^\n]+/,I=/(?!\s*\])(?:\\.|[^\[\]\\])+/,L=A(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,I).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),R=A(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,F).getRegex(),z=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,lt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ut=A(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,lt).replace(`tag`,z).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),dt=A(st).replace(`hr`,P).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,z).getRegex(),ft={blockquote:A(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,dt).getRegex(),code:nt,def:L,fences:N,heading:rt,hr:P,html:ut,lheading:at,list:R,newline:M,paragraph:dt,table:k,text:ct},pt=A(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,P).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,z).getRegex(),mt={...ft,lheading:ot,table:pt,paragraph:A(st).replace(`hr`,P).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,pt).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,z).getRegex()},B={...ft,html:A(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,lt).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:k,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:A(st).replace(`hr`,P).replace(`heading`,` *#{1,6} *[^
3
3
  ]`).replace(`lheading`,at).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},V=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ht=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,gt=/^( {2,}|\\)\n(?!\s*$)/,_t=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,H=/[\p{P}\p{S}]/u,U=/[\s\p{P}\p{S}]/u,vt=/[^\s\p{P}\p{S}]/u,yt=A(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,U).getRegex(),bt=/(?!~)[\p{P}\p{S}]/u,W=/(?!~)[\s\p{P}\p{S}]/u,xt=/(?:[^\s\p{P}\p{S}]|~)/u,St=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Ct=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,wt=A(Ct,`u`).replace(/punct/g,H).getRegex(),Tt=A(Ct,`u`).replace(/punct/g,bt).getRegex(),Et=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,Dt=A(Et,`gu`).replace(/notPunctSpace/g,vt).replace(/punctSpace/g,U).replace(/punct/g,H).getRegex(),G=A(Et,`gu`).replace(/notPunctSpace/g,xt).replace(/punctSpace/g,W).replace(/punct/g,bt).getRegex(),K=A(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,vt).replace(/punctSpace/g,U).replace(/punct/g,H).getRegex(),Ot=A(/\\(punct)/,`gu`).replace(/punct/g,H).getRegex(),kt=A(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),At=A(lt).replace(`(?:-->|$)`,`-->`).getRegex(),jt=A(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,At).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),q=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Mt=A(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace(`label`,q).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Nt=A(/^!?\[(label)\]\[(ref)\]/).replace(`label`,q).replace(`ref`,I).getRegex(),Pt=A(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,I).getRegex(),Ft={_backpedal:k,anyPunctuation:Ot,autolink:kt,blockSkip:St,br:gt,code:ht,del:k,emStrongLDelim:wt,emStrongRDelimAst:Dt,emStrongRDelimUnd:K,escape:V,link:Mt,nolink:Pt,punctuation:yt,reflink:Nt,reflinkSearch:A(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Nt).replace(`nolink`,Pt).getRegex(),tag:jt,text:_t,url:k},It={...Ft,link:A(/^!?\[(label)\]\((.*?)\)/).replace(`label`,q).getRegex(),reflink:A(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,q).getRegex()},Lt={...Ft,emStrongRDelimAst:G,emStrongLDelim:Tt,url:A(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,`i`).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Rt={...Lt,br:A(gt).replace(`{2,}`,`*`).getRegex(),text:A(Lt.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},zt={normal:ft,gfm:mt,pedantic:B},Bt={normal:Ft,gfm:Lt,breaks:Rt,pedantic:It},Vt={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},Ht=e=>Vt[e];function J(e,t){if(t){if(j.escapeTest.test(e))return e.replace(j.escapeReplace,Ht)}else if(j.escapeTestNoEncode.test(e))return e.replace(j.escapeReplaceNoEncode,Ht);return e}function Ut(e){try{e=encodeURI(e).replace(j.percentDecode,`%`)}catch{return null}return e}function Wt(e,t){let n=e.replace(j.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(j.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``);for(;r<n.length;r++)n[r]=n[r].trim().replace(j.slashPipe,`|`);return n}function Gt(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function Kt(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function qt(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function Jt(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
4
4
  `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
@@ -54,8 +54,8 @@ ${e}</tr>
54
54
  `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
55
55
  `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${J(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Ut(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+J(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Ut(e);if(i===null)return J(n);e=i;let a=`<img src="${e}" alt="${n}"`;return t&&(a+=` title="${J(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:J(e.text)}},Zt=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}},X=class e{options;renderer;textRenderer;constructor(e){this.options=e||O,this.options.renderer=this.options.renderer||new Xt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Zt}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(t!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`paragraph`,`text`].includes(e.type)){n+=t||``;continue}}let a=i;switch(a.type){case`space`:n+=this.renderer.space(a);continue;case`hr`:n+=this.renderer.hr(a);continue;case`heading`:n+=this.renderer.heading(a);continue;case`code`:n+=this.renderer.code(a);continue;case`table`:n+=this.renderer.table(a);continue;case`blockquote`:n+=this.renderer.blockquote(a);continue;case`list`:n+=this.renderer.list(a);continue;case`html`:n+=this.renderer.html(a);continue;case`paragraph`:n+=this.renderer.paragraph(a);continue;case`text`:{let i=a,o=this.renderer.text(i);for(;r+1<e.length&&e[r+1].type===`text`;)i=e[++r],o+=`
56
56
  `+this.renderer.text(i);t?n+=this.renderer.paragraph({type:`paragraph`,raw:o,text:o,tokens:[{type:`text`,raw:o,text:o,escaped:!0}]}):n+=o;continue}default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}parseInline(e,t=this.renderer){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},Qt=class{options;block;constructor(e){this.options=e||O}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?Y.lex:Y.lexInline}provideParser(){return this.block?X.parse:X.parseInline}},$t=class{defaults=et();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=X;Renderer=Xt;TextRenderer=Zt;Lexer=Y;Tokenizer=Yt;Hooks=Qt;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Xt(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new Yt(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Qt;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];Qt.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(i.call(t,e)).then(e=>a.call(t,e));let n=i.call(t,e);return a.call(t,n)}:t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Y.lex(e,t??this.defaults)}parser(e,t){return X.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(t==null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));i.hooks&&(i.hooks.options=i,i.hooks.block=e);let o=i.hooks?i.hooks.provideLexer():e?Y.lex:Y.lexInline,s=i.hooks?i.hooks.provideParser():e?X.parse:X.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(t):t).then(e=>o(e,i)).then(e=>i.hooks?i.hooks.processAllTokens(e):e).then(e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then(()=>e):e).then(e=>s(e,i)).then(e=>i.hooks?i.hooks.postprocess(e):e).catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let e=o(t,i);i.hooks&&(e=i.hooks.processAllTokens(e)),i.walkTokens&&this.walkTokens(e,i.walkTokens);let n=s(e,i);return i.hooks&&(n=i.hooks.postprocess(n)),n}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
57
- Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+J(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},en=new $t;function Z(e,t){return en.parse(e,t)}Z.options=Z.setOptions=function(e){return en.setOptions(e),Z.defaults=en.defaults,tt(Z.defaults),Z},Z.getDefaults=et,Z.defaults=O,Z.use=function(...e){return en.use(...e),Z.defaults=en.defaults,tt(Z.defaults),Z},Z.walkTokens=function(e,t){return en.walkTokens(e,t)},Z.parseInline=en.parseInline,Z.Parser=X,Z.parser=X.parse,Z.Renderer=Xt,Z.TextRenderer=Zt,Z.Lexer=Y,Z.lexer=Y.lex,Z.Tokenizer=Yt,Z.Hooks=Qt,Z.parse=Z,Z.options,Z.setOptions,Z.use,Z.walkTokens,Z.parseInline,X.parse,Y.lex;var tn=e=>(Object.getOwnPropertyNames(e).forEach(t=>{let n=e[t];n&&typeof n==`object`&&tn(n)}),Object.freeze(e)),nn=tn({all:[],used:[],unused:[]}),rn=(e,t)=>{let n=$e(e);return n.addHook(`uponSanitizeElement`,function(e,t){let n=t.tagName||e.nodeName.toLowerCase();n.startsWith(`liipgpt-`)&&(t.allowedTags[n]=!0)}),n.addHook(`afterSanitizeAttributes`,function(e){if(e.tagName!==`A`||!e.getAttribute(`href`)?.startsWith(`http`)||(e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`),!t||e.querySelector(`.sr-only`)))return;let n=e.ownerDocument.createElement(`span`);n.className=`sr-only`,n.textContent=` ${t}`,e.appendChild(n)}),n},an=class{marked;currentReferences=nn;lastUsedIndex=0;DomPurity;constructor(e={}){this.marked=new $t({async:!1,breaks:!0}).use(this.createFootnoteExtension(),...e.extensions??[]),this.DomPurity=rn(e.window,e.newTabSrText)}createFootnoteExtension=()=>{let e=this;return{extensions:[{name:`footnote`,level:`inline`,start(e){return e.match(/\[\^(\d+(?:\.\d+)?)\]/)?.index},tokenizer(e){let t=/^\[\^(\d+(?:\.\d+)?)\]/.exec(e);if(t){let[e,n]=t;return{type:`footnote`,raw:e,refNumber:n}}},renderer(t){if(t.type===`footnote`){let n=e.currentReferences.all,r=n.some(e=>e.citationId!==void 0)?n.findIndex(e=>e.citationId===t.refNumber):/^\d+$/.test(t.refNumber)?Number(t.refNumber)-1:-1,i=e.currentReferences.all[r];if(!i)return console.error(`Could not find ref for citation:`,t.refNumber),``;let a;return i?.referenceIndex.used?a=i.referenceIndex.used:(e.currentReferences.used.push(i),e.lastUsedIndex++,a=e.lastUsedIndex,i.referenceIndex.used=a),` <liipgpt-reference-number data-all-index="${r}" data-used-index="${a}" data-source="${JSON.stringify(i).replace(/"/g,`&quot;`)}"></liipgpt-reference-number>`}}}]}};parse(e){return this.DomPurity.sanitize(this.marked.parse(e),{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0,mathMl:!0},FORBID_TAGS:[`hr`],ADD_ATTR:[`target`]})}toHTML(e,t){this.currentReferences=t;let n=this.parse(e);return this.currentReferences=nn,n}};function on(){let e,t;return{promise:new Promise((n,r)=>{t=n,e=r}),reject:e,resolve:t}}var sn=class{promise;resolve;reject;constructor(){let{promise:e,resolve:t,reject:n}=on();this.promise=e,this.resolve=t,this.reject=n}then(e,t){return this.promise.then(e,t)}catch(e){return this.promise.catch(e)}finally(e){return this.promise.finally(e)}toPromise(){return this.promise}[Symbol.toStringTag]=`Flag`},cn=class{hasValue=new sn;currentValue;setValue(e){this.currentValue=e,this.hasValue.resolve()}cleanup(e){this.hasValue.reject(e)}getCurrentValue(){return this.currentValue}async toPromise(){return await this.hasValue,this.currentValue}then(e,t){return this.toPromise().then(e,t)}catch(e){return this.toPromise().catch(e)}finally(e){return this.toPromise().finally(e)}[Symbol.toStringTag]=`FutureValue`},ln=e=>{try{return new URL(e).hostname}catch{return e}};function un(e){return e.replace(/<[^>]*>/g,``).replace(/&nbsp;/g,` `).replace(/&amp;/g,`&`).replace(/&lt;/g,`<`).replace(/&gt;/g,`>`).replace(/&quot;/g,`"`)}var dn=({citationId:e,url:t,considered:n,title:r,description:i,summary:a})=>{let o=ln(t),s=i||a;return{...e?{citationId:e}:{},url:t,considered:n,referenceIndex:{},score:0,metadata:{},display:{card:{title:r,description:s,badge:t},listItem:{title:r,badge:o}}}},fn=class{store;content=new cn;backendSendsMappedRefs=!1;constructor(e){this.options=e,this.store=n({id:e.id,state:`loading`,errors:[],type:`bot`,time:new Date().toISOString(),message:{markdown:``,html:``,text:``},references:{all:[],used:[],unused:[]},retrievalQuestion:e.userQuestion})}pushError(e,t){this.options.onError?.(e,t),this.store.update(t=>({...t,errors:[...t.errors,e]}))}updateRequestId(e){this.store.update(t=>({...t,id:e}))}updateText(e){this.store.update(t=>{let n=t.message.markdown+e,r=this.options.markdownRenderer.toHTML(n,t.references);return{...t,state:`streaming`,message:{markdown:n,html:r,text:``}}})}finishMessage(){this.store.update(e=>{let t={...e,state:`done`};return t.references.unused=t.references.all.filter(e=>e.referenceIndex.used===void 0),t.message.text=un(t.message.html),this.options?.onFinish?.(t),this.content.setValue(t),t})}addReference(e){this.store.update(t=>{let n=t.references.all,r=n.length,i=[...n,{...e,referenceIndex:{all:r}}];return{...t,references:{used:t.references.used,all:i}}})}addMappedReference(e){this.backendSendsMappedRefs=!0,this.addReference(e)}addOldReference(e){this.backendSendsMappedRefs||this.addReference(dn(e))}updateRetrievalQuestion(e){this.store.update(t=>({...t,retrievalQuestion:e}))}setNoFeedback(){this.store.update(e=>({...e,noFeedback:!0}))}getReadableStore(){return{subscribe:this.store.subscribe}}getPromise(){return this.content.toPromise()}},pn=[{type:`email`,check:e=>/\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}\b/.test(e)},{type:`creditCard`,check:e=>/\b(?:\d[ -]*?){13,16}\b/.test(e)},{type:`ahv`,check:e=>/\b756[.\s-]?\d{2,4}[.\s-]?\d{2,4}[.\s-]?\d{2}\b/.test(e)},{type:`phoneSwiss`,check:e=>/\b0(?:\s*\d){2}(?:\s*\/\s*)?(?:\s*\d){7,}\b/.test(e)},{type:`phoneInternational`,check:e=>/(?:\+|00)(?:\s*\d){10,}\b/.test(e)},{type:`swissPassport`,check:e=>/\b[A-HJ-NP-Z](?=.*\d)[A-HJ-NP-Z0-9]{7}\b/.test(e)},{type:`longNumber`,check:e=>/\b\d{9,}\b/.test(e)}],mn=e=>{for(let t of pn)if(t.check(e))return t.type},hn=class{id;constructor(e){this.chatResponseData=e,this.id=this.chatResponseData.id}async isReadyForFeedback(){return await this.chatResponseData.readyForFeedback.toPromise(),!0}subscribe(e,t){return this.chatResponseData.readableStore.subscribe(e,t)}getContent(){return this.chatResponseData.content.toPromise()}abort(){return this.chatResponseData.abort()}async thumbsUp(){await this.isReadyForFeedback(),await this.chatResponseData.liipgptClientPrimitive.thumbsUp(this.id,this.chatResponseData.question)}async thumbsDown(){await this.isReadyForFeedback(),await this.chatResponseData.liipgptClientPrimitive.thumbsDown(this.id,this.chatResponseData.question)}async feedback(e){await this.isReadyForFeedback(),await this.chatResponseData.liipgptClientPrimitive.feedback(this.id,this.chatResponseData.question,e)}},gn=class{latestRequest=new cn;state=n({state:`idle`});id;history=[];constructor(e){this.clientPrimitive=e,this.id=e.createConversationId()}subscribe(e){return this.state.subscribe(e)}chat(e,t={}){let n=this.clientPrimitive.chat(this.id,e,t);return this.history.push(n),this.latestRequest.setValue({question:e,response:n}),n}async abort(){let e=this.history.map(e=>e.abort());await Promise.all(e)}async thumbsUp(){let{question:e,response:t}=await this.latestRequest;await t.isReadyForFeedback(),await this.clientPrimitive.thumbsUp(t.id,e)}async thumbsDown(){let{question:e,response:t}=await this.latestRequest;await t.isReadyForFeedback(),await this.clientPrimitive.thumbsDown(t.id,e)}async feedback(e){let{question:t,response:n}=await this.latestRequest;await n.isReadyForFeedback(),await this.clientPrimitive.feedback(n.id,t,e)}},Q=[];for(let e=0;e<256;++e)Q.push((e+256).toString(16).slice(1));function _n(e,t=0){return(Q[e[t+0]]+Q[e[t+1]]+Q[e[t+2]]+Q[e[t+3]]+`-`+Q[e[t+4]]+Q[e[t+5]]+`-`+Q[e[t+6]]+Q[e[t+7]]+`-`+Q[e[t+8]]+Q[e[t+9]]+`-`+Q[e[t+10]]+Q[e[t+11]]+Q[e[t+12]]+Q[e[t+13]]+Q[e[t+14]]+Q[e[t+15]]).toLowerCase()}var vn,yn=new Uint8Array(16);function bn(){if(!vn){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);vn=crypto.getRandomValues.bind(crypto)}return vn(yn)}var xn={};function Sn(e,t,n){let r;if(e)r=wn(e.random??e.rng?.()??bn(),e.msecs,e.seq,t,n);else{let e=Date.now(),i=bn();Cn(xn,e,i),r=wn(i,xn.msecs,xn.seq,t,n)}return t??_n(r)}function Cn(e,t,n){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=n[6]<<23|n[7]<<16|n[8]<<8|n[9],e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function wn(e,t,n,r,i=0){if(e.length<16)throw Error(`Random bytes length must be >= 16`);if(!r)r=new Uint8Array(16),i=0;else if(i<0||i+16>r.length)throw RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),n??=e[6]*127<<24|e[7]<<16|e[8]<<8|e[9],r[i++]=t/1099511627776&255,r[i++]=t/4294967296&255,r[i++]=t/16777216&255,r[i++]=t/65536&255,r[i++]=t/256&255,r[i++]=t&255,r[i++]=112|n>>>28&15,r[i++]=n>>>20&255,r[i++]=128|n>>>14&63,r[i++]=n>>>6&255,r[i++]=n<<2&255|e[10]&3,r[i++]=e[11],r[i++]=e[12],r[i++]=e[13],r[i++]=e[14],r[i++]=e[15],r}var Tn=new Map,En=class{get length(){return Tn.size}clear(){Tn.clear()}getItem(e){return Tn.get(e)||null}key(e){return Array.from(Tn.keys())[e]||null}removeItem(e){Tn.delete(e)}setItem(e,t){Tn.set(e,String(t))}},Dn=globalThis.localStorage??new En,On=async(e,t)=>{try{let n=Dn.getItem(`liipgpt:uID`)||Dn.getItem(`uID`),r={method:`POST`,headers:{Accept:`application/json`,"Content-Type":`application/json`},body:JSON.stringify({referrer:globalThis?.document?.referrer||null,uID:n,...t?{startParameters:t}:{}})},i=await e.fetchData(`/login`,ne,{},r).catch(t=>(console.log(`Failed to /login use /log`,t),e.fetchData(`/log`,ne,{},r)));if(`maintenance`in i&&i.maintenance)return{mode:`maintenance`};if(!(`id`in i))throw Error(`Invalid response format: missing user id`);return Dn.setItem(`liipgpt:uID`,i.id),{mode:`ready`,userId:i.id}}catch(e){throw console.error(`Failed to fetch user data:`,e),e}},$=function(e,t){if(!(this instanceof $))return new $(e,t);this.url=e,t||={},this.headers=t.headers||{},this.payload=t.payload===void 0?``:t.payload,this.method=t.method||this.payload&&`POST`||`GET`,this.withCredentials=!!t.withCredentials,this.debug=!!t.debug,this.autoReconnect=t.autoReconnect===void 0?!1:t.autoReconnect,this.reconnectDelay=t.reconnectDelay===void 0?3e3:t.reconnectDelay,this.maxRetries=t.maxRetries===void 0?null:t.maxRetries,this.retryCount=0,this.reconnectTimer=null,this.useLastEventId=t.useLastEventId===void 0?!0:t.useLastEventId,this.FIELD_SEPARATOR=`:`,this.listeners={},this.xhr=null,this.readyState=$.INITIALIZING,this.progress=0,this.chunk=``,this.lastEventId=``,this._hasParsedBom=!1,this.addEventListener=function(e,t){this.listeners[e]===void 0&&(this.listeners[e]=[]),this.listeners[e].indexOf(t)===-1&&this.listeners[e].push(t)},this.removeEventListener=function(e,t){if(this.listeners[e]===void 0)return;let n=[];this.listeners[e].forEach(function(e){e!==t&&n.push(e)}),n.length===0?delete this.listeners[e]:this.listeners[e]=n},this.dispatchEvent=function(e){if(!e)return!0;this.debug&&console.debug(e),e.source=this;let t=`on`+e.type;return this.hasOwnProperty(t)&&(this[t].call(this,e),e.defaultPrevented)?!1:this.listeners[e.type]?this.listeners[e.type].every(function(t){return t(e),!e.defaultPrevented}):!0},this._markClosed=function(){if(this.xhr=null,this.progress=0,this.chunk=``,this._setReadyState($.CLOSED),this.autoReconnect){if(this.maxRetries!==null&&this.retryCount>=this.maxRetries){this.debug&&console.debug(`SSE max retries (${this.maxRetries}) reached, stopping reconnection attempts`),this.autoReconnect=!1,this.close();return}this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.debug&&console.debug(`SSE will attempt to reconnect in ${this.reconnectDelay}ms (attempt ${this.retryCount+1}${this.maxRetries?`/`+this.maxRetries:``})`),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.retryCount++,this.stream()},this.reconnectDelay)}},this._setReadyState=function(e){let t=new CustomEvent(`readystatechange`);t.readyState=e,this.readyState=e,this.dispatchEvent(t)},this._onStreamFailure=function(e){let t=new CustomEvent(`error`);t.responseCode=e.currentTarget.status,t.data=e.currentTarget.response,this.dispatchEvent(t),this._markClosed()},this._onStreamAbort=function(){this.dispatchEvent(new CustomEvent(`abort`)),this._markClosed()},this._onStreamProgress=function(e){if(!this.xhr)return;if(this.xhr.status<200||this.xhr.status>=300){this._onStreamFailure(e);return}this.retryCount=0;let t=this.xhr.responseText.substring(this.progress);this.progress+=t.length,!this._hasParsedBom&&this.chunk.length===0&&(t.charCodeAt(0)===65279&&(t=t.substring(1)),this._hasParsedBom=!0);let n=(this.chunk+t).split(/(\r\n\r\n|\r\r|\n\n)/g),r=n.pop();n.forEach(function(e){e.trim().length>0&&this.dispatchEvent(this._parseEventChunk(e))}.bind(this)),this.chunk=r},this._onStreamLoaded=function(e){this._onStreamProgress(e),this.dispatchEvent(this._parseEventChunk(this.chunk)),this.chunk=``,this._markClosed()},this._parseEventChunk=function(e){if(!e||e.length===0)return null;this.debug&&console.debug(e);let t={id:null,retry:null,data:null,event:null};if(e.split(/\n|\r\n|\r/).forEach(function(e){let n=e.indexOf(this.FIELD_SEPARATOR),r,i;if(n>0){let t=e[n+1]===` `?2:1;r=e.substring(0,n),i=e.substring(n+t)}else if(n<0)r=e,i=``;else return;r in t&&(r===`data`&&t[r]!==null?t.data+=`
57
+ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+J(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},en=new $t;function Z(e,t){return en.parse(e,t)}Z.options=Z.setOptions=function(e){return en.setOptions(e),Z.defaults=en.defaults,tt(Z.defaults),Z},Z.getDefaults=et,Z.defaults=O,Z.use=function(...e){return en.use(...e),Z.defaults=en.defaults,tt(Z.defaults),Z},Z.walkTokens=function(e,t){return en.walkTokens(e,t)},Z.parseInline=en.parseInline,Z.Parser=X,Z.parser=X.parse,Z.Renderer=Xt,Z.TextRenderer=Zt,Z.Lexer=Y,Z.lexer=Y.lex,Z.Tokenizer=Yt,Z.Hooks=Qt,Z.parse=Z,Z.options,Z.setOptions,Z.use,Z.walkTokens,Z.parseInline,X.parse,Y.lex;var tn=e=>(Object.getOwnPropertyNames(e).forEach(t=>{let n=e[t];n&&typeof n==`object`&&tn(n)}),Object.freeze(e)),nn=tn({all:[],used:[],unused:[]}),rn=(e,t)=>{let n=$e(e);return n.addHook(`uponSanitizeElement`,function(e,t){let n=t.tagName||e.nodeName.toLowerCase();n.startsWith(`liipgpt-`)&&(t.allowedTags[n]=!0)}),n.addHook(`afterSanitizeAttributes`,function(e){if(e.tagName!==`A`||!e.getAttribute(`href`)?.startsWith(`http`)||(e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`),!t||e.querySelector(`.sr-only`)))return;let n=e.ownerDocument.createElement(`span`);n.className=`sr-only`,n.textContent=` ${t}`,e.appendChild(n)}),n},an=class{marked;currentReferences=nn;lastUsedIndex=0;DomPurity;constructor(e={}){this.marked=new $t({async:!1,breaks:!0}).use(this.createFootnoteExtension(),...e.extensions??[]),this.DomPurity=rn(e.window,e.newTabSrText)}createFootnoteExtension=()=>{let e=this;return{extensions:[{name:`footnote`,level:`inline`,start(e){return e.match(/\[\^(\d+(?:\.\d+)?)\]/)?.index},tokenizer(e){let t=/^\[\^(\d+(?:\.\d+)?)\]/.exec(e);if(t){let[e,n]=t;return{type:`footnote`,raw:e,refNumber:n}}},renderer(t){if(t.type===`footnote`){let n=e.currentReferences.all,r=n.some(e=>e.citationId!==void 0)?n.findIndex(e=>e.citationId===t.refNumber):/^\d+$/.test(t.refNumber)?Number(t.refNumber)-1:-1,i=e.currentReferences.all[r];if(!i)return console.error(`Could not find ref for citation:`,t.refNumber),``;let a;return i?.referenceIndex.used?a=i.referenceIndex.used:(e.currentReferences.used.push(i),e.lastUsedIndex++,a=e.lastUsedIndex,i.referenceIndex.used=a),` <liipgpt-reference-number data-all-index="${r}" data-used-index="${a}" data-source="${JSON.stringify(i).replace(/"/g,`&quot;`)}"></liipgpt-reference-number>`}}}]}};parse(e){return this.DomPurity.sanitize(this.marked.parse(e),{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0,mathMl:!0},FORBID_TAGS:[`hr`],ADD_ATTR:[`target`]})}toHTML(e,t){this.currentReferences=t;let n=this.parse(e);return this.currentReferences=nn,n}};function on(){let e,t;return{promise:new Promise((n,r)=>{t=n,e=r}),reject:e,resolve:t}}var sn=class{promise;resolve;reject;constructor(){let{promise:e,resolve:t,reject:n}=on();this.promise=e,this.resolve=t,this.reject=n}then(e,t){return this.promise.then(e,t)}catch(e){return this.promise.catch(e)}finally(e){return this.promise.finally(e)}toPromise(){return this.promise}[Symbol.toStringTag]=`Flag`},cn=class{hasValue=new sn;currentValue;setValue(e){this.currentValue=e,this.hasValue.resolve()}cleanup(e){this.hasValue.reject(e)}getCurrentValue(){return this.currentValue}async toPromise(){return await this.hasValue,this.currentValue}then(e,t){return this.toPromise().then(e,t)}catch(e){return this.toPromise().catch(e)}finally(e){return this.toPromise().finally(e)}[Symbol.toStringTag]=`FutureValue`},ln=e=>{try{return new URL(e).hostname}catch{return e}};function un(e){return e.replace(/<[^>]*>/g,``).replace(/&nbsp;/g,` `).replace(/&amp;/g,`&`).replace(/&lt;/g,`<`).replace(/&gt;/g,`>`).replace(/&quot;/g,`"`)}var dn=({citationId:e,url:t,considered:n,title:r,description:i,summary:a})=>{let o=ln(t),s=i||a;return{...e?{citationId:e}:{},url:t,considered:n,referenceIndex:{},score:0,metadata:{},display:{card:{title:r,description:s,badge:t},listItem:{title:r,badge:o}}}},fn=class{store;content=new cn;backendSendsMappedRefs=!1;constructor(e){this.options=e,this.store=n({id:e.id,state:`loading`,errors:[],type:`bot`,time:new Date().toISOString(),message:{markdown:``,html:``,text:``},references:{all:[],used:[],unused:[]},retrievalQuestion:e.userQuestion})}pushError(e,t){this.options.onError?.(e,t),this.store.update(t=>({...t,errors:[...t.errors,e]}))}updateRequestId(e){this.store.update(t=>({...t,id:e}))}updateText(e){this.store.update(t=>{let n=t.message.markdown+e,r=this.options.markdownRenderer.toHTML(n,t.references);return{...t,state:`streaming`,message:{markdown:n,html:r,text:``}}})}finishMessage(){this.store.update(e=>{let t={...e,state:`done`};return t.references.unused=t.references.all.filter(e=>e.referenceIndex.used===void 0),t.message.text=un(t.message.html),this.options?.onFinish?.(t),this.content.setValue(t),t})}addReference(e){this.store.update(t=>{let n=t.references.all,r=n.length,i=[...n,{...e,referenceIndex:{all:r}}];return{...t,references:{used:t.references.used,all:i}}})}addMappedReference(e){this.backendSendsMappedRefs=!0,this.addReference(e)}addOldReference(e){this.backendSendsMappedRefs||this.addReference(dn(e))}updateRetrievalQuestion(e){this.store.update(t=>({...t,retrievalQuestion:e}))}setNoFeedback(){this.store.update(e=>({...e,noFeedback:!0}))}getReadableStore(){return{subscribe:this.store.subscribe}}getPromise(){return this.content.toPromise()}},pn=[{type:`email`,check:e=>/\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}\b/.test(e)},{type:`creditCard`,check:e=>/\b(?:\d[ -]*?){13,16}\b/.test(e)},{type:`ahv`,check:e=>/\b756[.\s-]?\d{2,4}[.\s-]?\d{2,4}[.\s-]?\d{2}\b/.test(e)},{type:`phoneSwiss`,check:e=>/\b0(?:\s*\d){2}(?:\s*\/\s*)?(?:\s*\d){7,}\b/.test(e)},{type:`phoneInternational`,check:e=>/(?:\+|00)(?:\s*\d){10,}\b/.test(e)},{type:`swissPassport`,check:e=>/\b[A-HJ-NP-Z](?=.*\d)[A-HJ-NP-Z0-9]{7}\b/.test(e)},{type:`longNumber`,check:e=>/\b\d{9,}\b/.test(e)}],mn=e=>{for(let t of pn)if(t.check(e))return t.type},hn=class{id;constructor(e){this.chatResponseData=e,this.id=this.chatResponseData.id}async isReadyForFeedback(){return await this.chatResponseData.readyForFeedback.toPromise(),!0}subscribe(e,t){return this.chatResponseData.readableStore.subscribe(e,t)}getContent(){return this.chatResponseData.content.toPromise()}abort(){return this.chatResponseData.abort()}async thumbsUp(){await this.isReadyForFeedback(),await this.chatResponseData.liipgptClientPrimitive.thumbsUp(this.id,this.chatResponseData.question)}async thumbsDown(){await this.isReadyForFeedback(),await this.chatResponseData.liipgptClientPrimitive.thumbsDown(this.id,this.chatResponseData.question)}async feedback(e){await this.isReadyForFeedback(),await this.chatResponseData.liipgptClientPrimitive.feedback(this.id,this.chatResponseData.question,e)}},gn=class{latestRequest=new cn;state=n({state:`idle`});id;history=[];constructor(e){this.clientPrimitive=e,this.id=e.createConversationId()}subscribe(e){return this.state.subscribe(e)}chat(e,t={}){let n=this.clientPrimitive.chat(this.id,e,t);return this.history.push(n),this.latestRequest.setValue({question:e,response:n}),n}async abort(){let e=this.history.map(e=>e.abort());await Promise.all(e)}async thumbsUp(){let{question:e,response:t}=await this.latestRequest;await t.isReadyForFeedback(),await this.clientPrimitive.thumbsUp(t.id,e)}async thumbsDown(){let{question:e,response:t}=await this.latestRequest;await t.isReadyForFeedback(),await this.clientPrimitive.thumbsDown(t.id,e)}async feedback(e){let{question:t,response:n}=await this.latestRequest;await n.isReadyForFeedback(),await this.clientPrimitive.feedback(n.id,t,e)}},Q=[];for(let e=0;e<256;++e)Q.push((e+256).toString(16).slice(1));function _n(e,t=0){return(Q[e[t+0]]+Q[e[t+1]]+Q[e[t+2]]+Q[e[t+3]]+`-`+Q[e[t+4]]+Q[e[t+5]]+`-`+Q[e[t+6]]+Q[e[t+7]]+`-`+Q[e[t+8]]+Q[e[t+9]]+`-`+Q[e[t+10]]+Q[e[t+11]]+Q[e[t+12]]+Q[e[t+13]]+Q[e[t+14]]+Q[e[t+15]]).toLowerCase()}var vn,yn=new Uint8Array(16);function bn(){if(!vn){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);vn=crypto.getRandomValues.bind(crypto)}return vn(yn)}var xn={};function Sn(e,t,n){let r;if(e)r=wn(e.random??e.rng?.()??bn(),e.msecs,e.seq,t,n);else{let e=Date.now(),i=bn();Cn(xn,e,i),r=wn(i,xn.msecs,xn.seq,t,n)}return t??_n(r)}function Cn(e,t,n){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=n[6]<<23|n[7]<<16|n[8]<<8|n[9],e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function wn(e,t,n,r,i=0){if(e.length<16)throw Error(`Random bytes length must be >= 16`);if(!r)r=new Uint8Array(16),i=0;else if(i<0||i+16>r.length)throw RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),n??=e[6]*127<<24|e[7]<<16|e[8]<<8|e[9],r[i++]=t/1099511627776&255,r[i++]=t/4294967296&255,r[i++]=t/16777216&255,r[i++]=t/65536&255,r[i++]=t/256&255,r[i++]=t&255,r[i++]=112|n>>>28&15,r[i++]=n>>>20&255,r[i++]=128|n>>>14&63,r[i++]=n>>>6&255,r[i++]=n<<2&255|e[10]&3,r[i++]=e[11],r[i++]=e[12],r[i++]=e[13],r[i++]=e[14],r[i++]=e[15],r}var Tn=new Map,En=class{get length(){return Tn.size}clear(){Tn.clear()}getItem(e){return Tn.get(e)||null}key(e){return Array.from(Tn.keys())[e]||null}removeItem(e){Tn.delete(e)}setItem(e,t){Tn.set(e,String(t))}},Dn=globalThis.localStorage??new En,On=async(e,t)=>{try{let n=Dn.getItem(`liipgpt:uID`)||Dn.getItem(`uID`),r={method:`POST`,headers:{Accept:`application/json`,"Content-Type":`application/json`},body:JSON.stringify({referrer:globalThis?.document?.referrer||null,uID:n,...t?{startParameters:t}:{}})},i=await e.fetchData(`/login`,g,{},r).catch(t=>(console.log(`Failed to /login use /log`,t),e.fetchData(`/log`,g,{},r)));if(`maintenance`in i&&i.maintenance)return{mode:`maintenance`};if(!(`id`in i))throw Error(`Invalid response format: missing user id`);return Dn.setItem(`liipgpt:uID`,i.id),{mode:`ready`,userId:i.id}}catch(e){throw console.error(`Failed to fetch user data:`,e),e}},$=function(e,t){if(!(this instanceof $))return new $(e,t);this.url=e,t||={},this.headers=t.headers||{},this.payload=t.payload===void 0?``:t.payload,this.method=t.method||this.payload&&`POST`||`GET`,this.withCredentials=!!t.withCredentials,this.debug=!!t.debug,this.autoReconnect=t.autoReconnect===void 0?!1:t.autoReconnect,this.reconnectDelay=t.reconnectDelay===void 0?3e3:t.reconnectDelay,this.maxRetries=t.maxRetries===void 0?null:t.maxRetries,this.retryCount=0,this.reconnectTimer=null,this.useLastEventId=t.useLastEventId===void 0?!0:t.useLastEventId,this.FIELD_SEPARATOR=`:`,this.listeners={},this.xhr=null,this.readyState=$.INITIALIZING,this.progress=0,this.chunk=``,this.lastEventId=``,this._hasParsedBom=!1,this.addEventListener=function(e,t){this.listeners[e]===void 0&&(this.listeners[e]=[]),this.listeners[e].indexOf(t)===-1&&this.listeners[e].push(t)},this.removeEventListener=function(e,t){if(this.listeners[e]===void 0)return;let n=[];this.listeners[e].forEach(function(e){e!==t&&n.push(e)}),n.length===0?delete this.listeners[e]:this.listeners[e]=n},this.dispatchEvent=function(e){if(!e)return!0;this.debug&&console.debug(e),e.source=this;let t=`on`+e.type;return this.hasOwnProperty(t)&&(this[t].call(this,e),e.defaultPrevented)?!1:this.listeners[e.type]?this.listeners[e.type].every(function(t){return t(e),!e.defaultPrevented}):!0},this._markClosed=function(){if(this.xhr=null,this.progress=0,this.chunk=``,this._setReadyState($.CLOSED),this.autoReconnect){if(this.maxRetries!==null&&this.retryCount>=this.maxRetries){this.debug&&console.debug(`SSE max retries (${this.maxRetries}) reached, stopping reconnection attempts`),this.autoReconnect=!1,this.close();return}this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.debug&&console.debug(`SSE will attempt to reconnect in ${this.reconnectDelay}ms (attempt ${this.retryCount+1}${this.maxRetries?`/`+this.maxRetries:``})`),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.retryCount++,this.stream()},this.reconnectDelay)}},this._setReadyState=function(e){let t=new CustomEvent(`readystatechange`);t.readyState=e,this.readyState=e,this.dispatchEvent(t)},this._onStreamFailure=function(e){let t=new CustomEvent(`error`);t.responseCode=e.currentTarget.status,t.data=e.currentTarget.response,this.dispatchEvent(t),this._markClosed()},this._onStreamAbort=function(){this.dispatchEvent(new CustomEvent(`abort`)),this._markClosed()},this._onStreamProgress=function(e){if(!this.xhr)return;if(this.xhr.status<200||this.xhr.status>=300){this._onStreamFailure(e);return}this.retryCount=0;let t=this.xhr.responseText.substring(this.progress);this.progress+=t.length,!this._hasParsedBom&&this.chunk.length===0&&(t.charCodeAt(0)===65279&&(t=t.substring(1)),this._hasParsedBom=!0);let n=(this.chunk+t).split(/(\r\n\r\n|\r\r|\n\n)/g),r=n.pop();n.forEach(function(e){e.trim().length>0&&this.dispatchEvent(this._parseEventChunk(e))}.bind(this)),this.chunk=r},this._onStreamLoaded=function(e){this._onStreamProgress(e),this.dispatchEvent(this._parseEventChunk(this.chunk)),this.chunk=``,this._markClosed()},this._parseEventChunk=function(e){if(!e||e.length===0)return null;this.debug&&console.debug(e);let t={id:null,retry:null,data:null,event:null};if(e.split(/\n|\r\n|\r/).forEach(function(e){let n=e.indexOf(this.FIELD_SEPARATOR),r,i;if(n>0){let t=e[n+1]===` `?2:1;r=e.substring(0,n),i=e.substring(n+t)}else if(n<0)r=e,i=``;else return;r in t&&(r===`data`&&t[r]!==null?t.data+=`
58
58
  `+i:t[r]=i)}.bind(this)),t.id!==null&&t.id.indexOf(`\0`)===-1&&(this.lastEventId=t.id),t.retry!==null&&/^[0-9]+$/.test(t.retry)&&(this.reconnectDelay=parseInt(t.retry,10)),t.data===null)return null;let n=new CustomEvent(t.event||`message`);return n.id=t.id,n.data=t.data||``,n.lastEventId=this.lastEventId,n},this._onReadyStateChange=function(){if(this.xhr&&this.xhr.readyState===XMLHttpRequest.HEADERS_RECEIVED){let e={},t=this.xhr.getAllResponseHeaders().trim().split(`\r
59
59
  `);for(let n of t){let[t,...r]=n.split(`:`),i=r.join(`:`).trim();e[t.trim().toLowerCase()]=e[t.trim().toLowerCase()]||[],e[t.trim().toLowerCase()].push(i)}let n=new CustomEvent(`open`);n.responseCode=this.xhr.status,n.headers=e,this.dispatchEvent(n),this._setReadyState($.OPEN)}},this.stream=function(){if(!this.xhr){this._setReadyState($.CONNECTING),this.xhr=new XMLHttpRequest,this.xhr.addEventListener(`progress`,this._onStreamProgress.bind(this)),this.xhr.addEventListener(`load`,this._onStreamLoaded.bind(this)),this.xhr.addEventListener(`readystatechange`,this._onReadyStateChange.bind(this)),this.xhr.addEventListener(`error`,this._onStreamFailure.bind(this)),this.xhr.addEventListener(`abort`,this._onStreamAbort.bind(this)),this.xhr.open(this.method,this.url);for(let e in this.headers)this.xhr.setRequestHeader(e,this.headers[e]);this.useLastEventId&&this.lastEventId.length>0&&this.xhr.setRequestHeader(`Last-Event-ID`,this.lastEventId),this.xhr.withCredentials=this.withCredentials,this.xhr.send(this.payload)}},this.close=function(){this.reconnectTimer&&=(clearTimeout(this.reconnectTimer),null),this.autoReconnect=!1,this.xhr&&this.xhr.abort()},(t.start===void 0||t.start)&&this.stream()};$.INITIALIZING=-1,$.CONNECTING=0,$.OPEN=1,$.CLOSED=2;var kn=class{eventSource;triggeredOnClose=!1;constructor(e,t,n){this.options=t,this.payload=n;let r={headers:{"content-type":`application/json`}};n&&(r.payload=JSON.stringify(n)),t.apiKey&&(r.headers[`api-key`]=t.apiKey),this.eventSource=new(t.EventSource??$)(e,r),this.eventSource.onmessage=e=>{try{let n=JSON.parse(e.data);t.onMessage(n)}catch(e){t.onError(new CustomEvent(`parse-error`,{detail:e}))}},this.eventSource.onerror=e=>{t.onError(e),this.isClosed()&&this.close()}}isClosed(){return this.eventSource.readyState===EventSource.CLOSED}close(){this.isClosed()||this.eventSource.close(),this.triggeredOnClose||(this.triggeredOnClose=!0,this.options.onClose())}},An=e=>Object.fromEntries(Object.entries(e).filter(([e,t])=>t!=null)),jn=class{constructor(e){this.options=e}getDefaultHeaders(e={}){let t={"Content-Type":`application/json`,...e};return this.options.apiKey&&(t[`api-key`]=this.options.apiKey),t}get speechRecognitionApiKey(){return this.options.speechRecognitionApiKey}async subscribeSse(e,t={},n){let r=An(t);return this.options.apiKey&&(n.apiKey=this.options.apiKey),new kn(`${this.options.apiUrl}${e}`,n,r)}async fetchData(e,t,n={},r={}){let i=`${this.options.apiUrl}${e}?${new URLSearchParams(An(n)).toString()}`,a={...r,headers:this.getDefaultHeaders(r?.headers)},o=await fetch(i,a);if(!o.ok){let e=await o.text();throw Error(`API request failed: ${o.status} - ${e}`)}let s=await o.json(),{success:c,data:l,error:u}=t.safeParse(s);if(this.options.strict){if(!c)throw console.error(`Server response has wrong type:
60
60
  `,{error:u,url:i,opts:a,data:s}),Error(`Server response has wrong type: ${u.message}`);return l}else return c||console.warn(`Server response has wrong type:
61
- `,{error:u,url:i,opts:a,data:s}),s}async postData(e,t){let n=await fetch(`${this.options.apiUrl}${e}`,{method:`POST`,headers:this.getDefaultHeaders(),body:JSON.stringify(t)});if(!n.ok){let e=await n.text();throw Error(`${n.status} - ${e}`)}return n}async postFormData(e,t){let n=await fetch(`${this.options.apiUrl}${e}`,{method:`POST`,body:t});if(!n.ok){let e=await n.text();throw Error(`${n.status} - ${e}`)}return n}},Mn=m({links:u(d([m({url:f(l()),title:f(te()),considered:f(ee()),orgMetadata:f(m({authors:f(u(te()))})),type:f(te()),date:f(re()),similarity:f(h()),content:f(te()),fromFullTextSearch:f(ee()),rerank:f(m({index:f(p()),adjustment:f(h()),score:f(h()),similarityOld:f(h())}))}),oe]))}),Nn=e=>{if(`metadata`in e)return e;console.warn(`Please upgrade your backend you are currently using an old api feature.`);let t=e.orgMetadata??{};e?.fromFullTextSearch&&(t.fromFullTextSearch=e?.fromFullTextSearch),e?.rerank&&(t.rerank=e?.rerank);let n=[],r=e.title??``;if(e.title&&e.title.includes(` > `)){let t=e.title.split(` > `);r=t.pop()??``,n=t}return{url:e.url??``,title:r,score:e.similarity||0,breadcrumbs:n,metadata:t,description:e.content,date:e.date}},Pn=7,Fn=8,In=160,Ln=e=>{let t=[],n=0;for(;n<e.length;){let r=e[n];if(r===`<`){let r=e.indexOf(`>`,n);if(r!==-1){t.push({type:`tag`,value:e.slice(n,r+1)}),n=r+1;continue}}if(/\s/.test(r)){let r=n;for(;r<e.length&&/\s/.test(e[r]);)r++;t.push({type:`space`,value:e.slice(n,r)}),n=r;continue}let i=n;for(;i<e.length&&!/\s/.test(e[i])&&e[i]!==`<`;)i++;t.push({type:`word`,value:e.slice(n,i)}),n=i}return t},Rn=e=>{let t=Ln(e),n=[],r=``,i=!1;for(let e of t)e.type===`space`&&i?(n.push(r),r=e.value,i=!1):(r+=e.value,e.type===`word`&&(i=!0));return r&&n.push(r),n},zn=e=>Math.max(Fn,Math.min(In,e.length*Pn)),Bn=class{queue=[];timeoutId=null;isProcessing=!1;constructor(e){this.onText=e}ingestText(e){let t=Rn(e);if(t.length>=5){for(let e of t)this.queue.push({kind:`text`,chunk:e,delayMs:zn(e)});this.kickoff();return}this.runAfterTyping(()=>this.onText(e))}runAfterTyping(e){if(this.queue.length===0&&!this.isProcessing){e();return}this.queue.push({kind:`fn`,fn:e}),this.kickoff()}runWithWarmup(e){this.queue.push({kind:`fn`,fn:e}),this.kickoff()}clear(){this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null),this.queue=[],this.isProcessing=!1}kickoff(){this.isProcessing||this.timeoutId!==null||(this.timeoutId=setTimeout(()=>{this.timeoutId=null,this.processNext()},750))}processNext(){let e=this.queue.shift();if(!e){this.isProcessing=!1;return}this.isProcessing=!0,e.kind===`text`?(this.onText(e.chunk),this.timeoutId=setTimeout(()=>{this.timeoutId=null,this.processNext()},e.delayMs)):(e.fn(),this.processNext())}},Vn=class{constructor(e){this.results=e}},Hn=45e3,Un=class{internalData;renderers=new Map;markedExtensions=[];_newTabSrText;chatTimeout;constructor(e){this.chatTimeout=e.chatTimeout??Hn;let t=new jn({apiUrl:e.apiUrl,apiKey:e.apiKey,speechRecognitionApiKey:e.speechRecognitionApiKey,strict:e.strict??!1,EventSource:e.EventSource??EventSource});this.internalData={restClient:t,metadata:On(t,e.startParameters),searchResponseMap:new Map,chatResponseMap:new Map,conversationMap:new Map}}setMarkedExtensions(...e){this.markedExtensions=e}setNewTabSrText(e){this._newTabSrText=e}getMetadata(){return this.internalData.metadata}createConversationId(){let e=Sn();return this.renderers.set(e,new an({extensions:this.markedExtensions,newTabSrText:this._newTabSrText})),e}chat(e,t,n={}){let r=new cn,i=Sn(),a=new sn,o=new fn({id:i,onError:(e,t)=>{n.onError?.(e,t)},onFinish:e=>{r.setValue(e)},markdownRenderer:this.renderers.get(e)??new an({extensions:this.markedExtensions,newTabSrText:this._newTabSrText}),userQuestion:t}),s=async()=>{await a,!(f&&!c.getCurrentValue())&&(await c).close()},c=new cn,l=new Bn(e=>o.updateText(e)),u=n.timeout??this.chatTimeout,d,f=!1,p=()=>{d!==void 0&&clearTimeout(d),d=void 0},m=()=>{f=!0,d=void 0,console.error(`No SSE activity for ${u}ms, giving up on chat request ${i}`),l.clear(),o.pushError(`sse-error`);let e=c.getCurrentValue();if(e){e.close();return}o.finishMessage(),a.resolve()},ee=()=>{p(),u>0&&!f&&(d=setTimeout(m,u))};ee(),(async()=>{let s=await this.internalData.metadata;if(s.mode===`maintenance`)throw Error(`Can not chat in maintenance mode`);let u=await this.internalData.restClient.subscribeSse(`/assistant/sse`,{query:t,uID:s.userId,cID:e,rID:i,lang:n.lang,feature:n.features?.join(`,`),referrer:n.referrer,source:n.source,...n.selectorValues??{},...n.mode?{mode:n.mode}:{},...n.cache?{cache:!0}:{},...n.predefinedQuestionId?{predefinedQuestionId:n.predefinedQuestionId}:{},...n.switchQuestionId?{switchQuestionId:n.switchQuestionId}:{},chat:`true`,version:`2`},{onClose:()=>{p(),l.clear(),o.finishMessage(),a.resolve(),r.cleanup()},onMessage:t=>{let r=t;switch(ee(),r.type){case`error`:l.runAfterTyping(()=>o.pushError(r.error,r.message));break;case`id`:r.for===`request`&&i!==r.id&&console.warn(`Unexpected request id "${r.id}" expected "${i}"`),r.for===`conversation`&&e!==r.id&&console.warn(`Unexpected conversation id "${r.id}" expected "${e}"`);break;case`state`:r.state===`history-entry-initialized`&&a.resolve();break;case`text`:l.ingestText(r.text);break;case`done`:case`answer-done`:p(),l.runAfterTyping(()=>{o.finishMessage(),a.resolve(),c.then(e=>e.close())});break;case`unexpected-call`:l.runAfterTyping(()=>{console.error(`unexpected-call:`,r),o.pushError(`unexpected-call`)});break;case`jsonld-component`:case`mapped-reference`:l.runAfterTyping(()=>o.addMappedReference(r.reference));break;case`reference`:l.runAfterTyping(()=>o.addOldReference(r.reference));break;case`retrieval-question`:l.runAfterTyping(()=>o.updateRetrievalQuestion(r.question));break;case`no-feedback`:l.runAfterTyping(()=>o.setNoFeedback());break;case`component`:l.runWithWarmup(()=>n.onEmbed?.(r));break}l.runAfterTyping(()=>n.onMessage?.(r))},onError:e=>{console.error(` sse-error:`,e),!(`data`in e&&!e.data&&`responseCode`in e&&e.responseCode===0)&&o.pushError(`sse-error`)}});c.setValue(u),f&&u.close()})();let h=new hn({question:t,id:i,content:r,readableStore:o.getReadableStore(),readyForFeedback:a,abort:s,liipgptClientPrimitive:this});return this.internalData.chatResponseMap.set(h.id,h),h}async thumbs(e,t,n){if((await this.internalData.metadata).mode!==`ready`)throw Error(`Can not post feedback unless we are in ready mode`);let r={feedback:n,rID:e,query:t};await this.internalData.restClient.postData(`/quickfeedback`,r)}thumbsUp(e,t){return this.thumbs(e,t,`positive`)}thumbsDown(e,t){return this.thumbs(e,t,`negative`)}async feedback(e,t,n){let r=await this.internalData.metadata;if(r.mode!==`ready`)throw Error(`Can not post feedback unless we are in ready mode`);if(n.message){let i={body:n.message,email:n.email,rID:e,uID:r.userId,query:t};await this.internalData.restClient.postData(`/feedback`,i)}n.classification&&await this.internalData.restClient.postData(`/classification`,{impact:n.classification.impact,quality:n.classification.quality,rID:e})}async submitAnswerForm(e){let t=await this.internalData.metadata;if(t.mode!==`ready`)throw Error(`Can not submit the answer form unless we are in ready mode`);let n={receiverEmail:e.receiverEmail,fields:e.fields,query:e.question,answer:e.answer,rID:e.requestId,uID:t.userId,lang:e.lang};await this.internalData.restClient.postData(`/customform`,n)}async userAction(e,t={}){let n=await this.internalData.metadata;if(n.mode!==`ready`)throw Error(`Can not post user action unless we are in ready mode`);let r={uID:n.userId,cID:t.conversationId,lang:t.lang,userAction:e};await this.internalData.restClient.postData(`/assistant/userAction`,r)}async search(e,t={}){let n=await this.internalData.metadata,r=n.mode===`ready`?n.userId:void 0,{links:i}=await this.internalData.restClient.fetchData(`/assistant/search`,Mn,{modelId:t.model,lang:t.language,query:e,mapResults:`true`,uID:r});return new Vn(i.map(Nn))}async getChatConfig(){return this.internalData.restClient.fetchData(`/chatconfig`,ie)}async getChatHistory(e,t){try{let n=await this.internalData.restClient.postData(`/chathistory`,{cID:e,uID:t}),r=g.safeParse(await n.json());return r.success?r.data:[]}catch(e){return console.error(`Failed to load chat history:`,e),[]}}async getPredefinedQuestions(e){return(await this.internalData.restClient.fetchData(`/topics/questions`,ae,e)).predefinedQuestions}async transcribeAudio(e,t={}){let n=await this.internalData.metadata,r=t.lang||`de-CH`;if(n.mode===`maintenance`)throw Error(`Can not transcribe audio in maintenance mode`);try{let t=(e=>e.includes(`mp4`)?`mp4`:e.includes(`webm`)?`webm`:(e.includes(`wav`),`wav`))(e.type),n=new FormData;return n.append(`file`,e,`audio.${t}`),n.append(`lang`,r),n.append(`type`,e.type),{transcript:await(await this.internalData.restClient.postFormData(`/speech?key=${this.internalData.restClient.speechRecognitionApiKey||``}&lang=${r}`,n)).text()||``,error:void 0}}catch(e){return console.error(`Error transcribing audio:`,e),{transcript:``,error:e instanceof Error?e.message:`Unknown error`}}}},Wn=class{clientPrimitive;constructor(e){this.clientPrimitive=new Un(e)}getMetadata(){return this.clientPrimitive.getMetadata()}createConversation(){return new gn(this.clientPrimitive)}search(e,t={}){return this.clientPrimitive.search(e,t)}getChatConfig(){return this.clientPrimitive.getChatConfig()}getPredefinedQuestions(e){return this.clientPrimitive.getPredefinedQuestions(e)}},Gn={all:!0,own:!0,location:!0,none:!0};function Kn(e){if(e)return Object.keys(Gn).includes(e)?e:void 0}var qn=(e,t)=>{try{let n=new URL(e),r=new URL(t);return n.origin===r.origin&&n.pathname===r.pathname}catch{return!1}},Jn=e=>{try{return new URL(e).origin===window.location.origin}catch{return!1}},Yn=()=>`${window.location.protocol}//${window.location.host}${window.location.pathname}`;function Xn(e,{embedded:t}){let n=e??`all`;if(n===`none`)return;if(t||n===`location`)return Yn();let r=qn(document.referrer,window.location.href)?``:document.referrer;if(r&&!(n===`own`&&!Jn(r)))return r}var Zn=class extends Map{#e=new Map;#t=e(0);#n=e(0);#r=s||-1;constructor(e){if(super(),e){for(var[t,n]of e)super.set(t,n);this.#n.v=super.size}}#i(n){return s===this.#r?e(n):t(n)}has(e){var t=this.#e,n=t.get(e);if(n===void 0)if(super.has(e))n=this.#i(0),t.set(e,n);else return o(this.#t),!1;return o(n),!0}forEach(e,t){this.#a(),super.forEach(e,t)}get(e){var t=this.#e,n=t.get(e);if(n===void 0)if(super.has(e))n=this.#i(0),t.set(e,n);else{o(this.#t);return}return o(n),super.get(e)}set(e,t){var n=this.#e,i=n.get(e),a=super.get(e),o=super.set(e,t),s=this.#t;if(i===void 0)i=this.#i(0),n.set(e,i),r(this.#n,super.size),c(s);else if(a!==t){c(i);var l=s.reactions===null?null:new Set(s.reactions);(l===null||!i.reactions?.every(e=>l.has(e)))&&c(s)}return o}delete(e){var t=this.#e,n=t.get(e),i=super.delete(e);return n!==void 0&&(t.delete(e),r(n,-1)),i&&(r(this.#n,super.size),c(this.#t)),i}clear(){if(super.size!==0){super.clear();var e=this.#e;r(this.#n,0);for(var t of e.values())r(t,-1);c(this.#t),e.clear()}}#a(){o(this.#t);var e=this.#e;if(this.#n.v!==e.size){for(var t of super.keys())if(!e.has(t)){var n=this.#i(0);e.set(t,n)}}for([,n]of this.#e)o(n)}keys(){return o(this.#t),super.keys()}values(){return this.#a(),super.values()}entries(){return this.#a(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return o(this.#n),super.size}},Qn=class{#e;#t;constructor(e,t){this.#e=e,this.#t=a(t)}get current(){return this.#t(),this.#e()}},$n=/\(.+\)/,er=new Set([`all`,`print`,`screen`,`and`,`or`,`not`,`only`]),tr=class extends Qn{constructor(e,t){let n=$n.test(e)||e.split(/[\s,]+/).some(e=>er.has(e.trim()))?e:`(${e})`,r=window.matchMedia(n);super(()=>r.matches,e=>i(r,`change`,e))}};function nr(e){return e}function rr(e){return e<.5?4*e*e*e:.5*(2*e-2)**3+1}function ir(e){return e<.5?8*e**4:-8*(e-1)**4+1}function ar(e){return e**4}function or(e){return(e-1)**3*(1-e)+1}function sr(e){return--e*e*e*e*e+1}export{$e as S,_n as _,or as a,un as b,Zn as c,Wn as d,Un as f,bn as g,Dn as h,ir as i,Kn as l,Rn as m,nr as n,sr as o,zn as p,ar as r,tr as s,rr as t,Xn as u,pn as v,an as x,mn as y};
61
+ `,{error:u,url:i,opts:a,data:s}),s}async postData(e,t){let n=await fetch(`${this.options.apiUrl}${e}`,{method:`POST`,headers:this.getDefaultHeaders(),body:JSON.stringify(t)});if(!n.ok){let e=await n.text();throw Error(`${n.status} - ${e}`)}return n}async postFormData(e,t){let n=await fetch(`${this.options.apiUrl}${e}`,{method:`POST`,body:t});if(!n.ok){let e=await n.text();throw Error(`${n.status} - ${e}`)}return n}},Mn=m({links:u(d([m({url:f(l()),title:f(te()),considered:f(ee()),orgMetadata:f(m({authors:f(u(te()))})),type:f(te()),date:f(ie()),similarity:f(h()),content:f(te()),fromFullTextSearch:f(ee()),rerank:f(m({index:f(p()),adjustment:f(h()),score:f(h()),similarityOld:f(h())}))}),re]))}),Nn=e=>{if(`metadata`in e)return e;console.warn(`Please upgrade your backend you are currently using an old api feature.`);let t=e.orgMetadata??{};e?.fromFullTextSearch&&(t.fromFullTextSearch=e?.fromFullTextSearch),e?.rerank&&(t.rerank=e?.rerank);let n=[],r=e.title??``;if(e.title&&e.title.includes(` > `)){let t=e.title.split(` > `);r=t.pop()??``,n=t}return{url:e.url??``,title:r,score:e.similarity||0,breadcrumbs:n,metadata:t,description:e.content,date:e.date}},Pn=7,Fn=8,In=160,Ln=e=>{let t=[],n=0;for(;n<e.length;){let r=e[n];if(r===`<`){let r=e.indexOf(`>`,n);if(r!==-1){t.push({type:`tag`,value:e.slice(n,r+1)}),n=r+1;continue}}if(/\s/.test(r)){let r=n;for(;r<e.length&&/\s/.test(e[r]);)r++;t.push({type:`space`,value:e.slice(n,r)}),n=r;continue}let i=n;for(;i<e.length&&!/\s/.test(e[i])&&e[i]!==`<`;)i++;t.push({type:`word`,value:e.slice(n,i)}),n=i}return t},Rn=e=>{let t=Ln(e),n=[],r=``,i=!1;for(let e of t)e.type===`space`&&i?(n.push(r),r=e.value,i=!1):(r+=e.value,e.type===`word`&&(i=!0));return r&&n.push(r),n},zn=e=>Math.max(Fn,Math.min(In,e.length*Pn)),Bn=class{queue=[];timeoutId=null;isProcessing=!1;constructor(e){this.onText=e}ingestText(e){let t=Rn(e);if(t.length>=5){for(let e of t)this.queue.push({kind:`text`,chunk:e,delayMs:zn(e)});this.kickoff();return}this.runAfterTyping(()=>this.onText(e))}runAfterTyping(e){if(this.queue.length===0&&!this.isProcessing){e();return}this.queue.push({kind:`fn`,fn:e}),this.kickoff()}runWithWarmup(e){this.queue.push({kind:`fn`,fn:e}),this.kickoff()}clear(){this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null),this.queue=[],this.isProcessing=!1}kickoff(){this.isProcessing||this.timeoutId!==null||(this.timeoutId=setTimeout(()=>{this.timeoutId=null,this.processNext()},750))}processNext(){let e=this.queue.shift();if(!e){this.isProcessing=!1;return}this.isProcessing=!0,e.kind===`text`?(this.onText(e.chunk),this.timeoutId=setTimeout(()=>{this.timeoutId=null,this.processNext()},e.delayMs)):(e.fn(),this.processNext())}},Vn=class{constructor(e){this.results=e}},Hn=45e3,Un=class{internalData;renderers=new Map;markedExtensions=[];_newTabSrText;chatTimeout;constructor(e){this.chatTimeout=e.chatTimeout??Hn;let t=new jn({apiUrl:e.apiUrl,apiKey:e.apiKey,speechRecognitionApiKey:e.speechRecognitionApiKey,strict:e.strict??!1,EventSource:e.EventSource??EventSource});this.internalData={restClient:t,metadata:On(t,e.startParameters),searchResponseMap:new Map,chatResponseMap:new Map,conversationMap:new Map}}setMarkedExtensions(...e){this.markedExtensions=e}setNewTabSrText(e){this._newTabSrText=e}getMetadata(){return this.internalData.metadata}createConversationId(){let e=Sn();return this.renderers.set(e,new an({extensions:this.markedExtensions,newTabSrText:this._newTabSrText})),e}chat(e,t,n={}){let r=new cn,i=Sn(),a=new sn,o=new fn({id:i,onError:(e,t)=>{n.onError?.(e,t)},onFinish:e=>{r.setValue(e)},markdownRenderer:this.renderers.get(e)??new an({extensions:this.markedExtensions,newTabSrText:this._newTabSrText}),userQuestion:t}),s=async()=>{await a,!(f&&!c.getCurrentValue())&&(await c).close()},c=new cn,l=new Bn(e=>o.updateText(e)),u=n.timeout??this.chatTimeout,d,f=!1,p=()=>{d!==void 0&&clearTimeout(d),d=void 0},m=()=>{f=!0,d=void 0,console.error(`No SSE activity for ${u}ms, giving up on chat request ${i}`),l.clear(),o.pushError(`sse-error`);let e=c.getCurrentValue();if(e){e.close();return}o.finishMessage(),a.resolve()},ee=()=>{p(),u>0&&!f&&(d=setTimeout(m,u))};ee(),(async()=>{let s=await this.internalData.metadata;if(s.mode===`maintenance`)throw Error(`Can not chat in maintenance mode`);let u=await this.internalData.restClient.subscribeSse(`/assistant/sse`,{query:t,uID:s.userId,cID:e,rID:i,lang:n.lang,feature:n.features?.join(`,`),referrer:n.referrer,source:n.source,...n.selectorValues??{},...n.mode?{mode:n.mode}:{},...n.cache?{cache:!0}:{},...n.predefinedQuestionId?{predefinedQuestionId:n.predefinedQuestionId}:{},...n.switchQuestionId?{switchQuestionId:n.switchQuestionId}:{},chat:`true`,version:`2`},{onClose:()=>{p(),l.clear(),o.finishMessage(),a.resolve(),r.cleanup()},onMessage:t=>{let r=t;switch(ee(),r.type){case`error`:l.runAfterTyping(()=>o.pushError(r.error,r.message));break;case`id`:r.for===`request`&&i!==r.id&&console.warn(`Unexpected request id "${r.id}" expected "${i}"`),r.for===`conversation`&&e!==r.id&&console.warn(`Unexpected conversation id "${r.id}" expected "${e}"`);break;case`state`:r.state===`history-entry-initialized`&&a.resolve();break;case`text`:l.ingestText(r.text);break;case`done`:case`answer-done`:p(),l.runAfterTyping(()=>{o.finishMessage(),a.resolve(),c.then(e=>e.close())});break;case`unexpected-call`:l.runAfterTyping(()=>{console.error(`unexpected-call:`,r),o.pushError(`unexpected-call`)});break;case`jsonld-component`:case`mapped-reference`:l.runAfterTyping(()=>o.addMappedReference(r.reference));break;case`reference`:l.runAfterTyping(()=>o.addOldReference(r.reference));break;case`retrieval-question`:l.runAfterTyping(()=>o.updateRetrievalQuestion(r.question));break;case`no-feedback`:l.runAfterTyping(()=>o.setNoFeedback());break;case`component`:l.runWithWarmup(()=>n.onEmbed?.(r));break}l.runAfterTyping(()=>n.onMessage?.(r))},onError:e=>{console.error(` sse-error:`,e),!(`data`in e&&!e.data&&`responseCode`in e&&e.responseCode===0)&&o.pushError(`sse-error`)}});c.setValue(u),f&&u.close()})();let h=new hn({question:t,id:i,content:r,readableStore:o.getReadableStore(),readyForFeedback:a,abort:s,liipgptClientPrimitive:this});return this.internalData.chatResponseMap.set(h.id,h),h}async thumbs(e,t,n){if((await this.internalData.metadata).mode!==`ready`)throw Error(`Can not post feedback unless we are in ready mode`);let r={feedback:n,rID:e,query:t};await this.internalData.restClient.postData(`/quickfeedback`,r)}thumbsUp(e,t){return this.thumbs(e,t,`positive`)}thumbsDown(e,t){return this.thumbs(e,t,`negative`)}async feedback(e,t,n){let r=await this.internalData.metadata;if(r.mode!==`ready`)throw Error(`Can not post feedback unless we are in ready mode`);if(n.message){let i={body:n.message,email:n.email,rID:e,uID:r.userId,query:t};await this.internalData.restClient.postData(`/feedback`,i)}n.classification&&await this.internalData.restClient.postData(`/classification`,{impact:n.classification.impact,quality:n.classification.quality,rID:e})}async submitAnswerForm(e){let t=await this.internalData.metadata;if(t.mode!==`ready`)throw Error(`Can not submit the answer form unless we are in ready mode`);let n={receiverEmail:e.receiverEmail,fields:e.fields,query:e.question,answer:e.answer,rID:e.requestId,uID:t.userId,lang:e.lang};await this.internalData.restClient.postData(`/customform`,n)}async userAction(e,t={}){let n=await this.internalData.metadata;if(n.mode!==`ready`)throw Error(`Can not post user action unless we are in ready mode`);let r={uID:n.userId,cID:t.conversationId,lang:t.lang,userAction:e};await this.internalData.restClient.postData(`/assistant/userAction`,r)}async search(e,t={}){let n=await this.internalData.metadata,r=n.mode===`ready`?n.userId:void 0,{links:i}=await this.internalData.restClient.fetchData(`/assistant/search`,Mn,{modelId:t.model,lang:t.language,query:e,mapResults:`true`,uID:r});return new Vn(i.map(Nn))}async getChatConfig(){return this.internalData.restClient.fetchData(`/chatconfig`,ae)}async getChatHistory(e,t){try{let n=await this.internalData.restClient.postData(`/chathistory`,{cID:e,uID:t}),r=oe.safeParse(await n.json());return r.success?r.data:[]}catch(e){return console.error(`Failed to load chat history:`,e),[]}}async getPredefinedQuestions(e){return(await this.internalData.restClient.fetchData(`/topics/questions`,ne,e)).predefinedQuestions}async transcribeAudio(e,t={}){let n=await this.internalData.metadata,r=t.lang||`de-CH`;if(n.mode===`maintenance`)throw Error(`Can not transcribe audio in maintenance mode`);try{let t=(e=>e.includes(`mp4`)?`mp4`:e.includes(`webm`)?`webm`:(e.includes(`wav`),`wav`))(e.type),n=new FormData;return n.append(`file`,e,`audio.${t}`),n.append(`lang`,r),n.append(`type`,e.type),{transcript:await(await this.internalData.restClient.postFormData(`/speech?key=${this.internalData.restClient.speechRecognitionApiKey||``}&lang=${r}`,n)).text()||``,error:void 0}}catch(e){return console.error(`Error transcribing audio:`,e),{transcript:``,error:e instanceof Error?e.message:`Unknown error`}}}},Wn=class{clientPrimitive;constructor(e){this.clientPrimitive=new Un(e)}getMetadata(){return this.clientPrimitive.getMetadata()}createConversation(){return new gn(this.clientPrimitive)}search(e,t={}){return this.clientPrimitive.search(e,t)}getChatConfig(){return this.clientPrimitive.getChatConfig()}getPredefinedQuestions(e){return this.clientPrimitive.getPredefinedQuestions(e)}},Gn={all:!0,own:!0,location:!0,none:!0};function Kn(e){if(e)return Object.keys(Gn).includes(e)?e:void 0}var qn=(e,t)=>{try{let n=new URL(e),r=new URL(t);return n.origin===r.origin&&n.pathname===r.pathname}catch{return!1}},Jn=e=>{try{return new URL(e).origin===window.location.origin}catch{return!1}},Yn=()=>`${window.location.protocol}//${window.location.host}${window.location.pathname}`;function Xn(e,{embedded:t}){let n=e??`all`;if(n===`none`)return;if(t||n===`location`)return Yn();let r=qn(document.referrer,window.location.href)?``:document.referrer;if(r&&!(n===`own`&&!Jn(r)))return r}var Zn=class extends Map{#e=new Map;#t=e(0);#n=e(0);#r=s||-1;constructor(e){if(super(),e){for(var[t,n]of e)super.set(t,n);this.#n.v=super.size}}#i(n){return s===this.#r?e(n):t(n)}has(e){var t=this.#e,n=t.get(e);if(n===void 0)if(super.has(e))n=this.#i(0),t.set(e,n);else return o(this.#t),!1;return o(n),!0}forEach(e,t){this.#a(),super.forEach(e,t)}get(e){var t=this.#e,n=t.get(e);if(n===void 0)if(super.has(e))n=this.#i(0),t.set(e,n);else{o(this.#t);return}return o(n),super.get(e)}set(e,t){var n=this.#e,i=n.get(e),a=super.get(e),o=super.set(e,t),s=this.#t;if(i===void 0)i=this.#i(0),n.set(e,i),r(this.#n,super.size),c(s);else if(a!==t){c(i);var l=s.reactions===null?null:new Set(s.reactions);(l===null||!i.reactions?.every(e=>l.has(e)))&&c(s)}return o}delete(e){var t=this.#e,n=t.get(e),i=super.delete(e);return n!==void 0&&(t.delete(e),r(n,-1)),i&&(r(this.#n,super.size),c(this.#t)),i}clear(){if(super.size!==0){super.clear();var e=this.#e;r(this.#n,0);for(var t of e.values())r(t,-1);c(this.#t),e.clear()}}#a(){o(this.#t);var e=this.#e;if(this.#n.v!==e.size){for(var t of super.keys())if(!e.has(t)){var n=this.#i(0);e.set(t,n)}}for([,n]of this.#e)o(n)}keys(){return o(this.#t),super.keys()}values(){return this.#a(),super.values()}entries(){return this.#a(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return o(this.#n),super.size}},Qn=class{#e;#t;constructor(e,t){this.#e=e,this.#t=a(t)}get current(){return this.#t(),this.#e()}},$n=/\(.+\)/,er=new Set([`all`,`print`,`screen`,`and`,`or`,`not`,`only`]),tr=class extends Qn{constructor(e,t){let n=$n.test(e)||e.split(/[\s,]+/).some(e=>er.has(e.trim()))?e:`(${e})`,r=window.matchMedia(n);super(()=>r.matches,e=>i(r,`change`,e))}};export{Wn as a,Rn as c,_n as d,pn as f,$e as g,an as h,Xn as i,Dn as l,un as m,Zn as n,Un as o,mn as p,Kn as r,zn as s,tr as t,bn as u};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DUR8K4eS.js","./DK3lEKRX.js","./CibALFW0.js","./CsGLkWF6.js","./BaFk5JeE.js","./C1vsjZB2.js","./BnXjA2kT.js","./uNnF9TU1.js","./DjVmpym-.js","./DFgR2o_I.js","./IhqdV4A8.js","./B_FUTopa.js","./DSItGtCS.js","./D63FM6dK.js","./HfoaPmLk.js","./Bo0U8J3e.js","./pncTt4Yg2.js","./7NDngRQo.js","./DIQK1dMk.js","./6QxjtaMo.js","./Do9AxEGi.js","./CFKVnMbq.js","./DUHuqsF-.js"])))=>i.map(i=>d[i]);
2
+ import{A as e,B as t,D as n,Dt as r,E as i,Gt as a,I as o,J as s,L as c,Lt as l,Mt as u,N as d,R as f,Rt as p,St as m,T as h,Tt as g,U as _,V as v,W as y,X as b,Y as x,bt as S,c as ee,ht as C,i as w,j as T,k as E,kt as D,lt as O,mt as k,o as A,ot as j,rt as te,s as ne,u as re,v as M,xt as N,yt as P}from"./DK3lEKRX.js";import{t as F}from"./DjVmpym-.js";import{t as I}from"./HfoaPmLk.js";import{t as ie}from"./Do9AxEGi.js";import{o as L}from"./DIQK1dMk.js";import{n as R,t as z}from"./Dq7Zntjw.js";import{t as B}from"./wezic_7b.js";import{t as ae}from"./BEfnCtbB2.js";var V=()=>F(()=>import(`./DUR8K4eS.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url),H=b(`<div class="loader-container svelte-6xtyn8"><svg width="40" height="40" viewBox="0 0 24 24"><circle cx="4" cy="12" r="3"><animate id="spinner_qFRN" begin="0;spinner_OcgL.end+0.25s" attributeName="cy" calcMode="spline" dur="0.6s" values="12;6;12" keySplines=".33,.66,.66,1;.33,0,.66,.33"></animate></circle><circle cx="12" cy="12" r="3"><animate begin="spinner_qFRN.begin+0.1s" attributeName="cy" calcMode="spline" dur="0.6s" values="12;6;12" keySplines=".33,.66,.66,1;.33,0,.66,.33"></animate></circle><circle cx="20" cy="12" r="3"><animate id="spinner_OcgL" begin="spinner_qFRN.begin+0.2s" attributeName="cy" calcMode="spline" dur="0.6s" values="12;6;12" keySplines=".33,.66,.66,1;.33,0,.66,.33"></animate></circle></svg></div>`),U={hash:`svelte-6xtyn8`,code:`.loader-container.svelte-6xtyn8 {display:flex;z-index:var(--z-index-loader);position:absolute;top:0;right:0;bottom:0;left:0;align-items:center;justify-content:center;background-color:#fff;}`};function W(t,n){p(n,!0),e(t,U);let r=A(n,`color`,7),i=A(n,`background`,7);var o={get color(){return r()},set color(e){r(e),u()},get background(){return i()},set background(e){i(e),u()}},c=H(),d=S(c);return a(c),k(()=>{h(c,i()?`background: ${i()};`:``),M(d,`fill`,r()??`rgba(127, 127, 127, 0.3)`)}),s(t,c),l(o)}w(W,{color:{},background:{}},[],[],{mode:`open`});var G=()=>F(()=>import(`./pncTt4Yg2.js`),__vite__mapDeps([16,17,8,1,2,5,4,6,7,3,9,10,11,12,13,14,18,19,20,21,22,15]),import.meta.url),K=b(`<div class="chat-app__container"><div class="chat-app__loader-container"><!></div></div>`);function q(e,t){p(t,!0);let n=e=>{var t=K(),n=S(t);W(S(n),{get background(){return i()},get color(){return c()}}),a(n),a(t),s(e,t)},r=A(t,`onCloseChat`,7),i=A(t,`loaderBackground`,7),c=A(t,`loaderColor`,7);var d={get onCloseChat(){return r()},set onCloseChat(e){r(e),u()},get loaderBackground(){return i()},set loaderBackground(e){i(e),u()},get loaderColor(){return c()},set loaderColor(e){c(e),u()}},f=x(),m=N(f),h=e=>{n(e)},g=e=>{var t=x();y(N(t),()=>F(()=>import(`./pncTt4Yg2.js`),__vite__mapDeps([16,17,8,1,2,5,4,6,7,3,9,10,11,12,13,14,18,19,20,21,22,15]),import.meta.url),e=>{n(e)},(e,t)=>{var n=D(()=>{var{default:e}=j(t);return{ChatPanel:e}}),i=D(()=>j(n).ChatPanel),a=x();o(N(a),()=>j(i),(e,t)=>{t(e,{get onCloseChat(){return r()}})}),s(e,a)}),s(e,t)};return _(m,e=>{I.initialized?e(g,-1):e(h)}),s(e,f),l(d)}w(q,{onCloseChat:{},loaderBackground:{},loaderColor:{}},[],[],{mode:`open`});function J(e,{delay:t=0,duration:n=200,easing:r=e=>e,baseScale:i=0,transformOrigin:a=`bottom right`,scaleDirection:o=`scale`}={}){if(window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return{delay:0,duration:0,css:()=>`opacity: 1; transform: ${o}(1); transform-origin: ${a};`};let s=getComputedStyle(e),c=+s.opacity,l=s.transform.match(/scale[XY]?\(([0-9.]+)\)/),u=l?+l[1]:1,d=1-i;return{delay:t,duration:n,css:e=>{let t=r(e),n=t*u*d+i;return`opacity: ${t*c}; transform: ${o}(${n}); transform-origin: ${a};`}}}var oe=b(`<div class="flyout__backdrop"></div>`),se=b(`<div class="flyout__content"><!></div>`),ce=b(`<!> <div><!> <div class="flyout__body"><!> <div><!></div></div></div>`,1),le=b(`<!> <div class="chat-app__container"><div class="chat-app__loader-container"><!></div></div>`,1);function Y(e,t){p(t,!0);let o=A(t,`children`,7),v=A(t,`loaderColor`,7),y=A(t,`loaderBackground`,7),b=A(t,`flyout`,7),w=A(t,`flyoutClass`,7),T=A(t,`flyoutStyle`,7),O=A(t,`onCloseChat`,7),F=A(t,`onActivate`,7),z=A(t,`onPrefetch`,7),V=A(t,`activating`,7,!1),H=A(t,`onError`,7),U=ne(t,[`$$slots`,`$$events`,`$$legacy`,`$$host`,`children`,`loaderColor`,`loaderBackground`,`flyout`,`flyoutClass`,`flyoutStyle`,`onCloseChat`,`onActivate`,`onPrefetch`,`activating`,`onError`]),G=D(()=>I.theme?.components?.flyout?.custom??{}),K=D(()=>({enabled:I.data?.chatConfig?.enableBackdrop??!1,delayIn:Number(j(G).backdropDelayIn??0),durationIn:Number(j(G).backdropDurationIn??200),delayOut:Number(j(G).backdropDelayOut??0),durationOut:Number(j(G).backdropDurationOut??200),baseScaleIn:Number(j(G).backdropBaseScaleIn??1),baseScaleOut:Number(j(G).backdropBaseScaleOut??1),transformOrigin:String(j(G).backdropTransformOrigin??`center`),scaleDirection:String(j(G).backdropScaleDirection??`scale`)})),q=D(()=>({in:{delay:j(K).delayIn,duration:j(K).durationIn,baseScale:j(K).baseScaleIn,transformOrigin:j(K).transformOrigin,scaleDirection:j(K).scaleDirection},out:{delay:j(K).delayOut,duration:j(K).durationOut,baseScale:j(K).baseScaleOut,transformOrigin:j(K).transformOrigin,scaleDirection:j(K).scaleDirection}})),Y,ue=e=>{C(()=>{let t=e=>{Y=e};return e.addEventListener(`click`,t),()=>{e.removeEventListener(`click`,t),Y=void 0}})},de=e=>{C(()=>{let t=()=>z()?.();return e.addEventListener(`pointerenter`,t,{once:!0}),e.addEventListener(`focusin`,t,{once:!0}),()=>{e.removeEventListener(`pointerenter`,t),e.removeEventListener(`focusin`,t)}})},X=`flyout`,Z=r(void 0),Q=D(()=>I.data.flyoutIsOpen),fe=r(!1),$=D(()=>I.initialized),pe=D(()=>I.data.hasOpenedOverlays),me=D(()=>j(Q)||V());C(()=>{!I.data.flyoutIsOpen&&j(fe)&&(j(Z)?.querySelector(`button`))?.focus({preventScroll:!0}),g(fe,j(Q),!0)}),C(()=>{if(j($)&&j(Q)){let e=e=>{e.key===`Escape`&&(j(pe)||O()())};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}}});var he={get children(){return o()},set children(e){o(e),u()},get loaderColor(){return v()},set loaderColor(e){v(e),u()},get loaderBackground(){return y()},set loaderBackground(e){y(e),u()},get flyout(){return b()},set flyout(e){b(e),u()},get flyoutClass(){return w()},set flyoutClass(e){w(e),u()},get flyoutStyle(){return T()},set flyoutStyle(e){T(e),u()},get onCloseChat(){return O()},set onCloseChat(e){O(e),u()},get onActivate(){return F()},set onActivate(e){F(e),u()},get onPrefetch(){return z()},set onPrefetch(e){z(e),u()},get activating(){return V()},set activating(e=!1){V(e),u()},get onError(){return H()},set onError(e){H(e),u()}},ge=x();te(`click`,P,e=>{e!==Y&&b()&&O()()});var _e=N(ge),ve=e=>{var t=ce(),r=N(t),l=e=>{R(e,{id:`app-css`,get css(){return B}})};_(r,e=>{I.initialized||e(l)});var u=m(r,2),f=S(u),p=e=>{var t=oe();d(1,t,()=>J,()=>({...j(q).in,easing:L})),d(2,t,()=>J,()=>({...j(q).out,easing:L})),s(e,t)};_(f,e=>{j(me)&&j(K).enabled&&e(p)});var v=m(f,2);M(v,`id`,X);var y=S(v),b=e=>{var t=se();c(S(t),o),a(t),d(1,t,()=>J,()=>({delay:0,duration:500,easing:L,baseScale:.3})),d(2,t,()=>J,()=>({delay:100,duration:300,easing:L,baseScale:.7})),s(e,t)};_(y,e=>{j(me)&&e(b)});var x=m(y,2);ae(S(x),ee({get onError(){return H()},onclick:e=>{e.stopPropagation(),F()?.()},flyoutId:X,get flyoutIsOpen(){return j(Q)},buttonClass:`flyout__open-button`},()=>U)),a(x),re(x,e=>g(Z,e),()=>j(Z)),E(x,e=>de?.(e)),a(v),E(v,e=>ue?.(e)),a(u),k(()=>{h(u,T()),i(u,1,n([`flyout`,w()]))}),s(e,t)},ye=e=>{var n=x(),r=N(n),i=e=>{var n=le(),r=N(n);R(r,{id:`app-css`,get css(){return B}});var i=m(r,2),o=S(i);f(S(o),t,`loader`,{},e=>{W(e,{get background(){return y()},get color(){return v()}})}),a(o),a(i),d(2,i,()=>ie,()=>({duration:200,delay:300})),s(e,n)},l=e=>{var t=x();c(N(t),o),s(e,t)};_(r,e=>{I.initialized?e(l,-1):e(i)}),s(e,n)};return _(_e,e=>{b()?e(ve):e(ye,-1)}),s(e,ge),l(he)}w(Y,{children:{},loaderColor:{},loaderBackground:{},flyout:{},flyoutClass:{},flyoutStyle:{},onCloseChat:{},onActivate:{},onPrefetch:{},activating:{},onError:{}},[`loader`],[],{mode:`open`});var ue=b(`<link rel="stylesheet"/>`),de=b(`<link rel="stylesheet"/>`),X=b(`<!> <!> <!>`,1),Z=b(`<link rel="stylesheet"/>`),Q=b(`<!> <!> <!> <!>`,1),fe=b(`<div><!> <!></div>`);function $(e,o){p(o,!0);let c=A(o,`host`,7),d=A(o,`onError`,7),f=ne(o,[`$$slots`,`$$events`,`$$legacy`,`$$host`,`host`,`onError`]),y=()=>({forceTheme:o.forceTheme,apiUrl:o.apiUrl,apiKey:o.apiKey,speechRecognitionApiKey:o.speechRecognitionApiKey,lang:o.lang,features:o.features,loaderBackground:o.loaderBackground,loaderColor:o.loaderColor,flyout:o.flyout,flyoutStyle:o.flyoutStyle,flyoutClass:o.flyoutClass,chatClass:o.chatClass,inlineLayout:o.inlineLayout,forceChatPage:o.forceChatPage,hidePredefinedQuestions:o.hidePredefinedQuestions,autofirePredefinedQuestionId:o.autofirePredefinedQuestionId,additionalStartParameters:o.additionalStartParameters,question:o.question,mode:o.mode,source:o.source,cache:o.cache}),b,w=()=>(b||(b=V().then(async e=>(await e.logic.init(y()),e)),b.catch(e=>d()(e))),b);C(()=>{o.flyout||O(()=>w())});let E=r(!1),te=()=>{w(),G()},re=async()=>{g(E,!0);try{(await w()).logic.openFlyout()}catch{}finally{g(E,!1)}},P=()=>{b?.then(e=>e.logic.closeFlyout()).catch(()=>{}),c().dispatchEvent(new CustomEvent(`closechat`))};C(()=>{I.initialized&&I.data?.chatConfig&&c().dispatchEvent(new CustomEvent(`configloaded`,{detail:I.data.chatConfig}))});let F=D(()=>o.flyout),ie=D(()=>I.data?.chatConfig?.inlineLayout&&!o.flyout);C(()=>{j(L)&&j(F)&&(c().setAttribute(`role`,`region`),O(()=>{c().setAttribute(`aria-label`,I.t.ariaFlyoutRegion)}))});let L=D(()=>I.initialized);var ae={get host(){return c()},set host(e){c(e),u()},get onError(){return d()},set onError(e){d(e),u()}},H=fe();T(`3hann0`,e=>{var n=x(),r=N(n),i=e=>{var n=X(),r=N(n);t(r,17,()=>I.themeBase.fontURLs??[],v,(e,t)=>{var n=ue();k(()=>M(n,`href`,j(t))),s(e,n)});var i=m(r,2);t(i,17,()=>I.data.additionalStylesheets,v,(e,t)=>{var n=de();k(()=>M(n,`href`,j(t))),s(e,n)}),R(m(i,2),{id:`font-css`,get css(){return I.themeBase.fontCSS}}),s(e,n)};_(r,e=>{I.initialized&&e(i)}),s(e,n)});let U;var W=S(H),K=e=>{var n=Q(),r=N(n);{let e=D(()=>z(I.theme));R(r,{id:`theme-css`,get css(){return j(e)}})}var i=m(r,2);R(i,{id:`app-css`,get css(){return B}});var a=m(i,2);R(a,{id:`custom-css`,get css(){return I.themeBase.customCSS}}),t(m(a,2),17,()=>I.data.additionalStylesheets,v,(e,t)=>{var n=Z();k(()=>M(n,`href`,j(t))),s(e,n)}),s(e,n)};return _(W,e=>{I.initialized&&e(K)}),Y(m(W,2),ee({onCloseChat:P,onActivate:re,onPrefetch:te,get activating(){return j(E)},get onError(){return d()}},()=>f,{children:(e,t)=>{q(e,{onCloseChat:P,get loaderBackground(){return o.loaderBackground},get loaderColor(){return o.loaderColor}})},$$slots:{default:!0}})),a(H),k(()=>{i(H,1,n([`chat-app`,o.chatClass])),M(H,`role`,!j(F)&&!j(ie)?`main`:void 0),U=h(H,``,U,{"color-scheme":I.colorScheme||`light`})}),s(e,H),l(ae)}w($,{host:{},onError:{}},[],[],{mode:`open`});export{$ as t};
@@ -0,0 +1 @@
1
+ import{Lt as e,Mt as t,Rt as n,c as r,i,kt as a,o,ot as s,qt as c}from"./DK3lEKRX.js";import"./CFKVnMbq.js";import"./CsGLkWF6.js";import"./DFgR2o_I.js";import"./BaFk5JeE.js";import"./BnXjA2kT.js";import"./HfoaPmLk.js";import"./6QxjtaMo.js";import"./Dq7Zntjw.js";import{t as l}from"./C9_9vTHd2.js";import"./BEfnCtbB2.js";import"./BjxmHIml2.js";import{t as u}from"./DFocG2Q_2.js";function d(i,d){n(d,!0);let f=o(d,`forceTheme`,7),p=o(d,`apiUrl`,7),m=o(d,`apiKey`,7),h=o(d,`speechRecognitionApiKey`,7),g=o(d,`lang`,7),_=o(d,`features`,7),v=o(d,`loaderBackground`,7),y=o(d,`loaderColor`,7),b=o(d,`flyout`,7),x=o(d,`flyoutStyle`,7),S=o(d,`flyoutClass`,7),C=o(d,`chatClass`,7),w=o(d,`inlineLayout`,7),T=o(d,`forceChatPage`,7),E=o(d,`hidePredefinedQuestions`,7),D=o(d,`autofirePredefinedQuestionId`,7),O=o(d,`additionalStartParameters`,7),k=o(d,`question`,7),A=o(d,`mode`,7),j=o(d,`source`,7),M=o(d,`cache`,7),N=a(()=>({forceTheme:f(),apiUrl:p(),apiKey:m(),speechRecognitionApiKey:h(),lang:g(),features:_(),loaderBackground:v(),loaderColor:y(),flyout:b(),flyoutStyle:x(),flyoutClass:S(),chatClass:C(),inlineLayout:w(),forceChatPage:T(),hidePredefinedQuestions:E(),autofirePredefinedQuestionId:D(),additionalStartParameters:O(),question:k(),mode:A(),source:j(),cache:M()}));var P={get forceTheme(){return f()},set forceTheme(e){f(e),t()},get apiUrl(){return p()},set apiUrl(e){p(e),t()},get apiKey(){return m()},set apiKey(e){m(e),t()},get speechRecognitionApiKey(){return h()},set speechRecognitionApiKey(e){h(e),t()},get lang(){return g()},set lang(e){g(e),t()},get features(){return _()},set features(e){_(e),t()},get loaderBackground(){return v()},set loaderBackground(e){v(e),t()},get loaderColor(){return y()},set loaderColor(e){y(e),t()},get flyout(){return b()},set flyout(e){b(e),t()},get flyoutStyle(){return x()},set flyoutStyle(e){x(e),t()},get flyoutClass(){return S()},set flyoutClass(e){S(e),t()},get chatClass(){return C()},set chatClass(e){C(e),t()},get inlineLayout(){return w()},set inlineLayout(e){w(e),t()},get forceChatPage(){return T()},set forceChatPage(e){T(e),t()},get hidePredefinedQuestions(){return E()},set hidePredefinedQuestions(e){E(e),t()},get autofirePredefinedQuestionId(){return D()},set autofirePredefinedQuestionId(e){D(e),t()},get additionalStartParameters(){return O()},set additionalStartParameters(e){O(e),t()},get question(){return k()},set question(e){k(e),t()},get mode(){return A()},set mode(e){A(e),t()},get source(){return j()},set source(e){j(e),t()},get cache(){return M()},set cache(e){M(e),t()}};{let e=(e,t=c)=>{l(e,r({host:d.$$host,get onError(){return t()}},()=>s(N)))},t=a(()=>s(N).flyout??!1);u(i,{get silent(){return s(t)},body:e,$$slots:{body:!0}})}return e(P)}customElements.define(`liipgpt-chat`,i(d,{forceTheme:{attribute:`force-theme`,type:`String`},apiUrl:{attribute:`api-url`,type:`String`},apiKey:{attribute:`api-key`,type:`String`},speechRecognitionApiKey:{attribute:`speech-recognition-api-key`,type:`String`},lang:{attribute:`lang`,type:`String`},features:{attribute:`features`,type:`String`},loaderBackground:{attribute:`loader-background`,type:`String`},loaderColor:{attribute:`loader-color`,type:`String`},flyout:{attribute:`flyout`,type:`Boolean`},flyoutStyle:{attribute:`flyout-style`,type:`String`},flyoutClass:{attribute:`flyout-class`,type:`String`},chatClass:{attribute:`chat-class`,type:`String`},inlineLayout:{attribute:`inline-layout`,type:`Boolean`},forceChatPage:{attribute:`force-chat-page`,type:`Boolean`},hidePredefinedQuestions:{attribute:`hide-predefined-questions`,type:`Boolean`},autofirePredefinedQuestionId:{attribute:`autofire-predefined-question-id`,type:`String`},additionalStartParameters:{attribute:`additional-start-parameters`,type:`String`},question:{attribute:`question`,type:`String`},mode:{attribute:`mode`,type:`String`},source:{attribute:`source`,type:`String`},cache:{attribute:`cache`,type:`Boolean`}},[],[],{mode:`open`}));export{d as LiipGPTChat};
@@ -0,0 +1 @@
1
+ import{Dt as e,Nt as t,Tt as n,ct as r,ot as i,r as a,st as o,t as s}from"./DK3lEKRX.js";var c=class{constructor(e,t){this.status=e,typeof t==`string`?this.body={message:t}:t?this.body=t:this.body={message:`Error: ${e}`}}toString(){return JSON.stringify(this.body)}},l=class{constructor(e,t){this.status=e,this.location=t}},u=class extends Error{constructor(e,t,n){super(n),this.status=e,this.text=t}};new URL(`sveltekit-internal://`);function d(e,t){return e===`/`||t===`ignore`?e:t===`never`?e.endsWith(`/`)?e.slice(0,-1):e:t===`always`&&!e.endsWith(`/`)?e+`/`:e}function f(e){return e.split(`%25`).map(decodeURI).join(`%25`)}function p(e){for(let t in e)e[t]=decodeURIComponent(e[t]);return e}function m({href:e}){return e.split(`#`)[0]}function h(e,t,n,r=!1){let i=new URL(e);Object.defineProperty(i,`searchParams`,{value:new Proxy(i.searchParams,{get(e,r){if(r===`get`||r===`getAll`||r===`has`)return(t,...i)=>(n(t),e[r](t,...i));t();let i=Reflect.get(e,r);return typeof i==`function`?i.bind(e):i}}),enumerable:!0,configurable:!0});let a=[`href`,`pathname`,`search`,`toString`,`toJSON`];r&&a.push(`hash`);for(let n of a)Object.defineProperty(i,n,{get(){return t(),e[n]},enumerable:!0,configurable:!0});return i}function g(...e){let t=5381;for(let n of e)if(typeof n==`string`){let e=n.length;for(;e;)t=t*33^n.charCodeAt(--e)}else if(ArrayBuffer.isView(n)){let e=new Uint8Array(n.buffer,n.byteOffset,n.byteLength),r=e.length;for(;r;)t=t*33^e[--r]}else throw TypeError(`value must be a string or TypedArray`);return(t>>>0).toString(36)}new TextEncoder,new TextDecoder;function _(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}var ee=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||`GET`)!==`GET`&&v.delete(b(e)),ee(e,t));var v=new Map;function y(e,t){let n=b(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:e,...t}=JSON.parse(r.textContent),i=r.getAttribute(`data-ttl`);return i&&v.set(n,{body:e,init:t,ttl:1e3*Number(i)}),r.getAttribute(`data-b64`)!==null&&(e=_(e)),Promise.resolve(new Response(e,t))}return window.fetch(e,t)}function te(e,t,n){if(v.size>0){let t=b(e,n),r=v.get(t);if(r){if(performance.now()<r.ttl&&[`default`,`force-cache`,`only-if-cached`,void 0].includes(n?.cache))return new Response(r.body,r.init);v.delete(t)}}return window.fetch(t,n)}function b(e,t){let n=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t?.headers||t?.body){let e=[];t.headers&&e.push([...new Headers(t.headers)].join(`,`)),t.body&&(typeof t.body==`string`||ArrayBuffer.isView(t.body))&&e.push(t.body),n+=`[data-hash="${g(...e)}"]`}return n}var ne=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function re(e){let t=[];return{pattern:e===`/`?/^\/$/:RegExp(`^${ae(e).map(e=>{let n=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(e);if(n)return t.push({name:n[1],matcher:n[2],optional:!1,rest:!0,chained:!0}),`(?:/([^]*))?`;let r=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(e);if(r)return t.push({name:r[1],matcher:r[2],optional:!0,rest:!1,chained:!0}),`(?:/([^/]+))?`;if(!e)return;let i=e.split(/\[(.+?)\](?!\])/);return`/`+i.map((e,n)=>{if(n%2){if(e.startsWith(`x+`))return se(String.fromCharCode(parseInt(e.slice(2),16)));if(e.startsWith(`u+`))return se(String.fromCharCode(...e.slice(2).split(`-`).map(e=>parseInt(e,16))));let[,r,a,o,s]=ne.exec(e);return t.push({name:o,matcher:s,optional:!!r,rest:!!a,chained:a?n===1&&i[0]===``:!1}),a?`([^]*?)`:r?`([^/]*)?`:`([^/]+?)`}return se(e)}).join(``)}).join(``)}/?$`),params:t}}function ie(e){return e!==``&&!/^\([^)]+\)$/.test(e)}function ae(e){return e.slice(1).split(`/`).filter(ie)}function oe(e,t,n){let r={},i=e.slice(1),a=i.filter(e=>e!==void 0),o=0;for(let e=0;e<t.length;e+=1){let s=t[e],c=i[e-o];if(s.chained&&s.rest&&o&&(c=i.slice(e-o,e+1).filter(e=>e).join(`/`),o=0),c===void 0)if(s.rest)c=``;else continue;if(!s.matcher||n[s.matcher](c)){r[s.name]=c;let n=t[e+1],l=i[e+1];n&&!n.rest&&n.optional&&l&&s.chained&&(o=0),!n&&!l&&Object.keys(r).length===a.length&&(o=0);continue}if(s.optional&&s.chained){o++;continue}return}if(!o)return r}function se(e){return e.normalize().replace(/[[\]]/g,`\\$&`).replace(/%/g,`%25`).replace(/\//g,`%2[Ff]`).replace(/\?/g,`%3[Ff]`).replace(/#/g,`%23`).replace(/[.*+?^${}()|\\]/g,`\\$&`)}function ce({nodes:e,server_loads:t,dictionary:n,matchers:r}){let i=new Set(t);return Object.entries(n).map(([t,[n,i,s]])=>{let{pattern:c,params:l}=re(t),u={id:t,exec:e=>{let t=c.exec(e);if(t)return oe(t,l,r)},errors:[1,...s||[]].map(t=>e[t]),layouts:[0,...i||[]].map(o),leaf:a(n)};return u.errors.length=u.layouts.length=Math.max(u.errors.length,u.layouts.length),u});function a(t){let n=t<0;return n&&(t=~t),[n,e[t]]}function o(t){return t===void 0?t:[i.has(t),e[t]]}}function le(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function ue(e,t,n=JSON.stringify){let r=n(t);try{sessionStorage[e]=r}catch{}}var x=globalThis.__sveltekit_ek7ib8?.base??`/configurator`,de=globalThis.__sveltekit_ek7ib8?.assets??x??``,fe=`1789157311688`,pe=`sveltekit:snapshot`,me=`sveltekit:scroll`,he=`sveltekit:states`,S=`sveltekit:history`,C=`sveltekit:navigation`,w={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},ge=location.origin;function _e(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){let e=document.getElementsByTagName(`base`);t=e.length?e[0].href:document.URL}return new URL(e,t)}function T(){return{x:pageXOffset,y:pageYOffset}}function E(e,t){return e.getAttribute(`data-sveltekit-${t}`)}var ve={...w,"":w.hover};function ye(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function be(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()===`A`&&e.hasAttribute(`href`))return e;e=ye(e)}}function xe(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){let e=location.hash.split(`#`)[1]||`/`;r.hash=`#${e}${r.hash}`}}catch{}let i=e instanceof SVGAElement?e.target.baseVal:e.target,a=!r||!!i||O(r,t,n)||(e.getAttribute(`rel`)||``).split(/\s+/).includes(`external`),o=r?.origin===ge&&e.hasAttribute(`download`);return{url:r,external:a,target:i,download:o}}function D(e){let t=null,n=null,r=null,i=null,a=null,o=null,s=e;for(;s&&s!==document.documentElement;)r===null&&(r=E(s,`preload-code`)),i===null&&(i=E(s,`preload-data`)),t===null&&(t=E(s,`keepfocus`)),n===null&&(n=E(s,`noscroll`)),a===null&&(a=E(s,`reload`)),o===null&&(o=E(s,`replacestate`)),s=ye(s);function c(e){switch(e){case``:case`true`:return!0;case`off`:case`false`:return!1;default:return}}return{preload_code:ve[r??`off`],preload_data:ve[i??`off`],keepfocus:c(t),noscroll:c(n),reload:c(a),replace_state:c(o)}}function Se(e){let n=t(e),r=!0;function i(){r=!0,n.update(e=>e)}function a(e){r=!1,n.set(e)}function o(e){let t;return n.subscribe(n=>{(t===void 0||r&&n!==t)&&e(t=n)})}return{notify:i,set:a,subscribe:o}}var Ce={v:()=>{}};function we(){let{set:e,subscribe:n}=t(!1);async function r(){clearTimeout(void 0);try{let t=await fetch(`${de}/_app/version.json`,{headers:{pragma:`no-cache`,"cache-control":`no-cache`}});if(!t.ok)return!1;let n=(await t.json()).version!==fe;return n&&(e(!0),Ce.v(),clearTimeout(void 0)),n}catch{return!1}}return{subscribe:n,check:r}}function O(e,t,n){return e.origin!==ge||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function Te(e){}var Ee=new Set([`load`,`prerender`,`csr`,`ssr`,`trailingSlash`,`config`]);new Set([...Ee,`entries`]);var De=new Set([...Ee]);new Set([...De,`actions`,`entries`]);function Oe(e){return e.filter(e=>e!=null)}function ke(e){return e instanceof c||e instanceof u?e.status:500}function Ae(e){return e instanceof u?e.text:`Internal Error`}var k,A,j,je=a.toString().includes(`$$`)||/function \w+\(\) \{\}/.test(a.toString()),Me=`a:`;je?(k={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL(Me)},A={current:null},j={current:!1}):(k=new class{#e=e({});get data(){return i(this.#e)}set data(e){n(this.#e,e)}#t=e(null);get form(){return i(this.#t)}set form(e){n(this.#t,e)}#n=e(null);get error(){return i(this.#n)}set error(e){n(this.#n,e)}#r=e({});get params(){return i(this.#r)}set params(e){n(this.#r,e)}#i=e({id:null});get route(){return i(this.#i)}set route(e){n(this.#i,e)}#a=e({});get state(){return i(this.#a)}set state(e){n(this.#a,e)}#o=e(-1);get status(){return i(this.#o)}set status(e){n(this.#o,e)}#s=e(new URL(Me));get url(){return i(this.#s)}set url(e){n(this.#s,e)}},A=new class{#e=e(null);get current(){return i(this.#e)}set current(e){n(this.#e,e)}},j=new class{#e=e(!1);get current(){return i(this.#e)}set current(e){n(this.#e,e)}},Ce.v=()=>j.current=!0);function Ne(e){Object.assign(k,e)}var Pe={spanContext(){return Fe},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this},addLink(){return this},addLinks(){return this}},Fe={traceId:``,spanId:``,traceFlags:0},{onMount:Ie,tick:Le}=s,Re=new Set([`icon`,`shortcut icon`,`apple-touch-icon`]),M=null,N=le(`sveltekit:scroll`)??{},P=le(`sveltekit:snapshot`)??{},F={url:Se({}),page:Se({}),navigating:t(null),updated:we()};function ze(e){N[e]=T()}function Be(e,t){let n=e+1;for(;N[n];)delete N[n],n+=1;for(n=t+1;P[n];)delete P[n],n+=1}function I(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function Ve(){if(`serviceWorker`in navigator){let e=await navigator.serviceWorker.getRegistration(x||`/`);e&&await e.update()}}function He(){}var Ue,We,L,R,Ge,z,B=[],V=[],H=null;function Ke(){H?.fork?.then(e=>e?.discard()),H=null}var U=new Map,qe=new Set,Je=new Set,W=new Set,G={branch:[],error:null,url:null,nav:null},Ye=!1,K=!1,Xe=!0,q=!1,J=!1,Ze=!1,Qe=!1,$e,Y,X,Z,et=new Set,tt=new Map;async function nt(e,t,n){globalThis.__sveltekit_ek7ib8?.data&&globalThis.__sveltekit_ek7ib8.data,document.URL!==location.href&&(location.href=location.href),z=e,await e.hooks.init?.(),Ue=ce(e),R=document.documentElement,Ge=t,We=e.nodes[0],L=e.nodes[1],We(),L(),Y=history.state?.[S],X=history.state?.[C],Y||(Y=X=Date.now(),history.replaceState({...history.state,[S]:Y,[C]:X},``));let r=N[Y];function i(){r&&(history.scrollRestoration=`manual`,scrollTo(r.x,r.y))}n?(i(),await jt(Ge,n)):(await Q({type:`enter`,url:_e(z.hash?Lt(new URL(location.href)):location.href),replace_state:!0}),i()),At()}function rt(){B.length=0,Qe=!1}function it(e){V.some(e=>e?.snapshot)&&(P[e]=V.map(e=>e?.snapshot?.capture()))}function at(e){P[e]?.forEach((e,t)=>{V[t]?.snapshot?.restore(e)})}function ot(){ze(Y),ue(me,N),it(X),ue(pe,P)}async function st(e,t,n,i){let a;t.invalidateAll&&Ke(),await Q({type:`goto`,url:_e(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:i,accept:()=>{t.invalidateAll&&(Qe=!0,a=[...tt.keys()]),t.invalidate&&t.invalidate.forEach(kt)}}),t.invalidateAll&&r().then(r).then(()=>{tt.forEach(({resource:e},t)=>{a?.includes(t)&&e.refresh?.()})})}async function ct(e){if(e.id!==H?.id){Ke();let t={};et.add(t),H={id:e.id,token:t,promise:vt({...e,preload:t}).then(e=>(et.delete(t),e.type===`loaded`&&e.state.error&&Ke(),e)),fork:null}}return H.promise}async function lt(e){let t=(await St(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(e=>e[1]()))}async function ut(e,t,n){let r={params:G.params,route:{id:G.route?.id??null},url:new URL(location.href)};G={...e.state,nav:r};let i=document.querySelector(`style[data-sveltekit]`);if(i&&i.remove(),Object.assign(k,e.props.page),$e=new z.root({target:t,props:{...e.props,stores:F,components:V},hydrate:n,sync:!1,transformError:void 0}),await Promise.resolve(),at(X),n){let e={from:null,to:{...r,scroll:N[Y]??T()},willUnload:!1,type:`enter`,complete:Promise.resolve()};W.forEach(t=>t(e))}K=!0}async function dt({url:e,params:t,branch:n,errors:r,status:i,error:a,route:o,form:s}){let c=`never`;if(x&&(e.pathname===x||e.pathname===x+`/`))c=`always`;else for(let e of n)e?.slash!==void 0&&(c=e.slash);e.pathname=d(e.pathname,c),e.search=e.search;let l={type:`loaded`,state:{url:e,params:t,branch:n,error:a,route:o},props:{constructors:Oe(n).map(e=>e.node.component),page:It(k)}};s!==void 0&&(l.props.form=s);let u={},f=!k,p=0;for(let e=0;e<Math.max(n.length,G.branch.length);e+=1){let t=n[e],r=G.branch[e];t?.data!==r?.data&&(f=!0),t&&(u={...u,...t.data},f&&(l.props[`data_${p}`]=u),p+=1)}return(!G.url||e.href!==G.url.href||G.error!==a||s!==void 0&&s!==k.form||f)&&(l.props.page={error:a,params:t,route:{id:o?.id??null},state:{},status:i,url:new URL(e),form:s??null,data:f?u:k.data}),l}async function ft({loader:e,parent:t,url:n,params:r,route:i,server_data_node:a}){let o=null,s=!0,c={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},l=await e();if(l.universal?.load){function e(...e){for(let t of e){let{href:e}=new URL(t,n);c.dependencies.add(e)}}let u={tracing:{enabled:!1,root:Pe,current:Pe},route:new Proxy(i,{get:(e,t)=>(s&&(c.route=!0),e[t])}),params:new Proxy(r,{get:(e,t)=>(s&&c.params.add(t),e[t])}),data:a?.data??null,url:h(n,()=>{s&&(c.url=!0)},e=>{s&&c.search_params.add(e)},z.hash),async fetch(t,r){t instanceof Request&&(r={body:t.method===`GET`||t.method===`HEAD`?void 0:await t.blob(),cache:t.cache,credentials:t.credentials,headers:[...t.headers].length>0?t?.headers:void 0,integrity:t.integrity,keepalive:t.keepalive,method:t.method,mode:t.mode,redirect:t.redirect,referrer:t.referrer,referrerPolicy:t.referrerPolicy,signal:t.signal,...r});let{resolved:i,promise:a}=pt(t,r,n);return s&&e(i.href),a},setHeaders:()=>{},depends:e,parent(){return s&&(c.parent=!0),t()},untrack(e){s=!1;try{return e()}finally{s=!0}}};o=await l.universal.load.call(null,u)??null}return{node:l,loader:e,server:a,universal:l.universal?.load?{type:`data`,data:o,uses:c}:null,data:o??a?.data??null,slash:l.universal?.trailingSlash??a?.slash}}function pt(e,t,n){let r=e instanceof Request?e.url:e,i=new URL(r,n);return i.origin===n.origin&&(r=i.href.slice(n.origin.length)),{resolved:i,promise:K?te(r,i.href,t):y(r,t)}}function mt(e,t,n,r,i,a){if(Qe)return!0;if(!i)return!1;if(i.parent&&e||i.route&&t||i.url&&n)return!0;for(let e of i.search_params)if(r.has(e))return!0;for(let e of i.params)if(a[e]!==G.params[e])return!0;for(let e of i.dependencies)if(B.some(t=>t(new URL(e))))return!0;return!1}function ht(e,t){return e?.type===`data`?e:e?.type===`skip`?t??null:null}function gt(e,t){if(!e)return new Set(t.searchParams.keys());let n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(let r of n){let i=e.searchParams.getAll(r),a=t.searchParams.getAll(r);i.every(e=>a.includes(e))&&a.every(e=>i.includes(e))&&n.delete(r)}return n}function _t({error:e,url:t,route:n,params:r}){return{type:`loaded`,state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:It(k),constructors:[]}}}async function vt({id:e,invalidating:t,url:n,params:r,route:i,preload:a}){if(H?.id===e)return et.delete(H.token),H.promise;let{errors:o,layouts:s,leaf:u}=i,d=[...s,u];o.forEach(e=>e?.().catch(()=>{})),d.forEach(e=>e?.[1]().catch(()=>{}));let f=G.url?e!==wt(G.url):!1,p=G.route?i.id!==G.route.id:!1,m=gt(G.url,n),h=!1,g=d.map(async(e,t)=>{if(!e)return;let a=G.branch[t];return e[1]===a?.loader&&!mt(h,p,f,m,a.universal?.uses,r)?a:(h=!0,ft({loader:e[1],url:n,params:r,route:i,parent:async()=>{let e={};for(let n=0;n<t;n+=1)Object.assign(e,(await g[n])?.data);return e},server_data_node:ht(e[0]?{type:`skip`}:null,e[0]?a?.server:void 0)}))});for(let e of g)e.catch(()=>{});let _=[];for(let e=0;e<d.length;e+=1)if(d[e])try{_.push(await g[e])}catch(t){if(t instanceof l)return{type:`redirect`,location:t.location};if(et.has(a))return _t({error:await $(t,{params:r,url:n,route:{id:i.id}}),url:n,params:r,route:i});let s=ke(t),u;if((void 0)?.includes(t))s=t.status??s,u=t.error;else if(t instanceof c)u=t.body;else{if(await F.updated.check())return await Ve(),await I(n);u=await $(t,{params:r,url:n,route:{id:i.id}})}let d=await yt(e,_,o);return d?dt({url:n,params:r,branch:_.slice(0,d.idx).concat(d.node),errors:o,status:s,error:u,route:i}):await Et(n,{id:i.id},u,s)}else _.push(void 0);return dt({url:n,params:r,branch:_,errors:o,status:200,error:null,route:i,form:t?void 0:null})}async function yt(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)--r;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function bt({status:e,error:t,url:n,route:r}){let i={};try{return dt({url:n,params:i,branch:[await ft({loader:We,url:n,params:i,route:r,parent:()=>Promise.resolve({}),server_data_node:ht(null)}),{node:await L(),loader:L,universal:null,server:null,data:null}],status:e,error:t,errors:[],route:null})}catch(e){if(e instanceof l)return st(new URL(e.location,location.href),{},0);throw e}}async function xt(e){let t=e.href;if(U.has(t))return U.get(t);let n;try{let r=(async()=>{let t=await z.hooks.reroute({url:new URL(e),fetch:async(t,n)=>pt(t,n,e).promise})??e;if(typeof t==`string`){let n=new URL(e);z.hash?n.hash=t:n.pathname=t,t=n}return t})();U.set(t,r),n=await r}catch{U.delete(t);return}return n}async function St(e,t){if(e&&!O(e,x,z.hash)){let n=await xt(e);if(!n)return;let r=Ct(n);for(let n of Ue){let i=n.exec(r);if(i)return{id:wt(e),invalidating:t,route:n,params:p(i),url:e}}}}function Ct(e){return f(z.hash?e.hash.replace(/^#/,``).replace(/[?#].+/,``):e.pathname.slice(x.length))||`/`}function wt(e){return(z.hash?e.hash.replace(/^#/,``):e.pathname)+e.search}function Tt({url:e,type:t,intent:n,delta:r,event:i,scroll:a}){let o=!1,s=Ft(G,n,e,t,a??null);r!==void 0&&(s.navigation.delta=r),i!==void 0&&(s.navigation.event=i);let c={...s.navigation,cancel:()=>{o=!0,s.reject(Error(`navigation cancelled`))}};return q||qe.forEach(e=>e(c)),o?null:s}async function Q({type:e,url:t,popped:n,keepfocus:i,noscroll:a,replace_state:s,state:c={},redirect_count:l=0,nav_token:d={},accept:f=He,block:p=He,event:m}){let h=Z;Z=d;let g=await St(t,!1),_=e===`enter`?Ft(G,g,t,e):Tt({url:t,type:e,delta:n?.delta,intent:g,scroll:n?.scroll,event:m});if(!_){p(),Z===d&&(Z=h);return}let ee=Y,v=X;f(),q=!0,K&&_.navigation.type!==`enter`&&F.navigating.set(A.current=_.navigation);let y=g&&await vt(g);if(!y){if(O(t,x,z.hash))return await I(t,s);y=await Et(t,{id:null},await $(new u(404,`Not Found`,`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,s)}if(t=g?.url||t,Z!==d)return _.reject(Error(`navigation aborted`)),!1;if(y.type===`redirect`){if(l<20){await Q({type:e,url:new URL(y.location,t),popped:n,keepfocus:i,noscroll:a,replace_state:s,state:c,redirect_count:l+1,nav_token:d}),_.fulfil(void 0);return}y=await bt({status:500,error:await $(Error(`Redirect loop`),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else y.props.page.status>=400&&await F.updated.check()&&(await Ve(),await I(t,s));if(rt(),ze(ee),it(v),y.props.page.url.pathname!==t.pathname&&(t.pathname=y.props.page.url.pathname),c=n?n.state:c,!n){let e=s?0:1,n={[S]:Y+=e,[C]:X+=e,[he]:c};(s?history.replaceState:history.pushState).call(history,n,``,t),s||Be(Y,X)}let te=g&&H?.id===g.id?H.fork:null;H=null,y.props.page.state=c;let b;if(K){let e=(await Promise.all(Array.from(Je,e=>e(_.navigation)))).filter(e=>typeof e==`function`);if(e.length>0){function t(){e.forEach(e=>{W.delete(e)})}e.push(t),e.forEach(e=>{W.add(e)})}let n=_.navigation.to;G={...y.state,nav:{params:n.params,route:n.route,url:n.url}},y.props.page&&(y.props.page.url=t);let r=te&&await te;r?b=r.commit():(M=null,$e.$set(y.props),M&&Object.assign(y.props.page,M),Ne(y.props.page),b=o?.()),Ze=!0}else await ut(y,Ge,!1);let{activeElement:ne}=document;await b,await r(),await r();let re=null;if(Xe){let e=n?n.scroll:a?T():null;e?scrollTo(e.x,e.y):(re=t.hash&&document.getElementById(Rt(t)))?re.scrollIntoView():scrollTo(0,0)}let ie=document.activeElement!==ne&&document.activeElement!==document.body;!i&&!ie&&Pt(t,!re),Xe=!0,y.props.page&&(M&&Object.assign(y.props.page,M),Object.assign(k,y.props.page)),q=!1,e===`popstate`&&at(X),_.fulfil(void 0),_.navigation.to&&(_.navigation.to.scroll=T()),W.forEach(e=>e(_.navigation)),F.navigating.set(A.current=null)}async function Et(e,t,n,r,i){return e.origin===ge&&e.pathname===location.pathname&&!Ye?await bt({status:r,error:n,url:e,route:t}):await I(e,i)}function Dt(){let e,t={element:void 0,href:void 0},n;R.addEventListener(`mousemove`,t=>{let n=t.target;clearTimeout(e),e=setTimeout(()=>{a(n,w.hover)},20)});function r(e){e.defaultPrevented||a(e.composedPath()[0],w.tap)}R.addEventListener(`mousedown`,r),R.addEventListener(`touchstart`,r,{passive:!0});let i=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&(lt(new URL(t.target.href)),i.unobserve(t.target))},{threshold:0});async function a(e,r){let i=be(e,R),a=i===t.element&&i?.href===t.href&&r>=n;if(!i||a)return;let{url:o,external:s,download:c}=xe(i,x,z.hash);if(s||c)return;let l=D(i),u=o&&wt(G.url)===wt(o);if(!(l.reload||u))if(r<=l.preload_data){t={element:i,href:i.href},n=w.tap;let e=await St(o,!1);if(!e)return;ct(e)}else r<=l.preload_code&&(t={element:i,href:i.href},n=r,lt(o))}function o(){i.disconnect();for(let e of R.querySelectorAll(`a`)){let{url:t,external:n,download:r}=xe(e,x,z.hash);if(n||r)continue;let a=D(e);a.reload||(a.preload_code===w.viewport&&i.observe(e),a.preload_code===w.eager&&lt(t))}}W.add(o),o()}function $(e,t){if(e instanceof c)return e.body;let n=ke(e),r=Ae(e);return z.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function Ot(e,t={}){return e=new URL(_e(e)),e.origin===ge?st(e,t,0):Promise.reject(Error(`goto: invalid URL`))}function kt(e){if(typeof e==`function`)B.push(e);else{let{href:t}=new URL(e,location.href);B.push(e=>e.href===t)}}function At(){history.scrollRestoration=`manual`,addEventListener(`beforeunload`,e=>{let t=!1;if(ot(),!q){let e=Ft(G,void 0,null,`leave`),n={...e.navigation,cancel:()=>{t=!0,e.reject(Error(`navigation cancelled`))}};qe.forEach(e=>e(n))}t?(e.preventDefault(),e.returnValue=``):history.scrollRestoration=`auto`}),addEventListener(`visibilitychange`,()=>{document.visibilityState===`hidden`&&ot()}),navigator.connection?.saveData||Dt(),R.addEventListener(`click`,async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;let n=be(t.composedPath()[0],R);if(!n)return;let{url:r,external:i,target:a,download:o}=xe(n,x,z.hash);if(!r)return;if(a===`_parent`||a===`_top`){if(window.parent!==window)return}else if(a&&a!==`_self`)return;let s=D(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol===`https:`||r.protocol===`http:`)||o)return;let[c,l]=(z.hash?r.hash.replace(/^#/,``):r.href).split(`#`),u=c===m(location);if(i||s.reload&&(!u||!l)){Tt({url:r,type:`link`,event:t})?q=!0:t.preventDefault();return}if(l!==void 0&&u){let[,i]=G.url.href.split(`#`);if(i===l){if(t.preventDefault(),l===``||l===`top`&&n.ownerDocument.getElementById(`top`)===null)scrollTo({top:0});else{let e=n.ownerDocument.getElementById(decodeURIComponent(l));e&&(e.scrollIntoView(),e.focus())}return}if(J=!0,ze(Y),e(r),!s.replace_state)return;J=!1}t.preventDefault(),await new Promise(e=>{requestAnimationFrame(()=>{setTimeout(e,0)}),setTimeout(e,100)}),await Q({type:`link`,url:r,keepfocus:s.keepfocus,noscroll:s.noscroll,replace_state:s.replace_state??r.href===location.href,event:t})}),R.addEventListener(`submit`,e=>{if(e.defaultPrevented)return;let t=HTMLFormElement.prototype.cloneNode.call(e.target),n=e.submitter;if((n?.formTarget||t.target)===`_blank`||(n?.formMethod||t.method)!==`get`)return;let r=new URL(n?.hasAttribute(`formaction`)&&n?.formAction||t.action);if(O(r,x,!1))return;let i=e.target,a=D(i);if(a.reload)return;e.preventDefault(),e.stopPropagation();let o=new FormData(i,n);r.search=new URLSearchParams(o).toString(),Q({type:`form`,url:r,keepfocus:a.keepfocus,noscroll:a.noscroll,replace_state:a.replace_state??r.href===location.href,event:e})}),addEventListener(`popstate`,async t=>{if(!Nt)if(t.state?.[`sveltekit:history`]){let n=t.state[S];if(Z={},n===Y)return;let r=N[n],i=t.state[`sveltekit:states`]??{},a=new URL(t.state[`sveltekit:pageurl`]??location.href),o=t.state[C],s=G.url?m(location)===m(G.url):!1;if(o===X&&(Ze||s)){i!==k.state&&(k.state=i),e(a),N[Y]=T(),r&&scrollTo(r.x,r.y),Y=n;return}let c=n-Y;await Q({type:`popstate`,url:a,popped:{state:i,scroll:r,delta:c},accept:()=>{Y=n,X=o},block:()=>{history.go(-c)},nav_token:Z,event:t})}else J||(e(new URL(location.href)),z.hash&&location.reload())}),addEventListener(`hashchange`,()=>{J&&(J=!1,history.replaceState({...history.state,[S]:++Y,[C]:X},``,location.href))});for(let e of document.querySelectorAll(`link`))Re.has(e.rel)&&(e.href=e.href);addEventListener(`pageshow`,e=>{e.persisted&&F.navigating.set(A.current=null)});function e(e){G.url=k.url=e,F.page.set(It(k)),F.page.notify()}}async function jt(e,{status:t=200,error:n,node_ids:r,params:i,route:a,server_route:o,data:s,form:c}){Ye=!0;let u=new URL(location.href),d;({params:i={},route:a={id:null}}=await St(u,!1)||{}),d=Ue.find(({id:e})=>e===a.id);let f,p=!0;try{let e=r.map(async(t,n)=>{let r=s[n];return r?.uses&&(r.uses=Mt(r.uses)),ft({loader:z.nodes[t],url:u,params:i,route:a,parent:async()=>{let t={};for(let r=0;r<n;r+=1)Object.assign(t,(await e[r]).data);return t},server_data_node:ht(r)})}),o=await Promise.all(e);if(d){let e=d.layouts;for(let t=0;t<e.length;t++)e[t]||o.splice(t,0,void 0)}f=await dt({url:u,params:i,branch:o,status:t,error:n,errors:d?.errors,form:c,route:d??null})}catch(t){if(t instanceof l){await I(new URL(t.location,location.href));return}f=await bt({status:ke(t),error:await $(t,{url:u,params:i,route:a}),url:u,route:a}),e.textContent=``,p=!1}f.props.page&&(f.props.page.state={}),await ut(f,e,p)}function Mt(e){return{dependencies:new Set(e?.dependencies??[]),params:new Set(e?.params??[]),parent:!!e?.parent,route:!!e?.route,url:!!e?.url,search_params:new Set(e?.search_params??[])}}var Nt=!1;function Pt(e,t=!0){let n=document.querySelector(`[autofocus]`);if(n)n.focus();else{let n=Rt(e);if(n&&document.getElementById(n)){let{x:r,y:i}=T();setTimeout(()=>{let a=history.state;Nt=!0,location.replace(new URL(`#${n}`,location.href)),history.replaceState(a,``,e),t&&scrollTo(r,i),Nt=!1})}else{let e=document.body,t=e.getAttribute(`tabindex`);e.tabIndex=-1,e.focus({preventScroll:!0,focusVisible:!1}),t===null?e.removeAttribute(`tabindex`):e.setAttribute(`tabindex`,t)}let r=getSelection();if(r&&r.type!==`None`){let e=[];for(let t=0;t<r.rangeCount;t+=1)e.push(r.getRangeAt(t));setTimeout(()=>{if(r.rangeCount===e.length){for(let t=0;t<r.rangeCount;t+=1){let n=e[t],i=r.getRangeAt(t);if(n.commonAncestorContainer!==i.commonAncestorContainer||n.startContainer!==i.startContainer||n.endContainer!==i.endContainer||n.startOffset!==i.startOffset||n.endOffset!==i.endOffset)return}r.removeAllRanges()}})}}}function Ft(e,t,n,r,i=null){let a,o,s=new Promise((e,t)=>{a=e,o=t});return s.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:T()},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n,scroll:i},willUnload:!t,type:r,complete:s},fulfil:a,reject:o}}function It(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function Lt(e){let t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function Rt(e){let t;if(z.hash){let[,,n]=e.hash.split(`#`,3);t=n??``}else t=e.hash.slice(1);return decodeURIComponent(t)}export{k as a,A as i,nt as n,j as o,F as r,Te as s,Ot as t};
@@ -0,0 +1 @@
1
+ import"./CsGLkWF6.js";import{a as e,i as t,t as n}from"./DFgR2o_I.js";import"./BaFk5JeE.js";import{o as r,t as i}from"./BnXjA2kT.js";import{t as a}from"./BjxmHIml2.js";var o=async e=>a(await(await fetch(`${e}/chatconfig`)).json());async function s({apiUrl:a,lang:s,forceTheme:c}){let l=await o(a),u=i(s,r(l.supportedLanguages)),d=e(l,await t([u]));return{chatConfig:d,language:u,colorScheme:n(Object.keys(d.fullTheme))}}export{s as loadChatConfig};