@blotoutio/providers-shop-gpt-sdk 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/index.cjs.js +633 -143
  2. package/index.js +633 -143
  3. package/index.mjs +633 -143
  4. package/package.json +1 -1
package/index.js CHANGED
@@ -430,11 +430,34 @@ var ProvidersShopGptSdk = (function () {
430
430
  const data = (await response.json());
431
431
  return data;
432
432
  };
433
+ const deleteSingleThread = async (threadId) => {
434
+ const response = await fetchImpl(getURL('/thread'), {
435
+ method: 'DELETE',
436
+ headers: getHeaders(),
437
+ credentials: 'include',
438
+ body: JSON.stringify({ threadId }),
439
+ });
440
+ if (!response.ok) {
441
+ throw new Error(`Failed to delete chat threads - ${response.status}: ${await response.text()}`);
442
+ }
443
+ };
444
+ const deleteAllThreads = async () => {
445
+ const response = await fetchImpl(getURL('/delete-threads'), {
446
+ method: 'DELETE',
447
+ headers: getHeaders(),
448
+ credentials: 'include',
449
+ });
450
+ if (!response.ok) {
451
+ throw new Error(`Failed to delete all chat threads - ${response.status}: ${await response.text()}`);
452
+ }
453
+ };
433
454
  return {
434
455
  processQuery,
435
456
  fetchChatHistory,
436
457
  fetchChatThreads,
437
458
  createChatThread,
459
+ deleteSingleThread,
460
+ deleteAllThreads,
438
461
  };
439
462
  };
440
463
 
@@ -551,52 +574,58 @@ var ProvidersShopGptSdk = (function () {
551
574
  * Copyright 2019 Google LLC
552
575
  * SPDX-License-Identifier: BSD-3-Clause
553
576
  */
554
- const t$3=globalThis,e$6=t$3.ShadowRoot&&(void 0===t$3.ShadyCSS||t$3.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$2=Symbol(),o$4=new WeakMap;let n$3 = class n{constructor(t,e,o){if(this._$cssResult$=!0,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$6&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$4.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$4.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$3=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,s,o)=>e+(t=>{if(!0===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$6)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$6?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$4(e)})(t):t;
577
+ const t$4=globalThis,e$8=t$4.ShadowRoot&&(void 0===t$4.ShadyCSS||t$4.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$2=Symbol(),o$5=new WeakMap;let n$4 = class n{constructor(t,e,o){if(this._$cssResult$=!0,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$8&&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$6=t=>new n$4("string"==typeof t?t:t+"",void 0,s$2),i$3=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,s,o)=>e+(t=>{if(!0===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$2)},S$1=(s,o)=>{if(e$8)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$2=e$8?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$6(e)})(t):t;
555
578
 
556
579
  /**
557
580
  * @license
558
581
  * Copyright 2017 Google LLC
559
582
  * SPDX-License-Identifier: BSD-3-Clause
560
- */const{is:i$2,defineProperty:e$5,getOwnPropertyDescriptor:r$3,getOwnPropertyNames:h$1,getOwnPropertySymbols:o$3,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$2(t,s),y$1={attribute:!0,type:String,converter:u$1,reflect:!1,hasChanged:f$1};Symbol.metadata??=Symbol("metadata"),a$1.litPropertyMetadata??=new WeakMap;let b$1 = class b 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=y$1){if(s.state&&(s.attribute=!1),this._$Ei(),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,s);void 0!==r&&e$5(this.prototype,t,r);}}static getPropertyDescriptor(t,s,i){const{get:e,set:h}=r$3(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get(){return e?.call(this)},set(s){const r=e?.call(this);h.call(this,s),this.requestUpdate(t,r,i);},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??y$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=!0,this._$Ei(),this.hasOwnProperty(d$1("properties"))){const t=this.properties,s=[...h$1(t),...o$3(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 !1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,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(!0),this._$EO?.forEach((t=>t.hostConnected?.()));}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()));}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$EC(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:u$1).toAttribute(s,i.type);this._$Em=t,null==r?this.removeAttribute(e):this.setAttribute(e,r),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),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u$1;this._$Em=e,this[e]=r.fromAttribute(s,t.type),this._$Em=null;}}requestUpdate(t,s,i){if(void 0!==t){if(i??=this.constructor.getPropertyOptions(t),!(i.hasChanged??f$1)(this[t],s))return;this.P(t,s,i);}!1===this.isUpdatePending&&(this._$ES=this._$ET());}P(t,s,i){this._$AL.has(t)||this._$AL.set(t,s),!0===i.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t);}async _$ET(){this.isUpdatePending=!0;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)!0!==i.wrapped||this._$AL.has(s)||void 0===this[s]||this.P(s,this[s],i);}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EU();}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(s);}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t);}_$EU(){this._$AL=new Map,this.isUpdatePending=!1;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return !0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU();}updated(t){}firstUpdated(t){}};b$1.elementStyles=[],b$1.shadowRootOptions={mode:"open"},b$1[d$1("elementProperties")]=new Map,b$1[d$1("finalized")]=new Map,p$1?.({ReactiveElement:b$1}),(a$1.reactiveElementVersions??=[]).push("2.0.4");
583
+ */const{is:i$2,defineProperty:e$7,getOwnPropertyDescriptor:r$5,getOwnPropertyNames:h$1,getOwnPropertySymbols:o$4,getPrototypeOf:n$3}=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$2(t,s),y$1={attribute:!0,type:String,converter:u$1,reflect:!1,hasChanged:f$1};Symbol.metadata??=Symbol("metadata"),a$1.litPropertyMetadata??=new WeakMap;let b$1 = class b 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=y$1){if(s.state&&(s.attribute=!1),this._$Ei(),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,s);void 0!==r&&e$7(this.prototype,t,r);}}static getPropertyDescriptor(t,s,i){const{get:e,set:h}=r$5(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get(){return e?.call(this)},set(s){const r=e?.call(this);h.call(this,s),this.requestUpdate(t,r,i);},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??y$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=!0,this._$Ei(),this.hasOwnProperty(d$1("properties"))){const t=this.properties,s=[...h$1(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 !1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,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(!0),this._$EO?.forEach((t=>t.hostConnected?.()));}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()));}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$EC(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:u$1).toAttribute(s,i.type);this._$Em=t,null==r?this.removeAttribute(e):this.setAttribute(e,r),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),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u$1;this._$Em=e,this[e]=r.fromAttribute(s,t.type),this._$Em=null;}}requestUpdate(t,s,i){if(void 0!==t){if(i??=this.constructor.getPropertyOptions(t),!(i.hasChanged??f$1)(this[t],s))return;this.P(t,s,i);}!1===this.isUpdatePending&&(this._$ES=this._$ET());}P(t,s,i){this._$AL.has(t)||this._$AL.set(t,s),!0===i.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t);}async _$ET(){this.isUpdatePending=!0;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)!0!==i.wrapped||this._$AL.has(s)||void 0===this[s]||this.P(s,this[s],i);}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EU();}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(s);}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t);}_$EU(){this._$AL=new Map,this.isUpdatePending=!1;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return !0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU();}updated(t){}firstUpdated(t){}};b$1.elementStyles=[],b$1.shadowRootOptions={mode:"open"},b$1[d$1("elementProperties")]=new Map,b$1[d$1("finalized")]=new Map,p$1?.({ReactiveElement:b$1}),(a$1.reactiveElementVersions??=[]).push("2.0.4");
561
584
 
562
585
  /**
563
586
  * @license
564
587
  * Copyright 2017 Google LLC
565
588
  * SPDX-License-Identifier: BSD-3-Clause
566
589
  */
