@ikas/bp-storefront 2.5.0 → 2.6.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.
@@ -1,62 +1,97 @@
1
1
  import { IkasImage } from "../../../storefront-models/src";
2
2
  /**
3
- * Returns the default source URL for an image at 1080px resolution.
3
+ * Returns the default source URL for an image OR video at 1080px resolution.
4
+ *
5
+ * Product media items (IkasProductImage) can be videos. ALWAYS check `item.isVideo`
6
+ * and render a `<video src={getDefaultSrc(item)}>` instead of an `<img>` when it is true.
7
+ * Never assume every media item is an image.
4
8
  *
5
9
  * @ai-category Image
6
10
  * @ai-related getThumbnailSrc, getSrc, createMediaSrcset
7
11
  *
8
12
  * @param image - The image object to generate the default source URL for.
9
- * @returns The CDN URL string for the image at 1080px size.
13
+ * @returns The CDN URL string for the image or video at 1080px size.
10
14
  *
11
15
  * @example
12
16
  * ```typescript
13
- * import { getDefaultSrc } from "@ikas/bp-storefront";
14
- *
15
- * const src = getDefaultSrc(image);
16
- * console.log(src); // "https://cdn.example.com/images/.../1080/image.webp"
17
+ * import { getDefaultSrc, createMediaSrcset } from "@ikas/bp-storefront";
18
+ *
19
+ * // Product images can be videos — ALWAYS branch on isVideo when mapping media:
20
+ * {product.images.map((item, i) =>
21
+ * item.isVideo ? (
22
+ * <video key={i} src={getDefaultSrc(item)} muted playsInline preload="metadata">
23
+ * <track kind="captions" />
24
+ * </video>
25
+ * ) : (
26
+ * <img key={i} src={getDefaultSrc(item)} srcSet={createMediaSrcset(item)} alt={`Product ${i + 1}`} />
27
+ * )
28
+ * )}
17
29
  * ```
18
30
  */
19
31
  export declare function getDefaultSrc(image: IkasImage): string;
20
32
  /**
21
- * Returns the thumbnail source URL for an image at 180px resolution.
33
+ * Returns the thumbnail source URL for an image OR video at 180px resolution.
34
+ *
35
+ * When mapping over product media (IkasProductImage[]), some items are videos:
36
+ * check `item.isVideo` and render a `<video>` thumbnail (typically with a play
37
+ * overlay) instead of an `<img>` when it is true.
22
38
  *
23
39
  * @ai-category Image
24
40
  * @ai-related getDefaultSrc, getSrc, createMediaSrcset
25
41
  *
26
42
  * @param image - The image object to generate the thumbnail source URL for.
27
- * @returns The CDN URL string for the image at 180px size.
43
+ * @returns The CDN URL string for the image or video at 180px size.
28
44
  *
29
45
  * @example
30
46
  * ```typescript
31
- * import { getThumbnailSrc } from "@ikas/bp-storefront";
32
- *
33
- * const thumbnailSrc = getThumbnailSrc(image);
34
- * console.log(thumbnailSrc); // "https://cdn.example.com/images/.../180/image.webp"
47
+ * import { getThumbnailSrc, getDefaultSrc } from "@ikas/bp-storefront";
48
+ *
49
+ * // Thumbnail rail — branch on isVideo per item:
50
+ * {product.images.map((item, i) =>
51
+ * item.isVideo ? (
52
+ * <video key={i} src={getDefaultSrc(item)} muted preload="metadata">
53
+ * <track kind="captions" />
54
+ * </video>
55
+ * ) : (
56
+ * <img key={i} src={getThumbnailSrc(item)} sizes="112px" alt={`Thumb ${i + 1}`} />
57
+ * )
58
+ * )}
35
59
  * ```
36
60
  */
37
61
  export declare function getThumbnailSrc(image: IkasImage): string;
38
62
  /**
39
63
  * Generates the full CDN source URL for an image or video at the specified size, handling both legacy path-based and merchant-scoped ID formats.
40
64
  *
65
+ * NOTE: For videos (`image.isVideo === true`) the `size` argument is IGNORED — the original .mp4 is always returned.
66
+ * So `getSrc(item, 240)` and `getDefaultSrc(item)` produce the identical URL for a video. PREFER `getDefaultSrc(item)`
67
+ * for video `src` (no size param) — do NOT pass an arbitrary size like `getSrc(item, 240)`, it is misleading.
68
+ *
41
69
  * @ai-category Image
42
70
  * @ai-related getDefaultSrc, getThumbnailSrc, createMediaSrcset
43
71
  *
44
72
  * @param image - The image object containing the id, fileName, and isVideo flag.
45
- * @param size - The desired image width in pixels for the generated URL.
73
+ * @param size - The desired image width in pixels. Ignored for videos.
46
74
  * @returns The full CDN URL string for the image or video.
47
75
  *
48
76
  * @example
49
77
  * ```typescript
50
- * import { getSrc } from "@ikas/bp-storefront";
78
+ * import { getSrc, getDefaultSrc } from "@ikas/bp-storefront";
51
79
  *
52
80
  * const src = getSrc(image, 640);
53
81
  * console.log(src); // "https://cdn.example.com/images/.../640/image.webp"
82
+ *
83
+ * // For a video, use getDefaultSrc (size is ignored anyway):
84
+ * <video src={getDefaultSrc(item)} muted playsInline preload="metadata" />
54
85
  * ```
55
86
  */
56
87
  export declare function getSrc(image: IkasImage, size: number): string;
57
88
  /**
58
89
  * Generates a complete responsive `srcset` string for an image across all standard sizes (180–3840px).
59
90
  *
91
+ * srcset applies to `<img>` only — video media (`item.isVideo === true`) has no srcset
92
+ * and must be rendered with `<video src={getDefaultSrc(item)}>`. When mapping product
93
+ * images, branch on `item.isVideo` first, then only use createMediaSrcset on the image branch.
94
+ *
60
95
  * @ai-category Image
61
96
  * @ai-related getDefaultSrc, getThumbnailSrc, getSrc
62
97
  *
@@ -67,12 +102,22 @@ export declare function getSrc(image: IkasImage, size: number): string;
67
102
  * ```typescript
68
103
  * import { createMediaSrcset, getDefaultSrc } from "@ikas/bp-storefront";
69
104
  *
70
- * <img
71
- * src={getDefaultSrc(image)}
72
- * srcSet={createMediaSrcset(image)}
73
- * sizes="(max-width: 768px) 100vw, 50vw"
74
- * alt="Product"
75
- * />
105
+ * // Product images can be videos — ALWAYS branch on isVideo when mapping media:
106
+ * {product.images.map((item, i) =>
107
+ * item.isVideo ? (
108
+ * <video key={i} src={getDefaultSrc(item)} muted playsInline preload="metadata">
109
+ * <track kind="captions" />
110
+ * </video>
111
+ * ) : (
112
+ * <img
113
+ * key={i}
114
+ * src={getDefaultSrc(item)}
115
+ * srcSet={createMediaSrcset(item)}
116
+ * sizes="(max-width: 768px) 100vw, 50vw"
117
+ * alt={`Product ${i + 1}`}
118
+ * />
119
+ * )
120
+ * )}
76
121
  * ```
77
122
  */
78
123
  export declare function createMediaSrcset(image?: IkasImage | null): string;
@@ -1 +1 @@
1
- import{IkasStorefrontConfig as c}from"../../../packages/storefront-config/src/index.js";function n(c){return a(c,1080)}function o(c){return a(c,180)}function a(n,o){var a,i=c.cdnUrl,t=c.videoCdnUrl;if(n.id.includes("/"))return n.isVideo?"".concat(t,"videos/").concat(n.id,"/original.mp4"):n.fileName?"".concat(i,"images/").concat(n.id,"/").concat(o,"/").concat(n.fileName,".webp"):"".concat(i,"images/").concat(n.id,"/image_").concat(o,".webp");var e=null===(a=c.merchantSettings)||void 0===a?void 0:a.merchantId;return n.isVideo?"".concat(t,"videos/").concat(e,"/").concat(n.id,"/original.mp4"):n.fileName?"".concat(i,"images/").concat(e,"/").concat(n.id,"/").concat(o,"/").concat(n.fileName,".webp"):"".concat(i,"images/").concat(e,"/").concat(n.id,"/image_").concat(o,".webp")}var i=[180,360,420,540,640,720,800,900,1080,1296,1350,1512,1728,1950,2560,3840];function t(c){return c?i.map(function(n){return"".concat(a(c,n)," ").concat(n,"w")}).join(", "):""}export{t as createMediaSrcset,n as getDefaultSrc,a as getSrc,o as getThumbnailSrc};
1
+ import{IkasStorefrontConfig as c}from"../../../packages/storefront-config/src/index.js";function n(c){return o(c,1080)}function i(c){return o(c,180)}function o(n,i){var o;if(!(null==n?void 0:n.id))return"";var a=c.cdnUrl,t=c.videoCdnUrl;if(n.id.includes("/"))return n.isVideo?"".concat(t,"videos/").concat(n.id,"/original.mp4"):n.fileName?"".concat(a,"images/").concat(n.id,"/").concat(i,"/").concat(n.fileName,".webp"):"".concat(a,"images/").concat(n.id,"/image_").concat(i,".webp");var e=null===(o=c.merchantSettings)||void 0===o?void 0:o.merchantId;return n.isVideo?"".concat(t,"videos/").concat(e,"/").concat(n.id,"/original.mp4"):n.fileName?"".concat(a,"images/").concat(e,"/").concat(n.id,"/").concat(i,"/").concat(n.fileName,".webp"):"".concat(a,"images/").concat(e,"/").concat(n.id,"/image_").concat(i,".webp")}var a=[180,360,420,540,640,720,800,900,1080,1296,1350,1512,1728,1950,2560,3840];function t(c){return(null==c?void 0:c.id)?a.map(function(n){return"".concat(o(c,n)," ").concat(n,"w")}).join(", "):""}export{t as createMediaSrcset,n as getDefaultSrc,o as getSrc,i as getThumbnailSrc};
@@ -1,16 +1,19 @@
1
1
  import { BackInStockNotificationForm, IkasAppliedCampaignAmount, IkasProductAttributeMap, IkasProductPrice, IkasProductVariant } from "../../../../storefront-models/src";
