@ikas/loyalty-widget-renderer 1.0.0-alpha.81 → 1.0.0-alpha.83

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.
Files changed (38) hide show
  1. package/build/assets/index.d.ts +2 -0
  2. package/build/assets/widget-icons/illustraions/scenery.d.ts +2 -0
  3. package/build/assets/widget-icons/illustraions/scenery.js +1 -0
  4. package/build/assets/widget-icons/normal/album02.d.ts +2 -0
  5. package/build/assets/widget-icons/normal/album02.js +1 -0
  6. package/build/index.js +1 -1
  7. package/build/injector.d.ts +1 -1
  8. package/build/locales.d.ts +25 -0
  9. package/build/models/index.d.ts +6 -1
  10. package/build/models/index.js +1 -1
  11. package/build/models/loyalty-customer-info/index.d.ts +1 -1
  12. package/build/models/loyalty-customer-info/index.js +1 -1
  13. package/build/models/loyalty-program-point-history/index.d.ts +2 -0
  14. package/build/models/loyalty-program-point-history/index.js +1 -1
  15. package/build/models/loyalty-program-spending-method/index.d.ts +1 -0
  16. package/build/models/loyalty-program-spending-method/index.js +1 -1
  17. package/build/models/types/index.d.ts +17 -1
  18. package/build/models/types/index.js +1 -1
  19. package/build/renderer/index.js +1 -1
  20. package/build/renderer/screens/gift-product-selection-screen/index.d.ts +9 -0
  21. package/build/renderer/screens/gift-product-selection-screen/index.js +1 -0
  22. package/build/renderer/screens/gift-product-selection-screen/style.d.ts +20 -0
  23. package/build/renderer/screens/gift-product-selection-screen/style.js +1 -0
  24. package/build/renderer/screens/main-screen/spending-methods-section/dynamic-slider.js +1 -1
  25. package/build/renderer/screens/main-screen/spending-methods-section/index.js +1 -1
  26. package/build/renderer/style.d.ts +1 -1
  27. package/build/renderer/style.js +1 -1
  28. package/build/renderer/utils/locales/de.json.js +1 -1
  29. package/build/renderer/utils/locales/en.json.js +1 -1
  30. package/build/renderer/utils/locales/fr.json.js +1 -1
  31. package/build/renderer/utils/locales/nl.json.js +1 -1
  32. package/build/renderer/utils/locales/tr.json.js +1 -1
  33. package/build/renderer/utils/spending-method-utils.d.ts +20 -0
  34. package/build/renderer/utils/spending-method-utils.js +1 -0
  35. package/build/storefront-widget-script-injector.iife.js +60 -60
  36. package/build/storefront-widget-script-injector.iife.js.map +1 -1
  37. package/build/utils.js +1 -1
  38. package/package.json +1 -1
@@ -20,6 +20,7 @@ export { ShoppingBasketAdd02 } from "./widget-icons/normal/shoppingBasketAdd02";
20
20
  export { UserAdd01 } from "./widget-icons/normal/userAdd01";
21
21
  export { InformationCircle } from "./widget-icons/normal/informationCircle";
22
22
  export { Refund } from "./widget-icons/normal/refund";
23
+ export { Album02 } from "./widget-icons/normal/album02";
23
24
  export { UsersIllustration } from "./widget-icons/illustraions/usersIllustration";
24
25
  export { BubbleChatIllustration } from "./widget-icons/illustraions/bubbleChatIllustration";
25
26
  export { ApprovedChatIllustration } from "./widget-icons/illustraions/approvedChatIllustration";
@@ -32,3 +33,4 @@ export { ShoppingCartIllustration } from "./widget-icons/illustraions/shoppingCa
32
33
  export { InformationCircleIllustration } from "./widget-icons/illustraions/informationCircleIllustration";
33
34
  export { CheckFillIllustration } from "./widget-icons/illustraions/check-fill";
34
35
  export { RefundIllustration } from "./widget-icons/illustraions/refundIllustration";
36
+ export { Scenery } from "./widget-icons/illustraions/scenery";
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare const Scenery: React.FC<React.SVGProps<SVGSVGElement>>;
@@ -0,0 +1 @@
1
+ import e from"react";var t=function(t){return e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},e.createElement("path",{d:"M11.25 7.5C10.5596 7.5 10 6.94036 10 6.25C10 5.55964 10.5596 5 11.25 5C11.9404 5 12.5 5.55964 12.5 6.25C12.4992 6.94004 11.94 7.49925 11.25 7.5Z",fill:"url(#paint0_linear_17303_24744)"}),e.createElement("path",{d:"M15.8346 1.66602H4.16797C2.78893 1.67004 1.67199 2.78697 1.66797 4.16602V11.5493L4.9013 8.31602C5.89086 7.37435 7.44508 7.37435 8.43464 8.31602L10.8275 10.7218L11.5671 9.98226C12.5449 9.01007 14.1243 9.01007 15.1022 9.98226L18.3346 13.2147V4.16602C18.3306 2.78697 17.2137 1.67004 15.8346 1.66602ZM11.2513 7.49935C10.5609 7.49935 10.0013 6.93971 10.0013 6.24935C10.0013 5.55899 10.5609 4.99935 11.2513 4.99935C11.9417 4.99935 12.5013 5.55899 12.5013 6.24935C12.5006 6.93939 11.9413 7.4986 11.2513 7.49935Z",fill:"url(#paint1_linear_17303_24744)"}),e.createElement("path",{d:"M8.43464 8.31758C7.44508 7.37591 5.89086 7.37591 4.9013 8.31758L1.66797 11.5509V15.8342C1.672 17.2133 2.78894 18.3302 4.16797 18.3342H15.8346C16.5139 18.334 17.1638 18.0572 17.6346 17.5676L8.43464 8.31758Z",fill:"url(#paint2_linear_17303_24744)"}),e.createElement("path",{d:"M18.3314 13.2155L15.099 9.98303C14.1211 9.01086 12.5417 9.01086 11.5638 9.98303L10.8242 10.7226L17.6278 17.5631C18.0795 17.1008 18.3321 16.4798 18.3314 15.8335V13.2155Z",fill:"url(#paint3_linear_17303_24744)"}),e.createElement("defs",null,e.createElement("linearGradient",{id:"paint0_linear_17303_24744",x1:"11.25",y1:"5",x2:"11.25",y2:"7.5",gradientUnits:"userSpaceOnUse"},e.createElement("stop",{stopColor:"#FFDB53"}),e.createElement("stop",{offset:"1",stopColor:"#F09B13"})),e.createElement("linearGradient",{id:"paint1_linear_17303_24744",x1:"10.0013",y1:"1.66602",x2:"10.0013",y2:"13.2147",gradientUnits:"userSpaceOnUse"},e.createElement("stop",{stopColor:"#CDE7FF"}),e.createElement("stop",{offset:"1",stopColor:"#EAF5FF"})),e.createElement("linearGradient",{id:"paint2_linear_17303_24744",x1:"9.6513",y1:"7.61133",x2:"9.6513",y2:"18.3342",gradientUnits:"userSpaceOnUse"},e.createElement("stop",{stopColor:"#4BC67D"}),e.createElement("stop",{offset:"1",stopColor:"#1F857D"})),e.createElement("linearGradient",{id:"paint3_linear_17303_24744",x1:"14.5778",y1:"9.25391",x2:"14.5778",y2:"17.5631",gradientUnits:"userSpaceOnUse"},e.createElement("stop",{stopColor:"#62E39B"}),e.createElement("stop",{offset:"1",stopColor:"#29CCAD"}))))};export{t as Scenery};
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare const Album02: React.FC<React.SVGProps<SVGSVGElement>>;
@@ -0,0 +1 @@
1
+ import e from"react";var t=function(t){return e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},e.createElement("path",{d:"M4.5 13.4809C4.59653 14.4622 4.81467 15.1227 5.30768 15.6157C6.19197 16.5 7.6152 16.5 10.4617 16.5C13.3082 16.5 14.7314 16.5 15.6157 15.6157C16.5 14.7314 16.5 13.3082 16.5 10.4617C16.5 7.6152 16.5 6.19197 15.6157 5.30768C15.1227 4.81467 14.4622 4.59653 13.4809 4.5",stroke:"#4B5565",strokeWidth:"1.4"}),e.createElement("path",{d:"M1.5 7.5C1.5 4.67157 1.5 3.25736 2.37868 2.37868C3.25736 1.5 4.67157 1.5 7.5 1.5C10.3284 1.5 11.7427 1.5 12.6213 2.37868C13.5 3.25736 13.5 4.67157 13.5 7.5C13.5 10.3284 13.5 11.7427 12.6213 12.6213C11.7427 13.5 10.3284 13.5 7.5 13.5C4.67157 13.5 3.25736 13.5 2.37868 12.6213C1.5 11.7427 1.5 10.3284 1.5 7.5Z",stroke:"#4B5565",strokeWidth:"1.4"}),e.createElement("path",{d:"M1.5 8.3389C1.96426 8.27988 2.43363 8.25078 2.90378 8.25175C4.89274 8.215 6.83298 8.75725 8.37832 9.78183C9.8115 10.7321 10.8185 12.0398 11.25 13.5",stroke:"#4B5565",strokeWidth:"1.4",strokeLinejoin:"round"}),e.createElement("path",{d:"M9.75 5.25H9.75675",stroke:"#4B5565",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}))};export{t as Album02};
package/build/index.js CHANGED
@@ -1 +1 @@
1
- export{default as locales}from"./locales.js";export{LoyaltyWidget}from"./models/loyalty-widget/index.js";export{BadgeIconTypeEnum,HeaderBackgroundTypeEnum,ImageTypeEnum,LoyaltyWidgetLayoutTypeEnum,WidgetIconTypeEnum,WidgetPositionEnum}from"./models/loyalty-widget/types/index.js";export{LoyaltyWidgetHeader}from"./models/loyalty-widget/header/index.js";export{LoyaltyWidgetHeaderBackground}from"./models/loyalty-widget/header/header-background/index.js";export{LoyaltyWidgetTranslations}from"./models/loyalty-widget/translations.js";export{IMAGE_SIZE,LoyaltyWidgetImage}from"./models/image/index.js";export{LoyaltyWidgetButton}from"./models/button/index.js";export{CampaignTypeEnum,CartLoyaltyLineData,LoyaltyCustomerInfo,LoyaltyProgramTier,LoyaltyProgramTierTranslation,OrderAmountTypeEnum}from"./models/loyalty-customer-info/index.js";export{LoyaltyProgramPointHistory}from"./models/loyalty-program-point-history/index.js";export{LoyaltyProgramDiscountSettings,LoyaltyProgramSpendingMethod}from"./models/loyalty-program-spending-method/index.js";export{LoyaltyProgramEarningMethod,LoyaltyProgramEarningMethodOrderSettings,LoyaltyProgramEarningMethodProductSettings}from"./models/loyalty-program-earning-method/index.js";export{LoyaltyWidgetSettings}from"./models/loyalty-widget/settings/index.js";export{LoyaltyWidgetViewModel}from"./models/index.js";export{EarningMethodTypeEnum,LoyaltyProgramFilterTypeEnum,LoyaltyProgramMethodSpendingTypeEnum,LoyaltyProgramPointEarningTypeEnum,LoyaltyProgramPointHistoryTypeEnum,LoyaltyWidgetScreenTypeEnum,PeriodTypeEnum,WidgetMode}from"./models/types/index.js";export{BadgeLevel1}from"./assets/badgeLevel1.js";export{BadgeLevel2}from"./assets/badgeLevel2.js";export{BadgeLevel3}from"./assets/badgeLevel3.js";export{BadgeLevel4}from"./assets/badgeLevel4.js";export{XClose}from"./assets/icons/x-close.js";export{CheckCircleFill}from"./assets/icons/check-circle-fill.js";export{ChevronLeft}from"./assets/icons/chevron-left.js";export{Check}from"./assets/icons/check.js";export{ArrowRight}from"./assets/icons/arrow-right.js";export{CheckCircle}from"./assets/icons/check-circle.js";export{BubbleChatDone}from"./assets/widget-icons/normal/bubbleChatDone.js";export{CommentAdd01}from"./assets/widget-icons/normal/commentAdd01.js";export{CouponPercent}from"./assets/widget-icons/normal/couponPercent.js";export{DiscountTag02}from"./assets/widget-icons/normal/discountTag02.js";export{Gift}from"./assets/widget-icons/normal/gift.js";export{MoneyAdd01}from"./assets/widget-icons/normal/moneyAdd01.js";export{PackageDelivered}from"./assets/widget-icons/normal/packageDelivered.js";export{SaveMoneyDollar}from"./assets/widget-icons/normal/saveMoneyDollar.js";export{ShoppingBasketAdd02}from"./assets/widget-icons/normal/shoppingBasketAdd02.js";export{UserAdd01}from"./assets/widget-icons/normal/userAdd01.js";export{InformationCircle}from"./assets/widget-icons/normal/informationCircle.js";export{Refund}from"./assets/widget-icons/normal/refund.js";export{UsersIllustration}from"./assets/widget-icons/illustraions/usersIllustration.js";export{BubbleChatIllustration}from"./assets/widget-icons/illustraions/bubbleChatIllustration.js";export{ApprovedChatIllustration}from"./assets/widget-icons/illustraions/approvedChatIllustration.js";export{TshirtIllustration}from"./assets/widget-icons/illustraions/tshirtIllustration.js";export{Medal}from"./assets/widget-icons/illustraions/medal.js";export{GiftIllustration}from"./assets/widget-icons/illustraions/giftIllustration.js";export{ShippingBox}from"./assets/widget-icons/illustraions/shippingBox.js";export{BigSaleMedal}from"./assets/widget-icons/illustraions/bigSaleMedal.js";export{ShoppingCartIllustration}from"./assets/widget-icons/illustraions/shoppingCartIllustration.js";export{InformationCircleIllustration}from"./assets/widget-icons/illustraions/informationCircleIllustration.js";export{CheckFillIllustration}from"./assets/widget-icons/illustraions/check-fill.js";export{RefundIllustration}from"./assets/widget-icons/illustraions/refundIllustration.js";export{default as LoyaltyWidgetRenderer}from"./renderer/index.js";export{flatten,unflatten}from"./renderer/utils/object-utils.js";
1
+ export{default as locales}from"./locales.js";export{LoyaltyWidget}from"./models/loyalty-widget/index.js";export{BadgeIconTypeEnum,HeaderBackgroundTypeEnum,ImageTypeEnum,LoyaltyWidgetLayoutTypeEnum,WidgetIconTypeEnum,WidgetPositionEnum}from"./models/loyalty-widget/types/index.js";export{LoyaltyWidgetHeader}from"./models/loyalty-widget/header/index.js";export{LoyaltyWidgetHeaderBackground}from"./models/loyalty-widget/header/header-background/index.js";export{LoyaltyWidgetTranslations}from"./models/loyalty-widget/translations.js";export{IMAGE_SIZE,LoyaltyWidgetImage}from"./models/image/index.js";export{LoyaltyWidgetButton}from"./models/button/index.js";export{CampaignTypeEnum,CartLoyaltyLineData,LoyaltyCustomerInfo,LoyaltyProgramTier,LoyaltyProgramTierTranslation,OrderAmountTypeEnum}from"./models/loyalty-customer-info/index.js";export{LoyaltyProgramPointHistory}from"./models/loyalty-program-point-history/index.js";export{LoyaltyProgramDiscountSettings,LoyaltyProgramSpendingMethod}from"./models/loyalty-program-spending-method/index.js";export{LoyaltyProgramEarningMethod,LoyaltyProgramEarningMethodOrderSettings,LoyaltyProgramEarningMethodProductSettings}from"./models/loyalty-program-earning-method/index.js";export{LoyaltyWidgetSettings}from"./models/loyalty-widget/settings/index.js";export{LoyaltyWidgetViewModel}from"./models/index.js";export{EarningMethodTypeEnum,LoyaltyProgramFilterTypeEnum,LoyaltyProgramMethodSpendingTypeEnum,LoyaltyProgramPointEarningTypeEnum,LoyaltyProgramPointHistoryTypeEnum,LoyaltyWidgetScreenTypeEnum,PeriodTypeEnum,WidgetMode}from"./models/types/index.js";export{BadgeLevel1}from"./assets/badgeLevel1.js";export{BadgeLevel2}from"./assets/badgeLevel2.js";export{BadgeLevel3}from"./assets/badgeLevel3.js";export{BadgeLevel4}from"./assets/badgeLevel4.js";export{XClose}from"./assets/icons/x-close.js";export{CheckCircleFill}from"./assets/icons/check-circle-fill.js";export{ChevronLeft}from"./assets/icons/chevron-left.js";export{Check}from"./assets/icons/check.js";export{ArrowRight}from"./assets/icons/arrow-right.js";export{CheckCircle}from"./assets/icons/check-circle.js";export{BubbleChatDone}from"./assets/widget-icons/normal/bubbleChatDone.js";export{CommentAdd01}from"./assets/widget-icons/normal/commentAdd01.js";export{CouponPercent}from"./assets/widget-icons/normal/couponPercent.js";export{DiscountTag02}from"./assets/widget-icons/normal/discountTag02.js";export{Gift}from"./assets/widget-icons/normal/gift.js";export{MoneyAdd01}from"./assets/widget-icons/normal/moneyAdd01.js";export{PackageDelivered}from"./assets/widget-icons/normal/packageDelivered.js";export{SaveMoneyDollar}from"./assets/widget-icons/normal/saveMoneyDollar.js";export{ShoppingBasketAdd02}from"./assets/widget-icons/normal/shoppingBasketAdd02.js";export{UserAdd01}from"./assets/widget-icons/normal/userAdd01.js";export{InformationCircle}from"./assets/widget-icons/normal/informationCircle.js";export{Refund}from"./assets/widget-icons/normal/refund.js";export{Album02}from"./assets/widget-icons/normal/album02.js";export{UsersIllustration}from"./assets/widget-icons/illustraions/usersIllustration.js";export{BubbleChatIllustration}from"./assets/widget-icons/illustraions/bubbleChatIllustration.js";export{ApprovedChatIllustration}from"./assets/widget-icons/illustraions/approvedChatIllustration.js";export{TshirtIllustration}from"./assets/widget-icons/illustraions/tshirtIllustration.js";export{Medal}from"./assets/widget-icons/illustraions/medal.js";export{GiftIllustration}from"./assets/widget-icons/illustraions/giftIllustration.js";export{ShippingBox}from"./assets/widget-icons/illustraions/shippingBox.js";export{BigSaleMedal}from"./assets/widget-icons/illustraions/bigSaleMedal.js";export{ShoppingCartIllustration}from"./assets/widget-icons/illustraions/shoppingCartIllustration.js";export{InformationCircleIllustration}from"./assets/widget-icons/illustraions/informationCircleIllustration.js";export{CheckFillIllustration}from"./assets/widget-icons/illustraions/check-fill.js";export{RefundIllustration}from"./assets/widget-icons/illustraions/refundIllustration.js";export{Scenery}from"./assets/widget-icons/illustraions/scenery.js";export{default as LoyaltyWidgetRenderer}from"./renderer/index.js";export{flatten,unflatten}from"./renderer/utils/object-utils.js";
@@ -1,5 +1,5 @@
1
- import LoyaltyWidgetRenderer from "./renderer";
2
1
  import { IkasLoyaltyWidgetConfig } from "./models/types";