567
- const t$2=globalThis,i$1=t$2.trustedTypes,s$1=i$1?i$1.createPolicy("lit-html",{createHTML:t=>t}):void 0,e$4="$lit$",h=`lit$${Math.random().toFixed(9).slice(2)}$`,o$2="?"+h,n$1=`<${o$2}>`,r$2=document,l=()=>r$2.createComment(""),c=t=>null===t||"object"!=typeof t&&"function"!=typeof t,a=Array.isArray,u=t=>a(t)||"function"==typeof t?.[Symbol.iterator],d="[ \t\n\f\r]",f=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,_=/>/g,m=RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),p=/'/g,g=/"/g,$=/^(?:script|style|textarea|title)$/i,y=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x=y(1),b=y(2),w=Symbol.for("lit-noChange"),T=Symbol.for("lit-nothing"),A=new WeakMap,E=r$2.createTreeWalker(r$2,129);function C(t,i){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s$1?s$1.createHTML(i):i}const P=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?"<svg>":"",c=f;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,y=0;for(;y<s.length&&(c.lastIndex=y,u=c.exec(s),null!==u);)y=c.lastIndex,c===f?"!--"===u[1]?c=v:void 0!==u[1]?c=_:void 0!==u[2]?($.test(u[2])&&(r=RegExp("</"+u[2],"g")),c=m):void 0!==u[3]&&(c=m):c===m?">"===u[0]?(c=r??f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?m:'"'===u[3]?g:p):c===g||c===p?c=m:c===v||c===_?c=f:(c=m,r=void 0);const x=c===m&&t[i+1].startsWith("/>")?" ":"";l+=c===f?s+n$1:d>=0?(o.push(a),s.slice(0,d)+e$4+s.slice(d)+h+x):s+h+(-2===d?i:x);}return [C(t,l+(t[s]||"<?>")+(2===i?"</svg>":"")),o]};class V{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=P(t,s);if(this.el=V.createElement(f,n),E.currentNode=this.el.content,2===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes);}for(;null!==(r=E.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(e$4)){const i=v[a++],s=r.getAttribute(t).split(h),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:c,name:e[2],strings:s,ctor:"."===e[1]?k:"?"===e[1]?H:"@"===e[1]?I:R}),r.removeAttribute(t);}else t.startsWith(h)&&(d.push({type:6,index:c}),r.removeAttribute(t));if($.test(r.tagName)){const t=r.textContent.split(h),s=t.length-1;if(s>0){r.textContent=i$1?i$1.emptyScript:"";for(let i=0;i<s;i++)r.append(t[i],l()),E.nextNode(),d.push({type:2,index:++c});r.append(t[s],l());}}}else if(8===r.nodeType)if(r.data===o$2)d.push({type:2,index:c});else {let t=-1;for(;-1!==(t=r.data.indexOf(h,t+1));)d.push({type:7,index:c}),t+=h.length-1;}c++;}}static createElement(t,i){const s=r$2.createElement("template");return s.innerHTML=t,s}}function N(t,i,s=t,e){if(i===w)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=c(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(!1),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=N(t,h._$AS(t,i.values),h,e)),i}class S{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??r$2).importNode(i,!0);E.currentNode=e;let h=E.nextNode(),o=0,n=0,l=s[0];for(;void 0!==l;){if(o===l.index){let i;2===l.type?i=new M(h,h.nextSibling,this,t):1===l.type?i=new l.ctor(h,l.name,l.strings,this,t):6===l.type&&(i=new L(h,this,t)),this._$AV.push(i),l=s[++n];}o!==l?.index&&(h=E.nextNode(),o++);}return E.currentNode=r$2,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 M{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=T,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??!0;}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=N(this,t,i),c(t)?t===T||null==t||""===t?(this._$AH!==T&&this._$AR(),this._$AH=T):t!==this._$AH&&t!==w&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):u(t)?this.k(t):this._(t);}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t));}_(t){this._$AH!==T&&c(this._$AH)?this._$AA.nextSibling.data=t:this.T(r$2.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=V.createElement(C(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else {const t=new S(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t;}}_$AC(t){let i=A.get(t.strings);return void 0===i&&A.set(t.strings,i=new V(t)),i}k(t){a(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 M(this.S(l()),this.S(l()),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,i){for(this._$AP?.(!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i;}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t));}}class R{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=T,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=T;}_$AI(t,i=this,s,e){const h=this.strings;let o=!1;if(void 0===h)t=N(this,t,i,0),o=!c(t)||t!==this._$AH&&t!==w,o&&(this._$AH=t);else {const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=N(this,e[s+n],i,n),r===w&&(r=this._$AH[n]),o||=!c(r)||r!==this._$AH[n],r===T?t=T:t!==T&&(t+=(r??"")+h[n+1]),this._$AH[n]=r;}o&&!e&&this.j(t);}j(t){t===T?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}}class k extends R{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===T?void 0:t;}}class H extends R{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==T);}}class I extends R{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5;}_$AI(t,i=this){if((t=N(this,t,i,0)??T)===w)return;const s=this._$AH,e=t===T&&s!==T||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==T&&(s===T||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 L{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){N(this,t);}}const Z=t$2.litHtmlPolyfillSupport;Z?.(V,M),(t$2.litHtmlVersions??=[]).push("3.1.3");const j=(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 M(i.insertBefore(l(),t),t,void 0,s??{});}return h._$AI(t),h};
590
+ const t$3=globalThis,i$1=t$3.trustedTypes,s$1=i$1?i$1.createPolicy("lit-html",{createHTML:t=>t}):void 0,e$6="$lit$",h=`lit$${Math.random().toFixed(9).slice(2)}$`,o$3="?"+h,n$2=`<${o$3}>`,r$4=document,l=()=>r$4.createComment(""),c=t=>null===t||"object"!=typeof t&&"function"!=typeof t,a=Array.isArray,u=t=>a(t)||"function"==typeof t?.[Symbol.iterator],d="[ \t\n\f\r]",f=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,_=/>/g,m=RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),p=/'/g,g=/"/g,$=/^(?:script|style|textarea|title)$/i,y=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x=y(1),b=y(2),w=Symbol.for("lit-noChange"),T=Symbol.for("lit-nothing"),A=new WeakMap,E=r$4.createTreeWalker(r$4,129);function C(t,i){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s$1?s$1.createHTML(i):i}const P=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?"<svg>":"",c=f;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,y=0;for(;y<s.length&&(c.lastIndex=y,u=c.exec(s),null!==u);)y=c.lastIndex,c===f?"!--"===u[1]?c=v:void 0!==u[1]?c=_:void 0!==u[2]?($.test(u[2])&&(r=RegExp("</"+u[2],"g")),c=m):void 0!==u[3]&&(c=m):c===m?">"===u[0]?(c=r??f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?m:'"'===u[3]?g:p):c===g||c===p?c=m:c===v||c===_?c=f:(c=m,r=void 0);const x=c===m&&t[i+1].startsWith("/>")?" ":"";l+=c===f?s+n$2:d>=0?(o.push(a),s.slice(0,d)+e$6+s.slice(d)+h+x):s+h+(-2===d?i:x);}return [C(t,l+(t[s]||"<?>")+(2===i?"</svg>":"")),o]};class V{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=P(t,s);if(this.el=V.createElement(f,n),E.currentNode=this.el.content,2===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes);}for(;null!==(r=E.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(e$6)){const i=v[a++],s=r.getAttribute(t).split(h),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:c,name:e[2],strings:s,ctor:"."===e[1]?k:"?"===e[1]?H:"@"===e[1]?I:R}),r.removeAttribute(t);}else t.startsWith(h)&&(d.push({type:6,index:c}),r.removeAttribute(t));if($.test(r.tagName)){const t=r.textContent.split(h),s=t.length-1;if(s>0){r.textContent=i$1?i$1.emptyScript:"";for(let i=0;i<s;i++)r.append(t[i],l()),E.nextNode(),d.push({type:2,index:++c});r.append(t[s],l());}}}else if(8===r.nodeType)if(r.data===o$3)d.push({type:2,index:c});else {let t=-1;for(;-1!==(t=r.data.indexOf(h,t+1));)d.push({type:7,index:c}),t+=h.length-1;}c++;}}static createElement(t,i){const s=r$4.createElement("template");return s.innerHTML=t,s}}function N(t,i,s=t,e){if(i===w)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=c(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(!1),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=N(t,h._$AS(t,i.values),h,e)),i}class S{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??r$4).importNode(i,!0);E.currentNode=e;let h=E.nextNode(),o=0,n=0,l=s[0];for(;void 0!==l;){if(o===l.index){let i;2===l.type?i=new M(h,h.nextSibling,this,t):1===l.type?i=new l.ctor(h,l.name,l.strings,this,t):6===l.type&&(i=new L(h,this,t)),this._$AV.push(i),l=s[++n];}o!==l?.index&&(h=E.nextNode(),o++);}return E.currentNode=r$4,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 M{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=T,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??!0;}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=N(this,t,i),c(t)?t===T||null==t||""===t?(this._$AH!==T&&this._$AR(),this._$AH=T):t!==this._$AH&&t!==w&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):u(t)?this.k(t):this._(t);}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t));}_(t){this._$AH!==T&&c(this._$AH)?this._$AA.nextSibling.data=t:this.T(r$4.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=V.createElement(C(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else {const t=new S(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t;}}_$AC(t){let i=A.get(t.strings);return void 0===i&&A.set(t.strings,i=new V(t)),i}k(t){a(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 M(this.S(l()),this.S(l()),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,i){for(this._$AP?.(!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i;}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t));}}class R{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=T,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=T;}_$AI(t,i=this,s,e){const h=this.strings;let o=!1;if(void 0===h)t=N(this,t,i,0),o=!c(t)||t!==this._$AH&&t!==w,o&&(this._$AH=t);else {const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=N(this,e[s+n],i,n),r===w&&(r=this._$AH[n]),o||=!c(r)||r!==this._$AH[n],r===T?t=T:t!==T&&(t+=(r??"")+h[n+1]),this._$AH[n]=r;}o&&!e&&this.j(t);}j(t){t===T?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}}class k extends R{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===T?void 0:t;}}class H extends R{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==T);}}class I extends R{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5;}_$AI(t,i=this){if((t=N(this,t,i,0)??T)===w)return;const s=this._$AH,e=t===T&&s!==T||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==T&&(s===T||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 L{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){N(this,t);}}const Z=t$3.litHtmlPolyfillSupport;Z?.(V,M),(t$3.litHtmlVersions??=[]).push("3.1.3");const j=(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 M(i.insertBefore(l(),t),t,void 0,s??{});}return h._$AI(t),h};
568
591
 
569
592
  /**
570
593
  * @license
571
594
  * Copyright 2017 Google LLC
572
595
  * SPDX-License-Identifier: BSD-3-Clause
573
- */class s extends b$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 i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=j(i,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1);}render(){return w}}s._$litElement$=!0,s[("finalized")]=!0,globalThis.litElementHydrateSupport?.({LitElement:s});const r$1=globalThis.litElementPolyfillSupport;r$1?.({LitElement:s});(globalThis.litElementVersions??=[]).push("4.0.5");
596
+ */class s extends b$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 i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=j(i,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1);}render(){return w}}s._$litElement$=!0,s[("finalized")]=!0,globalThis.litElementHydrateSupport?.({LitElement:s});const r$3=globalThis.litElementPolyfillSupport;r$3?.({LitElement:s});(globalThis.litElementVersions??=[]).push("4.0.5");
574
597
 
575
598
  /**
576
599
  * @license
577
600
  * Copyright 2017 Google LLC
578
601
  * SPDX-License-Identifier: BSD-3-Clause
579
602
  */
580
- const t$1=t=>(e,o)=>{void 0!==o?o.addInitializer((()=>{customElements.define(t,e);})):customElements.define(t,e);};
603
+ const t$2=t=>(e,o)=>{void 0!==o?o.addInitializer((()=>{customElements.define(t,e);})):customElements.define(t,e);};
581
604
 
