@kodaris/krubble-app-components 1.0.75 → 1.0.77

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.
@@ -6,26 +6,26 @@ import { KRHttp } from '@kodaris/krubble-http';
6
6
  * Copyright 2019 Google LLC
7
7
  * SPDX-License-Identifier: BSD-3-Clause
8
8
  */
9
- const t$4=globalThis,e$7=t$4.ShadowRoot&&(void 0===t$4.ShadyCSS||t$4.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$3=Symbol(),o$5=new WeakMap;let n$3 = class n{constructor(t,e,o){if(this._$cssResult$=true,o!==s$3)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e$7&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$5.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$5.set(s,t));}return t}toString(){return this.cssText}};const r$4=t=>new n$3("string"==typeof t?t:t+"",void 0,s$3),i$5=(t,...e)=>{const o=1===t.length?t[0]:e.reduce((e,s,o)=>e+(t=>{if(true===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[o+1],t[0]);return new n$3(o,t,s$3)},S$1=(s,o)=>{if(e$7)s.adoptedStyleSheets=o.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const e of o){const o=document.createElement("style"),n=t$4.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$3=e$7?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$4(e)})(t):t;
9
+ const t$4=globalThis,e$7=t$4.ShadowRoot&&(void 0===t$4.ShadyCSS||t$4.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$3=Symbol(),o$6=new WeakMap;let n$4 = class n{constructor(t,e,o){if(this._$cssResult$=true,o!==s$3)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e$7&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$6.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$6.set(s,t));}return t}toString(){return this.cssText}};const r$4=t=>new n$4("string"==typeof t?t:t+"",void 0,s$3),i$6=(t,...e)=>{const o=1===t.length?t[0]:e.reduce((e,s,o)=>e+(t=>{if(true===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[o+1],t[0]);return new n$4(o,t,s$3)},S$1=(s,o)=>{if(e$7)s.adoptedStyleSheets=o.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const e of o){const o=document.createElement("style"),n=t$4.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$3=e$7?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$4(e)})(t):t;
10
10
 
11
11
  /**
12
12
  * @license
13
13
  * Copyright 2017 Google LLC
14
14
  * SPDX-License-Identifier: BSD-3-Clause
15
- */const{is:i$4,defineProperty:e$6,getOwnPropertyDescriptor:h$2,getOwnPropertyNames:r$3,getOwnPropertySymbols:o$4,getPrototypeOf:n$2}=Object,a$1=globalThis,c$2=a$1.trustedTypes,l$1=c$2?c$2.emptyScript:"",p$2=a$1.reactiveElementPolyfillSupport,d$1=(t,s)=>t,u$3={toAttribute(t,s){switch(s){case Boolean:t=t?l$1:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t);}catch(t){i=null;}}return i}},f$1=(t,s)=>!i$4(t,s),b$1={attribute:true,type:String,converter:u$3,reflect:false,useDefault:false,hasChanged:f$1};Symbol.metadata??=Symbol("metadata"),a$1.litPropertyMetadata??=new WeakMap;let y$1 = class y extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=b$1){if(s.state&&(s.attribute=false),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=true),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),h=this.getPropertyDescriptor(t,i,s);void 0!==h&&e$6(this.prototype,t,h);}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h$2(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)??b$1}static _$Ei(){if(this.hasOwnProperty(d$1("elementProperties")))return;const t=n$2(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d$1("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(d$1("properties"))){const t=this.properties,s=[...r$3(t),...o$4(t)];for(const i of s)this.createProperty(i,t[i]);}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i);}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(c$3(s));}else void 0!==s&&i.push(c$3(s));return i}static _$Eu(t,s){const i=s.attribute;return false===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=false,this.hasUpdated=false,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this));}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.();}removeController(t){this._$EO?.delete(t);}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t);}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return S$1(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(true),this._$EO?.forEach(t=>t.hostConnected?.());}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.());}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&true===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u$3).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null;}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u$3;this._$Em=e;const r=h.fromAttribute(s,t.type);this[e]=r??this._$Ej?.get(e)??r,this._$Em=null;}}requestUpdate(t,s,i,e=false,h){if(void 0!==t){const r=this.constructor;if(false===e&&(h=this[t]),i??=r.getPropertyOptions(t),!((i.hasChanged??f$1)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(r._$Eu(t,i))))return;this.C(t,s,i);} false===this.isUpdatePending&&(this._$ES=this._$EP());}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),true!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),true===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t));}async _$EP(){this.isUpdatePending=true;try{await this._$ES;}catch(t){Promise.reject(t);}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0;}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];true!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e);}}let t=false;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(s)):this._$EM();}catch(s){throw t=false,this._$EM(),s}t&&this._$AE(s);}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(t)),this.updated(t);}_$EM(){this._$AL=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return true}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM();}updated(t){}firstUpdated(t){}};y$1.elementStyles=[],y$1.shadowRootOptions={mode:"open"},y$1[d$1("elementProperties")]=new Map,y$1[d$1("finalized")]=new Map,p$2?.({ReactiveElement:y$1}),(a$1.reactiveElementVersions??=[]).push("2.1.2");
15
+ */const{is:i$5,defineProperty:e$6,getOwnPropertyDescriptor:h$2,getOwnPropertyNames:r$3,getOwnPropertySymbols:o$5,getPrototypeOf:n$3}=Object,a$1=globalThis,c$2=a$1.trustedTypes,l$1=c$2?c$2.emptyScript:"",p$2=a$1.reactiveElementPolyfillSupport,d$1=(t,s)=>t,u$3={toAttribute(t,s){switch(s){case Boolean:t=t?l$1:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t);}catch(t){i=null;}}return i}},f$1=(t,s)=>!i$5(t,s),b$1={attribute:true,type:String,converter:u$3,reflect:false,useDefault:false,hasChanged:f$1};Symbol.metadata??=Symbol("metadata"),a$1.litPropertyMetadata??=new WeakMap;let y$1 = class y extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=b$1){if(s.state&&(s.attribute=false),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=true),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),h=this.getPropertyDescriptor(t,i,s);void 0!==h&&e$6(this.prototype,t,h);}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h$2(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)??b$1}static _$Ei(){if(this.hasOwnProperty(d$1("elementProperties")))return;const t=n$3(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d$1("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(d$1("properties"))){const t=this.properties,s=[...r$3(t),...o$5(t)];for(const i of s)this.createProperty(i,t[i]);}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i);}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(c$3(s));}else void 0!==s&&i.push(c$3(s));return i}static _$Eu(t,s){const i=s.attribute;return false===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=false,this.hasUpdated=false,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this));}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.();}removeController(t){this._$EO?.delete(t);}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t);}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return S$1(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(true),this._$EO?.forEach(t=>t.hostConnected?.());}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.());}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&true===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u$3).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null;}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u$3;this._$Em=e;const r=h.fromAttribute(s,t.type);this[e]=r??this._$Ej?.get(e)??r,this._$Em=null;}}requestUpdate(t,s,i,e=false,h){if(void 0!==t){const r=this.constructor;if(false===e&&(h=this[t]),i??=r.getPropertyOptions(t),!((i.hasChanged??f$1)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(r._$Eu(t,i))))return;this.C(t,s,i);} false===this.isUpdatePending&&(this._$ES=this._$EP());}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),true!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),true===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t));}async _$EP(){this.isUpdatePending=true;try{await this._$ES;}catch(t){Promise.reject(t);}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0;}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];true!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e);}}let t=false;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(s)):this._$EM();}catch(s){throw t=false,this._$EM(),s}t&&this._$AE(s);}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(t)),this.updated(t);}_$EM(){this._$AL=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return true}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM();}updated(t){}firstUpdated(t){}};y$1.elementStyles=[],y$1.shadowRootOptions={mode:"open"},y$1[d$1("elementProperties")]=new Map,y$1[d$1("finalized")]=new Map,p$2?.({ReactiveElement:y$1}),(a$1.reactiveElementVersions??=[]).push("2.1.2");
16
16
 
17
17
  /**
18
18
  * @license
19
19
  * Copyright 2017 Google LLC
20
20
  * SPDX-License-Identifier: BSD-3-Clause
21
21
  */
22
- const t$3=globalThis,i$3=t=>t,s$2=t$3.trustedTypes,e$5=s$2?s$2.createPolicy("lit-html",{createHTML:t=>t}):void 0,h$1="$lit$",o$3=`lit$${Math.random().toFixed(9).slice(2)}$`,n$1="?"+o$3,r$2=`<${n$1}>`,l=document,c$1=()=>l.createComment(""),a=t=>null===t||"object"!=typeof t&&"function"!=typeof t,u$2=Array.isArray,d=t=>u$2(t)||"function"==typeof t?.[Symbol.iterator],f="[ \t\n\f\r]",v$1=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_=/-->/g,m$1=/>/g,p$1=RegExp(`>|${f}(?:([^\\s"'>=/]+)(${f}*=${f}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),g=/'/g,$=/"/g,y=/^(?:script|style|textarea|title)$/i,x=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),b=x(1),E=Symbol.for("lit-noChange"),A=Symbol.for("lit-nothing"),C=new WeakMap,P=l.createTreeWalker(l,129);function V(t,i){if(!u$2(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==e$5?e$5.createHTML(i):i}const N=(t,i)=>{const s=t.length-1,e=[];let n,l=2===i?"<svg>":3===i?"<math>":"",c=v$1;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,f=0;for(;f<s.length&&(c.lastIndex=f,u=c.exec(s),null!==u);)f=c.lastIndex,c===v$1?"!--"===u[1]?c=_:void 0!==u[1]?c=m$1:void 0!==u[2]?(y.test(u[2])&&(n=RegExp("</"+u[2],"g")),c=p$1):void 0!==u[3]&&(c=p$1):c===p$1?">"===u[0]?(c=n??v$1,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?p$1:'"'===u[3]?$:g):c===$||c===g?c=p$1:c===_||c===m$1?c=v$1:(c=p$1,n=void 0);const x=c===p$1&&t[i+1].startsWith("/>")?" ":"";l+=c===v$1?s+r$2:d>=0?(e.push(a),s.slice(0,d)+h$1+s.slice(d)+o$3+x):s+o$3+(-2===d?i:x);}return [V(t,l+(t[s]||"<?>")+(2===i?"</svg>":3===i?"</math>":"")),e]};class S{constructor({strings:t,_$litType$:i},e){let r;this.parts=[];let l=0,a=0;const u=t.length-1,d=this.parts,[f,v]=N(t,i);if(this.el=S.createElement(f,e),P.currentNode=this.el.content,2===i||3===i){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes);}for(;null!==(r=P.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(h$1)){const i=v[a++],s=r.getAttribute(t).split(o$3),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:l,name:e[2],strings:s,ctor:"."===e[1]?I:"?"===e[1]?L:"@"===e[1]?z:H}),r.removeAttribute(t);}else t.startsWith(o$3)&&(d.push({type:6,index:l}),r.removeAttribute(t));if(y.test(r.tagName)){const t=r.textContent.split(o$3),i=t.length-1;if(i>0){r.textContent=s$2?s$2.emptyScript:"";for(let s=0;s<i;s++)r.append(t[s],c$1()),P.nextNode(),d.push({type:2,index:++l});r.append(t[i],c$1());}}}else if(8===r.nodeType)if(r.data===n$1)d.push({type:2,index:l});else {let t=-1;for(;-1!==(t=r.data.indexOf(o$3,t+1));)d.push({type:7,index:l}),t+=o$3.length-1;}l++;}}static createElement(t,i){const s=l.createElement("template");return s.innerHTML=t,s}}function M$1(t,i,s=t,e){if(i===E)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=a(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(false),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s._$Co??=[])[e]=h:s._$Cl=h),void 0!==h&&(i=M$1(t,h._$AS(t,i.values),h,e)),i}class R{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??l).importNode(i,true);P.currentNode=e;let h=P.nextNode(),o=0,n=0,r=s[0];for(;void 0!==r;){if(o===r.index){let i;2===r.type?i=new k(h,h.nextSibling,this,t):1===r.type?i=new r.ctor(h,r.name,r.strings,this,t):6===r.type&&(i=new Z(h,this,t)),this._$AV.push(i),r=s[++n];}o!==r?.index&&(h=P.nextNode(),o++);}return P.currentNode=l,e}p(t){let i=0;for(const s of this._$AV) void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++;}}class k{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=A,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??true;}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=M$1(this,t,i),a(t)?t===A||null==t||""===t?(this._$AH!==A&&this._$AR(),this._$AH=A):t!==this._$AH&&t!==E&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):d(t)?this.k(t):this._(t);}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t));}_(t){this._$AH!==A&&a(this._$AH)?this._$AA.nextSibling.data=t:this.T(l.createTextNode(t)),this._$AH=t;}$(t){const{values:i,_$litType$:s}=t,e="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=S.createElement(V(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else {const t=new R(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t;}}_$AC(t){let i=C.get(t.strings);return void 0===i&&C.set(t.strings,i=new S(t)),i}k(t){u$2(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const h of t)e===i.length?i.push(s=new k(this.O(c$1()),this.O(c$1()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e);}_$AR(t=this._$AA.nextSibling,s){for(this._$AP?.(false,true,s);t!==this._$AB;){const s=i$3(t).nextSibling;i$3(t).remove(),t=s;}}setConnected(t){ void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t));}}class H{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=A,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=A;}_$AI(t,i=this,s,e){const h=this.strings;let o=false;if(void 0===h)t=M$1(this,t,i,0),o=!a(t)||t!==this._$AH&&t!==E,o&&(this._$AH=t);else {const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=M$1(this,e[s+n],i,n),r===E&&(r=this._$AH[n]),o||=!a(r)||r!==this._$AH[n],r===A?t=A:t!==A&&(t+=(r??"")+h[n+1]),this._$AH[n]=r;}o&&!e&&this.j(t);}j(t){t===A?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}}class I extends H{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===A?void 0:t;}}class L extends H{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==A);}}class z extends H{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5;}_$AI(t,i=this){if((t=M$1(this,t,i,0)??A)===E)return;const s=this._$AH,e=t===A&&s!==A||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==A&&(s===A||e);e&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t;}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t);}}class Z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s;}get _$AU(){return this._$AM._$AU}_$AI(t){M$1(this,t);}}const j={I:k},B=t$3.litHtmlPolyfillSupport;B?.(S,k),(t$3.litHtmlVersions??=[]).push("3.3.2");const D=(t,i,s)=>{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new k(i.insertBefore(c$1(),t),t,void 0,s??{});}return h._$AI(t),h};
22
+ const t$3=globalThis,i$4=t=>t,s$2=t$3.trustedTypes,e$5=s$2?s$2.createPolicy("lit-html",{createHTML:t=>t}):void 0,h$1="$lit$",o$4=`lit$${Math.random().toFixed(9).slice(2)}$`,n$2="?"+o$4,r$2=`<${n$2}>`,l=document,c$1=()=>l.createComment(""),a=t=>null===t||"object"!=typeof t&&"function"!=typeof t,u$2=Array.isArray,d=t=>u$2(t)||"function"==typeof t?.[Symbol.iterator],f="[ \t\n\f\r]",v$1=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_=/-->/g,m$1=/>/g,p$1=RegExp(`>|${f}(?:([^\\s"'>=/]+)(${f}*=${f}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),g=/'/g,$=/"/g,y=/^(?:script|style|textarea|title)$/i,x=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),b=x(1),E=Symbol.for("lit-noChange"),A=Symbol.for("lit-nothing"),C=new WeakMap,P=l.createTreeWalker(l,129);function V(t,i){if(!u$2(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==e$5?e$5.createHTML(i):i}const N=(t,i)=>{const s=t.length-1,e=[];let n,l=2===i?"<svg>":3===i?"<math>":"",c=v$1;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,f=0;for(;f<s.length&&(c.lastIndex=f,u=c.exec(s),null!==u);)f=c.lastIndex,c===v$1?"!--"===u[1]?c=_:void 0!==u[1]?c=m$1:void 0!==u[2]?(y.test(u[2])&&(n=RegExp("</"+u[2],"g")),c=p$1):void 0!==u[3]&&(c=p$1):c===p$1?">"===u[0]?(c=n??v$1,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?p$1:'"'===u[3]?$:g):c===$||c===g?c=p$1:c===_||c===m$1?c=v$1:(c=p$1,n=void 0);const x=c===p$1&&t[i+1].startsWith("/>")?" ":"";l+=c===v$1?s+r$2:d>=0?(e.push(a),s.slice(0,d)+h$1+s.slice(d)+o$4+x):s+o$4+(-2===d?i:x);}return [V(t,l+(t[s]||"<?>")+(2===i?"</svg>":3===i?"</math>":"")),e]};class S{constructor({strings:t,_$litType$:i},e){let r;this.parts=[];let l=0,a=0;const u=t.length-1,d=this.parts,[f,v]=N(t,i);if(this.el=S.createElement(f,e),P.currentNode=this.el.content,2===i||3===i){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes);}for(;null!==(r=P.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(h$1)){const i=v[a++],s=r.getAttribute(t).split(o$4),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:l,name:e[2],strings:s,ctor:"."===e[1]?I:"?"===e[1]?L:"@"===e[1]?z:H}),r.removeAttribute(t);}else t.startsWith(o$4)&&(d.push({type:6,index:l}),r.removeAttribute(t));if(y.test(r.tagName)){const t=r.textContent.split(o$4),i=t.length-1;if(i>0){r.textContent=s$2?s$2.emptyScript:"";for(let s=0;s<i;s++)r.append(t[s],c$1()),P.nextNode(),d.push({type:2,index:++l});r.append(t[i],c$1());}}}else if(8===r.nodeType)if(r.data===n$2)d.push({type:2,index:l});else {let t=-1;for(;-1!==(t=r.data.indexOf(o$4,t+1));)d.push({type:7,index:l}),t+=o$4.length-1;}l++;}}static createElement(t,i){const s=l.createElement("template");return s.innerHTML=t,s}}function M$1(t,i,s=t,e){if(i===E)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=a(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(false),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s._$Co??=[])[e]=h:s._$Cl=h),void 0!==h&&(i=M$1(t,h._$AS(t,i.values),h,e)),i}class R{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??l).importNode(i,true);P.currentNode=e;let h=P.nextNode(),o=0,n=0,r=s[0];for(;void 0!==r;){if(o===r.index){let i;2===r.type?i=new k(h,h.nextSibling,this,t):1===r.type?i=new r.ctor(h,r.name,r.strings,this,t):6===r.type&&(i=new Z(h,this,t)),this._$AV.push(i),r=s[++n];}o!==r?.index&&(h=P.nextNode(),o++);}return P.currentNode=l,e}p(t){let i=0;for(const s of this._$AV) void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++;}}class k{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=A,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??true;}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=M$1(this,t,i),a(t)?t===A||null==t||""===t?(this._$AH!==A&&this._$AR(),this._$AH=A):t!==this._$AH&&t!==E&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):d(t)?this.k(t):this._(t);}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t));}_(t){this._$AH!==A&&a(this._$AH)?this._$AA.nextSibling.data=t:this.T(l.createTextNode(t)),this._$AH=t;}$(t){const{values:i,_$litType$:s}=t,e="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=S.createElement(V(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else {const t=new R(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t;}}_$AC(t){let i=C.get(t.strings);return void 0===i&&C.set(t.strings,i=new S(t)),i}k(t){u$2(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const h of t)e===i.length?i.push(s=new k(this.O(c$1()),this.O(c$1()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e);}_$AR(t=this._$AA.nextSibling,s){for(this._$AP?.(false,true,s);t!==this._$AB;){const s=i$4(t).nextSibling;i$4(t).remove(),t=s;}}setConnected(t){ void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t));}}class H{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=A,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=A;}_$AI(t,i=this,s,e){const h=this.strings;let o=false;if(void 0===h)t=M$1(this,t,i,0),o=!a(t)||t!==this._$AH&&t!==E,o&&(this._$AH=t);else {const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=M$1(this,e[s+n],i,n),r===E&&(r=this._$AH[n]),o||=!a(r)||r!==this._$AH[n],r===A?t=A:t!==A&&(t+=(r??"")+h[n+1]),this._$AH[n]=r;}o&&!e&&this.j(t);}j(t){t===A?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}}class I extends H{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===A?void 0:t;}}class L extends H{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==A);}}class z extends H{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5;}_$AI(t,i=this){if((t=M$1(this,t,i,0)??A)===E)return;const s=this._$AH,e=t===A&&s!==A||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==A&&(s===A||e);e&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t;}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t);}}class Z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s;}get _$AU(){return this._$AM._$AU}_$AI(t){M$1(this,t);}}const j={I:k},B=t$3.litHtmlPolyfillSupport;B?.(S,k),(t$3.litHtmlVersions??=[]).push("3.3.2");const D=(t,i,s)=>{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new k(i.insertBefore(c$1(),t),t,void 0,s??{});}return h._$AI(t),h};
23
23
 
24
24
  /**
25
25
  * @license
26
26
  * Copyright 2017 Google LLC
27
27
  * SPDX-License-Identifier: BSD-3-Clause
28
- */const s$1=globalThis;let i$2 = class i extends y$1{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=D(r,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(true);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(false);}render(){return E}};i$2._$litElement$=true,i$2["finalized"]=true,s$1.litElementHydrateSupport?.({LitElement:i$2});const o$2=s$1.litElementPolyfillSupport;o$2?.({LitElement:i$2});(s$1.litElementVersions??=[]).push("4.2.2");
28
+ */const s$1=globalThis;let i$3 = class i extends y$1{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=D(r,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(true);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(false);}render(){return E}};i$3._$litElement$=true,i$3["finalized"]=true,s$1.litElementHydrateSupport?.({LitElement:i$3});const o$3=s$1.litElementPolyfillSupport;o$3?.({LitElement:i$3});(s$1.litElementVersions??=[]).push("4.2.2");
29
29
 
30
30
  /**
31
31
  * @license
@@ -38,13 +38,13 @@ const t$2=t=>(e,o)=>{ void 0!==o?o.addInitializer(()=>{customElements.define(t,e
38
38
  * @license
39
39
  * Copyright 2017 Google LLC
40
40
  * SPDX-License-Identifier: BSD-3-Clause
41
- */const o$1={attribute:true,type:String,converter:u$3,reflect:false,hasChanged:f$1},r$1=(t=o$1,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),"setter"===n&&((t=Object.create(t)).wrapped=true),s.set(r.name,t),"accessor"===n){const{name:o}=r;return {set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(o,n,t,true,r);},init(e){return void 0!==e&&this.C(o,void 0,t,e),e}}}if("setter"===n){const{name:o}=r;return function(r){const n=this[o];e.call(this,r),this.requestUpdate(o,n,t,true,r);}}throw Error("Unsupported decorator location: "+n)};function n(t){return (e,o)=>"object"==typeof o?r$1(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,t),r?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)}
41
+ */const o$2={attribute:true,type:String,converter:u$3,reflect:false,hasChanged:f$1},r$1=(t=o$2,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),"setter"===n&&((t=Object.create(t)).wrapped=true),s.set(r.name,t),"accessor"===n){const{name:o}=r;return {set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(o,n,t,true,r);},init(e){return void 0!==e&&this.C(o,void 0,t,e),e}}}if("setter"===n){const{name:o}=r;return function(r){const n=this[o];e.call(this,r),this.requestUpdate(o,n,t,true,r);}}throw Error("Unsupported decorator location: "+n)};function n$1(t){return (e,o)=>"object"==typeof o?r$1(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,t),r?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)}
42
42
 