2
+ import LoyaltyWidgetRenderer from "./renderer";
3
3
  export declare function startIkasLoyaltyWidget(config?: IkasLoyaltyWidgetConfig): void;
4
4
  export { LoyaltyWidgetRenderer };
5
5
  export type { IkasLoyaltyWidgetConfig };
@@ -42,6 +42,10 @@ declare const locales: {
42
42
  FREE_PRODUCT: {
43
43
  title: string;
44
44
  description: string;
45
+ groupedDescription: string;
46
+ singleDescription: string;
47
+ selectGift: string;
48
+ addFree: string;
45
49
  };
46
50
  };
47
51
  header: {
@@ -110,6 +114,7 @@ declare const locales: {
110
114
  screens: {
111
115
  creditEarningMethods: string;
112
116
  creditSpendingMethods: string;
117
+ giftProductSelection: string;
113
118
  creditHistory: string;
114
119
  loyaltyLevel: string;
115
120
  loyaltyLevelScreen: {
@@ -169,6 +174,10 @@ declare const locales: {
169
174
  FREE_PRODUCT: {
170
175
  title: string;
171
176
  description: string;
177
+ groupedDescription: string;
178
+ singleDescription: string;
179
+ selectGift: string;
180
+ addFree: string;
172
181
  };
173
182
  };
174
183
  header: {
@@ -237,6 +246,7 @@ declare const locales: {
237
246
  screens: {
238
247
  creditEarningMethods: string;
239
248
  creditSpendingMethods: string;
249
+ giftProductSelection: string;
240
250
  creditHistory: string;
241
251
  loyaltyLevel: string;
242
252
  loyaltyLevelScreen: {
@@ -296,6 +306,10 @@ declare const locales: {
296
306
  FREE_PRODUCT: {
297
307
  title: string;
298
308
  description: string;
309
+ groupedDescription: string;
310
+ singleDescription: string;
311
+ selectGift: string;
312
+ addFree: string;
299
313
  };
300
314
  };
301
315
  header: {
@@ -364,6 +378,7 @@ declare const locales: {
364
378
  screens: {
365
379
  creditEarningMethods: string;
366
380
  creditSpendingMethods: string;
381
+ giftProductSelection: string;
367
382
  creditHistory: string;
368
383
  loyaltyLevel: string;
369
384
  loyaltyLevelScreen: {
@@ -423,6 +438,10 @@ declare const locales: {
423
438
  FREE_PRODUCT: {
424
439
  title: string;
425
440
  description: string;
441
+ groupedDescription: string;
442
+ singleDescription: string;
443
+ selectGift: string;
444
+ addFree: string;
426
445
  };
427
446
  };
428
447
  header: {
@@ -491,6 +510,7 @@ declare const locales: {
491
510
  screens: {
492
511
  creditEarningMethods: string;
493
512
  creditSpendingMethods: string;
513
+ giftProductSelection: string;
494
514
  creditHistory: string;
495
515
  loyaltyLevel: string;
496
516
  loyaltyLevelScreen: {
@@ -550,6 +570,10 @@ declare const locales: {
550
570
  FREE_PRODUCT: {
551
571
  title: string;
552
572
  description: string;
573
+ groupedDescription: string;
574
+ singleDescription: string;
575
+ selectGift: string;
576
+ addFree: string;
553
577
  };
554
578
  };
555
579
  header: {
@@ -618,6 +642,7 @@ declare const locales: {
618
642
  screens: {
619
643
  creditEarningMethods: string;
620
644
  creditSpendingMethods: string;
645
+ giftProductSelection: string;
621
646
  creditHistory: string;
622
647
  loyaltyLevel: string;
623
648
  loyaltyLevelScreen: {
@@ -5,7 +5,7 @@ import { LoyaltyProgramSpendingMethod } from "./loyalty-program-spending-method"
5
5
  import { LoyaltyWidget } from "./loyalty-widget";
6
6
  import { Brand, Category, LoyaltyWidgetCallbacks, LoyaltyWidgetScreenTypeEnum, Product, Tag, WidgetMode } from "./types";
7
7
  export declare class LoyaltyWidgetViewModel {
8
- selectedScreen: LoyaltyWidgetScreenTypeEnum;
8
+ navigationStack: LoyaltyWidgetScreenTypeEnum[];
9
9
  currentWidgetMode: WidgetMode;
10
10
  isMiniModeDescriptionClosed: boolean;
11
11
  isLoading: boolean;
@@ -31,6 +31,11 @@ export declare class LoyaltyWidgetViewModel {
31
31
  pointHistory: LoyaltyProgramPointHistory[];
32
32
  callbacks?: LoyaltyWidgetCallbacks;
33
33
  constructor(data: Partial<LoyaltyWidgetViewModel> | undefined, cdnURL: string, merchantId: string, currency: string, storeURL?: string | null, isPreviewMode?: boolean, callbacks?: LoyaltyWidgetCallbacks);
34
+ get currentScreen(): LoyaltyWidgetScreenTypeEnum;
35
+ get isMainScreen(): boolean;
36
+ pushScreen(screen: LoyaltyWidgetScreenTypeEnum): void;
37
+ popScreen(): void;
38
+ resetNavigation(): void;
34
39
  get shouldShowSpendingMethods(): boolean;
35
40
  setWidgetMode(mode: WidgetMode): void;
36
41
  closeMiniModeDescription(): void;
@@ -1 +1 @@
1
- import{__assign as t}from'./../ext/tslib/tslib.es6.mjs.js';import{makeObservable as e,observable as i,action as s,computed as r}from"mobx";import{markDescriptionClosedForSession as o,isDescriptionClosedForCurrentSession as n}from"../utils.js";import{LoyaltyCustomerInfo as d}from"./loyalty-customer-info/index.js";import{LoyaltyProgramEarningMethod as c}from"./loyalty-program-earning-method/index.js";import{LoyaltyProgramSpendingMethod as a}from"./loyalty-program-spending-method/index.js";import{LoyaltyWidget as h}from"./loyalty-widget/index.js";import{WidgetMode as l,LoyaltyWidgetScreenTypeEnum as u}from"./types/index.js";var g=function(){function g(o,g,p,M,m,y,f){void 0===o&&(o={}),this.userRefreshTrigger=0,this.cartRefreshTrigger=0,this.selectedScreen=o.selectedScreen||u.MAIN_SCREEN,this.currentWidgetMode=y?l.WIDGET_MODE:l.MINI_MODE,this.isMiniModeDescriptionClosed=n(),this.isLoading=o.isLoading||!1,this.isActionLoading=o.isActionLoading||!1,this.loyaltyWidget=new h(o.loyaltyWidget),this.cdnURL=g,this.merchantId=p,this.storeUrl=m||o.storeUrl||"",this.currency=M,this.isPreviewMode=y||!1,this.cartId=o.cartId||null,this.cartId=o.cartId||null,this.ikasEventUser=o.ikasEventUser||null,this.user=o.user?new d(o.user):null,this.earningMethods=o.earningMethods?o.earningMethods.map(function(t){return new c(t)}):[],this.spendingMethods=o.spendingMethods?o.spendingMethods.map(function(t){return new a(t)}):[],this.tiers=o.tiers?o.tiers:[],this.categories=o.categories?o.categories:[],this.products=o.products?o.products:[],this.brands=o.brands?o.brands:[],this.tags=o.tags?o.tags:[],this.pointHistory=o.pointHistory?o.pointHistory:[],this.callbacks=f||void 0,e(this,t(t({cartId:i},y?{}:{loyaltyWidget:i}),{isLoading:i,isActionLoading:i,cdnURL:i,merchantId:i,storeUrl:i,currency:i,setWidgetMode:s.bound,closeMiniModeDescription:s.bound,formatCurrency:s.bound,selectedScreen:i,currentWidgetMode:i,isMiniModeDescriptionClosed:i,user:i,earningMethods:i,spendingMethods:i,tiers:i,categories:i,products:i,brands:i,tags:i,pointHistory:i,ikasEventUser:i,userRefreshTrigger:i,cartRefreshTrigger:i,shouldShowSpendingMethods:r}))}return Object.defineProperty(g.prototype,"shouldShowSpendingMethods",{get:function(){return!!this.user&&(!(this.user.totalPoint<=0)&&0!==this.spendingMethods.length)},enumerable:!1,configurable:!0}),g.prototype.setWidgetMode=function(t){this.currentWidgetMode=t,t!==l.WIDGET_MODE||this.isPreviewMode||(this.isMiniModeDescriptionClosed=!0,o())},g.prototype.closeMiniModeDescription=function(){this.isMiniModeDescriptionClosed=!0,o()},g.prototype.formatCurrency=function(t){var e;return(null===(e=this.callbacks)||void 0===e?void 0:e.formatCurrency)?this.callbacks.formatCurrency(t):"".concat(t.toFixed(2)," ").concat(this.currency)},g}();export{g as LoyaltyWidgetViewModel};
1
+ import{__assign as t}from'./../ext/tslib/tslib.es6.mjs.js';import{makeObservable as e,observable as i,computed as n,action as r}from"mobx";import{markDescriptionClosedForSession as o,isDescriptionClosedForCurrentSession as s}from"../utils.js";import{LoyaltyCustomerInfo as a}from"./loyalty-customer-info/index.js";import{LoyaltyProgramEarningMethod as c}from"./loyalty-program-earning-method/index.js";import{LoyaltyProgramSpendingMethod as d}from"./loyalty-program-spending-method/index.js";import{LoyaltyWidget as h}from"./loyalty-widget/index.js";import{LoyaltyWidgetScreenTypeEnum as u,WidgetMode as p}from"./types/index.js";var g=function(){function g(o,g,l,M,y,f,m){void 0===o&&(o={}),this.userRefreshTrigger=0,this.cartRefreshTrigger=0,this.navigationStack=[u.MAIN_SCREEN],this.currentWidgetMode=f?p.WIDGET_MODE:p.MINI_MODE,this.isMiniModeDescriptionClosed=s(),this.isLoading=o.isLoading||!1,this.isActionLoading=o.isActionLoading||!1,this.loyaltyWidget=new h(o.loyaltyWidget),this.cdnURL=g,this.merchantId=l,this.storeUrl=y||o.storeUrl||"",this.currency=M,this.isPreviewMode=f||!1,this.cartId=o.cartId||null,this.ikasEventUser=o.ikasEventUser||null,this.user=o.user?new a(o.user):null,this.earningMethods=o.earningMethods?o.earningMethods.map(function(t){return new c(t)}):[],this.spendingMethods=o.spendingMethods?o.spendingMethods.map(function(t){return new d(t)}):[],this.tiers=o.tiers?o.tiers:[],this.categories=o.categories?o.categories:[],this.products=o.products?o.products:[],this.brands=o.brands?o.brands:[],this.tags=o.tags?o.tags:[],this.pointHistory=o.pointHistory?o.pointHistory:[],this.callbacks=m||void 0,e(this,t(t({cartId:i},f?{}:{loyaltyWidget:i}),{isLoading:i,isActionLoading:i,cdnURL:i,merchantId:i,storeUrl:i,currency:i,navigationStack:i,currentScreen:n,isMainScreen:n,pushScreen:r.bound,popScreen:r.bound,resetNavigation:r.bound,setWidgetMode:r.bound,closeMiniModeDescription:r.bound,formatCurrency:r.bound,currentWidgetMode:i,isMiniModeDescriptionClosed:i,user:i,earningMethods:i,spendingMethods:i,tiers:i,categories:i,products:i,brands:i,tags:i,pointHistory:i,ikasEventUser:i,userRefreshTrigger:i,cartRefreshTrigger:i,shouldShowSpendingMethods:n}))}return Object.defineProperty(g.prototype,"currentScreen",{get:function(){return this.navigationStack[this.navigationStack.length-1]},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"isMainScreen",{get:function(){return this.currentScreen===u.MAIN_SCREEN},enumerable:!1,configurable:!0}),g.prototype.pushScreen=function(t){this.currentScreen!==t&&this.navigationStack.push(t)},g.prototype.popScreen=function(){this.navigationStack.length>1&&this.navigationStack.pop()},g.prototype.resetNavigation=function(){this.navigationStack=[u.MAIN_SCREEN]},Object.defineProperty(g.prototype,"shouldShowSpendingMethods",{get:function(){return!!this.user&&(!(this.user.totalPoint<=0)&&0!==this.spendingMethods.length)},enumerable:!1,configurable:!0}),g.prototype.setWidgetMode=function(t){this.currentWidgetMode=t,t!==p.WIDGET_MODE||this.isPreviewMode||(this.isMiniModeDescriptionClosed=!0,o())},g.prototype.closeMiniModeDescription=function(){this.isMiniModeDescriptionClosed=!0,o()},g.prototype.formatCurrency=function(t){var e;return(null===(e=this.callbacks)||void 0===e?void 0:e.formatCurrency)?this.callbacks.formatCurrency(t):"".concat(t.toFixed(2)," ").concat(this.currency)},g}();export{g as LoyaltyWidgetViewModel};
@@ -23,7 +23,7 @@ export declare class CartLoyaltyLineData {
23
23
  campaignType: CampaignTypeEnum | null;
24
24
  discountAmount: number;
25
25
  discountAmountType: OrderAmountTypeEnum;
26
- discountPercentage?: number | null;
26
+ discountPercentage: number | null;
27
27
  loyaltySpendingMethodId: string;
28
28
  pointUsed: number;
29
29
  constructor(data?: Partial<CartLoyaltyLineData>);
@@ -1 +1 @@
1
- import{makeObservable as t,observable as i}from"mobx";import{LoyaltyProgramPeriod as e}from"../common/index.js";var n,o,r=function(e){void 0===e&&(e={}),this.locale=e.locale||"",this.name=e.name||"",t(this,{locale:i,name:i})},l=function(n){void 0===n&&(n={}),this.id=n.id||"",this.name=n.name||"",this.pointsRequired=n.pointsRequired||null,this.tierPointMultiplier=n.tierPointMultiplier||null,this.loyaltyProgramId=n.loyaltyProgramId||"",this.customerSegmentId=n.customerSegmentId||null,this.createdAt=n.createdAt||null,this.updatedAt=n.updatedAt||null,this.deleted=n.deleted||!1,this.isActive=n.isActive||!1,this.period=n.period?new e(n.period):null,this.translations=n.translations?n.translations.map(function(t){return new r(t)}):null,t(this,{id:i,name:i,pointsRequired:i,tierPointMultiplier:i,loyaltyProgramId:i,customerSegmentId:i,createdAt:i,updatedAt:i,deleted:i,isActive:i,period:i,translations:i})},s=function(e){void 0===e&&(e={}),this.campaignType=e.campaignType||null,this.discountAmount=e.discountAmount||0,this.discountAmountType=e.discountAmountType||o.AMOUNT,this.discountPercentage=e.discountPercentage||null,this.loyaltySpendingMethodId=e.loyaltySpendingMethodId||"",this.pointUsed=e.pointUsed||0,t(this,{campaignType:i,discountAmount:i,discountAmountType:i,discountPercentage:i,loyaltySpendingMethodId:i,pointUsed:i})},d=function(e){void 0===e&&(e={}),this.customerTier=e.customerTier?new l(e.customerTier):null,this.loyaltyProgramCustomerId=e.loyaltyProgramCustomerId||"",this.loyaltyProgramId=e.loyaltyProgramId||"",this.totalPoint=e.totalPoint||0,this.nextTierRequiredPoint=void 0!==e.nextTierRequiredPoint&&null!==e.nextTierRequiredPoint?e.nextTierRequiredPoint:null,this.cartLoyaltyLines=e.cartLoyaltyLines?e.cartLoyaltyLines.map(function(t){return new s(t)}):null,t(this,{customerTier:i,loyaltyProgramCustomerId:i,loyaltyProgramId:i,totalPoint:i,nextTierRequiredPoint:i,cartLoyaltyLines:i})};!function(t){t.BUY_X_THEN_GET_Y="BUY_X_THEN_GET_Y",t.FIXED_AMOUNT="FIXED_AMOUNT",t.FREE_SHIPPING="FREE_SHIPPING",t.RATIO="RATIO"}(n||(n={})),function(t){t.AMOUNT="AMOUNT",t.RATIO="RATIO"}(o||(o={}));export{n as CampaignTypeEnum,s as CartLoyaltyLineData,d as LoyaltyCustomerInfo,l as LoyaltyProgramTier,r as LoyaltyProgramTierTranslation,o as OrderAmountTypeEnum};
1
+ import{makeObservable as t,observable as e}from"mobx";import{LoyaltyProgramPeriod as i}from"../common/index.js";var n,o,r=function(i){void 0===i&&(i={}),this.locale=i.locale||"",this.name=i.name||"",t(this,{locale:e,name:e})},l=function(n){void 0===n&&(n={}),this.id=n.id||"",this.name=n.name||"",this.pointsRequired=n.pointsRequired||null,this.tierPointMultiplier=n.tierPointMultiplier||null,this.loyaltyProgramId=n.loyaltyProgramId||"",this.customerSegmentId=n.customerSegmentId||null,this.createdAt=n.createdAt||null,this.updatedAt=n.updatedAt||null,this.deleted=n.deleted||!1,this.isActive=n.isActive||!1,this.period=n.period?new i(n.period):null,this.translations=n.translations?n.translations.map(function(t){return new r(t)}):null,t(this,{id:e,name:e,pointsRequired:e,tierPointMultiplier:e,loyaltyProgramId:e,customerSegmentId:e,createdAt:e,updatedAt:e,deleted:e,isActive:e,period:e,translations:e})},s=function(i){void 0===i&&(i={}),this.campaignType=i.campaignType||null,this.discountAmount=i.discountAmount||0,this.discountAmountType=i.discountAmountType||o.AMOUNT,this.discountPercentage=void 0!==i.discountPercentage&&null!==i.discountPercentage?i.discountPercentage:null,this.loyaltySpendingMethodId=i.loyaltySpendingMethodId||"",this.pointUsed=i.pointUsed||0,t(this,{campaignType:e,discountAmount:e,discountAmountType:e,discountPercentage:e,loyaltySpendingMethodId:e,pointUsed:e})},d=function(i){void 0===i&&(i={}),this.customerTier=i.customerTier?new l(i.customerTier):null,this.loyaltyProgramCustomerId=i.loyaltyProgramCustomerId||"",this.loyaltyProgramId=i.loyaltyProgramId||"",this.totalPoint=i.totalPoint||0,this.nextTierRequiredPoint=void 0!==i.nextTierRequiredPoint&&null!==i.nextTierRequiredPoint?i.nextTierRequiredPoint:null,this.cartLoyaltyLines=i.cartLoyaltyLines?i.cartLoyaltyLines.map(function(t){return new s(t)}):null,t(this,{customerTier:e,loyaltyProgramCustomerId:e,loyaltyProgramId:e,totalPoint:e,nextTierRequiredPoint:e,cartLoyaltyLines:e})};!function(t){t.BUY_X_THEN_GET_Y="BUY_X_THEN_GET_Y",t.FIXED_AMOUNT="FIXED_AMOUNT",t.FREE_SHIPPING="FREE_SHIPPING",t.RATIO="RATIO"}(n||(n={})),function(t){t.AMOUNT="AMOUNT",t.RATIO="RATIO"}(o||(o={}));export{n as CampaignTypeEnum,s as CartLoyaltyLineData,d as LoyaltyCustomerInfo,l as LoyaltyProgramTier,r as LoyaltyProgramTierTranslation,o as OrderAmountTypeEnum};
@@ -3,6 +3,7 @@ export declare class LoyaltyProgramPointHistory {
3
3
  amount: number;
4
4
  createdAt: any | null;
5
5
  customerId: string;
6
+ customerReviewId: string | null;
6
7
  deleted: boolean;
7
8
  expireDate: any | null;
8
9
  id: string;
@@ -12,6 +13,7 @@ export declare class LoyaltyProgramPointHistory {
12
13
  loyaltyProgramSpendingMethodId: string | null;
13
14
  orderId: string | null;
14
15
  type: LoyaltyProgramPointHistoryTypeEnum;
16
+ productVariantId: string | null;
15
17
  updatedAt: any | null;
16
18
  constructor(data?: Partial<LoyaltyProgramPointHistory>);
17
19
  }
@@ -1 +1 @@
1
- import{makeObservable as t,observable as e}from"mobx";import{LoyaltyProgramPointHistoryTypeEnum as r}from"../types/index.js";var d=function(d){void 0===d&&(d={}),this.amount=d.amount||0,this.createdAt=d.createdAt||null,this.customerId=d.customerId||"",this.deleted=d.deleted||!1,this.expireDate=d.expireDate||null,this.id=d.id||"",this.loyaltyProgramCustomerId=d.loyaltyProgramCustomerId||"",this.loyaltyProgramEarningMethodId=d.loyaltyProgramEarningMethodId||null,this.loyaltyProgramId=d.loyaltyProgramId||"",this.loyaltyProgramSpendingMethodId=d.loyaltyProgramSpendingMethodId||null,this.orderId=d.orderId||null,this.type=d.type||r.EARN,this.updatedAt=d.updatedAt||null,t(this,{amount:e,createdAt:e,customerId:e,deleted:e,expireDate:e,id:e,loyaltyProgramCustomerId:e,loyaltyProgramEarningMethodId:e,loyaltyProgramId:e,loyaltyProgramSpendingMethodId:e,orderId:e,type:e,updatedAt:e})};export{d as LoyaltyProgramPointHistory};
1
+ import{makeObservable as t,observable as e}from"mobx";import{LoyaltyProgramPointHistoryTypeEnum as r}from"../types/index.js";var d=function(d){void 0===d&&(d={}),this.amount=d.amount||0,this.createdAt=d.createdAt||null,this.customerId=d.customerId||"",this.customerReviewId=d.customerReviewId||null,this.deleted=d.deleted||!1,this.expireDate=d.expireDate||null,this.id=d.id||"",this.loyaltyProgramCustomerId=d.loyaltyProgramCustomerId||"",this.loyaltyProgramEarningMethodId=d.loyaltyProgramEarningMethodId||null,this.loyaltyProgramId=d.loyaltyProgramId||"",this.loyaltyProgramSpendingMethodId=d.loyaltyProgramSpendingMethodId||null,this.orderId=d.orderId||null,this.type=d.type||r.EARN,this.productVariantId=d.productVariantId||null,this.updatedAt=d.updatedAt||null,t(this,{amount:e,createdAt:e,customerId:e,customerReviewId:e,deleted:e,expireDate:e,id:e,loyaltyProgramCustomerId:e,loyaltyProgramEarningMethodId:e,loyaltyProgramId:e,loyaltyProgramSpendingMethodId:e,orderId:e,type:e,productVariantId:e,updatedAt:e})};export{d as LoyaltyProgramPointHistory};
@@ -3,6 +3,7 @@ import { LoyaltyProgramPointLimit, LoyaltyProgramFilter, LoyaltyProgramMethodTra
3
3
  export declare class LoyaltyProgramDiscountSettings {
4
4
  discountAmount: number | null;
5
5
  freeProductId: string | null;
6
+ freeProductVariantId: string | null;
6
7
  point: number;
7
8
  constructor(data?: Partial<LoyaltyProgramDiscountSettings>);
8
9
  }
@@ -1 +1 @@
1
- import{makeObservable as t,observable as i}from"mobx";import{LoyaltyProgramMethodSpendingTypeEnum as n}from"../types/index.js";import{LoyaltyProgramPointLimit as s,LoyaltyProgramFilter as e,LoyaltyProgramMethodTranslation as o}from"../common/index.js";var l=function(n){void 0===n&&(n={}),this.discountAmount=n.discountAmount||null,this.freeProductId=n.freeProductId||null,this.point=n.point||0,t(this,{discountAmount:i,freeProductId:i,point:i})},d=function(d){void 0===d&&(d={}),this.createdAt=d.createdAt||null,this.deleted=d.deleted||!1,this.description=d.description||null,this.discountSettings=d.discountSettings?new l(d.discountSettings):null,this.id=d.id||"",this.isActive=d.isActive||!1,this.isAvailable=void 0!==d.isAvailable&&null!==d.isAvailable?d.isAvailable:null,this.isDynamic=d.isDynamic||!1,this.loyaltyProgramId=d.loyaltyProgramId||"",this.pointUsageLimit=d.pointUsageLimit?new s(d.pointUsageLimit):null,this.productFilters=d.productFilters?d.productFilters.map(function(t){return new e(t)}):null,this.translations=d.translations?d.translations.map(function(t){return new o(t)}):null,this.type=d.type||n.FIXED_AMOUNT,this.updatedAt=d.updatedAt||null,t(this,{createdAt:i,deleted:i,description:i,discountSettings:i,id:i,isActive:i,isAvailable:i,isDynamic:i,loyaltyProgramId:i,pointUsageLimit:i,productFilters:i,translations:i,type:i,updatedAt:i})};export{l as LoyaltyProgramDiscountSettings,d as LoyaltyProgramSpendingMethod};
1
+ import{makeObservable as t,observable as i}from"mobx";import{LoyaltyProgramMethodSpendingTypeEnum as n}from"../types/index.js";import{LoyaltyProgramPointLimit as e,LoyaltyProgramFilter as s,LoyaltyProgramMethodTranslation as o}from"../common/index.js";var d=function(n){void 0===n&&(n={}),this.discountAmount=n.discountAmount||null,this.freeProductId=n.freeProductId||null,this.freeProductVariantId=n.freeProductVariantId||null,this.point=n.point||0,t(this,{discountAmount:i,freeProductId:i,freeProductVariantId:i,point:i})},l=function(l){void 0===l&&(l={}),this.createdAt=l.createdAt||null,this.deleted=l.deleted||!1,this.description=l.description||null,this.discountSettings=l.discountSettings?new d(l.discountSettings):null,this.id=l.id||"",this.isActive=l.isActive||!1,this.isAvailable=void 0!==l.isAvailable&&null!==l.isAvailable?l.isAvailable:null,this.isDynamic=l.isDynamic||!1,this.loyaltyProgramId=l.loyaltyProgramId||"",this.pointUsageLimit=l.pointUsageLimit?new e(l.pointUsageLimit):null,this.productFilters=l.productFilters?l.productFilters.map(function(t){return new s(t)}):null,this.translations=l.translations?l.translations.map(function(t){return new o(t)}):null,this.type=l.type||n.FIXED_AMOUNT,this.updatedAt=l.updatedAt||null,t(this,{createdAt:i,deleted:i,description:i,discountSettings:i,id:i,isActive:i,isAvailable:i,isDynamic:i,loyaltyProgramId:i,pointUsageLimit:i,productFilters:i,translations:i,type:i,updatedAt:i})};export{d as LoyaltyProgramDiscountSettings,l as LoyaltyProgramSpendingMethod};
@@ -9,7 +9,8 @@ export declare enum LoyaltyWidgetScreenTypeEnum {
9
9
  CREDIT_SPENDING_METHODS_SCREEN = "CREDIT_SPENDING_METHODS_SCREEN",
10
10
  CREDIT_EARNING_METHODS_SCREEN = "CREDIT_EARNING_METHODS_SCREEN",
11
11
  CREDIT_HISTORY_SCREEN = "CREDIT_HISTORY_SCREEN",
12
- LOYALTY_LEVEL_SCREEN = "LOYALTY_LEVEL_SCREEN"
12
+ LOYALTY_LEVEL_SCREEN = "LOYALTY_LEVEL_SCREEN",
13
+ GIFT_PRODUCT_SELECTION_SCREEN = "GIFT_PRODUCT_SELECTION_SCREEN"
13
14
  }
14
15
  export declare enum WidgetMode {
15
16
  MINI_MODE = "MINI_MODE",
@@ -50,9 +51,16 @@ export type Category = {
50
51
  id: string;
51
52
  name: string;
52
53
  };
54
+ export type ProductVariant = {
55
+ id: string;
56
+ mainImageSrc?: string | null;
57
+ variantText?: string | null;
58
+ };
53
59
  export type Product = {
54
60
  id: string;
55
61
  name: string;
62
+ mainImageSrc?: string | null;
63
+ variants?: ProductVariant[];
56
64
  };
57
65
  export type Brand = {
58
66
  id: string;
@@ -127,3 +135,11 @@ export type IkasLoyaltyWidgetConfig = {
127
135
  isPreviewMode?: boolean;
128
136
  onViewModelInitialized?: (viewModel: LoyaltyWidgetViewModel) => void;
129
137
  };
138
+ declare global {
139
+ interface Window {
140
+ startIkasLoyaltyWidget?: (config?: IkasLoyaltyWidgetConfig) => void;
141
+ openIkasStorefrontWidget?: () => void;
142
+ closeIkasStorefrontWidget?: () => void;
143
+ ikasLoyaltyWidgetConfig?: IkasLoyaltyWidgetConfig;
144
+ }
145
+ }
@@ -1 +1 @@
1
- var E,R,T,_,N,D,I,C;!function(E){E.MAIN_SCREEN="MAIN_SCREEN",E.CREDIT_SPENDING_METHODS_SCREEN="CREDIT_SPENDING_METHODS_SCREEN",E.CREDIT_EARNING_METHODS_SCREEN="CREDIT_EARNING_METHODS_SCREEN",E.CREDIT_HISTORY_SCREEN="CREDIT_HISTORY_SCREEN",E.LOYALTY_LEVEL_SCREEN="LOYALTY_LEVEL_SCREEN"}(E||(E={})),function(E){E.MINI_MODE="MINI_MODE",E.WIDGET_MODE="WIDGET_MODE"}(R||(R={})),function(E){E.BUY_PRODUCT="BUY_PRODUCT",E.CUSTOMER_REGISTER="CUSTOMER_REGISTER",E.CUSTOMER_REVIEW="CUSTOMER_REVIEW",E.CUSTOMER_SEGMENT="CUSTOMER_SEGMENT",E.ENABLE_SUBSCRIPTION="ENABLE_SUBSCRIPTION",E.ORDER_CREATE="ORDER_CREATE"}(T||(T={})),function(E){E.DYNAMIC_ORDER_AMOUNT="DYNAMIC_ORDER_AMOUNT",E.DYNAMIC_ORDER_QUANTITY="DYNAMIC_ORDER_QUANTITY",E.STATIC="STATIC"}(_||(_={})),function(E){E.FIXED_AMOUNT="FIXED_AMOUNT",E.FREE_PRODUCT="FREE_PRODUCT",E.FREE_SHIPPING="FREE_SHIPPING",E.RATIO="RATIO"}(N||(N={})),function(E){E.CATEGORY="CATEGORY",E.DYNAMIC_CATEGORY="DYNAMIC_CATEGORY",E.PRODUCT_AND_VARIANT="PRODUCT_AND_VARIANT",E.PRODUCT_BRAND="PRODUCT_BRAND",E.PRODUCT_TAG="PRODUCT_TAG"}(D||(D={})),function(E){E.MONTH="MONTH",E.WEEK="WEEK",E.YEAR="YEAR"}(I||(I={})),function(E){E.EARN="EARN",E.SPEND="SPEND",E.REFUND="REFUND",E.REFILL="REFILL"}(C||(C={}));export{T as EarningMethodTypeEnum,D as LoyaltyProgramFilterTypeEnum,N as LoyaltyProgramMethodSpendingTypeEnum,_ as LoyaltyProgramPointEarningTypeEnum,C as LoyaltyProgramPointHistoryTypeEnum,E as LoyaltyWidgetScreenTypeEnum,I as PeriodTypeEnum,R as WidgetMode};
1
+ var E,R,T,_,N,C,I,D;!function(E){E.MAIN_SCREEN="MAIN_SCREEN",E.CREDIT_SPENDING_METHODS_SCREEN="CREDIT_SPENDING_METHODS_SCREEN",E.CREDIT_EARNING_METHODS_SCREEN="CREDIT_EARNING_METHODS_SCREEN",E.CREDIT_HISTORY_SCREEN="CREDIT_HISTORY_SCREEN",E.LOYALTY_LEVEL_SCREEN="LOYALTY_LEVEL_SCREEN",E.GIFT_PRODUCT_SELECTION_SCREEN="GIFT_PRODUCT_SELECTION_SCREEN"}(E||(E={})),function(E){E.MINI_MODE="MINI_MODE",E.WIDGET_MODE="WIDGET_MODE"}(R||(R={})),function(E){E.BUY_PRODUCT="BUY_PRODUCT",E.CUSTOMER_REGISTER="CUSTOMER_REGISTER",E.CUSTOMER_REVIEW="CUSTOMER_REVIEW",E.CUSTOMER_SEGMENT="CUSTOMER_SEGMENT",E.ENABLE_SUBSCRIPTION="ENABLE_SUBSCRIPTION",E.ORDER_CREATE="ORDER_CREATE"}(T||(T={})),function(E){E.DYNAMIC_ORDER_AMOUNT="DYNAMIC_ORDER_AMOUNT",E.DYNAMIC_ORDER_QUANTITY="DYNAMIC_ORDER_QUANTITY",E.STATIC="STATIC"}(_||(_={})),function(E){E.FIXED_AMOUNT="FIXED_AMOUNT",E.FREE_PRODUCT="FREE_PRODUCT",E.FREE_SHIPPING="FREE_SHIPPING",E.RATIO="RATIO"}(N||(N={})),function(E){E.CATEGORY="CATEGORY",E.DYNAMIC_CATEGORY="DYNAMIC_CATEGORY",E.PRODUCT_AND_VARIANT="PRODUCT_AND_VARIANT",E.PRODUCT_BRAND="PRODUCT_BRAND",E.PRODUCT_TAG="PRODUCT_TAG"}(C||(C={})),function(E){E.MONTH="MONTH",E.WEEK="WEEK",E.YEAR="YEAR"}(I||(I={})),function(E){E.EARN="EARN",E.SPEND="SPEND",E.REFUND="REFUND",E.REFILL="REFILL"}(D||(D={}));export{T as EarningMethodTypeEnum,C as LoyaltyProgramFilterTypeEnum,N as LoyaltyProgramMethodSpendingTypeEnum,_ as LoyaltyProgramPointEarningTypeEnum,D as LoyaltyProgramPointHistoryTypeEnum,E as LoyaltyWidgetScreenTypeEnum,I as PeriodTypeEnum,R as WidgetMode};
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t,__spreadArray as n}from'./../ext/tslib/tslib.es6.mjs.js';import{toJS as r}from"mobx";import{observer as i}from"mobx-react";import o,{useState as s,useEffect as a}from"react";import'./../ext/react-i18next/dist/es/context.js';import{I18nextProvider as l}from'./../ext/react-i18next/dist/es/I18nextProvider.js';import{LoyaltyWidgetViewModel as c}from"../models/index.js";import{LoyaltyCustomerInfo as d}from"../models/loyalty-customer-info/index.js";import{LoyaltyProgramEarningMethod as u}from"../models/loyalty-program-earning-method/index.js";import{LoyaltyProgramPointHistory as f}from"../models/loyalty-program-point-history/index.js";import{LoyaltyProgramSpendingMethod as m}from"../models/loyalty-program-spending-method/index.js";import{LoyaltyWidget as v}from"../models/loyalty-widget/index.js";import{WidgetPositionEnum as g,LoyaltyWidgetLayoutTypeEnum as E}from"../models/loyalty-widget/types/index.js";import{WidgetMode as y,LoyaltyWidgetScreenTypeEnum as p,EarningMethodTypeEnum as h,LoyaltyProgramFilterTypeEnum as R,LoyaltyProgramMethodSpendingTypeEnum as T}from"../models/types/index.js";import I from"./components/mini-mode-button/index.js";import b from"./components/mini-mode-description/index.js";import w from"./screens/credit-earning-methods-screen/index.js";import M from"./screens/credit-history-screen/index.js";import k from"./screens/credit-spending-methods-screen/index.js";import _ from"./screens/loyalty-level-screen/index.js";import C from"./screens/main-screen/index.js";import S from"./utils/i18n.js";import{unflatten as N}from"./utils/object-utils.js";import{Container as A,MiniModeWrapper as O,Panel as D,ScreenWrapper as L}from"./style.js";var P=i(function(i){var P,j,x=i.config,U=s(function(){var e=x||window.ikasLoyaltyWidgetConfig;return new c({cartId:(null==e?void 0:e.cartId)||null,ikasEventUser:(null==e?void 0:e.userId)?{id:e.userId}:null},(null==e?void 0:e.cdnURL)||"",(null==e?void 0:e.merchantId)||"",(null==e?void 0:e.currency)||"",(null==e?void 0:e.storeURL)||null,null==e?void 0:e.isPreviewMode,null==e?void 0:e.callbacks)})[0],W=s(!1),$=W[0],G=W[1],B=s(!1),V=B[0],F=B[1],z=s(!1),Y=z[0],H=z[1],J=U.loyaltyWidget.translations,q=JSON.stringify(r(null==J?void 0:J.custom));a(function(){var e=null==J?void 0:J.language,t=(null==J?void 0:J.custom)?r(J.custom):{};if(e){var n=["tr","en","de","nl","fr"].includes(e)?e:"en";if(S.language!==n&&S.changeLanguage(n),Object.keys(t).length>0){var i=N(t);S.addResourceBundle(n,"translation",i,!0,!0)}}},[null==J?void 0:J.language,q]),a(function(){var e=x||window.ikasLoyaltyWidgetConfig;(null==e?void 0:e.onViewModelInitialized)&&e.onViewModelInitialized(U)},[U,x]);var K=function(){return e(void 0,void 0,void 0,function(){var e,r,i,o,s;return t(this,function(t){switch(t.label){case 0:return U.callbacks?(e=new Set,r=new Set,i=new Set,o=new Set,U.earningMethods.forEach(function(t){var s,a;t.methodType===h.ORDER_CREATE&&n(n([],(null===(s=t.orderSettings)||void 0===s?void 0:s.productFilters)||[],!0),(null===(a=t.productSettings)||void 0===a?void 0:a.productFilters)||[],!0).forEach(function(t){t.type===R.PRODUCT_AND_VARIANT?t.idList.forEach(function(t){return e.add(t)}):t.type===R.CATEGORY?t.idList.forEach(function(e){return r.add(e)}):t.type===R.PRODUCT_BRAND?t.idList.forEach(function(e){return i.add(e)}):t.type===R.PRODUCT_TAG&&t.idList.forEach(function(e){return o.add(e)})})}),U.spendingMethods&&U.spendingMethods.forEach(function(t){var n,s;t.type===T.FREE_PRODUCT&&(null===(n=t.discountSettings)||void 0===n?void 0:n.freeProductId)&&e.add(t.discountSettings.freeProductId),null===(s=t.productFilters)||void 0===s||s.forEach(function(t){t.type===R.PRODUCT_AND_VARIANT?t.idList.forEach(function(t){return e.add(t)}):t.type===R.CATEGORY?t.idList.forEach(function(e){return r.add(e)}):t.type===R.PRODUCT_BRAND?t.idList.forEach(function(e){return i.add(e)}):t.type===R.PRODUCT_TAG&&t.idList.forEach(function(e){return o.add(e)})})}),s=[],e.size>0&&U.callbacks.getProducts&&s.push(U.callbacks.getProducts(Array.from(e)).then(function(e){return U.products=e})),r.size>0&&U.callbacks.getCategories&&s.push(U.callbacks.getCategories(Array.from(r)).then(function(e){return U.categories=e})),i.size>0&&U.callbacks.getBrands&&s.push(U.callbacks.getBrands(Array.from(i)).then(function(e){return U.brands=e})),o.size>0&&U.callbacks.getTags&&s.push(U.callbacks.getTags(Array.from(o)).then(function(e){return U.tags=e})),[4,Promise.all(s)]):[2];case 1:return t.sent(),[2]}})})};a(function(){e(void 0,void 0,void 0,function(){var e,n,r,i,o,s;return t(this,function(t){switch(t.label){case 0:if(!U.callbacks)return[3,6];t.label=1;case 1:return t.trys.push([1,4,5,6]),e=[U.callbacks.getLoyaltyWidget(),U.callbacks.listEarningMethods(),U.callbacks.listLoyaltyProgramTier({})],[4,Promise.all(e)];case 2:return n=t.sent(),r=n[0],i=n[1],o=n[2],U.loyaltyWidget=r instanceof v?r:new v(r||{}),U.earningMethods=i.map(function(e){return new u(e)}),U.tiers=o||[],[4,K()];case 3:return t.sent(),[3,6];case 4:return s=t.sent(),console.error("Failed to initialize loyalty data",s),[3,6];case 5:return G(!0),[7];case 6:return[2]}})})},[]),a(function(){if(window.IkasEvents){var e=function(e){var t,n,r=null===(t=e.data)||void 0===t?void 0:t.customer,i=(null===(n=U.ikasEventUser)||void 0===n?void 0:n.id)===r.id;r&&!i&&(U.ikasEventUser=r,U.userRefreshTrigger++,U.cartRefreshTrigger++)},t=function(e){var t,n,r,i,o,s=U.cartId,a=null===(n=null===(t=e.data)||void 0===t?void 0:t.cart)||void 0===n?void 0:n.id;0===(null===(o=null===(i=null===(r=e.data)||void 0===r?void 0:r.cart)||void 0===i?void 0:i.orderLineItems)||void 0===o?void 0:o.length)?U.cartId=null:U.cartId=a,s!==U.cartId&&U.cartRefreshTrigger++},n={CUSTOMER_LOGIN:e,CUSTOMER_VISIT:e,CUSTOMER_LOGOUT:function(){U.userRefreshTrigger++,U.cartRefreshTrigger++},ADD_TO_CART:t,REMOVE_FROM_CART:t,REMOVE_LOYALTY_POINTS:function(e){U.cartRefreshTrigger++,U.userRefreshTrigger++},PAGE_VIEW:function(e){var t,n,r=null===(t=e.data)||void 0===t?void 0:t.customer;if(r){var i=!U.ikasEventUser,o=(null===(n=U.ikasEventUser)||void 0===n?void 0:n.subscriptionStatus)!==r.subscriptionStatus;(i||o)&&(U.ikasEventUser=r,U.userRefreshTrigger++,U.cartRefreshTrigger++)}}},r="ikas-loyalty-widget-subscriber";try{window.IkasEvents.subscribe({id:r,callback:function(e){var t=n[e.type];t&&t(e)}})}catch(e){console.error("Failed to subscribe to IkasEvents",e)}return function(){var e;(null===(e=window.IkasEvents)||void 0===e?void 0:e.unsubscribe)&&window.IkasEvents.unsubscribe(r)}}},[U]),a(function(){e(void 0,void 0,void 0,function(){var e,n,r,i,o;return t(this,function(t){switch(t.label){case 0:if(V)return[2];if(F(!0),!U.callbacks||!(null===(o=U.ikasEventUser)||void 0===o?void 0:o.id))return[3,4];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,Promise.all([U.callbacks.getLoyaltyCustomerInfo(),U.callbacks.listLoyaltyProgramPointHistory({})])];case 2:return e=t.sent(),n=e[0],r=e[1],U.user=n?new d(n):null,n||(U.ikasEventUser=null),U.pointHistory=r?r.map(function(e){return new f(e)}):[],[3,4];case 3:return i=t.sent(),console.error("Failed to fetch user data",i),[3,4];case 4:return F(!1),[2]}})})},[null===(P=U.ikasEventUser)||void 0===P?void 0:P.id,U.userRefreshTrigger]),a(function(){e(void 0,void 0,void 0,function(){var e,n;return t(this,function(t){switch(t.label){case 0:if(Y)return[2];if(H(!0),!U.callbacks)return[3,5];t.label=1;case 1:return t.trys.push([1,4,,5]),[4,U.callbacks.listSpendingMethodsByCartId(U.cartId)];case 2:return e=t.sent(),U.spendingMethods=e.map(function(e){return new m(e)}),[4,K()];case 3:return t.sent(),[3,5];case 4:return n=t.sent(),console.error("Failed to fetch cart data",n),[3,5];case 5:return H(!1),[2]}})})},[U.cartId,U.cartRefreshTrigger]);var Q=function(e){U.selectedScreen=e},X=function(){U.setWidgetMode(y.MINI_MODE),setTimeout(function(){U.selectedScreen=p.MAIN_SCREEN},300)};a(function(){return U.currentWidgetMode===y.WIDGET_MODE?document.body.style.overflow="hidden":document.body.style.overflow="",function(){document.body.style.overflow=""}},[U.currentWidgetMode]);var Z=U.selectedScreen===p.MAIN_SCREEN,ee=s(null),te=ee[0],ne=ee[1];a(function(){U.selectedScreen!==p.MAIN_SCREEN&&ne(U.selectedScreen)},[U.selectedScreen]);var re=Z?te:U.selectedScreen,ie=U.loyaltyWidget.settings.position||g.RIGHT,oe=U.loyaltyWidget.settings.type||E.DRAWER;if(!$)return null;var se=(null==x?void 0:x.position)||(null===(j=window.ikasLoyaltyWidgetConfig)||void 0===j?void 0:j.position)||"fixed";return o.createElement(l,{i18n:S},o.createElement(A,{$layoutType:oe,$widgetPosition:ie,$widgetMode:U.currentWidgetMode,$position:se,onClick:function(){U.currentWidgetMode===y.WIDGET_MODE&&X()},className:"ikas-storefront-widget"},o.createElement(O,{$isVisible:U.currentWidgetMode===y.MINI_MODE,$widgetPosition:ie},o.createElement(b,{viewModel:U,isInitialized:$}),o.createElement(I,{viewModel:U})),o.createElement(D,{$layoutType:oe,$isOpen:U.currentWidgetMode===y.WIDGET_MODE,$widgetPosition:ie,onClick:function(e){return e.stopPropagation()}},o.createElement(L,{$isActive:Z,$isMain:!0,$layoutType:oe},o.createElement(C,{viewModel:U,onClose:X,onNavigate:Q})),o.createElement(L,{$isActive:!Z,$isMain:!1,$layoutType:oe},function(){switch(re){case p.CREDIT_SPENDING_METHODS_SCREEN:return o.createElement(k,{viewModel:U,onBack:function(){return Q(p.MAIN_SCREEN)},onClose:X});case p.CREDIT_EARNING_METHODS_SCREEN:return o.createElement(w,{viewModel:U,onBack:function(){return Q(p.MAIN_SCREEN)},onClose:X});case p.CREDIT_HISTORY_SCREEN:return o.createElement(M,{viewModel:U,onBack:function(){return Q(p.MAIN_SCREEN)},onClose:X});case p.LOYALTY_LEVEL_SCREEN:return o.createElement(_,{viewModel:U,onBack:function(){return Q(p.MAIN_SCREEN)},onClose:X});default:return null}}()))))});export{P as default};
1
+ import{__awaiter as e,__generator as t,__spreadArray as n}from'./../ext/tslib/tslib.es6.mjs.js';import{toJS as r}from"mobx";import{observer as i}from"mobx-react";import o,{useState as s,useEffect as a}from"react";import'./../ext/react-i18next/dist/es/context.js';import{I18nextProvider as l}from'./../ext/react-i18next/dist/es/I18nextProvider.js';import{LoyaltyWidgetViewModel as c}from"../models/index.js";import{LoyaltyCustomerInfo as d}from"../models/loyalty-customer-info/index.js";import{LoyaltyProgramEarningMethod as u}from"../models/loyalty-program-earning-method/index.js";import{LoyaltyProgramPointHistory as f}from"../models/loyalty-program-point-history/index.js";import{LoyaltyProgramSpendingMethod as v}from"../models/loyalty-program-spending-method/index.js";import{LoyaltyWidget as m}from"../models/loyalty-widget/index.js";import{WidgetPositionEnum as g,LoyaltyWidgetLayoutTypeEnum as p}from"../models/loyalty-widget/types/index.js";import{WidgetMode as y,LoyaltyWidgetScreenTypeEnum as E,EarningMethodTypeEnum as h,LoyaltyProgramFilterTypeEnum as T,LoyaltyProgramMethodSpendingTypeEnum as R}from"../models/types/index.js";import b from"./components/mini-mode-button/index.js";import w from"./components/mini-mode-description/index.js";import k from"./screens/credit-earning-methods-screen/index.js";import I from"./screens/credit-history-screen/index.js";import M from"./screens/credit-spending-methods-screen/index.js";import _ from"./screens/gift-product-selection-screen/index.js";import C from"./screens/loyalty-level-screen/index.js";import S from"./screens/main-screen/index.js";import O from"./utils/i18n.js";import{unflatten as D}from"./utils/object-utils.js";import{Container as A,MiniModeWrapper as L,Panel as P,ScreenWrapper as j}from"./style.js";var x=i(function(i){var x,N,U=i.config,W=s(function(){var e=U||window.ikasLoyaltyWidgetConfig;return new c({cartId:(null==e?void 0:e.cartId)||null,ikasEventUser:(null==e?void 0:e.userId)?{id:e.userId}:null},(null==e?void 0:e.cdnURL)||"",(null==e?void 0:e.merchantId)||"",(null==e?void 0:e.currency)||"",(null==e?void 0:e.storeURL)||null,null==e?void 0:e.isPreviewMode,null==e?void 0:e.callbacks)})[0],$=s(!1),G=$[0],B=$[1],F=s(!1),V=F[0],z=F[1],Y=s(!1),H=Y[0],J=Y[1],q=W.loyaltyWidget.translations,K=JSON.stringify(r(null==q?void 0:q.custom));a(function(){var e=null==q?void 0:q.language,t=(null==q?void 0:q.custom)?r(q.custom):{};if(e){var n=["tr","en","de","nl","fr"].includes(e)?e:"en";if(O.language!==n&&O.changeLanguage(n),Object.keys(t).length>0){var i=D(t);O.addResourceBundle(n,"translation",i,!0,!0)}}},[null==q?void 0:q.language,K]),a(function(){var e=U||window.ikasLoyaltyWidgetConfig;(null==e?void 0:e.onViewModelInitialized)&&e.onViewModelInitialized(W)},[W,U]);var Q=function(){return e(void 0,void 0,void 0,function(){var e,r,i,o,s;return t(this,function(t){switch(t.label){case 0:return W.callbacks?(e=new Set,r=new Set,i=new Set,o=new Set,W.earningMethods.forEach(function(t){var s,a;t.methodType===h.ORDER_CREATE&&n(n([],(null===(s=t.orderSettings)||void 0===s?void 0:s.productFilters)||[],!0),(null===(a=t.productSettings)||void 0===a?void 0:a.productFilters)||[],!0).forEach(function(t){t.type===T.PRODUCT_AND_VARIANT?t.idList.forEach(function(t){return e.add(t)}):t.type===T.CATEGORY?t.idList.forEach(function(e){return r.add(e)}):t.type===T.PRODUCT_BRAND?t.idList.forEach(function(e){return i.add(e)}):t.type===T.PRODUCT_TAG&&t.idList.forEach(function(e){return o.add(e)})})}),W.spendingMethods&&W.spendingMethods.forEach(function(t){var n,s;t.type===R.FREE_PRODUCT&&(null===(n=t.discountSettings)||void 0===n?void 0:n.freeProductId)&&e.add(t.discountSettings.freeProductId),null===(s=t.productFilters)||void 0===s||s.forEach(function(t){t.type===T.PRODUCT_AND_VARIANT?t.idList.forEach(function(t){return e.add(t)}):t.type===T.CATEGORY?t.idList.forEach(function(e){return r.add(e)}):t.type===T.PRODUCT_BRAND?t.idList.forEach(function(e){return i.add(e)}):t.type===T.PRODUCT_TAG&&t.idList.forEach(function(e){return o.add(e)})})}),s=[],e.size>0&&W.callbacks.getProducts&&s.push(W.callbacks.getProducts(Array.from(e)).then(function(e){return W.products=e})),r.size>0&&W.callbacks.getCategories&&s.push(W.callbacks.getCategories(Array.from(r)).then(function(e){return W.categories=e})),i.size>0&&W.callbacks.getBrands&&s.push(W.callbacks.getBrands(Array.from(i)).then(function(e){return W.brands=e})),o.size>0&&W.callbacks.getTags&&s.push(W.callbacks.getTags(Array.from(o)).then(function(e){return W.tags=e})),[4,Promise.all(s)]):[2];case 1:return t.sent(),[2]}})})};a(function(){e(void 0,void 0,void 0,function(){var e,n,r,i,o,s;return t(this,function(t){switch(t.label){case 0:if(!W.callbacks)return[3,6];t.label=1;case 1:return t.trys.push([1,4,5,6]),e=[W.callbacks.getLoyaltyWidget(),W.callbacks.listEarningMethods(),W.callbacks.listLoyaltyProgramTier({})],[4,Promise.all(e)];case 2:return n=t.sent(),r=n[0],i=n[1],o=n[2],W.loyaltyWidget=r instanceof m?r:new m(r||{}),W.earningMethods=i.map(function(e){return new u(e)}),W.tiers=o||[],[4,Q()];case 3:return t.sent(),[3,6];case 4:return s=t.sent(),console.error("Failed to initialize loyalty data",s),[3,6];case 5:return B(!0),[7];case 6:return[2]}})})},[]),a(function(){if(window.IkasEvents){var e=function(e){var t,n,r=null===(t=e.data)||void 0===t?void 0:t.customer,i=(null===(n=W.ikasEventUser)||void 0===n?void 0:n.id)===r.id;r&&!i&&(W.ikasEventUser=r,W.userRefreshTrigger++,W.cartRefreshTrigger++)},t=function(e){var t,n,r,i,o,s=W.cartId,a=null===(n=null===(t=e.data)||void 0===t?void 0:t.cart)||void 0===n?void 0:n.id;0===(null===(o=null===(i=null===(r=e.data)||void 0===r?void 0:r.cart)||void 0===i?void 0:i.orderLineItems)||void 0===o?void 0:o.length)?W.cartId=null:W.cartId=a,s!==W.cartId&&W.cartRefreshTrigger++},n={CUSTOMER_LOGIN:e,CUSTOMER_VISIT:e,CUSTOMER_LOGOUT:function(){W.userRefreshTrigger++,W.cartRefreshTrigger++},ADD_TO_CART:t,REMOVE_FROM_CART:t,REMOVE_LOYALTY_POINTS:function(){W.cartRefreshTrigger++,W.userRefreshTrigger++},PAGE_VIEW:function(e){var t,n,r=null===(t=e.data)||void 0===t?void 0:t.customer;if(r){var i=!W.ikasEventUser,o=(null===(n=W.ikasEventUser)||void 0===n?void 0:n.subscriptionStatus)!==r.subscriptionStatus;(i||o)&&(W.ikasEventUser=r,W.userRefreshTrigger++,W.cartRefreshTrigger++)}}},r="ikas-loyalty-widget-subscriber";try{window.IkasEvents.subscribe({id:r,callback:function(e){var t=n[e.type];t&&t(e)}})}catch(e){console.error("Failed to subscribe to IkasEvents",e)}return function(){var e;(null===(e=window.IkasEvents)||void 0===e?void 0:e.unsubscribe)&&window.IkasEvents.unsubscribe(r)}}},[W]),a(function(){e(void 0,void 0,void 0,function(){var e,n,r,i,o;return t(this,function(t){switch(t.label){case 0:if(V)return[2];if(z(!0),!W.callbacks||!(null===(o=W.ikasEventUser)||void 0===o?void 0:o.id))return[3,4];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,Promise.all([W.callbacks.getLoyaltyCustomerInfo(),W.callbacks.listLoyaltyProgramPointHistory({})])];case 2:return e=t.sent(),n=e[0],r=e[1],W.user=n?new d(n):null,n||(W.ikasEventUser=null),W.pointHistory=r?r.map(function(e){return new f(e)}):[],[3,4];case 3:return i=t.sent(),console.error("Failed to fetch user data",i),[3,4];case 4:return z(!1),[2]}})})},[null===(x=W.ikasEventUser)||void 0===x?void 0:x.id,W.userRefreshTrigger]),a(function(){e(void 0,void 0,void 0,function(){var e,n;return t(this,function(t){switch(t.label){case 0:if(H)return[2];if(J(!0),!W.callbacks)return[3,5];t.label=1;case 1:return t.trys.push([1,4,,5]),[4,W.callbacks.listSpendingMethodsByCartId(W.cartId)];case 2:return e=t.sent(),W.spendingMethods=e.map(function(e){return new v(e)}),[4,Q()];case 3:return t.sent(),[3,5];case 4:return n=t.sent(),console.error("Failed to fetch cart data",n),[3,5];case 5:return J(!1),[2]}})})},[W.cartId,W.cartRefreshTrigger]);var X=function(){W.setWidgetMode(y.MINI_MODE),setTimeout(function(){W.resetNavigation()},300)};a(function(){return W.currentWidgetMode===y.WIDGET_MODE?document.body.style.overflow="hidden":document.body.style.overflow="",function(){document.body.style.overflow=""}},[W.currentWidgetMode]);var Z=s(null),ee=Z[0],te=Z[1],ne=s(null),re=ne[0],ie=ne[1],oe=W.navigationStack.length,se=oe>1?W.navigationStack[1]:null,ae=oe>2?W.navigationStack[2]:null;a(function(){se&&te(se)},[se]),a(function(){ae&&ie(ae)},[ae]);var le=W.loyaltyWidget.settings.position||g.RIGHT,ce=W.loyaltyWidget.settings.type||p.DRAWER,de=function(e){switch(e){case E.CREDIT_SPENDING_METHODS_SCREEN:return o.createElement(M,{viewModel:W,onBack:function(){return W.popScreen()},onClose:X});case E.CREDIT_EARNING_METHODS_SCREEN:return o.createElement(k,{viewModel:W,onBack:function(){return W.popScreen()},onClose:X});case E.CREDIT_HISTORY_SCREEN:return o.createElement(I,{viewModel:W,onBack:function(){return W.popScreen()},onClose:X});case E.LOYALTY_LEVEL_SCREEN:return o.createElement(C,{viewModel:W,onBack:function(){return W.popScreen()},onClose:X});case E.GIFT_PRODUCT_SELECTION_SCREEN:return o.createElement(_,{viewModel:W,onBack:function(){return W.popScreen()},onClose:X});default:return null}};if(!G)return null;var ue=(null==U?void 0:U.position)||(null===(N=window.ikasLoyaltyWidgetConfig)||void 0===N?void 0:N.position)||"fixed";return o.createElement(l,{i18n:O},o.createElement(A,{$layoutType:ce,$widgetPosition:le,$widgetMode:W.currentWidgetMode,$position:ue,onClick:function(){W.currentWidgetMode===y.WIDGET_MODE&&X()},className:"ikas-storefront-widget"},o.createElement(L,{$isVisible:W.currentWidgetMode===y.MINI_MODE,$widgetPosition:le},o.createElement(w,{viewModel:W,isInitialized:G}),o.createElement(b,{viewModel:W})),o.createElement(P,{$layoutType:ce,$isOpen:W.currentWidgetMode===y.WIDGET_MODE,$widgetPosition:le,onClick:function(e){return e.stopPropagation()}},o.createElement(j,{$isActive:W.isMainScreen,$layer:0,$layoutType:ce},o.createElement(S,{viewModel:W,onClose:X,onNavigate:function(e){return W.pushScreen(e)}})),o.createElement(j,{$isActive:!!se,$layer:1,$layoutType:ce},de(se||ee)),o.createElement(j,{$isActive:!!ae,$layer:2,$layoutType:ce},de(ae||re)))))});export{x as default};
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import { LoyaltyWidgetViewModel } from "models";
3
+ type Props = {
4
+ viewModel: LoyaltyWidgetViewModel;
5
+ onBack: () => void;
6
+ onClose: () => void;
7
+ };
8
+ declare const GiftProductSelectionScreen: React.FC<Props>;
9
+ export default GiftProductSelectionScreen;
@@ -0,0 +1 @@
1
+ import{__spreadArray as e,__awaiter as t,__generator as n}from'./../../../ext/tslib/tslib.es6.mjs.js';import{observer as l}from"mobx-react";import i,{useState as o}from"react";import'./../../../ext/react-i18next/dist/es/context.js';import{useTranslation as r}from'./../../../ext/react-i18next/dist/es/useTranslation.js';import{ChevronLeft as s}from"../../../assets/icons/chevron-left.js";import{XClose as a}from"../../../assets/icons/x-close.js";import{Album02 as d}from"../../../assets/widget-icons/normal/album02.js";import{Scenery as u}from"../../../assets/widget-icons/illustraions/scenery.js";import{WidgetIconTypeEnum as c}from"../../../models/loyalty-widget/types/index.js";import m from"../../components/button/index.js";import v from"../../components/count-up/index.js";import{getFreeProductMethods as f}from"../../utils/spending-method-utils.js";import{ProductCard as p,ProductCardContent as g,ProductImageContainer as E,ProductImage as y,ProductInfo as b,ProductNameContainer as h,ProductName as I,VariantText as j,PointBadge as S,Container as x,Header as P,IconButton as M,Title as w,Content as T,PointsSection as A,PointsTitle as R,PointsValue as k,ProductList as C}from"./style.js";var L=l(function(e){var l,s,a,v,f=e.method,x=e.viewModel,P=r().t,M=o(!1),w=M[0],T=M[1],A=x.loyaltyWidget,R=null===(l=f.discountSettings)||void 0===l?void 0:l.freeProductId,k=null===(s=f.discountSettings)||void 0===s?void 0:s.freeProductVariantId,C=R?x.products.find(function(e){return e.id===R}):null,L=k?null===(a=null==C?void 0:C.variants)||void 0===a?void 0:a.find(function(e){return e.id===k}):null,_=(null==L?void 0:L.mainImageSrc)||(null==C?void 0:C.mainImageSrc),W=(null==L?void 0:L.variantText)||null,z=(null===(v=f.discountSettings)||void 0===v?void 0:v.point)||0,B=A.settings.widgetIconType===c.ILLUSTRATION?u:d;return i.createElement(p,null,i.createElement(g,null,i.createElement(E,null,_?i.createElement(y,{src:_,alt:(null==C?void 0:C.name)||""}):i.createElement(B,null)),i.createElement(b,null,i.createElement(h,null,i.createElement(I,null,(null==C?void 0:C.name)||"-"),W&&i.createElement(j,null,W)),i.createElement(S,null,P("earningMethods.xPoints",{points:z})))),i.createElement(m,{button:A.button,paddingSize:"small",fontSize:"textSMMedium",onClick:function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:if(!x.cartId||!f.isAvailable)return[2];T(!0),t.label=1;case 1:return t.trys.push([1,,3,4]),[4,null===(e=x.callbacks)||void 0===e?void 0:e.useLoyaltyPoints({cartId:x.cartId,loyaltyProgramId:f.loyaltyProgramId,loyaltySpendingMethodId:f.id})];case 2:return t.sent()&&(x.userRefreshTrigger++,x.cartRefreshTrigger++,x.resetNavigation()),[3,4];case 3:return T(!1),[7];case 4:return[2]}})})},isLoading:w,disabled:!f.isAvailable||!x.cartId,fullWidth:!0},P("spendingMethods.FREE_PRODUCT.addFree")))}),_=l(function(t){var n=t.viewModel,l=t.onBack,o=t.onClose,d=r().t,u=n.user,c=f(n.spendingMethods),m=e([],c,!0).sort(function(e,t){var n,l;return e.isAvailable&&!t.isAvailable?-1:!e.isAvailable&&t.isAvailable?1:((null===(n=e.discountSettings)||void 0===n?void 0:n.point)||0)-((null===(l=t.discountSettings)||void 0===l?void 0:l.point)||0)});return i.createElement(x,null,i.createElement(P,null,i.createElement(M,{onClick:l},i.createElement(s,null)),i.createElement(w,null,d("screens.giftProductSelection")),i.createElement(M,{onClick:o},i.createElement(a,null))),i.createElement(T,null,u&&i.createElement(A,{$borderRadius:n.loyaltyWidget.settings.cartBorderRadius},i.createElement(R,null,d("header.earnedPoints")),i.createElement(k,null,i.createElement(v,{end:u.totalPoint}))),i.createElement(C,null,m.map(function(e){return i.createElement(L,{key:e.id,method:e,viewModel:n})}))))});export{_ as default};
@@ -0,0 +1,20 @@
1
+ export declare const Container: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export declare const Header: import("styled-components").StyledComponent<"div", any, {}, never>;
3
+ export declare const Title: import("styled-components").StyledComponent<"div", any, {}, never>;
4
+ export declare const IconButton: import("styled-components").StyledComponent<"button", any, {}, never>;
5
+ export declare const Content: import("styled-components").StyledComponent<"div", any, {}, never>;
6
+ export declare const PointsSection: import("styled-components").StyledComponent<"div", any, {
7
+ $borderRadius: number;
8
+ }, never>;
9
+ export declare const PointsTitle: import("styled-components").StyledComponent<"div", any, {}, never>;
10
+ export declare const PointsValue: import("styled-components").StyledComponent<"div", any, {}, never>;
11
+ export declare const ProductList: import("styled-components").StyledComponent<"div", any, {}, never>;
12
+ export declare const ProductCard: import("styled-components").StyledComponent<"div", any, {}, never>;
13
+ export declare const ProductCardContent: import("styled-components").StyledComponent<"div", any, {}, never>;
14
+ export declare const ProductImageContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
15
+ export declare const ProductImage: import("styled-components").StyledComponent<"img", any, {}, never>;
16
+ export declare const ProductInfo: import("styled-components").StyledComponent<"div", any, {}, never>;
17
+ export declare const ProductNameContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
18
+ export declare const ProductName: import("styled-components").StyledComponent<"div", any, {}, never>;
19
+ export declare const VariantText: import("styled-components").StyledComponent<"div", any, {}, never>;
20
+ export declare const PointBadge: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1 @@
1
+ import{__makeTemplateObject as n}from'./../../../ext/tslib/tslib.es6.mjs.js';import e from"styled-components";import{textMDMedium as o,textSMMedium as i,textXLSemiBold as d,textSM as r}from"../../components/style/typography.js";var t,p,l,f,a,x,c,s,g,b,u,y,m,h,v,w,k,j,z=e.div(t||(t=n(["\n display: flex;\n flex-direction: column;\n height: 100%;\n background-color: #ffffff;\n"],["\n display: flex;\n flex-direction: column;\n height: 100%;\n background-color: #ffffff;\n"]))),R=e.div(p||(p=n(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 20px;\n border-bottom: 1px solid #eef2f6;\n position: sticky;\n top: 0;\n background-color: #ffffff;\n z-index: 10;\n"],["\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 20px;\n border-bottom: 1px solid #eef2f6;\n position: sticky;\n top: 0;\n background-color: #ffffff;\n z-index: 10;\n"]))),$=e.div(l||(l=n(["\n ","\n color: #121926;\n text-align: center;\n flex: 1;\n"],["\n ","\n color: #121926;\n text-align: center;\n flex: 1;\n"])),o),_=e.button(f||(f=n(["\n background: none;\n border: none;\n cursor: pointer;\n padding: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #697586;\n\n &:hover {\n opacity: 0.8;\n }\n"],["\n background: none;\n border: none;\n cursor: pointer;\n padding: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #697586;\n\n &:hover {\n opacity: 0.8;\n }\n"]))),q=e.div(a||(a=n(["\n padding-top: 20px;\n padding-bottom: 20px;\n flex: 1;\n overflow-y: auto;\n"],["\n padding-top: 20px;\n padding-bottom: 20px;\n flex: 1;\n overflow-y: auto;\n"]))),A=e.div(x||(x=n(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 16px;\n border-radius: ",";\n border: 1px solid #eef2f6;\n background: #fff;\n box-shadow:\n 0 7px 2px 0 rgba(0, 0, 0, 0),\n 0 5px 2px 0 rgba(0, 0, 0, 0.01),\n 0 3px 2px 0 rgba(0, 0, 0, 0.02),\n 0 1px 1px 0 rgba(0, 0, 0, 0.03),\n 0 0 1px 0 rgba(0, 0, 0, 0.04);\n margin: 0 16px 20px 16px;\n"],["\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 16px;\n border-radius: ",";\n border: 1px solid #eef2f6;\n background: #fff;\n box-shadow:\n 0 7px 2px 0 rgba(0, 0, 0, 0),\n 0 5px 2px 0 rgba(0, 0, 0, 0.01),\n 0 3px 2px 0 rgba(0, 0, 0, 0.02),\n 0 1px 1px 0 rgba(0, 0, 0, 0.03),\n 0 0 1px 0 rgba(0, 0, 0, 0.04);\n margin: 0 16px 20px 16px;\n"])),function(n){var e=n.$borderRadius;return"".concat(e,"px")}),B=e.div(c||(c=n(["\n ","\n color: #121926;\n"],["\n ","\n color: #121926;\n"])),i),C=e.div(s||(s=n(["\n ","\n color: #121926;\n"],["\n ","\n color: #121926;\n"])),d),D=e.div(g||(g=n(["\n display: flex;\n flex-direction: column;\n gap: 12px;\n padding: 0 16px;\n"],["\n display: flex;\n flex-direction: column;\n gap: 12px;\n padding: 0 16px;\n"]))),E=e.div(b||(b=n(["\n display: flex;\n flex-direction: column;\n gap: 20px;\n padding: 12px;\n border-radius: 6px;\n border: 1px solid #eef2f6;\n"],["\n display: flex;\n flex-direction: column;\n gap: 20px;\n padding: 12px;\n border-radius: 6px;\n border: 1px solid #eef2f6;\n"]))),F=e.div(u||(u=n(["\n display: flex;\n gap: 12px;\n align-items: flex-start;\n"],["\n display: flex;\n gap: 12px;\n align-items: flex-start;\n"]))),G=e.div(y||(y=n(["\n width: 48px;\n height: 48px;\n min-width: 48px;\n border-radius: 6px;\n border: 1px solid #eef2f6;\n background-color: #f8fafc;\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n"],["\n width: 48px;\n height: 48px;\n min-width: 48px;\n border-radius: 6px;\n border: 1px solid #eef2f6;\n background-color: #f8fafc;\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n"]))),H=e.img(m||(m=n(["\n width: 100%;\n height: 100%;\n object-fit: cover;\n"],["\n width: 100%;\n height: 100%;\n object-fit: cover;\n"]))),I=e.div(h||(h=n(["\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: 1;\n min-width: 0;\n"],["\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: 1;\n min-width: 0;\n"]))),J=e.div(v||(v=n(["\n display: flex;\n flex-direction: column;\n gap: 2px;\n"],["\n display: flex;\n flex-direction: column;\n gap: 2px;\n"]))),K=e.div(w||(w=n(["\n ","\n color: #121926;\n word-break: break-word;\n"],["\n ","\n color: #121926;\n word-break: break-word;\n"])),i),L=e.div(k||(k=n(["\n ","\n color: #697586;\n"],["\n ","\n color: #697586;\n"])),r),M=e.div(j||(j=n(["\n display: inline-flex;\n padding: 2px 8px;\n justify-content: center;\n align-items: center;\n border-radius: 6px;\n border: 0.6px solid #cdd5df;\n opacity: 0.8;\n background: #f8fafc;\n ","\n color: #121926;\n width: fit-content;\n"],["\n display: inline-flex;\n padding: 2px 8px;\n justify-content: center;\n align-items: center;\n border-radius: 6px;\n border: 0.6px solid #cdd5df;\n opacity: 0.8;\n background: #f8fafc;\n ","\n color: #121926;\n width: fit-content;\n"])),r);export{z as Container,q as Content,R as Header,_ as IconButton,M as PointBadge,A as PointsSection,B as PointsTitle,C as PointsValue,E as ProductCard,F as ProductCardContent,H as ProductImage,G as ProductImageContainer,I as ProductInfo,D as ProductList,K as ProductName,J as ProductNameContainer,$ as Title,L as VariantText};
@@ -1 +1 @@
1
- import{__makeTemplateObject as n,__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.mjs.js';import{observer as o}from"mobx-react";import i,{useState as r,useEffect as a}from"react";import'./../../../../ext/react-i18next/dist/es/context.js';import{useTranslation as l}from'./../../../../ext/react-i18next/dist/es/useTranslation.js';import s from"styled-components";import{HeaderBackgroundTypeEnum as d}from"../../../../models/loyalty-widget/types/index.js";import{LoyaltyWidgetScreenTypeEnum as p}from"../../../../models/types/index.js";import u from"../../../components/button/index.js";import{textSM as c,Badge as f}from"../../../components/style/typography.js";var m,g,x,h,b,v,y,w,E,k,$,j,S=s.div(m||(m=n(["\n display: flex;\n padding: 12px 16px 16px 16px;\n flex-direction: column;\n align-items: flex-start;\n gap: 12px;\n align-self: stretch;\n border-radius: 6px;\n border: 1px solid #eef2f6;\n background: #f8fafc;\n"],["\n display: flex;\n padding: 12px 16px 16px 16px;\n flex-direction: column;\n align-items: flex-start;\n gap: 12px;\n align-self: stretch;\n border-radius: 6px;\n border: 1px solid #eef2f6;\n background: #f8fafc;\n"]))),C=s.div(g||(g=n(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n"],["\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n"]))),z=s.div(x||(x=n(["\n color: #364152;\n ","\n"],["\n color: #364152;\n ","\n"])),c),I=s.div(h||(h=n(["\n width: 100%;\n position: relative;\n padding-bottom: 16px; /* Space for markers */\n"],["\n width: 100%;\n position: relative;\n padding-bottom: 16px; /* Space for markers */\n"]))),M=s.div(b||(b=n(["\n position: relative;\n width: 100%;\n height: 24px;\n display: flex;\n align-items: center;\n cursor: pointer;\n"],["\n position: relative;\n width: 100%;\n height: 24px;\n display: flex;\n align-items: center;\n cursor: pointer;\n"]))),N=s.div(v||(v=n(["\n position: absolute;\n left: 0;\n right: 0;\n height: 6px;\n border-radius: 3px;\n background-color: #e3e8ef;\n"],["\n position: absolute;\n left: 0;\n right: 0;\n height: 6px;\n border-radius: 3px;\n background-color: #e3e8ef;\n"]))),A=s.div(y||(y=n(["\n position: absolute;\n left: 0;\n height: 6px;\n width: ","%;\n border-radius: 3px;\n background: ",";\n"],["\n position: absolute;\n left: 0;\n height: 6px;\n width: ","%;\n border-radius: 3px;\n background: ",";\n"])),function(n){return n.$percentage},function(n){return n.$isGradient?"radial-gradient(92.35% 100% at 50% 0%, rgba(255, 255, 255, 0.5) 0%, rgba(0, 0, 0, 0.5) 100%), ".concat(n.$bgColor):n.$bgColor}),L=s.div(w||(w=n(["\n position: absolute;\n left: ","%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 20px;\n height: 20px;\n border-radius: 50%;\n background: #ffffff;\n border: 2px solid ",";\n box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);\n z-index: 2;\n pointer-events: none; /* Let clicks pass through to input/container if needed, but input handles interaction */\n"],["\n position: absolute;\n left: ","%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 20px;\n height: 20px;\n border-radius: 50%;\n background: #ffffff;\n border: 2px solid ",";\n box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);\n z-index: 2;\n pointer-events: none; /* Let clicks pass through to input/container if needed, but input handles interaction */\n"])),function(n){return n.$left},function(n){return n.$bgColor}),_=s.input(E||(E=n(["\n position: absolute;\n width: 100%;\n height: 100%;\n opacity: 0;\n cursor: pointer;\n z-index: 3;\n margin: 0;\n"],["\n position: absolute;\n width: 100%;\n height: 100%;\n opacity: 0;\n cursor: pointer;\n z-index: 3;\n margin: 0;\n"]))),P=s.div(k||(k=n(["\n position: absolute;\n top: 28px; /* Below the slider track/thumb */\n left: 0;\n right: 0;\n display: flex;\n justify-content: space-between;\n pointer-events: none;\n"],["\n position: absolute;\n top: 28px; /* Below the slider track/thumb */\n left: 0;\n right: 0;\n display: flex;\n justify-content: space-between;\n pointer-events: none;\n"]))),R=s.div($||($=n(["\n font-size: 12px;\n color: #9aa4b2;\n font-weight: 400;\n line-height: 18px;\n"],["\n font-size: 12px;\n color: #9aa4b2;\n font-weight: 400;\n line-height: 18px;\n"]))),T=s.div(j||(j=n(["\n position: absolute;\n left: ","%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 4px;\n height: 4px;\n border-radius: 50%;\n background-color: #fff;\n z-index: 1;\n"],["\n position: absolute;\n left: ","%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 4px;\n height: 4px;\n border-radius: 50%;\n background-color: #fff;\n z-index: 1;\n"])),function(n){return n.$left}),F=o(function(n){var o=n.viewModel,s=n.method,c=l().t,m=r(!1),g=m[0],x=m[1],h=o.user,b=o.loyaltyWidget,v=s.discountSettings;if(!h||!v)return null;var y=v.point,w=v.discountAmount||0;if(y<=0)return null;var E=s.pointUsageLimit,k=(null==E?void 0:E.minPointLimit)||0,$=(null==E?void 0:E.maxPointLimit)||Number.MAX_SAFE_INTEGER,j=Math.min(h.totalPoint,$),F=Math.floor(j/y)*y,G=k>0?Math.ceil(k/y)*y:0,B=F>0?F:y,W=G,D=r(G),U=D[0],X=D[1];a(function(){U>F?X(F):U<G&&X(G)},[F,G]);var q=B-W,H=q>0?(U-W)/q*100:0,J=U/y*w,K=b.header.background.bgColor||"#7B61FF",O=b.header.background.type===d.GRADIENT,Q=q/y,V=[];if(Q>1&&Q<20)for(var Y=1;Y<Q;Y++)V.push(Y/Q*100);var Z=F>=G&&F>0&&!0===s.isAvailable;return i.createElement(i.Fragment,null,i.createElement(S,null,i.createElement(C,null,i.createElement(z,null,U," ",c("common.points")),i.createElement(f,null,o.formatCurrency(Number(J)))),i.createElement(I,null,i.createElement(M,null,i.createElement(N,null,V.map(function(n,e){return i.createElement(T,{key:e,$left:n})})),i.createElement(A,{$percentage:H,$bgColor:K,$isGradient:O}),i.createElement(L,{$left:H,$bgColor:K}),i.createElement(_,{type:"range",min:W,max:B,step:y,value:U,onChange:function(n){var e=Number(n.target.value);X(e)}})),i.createElement(P,null,i.createElement(R,null,W),i.createElement(R,null,B)))),i.createElement(u,{button:b.button,fontSize:"textSMMedium",paddingSize:"medium",fullWidth:!0,disabled:0===U||g||!Z,isLoading:g,onClick:function(){return e(void 0,void 0,void 0,function(){var n;return t(this,function(e){switch(e.label){case 0:if(!o.cartId||0===U)return[2];x(!0),e.label=1;case 1:return e.trys.push([1,,3,4]),[4,null===(n=o.callbacks)||void 0===n?void 0:n.useLoyaltyPoints({amount:U,cartId:o.cartId,loyaltyProgramId:s.loyaltyProgramId,loyaltySpendingMethodId:s.id})];case 2:return e.sent()&&(o.userRefreshTrigger++,o.cartRefreshTrigger++,o.selectedScreen!==p.MAIN_SCREEN&&(o.selectedScreen=p.MAIN_SCREEN)),[3,4];case 3:return x(!1),[7];case 4:return[2]}})})}},c("common.convert")))});export{F as default};
1
+ import{__makeTemplateObject as n,__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.mjs.js';import{observer as i}from"mobx-react";import o,{useState as r,useEffect as a}from"react";import'./../../../../ext/react-i18next/dist/es/context.js';import{useTranslation as l}from'./../../../../ext/react-i18next/dist/es/useTranslation.js';import s from"styled-components";import{HeaderBackgroundTypeEnum as d}from"../../../../models/loyalty-widget/types/index.js";import p from"../../../components/button/index.js";import{textSM as u,Badge as c}from"../../../components/style/typography.js";var f,m,g,h,x,b,v,y,w,k,E,$,j=s.div(f||(f=n(["\n display: flex;\n padding: 12px 16px 16px 16px;\n flex-direction: column;\n align-items: flex-start;\n gap: 12px;\n align-self: stretch;\n border-radius: 6px;\n border: 1px solid #eef2f6;\n background: #f8fafc;\n"],["\n display: flex;\n padding: 12px 16px 16px 16px;\n flex-direction: column;\n align-items: flex-start;\n gap: 12px;\n align-self: stretch;\n border-radius: 6px;\n border: 1px solid #eef2f6;\n background: #f8fafc;\n"]))),z=s.div(m||(m=n(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n"],["\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n"]))),C=s.div(g||(g=n(["\n color: #364152;\n ","\n"],["\n color: #364152;\n ","\n"])),u),M=s.div(h||(h=n(["\n width: 100%;\n position: relative;\n padding-bottom: 16px; /* Space for markers */\n"],["\n width: 100%;\n position: relative;\n padding-bottom: 16px; /* Space for markers */\n"]))),S=s.div(x||(x=n(["\n position: relative;\n width: 100%;\n height: 24px;\n display: flex;\n align-items: center;\n cursor: pointer;\n"],["\n position: relative;\n width: 100%;\n height: 24px;\n display: flex;\n align-items: center;\n cursor: pointer;\n"]))),I=s.div(b||(b=n(["\n position: absolute;\n left: 0;\n right: 0;\n height: 6px;\n border-radius: 3px;\n background-color: #e3e8ef;\n"],["\n position: absolute;\n left: 0;\n right: 0;\n height: 6px;\n border-radius: 3px;\n background-color: #e3e8ef;\n"]))),L=s.div(v||(v=n(["\n position: absolute;\n left: 0;\n height: 6px;\n width: ","%;\n border-radius: 3px;\n background: ",";\n"],["\n position: absolute;\n left: 0;\n height: 6px;\n width: ","%;\n border-radius: 3px;\n background: ",";\n"])),function(n){return n.$percentage},function(n){return n.$isGradient?"radial-gradient(92.35% 100% at 50% 0%, rgba(255, 255, 255, 0.5) 0%, rgba(0, 0, 0, 0.5) 100%), ".concat(n.$bgColor):n.$bgColor}),N=s.div(y||(y=n(["\n position: absolute;\n left: ","%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 20px;\n height: 20px;\n border-radius: 50%;\n background: #ffffff;\n border: 2px solid ",";\n box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);\n z-index: 2;\n pointer-events: none; /* Let clicks pass through to input/container if needed, but input handles interaction */\n"],["\n position: absolute;\n left: ","%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 20px;\n height: 20px;\n border-radius: 50%;\n background: #ffffff;\n border: 2px solid ",";\n box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);\n z-index: 2;\n pointer-events: none; /* Let clicks pass through to input/container if needed, but input handles interaction */\n"])),function(n){return n.$left},function(n){return n.$bgColor}),P=s.input(w||(w=n(["\n position: absolute;\n width: 100%;\n height: 100%;\n opacity: 0;\n cursor: pointer;\n z-index: 3;\n margin: 0;\n"],["\n position: absolute;\n width: 100%;\n height: 100%;\n opacity: 0;\n cursor: pointer;\n z-index: 3;\n margin: 0;\n"]))),A=s.div(k||(k=n(["\n position: absolute;\n top: 28px; /* Below the slider track/thumb */\n left: 0;\n right: 0;\n display: flex;\n justify-content: space-between;\n pointer-events: none;\n"],["\n position: absolute;\n top: 28px; /* Below the slider track/thumb */\n left: 0;\n right: 0;\n display: flex;\n justify-content: space-between;\n pointer-events: none;\n"]))),T=s.div(E||(E=n(["\n font-size: 12px;\n color: #9aa4b2;\n font-weight: 400;\n line-height: 18px;\n"],["\n font-size: 12px;\n color: #9aa4b2;\n font-weight: 400;\n line-height: 18px;\n"]))),_=s.div($||($=n(["\n position: absolute;\n left: ","%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 4px;\n height: 4px;\n border-radius: 50%;\n background-color: #fff;\n z-index: 1;\n"],["\n position: absolute;\n left: ","%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 4px;\n height: 4px;\n border-radius: 50%;\n background-color: #fff;\n z-index: 1;\n"])),function(n){return n.$left}),F=i(function(n){var i=n.viewModel,s=n.method,u=l().t,f=r(!1),m=f[0],g=f[1],h=i.user,x=i.loyaltyWidget,b=s.discountSettings;if(!h||!b)return null;var v=b.point,y=b.discountAmount||0;if(v<=0)return null;var w=s.pointUsageLimit,k=(null==w?void 0:w.minPointLimit)||0,E=(null==w?void 0:w.maxPointLimit)||Number.MAX_SAFE_INTEGER,$=Math.min(h.totalPoint,E),F=Math.floor($/v)*v,G=k>0?Math.ceil(k/v)*v:0,R=F>0?F:v,B=G,W=r(G),D=W[0],U=W[1];a(function(){D>F?U(F):D<G&&U(G)},[F,G]);var X=R-B,q=X>0?(D-B)/X*100:0,H=D/v*y,J=x.header.background.bgColor||"#7B61FF",K=x.header.background.type===d.GRADIENT,O=X/v,Q=[];if(O>1&&O<20)for(var V=1;V<O;V++)Q.push(V/O*100);var Y=F>=G&&F>0&&!0===s.isAvailable;return o.createElement(o.Fragment,null,o.createElement(j,null,o.createElement(z,null,o.createElement(C,null,D," ",u("common.points")),o.createElement(c,null,i.formatCurrency(Number(H)))),o.createElement(M,null,o.createElement(S,null,o.createElement(I,null,Q.map(function(n,e){return o.createElement(_,{key:e,$left:n})})),o.createElement(L,{$percentage:q,$bgColor:J,$isGradient:K}),o.createElement(N,{$left:q,$bgColor:J}),o.createElement(P,{type:"range",min:B,max:R,step:v,value:D,onChange:function(n){var e=Number(n.target.value);U(e)}})),o.createElement(A,null,o.createElement(T,null,B),o.createElement(T,null,R)))),o.createElement(p,{button:x.button,fontSize:"textSMMedium",paddingSize:"medium",fullWidth:!0,disabled:0===D||m||!Y,isLoading:m,onClick:function(){return e(void 0,void 0,void 0,function(){var n;return t(this,function(e){switch(e.label){case 0:if(!i.cartId||0===D)return[2];g(!0),e.label=1;case 1:return e.trys.push([1,,3,4]),[4,null===(n=i.callbacks)||void 0===n?void 0:n.useLoyaltyPoints({amount:D,cartId:i.cartId,loyaltyProgramId:s.loyaltyProgramId,loyaltySpendingMethodId:s.id})];case 2:return e.sent()&&(i.userRefreshTrigger++,i.cartRefreshTrigger++,i.isMainScreen||i.resetNavigation()),[3,4];case 3:return g(!1),[7];case 4:return[2]}})})}},u("common.convert")))});export{F as default};
@@ -1 +1 @@
1
- import{__spreadArray as e,__awaiter as t,__generator as i}from'./../../../../ext/tslib/tslib.es6.mjs.js';import{observer as n}from"mobx-react";import o,{useState as r,useMemo as d}from"react";import'./../../../../ext/react-i18next/dist/es/context.js';import{useTranslation as a}from'./../../../../ext/react-i18next/dist/es/useTranslation.js';import{LoyaltyProgramMethodSpendingTypeEnum as l,LoyaltyProgramFilterTypeEnum as s,LoyaltyWidgetScreenTypeEnum as c}from"../../../../models/types/index.js";import m from"../../../components/button/index.js";import u from"../../../components/loyalty-method-card/index.js";import{getFreeProductName as p,getFilterDetails as g}from"../../../utils/loyalty-details.js";import{getSpendingMethodTitle as y,getSpendingMethodDescription as f,getSpendingMethodIcon as v}from"../../../../utils.js";import E from"./dynamic-slider.js";var h=n(function(e){var n,h,x=e.method,R=e.viewModel,A=e.actionText,b=e.padding,T=e.onClick,C=e.mode,D=a().t,S=r(!1),I=S[0],M=S[1],_=R.loyaltyWidget,O=y(x),P=f(x,R),k=v(x.type,_.settings.widgetIconType),j=x.productFilters||[],w=x.type===l.FREE_PRODUCT,B=w&&(null===(n=x.discountSettings)||void 0===n?void 0:n.freeProductId)?p(R,x.discountSettings.freeProductId):void 0,N=w&&!!B,L=null===(h=x.pointUsageLimit)||void 0===h?void 0:h.minPointLimit,U=!x.isDynamic&&!!R.user&&!!R.cartId,z=x.isDynamic&&!!R.user&&!!R.cartId,W=x.isDynamic,F=d(function(){return j.map(function(e){var t=g(R,e.type,e.idList);if(!t.length)return null;var i=t[0],n=i.name,o="";switch(i.type){case s.CATEGORY:case s.DYNAMIC_CATEGORY:o=D("earningMethods.ORDER_CREATE.BASE.descriptionOnlyCategory",{category:n});break;case s.PRODUCT_AND_VARIANT:o=D("earningMethods.ORDER_CREATE.BASE.descriptionOnlyProduct",{product:n});break;case s.PRODUCT_BRAND:o=D("earningMethods.ORDER_CREATE.BASE.descriptionOnlyBrand",{brand:n});break;case s.PRODUCT_TAG:o=D("earningMethods.ORDER_CREATE.BASE.descriptionOnlyTag",{tag:n})}return!o&&n&&(o=n),o||null}).filter(Boolean)},[j,R,D]),G=F.length>0,H="accordion"===C?!!(L&&L>0)||N||G||z||U&&!W?"accordion":"card":W&&z?"accordion":"card",Y=function(){return t(void 0,void 0,void 0,function(){var e;return i(this,function(t){switch(t.label){case 0:if(!R.cartId||!x.isAvailable)return[2];M(!0),t.label=1;case 1:return t.trys.push([1,,3,4]),[4,null===(e=R.callbacks)||void 0===e?void 0:e.useLoyaltyPoints({cartId:R.cartId,loyaltyProgramId:x.loyaltyProgramId,loyaltySpendingMethodId:x.id})];case 2:return t.sent()&&(R.userRefreshTrigger++,R.cartRefreshTrigger++,R.selectedScreen!==c.MAIN_SCREEN&&(R.selectedScreen=c.MAIN_SCREEN)),[3,4];case 3:return M(!1),[7];case 4:return[2]}})})},V="card"===H&&U&&!W?{text:D("common.use"),onClick:Y,loading:I}:A&&T?{text:A,onClick:T}:void 0;return o.createElement(u,{title:O,description:P,icon:k,action:V,isCompleted:!1,mode:H,padding:b,settings:{borderRadius:_.settings.cartBorderRadius,widgetIconType:_.settings.widgetIconType,button:_.button}},"accordion"!==H?null:o.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},L&&L>0&&o.createElement("div",{style:{fontSize:"14px",color:"#475467",lineHeight:"20px",fontWeight:400}},D("spendingMethods.minPointLimit",{points:L})),N&&o.createElement("div",{style:{fontSize:"14px",color:"#475467",lineHeight:"20px",fontWeight:400}},D("spendingMethods.FREE_PRODUCT.description",{product:B})),F.map(function(e,t){return o.createElement("div",{key:t,style:{fontSize:"14px",color:"#475467",lineHeight:"20px",fontWeight:400}},e)}),z&&o.createElement(E,{viewModel:R,method:x}),U&&!W&&o.createElement("div",{style:{alignSelf:"flex-end",width:"100%"}},o.createElement(m,{button:_.button,paddingSize:"small",fontSize:"textSMMedium",onClick:Y,isLoading:I,disabled:!x.isAvailable,fullWidth:!0},D("common.use")))))}),x=n(function(t){var i=t.viewModel,n=t.mode,r=void 0===n?"card":n,d=t.getActionProps,a=t.methods,l=i.spendingMethods,s=e([],a||l,!0).sort(function(e,t){return e.isAvailable&&!t.isAvailable?-1:!e.isAvailable&&t.isAvailable?1:e.isDynamic&&!t.isDynamic?-1:!e.isDynamic&&t.isDynamic?1:0}),c="accordion"===r?"16px":void 0;return o.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"12px",padding:"0 16px"}},s.map(function(e){var t=d?d(e):null;return o.createElement(h,{key:e.id,method:e,viewModel:i,mode:r,padding:c,actionText:null==t?void 0:t.actionText,onClick:null==t?void 0:t.onClick})}))});export{x as default};
1
+ import{__makeTemplateObject as e,__spreadArray as t,__awaiter as i,__generator as n}from'./../../../../ext/tslib/tslib.es6.mjs.js';import{observer as o}from"mobx-react";import r,{useState as d,useMemo as s}from"react";import'./../../../../ext/react-i18next/dist/es/context.js';import{useTranslation as a}from'./../../../../ext/react-i18next/dist/es/useTranslation.js';import l from"styled-components";import{LoyaltyProgramMethodSpendingTypeEnum as c,LoyaltyProgramFilterTypeEnum as m,LoyaltyWidgetScreenTypeEnum as p}from"../../../../models/types/index.js";import u from"../../../components/button/index.js";import g from"../../../components/loyalty-method-card/index.js";import{textSM as y}from"../../../components/style/typography.js";import{getFreeProductName as E,getFilterDetails as f}from"../../../utils/loyalty-details.js";import{getFreeProductPointRange as v,hasAvailableFreeProduct as R,getFreeProductMethods as h,getNonFreeProductMethods as T}from"../../../utils/spending-method-utils.js";import{getSpendingMethodTitle as x,getSpendingMethodDescription as C,getSpendingMethodIcon as D}from"../../../../utils.js";import P from"./dynamic-slider.js";var b,A=l.span(b||(b=e(["\n ","\n color: #364152;\n"],["\n ","\n color: #364152;\n"])),y),M=o(function(e){var t,o,l=e.method,p=e.viewModel,y=e.actionText,v=e.padding,R=e.onClick,h=e.mode,T=a().t,b=d(!1),A=b[0],M=b[1],O=p.loyaltyWidget,_=x(l),I=C(l,p),S=D(l.type,O.settings.widgetIconType),w=l.productFilters||[],k=l.type===c.FREE_PRODUCT,j=k&&(null===(t=l.discountSettings)||void 0===t?void 0:t.freeProductId)?E(p,l.discountSettings.freeProductId):void 0,U=k&&!!j,B=null===(o=l.pointUsageLimit)||void 0===o?void 0:o.minPointLimit,F=!l.isDynamic&&!!p.user&&!!p.cartId,L=l.isDynamic&&!!p.user&&!!p.cartId,N=l.isDynamic,W=s(function(){return w.map(function(e){var t=f(p,e.type,e.idList);if(!t.length)return null;var i=t[0],n=i.name,o="";switch(i.type){case m.CATEGORY:case m.DYNAMIC_CATEGORY:o=T("earningMethods.ORDER_CREATE.BASE.descriptionOnlyCategory",{category:n});break;case m.PRODUCT_AND_VARIANT:o=T("earningMethods.ORDER_CREATE.BASE.descriptionOnlyProduct",{product:n});break;case m.PRODUCT_BRAND:o=T("earningMethods.ORDER_CREATE.BASE.descriptionOnlyBrand",{brand:n});break;case m.PRODUCT_TAG:o=T("earningMethods.ORDER_CREATE.BASE.descriptionOnlyTag",{tag:n})}return!o&&n&&(o=n),o||null}).filter(Boolean)},[w,p,T]),z=W.length>0,G="accordion"===h?!!(B&&B>0)||U||z||L||F&&!N?"accordion":"card":N&&L?"accordion":"card",H=function(){return i(void 0,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:if(!p.cartId||!l.isAvailable)return[2];M(!0),t.label=1;case 1:return t.trys.push([1,,3,4]),[4,null===(e=p.callbacks)||void 0===e?void 0:e.useLoyaltyPoints({cartId:p.cartId,loyaltyProgramId:l.loyaltyProgramId,loyaltySpendingMethodId:l.id})];case 2:return t.sent()&&(p.userRefreshTrigger++,p.cartRefreshTrigger++,p.isMainScreen||p.resetNavigation()),[3,4];case 3:return M(!1),[7];case 4:return[2]}})})},Y="card"===G&&F&&!N?{text:T("common.use"),onClick:H,loading:A}:y&&R?{text:y,onClick:R}:void 0;return r.createElement(g,{title:_,description:I,icon:S,action:Y,isCompleted:!1,mode:G,padding:v,settings:{borderRadius:O.settings.cartBorderRadius,widgetIconType:O.settings.widgetIconType,button:O.button}},"accordion"!==G?null:r.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},B&&B>0&&r.createElement("div",{style:{fontSize:"14px",color:"#475467",lineHeight:"20px",fontWeight:400}},T("spendingMethods.minPointLimit",{points:B})),U&&r.createElement("div",{style:{fontSize:"14px",color:"#475467",lineHeight:"20px",fontWeight:400}},T("spendingMethods.FREE_PRODUCT.description",{product:j})),W.map(function(e,t){return r.createElement("div",{key:t,style:{fontSize:"14px",color:"#475467",lineHeight:"20px",fontWeight:400}},e)}),L&&r.createElement(P,{viewModel:p,method:l}),F&&!N&&r.createElement("div",{style:{alignSelf:"flex-end",width:"100%"}},r.createElement(u,{button:O.button,paddingSize:"small",fontSize:"textSMMedium",onClick:H,isLoading:A,disabled:!l.isAvailable,fullWidth:!0},T("common.use")))))}),O=o(function(e){var t=e.methods,i=e.viewModel;e.mode;var n=e.padding,o=a().t,d=i.loyaltyWidget,s=v(t);if(R(t),!s)return null;var l=s.minPoint===s.maxPoint?r.createElement(A,null,o("spendingMethods.FREE_PRODUCT.singleDescription",{points:s.minPoint})):r.createElement(A,null,o("spendingMethods.FREE_PRODUCT.groupedDescription",{minPoint:s.minPoint,maxPoint:s.maxPoint})),m=D(c.FREE_PRODUCT,d.settings.widgetIconType),u=!!i.user&&!!i.cartId?{text:o("spendingMethods.FREE_PRODUCT.selectGift"),onClick:function(){i.pushScreen(p.GIFT_PRODUCT_SELECTION_SCREEN)}}:void 0;return r.createElement(g,{title:o("spendingMethods.FREE_PRODUCT.title"),description:l,icon:m,action:u,isCompleted:!1,mode:"card",padding:n,settings:{borderRadius:d.settings.cartBorderRadius,widgetIconType:d.settings.widgetIconType,button:d.button}})}),_=o(function(e){var i=e.viewModel,n=e.mode,o=void 0===n?"card":n,d=e.getActionProps,s=e.methods,a=i.spendingMethods,l=s||a,c=h(l),m=T(l),p=t([],m,!0).sort(function(e,t){return e.isAvailable&&!t.isAvailable?-1:!e.isAvailable&&t.isAvailable?1:e.isDynamic&&!t.isDynamic?-1:!e.isDynamic&&t.isDynamic?1:0}),u="accordion"===o?"16px":void 0;return R(c),r.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"12px",padding:"0 16px"}},p.map(function(e){var t=d?d(e):null;return r.createElement(M,{key:e.id,method:e,viewModel:i,mode:o,padding:u,actionText:null==t?void 0:t.actionText,onClick:null==t?void 0:t.onClick})}),c.length>0&&r.createElement(O,{methods:c,viewModel:i,mode:o,padding:u}))});export{_ as default};
@@ -13,7 +13,7 @@ export declare const Panel: import("styled-components").StyledComponent<"div", a
13
13
  }, never>;
14
14
  export declare const ScreenWrapper: import("styled-components").StyledComponent<"div", any, {
15
15
  $isActive: boolean;
16
- $isMain: boolean;
16
+ $layer: number;
17
17
  $layoutType: LoyaltyWidgetLayoutTypeEnum;
18
18
  }, never>;
19
19
  export declare const MiniModeWrapper: import("styled-components").StyledComponent<"div", any, {
@@ -1 +1 @@
1
- import{__makeTemplateObject as n}from'./../ext/tslib/tslib.es6.mjs.js';import t,{css as o}from"styled-components";import{WidgetPositionEnum as i,LoyaltyWidgetLayoutTypeEnum as e}from"../models/loyalty-widget/types/index.js";import{WidgetMode as r}from"../models/types/index.js";var a,s,d,l,p,x,h,b,f,c,u,m,g,w,v=t.div(a||(a=n(["\n position: ",";\n position: ",";\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n\n width: 100%;\n height: ",";\n max-height: ",";\n overflow: hidden; /* Prevent scrollbars from absolute children */\n background-color: ",";\n transition: background-color 0.3s ease-in-out;\n z-index: 2147483647;\n pointer-events: ",";\n\n /* Ensure children are clickable in Mini Mode */\n & > * {\n pointer-events: auto;\n }\n\n /* Global scrollbar styling for all children */\n & * {\n scrollbar-width: thin;\n scrollbar-color: #cdd5df transparent;\n }\n\n & *::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n }\n\n & *::-webkit-scrollbar-track {\n background: transparent;\n }\n\n & *::-webkit-scrollbar-thumb {\n background-color: #cdd5df !important;\n border-radius: 8px;\n }\n"],["\n position: ",";\n position: ",";\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n\n width: 100%;\n height: ",";\n max-height: ",";\n overflow: hidden; /* Prevent scrollbars from absolute children */\n background-color: ",";\n transition: background-color 0.3s ease-in-out;\n z-index: 2147483647;\n pointer-events: ",";\n\n /* Ensure children are clickable in Mini Mode */\n & > * {\n pointer-events: auto;\n }\n\n /* Global scrollbar styling for all children */\n & * {\n scrollbar-width: thin;\n scrollbar-color: #cdd5df transparent;\n }\n\n & *::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n }\n\n & *::-webkit-scrollbar-track {\n background: transparent;\n }\n\n & *::-webkit-scrollbar-thumb {\n background-color: #cdd5df !important;\n border-radius: 8px;\n }\n"])),function(n){return n.$position||"fixed"},function(n){return n.$position||"fixed"},function(n){return"absolute"===n.$position?"100%":"100dvh"},function(n){return"absolute"===n.$position?"100%":"100dvh"},function(n){return n.$widgetMode===r.MINI_MODE?"transparent":"rgba(0, 0, 0, 0.5)"},function(n){return n.$widgetMode===r.MINI_MODE?"none":"auto"}),y=t.div(l||(l=n(["\n position: absolute;\n top: 0;\n ","\n display: block;\n width: 100%;\n max-width: 400px;\n height: 100%;\n background-color: #ffffff;\n overflow: hidden;\n\n /* Animation props */\n transform: ",";\n transition:\n transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),\n opacity 0.3s ease-in-out;\n opacity: ",";\n pointer-events: ",";\n\n ","\n\n @media (max-width: 600px) {\n max-width: 100%;\n }\n"],["\n position: absolute;\n top: 0;\n ","\n display: block;\n width: 100%;\n max-width: 400px;\n height: 100%;\n background-color: #ffffff;\n overflow: hidden;\n\n /* Animation props */\n transform: ",";\n transition:\n transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),\n opacity 0.3s ease-in-out;\n opacity: ",";\n pointer-events: ",";\n\n ","\n\n @media (max-width: 600px) {\n max-width: 100%;\n }\n"])),function(n){return n.$widgetPosition===i.LEFT?"left: 0;":"right: 0;"},function(n){var t=n.$isOpen,o=n.$widgetPosition;return t?"translateX(0%)":o===i.LEFT?"translateX(-100%)":"translateX(100%)"},function(n){return n.$isOpen?1:0},function(n){return n.$isOpen?"auto":"none"},function(t){return t.$layoutType===e.DRAWER?o(s||(s=n(["\n border-radius: 0;\n box-shadow: -2px 0 8px rgba(36, 30, 30, 0.15);\n\n @media (max-width: 600px) {\n max-width: 100%;\n height: 100%;\n }\n "],["\n border-radius: 0;\n box-shadow: -2px 0 8px rgba(36, 30, 30, 0.15);\n\n @media (max-width: 600px) {\n max-width: 100%;\n height: 100%;\n }\n "]))):o(d||(d=n(["\n border-radius: 12px;\n box-shadow:\n 0 136px 38px 0 rgba(0, 0, 0, 0),\n 0 87px 35px 0 rgba(0, 0, 0, 0.01),\n 0 49px 29px 0 rgba(0, 0, 0, 0.02),\n 0 22px 22px 0 rgba(0, 0, 0, 0.04),\n 0 5px 12px 0 rgba(0, 0, 0, 0.04);\n max-height: calc(100% - 32px);\n overflow-y: hidden;\n display: flex;\n flex-direction: column;\n top: auto;\n bottom: 16px;\n margin: 0 16px;\n height: auto;\n\n @media (max-width: 600px) {\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n width: 100%;\n height: 100%;\n max-width: none;\n max-height: none;\n margin: 0;\n border-radius: 0;\n }\n "],["\n border-radius: 12px;\n box-shadow:\n 0 136px 38px 0 rgba(0, 0, 0, 0),\n 0 87px 35px 0 rgba(0, 0, 0, 0.01),\n 0 49px 29px 0 rgba(0, 0, 0, 0.02),\n 0 22px 22px 0 rgba(0, 0, 0, 0.04),\n 0 5px 12px 0 rgba(0, 0, 0, 0.04);\n max-height: calc(100% - 32px);\n overflow-y: hidden;\n display: flex;\n flex-direction: column;\n top: auto;\n bottom: 16px;\n margin: 0 16px;\n height: auto;\n\n @media (max-width: 600px) {\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n width: 100%;\n height: 100%;\n max-width: none;\n max-height: none;\n margin: 0;\n border-radius: 0;\n }\n "])))}),k=t.div(g||(g=n(["\n width: 100%;\n background-color: #ffffff;\n transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);\n overflow: hidden;\n padding-bottom: env(safe-area-inset-bottom);\n display: flex;\n flex-direction: column;\n\n ","\n"],["\n width: 100%;\n background-color: #ffffff;\n transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);\n overflow: hidden;\n padding-bottom: env(safe-area-inset-bottom);\n display: flex;\n flex-direction: column;\n\n ","\n"])),function(t){var i=t.$isActive,r=t.$isMain;return t.$layoutType===e.DRAWER?o(h||(h=n(["\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n\n ","\n "],["\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n\n ","\n "])),r?o(p||(p=n(["\n transform: translateX(0%);\n z-index: 1;\n "],["\n transform: translateX(0%);\n z-index: 1;\n "]))):o(x||(x=n(["\n transform: translateX(",");\n z-index: 2;\n box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);\n "],["\n transform: translateX(",");\n z-index: 2;\n box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);\n "])),i?"0%":"100%")):o(m||(m=n(["\n ","\n\n ","\n "],["\n ","\n\n ","\n "])),o(r?b||(b=n(["\n position: relative;\n height: auto;\n max-height: 100%;\n "],["\n position: relative;\n height: auto;\n max-height: 100%;\n "])):f||(f=n(["\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n overflow-y: auto;\n "],["\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n overflow-y: auto;\n "]))),r?o(c||(c=n(["\n transform: translateX(0%);\n z-index: 1;\n "],["\n transform: translateX(0%);\n z-index: 1;\n "]))):o(u||(u=n(["\n transform: translateX(",");\n z-index: 2;\n box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);\n "],["\n transform: translateX(",");\n z-index: 2;\n box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);\n "])),i?"0%":"100%"))}),$=t.div(w||(w=n(["\n position: absolute;\n bottom: 20px;\n ","\n display: flex;\n flex-direction: column;\n align-items: ",";\n transition:\n opacity 0.2s ease-in-out,\n transform 0.2s ease-in-out;\n opacity: ",";\n transform: ",";\n pointer-events: ",";\n"],["\n position: absolute;\n bottom: 20px;\n ","\n display: flex;\n flex-direction: column;\n align-items: ",";\n transition:\n opacity 0.2s ease-in-out,\n transform 0.2s ease-in-out;\n opacity: ",";\n transform: ",";\n pointer-events: ",";\n"])),function(n){return n.$widgetPosition===i.LEFT?"left: 20px;":"right: 20px;"},function(n){return n.$widgetPosition===i.LEFT?"flex-start":"flex-end"},function(n){return n.$isVisible?1:0},function(n){return n.$isVisible?"translateY(0)":"translateY(10px)"},function(n){return n.$isVisible?"auto":"none"});export{v as Container,$ as MiniModeWrapper,y as Panel,k as ScreenWrapper};
1
+ import{__makeTemplateObject as n}from'./../ext/tslib/tslib.es6.mjs.js';import t,{css as o}from"styled-components";import{WidgetPositionEnum as i,LoyaltyWidgetLayoutTypeEnum as e}from"../models/loyalty-widget/types/index.js";import{WidgetMode as r}from"../models/types/index.js";var a,s,d,l,p,x,h,b,f,c,u,m,g,w,v=t.div(a||(a=n(["\n position: ",";\n position: ",";\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n\n width: 100%;\n height: ",";\n max-height: ",";\n overflow: hidden; /* Prevent scrollbars from absolute children */\n background-color: ",";\n transition: background-color 0.3s ease-in-out;\n z-index: 2147483647;\n pointer-events: ",";\n\n /* Ensure children are clickable in Mini Mode */\n & > * {\n pointer-events: auto;\n }\n\n /* Global scrollbar styling for all children */\n & * {\n scrollbar-width: thin;\n scrollbar-color: #cdd5df transparent;\n }\n\n & *::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n }\n\n & *::-webkit-scrollbar-track {\n background: transparent;\n }\n\n & *::-webkit-scrollbar-thumb {\n background-color: #cdd5df !important;\n border-radius: 8px;\n }\n"],["\n position: ",";\n position: ",";\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n\n width: 100%;\n height: ",";\n max-height: ",";\n overflow: hidden; /* Prevent scrollbars from absolute children */\n background-color: ",";\n transition: background-color 0.3s ease-in-out;\n z-index: 2147483647;\n pointer-events: ",";\n\n /* Ensure children are clickable in Mini Mode */\n & > * {\n pointer-events: auto;\n }\n\n /* Global scrollbar styling for all children */\n & * {\n scrollbar-width: thin;\n scrollbar-color: #cdd5df transparent;\n }\n\n & *::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n }\n\n & *::-webkit-scrollbar-track {\n background: transparent;\n }\n\n & *::-webkit-scrollbar-thumb {\n background-color: #cdd5df !important;\n border-radius: 8px;\n }\n"])),function(n){return n.$position||"fixed"},function(n){return n.$position||"fixed"},function(n){return"absolute"===n.$position?"100%":"100dvh"},function(n){return"absolute"===n.$position?"100%":"100dvh"},function(n){return n.$widgetMode===r.MINI_MODE?"transparent":"rgba(0, 0, 0, 0.5)"},function(n){return n.$widgetMode===r.MINI_MODE?"none":"auto"}),y=t.div(l||(l=n(["\n position: absolute;\n top: 0;\n ","\n display: block;\n width: 100%;\n max-width: 400px;\n height: 100%;\n background-color: #ffffff;\n overflow: hidden;\n\n /* Animation props */\n transform: ",";\n transition:\n transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),\n opacity 0.3s ease-in-out;\n opacity: ",";\n pointer-events: ",";\n\n ","\n\n @media (max-width: 600px) {\n max-width: 100%;\n }\n"],["\n position: absolute;\n top: 0;\n ","\n display: block;\n width: 100%;\n max-width: 400px;\n height: 100%;\n background-color: #ffffff;\n overflow: hidden;\n\n /* Animation props */\n transform: ",";\n transition:\n transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),\n opacity 0.3s ease-in-out;\n opacity: ",";\n pointer-events: ",";\n\n ","\n\n @media (max-width: 600px) {\n max-width: 100%;\n }\n"])),function(n){return n.$widgetPosition===i.LEFT?"left: 0;":"right: 0;"},function(n){var t=n.$isOpen,o=n.$widgetPosition;return t?"translateX(0%)":o===i.LEFT?"translateX(-100%)":"translateX(100%)"},function(n){return n.$isOpen?1:0},function(n){return n.$isOpen?"auto":"none"},function(t){return t.$layoutType===e.DRAWER?o(s||(s=n(["\n border-radius: 0;\n box-shadow: -2px 0 8px rgba(36, 30, 30, 0.15);\n\n @media (max-width: 600px) {\n max-width: 100%;\n height: 100%;\n }\n "],["\n border-radius: 0;\n box-shadow: -2px 0 8px rgba(36, 30, 30, 0.15);\n\n @media (max-width: 600px) {\n max-width: 100%;\n height: 100%;\n }\n "]))):o(d||(d=n(["\n border-radius: 12px;\n box-shadow:\n 0 136px 38px 0 rgba(0, 0, 0, 0),\n 0 87px 35px 0 rgba(0, 0, 0, 0.01),\n 0 49px 29px 0 rgba(0, 0, 0, 0.02),\n 0 22px 22px 0 rgba(0, 0, 0, 0.04),\n 0 5px 12px 0 rgba(0, 0, 0, 0.04);\n max-height: calc(100% - 32px);\n overflow-y: hidden;\n display: flex;\n flex-direction: column;\n top: auto;\n bottom: 16px;\n margin: 0 16px;\n height: auto;\n\n @media (max-width: 600px) {\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n width: 100%;\n height: 100%;\n max-width: none;\n max-height: none;\n margin: 0;\n border-radius: 0;\n }\n "],["\n border-radius: 12px;\n box-shadow:\n 0 136px 38px 0 rgba(0, 0, 0, 0),\n 0 87px 35px 0 rgba(0, 0, 0, 0.01),\n 0 49px 29px 0 rgba(0, 0, 0, 0.02),\n 0 22px 22px 0 rgba(0, 0, 0, 0.04),\n 0 5px 12px 0 rgba(0, 0, 0, 0.04);\n max-height: calc(100% - 32px);\n overflow-y: hidden;\n display: flex;\n flex-direction: column;\n top: auto;\n bottom: 16px;\n margin: 0 16px;\n height: auto;\n\n @media (max-width: 600px) {\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n width: 100%;\n height: 100%;\n max-width: none;\n max-height: none;\n margin: 0;\n border-radius: 0;\n }\n "])))}),k=t.div(g||(g=n(["\n width: 100%;\n background-color: #ffffff;\n transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);\n overflow: hidden;\n padding-bottom: env(safe-area-inset-bottom);\n display: flex;\n flex-direction: column;\n\n ","\n"],["\n width: 100%;\n background-color: #ffffff;\n transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);\n overflow: hidden;\n padding-bottom: env(safe-area-inset-bottom);\n display: flex;\n flex-direction: column;\n\n ","\n"])),function(t){var i=t.$isActive,r=t.$layer,a=0===r;return t.$layoutType===e.DRAWER?o(h||(h=n(["\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n\n ","\n "],["\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n\n ","\n "])),a?o(p||(p=n(["\n transform: translateX(0%);\n z-index: 1;\n "],["\n transform: translateX(0%);\n z-index: 1;\n "]))):o(x||(x=n(["\n transform: translateX(",");\n z-index: ",";\n box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);\n "],["\n transform: translateX(",");\n z-index: ",";\n box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);\n "])),i?"0%":"100%",r+1)):o(m||(m=n(["\n ","\n\n ","\n "],["\n ","\n\n ","\n "])),o(a?b||(b=n(["\n position: relative;\n height: auto;\n max-height: 100%;\n "],["\n position: relative;\n height: auto;\n max-height: 100%;\n "])):f||(f=n(["\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n overflow-y: auto;\n "],["\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n overflow-y: auto;\n "]))),a?o(c||(c=n(["\n transform: translateX(0%);\n z-index: 1;\n "],["\n transform: translateX(0%);\n z-index: 1;\n "]))):o(u||(u=n(["\n transform: translateX(",");\n z-index: ",";\n box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);\n "],["\n transform: translateX(",");\n z-index: ",";\n box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);\n "])),i?"0%":"100%",r+1))}),$=t.div(w||(w=n(["\n position: absolute;\n bottom: 20px;\n ","\n display: flex;\n flex-direction: column;\n align-items: ",";\n transition:\n opacity 0.2s ease-in-out,\n transform 0.2s ease-in-out;\n opacity: ",";\n transform: ",";\n pointer-events: ",";\n"],["\n position: absolute;\n bottom: 20px;\n ","\n display: flex;\n flex-direction: column;\n align-items: ",";\n transition:\n opacity 0.2s ease-in-out,\n transform 0.2s ease-in-out;\n opacity: ",";\n transform: ",";\n pointer-events: ",";\n"])),function(n){return n.$widgetPosition===i.LEFT?"left: 20px;":"right: 20px;"},function(n){return n.$widgetPosition===i.LEFT?"flex-start":"flex-end"},function(n){return n.$isVisible?1:0},function(n){return n.$isVisible?"translateY(0)":"translateY(10px)"},function(n){return n.$isVisible?"auto":"none"});export{v as Container,$ as MiniModeWrapper,y as Panel,k as ScreenWrapper};