2
2
  /**
3
- * Get the main/primary image for a product variant.
3
+ * Get the main/primary media item for a product variant.
4
+ *
5
+ * The returned IkasProductImage may be a video (`isVideo === true`) — branch on it
6
+ * and render `<video>` instead of `<img>`.
4
7
  *
5
8
  * @ai-category ProductDetail, ProductList
6
9
  * @ai-related getSelectedProductVariant
7
10
  *
8
11
  * @param variant - The product variant
9
- * @returns The first IkasProductImage of the variant, or undefined if no images. Access `.image` to get the IkasImage for CDN helpers.
12
+ * @returns The first IkasProductImage of the variant, or undefined if no images. Check `.isVideo` to decide between `<video>` and `<img>`, and access `.image` to get the IkasImage for CDN helpers.
10
13
  *
11
14
  * @example
12
15
  * ```typescript
13
- * import { getProductVariantMainImage, getSelectedProductVariant, getDefaultSrc } from "@ikas/bp-storefront";
16
+ * import { getProductVariantMainImage, getSelectedProductVariant, getDefaultSrc, createMediaSrcset } from "@ikas/bp-storefront";
14
17
  * import { IkasProduct } from "@ikas/bp-storefront";
15
18
  *
16
19
  * function ProductImage({ product }: { product: IkasProduct }) {
@@ -22,7 +25,14 @@ import { BackInStockNotificationForm, IkasAppliedCampaignAmount, IkasProductAttr
22
25
  * return <div className="no-image">No image available</div>;
23
26
  * }
24
27
  *
25
- * return <img src={getDefaultSrc(image)} alt={product.name} />;
28
+ * // Media can be a video — branch on isVideo:
29
+ * return productImage.isVideo ? (
30
+ * <video src={getDefaultSrc(image)} muted playsInline loop>
31
+ * <track kind="captions" />
32
+ * </video>
33
+ * ) : (
34
+ * <img src={getDefaultSrc(image)} srcSet={createMediaSrcset(image)} alt={product.name} />
35
+ * );
26
36
  * }
27
37
  * ```
28
38
  */
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as n}from'./../../../ext/tslib/tslib.es6.mjs.js';import{IkasStorefrontConfig as r}from"../../../packages/storefront-config/src/index.js";import{CART_LS_KEY as e,cartStore as i}from"../../../stores/cart/index.js";import{customerStore as a}from"../../../stores/customer/index.js";import{getCookieValue as o}from"../../../utils/helper.js";import{getIkasOrderDistinctItemCount as s}from"../../models/order/index.js";import{getSelectedProductVariant as u,hasProductValidOptionValues as c}from"../../models/product/index.js";import{isProductOfferAccepted as d}from"../../models/product/campaign-offer/index.js";import{initProductOptionSetValues as l}from"../../models/product/option-set/index.js";import{hasProductVariantStock as f}from"../../models/product/variant/index.js";function v(t){var n,e=null===(n=t.cart)||void 0===n?void 0:n.id;if(e){var i=r.getCurrentRouting();return"".concat((null==i?void 0:i.path)?"/".concat(i.path):"","/checkout?id=").concat(e,"&step=info")}return""}function p(a,s){return t(this,arguments,void 0,function(t,a,s,d){var v,p,m,I,g,y,b,C,L,_,j,w,P,T,x,k,U;return void 0===s&&(s=1),n(this,function(n){switch(n.label){case 0:v=null!==(w=null==d?void 0:d.isPayWithIkas)&&void 0!==w&&w,n.label=1;case 1:return n.trys.push([1,10,,11]),v||!a.productOptionSetId||a.productOptionSet?c(a)?f(t)||t.sellIfOutOfStock?(p=void 0,v?[3,3]:[4,E()]):[2,{success:!1,validationError:"INSUFFICIENT_STOCK"}]:[2,{success:!1,validationError:"INVALID_PRODUCT_OPTION_VALUES"}]:[2,{success:!1,validationError:"INVALID_PRODUCT_OPTION_VALUES"}];case 2:if(n.sent(),i.cart&&(p=O(i.cart,t,a))){if(a.productOptionSet&&l(a.productOptionSet),!t.bundleSettings)return[2,h(p,p.quantity+s,a.offers,a)];if(!S())return[2,h(p,p.quantity+s,a.offers,a)]}n.label=3;case 3:return m=F(a),I=s,(null==(g=null===(P=a.salesChannels)||void 0===P?void 0:P.find(function(t){return t.id===r.salesChannelId}))?void 0:g.minQuantityPerCart)&&s<g.minQuantityPerCart&&(I=g.minQuantityPerCart),(null==g?void 0:g.maxQuantityPerCart)&&s>g.maxQuantityPerCart&&(I=g.maxQuantityPerCart),y=v?null:(null===(T=i.cart)||void 0===T?void 0:T.id)||localStorage.getItem(e),[4,import("../../api/cart/index.js")];case 4:return[4,(0,n.sent().apiAddItemToCart)({input:{cartId:y,item:{id:null!==(x=null==p?void 0:p.id)&&void 0!==x?x:null,quantity:null!==(k=null==p?void 0:p.quantity)&&void 0!==k?k:I,variant:{id:t.id,name:a.name,bundleProducts:null===(U=t.bundleSettings)||void 0===U?void 0:U.products.map(function(t){var n;return{id:t.id,productId:(null===(n=t.product)||void 0===n?void 0:n.id)||"",variantId:t.product?u(t.product).id:"",quantity:t.quantity}})}},acceptedOffers:q(a.offers),options:m.length?m:null,priceListId:r.priceListId||null,salesChannelId:r.salesChannelId,storefrontThemeId:r.storefrontThemeId,metadata:{_fbp:o("_fbp"),_fbc:o("_fbc")}}})];case 5:return b=n.sent(),v?[3,7]:b.isSuccess&&b.data?[4,A(b.data)]:[3,7];case 6:n.sent(),n.label=7;case 7:return(C=v?b.data:i.cart)?(L="".concat(C.id,"-").concat(C.updatedAt),(_=C.orderLineItems.find(function(n){return n.variant.id===t.id}))?[4,import("../../../analytics/analytics-functions/addToCart.js")]:[3,9]):[3,9];case 8:(0,n.sent().anl_addToCart)(_,s,L,C,a),n.label=9;case 9:return a.productOptionSet&&l(a.productOptionSet),[2,{success:b.isSuccess,response:b}];case 10:return j=n.sent(),console.log(j),[2,{success:!1}];case 11:return[2]}})})}function m(r){return t(this,arguments,void 0,function(t,r){return void 0===r&&(r=1),n(this,function(n){switch(n.label){case 0:return[4,p(u(t),t,r)];case 1:return[2,n.sent()]}})})}function h(e,a,s,u){return t(this,void 0,void 0,function(){var t,c,d,l,f,v;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,10,,11]),[4,E()];case 1:return n.sent(),[4,import("../../api/cart/index.js")];case 2:return[4,(0,n.sent().apiAddItemToCart)({input:{cartId:(null===(f=i.cart)||void 0===f?void 0:f.id)||null,item:{id:e.id,quantity:a,variant:{id:e.variant.id,name:e.variant.name,bundleProducts:null===(v=e.variant.bundleProducts)||void 0===v?void 0:v.map(function(t){return{id:t.id,productId:t.variant.productId||"",variantId:t.variant.id||"",quantity:t.quantity}})}},acceptedOffers:s?q(s):void 0,options:k(e),priceListId:r.priceListId||null,salesChannelId:r.salesChannelId,storefrontThemeId:r.storefrontThemeId,metadata:{_fbp:o("_fbp"),_fbc:o("_fbc")}}})];case 3:return(t=n.sent()).isSuccess&&t.data?[4,A(t.data)]:[3,5];case 4:n.sent(),n.label=5;case 5:return i.cart?(c="".concat(i.cart.id,"-").concat(i.cart.updatedAt),(d=e.quantity)>a?[4,import("../../../analytics/analytics-functions/removeFromCart.js")]:[3,7]):[3,9];case 6:return(0,n.sent().anl_removeFromCart)(e,d-a,i.cart),[3,9];case 7:return[4,import("../../../analytics/analytics-functions/addToCart.js")];case 8:(0,n.sent().anl_addToCart)(e,a-d,c,i.cart,u),n.label=9;case 9:return P(i),[2,{success:t.isSuccess,response:t}];case 10:return l=n.sent(),console.log(l),[2,{success:!1}];case 11:return[2]}})})}function I(r,e,i,a,o){return t(this,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,h(e,i,a,o)];case 1:return[2,t.sent()]}})})}function g(t,n){for(var r=0,e=(null==t?void 0:t.orderAdjustments)||[];r<e.length;r++)for(var i=0,a=e[r].appliedOrderLines||[];i<a.length;i++){var o=a[i];if(o.orderLineId===n.id)return o.isAutoCreated||!1}return!1}function y(r){return t(this,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,h(r,0)];case 1:return[2,t.sent()]}})})}function b(t){localStorage.removeItem(e),t.cart=null}function C(r){return t(this,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,new Promise(function(t){var n=setInterval(function(){r.isCartInitialLoadFinished&&(clearInterval(n),t(null))},100)})];case 1:return[2,t.sent()]}})})}function S(){if("undefined"!=typeof window)return new URLSearchParams(window.location.search).get("editLineID")||""}function O(t,n,r){var e;if(!r.productOptionSetId&&!n.bundleSettings)return t.orderLineItems.find(function(t){return t.variant.id===n.id});if(n.bundleSettings){var i=S();if(i)if(h=t.orderLineItems.find(function(t){return t.id===i}))return h}var a=t.orderLineItems.filter(function(t){return t.variant.id===n.id})||[];if(r.productOptionSetId)for(var o=F(r),s=a.filter(function(t){var n;return(null===(n=t.options)||void 0===n?void 0:n.length)===o.length})||[],u=0,c=s;u<c.length;u++){if((h=c[u]).options){for(var d=!0,l=function(t){var n=t.values.map(function(t){return t.value}),r=null===(e=o.find(function(n){return n.productOptionId===t.productOptionId}))||void 0===e?void 0:e.values;if(!(d=d&&n.length===(null==r?void 0:r.length)&&n.every(function(t){return null==r?void 0:r.includes(t)})))return"break"},f=0,v=h.options;f<v.length;f++){if("break"===l(v[f]))break}if(d){if(!n.bundleSettings)return h;if(_(n,h))return h}}}else if(n.bundleSettings)for(var p=0,m=a;p<m.length;p++){var h=m[p];if(_(n,h))return h}}function L(t,n){return O(t,u(n),n)}function _(t,n){var r,e=null===(r=t.bundleSettings)||void 0===r?void 0:r.products,i=n.variant.bundleProducts;return!!e&&((null==e?void 0:e.length)===(null==i?void 0:i.length)&&(null==e?void 0:e.every(function(t){return!!(null==i?void 0:i.find(function(n){return n.id===t.id&&n.quantity===t.quantity&&t.product&&n.variant.id===u(t.product).id}))})))}function j(r,e){return t(this,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,import("../../api/cart/index.js")];case 1:return[4,(0,n.sent().apiSaveCartCouponCode)({cartId:r.id,couponCode:e})];case 2:return(t=n.sent()).isSuccess&&t.data&&(i.cart=t.data),[2,{success:t.isSuccess,response:t}]}})})}function w(r){return t(this,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,j(r,null)];case 1:return[2,t.sent()]}})})}function P(t){t.cart&&0===s(t.cart)&&b(t)}function T(){return t(this,void 0,void 0,function(){var t,r,o,s,u,c;return n(this,function(n){switch(n.label){case 0:if(!("undefined"!=typeof localStorage))return[2];n.label=1;case 1:return n.trys.push([1,7,8,9]),i.isCartLoading=!0,t=null===(u=a.customer)||void 0===u?void 0:u.id,(r=(null===(c=i.cart)||void 0===c?void 0:c.id)||localStorage.getItem(e))||t?[4,import("../../api/cart/index.js")]:[2];case 2:return[4,(0,n.sent().apiGetCartById)({id:r})];case 3:return(o=n.sent()).isSuccess&&o.data?[4,A(o.data)]:[3,5];case 4:return n.sent(),[3,6];case 5:if(o.isCancelled||o.isNetworkError)return[2];b(i),n.label=6;case 6:return[3,9];case 7:return s=n.sent(),console.log(s),[3,9];case 8:return i.isCartLoading=!1,i.isCartInitialLoadFinished=!0,[7];case 9:return[2]}})})}function q(t){var n=t.filter(function(t){return t.isSelected&&!d(t)}).map(function(t){return{campaignOfferId:t.campaignOfferId,campaignOfferProductId:t.campaignOfferProductId,productId:t.product.id,quantity:t.quantity,variantId:u(t.product).id}})||[];return n.length?n:void 0}function x(e,i){return t(this,arguments,void 0,function(t,e,i){var a,o,s,c,d,l,f,v,m,h,I,g,y,b,C;return void 0===i&&(i=1),n(this,function(t){switch(t.label){case 0:return t.trys.push([0,4,,5]),a=r.salesChannelId,o=r.storefrontThemeId,a&&o?(s=u(e))?[4,p(s,e,i,{isPayWithIkas:!0})]:[2,{success:!1,error:"No variant selected"}]:[2,{success:!1,error:"Missing storefront configuration"}];case 1:return(c=t.sent()).success&&(null===(m=null===(v=c.response)||void 0===v?void 0:v.data)||void 0===m?void 0:m.id)?(d=c.response.data.id,[4,import("../../api/cart/index.js")]):[2,{success:!1,error:(null===(g=null===(I=null===(h=c.response)||void 0===h?void 0:h.graphQLErrors)||void 0===I?void 0:I[0])||void 0===g?void 0:g.message)||"Failed to create cart"}];case 2:return[4,(0,t.sent().apiCreatePayWithIkasSessionUrl)({cartId:d})];case 3:return!(l=t.sent()).data||(null===(y=l.graphQLErrors)||void 0===y?void 0:y.length)?[2,{success:!1,error:(null===(C=null===(b=l.graphQLErrors)||void 0===b?void 0:b[0])||void 0===C?void 0:C.message)||"Failed to create Pay with ikas session"}]:[2,{success:!0,payUrl:l.data.payUrl,expiresAt:l.data.expiresAt}];case 4:return f=t.sent(),console.log("error",f),[2,{success:!1,error:f instanceof Error?f.message:"Unknown error occurred"}];case 5:return[2]}})})}function A(r){return t(this,void 0,void 0,function(){return n(this,function(t){return localStorage.setItem(e,r.id),i.cart=r,[2]})})}function E(){return t(this,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return t=localStorage.getItem(e),!i.cart||t?[3,1]:(b(i),[3,3]);case 1:return i.cart||!t?[3,3]:[4,T()];case 2:n.sent(),n.label=3;case 3:return[2]}})})}function k(t){if(t&&t.options){for(var n=[],r=0,e=t.options;r<e.length;r++){var i=e[r],a={productOptionId:i.productOptionId,productOptionsSetId:i.productOptionsSetId,values:i.values.map(function(t){return t.value})};n.push(a)}return n}return null}function F(t){var n,r=[],e=new Set,i=function(t){var n;e.has(t.id)||(e.add(t.id),t.values.length&&r.push({productOptionId:t.id,productOptionsSetId:t.productOptionSetId,values:t.values}),null===(n=t.childOptions)||void 0===n||n.forEach(i))};return null===(n=t.productOptionSet)||void 0===n||n.options.filter(function(t){return!t.requiredOptionId}).forEach(i),r}function U(e){return t(this,void 0,void 0,function(){var t,a,s,u,c,d,l,f,v,p,m;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,10,,11]),[4,E()];case 1:return n.sent(),t=e.itemId?null===(v=i.cart)||void 0===v?void 0:v.orderLineItems.find(function(t){return t.id===e.itemId}):null,[4,import("../../api/cart/index.js")];case 2:return[4,(0,n.sent().apiAddItemToCart)({input:{cartId:(null===(p=i.cart)||void 0===p?void 0:p.id)||null,item:{id:e.itemId||null,quantity:e.quantity,variant:{id:e.variantId}},priceListId:r.priceListId||null,salesChannelId:r.salesChannelId,storefrontThemeId:r.storefrontThemeId,metadata:{_fbp:o("_fbp"),_fbc:o("_fbc")}}})];case 3:return(a=n.sent()).isSuccess&&a.data?(e.itemId||(s=(null===(m=i.cart)||void 0===m?void 0:m.orderLineItems.map(function(t){return t.id}))||[],u=a.data.orderLineItems.map(function(t){return t.id}),(c=u.find(function(t){return!s.includes(t)}))&&(t=a.data.orderLineItems.find(function(t){return t.id===c}))),[4,A(a.data)]):[3,5];case 4:n.sent(),n.label=5;case 5:return i.cart&&t?(d="".concat(i.cart.id,"-").concat(i.cart.updatedAt),(l=e.quantity)>e.quantity?[4,import("../../../analytics/analytics-functions/removeFromCart.js")]:[3,7]):[3,9];case 6:return(0,n.sent().anl_removeFromCart)(t,l-e.quantity,i.cart),[3,9];case 7:return[4,import("../../../analytics/analytics-functions/addToCart.js")];case 8:(0,n.sent().anl_addToCart)(t,e.quantity-l,d,i.cart),n.label=9;case 9:return P(i),[2,{success:a.isSuccess,response:a}];case 10:return f=n.sent(),console.log(f),[2,{success:!1}];case 11:return[2]}})})}function Q(t){var n;return!!t.cart&&(null===(n=t.cart.orderLineItems)||void 0===n?void 0:n.length)>0}export{p as addItemToCart,m as addSelectedtedVariantToCart,I as changeCartItemQuantity,h as changeItemQuantity,x as createPayWithIkasSession,O as findExistingCartItem,L as findExistingCartItemWithProduct,q as getAcceptedOffers,T as getCart,v as getCheckoutUrlFromCartStore,Q as hasCart,g as isOrderLineItemAutoCreated,b as removeCart,w as removeCouponCode,y as removeItem,j as saveCouponCode,A as setCart,C as waitForCartStoreInit,U as windowAddToCart};
1
+ import{__awaiter as t,__generator as n}from'./../../../ext/tslib/tslib.es6.mjs.js';import{IkasStorefrontConfig as r}from"../../../packages/storefront-config/src/index.js";import{CART_LS_KEY as e,cartStore as i}from"../../../stores/cart/index.js";import{customerStore as a}from"../../../stores/customer/index.js";import{getCookieValue as o}from"../../../utils/helper.js";import{getIkasOrderDistinctItemCount as s}from"../../models/order/index.js";import{getSelectedProductVariant as u,hasProductValidOptionValues as c}from"../../models/product/index.js";import{isProductOfferAccepted as d}from"../../models/product/campaign-offer/index.js";import{initProductOptionSetValues as l}from"../../models/product/option-set/index.js";import{hasProductVariantStock as f}from"../../models/product/variant/index.js";import{waitForCustomerStoreInit as v}from"../customer/index.js";function p(t){var n,e=null===(n=t.cart)||void 0===n?void 0:n.id;if(e){var i=r.getCurrentRouting();return"".concat((null==i?void 0:i.path)?"/".concat(i.path):"","/checkout?id=").concat(e,"&step=info")}return""}function m(a,s){return t(this,arguments,void 0,function(t,a,s,d){var v,p,m,h,g,y,b,C,S,L,j,w,P,T,q,A,F;return void 0===s&&(s=1),n(this,function(n){switch(n.label){case 0:v=null!==(w=null==d?void 0:d.isPayWithIkas)&&void 0!==w&&w,n.label=1;case 1:return n.trys.push([1,10,,11]),v||!a.productOptionSetId||a.productOptionSet?c(a)?f(t)||t.sellIfOutOfStock?(p=void 0,v?[3,3]:[4,k()]):[2,{success:!1,validationError:"INSUFFICIENT_STOCK"}]:[2,{success:!1,validationError:"INVALID_PRODUCT_OPTION_VALUES"}]:[2,{success:!1,validationError:"INVALID_PRODUCT_OPTION_VALUES"}];case 2:if(n.sent(),i.cart&&(p=_(i.cart,t,a))){if(a.productOptionSet&&l(a.productOptionSet),!t.bundleSettings)return[2,I(p,p.quantity+s,a.offers,a)];if(!O())return[2,I(p,p.quantity+s,a.offers,a)]}n.label=3;case 3:return m=U(a),h=s,(null==(g=null===(P=a.salesChannels)||void 0===P?void 0:P.find(function(t){return t.id===r.salesChannelId}))?void 0:g.minQuantityPerCart)&&s<g.minQuantityPerCart&&(h=g.minQuantityPerCart),(null==g?void 0:g.maxQuantityPerCart)&&s>g.maxQuantityPerCart&&(h=g.maxQuantityPerCart),y=v?null:(null===(T=i.cart)||void 0===T?void 0:T.id)||localStorage.getItem(e),[4,import("../../api/cart/index.js")];case 4:return[4,(0,n.sent().apiAddItemToCart)({input:{cartId:y,item:{id:null!==(q=null==p?void 0:p.id)&&void 0!==q?q:null,quantity:null!==(A=null==p?void 0:p.quantity)&&void 0!==A?A:h,variant:{id:t.id,name:a.name,bundleProducts:null===(F=t.bundleSettings)||void 0===F?void 0:F.products.map(function(t){var n;return{id:t.id,productId:(null===(n=t.product)||void 0===n?void 0:n.id)||"",variantId:t.product?u(t.product).id:"",quantity:t.quantity}})}},acceptedOffers:x(a.offers),options:m.length?m:null,priceListId:r.priceListId||null,salesChannelId:r.salesChannelId,storefrontThemeId:r.storefrontThemeId,metadata:{_fbp:o("_fbp"),_fbc:o("_fbc"),_ga:o("_ga")}}})];case 5:return b=n.sent(),v?[3,7]:b.isSuccess&&b.data?[4,E(b.data)]:[3,7];case 6:n.sent(),n.label=7;case 7:return(C=v?b.data:i.cart)?(S="".concat(C.id,"-").concat(C.updatedAt),(L=C.orderLineItems.find(function(n){return n.variant.id===t.id}))?[4,import("../../../analytics/analytics-functions/addToCart.js")]:[3,9]):[3,9];case 8:(0,n.sent().anl_addToCart)(L,s,S,C,a),n.label=9;case 9:return a.productOptionSet&&l(a.productOptionSet),[2,{success:b.isSuccess,response:b}];case 10:return j=n.sent(),console.log(j),[2,{success:!1}];case 11:return[2]}})})}function h(r){return t(this,arguments,void 0,function(t,r){return void 0===r&&(r=1),n(this,function(n){switch(n.label){case 0:return[4,m(u(t),t,r)];case 1:return[2,n.sent()]}})})}function I(e,a,s,u){return t(this,void 0,void 0,function(){var t,c,d,l,f,v;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,10,,11]),[4,k()];case 1:return n.sent(),[4,import("../../api/cart/index.js")];case 2:return[4,(0,n.sent().apiAddItemToCart)({input:{cartId:(null===(f=i.cart)||void 0===f?void 0:f.id)||null,item:{id:e.id,quantity:a,variant:{id:e.variant.id,name:e.variant.name,bundleProducts:null===(v=e.variant.bundleProducts)||void 0===v?void 0:v.map(function(t){return{id:t.id,productId:t.variant.productId||"",variantId:t.variant.id||"",quantity:t.quantity}})}},acceptedOffers:s?x(s):void 0,options:F(e),priceListId:r.priceListId||null,salesChannelId:r.salesChannelId,storefrontThemeId:r.storefrontThemeId,metadata:{_fbp:o("_fbp"),_fbc:o("_fbc"),_ga:o("_ga")}}})];case 3:return(t=n.sent()).isSuccess&&t.data?[4,E(t.data)]:[3,5];case 4:n.sent(),n.label=5;case 5:return i.cart?(c="".concat(i.cart.id,"-").concat(i.cart.updatedAt),(d=e.quantity)>a?[4,import("../../../analytics/analytics-functions/removeFromCart.js")]:[3,7]):[3,9];case 6:return(0,n.sent().anl_removeFromCart)(e,d-a,i.cart),[3,9];case 7:return[4,import("../../../analytics/analytics-functions/addToCart.js")];case 8:(0,n.sent().anl_addToCart)(e,a-d,c,i.cart,u),n.label=9;case 9:return T(i),[2,{success:t.isSuccess,response:t}];case 10:return l=n.sent(),console.log(l),[2,{success:!1}];case 11:return[2]}})})}function g(r,e,i,a,o){return t(this,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,I(e,i,a,o)];case 1:return[2,t.sent()]}})})}function y(t,n){for(var r=0,e=(null==t?void 0:t.orderAdjustments)||[];r<e.length;r++)for(var i=0,a=e[r].appliedOrderLines||[];i<a.length;i++){var o=a[i];if(o.orderLineId===n.id)return o.isAutoCreated||!1}return!1}function b(r){return t(this,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,I(r,0)];case 1:return[2,t.sent()]}})})}function C(t){localStorage.removeItem(e),t.cart=null}function S(r){return t(this,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,new Promise(function(t){var n=setInterval(function(){r.isCartInitialLoadFinished&&(clearInterval(n),t(null))},100)})];case 1:return[2,t.sent()]}})})}function O(){if("undefined"!=typeof window)return new URLSearchParams(window.location.search).get("editLineID")||""}function _(t,n,r){var e;if(!r.productOptionSetId&&!n.bundleSettings)return t.orderLineItems.find(function(t){return t.variant.id===n.id});if(n.bundleSettings){var i=O();if(i)if(h=t.orderLineItems.find(function(t){return t.id===i}))return h}var a=t.orderLineItems.filter(function(t){return t.variant.id===n.id})||[];if(r.productOptionSetId)for(var o=U(r),s=a.filter(function(t){var n;return(null===(n=t.options)||void 0===n?void 0:n.length)===o.length})||[],u=0,c=s;u<c.length;u++){if((h=c[u]).options){for(var d=!0,l=function(t){var n=t.values.map(function(t){return t.value}),r=null===(e=o.find(function(n){return n.productOptionId===t.productOptionId}))||void 0===e?void 0:e.values;if(!(d=d&&n.length===(null==r?void 0:r.length)&&n.every(function(t){return null==r?void 0:r.includes(t)})))return"break"},f=0,v=h.options;f<v.length;f++){if("break"===l(v[f]))break}if(d){if(!n.bundleSettings)return h;if(j(n,h))return h}}}else if(n.bundleSettings)for(var p=0,m=a;p<m.length;p++){var h=m[p];if(j(n,h))return h}}function L(t,n){return _(t,u(n),n)}function j(t,n){var r,e=null===(r=t.bundleSettings)||void 0===r?void 0:r.products,i=n.variant.bundleProducts;return!!e&&((null==e?void 0:e.length)===(null==i?void 0:i.length)&&(null==e?void 0:e.every(function(t){return!!(null==i?void 0:i.find(function(n){return n.id===t.id&&n.quantity===t.quantity&&t.product&&n.variant.id===u(t.product).id}))})))}function w(r,e){return t(this,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,import("../../api/cart/index.js")];case 1:return[4,(0,n.sent().apiSaveCartCouponCode)({cartId:r.id,couponCode:e})];case 2:return(t=n.sent()).isSuccess&&t.data&&(i.cart=t.data),[2,{success:t.isSuccess,response:t}]}})})}function P(r){return t(this,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,w(r,null)];case 1:return[2,t.sent()]}})})}function T(t){t.cart&&0===s(t.cart)&&C(t)}function q(){return t(this,void 0,void 0,function(){var t,r,o,s,u,c;return n(this,function(n){switch(n.label){case 0:if(!("undefined"!=typeof localStorage))return[2];n.label=1;case 1:return n.trys.push([1,8,9,10]),i.isCartLoading=!0,[4,v(a)];case 2:return n.sent(),t=null===(u=a.customer)||void 0===u?void 0:u.id,(r=(null===(c=i.cart)||void 0===c?void 0:c.id)||localStorage.getItem(e))||t?[4,import("../../api/cart/index.js")]:[2];case 3:return[4,(0,n.sent().apiGetCartById)({id:r})];case 4:return(o=n.sent()).isSuccess&&o.data?[4,E(o.data)]:[3,6];case 5:return n.sent(),[3,7];case 6:if(o.isCancelled||o.isNetworkError)return[2];C(i),n.label=7;case 7:return[3,10];case 8:return s=n.sent(),console.log(s),[3,10];case 9:return i.isCartLoading=!1,i.isCartInitialLoadFinished=!0,[7];case 10:return[2]}})})}function x(t){var n=t.filter(function(t){return t.isSelected&&!d(t)}).map(function(t){return{campaignOfferId:t.campaignOfferId,campaignOfferProductId:t.campaignOfferProductId,productId:t.product.id,quantity:t.quantity,variantId:u(t.product).id}})||[];return n.length?n:void 0}function A(e,i){return t(this,arguments,void 0,function(t,e,i){var a,o,s,c,d,l,f,v,p,h,I,g,y,b,C;return void 0===i&&(i=1),n(this,function(t){switch(t.label){case 0:return t.trys.push([0,4,,5]),a=r.salesChannelId,o=r.storefrontThemeId,a&&o?(s=u(e))?[4,m(s,e,i,{isPayWithIkas:!0})]:[2,{success:!1,error:"No variant selected"}]:[2,{success:!1,error:"Missing storefront configuration"}];case 1:return(c=t.sent()).success&&(null===(p=null===(v=c.response)||void 0===v?void 0:v.data)||void 0===p?void 0:p.id)?(d=c.response.data.id,[4,import("../../api/cart/index.js")]):[2,{success:!1,error:(null===(g=null===(I=null===(h=c.response)||void 0===h?void 0:h.graphQLErrors)||void 0===I?void 0:I[0])||void 0===g?void 0:g.message)||"Failed to create cart"}];case 2:return[4,(0,t.sent().apiCreatePayWithIkasSessionUrl)({cartId:d})];case 3:return!(l=t.sent()).data||(null===(y=l.graphQLErrors)||void 0===y?void 0:y.length)?[2,{success:!1,error:(null===(C=null===(b=l.graphQLErrors)||void 0===b?void 0:b[0])||void 0===C?void 0:C.message)||"Failed to create Pay with ikas session"}]:[2,{success:!0,payUrl:l.data.payUrl,expiresAt:l.data.expiresAt}];case 4:return f=t.sent(),console.log("error",f),[2,{success:!1,error:f instanceof Error?f.message:"Unknown error occurred"}];case 5:return[2]}})})}function E(r){return t(this,void 0,void 0,function(){return n(this,function(t){return localStorage.setItem(e,r.id),i.cart=r,[2]})})}function k(){return t(this,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return t=localStorage.getItem(e),!i.cart||t?[3,1]:(C(i),[3,3]);case 1:return i.cart||!t?[3,3]:[4,q()];case 2:n.sent(),n.label=3;case 3:return[2]}})})}function F(t){if(t&&t.options){for(var n=[],r=0,e=t.options;r<e.length;r++){var i=e[r],a={productOptionId:i.productOptionId,productOptionsSetId:i.productOptionsSetId,values:i.values.map(function(t){return t.value})};n.push(a)}return n}return null}function U(t){var n,r=[],e=new Set,i=function(t){var n;e.has(t.id)||(e.add(t.id),t.values.length&&r.push({productOptionId:t.id,productOptionsSetId:t.productOptionSetId,values:t.values}),null===(n=t.childOptions)||void 0===n||n.forEach(i))};return null===(n=t.productOptionSet)||void 0===n||n.options.filter(function(t){return!t.requiredOptionId}).forEach(i),r}function Q(e){return t(this,void 0,void 0,function(){var t,a,s,u,c,d,l,f,v,p,m;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,10,,11]),[4,k()];case 1:return n.sent(),t=e.itemId?null===(v=i.cart)||void 0===v?void 0:v.orderLineItems.find(function(t){return t.id===e.itemId}):null,[4,import("../../api/cart/index.js")];case 2:return[4,(0,n.sent().apiAddItemToCart)({input:{cartId:(null===(p=i.cart)||void 0===p?void 0:p.id)||null,item:{id:e.itemId||null,quantity:e.quantity,variant:{id:e.variantId}},priceListId:r.priceListId||null,salesChannelId:r.salesChannelId,storefrontThemeId:r.storefrontThemeId,metadata:{_fbp:o("_fbp"),_fbc:o("_fbc"),_ga:o("_ga")}}})];case 3:return(a=n.sent()).isSuccess&&a.data?(e.itemId||(s=(null===(m=i.cart)||void 0===m?void 0:m.orderLineItems.map(function(t){return t.id}))||[],u=a.data.orderLineItems.map(function(t){return t.id}),(c=u.find(function(t){return!s.includes(t)}))&&(t=a.data.orderLineItems.find(function(t){return t.id===c}))),[4,E(a.data)]):[3,5];case 4:n.sent(),n.label=5;case 5:return i.cart&&t?(d="".concat(i.cart.id,"-").concat(i.cart.updatedAt),(l=e.quantity)>e.quantity?[4,import("../../../analytics/analytics-functions/removeFromCart.js")]:[3,7]):[3,9];case 6:return(0,n.sent().anl_removeFromCart)(t,l-e.quantity,i.cart),[3,9];case 7:return[4,import("../../../analytics/analytics-functions/addToCart.js")];case 8:(0,n.sent().anl_addToCart)(t,e.quantity-l,d,i.cart),n.label=9;case 9:return T(i),[2,{success:a.isSuccess,response:a}];case 10:return f=n.sent(),console.log(f),[2,{success:!1}];case 11:return[2]}})})}function N(t){var n;return!!t.cart&&(null===(n=t.cart.orderLineItems)||void 0===n?void 0:n.length)>0}export{m as addItemToCart,h as addSelectedtedVariantToCart,g as changeCartItemQuantity,I as changeItemQuantity,A as createPayWithIkasSession,_ as findExistingCartItem,L as findExistingCartItemWithProduct,x as getAcceptedOffers,q as getCart,p as getCheckoutUrlFromCartStore,N as hasCart,y as isOrderLineItemAutoCreated,C as removeCart,P as removeCouponCode,b as removeItem,w as saveCouponCode,E as setCart,S as waitForCartStoreInit,Q as windowAddToCart};
package/dist/index.d.ts CHANGED
@@ -16,12 +16,14 @@ export * from "./stores/cart";
16
16
  export * from "./stores/customer";
