@kodaris/krubble-app-components 1.0.69 → 1.0.70

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.
@@ -1,4 +1,4 @@
1
- import { KRContextMenu, KRDialog } from '@kodaris/krubble-components';
1
+ import { KRContextMenu, KRDialog, KRFilePreview } from '@kodaris/krubble-components';
2
2
  import { KRHttp } from '@kodaris/krubble-http';
3
3
 
4
4
  /**
@@ -6,39 +6,39 @@ 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$3=globalThis,e$7=t$3.ShadowRoot&&(void 0===t$3.ShadyCSS||t$3.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$2=Symbol(),o$5=new WeakMap;let n$3 = class n{constructor(t,e,o){if(this._$cssResult$=true,o!==s$2)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$2),i$4=(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$2)},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$3.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$2=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$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;
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$3,defineProperty:e$6,getOwnPropertyDescriptor:h$1,getOwnPropertyNames:r$3,getOwnPropertySymbols:o$4,getPrototypeOf:n$2}=Object,a$1=globalThis,c$1=a$1.trustedTypes,l$1=c$1?c$1.emptyScript:"",p$1=a$1.reactiveElementPolyfillSupport,d$1=(t,s)=>t,u$1={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$3(t,s),b$1={attribute:true,type:String,converter:u$1,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$1(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$2(s));}else void 0!==s&&i.push(c$2(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$1).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$1;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$1?.({ReactiveElement:y$1}),(a$1.reactiveElementVersions??=[]).push("2.1.2");
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");
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$2=globalThis,i$2=t=>t,s$1=t$2.trustedTypes,e$5=s$1?s$1.createPolicy("lit-html",{createHTML:t=>t}):void 0,h="$lit$",o$3=`lit$${Math.random().toFixed(9).slice(2)}$`,n$1="?"+o$3,r$2=`<${n$1}>`,l=document,c=()=>l.createComment(""),a=t=>null===t||"object"!=typeof t&&"function"!=typeof t,u=Array.isArray,d=t=>u(t)||"function"==typeof t?.[Symbol.iterator],f="[ \t\n\f\r]",v=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_=/-->/g,m=/>/g,p=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(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;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?"!--"===u[1]?c=_:void 0!==u[1]?c=m:void 0!==u[2]?(y.test(u[2])&&(n=RegExp("</"+u[2],"g")),c=p):void 0!==u[3]&&(c=p):c===p?">"===u[0]?(c=n??v,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?p:'"'===u[3]?$:g):c===$||c===g?c=p:c===_||c===m?c=v:(c=p,n=void 0);const x=c===p&&t[i+1].startsWith("/>")?" ":"";l+=c===v?s+r$2:d>=0?(e.push(a),s.slice(0,d)+h+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)){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$1?s$1.emptyScript:"";for(let s=0;s<i;s++)r.append(t[s],c()),P.nextNode(),d.push({type:2,index:++l});r.append(t[i],c());}}}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(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(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(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(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()),this.O(c()),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$2(t).nextSibling;i$2(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(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(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(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(this,t);}}const B=t$2.litHtmlPolyfillSupport;B?.(S,k),(t$2.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(),t),t,void 0,s??{});}return h._$AI(t),h};
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};
23
23
 
24
24
  /**
25
25
  * @license
26
26
  * Copyright 2017 Google LLC
27
27
  * SPDX-License-Identifier: BSD-3-Clause
28
- */const s=globalThis;let i$1 = 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$1._$litElement$=true,i$1["finalized"]=true,s.litElementHydrateSupport?.({LitElement:i$1});const o$2=s.litElementPolyfillSupport;o$2?.({LitElement:i$1});(s.litElementVersions??=[]).push("4.2.2");
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");
29
29
 
30
30
  /**
31
31
  * @license
32
32
  * Copyright 2017 Google LLC
33
33
  * SPDX-License-Identifier: BSD-3-Clause
34
34
  */
35
- const t$1=t=>(e,o)=>{ void 0!==o?o.addInitializer(()=>{customElements.define(t,e);}):customElements.define(t,e);};
35
+ const t$2=t=>(e,o)=>{ void 0!==o?o.addInitializer(()=>{customElements.define(t,e);}):customElements.define(t,e);};
36
36
 
