@liip/liipgpt 3.6.2 → 3.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/button/liipgpt-button.iife.js +1 -1
- package/chat/liipgpt-chat.iife.js +3 -3
- package/configurator/_app/env.js +1 -1
- package/configurator/_app/immutable/chunks/-NcnoUoN.js +74 -0
- package/configurator/_app/immutable/chunks/{DGMq4YTc.js → 6JdeEzKi.js} +1 -1
- package/configurator/_app/immutable/chunks/{CNPN3doH.js → C4ORIoWK.js} +1 -1
- package/configurator/_app/immutable/chunks/{C3C5ovFp.js → C59SVKNf.js} +1 -1
- package/configurator/_app/immutable/chunks/{DqWrDTiT.js → CKIDNEuR.js} +1 -1
- package/configurator/_app/immutable/chunks/{DuT8PUr2.js → Cz0dIq0O.js} +1 -1
- package/configurator/_app/immutable/chunks/{jnZHBu2H.js → D7xeAlKo.js} +2 -2
- package/configurator/_app/immutable/chunks/DembPZun.js +2 -0
- package/configurator/_app/immutable/chunks/NtMAcZ7G.js +1 -0
- package/configurator/_app/immutable/chunks/Nw8j0Xyw.js +1 -0
- package/configurator/_app/immutable/chunks/{CI5X5-2i.js → QyXFn05f.js} +1 -1
- package/configurator/_app/immutable/entry/{app.C0j_jYEe.js → app.C_qls3uJ.js} +2 -2
- package/configurator/_app/immutable/entry/start.CJocbWmY.js +1 -0
- package/configurator/_app/immutable/nodes/{0.ieD1cNha.js → 0.Z8aHQ8Ms.js} +2 -2
- package/configurator/_app/immutable/nodes/{1.TURI2PFu.js → 1.D_R2KrSw.js} +1 -1
- package/configurator/_app/immutable/nodes/{2.B2VHw2_C.js → 2.BoZGqQ9G.js} +6 -4
- package/configurator/_app/immutable/nodes/{3.CtLGhOnC.js → 3.Bg8nwFnb.js} +1 -1
- package/configurator/_app/version.json +1 -1
- package/configurator/index.html +6 -6
- package/configurator/sidebar.html +6 -6
- package/package.json +1 -1
- package/search-summary/liipgpt-search-summary.iife.js +10 -10
- package/configurator/_app/immutable/chunks/BhtfdPmu.js +0 -70
- package/configurator/_app/immutable/chunks/BjD-MS84.js +0 -1
- package/configurator/_app/immutable/chunks/Cfhl-lQn.js +0 -1
- package/configurator/_app/immutable/chunks/yuKWODQS.js +0 -2
- package/configurator/_app/immutable/entry/start.B1J-yqeo.js +0 -1
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
var e=`https://liipgpt.api.dev.genai.liip.ch/liipgpt`,t=`3.6.2`,n=new Map;async function r(e){let t=n.get(e);if(t)return t;let r=await fetch(e),i=r.url,a=await r.arrayBuffer(),o=await crypto.subtle.digest(`SHA-384`,a),s={versionedUrl:i,integrity:`sha384-${btoa(String.fromCharCode(...new Uint8Array(o)))}`};return n.set(e,s),s}var i=/\/\*\s*@host-class:\s*([a-zA-Z_-][\w-]*)\s*\*\//;function a(e,t=`your-custom-class-wrapper`){let n=e.match(i);if(n)return n[1];let r=e.match(/\.([a-zA-Z_-][\w-]*)\s+\.search-summary\b/);if(r)return r[1];let a=e.match(/liipgpt-search-summary\.([a-zA-Z_-][\w-]*)/);return a?a[1]:t}var o=`/* Host tokens — set on the custom element, inherited by .search-summary and descendants */
|
|
2
|
-
liipgpt-search-summary.your-custom-class-wrapper {
|
|
3
|
-
--search-summary-padding: 1rem;
|
|
4
|
-
--search-summary-background: #fff;
|
|
5
|
-
--search-summary-footer-background: #fff;
|
|
6
|
-
}
|
|
7
|
-
.your-custom-class-wrapper .search-summary {
|
|
8
|
-
--search-summary-background: #fff;
|
|
9
|
-
--search-summary-footer-background: #fff;
|
|
10
|
-
padding: var(--search-summary-padding);
|
|
11
|
-
padding-bottom: 0;
|
|
12
|
-
border: 1px solid #e2e8f0;
|
|
13
|
-
border-radius: 0.5rem;
|
|
14
|
-
background: var(--search-summary-background);
|
|
15
|
-
color: #1a202c;
|
|
16
|
-
font-family: system-ui, sans-serif;
|
|
17
|
-
}
|
|
18
|
-
.your-custom-class-wrapper .search-summary__link,
|
|
19
|
-
.your-custom-class-wrapper .search-summary__disclaimer a {
|
|
20
|
-
color: #c44b00;
|
|
21
|
-
}
|
|
22
|
-
/* Slot button styles */
|
|
23
|
-
.your-custom-class-btn {
|
|
24
|
-
display: inline-flex;
|
|
25
|
-
align-items: center;
|
|
26
|
-
padding: 0.5rem 1rem;
|
|
27
|
-
border: 1px solid #c44b00;
|
|
28
|
-
border-radius: 0.25rem;
|
|
29
|
-
background: transparent;
|
|
30
|
-
color: #c44b00;
|
|
31
|
-
cursor: pointer;
|
|
32
|
-
font-size: inherit;
|
|
33
|
-
}
|
|
34
|
-
.your-custom-class-btn--primary {
|
|
35
|
-
background: #c44b00;
|
|
36
|
-
border-color: #c44b00;
|
|
37
|
-
color: #fff;
|
|
38
|
-
}
|
|
39
|
-
.your-custom-class-btn--secondary {
|
|
40
|
-
border-color: transparent;
|
|
41
|
-
background: transparent;
|
|
42
|
-
color: #c44b00;
|
|
43
|
-
}`,s=null;function c(e){s||(s=document.createElement(`style`),s.id=`preview-css-injection`,document.head.appendChild(s)),s.textContent=e}function l(){s?.remove(),s=null}var u=e=>e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`'`).replace(/\n/g,` `),d=(e,t)=>{if(t!==void 0){if(typeof t==`string`)return`${e}="${u(t)}"`;if(typeof t==`boolean`)return t?e:void 0}},f=(e,t)=>{if(!(typeof t!=`string`||!t))return`${e}='${t.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/'/g,`'`)}'`},p=(e,n)=>n===`search-summary`?e.cdn.value?`https://cdn.jsdelivr.net/npm/@liip/liipgpt@${t}/search-summary/liipgpt-search-summary.iife.min.js`:`${e[`api-url`].value}/cdn/npm/@liip/liipgpt/search-summary/liipgpt-search-summary.iife.min.js`:e.cdn.value?`https://cdn.jsdelivr.net/npm/@liip/liipgpt@${t}/${n}/liipgpt-${n}.iife.min.js`:`${e[`api-url`].value}/cdn/npm/@liip/liipgpt/${n}/liipgpt-${n}.iife.min.js`,m=(e,t)=>t?`<script async src="${t.versionedUrl}" integrity="${t.integrity}" crossorigin="anonymous"><\/script>`:`<script async src="${e}"><\/script>`,h=(e,t,n)=>{let r=`<liipgpt-button ${[d(`lang`,e.lang.value),d(`force-theme`,e?.[`force-theme`]?.value),d(`api-url`,e[`api-url`].value),d(`button-class`,e[`button-class`]?.value),d(`button-style`,e[`button-style`]?.value)].filter(Boolean).join(` `)}</liipgpt-button>`;if(t){let t=`${m(p(e,`button`),n)}\n${r}`;return e.CHAT_CONFIG_OVERRIDE.value&&(t=`<script>\n${e.CHAT_CONFIG_OVERRIDE.value}<\/script>\n`+t),e.onclosechat.value&&(t+=`\n<script>${e.onclosechat.value}<\/script>`),t}return r},g=(e,t,n)=>{let r=`<liipgpt-chat ${[d(`lang`,e.lang.value),d(`force-theme`,e?.[`force-theme`]?.value),d(`api-url`,e[`api-url`].value),d(`loader-background`,e[`loader-background`].value),d(`loader-color`,e[`loader-color`].value),d(`flyout`,e.flyout.value),d(`flyout-style`,e[`flyout-style`].value),d(`flyout-class`,e[`flyout-class`].value),d(`chat-class`,e[`chat-class`].value),d(`inline-layout`,e[`inline-layout`].value),d(`force-chat-page`,e[`force-chat-page`].value),d(`autofire-predefined-question-id`,e[`autofire-predefined-question-id`].value),f(`additional-start-parameters`,e[`additional-start-parameters`].value)].filter(Boolean).join(` `)}>${e[`custom-loader`].value?`<div slot="loader">${e[`custom-loader`].value}</div>`:``}</liipgpt-chat>`;if(t){let t=`${m(p(e,`chat`),n)}\n${r}`;return e.CHAT_CONFIG_OVERRIDE.value&&(t=`<script>\n${e.CHAT_CONFIG_OVERRIDE.value}<\/script>\n`+t),e.onclosechat.value&&(t+=`\n<script>${e.onclosechat.value}<\/script>`),t}return r},_=`ai-overview`,v={de:`KI-Übersicht`,en:`AI overview`,fr:`Aperçu IA`,it:`Panoramica IA`},y=`<p><strong>Get an AI-generated summary above your search results.</strong></p>
|
|
44
|
-
<p>When enabled, an AI overview will appear at the top of every search results page, synthesising the most relevant information for your query. Classical search results remain accessible below.</p>
|
|
45
|
-
<p>AI-generated answers may not always be accurate. <a href="https://example.com/privacy">Privacy policy</a></p>`,b=`<button
|
|
46
|
-
type="button"
|
|
47
|
-
slot="activate-ai-button"
|
|
48
|
-
class="your-custom-class-btn your-custom-class-btn--primary"
|
|
49
|
-
>
|
|
50
|
-
Enable AI
|
|
51
|
-
</button>
|
|
52
|
-
<button
|
|
53
|
-
type="button"
|
|
54
|
-
slot="expand-answer-button"
|
|
55
|
-
class="your-custom-class-btn your-custom-class-btn--primary"
|
|
56
|
-
>
|
|
57
|
-
Full answer
|
|
58
|
-
</button>
|
|
59
|
-
<button
|
|
60
|
-
type="button"
|
|
61
|
-
slot="deactivate-ai-button"
|
|
62
|
-
class="your-custom-class-btn your-custom-class-btn--secondary"
|
|
63
|
-
>
|
|
64
|
-
Disable AI
|
|
65
|
-
</button>`,x=(e,t,n)=>{let r=typeof window<`u`&&new URLSearchParams(window.location.search).get(`q`)||`What is liip?`,i=typeof e.lang.value==`string`?e.lang.value:`en`,s=v[i]??v.en,c=e[`use-chat-config`]?.value,l=e[`host-css`]?.value,f=a((!c&&typeof l==`string`?l:``)||o),h=[d(`lang`,i),d(`api-url`,e[`api-url`].value),d(`question`,r),d(`labelled-by`,_),d(`height`,e.height?.value??`280`),d(`opt-in`,e[`opt-in`]?.value),d(`use-chat-config`,c),c?d(`force-theme`,e?.[`force-theme`]?.value):void 0,c?void 0:d(`class`,f)].filter(Boolean),g=e[`disclaimer-slot`]?.value,b=typeof g==`string`?g:y,x=!c&&e[`opt-in`]?.value?`\n <div slot="disclaimer">\n ${b.trim().replace(/\n/g,`
|
|
66
|
-
`)}\n </div>`:``,S=e[`buttons-slots`]?.value,C=typeof S==`string`?S.trim():``,w=!c&&C?`\n ${C.replace(/\n/g,`
|
|
67
|
-
`)}`:``,T=`<liipgpt-search-summary\n ${h.join(`
|
|
68
|
-
`)}\n>${x}${w}\n</liipgpt-search-summary>`,E=`${`<h2 id="${_}">${u(s)}</h2>`}\n${T}`;if(t){let t=p(e,`search-summary`),r=e[`host-css`]?.value,i=!c&&typeof r==`string`?r:``,a=i.split(`
|
|
69
|
-
`).map(e=>e.trim()?` `+e:``).join(`
|
|
70
|
-
`),o=i?`<style>\n${a}\n</style>\n`:``;return`${m(t,n)}\n${o}${E}`}return E},S=(e,t,n=!1)=>t===`link-button`?h(e,n):t===`search-summary`?x(e,n):g(e,n),C=async(e,t,n=!1)=>{if(!e[`use-sri`]?.value||!n)return S(e,t,n);let i=await r(p(e,t===`link-button`?`button`:t===`search-summary`?`search-summary`:`chat`));return t===`link-button`?h(e,n,i):t===`search-summary`?x(e,n,i):g(e,n,i)};export{p as a,l as c,C as i,e as l,y as n,o,S as r,c as s,b as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Et as e,Mt as t,at as n,ot as r,r as i,st as a,t as o,wt as s}from"./C00ruT0L.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_1usn2b4?.base??`/configurator`,de=globalThis.__sveltekit_1usn2b4?.assets??x??``,fe=`1780479677645`,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=i.toString().includes(`$$`)||/function \w+\(\) \{\}/.test(i.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 n(this.#e)}set data(e){s(this.#e,e)}#t=e(null);get form(){return n(this.#t)}set form(e){s(this.#t,e)}#n=e(null);get error(){return n(this.#n)}set error(e){s(this.#n,e)}#r=e({});get params(){return n(this.#r)}set params(e){s(this.#r,e)}#i=e({id:null});get route(){return n(this.#i)}set route(e){s(this.#i,e)}#a=e({});get state(){return n(this.#a)}set state(e){s(this.#a,e)}#o=e(-1);get status(){return n(this.#o)}set status(e){s(this.#o,e)}#s=e(new URL(Me));get url(){return n(this.#s)}set url(e){s(this.#s,e)}},A=new class{#e=e(null);get current(){return n(this.#e)}set current(e){s(this.#e,e)}},j=new class{#e=e(!1);get current(){return n(this.#e)}set current(e){s(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}=o,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_1usn2b4?.data&&globalThis.__sveltekit_1usn2b4.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,r){let i;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:r,accept:()=>{t.invalidateAll&&(Qe=!0,i=[...tt.keys()]),t.invalidate&&t.invalidate.forEach(kt)}}),t.invalidateAll&&a().then(a).then(()=>{tt.forEach(({resource:e},t)=>{i?.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:o,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:o,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 i=te&&await te;i?b=i.commit():(M=null,$e.$set(y.props),M&&Object.assign(y.props.page,M),Ne(y.props.page),b=r?.()),Ze=!0}else await ut(y,Ge,!1);let{activeElement:ne}=document;await b,await a(),await a();let re=null;if(Xe){let e=n?n.scroll:o?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&<(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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Gt as e,It as t,Lt as n,Ot as r,at as i,c as a,i as o,jt as s,o as c}from"./C00ruT0L.js";import"./Bo0U8J3e.js";import"./CFKVnMbq.js";import"./DV91TmsB.js";import"./D6Qx_EAy.js";import"./MRyhzcyW.js";import"./DVeOoWpz.js";import"./GwQP32Cz.js";import"./CZiOHSGl.js";import"./CNPN3doH.js";import{t as l}from"./jnZHBu2H.js";import"./CI5X5-2i.js";import"./C3C5ovFp.js";import{t as u}from"./BmUm-Ak4.js";function d(o,d){n(d,!0);let f=c(d,`forceTheme`,7),p=c(d,`apiUrl`,7),m=c(d,`apiKey`,7),h=c(d,`speechRecognitionApiKey`,7),g=c(d,`lang`,7),_=c(d,`features`,7),v=c(d,`loaderBackground`,7),y=c(d,`loaderColor`,7),b=c(d,`flyout`,7),x=c(d,`flyoutStyle`,7),S=c(d,`flyoutClass`,7),C=c(d,`chatClass`,7),w=c(d,`inlineLayout`,7),T=c(d,`forceChatPage`,7),E=c(d,`autofirePredefinedQuestionId`,7),D=c(d,`additionalStartParameters`,7),O=r(()=>({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(),autofirePredefinedQuestionId:E(),additionalStartParameters:D()}));var k={get forceTheme(){return f()},set forceTheme(e){f(e),s()},get apiUrl(){return p()},set apiUrl(e){p(e),s()},get apiKey(){return m()},set apiKey(e){m(e),s()},get speechRecognitionApiKey(){return h()},set speechRecognitionApiKey(e){h(e),s()},get lang(){return g()},set lang(e){g(e),s()},get features(){return _()},set features(e){_(e),s()},get loaderBackground(){return v()},set loaderBackground(e){v(e),s()},get loaderColor(){return y()},set loaderColor(e){y(e),s()},get flyout(){return b()},set flyout(e){b(e),s()},get flyoutStyle(){return x()},set flyoutStyle(e){x(e),s()},get flyoutClass(){return S()},set flyoutClass(e){S(e),s()},get chatClass(){return C()},set chatClass(e){C(e),s()},get inlineLayout(){return w()},set inlineLayout(e){w(e),s()},get forceChatPage(){return T()},set forceChatPage(e){T(e),s()},get autofirePredefinedQuestionId(){return E()},set autofirePredefinedQuestionId(e){E(e),s()},get additionalStartParameters(){return D()},set additionalStartParameters(e){D(e),s()}};{let t=(t,n=e)=>{l(t,a({host:d.$$host,get onError(){return n()}},()=>i(O)))},n=r(()=>i(O).flyout??!1);u(o,{get silent(){return i(n)},body:t,$$slots:{body:!0}})}return t(k)}customElements.define(`liipgpt-chat`,o(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`},autofirePredefinedQuestionId:{attribute:`autofire-predefined-question-id`,type:`String`},additionalStartParameters:{attribute:`additional-start-parameters`,type:`String`}},[],[],{mode:`open`}));export{d as LiipGPTChat};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./BsL0-YLl.js","./DV91TmsB.js","./CibALFW0.js","./MRyhzcyW.js","./D6Qx_EAy.js","./CZiOHSGl.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{Et as e,G as t,H as n,It as r,J as i,Lt as a,M as o,N as s,Ot as c,P as l,R as u,St as d,T as f,Wt as p,Y as m,at as h,bt as g,c as _,ct as v,et as y,ft as b,ht as x,i as S,jt as C,mt as w,n as ee,o as T,pt as E,q as D,st as te,tt as O,u as k,v as A,w as ne,wt as j,x as re,xt as M,yt as N,z as ie}from"./C00ruT0L.js";import"./Bo0U8J3e.js";import{t as ae}from"./DjVmpym-.js";import"./CFKVnMbq.js";import"./MRyhzcyW.js";import{i as oe,n as se,r as ce,t as le}from"./tFLMI64R.js";import{a as ue,n as de,t as fe}from"./GwQP32Cz.js";import{n as pe}from"./CZiOHSGl.js";import{n as P,t as me}from"./CqCdl07t.js";function F(e){return Object.prototype.toString.call(e)===`[object Date]`}function I(e,t){if(e===t||e!==e)return()=>e;let n=typeof e;if(n!==typeof t||Array.isArray(e)!==Array.isArray(t))throw Error(`Cannot interpolate values of different type`);if(Array.isArray(e)){let n=t.map((t,n)=>I(e[n],t));return e=>n.map(t=>t(e))}if(n===`object`){if(!e||!t)throw Error(`Object cannot be null`);if(F(e)&&F(t)){let n=e.getTime(),r=t.getTime()-n;return e=>new Date(n+e*r)}let n=Object.keys(t),r={};return n.forEach(n=>{r[n]=I(e[n],t[n])}),e=>{let t={};return n.forEach(n=>{t[n]=r[n](e)}),t}}if(n===`number`){let n=t-e;return t=>e+t*n}return()=>t}var he=class t{#e;#t;#n;#r=null;constructor(t,n={}){this.#e=e(t),this.#t=e(t),this.#n=n}static of(e,n){let r=new t(e(),n);return b(()=>{r.set(e())}),r}set(e,t){j(this.#t,e);let{delay:n=0,duration:r=400,easing:i=P,interpolate:a=I}={...this.#n,...t};if(r===0)return this.#r?.abort(),j(this.#e,e),Promise.resolve();let o=l.now()+n,c,u=!1,d=this.#r;return this.#r=s(t=>{if(t<o)return!0;if(!u){u=!0;let t=this.#e.v;c=a(t,e),typeof r==`function`&&(r=r(t,e)),d?.abort()}let n=t-o;return n>r?(j(this.#e,e),!1):(j(this.#e,c(i(n/r))),!0)}),this.#r.promise}get current(){return h(this.#e)}get target(){return h(this.#t)}set target(e){this.set(e)}},ge={de:{searchSummaryExpand:`Gesamte Antwort`,searchSummaryCollapse:`Weniger anzeigen`,searchSummaryOptInDefault:`KI-Suche aktivieren`,searchSummaryOptOut:`KI-Suche deaktivieren`,searchSummaryError:`Etwas ist schiefgelaufen.`,searchSummaryLoading:`Antwort wird generiert…`,searchSummaryDisclaimer:`<p><strong>Ich bin ein KI-Assistent.</strong></p><p>Meine Antworten werden von einer künstlichen Intelligenz generiert und sind deshalb nicht immer korrekt. Wenn Sie mich aktivieren, unterstütze ich Sie bei der Suche nach den richtigen Informationen.</p>`,ariaSearchSummaryExpand:`Vollständige Antwort anzeigen`,ariaSearchSummaryCollapse:`Antwort einklappen`,ariaSearchSummaryOptOut:`KI-Suche deaktivieren`,referencesTitle:`Quellen`},en:{searchSummaryExpand:`Full answer`,searchSummaryCollapse:`Show less`,searchSummaryOptInDefault:`Enable AI search`,searchSummaryOptOut:`Disable AI search`,searchSummaryError:`Something went wrong.`,searchSummaryLoading:`Generating answer…`,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>`,ariaSearchSummaryExpand:`Show full answer`,ariaSearchSummaryCollapse:`Collapse answer`,ariaSearchSummaryOptOut:`Disable AI search`,referencesTitle:`References`},it:{searchSummaryExpand:`Risposta completa`,searchSummaryCollapse:`Mostra meno`,searchSummaryOptInDefault:`Attiva la ricerca IA`,searchSummaryOptOut:`Disattiva la ricerca IA`,searchSummaryError:`Si è verificato un errore.`,searchSummaryLoading:`Generazione della risposta…`,searchSummaryDisclaimer:`<p><strong>Sono un assistente IA.</strong></p><p>Le mie risposte sono generate da un'intelligenza artificiale e potrebbero non essere sempre corrette. Se mi attivi, ti aiuto a trovare le informazioni giuste.</p>`,ariaSearchSummaryExpand:`Mostra la risposta completa`,ariaSearchSummaryCollapse:`Comprimi la risposta`,ariaSearchSummaryOptOut:`Disattiva la ricerca IA`,referencesTitle:`Riferimenti`},fr:{searchSummaryExpand:`Réponse complète`,searchSummaryCollapse:`Afficher moins`,searchSummaryOptInDefault:`Activer la recherche IA`,searchSummaryOptOut:`Désactiver la recherche IA`,searchSummaryError:`Une erreur s'est produite.`,searchSummaryLoading:`Génération de la réponse…`,searchSummaryDisclaimer:`<p><strong>Je suis un assistant IA.</strong></p><p>Mes réponses sont générées par une intelligence artificielle et peuvent ne pas toujours être correctes. Si vous m'activez, je vous aide à trouver les bonnes informations.</p>`,ariaSearchSummaryExpand:`Afficher la réponse complète`,ariaSearchSummaryCollapse:`Réduire la réponse`,ariaSearchSummaryOptOut:`Désactiver la recherche IA`,referencesTitle:`Références`}},_e=`liipgpt-search-summary>[slot]{display:none}@layer components{@keyframes search-summary-spin{to{transform:rotate(360deg)}}@keyframes search-summary-content-appear{0%{opacity:0}}@keyframes search-summary-content-disappear{to{opacity:0}}@keyframes search-summary-action-appear{0%{opacity:0;transform:translateY(12px)}}@keyframes search-summary-action-disappear{to{opacity:0;transform:translateY(12px)}}.search-summary{box-sizing:border-box;padding:var(--search-summary-padding,0);border-width:var(--search-summary-border-width,0);border-style:var(--search-summary-border-style,solid);border-radius:var(--search-summary-border-radius,0);border-color:var(--search-summary-border-color,transparent);background:var(--search-summary-background,transparent);box-shadow:var(--search-summary-box-shadow,none);color:var(--search-summary-color,var(--body-color,inherit));font-weight:var(--base-font-weight-normal,inherit);font-size:var(--base-font-size-body,inherit);line-height:var(--base-line-height-default,inherit);font-family:var(--search-summary-font-family,var(--font-family,inherit));font-optical-sizing:auto;flex-direction:column;padding-bottom:0;display:flex;overflow:hidden}.search-summary :where(button){cursor:pointer;font-family:inherit}.search-summary :where(.search-summary__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}.search-summary:where([data-state=loading]),.search-summary:where([data-state=answering]){opacity:var(--search-summary-loading-opacity,1)}.search-summary:where([data-state=error]){border-color:var(--search-summary-error-border-color,inherit)}.search-summary :where(.search-summary__content){min-height:0;padding-bottom:var(--search-summary-padding,0);flex:1;animation:.35s ease-out both search-summary-content-appear;display:block;position:relative;overflow:hidden}.search-summary :where(.search-summary__content--leaving),.search-summary :where(.search-summary__footer--leaving){pointer-events:none;animation:.25s ease-in both search-summary-content-disappear}.search-summary :where(.search-summary__answer-wrap){display:block;position:relative}.search-summary :where(.search-summary__answer){margin-bottom:var(--spacer-16,1rem);line-height:var(--search-summary-answer-line-height,1.5)}.search-summary :where(.search-summary__answer a){color:var(--search-summary-link-color,LinkText);text-decoration:underline}.search-summary :where(.search-summary__answer p){margin-top:0}.search-summary :where(.search-summary__loading){margin-bottom:var(--spacer-16,1rem);align-items:center;gap:var(--spacer-8,.5rem);display:flex}.search-summary :where(.search-summary__loading-spinner){border:1.5px solid var(--anchor-color,currentColor);border-top-color:#0000;border-radius:50%;flex-shrink:0;width:.5em;height:.5em;animation:.4s linear infinite search-summary-spin;display:inline-block}.search-summary :where(.search-summary__loading-text){font-size:var(--base-font-size-default,inherit)}.search-summary :where(.search-summary__references){padding:0;padding-bottom:var(--spacer-32,2rem);color:var(--search-summary-reference-list-color,inherit);font-size:var(--search-summary-reference-list-font-size,inherit);font-size:var(--base-font-size-sm,inherit);margin:0;list-style-type:none}.search-summary :where(.search-summary__references-title){padding:var(--spacer-2,2px) 0;font-weight:var(--base-font-weight-bold,500);font-size:var(--base-font-size-sm,inherit)}.search-summary :where(.search-summary__reference){display:list-item}.search-summary :where(.search-summary__reference a){padding:var(--spacer-2,2px) 0;color:var(--search-summary-reference-list-color,var(--search-summary-link-color,LinkText));display:block}.search-summary :where(.search-summary__disclaimer){margin-bottom:var(--spacer-16,1rem);line-height:var(--base-line-height-default,1.5)}.search-summary :where(.search-summary__disclaimer a){color:var(--search-summary-disclaimer-link-color,var(--search-summary-link-color,LinkText));text-decoration:underline}.search-summary :where(.search-summary__disclaimer p){margin-top:0}.search-summary :where(.search-summary__opt-in-panel){flex-direction:column;flex:1;min-height:0;display:flex}.search-summary :where(.search-summary__opt-in-body){min-height:0;margin-top:var(--spacer-4,.25rem);margin-bottom:var(--spacer-16,1rem);flex:1;position:relative;overflow-y:auto}.search-summary :where(.search-summary__error){color:var(--search-summary-error-color,inherit)}.search-summary :where(.search-summary__footer){margin-right:calc(-1 * var(--search-summary-padding,0));margin-left:calc(-1 * var(--search-summary-padding,0));padding:0 var(--search-summary-padding,0) calc(var(--search-summary-padding,0));justify-content:space-between;align-items:center;gap:var(--spacer-12,.75rem);background:var(--search-summary-footer-background,var(--search-summary-background,white));flex-wrap:wrap;flex-shrink:0;display:flex;position:relative}.search-summary :where(.search-summary__footer):after{height:var(--spacer-48,3rem);background:linear-gradient(to bottom, transparent, var(--search-summary-footer-background,var(--search-summary-background,white)));content:"";pointer-events:none;position:absolute;top:0;left:0;right:0;transform:translateY(-100%)}.search-summary :where(.search-summary__footer-actions){align-items:center;gap:var(--spacer-8,.5rem);flex-wrap:wrap;display:flex}.search-summary :where(.search-summary__expand,.search-summary__expand-slot-mount,.search-summary__opt-in,.search-summary__opt-in-slot-mount,.search-summary__opt-out,.search-summary__opt-out-slot-mount){animation:.3s cubic-bezier(.25,.46,.45,.94) both search-summary-action-appear}.search-summary :where(.search-summary__opt-in,.search-summary__opt-in-slot-mount){animation-delay:.3s}.search-summary :where(.search-summary__btn--leaving){pointer-events:none;animation:.2s cubic-bezier(.55,0,1,.45) both search-summary-action-disappear}.search-summary :where(.search-summary__expand,.search-summary__opt-in,.search-summary__opt-out):not(:where(.search-summary__btn)){padding:0;font:inherit;padding-inline:0}.search-summary :where(.search-summary__expand,.search-summary__opt-in):not(:where(.search-summary__btn)){border-width:var(--search-summary-action-border-width,0);border-style:var(--search-summary-action-border-style,solid);border-radius:var(--search-summary-action-primary-border-radius,0);border-color:var(--search-summary-action-primary-border-color,transparent);background:var(--search-summary-action-primary-background,transparent);color:var(--search-summary-action-primary-color,var(--search-summary-link-color,LinkText));text-decoration:underline}.search-summary :where(.search-summary__opt-out):not(:where(.search-summary__btn)){border-width:var(--search-summary-action-border-width,0);border-style:var(--search-summary-action-border-style,solid);border-radius:var(--search-summary-action-secondary-border-radius,0);border-color:var(--search-summary-action-secondary-border-color,transparent);background:var(--search-summary-action-secondary-background,transparent);color:var(--search-summary-action-secondary-color,var(--search-summary-link-color,LinkText));text-decoration:underline}.search-summary :where(.search-summary__btn){padding:var(--btn-padding-y,var(--spacer-8,.5rem)) var(--btn-padding-x,var(--spacer-20,1.25rem));align-items:center;gap:var(--spacer-8,.5rem);border-width:var(--spacer-1,1px);font-size:var(--base-font-size-sm,inherit);cursor:pointer;border-style:solid;font-family:inherit;line-height:1.25;text-decoration:none;display:inline-flex}.search-summary :where(.search-summary__btn--primary){border-radius:var(--btn-primary-border-radius);border-color:var(--btn-primary-border-color,transparent);background:var(--btn-primary-background);color:var(--btn-primary-color);font-weight:var(--btn-primary-font-weight,700)}.search-summary :where(.search-summary__btn--primary):hover{background:var(--btn-primary-hover-background,var(--btn-primary-background));color:var(--btn-primary-hover-color,var(--btn-primary-color))}.search-summary :where(.search-summary__btn--secondary){border-radius:var(--btn-secondary-border-radius);border-color:var(--btn-secondary-border-color,var(--btn-secondary-background));background:var(--btn-secondary-background);color:var(--btn-secondary-color);font-weight:var(--btn-secondary-font-weight,700)}.search-summary :where(.search-summary__btn--secondary):hover{background:var(--btn-secondary-hover-background,var(--btn-secondary-background));color:var(--btn-secondary-hover-color,var(--btn-secondary-color))}@media (prefers-reduced-motion:reduce){.search-summary :where(.search-summary__content),.search-summary :where(.search-summary__content--leaving),.search-summary :where(.search-summary__footer--leaving),.search-summary :where(.search-summary__expand,.search-summary__expand-slot-mount,.search-summary__opt-in,.search-summary__opt-in-slot-mount,.search-summary__opt-out,.search-summary__opt-out-slot-mount),.search-summary :where(.search-summary__btn--leaving),.search-summary :where(.search-summary__loading-spinner){animation:none!important}}}`,ve=`liipgpt:search-summary:opt-in:`;function ye(e){let t=5381;for(let n=0;n<e.length;n++)t=t*33^e.charCodeAt(n);return(t>>>0).toString(36)}function L(e){return`${ve}${ye(e??``)}`}function R(){try{return typeof window<`u`&&window.localStorage!==void 0}catch{return!1}}function be(e){if(!R())return!1;try{return window.localStorage.getItem(L(e))===`1`}catch{return!1}}function xe(e){if(R())try{window.localStorage.setItem(L(e),`1`)}catch{}}function Se(e){if(R())try{window.localStorage.removeItem(L(e))}catch{}}var z=new WeakMap;function Ce(e,t,n){if(!t)return null;let r=z.get(t);return r&&t.removeEventListener(`click`,r),t.removeAttribute(`slot`),t.type=`button`,t.addEventListener(`click`,n),z.set(t,n),e.appendChild(t),({label:e,ariaLabel:n,ariaExpanded:r})=>{e!==void 0&&(t.textContent=e),n!==void 0&&t.setAttribute(`aria-label`,n),r===void 0?t.removeAttribute(`aria-expanded`):t.setAttribute(`aria-expanded`,String(r))}}function we(e,t){if(!t)return;let n=z.get(t);n&&(t.removeEventListener(`click`,n),z.delete(t)),e.contains(t)&&e.removeChild(t)}function Te(e,t=`.search-summary`){return e.replaceAll(`.chat-app`,t)}var B=`(prefers-reduced-motion: reduce)`;function Ee(e){if(typeof window>`u`)return e(!1),()=>{};let t=window.matchMedia(B);e(t.matches);let n=()=>e(t.matches);return t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)}var De=m(`<!> <!> <!>`,1),Oe=m(`<div class="search-summary__disclaimer-text"></div>`),ke=m(`<div class="search-summary__opt-in-slot-mount"></div>`),Ae=m(`<button type="button"> </button>`),je=m(`<div class="search-summary__opt-in-panel"><div class="search-summary__opt-in-body"><div class="search-summary__disclaimer"><!></div></div> <div class="search-summary__footer"><!></div></div>`),Me=m(`<div class="search-summary__loading" aria-live="polite"><span class="search-summary__loading-spinner" aria-hidden="true"></span> <span class="search-summary__loading-text"> </span></div>`),Ne=m(`<div class="search-summary__error" role="alert"> </div>`),Pe=m(`<li class="search-summary__reference"><a target="_blank" rel="noopener noreferrer"> </a></li>`),Fe=m(`<div class="search-summary__references-title"> </div> <ol class="search-summary__references"></ol>`,1),Ie=m(`<div class="search-summary__expand-slot-mount"></div>`),Le=m(`<button type="button"> </button>`),Re=m(`<div class="search-summary__opt-out-slot-mount"></div>`),ze=m(`<button type="button"> </button>`),Be=m(`<div class="search-summary__content"><div class="search-summary__answer-wrap"><!> <div class="search-summary__answer" aria-live="polite"></div></div> <!> <!></div> <div class="search-summary__footer"><div class="search-summary__footer-actions"><!></div> <!></div>`,1),Ve=m(`<!> <!> <div class="search-summary"><!></div>`,1);function V(s,l){a(l,!0);let m=T(l,`lang`,7,`de`),_=T(l,`apiUrl`,7),y=T(l,`apiKey`,7,``),b=T(l,`question`,7),x=T(l,`height`,7,`280`),S=T(l,`optIn`,7,!1),P=T(l,`optInLabel`,7),F=T(l,`expandLabel`,7),I=T(l,`collapseLabel`,7),ve=T(l,`optOutLabel`,7),ye=T(l,`useChatConfig`,7,!1),L=T(l,`forceTheme`,7),R=T(l,`disclaimerHtml`,7,``),z=T(l,`labelledBy`,7),B=T(l,`activateAiButtonSlot`,7,null),V=T(l,`expandAnswerButtonSlot`,7,null),H=T(l,`deactivateAiButtonSlot`,7,null),He=e(null),U=e(null),Ue=[`de`,`en`,`fr`,`it`],We=c(()=>h(U)?.language??pe(m(),Ue)),W=c(()=>({...ge[h(We)],...h(He)})),G=e(`loading`),K=e(null),q=e(null),Ge=e(null),Ke=e(null),qe=e(!1),J=e(!1),Je=e(d(le)),Ye=c(()=>ce(x())),Y=c(()=>oe(h(Ye))),Xe=c(()=>h(Y)===null),Ze=c(()=>h(Y)??le),Qe=e(!1);w(()=>Ee(e=>j(Qe,e,!0)));function $e(e){return h(Qe)?0:e}let X=new he(v(()=>h(Ze)),{duration:400,easing:me}),et=e(!1);w(()=>{if(!h(et)){if(h(J)){X.set(h(Je),{duration:$e(400)});return}!h(Xe)&&h(Y)!==null&&X.set(h(Y),{duration:$e(400)})}});function tt(){return h(K)?h(Y)===null?se(h(K),h(Ye)):h(Y):h(Ze)}async function nt(e){j(et,!0),await X.set(e,{duration:$e(400)}),j(et,!1)}function rt(){if(!h(K))return tt();if(h(K).offsetHeight>0)return h(K).offsetHeight;let e=h(K).style.height;if(!e)return tt();let t=oe(e);return t===null?se(h(K),e):t}let it=e(``),at=e(d([])),ot=e(``),st=c(()=>h(G)!==`opt-in`&&h(G)!==`loading`&&h(G)!==`error`&&(h(qe)||h(J))),ct=c(()=>S()&&h(G)!==`opt-in`),lt=c(()=>h(J)?I()||h(W).searchSummaryCollapse:F()||h(W).searchSummaryExpand),ut=c(()=>h(J)?h(W).ariaSearchSummaryCollapse:h(W).ariaSearchSummaryExpand),dt=c(()=>h(U)?fe(h(U).chatConfig.fullTheme[h(U).colorScheme].tokens,{root:`.search-summary`}):``),ft=c(()=>h(U)?.chatConfig.fullTheme[h(U).colorScheme]?.customCSS?Te(h(U).chatConfig.fullTheme[h(U).colorScheme].customCSS):``),pt=c(()=>h(U)?.chatConfig.fullTheme[h(U).colorScheme]?.fontCSS??``),mt=c(()=>h(U)!==null),ht=c(()=>h(mt)?` search-summary__btn`:``);function gt(){if(!h(K))return h(Ze);let e=h(K).style.height;h(K).style.height=`auto`;let t=h(K).scrollHeight;return h(K).style.height=e,t}function Z(){j(qe,(h(q)?.scrollHeight??0)>(h(q)?.offsetHeight??0)+1)}function _t(){j(Je,gt(),!0)}async function vt(){if(h(K))if(!h(J))_t(),X.set(rt(),{duration:0}),j(J,!0),j(G,`expanded`),await te(),Z(),_t(),await nt(h(Je));else{X.set(rt(),{duration:0});let e=tt();j(J,!1),j(G,h(it)?`done`:`loading`,!0),await te(),Z(),await nt(e)}}let yt=e(!1);w(()=>{h(yt)||_()&&(j(G,S()&&!be(_())?`opt-in`:`loading`,!0),j(yt,!0))}),w(()=>{if(!_()||!ye()){j(U,null),j(He,null);return}let e=!1;return ae(async()=>{let{loadChatConfig:e}=await import(`./BsL0-YLl.js`);return{loadChatConfig:e}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url).then(({loadChatConfig:e})=>e({apiUrl:_(),lang:m(),forceTheme:L()})).then(t=>{e||(j(U,t,!0),j(He,t.chatConfig.translations[t.language]??null,!0))}).catch(()=>{e||(j(U,null),j(He,null))}),()=>{e=!0}}),w(()=>{if(!h(K))return;h(it),h(at).length,h(Ye),_t(),Z();let e=new ResizeObserver(()=>{_t(),Z()});return e.observe(h(K)),h(q)&&e.observe(h(q)),()=>e.disconnect()});function bt(e){return e.classList.add(`search-summary__btn--leaving`),{duration:$e(200)}}function xt(e,t){if(h(Qe)){t();return}let n=e.currentTarget;n.classList.add(`search-summary__btn--leaving`),n.addEventListener(`animationend`,t,{once:!0})}function St(e=null){if(h(Qe)){Tt();return}e?.classList.add(`search-summary__btn--leaving`),h(q)?.classList.add(`search-summary__content--leaving`),h(Ge)?.classList.add(`search-summary__footer--leaving`),h(Ge)?.querySelector(`.search-summary__expand, .search-summary__expand-slot-mount`)?.classList.add(`search-summary__btn--leaving`);let t=h(q)??e;t?t.addEventListener(`animationend`,Tt,{once:!0}):Tt()}function Ct(e){St(e.currentTarget)}function wt(){xe(_()),j(G,`loading`)}async function Tt(){Se(_()),Dt?.(),Q&&await Q.abort().catch(()=>{}),Dt=void 0,Q=void 0,Et=!1,j(it,``),j(at,[],!0),j(ot,``),j(J,!1),j(qe,!1),j(G,`opt-in`)}let Et=!1,Dt,Q;function Ot(){if(Et)return;Et=!0;let e=new ue({apiUrl:_(),apiKey:y()});try{Q=e.createConversation().chat(b(),{lang:h(We)})}catch(e){j(ot,e instanceof Error&&e.message?e.message:h(W).searchSummaryError,!0),j(G,`error`);return}Dt=Q.subscribe(e=>{if(e.errors.length>0){j(ot,e.errors.join(`, `)||h(W).searchSummaryError,!0),j(G,`error`);return}if(e.state===`loading`){j(G,`loading`);return}j(it,e.message.html,!0),j(at,e.references.used.slice().sort((e,t)=>(e.referenceIndex.used??0)-(t.referenceIndex.used??0)),!0),e.state===`streaming`?h(J)||j(G,`answering`):e.state===`done`&&(h(J)||j(G,`done`),queueMicrotask(Z))})}w(()=>{!b()||!_()||h(G)!==`loading`||Ot()}),ee(()=>{Dt?.(),Q&&Q.abort().catch(()=>{})}),w(()=>{h(Ke)&&(h(Ke).innerHTML=h(it),h(Ke).querySelectorAll(`liipgpt-reference-number`).forEach(e=>e.remove()),queueMicrotask(Z))});let kt=e(null),At=e(null),jt=e(null);w(()=>{let e=h(kt),t=B();if(!(!e||!t))return Ce(e,t,wt)?.({label:P()||void 0}),()=>we(e,t)}),w(()=>{let e=h(At),t=V();if(!(!e||!t||!h(st)))return Ce(e,t,vt)?.({label:F()||I()?h(lt):void 0,ariaLabel:h(ut),ariaExpanded:h(J)}),()=>we(e,t)}),w(()=>{!V()||!h(st)||((F()||I())&&(V().textContent=h(lt)),V().setAttribute(`aria-label`,h(ut)),V().setAttribute(`aria-expanded`,String(h(J))))}),w(()=>{let e=h(jt),t=H();if(!(!e||!t||!h(ct)))return Ce(e,t,()=>St(e))?.({label:ve()||void 0,ariaLabel:h(W).ariaSearchSummaryOptOut}),()=>we(e,t)});var Mt={get lang(){return m()},set lang(e=`de`){m(e),C()},get apiUrl(){return _()},set apiUrl(e){_(e),C()},get apiKey(){return y()},set apiKey(e=``){y(e),C()},get question(){return b()},set question(e){b(e),C()},get height(){return x()},set height(e=`280`){x(e),C()},get optIn(){return S()},set optIn(e=!1){S(e),C()},get optInLabel(){return P()},set optInLabel(e){P(e),C()},get expandLabel(){return F()},set expandLabel(e){F(e),C()},get collapseLabel(){return I()},set collapseLabel(e){I(e),C()},get optOutLabel(){return ve()},set optOutLabel(e){ve(e),C()},get useChatConfig(){return ye()},set useChatConfig(e=!1){ye(e),C()},get forceTheme(){return L()},set forceTheme(e){L(e),C()},get disclaimerHtml(){return R()},set disclaimerHtml(e=``){R(e),C()},get labelledBy(){return z()},set labelledBy(e){z(e),C()},get activateAiButtonSlot(){return B()},set activateAiButtonSlot(e=null){B(e),C()},get expandAnswerButtonSlot(){return V()},set expandAnswerButtonSlot(e=null){V(e),C()},get deactivateAiButtonSlot(){return H()},set deactivateAiButtonSlot(e=null){H(e),C()}},Nt=Ve(),Pt=g(Nt);de(Pt,{id:`search-summary-css`,get css(){return _e}});var Ft=M(Pt,2),It=e=>{var t=De(),r=g(t);de(r,{id:`search-summary-font-css`,get css(){return h(pt)}});var i=M(r,2);de(i,{id:`search-summary-theme-css`,get css(){return h(dt)}});var a=M(i,2),o=e=>{de(e,{id:`search-summary-custom-css`,get css(){return h(ft)}})};n(a,e=>{h(ft)&&e(o)}),D(e,t)};n(Ft,e=>{h(mt)&&h(dt)&&e(It)});var $=M(Ft,2);let Lt;var Rt=N($),zt=e=>{var r=je(),a=N(r),o=N(a),s=N(o),c=e=>{var t=i(),r=g(t),a=e=>{var t=Oe();u(t,()=>h(W).searchSummaryDisclaimer,!0),p(t),D(e,t)};n(r,e=>{h(W).searchSummaryDisclaimer&&e(a)}),D(e,t)},l=e=>{var t=i();u(g(t),R),D(e,t)};n(s,e=>{ye()?e(c):e(l,-1)}),p(o),p(a);var d=M(a,2),m=N(d),_=e=>{var t=ke();k(t,e=>j(kt,e),()=>h(kt)),D(e,t)},v=e=>{var n=Ae(),r=N(n,!0);p(n),E(()=>{f(n,1,`search-summary__opt-in${h(ht)??``}${h(mt)?` search-summary__btn--secondary`:``}`),t(r,P()||h(W).searchSummaryOptInDefault)}),O(`click`,n,e=>xt(e,wt)),D(e,n)};n(m,e=>{B()?e(_):e(v,-1)}),p(d),p(r),D(e,r)},Bt=e=>{var r=Be(),a=g(r),s=N(a),c=N(s),l=e=>{var n=Me(),r=M(N(n),2),i=N(r,!0);p(r),p(n),E(()=>t(i,h(W).searchSummaryLoading)),D(e,n)};n(c,e=>{h(G)===`loading`&&e(l)}),k(M(c,2),e=>j(Ke,e),()=>h(Ke)),p(s);var u=M(s,2),d=e=>{var n=Ne(),r=N(n,!0);p(n),E(()=>t(r,h(ot)||h(W).searchSummaryError)),D(e,n)};n(u,e=>{h(G)===`error`&&e(d)});var m=M(u,2),_=e=>{var n=Fe(),r=g(n),i=N(r,!0);p(r);var a=M(r,2);ie(a,21,()=>h(at),e=>e.referenceIndex.used??e.url,(e,n)=>{var r=Pe(),i=N(r),a=N(i,!0);p(i),p(r),E(()=>{re(r,h(n).referenceIndex.used??void 0),A(i,`href`,h(n).url),t(a,h(n).display.listItem.title||h(n).display.card.title||h(n).url)}),D(e,r)}),p(a),E(()=>t(i,h(W).referencesTitle)),D(e,n)};n(m,e=>{h(at).length>0&&e(_)}),p(a),k(a,e=>j(q,e),()=>h(q));var v=M(a,2),y=N(v),b=N(y),x=e=>{var r=i(),a=g(r),s=e=>{var t=Ie();k(t,e=>j(At,e),()=>h(At)),o(2,t,()=>bt),D(e,t)},c=e=>{var n=Le(),r=N(n,!0);p(n),E(()=>{f(n,1,`search-summary__expand${h(ht)??``}${h(mt)?` search-summary__btn--primary`:``}`),A(n,`aria-expanded`,h(J)),A(n,`aria-label`,h(ut)),t(r,h(lt))}),O(`click`,n,vt),o(2,n,()=>bt),D(e,n)};n(a,e=>{V()?e(s):e(c,-1)}),D(e,r)};n(b,e=>{h(st)&&e(x)}),p(y);var S=M(y,2),C=e=>{var r=i(),a=g(r),o=e=>{var t=Re();k(t,e=>j(jt,e),()=>h(jt)),D(e,t)},s=e=>{var n=ze(),r=N(n,!0);p(n),E(()=>{f(n,1,`search-summary__opt-out${h(ht)??``}${h(mt)?` search-summary__btn--secondary`:``}`),A(n,`aria-label`,h(W).ariaSearchSummaryOptOut),t(r,ve()||h(W).searchSummaryOptOut)}),O(`click`,n,Ct),D(e,n)};n(a,e=>{H()?e(o):e(s,-1)}),D(e,r)};n(S,e=>{h(ct)&&e(C)}),p(v),k(v,e=>j(Ge,e),()=>h(Ge)),D(e,r)};return n(Rt,e=>{h(G)===`opt-in`?e(zt):e(Bt,-1)}),p($),k($,e=>j(K,e),()=>h(K)),E(()=>{A($,`data-state`,h(G)),A($,`data-expanded`,h(J)?`true`:`false`),A($,`role`,z()?`region`:void 0),A($,`aria-labelledby`,z()),Lt=ne($,``,Lt,{height:h(J)||h(et)||!h(Xe)?`${X.current}px`:h(Ye)})}),D(s,Nt),r(Mt)}y([`click`]),S(V,{lang:{},apiUrl:{},apiKey:{},question:{},height:{},optIn:{},optInLabel:{},expandLabel:{},collapseLabel:{},optOutLabel:{},useChatConfig:{},forceTheme:{},disclaimerHtml:{},labelledBy:{},activateAiButtonSlot:{},expandAnswerButtonSlot:{},deactivateAiButtonSlot:{}},[],[],{mode:`open`});function H(t,n){a(n,!0);let i=T(n,`lang`,7),o=T(n,`apiUrl`,7),s=T(n,`apiKey`,7),l=T(n,`question`,7),u=T(n,`height`,7),d=T(n,`optIn`,7),f=T(n,`optInLabel`,7),p=T(n,`expandLabel`,7),m=T(n,`collapseLabel`,7),g=T(n,`optOutLabel`,7),v=T(n,`useChatConfig`,7),y=T(n,`forceTheme`,7),b=T(n,`wrapperClass`,7),S=T(n,`labelledBy`,7),ee=c(()=>({lang:i(),apiUrl:o(),apiKey:s(),question:l(),height:u(),optIn:d(),optInLabel:f(),expandLabel:p(),collapseLabel:m(),optOutLabel:g(),useChatConfig:v(),forceTheme:y(),labelledBy:S()})),E=n.$$host;w(()=>{E&&b()&&(E.className=b())});let D=c(()=>E?.querySelector(`[slot="disclaimer"]`)?.innerHTML??``),te=e(null),O=e(null),k=e(null);return x(()=>{if(v()){j(te,null),j(O,null),j(k,null);return}j(te,E?.querySelector(`[slot="activate-ai-button"]`)??null,!0),j(O,E?.querySelector(`[slot="expand-answer-button"]`)??null,!0),j(k,E?.querySelector(`[slot="deactivate-ai-button"]`)??null,!0)}),V(t,_(()=>h(ee),{get disclaimerHtml(){return h(D)},get activateAiButtonSlot(){return h(te)},get expandAnswerButtonSlot(){return h(O)},get deactivateAiButtonSlot(){return h(k)}})),r({get lang(){return i()},set lang(e){i(e),C()},get apiUrl(){return o()},set apiUrl(e){o(e),C()},get apiKey(){return s()},set apiKey(e){s(e),C()},get question(){return l()},set question(e){l(e),C()},get height(){return u()},set height(e){u(e),C()},get optIn(){return d()},set optIn(e){d(e),C()},get optInLabel(){return f()},set optInLabel(e){f(e),C()},get expandLabel(){return p()},set expandLabel(e){p(e),C()},get collapseLabel(){return m()},set collapseLabel(e){m(e),C()},get optOutLabel(){return g()},set optOutLabel(e){g(e),C()},get useChatConfig(){return v()},set useChatConfig(e){v(e),C()},get forceTheme(){return y()},set forceTheme(e){y(e),C()},get wrapperClass(){return b()},set wrapperClass(e){b(e),C()},get labelledBy(){return S()},set labelledBy(e){S(e),C()}})}customElements.define(`liipgpt-search-summary`,S(H,{lang:{attribute:`lang`,type:`String`},apiUrl:{attribute:`api-url`,type:`String`},apiKey:{attribute:`api-key`,type:`String`},question:{attribute:`question`,type:`String`},height:{attribute:`height`,type:`String`},optIn:{attribute:`opt-in`,type:`Boolean`},optInLabel:{attribute:`opt-in-label`,type:`String`},expandLabel:{attribute:`expand-label`,type:`String`},collapseLabel:{attribute:`collapse-label`,type:`String`},optOutLabel:{attribute:`opt-out-label`,type:`String`},useChatConfig:{attribute:`use-chat-config`,type:`Boolean`},forceTheme:{attribute:`force-theme`,type:`String`},wrapperClass:{attribute:`wrapper-class`,type:`String`},labelledBy:{attribute:`labelled-by`,type:`String`}},[],[]));export{H as LiipGPTSearchSummary};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"../chunks/C00ruT0L.js";import{n as e,s as t}from"../chunks/BjD-MS84.js";import"../chunks/Bo0U8J3e.js";export{t as load_css,e as start};
|