@blotoutio/providers-shop-gpt-sdk 1.2.1 → 1.3.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.
- package/index.cjs.js +201 -103
- package/index.js +201 -103
- package/index.mjs +201 -103
- package/package.json +1 -1
package/index.mjs
CHANGED
@@ -488,7 +488,7 @@ const init = (params) => {
|
|
488
488
|
// exit if not in top window
|
489
489
|
return;
|
490
490
|
}
|
491
|
-
const { enabled, devMode, merchantUrl, profiles, productHandles, targetPath, uiMode, } = (_c = params.manifest.variables) !== null && _c !== void 0 ? _c : {};
|
491
|
+
const { enabled, devMode, merchantUrl, profiles, productHandles, targetPath, uiMode, brandName, quickPrompts, merchantImage, } = (_c = params.manifest.variables) !== null && _c !== void 0 ? _c : {};
|
492
492
|
let shouldShowUI = enabled;
|
493
493
|
if (!enabled && hasPreviewKey()) {
|
494
494
|
logger.log('Enabling UI in preview mode');
|
@@ -514,6 +514,9 @@ const init = (params) => {
|
|
514
514
|
profiles,
|
515
515
|
productHandles,
|
516
516
|
path: targetPath,
|
517
|
+
brandName,
|
518
|
+
quickPrompts,
|
519
|
+
merchantImage,
|
517
520
|
});
|
518
521
|
}
|
519
522
|
};
|
@@ -547,7 +550,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
547
550
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
548
551
|
PERFORMANCE OF THIS SOFTWARE.
|
549
552
|
***************************************************************************** */
|
550
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
553
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
551
554
|
|
552
555
|
|
553
556
|
function __decorate(decorators, target, key, desc) {
|
@@ -571,26 +574,26 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
571
574
|
* Copyright 2019 Google LLC
|
572
575
|
* SPDX-License-Identifier: BSD-3-Clause
|
573
576
|
*/
|
574
|
-
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$
|
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$1=Symbol(),o$5=new WeakMap;let n$4 = class n{constructor(t,e,o){if(this._$cssResult$=!0,o!==s$1)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$1),i$4=(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$1)},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;
|
575
578
|
|
576
579
|
/**
|
577
580
|
* @license
|
578
581
|
* Copyright 2017 Google LLC
|
579
582
|
* SPDX-License-Identifier: BSD-3-Clause
|
580
|
-
*/const{is:i$
|
583
|
+
*/const{is:i$3,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$3(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");
|
581
584
|
|
582
585
|
/**
|
583
586
|
* @license
|
584
587
|
* Copyright 2017 Google LLC
|
585
588
|
* SPDX-License-Identifier: BSD-3-Clause
|
586
589
|
*/
|
587
|
-
const t$3=globalThis,i$
|
590
|
+
const t$3=globalThis,i$2=t$3.trustedTypes,s=i$2?i$2.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),T=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),A=new WeakMap,C=r$4.createTreeWalker(r$4,129);function P(t,i){if(!a(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s?s.createHTML(i):i}const V=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?"<svg>":3===i?"<math>":"",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 [P(t,l+(t[s]||"<?>")+(2===i?"</svg>":3===i?"</math>":"")),o]};class N{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]=V(t,s);if(this.el=N.createElement(f,n),C.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes);}for(;null!==(r=C.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]?H:"?"===e[1]?I:"@"===e[1]?L:k}),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$2?i$2.emptyScript:"";for(let i=0;i<s;i++)r.append(t[i],l()),C.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 S(t,i,s=t,e){if(i===T)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=S(t,h._$AS(t,i.values),h,e)),i}class M{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);C.currentNode=e;let h=C.nextNode(),o=0,n=0,l=s[0];for(;void 0!==l;){if(o===l.index){let i;2===l.type?i=new R(h,h.nextSibling,this,t):1===l.type?i=new l.ctor(h,l.name,l.strings,this,t):6===l.type&&(i=new z(h,this,t)),this._$AV.push(i),l=s[++n];}o!==l?.index&&(h=C.nextNode(),o++);}return C.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 R{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=E,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=S(this,t,i),c(t)?t===E||null==t||""===t?(this._$AH!==E&&this._$AR(),this._$AH=E):t!==this._$AH&&t!==T&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):u(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!==E&&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=N.createElement(P(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else {const t=new M(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 N(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 R(this.O(l()),this.O(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 k{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=E,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=E;}_$AI(t,i=this,s,e){const h=this.strings;let o=!1;if(void 0===h)t=S(this,t,i,0),o=!c(t)||t!==this._$AH&&t!==T,o&&(this._$AH=t);else {const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=S(this,e[s+n],i,n),r===T&&(r=this._$AH[n]),o||=!c(r)||r!==this._$AH[n],r===E?t=E:t!==E&&(t+=(r??"")+h[n+1]),this._$AH[n]=r;}o&&!e&&this.j(t);}j(t){t===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}}class H extends k{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===E?void 0:t;}}class I extends k{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==E);}}class L extends k{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5;}_$AI(t,i=this){if((t=S(this,t,i,0)??E)===T)return;const s=this._$AH,e=t===E&&s!==E||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==E&&(s===E||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){S(this,t);}}const j=t$3.litHtmlPolyfillSupport;j?.(N,R),(t$3.litHtmlVersions??=[]).push("3.2.1");const B=(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 R(i.insertBefore(l(),t),t,void 0,s??{});}return h._$AI(t),h};
|
588
591
|
|
589
592
|
/**
|
590
593
|
* @license
|
591
594
|
* Copyright 2017 Google LLC
|
592
595
|
* SPDX-License-Identifier: BSD-3-Clause
|
593
|
-
*/class
|
596
|
+
*/let r$3 = class r 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 s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=B(s,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1);}render(){return T}};r$3._$litElement$=!0,r$3["finalized"]=!0,globalThis.litElementHydrateSupport?.({LitElement:r$3});const i$1=globalThis.litElementPolyfillSupport;i$1?.({LitElement:r$3});(globalThis.litElementVersions??=[]).push("4.1.1");
|
594
597
|
|
595
598
|
/**
|
596
599
|
* @license
|
@@ -624,7 +627,7 @@ const e$5=(e,t,c)=>(c.configurable=!0,c.enumerable=!0,Reflect.decorate&&"object"
|
|
624
627
|
* SPDX-License-Identifier: BSD-3-Clause
|
625
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)}})}}
|
626
629
|
|
627
|
-
const scrollBarStyles = i$
|
630
|
+
const scrollBarStyles = i$4 `
|
628
631
|
::-webkit-scrollbar {
|
629
632
|
width: 20px;
|
630
633
|
}
|
@@ -644,7 +647,7 @@ const scrollBarStyles = i$3 `
|
|
644
647
|
background-color: #a8bbbf;
|
645
648
|
}
|
646
649
|
`;
|
647
|
-
const shopGPTStyles = i$
|
650
|
+
const shopGPTStyles = i$4 `
|
648
651
|
${scrollBarStyles}
|
649
652
|
|
650
653
|
* {
|
@@ -761,7 +764,7 @@ const t$1={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6}
|
|
761
764
|
* @license
|
762
765
|
* Copyright 2018 Google LLC
|
763
766
|
* SPDX-License-Identifier: BSD-3-Clause
|
764
|
-
*/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
|
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 T}});
|
765
768
|
|
766
769
|
/**
|
767
770
|
* @license
|
@@ -841,7 +844,7 @@ const shopGPTIcon = b `<svg xmlns="http://www.w3.org/2000/svg" width="105" heigh
|
|
841
844
|
<path d="M90.323 25.7117C90.2401 25.7117 90.1986 25.7117 90.1669 25.7281C90.1391 25.7424 90.1165 25.7653 90.1022 25.7934C90.0861 25.8255 90.0861 25.8674 90.0861 25.9512V26.9203H89.7359C89.6558 26.9203 89.6148 26.9205 89.5836 26.9366C89.5558 26.9509 89.5331 26.9738 89.5189 27.002C89.5028 27.034 89.5028 27.0759 89.5028 27.1597V27.717C89.5028 27.8008 89.5028 27.8427 89.5189 27.8748C89.5331 27.9029 89.5558 27.9258 89.5836 27.9402C89.6153 27.9565 89.6568 27.9565 89.7397 27.9565H90.0861V32.1113H90.0847C90.0843 32.1182 90.0838 32.1251 90.0835 32.1319C90.0841 32.1478 90.085 32.1637 90.0861 32.1795V32.2192L90.0883 32.2191C90.1341 33.0885 90.844 33.7701 91.7052 33.7715C91.8727 33.7713 92.0388 33.745 92.1978 33.6936C92.2668 33.6713 92.321 33.5887 92.3208 33.5154L92.3225 32.749C92.3226 32.7376 92.3205 32.7194 92.3176 32.7084C92.317 32.7064 92.3165 32.7043 92.3159 32.7022C92.3113 32.6856 92.297 32.6611 92.283 32.651C92.2793 32.6484 92.2311 32.6207 92.1908 32.6453C92.1477 32.6656 92.147 32.6659 92.1463 32.6662C92.1353 32.6715 92.0981 32.6856 92.0807 32.6958C91.9299 32.7603 91.9074 32.7589 91.8631 32.7651C91.8328 32.7694 91.8023 32.7716 91.7716 32.7716C91.7139 32.7716 91.6565 32.7639 91.6007 32.7488C91.5449 32.7337 91.4914 32.7113 91.4414 32.6821C91.4146 32.6643 91.3891 32.6445 91.3652 32.623C91.3511 32.613 91.3375 32.6024 91.3243 32.5912C91.3176 32.5863 91.3111 32.5812 91.3046 32.576C91.3029 32.5738 91.3012 32.5715 91.2995 32.5692C91.1797 32.456 91.1115 32.2977 91.1112 32.1319C91.1116 32.1265 91.1121 32.1212 91.1127 32.1158C91.1122 32.1118 91.1116 32.1079 91.1112 32.1039V27.9565H92.0702C92.1531 27.9565 92.1946 27.9565 92.2262 27.9402C92.2541 27.9258 92.2767 27.9029 92.2909 27.8748C92.3071 27.8427 92.3071 27.8008 92.3071 27.717V27.1597C92.3071 27.0759 92.3071 27.034 92.2909 27.002C92.2767 26.9738 92.2541 26.9509 92.2262 26.9366C92.1946 26.9203 92.1531 26.9203 92.0702 26.9203H91.1112V25.9512C91.1112 25.8674 91.1112 25.8255 91.095 25.7934C91.0808 25.7653 91.0582 25.7424 91.0303 25.7281C90.9986 25.7117 90.9572 25.7117 90.8743 25.7117H90.323Z" fill="#F25C2B"/>
|
842
845
|
</svg>`;
|
843
846
|
|
844
|
-
const chatThreadsStyles = i$
|
847
|
+
const chatThreadsStyles = i$4 `
|
845
848
|
:host {
|
846
849
|
padding: 24px 24px 21px;
|
847
850
|
font-family: 'Inter', sans-serif;
|
@@ -994,13 +997,13 @@ const chatThreadsStyles = i$3 `
|
|
994
997
|
|
995
998
|
let LoadSpinner =
|
996
999
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
997
|
-
class LoadSpinner extends
|
1000
|
+
class LoadSpinner extends r$3 {
|
998
1001
|
render() {
|
999
1002
|
return x ` <div class="loader"><div class="spinner"></div></div> `;
|
1000
1003
|
}
|
1001
1004
|
};
|
1002
1005
|
LoadSpinner.styles = [
|
1003
|
-
i$
|
1006
|
+
i$4 `
|
1004
1007
|
.loader {
|
1005
1008
|
display: flex;
|
1006
1009
|
flex: 1;
|
@@ -1039,7 +1042,7 @@ LoadSpinner = __decorate([
|
|
1039
1042
|
|
1040
1043
|
let ChatThreads =
|
1041
1044
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
1042
|
-
class ChatThreads extends
|
1045
|
+
class ChatThreads extends r$3 {
|
1043
1046
|
getDomain() {
|
1044
1047
|
var _a;
|
1045
1048
|
if ((_a = this.merchantUrl) === null || _a === void 0 ? void 0 : _a.startsWith('https://')) {
|
@@ -1103,7 +1106,7 @@ class ChatThreads extends s {
|
|
1103
1106
|
</div>
|
1104
1107
|
`)}
|
1105
1108
|
</div>`
|
1106
|
-
:
|
1109
|
+
: E}
|
1107
1110
|
</div>
|
1108
1111
|
`;
|
1109
1112
|
}
|
@@ -1125,21 +1128,21 @@ class ChatThreads extends s {
|
|
1125
1128
|
${this.getDomain().replace('https://', '')}
|
1126
1129
|
</a>
|
1127
1130
|
</div>`
|
1128
|
-
:
|
1131
|
+
: E}
|
1129
1132
|
${this.deleteThreadId
|
1130
1133
|
? x `
|
1131
1134
|
<confirm-dialog
|
1132
1135
|
@accept=${this.handleThreadDelete}
|
1133
1136
|
@decline=${() => (this.deleteThreadId = '')}
|
1134
1137
|
>
|
1135
|
-
<h2 slot="title">Delete
|
1138
|
+
<h2 slot="title">Delete Chat?</h2>
|
1136
1139
|
<p slot="content">
|
1137
1140
|
This action cannot be undone. Are you sure you want to delete
|
1138
1141
|
<b>"${this.chatThreads.get(this.deleteThreadId).title}"</b>?
|
1139
1142
|
</p>
|
1140
1143
|
</confirm-dialog>
|
1141
1144
|
`
|
1142
|
-
:
|
1145
|
+
: E}
|
1143
1146
|
`;
|
1144
1147
|
}
|
1145
1148
|
};
|
@@ -1173,7 +1176,7 @@ ChatThreads = __decorate([
|
|
1173
1176
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
1174
1177
|
], ChatThreads);
|
1175
1178
|
|
1176
|
-
const productsSectionStyles = i$
|
1179
|
+
const productsSectionStyles = i$4 `
|
1177
1180
|
:host {
|
1178
1181
|
padding: 24px 16px;
|
1179
1182
|
background-color: #fff;
|
@@ -1209,9 +1212,14 @@ const productsSectionStyles = i$3 `
|
|
1209
1212
|
justify-content: center;
|
1210
1213
|
height: 100%;
|
1211
1214
|
}
|
1215
|
+
|
1216
|
+
.merchant-image {
|
1217
|
+
width: 100%;
|
1218
|
+
object-fit: contain;
|
1219
|
+
}
|
1212
1220
|
`;
|
1213
1221
|
|
1214
|
-
const productItemStyles = i$
|
1222
|
+
const productItemStyles = i$4 `
|
1215
1223
|
:host {
|
1216
1224
|
font-family: 'Inter', sans-serif;
|
1217
1225
|
font-size: 16px;
|
@@ -1356,7 +1364,7 @@ const productItemStyles = i$3 `
|
|
1356
1364
|
|
1357
1365
|
let ProductItem =
|
1358
1366
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
1359
|
-
class ProductItem extends
|
1367
|
+
class ProductItem extends r$3 {
|
1360
1368
|
getLocalPrice(price) {
|
1361
1369
|
if (!this.siteCurrency) {
|
1362
1370
|
return price;
|
@@ -1372,8 +1380,8 @@ class ProductItem extends s {
|
|
1372
1380
|
(_a = open(url, '_blank')) === null || _a === void 0 ? void 0 : _a.focus();
|
1373
1381
|
}
|
1374
1382
|
renderVariantTitles() {
|
1375
|
-
if (
|
1376
|
-
return
|
1383
|
+
if (this.product.hasOnlyDefaultVariant) {
|
1384
|
+
return E;
|
1377
1385
|
}
|
1378
1386
|
return this.product.variants[0].selectedOptions.map((option) => x `
|
1379
1387
|
<p class="product-variation-details">${option.name}: ${option.value}</p>
|
@@ -1403,7 +1411,7 @@ class ProductItem extends s {
|
|
1403
1411
|
? x `<p class="price-compared">
|
1404
1412
|
${this.getLocalPrice(this.product.variants[0].comparedAtPrice)}
|
1405
1413
|
</p>`
|
1406
|
-
:
|
1414
|
+
: E}
|
1407
1415
|
<p>${this.getLocalPrice(this.product.variants[0].price)}</p>
|
1408
1416
|
</div>
|
1409
1417
|
<button
|
@@ -1431,7 +1439,7 @@ ProductItem = __decorate([
|
|
1431
1439
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
1432
1440
|
], ProductItem);
|
1433
1441
|
|
1434
|
-
const productsListStyles = i$
|
1442
|
+
const productsListStyles = i$4 `
|
1435
1443
|
.products::-webkit-scrollbar {
|
1436
1444
|
display: none;
|
1437
1445
|
}
|
@@ -1493,17 +1501,34 @@ const productsListStyles = i$3 `
|
|
1493
1501
|
|
1494
1502
|
let ProductsList =
|
1495
1503
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
1496
|
-
class ProductsList extends
|
1504
|
+
class ProductsList extends r$3 {
|
1505
|
+
constructor() {
|
1506
|
+
super(...arguments);
|
1507
|
+
this.showButtons = true;
|
1508
|
+
this.updateButtonsState = () => {
|
1509
|
+
if (!this.leftBtnEle || !this.productsEle || !this.rightBtnEle) {
|
1510
|
+
return;
|
1511
|
+
}
|
1512
|
+
const { scrollWidth, clientWidth } = this.productsEle;
|
1513
|
+
this.showButtons = scrollWidth > clientWidth;
|
1514
|
+
this.leftBtnEle.classList.toggle('disabled', this.productsEle.scrollLeft === 0);
|
1515
|
+
const maxScroll = this.productsEle.scrollWidth - this.productsEle.clientWidth;
|
1516
|
+
this.rightBtnEle.classList.toggle('disabled', this.productsEle.scrollLeft >= maxScroll - 1);
|
1517
|
+
};
|
1518
|
+
}
|
1497
1519
|
connectedCallback() {
|
1498
1520
|
super.connectedCallback();
|
1521
|
+
this.updateButtonsState();
|
1522
|
+
window.addEventListener('resize', this.updateButtonsState);
|
1499
1523
|
}
|
1500
|
-
|
1501
|
-
|
1502
|
-
|
1524
|
+
disconnectedCallback() {
|
1525
|
+
window.removeEventListener('resize', this.updateButtonsState);
|
1526
|
+
super.disconnectedCallback();
|
1527
|
+
}
|
1528
|
+
updated(_changedProperties) {
|
1529
|
+
if (_changedProperties.has('products')) {
|
1530
|
+
this.updateButtonsState();
|
1503
1531
|
}
|
1504
|
-
this.leftBtnEle.classList.toggle('disabled', this.productsEle.scrollLeft === 0);
|
1505
|
-
const maxScroll = this.productsEle.scrollWidth - this.productsEle.clientWidth;
|
1506
|
-
this.rightBtnEle.classList.toggle('disabled', this.productsEle.scrollLeft >= maxScroll - 1);
|
1507
1532
|
}
|
1508
1533
|
scrollToLeft(e) {
|
1509
1534
|
var _a;
|
@@ -1517,7 +1542,7 @@ class ProductsList extends s {
|
|
1517
1542
|
}
|
1518
1543
|
render() {
|
1519
1544
|
if (!this.products.length) {
|
1520
|
-
return
|
1545
|
+
return E;
|
1521
1546
|
}
|
1522
1547
|
return x `
|
1523
1548
|
<div class="products-wrapper">
|
@@ -1536,12 +1561,16 @@ class ProductsList extends s {
|
|
1536
1561
|
</div>
|
1537
1562
|
`)}
|
1538
1563
|
</div>
|
1539
|
-
|
1540
|
-
|
1541
|
-
|
1542
|
-
|
1543
|
-
|
1544
|
-
|
1564
|
+
${this.showButtons
|
1565
|
+
? x ` <div class="scroll-btns">
|
1566
|
+
<div class="left-btn disabled" @click=${this.scrollToLeft}>
|
1567
|
+
${leftBtn}
|
1568
|
+
</div>
|
1569
|
+
<div class="right-btn" @click=${this.scrollToRight}>
|
1570
|
+
${rightBtn}
|
1571
|
+
</div>
|
1572
|
+
</div>`
|
1573
|
+
: E}
|
1545
1574
|
</div>
|
1546
1575
|
`;
|
1547
1576
|
}
|
@@ -1555,6 +1584,10 @@ __decorate([
|
|
1555
1584
|
n$1({ type: Object }),
|
1556
1585
|
__metadata("design:type", Object)
|
1557
1586
|
], ProductsList.prototype, "siteCurrency", void 0);
|
1587
|
+
__decorate([
|
1588
|
+
r$1(),
|
1589
|
+
__metadata("design:type", Object)
|
1590
|
+
], ProductsList.prototype, "showButtons", void 0);
|
1558
1591
|
__decorate([
|
1559
1592
|
e$4('.left-btn'),
|
1560
1593
|
__metadata("design:type", Object)
|
@@ -1574,22 +1607,28 @@ ProductsList = __decorate([
|
|
1574
1607
|
|
1575
1608
|
let ProductsSection =
|
1576
1609
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
1577
|
-
class ProductsSection extends
|
1610
|
+
class ProductsSection extends r$3 {
|
1578
1611
|
connectedCallback() {
|
1579
1612
|
super.connectedCallback();
|
1580
1613
|
}
|
1614
|
+
renderMerchantImage() {
|
1615
|
+
if (this.merchantImage) {
|
1616
|
+
return x ` <img class="merchant-image" src=${this.merchantImage} /> `;
|
1617
|
+
}
|
1618
|
+
return x `
|
1619
|
+
<div>${searchIcon}</div>
|
1620
|
+
<p>
|
1621
|
+
Start exploring by typing your query in the search bar on the right.
|
1622
|
+
</p>
|
1623
|
+
`;
|
1624
|
+
}
|
1581
1625
|
render() {
|
1582
1626
|
if (this.isLoadingHistory) {
|
1583
1627
|
return x ` <load-spinner></load-spinner> `;
|
1584
1628
|
}
|
1585
1629
|
if (!this.products.length) {
|
1586
1630
|
return x `
|
1587
|
-
<div class="no-products">
|
1588
|
-
<div>${searchIcon}</div>
|
1589
|
-
<p>
|
1590
|
-
Start exploring by typing your query in the search bar on the right.
|
1591
|
-
</p>
|
1592
|
-
</div>
|
1631
|
+
<div class="no-products">${this.renderMerchantImage()}</div>
|
1593
1632
|
`;
|
1594
1633
|
}
|
1595
1634
|
const topResult = this.products[0];
|
@@ -1615,6 +1654,10 @@ class ProductsSection extends s {
|
|
1615
1654
|
}
|
1616
1655
|
};
|
1617
1656
|
ProductsSection.styles = [productsSectionStyles];
|
1657
|
+
__decorate([
|
1658
|
+
n$1({ type: String }),
|
1659
|
+
__metadata("design:type", Object)
|
1660
|
+
], ProductsSection.prototype, "merchantImage", void 0);
|
1618
1661
|
__decorate([
|
1619
1662
|
n$1({ type: Array }),
|
1620
1663
|
__metadata("design:type", Array)
|
@@ -1644,7 +1687,7 @@ ProductsSection = __decorate([
|
|
1644
1687
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
1645
1688
|
], ProductsSection);
|
1646
1689
|
|
1647
|
-
const chatSectionStyles = i$
|
1690
|
+
const chatSectionStyles = i$4 `
|
1648
1691
|
:host {
|
1649
1692
|
font-family: 'Inter', sans-serif;
|
1650
1693
|
font-size: 16px;
|
@@ -2118,7 +2161,7 @@ const crossBtn = b `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="2
|
|
2118
2161
|
<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"/>
|
2119
2162
|
</svg>`;
|
2120
2163
|
|
2121
|
-
const personalizeDialogStyles = i$
|
2164
|
+
const personalizeDialogStyles = i$4 `
|
2122
2165
|
:host {
|
2123
2166
|
font-family: 'Inter', sans-serif;
|
2124
2167
|
font-size: 16px;
|
@@ -2358,7 +2401,7 @@ const profilePlusIcon = b `<svg xmlns="http://www.w3.org/2000/svg" width="56" he
|
|
2358
2401
|
|
2359
2402
|
let PersonalizeDialog =
|
2360
2403
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
2361
|
-
class PersonalizeDialog extends
|
2404
|
+
class PersonalizeDialog extends r$3 {
|
2362
2405
|
constructor() {
|
2363
2406
|
super(...arguments);
|
2364
2407
|
this.isLoading = false;
|
@@ -2381,7 +2424,7 @@ class PersonalizeDialog extends s {
|
|
2381
2424
|
return this.selectProductHandle();
|
2382
2425
|
}
|
2383
2426
|
}
|
2384
|
-
return
|
2427
|
+
return E;
|
2385
2428
|
};
|
2386
2429
|
}
|
2387
2430
|
showModal() {
|
@@ -2565,7 +2608,7 @@ class PersonalizeDialog extends s {
|
|
2565
2608
|
: 'Select Product'}
|
2566
2609
|
</div>
|
2567
2610
|
<ul class="dropdown-list">
|
2568
|
-
${(_a = this.defaultProductHandles) === null || _a === void 0 ? void 0 : _a.map((productHandle) => x
|
2611
|
+
${(_a = this.defaultProductHandles) === null || _a === void 0 ? void 0 : _a.map((productHandle) => x ` <li
|
2569
2612
|
class="dropdown-item"
|
2570
2613
|
@click=${() => {
|
2571
2614
|
this.productHandle = productHandle;
|
@@ -2577,10 +2620,10 @@ class PersonalizeDialog extends s {
|
|
2577
2620
|
</ul>
|
2578
2621
|
</div>
|
2579
2622
|
${this.productHandle
|
2580
|
-
? x
|
2623
|
+
? x ` <button class="finish-btn" @click=${this.handleSubmit}>
|
2581
2624
|
Finish
|
2582
2625
|
</button>`
|
2583
|
-
:
|
2626
|
+
: E}
|
2584
2627
|
`;
|
2585
2628
|
}
|
2586
2629
|
render() {
|
@@ -2588,10 +2631,10 @@ class PersonalizeDialog extends s {
|
|
2588
2631
|
<dialog>
|
2589
2632
|
<div class="dialog-title">
|
2590
2633
|
${this.state !== 'profile-type'
|
2591
|
-
? x
|
2634
|
+
? x ` <div class="back-btn btn" @click=${this.handleBackStep}>
|
2592
2635
|
${backBtn}
|
2593
2636
|
</div>`
|
2594
|
-
:
|
2637
|
+
: E}
|
2595
2638
|
<h2>Personalize your search</h2>
|
2596
2639
|
<div class="close-btn btn" @click=${() => this.dialogModal.close()}>
|
2597
2640
|
${closeBtn}
|
@@ -2625,7 +2668,7 @@ __decorate([
|
|
2625
2668
|
], PersonalizeDialog.prototype, "defaultProfiles", void 0);
|
2626
2669
|
__decorate([
|
2627
2670
|
n$1({ type: Boolean }),
|
2628
|
-
__metadata("design:type",
|
2671
|
+
__metadata("design:type", Object)
|
2629
2672
|
], PersonalizeDialog.prototype, "isLoading", void 0);
|
2630
2673
|
__decorate([
|
2631
2674
|
n$1({ type: String }),
|
@@ -2656,20 +2699,20 @@ PersonalizeDialog = __decorate([
|
|
2656
2699
|
* @license
|
2657
2700
|
* Copyright 2017 Google LLC
|
2658
2701
|
* SPDX-License-Identifier: BSD-3-Clause
|
2659
|
-
*/let e$1 = class e extends i{constructor(i){if(super(i),this.it=
|
2702
|
+
*/let e$1 = class e extends i{constructor(i){if(super(i),this.it=E,i.type!==t$1.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(r){if(r===E||null==r)return this._t=void 0,this.it=r;if(r===T)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);
|
2660
2703
|
|
2661
2704
|
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,""").replace(/</g,"<").replace(/>/g,">")}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,"")}
|
2662
2705
|
|
2663
2706
|
let MarkdownRenderer =
|
2664
2707
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
2665
|
-
class MarkdownRenderer extends
|
2708
|
+
class MarkdownRenderer extends r$3 {
|
2666
2709
|
render() {
|
2667
2710
|
const slotContent = this.innerHTML.trim();
|
2668
2711
|
const parsedContent = t(slotContent);
|
2669
2712
|
return o(parsedContent);
|
2670
2713
|
}
|
2671
2714
|
};
|
2672
|
-
MarkdownRenderer.styles = i$
|
2715
|
+
MarkdownRenderer.styles = i$4 `
|
2673
2716
|
:host {
|
2674
2717
|
font-family: 'Inter', sans-serif;
|
2675
2718
|
font-size: 16px;
|
@@ -2687,7 +2730,7 @@ MarkdownRenderer = __decorate([
|
|
2687
2730
|
|
2688
2731
|
let TooltipComponent =
|
2689
2732
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
2690
|
-
class TooltipComponent extends
|
2733
|
+
class TooltipComponent extends r$3 {
|
2691
2734
|
constructor() {
|
2692
2735
|
super(...arguments);
|
2693
2736
|
this.position = 'bottom-left';
|
@@ -2701,11 +2744,12 @@ class TooltipComponent extends s {
|
|
2701
2744
|
}
|
2702
2745
|
};
|
2703
2746
|
TooltipComponent.styles = [
|
2704
|
-
i$
|
2747
|
+
i$4 `
|
2705
2748
|
:host {
|
2706
2749
|
position: relative;
|
2707
2750
|
display: inline-block;
|
2708
2751
|
}
|
2752
|
+
|
2709
2753
|
.tooltip {
|
2710
2754
|
position: absolute;
|
2711
2755
|
color: #172a41;
|
@@ -2726,57 +2770,70 @@ TooltipComponent.styles = [
|
|
2726
2770
|
font-weight: 400;
|
2727
2771
|
line-height: 150%;
|
2728
2772
|
}
|
2773
|
+
|
2729
2774
|
:host(:hover) .tooltip {
|
2730
2775
|
opacity: 1;
|
2731
2776
|
}
|
2777
|
+
|
2732
2778
|
.top-center {
|
2733
2779
|
bottom: calc(100% + 2px);
|
2734
2780
|
left: 50%;
|
2735
2781
|
transform: translateX(-50%);
|
2736
2782
|
}
|
2783
|
+
|
2737
2784
|
.top-left {
|
2738
2785
|
bottom: calc(100% + 2px);
|
2739
2786
|
left: 0;
|
2740
2787
|
}
|
2788
|
+
|
2741
2789
|
.top-right {
|
2742
2790
|
bottom: calc(100% + 2px);
|
2743
2791
|
right: 0;
|
2744
2792
|
}
|
2793
|
+
|
2745
2794
|
.bottom-center {
|
2746
2795
|
top: calc(100% + 2px);
|
2747
2796
|
left: 50%;
|
2748
2797
|
transform: translateX(-50%);
|
2749
2798
|
}
|
2799
|
+
|
2750
2800
|
.bottom-left {
|
2751
2801
|
top: calc(100% + 2px);
|
2752
2802
|
left: 0;
|
2753
2803
|
}
|
2804
|
+
|
2754
2805
|
.bottom-right {
|
2755
2806
|
top: calc(100% + 2px);
|
2756
2807
|
right: 0;
|
2757
2808
|
}
|
2809
|
+
|
2758
2810
|
.left-center {
|
2759
2811
|
right: calc(100% + 2px);
|
2760
2812
|
top: 50%;
|
2761
2813
|
transform: translateY(-50%);
|
2762
2814
|
}
|
2815
|
+
|
2763
2816
|
.left-top {
|
2764
2817
|
right: calc(100% + 2px);
|
2765
2818
|
top: 0;
|
2766
2819
|
}
|
2820
|
+
|
2767
2821
|
.left-bottom {
|
2768
2822
|
right: calc(100% + 2px);
|
2769
2823
|
bottom: 0;
|
2770
2824
|
}
|
2825
|
+
|
2771
2826
|
.right-center {
|
2772
2827
|
left: calc(100% + 2px);
|
2773
2828
|
top: 50%;
|
2774
2829
|
transform: translateY(-50%);
|
2775
2830
|
}
|
2831
|
+
|
2776
2832
|
.right-top {
|
2777
2833
|
left: calc(100% + 2px);
|
2778
2834
|
top: 0;
|
2779
2835
|
}
|
2836
|
+
|
2780
2837
|
.right-bottom {
|
2781
2838
|
left: calc(100% + 2px);
|
2782
2839
|
bottom: 0;
|
@@ -2789,14 +2846,14 @@ __decorate([
|
|
2789
2846
|
], TooltipComponent.prototype, "position", void 0);
|
2790
2847
|
__decorate([
|
2791
2848
|
n$1({ type: String }),
|
2792
|
-
__metadata("design:type",
|
2849
|
+
__metadata("design:type", Object)
|
2793
2850
|
], TooltipComponent.prototype, "text", void 0);
|
2794
2851
|
TooltipComponent = __decorate([
|
2795
2852
|
t$2('tooltip-component')
|
2796
2853
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
2797
2854
|
], TooltipComponent);
|
2798
2855
|
|
2799
|
-
const confirmDialogStyles = i$
|
2856
|
+
const confirmDialogStyles = i$4 `
|
2800
2857
|
:host {
|
2801
2858
|
font-family: 'Inter', sans-serif;
|
2802
2859
|
font-size: 16px;
|
@@ -2877,7 +2934,7 @@ const confirmDialogStyles = i$3 `
|
|
2877
2934
|
|
2878
2935
|
let ConfirmDialog =
|
2879
2936
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
2880
|
-
class ConfirmDialog extends
|
2937
|
+
class ConfirmDialog extends r$3 {
|
2881
2938
|
onAcceptClick(e) {
|
2882
2939
|
e.preventDefault();
|
2883
2940
|
this.dispatchEvent(new CustomEvent('accept', {
|
@@ -2919,7 +2976,7 @@ ConfirmDialog = __decorate([
|
|
2919
2976
|
|
2920
2977
|
let ChatSection =
|
2921
2978
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
2922
|
-
class ChatSection extends
|
2979
|
+
class ChatSection extends r$3 {
|
2923
2980
|
constructor() {
|
2924
2981
|
super(...arguments);
|
2925
2982
|
this.showChatThreads = false;
|
@@ -2958,7 +3015,7 @@ class ChatSection extends s {
|
|
2958
3015
|
this.deleteThreadId = '';
|
2959
3016
|
}
|
2960
3017
|
typingIndicator() {
|
2961
|
-
return x
|
3018
|
+
return x ` <div class="typing-dots">
|
2962
3019
|
<div class="dot"></div>
|
2963
3020
|
<div class="dot"></div>
|
2964
3021
|
<div class="dot"></div>
|
@@ -2974,8 +3031,8 @@ class ChatSection extends s {
|
|
2974
3031
|
</div>
|
2975
3032
|
<div>
|
2976
3033
|
${message.message
|
2977
|
-
? x
|
2978
|
-
:
|
3034
|
+
? x ` <markdown-renderer>${message.message}</markdown-renderer>`
|
3035
|
+
: E}
|
2979
3036
|
${this.viewType !== 'modal' && ((_a = message.products) === null || _a === void 0 ? void 0 : _a[0])
|
2980
3037
|
? x `
|
2981
3038
|
<span class="line"></span>
|
@@ -2986,16 +3043,16 @@ class ChatSection extends s {
|
|
2986
3043
|
></product-item>
|
2987
3044
|
</div>
|
2988
3045
|
`
|
2989
|
-
:
|
3046
|
+
: E}
|
2990
3047
|
</div>
|
2991
3048
|
</div>
|
2992
3049
|
${this.viewType === 'modal' && message.products
|
2993
|
-
? x
|
3050
|
+
? x ` <products-list
|
2994
3051
|
.products=${message.products}
|
2995
3052
|
.siteCurrency=${this.siteCurrency}
|
2996
3053
|
.viewType=${this.viewType}
|
2997
3054
|
></products-list>`
|
2998
|
-
:
|
3055
|
+
: E}
|
2999
3056
|
</div>
|
3000
3057
|
`;
|
3001
3058
|
}
|
@@ -3006,7 +3063,7 @@ class ChatSection extends s {
|
|
3006
3063
|
return x `
|
3007
3064
|
<div class="messages">
|
3008
3065
|
${this.isTyping
|
3009
|
-
? x
|
3066
|
+
? x ` <div class="message bot">
|
3010
3067
|
<div>
|
3011
3068
|
<div class="bot-icon">${botIcon}</div>
|
3012
3069
|
</div>
|
@@ -3018,7 +3075,7 @@ class ChatSection extends s {
|
|
3018
3075
|
sender: 'bot',
|
3019
3076
|
message: "Uh-oh! Looks like I tripped over some alpha-stage wires. Things are still a bit wobbly here, buy hey, that's what testing is for, Let's try that again; or feel free to throw another challenge my way!",
|
3020
3077
|
})
|
3021
|
-
:
|
3078
|
+
: E}
|
3022
3079
|
${this.messages.map((message) => {
|
3023
3080
|
if (message.sender === 'bot') {
|
3024
3081
|
return this.botMessage(message);
|
@@ -3031,11 +3088,10 @@ class ChatSection extends s {
|
|
3031
3088
|
</div>
|
3032
3089
|
<div>
|
3033
3090
|
<p>
|
3034
|
-
|
3035
|
-
|
3036
|
-
|
3037
|
-
|
3038
|
-
started:
|
3091
|
+
Hi,
|
3092
|
+
${this.brandName ? x `Welcome to ${this.brandName}.` : E}
|
3093
|
+
I'm here to help you find the perfect product? What are you
|
3094
|
+
looking to resolve today?
|
3039
3095
|
</p>
|
3040
3096
|
</div>
|
3041
3097
|
</div>
|
@@ -3045,9 +3101,11 @@ class ChatSection extends s {
|
|
3045
3101
|
quickPrompts() {
|
3046
3102
|
var _a;
|
3047
3103
|
if (((_a = this.thread) === null || _a === void 0 ? void 0 : _a.threadId) || this.messages.length) {
|
3048
|
-
return
|
3104
|
+
return E;
|
3049
3105
|
}
|
3050
|
-
const defaultPrompts =
|
3106
|
+
const defaultPrompts = this.prompts
|
3107
|
+
? this.prompts.split(',').map((prompt) => prompt.trim())
|
3108
|
+
: ['Best Selling Items', 'Hot Sales'];
|
3051
3109
|
return x `
|
3052
3110
|
<div class="prompts btn">
|
3053
3111
|
${defaultPrompts.map((prompt) => x `
|
@@ -3117,8 +3175,8 @@ class ChatSection extends s {
|
|
3117
3175
|
<span class="context-type-value"> ${profileType} </span>
|
3118
3176
|
</div>
|
3119
3177
|
${userDetails
|
3120
|
-
? x
|
3121
|
-
:
|
3178
|
+
? x ` <div class="context user-details">${userDetails}</div>`
|
3179
|
+
: E}
|
3122
3180
|
</div>
|
3123
3181
|
<div>
|
3124
3182
|
<div class="context">
|
@@ -3126,10 +3184,10 @@ class ChatSection extends s {
|
|
3126
3184
|
<span class="context-type-value">${visitationType}</span>
|
3127
3185
|
</div>
|
3128
3186
|
${devContext.productHandle
|
3129
|
-
? x
|
3187
|
+
? x ` <div class="context product-handle">
|
3130
3188
|
${devContext.productHandle}
|
3131
3189
|
</div>`
|
3132
|
-
:
|
3190
|
+
: E}
|
3133
3191
|
</div>
|
3134
3192
|
</div>
|
3135
3193
|
`;
|
@@ -3225,9 +3283,9 @@ class ChatSection extends s {
|
|
3225
3283
|
}
|
3226
3284
|
renderChatThreads() {
|
3227
3285
|
if (!this.chatThreads || !this.showChatThreads) {
|
3228
|
-
return
|
3286
|
+
return E;
|
3229
3287
|
}
|
3230
|
-
return x
|
3288
|
+
return x ` <div id="modal-chat-threads">
|
3231
3289
|
<div class="chat-threads">
|
3232
3290
|
<h2>Your Search History</h2>
|
3233
3291
|
<div class="thread-titles-wrapper">
|
@@ -3313,18 +3371,26 @@ class ChatSection extends s {
|
|
3313
3371
|
@accept=${this.handleThreadDelete}
|
3314
3372
|
@decline=${() => (this.deleteThreadId = '')}
|
3315
3373
|
>
|
3316
|
-
<h2 slot="title">Delete
|
3374
|
+
<h2 slot="title">Delete Chat?</h2>
|
3317
3375
|
<p slot="content">
|
3318
3376
|
This action cannot be undone. Are you sure you want to delete
|
3319
3377
|
<b>"${this.chatThreads.get(this.deleteThreadId).title}"</b>?
|
3320
3378
|
</p>
|
3321
3379
|
</confirm-dialog>
|
3322
3380
|
`
|
3323
|
-
:
|
3381
|
+
: E}
|
3324
3382
|
`;
|
3325
3383
|
}
|
3326
3384
|
};
|
3327
3385
|
ChatSection.styles = [chatSectionStyles];
|
3386
|
+
__decorate([
|
3387
|
+
n$1({ type: String }),
|
3388
|
+
__metadata("design:type", Object)
|
3389
|
+
], ChatSection.prototype, "brandName", void 0);
|
3390
|
+
__decorate([
|
3391
|
+
n$1({ type: String }),
|
3392
|
+
__metadata("design:type", Object)
|
3393
|
+
], ChatSection.prototype, "prompts", void 0);
|
3328
3394
|
__decorate([
|
3329
3395
|
n$1({ type: Object }),
|
3330
3396
|
__metadata("design:type", Map)
|
@@ -3335,7 +3401,7 @@ __decorate([
|
|
3335
3401
|
], ChatSection.prototype, "deleteThreadId", void 0);
|
3336
3402
|
__decorate([
|
3337
3403
|
n$1({ type: Boolean }),
|
3338
|
-
__metadata("design:type",
|
3404
|
+
__metadata("design:type", Object)
|
3339
3405
|
], ChatSection.prototype, "showChatThreads", void 0);
|
3340
3406
|
__decorate([
|
3341
3407
|
n$1({ type: Boolean }),
|
@@ -3387,7 +3453,7 @@ __decorate([
|
|
3387
3453
|
], ChatSection.prototype, "personalizeDialogElement", void 0);
|
3388
3454
|
__decorate([
|
3389
3455
|
n$1({ type: String }),
|
3390
|
-
__metadata("design:type",
|
3456
|
+
__metadata("design:type", Object)
|
3391
3457
|
], ChatSection.prototype, "userQuery", void 0);
|
3392
3458
|
ChatSection = __decorate([
|
3393
3459
|
t$2('chat-section')
|
@@ -3395,8 +3461,9 @@ ChatSection = __decorate([
|
|
3395
3461
|
], ChatSection);
|
3396
3462
|
|
3397
3463
|
const DIALOG_DELAY = 1000;
|
3464
|
+
const LATEST_THREAD_LOAD_DAYS = 14;
|
3398
3465
|
const normalizePath = (path) => path.replace(/\/$/, '');
|
3399
|
-
let ShopGPT = class ShopGPT extends
|
3466
|
+
let ShopGPT = class ShopGPT extends r$3 {
|
3400
3467
|
constructor() {
|
3401
3468
|
super(...arguments);
|
3402
3469
|
this.modalState = 'close';
|
@@ -3408,6 +3475,14 @@ let ShopGPT = class ShopGPT extends s {
|
|
3408
3475
|
this.products = [];
|
3409
3476
|
this.messages = [];
|
3410
3477
|
this.chatThreads = new Map();
|
3478
|
+
this.loadData = async () => {
|
3479
|
+
if (!this.shopGPTAPI) {
|
3480
|
+
return;
|
3481
|
+
}
|
3482
|
+
await this.loadChatThreads();
|
3483
|
+
await this.loadInitialQuery();
|
3484
|
+
this.selectLatestThread();
|
3485
|
+
};
|
3411
3486
|
this.submitQuery = (message) => {
|
3412
3487
|
if (!message) {
|
3413
3488
|
return;
|
@@ -3431,14 +3506,12 @@ let ShopGPT = class ShopGPT extends s {
|
|
3431
3506
|
}
|
3432
3507
|
this.init();
|
3433
3508
|
}
|
3509
|
+
disconnectedCallback() {
|
3510
|
+
window.removeEventListener('edgetag-initialized', this.loadData);
|
3511
|
+
super.disconnectedCallback();
|
3512
|
+
}
|
3434
3513
|
init() {
|
3435
|
-
window.addEventListener('edgetag-initialized',
|
3436
|
-
if (!this.shopGPTAPI) {
|
3437
|
-
return;
|
3438
|
-
}
|
3439
|
-
await this.loadChatThreads();
|
3440
|
-
await this.loadInitialQuery();
|
3441
|
-
});
|
3514
|
+
window.addEventListener('edgetag-initialized', this.loadData);
|
3442
3515
|
if (!this.uiMode || this.uiMode === 'overlay') {
|
3443
3516
|
delay(DIALOG_DELAY).then(() => {
|
3444
3517
|
var _a;
|
@@ -3498,6 +3571,23 @@ let ShopGPT = class ShopGPT extends s {
|
|
3498
3571
|
this.isLoadingThreads = false;
|
3499
3572
|
}
|
3500
3573
|
}
|
3574
|
+
selectLatestThread() {
|
3575
|
+
if (!this.devMode) {
|
3576
|
+
return;
|
3577
|
+
}
|
3578
|
+
const cutoffTime = Date.now() - LATEST_THREAD_LOAD_DAYS * 24 * 60 * 60 * 1000;
|
3579
|
+
// If the latest thread is not older than cutoff we should load the thread
|
3580
|
+
let latestThread;
|
3581
|
+
for (const thread of this.chatThreads.values()) {
|
3582
|
+
if (thread.createdAt >= cutoffTime &&
|
3583
|
+
(!latestThread || latestThread.createdAt < thread.createdAt)) {
|
3584
|
+
latestThread = thread;
|
3585
|
+
}
|
3586
|
+
}
|
3587
|
+
if (latestThread) {
|
3588
|
+
this.setSelectedThreadId(latestThread.threadId);
|
3589
|
+
}
|
3590
|
+
}
|
3501
3591
|
async loadHistory(threadId) {
|
3502
3592
|
var _a, _b, _c;
|
3503
3593
|
try {
|
@@ -3635,11 +3725,14 @@ let ShopGPT = class ShopGPT extends s {
|
|
3635
3725
|
.merchantUrl=${this.merchantUrl}
|
3636
3726
|
></chat-threads>
|
3637
3727
|
<products-section
|
3728
|
+
.merchantImage=${this.merchantImage}
|
3638
3729
|
.products=${this.products}
|
3639
3730
|
.isLoadingHistory=${this.isLoadingHistory}
|
3640
3731
|
.siteCurrency=${this.getSiteCurrency()}
|
3641
3732
|
></products-section>
|
3642
3733
|
<chat-section
|
3734
|
+
.prompts=${this.quickPrompts}
|
3735
|
+
.brandName=${this.brandName}
|
3643
3736
|
.isFailed=${this.isFailed}
|
3644
3737
|
.isLoadingHistory=${this.isLoadingHistory}
|
3645
3738
|
.isTyping=${this.isTyping}
|
@@ -3663,7 +3756,7 @@ let ShopGPT = class ShopGPT extends s {
|
|
3663
3756
|
this.modalState = 'close';
|
3664
3757
|
};
|
3665
3758
|
if (this.modalState === 'close') {
|
3666
|
-
return x
|
3759
|
+
return x ` <div class="chatbot-widget">
|
3667
3760
|
<button
|
3668
3761
|
@click=${(e) => {
|
3669
3762
|
e.preventDefault();
|
@@ -3677,6 +3770,8 @@ let ShopGPT = class ShopGPT extends s {
|
|
3677
3770
|
return x `
|
3678
3771
|
<div id="shop-gpt-modal" @delete-thread=${this.handleThreadDelete}>
|
3679
3772
|
<chat-section
|
3773
|
+
.prompts=${this.quickPrompts}
|
3774
|
+
.brandName=${this.brandName}
|
3680
3775
|
.isFailed=${this.isFailed}
|
3681
3776
|
.isLoadingHistory=${this.isLoadingHistory}
|
3682
3777
|
.isTyping=${this.isTyping}
|
@@ -3708,23 +3803,23 @@ __decorate([
|
|
3708
3803
|
], ShopGPT.prototype, "modalState", void 0);
|
3709
3804
|
__decorate([
|
3710
3805
|
n$1({ type: Boolean }),
|
3711
|
-
__metadata("design:type",
|
3806
|
+
__metadata("design:type", Object)
|
3712
3807
|
], ShopGPT.prototype, "isLoadingHistory", void 0);
|
3713
3808
|
__decorate([
|
3714
3809
|
n$1({ type: Boolean }),
|
3715
|
-
__metadata("design:type",
|
3810
|
+
__metadata("design:type", Object)
|
3716
3811
|
], ShopGPT.prototype, "isLoadingThreads", void 0);
|
3717
3812
|
__decorate([
|
3718
3813
|
n$1({ type: Boolean }),
|
3719
|
-
__metadata("design:type",
|
3814
|
+
__metadata("design:type", Object)
|
3720
3815
|
], ShopGPT.prototype, "isTyping", void 0);
|
3721
3816
|
__decorate([
|
3722
3817
|
n$1({ type: Boolean }),
|
3723
|
-
__metadata("design:type",
|
3818
|
+
__metadata("design:type", Object)
|
3724
3819
|
], ShopGPT.prototype, "isFailed", void 0);
|
3725
3820
|
__decorate([
|
3726
3821
|
n$1({ type: String }),
|
3727
|
-
__metadata("design:type",
|
3822
|
+
__metadata("design:type", Object)
|
3728
3823
|
], ShopGPT.prototype, "selectedThreadId", void 0);
|
3729
3824
|
__decorate([
|
3730
3825
|
n$1({ type: Array }),
|
@@ -3761,6 +3856,9 @@ if (typeof window != 'undefined' && typeof document != 'undefined') {
|
|
3761
3856
|
shopGPT.productHandles = params.productHandles;
|
3762
3857
|
shopGPT.uiMode = params.uiMode;
|
3763
3858
|
shopGPT.path = params.path;
|
3859
|
+
shopGPT.brandName = params.brandName;
|
3860
|
+
shopGPT.quickPrompts = params.quickPrompts;
|
3861
|
+
shopGPT.merchantImage = params.merchantImage;
|
3764
3862
|
document.body.append(shopGPT);
|
3765
3863
|
},
|
3766
3864
|
});
|