37
37
  /**
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$1,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$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)}
42
42
 
43
43
  /**
44
44
  * @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={ATTRIBUTE:1,CHILD:2},e$2=t=>(...e)=>({_$litDirective$:t,values:e});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$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)}};
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{constructor(i){if(super(i),this.it=A,i.type!==t.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$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);
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{constructor(t$1){if(super(t$1),t$1.type!==t.ATTRIBUTE||"class"!==t$1.name||t$1.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$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}});
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$1 {
87
+ let KRNavItemEdit = class KRNavItemEdit extends i$2 {
88
88
  constructor() {
89
89
  super(...arguments);
90
90
  this.label = '';
@@ -188,7 +188,7 @@ let KRNavItemEdit = class KRNavItemEdit extends i$1 {
188
188
  `;
189
189
  }
190
190
  };
191
- KRNavItemEdit.styles = i$4 `
191
+ KRNavItemEdit.styles = i$5 `
192
192
  :host {
193
193
  display: block;
194
194
  width: 360px;
@@ -287,7 +287,7 @@ __decorate$6([
287
287
  r()
288
288
  ], KRNavItemEdit.prototype, "active", void 0);
289
289
  KRNavItemEdit = __decorate$6([
290
- t$1('kr-nav-item-edit')
290
+ t$2('kr-nav-item-edit')
291
291
  ], KRNavItemEdit);
292
292
 
293
293
  var __decorate$5 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
@@ -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$1 {
352
+ let KRScaffold = class KRScaffold extends i$2 {
353
353
  constructor() {
354
354
  super();
355
355
  /**
@@ -1513,7 +1513,7 @@ let KRScaffold = class KRScaffold extends i$1 {
1513
1513
  `;
1514
1514
  }
1515
1515
  };
1516
- KRScaffold.styles = i$4 `
1516
+ KRScaffold.styles = i$5 `
1517
1517
  :host {
1518
1518
  display: flex;
1519
1519
  flex-direction: column;
@@ -2331,7 +2331,7 @@ __decorate$5([
2331
2331
  r()
2332
2332
  ], KRScaffold.prototype, "pendingRequests", void 0);
2333
2333
  KRScaffold = __decorate$5([
2334
- t$1('kr-scaffold')
2334
+ t$2('kr-scaffold')
2335
2335
  ], KRScaffold);
2336
2336
 
2337
2337
  var __decorate$4 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
@@ -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$1 {
2371
+ let KRScreenNav = class KRScreenNav extends i$2 {
2372
2372
  constructor() {
2373
2373
  super(...arguments);
2374
2374
  /**
@@ -2484,7 +2484,7 @@ let KRScreenNav = class KRScreenNav extends i$1 {
2484
2484
  `;
2485
2485
  }
2486
2486
  };
2487
- KRScreenNav.styles = i$4 `
2487
+ KRScreenNav.styles = i$5 `
2488
2488
  :host {
2489
2489
  display: flex;
2490
2490
  height: 100%;
@@ -2589,7 +2589,7 @@ __decorate$4([
2589
2589
  n({ type: String })
2590
2590
  ], KRScreenNav.prototype, "activeId", void 0);
2591
2591
  KRScreenNav = __decorate$4([
2592
- t$1('kr-screen-nav')
2592
+ t$2('kr-screen-nav')
2593
2593
  ], KRScreenNav);
2594
2594
 
2595
2595
  var __decorate$3 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
@@ -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$1 {
2620
+ let KRScreenDetail = class KRScreenDetail extends i$2 {
2621
2621
  constructor() {
2622
2622
  super(...arguments);
2623
2623
  /**
@@ -2641,7 +2641,7 @@ let KRScreenDetail = class KRScreenDetail extends i$1 {
2641
2641
  `;
2642
2642
  }
2643
2643
  };
2644
- KRScreenDetail.styles = i$4 `
2644
+ KRScreenDetail.styles = i$5 `
2645
2645
  :host {
2646
2646
  display: flex;
2647
2647
  flex-direction: column;
@@ -2690,7 +2690,7 @@ __decorate$3([
2690
2690
  n({ type: String })
2691
2691
  ], KRScreenDetail.prototype, "title", void 0);
2692
2692
  KRScreenDetail = __decorate$3([
2693
- t$1('kr-screen-detail')
2693
+ t$2('kr-screen-detail')
2694
2694
  ], KRScreenDetail);
2695
2695
 
2696
2696
  var __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
@@ -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$1 {
2707
+ let KRSubbar = class KRSubbar extends i$2 {
2708
2708
  constructor() {
2709
2709
  super(...arguments);
2710
2710
  /**
@@ -2832,7 +2832,7 @@ let KRSubbar = class KRSubbar extends i$1 {
2832
2832
  `;
2833
2833
  }
2834
2834
  };
2835
- KRSubbar.styles = i$4 `
2835
+ KRSubbar.styles = i$5 `
2836
2836
  :host {
2837
2837
  display: flex;
2838
2838
  flex-direction: row;
@@ -2906,7 +2906,7 @@ __decorate$2([
2906
2906
  n({ type: Boolean })
2907
2907
  ], KRSubbar.prototype, "menu", void 0);
2908
2908
  KRSubbar = __decorate$2([
2909
- t$1('kr-subbar')
2909
+ t$2('kr-subbar')
2910
2910
  ], KRSubbar);
2911
2911
 
2912
2912
  var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
@@ -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$1 {
3048
+ let KRRouterOutlet = class KRRouterOutlet extends i$2 {
3049
3049
  constructor() {
3050
3050
  super(...arguments);
3051
3051
  this.level = -1;
@@ -3090,16 +3090,29 @@ let KRRouterOutlet = class KRRouterOutlet extends i$1 {
3090
3090
  return b `${el}`;
3091
3091
  }
3092
3092
  };
3093
- KRRouterOutlet.styles = i$4 `
3093
+ KRRouterOutlet.styles = i$5 `
3094
3094
  :host {
3095
3095
  display: block;
3096
3096
  height: 100%;
3097
3097
  }
3098
3098
  `;
3099
3099
  KRRouterOutlet = __decorate$1([
3100
- t$1('kr-router-outlet')
3100
+ t$2('kr-router-outlet')
3101
3101
  ], KRRouterOutlet);
3102
3102
 
3103
+ /**
3104
+ * @license
3105
+ * Copyright 2020 Google LLC
3106
+ * SPDX-License-Identifier: BSD-3-Clause
3107
+ */const {I:t}=j,i=o=>o,s=()=>document.createComment(""),v=(o,n,e)=>{const l=o._$AA.parentNode,d=void 0===n?o._$AB:n._$AA;if(void 0===e){const i=l.insertBefore(s(),d),n=l.insertBefore(s(),d);e=new t(i,n,o,o.options);}else {const t=e._$AB.nextSibling,n=e._$AM,c=n!==o;if(c){let t;e._$AQ?.(o),e._$AM=o,void 0!==e._$AP&&(t=o._$AU)!==n._$AU&&e._$AP(t);}if(t!==d||c){let o=e._$AA;for(;o!==t;){const t=i(o).nextSibling;i(l).insertBefore(o,d),o=t;}}}return e},u$1=(o,t,i=o)=>(o._$AI(t,i),o),m={},p=(o,t=m)=>o._$AH=t,M=o=>o._$AH,h=o=>{o._$AR(),o._$AA.remove();};
3108
+
3109
+ /**
3110
+ * @license
3111
+ * Copyright 2017 Google LLC
3112
+ * SPDX-License-Identifier: BSD-3-Clause
3113
+ */
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}});
3115
+
3103
3116
  /**
3104
3117
  * marked v12.0.2 - a markdown parser
3105
3118
  * Copyright (c) 2011-2024, Christopher Jeffrey. (MIT Licensed)
@@ -5532,6 +5545,8 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
5532
5545
  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;
5533
5546
  return c > 3 && r && Object.defineProperty(target, key, r), r;
5534
5547
  };
5548
+ /** Image MIME types the chatbot accepts (matches what Bedrock can ingest). */
5549
+ const ACCEPTED_IMAGE_TYPES = ['image/jpeg', 'image/png', 'image/gif', 'image/webp'];
5535
5550
  /**
5536
5551
  * AI chatbot component with SSE streaming.
5537
5552
  *
@@ -5569,7 +5584,7 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
5569
5584
  * @fires message-submit - When the user sends a message. Cancelable. Detail: `{ message: string }`
5570
5585
  * @fires stream-event - Dispatched for every SSE message received. Detail contains the parsed event data.
5571
5586
  */