43
43
  /**
44
44
  * @license
45
45
  * Copyright 2017 Google LLC
46
46
  * SPDX-License-Identifier: BSD-3-Clause
47
- */function r(r){return n({...r,state:true,attribute:false})}
47
+ */function r(r){return n$1({...r,state:true,attribute:false})}
48
48
 
49
49
  /**
50
50
  * @license
@@ -64,19 +64,19 @@ const e$4=(e,t,c)=>(c.configurable=true,c.enumerable=true,Reflect.decorate&&"obj
64
64
  * Copyright 2017 Google LLC
65
65
  * SPDX-License-Identifier: BSD-3-Clause
66
66
  */
67
- const t$1={ATTRIBUTE:1,CHILD:2},e$2=t=>(...e)=>({_$litDirective$:t,values:e});let i$1 = class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i;}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};
67
+ const t$1={ATTRIBUTE:1,CHILD:2},e$2=t=>(...e)=>({_$litDirective$:t,values:e});let i$2 = class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i;}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};
68
68
 
69
69
  /**
70
70
  * @license
71
71
  * Copyright 2017 Google LLC
72
72
  * SPDX-License-Identifier: BSD-3-Clause
73
- */let e$1 = class e extends i$1{constructor(i){if(super(i),this.it=A,i.type!==t$1.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(r){if(r===A||null==r)return this._t=void 0,this.it=r;if(r===E)return r;if("string"!=typeof r)throw Error(this.constructor.directiveName+"() called with a non-string value");if(r===this.it)return this._t;this.it=r;const s=[r];return s.raw=s,this._t={_$litType$:this.constructor.resultType,strings:s,values:[]}}};e$1.directiveName="unsafeHTML",e$1.resultType=1;const o=e$2(e$1);
73
+ */let e$1 = class e extends i$2{constructor(i){if(super(i),this.it=A,i.type!==t$1.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(r){if(r===A||null==r)return this._t=void 0,this.it=r;if(r===E)return r;if("string"!=typeof r)throw Error(this.constructor.directiveName+"() called with a non-string value");if(r===this.it)return this._t;this.it=r;const s=[r];return s.raw=s,this._t={_$litType$:this.constructor.resultType,strings:s,values:[]}}};e$1.directiveName="unsafeHTML",e$1.resultType=1;const o$1=e$2(e$1);
74
74
 
75
75
  /**
76
76
  * @license
77
77
  * Copyright 2018 Google LLC
78
78
  * SPDX-License-Identifier: BSD-3-Clause
79
- */const e=e$2(class extends i$1{constructor(t){if(super(t),t.type!==t$1.ATTRIBUTE||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return " "+Object.keys(t).filter(s=>t[s]).join(" ")+" "}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter(t=>""!==t)));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)));}return E}});
79
+ */const e=e$2(class extends i$2{constructor(t){if(super(t),t.type!==t$1.ATTRIBUTE||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return " "+Object.keys(t).filter(s=>t[s]).join(" ")+" "}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter(t=>""!==t)));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)));}return E}});
80
80
 