582
605
  /**
583
606
  * @license
584
607
  * Copyright 2017 Google LLC
585
608
  * SPDX-License-Identifier: BSD-3-Clause
586
- */const o$1={attribute:!0,type:String,converter:u$1,reflect:!1,hasChanged:f$1},r=(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),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);},init(e){return void 0!==e&&this.P(o,void 0,t),e}}}if("setter"===n){const{name:o}=r;return function(r){const n=this[o];e.call(this,r),this.requestUpdate(o,n,t);}}throw Error("Unsupported decorator location: "+n)};function n(t){return (e,o)=>"object"==typeof o?r(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,r?{...t,wrapped:!0}:t),r?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)}
609
+ */const o$2={attribute:!0,type:String,converter:u$1,reflect:!1,hasChanged:f$1},r$2=(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),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);},init(e){return void 0!==e&&this.P(o,void 0,t),e}}}if("setter"===n){const{name:o}=r;return function(r){const n=this[o];e.call(this,r),this.requestUpdate(o,n,t);}}throw Error("Unsupported decorator location: "+n)};function n$1(t){return (e,o)=>"object"==typeof o?r$2(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,r?{...t,wrapped:!0}:t),r?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)}
610
+
611
+ /**
612
+ * @license
613
+ * Copyright 2017 Google LLC
614
+ * SPDX-License-Identifier: BSD-3-Clause
615
+ */function r$1(r){return n$1({...r,state:!0,attribute:!1})}
587
616
 
588
617
  /**
589
618
  * @license
590
619
  * Copyright 2017 Google LLC
591
620
  * SPDX-License-Identifier: BSD-3-Clause
592
621
  */
593
- const e$3=(e,t,c)=>(c.configurable=!0,c.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,c),c);
622
+ const e$5=(e,t,c)=>(c.configurable=!0,c.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,c),c);
594
623
 
595
624
  /**
596
625
  * @license
597
626
  * Copyright 2017 Google LLC
598
627
  * SPDX-License-Identifier: BSD-3-Clause
599
- */function e$2(e,r){return (n,s,i)=>{const o=t=>t.renderRoot?.querySelector(e)??null;if(r){const{get:e,set:r}="object"==typeof s?n:i??(()=>{const t=Symbol();return {get(){return this[t]},set(e){this[t]=e;}}})();return e$3(n,s,{get(){let t=e.call(this);return void 0===t&&(t=o(this),(null!==t||this.hasUpdated)&&r.call(this,t)),t}})}return e$3(n,s,{get(){return o(this)}})}}
628
+ */function e$4(e,r){return (n,s,i)=>{const o=t=>t.renderRoot?.querySelector(e)??null;if(r){const{get:e,set:r}="object"==typeof s?n:i??(()=>{const t=Symbol();return {get(){return this[t]},set(e){this[t]=e;}}})();return e$5(n,s,{get(){let t=e.call(this);return void 0===t&&(t=o(this),(null!==t||this.hasUpdated)&&r.call(this,t)),t}})}return e$5(n,s,{get(){return o(this)}})}}
600
629
 
601
630
  const scrollBarStyles = i$3 `
602
631
  ::-webkit-scrollbar {
@@ -646,7 +675,6 @@ var ProvidersShopGptSdk = (function () {
646
675
  bottom: 28px;
647
676
  height: 80%;
648
677
  width: 35%;
649
- min-height: 620px;
650
678
  min-width: 475px;
651
679
  border-radius: 10px;
652
680
  overflow: hidden;
@@ -730,20 +758,20 @@ var ProvidersShopGptSdk = (function () {
730
758
  * Copyright 2017 Google LLC
731
759
  * SPDX-License-Identifier: BSD-3-Clause
732
760
  */
733
- const t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e$1=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)}}
761
+ const t$1={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e$3=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)}}
734
762
 
735
763
  /**
736
764
  * @license
737
765
  * Copyright 2018 Google LLC
738
766
  * SPDX-License-Identifier: BSD-3-Clause
739
- */const e=e$1(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 w}});
767
+ */const e$2=e$3(class extends i{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 w}});
740
768
 
741
769
  /**
742
770
  * @license
743
771
  * Copyright 2021 Google LLC
744
772
  * SPDX-License-Identifier: BSD-3-Clause
745
773
  */
746
- function*o(o,f){if(void 0!==o){let i=0;for(const t of o)yield f(t,i++);}}
774
+ function*o$1(o,f){if(void 0!==o){let i=0;for(const t of o)yield f(t,i++);}}
747
775
 
748
776
  const sendFilledIcon = b `
749
777
  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
