@gengage/assistant-fe 0.1.4 → 0.1.5
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/dist/chat/index.d.ts +12 -0
- package/dist/chat/index.d.ts.map +1 -1
- package/dist/chat.cjs +1 -1
- package/dist/chat.iife.js +24 -24
- package/dist/chat.iife.js.map +1 -1
- package/dist/chat.js +2 -2
- package/dist/common.cjs +1 -1
- package/dist/common.js +4 -4
- package/dist/index-eefqsSOT.cjs +13 -0
- package/dist/index-eefqsSOT.cjs.map +1 -0
- package/dist/{index-DC0Bo9EA.js → index-kp84NL1R.js} +781 -719
- package/dist/index-kp84NL1R.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/qna.js +1 -1
- package/dist/{schemas-CPkzbgia.js → schemas-B9GN-J3e.js} +6 -6
- package/dist/{schemas-CPkzbgia.js.map → schemas-B9GN-J3e.js.map} +1 -1
- package/dist/simrel.js +1 -1
- package/package.json +1 -1
- package/dist/index-DC0Bo9EA.js.map +0 -1
- package/dist/index-DHfTHscz.cjs +0 -13
- package/dist/index-DHfTHscz.cjs.map +0 -1
package/dist/chat.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./schemas-
|
|
2
|
-
import { G as c, e as s, c as n, a as o, d as p, b as d } from "./index-
|
|
1
|
+
import "./schemas-B9GN-J3e.js";
|
|
2
|
+
import { G as c, e as s, c as n, a as o, d as p, b as d } from "./index-kp84NL1R.js";
|
|
3
3
|
import "./quantity-stepper-B8kX8GbN.js";
|
|
4
4
|
export {
|
|
5
5
|
c as GengageChat,
|
package/dist/common.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./schemas-tCxs1sED.cjs"),u=require("./index-DHfTHscz.cjs"),q=require("./quantity-stepper-UbAp53Ow.cjs"),R=require("./qna.cjs"),M=require("./simrel.cjs"),g=n.object({enabled:n.boolean().default(!0)}),D=n.object({chat:n.string().optional(),qna:n.string().optional(),simrel:n.string().optional()}),L=n.object({}),v=n._enum(["none","x-api-key-header","bearer-header","body-api-key"]),F=n.object({mode:v.default("none"),key:n.string().optional(),headerName:n.string().optional(),bodyField:n.string().default("api_key")}),O=n.object({enabled:n.boolean().default(!0),endpoint:n.string().default("/analytics"),auth:F.default({mode:"none",bodyField:"api_key"}),fireAndForget:n.boolean().default(!0),useBeacon:n.boolean().default(!0),keepaliveFetch:n.boolean().default(!0),timeoutMs:n.number().int().positive().default(4e3),maxRetries:n.number().int().min(0).max(5).default(1)}),w="__gengageWidgetsInit",N=n.object({idempotencyKey:n.string().default(w),requireDomReady:n.boolean().default(!0)}),_=n._enum(["log-and-ignore","throw","delegate"]),B=n.object({unknownActionPolicy:_.default("log-and-ignore"),allowScriptCall:n.boolean().default(!1)}),f=n.object({version:n.literal("1"),accountId:n.string().min(1),middlewareUrl:n.string().url(),locale:n.string().optional(),widgets:n.object({chat:g.default({enabled:!0}),qna:g.default({enabled:!0}),simrel:g.default({enabled:!0})}),mounts:D.default({}),transport:L.default({}),analytics:O.default({enabled:!0,endpoint:"/analytics",auth:{mode:"none",bodyField:"api_key"},fireAndForget:!0,useBeacon:!0,keepaliveFetch:!0,timeoutMs:4e3,maxRetries:1}),gtm:N.default({idempotencyKey:"__gengageWidgetsInit",requireDomReady:!0}),actionHandling:B.default({unknownActionPolicy:"log-and-ignore",allowScriptCall:!1})});function T(e){return f.parse(e)}function C(e){return f.safeParse(e)}function W(e){return T({version:"1",accountId:e.accountId,middlewareUrl:e.middlewareUrl,locale:e.locale,widgets:{chat:{enabled:!0},qna:{enabled:!0},simrel:{enabled:!0}}})}const b=`${w}_overlay_`,$="#gengage-qna",G="#gengage-simrel";function m(){const e=window;return e.__gengageOverlayRegistry||(e.__gengageOverlayRegistry={instances:{},pending:{}}),e.__gengageOverlayRegistry}function H(e){const t={pageType:e.pageContext?.pageType??(e.sku!==void 0?"pdp":"other")},i=e.pageContext;return i?.sku!==void 0&&(t.sku=i.sku),i?.price!==void 0&&(t.price=i.price),i?.categoryTree!==void 0&&(t.categoryTree=i.categoryTree),i?.url!==void 0&&(t.url=i.url),i?.extra!==void 0&&(t.extra=i.extra),e.sku!==void 0&&(t.sku=e.sku),t}function z(e,t){const i={...e,...t,pageType:t.pageType??e.pageType};return t.sku===void 0&&e.sku!==void 0&&(i.sku=e.sku),i}function y(e){return e instanceof HTMLElement||document.querySelector(e)?e:null}function S(e){return e.idempotencyKey??`${b}${e.accountId}`}class K{constructor(t,i){this.options=t,this.onDestroy=i,this._chat=null,this._qna=null,this._simrel=null,this._analyticsClient=null,this._destroyed=!1,this._queue=Promise.resolve(),this._warnedQnaMountMissing=!1,this._warnedSimRelMountMissing=!1,this.idempotencyKey=S(t),this.session=n.resolveSession(t.session),this._pageContext=H(t)}get chat(){return this._chat}get qna(){return this._qna}get simrel(){return this._simrel}get analyticsClient(){return this._analyticsClient}async init(){window.gengage||(window.gengage={}),window.gengage.sessionId=this.session.sessionId,window.gengage.pageContext=this._pageContext,await this._initChat(),await this._syncPdpWidgets(),this.options.wireQnaToChat!==!1&&n.wireQNAToChat(),window.gengage.overlay=this}openChat(t){this._chat?.open(t)}closeChat(){this._chat?.close()}async updateContext(t){this._destroyed||await this._enqueue(async()=>{this._pageContext=z(this._pageContext,t),window.gengage||(window.gengage={}),window.gengage.pageContext=this._pageContext,this._chat?.update(t),this._qna?.update(t),this._simrel?.update(t),await this._syncPdpWidgets()})}async updateSku(t,i="pdp"){await this.updateContext({sku:t,pageType:i})}destroy(){this._destroyed||(this._destroyed=!0,this._chat?.destroy(),this._qna?.destroy(),this._simrel?.destroy(),this._chat=null,this._qna=null,this._simrel=null,window.gengage?.overlay===this&&delete window.gengage.overlay,this.onDestroy())}async _initChat(){if(this.options.chat?.enabled===!1)return;const t=this.options.middlewareUrl,i={accountId:this.options.accountId,middlewareUrl:t,session:this.session,pageContext:this._pageContext,variant:this.options.chat?.variant??"floating"};this.options.theme!==void 0&&(i.theme=this.options.theme),this.options.locale!==void 0&&(i.locale=this.options.locale),this.options.pricing!==void 0&&(i.pricing=this.options.pricing),this.options.chat?.mountTarget!==void 0&&(i.mountTarget=this.options.chat.mountTarget),this.options.chat?.launcherSvg!==void 0&&(i.launcherSvg=this.options.chat.launcherSvg),this.options.chat?.hideMobileLauncher!==void 0&&(i.hideMobileLauncher=this.options.chat.hideMobileLauncher),this.options.chat?.mobileBreakpoint!==void 0&&(i.mobileBreakpoint=this.options.chat.mobileBreakpoint),this.options.chat?.mobileInitialState!==void 0&&(i.mobileInitialState=this.options.chat.mobileInitialState),this.options.chat?.i18n!==void 0&&(i.i18n=this.options.chat.i18n),this.options.chat?.actionHandling!==void 0&&(i.actionHandling=this.options.chat.actionHandling),this.options.onScriptCall!==void 0&&(i.onScriptCall=this.options.onScriptCall),this._chat=new u.GengageChat,await this._chat.init(i)}async _syncPdpWidgets(){if(this._destroyed)return;const t=this._pageContext.sku;if(!(this._pageContext.pageType==="pdp"&&t!==void 0&&t.length>0)){this._destroyPdpWidgets();return}const o=this.options.middlewareUrl;if(this.options.qna?.enabled!==!1){const a=this.options.qna?.mountTarget??$,r=y(a);if(r)if(this._warnedQnaMountMissing=!1,this._qna)this._qna.show(),this._qna.update({pageType:"pdp",sku:t});else{const l=new R.GengageQNA,s={accountId:this.options.accountId,middlewareUrl:o,session:this.session,pageContext:{pageType:"pdp",sku:t},mountTarget:r};this.options.theme!==void 0&&(s.theme=this.options.theme),this.options.qna?.ctaText!==void 0&&(s.ctaText=this.options.qna.ctaText),this.options.qna?.inputPlaceholder!==void 0&&(s.inputPlaceholder=this.options.qna.inputPlaceholder),await l.init(s),this._qna=l}else this._qna?.destroy(),this._qna=null,this._warnedQnaMountMissing||(console.warn(`[gengage] QNA mount target not found: ${a}`),this._warnedQnaMountMissing=!0)}else this._qna?.destroy(),this._qna=null;if(this.options.simrel?.enabled!==!1){const a=this.options.simrel?.mountTarget??G,r=y(a);if(r)if(this._warnedSimRelMountMissing=!1,this._simrel)this._simrel.show(),this._simrel.update({pageType:"pdp",sku:t});else{const l=new M.GengageSimRel,s={accountId:this.options.accountId,middlewareUrl:o,session:this.session,sku:t,mountTarget:r};this.options.theme!==void 0&&(s.theme=this.options.theme),this.options.pricing!==void 0&&(s.pricing=this.options.pricing),this.options.simrel?.discountType!==void 0&&(s.discountType=this.options.simrel.discountType),this.options.onAddToCart!==void 0&&(s.onAddToCart=this.options.onAddToCart),this.options.onProductNavigate!==void 0?s.onProductNavigate=this.options.onProductNavigate:s.onProductNavigate=(c,d,h)=>{this._chat?.saveSession(h??this.session.sessionId,d),window.location.href=c},await l.init(s),this._simrel=l}else this._simrel?.destroy(),this._simrel=null,this._warnedSimRelMountMissing||(console.warn(`[gengage] SimRel mount target not found: ${a}`),this._warnedSimRelMountMissing=!0)}else this._simrel?.destroy(),this._simrel=null}_destroyPdpWidgets(){this._qna?.destroy(),this._simrel?.destroy(),this._qna=null,this._simrel=null}_enqueue(t){const i=this._queue.then(t);return this._queue=i.catch(o=>{}),i}}async function E(e){const t=S(e),i=m(),o=i.instances[t];if(o)return o;const a=i.pending[t];if(a)return a;const r=new K(e,()=>{const s=m();delete s.instances[t],delete s.pending[t]}),l=r.init().then(()=>(i.instances[t]=r,delete i.pending[t],r)).catch(s=>{throw delete i.pending[t],s});return i.pending[t]=l,l}function k(e){return m().instances[e]??null}function j(e){k(e)?.destroy()}function Q(e){return`${b}${e}`}const V={enabled:!0,endpoint:"/analytics",fireAndForget:!0,useBeacon:!0,keepaliveFetch:!0,timeoutMs:4e3,maxRetries:1,batchSize:10,flushIntervalMs:250},Y={mode:"none",key:"",headerName:"X-API-Key",bodyField:"api_key"};class A{constructor(t){this.queue=[],this.flushTimer=null,this.config={...V,...t,auth:{...Y,...t.auth??{}}},this.onPageHideBound=()=>{this.queue.length!==0&&this.flushAll({preferBeacon:!0})},typeof window<"u"&&window.addEventListener("pagehide",this.onPageHideBound)}track(t){if(!this.config.enabled)return;const i=Z(t);if(this.queue.push(i),this.queue.length>=this.config.batchSize){this.scheduleImmediateFlush();return}this.scheduleFlush()}async flush(t={}){if(!this.config.enabled||this.queue.length===0)return;const i=this.queue.splice(0,this.config.batchSize),o=this.buildTransportBody(i),a=J(this.config.endpoint,this.config.middlewareUrl),r=t.preferBeacon??this.config.useBeacon;await this.sendWithRetry(a,o,r)}async flushAll(t={}){for(;this.queue.length>0;)await this.flush(t)}destroy(){this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=null),this.queue.length>0&&this.flushAll({preferBeacon:!0}),typeof window<"u"&&window.removeEventListener("pagehide",this.onPageHideBound)}scheduleFlush(){this.flushTimer||(this.flushTimer=setTimeout(()=>{this.flushTimer=null,this.flush()},this.config.flushIntervalMs))}scheduleImmediateFlush(){this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=null),this.flush()}buildTransportBody(t){const i={events:t};return this.config.auth.mode==="body-api-key"&&this.config.auth.key&&(i[this.config.auth.bodyField]=this.config.auth.key),i}async sendWithRetry(t,i,o){let a=0;for(;a<=this.config.maxRetries;){a+=1;try{if(await this.send(t,i,o))return}catch{}a<=this.config.maxRetries&&await new Promise(r=>setTimeout(r,Math.min(1e3,100*Math.pow(2,a-1))))}}async send(t,i,o){const a=JSON.stringify(i);if(o&&this.config.useBeacon&&this.config.auth.mode!=="x-api-key-header"&&this.config.auth.mode!=="bearer-header"&&ee()){const d=new Blob([a],{type:"application/json"});if(navigator.sendBeacon(t,d))return!0}if(typeof fetch>"u")return!1;const l={"Content-Type":"application/json"};this.config.auth.mode==="x-api-key-header"&&this.config.auth.key&&(l[this.config.auth.headerName]=this.config.auth.key),this.config.auth.mode==="bearer-header"&&this.config.auth.key&&(l.Authorization=`Bearer ${this.config.auth.key}`);const s=typeof AbortController<"u"?new AbortController:null,c=s?setTimeout(()=>s.abort(),this.config.timeoutMs):null;try{const d={method:"POST",headers:l,body:a,keepalive:this.config.keepaliveFetch&&this.config.fireAndForget};return s&&(d.signal=s.signal),(await fetch(t,d)).ok}finally{c&&clearTimeout(c)}}}function X(e){return new A(e)}function Z(e){const t={event_name:e.event_name,event_version:e.event_version??"1",timestamp_ms:e.timestamp_ms??Date.now(),account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:e.payload};return e.view_id!==void 0&&(t.view_id=e.view_id),e.user_id!==void 0&&(t.user_id=e.user_id),e.widget!==void 0&&(t.widget=e.widget),e.page_type!==void 0&&(t.page_type=e.page_type),e.sku!==void 0&&(t.sku=e.sku),t}function J(e,t){if(/^https?:\/\//i.test(e))return e;const i=n.normalizeMiddlewareUrl(t),o=e.startsWith("/")?e:`/${e}`;return`${i}${o}`}function ee(){return typeof navigator<"u"&&typeof navigator.sendBeacon=="function"}const I={primaryColor:"#000000",primaryForeground:"#ffffff",backgroundColor:"#ffffff",foregroundColor:"#222222",borderRadius:"8px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',fontSize:"14px",zIndex:"1000","--glov-chatbot-width":"420px","--glov-left-spacing":"260px","--chatbot-padding":"16px","--root-wrapper-background-color":"#F2F2F2","--root-wrapper-border-color":"#E5E5E5","--gengage-chat-width":"400px","--gengage-chat-shell-radius":"12px","--gengage-chat-header-height":"60px","--gengage-chat-conversation-width":"396px","--gengage-chat-panel-min-width":"320px","--gengage-chat-panel-max-width":"860px","--gengage-chat-input-height":"48px","--gengage-qna-pill-radius":"999px","--gengage-qna-input-radius":"14px","--gengage-simrel-card-radius":"14px"};function te(e){return{...I,...e}}const p="tr";function ie(e){return{ACCOUNT_ID:e.accountId,MIDDLEWARE_URL:e.middlewareUrl,LOCALE:e.locale??p}}function ne(e,t={}){const i={accountId:e.accountId,middlewareUrl:e.middlewareUrl,session:{sessionId:e.sessionId},variant:"floating",locale:e.locale??p,...t};return e.theme!==void 0&&(i.theme=e.theme),i}function oe(e,t={}){const i={accountId:e.accountId,middlewareUrl:e.middlewareUrl,session:{sessionId:e.sessionId},pageContext:{pageType:"pdp",sku:e.sku},mountTarget:e.mountTarget,...t};return e.theme!==void 0&&(i.theme=e.theme),i}function se(e,t={}){const i={accountId:e.accountId,middlewareUrl:e.middlewareUrl,session:{sessionId:e.sessionId},sku:e.sku,mountTarget:e.mountTarget,...t};return e.theme!==void 0&&(i.theme=e.theme),i}function ae(e,t={}){return{enabled:!0,middlewareUrl:e,endpoint:"/analytics",fireAndForget:!0,useBeacon:!0,...t}}function re(e){try{return document.querySelector(e),!0}catch{return!1}}function x(e,t){const i=[],o=e.mounts,a=[["qna",o.qna],["simrel",o.simrel],["chat",o.chat]];for(const[l,s]of a)if(s!==void 0){if(!re(s)){i.push({code:"INVALID_SELECTOR",message:`[gengage preflight] ${l} mount selector is invalid CSS: "${s}"`,severity:"error"});continue}document.querySelector(s)||i.push({code:"MOUNT_NOT_FOUND",message:`[gengage preflight] ${l} mount target not found: "${s}" — widget will skip or wait for DOM`,severity:"warn"})}const r=e.gtm.idempotencyKey;if(window[r]!==void 0&&i.push({code:"DUPLICATE_IDEMPOTENCY",message:`[gengage preflight] window["${r}"] already exists — widgets may have already initialized`,severity:"warn"}),!t?.skipCspCheck){let l=!1;const s=c=>{c.blockedURI&&e.middlewareUrl.startsWith(c.blockedURI)&&(l=!0)};document.addEventListener("securitypolicyviolation",s);try{fetch(e.middlewareUrl,{method:"HEAD",mode:"no-cors"}).catch(()=>{})}catch{l=!0}document.removeEventListener("securitypolicyviolation",s),l&&i.push({code:"CSP_BLOCKED",message:`[gengage preflight] middleware URL may be blocked by Content-Security-Policy: "${e.middlewareUrl}". Add it to connect-src.`,severity:"warn"})}for(const l of i)l.severity==="error"?console.error(l.message):console.warn(l.message);return{ok:i.every(l=>l.severity!=="error"),warnings:i}}function le(e){const t=C(e);if(!t.success){const i=t.error.issues.map(o=>`${o.path.join(".")}: ${o.message}`).join("; ");throw new Error(`[gengage] Invalid runtime config: ${i}`)}return t.data}function ce(e,t,i){const o={accountId:e.accountId,middlewareUrl:e.middlewareUrl,idempotencyKey:e.gtm.idempotencyKey};return e.locale!==void 0&&(o.locale=e.locale),i!==void 0&&(o.pageContext=i,i.sku!==void 0&&(o.sku=i.sku)),o.chat={enabled:e.widgets.chat.enabled},e.mounts.chat!==void 0&&(o.chat.mountTarget=e.mounts.chat),o.qna={enabled:e.widgets.qna.enabled},e.mounts.qna!==void 0&&(o.qna.mountTarget=e.mounts.qna),o.simrel={enabled:e.widgets.simrel.enabled},e.mounts.simrel!==void 0&&(o.simrel.mountTarget=e.mounts.simrel),t?.onAddToCart!==void 0&&(o.onAddToCart=t.onAddToCart),t?.onProductNavigate!==void 0&&(o.onProductNavigate=t.onProductNavigate),t?.onScriptCall!==void 0&&(o.onScriptCall=t.onScriptCall),o}async function de(e){const t=le(e.runtimeConfig);if(e.preflight!==!1){const r=x(t);if(!r.ok){const l=r.warnings.filter(s=>s.severity==="error");throw new Error(`[gengage] Preflight failed: ${l.map(s=>s.message).join("; ")}`)}}const i=e.contextResolver?.(),o=ce(t,e.hostActions,i),a=await E(o);if(e.contextResolver!==void 0){const r=e.contextResolver,l=()=>{const c=r();a.updateContext(c)};window.addEventListener("gengage:context:update",l);const s=a.destroy.bind(a);a.destroy=()=>{window.removeEventListener("gengage:context:update",l),s()}}return a}const ue=[{pageType:"home",urlPatterns:["^/$","^/index\\.html?$","^/anasayfa$"]},{pageType:"search",urlPatterns:["/arama","/search","/ara\\?"],queryParam:"q"},{pageType:"cart",urlPatterns:["/sepet","/cart","/basket","/sepetim"]},{pageType:"plp",urlPatterns:["/kategori/","/category/","/c/","/koleksiyon/","/collection/"]},{pageType:"pdp",urlPatterns:["/urun/","/product/","/p/","/-p-","/-pm-"]}];function U(e,t){const i=t??(typeof window<"u"?new URL(window.location.href):null);if(!i)return"other";const o=e??ue,a=i.pathname;for(const r of o)if(!(r.urlPatterns&&!r.urlPatterns.some(s=>{try{return new RegExp(s,"i").test(a)}catch{return!1}}))&&!(r.queryParam&&!i.searchParams.has(r.queryParam))&&!(r.selector&&typeof document<"u"&&!document.querySelector(r.selector)))return r.pageType;return"other"}function P(e){const t=e??(typeof window<"u"?new URL(window.location.href):null);if(!t)return;const i=t.pathname,o=i.match(/\/(?:p|urun|product)\/([^/?#]+)/i);if(o?.[1])return o[1];const a=i.match(/-p-(\d+)/i);if(a?.[1])return a[1]}function he(e){const t=U(e),i={pageType:t};if(t==="pdp"){const o=P();o&&(i.sku=o)}return typeof window<"u"&&(i.url=window.location.href),i}exports.BaseWidget=n.BaseWidget;exports.DEFAULT_WIDGET_THEME_TOKENS=n.DEFAULT_WIDGET_THEME_TOKENS;exports.adaptV1Event=n.adaptV1Event;exports.basketAddEvent=n.basketAddEvent;exports.bootstrapSession=n.bootstrapSession;exports.buildChatEndpointUrl=n.buildChatEndpointUrl;exports.chatHistorySnapshotEvent=n.chatHistorySnapshotEvent;exports.checkoutCompleteEvent=n.checkoutCompleteEvent;exports.checkoutStartEvent=n.checkoutStartEvent;exports.consumeStream=n.consumeStream;exports.defaultUnknownUISpecRenderer=n.defaultUnknownUISpecRenderer;exports.dismissGlobalErrorToast=n.dismissGlobalErrorToast;exports.dispatch=n.dispatch;exports.getGlobalErrorMessage=n.getGlobalErrorMessage;exports.getWindowPageContext=n.getWindowPageContext;exports.listen=n.listen;exports.llmUsageEvent=n.llmUsageEvent;exports.mergeUISpecRegistry=n.mergeUISpecRegistry;exports.meteringIncrementEvent=n.meteringIncrementEvent;exports.meteringSummaryEvent=n.meteringSummaryEvent;exports.normalizeMiddlewareUrl=n.normalizeMiddlewareUrl;exports.normalizeProductGroupingsResponse=n.normalizeProductGroupingsResponse;exports.normalizeSimilarProductsResponse=n.normalizeSimilarProductsResponse;exports.productToNormalized=n.productToNormalized;exports.registerGlobalErrorToastListener=n.registerGlobalErrorToastListener;exports.renderUISpecWithRegistry=n.renderUISpecWithRegistry;exports.resolveSession=n.resolveSession;exports.showGlobalErrorToast=n.showGlobalErrorToast;exports.streamChunkEvent=n.streamChunkEvent;exports.streamDoneEvent=n.streamDoneEvent;exports.streamErrorEvent=n.streamErrorEvent;exports.streamPost=n.streamPost;exports.streamStartEvent=n.streamStartEvent;exports.streamUiSpecEvent=n.streamUiSpecEvent;exports.updatePageContext=n.updatePageContext;exports.widgetHistorySnapshotEvent=n.widgetHistorySnapshotEvent;exports.wireGADataLayer=n.wireGADataLayer;exports.wireQNAToChat=n.wireQNAToChat;exports.wireSimilarToChat=n.wireSimilarToChat;exports.withDefaultWidgetTheme=n.withDefaultWidgetTheme;exports.VoiceInput=u.VoiceInput;exports.isVoiceInputSupported=u.isVoiceInputSupported;exports.routeStreamAction=u.routeStreamAction;exports.sanitizeHtml=q.sanitizeHtml;exports.AccountRuntimeConfigSchema=f;exports.AnalyticsAuthModeSchema=v;exports.AnalyticsClient=A;exports.BASE_WIDGET_THEME=I;exports.DEFAULT_CUSTOMIZATION_LOCALE=p;exports.UnknownActionPolicySchema=_;exports.autoDetectPageContext=he;exports.buildOverlayIdempotencyKey=Q;exports.createAccountIdentity=ie;exports.createAnalyticsClient=X;exports.createDefaultAccountRuntimeConfig=W;exports.createDefaultAnalyticsConfig=ae;exports.createFloatingChatConfig=ne;exports.createPdpQnaConfig=oe;exports.createPdpSimRelConfig=se;exports.destroyOverlayWidgets=j;exports.detectPageType=U;exports.extractSkuFromUrl=P;exports.getOverlayWidgets=k;exports.initGengageClient=de;exports.initOverlayWidgets=E;exports.parseAccountRuntimeConfig=T;exports.preflightDiagnostics=x;exports.safeParseAccountRuntimeConfig=C;exports.withBaseTheme=te;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./schemas-tCxs1sED.cjs"),u=require("./index-eefqsSOT.cjs"),q=require("./quantity-stepper-UbAp53Ow.cjs"),R=require("./qna.cjs"),M=require("./simrel.cjs"),g=n.object({enabled:n.boolean().default(!0)}),D=n.object({chat:n.string().optional(),qna:n.string().optional(),simrel:n.string().optional()}),L=n.object({}),v=n._enum(["none","x-api-key-header","bearer-header","body-api-key"]),F=n.object({mode:v.default("none"),key:n.string().optional(),headerName:n.string().optional(),bodyField:n.string().default("api_key")}),O=n.object({enabled:n.boolean().default(!0),endpoint:n.string().default("/analytics"),auth:F.default({mode:"none",bodyField:"api_key"}),fireAndForget:n.boolean().default(!0),useBeacon:n.boolean().default(!0),keepaliveFetch:n.boolean().default(!0),timeoutMs:n.number().int().positive().default(4e3),maxRetries:n.number().int().min(0).max(5).default(1)}),w="__gengageWidgetsInit",N=n.object({idempotencyKey:n.string().default(w),requireDomReady:n.boolean().default(!0)}),_=n._enum(["log-and-ignore","throw","delegate"]),B=n.object({unknownActionPolicy:_.default("log-and-ignore"),allowScriptCall:n.boolean().default(!1)}),f=n.object({version:n.literal("1"),accountId:n.string().min(1),middlewareUrl:n.string().url(),locale:n.string().optional(),widgets:n.object({chat:g.default({enabled:!0}),qna:g.default({enabled:!0}),simrel:g.default({enabled:!0})}),mounts:D.default({}),transport:L.default({}),analytics:O.default({enabled:!0,endpoint:"/analytics",auth:{mode:"none",bodyField:"api_key"},fireAndForget:!0,useBeacon:!0,keepaliveFetch:!0,timeoutMs:4e3,maxRetries:1}),gtm:N.default({idempotencyKey:"__gengageWidgetsInit",requireDomReady:!0}),actionHandling:B.default({unknownActionPolicy:"log-and-ignore",allowScriptCall:!1})});function T(e){return f.parse(e)}function C(e){return f.safeParse(e)}function W(e){return T({version:"1",accountId:e.accountId,middlewareUrl:e.middlewareUrl,locale:e.locale,widgets:{chat:{enabled:!0},qna:{enabled:!0},simrel:{enabled:!0}}})}const b=`${w}_overlay_`,$="#gengage-qna",G="#gengage-simrel";function m(){const e=window;return e.__gengageOverlayRegistry||(e.__gengageOverlayRegistry={instances:{},pending:{}}),e.__gengageOverlayRegistry}function H(e){const t={pageType:e.pageContext?.pageType??(e.sku!==void 0?"pdp":"other")},i=e.pageContext;return i?.sku!==void 0&&(t.sku=i.sku),i?.price!==void 0&&(t.price=i.price),i?.categoryTree!==void 0&&(t.categoryTree=i.categoryTree),i?.url!==void 0&&(t.url=i.url),i?.extra!==void 0&&(t.extra=i.extra),e.sku!==void 0&&(t.sku=e.sku),t}function z(e,t){const i={...e,...t,pageType:t.pageType??e.pageType};return t.sku===void 0&&e.sku!==void 0&&(i.sku=e.sku),i}function y(e){return e instanceof HTMLElement||document.querySelector(e)?e:null}function S(e){return e.idempotencyKey??`${b}${e.accountId}`}class K{constructor(t,i){this.options=t,this.onDestroy=i,this._chat=null,this._qna=null,this._simrel=null,this._analyticsClient=null,this._destroyed=!1,this._queue=Promise.resolve(),this._warnedQnaMountMissing=!1,this._warnedSimRelMountMissing=!1,this.idempotencyKey=S(t),this.session=n.resolveSession(t.session),this._pageContext=H(t)}get chat(){return this._chat}get qna(){return this._qna}get simrel(){return this._simrel}get analyticsClient(){return this._analyticsClient}async init(){window.gengage||(window.gengage={}),window.gengage.sessionId=this.session.sessionId,window.gengage.pageContext=this._pageContext,await this._initChat(),await this._syncPdpWidgets(),this.options.wireQnaToChat!==!1&&n.wireQNAToChat(),window.gengage.overlay=this}openChat(t){this._chat?.open(t)}closeChat(){this._chat?.close()}async updateContext(t){this._destroyed||await this._enqueue(async()=>{this._pageContext=z(this._pageContext,t),window.gengage||(window.gengage={}),window.gengage.pageContext=this._pageContext,this._chat?.update(t),this._qna?.update(t),this._simrel?.update(t),await this._syncPdpWidgets()})}async updateSku(t,i="pdp"){await this.updateContext({sku:t,pageType:i})}destroy(){this._destroyed||(this._destroyed=!0,this._chat?.destroy(),this._qna?.destroy(),this._simrel?.destroy(),this._chat=null,this._qna=null,this._simrel=null,window.gengage?.overlay===this&&delete window.gengage.overlay,this.onDestroy())}async _initChat(){if(this.options.chat?.enabled===!1)return;const t=this.options.middlewareUrl,i={accountId:this.options.accountId,middlewareUrl:t,session:this.session,pageContext:this._pageContext,variant:this.options.chat?.variant??"floating"};this.options.theme!==void 0&&(i.theme=this.options.theme),this.options.locale!==void 0&&(i.locale=this.options.locale),this.options.pricing!==void 0&&(i.pricing=this.options.pricing),this.options.chat?.mountTarget!==void 0&&(i.mountTarget=this.options.chat.mountTarget),this.options.chat?.launcherSvg!==void 0&&(i.launcherSvg=this.options.chat.launcherSvg),this.options.chat?.hideMobileLauncher!==void 0&&(i.hideMobileLauncher=this.options.chat.hideMobileLauncher),this.options.chat?.mobileBreakpoint!==void 0&&(i.mobileBreakpoint=this.options.chat.mobileBreakpoint),this.options.chat?.mobileInitialState!==void 0&&(i.mobileInitialState=this.options.chat.mobileInitialState),this.options.chat?.i18n!==void 0&&(i.i18n=this.options.chat.i18n),this.options.chat?.actionHandling!==void 0&&(i.actionHandling=this.options.chat.actionHandling),this.options.onScriptCall!==void 0&&(i.onScriptCall=this.options.onScriptCall),this._chat=new u.GengageChat,await this._chat.init(i)}async _syncPdpWidgets(){if(this._destroyed)return;const t=this._pageContext.sku;if(!(this._pageContext.pageType==="pdp"&&t!==void 0&&t.length>0)){this._destroyPdpWidgets();return}const o=this.options.middlewareUrl;if(this.options.qna?.enabled!==!1){const a=this.options.qna?.mountTarget??$,r=y(a);if(r)if(this._warnedQnaMountMissing=!1,this._qna)this._qna.show(),this._qna.update({pageType:"pdp",sku:t});else{const l=new R.GengageQNA,s={accountId:this.options.accountId,middlewareUrl:o,session:this.session,pageContext:{pageType:"pdp",sku:t},mountTarget:r};this.options.theme!==void 0&&(s.theme=this.options.theme),this.options.qna?.ctaText!==void 0&&(s.ctaText=this.options.qna.ctaText),this.options.qna?.inputPlaceholder!==void 0&&(s.inputPlaceholder=this.options.qna.inputPlaceholder),await l.init(s),this._qna=l}else this._qna?.destroy(),this._qna=null,this._warnedQnaMountMissing||(console.warn(`[gengage] QNA mount target not found: ${a}`),this._warnedQnaMountMissing=!0)}else this._qna?.destroy(),this._qna=null;if(this.options.simrel?.enabled!==!1){const a=this.options.simrel?.mountTarget??G,r=y(a);if(r)if(this._warnedSimRelMountMissing=!1,this._simrel)this._simrel.show(),this._simrel.update({pageType:"pdp",sku:t});else{const l=new M.GengageSimRel,s={accountId:this.options.accountId,middlewareUrl:o,session:this.session,sku:t,mountTarget:r};this.options.theme!==void 0&&(s.theme=this.options.theme),this.options.pricing!==void 0&&(s.pricing=this.options.pricing),this.options.simrel?.discountType!==void 0&&(s.discountType=this.options.simrel.discountType),this.options.onAddToCart!==void 0&&(s.onAddToCart=this.options.onAddToCart),this.options.onProductNavigate!==void 0?s.onProductNavigate=this.options.onProductNavigate:s.onProductNavigate=(c,d,h)=>{this._chat?.saveSession(h??this.session.sessionId,d),window.location.href=c},await l.init(s),this._simrel=l}else this._simrel?.destroy(),this._simrel=null,this._warnedSimRelMountMissing||(console.warn(`[gengage] SimRel mount target not found: ${a}`),this._warnedSimRelMountMissing=!0)}else this._simrel?.destroy(),this._simrel=null}_destroyPdpWidgets(){this._qna?.destroy(),this._simrel?.destroy(),this._qna=null,this._simrel=null}_enqueue(t){const i=this._queue.then(t);return this._queue=i.catch(o=>{}),i}}async function E(e){const t=S(e),i=m(),o=i.instances[t];if(o)return o;const a=i.pending[t];if(a)return a;const r=new K(e,()=>{const s=m();delete s.instances[t],delete s.pending[t]}),l=r.init().then(()=>(i.instances[t]=r,delete i.pending[t],r)).catch(s=>{throw delete i.pending[t],s});return i.pending[t]=l,l}function k(e){return m().instances[e]??null}function j(e){k(e)?.destroy()}function Q(e){return`${b}${e}`}const V={enabled:!0,endpoint:"/analytics",fireAndForget:!0,useBeacon:!0,keepaliveFetch:!0,timeoutMs:4e3,maxRetries:1,batchSize:10,flushIntervalMs:250},Y={mode:"none",key:"",headerName:"X-API-Key",bodyField:"api_key"};class A{constructor(t){this.queue=[],this.flushTimer=null,this.config={...V,...t,auth:{...Y,...t.auth??{}}},this.onPageHideBound=()=>{this.queue.length!==0&&this.flushAll({preferBeacon:!0})},typeof window<"u"&&window.addEventListener("pagehide",this.onPageHideBound)}track(t){if(!this.config.enabled)return;const i=Z(t);if(this.queue.push(i),this.queue.length>=this.config.batchSize){this.scheduleImmediateFlush();return}this.scheduleFlush()}async flush(t={}){if(!this.config.enabled||this.queue.length===0)return;const i=this.queue.splice(0,this.config.batchSize),o=this.buildTransportBody(i),a=J(this.config.endpoint,this.config.middlewareUrl),r=t.preferBeacon??this.config.useBeacon;await this.sendWithRetry(a,o,r)}async flushAll(t={}){for(;this.queue.length>0;)await this.flush(t)}destroy(){this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=null),this.queue.length>0&&this.flushAll({preferBeacon:!0}),typeof window<"u"&&window.removeEventListener("pagehide",this.onPageHideBound)}scheduleFlush(){this.flushTimer||(this.flushTimer=setTimeout(()=>{this.flushTimer=null,this.flush()},this.config.flushIntervalMs))}scheduleImmediateFlush(){this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=null),this.flush()}buildTransportBody(t){const i={events:t};return this.config.auth.mode==="body-api-key"&&this.config.auth.key&&(i[this.config.auth.bodyField]=this.config.auth.key),i}async sendWithRetry(t,i,o){let a=0;for(;a<=this.config.maxRetries;){a+=1;try{if(await this.send(t,i,o))return}catch{}a<=this.config.maxRetries&&await new Promise(r=>setTimeout(r,Math.min(1e3,100*Math.pow(2,a-1))))}}async send(t,i,o){const a=JSON.stringify(i);if(o&&this.config.useBeacon&&this.config.auth.mode!=="x-api-key-header"&&this.config.auth.mode!=="bearer-header"&&ee()){const d=new Blob([a],{type:"application/json"});if(navigator.sendBeacon(t,d))return!0}if(typeof fetch>"u")return!1;const l={"Content-Type":"application/json"};this.config.auth.mode==="x-api-key-header"&&this.config.auth.key&&(l[this.config.auth.headerName]=this.config.auth.key),this.config.auth.mode==="bearer-header"&&this.config.auth.key&&(l.Authorization=`Bearer ${this.config.auth.key}`);const s=typeof AbortController<"u"?new AbortController:null,c=s?setTimeout(()=>s.abort(),this.config.timeoutMs):null;try{const d={method:"POST",headers:l,body:a,keepalive:this.config.keepaliveFetch&&this.config.fireAndForget};return s&&(d.signal=s.signal),(await fetch(t,d)).ok}finally{c&&clearTimeout(c)}}}function X(e){return new A(e)}function Z(e){const t={event_name:e.event_name,event_version:e.event_version??"1",timestamp_ms:e.timestamp_ms??Date.now(),account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:e.payload};return e.view_id!==void 0&&(t.view_id=e.view_id),e.user_id!==void 0&&(t.user_id=e.user_id),e.widget!==void 0&&(t.widget=e.widget),e.page_type!==void 0&&(t.page_type=e.page_type),e.sku!==void 0&&(t.sku=e.sku),t}function J(e,t){if(/^https?:\/\//i.test(e))return e;const i=n.normalizeMiddlewareUrl(t),o=e.startsWith("/")?e:`/${e}`;return`${i}${o}`}function ee(){return typeof navigator<"u"&&typeof navigator.sendBeacon=="function"}const I={primaryColor:"#000000",primaryForeground:"#ffffff",backgroundColor:"#ffffff",foregroundColor:"#222222",borderRadius:"8px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',fontSize:"14px",zIndex:"1000","--glov-chatbot-width":"420px","--glov-left-spacing":"260px","--chatbot-padding":"16px","--root-wrapper-background-color":"#F2F2F2","--root-wrapper-border-color":"#E5E5E5","--gengage-chat-width":"400px","--gengage-chat-shell-radius":"12px","--gengage-chat-header-height":"60px","--gengage-chat-conversation-width":"396px","--gengage-chat-panel-min-width":"320px","--gengage-chat-panel-max-width":"860px","--gengage-chat-input-height":"48px","--gengage-qna-pill-radius":"999px","--gengage-qna-input-radius":"14px","--gengage-simrel-card-radius":"14px"};function te(e){return{...I,...e}}const p="tr";function ie(e){return{ACCOUNT_ID:e.accountId,MIDDLEWARE_URL:e.middlewareUrl,LOCALE:e.locale??p}}function ne(e,t={}){const i={accountId:e.accountId,middlewareUrl:e.middlewareUrl,session:{sessionId:e.sessionId},variant:"floating",locale:e.locale??p,...t};return e.theme!==void 0&&(i.theme=e.theme),i}function oe(e,t={}){const i={accountId:e.accountId,middlewareUrl:e.middlewareUrl,session:{sessionId:e.sessionId},pageContext:{pageType:"pdp",sku:e.sku},mountTarget:e.mountTarget,...t};return e.theme!==void 0&&(i.theme=e.theme),i}function se(e,t={}){const i={accountId:e.accountId,middlewareUrl:e.middlewareUrl,session:{sessionId:e.sessionId},sku:e.sku,mountTarget:e.mountTarget,...t};return e.theme!==void 0&&(i.theme=e.theme),i}function ae(e,t={}){return{enabled:!0,middlewareUrl:e,endpoint:"/analytics",fireAndForget:!0,useBeacon:!0,...t}}function re(e){try{return document.querySelector(e),!0}catch{return!1}}function x(e,t){const i=[],o=e.mounts,a=[["qna",o.qna],["simrel",o.simrel],["chat",o.chat]];for(const[l,s]of a)if(s!==void 0){if(!re(s)){i.push({code:"INVALID_SELECTOR",message:`[gengage preflight] ${l} mount selector is invalid CSS: "${s}"`,severity:"error"});continue}document.querySelector(s)||i.push({code:"MOUNT_NOT_FOUND",message:`[gengage preflight] ${l} mount target not found: "${s}" — widget will skip or wait for DOM`,severity:"warn"})}const r=e.gtm.idempotencyKey;if(window[r]!==void 0&&i.push({code:"DUPLICATE_IDEMPOTENCY",message:`[gengage preflight] window["${r}"] already exists — widgets may have already initialized`,severity:"warn"}),!t?.skipCspCheck){let l=!1;const s=c=>{c.blockedURI&&e.middlewareUrl.startsWith(c.blockedURI)&&(l=!0)};document.addEventListener("securitypolicyviolation",s);try{fetch(e.middlewareUrl,{method:"HEAD",mode:"no-cors"}).catch(()=>{})}catch{l=!0}document.removeEventListener("securitypolicyviolation",s),l&&i.push({code:"CSP_BLOCKED",message:`[gengage preflight] middleware URL may be blocked by Content-Security-Policy: "${e.middlewareUrl}". Add it to connect-src.`,severity:"warn"})}for(const l of i)l.severity==="error"?console.error(l.message):console.warn(l.message);return{ok:i.every(l=>l.severity!=="error"),warnings:i}}function le(e){const t=C(e);if(!t.success){const i=t.error.issues.map(o=>`${o.path.join(".")}: ${o.message}`).join("; ");throw new Error(`[gengage] Invalid runtime config: ${i}`)}return t.data}function ce(e,t,i){const o={accountId:e.accountId,middlewareUrl:e.middlewareUrl,idempotencyKey:e.gtm.idempotencyKey};return e.locale!==void 0&&(o.locale=e.locale),i!==void 0&&(o.pageContext=i,i.sku!==void 0&&(o.sku=i.sku)),o.chat={enabled:e.widgets.chat.enabled},e.mounts.chat!==void 0&&(o.chat.mountTarget=e.mounts.chat),o.qna={enabled:e.widgets.qna.enabled},e.mounts.qna!==void 0&&(o.qna.mountTarget=e.mounts.qna),o.simrel={enabled:e.widgets.simrel.enabled},e.mounts.simrel!==void 0&&(o.simrel.mountTarget=e.mounts.simrel),t?.onAddToCart!==void 0&&(o.onAddToCart=t.onAddToCart),t?.onProductNavigate!==void 0&&(o.onProductNavigate=t.onProductNavigate),t?.onScriptCall!==void 0&&(o.onScriptCall=t.onScriptCall),o}async function de(e){const t=le(e.runtimeConfig);if(e.preflight!==!1){const r=x(t);if(!r.ok){const l=r.warnings.filter(s=>s.severity==="error");throw new Error(`[gengage] Preflight failed: ${l.map(s=>s.message).join("; ")}`)}}const i=e.contextResolver?.(),o=ce(t,e.hostActions,i),a=await E(o);if(e.contextResolver!==void 0){const r=e.contextResolver,l=()=>{const c=r();a.updateContext(c)};window.addEventListener("gengage:context:update",l);const s=a.destroy.bind(a);a.destroy=()=>{window.removeEventListener("gengage:context:update",l),s()}}return a}const ue=[{pageType:"home",urlPatterns:["^/$","^/index\\.html?$","^/anasayfa$"]},{pageType:"search",urlPatterns:["/arama","/search","/ara\\?"],queryParam:"q"},{pageType:"cart",urlPatterns:["/sepet","/cart","/basket","/sepetim"]},{pageType:"plp",urlPatterns:["/kategori/","/category/","/c/","/koleksiyon/","/collection/"]},{pageType:"pdp",urlPatterns:["/urun/","/product/","/p/","/-p-","/-pm-"]}];function U(e,t){const i=t??(typeof window<"u"?new URL(window.location.href):null);if(!i)return"other";const o=e??ue,a=i.pathname;for(const r of o)if(!(r.urlPatterns&&!r.urlPatterns.some(s=>{try{return new RegExp(s,"i").test(a)}catch{return!1}}))&&!(r.queryParam&&!i.searchParams.has(r.queryParam))&&!(r.selector&&typeof document<"u"&&!document.querySelector(r.selector)))return r.pageType;return"other"}function P(e){const t=e??(typeof window<"u"?new URL(window.location.href):null);if(!t)return;const i=t.pathname,o=i.match(/\/(?:p|urun|product)\/([^/?#]+)/i);if(o?.[1])return o[1];const a=i.match(/-p-(\d+)/i);if(a?.[1])return a[1]}function he(e){const t=U(e),i={pageType:t};if(t==="pdp"){const o=P();o&&(i.sku=o)}return typeof window<"u"&&(i.url=window.location.href),i}exports.BaseWidget=n.BaseWidget;exports.DEFAULT_WIDGET_THEME_TOKENS=n.DEFAULT_WIDGET_THEME_TOKENS;exports.adaptV1Event=n.adaptV1Event;exports.basketAddEvent=n.basketAddEvent;exports.bootstrapSession=n.bootstrapSession;exports.buildChatEndpointUrl=n.buildChatEndpointUrl;exports.chatHistorySnapshotEvent=n.chatHistorySnapshotEvent;exports.checkoutCompleteEvent=n.checkoutCompleteEvent;exports.checkoutStartEvent=n.checkoutStartEvent;exports.consumeStream=n.consumeStream;exports.defaultUnknownUISpecRenderer=n.defaultUnknownUISpecRenderer;exports.dismissGlobalErrorToast=n.dismissGlobalErrorToast;exports.dispatch=n.dispatch;exports.getGlobalErrorMessage=n.getGlobalErrorMessage;exports.getWindowPageContext=n.getWindowPageContext;exports.listen=n.listen;exports.llmUsageEvent=n.llmUsageEvent;exports.mergeUISpecRegistry=n.mergeUISpecRegistry;exports.meteringIncrementEvent=n.meteringIncrementEvent;exports.meteringSummaryEvent=n.meteringSummaryEvent;exports.normalizeMiddlewareUrl=n.normalizeMiddlewareUrl;exports.normalizeProductGroupingsResponse=n.normalizeProductGroupingsResponse;exports.normalizeSimilarProductsResponse=n.normalizeSimilarProductsResponse;exports.productToNormalized=n.productToNormalized;exports.registerGlobalErrorToastListener=n.registerGlobalErrorToastListener;exports.renderUISpecWithRegistry=n.renderUISpecWithRegistry;exports.resolveSession=n.resolveSession;exports.showGlobalErrorToast=n.showGlobalErrorToast;exports.streamChunkEvent=n.streamChunkEvent;exports.streamDoneEvent=n.streamDoneEvent;exports.streamErrorEvent=n.streamErrorEvent;exports.streamPost=n.streamPost;exports.streamStartEvent=n.streamStartEvent;exports.streamUiSpecEvent=n.streamUiSpecEvent;exports.updatePageContext=n.updatePageContext;exports.widgetHistorySnapshotEvent=n.widgetHistorySnapshotEvent;exports.wireGADataLayer=n.wireGADataLayer;exports.wireQNAToChat=n.wireQNAToChat;exports.wireSimilarToChat=n.wireSimilarToChat;exports.withDefaultWidgetTheme=n.withDefaultWidgetTheme;exports.VoiceInput=u.VoiceInput;exports.isVoiceInputSupported=u.isVoiceInputSupported;exports.routeStreamAction=u.routeStreamAction;exports.sanitizeHtml=q.sanitizeHtml;exports.AccountRuntimeConfigSchema=f;exports.AnalyticsAuthModeSchema=v;exports.AnalyticsClient=A;exports.BASE_WIDGET_THEME=I;exports.DEFAULT_CUSTOMIZATION_LOCALE=p;exports.UnknownActionPolicySchema=_;exports.autoDetectPageContext=he;exports.buildOverlayIdempotencyKey=Q;exports.createAccountIdentity=ie;exports.createAnalyticsClient=X;exports.createDefaultAccountRuntimeConfig=W;exports.createDefaultAnalyticsConfig=ae;exports.createFloatingChatConfig=ne;exports.createPdpQnaConfig=oe;exports.createPdpSimRelConfig=se;exports.destroyOverlayWidgets=j;exports.detectPageType=U;exports.extractSkuFromUrl=P;exports.getOverlayWidgets=k;exports.initGengageClient=de;exports.initOverlayWidgets=E;exports.parseAccountRuntimeConfig=T;exports.preflightDiagnostics=x;exports.safeParseAccountRuntimeConfig=C;exports.withBaseTheme=te;
|
|
2
2
|
//# sourceMappingURL=common.cjs.map
|
package/dist/common.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { o as d, s as l, U as k, _ as w, d as u, v as m, V as S, W as x, A as E } from "./schemas-
|
|
2
|
-
import { B as xe, X as Ee, a as Ie, z as Ae, Y as qe, b as Pe, N as Ue, Z as Re, $ as Me, c as Le, a0 as Fe, a1 as De, j as Oe, k as Be, a2 as Ne, a3 as $e, P as We, m as He, M as ze, a4 as Ge, q as Ke, p as Qe, a5 as Ve, a6 as je, r as Ye, a7 as Xe, T as Ze, h as Je, l as et, a8 as tt, g as it, Q as nt, a9 as ot, w as st, aa as at, ab as rt, ac as lt } from "./schemas-
|
|
3
|
-
import { G as I } from "./index-
|
|
4
|
-
import { V as dt, i as ut, r as ht } from "./index-
|
|
1
|
+
import { o as d, s as l, U as k, _ as w, d as u, v as m, V as S, W as x, A as E } from "./schemas-B9GN-J3e.js";
|
|
2
|
+
import { B as xe, X as Ee, a as Ie, z as Ae, Y as qe, b as Pe, N as Ue, Z as Re, $ as Me, c as Le, a0 as Fe, a1 as De, j as Oe, k as Be, a2 as Ne, a3 as $e, P as We, m as He, M as ze, a4 as Ge, q as Ke, p as Qe, a5 as Ve, a6 as je, r as Ye, a7 as Xe, T as Ze, h as Je, l as et, a8 as tt, g as it, Q as nt, a9 as ot, w as st, aa as at, ab as rt, ac as lt } from "./schemas-B9GN-J3e.js";
|
|
3
|
+
import { G as I } from "./index-kp84NL1R.js";
|
|
4
|
+
import { V as dt, i as ut, r as ht } from "./index-kp84NL1R.js";
|
|
5
5
|
import { s as ft } from "./quantity-stepper-B8kX8GbN.js";
|
|
6
6
|
import { GengageQNA as A } from "./qna.js";
|
|
7
7
|
import { GengageSimRel as q } from "./simrel.js";
|