@ikas/loyalty-widget-renderer 1.0.0-alpha.4 → 1.0.0-alpha.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/assets/widget-icons/illustraions/medal.js +1 -1
- package/build/ext/@babel/runtime/helpers/esm/arrayLikeToArray.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/arrayWithHoles.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/assertThisInitialized.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/classCallCheck.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/createClass.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/defineProperty.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/getPrototypeOf.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/inherits.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/iterableToArray.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/iterableToArrayLimit.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/nonIterableRest.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/possibleConstructorReturn.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/setPrototypeOf.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/slicedToArray.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/toArray.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/toPrimitive.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/toPropertyKey.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/typeof.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +1 -0
- package/build/ext/i18next/dist/esm/i18next.js +1 -0
- package/build/ext/react-i18next/dist/es/I18nextProvider.js +1 -0
- package/build/ext/react-i18next/dist/es/context.js +1 -0
- package/build/ext/react-i18next/dist/es/unescape.js +1 -0
- package/build/ext/react-i18next/dist/es/useTranslation.js +1 -0
- package/build/ext/react-i18next/dist/es/utils.js +1 -0
- package/build/ext/tslib/tslib.es6.mjs.js +1 -1
- package/build/index.d.ts +5 -1
- package/build/index.js +1 -1
- package/build/injector.d.ts +5 -0
- package/build/models/common/index.d.ts +21 -0
- package/build/models/common/index.js +1 -0
- package/build/models/image/index.d.ts +1 -2
- package/build/models/image/index.js +1 -1
- package/build/models/index.d.ts +14 -3
- package/build/models/index.js +1 -1
- package/build/models/loyalty-customer-info/index.d.ts +7 -7
- package/build/models/loyalty-customer-info/index.js +1 -1
- package/build/models/loyalty-program-earning-method/index.d.ts +16 -30
- package/build/models/loyalty-program-earning-method/index.js +1 -1
- package/build/models/loyalty-program-point-history/index.d.ts +3 -3
- package/build/models/loyalty-program-point-history/index.js +1 -1
- package/build/models/loyalty-program-spending-method/index.d.ts +7 -20
- package/build/models/loyalty-program-spending-method/index.js +1 -1
- package/build/models/loyalty-widget/header/header-background/index.d.ts +1 -2
- package/build/models/loyalty-widget/header/header-background/index.js +1 -1
- package/build/models/loyalty-widget/settings/index.js +1 -1
- package/build/models/types/index.d.ts +13 -36
- package/build/models/types/index.js +1 -1
- package/build/renderer/components/button/index.js +1 -1
- package/build/renderer/components/button/style.js +1 -1
- package/build/renderer/components/count-up/index.d.ts +7 -0
- package/build/renderer/components/count-up/index.js +1 -0
- package/build/renderer/components/loyalty-method-card/index.d.ts +2 -1
- package/build/renderer/components/loyalty-method-card/index.js +1 -1
- package/build/renderer/components/loyalty-method-card/style.js +1 -1
- package/build/renderer/components/mini-mode-button/index.d.ts +7 -0
- package/build/renderer/components/mini-mode-button/index.js +1 -0
- package/build/renderer/components/mini-mode-button/style.d.ts +5 -0
- package/build/renderer/components/mini-mode-button/style.js +1 -0
- package/build/renderer/components/mini-mode-description/index.d.ts +7 -0
- package/build/renderer/components/mini-mode-description/index.js +1 -0
- package/build/renderer/components/mini-mode-description/style.d.ts +3 -0
- package/build/renderer/components/mini-mode-description/style.js +1 -0
- package/build/renderer/components/section-title/style.js +1 -1
- package/build/renderer/components/style/icon-wrapper.d.ts +4 -0
- package/build/renderer/components/style/icon-wrapper.js +1 -0
- package/build/renderer/components/style/typography.d.ts +2 -1
- package/build/renderer/components/style/typography.js +1 -1
- package/build/renderer/index.d.ts +0 -1
- package/build/renderer/index.js +1 -1
- package/build/renderer/screens/credit-earning-methods-screen/index.js +1 -1
- package/build/renderer/screens/credit-earning-methods-screen/style.js +1 -1
- package/build/renderer/screens/credit-history-screen/index.js +1 -1
- package/build/renderer/screens/credit-history-screen/style.d.ts +3 -1
- package/build/renderer/screens/credit-history-screen/style.js +1 -1
- package/build/renderer/screens/credit-spending-methods-screen/index.js +1 -1
- package/build/renderer/screens/credit-spending-methods-screen/style.d.ts +3 -1
- package/build/renderer/screens/credit-spending-methods-screen/style.js +1 -1
- package/build/renderer/screens/loyalty-level-screen/index.js +1 -1
- package/build/renderer/screens/loyalty-level-screen/style.d.ts +6 -2
- package/build/renderer/screens/loyalty-level-screen/style.js +1 -1
- package/build/renderer/screens/main-screen/earning-methods-section/index.d.ts +1 -0
- package/build/renderer/screens/main-screen/earning-methods-section/index.js +1 -1
- package/build/renderer/screens/main-screen/header/auth-user-section/index.js +1 -1
- package/build/renderer/screens/main-screen/header/auth-user-section/style.js +1 -1
- package/build/renderer/screens/main-screen/header/index.js +1 -1
- package/build/renderer/screens/main-screen/header/logo-section/index.js +1 -1
- package/build/renderer/screens/main-screen/header/logo-section/style.js +1 -1
- package/build/renderer/screens/main-screen/header/style.d.ts +8 -4
- package/build/renderer/screens/main-screen/header/style.js +1 -1
- package/build/renderer/screens/main-screen/header/title-section/index.js +1 -1
- package/build/renderer/screens/main-screen/header/title-section/style.js +1 -1
- package/build/renderer/screens/main-screen/header/user-logged-section/index.js +1 -1
- package/build/renderer/screens/main-screen/header/user-logged-section/style.js +1 -1
- package/build/renderer/screens/main-screen/index.js +1 -1
- package/build/renderer/screens/main-screen/program-info-section/index.js +1 -1
- package/build/renderer/screens/main-screen/program-info-section/style.d.ts +11 -3
- package/build/renderer/screens/main-screen/program-info-section/style.js +1 -1
- package/build/renderer/screens/main-screen/spending-methods-section/dynamic-slider.js +1 -1
- package/build/renderer/screens/main-screen/spending-methods-section/index.d.ts +1 -0
- package/build/renderer/screens/main-screen/spending-methods-section/index.js +1 -1
- package/build/renderer/screens/main-screen/style.js +1 -1
- package/build/renderer/style.d.ts +17 -2
- package/build/renderer/style.js +1 -1
- package/build/renderer/utils/i18n.d.ts +2 -2
- package/build/renderer/utils/i18n.js +1 -1
- package/build/renderer/utils/locales/en.json.js +1 -1
- package/build/renderer/utils/locales/tr.json.js +1 -1
- package/build/renderer/utils/loyalty-details.js +1 -1
- package/build/storefront-widget-script-injector.iife.js +68 -0
- package/build/storefront-widget-script-injector.iife.js.map +1 -0
- package/build/utils.d.ts +6 -4
- package/build/utils.js +1 -1
- package/package.json +20 -10
- package/build/_virtual/index.js +0 -1
- package/build/_virtual/index2.js +0 -1
- package/build/_virtual/react-is.development.js +0 -1
- package/build/_virtual/react-is.development2.js +0 -1
- package/build/_virtual/react-is.production.js +0 -1
- package/build/_virtual/react-is.production.min.js +0 -1
- package/build/ext/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js +0 -1
- package/build/ext/@emotion/memoize/dist/memoize.browser.esm.js +0 -1
- package/build/ext/@emotion/stylis/dist/stylis.browser.esm.js +0 -1
- package/build/ext/@emotion/unitless/dist/unitless.browser.esm.js +0 -1
- package/build/ext/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js +0 -1
- package/build/ext/hoist-non-react-statics/ext/react-is/cjs/react-is.development.js +0 -9
- package/build/ext/hoist-non-react-statics/ext/react-is/cjs/react-is.production.min.js +0 -9
- package/build/ext/hoist-non-react-statics/ext/react-is/index.js +0 -1
- package/build/ext/react-is/cjs/react-is.development.js +0 -10
- package/build/ext/react-is/cjs/react-is.production.js +0 -10
- package/build/ext/react-is/index.js +0 -1
- package/build/ext/styled-components/dist/styled-components.browser.esm.js +0 -1
- package/build/models/base.d.ts +0 -4
- package/build/models/base.js +0 -1
- package/build/models/category/index.d.ts +0 -5
- package/build/models/loyalty-widget/header-background/index.d.ts +0 -9
|
@@ -1,51 +1,37 @@
|
|
|
1
|
-
import { EarningMethodTypeEnum, LoyaltyProgramPointEarningTypeEnum
|
|
2
|
-
|
|
3
|
-
maxPointLimit: number;
|
|
4
|
-
minPointLimit: number;
|
|
5
|
-
constructor(data?: Partial<LoyaltyProgramPointLimit>);
|
|
6
|
-
}
|
|
7
|
-
export declare class LoyaltyProgramFilter {
|
|
8
|
-
type: LoyaltyProgramFilterTypeEnum;
|
|
9
|
-
idList: string[];
|
|
10
|
-
constructor(data?: Partial<LoyaltyProgramFilter>);
|
|
11
|
-
}
|
|
1
|
+
import { EarningMethodTypeEnum, LoyaltyProgramPointEarningTypeEnum } from "../types";
|
|
2
|
+
import { LoyaltyProgramPointLimit, LoyaltyProgramFilter, LoyaltyProgramMethodTranslation, LoyaltyProgramPeriod } from "../common";
|
|
12
3
|
export declare class LoyaltyProgramEarningMethodOrderSettings {
|
|
13
|
-
maxOrderAmount: number;
|
|
4
|
+
maxOrderAmount: number | null;
|
|
14
5
|
minOrderAmount: number;
|
|
15
|
-
productFilters: LoyaltyProgramFilter[];
|
|
6
|
+
productFilters: LoyaltyProgramFilter[] | null;
|
|
16
7
|
constructor(data?: Partial<LoyaltyProgramEarningMethodOrderSettings>);
|
|
17
8
|
}
|
|
18
9
|
export declare class LoyaltyProgramEarningMethodProductSettings {
|
|
19
|
-
maxProductQuantity: number;
|
|
20
|
-
minProductQuantity: number;
|
|
21
|
-
productFilters: LoyaltyProgramFilter[];
|
|
10
|
+
maxProductQuantity: number | null;
|
|
11
|
+
minProductQuantity: number | null;
|
|
12
|
+
productFilters: LoyaltyProgramFilter[] | null;
|
|
22
13
|
constructor(data?: Partial<LoyaltyProgramEarningMethodProductSettings>);
|
|
23
14
|
}
|
|
24
|
-
export declare class LoyaltyProgramMethodTranslation {
|
|
25
|
-
description: string;
|
|
26
|
-
locale: string;
|
|
27
|
-
constructor(data?: Partial<LoyaltyProgramMethodTranslation>);
|
|
28
|
-
}
|
|
29
15
|
export declare class LoyaltyProgramEarningMethod {
|
|
30
|
-
amountPerPointsEarned: number;
|
|
31
|
-
createdAt:
|
|
16
|
+
amountPerPointsEarned: number | null;
|
|
17
|
+
createdAt: any | null;
|
|
32
18
|
deleted: boolean;
|
|
33
|
-
description: string;
|
|
19
|
+
description: string | null;
|
|
34
20
|
earnedPointLimit: LoyaltyProgramPointLimit | null;
|
|
35
21
|
id: string;
|
|
36
22
|
isActive: boolean;
|
|
37
|
-
lastValidityDate:
|
|
23
|
+
lastValidityDate: any | null;
|
|
38
24
|
loyaltyProgramId: string;
|
|
39
25
|
methodType: EarningMethodTypeEnum;
|
|
40
26
|
orderSettings: LoyaltyProgramEarningMethodOrderSettings | null;
|
|
41
27
|
pointEarningType: LoyaltyProgramPointEarningTypeEnum;
|
|
42
28
|
pointsEarned: number;
|
|
43
29
|
productSettings: LoyaltyProgramEarningMethodProductSettings | null;
|
|
44
|
-
quantityPerPointsEarned: number;
|
|
45
|
-
segmentId: string;
|
|
46
|
-
tierIds: string[];
|
|
47
|
-
translations: LoyaltyProgramMethodTranslation[];
|
|
48
|
-
updatedAt:
|
|
30
|
+
quantityPerPointsEarned: number | null;
|
|
31
|
+
segmentId: string | null;
|
|
32
|
+
tierIds: string[] | null;
|
|
33
|
+
translations: LoyaltyProgramMethodTranslation[] | null;
|
|
34
|
+
updatedAt: any | null;
|
|
49
35
|
validityPeriod: LoyaltyProgramPeriod | null;
|
|
50
36
|
constructor(data?: Partial<LoyaltyProgramEarningMethod>);
|
|
51
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeObservable as t,observable as i}from"mobx";import{EarningMethodTypeEnum as n,LoyaltyProgramPointEarningTypeEnum as e
|
|
1
|
+
import{makeObservable as t,observable as i}from"mobx";import{EarningMethodTypeEnum as n,LoyaltyProgramPointEarningTypeEnum as e}from"../types/index.js";import{LoyaltyProgramFilter as r,LoyaltyProgramPointLimit as d,LoyaltyProgramMethodTranslation as o,LoyaltyProgramPeriod as s}from"../common/index.js";var a=function(n){void 0===n&&(n={}),this.maxOrderAmount=n.maxOrderAmount||null,this.minOrderAmount=n.minOrderAmount||0,this.productFilters=n.productFilters?n.productFilters.map(function(t){return new r(t)}):null,t(this,{maxOrderAmount:i,minOrderAmount:i,productFilters:i})},l=function(n){void 0===n&&(n={}),this.maxProductQuantity=n.maxProductQuantity||null,this.minProductQuantity=n.minProductQuantity||null,this.productFilters=n.productFilters?n.productFilters.map(function(t){return new r(t)}):null,t(this,{maxProductQuantity:i,minProductQuantity:i,productFilters:i})},u=function(r){void 0===r&&(r={}),this.amountPerPointsEarned=r.amountPerPointsEarned||null,this.createdAt=r.createdAt||null,this.deleted=r.deleted||!1,this.description=r.description||null,this.earnedPointLimit=r.earnedPointLimit?new d(r.earnedPointLimit):null,this.id=r.id||"",this.isActive=r.isActive||!1,this.lastValidityDate=r.lastValidityDate||null,this.loyaltyProgramId=r.loyaltyProgramId||"",this.methodType=r.methodType||n.ORDER_CREATE,this.orderSettings=r.orderSettings?new a(r.orderSettings):null,this.pointEarningType=r.pointEarningType||e.STATIC,this.pointsEarned=r.pointsEarned||0,this.productSettings=r.productSettings?new l(r.productSettings):null,this.quantityPerPointsEarned=r.quantityPerPointsEarned||null,this.segmentId=r.segmentId||null,this.tierIds=r.tierIds||null,this.translations=r.translations?r.translations.map(function(t){return new o(t)}):null,this.updatedAt=r.updatedAt||null,this.validityPeriod=r.validityPeriod?new s(r.validityPeriod):null,t(this,{amountPerPointsEarned:i,createdAt:i,deleted:i,description:i,earnedPointLimit:i,id:i,isActive:i,lastValidityDate:i,loyaltyProgramId:i,methodType:i,orderSettings:i,pointEarningType:i,pointsEarned:i,productSettings:i,quantityPerPointsEarned:i,segmentId:i,tierIds:i,translations:i,updatedAt:i,validityPeriod:i})};export{u as LoyaltyProgramEarningMethod,a as LoyaltyProgramEarningMethodOrderSettings,l as LoyaltyProgramEarningMethodProductSettings};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { LoyaltyProgramPointHistoryTypeEnum } from "../types";
|
|
2
2
|
export declare class LoyaltyProgramPointHistory {
|
|
3
3
|
amount: number;
|
|
4
|
-
createdAt:
|
|
4
|
+
createdAt: any | null;
|
|
5
5
|
customerId: string;
|
|
6
6
|
deleted: boolean;
|
|
7
|
-
expireDate:
|
|
7
|
+
expireDate: any | null;
|
|
8
8
|
id: string;
|
|
9
9
|
loyaltyProgramCustomerId: string;
|
|
10
10
|
loyaltyProgramEarningMethodId: string | null;
|
|
@@ -12,6 +12,6 @@ export declare class LoyaltyProgramPointHistory {
|
|
|
12
12
|
loyaltyProgramSpendingMethodId: string | null;
|
|
13
13
|
orderId: string | null;
|
|
14
14
|
type: LoyaltyProgramPointHistoryTypeEnum;
|
|
15
|
-
updatedAt:
|
|
15
|
+
updatedAt: any | null;
|
|
16
16
|
constructor(data?: Partial<LoyaltyProgramPointHistory>);
|
|
17
17
|
}
|
|
@@ -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||
|
|
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,38 +1,25 @@
|
|
|
1
|
-
import { LoyaltyProgramMethodSpendingTypeEnum
|
|
2
|
-
|
|
3
|
-
maxPointLimit: number | null;
|
|
4
|
-
minPointLimit: number | null;
|
|
5
|
-
constructor(data?: Partial<LoyaltyProgramPointLimit>);
|
|
6
|
-
}
|
|
7
|
-
export declare class LoyaltyProgramFilter {
|
|
8
|
-
idList: string[];
|
|
9
|
-
type: LoyaltyProgramFilterTypeEnum;
|
|
10
|
-
constructor(data?: Partial<LoyaltyProgramFilter>);
|
|
11
|
-
}
|
|
1
|
+
import { LoyaltyProgramMethodSpendingTypeEnum } from "../types";
|
|
2
|
+
import { LoyaltyProgramPointLimit, LoyaltyProgramFilter, LoyaltyProgramMethodTranslation } from "../common";
|
|
12
3
|
export declare class LoyaltyProgramDiscountSettings {
|
|
13
4
|
discountAmount: number | null;
|
|
14
5
|
freeProductId: string | null;
|
|
15
6
|
point: number;
|
|
16
7
|
constructor(data?: Partial<LoyaltyProgramDiscountSettings>);
|
|
17
8
|
}
|
|
18
|
-
export declare class LoyaltyProgramMethodTranslation {
|
|
19
|
-
description: string | null;
|
|
20
|
-
locale: string | null;
|
|
21
|
-
constructor(data?: Partial<LoyaltyProgramMethodTranslation>);
|
|
22
|
-
}
|
|
23
9
|
export declare class LoyaltyProgramSpendingMethod {
|
|
24
|
-
createdAt:
|
|
10
|
+
createdAt: any | null;
|
|
25
11
|
deleted: boolean;
|
|
26
12
|
description: string | null;
|
|
27
13
|
discountSettings: LoyaltyProgramDiscountSettings | null;
|
|
28
14
|
id: string;
|
|
29
15
|
isActive: boolean;
|
|
16
|
+
isAvailable: boolean | null;
|
|
30
17
|
isDynamic: boolean;
|
|
31
18
|
loyaltyProgramId: string;
|
|
32
19
|
pointUsageLimit: LoyaltyProgramPointLimit | null;
|
|
33
|
-
productFilters: LoyaltyProgramFilter[];
|
|
34
|
-
translations: LoyaltyProgramMethodTranslation[];
|
|
20
|
+
productFilters: LoyaltyProgramFilter[] | null;
|
|
21
|
+
translations: LoyaltyProgramMethodTranslation[] | null;
|
|
35
22
|
type: LoyaltyProgramMethodSpendingTypeEnum;
|
|
36
|
-
updatedAt:
|
|
23
|
+
updatedAt: any | null;
|
|
37
24
|
constructor(data?: Partial<LoyaltyProgramSpendingMethod>);
|
|
38
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeObservable as t,observable as i}from"mobx";import{LoyaltyProgramMethodSpendingTypeEnum as n
|
|
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,7 +1,6 @@
|
|
|
1
|
-
import { BaseModel } from "models/base";
|
|
2
1
|
import { LoyaltyWidgetImage } from "models/image";
|
|
3
2
|
import { HeaderBackgroundTypeEnum } from "../../types";
|
|
4
|
-
export declare class LoyaltyWidgetHeaderBackground
|
|
3
|
+
export declare class LoyaltyWidgetHeaderBackground {
|
|
5
4
|
bgColor: string | null;
|
|
6
5
|
image: LoyaltyWidgetImage | null;
|
|
7
6
|
type: HeaderBackgroundTypeEnum;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{makeObservable as i,observable as o}from"mobx";import{LoyaltyWidgetImage as e}from"../../../image/index.js";import{HeaderBackgroundTypeEnum as t}from"../../types/index.js";var m=function(m){this.bgColor=m.bgColor||null,this.image=m.image?new e(m.image):null,this.type=m.type||t.COLOR,i(this,{bgColor:o,image:o,type:o})};export{m as LoyaltyWidgetHeaderBackground};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeObservable as o,observable as i}from"mobx";import{WidgetPositionEnum as r,LoyaltyWidgetLayoutTypeEnum as e,WidgetIconTypeEnum as t,BadgeIconTypeEnum as p}from"../types/index.js";var d=function(d){var s;void 0===d&&(d={}),this.position=d.position||r.RIGHT,this.type=d.type||e.
|
|
1
|
+
import{makeObservable as o,observable as i}from"mobx";import{WidgetPositionEnum as r,LoyaltyWidgetLayoutTypeEnum as e,WidgetIconTypeEnum as t,BadgeIconTypeEnum as p}from"../types/index.js";var d=function(d){var s;void 0===d&&(d={}),this.position=d.position||r.RIGHT,this.type=d.type||e.DRAWER,this.primaryColor=d.primaryColor||null,this.cartBorderRadius=null!==(s=d.cartBorderRadius)&&void 0!==s?s:0,this.widgetIconType=d.widgetIconType||t.NORMAL,this.badgeIconLevel=d.badgeIconLevel||p.LEVEL_1,o(this,{position:i,type:i,primaryColor:i,cartBorderRadius:i,widgetIconType:i,badgeIconLevel:i})};export{d as LoyaltyWidgetSettings};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { LoyaltyProgramSpendingMethod } from "../loyalty-program-spending-method";
|
|
2
2
|
import type { LoyaltyProgramEarningMethod } from "../loyalty-program-earning-method";
|
|
3
|
-
import type { LoyaltyCustomerInfo } from "../loyalty-customer-info";
|
|
3
|
+
import type { LoyaltyCustomerInfo, LoyaltyProgramTier } from "../loyalty-customer-info";
|
|
4
4
|
import type { LoyaltyWidget } from "../loyalty-widget";
|
|
5
5
|
import type { LoyaltyProgramPointHistory } from "../loyalty-program-point-history";
|
|
6
|
+
import { LoyaltyWidgetViewModel } from "models";
|
|
6
7
|
export declare enum LoyaltyWidgetScreenTypeEnum {
|
|
7
8
|
MAIN_SCREEN = "MAIN_SCREEN",
|
|
8
9
|
CREDIT_SPENDING_METHODS_SCREEN = "CREDIT_SPENDING_METHODS_SCREEN",
|
|
@@ -10,6 +11,10 @@ export declare enum LoyaltyWidgetScreenTypeEnum {
|
|
|
10
11
|
CREDIT_HISTORY_SCREEN = "CREDIT_HISTORY_SCREEN",
|
|
11
12
|
LOYALTY_LEVEL_SCREEN = "LOYALTY_LEVEL_SCREEN"
|
|
12
13
|
}
|
|
14
|
+
export declare enum WidgetMode {
|
|
15
|
+
MINI_MODE = "MINI_MODE",
|
|
16
|
+
WIDGET_MODE = "WIDGET_MODE"
|
|
17
|
+
}
|
|
13
18
|
export declare enum EarningMethodTypeEnum {
|
|
14
19
|
BUY_PRODUCT = "BUY_PRODUCT",
|
|
15
20
|
CUSTOMER_REGISTER = "CUSTOMER_REGISTER",
|
|
@@ -41,11 +46,6 @@ export declare enum PeriodTypeEnum {
|
|
|
41
46
|
WEEK = "WEEK",
|
|
42
47
|
YEAR = "YEAR"
|
|
43
48
|
}
|
|
44
|
-
export declare class LoyaltyProgramPeriod {
|
|
45
|
-
period: string;
|
|
46
|
-
periodType: PeriodTypeEnum;
|
|
47
|
-
constructor(data?: Partial<LoyaltyProgramPeriod>);
|
|
48
|
-
}
|
|
49
49
|
export type Category = {
|
|
50
50
|
id: string;
|
|
51
51
|
name: string;
|
|
@@ -80,45 +80,16 @@ export type StringFilterInput = {
|
|
|
80
80
|
endsWith?: string;
|
|
81
81
|
nendsWith?: string;
|
|
82
82
|
};
|
|
83
|
-
export type LoyaltyProgramTierTranslation = {
|
|
84
|
-
locale: string;
|
|
85
|
-
name: string;
|
|
86
|
-
};
|
|
87
|
-
export type LoyaltyProgramTier = {
|
|
88
|
-
createdAt?: string;
|
|
89
|
-
customerSegmentId?: string;
|
|
90
|
-
deleted: boolean;
|
|
91
|
-
id: string;
|
|
92
|
-
isActive: boolean;
|
|
93
|
-
loyaltyProgramId: string;
|
|
94
|
-
name: string;
|
|
95
|
-
period?: LoyaltyProgramPeriod;
|
|
96
|
-
pointsRequired?: number;
|
|
97
|
-
tierPointMultiplier?: number;
|
|
98
|
-
translations?: LoyaltyProgramTierTranslation[];
|
|
99
|
-
updatedAt?: string;
|
|
100
|
-
};
|
|
101
83
|
export type ListLoyaltyProgramTierInput = {
|
|
102
84
|
id?: StringFilterInput;
|
|
103
|
-
includeDeleted?: boolean;
|
|
104
85
|
loyaltyProgramId?: StringFilterInput;
|
|
105
86
|
};
|
|
106
87
|
export declare enum LoyaltyProgramPointHistoryTypeEnum {
|
|
107
88
|
EARN = "EARN",
|
|
108
89
|
SPEND = "SPEND"
|
|
109
90
|
}
|
|
110
|
-
export type LoyaltyProgramPointHistoryTypeEnumFilterInput = {
|
|
111
|
-
eq?: LoyaltyProgramPointHistoryTypeEnum;
|
|
112
|
-
in?: LoyaltyProgramPointHistoryTypeEnum[];
|
|
113
|
-
ne?: LoyaltyProgramPointHistoryTypeEnum;
|
|
114
|
-
nin?: LoyaltyProgramPointHistoryTypeEnum[];
|
|
115
|
-
};
|
|
116
91
|
export type ListLoyaltyProgramPointHistoryInput = {
|
|
117
|
-
customerId?: StringFilterInput;
|
|
118
|
-
includeDeleted?: boolean;
|
|
119
92
|
loyaltyProgramId?: StringFilterInput;
|
|
120
|
-
sort?: string;
|
|
121
|
-
type?: LoyaltyProgramPointHistoryTypeEnumFilterInput;
|
|
122
93
|
};
|
|
123
94
|
export type LoyaltyWidgetCallbacks = {
|
|
124
95
|
listSpendingMethodsByCartId: (cartId?: string | null) => Promise<LoyaltyProgramSpendingMethod[]>;
|
|
@@ -129,17 +100,23 @@ export type LoyaltyWidgetCallbacks = {
|
|
|
129
100
|
useLoyaltyPoints: (input: AddLoyaltyToCartInput) => Promise<boolean>;
|
|
130
101
|
removeLoyaltyPointsFromCart: () => Promise<void>;
|
|
131
102
|
getLoyaltyWidget: () => Promise<LoyaltyWidget>;
|
|
132
|
-
onWidgetClose: () => void;
|
|
133
103
|
getProducts: (ids: string[]) => Promise<Product[]>;
|
|
134
104
|
getCategories: (ids: string[]) => Promise<Category[]>;
|
|
135
105
|
getBrands: (ids: string[]) => Promise<Brand[]>;
|
|
136
106
|
getTags: (ids: string[]) => Promise<Tag[]>;
|
|
107
|
+
subscribeToMarketingNotifications: () => Promise<boolean>;
|
|
108
|
+
formatCurrency?: (price: number) => string;
|
|
137
109
|
};
|
|
138
110
|
export type IkasLoyaltyWidgetConfig = {
|
|
139
111
|
cartId?: string | null;
|
|
112
|
+
userId?: string | null;
|
|
140
113
|
cdnURL: string;
|
|
141
114
|
merchantId: string;
|
|
142
115
|
currency: string;
|
|
143
116
|
locale: string;
|
|
117
|
+
storeURL?: string | null;
|
|
144
118
|
callbacks: LoyaltyWidgetCallbacks;
|
|
119
|
+
position?: "fixed" | "absolute";
|
|
120
|
+
isPreviewMode?: boolean;
|
|
121
|
+
onViewModelInitialized?: (viewModel: LoyaltyWidgetViewModel) => void;
|
|
145
122
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
var E,R,T,_,N,C,D,I;!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"}(C||(C={})),function(E){E.MONTH="MONTH",E.WEEK="WEEK",E.YEAR="YEAR"}(D||(D={})),function(E){E.EARN="EARN",E.SPEND="SPEND"}(I||(I={}));export{T as EarningMethodTypeEnum,C as LoyaltyProgramFilterTypeEnum,N as LoyaltyProgramMethodSpendingTypeEnum,_ as LoyaltyProgramPointEarningTypeEnum,I as LoyaltyProgramPointHistoryTypeEnum,E as LoyaltyWidgetScreenTypeEnum,D as PeriodTypeEnum,R as WidgetMode};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"react";import{Button as t,Loader as e}from"./style.js";var
|
|
1
|
+
import{observer as o}from"mobx-react";import r from"react";import{Button as t,Loader as e}from"./style.js";var i=o(function(o){var i=o.children,d=o.onClick,l=o.button,n=o.fontSize,a=o.paddingSize,u=o.fullWidth,b=void 0!==u&&u,f=o.disabled,m=void 0!==f&&f,s=o.isLoading,c=void 0!==s&&s;return r.createElement(t,{onClick:d,fullWidth:b,fontSize:n,paddingSize:a,borderRadius:l.buttonRadius,bgColor:l.bgColor,textColor:l.textColor,borderColor:l.borderColor,disabled:m||c},c&&r.createElement(e,null),i)});export{i as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__makeTemplateObject as n}from'./../../../ext/tslib/tslib.es6.mjs.js';import r,{keyframes as
|
|
1
|
+
import{__makeTemplateObject as n}from'./../../../ext/tslib/tslib.es6.mjs.js';import r,{keyframes as t}from"styled-components";import{textXSMedium as o,textSM as e,textSMMedium as i,textMDMedium as a,textLGSemiBold as d,displayXSSemiBold as s}from"../style/typography.js";var l,p,u,c={textXSMedium:o,textSM:e,textSMMedium:i,textMDMedium:a,textLGSemiBold:d,displayXSSemiBold:s},f={small:"8px",medium:"10px 16px"},m=r.button(l||(l=n(["\n border: none;\n cursor: ",";\n transition: all 0.2s ease;\n opacity: ",";\n pointer-events: ",";\n\n ","\n\n padding: ",";\n border-radius: ","px;\n width: ",";\n background-color: ",";\n color: ",";\n border: ",";\n\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n\n &:hover {\n opacity: 0.9;\n }\n"],["\n border: none;\n cursor: ",";\n transition: all 0.2s ease;\n opacity: ",";\n pointer-events: ",";\n\n ","\n\n padding: ",";\n border-radius: ","px;\n width: ",";\n background-color: ",";\n color: ",";\n border: ",";\n\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n\n &:hover {\n opacity: 0.9;\n }\n"])),function(n){return n.disabled?"not-allowed":"pointer"},function(n){return n.disabled?.5:1},function(n){return n.disabled?"none":"auto"},function(n){return c[n.fontSize]},function(n){return f[n.paddingSize]},function(n){return n.borderRadius},function(n){return n.fullWidth?"100%":"auto"},function(n){var r;return null!==(r=n.bgColor)&&void 0!==r?r:"transparent"},function(n){var r;return null!==(r=n.textColor)&&void 0!==r?r:"inherit"},function(n){return n.borderColor?"1px solid ".concat(n.borderColor):"none"}),x=t(p||(p=n(["\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n"],["\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n"]))),b=r.div(u||(u=n(["\n border: 2px solid rgba(255, 255, 255, 0.3);\n border-top: 2px solid currentColor;\n border-radius: 50%;\n width: 14px;\n height: 14px;\n min-width: 14px; /* Ensure it doesn't collapse */\n animation: "," 1s linear infinite, fade-in 0.3s ease-out;\n\n @keyframes fade-in {\n from {\n opacity: 0;\n width: 0;\n transform: scale(0);\n }\n to {\n opacity: 1;\n width: 14px;\n transform: scale(1);\n }\n }\n"],["\n border: 2px solid rgba(255, 255, 255, 0.3);\n border-top: 2px solid currentColor;\n border-radius: 50%;\n width: 14px;\n height: 14px;\n min-width: 14px; /* Ensure it doesn't collapse */\n animation: "," 1s linear infinite, fade-in 0.3s ease-out;\n\n @keyframes fade-in {\n from {\n opacity: 0;\n width: 0;\n transform: scale(0);\n }\n to {\n opacity: 1;\n width: 14px;\n transform: scale(1);\n }\n }\n"])),x);export{m as Button,b as Loader};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import r,{useState as n,useRef as t,useEffect as e}from"react";var u=function(u){var a=u.end,c=u.duration,i=void 0===c?1e3:c,o=n(a),m=o[0],l=o[1],f=t(null),v=t(a);return e(function(){var r;v.current=m,f.current=null;var n=function(t){f.current||(f.current=t);var e=Math.min((t-f.current)/i,1),u=1-Math.pow(1-e,4),c=Math.round(v.current+(a-v.current)*u);l(c),e<1&&(r=requestAnimationFrame(n))};return r=requestAnimationFrame(n),function(){return cancelAnimationFrame(r)}},[a,i]),r.createElement(r.Fragment,null,m)};export{u as default};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { WidgetIconTypeEnum } from "models/loyalty-widget/types";
|
|
3
2
|
import { LoyaltyWidgetButton } from "models/button";
|
|
3
|
+
import { WidgetIconTypeEnum } from "models/loyalty-widget/types";
|
|
4
4
|
export type LoyaltyMethodCardProps = {
|
|
5
5
|
title: string;
|
|
6
6
|
description: string | React.ReactNode;
|
|
@@ -8,6 +8,7 @@ export type LoyaltyMethodCardProps = {
|
|
|
8
8
|
action?: {
|
|
9
9
|
text: string;
|
|
10
10
|
onClick: () => void;
|
|
11
|
+
loading?: boolean;
|
|
11
12
|
};
|
|
12
13
|
isCompleted?: boolean;
|
|
13
14
|
mode: "card" | "accordion";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{observer as e}from"mobx-react";import t,{useState as n}from"react";import{CheckCircleFill as i}from"../../../assets/icons/check-circle-fill.js";import{ChevronLeft as o}from"../../../assets/icons/chevron-left.js";import{WidgetIconTypeEnum as l}from"../../../models/loyalty-widget/types/index.js";import r from"../button/index.js";import{Container as c,Header as a,IconWrapper as m,Content as d,Title as s,Description as p,ArrowButton as u,AccordionWrapper as f,AccordionInner as E}from"./style.js";var g=e(function(e){var g=e.title,y=e.description,x=e.icon,$=e.action,b=e.isCompleted,v=e.mode,C=e.children,j=e.padding,k=e.settings,O=n(!1),h=O[0],w=O[1],I=!b&&(null==$?void 0:$.text)&&(null==$?void 0:$.onClick);return t.createElement(c,{$borderRadius:k.borderRadius,$isCompleted:b,$padding:j},t.createElement(a,{onClick:function(){"accordion"===v&&w(!h)},style:{cursor:"accordion"===v?"pointer":"default"}},k.widgetIconType!==l.NONE&&t.createElement(m,{$iconType:k.widgetIconType},x),t.createElement(d,null,t.createElement(s,null,g),t.createElement(p,null,y)),"card"===v?t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},b&&t.createElement(i,null),I&&t.createElement(r,{button:k.button,paddingSize:"small",fontSize:"textSMMedium",onClick:$.onClick,isLoading:$.loading},$.text)):t.createElement(u,{$isOpen:h},t.createElement(o,null))),"accordion"===v&&t.createElement(f,{$isOpen:h},t.createElement(E,{$isOpen:h},C)))});export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__makeTemplateObject as n}from'./../../../ext/tslib/tslib.es6.mjs.js';import{WidgetIconTypeEnum as e}from"../../../models/loyalty-widget/types/index.js";import
|
|
1
|
+
import{__makeTemplateObject as n}from'./../../../ext/tslib/tslib.es6.mjs.js';import{WidgetIconTypeEnum as e}from"../../../models/loyalty-widget/types/index.js";import r,{css as o}from"styled-components";import{textSMMedium as i,textSM as t}from"../style/typography.js";import{iconWrapperShape as a}from"../style/icon-wrapper.js";var s,p,d,l,f,c,x,g,u,m,b,y=r.div(s||(s=n(["\n display: flex;\n padding: ",";\n flex-direction: column;\n align-items: flex-start;\n align-self: stretch;\n border-radius: ","px;\n border: 1px solid #eef2f6;\n background: #fff;\n opacity: ",";\n user-select: none;\n"],["\n display: flex;\n padding: ",";\n flex-direction: column;\n align-items: flex-start;\n align-self: stretch;\n border-radius: ","px;\n border: 1px solid #eef2f6;\n background: #fff;\n opacity: ",";\n user-select: none;\n"])),function(n){return n.$padding||"16px 14px"},function(n){return n.$borderRadius},function(n){return n.$isCompleted?"0.8":"1"}),h=r.div(p||(p=n(["\n display: flex;\n align-items: center;\n gap: 12px;\n align-self: stretch;\n width: 100%;\n"],["\n display: flex;\n align-items: center;\n gap: 12px;\n align-self: stretch;\n width: 100%;\n"]))),w=r.div(f||(f=n(["\n ","\n\n ","\n\n ","\n"],["\n ","\n\n ","\n\n ","\n"])),a,function(r){return r.$iconType===e.ILLUSTRATION&&o(d||(d=n(["\n border-radius: 40px;\n background: #f6f6f6;\n "],["\n border-radius: 40px;\n background: #f6f6f6;\n "])))},function(r){return r.$iconType===e.NORMAL&&o(l||(l=n(["\n border-radius: 8px;\n border: 1px solid #e3e8ef;\n background: #fff;\n box-shadow: 0 -3px 1px 0 rgba(238, 242, 246, 0.5) inset,\n 0 4px 1px 0 rgba(38, 69, 109, 0), 0 2px 1px 0 rgba(38, 69, 109, 0.01),\n 0 1px 1px 0 rgba(38, 69, 109, 0.02), 0 1px 1px 0 rgba(38, 69, 109, 0.03);\n\n svg {\n color: #4b5565;\n }\n "],["\n border-radius: 8px;\n border: 1px solid #e3e8ef;\n background: #fff;\n box-shadow: 0 -3px 1px 0 rgba(238, 242, 246, 0.5) inset,\n 0 4px 1px 0 rgba(38, 69, 109, 0), 0 2px 1px 0 rgba(38, 69, 109, 0.01),\n 0 1px 1px 0 rgba(38, 69, 109, 0.02), 0 1px 1px 0 rgba(38, 69, 109, 0.03);\n\n svg {\n color: #4b5565;\n }\n "])))}),v=r.div(c||(c=n(["\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 4px;\n flex: 1 0 0;\n"],["\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 4px;\n flex: 1 0 0;\n"]))),$=r.div(x||(x=n(["\n color: #121926;\n ","\n"],["\n color: #121926;\n ","\n"])),i),k=r.div(g||(g=n(["\n color: #121926;\n ","\n"],["\n color: #121926;\n ","\n"])),t),O=r.div(u||(u=n(["\n display: grid;\n grid-template-rows: ",";\n transition: grid-template-rows 300ms ease-in-out;\n width: 100%;\n"],["\n display: grid;\n grid-template-rows: ",";\n transition: grid-template-rows 300ms ease-in-out;\n width: 100%;\n"])),function(n){return n.$isOpen?"1fr":"0fr"}),j=r.div(m||(m=n(["\n overflow: hidden;\n color: #4b5565;\n ","\n\n /* Spacing: We need 20px from header. */\n padding-top: ",";\n\n /* Optional: fade content in/out */\n opacity: ",";\n transition: opacity 300ms ease-in-out, padding-top 300ms ease-in-out;\n"],["\n overflow: hidden;\n color: #4b5565;\n ","\n\n /* Spacing: We need 20px from header. */\n padding-top: ",";\n\n /* Optional: fade content in/out */\n opacity: ",";\n transition: opacity 300ms ease-in-out, padding-top 300ms ease-in-out;\n"])),t,function(n){return n.$isOpen?"20px":"0px"},function(n){return n.$isOpen?1:0}),T=r.button(b||(b=n(["\n border: none;\n background: none;\n cursor: pointer;\n transform: rotate(",");\n transition: transform 0.2s ease-in-out;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #9aa4b2;\n padding: 4px;\n"],["\n border: none;\n background: none;\n cursor: pointer;\n transform: rotate(",");\n transition: transform 0.2s ease-in-out;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #9aa4b2;\n padding: 4px;\n"])),function(n){return n.$isOpen?"270deg":"180deg"});export{j as AccordionInner,O as AccordionWrapper,T as ArrowButton,y as Container,v as Content,k as Description,h as Header,w as IconWrapper,$ as Title};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{observer as e}from"mobx-react";import t from"react";import{WidgetMode as o}from"../../../models/types/index.js";import{Container as r,Logo as a,Emoji as i}from"./style.js";var m=e(function(e){var m=e.viewModel,l=m.loyaltyWidget.miniModeLogo;return t.createElement(r,{$hasImg:!!l.src,onClick:function(e){e.stopPropagation(),m.setWidgetMode(o.WIDGET_MODE)}},l&&l.src?t.createElement(a,{src:l.src,alt:"Loyalty Widget"}):t.createElement(i,null,"🚀"))});export{m as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const Container: import("styled-components").StyledComponent<"div", any, {
|
|
2
|
+
$hasImg: boolean;
|
|
3
|
+
}, never>;
|
|
4
|
+
export declare const Logo: import("styled-components").StyledComponent<"img", any, {}, never>;
|
|
5
|
+
export declare const Emoji: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__makeTemplateObject as n}from'./../../../ext/tslib/tslib.es6.mjs.js';import t,{css as e}from"styled-components";var i,r,o,s,p=t.div(r||(r=n(["\n display: flex;\n width: 60px;\n height: 60px;\n padding: 14px;\n justify-content: center;\n align-items: center;\n border-radius: 60px;\n \n box-shadow: 0 12px 16px -4px rgba(16, 24, 40, 0.08),\n 0 4px 6px -2px rgba(19, 19, 24, 0.03);\n cursor: pointer;\n transition: transform 0.2s ease-in-out;\n\n &:hover {\n transform: scale(1.05);\n }\n\n ","\n"],["\n display: flex;\n width: 60px;\n height: 60px;\n padding: 14px;\n justify-content: center;\n align-items: center;\n border-radius: 60px;\n \n box-shadow: 0 12px 16px -4px rgba(16, 24, 40, 0.08),\n 0 4px 6px -2px rgba(19, 19, 24, 0.03);\n cursor: pointer;\n transition: transform 0.2s ease-in-out;\n\n &:hover {\n transform: scale(1.05);\n }\n\n ","\n"])),function(t){return!t.$hasImg&&e(i||(i=n(["\n background: #000;\n "],["\n background: #000;\n "])))}),a=t.img(o||(o=n(["\n width: 100%;\n height: 100%;\n object-fit: contain;\n"],["\n width: 100%;\n height: 100%;\n object-fit: contain;\n"]))),x=t.span(s||(s=n(["\n font-size: 32px;\n line-height: 1;\n"],["\n font-size: 32px;\n line-height: 1;\n"])));export{p as Container,x as Emoji,a as Logo};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"react";import{observer as o}from"mobx-react";import{WidgetMode as t}from"../../../models/types/index.js";import{XClose as i}from"../../../assets/icons/x-close.js";import{Container as r,CloseButton as a,Text as n}from"./style.js";var l=o(function(o){var l=o.viewModel;return l.isMiniModeDescriptionClosed?null:e.createElement(r,{onClick:function(e){e.stopPropagation(),l.setWidgetMode(t.WIDGET_MODE)}},e.createElement(a,{onClick:function(e){e.stopPropagation(),l.closeMiniModeDescription()}},e.createElement(i,null)),e.createElement(n,null,"Merhaba! 👋 Sadakat programın ve destek ekibimiz burada. Puanlarına göz at veya ekibimizle konuş."))});export{l as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const Container: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const CloseButton: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const Text: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__makeTemplateObject as n}from'./../../../ext/tslib/tslib.es6.mjs.js';import p from"styled-components";import{textMD as r}from"../style/typography.js";var o,x,a,i=p.div(o||(o=n(["\n display: flex;\n width: 432px;\n max-width: calc(100vw - 40px);\n padding: 20px;\n flex-direction: column;\n align-items: flex-start;\n gap: 24px;\n border-radius: 16px;\n border: 1px solid #ECECED;\n background: #FFF;\n box-shadow: 0 22px 6px 0 rgba(0, 0, 0, 0.00), 0 14px 6px 0 rgba(0, 0, 0, 0.01),\n 0 8px 5px 0 rgba(0, 0, 0, 0.05), 0 4px 4px 0 rgba(0, 0, 0, 0.09),\n 0 1px 2px 0 rgba(0, 0, 0, 0.10);\n color: #121926;\n position: relative;\n cursor: pointer;\n margin-bottom: 16px; /* 16px space between description and button */\n"],["\n display: flex;\n width: 432px;\n max-width: calc(100vw - 40px);\n padding: 20px;\n flex-direction: column;\n align-items: flex-start;\n gap: 24px;\n border-radius: 16px;\n border: 1px solid #ECECED;\n background: #FFF;\n box-shadow: 0 22px 6px 0 rgba(0, 0, 0, 0.00), 0 14px 6px 0 rgba(0, 0, 0, 0.01),\n 0 8px 5px 0 rgba(0, 0, 0, 0.05), 0 4px 4px 0 rgba(0, 0, 0, 0.09),\n 0 1px 2px 0 rgba(0, 0, 0, 0.10);\n color: #121926;\n position: relative;\n cursor: pointer;\n margin-bottom: 16px; /* 16px space between description and button */\n"]))),e=p.div(x||(x=n(["\n position: absolute;\n top: -12px;\n right: -12px;\n cursor: pointer;\n display: inline-flex;\n padding: 6px;\n align-items: center;\n gap: 10px;\n border-radius: 40px;\n background: #F6F6F6;\n box-shadow: 0 22px 6px 0 rgba(0, 0, 0, 0.00), 0 14px 6px 0 rgba(0, 0, 0, 0.01),\n 0 8px 5px 0 rgba(0, 0, 0, 0.05), 0 4px 4px 0 rgba(0, 0, 0, 0.09),\n 0 1px 2px 0 rgba(0, 0, 0, 0.10);\n color: #4B5565;\n\n &:hover {\n color: #667085;\n }\n"],["\n position: absolute;\n top: -12px;\n right: -12px;\n cursor: pointer;\n display: inline-flex;\n padding: 6px;\n align-items: center;\n gap: 10px;\n border-radius: 40px;\n background: #F6F6F6;\n box-shadow: 0 22px 6px 0 rgba(0, 0, 0, 0.00), 0 14px 6px 0 rgba(0, 0, 0, 0.01),\n 0 8px 5px 0 rgba(0, 0, 0, 0.05), 0 4px 4px 0 rgba(0, 0, 0, 0.09),\n 0 1px 2px 0 rgba(0, 0, 0, 0.10);\n color: #4B5565;\n\n &:hover {\n color: #667085;\n }\n"]))),t=p.div(a||(a=n(["\n ",";\n color: #121926;\n"],["\n ",";\n color: #121926;\n"])),r);export{e as CloseButton,i as Container,t as Text};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__makeTemplateObject as n}from'./../../../ext/tslib/tslib.es6.mjs.js';import
|
|
1
|
+
import{__makeTemplateObject as n}from'./../../../ext/tslib/tslib.es6.mjs.js';import p from"styled-components";import{textSMMedium as o}from"../style/typography.js";var m,r=p.div(m||(m=n(["\n ","\n margin: 0;\n padding: 16px 24px;\n"],["\n ","\n margin: 0;\n padding: 16px 24px;\n"])),o);export{r as Title};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__makeTemplateObject as n}from'./../../../ext/tslib/tslib.es6.mjs.js';import{css as e}from"styled-components";import{WidgetIconTypeEnum as t}from"../../../models/loyalty-widget/types/index.js";var i,r=e(i||(i=n(["\n display: flex;\n width: ",";\n height: ",";\n justify-content: center;\n align-items: center;\n border-radius: ",";\n"],["\n display: flex;\n width: ",";\n height: ",";\n justify-content: center;\n align-items: center;\n border-radius: ",";\n"])),function(n){return n.$iconType===t.ILLUSTRATION?"40px":"36px"},function(n){return n.$iconType===t.ILLUSTRATION?"40px":"36px"},function(n){return n.$iconType===t.ILLUSTRATION?"40px":"8px"});export{r as iconWrapperShape};
|
|
@@ -2,10 +2,11 @@ declare const textXSMedium: import("styled-components").FlattenSimpleInterpolati
|
|
|
2
2
|
declare const textSM: import("styled-components").FlattenSimpleInterpolation;
|
|
3
3
|
declare const textSMMedium: import("styled-components").FlattenSimpleInterpolation;
|
|
4
4
|
declare const textSMSemiBold: import("styled-components").FlattenSimpleInterpolation;
|
|
5
|
+
declare const textMD: import("styled-components").FlattenSimpleInterpolation;
|
|
5
6
|
declare const textMDMedium: import("styled-components").FlattenSimpleInterpolation;
|
|
6
7
|
declare const textLGMedium: import("styled-components").FlattenSimpleInterpolation;
|
|
7
8
|
declare const textLGSemiBold: import("styled-components").FlattenSimpleInterpolation;
|
|
8
9
|
declare const textXLSemiBold: import("styled-components").FlattenSimpleInterpolation;
|
|
9
10
|
declare const displayXSSemiBold: import("styled-components").FlattenSimpleInterpolation;
|
|
10
11
|
declare const Badge: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
11
|
-
export { textXSMedium, textSM, textSMMedium, textSMSemiBold, textMDMedium, textLGMedium, textLGSemiBold, textXLSemiBold, displayXSSemiBold, Badge, };
|
|
12
|
+
export { textXSMedium, textSM, textSMMedium, textSMSemiBold, textMD, textMDMedium, textLGMedium, textLGSemiBold, textXLSemiBold, displayXSSemiBold, Badge, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__makeTemplateObject as n}from'./../../../ext/tslib/tslib.es6.mjs.js';import t,{css as e}from
|
|
1
|
+
import{__makeTemplateObject as n}from'./../../../ext/tslib/tslib.es6.mjs.js';import t,{css as e}from"styled-components";var o,i,l,f,p,s,h,x,g,r,a,m=e(o||(o=n(["\n font-size: 12px;\n font-style: normal;\n font-weight: 500;\n line-height: 18px; /* 150% */\n letter-spacing: -0.24px;\n"],["\n font-size: 12px;\n font-style: normal;\n font-weight: 500;\n line-height: 18px; /* 150% */\n letter-spacing: -0.24px;\n"]))),y=e(i||(i=n(["\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px;\n"],["\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px;\n"]))),d=e(l||(l=n(["\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n line-height: 20px; /* 142.857% */\n"],["\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n line-height: 20px; /* 142.857% */\n"]))),w=e(f||(f=n(["\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n line-height: 20px;\n"],["\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n line-height: 20px;\n"]))),z=e(p||(p=n(["\nfont-size: 16px;\nfont-style: normal;\nfont-weight: 400;\nline-height: 24px\n"],["\nfont-size: 16px;\nfont-style: normal;\nfont-weight: 400;\nline-height: 24px\n"]))),c=e(s||(s=n(["\n font-size: 16px;\n font-style: normal;\n font-weight: 500;\n line-height: 24px; /* 150% */\n"],["\n font-size: 16px;\n font-style: normal;\n font-weight: 500;\n line-height: 24px; /* 150% */\n"]))),b=e(h||(h=n(["\n font-size: 18px;\n font-style: normal;\n font-weight: 500;\n line-height: 28px;\n"],["\n font-size: 18px;\n font-style: normal;\n font-weight: 500;\n line-height: 28px;\n"]))),u=e(x||(x=n(["\n font-size: 18px;\n font-style: normal;\n font-weight: 600;\n line-height: 28px;\n"],["\n font-size: 18px;\n font-style: normal;\n font-weight: 600;\n line-height: 28px;\n"]))),j=e(g||(g=n(["\n font-size: 20px;\n font-style: normal;\n font-weight: 600;\n line-height: 30px;\n"],["\n font-size: 20px;\n font-style: normal;\n font-weight: 600;\n line-height: 30px;\n"]))),k=e(r||(r=n(["\n font-size: 24px;\n font-style: normal;\n font-weight: 600;\n line-height: 32px;\n"],["\n font-size: 24px;\n font-style: normal;\n font-weight: 600;\n line-height: 32px;\n"]))),v=t.span(a||(a=n(["\n display: flex;\n padding: 2px 8px;\n justify-content: center;\n align-items: center;\n gap: 6px;\n border-radius: 6px;\n border: 0.6px solid #cdd5df;\n opacity: 0.8;\n background: #f8fafc;\n ","\n color: #121926;\n"],["\n display: flex;\n padding: 2px 8px;\n justify-content: center;\n align-items: center;\n gap: 6px;\n border-radius: 6px;\n border: 0.6px solid #cdd5df;\n opacity: 0.8;\n background: #f8fafc;\n ","\n color: #121926;\n"])),y);export{v as Badge,k as displayXSSemiBold,b as textLGMedium,u as textLGSemiBold,z as textMD,c as textMDMedium,y as textSM,d as textSMMedium,w as textSMSemiBold,j as textXLSemiBold,m as textXSMedium};
|
package/build/renderer/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t,__spreadArray as n}from'./../ext/tslib/tslib.es6.mjs.js';import r,{useState as o,
|
|
1
|
+
import{__awaiter as e,__generator as t,__spreadArray as n}from'./../ext/tslib/tslib.es6.mjs.js';import{observer as r}from"mobx-react";import i,{useState as o,useEffect as s}from"react";import'./../ext/react-i18next/dist/es/context.js';import{I18nextProvider as a}from'./../ext/react-i18next/dist/es/I18nextProvider.js';import{LoyaltyWidgetViewModel as c}from"../models/index.js";import{LoyaltyCustomerInfo as l}from"../models/loyalty-customer-info/index.js";import{LoyaltyProgramEarningMethod as d}from"../models/loyalty-program-earning-method/index.js";import{LoyaltyProgramPointHistory as u}from"../models/loyalty-program-point-history/index.js";import{LoyaltyProgramSpendingMethod as f}from"../models/loyalty-program-spending-method/index.js";import{LoyaltyWidget as m}from"../models/loyalty-widget/index.js";import{WidgetPositionEnum as v,LoyaltyWidgetLayoutTypeEnum as E}from"../models/loyalty-widget/types/index.js";import{WidgetMode as g,LoyaltyWidgetScreenTypeEnum as p,EarningMethodTypeEnum as y,LoyaltyProgramFilterTypeEnum as h,LoyaltyProgramMethodSpendingTypeEnum as R}from"../models/types/index.js";import w from"./components/mini-mode-button/index.js";import T from"./components/mini-mode-description/index.js";import b from"./screens/credit-earning-methods-screen/index.js";import M from"./screens/credit-history-screen/index.js";import I from"./screens/credit-spending-methods-screen/index.js";import k from"./screens/loyalty-level-screen/index.js";import C from"./screens/main-screen/index.js";import _ from"./utils/i18n.js";import{Container as S,MiniModeWrapper as A,Panel as N,ScreenWrapper as D}from"./style.js";var O=r(function(r){var O,P,L=r.config,x=o(function(){var e=L||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.locale)||"",(null==e?void 0:e.storeURL)||null,null==e?void 0:e.isPreviewMode,null==e?void 0:e.callbacks)})[0],j=o(!1),U=j[0],W=j[1];s(function(){var e=L||window.ikasLoyaltyWidgetConfig;(null==e?void 0:e.onViewModelInitialized)&&e.onViewModelInitialized(x)},[x,L]);var G=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 x.callbacks?(e=new Set,r=new Set,i=new Set,o=new Set,x.earningMethods.forEach(function(t){var s,a;t.methodType===y.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===h.PRODUCT_AND_VARIANT?t.idList.forEach(function(t){return e.add(t)}):t.type===h.CATEGORY?t.idList.forEach(function(e){return r.add(e)}):t.type===h.PRODUCT_BRAND?t.idList.forEach(function(e){return i.add(e)}):t.type===h.PRODUCT_TAG&&t.idList.forEach(function(e){return o.add(e)})})}),x.spendingMethods&&x.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===h.PRODUCT_AND_VARIANT?t.idList.forEach(function(t){return e.add(t)}):t.type===h.CATEGORY?t.idList.forEach(function(e){return r.add(e)}):t.type===h.PRODUCT_BRAND?t.idList.forEach(function(e){return i.add(e)}):t.type===h.PRODUCT_TAG&&t.idList.forEach(function(e){return o.add(e)})})}),s=[],e.size>0&&x.callbacks.getProducts&&s.push(x.callbacks.getProducts(Array.from(e)).then(function(e){return x.products=e})),r.size>0&&x.callbacks.getCategories&&s.push(x.callbacks.getCategories(Array.from(r)).then(function(e){return x.categories=e})),i.size>0&&x.callbacks.getBrands&&s.push(x.callbacks.getBrands(Array.from(i)).then(function(e){return x.brands=e})),o.size>0&&x.callbacks.getTags&&s.push(x.callbacks.getTags(Array.from(o)).then(function(e){return x.tags=e})),[4,Promise.all(s)]):[2];case 1:return t.sent(),[2]}})})};s(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(!x.callbacks)return[3,6];t.label=1;case 1:return t.trys.push([1,4,5,6]),e=[x.callbacks.getLoyaltyWidget(),x.callbacks.listEarningMethods(),x.callbacks.listLoyaltyProgramTier({})],[4,Promise.all(e)];case 2:return n=t.sent(),r=n[0],i=n[1],o=n[2],x.loyaltyWidget=r instanceof m?r:new m(r||{}),x.earningMethods=i.map(function(e){return new d(e)}),x.tiers=o||[],[4,G()];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 W(!0),[7];case 6:return[2]}})})},[]),s(function(){if(window.IkasEvents){var e=function(e){var t,n=null===(t=e.data)||void 0===t?void 0:t.customer;n&&(x.ikasEventUser=n),x.userRefreshTrigger++,x.cartRefreshTrigger++},t=function(e){var t,n,r=null===(n=null===(t=e.data)||void 0===t?void 0:t.cart)||void 0===n?void 0:n.id;r&&(x.cartId=r),x.cartRefreshTrigger++},n={CUSTOMER_LOGIN:e,CUSTOMER_VISIT:e,CUSTOMER_LOGOUT:function(){x.ikasEventUser=null,x.userRefreshTrigger++,x.cartRefreshTrigger++},ADD_TO_CART:t,REMOVE_FROM_CART:t,PAGE_VIEW:function(e){var t,n,r=null===(t=e.data)||void 0===t?void 0:t.customer;if(r){var i=!x.ikasEventUser,o=(null===(n=x.ikasEventUser)||void 0===n?void 0:n.subscriptionStatus)!==r.subscriptionStatus;(i||o)&&(x.ikasEventUser=r,x.userRefreshTrigger++,x.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)}}},[x]),s(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(!x.callbacks||!(null===(o=x.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([x.callbacks.getLoyaltyCustomerInfo(),x.callbacks.listLoyaltyProgramPointHistory({})])];case 2:return e=t.sent(),n=e[0],r=e[1],x.user=n?new l(n):null,x.pointHistory=r?r.map(function(e){return new u(e)}):[],[3,4];case 3:return i=t.sent(),console.error("Failed to fetch user data",i),[3,4];case 4:return[2]}})})},[null===(O=x.ikasEventUser)||void 0===O?void 0:O.id,x.userRefreshTrigger]),s(function(){e(void 0,void 0,void 0,function(){var e,n;return t(this,function(t){switch(t.label){case 0:if(!x.callbacks)return[3,5];t.label=1;case 1:return t.trys.push([1,4,,5]),[4,x.callbacks.listSpendingMethodsByCartId(x.cartId)];case 2:return e=t.sent(),x.spendingMethods=e.map(function(e){return new f(e)}),[4,G()];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[2]}})})},[x.cartId,x.cartRefreshTrigger]);var $=function(e){x.selectedScreen=e},B=function(){x.setWidgetMode(g.MINI_MODE),setTimeout(function(){x.selectedScreen=p.MAIN_SCREEN},300)};s(function(){return x.currentWidgetMode===g.WIDGET_MODE?document.body.style.overflow="hidden":document.body.style.overflow="",function(){document.body.style.overflow=""}},[x.currentWidgetMode]);var F=x.selectedScreen===p.MAIN_SCREEN,V=o(null),z=V[0],H=V[1];s(function(){x.selectedScreen!==p.MAIN_SCREEN&&H(x.selectedScreen)},[x.selectedScreen]);var Y=F?z:x.selectedScreen,q=x.loyaltyWidget.settings.position||v.RIGHT,J=x.loyaltyWidget.settings.type||E.DRAWER;return U?i.createElement(a,{i18n:_},i.createElement(S,{$layoutType:J,$widgetPosition:q,$widgetMode:x.currentWidgetMode,$position:(null==L?void 0:L.position)||(null===(P=window.ikasLoyaltyWidgetConfig)||void 0===P?void 0:P.position)||"fixed",onClick:function(){x.currentWidgetMode===g.WIDGET_MODE&&B()}},i.createElement(A,{$isVisible:x.currentWidgetMode===g.MINI_MODE,$widgetPosition:q},i.createElement(T,{viewModel:x}),i.createElement(w,{viewModel:x})),i.createElement(N,{$layoutType:J,$isOpen:x.currentWidgetMode===g.WIDGET_MODE,$widgetPosition:q,onClick:function(e){return e.stopPropagation()}},i.createElement(D,{$isActive:F,$isMain:!0},i.createElement(C,{viewModel:x,onClose:B,onNavigate:$})),i.createElement(D,{$isActive:!F,$isMain:!1},function(){switch(Y){case p.CREDIT_SPENDING_METHODS_SCREEN:return i.createElement(I,{viewModel:x,onBack:function(){return $(p.MAIN_SCREEN)},onClose:B});case p.CREDIT_EARNING_METHODS_SCREEN:return i.createElement(b,{viewModel:x,onBack:function(){return $(p.MAIN_SCREEN)},onClose:B});case p.CREDIT_HISTORY_SCREEN:return i.createElement(M,{viewModel:x,onBack:function(){return $(p.MAIN_SCREEN)},onClose:B});case p.LOYALTY_LEVEL_SCREEN:return i.createElement(k,{viewModel:x,onBack:function(){return $(p.MAIN_SCREEN)},onClose:B});default:return null}}())))):null});export{O as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from
|
|
1
|
+
import{__awaiter as e,__generator as t,__assign as o}from'./../../../ext/tslib/tslib.es6.mjs.js';import{observer as n}from"mobx-react";import i 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 c}from"../../../assets/icons/x-close.js";import{EarningMethodTypeEnum as l,WidgetMode as a}from"../../../models/types/index.js";import m from"../main-screen/earning-methods-section/index.js";import{Container as d,Header as u,IconButton as f,Title as E,Content as p}from"./style.js";var g=n(function(n){var g=n.viewModel,v=n.onBack,b=n.onClose,k=r().t;return i.createElement(d,null,i.createElement(u,null,i.createElement(f,{onClick:v},i.createElement(s,null)),i.createElement(E,null,k("screens.creditEarningMethods")),i.createElement(f,{onClick:b},i.createElement(c,null))),i.createElement(p,null,i.createElement(m,{containerStyle:{paddingRight:16,paddingLeft:16},viewModel:g,getActionProps:function(n){return n.methodType===l.CUSTOMER_REGISTER?{actionText:k("common.create"),onClick:function(){g.storeUrl&&(g.setWidgetMode(a.MINI_MODE),window.location.href="".concat(g.storeUrl,"/account/register"))}}:n.methodType===l.ENABLE_SUBSCRIPTION?{loading:g.isActionLoading,actionText:k("common.allow"),onClick:function(){return e(void 0,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:return(null===(e=g.callbacks)||void 0===e?void 0:e.subscribeToMarketingNotifications)?(g.isActionLoading=!0,[4,g.callbacks.subscribeToMarketingNotifications()]):[3,2];case 1:t.sent()&&(g.ikasEventUser=o(o({},g.ikasEventUser),{subscriptionStatus:"SUBSCRIBED"}),g.userRefreshTrigger++),g.isActionLoading=!1,t.label=2;case 2:return[2]}})})}}:null}})))});export{g as default};
|