@@ -757,6 +785,9 @@ var ProvidersShopGptSdk = (function () {
757
785
  </defs>
758
786
  </svg>
759
787
  `;
788
+ const trashIcon = b `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
789
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M6.75 1.125H11.25V2.25H6.75V1.125ZM2.25 3.375V4.5H3.375V15.75C3.375 16.0484 3.49353 16.3345 3.7045 16.5455C3.91548 16.7565 4.20163 16.875 4.5 16.875H13.5C13.7984 16.875 14.0845 16.7565 14.2955 16.5455C14.5065 16.3345 14.625 16.0484 14.625 15.75V4.5H15.75V3.375H2.25ZM4.5 15.75V4.5H13.5V15.75H4.5ZM6.75 6.75H7.875V13.5H6.75V6.75ZM10.125 6.75H11.25V13.5H10.125V6.75Z" fill="#A3B2C6"/>
790
+ </svg>`;
760
791
  const chatIcon = b `<svg focusable="false" preserveAspectRatio="xMidYMid meet" fill="currentColor" width="16" height="16" viewBox="0 0 32 32" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><path d="M16 19a6.9908 6.9908 0 01-5.833-3.1287l1.666-1.1074a5.0007 5.0007 0 008.334 0l1.666 1.1074A6.9908 6.9908 0 0116 19zM20 8a2 2 0 102 2A1.9806 1.9806 0 0020 8zM12 8a2 2 0 102 2A1.9806 1.9806 0 0012 8z"></path><path d="M17.7358,30,16,29l4-7h6a1.9966,1.9966,0,0,0,2-2V6a1.9966,1.9966,0,0,0-2-2H6A1.9966,1.9966,0,0,0,4,6V20a1.9966,1.9966,0,0,0,2,2h9v2H6a3.9993,3.9993,0,0,1-4-4V6A3.9988,3.9988,0,0,1,6,2H26a3.9988,3.9988,0,0,1,4,4V20a3.9993,3.9993,0,0,1-4,4H21.1646Z"></path></svg>`;
761
792
  const botIcon = b `
762
793
  <svg xmlns="http://www.w3.org/2000/svg" width="12" height="18" viewBox="0 0 12 18" fill="none">
@@ -897,6 +928,37 @@ var ProvidersShopGptSdk = (function () {
897
928
  flex: 1;
898
929
  overflow-y: auto;
899
930
  overflow-x: hidden;
931
+
932
+ .thread-wrapper {
933
+ display: flex;
934
+ justify-content: space-between;
935
+ align-items: center;
936
+
937
+ .trash-icon {
938
+ display: none;
939
+ padding: 2px;
940
+ cursor: pointer;
941
+
942
+ &:hover {
943
+ border-radius: 5px;
944
+ background: #dc3545;
945
+
946
+ path {
947
+ fill: white;
948
+ }
949
+ }
950
+ }
951
+
952
+ &:hover {
953
+ background: #f1f4f880;
954
+
955
+ .trash-icon {
956
+ display: flex;
957
+ justify-content: center;
958
+ align-items: center;
959
+ }
960
+ }
961
+ }
900
962
  }
901
963
 
902
964
  .thread-title {
@@ -906,12 +968,12 @@ var ProvidersShopGptSdk = (function () {
906
968
  cursor: pointer;
907
969
  }
908
970
 
909
- .thread-title.active {
971
+ .thread-wrapper.active {
910
972
  border-radius: 5px;
911
973
  background: #f1f4f8;
912
974
  }
913
975
 
914
- .thread-title.disabled {
976
+ .thread-wrapper.disabled {
915
977
  cursor: not-allowed;
916
978
  }
917
979
  }
@@ -974,13 +1036,31 @@ var ProvidersShopGptSdk = (function () {
974
1036
  `,
975
1037
  ];
976
1038
  LoadSpinner = __decorate([
977
- t$1('load-spinner')
1039
+ t$2('load-spinner')
978
1040
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
979
1041
  ], LoadSpinner);
980
1042
 
981
1043
  let ChatThreads =
982
1044
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
983
1045
  class ChatThreads extends s {
1046
+ getDomain() {
1047
+ var _a;
1048
+ if ((_a = this.merchantUrl) === null || _a === void 0 ? void 0 : _a.startsWith('https://')) {
1049
+ return this.merchantUrl;
1050
+ }
1051
+ return `https://${this.merchantUrl}`;
1052
+ }
1053
+ handleThreadDelete() {
1054
+ if (!this.deleteThreadId) {
1055
+ return;
1056
+ }
1057
+ this.dispatchEvent(new CustomEvent('delete-thread', {
1058
+ detail: { threadId: this.deleteThreadId },
1059
+ composed: true,
1060
+ bubbles: true,
1061
+ }));
1062
+ this.deleteThreadId = '';
1063
+ }
984
1064
  renderChatThreads() {
985
1065
  if (this.isLoading) {
986
1066
  return x `<div class="history">
@@ -993,21 +1073,36 @@ var ProvidersShopGptSdk = (function () {
993
1073
  <p class="title">History</p>
994
1074
  ${this.chatThreads.size
995
1075
  ? x `<div class="threads">
996
- ${o(this.chatThreads.values(), (thread) => x `
1076
+ ${o$1(this.chatThreads.values(), (thread) => x `
997
1077
  <div
998
- class=${e({
999
- 'thread-title': true,
1078
+ class=${e$2({
1079
+ 'thread-wrapper': true,
1000
1080
  active: this.selectedThreadId === thread.threadId,
1001
1081
  disabled: this.isTyping,
1002
1082
  })}
1003
- @click=${async () => {
1083
+ >
1084
+ <div
1085
+ class="thread-title"
1086
+ @click=${async () => {
1004
1087
  if (this.isLoading || this.isTyping) {
1005
1088
  return;
1006
1089
  }
1007
1090
  await this.setSelectedThreadId(thread.threadId);
1008
1091
  }}
1009
- >
1010
- ${thread.title || 'New Search'}
1092
+ >
1093
+ ${thread.title || 'New Search'}
1094
+ </div>
1095
+ <div
1096
+ class="trash-icon"
1097
+ @click=${() => {
1098
+ if (this.isLoading || this.isTyping) {
1099
+ return;
1100
+ }
1101
+ this.deleteThreadId = thread.threadId;
1102
+ }}
1103
+ >
1104
+ ${trashIcon}
1105
+ </div>
1011
1106
  </div>
1012
1107
  `)}
1013
1108
  </div>`
@@ -1015,13 +1110,6 @@ var ProvidersShopGptSdk = (function () {
1015
1110
  </div>
1016
1111
  `;
1017
1112
  }
1018
- getDomain() {
1019
- var _a;
1020
- if ((_a = this.merchantUrl) === null || _a === void 0 ? void 0 : _a.startsWith('https://')) {
1021
- return this.merchantUrl;
1022
- }
1023
- return `https://${this.merchantUrl}`;
1024
- }
1025
1113
  render() {
1026
1114
  return x `
1027
1115
  <div class="shop-gpt-icon">${shopGPTIcon}</div>
@@ -1041,32 +1129,50 @@ var ProvidersShopGptSdk = (function () {
1041
1129
  </a>
1042
1130
  </div>`
1043
1131
  : T}
1132
+ ${this.deleteThreadId
1133
+ ? x `
1134
+ <confirm-dialog
1135
+ @accept=${this.handleThreadDelete}
1136
+ @decline=${() => (this.deleteThreadId = '')}
1137
+ >
1138
+ <h2 slot="title">Delete Thread?</h2>
1139
+ <p slot="content">
1140
+ This action cannot be undone. Are you sure you want to delete
1141
+ <b>"${this.chatThreads.get(this.deleteThreadId).title}"</b>?
1142
+ </p>
1143
+ </confirm-dialog>
1144
+ `
1145
+ : T}
1044
1146
  `;
1045
1147
  }
1046
1148
  };
1047
1149
  ChatThreads.styles = [chatThreadsStyles];
1048
1150
  __decorate([
1049
- n({ type: Object }),
1151
+ n$1({ type: Object }),
1050
1152
  __metadata("design:type", Map)
1051
1153
  ], ChatThreads.prototype, "chatThreads", void 0);
1052
1154
  __decorate([
1053
- n({ type: String }),
1155
+ n$1({ type: String }),
1054
1156
  __metadata("design:type", Object)
1055
1157
  ], ChatThreads.prototype, "merchantUrl", void 0);
1056
1158
  __decorate([
1057
- n({ type: Boolean }),
1159
+ n$1({ type: Boolean }),
1058
1160
  __metadata("design:type", Boolean)
1059
1161
  ], ChatThreads.prototype, "isLoading", void 0);
1060
1162
  __decorate([
1061
- n({ type: Boolean }),
1163
+ n$1({ type: Boolean }),
1062
1164
  __metadata("design:type", Boolean)
1063
1165
  ], ChatThreads.prototype, "isTyping", void 0);
1064
1166
  __decorate([
1065
- n({ type: String }),
1167
+ n$1({ type: String }),
1066
1168
  __metadata("design:type", String)
1067
1169
  ], ChatThreads.prototype, "selectedThreadId", void 0);
1170
+ __decorate([
1171
+ r$1(),
1172
+ __metadata("design:type", String)
1173
+ ], ChatThreads.prototype, "deleteThreadId", void 0);
1068
1174
  ChatThreads = __decorate([
1069
- t$1('chat-threads')
1175
+ t$2('chat-threads')
1070
1176
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
1071
1177
  ], ChatThreads);
1072
1178
 
@@ -1268,6 +1374,14 @@ var ProvidersShopGptSdk = (function () {
1268
1374
  }
1269
1375
  (_a = open(url, '_blank')) === null || _a === void 0 ? void 0 : _a.focus();
1270
1376
  }
1377
+ renderVariantTitles() {
1378
+ if (!this.product.hasVariantsThatRequiresComponents) {
1379
+ return T;
1380
+ }
1381
+ return this.product.variants[0].selectedOptions.map((option) => x `
1382
+ <p class="product-variation-details">${option.name}: ${option.value}</p>
1383
+ `);
1384
+ }
1271
1385
  render() {
1272
1386
  return x `
1273
1387
  <div class="product">
@@ -1284,11 +1398,7 @@ var ProvidersShopGptSdk = (function () {
1284
1398
  >
1285
1399
  ${this.product.title}
1286
1400
  </p>
1287
- ${this.product.variants[0].selectedOptions.map((option) => x `
1288
- <p class="product-variation-details">
1289
- ${option.name}: ${option.value}
1290
- </p>
1291
- `)}
1401
+ ${this.renderVariantTitles()}
1292
1402
  <div class="prices">
1293
1403
  ${this.product.variants[0].comparedAtPrice &&
1294
1404
  this.product.variants[0].comparedAtPrice !==
@@ -1312,15 +1422,15 @@ var ProvidersShopGptSdk = (function () {
1312
1422
  };
1313
1423
  ProductItem.styles = [productItemStyles];
1314
1424
  __decorate([
1315
- n({ type: Object }),
1425
+ n$1({ type: Object }),
1316
1426
  __metadata("design:type", Object)
1317
1427
  ], ProductItem.prototype, "product", void 0);
1318
1428
  __decorate([
1319
- n({ type: Object }),
1429
+ n$1({ type: Object }),
1320
1430
  __metadata("design:type", Object)
1321
1431
  ], ProductItem.prototype, "siteCurrency", void 0);
1322
1432
  ProductItem = __decorate([
1323
- t$1('product-item')
1433
+ t$2('product-item')
1324
1434
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
1325
1435
  ], ProductItem);
1326
1436
 
@@ -1409,12 +1519,15 @@ var ProvidersShopGptSdk = (function () {
1409
1519
  (_a = this.productsEle) === null || _a === void 0 ? void 0 : _a.scrollBy({ left: 186, behavior: 'smooth' });
1410
1520
  }
1411
1521
  render() {
1522
+ if (!this.products.length) {
1523
+ return T;
1524
+ }
1412
1525
  return x `
1413
1526
  <div class="products-wrapper">
1414
1527
  <div class="products" @scroll=${this.updateButtonsState}>
1415
- ${o(this.products, (product) => x `
1528
+ ${o$1(this.products, (product) => x `
1416
1529
  <div
1417
- class=${e({
1530
+ class=${e$2({
1418
1531
  'product-container': true,
1419
1532
  modal: this.viewType === 'modal',
1420
1533
  })}
@@ -1438,27 +1551,27 @@ var ProvidersShopGptSdk = (function () {
1438
1551
  };
1439
1552
  ProductsList.styles = [productsListStyles];
1440
1553
  __decorate([
1441
- n({ type: Array }),
1554
+ n$1({ type: Array }),
1442
1555
  __metadata("design:type", Array)
1443
1556
  ], ProductsList.prototype, "products", void 0);
1444
1557
  __decorate([
1445
- n({ type: Object }),
1558
+ n$1({ type: Object }),
1446
1559
  __metadata("design:type", Object)
1447
1560
  ], ProductsList.prototype, "siteCurrency", void 0);
1448
1561
  __decorate([
1449
- e$2('.left-btn'),
1562
+ e$4('.left-btn'),
1450
1563
  __metadata("design:type", Object)
1451
1564
  ], ProductsList.prototype, "leftBtnEle", void 0);
1452
1565
  __decorate([
1453
- e$2('.right-btn'),
1566
+ e$4('.right-btn'),
1454
1567
  __metadata("design:type", Object)
1455
1568
  ], ProductsList.prototype, "rightBtnEle", void 0);
1456
1569
  __decorate([
1457
- e$2('.products'),
1570
+ e$4('.products'),
1458
1571
  __metadata("design:type", Object)
1459
1572
  ], ProductsList.prototype, "productsEle", void 0);
1460
1573
  ProductsList = __decorate([
1461
- t$1('products-list')
1574
+ t$2('products-list')
1462
1575
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
1463
1576
  ], ProductsList);
1464
1577
 
@@ -1506,31 +1619,31 @@ var ProvidersShopGptSdk = (function () {
1506
1619
  };
1507
1620
  ProductsSection.styles = [productsSectionStyles];
1508
1621
  __decorate([
1509
- n({ type: Array }),
1622
+ n$1({ type: Array }),
1510
1623
  __metadata("design:type", Array)
1511
1624
  ], ProductsSection.prototype, "products", void 0);
1512
1625
  __decorate([
1513
- n({ type: Boolean }),
1626
+ n$1({ type: Boolean }),
1514
1627
  __metadata("design:type", Boolean)
1515
1628
  ], ProductsSection.prototype, "isLoadingHistory", void 0);
1516
1629
  __decorate([
1517
- n({ type: Object }),
1630
+ n$1({ type: Object }),
1518
1631
  __metadata("design:type", Object)
1519
1632
  ], ProductsSection.prototype, "siteCurrency", void 0);
1520
1633
  __decorate([
1521
- e$2('.left-btn'),
1634
+ e$4('.left-btn'),
1522
1635
  __metadata("design:type", Object)
1523
1636
  ], ProductsSection.prototype, "leftBtnEle", void 0);
1524
1637
  __decorate([
1525
- e$2('.right-btn'),
1638
+ e$4('.right-btn'),
1526
1639
  __metadata("design:type", Object)
1527
1640
  ], ProductsSection.prototype, "rightBtnEle", void 0);
1528
1641
  __decorate([
1529
- e$2('.products'),
1642
+ e$4('.products'),
1530
1643
  __metadata("design:type", Object)
1531
1644
  ], ProductsSection.prototype, "productsEle", void 0);
1532
1645
  ProductsSection = __decorate([
1533
- t$1('products-section')
1646
+ t$2('products-section')
1534
1647
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
1535
1648
  ], ProductsSection);
1536
1649
 
@@ -1571,6 +1684,9 @@ var ProvidersShopGptSdk = (function () {
1571
1684
  font-weight: 600;
1572
1685
  line-height: 21px;
1573
1686
  text-transform: capitalize;
1687
+ white-space: nowrap;
1688
+ overflow: hidden;
1689
+ text-overflow: ellipsis;
1574
1690
  }
1575
1691
 
1576
1692
  .btn-context {
@@ -1709,6 +1825,10 @@ var ProvidersShopGptSdk = (function () {
1709
1825
  gap: 28px;
1710
1826
  padding-bottom: 10px;
1711
1827
  margin-bottom: -10px;
1828
+
1829
+ .message:last-child {
1830
+ margin-top: 10px;
1831
+ }
1712
1832
  }
1713
1833
 
1714
1834
  .message {
@@ -1926,15 +2046,28 @@ var ProvidersShopGptSdk = (function () {
1926
2046
  }
1927
2047
 
1928
2048
  .thread-title {
2049
+ display: flex;
2050
+ justify-content: space-between;
1929
2051
  padding: 10px 16px;
1930
2052
  color: #4e647f;
1931
- font-size: 14px;
1932
- font-weight: 400;
1933
- line-height: 20px;
1934
2053
  cursor: pointer;
1935
2054
 
2055
+ p {
2056
+ font-size: 14px;
2057
+ font-weight: 400;
2058
+ line-height: 20px;
2059
+ }
2060
+
2061
+ .trash-icon {
2062
+ display: none;
2063
+ }
2064
+
1936
2065
  &:hover {
1937
2066
  background: #f1f4f8;
2067
+
2068
+ .trash-icon {
2069
+ display: flex;
2070
+ }
1938
2071
  }
1939
2072
  }
1940
2073
 
@@ -1943,6 +2076,23 @@ var ProvidersShopGptSdk = (function () {
1943
2076
  }
1944
2077
  }
1945
2078
 
2079
+ .trash-icon {
2080
+ display: flex;
2081
+ justify-content: center;
2082
+ align-items: center;
2083
+ padding: 2px;
2084
+ cursor: pointer;
2085
+
2086
+ &:hover {
2087
+ border-radius: 5px;
2088
+ background: #dc3545;
2089
+
2090
+ path {
2091
+ fill: white;
2092
+ }
2093
+ }
2094
+ }
2095
+
1946
2096
  .chat-threads-background {
1947
2097
  position: absolute;
1948
2098
  top: 78px;
@@ -1961,6 +2111,16 @@ var ProvidersShopGptSdk = (function () {
1961
2111
  return str === null || str === void 0 ? void 0 : str.replace(/^\w/, (char) => char.toUpperCase());
1962
2112
  };
1963
2113
 
2114
+ const plusBtn = b `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
2115
+ <path d="M12.75 11.25V6H11.25V11.25H6V12.75H11.25V18H12.75V12.75H18V11.25H12.75Z" fill="white"/>
2116
+ </svg>`;
2117
+ const timerBtn = b `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
2118
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M6.16652 20.7304C7.89323 21.8842 9.9233 22.5 12 22.5C14.7848 22.5 17.4555 21.3938 19.4246 19.4246C21.3938 17.4555 22.5 14.7848 22.5 12C22.5 9.9233 21.8842 7.89323 20.7304 6.16652C19.5767 4.4398 17.9368 3.09399 16.0182 2.29927C14.0996 1.50455 11.9884 1.29661 9.95156 1.70176C7.91476 2.1069 6.04383 3.10693 4.57538 4.57538C3.10693 6.04383 2.1069 7.91476 1.70176 9.95156C1.29661 11.9884 1.50455 14.0996 2.29927 16.0182C3.09399 17.9368 4.4398 19.5767 6.16652 20.7304ZM6.99987 4.51678C8.47992 3.52785 10.22 3 12 3C14.387 3 16.6761 3.94822 18.364 5.63604C20.0518 7.32387 21 9.61306 21 12C21 13.78 20.4722 15.5201 19.4832 17.0001C18.4943 18.4802 17.0887 19.6337 15.4442 20.3149C13.7996 20.9961 11.99 21.1743 10.2442 20.8271C8.49836 20.4798 6.89472 19.6226 5.63604 18.364C4.37737 17.1053 3.5202 15.5016 3.17294 13.7558C2.82567 12.01 3.0039 10.2004 3.68509 8.55585C4.36628 6.91132 5.51983 5.50571 6.99987 4.51678ZM11.25 12.3075L15.4425 16.5L16.5 15.4425L12.75 11.685V5.25H11.25V12.3075Z" fill="white"/>
2119
+ </svg>`;
2120
+ const crossBtn = b `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
2121
+ <path d="M18 7.05L16.95 6L12 10.95L7.05 6L6 7.05L10.95 12L6 16.95L7.05 18L12 13.05L16.95 18L18 16.95L13.05 12L18 7.05Z" fill="white"/>
2122
+ </svg>`;
2123
+
1964
2124
  const personalizeDialogStyles = i$3 `
1965
2125
  :host {
1966
2126
  font-family: 'Inter', sans-serif;
@@ -2447,63 +2607,318 @@ var ProvidersShopGptSdk = (function () {
2447
2607
  };
2448
2608
  PersonalizeDialog.styles = [personalizeDialogStyles];
2449
2609
  __decorate([
2450
- e$2('dialog'),
2610
+ e$4('dialog'),
2451
2611
  __metadata("design:type", HTMLDialogElement)
2452
2612
  ], PersonalizeDialog.prototype, "dialogModal", void 0);
2453
2613
  __decorate([
2454
- e$2('.dropdown-list'),
2614
+ e$4('.dropdown-list'),
2455
2615
  __metadata("design:type", HTMLUListElement)
2456
2616
  ], PersonalizeDialog.prototype, "dropdownList", void 0);
2457
2617
  __decorate([
2458
- e$2('.dropdown-trigger'),
2618
+ e$4('.dropdown-trigger'),
2459
2619
  __metadata("design:type", HTMLDivElement)
2460
2620
  ], PersonalizeDialog.prototype, "dropdownTrigger", void 0);
2461
2621
  __decorate([
2462
- n({ type: Array }),
2622
+ n$1({ type: Array }),
2463
2623
  __metadata("design:type", Array)
2464
2624
  ], PersonalizeDialog.prototype, "defaultProductHandles", void 0);
2465
2625
  __decorate([
2466
- n({ type: Array }),
2626
+ n$1({ type: Array }),
2467
2627
  __metadata("design:type", Array)
2468
2628
  ], PersonalizeDialog.prototype, "defaultProfiles", void 0);
2469
2629
  __decorate([
2470
- n({ type: Boolean }),
2630
+ n$1({ type: Boolean }),
2471
2631
  __metadata("design:type", Boolean)
2472
2632
  ], PersonalizeDialog.prototype, "isLoading", void 0);
2473
2633
  __decorate([
2474
- n({ type: String }),
2634
+ n$1({ type: String }),
2475
2635
  __metadata("design:type", Object)
2476
2636
  ], PersonalizeDialog.prototype, "state", void 0);
2477
2637
  __decorate([
2478
- n({ type: String }),
2638
+ n$1({ type: String }),
2479
2639
  __metadata("design:type", Object)
2480
2640
  ], PersonalizeDialog.prototype, "profileType", void 0);
2481
2641
  __decorate([
2482
- n({ type: String }),
2642
+ n$1({ type: String }),
2483
2643
  __metadata("design:type", Object)
2484
2644
  ], PersonalizeDialog.prototype, "selectedProfile", void 0);
2485
2645
  __decorate([
2486
- n({ type: String }),
2646
+ n$1({ type: String }),
2487
2647
  __metadata("design:type", Object)
2488
2648
  ], PersonalizeDialog.prototype, "visitorType", void 0);
2489
2649
  __decorate([
2490
- n({ type: String }),
2650
+ n$1({ type: String }),
2491
2651
  __metadata("design:type", Object)
2492
2652
  ], PersonalizeDialog.prototype, "productHandle", void 0);
2493
2653
  PersonalizeDialog = __decorate([
2494
- t$1('personalize-dialog')
2654
+ t$2('personalize-dialog')
2495
2655
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
2496
2656
  ], PersonalizeDialog);
2497
2657
 
2498
- const plusBtn = b `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
2499
- <path d="M12.75 11.25V6H11.25V11.25H6V12.75H11.25V18H12.75V12.75H18V11.25H12.75Z" fill="white"/>
2500
- </svg>`;
2501
- const timerBtn = b `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
2502
- <path fill-rule="evenodd" clip-rule="evenodd" d="M6.16652 20.7304C7.89323 21.8842 9.9233 22.5 12 22.5C14.7848 22.5 17.4555 21.3938 19.4246 19.4246C21.3938 17.4555 22.5 14.7848 22.5 12C22.5 9.9233 21.8842 7.89323 20.7304 6.16652C19.5767 4.4398 17.9368 3.09399 16.0182 2.29927C14.0996 1.50455 11.9884 1.29661 9.95156 1.70176C7.91476 2.1069 6.04383 3.10693 4.57538 4.57538C3.10693 6.04383 2.1069 7.91476 1.70176 9.95156C1.29661 11.9884 1.50455 14.0996 2.29927 16.0182C3.09399 17.9368 4.4398 19.5767 6.16652 20.7304ZM6.99987 4.51678C8.47992 3.52785 10.22 3 12 3C14.387 3 16.6761 3.94822 18.364 5.63604C20.0518 7.32387 21 9.61306 21 12C21 13.78 20.4722 15.5201 19.4832 17.0001C18.4943 18.4802 17.0887 19.6337 15.4442 20.3149C13.7996 20.9961 11.99 21.1743 10.2442 20.8271C8.49836 20.4798 6.89472 19.6226 5.63604 18.364C4.37737 17.1053 3.5202 15.5016 3.17294 13.7558C2.82567 12.01 3.0039 10.2004 3.68509 8.55585C4.36628 6.91132 5.51983 5.50571 6.99987 4.51678ZM11.25 12.3075L15.4425 16.5L16.5 15.4425L12.75 11.685V5.25H11.25V12.3075Z" fill="white"/>
2503
- </svg>`;
2504
- const crossBtn = b `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
2505
- <path d="M18 7.05L16.95 6L12 10.95L7.05 6L6 7.05L10.95 12L6 16.95L7.05 18L12 13.05L16.95 18L18 16.95L13.05 12L18 7.05Z" fill="white"/>
2506
- </svg>`;
2658
+ /**
2659
+ * @license
2660
+ * Copyright 2017 Google LLC
2661
+ * SPDX-License-Identifier: BSD-3-Clause
2662
+ */let e$1 = class e extends i{constructor(i){if(super(i),this.it=T,i.type!==t$1.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(r){if(r===T||null==r)return this._t=void 0,this.it=r;if(r===w)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$3(e$1);
2663
+
2664
+ var e={"":["<em>","</em>"],_:["<strong>","</strong>"],"*":["<strong>","</strong>"],"~":["<s>","</s>"],"\n":["<br />"]," ":["<br />"],"-":["<hr />"]};function n(e){return e.replace(RegExp("^"+(e.match(/^(\t| )+/)||"")[0],"gm"),"")}function r(e){return (e+"").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function t(a,c){var o,l,g,s,p,u=/((?:^|\n+)(?:\n---+|\* \*(?: \*)+)\n)|(?:^``` *(\w*)\n([\s\S]*?)\n```$)|((?:(?:^|\n+)(?:\t| {2,}).+)+\n*)|((?:(?:^|\n)([>*+-]|\d+\.)\s+.*)+)|(?:!\[([^\]]*?)\]\(([^)]+?)\))|(\[)|(\](?:\(([^)]+?)\))?)|(?:(?:^|\n+)([^\s].*)\n(-{3,}|={3,})(?:\n+|$))|(?:(?:^|\n+)(#{1,6})\s*(.+)(?:\n+|$))|(?:`([^`].*?)`)|( \n\n*|\n{2,}|__|\*\*|[_*]|~~)/gm,m=[],h="",i=c||{},d=0;function f(n){var r=e[n[1]||""],t=m[m.length-1]==n;return r?r[1]?(t?m.pop():m.push(n),r[0|t]):r[0]:n}function $(){for(var e="";m.length;)e+=f(m[m.length-1]);return e}for(a=a.replace(/^\[(.+?)\]:\s*(.+)$/gm,function(e,n,r){return i[n.toLowerCase()]=r,""}).replace(/^\n+|\n+$/g,"");g=u.exec(a);)l=a.substring(d,g.index),d=u.lastIndex,o=g[0],l.match(/[^\\](\\\\)*\\$/)||((p=g[3]||g[4])?o='<pre class="code '+(g[4]?"poetry":g[2].toLowerCase())+'"><code'+(g[2]?' class="language-'+g[2].toLowerCase()+'"':"")+">"+n(r(p).replace(/^\n+|\n+$/g,""))+"</code></pre>":(p=g[6])?(p.match(/\./)&&(g[5]=g[5].replace(/^\d+/gm,"")),s=t(n(g[5].replace(/^\s*[>*+.-]/gm,""))),">"==p?p="blockquote":(p=p.match(/\./)?"ol":"ul",s=s.replace(/^(.*)(\n|$)/gm,"<li>$1</li>")),o="<"+p+">"+s+"</"+p+">"):g[8]?o='<img src="'+r(g[8])+'" alt="'+r(g[7])+'">':g[10]?(h=h.replace("<a>",'<a href="'+r(g[11]||i[l.toLowerCase()])+'">'),o=$()+"</a>"):g[9]?o="<a>":g[12]||g[14]?o="<"+(p="h"+(g[14]?g[14].length:g[13]>"="?1:2))+">"+t(g[12]||g[15],i)+"</"+p+">":g[16]?o="<code>"+r(g[16])+"</code>":(g[17]||g[1])&&(o=f(g[17]||"--"))),h+=l,h+=o;return (h+a.substring(d)+$()).replace(/^\n+|\n+$/g,"")}
2665
+
2666
+ let MarkdownRenderer =
2667
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2668
+ class MarkdownRenderer extends s {
2669
+ render() {
2670
+ const slotContent = this.innerHTML.trim();
2671
+ const parsedContent = t(slotContent);
2672
+ return o(parsedContent);
2673
+ }
2674
+ };
2675
+ MarkdownRenderer.styles = i$3 `
2676
+ :host {
2677
+ font-family: 'Inter', sans-serif;
2678
+ font-size: 16px;
2679
+ font-weight: 400;
2680
+
2681
+ p {
2682
+ margin: 0;
2683
+ }
2684
+ }
2685
+ `;
2686
+ MarkdownRenderer = __decorate([
2687
+ t$2('markdown-renderer')
2688
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2689
+ ], MarkdownRenderer);
2690
+
2691
+ let TooltipComponent =
2692
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2693
+ class TooltipComponent extends s {
2694
+ constructor() {
2695
+ super(...arguments);
2696
+ this.position = 'bottom-left';
2697
+ this.text = '';
2698
+ }
2699
+ render() {
2700
+ return x `
2701
+ <slot></slot>
2702
+ <div class="tooltip ${this.position}">${this.text}</div>
2703
+ `;
2704
+ }
2705
+ };
2706
+ TooltipComponent.styles = [
2707
+ i$3 `
2708
+ :host {
2709
+ position: relative;
2710
+ display: inline-block;
2711
+ }
2712
+ .tooltip {
2713
+ position: absolute;
2714
+ color: #172a41;
2715
+ padding: 4px 8px;
2716
+ border-radius: 4px;
2717
+ white-space: nowrap;
2718
+ font-size: 12px;
2719
+ opacity: 0;
2720
+ transition: opacity 0.2s;
2721
+ pointer-events: none;
2722
+
2723
+ border-radius: 5px;
2724
+ background: #ffcc81;
2725
+ box-shadow: 0px 4px 6px -1px rgba(0, 0, 0, 0.1),
2726
+ 0px 2px 4px -1px rgba(0, 0, 0, 0.06);
2727
+
2728
+ font-style: normal;
2729
+ font-weight: 400;
2730
+ line-height: 150%;
2731
+ }
2732
+ :host(:hover) .tooltip {
2733
+ opacity: 1;
2734
+ }
2735
+ .top-center {
2736
+ bottom: calc(100% + 2px);
2737
+ left: 50%;
2738
+ transform: translateX(-50%);
2739
+ }
2740
+ .top-left {
2741
+ bottom: calc(100% + 2px);
2742
+ left: 0;
2743
+ }
2744
+ .top-right {
2745
+ bottom: calc(100% + 2px);
2746
+ right: 0;
2747
+ }
2748
+ .bottom-center {
2749
+ top: calc(100% + 2px);
2750
+ left: 50%;
2751
+ transform: translateX(-50%);
2752
+ }
2753
+ .bottom-left {
2754
+ top: calc(100% + 2px);
2755
+ left: 0;
2756
+ }
2757
+ .bottom-right {
2758
+ top: calc(100% + 2px);
2759
+ right: 0;
2760
+ }
2761
+ .left-center {
2762
+ right: calc(100% + 2px);
2763
+ top: 50%;
2764
+ transform: translateY(-50%);
2765
+ }
2766
+ .left-top {
2767
+ right: calc(100% + 2px);
2768
+ top: 0;
2769
+ }
2770
+ .left-bottom {
2771
+ right: calc(100% + 2px);
2772
+ bottom: 0;
2773
+ }
2774
+ .right-center {
2775
+ left: calc(100% + 2px);
2776
+ top: 50%;
2777
+ transform: translateY(-50%);
2778
+ }
2779
+ .right-top {
2780
+ left: calc(100% + 2px);
2781
+ top: 0;
2782
+ }
2783
+ .right-bottom {
2784
+ left: calc(100% + 2px);
2785
+ bottom: 0;
2786
+ }
2787
+ `,
2788
+ ];
2789
+ __decorate([
2790
+ n$1({ type: String }),
2791
+ __metadata("design:type", String)
2792
+ ], TooltipComponent.prototype, "position", void 0);
2793
+ __decorate([
2794
+ n$1({ type: String }),
2795
+ __metadata("design:type", String)
2796
+ ], TooltipComponent.prototype, "text", void 0);
2797
+ TooltipComponent = __decorate([
2798
+ t$2('tooltip-component')
2799
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2800
+ ], TooltipComponent);
2801
+
2802
+ const confirmDialogStyles = i$3 `
2803
+ :host {
2804
+ font-family: 'Inter', sans-serif;
2805
+ font-size: 16px;
2806
+ font-weight: 400;
2807
+
2808
+ display: flex;
2809
+ position: absolute;
2810
+ top: 0;
2811
+ left: 0;
2812
+ width: 100%;
2813
+ height: 100%;
2814
+ background: #00000050;
2815
+ }
2816
+
2817
+ .modal {
2818
+ width: 75%;
2819
+ max-width: 350px;
2820
+ background: #fff;
2821
+ padding: 16px;
2822
+ margin: auto;
2823
+
2824
+ border-radius: 10px;
2825
+ box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.12),
2826
+ 0px 20px 20px 0px rgba(0, 0, 0, 0.08);
2827
+
2828
+ z-index: 2000;
2829
+ }
2830
+
2831
+ ::slotted([slot='title']) {
2832
+ margin-bottom: 8px !important;
2833
+ color: #172a41;
2834
+ font-size: 18px;
2835
+ font-weight: 700;
2836
+ line-height: 150%;
2837
+ }
2838
+
2839
+ ::slotted([slot='content']) {
2840
+ color: #4e647f;
2841
+ line-height: 150%;
2842
+ }
2843
+
2844
+ .button-wrapper {
2845
+ margin-top: 12px;
2846
+ display: flex;
2847
+ gap: 12px;
2848
+
2849
+ .btn {
2850
+ justify-self: stretch;
2851
+ padding: 10px;
2852
+ cursor: pointer;
2853
+ text-align: center;
2854
+ width: 100%;
2855
+ border: 0;
2856
+ color: #fff;
2857
+ line-height: 150%;
2858
+ text-transform: capitalize;
2859
+ }
2860
+
2861
+ .accept-btn {
2862
+ border-radius: 5px;
2863
+ background: #dc3545;
2864
+
2865
+ &:hover {
2866
+ background: rgb(176, 62, 25);
2867
+ }
2868
+ }
2869
+
2870
+ .decline-btn {
2871
+ border-radius: 5px;
2872
+ background: #4e647f;
2873
+
2874
+ &:hover {
2875
+ background: rgb(57, 77, 102);
2876
+ }
2877
+ }
2878
+ }
2879
+ `;
2880
+
2881
+ let ConfirmDialog =
2882
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2883
+ class ConfirmDialog extends s {
2884
+ onAcceptClick(e) {
2885
+ e.preventDefault();
2886
+ this.dispatchEvent(new CustomEvent('accept', {
2887
+ composed: true,
2888
+ }));
2889
+ }
2890
+ onCancelClick(e) {
2891
+ e.preventDefault();
2892
+ this.dispatchEvent(new CustomEvent('decline', {
2893
+ composed: true,
2894
+ }));
2895
+ }
2896
+ render() {
2897
+ return x `
2898
+ <div class="modal">
2899
+ <slot name="title"></slot>
2900
+ <slot name="content"></slot>
2901
+ <div class="button-wrapper">
2902
+ <slot name="accept-btn">
2903
+ <button class="btn accept-btn" @click=${this.onAcceptClick}>
2904
+ Delete
2905
+ </button>
2906
+ </slot>
2907
+ <slot name="decline-btn">
2908
+ <button class="btn decline-btn" @click=${this.onCancelClick}>
2909
+ Cancel
2910
+ </button>
2911
+ </slot>
2912
+ </div>
2913
+ </div>
2914
+ `;
2915
+ }
2916
+ };
2917
+ ConfirmDialog.styles = [confirmDialogStyles];
2918
+ ConfirmDialog = __decorate([
2919
+ t$2('confirm-dialog')
2920
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2921
+ ], ConfirmDialog);
2507
2922
 
2508
2923
  let ChatSection =
2509
2924
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -2534,6 +2949,17 @@ var ProvidersShopGptSdk = (function () {
2534
2949
  this.userQuery = '';
2535
2950
  await this.processMessage(e, message);
2536
2951
  }
2952
+ handleThreadDelete() {
2953
+ if (!this.deleteThreadId) {
2954
+ return;
2955
+ }
2956
+ this.dispatchEvent(new CustomEvent('delete-thread', {
2957
+ detail: { threadId: this.deleteThreadId },
2958
+ composed: true,
2959
+ bubbles: true,
2960
+ }));
2961
+ this.deleteThreadId = '';
2962
+ }
2537
2963
  typingIndicator() {
2538
2964
  return x `<div class="typing-dots">
2539
2965
  <div class="dot"></div>
@@ -2550,7 +2976,9 @@ var ProvidersShopGptSdk = (function () {
2550
2976
  <div class="bot-icon">${botIcon}</div>
2551
2977
  </div>
2552
2978
  <div>
2553
- ${message.message ? x `<p>${message.message}</p>` : T}
2979
+ ${message.message
2980
+ ? x `<markdown-renderer>${message.message}</markdown-renderer>`
2981
+ : T}
2554
2982
  ${this.viewType !== 'modal' && ((_a = message.products) === null || _a === void 0 ? void 0 : _a[0])
2555
2983
  ? x `
2556
2984
  <span class="line"></span>
@@ -2715,37 +3143,49 @@ var ProvidersShopGptSdk = (function () {
2715
3143
  <div>${botIcon}</div>
2716
3144
  <h2>${((_a = this.thread) === null || _a === void 0 ? void 0 : _a.title) || 'New Search'}</h2>
2717
3145
  <div class="btns-wrapper">
2718
- <button
2719
- class="btn btn-icon new-search-btn"
2720
- title="New chat"
2721
- @click=${async () => {
3146
+ <tooltip-component .position=${'bottom-right'} .text=${'New Chat'}>
3147
+ <button
3148
+ class="btn btn-icon new-search-btn"
3149
+ @click=${(e) => {
2722
3150
  var _a;
2723
- await ((_a = this.setSelectedThreadId) === null || _a === void 0 ? void 0 : _a.call(this, ''));
3151
+ e.preventDefault();
3152
+ (_a = this.setSelectedThreadId) === null || _a === void 0 ? void 0 : _a.call(this, '');
2724
3153
  }}
3154
+ >
3155
+ ${plusBtn}
3156
+ </button>
3157
+ </tooltip-component>
3158
+ <tooltip-component
3159
+ .position=${'bottom-right'}
3160
+ .text=${'Your Search History'}
2725
3161
  >
2726
- ${plusBtn}
2727
- </button>
2728
- <button
2729
- class=${e({
3162
+ <button
3163
+ class=${e$2({
2730
3164
  btn: true,
2731
3165
  'btn-icon': true,
2732
3166
  'threads-btn': true,
2733
3167
  active: this.showChatThreads,
2734
3168
  })}
2735
- title="Your Search History"
2736
- @click=${() => {
3169
+ @click=${(e) => {
3170
+ e.preventDefault();
2737
3171
  this.showChatThreads = !this.showChatThreads;
2738
3172
  }}
2739
- >
2740
- ${timerBtn}
2741
- </button>
2742
- <button
2743
- class="btn btn-icon close-btn"
2744
- title="Close chat"
2745
- @click=${() => { var _a; return (_a = this.closeModal) === null || _a === void 0 ? void 0 : _a.call(this); }}
2746
- >
2747
- ${crossBtn}
2748
- </button>
3173
+ >
3174
+ ${timerBtn}
3175
+ </button>
3176
+ </tooltip-component>
3177
+ <tooltip-component .position=${'bottom-right'} .text=${'Close Chat'}>
3178
+ <button
3179
+ class="btn btn-icon close-btn"
3180
+ @click=${(e) => {
3181
+ var _a;
3182
+ e.preventDefault();
3183
+ (_a = this.closeModal) === null || _a === void 0 ? void 0 : _a.call(this);
3184
+ }}
3185
+ >
3186
+ ${crossBtn}
3187
+ </button>
3188
+ </tooltip-component>
2749
3189
  </div>
2750
3190
  `;
2751
3191
  }
@@ -2794,23 +3234,38 @@ var ProvidersShopGptSdk = (function () {
2794
3234
  <div class="chat-threads">
2795
3235
  <h2>Your Search History</h2>
2796
3236
  <div class="thread-titles-wrapper">
2797
- ${o(this.chatThreads.values(), (thread) => x `
2798
- <p
2799
- class=${e({
3237
+ ${o$1(this.chatThreads.values(), (thread) => x `
3238
+ <div
3239
+ class=${e$2({
2800
3240
  'thread-title': true,
2801
3241
  disabled: this.isTyping,
2802
3242
  })}
2803
- @click=${async () => {
3243
+ >
3244
+ <p
3245
+ @click=${() => {
2804
3246
  var _a;
2805
3247
  if (this.isTyping) {
2806
3248
  return;
2807
3249
  }
2808
3250
  this.showChatThreads = false;
2809
- await ((_a = this.setSelectedThreadId) === null || _a === void 0 ? void 0 : _a.call(this, thread.threadId));
3251
+ (_a = this.setSelectedThreadId) === null || _a === void 0 ? void 0 : _a.call(this, thread.threadId);
2810
3252
  }}
2811
- >
2812
- ${thread.title || 'New Search'}
2813
- </p>
3253
+ >
3254
+ ${thread.title || 'New Search'}
3255
+ </p>
3256
+ <div
3257
+ class="trash-icon"
3258
+ @click=${() => {
3259
+ if (this.isTyping) {
3260
+ return;
3261
+ }
3262
+ this.deleteThreadId = thread.threadId;
3263
+ this.showChatThreads = false;
3264
+ }}
3265
+ >
3266
+ ${trashIcon}
3267
+ </div>
3268
+ </div>
2814
3269
  `)}
2815
3270
  </div>
2816
3271
  </div>
@@ -2824,7 +3279,7 @@ var ProvidersShopGptSdk = (function () {
2824
3279
  return x `
2825
3280
  <div class="chat-header">${this.contextButton()}</div>
2826
3281
  <div
2827
- class=${e({
3282
+ class=${e$2({
2828
3283
  'chatbot-section': true,
2829
3284
  'modal-view': this.viewType === 'modal',
2830
3285
  })}
@@ -2838,7 +3293,7 @@ var ProvidersShopGptSdk = (function () {
2838
3293
  placeholder="Type your search here..."
2839
3294
  />
2840
3295
  <button
2841
- class=${e({
3296
+ class=${e$2({
2842
3297
  btn: true,
2843
3298
  modal: this.viewType === 'modal',
2844
3299
  })}
@@ -2855,72 +3310,90 @@ var ProvidersShopGptSdk = (function () {
2855
3310
  .defaultProfiles=${this.profiles}
2856
3311
  ></personalize-dialog>
2857
3312
  ${this.renderChatThreads()}
3313
+ ${this.deleteThreadId
3314
+ ? x `
3315
+ <confirm-dialog
3316
+ @accept=${this.handleThreadDelete}
3317
+ @decline=${() => (this.deleteThreadId = '')}
3318
+ >
3319
+ <h2 slot="title">Delete Thread?</h2>
3320
+ <p slot="content">
3321
+ This action cannot be undone. Are you sure you want to delete
3322
+ <b>"${this.chatThreads.get(this.deleteThreadId).title}"</b>?
3323
+ </p>
3324
+ </confirm-dialog>
3325
+ `
3326
+ : T}
2858
3327
  `;
2859
3328
  }
2860
3329
  };
2861
3330
  ChatSection.styles = [chatSectionStyles];
2862
3331
  __decorate([
2863
- n({ type: Object }),
3332
+ n$1({ type: Object }),
2864
3333
  __metadata("design:type", Map)
2865
3334
  ], ChatSection.prototype, "chatThreads", void 0);
2866
3335
  __decorate([
2867
- n({ type: Boolean }),
3336
+ r$1(),
3337
+ __metadata("design:type", String)
3338
+ ], ChatSection.prototype, "deleteThreadId", void 0);
3339
+ __decorate([
3340
+ n$1({ type: Boolean }),
2868
3341
  __metadata("design:type", Boolean)
2869
3342
  ], ChatSection.prototype, "showChatThreads", void 0);
2870
3343
  __decorate([
2871
- n({ type: Boolean }),
3344
+ n$1({ type: Boolean }),
2872
3345
  __metadata("design:type", Boolean)
2873
3346
  ], ChatSection.prototype, "isLoadingHistory", void 0);
2874
3347
  __decorate([
2875
- n({ type: Boolean }),
3348
+ n$1({ type: Boolean }),
2876
3349
  __metadata("design:type", Object)
2877
3350
  ], ChatSection.prototype, "devMode", void 0);
2878
3351
  __decorate([
2879
- n({ type: Boolean }),
3352
+ n$1({ type: Boolean }),
2880
3353
  __metadata("design:type", Boolean)
2881
3354
  ], ChatSection.prototype, "isTyping", void 0);
2882
3355
  __decorate([
2883
- n({ type: Boolean }),
3356
+ n$1({ type: Boolean }),
2884
3357
  __metadata("design:type", Boolean)
2885
3358
  ], ChatSection.prototype, "isFailed", void 0);
2886
3359
  __decorate([
2887
- n({ type: Array }),
3360
+ n$1({ type: Array }),
2888
3361
  __metadata("design:type", Array)
2889
3362
  ], ChatSection.prototype, "messages", void 0);
2890
3363
  __decorate([
2891
- n({ type: Array }),
3364
+ n$1({ type: Array }),
2892
3365
  __metadata("design:type", Array)
2893
3366
  ], ChatSection.prototype, "profiles", void 0);
2894
3367
  __decorate([
2895
- n({ type: Array }),
3368
+ n$1({ type: Array }),
2896
3369
  __metadata("design:type", Array)
2897
3370
  ], ChatSection.prototype, "productHandles", void 0);
2898
3371
  __decorate([
2899
- n({ type: Object }),
3372
+ n$1({ type: Object }),
2900
3373
  __metadata("design:type", Object)
2901
3374
  ], ChatSection.prototype, "thread", void 0);
2902
3375
  __decorate([
2903
- n({ type: Object }),
3376
+ n$1({ type: Object }),
2904
3377
  __metadata("design:type", Object)
2905
3378
  ], ChatSection.prototype, "siteCurrency", void 0);
2906
3379
  __decorate([
2907
- e$2('.context-container'),
3380
+ e$4('.context-container'),
2908
3381
  __metadata("design:type", Object)
2909
3382
  ], ChatSection.prototype, "contextContainerElement", void 0);
2910
3383
  __decorate([
2911
- e$2('.chat-window'),
3384
+ e$4('.chat-window'),
2912
3385
  __metadata("design:type", Object)
2913
3386
  ], ChatSection.prototype, "chatWindowElement", void 0);
2914
3387
  __decorate([
2915
- e$2('personalize-dialog'),
3388
+ e$4('personalize-dialog'),
2916
3389
  __metadata("design:type", Object)
2917
3390
  ], ChatSection.prototype, "personalizeDialogElement", void 0);
2918
3391
  __decorate([
2919
- n({ type: String }),
3392
+ n$1({ type: String }),
2920
3393
  __metadata("design:type", String)
2921
3394
  ], ChatSection.prototype, "userQuery", void 0);
2922
3395
  ChatSection = __decorate([
2923
- t$1('chat-section')
3396
+ t$2('chat-section')
2924
3397
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
2925
3398
  ], ChatSection);
2926
3399
 
@@ -2948,7 +3421,7 @@ var ProvidersShopGptSdk = (function () {
2948
3421
  }
2949
3422
  connectedCallback() {
2950
3423
  super.connectedCallback();
2951
- if (this.uiMode === 'overlay') {
3424
+ if (!this.uiMode || this.uiMode === 'overlay') {
2952
3425
  if (!this.path) {
2953
3426
  return;
2954
3427
  }
@@ -3083,6 +3556,20 @@ var ProvidersShopGptSdk = (function () {
3083
3556
  logger.error(e);
3084
3557
  }
3085
3558
  }
3559
+ handleThreadDelete(e) {
3560
+ e.stopPropagation();
3561
+ this.isLoadingThreads = true;
3562
+ const threadId = e.detail.threadId;
3563
+ if (!threadId) {
3564
+ logger.error('ThreadId is missing to delete the thread!');
3565
+ return;
3566
+ }
3567
+ this.shopGPTAPI
3568
+ .deleteSingleThread(threadId)
3569
+ .then(this.loadChatThreads.bind(this))
3570
+ .catch(logger.error)
3571
+ .finally(() => (this.isLoadingThreads = false));
3572
+ }
3086
3573
  async sendMessageToServer(e, message) {
3087
3574
  e.preventDefault();
3088
3575
  e.stopPropagation();
@@ -3134,7 +3621,10 @@ var ProvidersShopGptSdk = (function () {
3134
3621
  overlayMode() {
3135
3622
  const thread = this.chatThreads.get(this.selectedThreadId);
3136
3623
  return x `
3137
- <dialog id="shop-gpt-dialog-overlay">
3624
+ <dialog
3625
+ id="shop-gpt-dialog-overlay"
3626
+ @delete-thread=${this.handleThreadDelete}
3627
+ >
3138
3628
  <div class="mobile-version">
3139
3629
  Please switch to the desktop version for the best experience.
3140
3630
  </div>
@@ -3188,7 +3678,7 @@ var ProvidersShopGptSdk = (function () {
3188
3678
  </div>`;
3189
3679
  }
3190
3680
  return x `
3191
- <div id="shop-gpt-modal">
3681
+ <div id="shop-gpt-modal" @delete-thread=${this.handleThreadDelete}>
3192
3682
  <chat-section
3193
3683
  .isFailed=${this.isFailed}
3194
3684
  .isLoadingHistory=${this.isLoadingHistory}
@@ -3212,47 +3702,47 @@ var ProvidersShopGptSdk = (function () {
3212
3702
  };
3213
3703
  ShopGPT.styles = [shopGPTStyles];
3214
3704
  __decorate([
3215
- e$2('#shop-gpt-dialog-overlay'),
3705
+ e$4('#shop-gpt-dialog-overlay'),
3216
3706
  __metadata("design:type", Object)
3217
3707
  ], ShopGPT.prototype, "shopGPTDialog", void 0);
3218
3708
  __decorate([
3219
- n({ type: String }),
3709
+ n$1({ type: String }),
3220
3710
  __metadata("design:type", String)
3221
3711
  ], ShopGPT.prototype, "modalState", void 0);
3222
3712
  __decorate([
3223
- n({ type: Boolean }),
3713
+ n$1({ type: Boolean }),
3224
3714
  __metadata("design:type", Boolean)
3225
3715
  ], ShopGPT.prototype, "isLoadingHistory", void 0);
3226
3716
  __decorate([
3227
- n({ type: Boolean }),
3717
+ n$1({ type: Boolean }),
3228
3718
  __metadata("design:type", Boolean)
3229
3719
  ], ShopGPT.prototype, "isLoadingThreads", void 0);
3230
3720
  __decorate([
3231
- n({ type: Boolean }),
3721
+ n$1({ type: Boolean }),
3232
3722
  __metadata("design:type", Boolean)
3233
3723
  ], ShopGPT.prototype, "isTyping", void 0);
3234
3724
  __decorate([
3235
- n({ type: Boolean }),
3725
+ n$1({ type: Boolean }),
3236
3726
  __metadata("design:type", Boolean)
3237
3727
  ], ShopGPT.prototype, "isFailed", void 0);
3238
3728
  __decorate([
3239
- n({ type: String }),
3729
+ n$1({ type: String }),
3240
3730
  __metadata("design:type", String)
3241
3731
  ], ShopGPT.prototype, "selectedThreadId", void 0);
3242
3732
  __decorate([
3243
- n({ type: Array }),
3733
+ n$1({ type: Array }),
3244
3734
  __metadata("design:type", Array)
3245
3735
  ], ShopGPT.prototype, "products", void 0);
3246
3736
  __decorate([
3247
- n({ type: Array }),
3737
+ n$1({ type: Array }),
3248
3738
  __metadata("design:type", Array)
3249
3739
  ], ShopGPT.prototype, "messages", void 0);
3250
3740
  __decorate([
3251
- n({ type: Object }),
3741
+ n$1({ type: Object }),
3252
3742
  __metadata("design:type", Map)
3253
3743
  ], ShopGPT.prototype, "chatThreads", void 0);
3254
3744
  ShopGPT = __decorate([
3255
- t$1('shop-gpt')
3745
+ t$2('shop-gpt')
3256
3746
  ], ShopGPT);
3257
3747
 
3258
3748
  var _a, _b;