81
81
  var __decorate$6 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
82
82
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -84,7 +84,7 @@ var __decorate$6 = (undefined && undefined.__decorate) || function (decorators,
84
84
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
85
85
  return c > 3 && r && Object.defineProperty(target, key, r), r;
86
86
  };
87
- let KRNavItemEdit = class KRNavItemEdit extends i$2 {
87
+ let KRNavItemEdit = class KRNavItemEdit extends i$3 {
88
88
  constructor() {
89
89
  super(...arguments);
90
90
  this.label = '';
@@ -188,7 +188,7 @@ let KRNavItemEdit = class KRNavItemEdit extends i$2 {
188
188
  `;
189
189
  }
190
190
  };
191
- KRNavItemEdit.styles = i$5 `
191
+ KRNavItemEdit.styles = i$6 `
192
192
  :host {
193
193
  display: block;
194
194
  width: 360px;
@@ -349,7 +349,7 @@ var __decorate$5 = (undefined && undefined.__decorate) || function (decorators,
349
349
  * - Don't hardcode breadcrumbs
350
350
  * - Look at renderNormalFooter and renderEditFooter and see if that is what we want to do
351
351
  */
352
- let KRScaffold = class KRScaffold extends i$2 {
352
+ let KRScaffold = class KRScaffold extends i$3 {
353
353
  constructor() {
354
354
  super();
355
355
  /**
@@ -1369,7 +1369,7 @@ let KRScaffold = class KRScaffold extends i$2 {
1369
1369
  @click=${(e) => this.handleNavItemClick(e, item)}
1370
1370
  @contextmenu=${(e) => this.handleNavItemContextMenu(e, item)}
1371
1371
  >
1372
- ${this.navIconsDisplayed ? b `<span class="nav-item__icon">${o(item.icon || this.defaultNavItemIcon)}</span>` : A}
1372
+ ${this.navIconsDisplayed ? b `<span class="nav-item__icon">${o$1(item.icon || this.defaultNavItemIcon)}</span>` : A}
1373
1373
  <span class="nav-item__label">${item.label}</span>
1374
1374
  <svg
1375
1375
  class="nav-item__chevron"
@@ -1409,7 +1409,7 @@ let KRScaffold = class KRScaffold extends i$2 {
1409
1409
  @click=${(e) => this.handleNavItemClick(e, item)}
1410
1410
  @contextmenu=${(e) => this.handleNavItemContextMenu(e, item)}
1411
1411
  >
1412
- ${this.navIconsDisplayed && !isChild ? b `<span class="nav-item__icon">${o(item.icon || this.defaultNavItemIcon)}</span>` : A}
1412
+ ${this.navIconsDisplayed && !isChild ? b `<span class="nav-item__icon">${o$1(item.icon || this.defaultNavItemIcon)}</span>` : A}
1413
1413
  <span class="nav-item__label">${item.label}</span>
1414
1414
  </a>
1415
1415
  `;
@@ -1513,7 +1513,7 @@ let KRScaffold = class KRScaffold extends i$2 {
1513
1513
  `;
1514
1514
  }
1515
1515
  };
1516
- KRScaffold.styles = i$5 `
1516
+ KRScaffold.styles = i$6 `
1517
1517
  :host {
1518
1518
  display: flex;
1519
1519
  flex-direction: column;
@@ -2240,59 +2240,59 @@ KRScaffold.styles = i$5 `
2240
2240
  }
2241
2241
  `;
2242
2242
  __decorate$5([
2243
- n({ type: String })
2243
+ n$1({ type: String })
2244
2244
  ], KRScaffold.prototype, "logo", void 0);
2245
2245
  __decorate$5([
2246
- n({ type: String })
2246
+ n$1({ type: String })
2247
2247
  ], KRScaffold.prototype, "label", void 0);
2248
2248
  __decorate$5([
2249
- n({
2249
+ n$1({
2250
2250
  type: String,
2251
2251
  attribute: 'home-url'
2252
2252
  })
2253
2253
  ], KRScaffold.prototype, "homeUrl", void 0);
2254
2254
  __decorate$5([
2255
- n({
2255
+ n$1({
2256
2256
  type: String,
2257
2257
  reflect: true
2258
2258
  })
2259
2259
  ], KRScaffold.prototype, "scheme", void 0);
2260
2260
  __decorate$5([
2261
- n({ type: Array })
2261
+ n$1({ type: Array })
2262
2262
  ], KRScaffold.prototype, "nav", void 0);
2263
2263
  __decorate$5([
2264
- n({
2264
+ n$1({
2265
2265
  type: Boolean,
2266
2266
  attribute: 'nav-icons-displayed',
2267
2267
  reflect: true
2268
2268
  })
2269
2269
  ], KRScaffold.prototype, "navIconsDisplayed", void 0);
2270
2270
  __decorate$5([
2271
- n({
2271
+ n$1({
2272
2272
  type: Boolean,
2273
2273
  attribute: 'nav-expanded'
2274
2274
  })
2275
2275
  ], KRScaffold.prototype, "navExpanded", void 0);
2276
2276
  __decorate$5([
2277
- n({ type: Object })
2277
+ n$1({ type: Object })
2278
2278
  ], KRScaffold.prototype, "user", void 0);
2279
2279
  __decorate$5([
2280
- n({ type: Boolean })
2280
+ n$1({ type: Boolean })
2281
2281
  ], KRScaffold.prototype, "subbar", void 0);
2282
2282
  __decorate$5([
2283
- n({
2283
+ n$1({
2284
2284
  type: Boolean,
2285
2285
  attribute: 'nav-enabled'
2286
2286
  })
2287
2287
  ], KRScaffold.prototype, "navEnabled", void 0);
2288
2288
  __decorate$5([
2289
- n({
2289
+ n$1({
2290
2290
  type: String,
2291
2291
  attribute: 'user-type'
2292
2292
  })
2293
2293
  ], KRScaffold.prototype, "userType", void 0);
2294
2294
  __decorate$5([
2295
- n({ type: Array })
2295
+ n$1({ type: Array })
2296
2296
  ], KRScaffold.prototype, "breadcrumbs", void 0);
2297
2297
  __decorate$5([
2298
2298
  r()
@@ -2368,7 +2368,7 @@ var __decorate$4 = (undefined && undefined.__decorate) || function (decorators,
2368
2368
  * @property {KRScreenNavItem[]} items - Navigation items as JSON array
2369
2369
  * @property {string} activeId - Currently active item ID
2370
2370
  */
2371
- let KRScreenNav = class KRScreenNav extends i$2 {
2371
+ let KRScreenNav = class KRScreenNav extends i$3 {
2372
2372
  constructor() {
2373
2373
  super(...arguments);
2374
2374
  /**
@@ -2484,7 +2484,7 @@ let KRScreenNav = class KRScreenNav extends i$2 {
2484
2484
  `;
2485
2485
  }
2486
2486
  };
2487
- KRScreenNav.styles = i$5 `
2487
+ KRScreenNav.styles = i$6 `
2488
2488
  :host {
2489
2489
  display: flex;
2490
2490
  height: 100%;
@@ -2577,16 +2577,16 @@ KRScreenNav.styles = i$5 `
2577
2577
  }
2578
2578
  `;
2579
2579
  __decorate$4([
2580
- n({ type: String })
2580
+ n$1({ type: String })
2581
2581
  ], KRScreenNav.prototype, "label", void 0);
2582
2582
  __decorate$4([
2583
- n({ type: String })
2583
+ n$1({ type: String })
2584
2584
  ], KRScreenNav.prototype, "subLabel", void 0);
2585
2585
  __decorate$4([
2586
- n({ type: Array })
2586
+ n$1({ type: Array })
2587
2587
  ], KRScreenNav.prototype, "items", void 0);
2588
2588
  __decorate$4([
2589
- n({ type: String })
2589
+ n$1({ type: String })
2590
2590
  ], KRScreenNav.prototype, "activeId", void 0);
2591
2591
  KRScreenNav = __decorate$4([
2592
2592
  t$2('kr-screen-nav')
@@ -2617,7 +2617,7 @@ var __decorate$3 = (undefined && undefined.__decorate) || function (decorators,
2617
2617
  *
2618
2618
  * @property {string} title - Section title (e.g., "Company Details")
2619
2619
  */
2620
- let KRScreenDetail = class KRScreenDetail extends i$2 {
2620
+ let KRScreenDetail = class KRScreenDetail extends i$3 {
2621
2621
  constructor() {
2622
2622
  super(...arguments);
2623
2623
  /**
@@ -2641,7 +2641,7 @@ let KRScreenDetail = class KRScreenDetail extends i$2 {
2641
2641
  `;
2642
2642
  }
2643
2643
  };
2644
- KRScreenDetail.styles = i$5 `
2644
+ KRScreenDetail.styles = i$6 `
2645
2645
  :host {
2646
2646
  display: flex;
2647
2647
  flex-direction: column;
@@ -2687,7 +2687,7 @@ KRScreenDetail.styles = i$5 `
2687
2687
  }
2688
2688
  `;
2689
2689
  __decorate$3([
2690
- n({ type: String })
2690
+ n$1({ type: String })
2691
2691
  ], KRScreenDetail.prototype, "title", void 0);
2692
2692
  KRScreenDetail = __decorate$3([
2693
2693
  t$2('kr-screen-detail')
@@ -2704,7 +2704,7 @@ var __decorate$2 = (undefined && undefined.__decorate) || function (decorators,
2704
2704
  *
2705
2705
  * @slot - Content to display in the subbar (right side)
2706
2706
  */
2707
- let KRSubbar = class KRSubbar extends i$2 {
2707
+ let KRSubbar = class KRSubbar extends i$3 {
2708
2708
  constructor() {
2709
2709
  super(...arguments);
2710
2710
  /**
@@ -2832,7 +2832,7 @@ let KRSubbar = class KRSubbar extends i$2 {
2832
2832
  `;
2833
2833
  }
2834
2834
  };
2835
- KRSubbar.styles = i$5 `
2835
+ KRSubbar.styles = i$6 `
2836
2836
  :host {
2837
2837
  display: flex;
2838
2838
  flex-direction: row;
@@ -2900,10 +2900,10 @@ KRSubbar.styles = i$5 `
2900
2900
  }
2901
2901
  `;
2902
2902
  __decorate$2([
2903
- n({ type: Array })
2903
+ n$1({ type: Array })
2904
2904
  ], KRSubbar.prototype, "breadcrumbs", void 0);
2905
2905
  __decorate$2([
2906
- n({ type: Boolean })
2906
+ n$1({ type: Boolean })
2907
2907
  ], KRSubbar.prototype, "menu", void 0);
2908
2908
  KRSubbar = __decorate$2([
2909
2909
  t$2('kr-subbar')
@@ -3045,7 +3045,7 @@ class KRRouter {
3045
3045
  KRRouter.base = '';
3046
3046
  KRRouter.routes = [];
3047
3047
  KRRouter.elementCache = new Map();
3048
- let KRRouterOutlet = class KRRouterOutlet extends i$2 {
3048
+ let KRRouterOutlet = class KRRouterOutlet extends i$3 {
3049
3049
  constructor() {
3050
3050
  super(...arguments);
3051
3051
  this.level = -1;
@@ -3090,7 +3090,7 @@ let KRRouterOutlet = class KRRouterOutlet extends i$2 {
3090
3090
  return b `${el}`;
3091
3091
  }
3092
3092
  };
3093
- KRRouterOutlet.styles = i$5 `
3093
+ KRRouterOutlet.styles = i$6 `
3094
3094
  :host {
3095
3095
  display: block;
3096
3096
  height: 100%;
@@ -3100,6 +3100,12 @@ KRRouterOutlet = __decorate$1([
3100
3100
  t$2('kr-router-outlet')
3101
3101
  ], KRRouterOutlet);
3102
3102
 
3103
+ /**
3104
+ * @license
3105
+ * Copyright 2018 Google LLC
3106
+ * SPDX-License-Identifier: BSD-3-Clause
3107
+ */const n="important",i$1=" !"+n,o=e$2(class extends i$2{constructor(t){if(super(t),t.type!==t$1.ATTRIBUTE||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce((e,r)=>{const s=t[r];return null==s?e:e+`${r=r.includes("-")?r:r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`},"")}update(e,[r]){const{style:s}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(r)),this.render(r);for(const t of this.ft)null==r[t]&&(this.ft.delete(t),t.includes("-")?s.removeProperty(t):s[t]=null);for(const t in r){const e=r[t];if(null!=e){this.ft.add(t);const r="string"==typeof e&&e.endsWith(i$1);t.includes("-")||r?s.setProperty(t,r?e.slice(0,-11):e,r?n:""):s[t]=e;}}return E}});
3108
+
3103
3109
  /**
3104
3110
  * @license
3105
3111
  * Copyright 2020 Google LLC
@@ -3111,7 +3117,7 @@ KRRouterOutlet = __decorate$1([
3111
3117
  * Copyright 2017 Google LLC
3112
3118
  * SPDX-License-Identifier: BSD-3-Clause
3113
3119
  */
3114
- const u=(e,s,t)=>{const r=new Map;for(let l=s;l<=t;l++)r.set(e[l],l);return r},c=e$2(class extends i$1{constructor(e){if(super(e),e.type!==t$1.CHILD)throw Error("repeat() can only be used in text expressions")}dt(e,s,t){let r;void 0===t?t=s:void 0!==s&&(r=s);const l=[],o=[];let i=0;for(const s of e)l[i]=r?r(s,i):i,o[i]=t(s,i),i++;return {values:o,keys:l}}render(e,s,t){return this.dt(e,s,t).values}update(s,[t,r,c]){const d=M(s),{values:p$1,keys:a}=this.dt(t,r,c);if(!Array.isArray(d))return this.ut=a,p$1;const h$1=this.ut??=[],v$1=[];let m,y,x=0,j=d.length-1,k=0,w=p$1.length-1;for(;x<=j&&k<=w;)if(null===d[x])x++;else if(null===d[j])j--;else if(h$1[x]===a[k])v$1[k]=u$1(d[x],p$1[k]),x++,k++;else if(h$1[j]===a[w])v$1[w]=u$1(d[j],p$1[w]),j--,w--;else if(h$1[x]===a[w])v$1[w]=u$1(d[x],p$1[w]),v(s,v$1[w+1],d[x]),x++,w--;else if(h$1[j]===a[k])v$1[k]=u$1(d[j],p$1[k]),v(s,d[x],d[j]),j--,k++;else if(void 0===m&&(m=u(a,k,w),y=u(h$1,x,j)),m.has(h$1[x]))if(m.has(h$1[j])){const e=y.get(a[k]),t=void 0!==e?d[e]:null;if(null===t){const e=v(s,d[x]);u$1(e,p$1[k]),v$1[k]=e;}else v$1[k]=u$1(t,p$1[k]),v(s,d[x],t),d[e]=null;k++;}else h(d[j]),j--;else h(d[x]),x++;for(;k<=w;){const e=v(s,v$1[w+1]);u$1(e,p$1[k]),v$1[k++]=e;}for(;x<=j;){const e=d[x++];null!==e&&h(e);}return this.ut=a,p(s,v$1),E}});
3120
+ const u=(e,s,t)=>{const r=new Map;for(let l=s;l<=t;l++)r.set(e[l],l);return r},c=e$2(class extends i$2{constructor(e){if(super(e),e.type!==t$1.CHILD)throw Error("repeat() can only be used in text expressions")}dt(e,s,t){let r;void 0===t?t=s:void 0!==s&&(r=s);const l=[],o=[];let i=0;for(const s of e)l[i]=r?r(s,i):i,o[i]=t(s,i),i++;return {values:o,keys:l}}render(e,s,t){return this.dt(e,s,t).values}update(s,[t,r,c]){const d=M(s),{values:p$1,keys:a}=this.dt(t,r,c);if(!Array.isArray(d))return this.ut=a,p$1;const h$1=this.ut??=[],v$1=[];let m,y,x=0,j=d.length-1,k=0,w=p$1.length-1;for(;x<=j&&k<=w;)if(null===d[x])x++;else if(null===d[j])j--;else if(h$1[x]===a[k])v$1[k]=u$1(d[x],p$1[k]),x++,k++;else if(h$1[j]===a[w])v$1[w]=u$1(d[j],p$1[w]),j--,w--;else if(h$1[x]===a[w])v$1[w]=u$1(d[x],p$1[w]),v(s,v$1[w+1],d[x]),x++,w--;else if(h$1[j]===a[k])v$1[k]=u$1(d[j],p$1[k]),v(s,d[x],d[j]),j--,k++;else if(void 0===m&&(m=u(a,k,w),y=u(h$1,x,j)),m.has(h$1[x]))if(m.has(h$1[j])){const e=y.get(a[k]),t=void 0!==e?d[e]:null;if(null===t){const e=v(s,d[x]);u$1(e,p$1[k]),v$1[k]=e;}else v$1[k]=u$1(t,p$1[k]),v(s,d[x],t),d[e]=null;k++;}else h(d[j]),j--;else h(d[x]),x++;for(;k<=w;){const e=v(s,v$1[w+1]);u$1(e,p$1[k]),v$1[k++]=e;}for(;x<=j;){const e=d[x++];null!==e&&h(e);}return this.ut=a,p(s,v$1),E}});
3115
3121
 
3116
3122
  /**
3117
3123
  * marked v12.0.2 - a markdown parser
@@ -5584,7 +5590,7 @@ const ACCEPTED_IMAGE_TYPES = ['image/jpeg', 'image/png', 'image/gif', 'image/web
5584
5590
  * @fires message-submit - When the user sends a message. Cancelable. Detail: `{ message: string }`
5585
5591
  * @fires stream-event - Dispatched for every SSE message received. Detail contains the parsed event data.
5586
5592
  */
5587
- let KRChatbot = class KRChatbot extends i$2 {
5593
+ let KRChatbot = class KRChatbot extends i$3 {
5588
5594
  constructor() {
5589
5595
  super(...arguments);
5590
5596
  // --- Private properties ---
@@ -5602,6 +5608,10 @@ let KRChatbot = class KRChatbot extends i$2 {
5602
5608
  this._dragStartTop = 0;
5603
5609
  this._resizeStartW = 0;
5604
5610
  this._resizeStartH = 0;
5611
+ /** Cursor X at debug-drawer resize start. */
5612
+ this._debugResizeStartX = 0;
5613
+ /** Debug-drawer width at resize start. */
5614
+ this._debugResizeStartW = 0;
5605
5615
  /** Counter for depth-aware dragenter/dragleave tracking. */
5606
5616
  this._dragDepth = 0;
5607
5617
  /** Monotonic id source for pending attachments. */
@@ -5674,6 +5684,39 @@ let KRChatbot = class KRChatbot extends i$2 {
5674
5684
  this._inputValue = '';
5675
5685
  this._isStreaming = false;
5676
5686
  this._error = '';
5687
+ /**
5688
+ * User-facing context warning text (`CONVERSATION_TOKEN_WARNING`). Shown as a
5689
+ * dismissible banner in all variants. Carries only friendly guidance, no numbers.
5690
+ */
5691
+ this._contextWarning = '';
5692
+ /**
5693
+ * True once the conversation hit the context-window limit
5694
+ * (`CONVERSATION_LIMIT_REACHED`, or `contextExceeded` on load). Drives a
5695
+ * blocking "start a new conversation" notice. User-facing, all variants.
5696
+ */
5697
+ this._contextLimitReached = false;
5698
+ /** Server-provided limit text (`CONVERSATION_LIMIT_REACHED`), if any. */
5699
+ this._contextLimitMessage = '';
5700
+ /**
5701
+ * INTERNAL-ONLY latest telemetry snapshot (last-value-wins). Populated from
5702
+ * `TOKEN_USAGE` events during streaming and hydrated from the conversation
5703
+ * DTO on load. Only surfaced in the `inline` variant's debug panel.
5704
+ */
5705
+ this._telemetry = null;
5706
+ /**
5707
+ * INTERNAL-ONLY per-iteration telemetry log for the debug panel's verbose
5708
+ * table. Append-only within a turn; reset at the start of each send. Each row
5709
+ * may be augmented with its `CACHE_CHECKPOINT` info.
5710
+ */
5711
+ this._iterationLog = [];
5712
+ /** Latest cache-checkpoint info keyed by iteration, for the verbose table. */
5713
+ this._cacheCheckpoints = {};
5714
+ /** Whether the internal debug panel is expanded (off by default). */
5715
+ this._debugPanelOpen = false;
5716
+ /** Current width of the debug drawer in px (user-resizable, persisted). */
5717
+ this._debugDrawerWidth = 430;
5718
+ /** True while the user is dragging the debug drawer's resize handle. */
5719
+ this._isDebugResizing = false;
5677
5720
  /** Images staged in the composer, before the message is sent. */
5678
5721
  this._pendingInternalFiles = [];
5679
5722
  /** True while a file is being dragged over the panel (shows the drop overlay). */
@@ -5757,6 +5800,25 @@ let KRChatbot = class KRChatbot extends i$2 {
5757
5800
  document.removeEventListener('mouseup', this._handleMouseUp);
5758
5801
  this._saveState();
5759
5802
  };
5803
+ this._handleDebugResizeMouseMove = (e) => {
5804
+ if (!this._isDebugResizing) {
5805
+ return;
5806
+ }
5807
+ // Handle is on the drawer's left edge; dragging left (negative dx) widens it.
5808
+ const dx = e.clientX - this._debugResizeStartX;
5809
+ const minW = 300;
5810
+ // Never let the chat column shrink below 300px — cap the drawer at the
5811
+ // container width minus that reserved chat width.
5812
+ const minChatWidth = 300;
5813
+ const maxW = Math.max(minW, this.offsetWidth - minChatWidth);
5814
+ this._debugDrawerWidth = Math.max(minW, Math.min(this._debugResizeStartW - dx, maxW));
5815
+ };
5816
+ this._handleDebugResizeMouseUp = () => {
5817
+ this._isDebugResizing = false;
5818
+ document.removeEventListener('mousemove', this._handleDebugResizeMouseMove);
5819
+ document.removeEventListener('mouseup', this._handleDebugResizeMouseUp);
5820
+ this._saveState();
5821
+ };
5760
5822
  }
5761
5823
  // --- Lifecycle ---
5762
5824
  connectedCallback() {
@@ -5778,10 +5840,10 @@ let KRChatbot = class KRChatbot extends i$2 {
5778
5840
  }
5779
5841
  }).catch(() => { });
5780
5842
  // Inline mode fills its container and is always open — the floating widget's
5781
- // toggle/drag/resize state (including any persisted layout) doesn't apply.
5843
+ // toggle/drag/resize state doesn't apply, but the composer message and debug
5844
+ // drawer state (restored inside _restoreState) do.
5782
5845
  if (this.variant === 'inline') {
5783
5846
  this.opened = true;
5784
- return;
5785
5847
  }
5786
5848
  this._restoreState();
5787
5849
  }
@@ -5971,7 +6033,12 @@ let KRChatbot = class KRChatbot extends i$2 {
5971
6033
  }
5972
6034
  _saveState() {
5973
6035
  try {
5974
- const state = { opened: String(this.opened) };
6036
+ const state = {
6037
+ opened: String(this.opened),
6038
+ message: this._inputValue,
6039
+ debugPanelOpen: String(this._debugPanelOpen),
6040
+ debugDrawerWidth: String(this._debugDrawerWidth),
6041
+ };
5975
6042
  if (this._panelEl) {
5976
6043
  const s = this._panelEl.style;
5977
6044
  if (s.left) {
@@ -6001,7 +6068,17 @@ let KRChatbot = class KRChatbot extends i$2 {
6001
6068
  return;
6002
6069
  }
6003
6070
  const state = JSON.parse(raw);
6004
- if (state.opened === 'true') {
6071
+ // Draft text and the debug drawer are persisted for all variants.
6072
+ if (typeof state.message === 'string') {
6073
+ this._inputValue = state.message;
6074
+ }
6075
+ this._debugPanelOpen = state.debugPanelOpen === 'true';
6076
+ const w = Number(state.debugDrawerWidth);
6077
+ if (w >= 300) {
6078
+ this._debugDrawerWidth = w;
6079
+ }
6080
+ // The floating widget's open/layout state doesn't apply to inline mode.
6081
+ if (this.variant !== 'inline' && state.opened === 'true') {
6005
6082
  this.opened = true;
6006
6083
  // Apply layout after first render
6007
6084
  this.updateComplete.then(() => this._applyStoredLayout());
@@ -6036,6 +6113,7 @@ let KRChatbot = class KRChatbot extends i$2 {
6036
6113
  }
6037
6114
  _handleInputChange(e) {
6038
6115
  this._inputValue = e.target.value;
6116
+ this._saveState();
6039
6117
  // Auto-resize textarea
6040
6118
  const textarea = e.target;
6041
6119
  textarea.style.height = 'auto';
@@ -6118,15 +6196,26 @@ let KRChatbot = class KRChatbot extends i$2 {
6118
6196
  this._skillRequestId++;
6119
6197
  const requestId = this._skillRequestId;
6120
6198
  const trimmed = query.trim();
6121
- // multi_match with an empty string matches nothing, so an empty query falls
6122
- // back to match_all to show everything.
6199
+ // An empty query matches everything; otherwise substring-match the query
6200
+ // against name/code/description. We use case-insensitive wildcard queries on
6201
+ // the `.raw` keyword subfields so "ord" matches anywhere in "Create Order"
6202
+ // (a plain match/multi_match only matches whole tokens). Escape the wildcard
6203
+ // specials so user input is treated literally, then wrap with `*...*`.
6123
6204
  let must = { match_all: {} };
6124
6205
  if (trimmed) {
6206
+ const pattern = `*${trimmed.replace(/([*?\\])/g, '\\$1')}*`;
6207
+ const value = {
6208
+ value: pattern,
6209
+ case_insensitive: true,
6210
+ };
6125
6211
  must = {
6126
- multi_match: {
6127
- query: trimmed,
6128
- fields: ['name^3', 'description^2', 'instructions'],
6129
- type: 'best_fields',
6212
+ bool: {
6213
+ should: [
6214
+ { wildcard: { 'name.raw': value } },
6215
+ { wildcard: { 'code.raw': value } },
6216
+ { wildcard: { 'description.raw': value } },
6217
+ ],
6218
+ minimum_should_match: 1,
6130
6219
  },
6131
6220
  };
6132
6221
  }
@@ -6169,6 +6258,7 @@ let KRChatbot = class KRChatbot extends i$2 {
6169
6258
  /** Insert `/code ` into the composer and focus it, ready for the message. */
6170
6259
  _handleSkillSelect(skill) {
6171
6260
  this._inputValue = `/${skill.code} `;
6261
+ this._saveState();
6172
6262
  this._skillMenuOpened = false;
6173
6263
  this._skillBrowseOpened = false;
6174
6264
  this._inputEl?.focus();
@@ -6341,6 +6431,7 @@ let KRChatbot = class KRChatbot extends i$2 {
6341
6431
  };
6342
6432
  this.messages = [...this.messages, userMessage];
6343
6433
  this._inputValue = '';
6434
+ this._saveState();
6344
6435
  this._error = '';
6345
6436
  this._userHasScrolledUp = false;
6346
6437
  // Clear the composer and release its preview object URLs.
@@ -6450,6 +6541,14 @@ let KRChatbot = class KRChatbot extends i$2 {
6450
6541
  this._error = '';
6451
6542
  this._inputValue = '';
6452
6543
  this._userHasScrolledUp = false;
6544
+ // Reset conversation-scoped context + telemetry state for the new convo.
6545
+ this._contextWarning = '';
6546
+ this._contextLimitReached = false;
6547
+ this._contextLimitMessage = '';
6548
+ this._telemetry = null;
6549
+ this._iterationLog = [];
6550
+ this._cacheCheckpoints = {};
6551
+ this._saveState();
6453
6552
  });
6454
6553
  }
6455
6554
  _handleMessagesScroll(e) {
@@ -6465,6 +6564,22 @@ let KRChatbot = class KRChatbot extends i$2 {
6465
6564
  _handleErrorDismiss() {
6466
6565
  this._error = '';
6467
6566
  }
6567
+ _handleContextWarningDismiss() {
6568
+ this._contextWarning = '';
6569
+ }
6570
+ _handleToggleDebugPanel() {
6571
+ this._debugPanelOpen = !this._debugPanelOpen;
6572
+ this._saveState();
6573
+ }
6574
+ _handleDebugResizeMouseDown(e) {
6575
+ this._isDebugResizing = true;
6576
+ this._debugResizeStartX = e.clientX;
6577
+ this._debugResizeStartW = this._debugDrawerWidth;
6578
+ e.preventDefault();
6579
+ e.stopPropagation();
6580
+ document.addEventListener('mousemove', this._handleDebugResizeMouseMove);
6581
+ document.addEventListener('mouseup', this._handleDebugResizeMouseUp);
6582
+ }
6468
6583
  _readStreamChunk() {
6469
6584
  if (!this._reader) {
6470
6585
  return;
@@ -6528,6 +6643,47 @@ let KRChatbot = class KRChatbot extends i$2 {
6528
6643
  else if (data.type === 'ERROR') {
6529
6644
  this._handleStreamError(String(data.message || 'Unknown error'));
6530
6645
  }
6646
+ else if (data.type === 'CONVERSATION_TOKEN_WARNING') {
6647
+ // User-facing: friendly "conversation is getting long" guidance.
6648
+ // Text only, never sent to the model — render verbatim as a banner.
6649
+ this._contextWarning = String(data.message || '');
6650
+ }
6651
+ else if (data.type === 'CONVERSATION_LIMIT_REACHED') {
6652
+ // User-facing hard stop. Carries finished:true (handled below).
6653
+ // Clear any soft warning so we don't double-message the user.
6654
+ this._contextLimitReached = true;
6655
+ this._contextLimitMessage = String(data.message || '');
6656
+ this._contextWarning = '';
6657
+ }
6658
+ else if (data.type === 'TOKEN_USAGE') {
6659
+ // INTERNAL-ONLY debug telemetry. Update the panel snapshot and the
6660
+ // per-iteration log; never render as a chat bubble.
6661
+ if (data.data) {
6662
+ const usage = data.data;
6663
+ this._telemetry = usage;
6664
+ // A new turn starts at iteration 1 — clear the prior turn's log
6665
+ // only now (not at send), so it stays visible until fresh data
6666
+ // actually arrives rather than blanking out on submit.
6667
+ if (usage.iteration === 1) {
6668
+ this._iterationLog = [usage];
6669
+ this._cacheCheckpoints = {};
6670
+ }
6671
+ else {
6672
+ this._iterationLog = [...this._iterationLog, usage];
6673
+ }
6674
+ }
6675
+ }
6676
+ else if (data.type === 'CACHE_CHECKPOINT') {
6677
+ // INTERNAL-ONLY debug telemetry. Records when/under which mode the
6678
+ // history checkpoint was placed, keyed by iteration for the table.
6679
+ if (data.data) {
6680
+ const checkpoint = data.data;
6681
+ this._cacheCheckpoints = {
6682
+ ...this._cacheCheckpoints,
6683
+ [checkpoint.iteration]: checkpoint,
6684
+ };
6685
+ }
6686
+ }
6531
6687
  if (data.finished) {
6532
6688
  this._isStreaming = false;
6533
6689
  this._reader = null;
@@ -6671,6 +6827,158 @@ let KRChatbot = class KRChatbot extends i$2 {
6671
6827
  }
6672
6828
  return content;
6673
6829
  }
6830
+ /** Compact integer formatting for the debug panel (e.g. 88928 → "88,928"). */
6831
+ _fmtTokens(n) {
6832
+ if (n == null || isNaN(n)) {
6833
+ return '—';
6834
+ }
6835
+ return n.toLocaleString('en-US');
6836
+ }
6837
+ /** Approximate USD formatting for the debug panel (e.g. 0.1434 → "~$0.1434"). */
6838
+ _fmtCost(n) {
6839
+ if (n == null || isNaN(n)) {
6840
+ return '—';
6841
+ }
6842
+ return '~$' + n.toFixed(4);
6843
+ }
6844
+ /**
6845
+ * INTERNAL-ONLY debug telemetry panel. Rendered only in the inline variant
6846
+ * (guarded by the caller) and only when the user has toggled it open. Shows
6847
+ * three scopes from the latest TOKEN_USAGE event — context gauge, this turn,
6848
+ * lifetime — plus a verbose per-iteration table. Never customer-facing.
6849
+ */
6850
+ _renderDebugPanel() {
6851
+ return b `
6852
+ <div
6853
+ class=${e({
6854
+ 'debug-drawer': true,
6855
+ 'debug-drawer--open': this._debugPanelOpen,
6856
+ 'debug-drawer--resizing': this._isDebugResizing,
6857
+ })}
6858
+ style=${o({ width: `${this._debugDrawerWidth}px` })}
6859
+ >
6860
+ <div
6861
+ class="debug-drawer__resize"
6862
+ @mousedown=${this._handleDebugResizeMouseDown}
6863
+ ></div>
6864
+ <div class="debug-drawer__header">
6865
+ <span class="debug-drawer__title">Debug</span>
6866
+ <button
6867
+ class="header-action"
6868
+ @click=${this._handleToggleDebugPanel}
6869
+ title="Close debug panel"
6870
+ >
6871
+ <svg
6872
+ xmlns="http://www.w3.org/2000/svg"
6873
+ fill="none"
6874
+ viewBox="0 0 24 24"
6875
+ stroke-width="2"
6876
+ stroke="currentColor"
6877
+ class="header-action-icon"
6878
+ >
6879
+ <path
6880
+ stroke-linecap="round"
6881
+ stroke-linejoin="round"
6882
+ d="M6 18 18 6M6 6l12 12"
6883
+ />
6884
+ </svg>
6885
+ </button>
6886
+ </div>
6887
+ <div class="debug-drawer__body">
6888
+ ${this._telemetry ? b `
6889
+ <div class="debug-section">
6890
+ <div class="debug-section__label">Context</div>
6891
+ <div class="debug-gauge">
6892
+ <div class="debug-gauge__bar">
6893
+ <div
6894
+ class="debug-gauge__fill"
6895
+ style=${o({ width: `${Math.min(100, Math.max(0, this._telemetry.contextUsedPercent || 0))}%` })}
6896
+ ></div>
6897
+ </div>
6898
+ <span class="debug-gauge__text">
6899
+ ${this._fmtTokens(this._telemetry.currentContextTokens)} / ${this._fmtTokens(this._telemetry.contextWindowTokens)}
6900
+ · ${this._telemetry.contextUsedPercent ?? 0}%
6901
+ </span>
6902
+ </div>
6903
+ </div>
6904
+
6905
+ <div class="debug-section">
6906
+ <div class="debug-section__label">This turn</div>
6907
+ <div class="debug-metrics">
6908
+ <span class="debug-metrics__key">Input</span>
6909
+ <span class="debug-metrics__val">${this._fmtTokens(this._telemetry.turnInputTokens)}</span>
6910
+ <span class="debug-metrics__key">Output</span>
6911
+ <span class="debug-metrics__val">${this._fmtTokens(this._telemetry.turnOutputTokens)}</span>
6912
+ <span class="debug-metrics__key">Cache read</span>
6913
+ <span class="debug-metrics__val">${this._fmtTokens(this._telemetry.turnCacheReadTokens)}</span>
6914
+ <span class="debug-metrics__key">Hit rate</span>
6915
+ <span class="debug-metrics__val">${this._telemetry.turnHitRate ?? '—'}%</span>
6916
+ <span class="debug-metrics__key">Cost</span>
6917
+ <span class="debug-metrics__val debug-cost">${this._fmtCost(this._telemetry.turnCostUsd)}</span>
6918
+ </div>
6919
+ </div>
6920
+
6921
+ <div class="debug-section">
6922
+ <div class="debug-section__label">Lifetime</div>
6923
+ <div class="debug-metrics">
6924
+ <span class="debug-metrics__key">Input</span>
6925
+ <span class="debug-metrics__val">${this._fmtTokens(this._telemetry.conversationInputTokens)}</span>
6926
+ <span class="debug-metrics__key">Output</span>
6927
+ <span class="debug-metrics__val">${this._fmtTokens(this._telemetry.conversationOutputTokens)}</span>
6928
+ <span class="debug-metrics__key">Cache read</span>
6929
+ <span class="debug-metrics__val">${this._fmtTokens(this._telemetry.conversationCacheReadTokens)}</span>
6930
+ <span class="debug-metrics__key">Cache write</span>
6931
+ <span class="debug-metrics__val">${this._fmtTokens(this._telemetry.conversationCacheWriteTokens)}</span>
6932
+ <span class="debug-metrics__key">Cost so far</span>
6933
+ <span class="debug-metrics__val debug-cost">${this._fmtCost(this._telemetry.conversationCostUsd)}</span>
6934
+ </div>
6935
+ </div>
6936
+ ` : b `
6937
+ <div class="debug-empty">No telemetry yet — send a message to populate.</div>
6938
+ `}
6939
+
6940
+ ${this._iterationLog.length ? b `
6941
+ <div class="debug-section">
6942
+ <div class="debug-section__label">Iterations (this turn)</div>
6943
+ <div class="debug-iterations-scroll">
6944
+ <table class="debug-iterations">
6945
+ <thead>
6946
+ <tr>
6947
+ <th>#</th>
6948
+ <th>In</th>
6949
+ <th>Out</th>
6950
+ <th>Cache R</th>
6951
+ <th>Cache W</th>
6952
+ <th>Hit</th>
6953
+ <th>Cost</th>
6954
+ <th>Ckpt</th>
6955
+ </tr>
6956
+ </thead>
6957
+ <tbody>
6958
+ ${this._iterationLog.map((it) => {
6959
+ const ckpt = this._cacheCheckpoints[it.iteration];
6960
+ return b `
6961
+ <tr>
6962
+ <td>${it.iteration}</td>
6963
+ <td>${this._fmtTokens(it.iterationInput)}</td>
6964
+ <td>${this._fmtTokens(it.iterationOutput)}</td>
6965
+ <td>${this._fmtTokens(it.iterationCacheRead)}</td>
6966
+ <td>${this._fmtTokens(it.iterationCacheWrite)}</td>
6967
+ <td>${it.iterationHitRate ?? '—'}%</td>
6968
+ <td class="debug-cost">${this._fmtCost(it.iterationCostUsd)}</td>
6969
+ <td>${ckpt ? ckpt.mode : '—'}</td>
6970
+ </tr>
6971
+ `;
6972
+ })}
6973
+ </tbody>
6974
+ </table>
6975
+ </div>
6976
+ </div>
6977
+ ` : A}
6978
+ </div>
6979
+ </div>
6980
+ `;
6981
+ }
6674
6982
  render() {
6675
6983
  return b `
6676
6984
  ${(this.hideToggle || this.variant === 'inline') ? A : b `
@@ -6700,7 +7008,9 @@ let KRChatbot = class KRChatbot extends i$2 {
6700
7008
  class=${e({
6701
7009
  'panel': true,
6702
7010
  'panel--opened': this.opened,
7011
+ 'panel--resizing-debug': this._isDebugResizing,
6703
7012
  })}
7013
+ style=${o(this.variant === 'inline' && this._debugPanelOpen ? { paddingRight: `${this._debugDrawerWidth}px` } : {})}
6704
7014
  @dragenter=${this._handleDragEnter}
6705
7015
  @dragover=${this._handleDragOver}
6706
7016
  @dragleave=${this._handleDragLeave}
@@ -6773,6 +7083,31 @@ let KRChatbot = class KRChatbot extends i$2 {
6773
7083
  </div>
6774
7084
  </div>
6775
7085
  <div class="header-actions">
7086
+ ${this.variant === 'inline' ? b `
7087
+ <button
7088
+ class=${e({
7089
+ 'header-action': true,
7090
+ 'header-action--active': this._debugPanelOpen,
7091
+ })}
7092
+ @click=${this._handleToggleDebugPanel}
7093
+ title="Debug telemetry"
7094
+ >
7095
+ <svg
7096
+ xmlns="http://www.w3.org/2000/svg"
7097
+ fill="none"
7098
+ viewBox="0 0 24 24"
7099
+ stroke-width="1.5"
7100
+ stroke="currentColor"
7101
+ class="header-action-icon"
7102
+ >
7103
+ <path
7104
+ stroke-linecap="round"
7105
+ stroke-linejoin="round"
7106
+ d="M3.75 3v11.25A2.25 2.25 0 0 0 6 16.5h2.25M3.75 3h-1.5m1.5 0h16.5m0 0h1.5m-1.5 0v11.25A2.25 2.25 0 0 1 18 16.5h-2.25m-7.5 0h7.5m-7.5 0-1 3m8.5-3 1 3m0 0 .5 1.5m-.5-1.5h-9.5m0 0-.5 1.5M9 11.25v1.5M12 9v3.75m3-6v6"
7107
+ />
7108
+ </svg>
7109
+ </button>
7110
+ ` : A}
6776
7111
  ${this.messages.length > 0 ? b `
6777
7112
  <button
6778
7113
  class="header-action"
@@ -6860,7 +7195,7 @@ let KRChatbot = class KRChatbot extends i$2 {
6860
7195
  <div class="message-content">
6861
7196
  ${msg.type === 'user'
6862
7197
  ? this._renderUserContent(msg.content)
6863
- : o(marked.parse(msg.content, { breaks: true }))}
7198
+ : o$1(marked.parse(msg.content, { breaks: true }))}
6864
7199
  </div>
6865
7200
  ` : A}
6866
7201
  ${msg.type === 'assistant' && this._isStreaming && msg === this.messages[this.messages.length - 1] ? b `
@@ -6937,6 +7272,37 @@ let KRChatbot = class KRChatbot extends i$2 {
6937
7272
  </div>
6938
7273
  ` : A}
6939
7274
 
7275
+ ${this._contextLimitReached ? b `
7276
+ <div class="context-limit" role="alert">
7277
+ ${this._contextLimitMessage
7278
+ || 'This conversation has reached its limit. Please start a new one to continue.'}
7279
+ </div>
7280
+ ` : this._contextWarning ? b `
7281
+ <div class="context-warning" role="status">
7282
+ <span>${this._contextWarning}</span>
7283
+ <button
7284
+ class="context-warning-dismiss"
7285
+ title="Dismiss"
7286
+ @click=${this._handleContextWarningDismiss}
7287
+ >
7288
+ <svg
7289
+ xmlns="http://www.w3.org/2000/svg"
7290
+ fill="none"
7291
+ viewBox="0 0 24 24"
7292
+ stroke-width="2"
7293
+ stroke="currentColor"
7294
+ class="context-warning-dismiss-icon"
7295
+ >
7296
+ <path
7297
+ stroke-linecap="round"
7298
+ stroke-linejoin="round"
7299
+ d="M6 18 18 6M6 6l12 12"
7300
+ />
7301
+ </svg>
7302
+ </button>
7303
+ </div>
7304
+ ` : A}
7305
+
6940
7306
  <div class="footer">
6941
7307
  ${this._pendingInternalFiles.length ? b `
6942
7308
  <div class="composer-attachments">
@@ -7036,11 +7402,12 @@ let KRChatbot = class KRChatbot extends i$2 {
7036
7402
  </div>
7037
7403
  </div>
7038
7404
  ${this._skillBrowseOpened ? this._renderSkillBrowse() : A}
7405
+ ${this.variant === 'inline' ? this._renderDebugPanel() : A}
7039
7406
  </div>
7040
7407
  `;
7041
7408
  }
7042
7409
  };
7043
- KRChatbot.styles = i$5 `
7410
+ KRChatbot.styles = i$6 `
7044
7411
  *,
7045
7412
  *::before,
7046
7413
  *::after {
@@ -7217,6 +7584,11 @@ KRChatbot.styles = i$5 `
7217
7584
  color: #000000;
7218
7585
  }
7219
7586
 
7587
+ .header-action--active {
7588
+ background: rgba(0, 0, 0, 0.08);
7589
+ color: #000000;
7590
+ }
7591
+
7220
7592
  .header-action-icon {
7221
7593
  width: 20px;
7222
7594
  height: 20px;
@@ -7246,19 +7618,6 @@ KRChatbot.styles = i$5 `
7246
7618
  margin-right: auto;
7247
7619
  }
7248
7620
 
7249
- .messages::-webkit-scrollbar {
7250
- width: 4px;
7251
- }
7252
-
7253
- .messages::-webkit-scrollbar-track {
7254
- background: transparent;
7255
- }
7256
-
7257
- .messages::-webkit-scrollbar-thumb {
7258
- background: rgba(0, 0, 0, 0.08);
7259
- border-radius: 2px;
7260
- }
7261
-
7262
7621
  .empty {
7263
7622
  flex: 1;
7264
7623
  display: flex;
@@ -7497,6 +7856,238 @@ KRChatbot.styles = i$5 `
7497
7856
  height: 14px;
7498
7857
  }
7499
7858
 
7859
+ /* Context warning banner (user-facing, dismissible, non-blocking) */
7860
+ .context-warning {
7861
+ padding: 8px 16px;
7862
+ background: #fffbeb;
7863
+ color: #92400e;
7864
+ font-size: 13px;
7865
+ display: flex;
7866
+ align-items: center;
7867
+ justify-content: space-between;
7868
+ gap: 8px;
7869
+ flex-shrink: 0;
7870
+ }
7871
+
7872
+ .context-warning-dismiss {
7873
+ background: none;
7874
+ border: none;
7875
+ color: #92400e;
7876
+ cursor: pointer;
7877
+ padding: 2px;
7878
+ display: flex;
7879
+ align-items: center;
7880
+ flex-shrink: 0;
7881
+ }
7882
+
7883
+ .context-warning-dismiss-icon {
7884
+ width: 14px;
7885
+ height: 14px;
7886
+ }
7887
+
7888
+ /* Context-limit notice (user-facing, blocking — steers to a new conversation) */
7889
+ .context-limit {
7890
+ padding: 10px 16px;
7891
+ background: var(--kr-chatbot-error-bg);
7892
+ color: var(--kr-chatbot-error-text);
7893
+ font-size: 13px;
7894
+ line-height: 1.5;
7895
+ flex-shrink: 0;
7896
+ }
7897
+
7898
+ /*
7899
+ * INTERNAL-ONLY debug telemetry drawer. A layout drawer docked to the right
7900
+ * of the inline chat — the chat column shrinks to make room; it does not
7901
+ * overlay. Closed by default (width 0), animates open. Not customer-facing —
7902
+ * token counts, cache internals, and approximate cost estimates for internal
7903
+ * debugging. Styled to match the chatbot's light theme (Inter, design tokens).
7904
+ */
7905
+ /*
7906
+ * The chat column reserves space for the drawer by animating padding-right,
7907
+ * so opening the drawer shrinks the chat (header/messages/composer) rather
7908
+ * than overlaying it. Only applies in inline mode.
7909
+ */
7910
+ :host([variant='inline']) .panel {
7911
+ transition: padding-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
7912
+ }
7913
+
7914
+ /* Track the cursor 1:1 while dragging the drawer's resize handle. */
7915
+ :host([variant='inline']) .panel--resizing-debug {
7916
+ transition: none;
7917
+ }
7918
+
7919
+ .debug-drawer {
7920
+ position: absolute;
7921
+ top: 0;
7922
+ right: 0;
7923
+ bottom: 0;
7924
+ background: var(--kr-chatbot-bg);
7925
+ display: flex;
7926
+ flex-direction: column;
7927
+ transform: translateX(100%);
7928
+ transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
7929
+ color: #000000;
7930
+ z-index: 5;
7931
+ }
7932
+
7933
+ /* While dragging the resize handle, suppress the slide transition so the
7934
+ drawer tracks the cursor 1:1. */
7935
+ .debug-drawer--resizing {
7936
+ transition: none;
7937
+ }
7938
+
7939
+ .debug-drawer--open {
7940
+ transform: translateX(0);
7941
+ box-shadow: -4px 0 20px rgba(10, 26, 46, 0.07);
7942
+ }
7943
+
7944
+ /* Left-edge grab handle for resizing the drawer. */
7945
+ .debug-drawer__resize {
7946
+ position: absolute;
7947
+ top: 0;
7948
+ left: 0;
7949
+ bottom: 0;
7950
+ width: 10px;
7951
+ cursor: ew-resize;
7952
+ z-index: 10;
7953
+ }
7954
+
7955
+ .debug-drawer__header {
7956
+ display: flex;
7957
+ align-items: center;
7958
+ justify-content: space-between;
7959
+ padding: 0 12px 0 20px;
7960
+ height: 64px;
7961
+ flex-shrink: 0;
7962
+ border-bottom: 1px solid rgba(0, 0, 0, 0.08);
7963
+ }
7964
+
7965
+ .debug-drawer__title {
7966
+ font-size: 14px;
7967
+ font-weight: 600;
7968
+ color: #000000;
7969
+ }
7970
+
7971
+ .debug-drawer__body {
7972
+ flex: 1;
7973
+ overflow-y: auto;
7974
+ overflow-x: hidden;
7975
+ padding: 4px 0;
7976
+ }
7977
+
7978
+ .debug-section {
7979
+ padding: 14px 20px;
7980
+ border-bottom: 1px solid rgba(0, 0, 0, 0.06);
7981
+ }
7982
+
7983
+ .debug-section:last-child {
7984
+ border-bottom: none;
7985
+ }
7986
+
7987
+ .debug-section__label {
7988
+ text-transform: uppercase;
7989
+ letter-spacing: 0.06em;
7990
+ color: #000000;
7991
+ font-size: 11px;
7992
+ font-weight: 600;
7993
+ margin-bottom: 10px;
7994
+ }
7995
+
7996
+ /* Context-fullness gauge */
7997
+ .debug-gauge {
7998
+ display: flex;
7999
+ align-items: center;
8000
+ gap: 10px;
8001
+ }
8002
+
8003
+ .debug-gauge__bar {
8004
+ flex: 1;
8005
+ height: 8px;
8006
+ border-radius: 4px;
8007
+ background: rgb(244 244 244 / 100%);
8008
+ overflow: hidden;
8009
+ }
8010
+
8011
+ .debug-gauge__fill {
8012
+ height: 100%;
8013
+ border-radius: 4px;
8014
+ background: var(--kr-chatbot-primary);
8015
+ transition: width 0.3s ease;
8016
+ }
8017
+
8018
+ .debug-gauge__text {
8019
+ color: #000000;
8020
+ font-size: 12px;
8021
+ white-space: nowrap;
8022
+ font-variant-numeric: tabular-nums;
8023
+ }
8024
+
8025
+ /* Metric rows */
8026
+ .debug-metrics {
8027
+ display: grid;
8028
+ grid-template-columns: auto 1fr;
8029
+ column-gap: 12px;
8030
+ row-gap: 7px;
8031
+ font-size: 13px;
8032
+ }
8033
+
8034
+ .debug-metrics__key {
8035
+ color: #000000;
8036
+ }
8037
+
8038
+ .debug-metrics__val {
8039
+ color: #000000;
8040
+ text-align: right;
8041
+ font-variant-numeric: tabular-nums;
8042
+ }
8043
+
8044
+ .debug-cost {
8045
+ font-weight: 600;
8046
+ }
8047
+
8048
+ /* Per-iteration table (verbose). The wrapper scrolls horizontally on its own
8049
+ so a wide table never forces the whole drawer to scroll sideways. */
8050
+ .debug-iterations-scroll {
8051
+ overflow-x: auto;
8052
+ max-width: 100%;
8053
+ }
8054
+
8055
+ .debug-iterations {
8056
+ width: 100%;
8057
+ border-collapse: collapse;
8058
+ font-size: 12px;
8059
+ font-variant-numeric: tabular-nums;
8060
+ }
8061
+
8062
+ .debug-iterations th,
8063
+ .debug-iterations td {
8064
+ padding: 5px 6px;
8065
+ text-align: right;
8066
+ white-space: nowrap;
8067
+ }
8068
+
8069
+ .debug-iterations th {
8070
+ color: #000000;
8071
+ font-weight: 600;
8072
+ border-bottom: 1px solid rgba(0, 0, 0, 0.10);
8073
+ }
8074
+
8075
+ .debug-iterations tbody tr:not(:last-child) td {
8076
+ border-bottom: 1px solid rgba(0, 0, 0, 0.05);
8077
+ }
8078
+
8079
+ .debug-iterations td:first-child,
8080
+ .debug-iterations th:first-child {
8081
+ text-align: left;
8082
+ }
8083
+
8084
+ .debug-empty {
8085
+ color: #000000;
8086
+ padding: 20px;
8087
+ font-size: 13px;
8088
+ text-align: center;
8089
+ }
8090
+
7500
8091
  /* Footer / Input */
7501
8092
  .footer {
7502
8093
  padding: 16px 16px 16px;
@@ -7959,38 +8550,38 @@ KRChatbot.styles = i$5 `
7959
8550
 
7960
8551
  `;
7961
8552
  __decorate([
7962
- n({ attribute: false })
8553
+ n$1({ attribute: false })
7963
8554
  ], KRChatbot.prototype, "send", void 0);
7964
8555
  __decorate([
7965
- n({ attribute: false })
8556
+ n$1({ attribute: false })
7966
8557
  ], KRChatbot.prototype, "clear", void 0);
7967
8558
  __decorate([
7968
- n({ attribute: false })
8559
+ n$1({ attribute: false })
7969
8560
  ], KRChatbot.prototype, "load", void 0);
7970
8561
  __decorate([
7971
- n({ attribute: false })
8562
+ n$1({ attribute: false })
7972
8563
  ], KRChatbot.prototype, "messages", void 0);
7973
8564
  __decorate([
7974
- n({ type: String })
8565
+ n$1({ type: String })
7975
8566
  ], KRChatbot.prototype, "label", void 0);
7976
8567
  __decorate([
7977
- n({ type: String })
8568
+ n$1({ type: String })
7978
8569
  ], KRChatbot.prototype, "placeholder", void 0);
7979
8570
  __decorate([
7980
- n({
8571
+ n$1({
7981
8572
  type: Boolean,
7982
8573
  reflect: true
7983
8574
  })
7984
8575
  ], KRChatbot.prototype, "opened", void 0);
7985
8576
  __decorate([
7986
- n({
8577
+ n$1({
7987
8578
  type: Boolean,
7988
8579
  attribute: 'hide-toggle',
7989
8580
  reflect: true
7990
8581
  })
7991
8582
  ], KRChatbot.prototype, "hideToggle", void 0);
7992
8583
  __decorate([
7993
- n({
8584
+ n$1({
7994
8585
  type: String,
7995
8586
  reflect: true
7996
8587
  })
@@ -8004,6 +8595,33 @@ __decorate([
8004
8595
  __decorate([
8005
8596
  r()
8006
8597
  ], KRChatbot.prototype, "_error", void 0);
8598
+ __decorate([
8599
+ r()
8600
+ ], KRChatbot.prototype, "_contextWarning", void 0);
8601
+ __decorate([
8602
+ r()
8603
+ ], KRChatbot.prototype, "_contextLimitReached", void 0);
8604
+ __decorate([
8605
+ r()
8606
+ ], KRChatbot.prototype, "_contextLimitMessage", void 0);
8607
+ __decorate([
8608
+ r()
8609
+ ], KRChatbot.prototype, "_telemetry", void 0);
8610
+ __decorate([
8611
+ r()
8612
+ ], KRChatbot.prototype, "_iterationLog", void 0);
8613
+ __decorate([
8614
+ r()
8615
+ ], KRChatbot.prototype, "_cacheCheckpoints", void 0);
8616
+ __decorate([
8617
+ r()
8618
+ ], KRChatbot.prototype, "_debugPanelOpen", void 0);
8619
+ __decorate([
8620
+ r()
8621
+ ], KRChatbot.prototype, "_debugDrawerWidth", void 0);
8622
+ __decorate([
8623
+ r()
8624
+ ], KRChatbot.prototype, "_isDebugResizing", void 0);
8007
8625
  __decorate([
8008
8626
  r()
8009
8627
  ], KRChatbot.prototype, "_pendingInternalFiles", void 0);