17
17
  export * from "./theme/infinite-scroller";
18
18
  export * from "./theme/overlay";
19
+ export * from "./theme/settings";
19
20
  export * from "./theme/slider";
20
21
  export * from "./theme/styles";
21
22
  export * from "./utils/blueprint";
22
23
  export * from "./utils/component-renderer";
23
24
  export * from "./utils/fetch";
24
25
  export * from "./utils/object-wrapper";
26
+ export * from "./utils/svg";
25
27
  export type { APIErrorCode, APIResponse } from "./storefront-api/src";
26
28
  export * from "./storefront-api/src";
27
29
  export * from "./storefront-config/src";
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export{Analytics}from"./analytics/analytics.js";export{initIkasEvents}from"./analytics/events.js";export{EMPTY_STRING,NULL,UNDEFINED}from"./externals/index.js";export{apiListProductBrand}from"./functions/api/brand/index.js";export{apiListCategory}from"./functions/api/category/index.js";export{apiGetLoyaltyCustomerInfo,apiGetStorefrontWidgetSettings,apiListEarningMethods,apiListLoyaltyProgramPointHistory,apiListLoyaltyProgramTiers,apiListSpendingMethodsByCartId,apiRemoveLoyaltyPointsFromCart,apiUseLoyaltyPoints}from"./functions/api/loyalty/index.js";export{apiListStorefrontPopup}from"./functions/api/popup/index.js";export{apiSearchProducts}from"./functions/api/product/index.js";export{getAttributeDetailValues}from"./functions/models/attribute-detail/index.js";export{getAttributeListValues}from"./functions/models/attribute-list/index.js";export{createIkasBaseModel}from"./functions/models/base/index.js";export{getIkasBlogFormattedDate,getIkasBlogHref}from"./functions/models/blog/index.js";export{createIkasBlogCategory,getIkasBlogCategoryHref}from"./functions/models/blog/category/index.js";export{initIkasBlogCategory}from"./functions/models/blog/category/init.js";export{initIkasBlog}from"./functions/models/blog/init.js";export{getBlogCategoryListInitialData,getBlogCategoryListNextPage,getBlogCategoryListPage,getBlogCategoryListPageCount,getBlogCategoryListPrevPage,hasBlogCategoryListNextPage,hasBlogCategoryListPrevPage,isBlogCategoryListStatic}from"./functions/models/blog-category-list/index.js";export{initBlogCategoryList}from"./functions/models/blog-category-list/init.js";export{getBlogListInitialData,getBlogListNextPage,getBlogListPage,getBlogListPageCount,getBlogListPrevPage,hasBlogListNextPage,hasBlogListPrevPage,isBlogListStatic}from"./functions/models/blog-list/index.js";export{initBlogList}from"./functions/models/blog-list/init.js";export{getIkasBrandHref}from"./functions/models/brand/index.js";export{initIkasBrand}from"./functions/models/brand/init.js";export{getBrandListInitialData,getBrandListNextPage,getBrandListPage,getBrandListPageCount,getBrandListPrevPage,hasBrandListNextPage,hasBrandListPrevPage,isBrandListStatic}from"./functions/models/brand-list/index.js";export{initBrandList}from"./functions/models/brand-list/init.js";export{acceptProductOffer,isAcceptedProductOffer,rejectProductOffer}from"./functions/models/campaign-offer/index.js";export{getCategoryPath,getIkasCategoryHref}from"./functions/models/category/index.js";export{initIkasCategory}from"./functions/models/category/init.js";export{getCategoryListInitialData,getCategoryListNextPage,getCategoryListPage,getCategoryListPageCount,getCategoryListPrevPage,hasCategoryListNextPage,hasCategoryListPrevPage,isCategoryListStatic}from"./functions/models/category-list/index.js";export{initCategoryList}from"./functions/models/category-list/init.js";export{getIkasCategoryPathItemHref,getIkasCategoryPathItemSlug}from"./functions/models/category/path-item/index.js";export{initIkasCategoryPathItem}from"./functions/models/category/path-item/init.js";export{getCheckoutTotalFinalPrice,isCheckoutComplete}from"./functions/models/checkout/index.js";export{initIkasCountry}from"./functions/models/country/init.js";export{getCustomerBasicInfo,isCustomerSubscribed}from"./functions/models/customer/index.js";export{clearIkasCustomerAddressForm,getCustomerAddressText,getCustomerAddressValidationResult,getIkasCustomerAddressForm,isValidCustomerAddress}from"./functions/models/customer/address/index.js";export{getCustomerAttributeAccountPagePermission,getCustomerAttributeRegisterPageRequirement}from"./functions/models/customer/attribute/index.js";export{initIkasCustomerAttribute}from"./functions/models/customer/attribute/init.js";export{getIkasCustomerReviewFormattedDate}from"./functions/models/customer/review/index.js";export{initIkasCustomerReview}from"./functions/models/customer/review/init.js";export{getCustomerReviewListInitialData,getCustomerReviewListNextPage,getCustomerReviewListPage,getCustomerReviewListPageCount,getCustomerReviewListPrev,getProductCustomerReviews,hasCustomerReviewListNextPage,hasCustomerReviewListPrevPage}from"./functions/models/customer-review-list/index.js";export{initCustomerReviewList}from"./functions/models/customer-review-list/init.js";export{getCustomerReviewSummaryListInitialData,getCustomerReviewSummaryListNextPage,getCustomerReviewSummaryListPage,getCustomerReviewSummaryListPrev,hasCustomerReviewSummaryListNextPage,hasCustomerReviewSummaryListPrevPage}from"./functions/models/customer-review-summary-list/index.js";export{initCustomerReviewSummaryList}from"./functions/models/customer-review-summary-list/init.js";export{getIkasFilterCategoryHref,getIkasFilterCategorySlug}from"./functions/models/filter-category/index.js";export{initIkasHTMLMetaData,setHTMLMetaDataTranslations}from"./functions/models/html-meta-data/init.js";export{initThemeDatePicker,themeDatePickerGetDate,themeDatePickerGetDaysOfMonth,themeDatePickerGetDaysOfWeekShort,themeDatePickerGetFullYear,themeDatePickerGetHours,themeDatePickerGetMinutes,themeDatePickerGetMonth,themeDatePickerGetMonthList,themeDatePickerGetMonthName,themeDatePickerGetViewFullYear,themeDatePickerGetViewMonth,themeDatePickerGetWeekFirstDay,themeDatePickerOnChange,themeDatePickerOnDayChange,themeDatePickerOnHoursChange,themeDatePickerOnMinutesChange,themeDatePickerOnViewFullYearChange,themeDatePickerOnViewMonthChange,themeDatePickerSetViewNextMonth,themeDatePickerSetViewPrevMonth}from"./functions/models/ikas-theme/date-picker.js";export{createMediaSrcset,getDefaultSrc,getSrc,getThumbnailSrc}from"./functions/models/image/index.js";export{initIkasMerchantSettings}from"./functions/models/merchant-settings/init.js";export{getIkasOrderCouponAdjustment,getIkasOrderCustomerFullName,getIkasOrderDisplayedAdjustments,getIkasOrderDisplayedPackages,getIkasOrderDistinctItemCount,getIkasOrderFormattedDate,getIkasOrderFormattedOrderedAt,getIkasOrderFormattedShippingTotal,getIkasOrderFormattedTotalFinalPrice,getIkasOrderFormattedTotalPrice,getIkasOrderFormattedTotalTax,getIkasOrderHref,getIkasOrderNonCouponAdjustments,getIkasOrderPackageStatusTranslation,getIkasOrderProductFiles,getIkasOrderRefundableItems,getIkasOrderRefundedItems,getIkasOrderShippingTotal,getIkasOrderTotalItemCount,getIkasOrderTotalTax,getIkasOrderUnfullfilledItems,getIkasOrderVariantNames,hasIkasOrderCustomer,hasValidIkasOrderCustomerEmail,initIkasOrder,isIkasOrderRefundable}from"./functions/models/order/index.js";export{createOrderAddress,getOrderAddressText,getOrderAddressValidationResult,isValidOrderAddress}from"./functions/models/order/address/index.js";export{getOrderAdjustmentDisplayName,getOrderAdjustmentFormattedAmount,getOrderAdjustmentIsDecrement}from"./functions/models/order/adjustment/index.js";export{getOrderGiftPackageLineFormattedPrice}from"./functions/models/order/gift-package/index.js";export{editOrderLineItem,getOrderLineItemFinalPriceWithQuantity,getOrderLineItemFormattedDiscountPrice,getOrderLineItemFormattedFinalPrice,getOrderLineItemFormattedFinalPriceWithQuantity,getOrderLineItemFormattedFinalUnitPrice,getOrderLineItemFormattedOverridenPriceWithQuantity,getOrderLineItemFormattedPrice,getOrderLineItemFormattedPriceWithQuantity,getOrderLineItemFormattedTax,getOrderLineItemFormattedUnitPrice,getOrderLineItemOverridenPriceWithQuantity,getOrderLineItemPriceWithQuantity,getOrderLineItemRefundQuantity,getOrderLineItemTax,getOrderLineItemUnitPriceText,hasOrderLineItemDiscount,setOrderLineItemRefundQuantity}from"./functions/models/order/line-item/index.js";export{downloadFile,getOrderLineItemOptionValueFormattedPrice,getOrderLineOptionFileName}from"./functions/models/order/line-item/option/value/index.js";export{getIkasOrderLineVariantHref,getIkasOrderLineVariantMainImage}from"./functions/models/order/line-item/variant/index.js";export{getIkasOrderLineBundleVariantMainImage}from"./functions/models/order/line-item/variant/bundle-product/bundle-variant/index.js";export{getIkasOrderLineVariantNameSlug,getIkasOrderLineVariantTypeSlug}from"./functions/models/order/line-item/variant/value/index.js";export{getOrderTransactionFormattedAmount,getOrderTransactionPaymentMethodTranslation}from"./functions/models/order/transaction/index.js";export{getPaymentGatewayCalculatedAdditionalPrices}from"./functions/models/payment-gateway/index.js";export{initIkasPaymentGateway}from"./functions/models/payment-gateway/init.js";export{addIkasProductToFavorites,clearIkasProductCustomerReviewForm,getBundleProductFinalPrice,getBundleProductFinalPriceWithQuantity,getBundleProductFormattedFinalPrice,getBundleProductFormattedFinalPriceWithQuantity,getBundleProductFormattedSellPrice,getBundleProductFormattedSellPriceWithQuantity,getBundleProductSellPrice,getBundleProductSellPriceWithQuantity,getBundleProductsOfVariant,getDisplayedProductGroups,getDisplayedProductVariantTypes,getGroupedAttributeValues,getIkasProductCustomerReviewForm,getMainProductVariantType,getMainProductVariantValue,getProductAvailableStockLocations,getProductCampaigns,getProductCategoryPath,getProductFirstCategory,getProductHref,getProductOptionSet,getSelectedProductVariant,getSelectedProductVariantHref,hasProductStock,hasProductValidOptionValues,hasProductVariant,initBundleProducts,initProductOnBrowser,initProductOptionSet,isAddToCartEnabled,isBundleProductQuantityEditable,isCustomerReviewEnabled,isCustomerReviewLoginRequired,isFavoriteIkasProduct,removeIkasProductFromFavorites,selectVariantValue,setBundleProductQuantity,setOptionRealPrices,setProductOfBundleProduct,shouldDisplayBundleProductPrice}from"./functions/models/product/index.js";export{getProductFromStore,initIkasProduct,initIkasProductExtraFields,productVariantStore}from"./functions/models/product/init.js";export{clearProductListFilter,clearProductListFilters,enableProductListSuggestions,getProductListCurrencyCode,getProductListCurrencySymbol,getProductListFilterCategories,getProductListInitialData,getProductListNextPage,getProductListPage,getProductListPrevPage,getProductListSortOptions,getProductListSortTypeTranslation,getProductListSuggestionHref,getSelectedFilterValues,handleFilterValueClick,handleNumberRangeOptionClick,hasProductListAppliedFilters,hasProductListFeaturedSortEnabled,hasProductListNextPage,hasProductListPrevPage,initProductList,initProductListFilterCategories,initProductListOnBrowser,isProductListDiscounted,isProductListFilterable,isProductListFiltered,isProductListLastViewed,isProductListPurchasedTogether,isProductListRecommended,isProductListRelatedProducts,isProductListSearch,isProductListStatic,isProductListViewedTogether,onFilterCategoryClick,productListToggleFilterCollapsed,searchProductList,setProductListIsFilteredForProducts,setProductListIsStaticForProducts,setProductListVisiblePage,setSortType,translateProductListSortType}from"./functions/models/product-list/index.js";export{getIkasProductAttributeProducts,getIkasProductAttributeTableValue,getIkasProductAttrributeProductIds}from"./functions/models/product/attribute-value/index.js";export{initIkasProductAttributeValue}from"./functions/models/product/attribute-value/init.js";export{applyQueryParamForFilter,clearFilter,filterParseRangeStr,filterRangeToId,filterToInput,getFilterDisplayedValues,getFilterKeyList,getFilterValueList,getIkasFilterHref,getIkasFilterThumbnailImage,initIkasProductFilter,isBoxFilter,isCustomValueFilter,isListFilter,isStockFilter,isSwatchFilter,onNumberRangeFilterChange,onNumberRangeFilterOptionClick,selectFilterValue}from"./functions/models/product/filter/index.js";export{getDisplayedOptions,hasDisplayedOptions,hasValidProductOptionSetValues,initOptionValues,initProductOptionSetValues,setChildOptions}from"./functions/models/product/option-set/index.js";export{initIkasProductOptionSet}from"./functions/models/product/option-set/init.js";export{clearValues,getDisplayedChildOptions,getProductOptionFormattedLabel,getProductOptionFormattedPrice,getTextValue,hasError,hasValidProductOptionValues,initIkasProductOptionValues,isCheckboxOption,isChecked,isChoiceOption,isChoiceOptionBoxType,isChoiceOptionSelectType,isChoiceOptionSwatchType,isColorPickerOption,isDatePickerOption,isFileOption,isImageOption,isProductOptionSelectValueSelected,isTextAreaOption,isTextOption,productOptionFileUpload,selectValue,setCheckboxValue,setTextValue,setValues}from"./functions/models/product/option-set/option/index.js";export{initIkasProductOption}from"./functions/models/product/option-set/option/init.js";export{clearProductVariantBackInStockForm,getGroupedAttributeValuesForVariant,getProductVariantAppliedCampaignAmount,getProductVariantB2bPriceRule,getProductVariantBackInStockForm,getProductVariantBundlePrice,getProductVariantCampaignOffersDiscountPercentage,getProductVariantCampaignPrice,getProductVariantDiscountAmount,getProductVariantDiscountPercentage,getProductVariantDiscountPrice,getProductVariantFinalPrice,getProductVariantFinalPriceWithCampaignOffers,getProductVariantFormattedBuyPrice,getProductVariantFormattedCampaignPrice,getProductVariantFormattedDiscountAmount,getProductVariantFormattedDiscountPrice,getProductVariantFormattedFinalPrice,getProductVariantFormattedFinalPriceWithCampaignOffers,getProductVariantFormattedSellPrice,getProductVariantFormattedSellPriceWithCampaignOffers,getProductVariantIsBackInStockCustomerLoginRequired,getProductVariantIsBackInStockEnabled,getProductVariantMainImage,getProductVariantPrice,getProductVariantSellPrice,getProductVariantSellPriceWithCampaignOffers,getProductVariantUnitPriceText,hasBundleSettings,hasProductVariantDiscount,hasProductVariantStock,saveProductVariantBackInStockReminder}from"./functions/models/product/variant/index.js";export{initIkasProductVariant}from"./functions/models/product/variant/init.js";export{getIkasProductDiscountPercentage,getIkasProductPriceDiscountAmount,getIkasProductPriceFinalPrice,hasIkasProductPriceDiscount}from"./functions/models/product/variant/price/index.js";export{isRaffleAvailable}from"./functions/models/raffle/index.js";export{initIkasRaffle}from"./functions/models/raffle/init.js";export{initIkasState}from"./functions/models/state/init.js";export{getIkasVariantTypeSlug,isIkasVariantTypeColorSelection}from"./functions/models/variant-type/index.js";export{initIkasVariantType}from"./functions/models/variant-type/init.js";export{getIkasVariantValueSlug,getIkasVariantValueThumbnailImage,isColorVariantValue,isImageVariantValue,isTextVariantValue}from"./functions/models/variant-type/variant-value/index.js";export{FORM_ITEM_DEFAULT_VALUE,validateValue}from"./functions/models/validator/index.js";export{initAccountInfoForm,setAccountInfoFormFirstName,setAccountInfoFormIsMarketingAccepted,setAccountInfoFormLastName,setAccountInfoFormPhone,submitAccountInfoForm}from"./functions/models/validator/account-info/index.js";export{initAddressForm,setAddressFormAddressLine1,setAddressFormAddressLine2,setAddressFormCity,setAddressFormCompany,setAddressFormCountry,setAddressFormDistrict,setAddressFormFirstName,setAddressFormIdentityNumber,setAddressFormLastName,setAddressFormPhone,setAddressFormPostalCode,setAddressFormRegion,setAddressFormState,setAddressFormTaxNumber,setAddressFormTaxOffice,setAddressFormTitle,submitAddressForm}from"./functions/models/validator/address/index.js";export{initBackInStockNotificationForm,setBackInStockNotificationFormEmail,submitBackInStockNotificationForm}from"./functions/models/validator/back-in-stock-notification/index.js";export{initContactForm,setContactFormEmail,setContactFormFirstName,setContactFormLastName,setContactFormMessage,setContactFormPhone,submitContactForm}from"./functions/models/validator/contact-form/index.js";export{initCouponCodeForm,removeCouponCodeForm,setCouponCodeFormCouponCode,submitCouponCodeForm}from"./functions/models/validator/coupon-code-form/index.js";export{initCustomerReviewForm,setCustomerReviewFormComment,setCustomerReviewFormStar,setCustomerReviewFormTitle,submitCustomerReviewForm}from"./functions/models/validator/customer-review/index.js";export{initForgotPasswordForm,setForgotPasswordFormEmail,submitForgotPasswordForm}from"./functions/models/validator/forgot-password/index.js";export{initLoginForm,setLoginFormEmail,setLoginFormPassword,submitLoginForm}from"./functions/models/validator/login/index.js";export{initNewsletterSubscriptionForm,setNewsletterSubscriptionFormEmail,setNewsletterSubscriptionFormIsMarketingAccepted,submitNewsletterSubscriptionForm}from"./functions/models/validator/newsletter-subscription/index.js";export{initOrderTrackingForm,setOrderTrackingFormEmail,setOrderTrackingFormOrderNumber,submitOrderTrackingForm}from"./functions/models/validator/order-tracking/index.js";export{initRecoverPasswordForm,setRecoverPasswordFormPassword,setRecoverPasswordFormPasswordAgain,submitRecoverPasswordForm}from"./functions/models/validator/recover-password/index.js";export{initRegisterForm,setRegisterFormBooleanAttribute,setRegisterFormChoiceAttribute,setRegisterFormDateAttribute,setRegisterFormDateTimeAttribute,setRegisterFormEmail,setRegisterFormFirstName,setRegisterFormIsMarketingAccepted,setRegisterFormIsMembershipAgreementAccepted,setRegisterFormLastName,setRegisterFormMultipleChoiceAttribute,setRegisterFormNumericAttribute,setRegisterFormPassword,setRegisterFormPhone,setRegisterFormTextAttribute,submitRegisterForm}from"./functions/models/validator/register/index.js";export{initSmsLoginForm,resendSmsLoginFormCode,setSmsLoginFormCode,setSmsLoginFormEmail,setSmsLoginFormFirstName,setSmsLoginFormIsMarketingAccepted,setSmsLoginFormIsMembershipAgreementAccepted,setSmsLoginFormLastName,setSmsLoginFormPhone,submitSmsLoginForm}from"./functions/models/validator/sms-login/index.js";export{initVerifyPhoneNumberForm,resendVerifyPhoneNumberFormCode,setVerifyPhoneNumberFormCode,submitVerifyPhoneNumberForm}from"./functions/models/validator/verify-phone-number/index.js";export{collectionToArray}from"./functions/others/index.js";export{bs_searchProductById,bs_searchProductsById,initBaseStore,setLanguage,setLocalization}from"./functions/stores/base/index.js";export{addItemToCart,addSelectedtedVariantToCart,changeCartItemQuantity,changeItemQuantity,createPayWithIkasSession,findExistingCartItem,findExistingCartItemWithProduct,getAcceptedOffers,getCart,getCheckoutUrlFromCartStore,hasCart,isOrderLineItemAutoCreated,removeCart,removeCouponCode,removeItem,saveCouponCode,setCart,waitForCartStoreInit,windowAddToCart}from"./functions/stores/cart/index.js";export{activateCustomer,addProductToFavorites,canCustomerCreateEmailSubscription,checkEmail,clearAccountInfoForm,clearContactForm,clearCouponCodeForm,clearForgotPasswordForm,clearLoginForm,clearNewsletterSubscriptionForm,clearOrderTrackingForm,clearRecoverPasswordForm,clearRegisterForm,closeIkasStorefrontWidget,createEmailSubscription,cs_getLoyaltyCustomerInfo,cs_listEarningMethods,cs_listLoyaltyProgramPointHistory,cs_listLoyaltyProgramTiers,cs_listSpendingMethodsByCartId,cs_removeLoyaltyPointsFromCart,cs_useLoyaltyPoints,customerLogin,customerStore_onProductView,customerToAnalyticsCustomer,deactivateCustomer,deleteCustomerAddress,exportCustomerPersonalData,forgotPassword,getAccountInfoForm,getContactForm,getCouponCodeForm,getCustomerAttributes,getCustomerConsentGranted,getDigitalProductFileDownloadUrl,getEmptyAddressForm,getFavoriteProducts,getFavoriteProductsIds,getForgotPasswordForm,getLastViewedProducts,getLoginForm,getNewsletterSubscriptionForm,getOrder,getOrderByEmail,getOrderDetailsOfPage,getOrderProductFiles,getOrderRefundSettings,getOrderTrackingForm,getOrderTransactions,getOrders,getRecoverPasswordForm,getRegisterForm,getSmsLoginForm,getVerifyPhoneNumberForm,handleCustomerConsentGrant,handleSocialLogin,hasCustomer,initCustomerStore,isFavoriteProduct,logout,openIkasStorefrontWidget,recoverPassword,refundOrder,register,removeCustomerConsent,removeProductFromFavorites,resendCustomerActivationMail,resendCustomerPhoneVerificationCode,saveContactForm,saveCustomer,saveCustomerFormData,sendReview,setCaptchaToken,setSavedLastViewedProductsResponse,socialLogin,socialLoginToken,validateCustomerPhoneVerificationCode,validateOTPCode,waitForCaptchaTokenInit,waitForCustomerStoreInit}from"./functions/stores/customer/index.js";export{I18n,i18n}from"./i18n/index.js";export{Router,router,withRoutePrefix}from"./router/index.js";export{baseStore}from"./stores/base/index.js";export{CART_LS_KEY,cartStore}from"./stores/cart/index.js";export{customerStore}from"./stores/customer/index.js";export{DYNAMIC_STYLE_PROPERTIES,SIZE_PROPERTIES,getFormattedBorder,getFormattedBorderRadiusBottomLeftSize,getFormattedBorderRadiusBottomRightSize,getFormattedBorderRadiusSize,getFormattedBorderRadiusTopLeftSize,getFormattedBorderRadiusTopRightSize,getFormattedBorderWidthSizeSize,getFormattedBottomSize,getFormattedFontSize,getFormattedGapSize,getFormattedGridTemplateColumns,getFormattedHeightSize,getFormattedLeftSize,getFormattedLetterSpacingSize,getFormattedLineHeightSize,getFormattedMarginBottomSize,getFormattedMarginLeftSize,getFormattedMarginRightSize,getFormattedMarginTopSize,getFormattedMaxHeightSize,getFormattedMaxWidthSize,getFormattedMinHeightSize,getFormattedMinWidthSize,getFormattedPaddingBottomSize,getFormattedPaddingLeftSize,getFormattedPaddingMarginSize,getFormattedPaddingRightSize,getFormattedPaddingSize,getFormattedPaddingTopSize,getFormattedRightSize,getFormattedShadow,getFormattedSize,getFormattedStyleVariable,getFormattedTopSize,getFormattedWidthSize}from"./theme/styles/index.js";export{isBrowser,isDefined,isEmpty,isNotEmpty}from"./utils/blueprint.js";export{IkasComponentRenderer}from"./utils/component-renderer.js";export{HttpMethod,get,httpRequest,post}from"./utils/fetch.js";export{JsObject}from"./utils/object-wrapper.js";export{setAPIClientConfig}from"./packages/storefront-api/src/index.js";export{IkasStorefrontConfig,escapeForJSON,unescapeFromJSON}from"./packages/storefront-config/src/index.js";import"./packages/storefront-models/src/models/merchant-settings/index.js";export{default as IkasAPIClientConfig}from"./packages/storefront-api-client/src/config/index.js";export{anl_addToCart}from"./analytics/analytics-functions/addToCart.js";export{anl_addToWishlist}from"./analytics/analytics-functions/addToWishlist.js";export{anl_completeRegistration}from"./analytics/analytics-functions/completeRegistration.js";export{anl_contactForm}from"./analytics/analytics-functions/contactForm.js";export{anl_createEmailSubscription}from"./analytics/analytics-functions/createEmailSubscription.js";export{anl_customerLogin}from"./analytics/analytics-functions/customerLogin.js";export{anl_customerLogout}from"./analytics/analytics-functions/customerLogout.js";export{anl_customerVisit}from"./analytics/analytics-functions/customerVisit.js";export{anl_pageView}from"./analytics/analytics-functions/pageView.js";export{anl_productView}from"./analytics/analytics-functions/productView.js";export{anl_removeFromCart}from"./analytics/analytics-functions/removeFromCart.js";export{anl_search}from"./analytics/analytics-functions/search.js";export{anl_viewBrand}from"./analytics/analytics-functions/viewBrand.js";export{anl_viewCart}from"./analytics/analytics-functions/viewCart.js";export{anl_viewCategory}from"./analytics/analytics-functions/viewCategory.js";export{anl_viewListing}from"./analytics/analytics-functions/viewListing.js";export{anl_viewSearchResults}from"./analytics/analytics-functions/viewSearchResults.js";export{anl_viewStorefrontPopup}from"./analytics/analytics-functions/viewStorefrontPopup.js";import*as t from'./ext/animejs/lib/anime.esm.js';export{t as AnimeJS};export{cloneDeep,reaction}from"./utils/helper.js";export{APIErrorCode,APIResponse}from"./packages/storefront-api-client/src/utils/api.js";
1
+ export{Analytics}from"./analytics/analytics.js";export{initIkasEvents}from"./analytics/events.js";export{EMPTY_STRING,NULL,UNDEFINED}from"./externals/index.js";export{apiListProductBrand}from"./functions/api/brand/index.js";export{apiListCategory}from"./functions/api/category/index.js";export{apiGetLoyaltyCustomerInfo,apiGetStorefrontWidgetSettings,apiListEarningMethods,apiListLoyaltyProgramPointHistory,apiListLoyaltyProgramTiers,apiListSpendingMethodsByCartId,apiRemoveLoyaltyPointsFromCart,apiUseLoyaltyPoints}from"./functions/api/loyalty/index.js";export{apiListStorefrontPopup}from"./functions/api/popup/index.js";export{apiSearchProducts}from"./functions/api/product/index.js";export{getAttributeDetailValues}from"./functions/models/attribute-detail/index.js";export{getAttributeListValues}from"./functions/models/attribute-list/index.js";export{createIkasBaseModel}from"./functions/models/base/index.js";export{getIkasBlogFormattedDate,getIkasBlogHref}from"./functions/models/blog/index.js";export{createIkasBlogCategory,getIkasBlogCategoryHref}from"./functions/models/blog/category/index.js";export{initIkasBlogCategory}from"./functions/models/blog/category/init.js";export{initIkasBlog}from"./functions/models/blog/init.js";export{getBlogCategoryListInitialData,getBlogCategoryListNextPage,getBlogCategoryListPage,getBlogCategoryListPageCount,getBlogCategoryListPrevPage,hasBlogCategoryListNextPage,hasBlogCategoryListPrevPage,isBlogCategoryListStatic}from"./functions/models/blog-category-list/index.js";export{initBlogCategoryList}from"./functions/models/blog-category-list/init.js";export{getBlogListInitialData,getBlogListNextPage,getBlogListPage,getBlogListPageCount,getBlogListPrevPage,hasBlogListNextPage,hasBlogListPrevPage,isBlogListStatic}from"./functions/models/blog-list/index.js";export{initBlogList}from"./functions/models/blog-list/init.js";export{getIkasBrandHref}from"./functions/models/brand/index.js";export{initIkasBrand}from"./functions/models/brand/init.js";export{getBrandListInitialData,getBrandListNextPage,getBrandListPage,getBrandListPageCount,getBrandListPrevPage,hasBrandListNextPage,hasBrandListPrevPage,isBrandListStatic}from"./functions/models/brand-list/index.js";export{initBrandList}from"./functions/models/brand-list/init.js";export{acceptProductOffer,isAcceptedProductOffer,rejectProductOffer}from"./functions/models/campaign-offer/index.js";export{getCategoryPath,getIkasCategoryHref}from"./functions/models/category/index.js";export{initIkasCategory}from"./functions/models/category/init.js";export{getCategoryListInitialData,getCategoryListNextPage,getCategoryListPage,getCategoryListPageCount,getCategoryListPrevPage,hasCategoryListNextPage,hasCategoryListPrevPage,isCategoryListStatic}from"./functions/models/category-list/index.js";export{initCategoryList}from"./functions/models/category-list/init.js";export{getIkasCategoryPathItemHref,getIkasCategoryPathItemSlug}from"./functions/models/category/path-item/index.js";export{initIkasCategoryPathItem}from"./functions/models/category/path-item/init.js";export{getCheckoutTotalFinalPrice,isCheckoutComplete}from"./functions/models/checkout/index.js";export{initIkasCountry}from"./functions/models/country/init.js";export{getCustomerBasicInfo,isCustomerSubscribed}from"./functions/models/customer/index.js";export{clearIkasCustomerAddressForm,getCustomerAddressText,getCustomerAddressValidationResult,getIkasCustomerAddressForm,isValidCustomerAddress}from"./functions/models/customer/address/index.js";export{getCustomerAttributeAccountPagePermission,getCustomerAttributeRegisterPageRequirement}from"./functions/models/customer/attribute/index.js";export{initIkasCustomerAttribute}from"./functions/models/customer/attribute/init.js";export{getIkasCustomerReviewFormattedDate}from"./functions/models/customer/review/index.js";export{initIkasCustomerReview}from"./functions/models/customer/review/init.js";export{getCustomerReviewListInitialData,getCustomerReviewListNextPage,getCustomerReviewListPage,getCustomerReviewListPageCount,getCustomerReviewListPrev,getProductCustomerReviews,hasCustomerReviewListNextPage,hasCustomerReviewListPrevPage}from"./functions/models/customer-review-list/index.js";export{initCustomerReviewList}from"./functions/models/customer-review-list/init.js";export{getCustomerReviewSummaryListInitialData,getCustomerReviewSummaryListNextPage,getCustomerReviewSummaryListPage,getCustomerReviewSummaryListPrev,hasCustomerReviewSummaryListNextPage,hasCustomerReviewSummaryListPrevPage}from"./functions/models/customer-review-summary-list/index.js";export{initCustomerReviewSummaryList}from"./functions/models/customer-review-summary-list/init.js";export{getIkasFilterCategoryHref,getIkasFilterCategorySlug}from"./functions/models/filter-category/index.js";export{initIkasHTMLMetaData,setHTMLMetaDataTranslations}from"./functions/models/html-meta-data/init.js";export{initThemeDatePicker,themeDatePickerGetDate,themeDatePickerGetDaysOfMonth,themeDatePickerGetDaysOfWeekShort,themeDatePickerGetFullYear,themeDatePickerGetHours,themeDatePickerGetMinutes,themeDatePickerGetMonth,themeDatePickerGetMonthList,themeDatePickerGetMonthName,themeDatePickerGetViewFullYear,themeDatePickerGetViewMonth,themeDatePickerGetWeekFirstDay,themeDatePickerOnChange,themeDatePickerOnDayChange,themeDatePickerOnHoursChange,themeDatePickerOnMinutesChange,themeDatePickerOnViewFullYearChange,themeDatePickerOnViewMonthChange,themeDatePickerSetViewNextMonth,themeDatePickerSetViewPrevMonth}from"./functions/models/ikas-theme/date-picker.js";export{createMediaSrcset,getDefaultSrc,getSrc,getThumbnailSrc}from"./functions/models/image/index.js";export{initIkasMerchantSettings}from"./functions/models/merchant-settings/init.js";export{getIkasOrderCouponAdjustment,getIkasOrderCustomerFullName,getIkasOrderDisplayedAdjustments,getIkasOrderDisplayedPackages,getIkasOrderDistinctItemCount,getIkasOrderFormattedDate,getIkasOrderFormattedOrderedAt,getIkasOrderFormattedShippingTotal,getIkasOrderFormattedTotalFinalPrice,getIkasOrderFormattedTotalPrice,getIkasOrderFormattedTotalTax,getIkasOrderHref,getIkasOrderNonCouponAdjustments,getIkasOrderPackageStatusTranslation,getIkasOrderProductFiles,getIkasOrderRefundableItems,getIkasOrderRefundedItems,getIkasOrderShippingTotal,getIkasOrderTotalItemCount,getIkasOrderTotalTax,getIkasOrderUnfullfilledItems,getIkasOrderVariantNames,hasIkasOrderCustomer,hasValidIkasOrderCustomerEmail,initIkasOrder,isIkasOrderRefundable}from"./functions/models/order/index.js";export{createOrderAddress,getOrderAddressText,getOrderAddressValidationResult,isValidOrderAddress}from"./functions/models/order/address/index.js";export{getOrderAdjustmentDisplayName,getOrderAdjustmentFormattedAmount,getOrderAdjustmentIsDecrement}from"./functions/models/order/adjustment/index.js";export{getOrderGiftPackageLineFormattedPrice}from"./functions/models/order/gift-package/index.js";export{editOrderLineItem,getOrderLineItemFinalPriceWithQuantity,getOrderLineItemFormattedDiscountPrice,getOrderLineItemFormattedFinalPrice,getOrderLineItemFormattedFinalPriceWithQuantity,getOrderLineItemFormattedFinalUnitPrice,getOrderLineItemFormattedOverridenPriceWithQuantity,getOrderLineItemFormattedPrice,getOrderLineItemFormattedPriceWithQuantity,getOrderLineItemFormattedTax,getOrderLineItemFormattedUnitPrice,getOrderLineItemOverridenPriceWithQuantity,getOrderLineItemPriceWithQuantity,getOrderLineItemRefundQuantity,getOrderLineItemTax,getOrderLineItemUnitPriceText,hasOrderLineItemDiscount,setOrderLineItemRefundQuantity}from"./functions/models/order/line-item/index.js";export{downloadFile,getOrderLineItemOptionValueFormattedPrice,getOrderLineOptionFileName}from"./functions/models/order/line-item/option/value/index.js";export{getIkasOrderLineVariantHref,getIkasOrderLineVariantMainImage}from"./functions/models/order/line-item/variant/index.js";export{getIkasOrderLineBundleVariantMainImage}from"./functions/models/order/line-item/variant/bundle-product/bundle-variant/index.js";export{getIkasOrderLineVariantNameSlug,getIkasOrderLineVariantTypeSlug}from"./functions/models/order/line-item/variant/value/index.js";export{getOrderTransactionFormattedAmount,getOrderTransactionPaymentMethodTranslation}from"./functions/models/order/transaction/index.js";export{getPaymentGatewayCalculatedAdditionalPrices}from"./functions/models/payment-gateway/index.js";export{initIkasPaymentGateway}from"./functions/models/payment-gateway/init.js";export{addIkasProductToFavorites,clearIkasProductCustomerReviewForm,getBundleProductFinalPrice,getBundleProductFinalPriceWithQuantity,getBundleProductFormattedFinalPrice,getBundleProductFormattedFinalPriceWithQuantity,getBundleProductFormattedSellPrice,getBundleProductFormattedSellPriceWithQuantity,getBundleProductSellPrice,getBundleProductSellPriceWithQuantity,getBundleProductsOfVariant,getDisplayedProductGroups,getDisplayedProductVariantTypes,getGroupedAttributeValues,getIkasProductCustomerReviewForm,getMainProductVariantType,getMainProductVariantValue,getProductAvailableStockLocations,getProductCampaigns,getProductCategoryPath,getProductFirstCategory,getProductHref,getProductOptionSet,getSelectedProductVariant,getSelectedProductVariantHref,hasProductStock,hasProductValidOptionValues,hasProductVariant,initBundleProducts,initProductOnBrowser,initProductOptionSet,isAddToCartEnabled,isBundleProductQuantityEditable,isCustomerReviewEnabled,isCustomerReviewLoginRequired,isFavoriteIkasProduct,removeIkasProductFromFavorites,selectVariantValue,setBundleProductQuantity,setOptionRealPrices,setProductOfBundleProduct,shouldDisplayBundleProductPrice}from"./functions/models/product/index.js";export{getProductFromStore,initIkasProduct,initIkasProductExtraFields,productVariantStore}from"./functions/models/product/init.js";export{clearProductListFilter,clearProductListFilters,enableProductListSuggestions,getProductListCurrencyCode,getProductListCurrencySymbol,getProductListFilterCategories,getProductListInitialData,getProductListNextPage,getProductListPage,getProductListPrevPage,getProductListSortOptions,getProductListSortTypeTranslation,getProductListSuggestionHref,getSelectedFilterValues,handleFilterValueClick,handleNumberRangeOptionClick,hasProductListAppliedFilters,hasProductListFeaturedSortEnabled,hasProductListNextPage,hasProductListPrevPage,initProductList,initProductListFilterCategories,initProductListOnBrowser,isProductListDiscounted,isProductListFilterable,isProductListFiltered,isProductListLastViewed,isProductListPurchasedTogether,isProductListRecommended,isProductListRelatedProducts,isProductListSearch,isProductListStatic,isProductListViewedTogether,onFilterCategoryClick,productListToggleFilterCollapsed,searchProductList,setProductListIsFilteredForProducts,setProductListIsStaticForProducts,setProductListVisiblePage,setSortType,translateProductListSortType}from"./functions/models/product-list/index.js";export{getIkasProductAttributeProducts,getIkasProductAttributeTableValue,getIkasProductAttrributeProductIds}from"./functions/models/product/attribute-value/index.js";export{initIkasProductAttributeValue}from"./functions/models/product/attribute-value/init.js";export{applyQueryParamForFilter,clearFilter,filterParseRangeStr,filterRangeToId,filterToInput,getFilterDisplayedValues,getFilterKeyList,getFilterValueList,getIkasFilterHref,getIkasFilterThumbnailImage,initIkasProductFilter,isBoxFilter,isCustomValueFilter,isListFilter,isStockFilter,isSwatchFilter,onNumberRangeFilterChange,onNumberRangeFilterOptionClick,selectFilterValue}from"./functions/models/product/filter/index.js";export{getDisplayedOptions,hasDisplayedOptions,hasValidProductOptionSetValues,initOptionValues,initProductOptionSetValues,setChildOptions}from"./functions/models/product/option-set/index.js";export{initIkasProductOptionSet}from"./functions/models/product/option-set/init.js";export{clearValues,getDisplayedChildOptions,getProductOptionFormattedLabel,getProductOptionFormattedPrice,getTextValue,hasError,hasValidProductOptionValues,initIkasProductOptionValues,isCheckboxOption,isChecked,isChoiceOption,isChoiceOptionBoxType,isChoiceOptionSelectType,isChoiceOptionSwatchType,isColorPickerOption,isDatePickerOption,isFileOption,isImageOption,isProductOptionSelectValueSelected,isTextAreaOption,isTextOption,productOptionFileUpload,selectValue,setCheckboxValue,setTextValue,setValues}from"./functions/models/product/option-set/option/index.js";export{initIkasProductOption}from"./functions/models/product/option-set/option/init.js";export{clearProductVariantBackInStockForm,getGroupedAttributeValuesForVariant,getProductVariantAppliedCampaignAmount,getProductVariantB2bPriceRule,getProductVariantBackInStockForm,getProductVariantBundlePrice,getProductVariantCampaignOffersDiscountPercentage,getProductVariantCampaignPrice,getProductVariantDiscountAmount,getProductVariantDiscountPercentage,getProductVariantDiscountPrice,getProductVariantFinalPrice,getProductVariantFinalPriceWithCampaignOffers,getProductVariantFormattedBuyPrice,getProductVariantFormattedCampaignPrice,getProductVariantFormattedDiscountAmount,getProductVariantFormattedDiscountPrice,getProductVariantFormattedFinalPrice,getProductVariantFormattedFinalPriceWithCampaignOffers,getProductVariantFormattedSellPrice,getProductVariantFormattedSellPriceWithCampaignOffers,getProductVariantIsBackInStockCustomerLoginRequired,getProductVariantIsBackInStockEnabled,getProductVariantMainImage,getProductVariantPrice,getProductVariantSellPrice,getProductVariantSellPriceWithCampaignOffers,getProductVariantUnitPriceText,hasBundleSettings,hasProductVariantDiscount,hasProductVariantStock,saveProductVariantBackInStockReminder}from"./functions/models/product/variant/index.js";export{initIkasProductVariant}from"./functions/models/product/variant/init.js";export{getIkasProductDiscountPercentage,getIkasProductPriceDiscountAmount,getIkasProductPriceFinalPrice,hasIkasProductPriceDiscount}from"./functions/models/product/variant/price/index.js";export{isRaffleAvailable}from"./functions/models/raffle/index.js";export{initIkasRaffle}from"./functions/models/raffle/init.js";export{initIkasState}from"./functions/models/state/init.js";export{getIkasVariantTypeSlug,isIkasVariantTypeColorSelection}from"./functions/models/variant-type/index.js";export{initIkasVariantType}from"./functions/models/variant-type/init.js";export{getIkasVariantValueSlug,getIkasVariantValueThumbnailImage,isColorVariantValue,isImageVariantValue,isTextVariantValue}from"./functions/models/variant-type/variant-value/index.js";export{FORM_ITEM_DEFAULT_VALUE,validateValue}from"./functions/models/validator/index.js";export{initAccountInfoForm,setAccountInfoFormFirstName,setAccountInfoFormIsMarketingAccepted,setAccountInfoFormLastName,setAccountInfoFormPhone,submitAccountInfoForm}from"./functions/models/validator/account-info/index.js";export{initAddressForm,setAddressFormAddressLine1,setAddressFormAddressLine2,setAddressFormCity,setAddressFormCompany,setAddressFormCountry,setAddressFormDistrict,setAddressFormFirstName,setAddressFormIdentityNumber,setAddressFormLastName,setAddressFormPhone,setAddressFormPostalCode,setAddressFormRegion,setAddressFormState,setAddressFormTaxNumber,setAddressFormTaxOffice,setAddressFormTitle,submitAddressForm}from"./functions/models/validator/address/index.js";export{initBackInStockNotificationForm,setBackInStockNotificationFormEmail,submitBackInStockNotificationForm}from"./functions/models/validator/back-in-stock-notification/index.js";export{initContactForm,setContactFormEmail,setContactFormFirstName,setContactFormLastName,setContactFormMessage,setContactFormPhone,submitContactForm}from"./functions/models/validator/contact-form/index.js";export{initCouponCodeForm,removeCouponCodeForm,setCouponCodeFormCouponCode,submitCouponCodeForm}from"./functions/models/validator/coupon-code-form/index.js";export{initCustomerReviewForm,setCustomerReviewFormComment,setCustomerReviewFormStar,setCustomerReviewFormTitle,submitCustomerReviewForm}from"./functions/models/validator/customer-review/index.js";export{initForgotPasswordForm,setForgotPasswordFormEmail,submitForgotPasswordForm}from"./functions/models/validator/forgot-password/index.js";export{initLoginForm,setLoginFormEmail,setLoginFormPassword,submitLoginForm}from"./functions/models/validator/login/index.js";export{initNewsletterSubscriptionForm,setNewsletterSubscriptionFormEmail,setNewsletterSubscriptionFormIsMarketingAccepted,submitNewsletterSubscriptionForm}from"./functions/models/validator/newsletter-subscription/index.js";export{initOrderTrackingForm,setOrderTrackingFormEmail,setOrderTrackingFormOrderNumber,submitOrderTrackingForm}from"./functions/models/validator/order-tracking/index.js";export{initRecoverPasswordForm,setRecoverPasswordFormPassword,setRecoverPasswordFormPasswordAgain,submitRecoverPasswordForm}from"./functions/models/validator/recover-password/index.js";export{initRegisterForm,setRegisterFormBooleanAttribute,setRegisterFormChoiceAttribute,setRegisterFormDateAttribute,setRegisterFormDateTimeAttribute,setRegisterFormEmail,setRegisterFormFirstName,setRegisterFormIsMarketingAccepted,setRegisterFormIsMembershipAgreementAccepted,setRegisterFormLastName,setRegisterFormMultipleChoiceAttribute,setRegisterFormNumericAttribute,setRegisterFormPassword,setRegisterFormPhone,setRegisterFormTextAttribute,submitRegisterForm}from"./functions/models/validator/register/index.js";export{initSmsLoginForm,resendSmsLoginFormCode,setSmsLoginFormCode,setSmsLoginFormEmail,setSmsLoginFormFirstName,setSmsLoginFormIsMarketingAccepted,setSmsLoginFormIsMembershipAgreementAccepted,setSmsLoginFormLastName,setSmsLoginFormPhone,submitSmsLoginForm}from"./functions/models/validator/sms-login/index.js";export{initVerifyPhoneNumberForm,resendVerifyPhoneNumberFormCode,setVerifyPhoneNumberFormCode,submitVerifyPhoneNumberForm}from"./functions/models/validator/verify-phone-number/index.js";export{collectionToArray}from"./functions/others/index.js";export{bs_searchProductById,bs_searchProductsById,initBaseStore,setLanguage,setLocalization}from"./functions/stores/base/index.js";export{addItemToCart,addSelectedtedVariantToCart,changeCartItemQuantity,changeItemQuantity,createPayWithIkasSession,findExistingCartItem,findExistingCartItemWithProduct,getAcceptedOffers,getCart,getCheckoutUrlFromCartStore,hasCart,isOrderLineItemAutoCreated,removeCart,removeCouponCode,removeItem,saveCouponCode,setCart,waitForCartStoreInit,windowAddToCart}from"./functions/stores/cart/index.js";export{activateCustomer,addProductToFavorites,canCustomerCreateEmailSubscription,checkEmail,clearAccountInfoForm,clearContactForm,clearCouponCodeForm,clearForgotPasswordForm,clearLoginForm,clearNewsletterSubscriptionForm,clearOrderTrackingForm,clearRecoverPasswordForm,clearRegisterForm,closeIkasStorefrontWidget,createEmailSubscription,cs_getLoyaltyCustomerInfo,cs_listEarningMethods,cs_listLoyaltyProgramPointHistory,cs_listLoyaltyProgramTiers,cs_listSpendingMethodsByCartId,cs_removeLoyaltyPointsFromCart,cs_useLoyaltyPoints,customerLogin,customerStore_onProductView,customerToAnalyticsCustomer,deactivateCustomer,deleteCustomerAddress,exportCustomerPersonalData,forgotPassword,getAccountInfoForm,getContactForm,getCouponCodeForm,getCustomerAttributes,getCustomerConsentGranted,getDigitalProductFileDownloadUrl,getEmptyAddressForm,getFavoriteProducts,getFavoriteProductsIds,getForgotPasswordForm,getLastViewedProducts,getLoginForm,getNewsletterSubscriptionForm,getOrder,getOrderByEmail,getOrderDetailsOfPage,getOrderProductFiles,getOrderRefundSettings,getOrderTrackingForm,getOrderTransactions,getOrders,getRecoverPasswordForm,getRegisterForm,getSmsLoginForm,getVerifyPhoneNumberForm,handleCustomerConsentGrant,handleSocialLogin,hasCustomer,initCustomerStore,isFavoriteProduct,logout,openIkasStorefrontWidget,recoverPassword,refundOrder,register,removeCustomerConsent,removeProductFromFavorites,resendCustomerActivationMail,resendCustomerPhoneVerificationCode,saveContactForm,saveCustomer,saveCustomerFormData,sendReview,setCaptchaToken,setSavedLastViewedProductsResponse,socialLogin,socialLoginToken,validateCustomerPhoneVerificationCode,validateOTPCode,waitForCaptchaTokenInit,waitForCustomerStoreInit}from"./functions/stores/customer/index.js";export{I18n,i18n}from"./i18n/index.js";export{Router,router,withRoutePrefix}from"./router/index.js";export{baseStore}from"./stores/base/index.js";export{CART_LS_KEY,cartStore}from"./stores/cart/index.js";export{customerStore}from"./stores/customer/index.js";export{getThemeBreakpoints,getThemeColorSchemes,getThemeColors,getThemeKeyframes,getThemeSetting,getThemeSettingValue,getThemeSettings,getThemeTypography,registerThemeSettingValues}from"./theme/settings/index.js";export{DYNAMIC_STYLE_PROPERTIES,SIZE_PROPERTIES,getFormattedBorder,getFormattedBorderRadiusBottomLeftSize,getFormattedBorderRadiusBottomRightSize,getFormattedBorderRadiusSize,getFormattedBorderRadiusTopLeftSize,getFormattedBorderRadiusTopRightSize,getFormattedBorderWidthSizeSize,getFormattedBottomSize,getFormattedFontSize,getFormattedGapSize,getFormattedGridTemplateColumns,getFormattedHeightSize,getFormattedLeftSize,getFormattedLetterSpacingSize,getFormattedLineHeightSize,getFormattedMarginBottomSize,getFormattedMarginLeftSize,getFormattedMarginRightSize,getFormattedMarginTopSize,getFormattedMaxHeightSize,getFormattedMaxWidthSize,getFormattedMinHeightSize,getFormattedMinWidthSize,getFormattedPaddingBottomSize,getFormattedPaddingLeftSize,getFormattedPaddingMarginSize,getFormattedPaddingRightSize,getFormattedPaddingSize,getFormattedPaddingTopSize,getFormattedRightSize,getFormattedShadow,getFormattedSize,getFormattedStyleVariable,getFormattedTopSize,getFormattedWidthSize}from"./theme/styles/index.js";export{isBrowser,isDefined,isEmpty,isNotEmpty}from"./utils/blueprint.js";export{IkasComponentRenderer}from"./utils/component-renderer.js";export{HttpMethod,get,httpRequest,post}from"./utils/fetch.js";export{JsObject}from"./utils/object-wrapper.js";export{normalizeSvg}from"./utils/svg.js";export{setAPIClientConfig}from"./packages/storefront-api/src/index.js";export{IkasStorefrontConfig,escapeForJSON,unescapeFromJSON}from"./packages/storefront-config/src/index.js";import"./packages/storefront-models/src/models/merchant-settings/index.js";export{default as IkasAPIClientConfig}from"./packages/storefront-api-client/src/config/index.js";export{anl_addToCart}from"./analytics/analytics-functions/addToCart.js";export{anl_addToWishlist}from"./analytics/analytics-functions/addToWishlist.js";export{anl_completeRegistration}from"./analytics/analytics-functions/completeRegistration.js";export{anl_contactForm}from"./analytics/analytics-functions/contactForm.js";export{anl_createEmailSubscription}from"./analytics/analytics-functions/createEmailSubscription.js";export{anl_customerLogin}from"./analytics/analytics-functions/customerLogin.js";export{anl_customerLogout}from"./analytics/analytics-functions/customerLogout.js";export{anl_customerVisit}from"./analytics/analytics-functions/customerVisit.js";export{anl_pageView}from"./analytics/analytics-functions/pageView.js";export{anl_productView}from"./analytics/analytics-functions/productView.js";export{anl_removeFromCart}from"./analytics/analytics-functions/removeFromCart.js";export{anl_search}from"./analytics/analytics-functions/search.js";export{anl_viewBrand}from"./analytics/analytics-functions/viewBrand.js";export{anl_viewCart}from"./analytics/analytics-functions/viewCart.js";export{anl_viewCategory}from"./analytics/analytics-functions/viewCategory.js";export{anl_viewListing}from"./analytics/analytics-functions/viewListing.js";export{anl_viewSearchResults}from"./analytics/analytics-functions/viewSearchResults.js";export{anl_viewStorefrontPopup}from"./analytics/analytics-functions/viewStorefrontPopup.js";import*as e from'./ext/animejs/lib/anime.esm.js';export{e as AnimeJS};export{cloneDeep,reaction}from"./utils/helper.js";export{APIErrorCode,APIResponse}from"./packages/storefront-api-client/src/utils/api.js";export{EMPTY_THEME_GLOBALS,breakpointCssToken,cssVarCamelCase,cssVarRef,isReservedVariableId,rawClassRef,resolveBreakpointMediaTokens,serializeThemeGlobals,toResolverBreakpoints}from"./packages/storefront-config/src/theme-globals.js";
@@ -1 +1 @@
1
- import{__assign as t}from'./../../../ext/tslib/tslib.es6.mjs.js';var r=function(){function r(){}return r.addObserver=function(t){var n=r.observers.find(function(r){return r.id===t.id});n?n.callback=t.callback:r.observers.push(t),t.callback(r)},r.init=function(t){try{var n=["themeSecret"];Object.entries(t).forEach(function(t){var i=t[0],o=t[1];n.includes(i)||(r[i]="storefrontJSScripts"===i||"highPriorityStoreFrontJSScripts"===i?null==o?void 0:o.map(function(t){return e(t)}):o)}),t.token&&(r.apiKey=t.token),this.notify()}catch(t){console.error(t)}},r.getCurrentRouting=function(){return r.routings.find(function(t){return t.id===r.storefrontRoutingId})},r.getCurrentPath=function(){var t;return(null===(t=r.getCurrentRouting())||void 0===t?void 0:t.path)||""},r.getSupportedPaths=function(){return r.routings.map(function(t){var r;return(null===(r=t.path)||void 0===r?void 0:r.split("/")[0])||""})},r.getCurrentLocale=function(){var t=r.getCurrentRouting();return(null==t?void 0:t.locale)||"en"},r.getDefaultLocale=function(){var t=r.routings.find(function(t){return"/"===t.path||!t.path});return(null==t?void 0:t.locale)||"en"},r.getIsPreview=function(){return r.isPreview},r.notify=function(){var t=this;this.observers.forEach(function(r){return r.callback(t)})},r.isCustomerReviewEnabled=function(){var t=r.customerReviewSettings;return!!t&&!t.customerPurchaseRequired},r.isCustomerReviewLoginRequired=function(){var t=r.customerReviewSettings;return!t||t.customerLoginRequired},r.isBackInStockEnabled=function(){return!!r.productBackInStockSettings},r.isCustomerLoginRequiredForBackInStock=function(){var t=r.productBackInStockSettings;return t&&t.customerLoginRequired},r.toJSON=function(){var r=t({},this);return delete r.observers,r.storefrontJSScripts=this.storefrontJSScripts.map(function(t){return n(t)}),r.highPriorityStoreFrontJSScripts=this.highPriorityStoreFrontJSScripts.map(function(t){return n(t)}),r},r.isB2BStorefront=function(){return"B2B_STOREFRONT"===r.storefrontType},r.getDefaultCurrencyCode=function(){var t;return null===(t=r.getCurrentRouting())||void 0===t?void 0:t.currencyCode},r.getDefaultCurrencySymbol=function(){var t;return null===(t=r.getCurrentRouting())||void 0===t?void 0:t.currencySymbol},r.isCaptchaRequired=function(){var t;return(null===(t=r.customerSettings)||void 0===t?void 0:t.requireCaptchaValidation)||!1},r.getPayWithIkasUrl=function(){return r.payWithIkasUrl},r.routings=[],r.paymentGateways=[],r.translations={},r.storefrontJSScripts=[],r.highPriorityStoreFrontJSScripts=[],r.isEditor=!1,r.observers=[],r.isPreview=!1,r}();function n(t){return"string"!=typeof t?(console.error("escapeForJSON: Input is not a string",t),""):t.replace(/<\/script\b/gi,"<\\/script")}function e(t){return"string"!=typeof t?(console.error("unescapeFromJSON: Input is not a string",t),""):t.replace(/<\\\/script\b/gi,"</script")}export{r as IkasStorefrontConfig,n as escapeForJSON,e as unescapeFromJSON};
1
+ import{__assign as r}from'./../../../ext/tslib/tslib.es6.mjs.js';import{EMPTY_THEME_GLOBALS as t}from"./theme-globals.js";export{EMPTY_THEME_GLOBALS,breakpointCssToken,cssVarCamelCase,cssVarRef,isReservedVariableId,rawClassRef,resolveBreakpointMediaTokens,serializeThemeGlobals,toResolverBreakpoints}from"./theme-globals.js";var e=function(){function e(){}return e.addObserver=function(r){var t=e.observers.find(function(t){return t.id===r.id});t?t.callback=r.callback:e.observers.push(r),r.callback(e)},e.init=function(r){try{var t=["themeSecret"];Object.entries(r).forEach(function(r){var n=r[0],i=r[1];t.includes(n)||(e[n]="storefrontJSScripts"===n||"highPriorityStoreFrontJSScripts"===n?null==i?void 0:i.map(function(r){return o(r)}):i)}),r.token&&(e.apiKey=r.token),this.notify()}catch(r){console.error(r)}},e.getCurrentRouting=function(){return e.routings.find(function(r){return r.id===e.storefrontRoutingId})},e.getCurrentPath=function(){var r;return(null===(r=e.getCurrentRouting())||void 0===r?void 0:r.path)||""},e.getSupportedPaths=function(){return e.routings.map(function(r){var t;return(null===(t=r.path)||void 0===t?void 0:t.split("/")[0])||""})},e.getCurrentLocale=function(){var r=e.getCurrentRouting();return(null==r?void 0:r.locale)||"en"},e.getDefaultLocale=function(){var r=e.routings.find(function(r){return"/"===r.path||!r.path});return(null==r?void 0:r.locale)||"en"},e.getIsPreview=function(){return e.isPreview},e.notify=function(){var r=this;this.observers.forEach(function(t){return t.callback(r)})},e.isCustomerReviewEnabled=function(){var r=e.customerReviewSettings;return!!r&&!r.customerPurchaseRequired},e.isCustomerReviewLoginRequired=function(){var r=e.customerReviewSettings;return!r||r.customerLoginRequired},e.isBackInStockEnabled=function(){return!!e.productBackInStockSettings},e.isCustomerLoginRequiredForBackInStock=function(){var r=e.productBackInStockSettings;return r&&r.customerLoginRequired},e.toJSON=function(){var t=r({},this);return delete t.observers,t.storefrontJSScripts=this.storefrontJSScripts.map(function(r){return n(r)}),t.highPriorityStoreFrontJSScripts=this.highPriorityStoreFrontJSScripts.map(function(r){return n(r)}),t},e.isB2BStorefront=function(){return"B2B_STOREFRONT"===e.storefrontType},e.getDefaultCurrencyCode=function(){var r;return null===(r=e.getCurrentRouting())||void 0===r?void 0:r.currencyCode},e.getDefaultCurrencySymbol=function(){var r;return null===(r=e.getCurrentRouting())||void 0===r?void 0:r.currencySymbol},e.isCaptchaRequired=function(){var r;return(null===(r=e.customerSettings)||void 0===r?void 0:r.requireCaptchaValidation)||!1},e.getPayWithIkasUrl=function(){return e.payWithIkasUrl},e.routings=[],e.paymentGateways=[],e.translations={},e.themeGlobals=t,e.storefrontJSScripts=[],e.highPriorityStoreFrontJSScripts=[],e.isEditor=!1,e.observers=[],e.isPreview=!1,e}();function n(r){return"string"!=typeof r?(console.error("escapeForJSON: Input is not a string",r),""):r.replace(/<\/script\b/gi,"<\\/script")}function o(r){return"string"!=typeof r?(console.error("unescapeFromJSON: Input is not a string",r),""):r.replace(/<\\\/script\b/gi,"</script")}export{e as IkasStorefrontConfig,n as escapeForJSON,o as unescapeFromJSON};
@@ -0,0 +1 @@
1
+ var n=new RegExp(["[A-Z]?[a-z]+","[0-9]*(?:1ST|2ND|3RD|(?![123])[0-9]TH)(?=\\b|[a-z_])","[0-9]*(?:1st|2nd|3rd|(?![123])[0-9]th)(?=\\b|[A-Z_])","[A-Z]+(?![a-z])","[0-9]+","[A-Z]"].join("|"),"g");function e(e){return(String(e).match(n)||[]).map(function(n,e){var l=n.toLowerCase();return 0===e?l:l.charAt(0).toUpperCase()+l.slice(1)}).join("")}var l={settings:{},colors:[],typography:[],breakpoints:[],keyframes:[],colorSchemes:{schemes:[],values:[]}},i=function(n){return"var(--".concat(e(n),")")},r=function(n){return"_".concat(n)},o=function(n){return"bp(".concat(n,")")},u=function(n){return n.map(function(n){return{id:n.id,width:Number(n.width)||0}})};function t(n,e){return n&&n.includes("bp(")?e.reduce(function(n,e){return n.split(o(e.id)).join("".concat(e.width,"px"))},n):n}var a=function(n){var e;if(n)return Array.isArray(n)?null===(e=n[0])||void 0===e?void 0:e.value:n},d=function(n){var e,l=n;if(!l)return null;if(l.patternValueId)return i(l.patternValueId);if(l.colorSchemeId)return i(l.colorSchemeId);if(l.keyframeValueId)return r(l.keyframeValueId);var o=l.value;return null==o?null:"object"==typeof o?"string"==typeof o.css?o.css:null!=o.value?"".concat(o.value).concat(null!==(e=o.unit)&&void 0!==e?e:""):null:String(o)},v=/^__.+__$/,s=function(n){return v.test(null!=n?n:"")};function c(n){var o,u,t,v,c,f,m,p,y,h,b,g,S,N,A,I;if(!n)return l;for(var k=null===(o=n.theme)||void 0===o?void 0:o.pattern,V={},w=0,_=null!==(v=null===(t=null===(u=n.globalsBlueprint)||void 0===u?void 0:u.module)||void 0===t?void 0:t.variables)&&void 0!==v?v:[];w<_.length;w++){var D=_[w];if(!1!==D.isGlobal&&D.variableName&&(!s(D.id)&&!s(D.variableName))){var T=null!==(c=D.variableType)&&void 0!==c?c:"TEXT";V[D.variableName]={name:D.variableName,displayName:null!==(f=D.displayName)&&void 0!==f?f:D.variableName,type:T,value:"BOOLEAN"===T?!!D.defaultValue:null!==(m=D.defaultValue)&&void 0!==m?m:null}}}var j=(null!==(p=null==k?void 0:k.values)&&void 0!==p?p:[]).map(function(n){var e,l;return{id:n.id,name:null!==(e=n.name)&&void 0!==e?e:n.id,resolved:d(a(null===(l=n.style)||void 0===l?void 0:l.value)),cssVar:i(n.id)}}),Z=function(n){return(null!=n?n:[]).map(function(n){return{property:n.property,value:d(a(n.value))}}).filter(function(n){return null!=n.value})},x=(null!==(y=null==k?void 0:k.elements)&&void 0!==y?y:[]).map(function(n){for(var l,i={},o=0,u=Z(n.styles);o<u.length;o++){var t=u[o],a=t.property,d=t.value;i[e(a)]=d}return{id:n.id,name:null!==(l=n.name)&&void 0!==l?l:n.id,resolved:i,className:r(n.id)}}),z=(null!==(b=null===(h=n.theme)||void 0===h?void 0:h.breakpoints)&&void 0!==b?b:[]).map(function(n){var e,l;return{id:n.id,name:null!==(e=n.name)&&void 0!==e?e:n.id,width:null!==(l=n.width)&&void 0!==l?l:0}}),B=(null!==(S=null===(g=n.theme)||void 0===g?void 0:g.keyframes)&&void 0!==S?S:[]).map(function(n){var e,l,i;return{id:n.id,name:null!==(e=n.name)&&void 0!==e?e:n.id,type:null!==(l=n.type)&&void 0!==l?l:"keyframe",ref:r(n.id),settings:Z(n.styles),points:(null!==(i=n.points)&&void 0!==i?i:[]).map(function(n){return{point:n.point,styles:Z(n.styles)}})}}),E=(null!==(N=null==k?void 0:k.colorSchemes)&&void 0!==N?N:[]).map(function(n){var e;return{id:n.id,name:null!==(e=n.name)&&void 0!==e?e:n.id}}),C=null!==(A=null==k?void 0:k.colorSchemes)&&void 0!==A?A:[],L=null!==(I=null==k?void 0:k.colorSchemeValues)&&void 0!==I?I:[],O=L.map(function(n){for(var e,l,o,u,t=function(n){var e,l;return null!==(l=null===(e=L.find(function(e){return e.isDefault&&(n?e.designAssetId===n:!e.designAssetId)}))||void 0===e?void 0:e.colors)&&void 0!==l?l:[]}(n.designAssetId),a={},v=function(r){var u=null===(e=n.colors)||void 0===e?void 0:e.find(function(n){return n.colorSchemeId===r.id}),v=u?void 0:t.find(function(n){return n.colorSchemeId===r.id});a[r.id]={resolved:null!==(o=d(null!==(l=null==u?void 0:u.style)&&void 0!==l?l:null==v?void 0:v.style))&&void 0!==o?o:"#ffffff",cssVar:i(r.id)}},s=0,c=C;s<c.length;s++){v(c[s])}return{id:n.id,name:null!==(u=n.name)&&void 0!==u?u:n.id,isDefault:!!n.isDefault,className:r(n.id),colorsByScheme:a}});return{settings:V,colors:j,typography:x,breakpoints:z,keyframes:B,colorSchemes:{schemes:E,values:O}}}export{l as EMPTY_THEME_GLOBALS,o as breakpointCssToken,e as cssVarCamelCase,i as cssVarRef,s as isReservedVariableId,r as rawClassRef,t as resolveBreakpointMediaTokens,c as serializeThemeGlobals,u as toResolverBreakpoints};
@@ -1,4 +1,6 @@
1
1
  import { IkasCustomerReviewSettings, IkasCustomerSettings, IkasIndexPageSeoSetting, IkasLoyaltyProgram, IkasMerchantSettings, IkasProductBackInStockSettings, IkasSalesChannelPaymentGateway, IkasStorefontMetaTemplates, IkasStorefrontB2BSettings, IkasStorefrontPopup, IkasStorefrontRouting, IkasStorefrontType, IkasThemeStockPreference } from "../../storefront-models/src";
