@modainteract/moda-interact-shared 5.12.3 → 5.12.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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CommerceProductSchema
3
- } from "./chunk-W5Y5ZLGN.js";
3
+ } from "./chunk-TFUUXKMI.js";
4
4
 
5
5
  // src/commerce/presentation/product-image.ts
6
6
  import { z } from "zod";
@@ -181,4 +181,4 @@ export {
181
181
  digest,
182
182
  readPreparedWrapper
183
183
  };
184
- //# sourceMappingURL=chunk-SOAGFZ7A.js.map
184
+ //# sourceMappingURL=chunk-724PTEP6.js.map
@@ -7,7 +7,7 @@ import {
7
7
  isBuiltInTool,
8
8
  isTrustedCommerceBuiltInDescriptor,
9
9
  isTrustedCommerceBuiltInGrant
10
- } from "./chunk-W5Y5ZLGN.js";
10
+ } from "./chunk-TFUUXKMI.js";
11
11
  import {
12
12
  IdSchema
13
13
  } from "./chunk-GCCT2BDE.js";
@@ -102,4 +102,4 @@ export {
102
102
  currentlyGrantedTools,
103
103
  verifyCommerceAnswerPresentationSelection
104
104
  };
105
- //# sourceMappingURL=chunk-VJNXWDA5.js.map
105
+ //# sourceMappingURL=chunk-C53TPPK3.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  CommerceProductSchema,
3
3
  CommerceProductSelectedOptionsSchema
4
- } from "./chunk-W5Y5ZLGN.js";
4
+ } from "./chunk-TFUUXKMI.js";
5
5
 
6
6
  // src/commerce/product-context.ts
7
7
  import { z } from "zod";
@@ -73,4 +73,4 @@ export {
73
73
  resolveConversationProductReference,
74
74
  recordCommerceProductPresentation
75
75
  };
76
- //# sourceMappingURL=chunk-JWX4ZVKK.js.map
76
+ //# sourceMappingURL=chunk-QXS7H6FR.js.map
@@ -1577,9 +1577,18 @@ var CommerceToolOutputs = {
1577
1577
  commerce_find_qualifying_products: alternatives,
1578
1578
  commerce_find_similar_products: alternatives
1579
1579
  };
1580
+ function commerceStoreHostname(value) {
1581
+ try {
1582
+ if (!value || /[\\\s]/u.test(value)) return null;
1583
+ const url = new URL(value.includes("://") ? value : `https://${value}`);
1584
+ return url.protocol === "https:" && !url.username && !url.password && !url.port && url.pathname === "/" && !url.search && !url.hash ? url.hostname.toLowerCase() : null;
1585
+ } catch {
1586
+ return null;
1587
+ }
1588
+ }
1580
1589
  function productBelongsToDomain(product, verifiedDomain) {
1581
1590
  try {
1582
- return product.url === null || new URL(product.url).hostname === verifiedDomain;
1591
+ return product.url === null || commerceStoreHostname(verifiedDomain) !== null && new URL(product.url).protocol === "https:" && !new URL(product.url).username && !new URL(product.url).password && !new URL(product.url).port && new URL(product.url).hostname === commerceStoreHostname(verifiedDomain);
1583
1592
  } catch {
1584
1593
  return false;
1585
1594
  }
@@ -1694,6 +1703,7 @@ export {
1694
1703
  CommerceShippingInformationSchema,
1695
1704
  CommerceToolInputs,
1696
1705
  CommerceToolOutputs,
1706
+ commerceStoreHostname,
1697
1707
  productBelongsToDomain
1698
1708
  };
1699
- //# sourceMappingURL=chunk-W5Y5ZLGN.js.map
1709
+ //# sourceMappingURL=chunk-TFUUXKMI.js.map