@ikas/storefront 4.16.2 → 4.16.4
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/analytics/analytics.js +1 -1
- package/build/analytics/head/index.js +1 -1
- package/build/components/checkout/components/cart-summary/index.d.ts +0 -7
- package/build/components/checkout/components/cart-summary/index.js +1 -1
- package/build/components/checkout/components/cart-summary/loyalty/icons.d.ts +4 -0
- package/build/components/checkout/components/cart-summary/loyalty/icons.js +1 -0
- package/build/components/checkout/components/cart-summary/loyalty/index.d.ts +21 -0
- package/build/components/checkout/components/cart-summary/loyalty/index.js +1 -0
- package/build/components/checkout/components/cart-summary/loyalty/style.module.scss.js +1 -0
- package/build/components/checkout/components/cart-summary/style.module.scss.js +1 -1
- package/build/components/checkout/components/quick-registration/index.js +1 -1
- package/build/components/checkout/components/quick-registration/model.d.ts +5 -0
- package/build/components/checkout/components/quick-registration/model.js +1 -1
- package/build/components/checkout/components/quick-registration/verification-sent.d.ts +7 -0
- package/build/components/checkout/components/quick-registration/verification-sent.js +1 -0
- package/build/components/checkout/components/step-container/index.js +1 -1
- package/build/components/checkout/components/svg/star-loyalty.js +1 -1
- package/build/components/checkout/components/tkpay/index.js +1 -1
- package/build/components/checkout/index.d.ts +1 -0
- package/build/components/checkout/index.js +1 -1
- package/build/components/checkout/model.d.ts +50 -5
- package/build/components/checkout/model.js +1 -1
- package/build/components/checkout/steps/step-info/index.js +1 -1
- package/build/components/checkout/steps/step-payment/index.js +1 -1
- package/build/components/checkout/steps/step-payment/payment-gateways/index.js +1 -1
- package/build/components/checkout/steps/step-payment/payment-gateways/miles-smiles/header.d.ts +4 -0
- package/build/components/checkout/steps/step-payment/payment-gateways/miles-smiles/header.js +1 -0
- package/build/components/checkout/steps/step-payment/payment-gateways/miles-smiles/index.js +1 -1
- package/build/components/checkout/steps/step-payment/payment-gateways/miles-smiles/login-required.js +1 -1
- package/build/components/checkout/steps/step-payment/payment-gateways/miles-smiles/miles-smiles-logo.d.ts +7 -0
- package/build/components/checkout/steps/step-payment/payment-gateways/miles-smiles/miles-smiles-logo.js +1 -0
- package/build/components/checkout/steps/step-payment/payment-gateways/miles-smiles/style.module.scss.js +1 -1
- package/build/components/checkout/steps/step-payment/payment-gateways/store-credit/index.js +1 -1
- package/build/components/page/index.js +1 -1
- package/build/components/page/widgets/loyaltyWidget.d.ts +7 -2
- package/build/components/page/widgets/loyaltyWidget.js +1 -1
- package/build/models/data/cart/index.d.ts +2 -1
- package/build/models/data/cart/index.js +1 -1
- package/build/models/data/order/line-item/bundle-product-settings/index.d.ts +2 -0
- package/build/models/data/order/line-item/bundle-product-settings/index.js +1 -1
- package/build/models/data/theme-json/index.js +1 -1
- package/build/pages/checkout.js +1 -1
- package/package.json +12 -12
- package/build/components/checkout/components/svg/arrow-loyalty.d.ts +0 -6
- package/build/components/checkout/components/svg/arrow-loyalty.js +0 -1
- package/build/components/checkout/components/svg/arrow-right-loyalty.d.ts +0 -6
- package/build/components/checkout/components/svg/arrow-right-loyalty.js +0 -1
- package/build/components/checkout/components/svg/left-arrow-loyalty.d.ts +0 -6
- package/build/components/checkout/components/svg/left-arrow-loyalty.js +0 -1
- package/build/components/checkout/steps/step-payment/payment-gateways/miles-smiles/thy-logo.d.ts +0 -8
- package/build/components/checkout/steps/step-payment/payment-gateways/miles-smiles/thy-logo.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{observer as t}from"mobx-react-lite";import"../../../../../models/data/blog/category/index.js";import"../../../../../models/data/blog/content/index.js";import"../../../../../models/data/blog/meta-data/index.js";import"../../../../../models/data/blog/tag/index.js";import"../../../../../models/data/blog/index.js";import"../../../../../models/data/brand/index.js";import{IkasPaymentMethodType as a,IkasPaymentGatewayTransactionFeeType as n,IkasPaymentGatewayAdditionalPriceType as o,IkasPaymentGatewayType as i}from"@ikas/storefront-models";import"mobx";import"../../../../../models/data/campaign-offer/index.js";import"../../../../../models/data/cart/campaign-offer/index.js";import"../../../../../models/data/cart/index.js";import"../../../../../models/data/category/path-item/index.js";import"../../../../../models/data/category/index.js";import"../../../../../models/data/checkout/index.js";import"../../../../../models/data/checkout-settings/index.js";import"../../../../../models/data/city/index.js";import"../../../../../models/data/country/index.js";import"../../../../../models/data/customer/address/region/index.js";import"../../../../../models/data/customer/address/index.js";import"../../../../../models/data/customer/address/ikas-localized-customer-address.js";import"../../../../../models/data/customer/attribute/index.js";import"../../../../../models/data/customer/review/summary/index.js";import"../../../../../models/data/customer/review/index.js";import"../../../../../models/data/customer/index.js";import"../../../../../models/data/customer-form-data-input/index.js";import"../../../../../models/data/district/index.js";import"../../../../../models/data/favorite-product/index.js";import"../../../../../models/data/filter-category/index.js";import"../../../../../models/data/html-meta-data/index.js";import"../../../../../models/data/image/index.js";import"../../../../../models/data/order/address/region/index.js";import"../../../../../models/data/order/address/index.js";import"../../../../../models/data/order/line-item/option/value/index.js";import"../../../../../models/data/order/line-item/variant/value/index.js";import"../../../../../models/data/order/line-item/variant/index.js";import"../../../../../models/data/order/line-item/index.js";import"../../../../../models/data/order/order-transaction-with-prices/index.js";import"../../../../../models/data/order/package/index.js";import"../../../../../models/data/order/transaction/index.js";import"../../../../../models/data/order/index.js";import"../../../../../models/data/payment-gateway/index.js";import"../../../../../models/data/product/attribute-value/index.js";import"../../../../../models/data/product/filter/index.js";import"../../../../../models/data/product/campaign-offer/index.js";import"../../../../../models/data/product/option-set/option/index.js";import"../../../../../models/data/product/option-set/index.js";import"../../../../../models/data/product/stock-location/index.js";import"../../../../../models/data/product/variant/price/index.js";import"../../../../../models/data/product/variant/index.js";import"../../../../../models/data/variant-type/index.js";import"../../../../../models/data/product/index.js";import"../../../../../models/data/raffle/index.js";import"../../../../../models/data/shipping-zone/state/city/district/region/index.js";import"../../../../../models/data/state/index.js";import"../../../../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../../../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../../../../models/data/storefront-popup/index.js";import"../../../../../models/data/theme-json/index.js";import"../../../../../models/data/theme-json/component/index.js";import"../../../../../models/data/theme-json/custom-data/index.js";import"../../../../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import{CreditCardForm as r}from"../../../components/credit-card-form/index.js";import{Installments as c}from"./installments/index.js";import l from"../../../components/select-box/index.js";import m from"./style.module.scss.js";import{IkasStorefrontConfig as s}from"@ikas/storefront-config";import{formatCurrency as d}from"../../../../../utils/currency.js";import{createTranslationInputData as y,useTranslation as p}from"../../../../../utils/i18n.js";import u from"../../../components/svg/external.js";import v from"next/dynamic";import P from"../../../components/credit-card-form/model.js";import E from"../../../components/master-pass/credit-card-form/index.js";import{Toggle as f}from"../../../components/toggle/index.js";import g from"../../../components/select-box/style.module.scss.js";import x from"../../../components/master-pass/payment-gateway/svg/master-card.js";import C from"../../../components/master-pass/payment-gateway/svg/troy.js";import k from"../../../components/master-pass/payment-gateway/svg/visa.js";import{Checkbox as h}from"../../../components/checkbox/index.js";import j from"../../../components/svg/info.js";var w=v((function(){return import("../../../components/stripe/index.js").then((function(e){return e.default}))})),G=v((function(){return import("../../../components/adyen/index.js").then((function(e){return e.Adyen}))})),T=v((function(){return import("../../../components/klarna/index.js").then((function(e){return e.Klarna}))})),N=v((function(){return import("../../../components/hepsipay/index.js").then((function(e){return e.HepsiPay}))})),I=v((function(){return import("../../../components/iyzico/index.js").then((function(e){return e.Iyzico}))})),S=v((function(){return import("../../../components/tkpay/index.js").then((function(e){return e.TkPay}))})),b=t((function(v){var b=v.vm,M=p().t,A=function(t){return e.createElement("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",flexWrap:"wrap"}},t.children)},R=function(t){return e.createElement("div",{className:m.AdditionalPrice},t.children)},B=function(e){return 0===e.amount?"":"".concat(e.amountType===n.AMOUNT?d(e.amount,b.checkout.currencyCode,b.checkout.currencySymbol):" %"+e.amount).concat(e.type===o.DECREMENT?" "+M("checkout-page:paymentMethodDiscount"):" "+M("checkout-page:paymentMethodAdditionalPrice"))},V=function(e){return"STRIPE"===e.code||"STRIPE_EU"===e.code},z=function(){var t,a=b.selectedPaymentGatewayIndex===b.klarnaPaymentGatewayIndex;return b.klarnaPaymentGateway?e.createElement("div",{className:g.SelectBoxContainer},e.createElement("div",{className:"".concat(g.SelectBox," ").concat(a?g.Selected:""),onClick:function(){b.setPaymentGateway(b.klarnaPaymentGatewayIndex),b.mpVM.selectedCard=void 0}},e.createElement("div",{className:g.TopContent},e.createElement(f,{value:a,label:b.klarnaPaymentGateway.name,removePadding:!0}),e.createElement("div",{className:g.RightContent},(null===(t=b.klarnaPaymentGateway.additionalPrices)||void 0===t?void 0:t.length)?e.createElement(R,null,B(b.klarnaPaymentGateway.additionalPrices[0])):e.createElement(A,null,!!b.klarnaPaymentGateway.logoUrl&&e.createElement("div",{className:m.PaymentLogoContainer},e.createElement("img",{src:b.klarnaPaymentGateway.logoUrl}))))),e.createElement("div",{className:"".concat(a?g.BottomContent:""," ").concat(a?"":m.Hidden)},e.createElement(T,{vm:b}),b.klarnaError&&e.createElement("div",{className:m.ErrorMessage},b.klarnaError.data)))):null},D=function(){var t,a=b.selectedPaymentGatewayIndex===b.hepsiPayPaymentGatewayIndex;return b.hepsiPayPaymentGateway?e.createElement("div",{className:g.SelectBoxContainer},e.createElement("div",{className:"".concat(g.SelectBox," ").concat(a?g.Selected:""),onClick:function(){b.setPaymentGateway(b.hepsiPayPaymentGatewayIndex),b.mpVM.selectedCard=void 0}},e.createElement("div",{className:g.TopContent},e.createElement(f,{value:a,label:"Kredi / Banka Kartı - Hepsipay",removePadding:!0}),e.createElement("div",{className:g.RightContent},(null===(t=b.hepsiPayPaymentGateway.additionalPrices)||void 0===t?void 0:t.length)?e.createElement(R,null,B(b.hepsiPayPaymentGateway.additionalPrices[0])):e.createElement(A,null,!!b.hepsiPayPaymentGateway.logoUrl&&e.createElement("div",{className:m.PaymentLogoContainer},e.createElement("img",{src:b.hepsiPayPaymentGateway.logoUrl}))))),e.createElement("div",{className:"".concat(a?g.BottomContent:""," ").concat(a?"":m.Hidden)},e.createElement(N,{vm:b})))):null},L=function(){var t=b.selectedPaymentGatewayIndex===b.adyenPaymentGatewayIndex;return b.adyenPaymentGateway?e.createElement("div",{className:g.SelectBoxContainer},e.createElement("div",{className:"".concat(g.SelectBox," ").concat(g.AdyenSelectBox),onClick:function(){b.setPaymentGateway(b.adyenPaymentGatewayIndex),b.mpVM.selectedCard=void 0}},e.createElement("div",{className:g.TopContent}),e.createElement("div",{className:"".concat(t?g.BottomContent:""," "),style:{paddingTop:0}},e.createElement(G,{vm:b,isSelected:t})))):null},U=function(){var t,a=b.selectedPaymentGatewayIndex===b.payPalPaymentGatewayIndex;return b.payPalPaymentGateway?e.createElement("div",{className:g.SelectBoxContainer},e.createElement("div",{className:"".concat(g.SelectBox," ").concat(a?g.Selected:""),onClick:function(){b.setPaymentGateway(b.payPalPaymentGatewayIndex),b.mpVM.selectedCard=void 0}},e.createElement("div",{className:g.TopContent},e.createElement(f,{value:a,label:b.payPalPaymentGateway.name,removePadding:!0}),e.createElement("div",{className:g.RightContent},(null===(t=b.payPalPaymentGateway.additionalPrices)||void 0===t?void 0:t.length)?e.createElement(R,null,B(b.payPalPaymentGateway.additionalPrices[0])):e.createElement(A,null,!!b.payPalPaymentGateway.logoUrl&&e.createElement("div",{className:m.PaymentLogoContainer},e.createElement("img",{src:b.payPalPaymentGateway.logoUrl}))))))):null},_=t((function(t){var a,n=t.vm;e.useEffect((function(){n.isTermsAndConditionsChecked&&n.setShowIyzicoContainer(!0)}),[n.isTermsAndConditionsChecked]);var o=e.useCallback((function(e){e.stopPropagation(),n.policyModalTitle=M("checkout-page:privacyPolicy"),n.policyModalText=n.privacyPolicy}),[n,n.privacyPolicy]),i=e.useCallback((function(e){e.stopPropagation(),n.policyModalTitle=M("checkout-page:termsOfService"),n.policyModalText=n.termsOfService}),[n,n.termsOfService]),r=s.getTranslations()["checkout-page"],c=y(r.ackPoliciesSentence).map((function(t){return t.isVariable?e.createElement("span",{className:[m.TermsLabelSpan,n.isErrorsVisible&&!n.isTermsAndConditionsChecked?m.Error:""].join(" "),onClick:"{{ ackPrivacyPolicy }}"===t.value?o:i},"{{ ackPrivacyPolicy }}"===t.value?M("checkout-page:ackPrivacyPolicy"):M("checkout-page:ackTermsOfService")):t.value})),l=n.selectedPaymentGatewayIndex===n.iyzicoPaymentGatewayIndex;return n.iyzicoPaymentGateway?e.createElement("div",{className:g.SelectBoxContainer},e.createElement("div",{className:"".concat(g.SelectBox," ").concat(l?g.Selected:""," ").concat(m.IyzicoBottomContent),onClick:function(){n.setPaymentGateway(n.iyzicoPaymentGatewayIndex),n.mpVM.selectedCard=void 0}},e.createElement("div",{className:g.TopContent},e.createElement(f,{value:l,label:M("checkout-page:creditCard"),removePadding:!0}),e.createElement("div",{className:g.RightContent},(null===(a=n.iyzicoPaymentGateway.additionalPrices)||void 0===a?void 0:a.length)?e.createElement(R,null,B(n.iyzicoPaymentGateway.additionalPrices[0])):e.createElement(A,null,!!n.iyzicoPaymentGateway.logoUrl&&e.createElement("div",{className:m.PaymentLogoContainer},e.createElement("img",{src:n.iyzicoPaymentGateway.logoUrl}))))),e.createElement("div",{className:"".concat(l?g.BottomContent:""," ").concat(l?"":m.Hidden," ")},e.createElement("div",{className:m.IyzicoCheckboxContainer},e.createElement(h,{value:n.isTermsAndConditionsChecked,hasError:n.isErrorsVisible&&!n.isTermsAndConditionsChecked,label:e.createElement(e.Fragment,null,c),removePadding:!0,onChange:n.onTermsAndConditionsCheckedChange})),!n.isTermsAndConditionsChecked&&e.createElement("div",{className:[m.IyzicoDescription,n.iyzicoResponse?m.WithBottomMargin:""].join(" ")},e.createElement(j,null),M("checkout-page:iyzicoDescription")),n.iyzicoResponse&&e.createElement(I,{vm:n})))):null})),O=t((function(t){var a,n=t.vm;e.useEffect((function(){n.isTermsAndConditionsChecked&&n.setShowTkPayContainer(!0)}),[n.isTermsAndConditionsChecked]);var o=e.useCallback((function(e){e.stopPropagation(),n.policyModalTitle=M("checkout-page:privacyPolicy"),n.policyModalText=n.privacyPolicy}),[n,n.privacyPolicy]),i=e.useCallback((function(e){e.stopPropagation(),n.policyModalTitle=M("checkout-page:termsOfService"),n.policyModalText=n.termsOfService}),[n,n.termsOfService]),r=s.getTranslations()["checkout-page"],c=y(r.ackPoliciesSentence).map((function(t){return t.isVariable?e.createElement("span",{className:[m.TermsLabelSpan,n.isErrorsVisible&&!n.isTermsAndConditionsChecked?m.Error:""].join(" "),onClick:"{{ ackPrivacyPolicy }}"===t.value?o:i},"{{ ackPrivacyPolicy }}"===t.value?M("checkout-page:ackPrivacyPolicy"):M("checkout-page:ackTermsOfService")):t.value})),l=n.selectedPaymentGatewayIndex===n.tkPayPaymentGatewayIndex;return n.tkPayPaymentGateway?e.createElement("div",{className:g.SelectBoxContainer},e.createElement("div",{className:"".concat(g.SelectBox," ").concat(l?g.Selected:""," ").concat(m.TkPayBottomContent),onClick:function(){n.setPaymentGateway(n.tkPayPaymentGatewayIndex),n.mpVM.selectedCard=void 0}},e.createElement("div",{className:g.TopContent},e.createElement(f,{value:l,label:n.tkPayPaymentGateway.name,removePadding:!0}),e.createElement("div",{className:g.RightContent},(null===(a=n.tkPayPaymentGateway.additionalPrices)||void 0===a?void 0:a.length)?e.createElement(R,null,B(n.tkPayPaymentGateway.additionalPrices[0])):e.createElement(A,null,!!n.tkPayPaymentGateway.logoUrl&&e.createElement("div",{className:m.PaymentLogoContainer},e.createElement("img",{src:n.tkPayPaymentGateway.logoUrl}))))),e.createElement("div",{className:"".concat(l?g.BottomContent:""," ").concat(l?"":m.Hidden," ")},e.createElement("div",{className:m.TkPayCheckboxContainer},e.createElement(h,{value:n.isTermsAndConditionsChecked,hasError:n.isErrorsVisible&&!n.isTermsAndConditionsChecked,label:e.createElement(e.Fragment,null,c),removePadding:!0,onChange:n.onTermsAndConditionsCheckedChange})),!n.isTermsAndConditionsChecked&&e.createElement("div",{className:[m.TkPayDescription,n.tkPayResponse?m.WithBottomMargin:""].join(" ")},e.createElement(j,null),M("checkout-page:tkPayDescription")),n.tkPayResponse&&e.createElement(S,{vm:n})))):null}));return e.createElement(e.Fragment,null,!!b.mpVM.cards.length&&b.mpVM.cards.map((function(t,n){var o,r=b.paymentGateways.find((function(e){return e.id===t.paymentGatewayId})),s=e.createElement("button",{className:m.MasterPassSelectBoxDeleteButton,onClick:function(e){e.stopPropagation(),b.mpVM.deleteCard({store:b.store,checkout:b.checkout,card:t})}},M("checkout-page:masterPass.paymentGatewaySelectBox.delete")),d=function(e){return t.Value1.startsWith(e)},y=d("4"),p=d("5")||d("6"),u=d("9"),v=e.createElement("div",{style:{display:"flex",alignItems:"center"}},e.createElement("span",{className:m.MasterPassSelectBoxLabelLogo},y&&e.createElement(k,null),p&&e.createElement(x,null),u&&e.createElement(C,null)),t.Name," ",t.Value1),E=(null==r?void 0:r.id)&&r.paymentMethodType===a.CREDIT_CARD&&r.type===i.INTERNAL?b.installmentInfo&&e.createElement(c,{vm:b}):void 0;return e.createElement(l,{key:n,isSelected:(null===(o=b.mpVM.selectedCard)||void 0===o?void 0:o.UniqueId)===t.UniqueId,label:v,rightContent:s,bottomContent:E,onClick:function(){var e;(null===(e=b.mpVM.selectedCard)||void 0===e?void 0:e.UniqueId)!==t.UniqueId&&(b.checkout.selectedPaymentGateway=null,b.cardData=new P,b.installmentInfo=void 0,b.mpVM.selectedCard=t,t.Value1&&t.paymentGatewayId&&b.checkout.totalFinalPrice&&b.retrieveInstallmentInfo({input:{orderId:b.checkout.id,binNumber:t.Value1.slice(0,8),paymentGatewayId:t.paymentGatewayId,price:b.checkout.totalFinalPrice,currencyCode:b.checkout.currencyCode}}))}})})),b.paymentGateways.filter((function(e){return"in-store"!==b.deliveryMethod&&!b.isDigitalOnly||e.paymentMethodType!==a.CASH_ON_DELIVERY&&e.paymentMethodType!==a.CREDIT_CARD_ON_DELIVERY})).map((function(t,n){var o,s;if(b.useMilesSmiles&&t.id!==(null===(o=b.milesSmilesPaymentGateway)||void 0===o?void 0:o.id))return null;if(function(e){return"KLARNA"===e.code}(t)&&b.klarnaPaymentGateway)return z();if(function(e){return"ADYEN_PLATFORM"===e.code}(t)&&b.adyenPaymentGateway)return L();if(function(e){return"PAYPAL"===e.code}(t)&&b.payPalPaymentGateway)return U();if(function(e){return"HEPSIPAY"===e.code}(t)&&b.hepsiPayPaymentGateway)return D();if(function(e){return"IYZICO"===e.code}(t)&&b.iyzicoPaymentGateway)return e.createElement(_,{vm:b,key:t.id});if(function(e){var t,a;return"TK_PAY"===e.code&&"true"===(null===(a=null===(t=e.settings)||void 0===t?void 0:t.find((function(e){return"tkpay_use_checkout_form"===e.label})))||void 0===a?void 0:a.value)}(t)&&b.tkPayPaymentGateway)return e.createElement(O,{vm:b,key:t.id});var d=t.paymentMethodType===a.CREDIT_CARD&&t.type===i.INTERNAL?e.createElement(e.Fragment,null,V(t)?e.createElement(e.Fragment,null,e.createElement(w,{vm:b,pg:t}),b.stripeError&&e.createElement("div",{className:m.ErrorMessage},b.stripeError.data)):e.createElement("div",null,e.createElement(r,{vm:b}),b.isPaymentGatewayHasMasterPass&&e.createElement(E,{vm:b}),b.installmentInfo&&e.createElement(c,{vm:b}))):t.description?e.createElement(e.Fragment,null,t.type===i.EXTERNAL&&e.createElement("div",{style:{height:"52px",display:"flex",justifyContent:"center",margin:"24px 0"}},e.createElement(u,null)),e.createElement("div",{dangerouslySetInnerHTML:{__html:t.description}})):void 0;return e.createElement(l,{key:t.id,label:t.paymentMethodType===a.CREDIT_CARD&&t.type===i.INTERNAL?V(t)?t.name:M("checkout-page:creditCard"):t.name,isSelected:b.selectedPaymentGatewayIndex===n,rightContent:(null===(s=t.additionalPrices)||void 0===s?void 0:s.length)?e.createElement(R,null,B(t.additionalPrices[0])):e.createElement(A,null,!!t.logoUrl&&e.createElement("div",{className:m.PaymentLogoContainer},e.createElement("img",{src:t.logoUrl}))),bottomContent:d,onClick:function(){b.selectedPaymentGatewayIndex!==n&&(b.setPaymentGateway(n),b.mpVM.selectedCard=void 0)}})})))}));export{b as PaymentGateways};
|
|
1
|
+
import*as e from"react";import{observer as t}from"mobx-react-lite";import"../../../../../models/data/blog/category/index.js";import"../../../../../models/data/blog/content/index.js";import"../../../../../models/data/blog/meta-data/index.js";import"../../../../../models/data/blog/tag/index.js";import"../../../../../models/data/blog/index.js";import"../../../../../models/data/brand/index.js";import{IkasPaymentMethodType as a,IkasPaymentGatewayTransactionFeeType as n,IkasPaymentGatewayAdditionalPriceType as o,IkasPaymentGatewayType as i}from"@ikas/storefront-models";import"mobx";import"../../../../../models/data/campaign-offer/index.js";import"../../../../../models/data/cart/campaign-offer/index.js";import"../../../../../models/data/cart/index.js";import"../../../../../models/data/category/path-item/index.js";import"../../../../../models/data/category/index.js";import"../../../../../models/data/checkout/index.js";import"../../../../../models/data/checkout-settings/index.js";import"../../../../../models/data/city/index.js";import"../../../../../models/data/country/index.js";import"../../../../../models/data/customer/address/region/index.js";import"../../../../../models/data/customer/address/index.js";import"../../../../../models/data/customer/address/ikas-localized-customer-address.js";import"../../../../../models/data/customer/attribute/index.js";import"../../../../../models/data/customer/review/summary/index.js";import"../../../../../models/data/customer/review/index.js";import"../../../../../models/data/customer/index.js";import"../../../../../models/data/customer-form-data-input/index.js";import"../../../../../models/data/district/index.js";import"../../../../../models/data/favorite-product/index.js";import"../../../../../models/data/filter-category/index.js";import"../../../../../models/data/html-meta-data/index.js";import"../../../../../models/data/image/index.js";import"../../../../../models/data/order/address/region/index.js";import"../../../../../models/data/order/address/index.js";import"../../../../../models/data/order/line-item/option/value/index.js";import"../../../../../models/data/order/line-item/variant/value/index.js";import"../../../../../models/data/order/line-item/variant/index.js";import"../../../../../models/data/order/line-item/index.js";import"../../../../../models/data/order/order-transaction-with-prices/index.js";import"../../../../../models/data/order/package/index.js";import"../../../../../models/data/order/transaction/index.js";import"../../../../../models/data/order/index.js";import"../../../../../models/data/payment-gateway/index.js";import"../../../../../models/data/product/attribute-value/index.js";import"../../../../../models/data/product/filter/index.js";import"../../../../../models/data/product/campaign-offer/index.js";import"../../../../../models/data/product/option-set/option/index.js";import"../../../../../models/data/product/option-set/index.js";import"../../../../../models/data/product/stock-location/index.js";import"../../../../../models/data/product/variant/price/index.js";import"../../../../../models/data/product/variant/index.js";import"../../../../../models/data/variant-type/index.js";import"../../../../../models/data/product/index.js";import"../../../../../models/data/raffle/index.js";import"../../../../../models/data/shipping-zone/state/city/district/region/index.js";import"../../../../../models/data/state/index.js";import"../../../../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../../../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../../../../models/data/storefront-popup/index.js";import"../../../../../models/data/theme-json/index.js";import"../../../../../models/data/theme-json/component/index.js";import"../../../../../models/data/theme-json/custom-data/index.js";import"../../../../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import{CreditCardForm as r}from"../../../components/credit-card-form/index.js";import{Installments as l}from"./installments/index.js";import c from"../../../components/select-box/index.js";import m from"./style.module.scss.js";import{IkasStorefrontConfig as s}from"@ikas/storefront-config";import{formatCurrency as d}from"../../../../../utils/currency.js";import{createTranslationInputData as y,useTranslation as p}from"../../../../../utils/i18n.js";import u from"../../../components/svg/external.js";import v from"next/dynamic";import P from"../../../components/credit-card-form/model.js";import E from"../../../components/master-pass/credit-card-form/index.js";import{Toggle as f}from"../../../components/toggle/index.js";import g from"../../../components/select-box/style.module.scss.js";import x from"../../../components/master-pass/payment-gateway/svg/master-card.js";import C from"../../../components/master-pass/payment-gateway/svg/troy.js";import k from"../../../components/master-pass/payment-gateway/svg/visa.js";import{Checkbox as h}from"../../../components/checkbox/index.js";import j from"../../../components/svg/info.js";var w=v((function(){return import("../../../components/stripe/index.js").then((function(e){return e.default}))})),G=v((function(){return import("../../../components/adyen/index.js").then((function(e){return e.Adyen}))})),T=v((function(){return import("../../../components/klarna/index.js").then((function(e){return e.Klarna}))})),N=v((function(){return import("../../../components/hepsipay/index.js").then((function(e){return e.HepsiPay}))})),I=v((function(){return import("../../../components/iyzico/index.js").then((function(e){return e.Iyzico}))})),S=v((function(){return import("../../../components/tkpay/index.js").then((function(e){return e.TkPay}))})),M=t((function(v){var M=v.vm,b=p().t,A=function(t){return e.createElement("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",flexWrap:"wrap"}},t.children)},R=function(t){return e.createElement("div",{className:m.AdditionalPrice},t.children)},B=function(e){return 0===e.amount?"":"".concat(e.amountType===n.AMOUNT?d(e.amount,M.checkout.currencyCode,M.checkout.currencySymbol):" %"+e.amount).concat(e.type===o.DECREMENT?" "+b("checkout-page:paymentMethodDiscount"):" "+b("checkout-page:paymentMethodAdditionalPrice"))},V=function(e){return"STRIPE"===e.code||"STRIPE_EU"===e.code},D=function(){var t,a=M.selectedPaymentGatewayIndex===M.klarnaPaymentGatewayIndex;return M.klarnaPaymentGateway?e.createElement("div",{className:g.SelectBoxContainer},e.createElement("div",{className:"".concat(g.SelectBox," ").concat(a?g.Selected:""),onClick:function(){M.setPaymentGateway(M.klarnaPaymentGatewayIndex),M.mpVM.selectedCard=void 0}},e.createElement("div",{className:g.TopContent},e.createElement(f,{value:a,label:M.klarnaPaymentGateway.name,removePadding:!0}),e.createElement("div",{className:g.RightContent},(null===(t=M.klarnaPaymentGateway.additionalPrices)||void 0===t?void 0:t.length)?e.createElement(R,null,B(M.klarnaPaymentGateway.additionalPrices[0])):e.createElement(A,null,!!M.klarnaPaymentGateway.logoUrl&&e.createElement("div",{className:m.PaymentLogoContainer},e.createElement("img",{src:M.klarnaPaymentGateway.logoUrl}))))),e.createElement("div",{className:"".concat(a?g.BottomContent:""," ").concat(a?"":m.Hidden)},e.createElement(T,{vm:M}),M.klarnaError&&e.createElement("div",{className:m.ErrorMessage},M.klarnaError.data)))):null},z=function(){var t,a=M.selectedPaymentGatewayIndex===M.hepsiPayPaymentGatewayIndex;return M.hepsiPayPaymentGateway?e.createElement("div",{className:g.SelectBoxContainer},e.createElement("div",{className:"".concat(g.SelectBox," ").concat(a?g.Selected:""),onClick:function(){M.setPaymentGateway(M.hepsiPayPaymentGatewayIndex),M.mpVM.selectedCard=void 0}},e.createElement("div",{className:g.TopContent},e.createElement(f,{value:a,label:"Kredi / Banka Kartı - Hepsipay",removePadding:!0}),e.createElement("div",{className:g.RightContent},(null===(t=M.hepsiPayPaymentGateway.additionalPrices)||void 0===t?void 0:t.length)?e.createElement(R,null,B(M.hepsiPayPaymentGateway.additionalPrices[0])):e.createElement(A,null,!!M.hepsiPayPaymentGateway.logoUrl&&e.createElement("div",{className:m.PaymentLogoContainer},e.createElement("img",{src:M.hepsiPayPaymentGateway.logoUrl}))))),e.createElement("div",{className:"".concat(a?g.BottomContent:""," ").concat(a?"":m.Hidden)},e.createElement(N,{vm:M})))):null},L=function(){var t=M.selectedPaymentGatewayIndex===M.adyenPaymentGatewayIndex;return M.adyenPaymentGateway?e.createElement("div",{className:g.SelectBoxContainer},e.createElement("div",{className:"".concat(g.SelectBox," ").concat(g.AdyenSelectBox),onClick:function(){M.setPaymentGateway(M.adyenPaymentGatewayIndex),M.mpVM.selectedCard=void 0}},e.createElement("div",{className:g.TopContent}),e.createElement("div",{className:"".concat(t?g.BottomContent:""," "),style:{paddingTop:0}},e.createElement(G,{vm:M,isSelected:t})))):null},U=function(){var t,a=M.selectedPaymentGatewayIndex===M.payPalPaymentGatewayIndex;return M.payPalPaymentGateway?e.createElement("div",{className:g.SelectBoxContainer},e.createElement("div",{className:"".concat(g.SelectBox," ").concat(a?g.Selected:""),onClick:function(){M.setPaymentGateway(M.payPalPaymentGatewayIndex),M.mpVM.selectedCard=void 0}},e.createElement("div",{className:g.TopContent},e.createElement(f,{value:a,label:M.payPalPaymentGateway.name,removePadding:!0}),e.createElement("div",{className:g.RightContent},(null===(t=M.payPalPaymentGateway.additionalPrices)||void 0===t?void 0:t.length)?e.createElement(R,null,B(M.payPalPaymentGateway.additionalPrices[0])):e.createElement(A,null,!!M.payPalPaymentGateway.logoUrl&&e.createElement("div",{className:m.PaymentLogoContainer},e.createElement("img",{src:M.payPalPaymentGateway.logoUrl}))))))):null},_=t((function(t){var a,n=t.vm;e.useEffect((function(){n.isTermsAndConditionsChecked&&n.setShowIyzicoContainer(!0)}),[n.isTermsAndConditionsChecked]);var o=e.useCallback((function(e){e.stopPropagation(),n.policyModalTitle=b("checkout-page:privacyPolicy"),n.policyModalText=n.privacyPolicy}),[n,n.privacyPolicy]),i=e.useCallback((function(e){e.stopPropagation(),n.policyModalTitle=b("checkout-page:termsOfService"),n.policyModalText=n.termsOfService}),[n,n.termsOfService]),r=s.getTranslations()["checkout-page"],l=y(r.ackPoliciesSentence).map((function(t){return t.isVariable?e.createElement("span",{className:[m.TermsLabelSpan,n.isErrorsVisible&&!n.isTermsAndConditionsChecked?m.Error:""].join(" "),onClick:"{{ ackPrivacyPolicy }}"===t.value?o:i},"{{ ackPrivacyPolicy }}"===t.value?b("checkout-page:ackPrivacyPolicy"):b("checkout-page:ackTermsOfService")):t.value})),c=n.selectedPaymentGatewayIndex===n.iyzicoPaymentGatewayIndex;return n.iyzicoPaymentGateway?e.createElement("div",{className:g.SelectBoxContainer},e.createElement("div",{className:"".concat(g.SelectBox," ").concat(c?g.Selected:""," ").concat(m.IyzicoBottomContent),onClick:function(){n.setPaymentGateway(n.iyzicoPaymentGatewayIndex),n.mpVM.selectedCard=void 0}},e.createElement("div",{className:g.TopContent},e.createElement(f,{value:c,label:b("checkout-page:creditCard"),removePadding:!0}),e.createElement("div",{className:g.RightContent},(null===(a=n.iyzicoPaymentGateway.additionalPrices)||void 0===a?void 0:a.length)?e.createElement(R,null,B(n.iyzicoPaymentGateway.additionalPrices[0])):e.createElement(A,null,!!n.iyzicoPaymentGateway.logoUrl&&e.createElement("div",{className:m.PaymentLogoContainer},e.createElement("img",{src:n.iyzicoPaymentGateway.logoUrl}))))),e.createElement("div",{className:"".concat(c?g.BottomContent:""," ").concat(c?"":m.Hidden," ")},e.createElement("div",{className:m.IyzicoCheckboxContainer},e.createElement(h,{value:n.isTermsAndConditionsChecked,hasError:n.isErrorsVisible&&!n.isTermsAndConditionsChecked,label:e.createElement(e.Fragment,null,l),removePadding:!0,onChange:n.onTermsAndConditionsCheckedChange})),!n.isTermsAndConditionsChecked&&e.createElement("div",{className:[m.IyzicoDescription,n.iyzicoResponse?m.WithBottomMargin:""].join(" ")},e.createElement(j,null),b("checkout-page:iyzicoDescription")),n.iyzicoResponse&&e.createElement(I,{vm:n})))):null})),O=t((function(t){var a,n=t.vm;e.useEffect((function(){n.isTermsAndConditionsChecked&&n.setShowTkPayContainer(!0)}),[n.isTermsAndConditionsChecked]);var o=e.useCallback((function(e){e.stopPropagation(),n.policyModalTitle=b("checkout-page:privacyPolicy"),n.policyModalText=n.privacyPolicy}),[n,n.privacyPolicy]),i=e.useCallback((function(e){e.stopPropagation(),n.policyModalTitle=b("checkout-page:termsOfService"),n.policyModalText=n.termsOfService}),[n,n.termsOfService]),r=s.getTranslations()["checkout-page"],l=y(r.ackPoliciesSentence).map((function(t){return t.isVariable?e.createElement("span",{className:[m.TermsLabelSpan,n.isErrorsVisible&&!n.isTermsAndConditionsChecked?m.Error:""].join(" "),onClick:"{{ ackPrivacyPolicy }}"===t.value?o:i},"{{ ackPrivacyPolicy }}"===t.value?b("checkout-page:ackPrivacyPolicy"):b("checkout-page:ackTermsOfService")):t.value})),c=n.selectedPaymentGatewayIndex===n.tkPayPaymentGatewayIndex;return n.tkPayPaymentGateway?e.createElement("div",{className:g.SelectBoxContainer},e.createElement("div",{className:"".concat(g.SelectBox," ").concat(c?g.Selected:""," ").concat(m.TkPayBottomContent),onClick:function(){n.setPaymentGateway(n.tkPayPaymentGatewayIndex),n.mpVM.selectedCard=void 0}},e.createElement("div",{className:g.TopContent},e.createElement(f,{value:c,label:n.tkPayPaymentGateway.name,removePadding:!0}),e.createElement("div",{className:g.RightContent},(null===(a=n.tkPayPaymentGateway.additionalPrices)||void 0===a?void 0:a.length)?e.createElement(R,null,B(n.tkPayPaymentGateway.additionalPrices[0])):e.createElement(A,null,!!n.tkPayPaymentGateway.logoUrl&&e.createElement("div",{className:m.PaymentLogoContainer},e.createElement("img",{src:n.tkPayPaymentGateway.logoUrl}))))),e.createElement("div",{className:"".concat(c?g.BottomContent:""," ").concat(c?"":m.Hidden," ")},e.createElement("div",{className:m.TkPayCheckboxContainer},e.createElement(h,{value:n.isTermsAndConditionsChecked,hasError:n.isErrorsVisible&&!n.isTermsAndConditionsChecked,label:e.createElement(e.Fragment,null,l),removePadding:!0,onChange:n.onTermsAndConditionsCheckedChange})),!n.isTermsAndConditionsChecked&&e.createElement("div",{className:[m.TkPayDescription,n.tkPayResponse?m.WithBottomMargin:""].join(" ")},e.createElement(j,null),b("checkout-page:tkPayDescription")),n.isTermsAndConditionsChecked&&n.isMilesSmilesTermsMissing&&e.createElement("div",{className:m.TkPayDescription},e.createElement(j,null),b("checkout-page:milesSmilesTermsRequiredError")),n.tkPayResponse&&!n.isMilesSmilesTermsMissing&&e.createElement(S,{vm:n})))):null}));return e.createElement(e.Fragment,null,!!M.mpVM.cards.length&&M.mpVM.cards.map((function(t,n){var o,r=M.paymentGateways.find((function(e){return e.id===t.paymentGatewayId})),s=e.createElement("button",{className:m.MasterPassSelectBoxDeleteButton,onClick:function(e){e.stopPropagation(),M.mpVM.deleteCard({store:M.store,checkout:M.checkout,card:t})}},b("checkout-page:masterPass.paymentGatewaySelectBox.delete")),d=function(e){return t.Value1.startsWith(e)},y=d("4"),p=d("5")||d("6"),u=d("9"),v=e.createElement("div",{style:{display:"flex",alignItems:"center"}},e.createElement("span",{className:m.MasterPassSelectBoxLabelLogo},y&&e.createElement(k,null),p&&e.createElement(x,null),u&&e.createElement(C,null)),t.Name," ",t.Value1),E=(null==r?void 0:r.id)&&r.paymentMethodType===a.CREDIT_CARD&&r.type===i.INTERNAL?M.installmentInfo&&e.createElement(l,{vm:M}):void 0;return e.createElement(c,{key:n,isSelected:(null===(o=M.mpVM.selectedCard)||void 0===o?void 0:o.UniqueId)===t.UniqueId,label:v,rightContent:s,bottomContent:E,onClick:function(){var e;(null===(e=M.mpVM.selectedCard)||void 0===e?void 0:e.UniqueId)!==t.UniqueId&&(M.checkout.selectedPaymentGateway=null,M.cardData=new P,M.installmentInfo=void 0,M.mpVM.selectedCard=t,t.Value1&&t.paymentGatewayId&&M.checkout.totalFinalPrice&&M.retrieveInstallmentInfo({input:{orderId:M.checkout.id,binNumber:t.Value1.slice(0,8),paymentGatewayId:t.paymentGatewayId,price:M.checkout.totalFinalPrice,currencyCode:M.checkout.currencyCode}}))}})})),M.paymentGateways.filter((function(e){return"in-store"!==M.deliveryMethod&&!M.isDigitalOnly||e.paymentMethodType!==a.CASH_ON_DELIVERY&&e.paymentMethodType!==a.CREDIT_CARD_ON_DELIVERY})).map((function(t,n){var o,s;if(M.useMilesSmiles&&t.id!==(null===(o=M.milesSmilesPaymentGateway)||void 0===o?void 0:o.id))return null;if(function(e){return"KLARNA"===e.code}(t)&&M.klarnaPaymentGateway)return D();if(function(e){return"ADYEN_PLATFORM"===e.code}(t)&&M.adyenPaymentGateway)return L();if(function(e){return"PAYPAL"===e.code}(t)&&M.payPalPaymentGateway)return U();if(function(e){return"HEPSIPAY"===e.code}(t)&&M.hepsiPayPaymentGateway)return z();if(function(e){return"IYZICO"===e.code}(t)&&M.iyzicoPaymentGateway)return e.createElement(_,{vm:M,key:t.id});if(function(e){var t,a;return"TK_PAY"===e.code&&"true"===(null===(a=null===(t=e.settings)||void 0===t?void 0:t.find((function(e){return"tkpay_use_checkout_form"===e.label})))||void 0===a?void 0:a.value)}(t)&&M.tkPayPaymentGateway)return e.createElement(O,{vm:M,key:t.id});var d=t.paymentMethodType===a.CREDIT_CARD&&t.type===i.INTERNAL?e.createElement(e.Fragment,null,V(t)?e.createElement(e.Fragment,null,e.createElement(w,{vm:M,pg:t}),M.stripeError&&e.createElement("div",{className:m.ErrorMessage},M.stripeError.data)):e.createElement("div",null,e.createElement(r,{vm:M}),M.isPaymentGatewayHasMasterPass&&e.createElement(E,{vm:M}),M.installmentInfo&&e.createElement(l,{vm:M}))):t.description?e.createElement(e.Fragment,null,t.type===i.EXTERNAL&&e.createElement("div",{style:{height:"52px",display:"flex",justifyContent:"center",margin:"24px 0"}},e.createElement(u,null)),e.createElement("div",{dangerouslySetInnerHTML:{__html:t.description}})):void 0;return e.createElement(c,{key:t.id,label:t.paymentMethodType===a.CREDIT_CARD&&t.type===i.INTERNAL?V(t)?t.name:b("checkout-page:creditCard"):t.name,isSelected:M.selectedPaymentGatewayIndex===n,rightContent:(null===(s=t.additionalPrices)||void 0===s?void 0:s.length)?e.createElement(R,null,B(t.additionalPrices[0])):e.createElement(A,null,!!t.logoUrl&&e.createElement("div",{className:m.PaymentLogoContainer},e.createElement("img",{src:t.logoUrl}))),bottomContent:d,onClick:function(){M.selectedPaymentGatewayIndex!==n&&(M.setPaymentGateway(n),M.mpVM.selectedCard=void 0)}})})))}));export{M as PaymentGateways};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"react";import s from"./style.module.scss.js";import m from"./miles-smiles-logo.js";var r=function(){return e.createElement("div",{className:s.MilesSmilesBanner},e.createElement(m,{className:s.MilesSmilesBannerLogo}))};export{r as MilesSmilesBanner,r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{observer as l}from"mobx-react-lite";import"@ikas/storefront-config";import{formatCurrency as
|
|
1
|
+
import*as e from"react";import{observer as l}from"mobx-react-lite";import{IkasStorefrontConfig as s}from"@ikas/storefront-config";import{formatCurrency as i}from"../../../../../../utils/currency.js";import{createTranslationInputData as m,useTranslation as t}from"../../../../../../utils/i18n.js";import{Checkbox as a}from"../../../../components/checkbox/index.js";import r from"./style.module.scss.js";import{MilesSmilesBanner as c}from"./header.js";var n=function(e){return String(Math.floor(e||0)).replace(/\B(?=(\d{3})+(?!\d))/g,".")},o=function(e){return e?n(e):""},u=[500,1e3,5e3,1e4],S=l((function(l){var S=l.vm,d=t().t,M=S.milesSmilesAvailableMiles,E=S.milesSmilesMaxRedeemable,g=S.milesSmilesRedeemValue,T=S.milesToRedeem>M,h=S.isMilesSmilesTermsAccepted,v=S.isErrorsVisible&&S.isMilesSmilesTermsMissing,k=function(e){e.stopPropagation(),S.policyModalTitle=d("checkout-page:milesSmilesTerms"),S.policyModalText=S.imprint},f=m(s.getTranslations()["checkout-page"].milesSmilesTermsSentence).map((function(l,s){return l.isVariable?S.imprint?e.createElement("span",{key:s,className:[r.MilesSmilesTermsLink,v?r.MilesSmilesTermsLinkError:""].join(" "),onClick:k},d("checkout-page:milesSmilesTerms")):e.createElement(e.Fragment,{key:s},d("checkout-page:milesSmilesTerms")):e.createElement(e.Fragment,{key:s},l.value)}));return e.createElement("div",{className:r.MilesSmiles},e.createElement(c,null),e.createElement("div",{className:r.MilesSmilesBody},e.createElement("div",{className:r.MilesSmilesHeader},e.createElement("div",{className:r.MilesSmilesTitleWrapper},e.createElement("div",{className:r.MilesSmilesTitle},e.createElement("span",{className:r.MilesSmilesTitleBold},"Miles&Smiles")," ",e.createElement("span",null,d("checkout-page:milesSmilesUseMyMiles"))),e.createElement("div",{className:r.MilesSmilesSubtitle},d("checkout-page:milesSmilesAvailableTotal",{miles:n(M||0)}))),e.createElement(p,{value:S.useMilesSmiles,onChange:function(e){S.setUseMilesSmiles(e)}})),S.useMilesSmiles&&e.createElement(e.Fragment,null,e.createElement("div",{className:r.MilesSmilesChips},u.map((function(l){var s=S.milesToRedeem===l,i=l>E;return e.createElement("button",{key:l,type:"button",className:[r.MilesSmilesChip,s?r.MilesSmilesChipSelected:""].join(" "),disabled:i,"aria-pressed":s,onClick:function(){return S.selectMilesSmilesChip(l)}},n(l)," ",d("checkout-page:milesSmilesUnit"))}))),e.createElement("div",{className:r.MilesSmilesInputRow},e.createElement("div",{className:[r.MilesSmilesInputWrapper,T?r.MilesSmilesInputError:""].join(" ")},e.createElement("input",{className:r.MilesSmilesInput,type:"text",inputMode:"numeric",value:o(S.milesToRedeem),onChange:function(e){var l=e.target.value.replace(/[^\d]/g,"");S.setMilesToRedeem(l?parseInt(l,10):0)},onBlur:function(){S.clampMilesToRedeem()},max:E}),e.createElement("span",{className:r.MilesSmilesInputUnit},d("checkout-page:milesSmilesUnit"))),S.milesToRedeem>0&&g>0&&e.createElement("span",{className:r.MilesSmilesRedeemText},d("checkout-page:milesSmilesRedeemText",{miles:o(S.milesToRedeem),amount:i(g,S.checkout.currencyCode,S.checkout.currencySymbol)}))),T&&e.createElement("div",{className:r.MilesSmilesErrorText},d("checkout-page:milesSmilesExceedError")),e.createElement("div",{className:r.MilesSmilesUseAll},e.createElement(a,{value:S.isMilesSmilesAllMilesUsed,label:e.createElement("span",{className:r.MilesSmilesUseAllLabel},d("checkout-page:milesSmilesUseAllMiles")),removePadding:!0,onChange:function(e){S.setUseAllMilesSmiles(e)}})),e.createElement("div",{className:r.MilesSmilesTerms},e.createElement(a,{value:h,hasError:v,label:e.createElement("span",{className:r.MilesSmilesTermsLabel},f),removePadding:!0,onChange:function(e){S.setMilesSmilesTermsAccepted(e)}})),v&&e.createElement("div",{className:r.MilesSmilesErrorText},d("checkout-page:milesSmilesTermsRequiredError"))),S.milesSmilesError&&e.createElement("div",{className:r.MilesSmilesErrorText},S.getMilesSmilesErrorMessage(S.milesSmilesError))))})),p=function(l){var s=l.value,i=l.onChange;return e.createElement("div",{role:"switch","aria-checked":s,onClick:function(){i(!s)},className:[r.ToggleSwitch,s?r.ToggleSwitchActive:""].join(" ")},e.createElement("div",{className:[r.ToggleSwitchThumb,s?r.ToggleSwitchThumbActive:""].join(" ")}))};export{S as MilesSmiles};
|
package/build/components/checkout/steps/step-payment/payment-gateways/miles-smiles/login-required.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{observer as
|
|
1
|
+
import*as e from"react";import{observer as i}from"mobx-react-lite";import"@ikas/storefront-config";import{useTranslation as s}from"../../../../../../utils/i18n.js";import t from"./style.module.scss.js";import{MilesSmilesBanner as l}from"./header.js";var m=i((function(i){var m=i.vm,o=s().t,r=!m.store.customerStore.customer;return e.createElement("div",{className:t.MilesSmiles},e.createElement(l,null),e.createElement("div",{className:t.MilesSmilesLogin},e.createElement("div",{className:t.MilesSmilesLoginText},e.createElement("span",null,o(r?"checkout-page:milesSmilesLoginPrompt":"checkout-page:milesSmilesBindPrompt")),m.milesSmilesError&&e.createElement("div",{className:t.MilesSmilesErrorText},m.getMilesSmilesErrorMessage(m.milesSmilesError))),e.createElement("button",{type:"button",className:[t.MilesSmilesLoginButton,m.isMilesSmilesBindLoading?t.MilesSmilesLoginButtonBusy:""].join(" "),disabled:m.isMilesSmilesBindLoading,onClick:function(){return m.startMilesSmilesBind()}},o(r?"checkout-page:milesSmilesLoginButton":"checkout-page:milesSmilesBindButton"))))}));export{m as MilesSmilesLoginRequired,m as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as C from"react";var e=function(e){var t=e.className;return C.createElement("svg",{width:"121",height:"27",viewBox:"0 0 121 27",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t},C.createElement("path",{d:"M35.3526 0.0260046C37.7335 0.274351 39.5892 2.2853 39.5909 4.73139C39.5909 7.34542 37.4735 9.46515 34.8594 9.46675C32.2447 9.46675 30.125 7.34856 30.125 4.73452C30.1234 2.12053 32.2416 0 34.856 0C35.0239 0 35.1894 0.00945789 35.3526 0.0260046ZM35.5972 9.13564C38.0281 8.72731 39.6688 6.42466 39.2599 3.99355C38.9193 1.97077 37.2706 0.495051 35.3242 0.291662C34.9315 0.249894 34.5263 0.260957 34.118 0.330296C33.6323 0.410734 33.1803 0.569968 32.7686 0.788318C34.9114 1.51433 36.0637 2.62035 36.1429 3.75273C36.1827 4.45235 35.8583 4.9561 35.4305 5.36915L38.4611 5.15708C38.547 5.15156 38.5746 5.2517 38.47 5.28088L31.2422 7.35329C31.9771 8.36705 33.1201 9.04184 34.3895 9.17427C34.7819 9.21527 35.1871 9.20503 35.5972 9.13564ZM33.6081 4.83701C34.004 3.34635 33.5523 1.78708 32.47 0.957777C30.9963 1.89113 30.1471 3.6459 30.4539 5.47399C30.556 6.07783 30.7735 6.63122 31.0828 7.11838C32.2351 6.79754 33.2485 6.19093 33.6081 4.83701Z",fill:"white"}),C.createElement("path",{d:"M39.259 3.99377C39.6679 6.42488 38.0276 8.72793 35.5963 9.13586C35.1866 9.20524 34.7814 9.21589 34.3886 9.17449C33.1193 9.04206 31.9762 8.36728 31.2413 7.35352L38.4691 5.2811C38.5738 5.25192 38.5465 5.15179 38.4606 5.15731L35.4296 5.36937C35.8579 4.95632 36.1818 4.45256 36.1424 3.75335C36.0628 2.62058 34.9105 1.51455 32.7661 0.788541C33.1798 0.57019 33.6315 0.410956 34.1171 0.330519C34.5258 0.261179 34.931 0.252103 35.3233 0.291884C37.2701 0.495256 38.9188 1.97099 39.259 3.99377ZM30.453 5.47421C30.5555 6.07805 30.7727 6.63144 31.0823 7.1186C32.2342 6.79776 33.2479 6.19155 33.6064 4.83724C34.0035 3.34698 33.5518 1.7873 32.4691 0.9584C30.9958 1.89136 30.1462 3.64613 30.453 5.47421Z",fill:"#CE181E"}),C.createElement("path",{d:"M6.81431 22.6348L2.2123 13.1541H0V26.8022H1.52098V14.9713L6.04405 24.2741H7.52543L12.0485 14.9713V26.8022H13.5695V13.1541H11.377L6.81431 22.6348Z",fill:"white"}),C.createElement("path",{d:"M18.6262 16.551H17.125V26.8023H18.6262V16.551Z",fill:"white"}),C.createElement("path",{d:"M17.8746 12.9368C17.5588 12.9368 17.3117 13.0355 17.134 13.233C16.956 13.4306 16.8672 13.6677 16.8672 13.9442C16.8672 14.2077 16.956 14.4412 17.134 14.6451C17.3117 14.8497 17.5588 14.9515 17.8746 14.9515C18.1907 14.9515 18.4341 14.8525 18.6055 14.6553C18.7763 14.4578 18.8622 14.2206 18.8622 13.9442C18.8622 13.6809 18.7763 13.4473 18.6055 13.243C18.4341 13.0391 18.1907 12.9368 17.8746 12.9368Z",fill:"white"}),C.createElement("path",{d:"M23.4657 13.095H21.9844V26.8025H23.4657V13.095Z",fill:"white"}),C.createElement("path",{d:"M34.0327 20.9164H27.7912C27.8041 20.2977 27.9458 19.7349 28.2159 19.2279C28.4858 18.7212 28.8643 18.3226 29.3515 18.0329C29.8387 17.7432 30.4114 17.5983 31.07 17.5983C32.0048 17.5983 32.7456 17.8915 33.2919 18.4772C33.8383 19.0634 34.0853 19.8766 34.0327 20.9164ZM33.8253 17.1735C33.1208 16.6274 32.1959 16.354 31.0502 16.354C30.0626 16.354 29.2035 16.5779 28.4726 17.0255C27.7419 17.4734 27.1854 18.1019 26.8039 18.9115C26.4218 19.7217 26.2375 20.6598 26.2507 21.7266C26.2636 22.8195 26.471 23.7642 26.8729 24.5608C27.2743 25.3575 27.8503 25.963 28.6011 26.3778C29.3515 26.7927 30.2205 27.0001 31.2081 27.0001C31.7613 27.0001 32.3145 26.9109 32.8675 26.7335C33.4204 26.5555 33.9175 26.2727 34.3585 25.884C34.7997 25.4959 35.132 25.0051 35.356 24.4126L34.2303 23.7807C34.0721 24.1889 33.8416 24.538 33.539 24.8274C33.2358 25.1171 32.8837 25.338 32.4824 25.4893C32.0804 25.6406 31.6494 25.7162 31.1886 25.7162C30.609 25.7162 30.066 25.5977 29.5589 25.3608C29.052 25.1237 28.6308 24.7352 28.2949 24.1952C27.9593 23.6555 27.7912 22.9381 27.7912 22.0424H35.4154C35.5736 21.068 35.524 20.1494 35.2671 19.287C35.0107 18.4249 34.5298 17.7201 33.8253 17.1735Z",fill:"white"}),C.createElement("path",{d:"M44.8754 22.6647C44.5854 22.3024 44.2297 22.0226 43.8085 21.8251C43.3871 21.6275 42.8669 21.4369 42.2482 21.2523L41.8334 21.114C41.8334 21.114 40.5561 20.6928 40.2929 20.561C40.0293 20.4295 39.8255 20.2518 39.6805 20.0279C39.5355 19.804 39.4632 19.5143 39.4632 19.1589C39.4632 18.645 39.6475 18.25 40.0164 17.9735C40.3847 17.6971 40.8854 17.5587 41.5176 17.5587C42.1098 17.5587 42.6069 17.7039 43.0088 17.9933C43.4102 18.283 43.6767 18.7113 43.8085 19.2772L45.1713 18.8425C44.9738 18.0263 44.5559 17.4074 43.9175 16.9859C43.2784 16.5648 42.4916 16.3538 41.5569 16.3538C40.5297 16.3538 39.6706 16.6041 38.9793 17.1045C38.2882 17.6049 37.9425 18.3226 37.9425 19.2574C37.9425 19.8499 38.0905 20.3338 38.3867 20.709C38.683 21.0845 39.0417 21.3775 39.4631 21.5882C39.8843 21.799 40.4243 22.0097 41.0829 22.2204C41.2934 22.2729 42.561 22.7109 42.8308 22.8226C43.1007 22.9345 43.3246 23.096 43.5026 23.3065C43.68 23.5172 43.7755 23.8003 43.789 24.1559C43.789 24.6693 43.578 25.0643 43.1568 25.3408C42.7354 25.6175 42.2089 25.7556 41.5767 25.7556C40.8128 25.7556 40.1941 25.5911 39.7201 25.2618C39.2459 24.9331 38.9499 24.4522 38.831 23.8201L37.5078 24.2943C37.6789 25.1766 38.1232 25.848 38.8409 26.3088C39.5586 26.7699 40.4507 27.0001 41.5175 27.0001C42.1888 27.0001 42.8077 26.8915 43.3741 26.6741C43.9403 26.4568 44.4041 26.1308 44.7664 25.6964C45.1287 25.2618 45.3097 24.7287 45.3097 24.0965C45.3097 23.5042 45.1648 23.027 44.8754 22.6647Z",fill:"white"}),C.createElement("path",{d:"M54.3161 25.1729C53.6842 25.522 52.9797 25.6964 52.2031 25.6964C51.7156 25.6964 51.2678 25.6042 50.8598 25.4196C50.4516 25.2356 50.1319 24.9687 49.9017 24.6199C49.6714 24.2711 49.5562 23.8662 49.5562 23.4051C49.5562 22.8915 49.6844 22.4505 49.9413 22.0816C50.1982 21.7133 50.5206 21.4002 50.9093 21.1436C51.2301 20.9315 51.6342 20.7026 52.1126 20.4589C52.2254 20.5821 52.3354 20.6996 52.44 20.808C52.6243 20.9989 52.835 21.2195 53.0721 21.4696L55.6145 24.1935C55.2178 24.5869 54.7854 24.914 54.3161 25.1729ZM50.9192 16.0775C50.9192 15.4847 51.0967 15.0274 51.4523 14.7045C51.8078 14.3823 52.282 14.2209 52.8743 14.2209C53.4404 14.2209 53.8916 14.3623 54.2275 14.6453C54.5634 14.9287 54.7309 15.3597 54.7309 15.9391C54.7309 16.716 54.4709 17.3679 53.9508 17.8945C53.5381 18.312 53.0504 18.6738 52.4928 18.9838C52.2336 18.7007 52.016 18.454 51.8474 18.2499C51.5313 17.868 51.2975 17.5027 51.1462 17.1536C50.9946 16.8051 50.9192 16.4461 50.9192 16.0775ZM58.4246 22.2693C58.7932 21.3411 59.0105 20.4358 59.0765 19.5535H57.5556C57.5289 20.304 57.3809 21.058 57.1113 21.8151C56.9385 22.2995 56.7226 22.7342 56.4717 23.1292L54.0201 20.5804L53.3161 19.8583C53.4017 19.8094 53.4875 19.7607 53.5659 19.7114C54.0396 19.435 54.471 19.1093 54.8594 18.7338C55.2478 18.3585 55.5672 17.9275 55.8172 17.44C56.0676 16.9531 56.1927 16.4263 56.1927 15.8601C56.1927 15.3069 56.061 14.8101 55.7977 14.3689C55.5342 13.9279 55.1557 13.5821 54.6619 13.3318C54.1681 13.082 53.5788 12.9565 52.8941 12.9565C52.2752 12.9565 51.7024 13.082 51.1756 13.3318C50.6488 13.5821 50.2276 13.9441 49.9118 14.4181C49.5955 14.8924 49.4376 15.4519 49.4376 16.097C49.4376 16.571 49.5297 17.0089 49.7143 17.4106C49.8983 17.8122 50.1487 18.2138 50.4645 18.6155C50.6744 18.882 50.9541 19.2042 51.2917 19.5722C50.755 19.8333 50.2697 20.1062 49.8425 20.3931C49.3619 20.7158 48.9372 21.1436 48.5686 21.677C48.1997 22.2101 48.0156 22.8324 48.0156 23.5435C48.0156 24.2414 48.2063 24.8537 48.5884 25.3803C48.9702 25.9071 49.4772 26.3087 50.1091 26.5849C50.7412 26.8616 51.413 26.9997 52.1239 26.9997C52.8218 26.9997 53.4603 26.9043 54.0396 26.7133C54.6189 26.5227 55.1457 26.2592 55.62 25.9233C55.9309 25.7029 56.2293 25.4468 56.5176 25.1613L58.0493 26.8025H60.0047L57.4199 24.1151C57.8183 23.5652 58.1541 22.9507 58.4246 22.2693Z",fill:"white"}),C.createElement("path",{d:"M68.9418 20.1362C68.3823 19.8531 67.6613 19.5601 66.7793 19.2572C65.923 18.9679 65.2944 18.737 64.8927 18.5659C64.4908 18.3948 64.1486 18.1448 63.8658 17.8152C63.5825 17.4862 63.4411 17.0584 63.4411 16.5314C63.4411 15.8076 63.7241 15.2544 64.2906 14.8726C64.8564 14.4907 65.5213 14.2998 66.2855 14.2998C67.1675 14.2998 67.8753 14.5039 68.4084 14.9119C68.9418 15.3204 69.2808 15.9982 69.426 16.9462L70.9467 16.6304C70.7756 15.4192 70.2783 14.5039 69.4554 13.885C68.6324 13.266 67.6087 12.9565 66.384 12.9565C65.5676 12.9565 64.8204 13.0982 64.1423 13.3813C63.4639 13.6646 62.9242 14.0792 62.5226 14.6255C62.1209 15.1721 61.9135 15.8205 61.9003 16.571C61.9003 17.3743 62.111 18.0359 62.5325 18.5561C62.9536 19.0763 63.4378 19.4647 63.9841 19.7214C64.5307 19.9783 65.2119 20.2383 66.0286 20.5015L66.7001 20.7384C67.6217 21.0547 68.3001 21.3936 68.7344 21.7559C69.1691 22.1182 69.3864 22.6348 69.3864 23.3061C69.3864 24.0439 69.1066 24.6133 68.5468 25.0147C67.987 25.4166 67.299 25.6174 66.4828 25.6174C65.5081 25.6174 64.6919 25.3704 64.0336 24.8763C63.3751 24.3828 62.9932 23.7014 62.8882 22.8323L61.3672 23.3457C61.5119 24.0835 61.8148 24.7255 62.2758 25.2716C62.7366 25.8179 63.3192 26.2427 64.0237 26.5456C64.7283 26.8482 65.5081 26.9997 66.3645 26.9997C67.2465 26.9997 68.0365 26.8482 68.7344 26.5456C69.4323 26.2427 69.9787 25.8116 70.374 25.2518C70.769 24.6923 70.9665 24.0307 70.9665 23.2667C70.9665 22.4767 70.769 21.8283 70.374 21.3213C69.9787 20.8146 69.5014 20.4195 68.9418 20.1362Z",fill:"white"}),C.createElement("path",{d:"M85.7815 16.3538C85.2415 16.3538 84.7249 16.4462 84.2311 16.6306C83.7373 16.8151 83.3026 17.088 82.9274 17.4501C82.5522 17.8123 82.2589 18.2434 82.0485 18.7438C81.8639 17.967 81.4986 17.3744 80.9522 16.9662C80.4056 16.5582 79.6912 16.3538 78.8093 16.3538C78.0192 16.3538 77.3081 16.5678 76.6759 16.9959C76.044 17.4239 75.5896 17.9537 75.3131 18.5856V16.5513H73.8516V26.8023H75.3527V22.0424C75.3527 21.0815 75.5007 20.2747 75.797 19.6227C76.0933 18.971 76.4814 18.4838 76.9623 18.1611C77.4429 17.8385 77.9664 17.6773 78.5325 17.6773C79.2566 17.6773 79.8197 17.921 80.2213 18.4082C80.623 18.8954 80.8241 19.6986 80.8241 20.8177V26.8023H82.3052V21.9635C82.3052 21.002 82.4534 20.199 82.7497 19.5536C83.046 18.9086 83.4341 18.4343 83.915 18.1314C84.3956 17.8285 84.9125 17.6772 85.4657 17.6772C86.2027 17.6772 86.7754 17.9075 87.1839 18.3685C87.5919 18.8296 87.7963 19.5998 87.7963 20.6796V26.8023H89.2776V20.3632C89.2776 19.0598 88.9814 18.0659 88.3888 17.3807C87.7963 16.6962 86.9273 16.3538 85.7815 16.3538Z",fill:"white"}),C.createElement("path",{d:"M94.0324 16.551H92.5312V26.8023H94.0324V16.551Z",fill:"white"}),C.createElement("path",{d:"M93.2886 12.9368C92.9728 12.9368 92.7258 13.0355 92.5481 13.233C92.3701 13.4306 92.2812 13.6677 92.2812 13.9442C92.2812 14.2077 92.3701 14.4412 92.5481 14.6451C92.7258 14.8497 92.9728 14.9515 93.2886 14.9515C93.6047 14.9515 93.8482 14.8525 94.0196 14.6553C94.1904 14.4578 94.2762 14.2206 94.2762 13.9442C94.2762 13.6809 94.1904 13.4473 94.0196 13.243C93.8482 13.0391 93.6047 12.9368 93.2886 12.9368Z",fill:"white"}),C.createElement("path",{d:"M98.8798 13.095H97.3984V26.8025H98.8798V13.095Z",fill:"white"}),C.createElement("path",{d:"M109.439 20.9162H103.197C103.21 20.2975 103.352 19.7346 103.622 19.2277C103.892 18.7209 104.271 18.3223 104.758 18.0327C105.245 17.743 105.818 17.598 106.476 17.598C107.411 17.598 108.152 17.8913 108.698 18.4769C109.244 19.0632 109.492 19.8763 109.439 20.9162ZM109.232 17.1733C108.527 16.6272 107.602 16.3538 106.456 16.3538C105.469 16.3538 104.61 16.5777 103.879 17.0253C103.148 17.4731 102.592 18.1017 102.21 18.9113C101.828 19.7215 101.644 20.6595 101.657 21.7263C101.67 22.8193 101.877 23.7639 102.279 24.5606C102.681 25.3573 103.257 25.9627 104.007 26.3776C104.758 26.7924 105.627 26.9998 106.614 26.9998C107.168 26.9998 107.721 26.9107 108.274 26.7333C108.827 26.5553 109.324 26.2725 109.765 25.8838C110.206 25.4956 110.538 25.0049 110.762 24.4123L109.636 23.7804C109.478 24.1887 109.248 24.5377 108.945 24.8271C108.642 25.1168 108.29 25.3377 107.889 25.489C107.487 25.6403 107.056 25.716 106.595 25.716C106.015 25.716 105.472 25.5974 104.965 25.3605C104.458 25.1234 104.037 24.735 103.701 24.195C103.365 23.6552 103.197 22.9378 103.197 22.0421H110.822C110.979 21.0677 110.93 20.1492 110.673 19.2868C110.417 18.4246 109.936 17.7199 109.232 17.1733Z",fill:"white"}),C.createElement("path",{d:"M120.289 22.6644C119.999 22.3024 119.644 22.0223 119.223 21.8248C118.801 21.6273 118.281 21.4367 117.662 21.2521L117.247 21.1137C117.247 21.1137 115.97 20.6925 115.707 20.5611C115.443 20.4293 115.24 20.2516 115.095 20.0277C114.95 19.804 114.877 19.5141 114.877 19.1586C114.877 18.645 115.062 18.2497 115.43 17.9733C115.799 17.6968 116.299 17.5584 116.932 17.5584C117.524 17.5584 118.021 17.7036 118.423 17.9931C118.824 18.2827 119.091 18.711 119.223 19.2772L120.585 18.8423C120.388 18.0263 119.97 17.4074 119.332 16.9857C118.692 16.5645 117.906 16.3538 116.971 16.3538C115.944 16.3538 115.085 16.6041 114.393 17.1042C113.702 17.6046 113.357 18.3223 113.357 19.2571C113.357 19.8499 113.505 20.3335 113.801 20.709C114.097 21.0843 114.456 21.3772 114.877 21.5879C115.299 21.7989 115.838 22.0094 116.497 22.2201C116.708 22.2726 117.975 22.7106 118.245 22.8223C118.515 22.9342 118.739 23.0957 118.917 23.3062C119.094 23.5172 119.19 23.8 119.203 24.1557C119.203 24.669 118.992 25.0643 118.571 25.3408C118.149 25.6172 117.623 25.7553 116.991 25.7553C116.227 25.7553 115.608 25.5911 115.134 25.2615C114.66 24.9328 114.364 24.4519 114.245 23.8198L112.922 24.294C113.093 25.1762 113.537 25.8478 114.255 26.3085C114.973 26.7696 115.865 26.9998 116.932 26.9998C117.603 26.9998 118.222 26.8912 118.788 26.6739C119.354 26.4565 119.818 26.1308 120.18 25.6962C120.543 25.2615 120.724 24.7284 120.724 24.0963C120.724 23.504 120.579 23.0267 120.289 22.6644Z",fill:"white"}),C.createElement("path",{d:"M45.6562 2.87329V5.19402C45.6562 5.45069 45.6938 5.67254 45.7684 5.85297C45.8425 6.03203 45.9497 6.18094 46.0873 6.29529C46.2264 6.41073 46.3939 6.49602 46.5856 6.54839C46.78 6.60213 46.9997 6.62956 47.238 6.62956C47.4763 6.62956 47.694 6.60213 47.8843 6.54866C48.0719 6.49602 48.2318 6.41128 48.3598 6.29638C48.4879 6.1823 48.5885 6.03313 48.6587 5.85407C48.7292 5.67389 48.7651 5.45179 48.7651 5.19402V2.87329H47.9636V5.16962C47.9636 5.40326 47.9054 5.5922 47.7908 5.73095C47.6737 5.87218 47.4878 5.94347 47.238 5.94347C46.9926 5.94347 46.8077 5.87218 46.689 5.73122C46.5722 5.59302 46.5129 5.40408 46.5129 5.16962V2.87329H45.6562Z",fill:"white"}),C.createElement("path",{d:"M43.1869 6.58075V3.56543H42.1797V2.87329H45.0568V3.2051C45.0568 3.40392 44.8953 3.56543 44.6965 3.56543H44.0436V6.58075H43.1869Z",fill:"white"}),C.createElement("path",{d:"M64.0185 6.58043V5.02397H62.4582V6.58043H61.6016V2.87354H62.4582V4.35047H64.0185V2.87354H64.8815V6.58043H64.0185Z",fill:"white"}),C.createElement("path",{d:"M57.716 2.87305H56.8594V6.58024H57.716V2.87305Z",fill:"white"}),C.createElement("path",{d:"M54.0132 4.85171L54.0422 4.88845L55.1364 6.29876C55.2757 6.4781 55.486 6.5812 55.7131 6.5812H56.3953L54.8276 4.58707L54.8046 4.55773L54.8276 4.52839L56.1167 2.87183H55.2249L54.0431 4.46971L54.0132 4.50811L54.0129 4.44147V2.87183H53.1562V6.57929H54.0129V4.91779L54.0132 4.85171Z",fill:"white"}),C.createElement("path",{d:"M50.3249 4.57016H50.8242C51.0041 4.57016 51.1409 4.52079 51.2314 4.42373C51.3208 4.32748 51.3661 4.2027 51.3661 4.05243C51.3661 3.89859 51.3219 3.77218 51.2347 3.67592C51.1464 3.5783 51.0085 3.52894 50.8242 3.52894L50.3249 3.52866L50.3249 4.57016ZM52.0379 6.5799C51.7843 6.5799 51.5449 6.44527 51.4138 6.22809L50.7475 5.12764H50.3249V6.5799H49.4688V2.87354H50.9951C51.3872 2.87354 51.6943 2.97582 51.9079 3.17765C52.1207 3.37919 52.2288 3.65506 52.2288 3.99756C52.2288 4.17169 52.1824 4.34774 52.0908 4.52159C52.0009 4.69216 51.8408 4.832 51.6156 4.93675L51.566 4.95979L52.6061 6.57989L52.0379 6.5799Z",fill:"white"}),C.createElement("path",{d:"M58.4219 6.42275V5.71224C58.6945 5.83756 59.0457 5.96288 59.4093 5.96288C59.8273 5.96288 60.0392 5.81946 60.0395 5.54469C60.0395 5.22249 59.7546 5.18657 59.1853 4.94169C58.7975 4.76866 58.4279 4.49965 58.4279 3.87882C58.4279 3.15625 58.9791 2.81567 59.7425 2.81567C60.1484 2.81567 60.4936 2.91111 60.6875 2.98295V3.67563C60.4936 3.58622 60.1484 3.47847 59.8031 3.47847C59.4274 3.47847 59.2519 3.61586 59.2519 3.85471C59.2519 4.10563 59.4639 4.18322 59.8454 4.32663C60.3362 4.57152 60.9058 4.679 60.9058 5.5151C60.9058 6.23767 60.3302 6.63173 59.5607 6.63173C59.0882 6.63173 58.7126 6.54805 58.4219 6.42275Z",fill:"white"}),C.createElement("path",{d:"M84.875 6.58024V2.87305H87.1965V3.20925C87.1965 3.40558 87.0367 3.56518 86.8406 3.56518H85.7317V4.36234H86.9769V4.98126H85.7317V5.88837H87.1965V6.58024H84.875Z",fill:"white"}),C.createElement("path",{d:"M76.4141 6.57972V2.8728H76.8303C77.0733 2.8728 77.2707 3.07023 77.2707 3.31293V5.91228H78.638V6.57972H76.4141Z",fill:"white"}),C.createElement("path",{d:"M71.966 2.87451H71.1094V6.57922H71.966V2.87451Z",fill:"white"}),C.createElement("path",{d:"M73.6061 4.56965H74.1055C74.2853 4.56965 74.4222 4.52028 74.5127 4.42322C74.6021 4.32697 74.6473 4.2022 74.6473 4.05193C74.6473 3.89809 74.6032 3.77167 74.5162 3.67542C74.4277 3.57779 74.2897 3.52843 74.1055 3.52843H73.6061V4.56965ZM75.3192 6.57942C75.0655 6.57942 74.8261 6.44478 74.695 6.2276L74.0287 5.12715H73.6061V6.57942H72.75V2.87305H74.2763C74.6684 2.87305 74.9756 2.97561 75.1892 3.17715C75.4022 3.3787 75.51 3.65457 75.51 3.99735C75.51 4.1712 75.4637 4.34753 75.3721 4.5211C75.2821 4.69167 75.122 4.83152 74.8969 4.93626L74.8472 4.9593L75.8873 6.5794L75.3192 6.57942Z",fill:"white"}),C.createElement("path",{d:"M68.1593 5.22922L68.4958 4.2925C68.5707 4.08162 68.6455 3.85922 68.6952 3.69525H68.7078C68.7514 3.865 68.826 4.07586 68.9008 4.2925L69.225 5.22922H68.1593ZM69.2178 2.87256H68.2339L66.8359 6.58002H67.4532C67.6101 6.58002 67.748 6.47994 67.7974 6.33131L67.9408 5.89639H69.4443L69.6645 6.58002H70.5922L69.2178 2.87256Z",fill:"white"}),C.createElement("path",{d:"M87.8906 6.42299V5.71248C88.1632 5.8378 88.5145 5.96312 88.8781 5.96312C89.296 5.96312 89.5082 5.81971 89.5082 5.54494C89.5082 5.22246 89.2233 5.18682 88.6538 4.94193C88.2663 4.7689 87.8967 4.49989 87.8967 3.87906C87.8967 3.15622 88.4478 2.81592 89.2113 2.81592C89.6171 2.81592 89.9626 2.91135 90.1562 2.98319V3.67587C89.9626 3.58619 89.6171 3.47872 89.2719 3.47872C88.8965 3.47872 88.7207 3.6161 88.7207 3.85495C88.7207 4.10587 88.9327 4.18346 89.3144 4.32688C89.805 4.57176 90.3745 4.67924 90.3745 5.51534C90.3745 6.23764 89.7989 6.63197 89.0294 6.63197C88.557 6.63197 88.1813 6.54829 87.8906 6.42299Z",fill:"white"}),C.createElement("path",{d:"M80.8281 2.87331H81.359C81.6113 2.87331 81.8455 3.00329 81.9788 3.21745L83.0126 4.87841C83.1294 5.06296 83.2648 5.30675 83.3446 5.47923H83.3633C83.351 5.31278 83.3446 5.08051 83.3446 4.91406V2.87331H84.0955V6.58022H83.1565L81.899 4.57485C81.7819 4.39058 81.6587 4.17037 81.5726 4.00392H81.5603C81.5666 4.16433 81.5787 4.35491 81.5787 4.53315V6.58021H80.8281V2.87331Z",fill:"white"}),C.createElement("path",{d:"M80.0442 2.87451H79.1875V6.57922H80.0442V2.87451Z",fill:"white"}))};export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from'./../../../../../../ext/style-inject/dist/style-inject.es.js';var l={MilesSmiles:"style-module_MilesSmiles__-4b7k",MilesSmilesHeader:"style-module_MilesSmilesHeader__2wEKO",MilesSmilesHeaderLeft:"style-module_MilesSmilesHeaderLeft__azBmf",MilesSmilesLogo:"style-module_MilesSmilesLogo__Cttfa",MilesSmilesTitleWrapper:"style-module_MilesSmilesTitleWrapper__iGOg2",MilesSmilesTitle:"style-module_MilesSmilesTitle__ClDIS",MilesSmilesTitleBold:"style-module_MilesSmilesTitleBold__tSEX5",MilesSmilesSubtitle:"style-module_MilesSmilesSubtitle__4XQe2",MilesSmilesInputRow:"style-module_MilesSmilesInputRow__rgpyr",MilesSmilesInputWrapper:"style-module_MilesSmilesInputWrapper__cMQ9K",MilesSmilesInputError:"style-module_MilesSmilesInputError__tidH-",MilesSmilesInput:"style-module_MilesSmilesInput__-ADNL",MilesSmilesInputUnit:"style-module_MilesSmilesInputUnit__vza1O",MilesSmilesApprox:"style-module_MilesSmilesApprox__3P4Nr",MilesSmilesPriceBox:"style-module_MilesSmilesPriceBox__Clpc3",MilesSmilesErrorText:"style-module_MilesSmilesErrorText__02yD-",MilesSmilesNote:"style-module_MilesSmilesNote__xnNic",ToggleSwitch:"style-module_ToggleSwitch__fSVrp",ToggleSwitchActive:"style-module_ToggleSwitchActive__vd83i",ToggleSwitchThumb:"style-module_ToggleSwitchThumb__PiPwV",ToggleSwitchThumbActive:"style-module_ToggleSwitchThumbActive__RjbIp",MilesSmilesLogin:"style-module_MilesSmilesLogin__sPao6",MilesSmilesLoginLeft:"style-module_MilesSmilesLoginLeft__gL6xo",MilesSmilesLoginText:"style-module_MilesSmilesLoginText__Jlxn4",MilesSmilesLoginButtonBusy:"style-module_MilesSmilesLoginButtonBusy__m7rkq",MilesSmilesLoginButton:"style-module_MilesSmilesLoginButton__w82W4"};e(".style-module_MilesSmiles__-4b7k {\n padding: 12px;\n border-radius: 8px;\n border: 1px solid var(--checkout-border-color);\n margin-bottom: 16px;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesHeader__2wEKO {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n gap: 10px;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesHeader__2wEKO .style-module_MilesSmilesHeaderLeft__azBmf {\n display: flex;\n gap: 10px;\n align-items: center;\n flex: 1;\n min-width: 0;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesHeader__2wEKO .style-module_MilesSmilesLogo__Cttfa {\n flex-shrink: 0;\n width: 24px;\n height: 24px;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesHeader__2wEKO .style-module_MilesSmilesTitleWrapper__iGOg2 {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesHeader__2wEKO .style-module_MilesSmilesTitle__ClDIS {\n font-size: 16px;\n line-height: 24px;\n font-weight: 500;\n color: var(--checkout-primary-text-color);\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesHeader__2wEKO .style-module_MilesSmilesTitleBold__tSEX5 {\n font-weight: 600;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesHeader__2wEKO .style-module_MilesSmilesSubtitle__4XQe2 {\n font-size: 14px;\n line-height: 20px;\n color: var(--checkout-secondary-text-color);\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesInputRow__rgpyr {\n display: flex;\n align-items: center;\n gap: 10px;\n margin-top: 12px;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesInputWrapper__cMQ9K {\n display: flex;\n align-items: center;\n border: 1px solid var(--checkout-border-color);\n border-radius: 8px;\n overflow: hidden;\n background-color: var(--checkout-primary-bg-color);\n transition: border-color 0.15s ease;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesInputWrapper__cMQ9K.style-module_MilesSmilesInputError__tidH- {\n border-color: var(--checkout-error-color);\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesInput__-ADNL {\n width: 100%;\n max-width: 140px;\n padding: 6px 10px;\n border: none;\n outline: none;\n background: transparent;\n font-size: 15px;\n line-height: 20px;\n color: var(--checkout-primary-text-color);\n font-family: inherit;\n text-align: center;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesInput__-ADNL::placeholder {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesInputUnit__vza1O {\n padding: 6px 10px;\n font-size: 14px;\n line-height: 20px;\n color: var(--checkout-secondary-text-color);\n border-left: 1px solid var(--checkout-border-color);\n background-color: var(--checkout-primary-bg-color);\n white-space: nowrap;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesApprox__3P4Nr {\n font-size: 16px;\n color: var(--checkout-secondary-text-color);\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesPriceBox__Clpc3 {\n padding: 6px 10px;\n border-radius: 8px;\n background-color: var(--checkout-secondary-bg-color);\n font-size: 15px;\n line-height: 20px;\n color: var(--checkout-primary-text-color);\n white-space: nowrap;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesErrorText__02yD- {\n margin-top: 10px;\n font-size: 14px;\n line-height: 20px;\n color: var(--checkout-error-color);\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesNote__xnNic {\n margin-top: 8px;\n font-size: 13px;\n line-height: 18px;\n color: var(--checkout-secondary-text-color);\n}\n.style-module_MilesSmiles__-4b7k .style-module_ToggleSwitch__fSVrp {\n position: relative;\n width: 40px;\n height: 22px;\n background-color: #cdd5df;\n border-radius: 12px;\n cursor: pointer;\n transition: background-color 0.2s ease;\n display: flex;\n align-items: center;\n padding: 3px;\n box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);\n flex-shrink: 0;\n}\n.style-module_MilesSmiles__-4b7k .style-module_ToggleSwitch__fSVrp.style-module_ToggleSwitchActive__vd83i {\n background-color: #1f2a37;\n}\n.style-module_MilesSmiles__-4b7k .style-module_ToggleSwitchThumb__PiPwV {\n width: 16px;\n height: 16px;\n background-color: white;\n border-radius: 50%;\n transform: translateX(0px);\n transition: transform 0.2s ease;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: absolute;\n}\n.style-module_MilesSmiles__-4b7k .style-module_ToggleSwitchThumb__PiPwV.style-module_ToggleSwitchThumbActive__RjbIp {\n transform: translateX(18px);\n}\n\n.style-module_MilesSmilesLogin__sPao6 {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n padding: 12px;\n border-radius: 8px;\n border: 1px solid var(--checkout-border-color);\n margin-bottom: 16px;\n background-color: var(--checkout-card-bg-color);\n}\n.style-module_MilesSmilesLogin__sPao6 .style-module_MilesSmilesLoginLeft__gL6xo {\n display: flex;\n align-items: center;\n gap: 10px;\n flex: 1;\n min-width: 0;\n}\n.style-module_MilesSmilesLogin__sPao6 .style-module_MilesSmilesLogo__Cttfa {\n flex-shrink: 0;\n width: 24px;\n height: 24px;\n}\n.style-module_MilesSmilesLogin__sPao6 .style-module_MilesSmilesLoginText__Jlxn4 {\n font-size: 16px;\n line-height: 24px;\n color: var(--checkout-primary-text-color);\n min-width: 0;\n}\n.style-module_MilesSmilesLogin__sPao6 .style-module_MilesSmilesTitleBold__tSEX5 {\n font-weight: 600;\n}\n.style-module_MilesSmilesLogin__sPao6 .style-module_MilesSmilesErrorText__02yD- {\n margin-top: 4px;\n font-size: 14px;\n line-height: 20px;\n color: var(--checkout-error-color);\n}\n.style-module_MilesSmilesLogin__sPao6 .style-module_MilesSmilesLoginButtonBusy__m7rkq {\n opacity: 0.6;\n pointer-events: none;\n}\n.style-module_MilesSmilesLogin__sPao6 .style-module_MilesSmilesLoginButton__w82W4 {\n flex-shrink: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 8px 16px;\n background-color: #c90019;\n color: #fff;\n font-size: 16px;\n line-height: 24px;\n font-weight: 500;\n border-radius: 8px;\n text-decoration: none;\n}\n.style-module_MilesSmilesLogin__sPao6 .style-module_MilesSmilesLoginButton__w82W4:hover {\n background-color: #c90019;\n color: #fff;\n}");export{l as default};
|
|
1
|
+
import e from'./../../../../../../ext/style-inject/dist/style-inject.es.js';var l={MilesSmiles:"style-module_MilesSmiles__-4b7k",MilesSmilesBody:"style-module_MilesSmilesBody__I03ZG",MilesSmilesLogin:"style-module_MilesSmilesLogin__sPao6",MilesSmilesBanner:"style-module_MilesSmilesBanner__RnSA0",MilesSmilesBannerLogo:"style-module_MilesSmilesBannerLogo__4ac9B",MilesSmilesHeader:"style-module_MilesSmilesHeader__2wEKO",MilesSmilesTitleWrapper:"style-module_MilesSmilesTitleWrapper__iGOg2",MilesSmilesTitle:"style-module_MilesSmilesTitle__ClDIS",MilesSmilesTitleBold:"style-module_MilesSmilesTitleBold__tSEX5",MilesSmilesSubtitle:"style-module_MilesSmilesSubtitle__4XQe2",MilesSmilesChips:"style-module_MilesSmilesChips__JkGmK",MilesSmilesChip:"style-module_MilesSmilesChip__Qu4TF",MilesSmilesChipSelected:"style-module_MilesSmilesChipSelected__ay8cR",MilesSmilesInputRow:"style-module_MilesSmilesInputRow__rgpyr",MilesSmilesInputWrapper:"style-module_MilesSmilesInputWrapper__cMQ9K",MilesSmilesInputError:"style-module_MilesSmilesInputError__tidH-",MilesSmilesInput:"style-module_MilesSmilesInput__-ADNL",MilesSmilesInputUnit:"style-module_MilesSmilesInputUnit__vza1O",MilesSmilesRedeemText:"style-module_MilesSmilesRedeemText__tpFbH",MilesSmilesErrorText:"style-module_MilesSmilesErrorText__02yD-",MilesSmilesUseAll:"style-module_MilesSmilesUseAll__cbwYe",MilesSmilesUseAllLabel:"style-module_MilesSmilesUseAllLabel__ngBlj",MilesSmilesTerms:"style-module_MilesSmilesTerms__1xpun",MilesSmilesTermsLabel:"style-module_MilesSmilesTermsLabel__GsY7J",MilesSmilesTermsLink:"style-module_MilesSmilesTermsLink__BlijG",MilesSmilesTermsLinkError:"style-module_MilesSmilesTermsLinkError__ed3j5",ToggleSwitch:"style-module_ToggleSwitch__fSVrp",ToggleSwitchActive:"style-module_ToggleSwitchActive__vd83i",ToggleSwitchThumb:"style-module_ToggleSwitchThumb__PiPwV",ToggleSwitchThumbActive:"style-module_ToggleSwitchThumbActive__RjbIp",MilesSmilesLoginButton:"style-module_MilesSmilesLoginButton__w82W4",MilesSmilesLoginText:"style-module_MilesSmilesLoginText__Jlxn4",MilesSmilesLoginButtonBusy:"style-module_MilesSmilesLoginButtonBusy__m7rkq"};e(".style-module_MilesSmiles__-4b7k {\n border-radius: 8px;\n margin-bottom: 16px;\n overflow: hidden;\n background-color: var(--checkout-primary-bg-color);\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesBody__I03ZG,\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesLogin__sPao6 {\n border: 1px solid var(--checkout-border-color);\n border-top: none;\n border-radius: 0 0 8px 8px;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesBanner__RnSA0 {\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 10px 16px;\n background-color: #262626;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesBanner__RnSA0 .style-module_MilesSmilesBannerLogo__4ac9B {\n display: block;\n width: 121px;\n height: 27px;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesBody__I03ZG {\n padding: 16px 12px;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesHeader__2wEKO {\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 10px;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesHeader__2wEKO .style-module_MilesSmilesTitleWrapper__iGOg2 {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesHeader__2wEKO .style-module_MilesSmilesTitle__ClDIS {\n font-size: 16px;\n line-height: 24px;\n color: var(--checkout-primary-text-color);\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesHeader__2wEKO .style-module_MilesSmilesTitleBold__tSEX5 {\n font-weight: 500;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesHeader__2wEKO .style-module_MilesSmilesSubtitle__4XQe2 {\n font-size: 16px;\n font-weight: 500;\n line-height: 24px;\n color: #272727;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesChips__JkGmK {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n margin-top: 16px;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesChip__Qu4TF {\n padding: 6px 12px;\n border: 1px solid #e5e4e9;\n border-radius: 8px;\n background-color: transparent;\n color: #272727;\n font-family: inherit;\n font-size: 14px;\n line-height: 20px;\n cursor: pointer;\n transition: background-color 0.15s ease, color 0.15s ease;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesChip__Qu4TF.style-module_MilesSmilesChipSelected__ay8cR {\n background-color: #272727;\n border-color: #272727;\n color: #fff;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesChip__Qu4TF:disabled {\n opacity: 0.5;\n cursor: default;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesInputRow__rgpyr {\n display: flex;\n align-items: center;\n gap: 10px;\n margin-top: 16px;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesInputWrapper__cMQ9K {\n display: flex;\n align-items: center;\n border: 1px solid var(--checkout-border-color);\n border-radius: 8px;\n overflow: hidden;\n background-color: var(--checkout-primary-bg-color);\n transition: border-color 0.15s ease;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesInputWrapper__cMQ9K.style-module_MilesSmilesInputError__tidH- {\n border-color: var(--checkout-error-color);\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesInput__-ADNL {\n width: 100%;\n max-width: 140px;\n padding: 6px 10px;\n border: none;\n outline: none;\n background: transparent;\n font-size: 15px;\n line-height: 20px;\n color: var(--checkout-primary-text-color);\n font-family: inherit;\n text-align: center;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesInput__-ADNL::placeholder {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesInputUnit__vza1O {\n padding: 6px 10px;\n font-size: 14px;\n line-height: 20px;\n color: var(--checkout-secondary-text-color);\n border-left: 1px solid var(--checkout-border-color);\n background-color: var(--checkout-primary-bg-color);\n white-space: nowrap;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesRedeemText__tpFbH {\n font-size: 15px;\n line-height: 20px;\n font-weight: 500;\n color: var(--checkout-primary-text-color);\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesErrorText__02yD- {\n margin-top: 10px;\n font-size: 14px;\n line-height: 20px;\n color: var(--checkout-error-color);\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesUseAll__cbwYe {\n margin-top: 12px;\n display: flex;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesUseAll__cbwYe > div {\n width: auto;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesUseAllLabel__ngBlj {\n font-size: 14px;\n line-height: 20px;\n color: var(--checkout-primary-text-color);\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesTerms__1xpun {\n margin-top: 12px;\n display: flex;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesTerms__1xpun > div {\n width: auto;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesTermsLabel__GsY7J {\n font-size: 14px;\n line-height: 20px;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesTermsLink__BlijG {\n font-weight: 500;\n text-decoration: underline;\n cursor: pointer;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesTermsLinkError__ed3j5 {\n color: var(--checkout-error-color);\n}\n.style-module_MilesSmiles__-4b7k .style-module_ToggleSwitch__fSVrp {\n position: relative;\n width: 40px;\n height: 22px;\n background-color: #cdd5df;\n border-radius: 12px;\n cursor: pointer;\n transition: background-color 0.2s ease;\n display: flex;\n align-items: center;\n padding: 3px;\n box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);\n flex-shrink: 0;\n}\n.style-module_MilesSmiles__-4b7k .style-module_ToggleSwitch__fSVrp.style-module_ToggleSwitchActive__vd83i {\n background-color: #1f2a37;\n}\n.style-module_MilesSmiles__-4b7k .style-module_ToggleSwitchThumb__PiPwV {\n width: 16px;\n height: 16px;\n background-color: white;\n border-radius: 50%;\n transform: translateX(0px);\n transition: transform 0.2s ease;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: absolute;\n}\n.style-module_MilesSmiles__-4b7k .style-module_ToggleSwitchThumb__PiPwV.style-module_ToggleSwitchThumbActive__RjbIp {\n transform: translateX(18px);\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesLogin__sPao6 {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n padding: 12px;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_MilesSmiles__-4b7k .style-module_MilesSmilesLogin__sPao6 {\n flex-direction: column;\n align-items: stretch;\n }\n .style-module_MilesSmiles__-4b7k .style-module_MilesSmilesLogin__sPao6 .style-module_MilesSmilesLoginButton__w82W4 {\n width: 100%;\n }\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesLogin__sPao6 .style-module_MilesSmilesLoginText__Jlxn4 {\n font-size: 14px;\n line-height: 20px;\n color: var(--checkout-primary-text-color);\n min-width: 0;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesLogin__sPao6 .style-module_MilesSmilesErrorText__02yD- {\n margin-top: 4px;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesLogin__sPao6 .style-module_MilesSmilesLoginButtonBusy__m7rkq {\n opacity: 0.6;\n pointer-events: none;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesLogin__sPao6 .style-module_MilesSmilesLoginButton__w82W4 {\n flex-shrink: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 8px 16px;\n border: none;\n background-color: #c90019;\n color: #fff;\n font-size: 16px;\n line-height: 24px;\n font-weight: 500;\n font-family: inherit;\n border-radius: 8px;\n cursor: pointer;\n}\n.style-module_MilesSmiles__-4b7k .style-module_MilesSmilesLogin__sPao6 .style-module_MilesSmilesLoginButton__w82W4:hover {\n background-color: #c90019;\n color: #fff;\n}");export{l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t}from'./../../../../../../ext/tslib/tslib.es6.js';import*as r from"react";import{observer as n}from"mobx-react-lite";import"@ikas/storefront-config";import{formatCurrency as o}from"../../../../../../utils/currency.js";import{useTranslation as i}from"../../../../../../utils/i18n.js";import a from"./style.module.scss.js";import l from"../../../../components/svg/credit-balance.js";var c=n((function(n){var c,d,u,m,v=n.vm,f=i().t,C=r.useState(!1),h=C[0],p=C[1],g=(null===(c=v.storeCreditBalance)||void 0===c?void 0:c.storeCredits)&&(null===(d=v.storeCreditBalance)||void 0===d?void 0:d.storeCredits.length)>0?null===(u=v.checkout.giftCardLines)||void 0===u?void 0:u.find((function(e){var t,r;return e.code===(null===(r=null===(t=v.storeCreditBalance)||void 0===t?void 0:t.storeCredits[0])||void 0===r?void 0:r.code)})):void 0;if(r.useEffect((function(){p(!!g)}),[g]),!(null===(m=v.storeCreditBalance)||void 0===m?void 0:m.amount))return null;var E=g?(null==g?void 0:g.amount)||0:v.finalPrice>v.storeCreditBalance.amount?v.storeCreditBalance.amount:v.finalPrice;return r.createElement("div",{className:a.StoreCredit},r.createElement("div",{className:a.StoreCreditBalance},r.createElement("div",{className:a.StoreCreditBalanceLeft},r.createElement("div",{style:{width:"24px",height:"24px"}},r.createElement(l,null)),r.createElement("div",null,r.createElement("span",{className:a.StoreCreditBalanceAmount},o(E,v.checkout.currencyCode,v.checkout.currencySymbol)),r.createElement("span",null,f("checkout-page:storeCreditBalance")))),r.createElement("div",{className:a.StoreCreditBalanceRight},r.createElement("div",null,r.createElement(s,{value:h,onChange:function(r){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return p(r),r?(v.checkout.couponCode=(null===(e=v.storeCreditBalance)||void 0===e?void 0:e.storeCredits[0].code)||null,[4,v.onCouponCodeApply()]):[3,2];case 1:return t.sent(),[3,
|
|
1
|
+
import{__awaiter as e,__generator as t}from'./../../../../../../ext/tslib/tslib.es6.js';import*as r from"react";import{observer as n}from"mobx-react-lite";import"@ikas/storefront-config";import{formatCurrency as o}from"../../../../../../utils/currency.js";import{useTranslation as i}from"../../../../../../utils/i18n.js";import a from"./style.module.scss.js";import l from"../../../../components/svg/credit-balance.js";var c=n((function(n){var c,d,u,m,v=n.vm,f=i().t,C=r.useState(!1),h=C[0],p=C[1],g=(null===(c=v.storeCreditBalance)||void 0===c?void 0:c.storeCredits)&&(null===(d=v.storeCreditBalance)||void 0===d?void 0:d.storeCredits.length)>0?null===(u=v.checkout.giftCardLines)||void 0===u?void 0:u.find((function(e){var t,r;return e.code===(null===(r=null===(t=v.storeCreditBalance)||void 0===t?void 0:t.storeCredits[0])||void 0===r?void 0:r.code)})):void 0;if(r.useEffect((function(){p(!!g)}),[g]),!(null===(m=v.storeCreditBalance)||void 0===m?void 0:m.amount))return null;var E=g?(null==g?void 0:g.amount)||0:v.finalPrice>v.storeCreditBalance.amount?v.storeCreditBalance.amount:v.finalPrice;return r.createElement("div",{className:a.StoreCredit},r.createElement("div",{className:a.StoreCreditBalance},r.createElement("div",{className:a.StoreCreditBalanceLeft},r.createElement("div",{style:{width:"24px",height:"24px"}},r.createElement(l,null)),r.createElement("div",null,r.createElement("span",{className:a.StoreCreditBalanceAmount},o(E,v.checkout.currencyCode,v.checkout.currencySymbol)),r.createElement("span",null,f("checkout-page:storeCreditBalance")))),r.createElement("div",{className:a.StoreCreditBalanceRight},r.createElement("div",null,r.createElement(s,{value:h,onChange:function(r){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return p(r),r?(v.checkout.couponCode=(null===(e=v.storeCreditBalance)||void 0===e?void 0:e.storeCredits[0].code)||null,[4,v.onCouponCodeApply()]):[3,2];case 1:return t.sent(),[3,4];case 2:return[4,v.removeGiftCardLine((null==g?void 0:g.giftCardId)||"")];case 3:t.sent(),t.label=4;case 4:return[4,v.reInitPaymentMethod()];case 5:return t.sent(),[2]}}))}))}})))))})),s=function(e){var t=e.value,n=e.onChange;return r.createElement("div",{onClick:function(){n(!t)},className:[a.ToggleSwitch,t?a.ToggleSwitchActive:""].join(" ")},r.createElement("div",{className:[a.ToggleSwitchThumb,t?a.ToggleSwitchThumbActive:""].join(" ")}))};export{c as StoreCredit};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e,__spreadArray as t,__awaiter as o,__generator as i}from'./../../ext/tslib/tslib.es6.js';import*as r from"react";import{observer as a}from"mobx-react-lite";import{useRouter as s}from"next/router.js";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as d}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import{IkasMerchantSettings as n}from"../../models/data/merchant-settings/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import{IkasThemeJsonCustomData as m}from"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasStorefrontConfig as p}from"@ikas/storefront-config";import{Analytics as l}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{IkasPageHead as c}from"./head.js";import{ThemeComponent as u}from"./ThemeComponent.js";import{IkasBaseStore as f}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import{initIkasEvents as j}from"../../analytics/events.js";import{IkasPageDataInit as g}from"../../page-data-init/index.js";import{setAPIClientConfig as x}from"@ikas/storefront-api";import{usePopupWidget as v}from"./widgets/popupWidget.js";import{useLoyaltyWidget as y}from"./widgets/loyaltyWidget.js";var w=a((function(a){var u=a.propValues,w=a.themeJsonComponents,
|
|
1
|
+
import{__assign as e,__spreadArray as t,__awaiter as o,__generator as i}from'./../../ext/tslib/tslib.es6.js';import*as r from"react";import{observer as a}from"mobx-react-lite";import{useRouter as s}from"next/router.js";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as d}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import{IkasMerchantSettings as n}from"../../models/data/merchant-settings/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import{IkasThemeJsonCustomData as m}from"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasStorefrontConfig as p}from"@ikas/storefront-config";import{Analytics as l}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{IkasPageHead as c}from"./head.js";import{ThemeComponent as u}from"./ThemeComponent.js";import{IkasBaseStore as f}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import{initIkasEvents as j}from"../../analytics/events.js";import{IkasPageDataInit as g}from"../../page-data-init/index.js";import{setAPIClientConfig as x}from"@ikas/storefront-api";import{usePopupWidget as v}from"./widgets/popupWidget.js";import{useLoyaltyWidget as y}from"./widgets/loyaltyWidget.js";var w=a((function(a){var u=a.propValues,w=a.themeJsonComponents,S=a.customDataList,b=a.pageType,C=a.pageTitle,D=a.pageDescription,P=a.pageSpecificData,T=a.canonicals,k=a.disableIndex,I=a.settings,E=a.configJson,O=a.reInitOnBrowser,V=a.addOgpMetas,R=a.components,M=a.productReviewSummary,B=s(),z=r.useState(),A=z[0],H=z[1];p.init(e(e({},E),{currentPageComponents:R,loginRequiredCallback:function(){B.push("/account/login")}})),f.getInstance().router=B,x();var _=f.getInstance();_.router=B,_.currentPageType=b;var F=r.useState(!1),U=F[0],J=F[1],L=r.useMemo((function(){return(null==A?void 0:A.id)===(null==P?void 0:P.id)&&g.pageSpecificData&&g.isBrowser?b===d.PRODUCT&&g._initProductOnBrowser(g.pageSpecificData):g.setPageSpecificData(P,b,U),g.initPagePropValues(u,w,S.map((function(e){return new m(e)})),I,U)}),t(t([],b!==d.SEARCH?[U]:[],!0),[u,b,I,P,w],!1));r.useEffect((function(){O&&J("undefined"!=typeof window),window.addToCart=_.cartStore._windowAddToCart,window.getOptionValues=_.cartStore.getOptionValues,_.cartStore.getCart(),_.checkLocalization(),j()}),[]),r.useEffect((function(){P?(null==A?void 0:A.id)!==P.id&&H(P):H(null)}),[P]),r.useEffect((function(){var e=function(){_.customerStore.routeChangeInit()};return B.events.on("routeChangeStart",e),function(){B.events.off("routeChangeStart",e)}}),[]),r.useEffect((function(){!function(e,t){var r,a;o(this,void 0,void 0,(function(){var o,s,n,m,p,c;return i(this,(function(i){switch(i.label){case 0:return o=f.getInstance(),[4,l.pageView(e)];case 1:i.sent(),i.label=2;case 2:return i.trys.push([2,7,,8]),e!==d.PRODUCT?[3,4]:(s=t,"undefined"!=typeof window&&g._initProductOnBrowser(s),[4,l.productView(s)]);case 3:i.sent(),o.customerStore.onProductView(s.id,s.selectedVariant.id),i.label=4;case 4:return e===d.CATEGORY&&(m=null===(r=(n=t).categoryPathItems)||void 0===r?void 0:r.map((function(e){return e.name})).join(" > "),m=n.categoryPathItems&&(null===(a=n.categoryPathItems)||void 0===a?void 0:a.length)>0?m+" > "+n.name:n.name,l.viewCategory(m,n)),e===d.BRAND&&(p=t,l.viewBrand(p)),e!==d.CART?[3,6]:[4,o.cartStore.waitUntilInitialized()];case 5:i.sent(),l.viewCart(o.cartStore.cart),i.label=6;case 6:return[3,8];case 7:return c=i.sent(),console.error(c),[3,8];case 8:return[2]}}))}))}(b,g.pageSpecificData)}),[b,P]),v({router:B,pageType:b,pageSpecificDataId:null==P?void 0:P.id}),y({pageType:b,pageSpecificDataId:null==P?void 0:P.id});var W=r.useMemo((function(){var e=L.find((function(e){return e.component.isHeader})),t=L.find((function(e){return e.component.isFooter})),o=L.filter((function(e){return!e.component.isHeader&&!e.component.isFooter}))||[];return r.createElement("div",{style:{position:"relative",minHeight:"100vh",display:"flex",flexDirection:"column",justifyContent:"space-between"}},r.createElement("div",null,e&&h(e,I,-1),r.createElement("main",null,o.map((function(e,t){return h(e,I,t)})))),t&&h(t,I,-1))}),[L,I]),q=r.useMemo((function(){return p.getMerchantSettings()?new n(p.getMerchantSettings()):null}),[p.getMerchantSettings()]);return r.createElement(r.Fragment,null,r.createElement(c,{pageType:b,pageTitle:C,pageDescription:D,pageSpecificData:g.pageSpecificData,canonicals:T&&T.length>0?T:null,disableIndex:k,merchantSettings:q,addOgpMetas:V,productReviewSummary:M,pageComponentPropValues:L}),W)})),h=function(e,t,o){return r.createElement(u,{key:e.pageComponent.id,index:o,pageComponentPropValue:e,settings:t})};export{w as IkasPage,h as renderComponent};
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { IkasThemeJsonPageType } from "../../../models";
|
|
2
|
+
import type { IkasLoyaltyWidgetConfig, LoyaltyWidgetContextPatch } from "@ikas/loyalty-widget-renderer";
|
|
2
3
|
declare global {
|
|
3
4
|
interface Window {
|
|
4
5
|
ikasLoyaltyWidgetConfig?: IkasLoyaltyWidgetConfig;
|
|
5
6
|
startIkasLoyaltyWidget?: (config?: IkasLoyaltyWidgetConfig) => void;
|
|
7
|
+
updateIkasLoyaltyWidgetContext?: (patch: LoyaltyWidgetContextPatch) => void;
|
|
6
8
|
}
|
|
7
9
|
}
|
|
8
|
-
export declare const useLoyaltyWidget: (
|
|
10
|
+
export declare const useLoyaltyWidget: (options: {
|
|
11
|
+
pageType: IkasThemeJsonPageType;
|
|
12
|
+
pageSpecificDataId?: string | null | undefined;
|
|
13
|
+
}) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as n}from'./../../../ext/tslib/tslib.es6.js';import*as e from"react";import{StorefrontWidgetSettingsStatusEnum as r,getStorefrontWidgetSettings as i,listEarningMethods as o,getLoyaltyProgram as a,listLoyaltyProgramTiers as s,listSpendingMethodsByCartId as u,getLoyaltyCustomerInfo as c,listLoyaltyProgramPointHistory as d,useLoyaltyPoints as l,removeLoyaltyPointsFromCart as v}from"@ikas/storefront-api";import{IkasStorefrontConfig as f}from"@ikas/storefront-config";import{IkasBaseStore as g}from"../../../store/base.js";import"../../../store/customer/index.js";import"../../../store/cart/index.js";import m from"../../../store/product/index.js";import h from"../../../store/category/index.js";import y from"../../../store/brand/index.js";import{resolveStoreUrl as p}from"./common.js";import{formatCurrency as w}from"../../../utils/currency.js";import"lodash/get";function I(e){var r,p=this,I=g.getInstance(),S=function(){var t;return null===(t=I.cartStore.cart)||void 0===t?void 0:t.id},b=function(){var t;return!!(null===(t=I.customerStore.customer)||void 0===t?void 0:t.id)},L=function(t){var n,e=null!==(n=null==t?void 0:t.themeSettingsJson)&&void 0!==n?n:t;if(!e)throw new Error("Loyalty widget settings not found");if("string"==typeof e)try{return JSON.parse(e)}catch(t){throw new Error("Loyalty widget settings format is invalid")}return e};return{getLoyaltyWidget:function(){return t(p,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return e?[2,L(e)]:[4,i()];case 1:if((t=n.sent()).isSuccess&&t.data)return[2,L(t.data)];throw new Error("Loyalty widget settings not found")}}))}))},subscribeToMarketingNotifications:function(){return t(p,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,g.getInstance().customerStore.createEmailSubscription((null===(t=g.getInstance().customerStore.customer)||void 0===t?void 0:t.email)||"")];case 1:return[2,n.sent()]}}))}))},listEarningMethods:function(){return t(p,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,o()];case 1:return[2,t.sent().data||[]]}}))}))},getLoyaltyProgram:function(){return t(p,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,a()];case 1:return[2,(t=n.sent()).data?{id:t.data.id,waitingPeriodDays:t.data.waitingPeriodDays}:null]}}))}))},listLoyaltyProgramTier:function(e){return t(p,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,s()];case 1:return[2,t.sent().data||[]]}}))}))},listSpendingMethodsByCartId:function(e){return t(p,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return b()?[4,u({cartId:e||S()})]:[2,[]];case 1:return[2,t.sent().data||[]]}}))}))},getLoyaltyCustomerInfo:function(){return t(p,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return b()?[4,c({cartId:S()||null})]:[2,null];case 1:return[2,t.sent().data||null]}}))}))},listLoyaltyProgramPointHistory:function(e){return t(p,void 0,void 0,(function(){var t,r;return n(this,(function(n){switch(n.label){case 0:return b()?(t={},(r=null==e?void 0:e.type)&&(t.type=Array.isArray(r)?{in:r}:{eq:r}),[4,d(t)]):[2,[]];case 1:return[2,n.sent().data||[]]}}))}))},useLoyaltyPoints:function(e){return t(p,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return b()?[4,l({input:e})]:[2,!1];case 1:return(t=n.sent()).isSuccess?(r=e.loyaltySpendingMethodId,[4,I.cartStore.getCart()]):[3,3];case 2:n.sent(),n.label=3;case 3:return[2,!!t.isSuccess]}}))}))},removeLoyaltyPointsFromCart:function(){return t(p,void 0,void 0,(function(){var t,e,i,o,a;return n(this,(function(n){switch(n.label){case 0:return b()?(t=S(),e=r||(null===(a=null===(o=null===(i=I.cartStore.cart)||void 0===i?void 0:i.loyaltyLines)||void 0===o?void 0:o[0])||void 0===a?void 0:a.loyaltySpendingMethodId),t&&e?[4,v({cartId:t,loyaltySpendingMethodId:e})]:[2]):[2];case 1:return n.sent().isSuccess?[4,I.cartStore.getCart()]:[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}}))}))},getProducts:function(e){return t(p,void 0,void 0,(function(){var t,r;return n(this,(function(n){switch(n.label){case 0:return(null==e?void 0:e.length)?[4,m.searchProducts({input:{productIdList:e,page:1,perPage:e.length,priceListId:f.getPriceListId(),salesChannelId:f.getSalesChannelId()}},[])]:[2,[]];case 1:return t=n.sent(),[2,((null===(r=t.data)||void 0===r?void 0:r.data)||[]).map((function(t){var n,e,r,i,o,a,s;return{id:t.id,name:t.name,mainImageSrc:(null===(o=null===(i=null===(r=null===(e=null===(n=t.variants)||void 0===n?void 0:n[0])||void 0===e?void 0:e.images)||void 0===r?void 0:r.find((function(t){return t.isMain})))||void 0===i?void 0:i.image)||void 0===o?void 0:o.thumbnailSrc)||null,variants:(null===(a=t.variants)||void 0===a?void 0:a.map((function(t){var n,e,r,i;return{id:t.id,mainImageSrc:(null===(r=null===(e=null===(n=t.images)||void 0===n?void 0:n.find((function(t){return t.isMain})))||void 0===e?void 0:e.image)||void 0===r?void 0:r.thumbnailSrc)||null,variantText:(null===(i=t.variantValues)||void 0===i?void 0:i.map((function(t){return t.name})).join(" / "))||null}})))||[],url:null===(s=t.metaData)||void 0===s?void 0:s.slug}}))]}}))}))},getCategories:function(e){return t(p,void 0,void 0,(function(){var t,r,i;return n(this,(function(n){switch(n.label){case 0:return(null==e?void 0:e.length)?(t={id:{in:e},pagination:{limit:e.length,page:1}},[4,h.listCategory(t)]):[2,[]];case 1:return r=n.sent(),[2,(null===(i=r.data)||void 0===i?void 0:i.data)||[]]}}))}))},getBrands:function(e){return t(p,void 0,void 0,(function(){var t,r,i;return n(this,(function(n){switch(n.label){case 0:return(null==e?void 0:e.length)?(t={id:{in:e},pagination:{limit:e.length,page:1}},[4,y.listProductBrand(t)]):[2,[]];case 1:return r=n.sent(),[2,(null===(i=r.data)||void 0===i?void 0:i.data)||[]]}}))}))},getTags:function(e){return t(p,void 0,void 0,(function(){return n(this,(function(t){return[2,[]]}))}))},formatCurrency:function(t){return w(t,f.getDefaultCurrencyCode()||"TRY",f.getDefaultCurrencySymbol()||"TRY")}}}var S=function(){e.useEffect((function(){if("undefined"!=typeof window&&"undefined"!=typeof document){var e=!1,o=function(t){if("function"==typeof window.startIkasLoyaltyWidget)try{window.startIkasLoyaltyWidget(t)}catch(t){console.error("[@ikas/storefront] Failed to start loyalty widget",t)}},a=function(t){var n,r=(n=Date.now(),[window.location.href.includes("http://localhost:3333/")?"http://localhost:3000/storefront-widget-script-injector.iife.js":"".concat("/sf/assets/popup/storefront-widget-script-injector.iife.js","?v=").concat(n)])[0];if(r){var i=document.querySelector('script[data-ikas-loyalty-widget="true"]');if(i)"true"===i.dataset.loaded?o(t):i.addEventListener("load",(function(){return o(t)}),{once:!0});else{var a=document.createElement("script");a.src=r,a.defer=!0,a.setAttribute("data-ikas-loyalty-widget","true"),a.addEventListener("load",(function(){a.dataset.loaded="true",e||o(t)}),{once:!0}),a.addEventListener("error",(function(t){console.error("[@ikas/storefront] Failed to load loyalty widget script",r,t)}),{once:!0}),document.body.appendChild(a)}}};return t(void 0,void 0,void 0,(function(){var e,o,s,u,c,d;return n(this,(function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),(e=f.getLoyaltyPrograms()).length?(o=f.getStorefrontRoutingId(),s=[],e.forEach((function(t){var n;null===(n=t.salesChannels)||void 0===n||n.forEach((function(t){var n;null===(n=t.routingIds)||void 0===n||n.forEach((function(t){s.push(t)}))}))})),e.length>0&&o&&!s.some((function(t){return t===o}))?[2]:[4,i()]):[2];case 1:return(null==(u=l.sent())?void 0:u.isSuccess)&&u.data&&u.data.status===r.ACTIVE?[4,(v=u.data,t(void 0,void 0,void 0,(function(){var e,r,i,o,a,s,u;return n(this,(function(c){switch(c.label){case 0:return e={cdnURL:f.getCdnUrl()||"",merchantId:(null===(a=f.getMerchantSettings())||void 0===a?void 0:a.merchantId)||"",currency:f.getDefaultCurrencySymbol()||"TRY",callbacks:I(v),position:"fixed",storeURL:p()},[4,new Promise((function(t){var n=setInterval((function(){var e=f.getSessionId();e&&(clearInterval(n),t(e))}),100)}))];case 1:return c.sent(),[4,t(void 0,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return(t=g.getInstance().cartStore).isCartLoadFinished?[2]:t.isLoadingCart?[4,new Promise((function(n){var e=setInterval((function(){t.isCartLoadFinished&&(clearInterval(e),n(null))}),100)}))]:[3,2];case 1:case 3:return n.sent(),[2];case 2:return[4,t.getCart()]}}))}))];case 2:return c.sent(),r=g.getInstance(),(i=null===(s=r.cartStore.cart)||void 0===s?void 0:s.id)&&(e.cartId=i),[4,r.customerStore.waitUntilInitialized()];case 3:return c.sent(),(o=null===(u=r.customerStore.customer)||void 0===u?void 0:u.id)&&(e.userId=o),v&&(e.widgetSettings=v),[2,e]}}))})))]:[2];case 2:return c=l.sent(),window.ikasLoyaltyWidgetConfig=c,a(c),[3,4];case 3:return d=l.sent(),console.error("[@ikas/storefront] Failed to initialize loyalty widget",d),[3,4];case 4:return[2]}var v}))})),function(){e=!0}}}),[])};export{S as useLoyaltyWidget};
|
|
1
|
+
import{__awaiter as t,__generator as e}from'./../../../ext/tslib/tslib.es6.js';import*as n from"react";import{getStorefrontWidgetSettings as i,listEarningMethods as r,getLoyaltyProgram as o,listLoyaltyProgramTiers as a,listSpendingMethodsByCartId as s,getLoyaltyCustomerInfo as u,listLoyaltyProgramPointHistory as d,useLoyaltyPoints as c,removeLoyaltyPointsFromCart as l,StorefrontWidgetSettingsStatusEnum as v,getLoyaltyWidgetSettings as f}from"@ikas/storefront-api";import{IkasStorefrontConfig as g}from"@ikas/storefront-config";import{IkasBaseStore as y}from"../../../store/base.js";import"../../../store/customer/index.js";import"../../../store/cart/index.js";import p from"../../../store/product/index.js";import h from"../../../store/category/index.js";import m from"../../../store/brand/index.js";import{resolveStoreUrl as w}from"./common.js";import{formatCurrency as S}from"../../../utils/currency.js";import"lodash/get";var I=function(n,i,r){return t(void 0,void 0,void 0,(function(){var o,a,s,u,d,c,l;return e(this,(function(v){switch(v.label){case 0:return o={cdnURL:g.getCdnUrl()||"",merchantId:(null===(d=g.getMerchantSettings())||void 0===d?void 0:d.merchantId)||"",currency:g.getDefaultCurrencySymbol()||"TRY",callbacks:C(n),position:"fixed",storeURL:w(),pageFilters:i,pageContext:r},[4,new Promise((function(t){var e=setInterval((function(){var n=g.getSessionId();n&&(clearInterval(e),t(n))}),100)}))];case 1:return v.sent(),[4,t(void 0,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return(t=y.getInstance().cartStore).isCartLoadFinished?[2]:t.isLoadingCart?[4,new Promise((function(e){var n=setInterval((function(){t.isCartLoadFinished&&(clearInterval(n),e(null))}),100)}))]:[3,2];case 1:case 3:return e.sent(),[2];case 2:return[4,t.getCart()]}}))}))];case 2:return v.sent(),a=y.getInstance(),(s=null===(c=a.cartStore.cart)||void 0===c?void 0:c.id)&&(o.cartId=s),[4,a.customerStore.waitUntilInitialized()];case 3:return v.sent(),(u=null===(l=a.customerStore.customer)||void 0===l?void 0:l.id)&&(o.userId=u),n&&(o.widgetSettings=n),[2,o]}}))}))};function C(n){var v,f=this,w=y.getInstance(),I=function(){var t;return null===(t=w.cartStore.cart)||void 0===t?void 0:t.id},C=function(){var t;return!!(null===(t=w.customerStore.customer)||void 0===t?void 0:t.id)},b=function(t){var e,n=null!==(e=null==t?void 0:t.themeSettingsJson)&&void 0!==e?e:t;if(!n)throw new Error("Loyalty widget settings not found");if("string"==typeof n)try{return JSON.parse(n)}catch(t){throw new Error("Loyalty widget settings format is invalid")}return n};return{getLoyaltyWidget:function(){return t(f,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return n?[2,b(n)]:[4,i()];case 1:if((t=e.sent()).isSuccess&&t.data)return[2,b(t.data)];throw new Error("Loyalty widget settings not found")}}))}))},subscribeToMarketingNotifications:function(){return t(f,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,y.getInstance().customerStore.createEmailSubscription((null===(t=y.getInstance().customerStore.customer)||void 0===t?void 0:t.email)||"")];case 1:return[2,e.sent()]}}))}))},listEarningMethods:function(){return t(f,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,r()];case 1:return[2,t.sent().data||[]]}}))}))},getLoyaltyProgram:function(){return t(f,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,o()];case 1:return[2,(t=e.sent()).data?{id:t.data.id,waitingPeriodDays:t.data.waitingPeriodDays}:null]}}))}))},listLoyaltyProgramTier:function(n){return t(f,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,a()];case 1:return[2,t.sent().data||[]]}}))}))},listSpendingMethodsByCartId:function(n){return t(f,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return C()?[4,s({cartId:n||I()})]:[2,[]];case 1:return[2,t.sent().data||[]]}}))}))},getLoyaltyCustomerInfo:function(){return t(f,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return C()?[4,u({cartId:I()||null})]:[2,null];case 1:return[2,t.sent().data||null]}}))}))},listLoyaltyProgramPointHistory:function(n){return t(f,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return C()?(t={},(i=null==n?void 0:n.type)&&(t.type=Array.isArray(i)?{in:i}:{eq:i}),[4,d(t)]):[2,[]];case 1:return[2,e.sent().data||[]]}}))}))},useLoyaltyPoints:function(n){return t(f,void 0,void 0,(function(){var t,i,r,o,a;return e(this,(function(e){switch(e.label){case 0:return C()?[4,c({input:n})]:[2,{isSuccess:!1}];case 1:return(t=e.sent()).isSuccess&&(v=n.loyaltySpendingMethodId),[4,w.cartStore.getCart()];case 2:return e.sent(),i=null===(a=null===(o=null===(r=t.graphQLErrors)||void 0===r?void 0:r[0])||void 0===o?void 0:o.extensions)||void 0===a?void 0:a.code,[2,{isSuccess:!!t.isSuccess,errorCode:"string"==typeof i?i:null}]}}))}))},removeLoyaltyPointsFromCart:function(){return t(f,void 0,void 0,(function(){var t,n,i,r,o;return e(this,(function(e){switch(e.label){case 0:return C()?(t=I(),n=v||(null===(o=null===(r=null===(i=w.cartStore.cart)||void 0===i?void 0:i.loyaltyLines)||void 0===r?void 0:r[0])||void 0===o?void 0:o.loyaltySpendingMethodId),t&&n?[4,l({cartId:t,loyaltySpendingMethodId:n})]:[2]):[2];case 1:return e.sent().isSuccess?[4,w.cartStore.getCart()]:[3,3];case 2:e.sent(),e.label=3;case 3:return[2]}}))}))},getProducts:function(n){return t(f,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return(null==n?void 0:n.length)?[4,p.searchProducts({input:{productIdList:n,page:1,perPage:n.length,priceListId:g.getPriceListId(),salesChannelId:g.getSalesChannelId()}},[])]:[2,[]];case 1:return t=e.sent(),[2,((null===(i=t.data)||void 0===i?void 0:i.data)||[]).map((function(t){var e,n,i,r,o,a,s;return{id:t.id,name:t.name,mainImageSrc:(null===(o=null===(r=null===(i=null===(n=null===(e=t.variants)||void 0===e?void 0:e[0])||void 0===n?void 0:n.images)||void 0===i?void 0:i.find((function(t){return t.isMain})))||void 0===r?void 0:r.image)||void 0===o?void 0:o.thumbnailSrc)||null,variants:(null===(a=t.variants)||void 0===a?void 0:a.map((function(t){var e,n,i,r;return{id:t.id,mainImageSrc:(null===(i=null===(n=null===(e=t.images)||void 0===e?void 0:e.find((function(t){return t.isMain})))||void 0===n?void 0:n.image)||void 0===i?void 0:i.thumbnailSrc)||null,variantText:(null===(r=t.variantValues)||void 0===r?void 0:r.map((function(t){return t.name})).join(" / "))||null}})))||[],url:null===(s=t.metaData)||void 0===s?void 0:s.slug}}))]}}))}))},getCategories:function(n){return t(f,void 0,void 0,(function(){var t,i,r;return e(this,(function(e){switch(e.label){case 0:return(null==n?void 0:n.length)?(t={id:{in:n},pagination:{limit:n.length,page:1}},[4,h.listCategory(t)]):[2,[]];case 1:return i=e.sent(),[2,(null===(r=i.data)||void 0===r?void 0:r.data)||[]]}}))}))},getBrands:function(n){return t(f,void 0,void 0,(function(){var t,i,r;return e(this,(function(e){switch(e.label){case 0:return(null==n?void 0:n.length)?(t={id:{in:n},pagination:{limit:n.length,page:1}},[4,m.listProductBrand(t)]):[2,[]];case 1:return i=e.sent(),[2,(null===(r=i.data)||void 0===r?void 0:r.data)||[]]}}))}))},getTags:function(n){return t(f,void 0,void 0,(function(){return e(this,(function(t){return[2,[]]}))}))},formatCurrency:function(t){return S(t,g.getDefaultCurrencyCode()||"TRY",g.getDefaultCurrencySymbol()||"TRY")}}}var b=function(r){var o=r.pageType,a=r.pageSpecificDataId,s=n.useRef({pageType:o,pageSpecificDataId:a||null});n.useEffect((function(){var t;s.current={pageType:o,pageSpecificDataId:a||null},t={pageContext:s.current},"undefined"!=typeof window&&(window.ikasLoyaltyWidgetConfig&&(void 0!==t.pageFilters&&(window.ikasLoyaltyWidgetConfig.pageFilters=t.pageFilters),void 0!==t.pageContext&&(window.ikasLoyaltyWidgetConfig.pageContext=t.pageContext)),"function"!=typeof window.updateIkasLoyaltyWidgetContext?window.dispatchEvent(new CustomEvent("ikas:loyalty-widget-context-update",{detail:t})):window.updateIkasLoyaltyWidgetContext(t))}),[o,a]),n.useEffect((function(){if("undefined"!=typeof window&&"undefined"!=typeof document){var n=!1,r=function(t){if("function"==typeof window.startIkasLoyaltyWidget)try{window.startIkasLoyaltyWidget(t)}catch(t){console.error("[@ikas/storefront] Failed to start loyalty widget",t)}},o=function(t){var e,i=(e=Date.now(),[window.location.href.includes("http://localhost:3333/")?"http://localhost:3000/storefront-widget-script-injector.iife.js":"".concat("/sf/assets/popup/storefront-widget-script-injector.iife.js","?v=").concat(e)])[0];if(i){var o=document.querySelector('script[data-ikas-loyalty-widget="true"]');if(o)"true"===o.dataset.loaded?r(t):o.addEventListener("load",(function(){return r(t)}),{once:!0});else{var a=document.createElement("script");a.src=i,a.defer=!0,a.setAttribute("data-ikas-loyalty-widget","true"),a.addEventListener("load",(function(){a.dataset.loaded="true",n||r(t)}),{once:!0}),a.addEventListener("error",(function(t){console.error("[@ikas/storefront] Failed to load loyalty widget script",i,t)}),{once:!0}),document.body.appendChild(a)}}};return t(void 0,void 0,void 0,(function(){var n,r,a,u,d,c,l;return e(this,(function(y){switch(y.label){case 0:return y.trys.push([0,4,,5]),(n=g.getLoyaltyPrograms()).length?(r=g.getStorefrontRoutingId(),a=[],n.forEach((function(t){var e;null===(e=t.salesChannels)||void 0===e||e.forEach((function(t){var e;null===(e=t.routingIds)||void 0===e||e.forEach((function(t){a.push(t)}))}))})),n.length>0&&r&&!a.some((function(t){return t===r}))?[2]:[4,i()]):[2];case 1:return(null==(u=y.sent())?void 0:u.isSuccess)&&u.data&&u.data.status===v.ACTIVE?[4,t(void 0,void 0,void 0,(function(){var t,n,i,r;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,f()];case 1:return(null==(t=e.sent())?void 0:t.isSuccess)&&(null===(r=null===(i=t.data)||void 0===i?void 0:i.pageFilters)||void 0===r?void 0:r.length)?[2,t.data.pageFilters]:[3,3];case 2:return n=e.sent(),console.error("[@ikas/storefront] Failed to fetch loyalty widget page filters",n),[3,3];case 3:return[2,null]}}))}))]:[2];case 2:return d=y.sent(),[4,I(u.data,d,s.current)];case 3:return c=y.sent(),window.ikasLoyaltyWidgetConfig=c,o(c),[3,5];case 4:return l=y.sent(),console.error("[@ikas/storefront] Failed to initialize loyalty widget",l),[3,5];case 5:return[2]}}))})),function(){n=!0}}}),[])};export{b as useLoyaltyWidget};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { IkasCartCampaignOffer } from "./campaign-offer";
|
|
2
2
|
import { IkasAvailableShippingMethod } from "./available-shipping-method";
|
|
3
3
|
import { IkasOrder } from "../order";
|
|
4
|
-
import { IkasCart as ICart, IkasCartCreatedBy } from "@ikas/storefront-models";
|
|
4
|
+
import { IkasCart as ICart, IkasCartCreatedBy, IkasCartDroppedLoyaltyLine } from "@ikas/storefront-models";
|
|
5
5
|
export declare class IkasCart extends IkasOrder implements ICart {
|
|
6
6
|
availableShippingMethods: IkasAvailableShippingMethod[] | null;
|
|
7
7
|
campaignOffers: IkasCartCampaignOffer[] | null;
|
|
8
8
|
couponCode: string | null;
|
|
9
9
|
createdBy: IkasCartCreatedBy | null;
|
|
10
|
+
droppedLoyaltyLines: IkasCartDroppedLoyaltyLine[] | null;
|
|
10
11
|
shippingSettingsId: string | null;
|
|
11
12
|
shippingZoneRateId: string | null;
|
|
12
13
|
stockLocationId: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__extends as n}from'./../../../ext/tslib/tslib.es6.js';import{IkasCartCampaignOffer as
|
|
1
|
+
import{__extends as n,__assign as i}from'./../../../ext/tslib/tslib.es6.js';import{IkasCartCampaignOffer as o}from"./campaign-offer/index.js";import{IkasAvailableShippingMethod as e}from"./available-shipping-method/index.js";import{IkasOrder as l}from"../order/index.js";import{makeObservable as t,observable as p}from"mobx";var a=function(l){function a(n,a){var d,s,r,u=this;return(u=l.call(this,n,a)||this).availableShippingMethods=null,u.campaignOffers=null,u.couponCode=null,u.droppedLoyaltyLines=null,u.shippingSettingsId=null,u.shippingZoneRateId=null,u.stockLocationId=null,u.availableShippingMethods=(null===(d=n.availableShippingMethods)||void 0===d?void 0:d.map((function(n){return new e(n)})))||null,u.campaignOffers=(null===(s=n.campaignOffers)||void 0===s?void 0:s.map((function(n){return new o(n)})))||null,u.couponCode=n.couponCode||null,u.createdBy=n.createdBy||null,u.droppedLoyaltyLines=(null===(r=n.droppedLoyaltyLines)||void 0===r?void 0:r.map((function(n){return i({},n)})))||null,u.shippingSettingsId=n.shippingSettingsId||null,u.shippingZoneRateId=n.shippingZoneRateId||null,u.stockLocationId=n.stockLocationId||null,t(u,{availableShippingMethods:p,campaignOffers:p,couponCode:p,createdBy:p,droppedLoyaltyLines:p,shippingSettingsId:p,shippingZoneRateId:p,stockLocationId:p}),u}return n(a,l),a}(l);export{a as IkasCart};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { IkasOrderLineBundleProductSettings as IOrderLineBundleProductSettings } from "@ikas/storefront-models";
|
|
2
|
+
import { IkasOrderLineVariant } from "../variant";
|
|
2
3
|
export declare class IkasOrderLineBundleProductSettings implements IOrderLineBundleProductSettings {
|
|
3
4
|
bundleLineId: string;
|
|
4
5
|
bundleLineQuantity: number;
|
|
5
6
|
name: string | null;
|
|
7
|
+
variant: IkasOrderLineVariant | null;
|
|
6
8
|
constructor(data: IOrderLineBundleProductSettings);
|
|
7
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeAutoObservable as n}from"mobx";var
|
|
1
|
+
import{makeAutoObservable as n}from"mobx";import{IkasOrderLineVariant as i}from"../variant/index.js";var t=function(t){this.bundleLineId=t.bundleLineId||"",this.bundleLineQuantity=t.bundleLineQuantity||0,this.name=t.name||null,this.variant=t.variant?new i(t.variant):null,n(this)};export{t as IkasOrderLineBundleProductSettings};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeAutoObservable as e}from"mobx";import{IkasThemeJsonComponent as
|
|
1
|
+
import{makeAutoObservable as e}from"mobx";import{IkasThemeJsonComponent as o}from"./component/index.js";import{IkasThemeJsonComponentProp as n}from"./component/prop/index.js";import{IkasThemeJsonCustomData as r}from"./custom-data/index.js";import{IkasThemeJsonPage as i}from"./page/index.js";import{IkasThemeJsonPageComponent as t}from"./page/component/index.js";import{IkasThemeJsonSettings as a}from"./settings/index.js";import{IkasThemeJsonComponentPropType as s,IkasThemeJsonPageType as p}from"@ikas/storefront-models";var m="checkout",u=function(){function m(n){var t;void 0===n&&(n={}),this.name=n.name||"",this.components=n.components?n.components.map((function(e){return new o(e)})):[],this.pages=n.pages?n.pages.map((function(e){return new i(e)})):[],this.settings=n.settings?new a(n.settings):new a,this.customData=n.customData?null===(t=n.customData)||void 0===t?void 0:t.map((function(e){return new r(e)})):[],this.createCheckoutData(),e(this)}return Object.defineProperty(m.prototype,"headerComponent",{get:function(){return this.components.find((function(e){return e.isHeader}))},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"footerComponent",{get:function(){return this.components.find((function(e){return e.isFooter}))},enumerable:!1,configurable:!0}),m.prototype.createCheckoutData=function(){var e=this.components.find((function(e){return"checkout"===e.id})),r=this.pages.find((function(e){return"checkout"===e.id}));e||(e=new o({id:"checkout",dir:"",displayName:"",props:[new n({name:"logo",isRequired:!1,type:s.IMAGE}),new n({name:"showTax",isRequired:!1,type:s.BOOLEAN}),new n({name:"showLoyaltyPoints",isRequired:!1,type:s.BOOLEAN}),new n({name:"showCampaignOffersDesign",isRequired:!1,type:s.BOOLEAN}),new n({name:"showCampaignIsBiggerImage",isRequired:!1,type:s.BOOLEAN}),new n({name:"campaignOfferIsSmallDesign",isRequired:!1,type:s.BOOLEAN}),new n({name:"campaignOffersTitleColor",isRequired:!1,type:s.COLOR}),new n({name:"campaignOffersDescriptionColor",isRequired:!1,type:s.COLOR}),new n({name:"campaignOffersContainerBgColor",isRequired:!1,type:s.COLOR}),new n({name:"showCampaignShowDiscountSettings",isRequired:!1,type:s.BOOLEAN}),new n({name:"showCampaignHideDiscountBadge",isRequired:!1,type:s.BOOLEAN}),new n({name:"campaignOfferCountdownStyleIsLine",isRequired:!1,type:s.BOOLEAN}),new n({name:"campaignOffersDiscountPercentageColor",isRequired:!1,type:s.COLOR}),new n({name:"campaignOffersDiscountPercentageBgColor",isRequired:!1,type:s.COLOR}),new n({name:"showCampaignShowCountdownSettings",isRequired:!1,type:s.BOOLEAN}),new n({name:"campaignOffersCountdownTextColor",isRequired:!1,type:s.COLOR}),new n({name:"campaignOffersCountdownTimeColor",isRequired:!1,type:s.COLOR}),new n({name:"campaignOffersCountdownBgColor",isRequired:!1,type:s.COLOR}),new n({name:"campaignOffersEnableMiddlePhase",isRequired:!1,type:s.BOOLEAN}),new n({name:"campaignOffersMiddlePhaseOverlayColor",isRequired:!1,type:s.COLOR}),new n({name:"campaignOfferCountdownStyleIsLineSuccessPage",isRequired:!1,type:s.BOOLEAN}),new n({name:"buttonBgColor",isRequired:!1,type:s.COLOR}),new n({name:"buttonTextColor",isRequired:!1,type:s.COLOR}),new n({name:"buttonDisabledBgColor",isRequired:!1,type:s.COLOR}),new n({name:"buttonDisabledTextColor",isRequired:!1,type:s.COLOR}),new n({name:"primaryTextColor",isRequired:!1,type:s.COLOR}),new n({name:"secondaryTextColor",isRequired:!1,type:s.COLOR}),new n({name:"primaryBgColor",isRequired:!1,type:s.COLOR}),new n({name:"secondaryBgColor",isRequired:!1,type:s.COLOR}),new n({name:"borderColor",isRequired:!1,type:s.COLOR}),new n({name:"cardBgColor",isRequired:!1,type:s.COLOR}),new n({name:"errorColor",isRequired:!1,type:s.COLOR}),new n({name:"errorLightColor",isRequired:!1,type:s.COLOR}),new n({name:"warningColor",isRequired:!1,type:s.COLOR}),new n({name:"warningLightColor",isRequired:!1,type:s.COLOR}),new n({name:"successColor",isRequired:!1,type:s.COLOR}),new n({name:"successLightColor",isRequired:!1,type:s.COLOR}),new n({name:"secondaryButtonBgColor",isRequired:!1,type:s.COLOR}),new n({name:"secondaryButtonTextColor",isRequired:!1,type:s.COLOR}),new n({name:"secondaryButtonBorderColor",isRequired:!1,type:s.COLOR}),new n({name:"loyaltyIconColor",isRequired:!1,type:s.COLOR})]}),this.components.push(e)),r||this.pages.push(new i({id:"checkout",type:p.CHECKOUT,components:[new t({componentId:e.id,propValues:{logo:null,showTax:!0,showLoyaltyPoints:!1,showCampaignOffersDesign:!1,showCampaignIsBiggerImage:!1,campaignOfferIsSmallDesign:!1,showCampaignShowDiscountSettings:!1,showCampaignHideDiscountBadge:!1,campaignOfferCountdownStyleIsLine:!1,campaignOfferCountdownStyleIsLineSuccessPage:!1,showCampaignShowCountdownSettings:!1,campaignOffersEnableMiddlePhase:!1,campaignOffersTitleColor:c,campaignOffersDescriptionColor:d,campaignOffersContainerBgColor:g,campaignOffersDiscountPercentageColor:f,campaignOffersDiscountPercentageBgColor:l,campaignOffersCountdownTextColor:w,campaignOffersCountdownTimeColor:y,campaignOffersCountdownBgColor:R,campaignOffersMiddlePhaseOverlayColor:L,buttonBgColor:C,buttonTextColor:O,buttonDisabledBgColor:h,buttonDisabledTextColor:B,primaryTextColor:F,secondaryTextColor:q,primaryBgColor:E,secondaryBgColor:D,borderColor:b,cardBgColor:x,errorColor:T,errorLightColor:A,warningColor:S,warningLightColor:I,successColor:P,successLightColor:N,secondaryButtonBgColor:j,secondaryButtonTextColor:k,secondaryButtonBorderColor:v,loyaltyIconColor:M}})]}))},m}(),C="#272727",O="#FFFFFF",c="#272727",d="#272727",g="#ffffff",l="#FFF1BD",f="#272727",w="#272727",y="#FB4E4E",R="#FFF5F6",L="#27272799",h="#F7F7F9",B="#8A8B94",F="#272727",q="#8A8B94",E="#FFFFFF",D="#F7F7F9",b="#E5E4E9",x="#F7F7F9",T="#FB4E4E",A="#FCF3F4",S="#FFBC1F",I="#FFFAEE",P="#2DCA73",N="#F6FFED",j="#ffffff00",k="#272727",v="#E5E4E9",M="#F5B53F";export{m as CHECKOUT_ID,u as IkasThemeJson};
|
package/build/pages/checkout.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as o,__awaiter as e,__generator as t,__assign as r}from'./../ext/tslib/tslib.es6.js';import*as i from"react";import{observer as s}from"mobx-react-lite";import n from"../components/checkout/index.js";import{useRouter as d}from"next/router.js";import{FullscreenLoading as a}from"../components/checkout/components/fullscreen-loading/index.js";import{CheckoutLoadFailed as m,getCheckoutHomeHref as c}from"../components/checkout/components/checkout-load-failed/index.js";import{CheckoutStep as l}from"../components/checkout/model.js";import{setAPIClientConfig as u,getCartById as p,CampaignOfferTargetPageTypeEnum as f}from"@ikas/storefront-api";import{IkasStorefrontConfig as j}from"@ikas/storefront-config";import"../analytics/analytics.js";import"../analytics/head/index.js";import"../components/page/index.js";import"../components/page/head.js";import"next/image.js";import"@ikas/storefront-model-functions";import"../components/link/index.js";import"../components/page-editor/loader/style.module.scss.js";import"../components/google-captcha/index.js";import"../components/paypal-express-checkout/index.js";import{IkasBaseStore as g}from"../store/base.js";import"mobx";import"../models/data/blog/category/index.js";import"../models/data/blog/content/index.js";import"../models/data/blog/meta-data/index.js";import"../models/data/blog/tag/index.js";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"@ikas/storefront-models";import"../models/data/campaign-offer/index.js";import"../models/data/cart/campaign-offer/index.js";import{IkasCart as x}from"../models/data/cart/index.js";import"../models/data/category/path-item/index.js";import"../models/data/category/index.js";import{IkasCheckout as y}from"../models/data/checkout/index.js";import"../models/data/checkout-settings/index.js";import"../models/data/city/index.js";import"../models/data/country/index.js";import"../models/data/customer/address/region/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/address/ikas-localized-customer-address.js";import"../models/data/customer/attribute/index.js";import"../models/data/customer/review/summary/index.js";import"../models/data/customer/review/index.js";import"../models/data/customer/index.js";import"../models/data/customer-form-data-input/index.js";import"../models/data/district/index.js";import"../models/data/favorite-product/index.js";import"../models/data/filter-category/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/order/address/region/index.js";import"../models/data/order/address/index.js";import"../models/data/order/line-item/option/value/index.js";import"../models/data/order/line-item/variant/value/index.js";import"../models/data/order/line-item/variant/index.js";import"../models/data/order/line-item/index.js";import"../models/data/order/order-transaction-with-prices/index.js";import"../models/data/order/package/index.js";import"../models/data/order/transaction/index.js";import"../models/data/order/index.js";import"../models/data/payment-gateway/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product/filter/index.js";import"../models/data/product/campaign-offer/index.js";import"../models/data/product/option-set/option/index.js";import"../models/data/product/option-set/index.js";import"../models/data/product/stock-location/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product/variant/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/index.js";import"../models/data/raffle/index.js";import"../models/data/shipping-zone/state/city/district/region/index.js";import"../models/data/state/index.js";import"../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../models/data/storefront-popup/index.js";import"../models/data/theme-json/index.js";import"../models/data/theme-json/component/index.js";import"../models/data/theme-json/custom-data/index.js";import"../models/data/variant-type/variant-value/index.js";import{LocalizedAddressConfig as v}from"@ikas/localized-address";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/brand-list/index.js";import"../models/ui/category-list/index.js";import"../models/ui/product-list/index.js";import"../models/ui/product-attribute-detail/index.js";import"../models/ui/product-attribute-list/index.js";import"../models/ui/customer-review-list/index.js";import"../models/ui/customer-review-summary-list/index.js";import"../models/ui/validator/index.js";import"../models/ui/validator/rules/index.js";import"../models/ui/validator/form/login.js";import"../models/ui/validator/form/address.js";import"../models/ui/validator/form/ikas-address.js";import"../models/ui/validator/form/register.js";import"../models/ui/validator/form/contact-form.js";import"../models/ui/validator/form/forgot-password.js";import"../models/ui/validator/form/recover-password.js";import"../models/ui/validator/form/account-info.js";import"../models/ui/validator/form/raffle-form.js";import"../models/ui/validator/form/customer-review.js";import"../models/ui/raffle-list/index.js";import"./home.js";import"./_slug_/index.js";import"./pages/_slug_.js";import"./account/index.js";import"./account/addresses.js";import"./account/orders/index.js";import"./account/orders/_id_.js";import"./account/login.js";import"./account/register.js";import"./account/forgot-password.js";import"./account/recover-password.js";import"./cart.js";import"./editor.js";import"./account/favorite-products.js";import"./search.js";import"next/error.js";import"./blog/index.js";import"./blog/_slug_.js";import"./raffle/_slug_.js";import"./raffle/index.js";import"./account/raffles.js";import"./account/activate.js";import"../store/customer/index.js";import"../store/cart/index.js";import"lodash/get";import{initIkasEvents as h}from"../analytics/events.js";import{APIErrorCode as E}from'./../ext/@ikas/fe-api-client/build/utils/api.js';import'./../ext/axios/index.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_defineProperty.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_baseGetTag.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_stringToPath.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_baseToString.js';import C from"../store/checkout/index.js";var k=s((function(s){var k=s.customizationProps,b=s.configJson,P=o(s,["customizationProps","configJson"]),F=d(),w=i.useState(),_=w[0],T=w[1],S=i.useState(P.checkoutSettings),B=S[0],O=S[1],I=i.useState(!1),D=I[0],L=I[1];j.init(b),v.setCDNUrl(process.env.NEXT_PUBLIC_SETTINGS_CDN_URL),u(),i.useEffect((function(){!function(o){document.documentElement.style.setProperty("--checkout-button-bg-color",(null==o?void 0:o.buttonBgColor)||"#272727"),document.documentElement.style.setProperty("--checkout-button-text-color",(null==o?void 0:o.buttonTextColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-button-disabled-bg-color",(null==o?void 0:o.buttonDisabledBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-button-disabled-text-color",(null==o?void 0:o.buttonDisabledTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-text-color",(null==o?void 0:o.primaryTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-text-color",(null==o?void 0:o.secondaryTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-bg-color",(null==o?void 0:o.primaryBgColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-secondary-bg-color",(null==o?void 0:o.secondaryBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-border-color",(null==o?void 0:o.borderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-card-bg-color",(null==o?void 0:o.cardBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-error-color",(null==o?void 0:o.errorColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-error-light-color",(null==o?void 0:o.errorLightColor)||"#FCF3F4"),document.documentElement.style.setProperty("--checkout-warning-color",(null==o?void 0:o.warningColor)||"#FFBC1F"),document.documentElement.style.setProperty("--checkout-warning-light-color",(null==o?void 0:o.warningLightColor)||"#FFFAEE"),document.documentElement.style.setProperty("--checkout-success-color",(null==o?void 0:o.successColor)||"#2DCA73"),document.documentElement.style.setProperty("--checkout-success-light-color",(null==o?void 0:o.successLightColor)||"#F6FFED"),document.documentElement.style.setProperty("--checkout-secondary-button-bg-color",(null==o?void 0:o.secondaryButtonBgColor)||"#ffffff0"),document.documentElement.style.setProperty("--checkout-secondary-button-text-color",(null==o?void 0:o.secondaryButtonTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-button-border-color",(null==o?void 0:o.secondaryButtonBorderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-campaign-title-color",(null==o?void 0:o.campaignOffersTitleColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-description-color",(null==o?void 0:o.campaignOffersDescriptionColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-container-bg-color",(null==o?void 0:o.campaignOffersContainerBgColor)||"#ffffff"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-color",(null==o?void 0:o.campaignOffersDiscountPercentageColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-bg-color",(null==o?void 0:o.campaignOffersDiscountPercentageBgColor)||"#FFF1BD"),document.documentElement.style.setProperty("--checkout-campaign-countdown-text-color",(null==o?void 0:o.campaignOffersCountdownTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-countdown-time-color",(null==o?void 0:o.campaignOffersCountdownTimeColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-campaign-countdown-bg-color",(null==o?void 0:o.campaignOffersCountdownBgColor)||"#FFF5F6"),document.documentElement.style.setProperty("--checkout-campaign-middle-phase-overlay-color",(null==o?void 0:o.campaignOffersMiddlePhaseOverlayColor)||"#292727ad"),document.documentElement.style.lineHeight="1.5"}(k)}),[k]),i.useEffect((function(){g.getInstance().checkLocalization(),U(),h()}),[]);var U=i.useCallback((function(){return e(void 0,void 0,void 0,(function(){var o,e,r,i,s,n,d,a,m,c,u,v,h,k,b,P,w,_,S,I;return t(this,(function(t){switch(t.label){case 0:if(o=new URLSearchParams(window.location.search),e=o.get("id"),r=o.get("step"),i=o.get("lines"),s=o.get("couponCode"),!i)return[3,5];t.label=1;case 1:return t.trys.push([1,3,,4]),(n=g.getInstance().cartStore).removeCart(),d=i.split(","),a=d.map((function(o){var e=o.split(":"),t=e[0],r=e[1];return{variantId:t,quantity:parseInt(r)}})),m={variantLines:a,couponCode:s||void 0},[4,n.createCart(m)];case 2:return(c=t.sent()).success&&(u=j.getCurrentRouting(),v=(null==u?void 0:u.path)?"/".concat(u.path):"",window.location.href="".concat(v,"/checkout?id=").concat(null===(S=c.response.data)||void 0===S?void 0:S.id,"&step=info")),[3,4];case 3:return h=t.sent(),console.error("Error creating cart:",h),[3,4];case 4:return[2];case 5:return e?(k=!1,r&&r===l.SUCCESS&&(k=!0),[4,p({id:e,getCompletedCart:k,targetPageType:f.CHECKOUT})]):[2,F.replace("/")];case 6:if(b=t.sent(),B)return[3,10];t.label=7;case 7:return t.trys.push([7,9,,10]),[4,Promise.race([C.listCheckoutSettings({}),new Promise((function(o,e){return setTimeout((function(){return e(new Error("timeout"))}),1e4)}))])];case 8:return(P=t.sent()).isSuccess&&(null===(I=P.data)||void 0===I?void 0:I.length)?(O(P.data[0]),[3,10]):(console.error("CHECKOUT SETTINGS FETCH FAILED!"),L(!0),[2]);case 9:return w=t.sent(),console.error("CHECKOUT SETTINGS FETCH FAILED!",w),L(!0),[2];case 10:return b.isSuccess&&b.data?(_=b.data,T(new y(_)),g.getInstance().cartStore.setCart(new x(_))):b.errorCodes.some((function(o){return o===E.LOGIN_REQUIRED}))?F.replace("/account/login?redirect="+encodeURIComponent(window.location.href)):F.replace("/"),[2]}}))}))}),[]);if(D){var N=j.getMerchantSettings();return i.createElement(m,{logo:(null==k?void 0:k.logo)||(null==N?void 0:N.logo),merchantName:null==N?void 0:N.merchantName,backHref:c(),returnPolicy:P.returnPolicy,privacyPolicy:P.privacyPolicy,termsOfService:P.termsOfService,imprint:P.imprint,shippingPolicy:P.shippingPolicy})}return _&&B?i.createElement(n,r({checkout:_,customizationProps:k},P,{checkoutSettings:B})):i.createElement(a,null)}));export{k as default};
|
|
1
|
+
import{__rest as o,__awaiter as e,__generator as t,__assign as r}from'./../ext/tslib/tslib.es6.js';import*as i from"react";import{observer as s}from"mobx-react-lite";import n from"../components/checkout/index.js";import{useRouter as d}from"next/router.js";import{FullscreenLoading as a}from"../components/checkout/components/fullscreen-loading/index.js";import{CheckoutLoadFailed as m,getCheckoutHomeHref as c}from"../components/checkout/components/checkout-load-failed/index.js";import{CheckoutStep as l}from"../components/checkout/model.js";import{setAPIClientConfig as u,getCartById as p,CampaignOfferTargetPageTypeEnum as f}from"@ikas/storefront-api";import{IkasStorefrontConfig as j}from"@ikas/storefront-config";import"../analytics/analytics.js";import"../analytics/head/index.js";import"../components/page/index.js";import"../components/page/head.js";import"next/image.js";import"@ikas/storefront-model-functions";import"../components/link/index.js";import"../components/page-editor/loader/style.module.scss.js";import"../components/google-captcha/index.js";import"../components/paypal-express-checkout/index.js";import{IkasBaseStore as g}from"../store/base.js";import"mobx";import"../models/data/blog/category/index.js";import"../models/data/blog/content/index.js";import"../models/data/blog/meta-data/index.js";import"../models/data/blog/tag/index.js";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"@ikas/storefront-models";import"../models/data/campaign-offer/index.js";import"../models/data/cart/campaign-offer/index.js";import{IkasCart as y}from"../models/data/cart/index.js";import"../models/data/category/path-item/index.js";import"../models/data/category/index.js";import{IkasCheckout as x}from"../models/data/checkout/index.js";import"../models/data/checkout-settings/index.js";import"../models/data/city/index.js";import"../models/data/country/index.js";import"../models/data/customer/address/region/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/address/ikas-localized-customer-address.js";import"../models/data/customer/attribute/index.js";import"../models/data/customer/review/summary/index.js";import"../models/data/customer/review/index.js";import"../models/data/customer/index.js";import"../models/data/customer-form-data-input/index.js";import"../models/data/district/index.js";import"../models/data/favorite-product/index.js";import"../models/data/filter-category/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/order/address/region/index.js";import"../models/data/order/address/index.js";import"../models/data/order/line-item/option/value/index.js";import"../models/data/order/line-item/variant/value/index.js";import"../models/data/order/line-item/variant/index.js";import"../models/data/order/line-item/index.js";import"../models/data/order/order-transaction-with-prices/index.js";import"../models/data/order/package/index.js";import"../models/data/order/transaction/index.js";import"../models/data/order/index.js";import"../models/data/payment-gateway/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product/filter/index.js";import"../models/data/product/campaign-offer/index.js";import"../models/data/product/option-set/option/index.js";import"../models/data/product/option-set/index.js";import"../models/data/product/stock-location/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product/variant/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/index.js";import"../models/data/raffle/index.js";import"../models/data/shipping-zone/state/city/district/region/index.js";import"../models/data/state/index.js";import"../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../models/data/storefront-popup/index.js";import"../models/data/theme-json/index.js";import"../models/data/theme-json/component/index.js";import"../models/data/theme-json/custom-data/index.js";import"../models/data/variant-type/variant-value/index.js";import{LocalizedAddressConfig as v}from"@ikas/localized-address";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/brand-list/index.js";import"../models/ui/category-list/index.js";import"../models/ui/product-list/index.js";import"../models/ui/product-attribute-detail/index.js";import"../models/ui/product-attribute-list/index.js";import"../models/ui/customer-review-list/index.js";import"../models/ui/customer-review-summary-list/index.js";import"../models/ui/validator/index.js";import"../models/ui/validator/rules/index.js";import"../models/ui/validator/form/login.js";import"../models/ui/validator/form/address.js";import"../models/ui/validator/form/ikas-address.js";import"../models/ui/validator/form/register.js";import"../models/ui/validator/form/contact-form.js";import"../models/ui/validator/form/forgot-password.js";import"../models/ui/validator/form/recover-password.js";import"../models/ui/validator/form/account-info.js";import"../models/ui/validator/form/raffle-form.js";import"../models/ui/validator/form/customer-review.js";import"../models/ui/raffle-list/index.js";import"./home.js";import"./_slug_/index.js";import"./pages/_slug_.js";import"./account/index.js";import"./account/addresses.js";import"./account/orders/index.js";import"./account/orders/_id_.js";import"./account/login.js";import"./account/register.js";import"./account/forgot-password.js";import"./account/recover-password.js";import"./cart.js";import"./editor.js";import"./account/favorite-products.js";import"./search.js";import"next/error.js";import"./blog/index.js";import"./blog/_slug_.js";import"./raffle/_slug_.js";import"./raffle/index.js";import"./account/raffles.js";import"./account/activate.js";import"../store/customer/index.js";import"../store/cart/index.js";import"lodash/get";import{initIkasEvents as h}from"../analytics/events.js";import{APIErrorCode as C}from'./../ext/@ikas/fe-api-client/build/utils/api.js';import'./../ext/axios/index.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_defineProperty.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_baseGetTag.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_stringToPath.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_baseToString.js';import E from"../store/checkout/index.js";var k=s((function(s){var k=s.customizationProps,b=s.configJson,P=o(s,["customizationProps","configJson"]),F=d(),w=i.useState(),_=w[0],T=w[1],S=i.useState(P.checkoutSettings),B=S[0],I=S[1],O=i.useState(!1),D=O[0],L=O[1];j.init(b),v.setCDNUrl(process.env.NEXT_PUBLIC_SETTINGS_CDN_URL),u(),i.useEffect((function(){!function(o){document.documentElement.style.setProperty("--checkout-button-bg-color",(null==o?void 0:o.buttonBgColor)||"#272727"),document.documentElement.style.setProperty("--checkout-button-text-color",(null==o?void 0:o.buttonTextColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-button-disabled-bg-color",(null==o?void 0:o.buttonDisabledBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-button-disabled-text-color",(null==o?void 0:o.buttonDisabledTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-text-color",(null==o?void 0:o.primaryTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-text-color",(null==o?void 0:o.secondaryTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-bg-color",(null==o?void 0:o.primaryBgColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-secondary-bg-color",(null==o?void 0:o.secondaryBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-border-color",(null==o?void 0:o.borderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-card-bg-color",(null==o?void 0:o.cardBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-error-color",(null==o?void 0:o.errorColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-error-light-color",(null==o?void 0:o.errorLightColor)||"#FCF3F4"),document.documentElement.style.setProperty("--checkout-warning-color",(null==o?void 0:o.warningColor)||"#FFBC1F"),document.documentElement.style.setProperty("--checkout-warning-light-color",(null==o?void 0:o.warningLightColor)||"#FFFAEE"),document.documentElement.style.setProperty("--checkout-success-color",(null==o?void 0:o.successColor)||"#2DCA73"),document.documentElement.style.setProperty("--checkout-success-light-color",(null==o?void 0:o.successLightColor)||"#F6FFED"),document.documentElement.style.setProperty("--checkout-secondary-button-bg-color",(null==o?void 0:o.secondaryButtonBgColor)||"#ffffff00"),document.documentElement.style.setProperty("--checkout-secondary-button-text-color",(null==o?void 0:o.secondaryButtonTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-button-border-color",(null==o?void 0:o.secondaryButtonBorderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-loyalty-icon-color",(null==o?void 0:o.loyaltyIconColor)||"#F5B53F"),document.documentElement.style.setProperty("--checkout-campaign-title-color",(null==o?void 0:o.campaignOffersTitleColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-description-color",(null==o?void 0:o.campaignOffersDescriptionColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-container-bg-color",(null==o?void 0:o.campaignOffersContainerBgColor)||"#ffffff"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-color",(null==o?void 0:o.campaignOffersDiscountPercentageColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-bg-color",(null==o?void 0:o.campaignOffersDiscountPercentageBgColor)||"#FFF1BD"),document.documentElement.style.setProperty("--checkout-campaign-countdown-text-color",(null==o?void 0:o.campaignOffersCountdownTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-countdown-time-color",(null==o?void 0:o.campaignOffersCountdownTimeColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-campaign-countdown-bg-color",(null==o?void 0:o.campaignOffersCountdownBgColor)||"#FFF5F6"),document.documentElement.style.setProperty("--checkout-campaign-middle-phase-overlay-color",(null==o?void 0:o.campaignOffersMiddlePhaseOverlayColor)||"#292727ad"),document.documentElement.style.lineHeight="1.5"}(k)}),[k]),i.useEffect((function(){g.getInstance().checkLocalization(),U(),h()}),[]);var U=i.useCallback((function(){return e(void 0,void 0,void 0,(function(){var o,e,r,i,s,n,d,a,m,c,u,v,h,k,b,P,w,_,S,O,D,U;return t(this,(function(t){switch(t.label){case 0:if(o=new URLSearchParams(window.location.search),e=o.get("id"),r=o.get("step"),i=o.get("lines"),s=o.get("couponCode"),n=o.get("miniCart"),!i)return[3,5];t.label=1;case 1:return t.trys.push([1,3,,4]),(d=g.getInstance().cartStore).removeCart(),a=i.split(","),m=a.map((function(o){var e=o.split(":"),t=e[0],r=e[1];return{variantId:t,quantity:parseInt(r)}})),c={variantLines:m,couponCode:s||void 0},[4,d.createCart(c)];case 2:return(u=t.sent()).success&&(v=j.getCurrentRouting(),h=(null==v?void 0:v.path)?"/".concat(v.path):"",k=n?"&miniCart=".concat(encodeURIComponent(n)):"",window.location.href="".concat(h,"/checkout?id=").concat(null===(D=u.response.data)||void 0===D?void 0:D.id,"&step=info").concat(k)),[3,4];case 3:return b=t.sent(),console.error("Error creating cart:",b),[3,4];case 4:return[2];case 5:return e?(P=!1,r&&r===l.SUCCESS&&(P=!0),[4,p({id:e,getCompletedCart:P,targetPageType:f.CHECKOUT})]):[2,F.replace("/")];case 6:if(w=t.sent(),B)return[3,10];t.label=7;case 7:return t.trys.push([7,9,,10]),[4,Promise.race([E.listCheckoutSettings({}),new Promise((function(o,e){return setTimeout((function(){return e(new Error("timeout"))}),1e4)}))])];case 8:return(_=t.sent()).isSuccess&&(null===(U=_.data)||void 0===U?void 0:U.length)?(I(_.data[0]),[3,10]):(console.error("CHECKOUT SETTINGS FETCH FAILED!"),L(!0),[2]);case 9:return S=t.sent(),console.error("CHECKOUT SETTINGS FETCH FAILED!",S),L(!0),[2];case 10:return w.isSuccess&&w.data?(O=w.data,T(new x(O)),g.getInstance().cartStore.setCart(new y(O))):w.errorCodes.some((function(o){return o===C.LOGIN_REQUIRED}))?F.replace("/account/login?redirect="+encodeURIComponent(window.location.href)):F.replace("/"),[2]}}))}))}),[]);if(D){var N=j.getMerchantSettings();return i.createElement(m,{logo:(null==k?void 0:k.logo)||(null==N?void 0:N.logo),merchantName:null==N?void 0:N.merchantName,backHref:c(),returnPolicy:P.returnPolicy,privacyPolicy:P.privacyPolicy,termsOfService:P.termsOfService,imprint:P.imprint,shippingPolicy:P.shippingPolicy})}return _&&B?i.createElement(n,r({checkout:_,customizationProps:k},P,{checkoutSettings:B})):i.createElement(a,null)}));export{k as default};
|