2
+ import { ThemeGlobals } from "./theme-globals";
3
+ export * from "./theme-globals";
2
4
  export declare class IkasStorefrontConfig {
3
5
  static themeId?: string;
4
6
  static apiUrl?: string;
@@ -27,6 +29,7 @@ export declare class IkasStorefrontConfig {
27
29
  static tiktokPixelId?: string;
28
30
  static stockPreference?: IkasThemeStockPreference;
29
31
  static translations: Record<string, any>;
32
+ static themeGlobals: ThemeGlobals;
30
33
  static storefrontJSScripts: string[];
31
34
  static highPriorityStoreFrontJSScripts: string[];
32
35
  static customerReviewSettings?: IkasCustomerReviewSettings | null;
@@ -100,6 +103,7 @@ export type IkasStorefrontConfigParams = {
100
103
  tiktokPixelId?: string;
101
104
  stockPreference?: IkasThemeStockPreference;
102
105
  translations: Record<string, any>;
106
+ themeGlobals: ThemeGlobals;
103
107
  storefrontJSScripts: string[];
104
108
  highPriorityStoreFrontJSScripts: string[];
105
109
  customerReviewSettings?: IkasCustomerReviewSettings | null;
@@ -0,0 +1,295 @@
1
+ export declare function cssVarCamelCase(str: string): string;
2
+ /**
3
+ * Shared "theme globals" contract — the serialized, runtime-readable form of the editor's
4
+ * global theme settings (the left "Styles" panel): global variables + design tokens
5
+ * (colors, typography, breakpoints, keyframes, color schemes).
6
+ *
7
+ * This is packed into `IkasStorefrontConfig.themeGlobals` and read by the
8
+ * `@ikas/bp-storefront` runtime API (getThemeSetting / getThemeColors / ...). The same
9
+ * payload is produced for SSR, client hydration, and the editor canvas via
10
+ * {@link serializeThemeGlobals}, and returned by the CLI/MCP `list-theme-globals` reader.
11
+ */
12
+ /** Global-variable value kinds, mirrored from the editor sidebar `GlobalVariableType`. */
13
+ export type GlobalVariableType = "TEXT" | "RICH_TEXT" | "IMAGE" | "COLOR" | "NUMBER" | "BOOLEAN" | "BORDER" | "SHADOW";
14
+ /** A theme "global variable" (Theme Settings panel). `name` is the stable runtime key. */
15
+ export type ThemeSetting = {
16
+ /** Stable runtime key — the variable's `variableName` (e.g. `_6Q0KV7VGGM`). */
17
+ name: string;
18
+ /** Human-facing label. */
19
+ displayName: string;
20
+ type: GlobalVariableType;
21
+ /**
22
+ * Concrete value, discriminated by `type`:
23
+ * - TEXT/RICH_TEXT → string · NUMBER → number · BOOLEAN → boolean · COLOR → hex string.
24
+ * - IMAGE → an IkasImage REFERENCE, e.g. `{ id: "theme-images/<uuid>" }`. It has NO
25
+ * `.url` field — resolve to a URL with `getDefaultSrc(value)` / `getSrc(value, size)`
26
+ * from `@ikas/bp-storefront`, never read `value.url`.
27
+ * - BORDER/SHADOW → object, or `null` when unset.
28
+ */
29
+ value: any;
30
+ };
31
+ /** A single-value design token (color). `cssVar` resolves the live, scheme-aware value. */
32
+ export type DesignToken = {
33
+ id: string;
34
+ name: string;
35
+ /** Resolved base/default value (e.g. a hex string), or null when unset. */
36
+ resolved: string | null;
37
+ /** CSS custom-property reference, e.g. `var(--primaryColor)`. */
38
+ cssVar: string;
39
+ };
40
+ /** A typography token (text style). Apply `className` to an element to use it. */
41
+ export type TypographyToken = {
42
+ id: string;
43
+ name: string;
44
+ /** Resolved CSS values keyed by camelCased CSS property (e.g. `fontSize`, `fontWeight`). */
45
+ resolved: Record<string, string>;
46
+ /** Class selector the editor emits for this text style, e.g. `_<id>`. */
47
+ className: string;
48
+ };
49
+ export type BreakpointToken = {
50
+ id: string;
51
+ name: string;
52
+ width: number;
53
+ };
54
+ /** A resolved CSS style entry, e.g. { property: "animation-duration", value: "1.4s" }. */
55
+ export type StyleEntry = {
56
+ property: string;
57
+ value: string;
58
+ };
59
+ export type KeyframeToken = {
60
+ id: string;
61
+ name: string;
62
+ type: string;
63
+ /** CSS reference — the animation name / class the editor emits, e.g. `_<id>`. */
64
+ ref: string;
65
+ /**
66
+ * Keyframe-level animation "settings" (the editor's Settings popover). These are CSS
67
+ * animation/transition properties and DIFFER BY TYPE: a `keyframe` carries
68
+ * animation-duration/-iteration-count/-play-state/-delay/-timing-function/-direction/
69
+ * -fill-mode/-timeline/-range + transform-origin; a `transition` carries `transition`.
70
+ * Both may carry backface-visibility. Empty when none are set.
71
+ */
72
+ settings?: StyleEntry[];
73
+ /** Animation points; each point may carry its own resolved styles. */
74
+ points?: {
75
+ point: string;
76
+ styles?: StyleEntry[];
77
+ }[];
78
+ };
79
+ /**
80
+ * A color SLOT — one entry of the top-level `getThemeColorSchemes().schemes` list. It is a
81
+ * label only (`id` + display `name`); the actual colors for the slot live in each palette's
82
+ * `colorsByScheme[id]`.
83
+ */
84
+ export type ColorSchemeSlot = {
85
+ id: string;
86
+ name: string;
87
+ };
88
+ /**
89
+ * A color palette (one entry of `getThemeColorSchemes().values`). Its colors live in
90
+ * `colorsByScheme` — the top-level `schemes` list holds only slot id→name labels.
91
+ */
92
+ export type ColorSchemeToken = {
93
+ id: string;
94
+ name: string;
95
+ isDefault: boolean;
96
+ /** Class selector to activate this scheme value, e.g. `_<id>`. */
97
+ className: string;
98
+ /**
99
+ * This palette's colors, keyed by color-SLOT id (the ids in
100
+ * `getThemeColorSchemes().schemes`). THIS — not the top-level `schemes` array — is
101
+ * the source of truth for swatch colors; iterate it to render a palette. Prefer
102
+ * `cssVar` for live, in-editor reactivity; `resolved` is a render-time snapshot.
103
+ */
104
+ colorsByScheme: Record<string, {
105
+ resolved: string | null;
106
+ cssVar: string;
107
+ }>;
108
+ };
109
+ export type ThemeGlobals = {
110
+ settings: Record<string, ThemeSetting>;
111
+ colors: DesignToken[];
112
+ typography: TypographyToken[];
113
+ breakpoints: BreakpointToken[];
114
+ keyframes: KeyframeToken[];
115
+ colorSchemes: {
116
+ schemes: ColorSchemeSlot[];
117
+ values: ColorSchemeToken[];
118
+ };
119
+ };
120
+ /**
121
+ * Stamps a theme-token type as its RUNTIME view returned by the `@ikas/bp-storefront` getters
122
+ * (`getThemeColors` / `getThemeTypography` / ...). `name` is removed, then re-added as a
123
+ * DEPRECATED `never`. Plainly `Omit`-ing it would only ever surface a bare "Property 'name' does
124
+ * not exist on type" — re-adding it as a documented `@deprecated never` instead means a developer
125
+ * who reaches for `.name` at runtime sees the strikethrough + the explanation below on hover, and
126
+ * any actual use of the value is a type error (`never`). The agent is steered the same way.
127
+ *
128
+ * The full types above (with a real `name: string`) are still produced in the serialized
129
+ * {@link ThemeGlobals} payload and surfaced by the CLI/MCP `list-theme-globals` AUTHORING read, so
130
+ * the agent/editor can still discover and reuse existing tokens by name. `name` is hidden ONLY at
131
+ * the runtime getter return types (the getters cast the live payload to these views).
132
+ */
133
+ type RuntimeView<T> = Omit<T, "name"> & {
134
+ /**
135
+ * @deprecated `name` is authoring-only and is NOT exposed at runtime. Identify this token by its
136
+ * STABLE `id` instead — color → `cssVar` (`var(--<id>)`), typography & keyframe → `className` /
137
+ * `ref` (`_<id>`), color-scheme slot → a `colorsByScheme` key. Token names are non-unique (two
138
+ * design assets can ship the same name) and renaming one must not break references, so matching
139
+ * by name is unsafe. Need a human-readable label? Read it from `list_theme_globals` (MCP/CLI) or
140
+ * the editor's Styles panel — not from the runtime getters.
141
+ */
142
+ name?: never;
143
+ };
144
+ export type RuntimeDesignToken = RuntimeView<DesignToken>;
145
+ export type RuntimeTypographyToken = RuntimeView<TypographyToken>;
146
+ export type RuntimeBreakpointToken = RuntimeView<BreakpointToken>;
147
+ export type RuntimeKeyframeToken = RuntimeView<KeyframeToken>;
148
+ export type RuntimeColorSchemeToken = RuntimeView<ColorSchemeToken>;
149
+ export type RuntimeColorSchemeSlot = RuntimeView<ColorSchemeSlot>;
150
+ /**
151
+ * Runtime view of {@link ThemeGlobals.colorSchemes} (returned by `getThemeColorSchemes`). The
152
+ * slot list carries only `{ id }`: slot display LABELS (the slot `name`) are authoring-only —
153
+ * read them via the CLI/MCP `list-theme-globals` or the editor, not at runtime. Render a palette
154
+ * by iterating each value's `colorsByScheme`, keyed by slot id.
155
+ */
156
+ export type RuntimeThemeColorSchemes = {
157
+ schemes: RuntimeColorSchemeSlot[];
158
+ values: RuntimeColorSchemeToken[];
159
+ };
160
+ export declare const EMPTY_THEME_GLOBALS: ThemeGlobals;
161
+ type StyleValueLike = {
162
+ value?: any;
163
+ patternValueId?: string;
164
+ keyframeValueId?: string;
165
+ colorSchemeId?: string;
166
+ };
167
+ type StyleConditionLike = {
168
+ value?: StyleValueLike;
169
+ };
170
+ type ElementStyleLike = {
171
+ property: string;
172
+ value?: StyleValueLike | StyleConditionLike[];
173
+ };
174
+ type PatternValueLike = {
175
+ id: string;
176
+ name?: string;
177
+ style?: ElementStyleLike;
178
+ };
179
+ type PatternElementLike = {
180
+ id: string;
181
+ name?: string;
182
+ styles?: ElementStyleLike[];
183
+ };
184
+ type ColorSchemeLike = {
185
+ id: string;
186
+ name?: string;
187
+ };
188
+ type ColorSchemeValueColorLike = {
189
+ colorSchemeId: string;
190
+ style?: StyleValueLike;
191
+ };
192
+ type ColorSchemeValueLike = {
193
+ id: string;
194
+ name?: string;
195
+ isDefault?: boolean;
196
+ /** Set when this scheme belongs to an installed design asset; groups the default fallback. */
197
+ designAssetId?: string;
198
+ colors?: ColorSchemeValueColorLike[];
199
+ };
200
+ type BreakpointLike = {
201
+ id: string;
202
+ name?: string;
203
+ width?: number;
204
+ };
205
+ type KeyframePointLike = {
206
+ point: string;
207
+ styles?: ElementStyleLike[];
208
+ };
209
+ type KeyframeLike = {
210
+ id: string;
211
+ name?: string;
212
+ type?: string;
213
+ styles?: ElementStyleLike[];
214
+ points?: KeyframePointLike[];
215
+ };
216
+ type VariableLike = {
217
+ id?: string;
218
+ variableName?: string;
219
+ displayName?: string;
220
+ variableType?: string;
221
+ defaultValue?: any;
222
+ isGlobal?: boolean;
223
+ };
224
+ export type SerializableProject = {
225
+ globalsBlueprint?: {
226
+ module?: {
227
+ variables?: VariableLike[];
228
+ };
229
+ };
230
+ theme?: {
231
+ breakpoints?: BreakpointLike[];
232
+ keyframes?: KeyframeLike[];
233
+ pattern?: {
234
+ values?: PatternValueLike[];
235
+ elements?: PatternElementLike[];
236
+ colorSchemes?: ColorSchemeLike[];
237
+ colorSchemeValues?: ColorSchemeValueLike[];
238
+ };
239
+ };
240
+ };
241
+ export declare const cssVarRef: (id: string) => string;
242
+ export declare const rawClassRef: (id: string) => string;
243
+ /**
244
+ * CSS function-style token a code component writes to reference a theme breakpoint's width.
245
+ * Breakpoints can't ship as `var(--…)` because the CSS spec forbids `var()` in a media-query
246
+ * condition — and a `var()` there fails SILENTLY (it parses as valid-looking CSS but the whole
247
+ * query is dropped). So a code component writes a deliberately non-standard `bp(<breakpointId>)`
248
+ * token inside its OWN `min-width` / `max-width` condition; it resolves to a concrete `<width>px`
249
+ * at render time against the LIVE theme (see {@link resolveBreakpointMediaTokens}). The author
250
+ * picks the direction, so there is no implicit boundary magic:
251
+ * `@media (max-width: bp(_mob))` -> `@media (max-width: 767px)`
252
+ * `@media (min-width: bp(_mob))` -> `@media (min-width: 767px)`
253
+ * id-based, never a human name (the id is stable across renames). The id comes from
254
+ * `list-theme-globals` / `getThemeBreakpoints()`.
255
+ */
256
+ export declare const breakpointCssToken: (id: string) => string;
257
+ /**
258
+ * Coerce a theme's breakpoint list into the `{ id, width }` shape {@link resolveBreakpointMediaTokens}
259
+ * needs, defaulting a missing/non-numeric width to 0. Shared by both render sites so the coercion
260
+ * rule lives in one place; the editor passes `breakpoints.map(b => b.toJSON())` (Yjs → plain) first.
261
+ */
262
+ export declare const toResolverBreakpoints: (breakpoints: {
263
+ id: string;
264
+ width?: number | string;
265
+ }[]) => {
266
+ id: string;
267
+ width: number;
268
+ }[];
269
+ /**
270
+ * Replace breakpoint width tokens (`bp(<id>)`) in a CSS string with the breakpoint's concrete
271
+ * `<width>px`, using the given theme breakpoints. Pure text substitution — the single place
272
+ * breakpoint resolution lives, called at every render-time CC-CSS composition site
273
+ * (code-generator, editor canvas). Unknown ids are left untouched (the partner dependency
274
+ * collector ships referenced breakpoints into the target theme, so a real token always resolves).
275
+ * The `bp(<id>)` literal carries its own `)` boundary, so one id is never matched inside another.
276
+ */
277
+ export declare function resolveBreakpointMediaTokens(css: string, breakpoints: {
278
+ id: string;
279
+ width: number;
280
+ }[]): string;
281
+ /**
282
+ * True for system/reserved global variables (e.g. `__breakpointsVar__`) — internal
283
+ * constructs that live in `module.variables` but are NOT user-facing theme settings.
284
+ * Single source of truth for the `__name__` reserved-id convention; consumers (theme
285
+ * serialization here, partner publish dependency collection) share it so a new
286
+ * synthetic var is excluded everywhere at once.
287
+ */
288
+ export declare const isReservedVariableId: (id?: string | null) => boolean;
289
+ /**
290
+ * Build the {@link ThemeGlobals} payload from a project's theme. Pure and dependency-free
291
+ * (works on plain JSON), so the same function serves SSR (`IProject`) and the editor canvas
292
+ * (`YjsProject.toJSON()`).
293
+ */
294
+ export declare function serializeThemeGlobals(project?: SerializableProject | null): ThemeGlobals;
295
+ export {};
@@ -1,3 +1,5 @@
1
1
  export interface IBlueprintColorPropValue {
2
2
  value: string;
3
+ patternValueId?: string;
4
+ colorSchemeId?: string;
3
5
  }
@@ -0,0 +1,48 @@
1
+ import { RuntimeBreakpointToken, RuntimeDesignToken, RuntimeKeyframeToken, RuntimeThemeColorSchemes, RuntimeTypographyToken, ThemeSetting } from "../../storefront-config/src";
2
+ /**
3
+ * Register the live global-variable object (`_g_`) so `getThemeSetting`/`getThemeSettings`
4
+ * return actual runtime values (constants, computed getters, and in-editor edits) instead
5
+ * of the serialized design-time defaults. Called by generated code, not by component authors.
6
+ */
7
+ export declare function registerThemeSettingValues(values: Record<string, any> | null): void;
8
+ /** All global variables (Theme Settings) defined for the theme. */
9
+ export declare function getThemeSettings(): ThemeSetting[];
10
+ /**
11
+ * A single global variable by its stable key (`variableName`, e.g. `_6Q0KV7VGGM`).
12
+ * Discover keys via {@link getThemeSettings} (each item carries a human `displayName`).
13
+ * The returned `value` is the live blueprint value when available, else the default.
14
+ * Its shape is discriminated by `type` (see {@link ThemeSetting.value}); note an
15
+ * IMAGE setting's value is an image REFERENCE (no `.url`) — resolve with
16
+ * `getDefaultSrc`/`getSrc`.
17
+ */
18
+ export declare function getThemeSetting(name: string): ThemeSetting | undefined;
19
+ /** Convenience: the resolved value of a global variable, or `undefined` if not found. */
20
+ export declare function getThemeSettingValue(name: string): any;
21
+ /** Theme color tokens. Each carries a resolved value and a `var(--id)` CSS reference. */
22
+ export declare function getThemeColors(): RuntimeDesignToken[];
23
+ /** Theme typography tokens (text styles). Apply `className` or read `resolved` CSS values. */
24
+ export declare function getThemeTypography(): RuntimeTypographyToken[];
25
+ /** Theme responsive breakpoints (`{ id, width }`). */
26
+ export declare function getThemeBreakpoints(): RuntimeBreakpointToken[];
27
+ /** Theme keyframe/transition animations. Use `ref` as the CSS animation name. */
28
+ export declare function getThemeKeyframes(): RuntimeKeyframeToken[];
29
+ /**
30
+ * Theme color schemes (palettes). Returns two PARALLEL lists with different jobs:
31
+ * - `schemes`: the color SLOTS as `{ id }` only — no colors and no display label live here at
32
+ * runtime. A slot's human name is authoring-only (read it via the CLI/MCP `list-theme-globals`
33
+ * or the editor); at runtime identify a slot solely by its `id`.
34
+ * - `values`: the actual palettes. A palette's colors live in its `colorsByScheme`
35
+ * map, keyed by slot id → `{ resolved, cssVar }`.
36
+ *
37
+ * To render swatches, iterate `values[].colorsByScheme` (the source of truth for
38
+ * colors), NOT the top-level `schemes` array — `schemes` carries slot ids only, so
39
+ * iterating it renders empty:
40
+ *
41
+ * const { values } = getThemeColorSchemes();
42
+ * values.forEach(palette =>
43
+ * Object.entries(palette.colorsByScheme).forEach(([slotId, { resolved, cssVar }]) => {
44
+ * // slotId → stable slot key, cssVar → live var() ref (prefer this), resolved → hex snapshot
45
+ * })
46
+ * );
47
+ */
48
+ export declare function getThemeColorSchemes(): RuntimeThemeColorSchemes;
@@ -0,0 +1 @@
1
+ import{__assign as o}from'./../../ext/tslib/tslib.es6.mjs.js';import{IkasStorefrontConfig as l}from"../../packages/storefront-config/src/index.js";var n=null;function e(o){n=o}function i(l){return n&&l.name in n?o(o({},l),{value:n[l.name]}):l}function r(){var o,n;return Object.values(null!==(n=null===(o=l.themeGlobals)||void 0===o?void 0:o.settings)&&void 0!==n?n:{}).map(i)}function t(o){var n,e,r=null===(e=null===(n=l.themeGlobals)||void 0===n?void 0:n.settings)||void 0===e?void 0:e[o];return r?i(r):void 0}function u(o){var l;return null===(l=t(o))||void 0===l?void 0:l.value}function v(){var o,n;return null!==(n=null===(o=l.themeGlobals)||void 0===o?void 0:o.colors)&&void 0!==n?n:[]}function s(){var o,n;return null!==(n=null===(o=l.themeGlobals)||void 0===o?void 0:o.typography)&&void 0!==n?n:[]}function a(){var o,n;return null!==(n=null===(o=l.themeGlobals)||void 0===o?void 0:o.breakpoints)&&void 0!==n?n:[]}function d(){var o,n;return null!==(n=null===(o=l.themeGlobals)||void 0===o?void 0:o.keyframes)&&void 0!==n?n:[]}function m(){var o,n;return null!==(n=null===(o=l.themeGlobals)||void 0===o?void 0:o.colorSchemes)&&void 0!==n?n:{schemes:[],values:[]}}export{a as getThemeBreakpoints,m as getThemeColorSchemes,v as getThemeColors,d as getThemeKeyframes,t as getThemeSetting,u as getThemeSettingValue,r as getThemeSettings,s as getThemeTypography,e as registerThemeSettingValues};
@@ -1 +1 @@
1
- import{__assign as r}from'./../ext/tslib/tslib.es6.mjs.js';import{createElement as t}from'./../ext/preact/dist/preact.mjs.js';import{useRef as n,useEffect as e,useMemo as o}from'./../ext/preact/hooks/dist/hooks.mjs.js';var c={};function u(r,t){for(var n=[],e=r;e;){var o=e.getAttribute("id");o&&n.unshift(o),e=e.parentElement}var c=n.map(function(r){return'[id="'.concat(r,'"]')}).join(" ");return c?"".concat(c,' [id="').concat(t,'"]'):'[id="'.concat(t,'"]')}function a(a){var s=a.id,i=a.components,f=a.style,l=a.className,m=a.parentProps,d=void 0===m?c:m,p=a.map,v=void 0===p?c:p,h=n([]),j=n(d),y=n(v),g=n(null);j.current=d,y.current=v,e(function(){if(i&&0!==i.length){h.current.forEach(function(r){return r()}),h.current=[];for(var t=0;t<i.length;t++){var n=i[t];if(n.l){var e="".concat(s,"-").concat(t),o=u(g.current,e),c=n.l(o,r(r({},j.current),y.current),{},{id:e,key:e});"function"==typeof c&&h.current.push(c)}}return function(){h.current.forEach(function(r){return r()}),h.current=[]}}},[i,s]);var E=o(function(){return i&&0!==i.length?i.map(function(t,n){var e="".concat(s,"-").concat(n);return t.r(r(r({},j.current),y.current),{},{id:e,key:e})}).join(""):""},[i,s]);return i&&0!==i.length?t("div",{id:s,ref:g,dangerouslySetInnerHTML:{__html:E},style:r({display:"contents"},f),className:l}):null}export{a as IkasComponentRenderer};
1
+ import{__assign as r}from'./../ext/tslib/tslib.es6.mjs.js';import{createElement as t}from'./../ext/preact/dist/preact.mjs.js';import{useRef as n,useMemo as e,useEffect as o}from'./../ext/preact/hooks/dist/hooks.mjs.js';var c={};function a(r,t){for(var n=[],e=r;e;){var o=e.getAttribute("id");o&&n.unshift(o),e=e.parentElement}var c=n.map(function(r){return'[id="'.concat(r,'"]')}).join(" ");return c?"".concat(c,' [id="').concat(t,'"]'):'[id="'.concat(t,'"]')}function u(u){var i=u.id,s=u.components,f=u.style,l=u.className,m=u.parentProps,d=void 0===m?c:m,p=u.map,v=void 0===p?c:p,h=n([]),y=n(d),j=n(v),g=n(null);y.current=d,j.current=v;var E=e(function(){return(Array.isArray(s)?s:s?[s]:[]).flat().filter(Boolean)},[s]);o(function(){if(0!==E.length){h.current.forEach(function(r){return r()}),h.current=[];for(var t=0;t<E.length;t++){var n=E[t];if(n.l){var e="".concat(i,"-").concat(t),o=a(g.current,e),c=n.l(o,r(r({},y.current),j.current),{},{id:e,key:e});"function"==typeof c&&h.current.push(c)}}return function(){h.current.forEach(function(r){return r()}),h.current=[]}}},[E,i]);var _=e(function(){return 0===E.length?"":E.map(function(t,n){var e="".concat(i,"-").concat(n);return t.r(r(r({},y.current),j.current),{},{id:e,key:e})}).join("")},[E,i]);return 0===E.length?null:t("div",{id:i,ref:g,dangerouslySetInnerHTML:{__html:_},style:r({display:"contents"},f),className:l})}export{u as IkasComponentRenderer};
@@ -0,0 +1,15 @@
1
+ export type NormalizeSvgOptions = {
2
+ /** Deterministic, instance-unique prefix (element id, or prop key + list index). */
3
+ idPrefix: string;
4
+ /** Rewrite ids and their references. Default: true. */
5
+ scopeIds?: boolean;
6
+ /** Normalize fill/stroke to this color. Opt-in. */
7
+ color?: "currentColor";
8
+ /** Strip fixed width/height and ensure a viewBox. Default: true. */
9
+ size?: boolean;
10
+ };
11
+ /**
12
+ * Isomorphic, DOM-free normalization of a raw SVG markup string for render.
13
+ * Safe to call in SSR, browser, and node — pure string transforms only.
14
+ */
15
+ export declare function normalizeSvg(svg: string, options: NormalizeSvgOptions): string;
@@ -0,0 +1 @@
1
+ var r=/\swidth\s*=\s*["']([^"']*)["']/i,n=/\sheight\s*=\s*["']([^"']*)["']/i,t=function(r,n){var t;return null===(t=r.match(n))||void 0===t?void 0:t[1]},c=function(r){var n=null==r?void 0:r.trim().match(/^(-?\d*\.?\d+)(px)?$/i);return n?parseFloat(n[1]):NaN},e=/(\sfill\s*=\s*["'])([^"']*)(["'])/gi,i=/(\sstroke\s*=\s*["'])([^"']*)(["'])/gi,s=/(fill\s*:\s*)([^;"']+)/gi,o=/(stroke\s*:\s*)([^;"']+)/gi;function a(a,u){var l=u.idPrefix,f=u.scopeIds,v=void 0===f||f,p=u.color,h=u.size,d=void 0===h||h,g=v?function(r,n){var t=new Set(Array.from(r.matchAll(/\sid\s*=\s*["']([^"']+)["']/g)).map(function(r){return r[1]}));if(0===t.size)return r;var c=function(r){return"".concat(n,"-").concat(r)};return r.replace(/(\sid\s*=\s*["'])([^"']+)(["'])/g,function(r,n,e,i){return t.has(e)?"".concat(n).concat(c(e)).concat(i):r}).replace(/url\(\s*["']?#([^"')\s]+)["']?\s*\)/g,function(r,n){return t.has(n)?"url(#".concat(c(n),")"):r}).replace(/((?:xlink:)?href\s*=\s*["'])#([^"']+)(["'])/g,function(r,n,e,i){return t.has(e)?"".concat(n,"#").concat(c(e)).concat(i):r})}(a,l):a,m="currentColor"===p?function(r){var n=function(r){var n=r.trim();return"none"===n||n.startsWith("url(")},t=function(r,t,c,e){return n(c)?r:"".concat(t,"currentColor").concat(e)},c=function(r,t,c){return n(c)?r:"".concat(t,"currentColor")};return r.replace(e,t).replace(i,t).replace(s,c).replace(o,c)}(g):g;return d?function(e){return e.replace(/<svg\b[^>]*>/i,function(e){var i=/\sviewBox\s*=/i.test(e),s=c(t(e,r)),o=c(t(e,n)),a=!i&&!Number.isNaN(s)&&!Number.isNaN(o);return i||a?(a?e.replace(/<svg\b/i,'<svg viewBox="0 0 '.concat(s," ").concat(o,'"')):e).replace(/\swidth\s*=\s*["'][^"']*["']/i,"").replace(/\sheight\s*=\s*["'][^"']*["']/i,""):e})}(m):m}export{a as normalizeSvg};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/bp-storefront",
3
- "version": "2.5.0",
3
+ "version": "2.6.0",
4
4
  "description": "A framework for the ikas blueprint storefronts.",
5
5
  "author": "ikas",
6
6
  "license": "ISC",