@blotoutio/providers-shop-gpt-sdk 1.11.5 → 1.11.6

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 CHANGED
@@ -969,6 +969,7 @@ const init = (params) => {
969
969
  nudge,
970
970
  sessionId: (_b = params.session) === null || _b === void 0 ? void 0 : _b.sessionId,
971
971
  loadUIManually,
972
+ userId: params.userId,
972
973
  });
973
974
  const searchParams = new URLSearchParams(window.location.search);
974
975
  const hasSource = searchParams.get('utm_source') === 'shopgpt';
@@ -2023,6 +2024,7 @@ class ProductItem extends r$2 {
2023
2024
  const link = new URL(url);
2024
2025
  link.searchParams.set('utm_source', 'shopgpt');
2025
2026
  link.searchParams.set('utm_medium', 'chat');
2027
+ link.searchParams.set('et_u_id', this.userId);
2026
2028
  open(link, '_self');
2027
2029
  }
2028
2030
  renderVariantTitles() {
@@ -2093,6 +2095,10 @@ __decorate([
2093
2095
  n({ type: Number }),
2094
2096
  __metadata("design:type", Number)
2095
2097
  ], ProductItem.prototype, "rank", void 0);
2098
+ __decorate([
2099
+ n({ type: String }),
2100
+ __metadata("design:type", String)
2101
+ ], ProductItem.prototype, "userId", void 0);
2096
2102
  if (!customElements.get('product-item')) {
2097
2103
  customElements.define('product-item', ProductItem);
2098
2104
  }
@@ -2222,6 +2228,7 @@ class ProductsList extends r$2 {
2222
2228
  .product=${product}
2223
2229
  .siteCurrency=${this.siteCurrency}
2224
2230
  .rank=${index + 1}
2231
+ .userId=${this.userId}
2225
2232
  ></product-item>
2226
2233
  </div>
2227
2234
  `)}
@@ -2257,6 +2264,10 @@ __decorate([
2257
2264
  n({ type: String }),
2258
2265
  __metadata("design:type", String)
2259
2266
  ], ProductsList.prototype, "response", void 0);
2267
+ __decorate([
2268
+ n({ type: String }),
2269
+ __metadata("design:type", String)
2270
+ ], ProductsList.prototype, "userId", void 0);
2260
2271
  __decorate([
2261
2272
  r(),
2262
2273
  __metadata("design:type", Object)
@@ -2325,6 +2336,7 @@ class ProductsSection extends r$2 {
2325
2336
  .product=${topResult}
2326
2337
  .siteCurrency=${this.siteCurrency}
2327
2338
  .rank=${1}
2339
+ .userId=${this.userId}
2328
2340
  ></product-item>
2329
2341
  </div>
2330
2342
  <span class="line"></span>
@@ -2336,6 +2348,7 @@ class ProductsSection extends r$2 {
2336
2348
  .products=${others}
2337
2349
  .siteCurrency=${this.siteCurrency}
2338
2350
  .viewType=${'overlay'}
2351
+ .userId=${this.userId}
2339
2352
  ></products-list>
2340
2353
  </div>
2341
2354
  `;
@@ -2382,6 +2395,10 @@ __decorate([
2382
2395
  n({ type: Array }),
2383
2396
  __metadata("design:type", Array)
2384
2397
  ], ProductsSection.prototype, "messages", void 0);
2398
+ __decorate([
2399
+ n({ type: String }),
2400
+ __metadata("design:type", String)
2401
+ ], ProductsSection.prototype, "userId", void 0);
2385
2402
  if (!customElements.get('products-section')) {
2386
2403
  customElements.define('products-section', ProductsSection);
2387
2404
  }
@@ -4212,6 +4229,7 @@ class ChatSection extends r$2 {
4212
4229
  .product=${message.products[0]}
4213
4230
  .siteCurrency=${this.siteCurrency}
4214
4231
  .rank=${1}
4232
+ .userId=${this.userId}
4215
4233
  ></product-item>
4216
4234
  </div>
4217
4235
  `
@@ -4225,6 +4243,7 @@ class ChatSection extends r$2 {
4225
4243
  .products=${message.products}
4226
4244
  .siteCurrency=${this.siteCurrency}
4227
4245
  .viewType=${this.viewType}
4246
+ .userId=${this.userId}
4228
4247
  ></products-list>`
4229
4248
  : E}
4230
4249
  ${message.messageId && (queryMessage === null || queryMessage === void 0 ? void 0 : queryMessage.messageId)
@@ -4810,6 +4829,10 @@ __decorate([
4810
4829
  n({ type: Boolean }),
4811
4830
  __metadata("design:type", Boolean)
4812
4831
  ], ChatSection.prototype, "fromAd", void 0);
4832
+ __decorate([
4833
+ n({ type: String }),
4834
+ __metadata("design:type", String)
4835
+ ], ChatSection.prototype, "userId", void 0);
4813
4836
  if (!customElements.get('chat-section')) {
4814
4837
  customElements.define('chat-section', ChatSection);
4815
4838
  }
@@ -5375,6 +5398,7 @@ class ShopGPT extends r$2 {
5375
5398
  .siteCurrency=${this.getSiteCurrency()}
5376
5399
  .isLoadingThreads=${this.isLoadingThreads}
5377
5400
  .css=${this.css}
5401
+ .userId=${this.userId}
5378
5402
  ></products-section>
5379
5403
  <chat-section
5380
5404
  .prompts=${this.quickPrompts}
@@ -5397,6 +5421,7 @@ class ShopGPT extends r$2 {
5397
5421
  .botIconUrl=${this.botIconUrl}
5398
5422
  .css=${this.css}
5399
5423
  .fromAd=${this.isFromAd()}
5424
+ .userId=${this.userId}
5400
5425
  ></chat-section>
5401
5426
  </div>
5402
5427
  </dialog>
@@ -5470,6 +5495,7 @@ class ShopGPT extends r$2 {
5470
5495
  .botIconUrl=${this.botIconUrl}
5471
5496
  .css=${this.css}
5472
5497
  .fromAd=${this.isFromAd()}
5498
+ .userId=${this.userId}
5473
5499
  ></chat-section>
5474
5500
  </div>
5475
5501
  `;
@@ -5617,6 +5643,7 @@ if (typeof window != 'undefined' && typeof document != 'undefined') {
5617
5643
  shopGPT.nudge = params.nudge;
5618
5644
  shopGPT.sessionId = params.sessionId;
5619
5645
  shopGPT.loadUIManually = params.loadUIManually;
5646
+ shopGPT.userId = params.userId;
5620
5647
  },
5621
5648
  loadUI() {
5622
5649
  if (!shopGPT) {
package/index.js CHANGED
@@ -970,6 +970,7 @@ var ProvidersShopGptSdk = (function () {
970
970
  nudge,
971
971
  sessionId: (_b = params.session) === null || _b === void 0 ? void 0 : _b.sessionId,
972
972
  loadUIManually,
973
+ userId: params.userId,
973
974
  });
974
975
  const searchParams = new URLSearchParams(window.location.search);
975
976
  const hasSource = searchParams.get('utm_source') === 'shopgpt';
@@ -2024,6 +2025,7 @@ var ProvidersShopGptSdk = (function () {
2024
2025
  const link = new URL(url);
2025
2026
  link.searchParams.set('utm_source', 'shopgpt');
2026
2027
  link.searchParams.set('utm_medium', 'chat');
2028
+ link.searchParams.set('et_u_id', this.userId);
2027
2029
  open(link, '_self');
2028
2030
  }
2029
2031
  renderVariantTitles() {
@@ -2094,6 +2096,10 @@ var ProvidersShopGptSdk = (function () {
2094
2096
  n({ type: Number }),
2095
2097
  __metadata("design:type", Number)
2096
2098
  ], ProductItem.prototype, "rank", void 0);
2099
+ __decorate([
2100
+ n({ type: String }),
2101
+ __metadata("design:type", String)
2102
+ ], ProductItem.prototype, "userId", void 0);
2097
2103
  if (!customElements.get('product-item')) {
2098
2104
  customElements.define('product-item', ProductItem);
2099
2105
  }
@@ -2223,6 +2229,7 @@ var ProvidersShopGptSdk = (function () {
2223
2229
  .product=${product}
2224
2230
  .siteCurrency=${this.siteCurrency}
2225
2231
  .rank=${index + 1}
2232
+ .userId=${this.userId}
2226
2233
  ></product-item>
2227
2234
  </div>
2228
2235
  `)}
@@ -2258,6 +2265,10 @@ var ProvidersShopGptSdk = (function () {
2258
2265
  n({ type: String }),
2259
2266
  __metadata("design:type", String)
2260
2267
  ], ProductsList.prototype, "response", void 0);
2268
+ __decorate([
2269
+ n({ type: String }),
2270
+ __metadata("design:type", String)
2271
+ ], ProductsList.prototype, "userId", void 0);
2261
2272
  __decorate([
2262
2273
  r(),
2263
2274
  __metadata("design:type", Object)
@@ -2326,6 +2337,7 @@ var ProvidersShopGptSdk = (function () {
2326
2337
  .product=${topResult}
2327
2338
  .siteCurrency=${this.siteCurrency}
2328
2339
  .rank=${1}
2340
+ .userId=${this.userId}
2329
2341
  ></product-item>
2330
2342
  </div>
2331
2343
  <span class="line"></span>
@@ -2337,6 +2349,7 @@ var ProvidersShopGptSdk = (function () {
2337
2349
  .products=${others}
2338
2350
  .siteCurrency=${this.siteCurrency}
2339
2351
  .viewType=${'overlay'}
2352
+ .userId=${this.userId}
2340
2353
  ></products-list>
2341
2354
  </div>
2342
2355
  `;
@@ -2383,6 +2396,10 @@ var ProvidersShopGptSdk = (function () {
2383
2396
  n({ type: Array }),
2384
2397
  __metadata("design:type", Array)
2385
2398
  ], ProductsSection.prototype, "messages", void 0);
2399
+ __decorate([
2400
+ n({ type: String }),
2401
+ __metadata("design:type", String)
2402
+ ], ProductsSection.prototype, "userId", void 0);
2386
2403
  if (!customElements.get('products-section')) {
2387
2404
  customElements.define('products-section', ProductsSection);
2388
2405
  }
@@ -4213,6 +4230,7 @@ ${this.comment ? this.comment : E}</textarea
4213
4230
  .product=${message.products[0]}
4214
4231
  .siteCurrency=${this.siteCurrency}
4215
4232
  .rank=${1}
4233
+ .userId=${this.userId}
4216
4234
  ></product-item>
4217
4235
  </div>
4218
4236
  `
@@ -4226,6 +4244,7 @@ ${this.comment ? this.comment : E}</textarea
4226
4244
  .products=${message.products}
4227
4245
  .siteCurrency=${this.siteCurrency}
4228
4246
  .viewType=${this.viewType}
4247
+ .userId=${this.userId}
4229
4248
  ></products-list>`
4230
4249
  : E}
4231
4250
  ${message.messageId && (queryMessage === null || queryMessage === void 0 ? void 0 : queryMessage.messageId)
@@ -4811,6 +4830,10 @@ ${this.comment ? this.comment : E}</textarea
4811
4830
  n({ type: Boolean }),
4812
4831
  __metadata("design:type", Boolean)
4813
4832
  ], ChatSection.prototype, "fromAd", void 0);
4833
+ __decorate([
4834
+ n({ type: String }),
4835
+ __metadata("design:type", String)
4836
+ ], ChatSection.prototype, "userId", void 0);
4814
4837
  if (!customElements.get('chat-section')) {
4815
4838
  customElements.define('chat-section', ChatSection);
4816
4839
  }
@@ -5376,6 +5399,7 @@ ${this.comment ? this.comment : E}</textarea
5376
5399
  .siteCurrency=${this.getSiteCurrency()}
5377
5400
  .isLoadingThreads=${this.isLoadingThreads}
5378
5401
  .css=${this.css}
5402
+ .userId=${this.userId}
5379
5403
  ></products-section>
5380
5404
  <chat-section
5381
5405
  .prompts=${this.quickPrompts}
@@ -5398,6 +5422,7 @@ ${this.comment ? this.comment : E}</textarea
5398
5422
  .botIconUrl=${this.botIconUrl}
5399
5423
  .css=${this.css}
5400
5424
  .fromAd=${this.isFromAd()}
5425
+ .userId=${this.userId}
5401
5426
  ></chat-section>
5402
5427
  </div>
5403
5428
  </dialog>
@@ -5471,6 +5496,7 @@ ${this.comment ? this.comment : E}</textarea
5471
5496
  .botIconUrl=${this.botIconUrl}
5472
5497
  .css=${this.css}
5473
5498
  .fromAd=${this.isFromAd()}
5499
+ .userId=${this.userId}
5474
5500
  ></chat-section>
5475
5501
  </div>
5476
5502
  `;
@@ -5618,6 +5644,7 @@ ${this.comment ? this.comment : E}</textarea
5618
5644
  shopGPT.nudge = params.nudge;
5619
5645
  shopGPT.sessionId = params.sessionId;
5620
5646
  shopGPT.loadUIManually = params.loadUIManually;
5647
+ shopGPT.userId = params.userId;
5621
5648
  },
5622
5649
  loadUI() {
5623
5650
  if (!shopGPT) {
package/index.mjs CHANGED
@@ -967,6 +967,7 @@ const init = (params) => {
967
967
  nudge,
968
968
  sessionId: (_b = params.session) === null || _b === void 0 ? void 0 : _b.sessionId,
969
969
  loadUIManually,
970
+ userId: params.userId,
970
971
  });
971
972
  const searchParams = new URLSearchParams(window.location.search);
972
973
  const hasSource = searchParams.get('utm_source') === 'shopgpt';
@@ -2021,6 +2022,7 @@ class ProductItem extends r$2 {
2021
2022
  const link = new URL(url);
2022
2023
  link.searchParams.set('utm_source', 'shopgpt');
2023
2024
  link.searchParams.set('utm_medium', 'chat');
2025
+ link.searchParams.set('et_u_id', this.userId);
2024
2026
  open(link, '_self');
2025
2027
  }
2026
2028
  renderVariantTitles() {
@@ -2091,6 +2093,10 @@ __decorate([
2091
2093
  n({ type: Number }),
2092
2094
  __metadata("design:type", Number)
2093
2095
  ], ProductItem.prototype, "rank", void 0);
2096
+ __decorate([
2097
+ n({ type: String }),
2098
+ __metadata("design:type", String)
2099
+ ], ProductItem.prototype, "userId", void 0);
2094
2100
  if (!customElements.get('product-item')) {
2095
2101
  customElements.define('product-item', ProductItem);
2096
2102
  }
@@ -2220,6 +2226,7 @@ class ProductsList extends r$2 {
2220
2226
  .product=${product}
2221
2227
  .siteCurrency=${this.siteCurrency}
2222
2228
  .rank=${index + 1}
2229
+ .userId=${this.userId}
2223
2230
  ></product-item>
2224
2231
  </div>
2225
2232
  `)}
@@ -2255,6 +2262,10 @@ __decorate([
2255
2262
  n({ type: String }),
2256
2263
  __metadata("design:type", String)
2257
2264
  ], ProductsList.prototype, "response", void 0);
2265
+ __decorate([
2266
+ n({ type: String }),
2267
+ __metadata("design:type", String)
2268
+ ], ProductsList.prototype, "userId", void 0);
2258
2269
  __decorate([
2259
2270
  r(),
2260
2271
  __metadata("design:type", Object)
@@ -2323,6 +2334,7 @@ class ProductsSection extends r$2 {
2323
2334
  .product=${topResult}
2324
2335
  .siteCurrency=${this.siteCurrency}
2325
2336
  .rank=${1}
2337
+ .userId=${this.userId}
2326
2338
  ></product-item>
2327
2339
  </div>
2328
2340
  <span class="line"></span>
@@ -2334,6 +2346,7 @@ class ProductsSection extends r$2 {
2334
2346
  .products=${others}
2335
2347
  .siteCurrency=${this.siteCurrency}
2336
2348
  .viewType=${'overlay'}
2349
+ .userId=${this.userId}
2337
2350
  ></products-list>
2338
2351
  </div>
2339
2352
  `;
@@ -2380,6 +2393,10 @@ __decorate([
2380
2393
  n({ type: Array }),
2381
2394
  __metadata("design:type", Array)
2382
2395
  ], ProductsSection.prototype, "messages", void 0);
2396
+ __decorate([
2397
+ n({ type: String }),
2398
+ __metadata("design:type", String)
2399
+ ], ProductsSection.prototype, "userId", void 0);
2383
2400
  if (!customElements.get('products-section')) {
2384
2401
  customElements.define('products-section', ProductsSection);
2385
2402
  }
@@ -4210,6 +4227,7 @@ class ChatSection extends r$2 {
4210
4227
  .product=${message.products[0]}
4211
4228
  .siteCurrency=${this.siteCurrency}
4212
4229
  .rank=${1}
4230
+ .userId=${this.userId}
4213
4231
  ></product-item>
4214
4232
  </div>
4215
4233
  `
@@ -4223,6 +4241,7 @@ class ChatSection extends r$2 {
4223
4241
  .products=${message.products}
4224
4242
  .siteCurrency=${this.siteCurrency}
4225
4243
  .viewType=${this.viewType}
4244
+ .userId=${this.userId}
4226
4245
  ></products-list>`
4227
4246
  : E}
4228
4247
  ${message.messageId && (queryMessage === null || queryMessage === void 0 ? void 0 : queryMessage.messageId)
@@ -4808,6 +4827,10 @@ __decorate([
4808
4827
  n({ type: Boolean }),
4809
4828
  __metadata("design:type", Boolean)
4810
4829
  ], ChatSection.prototype, "fromAd", void 0);
4830
+ __decorate([
4831
+ n({ type: String }),
4832
+ __metadata("design:type", String)
4833
+ ], ChatSection.prototype, "userId", void 0);
4811
4834
  if (!customElements.get('chat-section')) {
4812
4835
  customElements.define('chat-section', ChatSection);
4813
4836
  }
@@ -5373,6 +5396,7 @@ class ShopGPT extends r$2 {
5373
5396
  .siteCurrency=${this.getSiteCurrency()}
5374
5397
  .isLoadingThreads=${this.isLoadingThreads}
5375
5398
  .css=${this.css}
5399
+ .userId=${this.userId}
5376
5400
  ></products-section>
5377
5401
  <chat-section
5378
5402
  .prompts=${this.quickPrompts}
@@ -5395,6 +5419,7 @@ class ShopGPT extends r$2 {
5395
5419
  .botIconUrl=${this.botIconUrl}
5396
5420
  .css=${this.css}
5397
5421
  .fromAd=${this.isFromAd()}
5422
+ .userId=${this.userId}
5398
5423
  ></chat-section>
5399
5424
  </div>
5400
5425
  </dialog>
@@ -5468,6 +5493,7 @@ class ShopGPT extends r$2 {
5468
5493
  .botIconUrl=${this.botIconUrl}
5469
5494
  .css=${this.css}
5470
5495
  .fromAd=${this.isFromAd()}
5496
+ .userId=${this.userId}
5471
5497
  ></chat-section>
5472
5498
  </div>
5473
5499
  `;
@@ -5615,6 +5641,7 @@ if (typeof window != 'undefined' && typeof document != 'undefined') {
5615
5641
  shopGPT.nudge = params.nudge;
5616
5642
  shopGPT.sessionId = params.sessionId;
5617
5643
  shopGPT.loadUIManually = params.loadUIManually;
5644
+ shopGPT.userId = params.userId;
5618
5645
  },
5619
5646
  loadUI() {
5620
5647
  if (!shopGPT) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blotoutio/providers-shop-gpt-sdk",
3
- "version": "1.11.5",
3
+ "version": "1.11.6",
4
4
  "description": "Shop GPT SDK for EdgeTag",
5
5
  "author": "Blotout",
6
6
  "license": "MIT",