5572
- let KRChatbot = class KRChatbot extends i$1 {
5587
+ let KRChatbot = class KRChatbot extends i$2 {
5573
5588
  constructor() {
5574
5589
  super(...arguments);
5575
5590
  // --- Private properties ---
@@ -5587,6 +5602,10 @@ let KRChatbot = class KRChatbot extends i$1 {
5587
5602
  this._dragStartTop = 0;
5588
5603
  this._resizeStartW = 0;
5589
5604
  this._resizeStartH = 0;
5605
+ /** Counter for depth-aware dragenter/dragleave tracking. */
5606
+ this._dragDepth = 0;
5607
+ /** Monotonic id source for pending attachments. */
5608
+ this._pendingSeq = 0;
5590
5609
  // --- @property (public API) ---
5591
5610
  /**
5592
5611
  * Callback function for sending messages. Receives the user's message and
@@ -5624,11 +5643,21 @@ let KRChatbot = class KRChatbot extends i$1 {
5624
5643
  * Whether the chat panel is open. Only relevant in floating mode.
5625
5644
  */
5626
5645
  this.opened = false;
5646
+ /**
5647
+ * Hide the built-in floating toggle button. Use this when an external
5648
+ * control (e.g. the site-editor bar) owns opening the chat — the panel is
5649
+ * then driven via the `open()` / `close()` / `toggle()` methods.
5650
+ */
5651
+ this.hideToggle = false;
5627
5652
  // --- @state (internal) ---
5628
5653
  this._inputValue = '';
5629
5654
  this._isStreaming = false;
5630
5655
  this._statusText = '';
5631
5656
  this._error = '';
5657
+ /** Images staged in the composer, before the message is sent. */
5658
+ this._pendingAttachments = [];
5659
+ /** True while a file is being dragged over the panel (shows the drop overlay). */
5660
+ this._isDraggingFile = false;
5632
5661
  this._handleMouseMove = (e) => {
5633
5662
  if (this._isDragging) {
5634
5663
  let newLeft = this._dragStartLeft + (e.clientX - this._dragStartX);
@@ -5707,6 +5736,8 @@ let KRChatbot = class KRChatbot extends i$1 {
5707
5736
  }
5708
5737
  document.removeEventListener('mousemove', this._handleMouseMove);
5709
5738
  document.removeEventListener('mouseup', this._handleMouseUp);
5739
+ // Release any object URLs still held by staged attachments.
5740
+ this._pendingAttachments.forEach((p) => URL.revokeObjectURL(p.previewUrl));
5710
5741
  }
5711
5742
  updated(changed) {
5712
5743
  if (changed.has('messages') || changed.has('_statusText')) {
@@ -5733,6 +5764,22 @@ let KRChatbot = class KRChatbot extends i$1 {
5733
5764
  stop() {
5734
5765
  this._handleStop();
5735
5766
  }
5767
+ /** Open the chat panel. */
5768
+ open() {
5769
+ if (!this.opened) {
5770
+ this._handleToggle();
5771
+ }
5772
+ }
5773
+ /** Close the chat panel. */
5774
+ close() {
5775
+ if (this.opened) {
5776
+ this._handleToggle();
5777
+ }
5778
+ }
5779
+ /** Toggle the chat panel open/closed. */
5780
+ toggle() {
5781
+ this._handleToggle();
5782
+ }
5736
5783
  // --- Private methods ---
5737
5784
  /**
5738
5785
  * Shows a full-viewport transparent overlay during drag/resize operations.
@@ -5901,14 +5948,137 @@ let KRChatbot = class KRChatbot extends i$1 {
5901
5948
  this._handleSubmit();
5902
5949
  }
5903
5950
  }
5951
+ // --- Attachments ---
5952
+ _openFilePicker() {
5953
+ this._fileInputEl?.click();
5954
+ }
5955
+ _handleFileInputChange(e) {
5956
+ const input = e.target;
5957
+ if (input.files) {
5958
+ this._addFiles(input.files);
5959
+ }
5960
+ // Reset so picking the same file again re-fires change.
5961
+ input.value = '';
5962
+ }
5963
+ _handlePaste(e) {
5964
+ const items = e.clipboardData?.items;
5965
+ if (!items) {
5966
+ return;
5967
+ }
5968
+ const files = [];
5969
+ for (let i = 0; i < items.length; i++) {
5970
+ if (items[i].kind === 'file') {
5971
+ const file = items[i].getAsFile();
5972
+ if (file) {
5973
+ files.push(file);
5974
+ }
5975
+ }
5976
+ }
5977
+ if (files.length) {
5978
+ e.preventDefault();
5979
+ this._addFiles(files);
5980
+ }
5981
+ }
5982
+ _handleDragEnter(e) {
5983
+ if (!this._hasFiles(e)) {
5984
+ return;
5985
+ }
5986
+ e.preventDefault();
5987
+ this._dragDepth++;
5988
+ this._isDraggingFile = true;
5989
+ }
5990
+ _handleDragOver(e) {
5991
+ if (!this._hasFiles(e)) {
5992
+ return;
5993
+ }
5994
+ // Required so the drop event fires.
5995
+ e.preventDefault();
5996
+ }
5997
+ _handleDragLeave(e) {
5998
+ if (!this._hasFiles(e)) {
5999
+ return;
6000
+ }
6001
+ this._dragDepth--;
6002
+ if (this._dragDepth <= 0) {
6003
+ this._dragDepth = 0;
6004
+ this._isDraggingFile = false;
6005
+ }
6006
+ }
6007
+ _handleDrop(e) {
6008
+ if (!this._hasFiles(e)) {
6009
+ return;
6010
+ }
6011
+ e.preventDefault();
6012
+ this._dragDepth = 0;
6013
+ this._isDraggingFile = false;
6014
+ if (e.dataTransfer?.files) {
6015
+ this._addFiles(e.dataTransfer.files);
6016
+ }
6017
+ }
6018
+ _hasFiles(e) {
6019
+ return Array.from(e.dataTransfer?.types || []).includes('Files');
6020
+ }
6021
+ /** Stage a set of image files in the composer (held locally until send). */
6022
+ _addFiles(fileList) {
6023
+ const files = Array.from(fileList).filter((f) => ACCEPTED_IMAGE_TYPES.includes(f.type));
6024
+ if (!files.length) {
6025
+ return;
6026
+ }
6027
+ files.forEach((file) => {
6028
+ const pending = {
6029
+ localId: 'att-' + this._pendingSeq++,
6030
+ file,
6031
+ name: file.name,
6032
+ previewUrl: URL.createObjectURL(file),
6033
+ };
6034
+ this._pendingAttachments = [...this._pendingAttachments, pending];
6035
+ });
6036
+ }
6037
+ _removePending(localId) {
6038
+ const target = this._pendingAttachments.find((p) => p.localId === localId);
6039
+ if (target) {
6040
+ URL.revokeObjectURL(target.previewUrl);
6041
+ }
6042
+ this._pendingAttachments = this._pendingAttachments.filter((p) => p.localId !== localId);
6043
+ }
6044
+ _clearPending() {
6045
+ this._pendingAttachments.forEach((p) => URL.revokeObjectURL(p.previewUrl));
6046
+ this._pendingAttachments = [];
6047
+ }
6048
+ /** Open the shared full-screen previewer for an attachment. */
6049
+ _openAttachment(att) {
6050
+ KRFilePreview.open({
6051
+ src: att.url,
6052
+ name: att.name || 'image',
6053
+ });
6054
+ }
6055
+ /** Whether the send button is active: needs text or at least one image. */
6056
+ _canSend() {
6057
+ return Boolean(this._inputValue.trim()) || this._pendingAttachments.length > 0;
6058
+ }
5904
6059
  _handleSubmit() {
5905
- if (!this._inputValue.trim() || !this.send || this._isStreaming) {
6060
+ if (!this.send || this._isStreaming) {
5906
6061
  return;
5907
6062
  }
5908
6063
  const messageText = this._inputValue.trim();
6064
+ const pending = this._pendingAttachments;
6065
+ // Allow sending an image with no text, but require at least one of them.
6066
+ if (!messageText && !pending.length) {
6067
+ return;
6068
+ }
6069
+ // The raw files sent to the backend, and the display attachments for the
6070
+ // sent message. The message reuses each preview object URL, so ownership of
6071
+ // those URLs transfers to the message (we don't revoke them here).
6072
+ const files = pending.map((p) => p.file);
6073
+ const attachments = pending.map((p) => ({
6074
+ url: p.previewUrl,
6075
+ name: p.name,
6076
+ mimeType: p.file.type,
6077
+ }));
5909
6078
  const submitEvent = new CustomEvent('message-submit', {
5910
6079
  detail: {
5911
6080
  message: messageText,
6081
+ files,
5912
6082
  },
5913
6083
  bubbles: true,
5914
6084
  composed: true,
@@ -5918,13 +6088,20 @@ let KRChatbot = class KRChatbot extends i$1 {
5918
6088
  if (submitEvent.defaultPrevented) {
5919
6089
  return;
5920
6090
  }
5921
- this.messages = [...this.messages, {
5922
- role: 'user',
5923
- content: messageText,
5924
- }];
6091
+ const userMessage = {
6092
+ role: 'user',
6093
+ content: messageText,
6094
+ };
6095
+ if (attachments.length) {
6096
+ userMessage.attachments = attachments;
6097
+ }
6098
+ this.messages = [...this.messages, userMessage];
5925
6099
  this._inputValue = '';
5926
6100
  this._error = '';
5927
6101
  this._userHasScrolledUp = false;
6102
+ // Clear the composer without revoking the object URLs — the sent message now
6103
+ // owns them for display.
6104
+ this._pendingAttachments = [];
5928
6105
  // Reset textarea height
5929
6106
  if (this._inputEl) {
5930
6107
  this._inputEl.style.height = 'auto';
@@ -5960,6 +6137,7 @@ let KRChatbot = class KRChatbot extends i$1 {
5960
6137
  this.send({
5961
6138
  message: messageText,
5962
6139
  messages: this.messages.slice(0, -1),
6140
+ files,
5963
6141
  }).then((response) => {
5964
6142
  if (!response.ok) {
5965
6143
  this._handleStreamError('Request failed: ' + response.status);
@@ -6120,31 +6298,57 @@ let KRChatbot = class KRChatbot extends i$1 {
6120
6298
  // --- Render ---
6121
6299
  render() {
6122
6300
  return b `
6123
- <button
6124
- class=${e({
6301
+ ${this.hideToggle ? A : b `
6302
+ <button
6303
+ class=${e({
6125
6304
  'toggle': true,
6126
6305
  'toggle--hidden': this.opened,
6127
6306
  })}
6128
- @click=${this._handleToggle}
6129
- title="Open chat"
6130
- >
6131
- <svg
6132
- viewBox="0 0 24 24"
6133
- fill="none"
6134
- stroke="currentColor"
6135
- stroke-width="2"
6136
- stroke-linecap="round"
6137
- class="toggle-icon"
6307
+ @click=${this._handleToggle}
6308
+ title="Open chat"
6138
6309
  >
6139
- <path d="M12 2C6.48 2 2 6.03 2 11c0 2.61 1.19 4.94 3.05 6.55L4 22l4.8-2.4C9.82 19.85 10.88 20 12 20c5.52 0 10-4.03 10-9S17.52 2 12 2z"/>
6140
- <path d="M8 11h.01M12 11h.01M16 11h.01" stroke-width="2.5"/>
6141
- </svg>
6142
- </button>
6310
+ <svg
6311
+ viewBox="0 0 24 24"
6312
+ fill="none"
6313
+ stroke="currentColor"
6314
+ stroke-width="2"
6315
+ stroke-linecap="round"
6316
+ class="toggle-icon"
6317
+ >
6318
+ <path d="M12 2C6.48 2 2 6.03 2 11c0 2.61 1.19 4.94 3.05 6.55L4 22l4.8-2.4C9.82 19.85 10.88 20 12 20c5.52 0 10-4.03 10-9S17.52 2 12 2z"/>
6319
+ <path d="M8 11h.01M12 11h.01M16 11h.01" stroke-width="2.5"/>
6320
+ </svg>
6321
+ </button>
6322
+ `}
6143
6323
 
6144
- <div class=${e({
6324
+ <div
6325
+ class=${e({
6145
6326
  'panel': true,
6146
6327
  'panel--opened': this.opened,
6147
- })}>
6328
+ })}
6329
+ @dragenter=${this._handleDragEnter}
6330
+ @dragover=${this._handleDragOver}
6331
+ @dragleave=${this._handleDragLeave}
6332
+ @drop=${this._handleDrop}
6333
+ >
6334
+ ${this._isDraggingFile ? b `
6335
+ <div class="drop-overlay">
6336
+ <svg
6337
+ xmlns="http://www.w3.org/2000/svg"
6338
+ fill="none"
6339
+ viewBox="0 0 24 24"
6340
+ stroke-width="1.5"
6341
+ stroke="currentColor"
6342
+ >
6343
+ <path
6344
+ stroke-linecap="round"
6345
+ stroke-linejoin="round"
6346
+ d="M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"
6347
+ />
6348
+ </svg>
6349
+ <span>Drop images to attach</span>
6350
+ </div>
6351
+ ` : A}
6148
6352
  <div
6149
6353
  class="resize resize--n"
6150
6354
  data-dir="n"
@@ -6258,6 +6462,20 @@ let KRChatbot = class KRChatbot extends i$1 {
6258
6462
  <div class="reasoning-content">${msg.reasoning}</div>
6259
6463
  </details>
6260
6464
  ` : A}
6465
+ ${msg.attachments && msg.attachments.length ? b `
6466
+ <div class="attachments">
6467
+ ${msg.attachments.map((att) => b `
6468
+ <button
6469
+ class="attachment"
6470
+ type="button"
6471
+ title=${att.name || 'View image'}
6472
+ @click=${() => this._openAttachment(att)}
6473
+ >
6474
+ <img src=${att.url} alt=${att.name || ''} />
6475
+ </button>
6476
+ `)}
6477
+ </div>
6478
+ ` : A}
6261
6479
  ${msg.content ? b `
6262
6480
  <div class="message-content">
6263
6481
  ${msg.role === 'user'
@@ -6299,8 +6517,48 @@ let KRChatbot = class KRChatbot extends i$1 {
6299
6517
  ` : A}
6300
6518
 
6301
6519
  <div class="footer">
6520
+ ${this._pendingAttachments.length ? b `
6521
+ <div class="composer-attachments">
6522
+ ${c(this._pendingAttachments, (p) => p.localId, (p) => b `
6523
+ <div class="chip">
6524
+ <img src=${p.previewUrl} alt=${p.name} />
6525
+ <button
6526
+ class="chip-remove"
6527
+ title="Remove"
6528
+ @click=${() => this._removePending(p.localId)}
6529
+ >
6530
+ <svg
6531
+ xmlns="http://www.w3.org/2000/svg"
6532
+ fill="none"
6533
+ viewBox="0 0 24 24"
6534
+ stroke-width="3"
6535
+ stroke="currentColor"
6536
+ >
6537
+ <path
6538
+ stroke-linecap="round"
6539
+ stroke-linejoin="round"
6540
+ d="M6 18 18 6M6 6l12 12"
6541
+ />
6542
+ </svg>
6543
+ </button>
6544
+ </div>
6545
+ `)}
6546
+ </div>
6547
+ ` : A}
6548
+ <input
6549
+ class="file-input"
6550
+ type="file"
6551
+ accept="image/png,image/jpeg,image/gif,image/webp"
6552
+ multiple
6553
+ hidden
6554
+ @change=${this._handleFileInputChange}
6555
+ />
6302
6556
  <div class="input-wrapper">
6303
- <button class="input-plus" title="Attach">+</button>
6557
+ <button
6558
+ class="input-plus"
6559
+ title="Attach image"
6560
+ @click=${this._openFilePicker}
6561
+ >+</button>
6304
6562
  <textarea
6305
6563
  class="input"
6306
6564
  .value=${this._inputValue}
@@ -6308,6 +6566,7 @@ let KRChatbot = class KRChatbot extends i$1 {
6308
6566
  rows="1"
6309
6567
  @input=${this._handleInputChange}
6310
6568
  @keydown=${this._handleKeyDown}
6569
+ @paste=${this._handlePaste}
6311
6570
  ></textarea>
6312
6571
  ${this._isStreaming ? b `
6313
6572
  <button
@@ -6334,7 +6593,7 @@ let KRChatbot = class KRChatbot extends i$1 {
6334
6593
  <button
6335
6594
  class=${e({
6336
6595
  'send': true,
6337
- 'send--disabled': !this._inputValue.trim(),
6596
+ 'send--disabled': !this._canSend(),
6338
6597
  })}
6339
6598
  @click=${this._handleSubmit}
6340
6599
  title="Send message"
@@ -6359,7 +6618,7 @@ let KRChatbot = class KRChatbot extends i$1 {
6359
6618
  `;
6360
6619
  }
6361
6620
  };
6362
- KRChatbot.styles = i$4 `
6621
+ KRChatbot.styles = i$5 `
6363
6622
  *,
6364
6623
  *::before,
6365
6624
  *::after {
@@ -6901,6 +7160,116 @@ KRChatbot.styles = i$4 `
6901
7160
  .resize--sw { bottom: -4px; left: -4px; width: 16px; height: 16px; cursor: sw-resize; }
6902
7161
  .resize--se { bottom: -4px; right: -4px; width: 16px; height: 16px; cursor: se-resize; }
6903
7162
 
7163
+ /* Attachment thumbnails inside a sent message bubble */
7164
+ .attachments {
7165
+ display: flex;
7166
+ flex-wrap: wrap;
7167
+ gap: 8px;
7168
+ }
7169
+
7170
+ .message--user .attachments {
7171
+ justify-content: flex-end;
7172
+ }
7173
+
7174
+ .attachment {
7175
+ width: 120px;
7176
+ height: 120px;
7177
+ border-radius: 12px;
7178
+ overflow: hidden;
7179
+ background: #f2f2f4;
7180
+ border: 1px solid rgba(0, 0, 0, 0.08);
7181
+ cursor: zoom-in;
7182
+ flex-shrink: 0;
7183
+ padding: 0;
7184
+ }
7185
+
7186
+ .attachment img {
7187
+ width: 100%;
7188
+ height: 100%;
7189
+ object-fit: cover;
7190
+ display: block;
7191
+ }
7192
+
7193
+ /* Composer attachment chips (pre-send) */
7194
+ .composer-attachments {
7195
+ display: flex;
7196
+ flex-wrap: wrap;
7197
+ gap: 8px;
7198
+ padding: 0 6px 10px;
7199
+ }
7200
+
7201
+ .chip {
7202
+ position: relative;
7203
+ width: 56px;
7204
+ height: 56px;
7205
+ border-radius: 10px;
7206
+ overflow: hidden;
7207
+ background: #f2f2f4;
7208
+ border: 1px solid var(--kr-chatbot-border);
7209
+ flex-shrink: 0;
7210
+ }
7211
+
7212
+ .chip img {
7213
+ width: 100%;
7214
+ height: 100%;
7215
+ object-fit: cover;
7216
+ display: block;
7217
+ }
7218
+
7219
+ .chip-remove {
7220
+ position: absolute;
7221
+ top: 2px;
7222
+ right: 2px;
7223
+ width: 18px;
7224
+ height: 18px;
7225
+ border-radius: 50%;
7226
+ border: none;
7227
+ background: rgba(0, 0, 0, 0.6);
7228
+ color: #fff;
7229
+ cursor: pointer;
7230
+ display: flex;
7231
+ align-items: center;
7232
+ justify-content: center;
7233
+ padding: 0;
7234
+ line-height: 1;
7235
+ }
7236
+
7237
+ .chip-remove:hover {
7238
+ background: rgba(0, 0, 0, 0.8);
7239
+ }
7240
+
7241
+ .chip-remove svg {
7242
+ width: 10px;
7243
+ height: 10px;
7244
+ }
7245
+
7246
+ /* Drag-and-drop overlay */
7247
+ .drop-overlay {
7248
+ position: absolute;
7249
+ inset: 0;
7250
+ z-index: 20;
7251
+ display: flex;
7252
+ align-items: center;
7253
+ justify-content: center;
7254
+ flex-direction: column;
7255
+ gap: 10px;
7256
+ /* Frosted, mostly-opaque surface so the chat content behind is masked
7257
+ and doesn't clash with the overlay label. */
7258
+ background: rgba(255, 255, 255, 0.92);
7259
+ backdrop-filter: blur(3px);
7260
+ border: 2px dashed var(--kr-chatbot-primary);
7261
+ border-radius: 16px;
7262
+ color: var(--kr-chatbot-primary);
7263
+ font-weight: 600;
7264
+ font-size: 15px;
7265
+ pointer-events: none;
7266
+ }
7267
+
7268
+ .drop-overlay svg {
7269
+ width: 32px;
7270
+ height: 32px;
7271
+ }
7272
+
6904
7273
  `;
6905
7274
  __decorate([
6906
7275
  n({ attribute: false })
@@ -6929,6 +7298,13 @@ __decorate([
6929
7298
  reflect: true
6930
7299
  })
6931
7300
  ], KRChatbot.prototype, "opened", void 0);
7301
+ __decorate([
7302
+ n({
7303
+ type: Boolean,
7304
+ attribute: 'hide-toggle',
7305
+ reflect: true
7306
+ })
7307
+ ], KRChatbot.prototype, "hideToggle", void 0);
6932
7308
  __decorate([
6933
7309
  r()
6934
7310
  ], KRChatbot.prototype, "_inputValue", void 0);
@@ -6941,6 +7317,12 @@ __decorate([
6941
7317
  __decorate([
6942
7318
  r()
6943
7319
  ], KRChatbot.prototype, "_error", void 0);
7320
+ __decorate([
7321
+ r()
7322
+ ], KRChatbot.prototype, "_pendingAttachments", void 0);
7323
+ __decorate([
7324
+ r()
7325
+ ], KRChatbot.prototype, "_isDraggingFile", void 0);
6944
7326
  __decorate([
6945
7327
  e$3('.panel')
6946
7328
  ], KRChatbot.prototype, "_panelEl", void 0);
@@ -6950,8 +7332,11 @@ __decorate([
6950
7332
  __decorate([
6951
7333
  e$3('.input')
6952
7334
  ], KRChatbot.prototype, "_inputEl", void 0);
7335
+ __decorate([
7336
+ e$3('.file-input')
7337
+ ], KRChatbot.prototype, "_fileInputEl", void 0);
6953
7338
  KRChatbot = __decorate([
6954
- t$1('kr-chatbot')
7339
+ t$2('kr-chatbot')
6955
7340
  ], KRChatbot);
6956
7341
 
6957
7342
  export { KRChatbot, KRRouter, KRRouterOutlet, KRScaffold, KRScreenDetail, KRScreenNav, KRSubbar };