@ikas/storefront 6.1.0-beta.371 → 6.1.0-beta.373

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +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";import{RewardSourceEnum as w}from"@ikas/storefront-api";var G=v((function(){return import("../../../components/stripe/index.js").then((function(e){return e.default}))})),T=v((function(){return import("../../../components/adyen/index.js").then((function(e){return e.Adyen}))})),N=v((function(){return import("../../../components/klarna/index.js").then((function(e){return e.Klarna}))})),I=v((function(){return import("../../../components/hepsipay/index.js").then((function(e){return e.HepsiPay}))})),S=v((function(){return import("../../../components/iyzico/index.js").then((function(e){return e.Iyzico}))})),b=v((function(){return import("../../../components/tkpay/index.js").then((function(e){return e.TkPay}))})),M=t((function(v){var M=v.vm,A=p().t,R=function(t){return e.createElement("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",flexWrap:"wrap"}},t.children)},B=function(t){return e.createElement("div",{className:m.AdditionalPrice},t.children)},V=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?" "+A("checkout-page:paymentMethodDiscount"):" "+A("checkout-page:paymentMethodAdditionalPrice"))},L=function(e){return"STRIPE"===e.code||"STRIPE_EU"===e.code},z=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(B,null,V(M.klarnaPaymentGateway.additionalPrices[0])):e.createElement(R,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(N,{vm:M}),M.klarnaError&&e.createElement("div",{className:m.ErrorMessage},M.klarnaError.data)))):null},D=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(B,null,V(M.hepsiPayPaymentGateway.additionalPrices[0])):e.createElement(R,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(I,{vm:M})))):null},U=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(T,{vm:M,isSelected:t})))):null},_=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(B,null,V(M.payPalPaymentGateway.additionalPrices[0])):e.createElement(R,null,!!M.payPalPaymentGateway.logoUrl&&e.createElement("div",{className:m.PaymentLogoContainer},e.createElement("img",{src:M.payPalPaymentGateway.logoUrl}))))))):null},O=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=A("checkout-page:privacyPolicy"),n.policyModalText=n.privacyPolicy}),[n,n.privacyPolicy]),i=e.useCallback((function(e){e.stopPropagation(),n.policyModalTitle=A("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?A("checkout-page:ackPrivacyPolicy"):A("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:A("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(B,null,V(n.iyzicoPaymentGateway.additionalPrices[0])):e.createElement(R,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),A("checkout-page:iyzicoDescription")),n.iyzicoResponse&&e.createElement(S,{vm:n})))):null})),H=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=A("checkout-page:privacyPolicy"),n.policyModalText=n.privacyPolicy}),[n,n.privacyPolicy]),i=e.useCallback((function(e){e.stopPropagation(),n.policyModalTitle=A("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?A("checkout-page:ackPrivacyPolicy"):A("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(B,null,V(n.tkPayPaymentGateway.additionalPrices[0])):e.createElement(R,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),A("checkout-page:tkPayDescription")),n.tkPayResponse&&e.createElement(b,{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})}},A("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(c,{vm:M}):void 0;return e.createElement(l,{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&&!(null===(o=t.enabledRewardSources)||void 0===o?void 0:o.includes(w.MILES_SMILES)))return null;if(function(e){return"KLARNA"===e.code}(t)&&M.klarnaPaymentGateway)return z();if(function(e){return"ADYEN_PLATFORM"===e.code}(t)&&M.adyenPaymentGateway)return U();if(function(e){return"PAYPAL"===e.code}(t)&&M.payPalPaymentGateway)return _();if(function(e){return"HEPSIPAY"===e.code}(t)&&M.hepsiPayPaymentGateway)return D();if(function(e){return"IYZICO"===e.code}(t)&&M.iyzicoPaymentGateway)return e.createElement(O,{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(H,{vm:M,key:t.id});var d=t.paymentMethodType===a.CREDIT_CARD&&t.type===i.INTERNAL?e.createElement(e.Fragment,null,L(t)?e.createElement(e.Fragment,null,e.createElement(G,{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(c,{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(l,{key:t.id,label:t.paymentMethodType===a.CREDIT_CARD&&t.type===i.INTERNAL?L(t)?t.name:A("checkout-page:creditCard"):t.name,isSelected:M.selectedPaymentGatewayIndex===n,rightContent:(null===(s=t.additionalPrices)||void 0===s?void 0:s.length)?e.createElement(B,null,V(t.additionalPrices[0])):e.createElement(R,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};
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};
@@ -3,5 +3,12 @@ import CheckoutViewModel from "../../../../model";
3
3
  declare type Props = {
4
4
  vm: CheckoutViewModel;
5
5
  };
6
+ /**
7
+ * Miles&Smiles block on the payment step.
8
+ *
9
+ * Miles are a second SALE on the synthetic MILES_SMILES gateway, charged
10
+ * before the TK_PAY card. The TRY figure shown here is an estimate; the
11
+ * server converts with the merchant's rate when charging.
12
+ */
6
13
  export declare const MilesSmiles: React.FC<Props>;
7
14
  export {};
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as l}from'./../../../../../../ext/tslib/tslib.es6.js';import*as i from"react";import{observer as t}from"mobx-react-lite";import{MILES_SMILES_RATE_PER_POINT as s}from"../../../../model.js";import"@ikas/storefront-config";import{formatCurrency as a}from"../../../../../../utils/currency.js";import{useTranslation as m}from"../../../../../../utils/i18n.js";import r from"./style.module.scss.js";import n from"./thy-logo.js";import{RewardSourceEnum as c}from"@ikas/storefront-api";var o=function(e){return e?e.toLocaleString("en-US"):""},u=t((function(t){var u,p=t.vm,v=m().t,S=(null===(u=p.milesSmilesDetails)||void 0===u?void 0:u.availableMiles)||0,M=p.checkout.currencyCode,f=s[M],E=f?(p.milesToRedeem||0)*f:0,g=p.milesToRedeem>S,h=function(){var e=p.finalPrice||0;return f&&e>0?Math.ceil(e/f):1/0};return i.createElement("div",{className:r.MilesSmiles},i.createElement("div",{className:r.MilesSmilesHeader},i.createElement("div",{className:r.MilesSmilesHeaderLeft},i.createElement(n,{className:r.MilesSmilesLogo}),i.createElement("div",{className:r.MilesSmilesTitleWrapper},i.createElement("div",{className:r.MilesSmilesTitle},i.createElement("span",{className:r.MilesSmilesTitleBold},"Miles & Smiles")," ",i.createElement("span",null,v("checkout-page:milesSmilesUseMyMiles"))),i.createElement("div",{className:r.MilesSmilesSubtitle},v("checkout-page:milesSmilesAvailableTotal",{miles:o(S)})))),i.createElement(d,{value:p.useMilesSmiles,onChange:function(i){return e(void 0,void 0,void 0,(function(){var e,t,s,a;return l(this,(function(l){switch(l.label){case 0:return p.useMilesSmiles=i,i?(e=p.paymentGateways.filter((function(e){var l;return null===(l=e.enabledRewardSources)||void 0===l?void 0:l.includes(c.MILES_SMILES)})),e.length?(t=e[0].id,s=p.paymentGateways.findIndex((function(e){return e.id===t})),p.selectedPaymentGatewayIndex===s?[3,2]:[4,p.setPaymentGateway(s)]):[3,2]):[3,2];case 1:l.sent(),p.mpVM.selectedCard=void 0,l.label=2;case 2:return i&&!p.milesToRedeem&&(a=h(),p.milesToRedeem=Math.min(S,a)),i||(p.milesToRedeem=0),[2]}}))}))}})),p.useMilesSmiles&&i.createElement(i.Fragment,null,i.createElement("div",{className:r.MilesSmilesInputRow},i.createElement("div",{className:[r.MilesSmilesInputWrapper,g?r.MilesSmilesInputError:""].join(" ")},i.createElement("input",{className:r.MilesSmilesInput,type:"text",inputMode:"numeric",value:o(p.milesToRedeem),onChange:function(e){var l=e.target.value.replace(/[^\d]/g,"");p.milesToRedeem=l?parseInt(l,10):0},onBlur:function(){var e=h(),l=Math.min(S,e);p.milesToRedeem>l&&(p.milesToRedeem=l)}}),i.createElement("span",{className:r.MilesSmilesInputUnit},v("checkout-page:milesSmilesUnit"))),i.createElement("span",{className:r.MilesSmilesApprox},"≈"),i.createElement("div",{className:r.MilesSmilesPriceBox},a(E,p.checkout.currencyCode,p.checkout.currencySymbol))),g&&i.createElement("div",{className:r.MilesSmilesErrorText},v("checkout-page:milesSmilesExceedError"))))})),d=function(e){var l=e.value,t=e.onChange;return i.createElement("div",{onClick:function(){t(!l)},className:[r.ToggleSwitch,l?r.ToggleSwitchActive:""].join(" ")},i.createElement("div",{className:[r.ToggleSwitchThumb,l?r.ToggleSwitchThumbActive:""].join(" ")}))};export{u as MilesSmiles};
1
+ import*as e from"react";import{observer as l}from"mobx-react-lite";import"@ikas/storefront-config";import{formatCurrency as s}from"../../../../../../utils/currency.js";import{useTranslation as i}from"../../../../../../utils/i18n.js";import m from"./style.module.scss.js";import t from"./thy-logo.js";var a=function(e){return e?e.toLocaleString("en-US"):""},r=l((function(l){var r,n=l.vm,o=i().t,u=n.milesSmilesAvailableMiles,S=n.milesSmilesMaxRedeemable,p=n.milesSmilesRedeemValue,d=n.milesToRedeem>u;return e.createElement("div",{className:m.MilesSmiles},e.createElement("div",{className:m.MilesSmilesHeader},e.createElement("div",{className:m.MilesSmilesHeaderLeft},e.createElement(t,{className:m.MilesSmilesLogo}),e.createElement("div",{className:m.MilesSmilesTitleWrapper},e.createElement("div",{className:m.MilesSmilesTitle},e.createElement("span",{className:m.MilesSmilesTitleBold},"Miles & Smiles")," ",e.createElement("span",null,o("checkout-page:milesSmilesUseMyMiles"))),e.createElement("div",{className:m.MilesSmilesSubtitle},o("checkout-page:milesSmilesAvailableTotal",{miles:a(u)}),(null===(r=n.milesSmilesDetails)||void 0===r?void 0:r.memberId)?" · ".concat(n.milesSmilesDetails.memberId):""))),e.createElement(c,{value:n.useMilesSmiles,onChange:function(e){n.setUseMilesSmiles(e)}})),n.useMilesSmiles&&e.createElement(e.Fragment,null,e.createElement("div",{className:m.MilesSmilesInputRow},e.createElement("div",{className:[m.MilesSmilesInputWrapper,d?m.MilesSmilesInputError:""].join(" ")},e.createElement("input",{className:m.MilesSmilesInput,type:"text",inputMode:"numeric",value:a(n.milesToRedeem),onChange:function(e){var l=e.target.value.replace(/[^\d]/g,"");n.setMilesToRedeem(l?parseInt(l,10):0)},onBlur:function(){n.clampMilesToRedeem()},max:S}),e.createElement("span",{className:m.MilesSmilesInputUnit},o("checkout-page:milesSmilesUnit"))),e.createElement("span",{className:m.MilesSmilesApprox},"≈"),e.createElement("div",{className:m.MilesSmilesPriceBox},s(p,n.checkout.currencyCode,n.checkout.currencySymbol))),d?e.createElement("div",{className:m.MilesSmilesErrorText},o("checkout-page:milesSmilesExceedError")):e.createElement("div",{className:m.MilesSmilesNote},o("checkout-page:milesSmilesApproxNote"))),n.milesSmilesError&&e.createElement("div",{className:m.MilesSmilesErrorText},n.getMilesSmilesErrorMessage(n.milesSmilesError)))})),c=function(l){var s=l.value,i=l.onChange;return e.createElement("div",{role:"switch","aria-checked":s,onClick:function(){i(!s)},className:[m.ToggleSwitch,s?m.ToggleSwitchActive:""].join(" ")},e.createElement("div",{className:[m.ToggleSwitchThumb,s?m.ToggleSwitchThumbActive:""].join(" ")}))};export{r as MilesSmiles};
@@ -3,5 +3,11 @@ import CheckoutViewModel from "../../../../model";
3
3
  declare type Props = {
4
4
  vm: CheckoutViewModel;
5
5
  };
6
+ /**
7
+ * "Continue with Miles&Smiles" CTA. Shown when the customer is a guest, has
8
+ * no Miles&Smiles link yet, or the short-lived checkout session expired
9
+ * (MILES_SMILES_LOGIN_REQUIRED). Also used as the retry surface for
10
+ * bind / member-details failures.
11
+ */
6
12
  export declare const MilesSmilesLoginRequired: React.FC<Props>;
7
13
  export default MilesSmilesLoginRequired;
@@ -1 +1 @@
1
- import*as e from"react";import"@ikas/storefront-config";import{useTranslation as s}from"../../../../../../utils/i18n.js";import l from"./style.module.scss.js";import i from"./thy-logo.js";var t=function(t){var m=t.vm,o=s().t;return e.createElement("div",{className:l.MilesSmilesLogin},e.createElement("div",{className:l.MilesSmilesLoginLeft},e.createElement(i,{className:l.MilesSmilesLogo}),e.createElement("div",{className:l.MilesSmilesLoginText},e.createElement("span",{className:l.MilesSmilesTitleBold},"Miles & Smiles")," ",e.createElement("span",null,o("checkout-page:milesSmilesLoginPrompt")))),e.createElement("a",{className:l.MilesSmilesLoginButton,href:m.getMilesSmilesLoginRedirectUrl()},o("checkout-page:milesSmilesLoginButton")))};export{t as MilesSmilesLoginRequired,t as default};
1
+ import*as e from"react";import{observer as s}from"mobx-react-lite";import"@ikas/storefront-config";import{useTranslation as i}from"../../../../../../utils/i18n.js";import t from"./style.module.scss.js";import l from"./thy-logo.js";var m=s((function(s){var m=s.vm,o=i().t,r=!m.store.customerStore.customer;return e.createElement("div",{className:t.MilesSmilesLogin},e.createElement("div",{className:t.MilesSmilesLoginLeft},e.createElement(l,{className:t.MilesSmilesLogo}),e.createElement("div",{className:t.MilesSmilesLoginText},e.createElement("span",{className:t.MilesSmilesTitleBold},"Miles & Smiles")," ",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};
@@ -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-",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",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_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_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",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 +1 @@
1
- import{__spreadArray as e}from'./../../../../ext/tslib/tslib.es6.js';import*as t from"react";import{observer as a}from"mobx-react-lite";import{Button as o}from"../../components/button/index.js";import{CART_LS_KEY as s}from"../../../../store/cart/index.js";import n from"./style.module.scss.js";import r from"../../components/svg/success-circle.js";import i from"../../components/expandable-section/index.js";import c from"../../components/credit-card-form/svg/amex.js";import l from"../../components/credit-card-form/svg/master-card.js";import d from"../../components/credit-card-form/svg/troy.js";import m from"../../components/credit-card-form/svg/visa.js";import"@ikas/storefront-config";import{formatCurrency as u}from"../../../../utils/currency.js";import{useTranslation as p}from"../../../../utils/i18n.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{IkasPaymentMethodType as v,IkasPaymentGatewayType as f,IkasOrderPackageStatus as g,IkasTransactionCardAssociation as E}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"../../../../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 h from"../../components/offer-product/index.js";import{Analytics as x}from"../../../../analytics/analytics.js";import"../../../../analytics/head/index.js";import{QuickRegistration as k}from"../../components/quick-registration/index.js";import{ProductFiles as y}from"../../components/product-files/index.js";import j from"../../components/offer-product/offer-arrows/index.js";import N from"../../components/offer-product/offer-dots/index.js";import I from"../../components/svg/shopping-bag.js";import{CartSummary as T}from"../../components/cart-summary/index.js";import A from"../../components/offer-product/useCampaignOffer.js";var C="eventSentCartIds",D=a((function(a){var g,C,D,P,S,L,R,M,b,O,_,F,w=a.vm,Y=p().t,U=A(w,!0),V=U.setActiveIndex,z=U.setIsActiveOverlay,B=U.handlePrev,G=U.handleNext,H=U.isActiveOverlay,K=U.activeIndex,Q=U.isMobile;t.useEffect((function(){if("undefined"!=typeof localStorage){var t=localStorage.getItem(s),a=localStorage.getItem("eventSentCartIds");if(t&&t===w.checkout.id){if(w.successTransaction){var o=JSON.parse(a||"[]");if(!o.some((function(e){return e===w.checkout.id}))){var n=w.checkout.orderedAt,r=Date.now();Math.floor(Math.abs(r-n)/1e3)<30&&x.purchase(w.checkout,w.successTransaction),localStorage.setItem("eventSentCartIds",JSON.stringify(e(e([],o,!0),[w.checkout.id],!1)))}}localStorage.removeItem(s)}window&&window.handleKlarna&&window.handleKlarna(void 0)}}),[]);var J=((null===(g=w.checkout.customer)||void 0===g?void 0:g.firstName)||"")+" "+((null===(C=w.checkout.customer)||void 0===C?void 0:C.lastName)||""),q=((null===(D=w.checkout.shippingAddress)||void 0===D?void 0:D.firstName)||"")+" "+((null===(P=w.checkout.shippingAddress)||void 0===P?void 0:P.lastName)||""),X=w.paymentGateways.find((function(e){var t;return e.id===(null===(t=w.successTransaction)||void 0===t?void 0:t.paymentGatewayId)})),W=function(e){var a,o;switch(e||(null===(o=null===(a=w.successTransaction)||void 0===a?void 0:a.paymentMethodDetail)||void 0===o?void 0:o.cardAssociation)){case E.AMERICAN_EXPRESS:return t.createElement(c,null);case E.MASTER_CARD:return t.createElement(l,null);case E.TROY:return t.createElement(d,null);case E.VISA:return t.createElement(m,null);default:return t.createElement("div",null)}},Z=function(e){switch(e){case v.APP_PAYMENT:return Y("checkout-page:appPayment");case v.BANK_REDIRECT:return Y("checkout-page:bankRedirect");case v.BUY_ONLINE_PAY_AT_STORE:return Y("checkout-page:buyOnlinePayAtStore");case v.CASH:return Y("checkout-page:cash");case v.CASH_ON_DELIVERY:return Y("checkout-page:cashOnDelivery");case v.CREDIT_CARD:return Y("checkout-page:creditCard");case v.CREDIT_CARD_ON_DELIVERY:return Y("checkout-page:creditCardOnDelivery");case v.DIRECT_DEBIT:return Y("checkout-page:directDebit");case v.GIFT_CARD:return Y("checkout-page:giftCard");case v.MONEY_ORDER:return Y("checkout-page:moneyOrder");case v.OTHER:return Y("checkout-page:other");case v.PAY_LATER:return Y("checkout-page:payLater");case v.SLICE_IT:return Y("checkout-page:sliceIt");case v.WALLET:return Y("checkout-page:wallet");default:return""}},$=null===(S=w.successTransaction)||void 0===S?void 0:S.paymentMethodDetail,ee=null===(L=w.successTransaction)||void 0===L?void 0:L.paymentGatewayCode,te=null===(R=w.successTransactions)||void 0===R?void 0:R.some((function(e){return e.paymentMethod===v.GIFT_CARD})),ae=t.useMemo((function(){var e;return null===(e=w.successTransactions)||void 0===e?void 0:e.map((function(e){var a,o,s;return t.createElement(t.Fragment,null,t.createElement("div",{className:n.InfoText},Z(e.paymentMethod)),e.paymentMethod===v.CREDIT_CARD&&t.createElement(t.Fragment,null,t.createElement("div",{className:n.InfoText},t.createElement("div",{className:n.CardLogoContainer},W(null===(a=e.paymentMethodDetail)||void 0===a?void 0:a.cardAssociation)),t.createElement("span",null,"**** ".concat((null==$?void 0:$.lastFourDigits)||""))),(null===(s=null===(o=e.paymentMethodDetail)||void 0===o?void 0:o.installment)||void 0===s?void 0:s.installmentCount)&&e.paymentMethodDetail.installment.installmentCount>1&&t.createElement(t.Fragment,null,t.createElement("div",{className:n.InfoText},"".concat(e.paymentMethodDetail.installment.installmentCount," ").concat(Y("checkout-page:installments"))),null!==e.paymentMethodDetail.installment.installmentPrice&&t.createElement("div",{className:n.InfoText},"".concat(e.paymentMethodDetail.installment.installmentCount," x ").concat(u(e.paymentMethodDetail.installment.installmentPrice,w.checkout.currencyCode,w.checkout.currencySymbol))))))}))}),[]),oe=t.useMemo((function(){var e,a,o,s,r,i,c,l,d,m;return t.createElement("div",{className:[n.InfoGrid].join(" ")},!w.isFree&&t.createElement("div",{className:n.PaymentMethodMain},t.createElement("div",{className:n.InfoTitle},Y("checkout-page:paymentMethod")),te?ae:t.createElement(t.Fragment,null,X&&t.createElement(t.Fragment,null,!!X.logoUrl&&t.createElement("div",{className:n.PaymentLogoContainer},t.createElement("img",{src:X.logoUrl})),!X.logoUrl&&t.createElement("div",{className:n.InfoText},X.paymentMethodType===v.CREDIT_CARD&&X.type===f.INTERNAL?Y("checkout-page:creditCard"):X.name),"STRIPE"!==X.code&&"STRIPE_EU"!==X.code&&"PAYPAL"!==X.code&&"KLARNA"!==X.code||!(null===(e=w.successTransaction)||void 0===e?void 0:e.paymentMethod)?!!X.description&&X.type!==f.EXTERNAL&&t.createElement("div",{className:n.InfoText},t.createElement("div",{dangerouslySetInnerHTML:{__html:X.description}})):t.createElement("div",{className:n.InfoText},Z(w.successTransaction.paymentMethod))),"E_PAY_KOLAY"===ee&&t.createElement(t.Fragment,null,t.createElement("div",{className:n.EPayKolayLogoContainer},t.createElement("img",{src:"https://cdn.myikas.com/sf/assets/payment/epaykolay.png"})),!!(null===(a=w.successTransaction)||void 0===a?void 0:a.paymentMethod)&&t.createElement("div",{className:n.InfoText},Z(null===(o=w.successTransaction)||void 0===o?void 0:o.paymentMethod))),"E_PAY_KOLAY"!==ee&&"STRIPE"!==ee&&"STRIPE_EU"!==ee&&"PAYPAL"!==ee&&"KLARNA"!==ee&&"CREDIT_CARD"===(null===(s=w.successTransaction)||void 0===s?void 0:s.paymentMethod)&&t.createElement(t.Fragment,null,t.createElement("div",{className:n.InfoText},t.createElement("div",{className:n.CardLogoContainer},W()),t.createElement("span",null,"**** ".concat((null==$?void 0:$.lastFourDigits)||""))),(null===(r=null==$?void 0:$.installment)||void 0===r?void 0:r.installmentCount)&&$.installment.installmentCount>1&&t.createElement(t.Fragment,null,t.createElement("div",{className:n.InfoText},"".concat($.installment.installmentCount," ").concat(Y("checkout-page:installments"))),null!==$.installment.installmentPrice&&t.createElement("div",{className:n.InfoText},"".concat($.installment.installmentCount," x ").concat(u($.installment.installmentPrice,w.checkout.currencyCode,w.checkout.currencySymbol))))))),!!w.isFree&&!!te&&t.createElement("div",{className:n.PaymentMethodMain},t.createElement("div",{className:n.InfoTitle},Y("checkout-page:paymentMethod")),ae),t.createElement("div",null,t.createElement("div",{className:n.InfoTitle},Y("checkout-page:billingAddress")),!!(null===(i=w.checkout.billingAddress)||void 0===i?void 0:i.firstName)&&t.createElement("div",{className:[n.InfoText,n.InfoTextPrimary].join(" ")},w.checkout.billingAddress.firstName," ",w.checkout.billingAddress.lastName),!!(null===(c=w.checkout.billingAddress)||void 0===c?void 0:c.company)&&t.createElement("div",{className:n.InfoText},w.checkout.billingAddress.company),(!!(null===(l=w.checkout.billingAddress)||void 0===l?void 0:l.taxOffice)||!!(null===(d=w.checkout.billingAddress)||void 0===d?void 0:d.taxNumber))&&t.createElement("div",{className:n.InfoText},w.checkout.billingAddress.taxOffice," ",w.checkout.billingAddress.taxNumber),t.createElement("div",{className:n.InfoText},null===(m=w.checkout.billingAddress)||void 0===m?void 0:m.addressText)))}),[]),se=t.useMemo((function(){return t.createElement(T,{vm:w,isSuccessPageSummary:!0})}),[]),ne=t.useMemo((function(){var e,a,o,s,r,i;return t.createElement("div",{className:[n.InfoGrid].join(" ")},t.createElement("div",null,t.createElement("div",{className:n.InfoTitle},Y("checkout-page:contactInfo")),t.createElement("div",{className:n.InfoText},null===(e=w.checkout.customer)||void 0===e?void 0:e.email),t.createElement("div",{className:n.InfoText},J),!!(null===(a=w.checkout.shippingAddress)||void 0===a?void 0:a.phone)&&t.createElement("div",{className:n.InfoText},null===(o=w.checkout.shippingAddress)||void 0===o?void 0:o.phone)),t.createElement("div",null,"in-store"===w.deliveryMethod&&t.createElement(t.Fragment,null,t.createElement("div",{className:n.InfoTitle},Y("checkout-page:receiver")),t.createElement("div",{className:[n.InfoText,n.withMBottom].join(" ")},q)),t.createElement("div",{className:n.InfoTitle},"address"===w.deliveryMethod?Y("checkout-page:shippingAddress"):Y("checkout-page:pickUpLocation")),!!(null===(s=w.checkout.shippingAddress)||void 0===s?void 0:s.firstName)&&t.createElement("div",{className:[n.InfoText,n.InfoTextPrimary].join(" ")},w.checkout.shippingAddress.firstName," ",w.checkout.shippingAddress.lastName),!!(null===(r=w.checkout.shippingAddress)||void 0===r?void 0:r.company)&&t.createElement("div",{className:n.InfoText},w.checkout.shippingAddress.company),t.createElement("div",{className:n.InfoText},null===(i=w.checkout.shippingAddress)||void 0===i?void 0:i.addressText)))}),[]),re=!!(null===(M=w.customizationProps)||void 0===M?void 0:M.campaignOffersEnableMiddlePhase)&&!!(null===(b=w.customizationProps)||void 0===b?void 0:b.showCampaignIsBiggerImage)&&Q&&H,ie=!!(null===(O=w.customizationProps)||void 0===O?void 0:O.campaignOffersEnableMiddlePhase)&&!!(null===(_=w.customizationProps)||void 0===_?void 0:_.showCampaignIsBiggerImage)&&Q&&!H;return t.createElement(t.Fragment,null,!!(null===(F=w.customizationProps)||void 0===F?void 0:F.campaignOffersEnableMiddlePhase)&&H&&w.campaignOffers&&w.campaignOffers.length>0&&Q&&t.createElement("div",{className:[n.MiddlePhaseOverlay,re?n.MiddlePhaseOverlayPopup:""].join(" ")}),w.campaignOffers&&!!w.campaignOffers.length&&w.isCampaignOfferLoaded&&t.createElement("div",{className:[n.CampaignOfferMain,re?n.OverlayPopupMain:""].join(" ")},t.createElement("div",{className:n.OfferSlider},w.campaignOffers.map((function(e,a){var o;return t.createElement(h,{vm:w,campaignOffer:e,index:a,activeIndex:K,offersLength:(null===(o=w.campaignOffers)||void 0===o?void 0:o.length)||0,handlePrev:B,handleNext:G,setActiveIndex:function(e){return V(e)},isPopupShow:re,closePopup:function(){return z(!1)},isPopupClosed:ie,showPopup:function(){return z(!0)},step:w.step})}))),w.campaignOffers.length>1&&t.createElement(j,{handlePrev:B,handleNext:G}),w.campaignOffers.length>1&&t.createElement(N,{isPopupShow:re,vm:w,activeIndex:K})),t.createElement("div",{className:n.StepSuccess},t.createElement("div",{className:n.SuccessTitleContainer},t.createElement(r,{className:n.SuccessCircle}),t.createElement("span",{className:n.SuccessTitle},Y("checkout-page:orderSuccessTitle"))),t.createElement("div",{className:n.SuccessSubTitle},Y(w.isDigitalOnly?"checkout-page:orderSuccessDigitalOnlyDescription":"address"===w.deliveryMethod?"checkout-page:orderSuccessDescription":"checkout-page:orderSuccessInStoreDeliveryDescription",{customerName:J})),w.productFiles.length>0&&t.createElement(y,{vm:w}),t.createElement("div",null,t.createElement("div",{className:n.OrderSummaryMain},t.createElement("div",null,t.createElement("span",{className:n.InfoTitle},Y("checkout-page:orderNo")),t.createElement("span",{className:n.InfoText},"#"+(w.checkout.orderNumber||""))),t.createElement("div",null,t.createElement("span",{className:n.InfoTitle},Y("checkout-page:orderDate")),t.createElement("span",{className:n.InfoText},w.checkout.dateStr)),t.createElement("div",{className:n.OrderAmountInfoMain},t.createElement("span",{className:n.InfoTitle},Y("checkout-page:orderAmount")),t.createElement("span",{className:n.OrderAmountInfo},t.createElement("span",null,"".concat(u(w.finalPrice||0,w.checkout.currencyCode,w.checkout.currencySymbol))),t.createElement("span",{className:n.Slash},"/"),t.createElement("span",{className:n.OrderItemCount},t.createElement(I,null),t.createElement("span",null," ",w.checkout.itemQuantity," ",Y("checkout-page:cartItemProduct"))))))),w.hasQuickRegistration&&t.createElement(k,{vm:w}),t.createElement("div",{className:n.HideOnDesktop},t.createElement(i,{title:Y("checkout-page:summary")},se)),t.createElement(i,{expanded:!0,title:Y("checkout-page:paymentSummary")},oe),!w.isDigitalOnly&&t.createElement(i,{title:Y("checkout-page:shippingSummary")},ne),t.createElement("div",{className:n.Actions},t.createElement("div",{className:n.HelpText},t.createElement("span",null,Y("checkout-page:helpCtaQuestion")),t.createElement("span",{style:{marginLeft:"4px"},className:n.Cta,onClick:function(){return w.setContactModalVisible(!0)}},Y("checkout-page:helpCta"))),t.createElement(o,{href:w.getBackToShoppingHref(),text:Y("checkout-page:actions.backToShopping"),style:{flex:"0 0 auto"}}))))}));a((function(e){var a,o=e.vm,s=p().t,r=n.Yellow;switch(o.checkout.orderPackageStatus){case g.FULFILLED:case g.PARTIALLY_FULFILLED:case g.DELIVERED:case g.PARTIALLY_DELIVERED:r=n.Green;break;case g.CANCELLED:case g.PARTIALLY_CANCELLED:case g.CANCEL_REJECTED:case g.CANCEL_REQUESTED:r=n.Red}return t.createElement("div",{className:[n.OrderStatus,r].join(" ")},o.checkout.orderPackageStatus?null===(a=[{types:[g.UNFULFILLED],text:s("checkout-page:orderPackageStatus.unfulfilled")},{types:[g.READY_FOR_SHIPMENT],text:s("checkout-page:orderPackageStatus.readyForShipment")},{types:[g.PARTIALLY_FULFILLED],text:s("checkout-page:orderPackageStatus.partiallyFulfilled")},{types:[g.FULFILLED],text:s("checkout-page:orderPackageStatus.fulfilled")},{types:[g.DELIVERED],text:s("checkout-page:orderPackageStatus.delivered")},{types:[g.PARTIALLY_DELIVERED],text:s("checkout-page:orderPackageStatus.partiallyDelivered")},{types:[g.UNABLE_TO_DELIVER],text:s("checkout-page:orderPackageStatus.unableToDeliver")},{types:[g.CANCELLED,g.PARTIALLY_CANCELLED],text:s("checkout-page:orderPackageStatus.cancelled")},{types:[g.CANCEL_REJECTED],text:s("checkout-page:orderPackageStatus.cancelRejected")},{types:[g.REFUNDED,g.PARTIALLY_REFUNDED],text:s("checkout-page:orderPackageStatus.refunded")},{types:[g.REFUND_REQUEST_ACCEPTED],text:s("checkout-page:orderPackageStatus.refundRequestAccepted")},{types:[g.REFUND_REJECTED],text:s("checkout-page:orderPackageStatus.refundRejected")},{types:[g.REFUND_REQUESTED],text:s("checkout-page:orderPackageStatus.refundRequested")}].find((function(e){return e.types.includes(o.checkout.orderPackageStatus)})))||void 0===a?void 0:a.text:"")}));export{C as SENT_CART_IDS_LS_KEY,D as StepSuccess};
1
+ import{__spreadArray as e}from'./../../../../ext/tslib/tslib.es6.js';import*as t from"react";import{observer as a}from"mobx-react-lite";import{Button as o}from"../../components/button/index.js";import{CART_LS_KEY as s}from"../../../../store/cart/index.js";import n from"./style.module.scss.js";import r from"../../components/svg/success-circle.js";import i from"../../components/expandable-section/index.js";import c from"../../components/credit-card-form/svg/amex.js";import l from"../../components/credit-card-form/svg/master-card.js";import d from"../../components/credit-card-form/svg/troy.js";import m from"../../components/credit-card-form/svg/visa.js";import"@ikas/storefront-config";import{formatCurrency as u}from"../../../../utils/currency.js";import{useTranslation as p}from"../../../../utils/i18n.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{IkasPaymentMethodType as v,IkasPaymentGatewayType as f,IkasOrderPackageStatus as g,IkasTransactionCardAssociation as E}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"../../../../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 h from"../../components/offer-product/index.js";import{MILES_SMILES_PAYMENT_GATEWAY_CODE as x}from"@ikas/storefront-api";import{Analytics as k}from"../../../../analytics/analytics.js";import"../../../../analytics/head/index.js";import{QuickRegistration as y}from"../../components/quick-registration/index.js";import{ProductFiles as j}from"../../components/product-files/index.js";import N from"../../components/offer-product/offer-arrows/index.js";import I from"../../components/offer-product/offer-dots/index.js";import T from"../../components/svg/shopping-bag.js";import{CartSummary as A}from"../../components/cart-summary/index.js";import C from"../../components/offer-product/useCampaignOffer.js";var D="eventSentCartIds",P=a((function(a){var g,D,P,S,L,R,b,M,O,_,F,w,Y,U=a.vm,G=p().t,V=C(U,!0),z=V.setActiveIndex,B=V.setIsActiveOverlay,H=V.handlePrev,K=V.handleNext,Q=V.isActiveOverlay,J=V.activeIndex,q=V.isMobile;t.useEffect((function(){if("undefined"!=typeof localStorage){var t=localStorage.getItem(s),a=localStorage.getItem("eventSentCartIds");if(t&&t===U.checkout.id){if(U.successTransaction){var o=JSON.parse(a||"[]");if(!o.some((function(e){return e===U.checkout.id}))){var n=U.checkout.orderedAt,r=Date.now();Math.floor(Math.abs(r-n)/1e3)<30&&k.purchase(U.checkout,U.successTransaction),localStorage.setItem("eventSentCartIds",JSON.stringify(e(e([],o,!0),[U.checkout.id],!1)))}}localStorage.removeItem(s)}window&&window.handleKlarna&&window.handleKlarna(void 0)}}),[]);var X=((null===(g=U.checkout.customer)||void 0===g?void 0:g.firstName)||"")+" "+((null===(D=U.checkout.customer)||void 0===D?void 0:D.lastName)||""),W=((null===(P=U.checkout.shippingAddress)||void 0===P?void 0:P.firstName)||"")+" "+((null===(S=U.checkout.shippingAddress)||void 0===S?void 0:S.lastName)||""),Z=U.paymentGateways.find((function(e){var t;return e.id===(null===(t=U.successTransaction)||void 0===t?void 0:t.paymentGatewayId)})),$=function(e){var a,o;switch(e||(null===(o=null===(a=U.successTransaction)||void 0===a?void 0:a.paymentMethodDetail)||void 0===o?void 0:o.cardAssociation)){case E.AMERICAN_EXPRESS:return t.createElement(c,null);case E.MASTER_CARD:return t.createElement(l,null);case E.TROY:return t.createElement(d,null);case E.VISA:return t.createElement(m,null);default:return t.createElement("div",null)}},ee=function(e){switch(e){case v.APP_PAYMENT:return G("checkout-page:appPayment");case v.BANK_REDIRECT:return G("checkout-page:bankRedirect");case v.BUY_ONLINE_PAY_AT_STORE:return G("checkout-page:buyOnlinePayAtStore");case v.CASH:return G("checkout-page:cash");case v.CASH_ON_DELIVERY:return G("checkout-page:cashOnDelivery");case v.CREDIT_CARD:return G("checkout-page:creditCard");case v.CREDIT_CARD_ON_DELIVERY:return G("checkout-page:creditCardOnDelivery");case v.DIRECT_DEBIT:return G("checkout-page:directDebit");case v.GIFT_CARD:return G("checkout-page:giftCard");case v.MONEY_ORDER:return G("checkout-page:moneyOrder");case v.OTHER:return G("checkout-page:other");case v.PAY_LATER:return G("checkout-page:payLater");case v.SLICE_IT:return G("checkout-page:sliceIt");case v.WALLET:return G("checkout-page:wallet");default:return""}},te=null===(L=U.successTransaction)||void 0===L?void 0:L.paymentMethodDetail,ae=null===(R=U.successTransaction)||void 0===R?void 0:R.paymentGatewayCode,oe=null===(b=U.successTransactions)||void 0===b?void 0:b.some((function(e){return e.paymentMethod===v.GIFT_CARD})),se=null===(M=U.successTransactions)||void 0===M?void 0:M.some((function(e){return e.paymentGatewayCode===x})),ne=t.useMemo((function(){var e;return null===(e=U.successTransactions)||void 0===e?void 0:e.map((function(e){var a,o,s;return t.createElement(t.Fragment,null,t.createElement("div",{className:n.InfoText},e.paymentGatewayCode===x?"".concat(G("checkout-page:milesSmilesPaymentLabel")," · ").concat(e.formattedAmount):ee(e.paymentMethod)),e.paymentMethod===v.CREDIT_CARD&&t.createElement(t.Fragment,null,t.createElement("div",{className:n.InfoText},t.createElement("div",{className:n.CardLogoContainer},$(null===(a=e.paymentMethodDetail)||void 0===a?void 0:a.cardAssociation)),t.createElement("span",null,"**** ".concat((null==te?void 0:te.lastFourDigits)||""))),(null===(s=null===(o=e.paymentMethodDetail)||void 0===o?void 0:o.installment)||void 0===s?void 0:s.installmentCount)&&e.paymentMethodDetail.installment.installmentCount>1&&t.createElement(t.Fragment,null,t.createElement("div",{className:n.InfoText},"".concat(e.paymentMethodDetail.installment.installmentCount," ").concat(G("checkout-page:installments"))),null!==e.paymentMethodDetail.installment.installmentPrice&&t.createElement("div",{className:n.InfoText},"".concat(e.paymentMethodDetail.installment.installmentCount," x ").concat(u(e.paymentMethodDetail.installment.installmentPrice,U.checkout.currencyCode,U.checkout.currencySymbol))))))}))}),[]),re=t.useMemo((function(){var e,a,o,s,r,i,c,l,d,m;return t.createElement("div",{className:[n.InfoGrid].join(" ")},(!U.isFree||se)&&t.createElement("div",{className:n.PaymentMethodMain},t.createElement("div",{className:n.InfoTitle},G("checkout-page:paymentMethod")),oe||se?ne:t.createElement(t.Fragment,null,Z&&t.createElement(t.Fragment,null,!!Z.logoUrl&&t.createElement("div",{className:n.PaymentLogoContainer},t.createElement("img",{src:Z.logoUrl})),!Z.logoUrl&&t.createElement("div",{className:n.InfoText},Z.paymentMethodType===v.CREDIT_CARD&&Z.type===f.INTERNAL?G("checkout-page:creditCard"):Z.name),"STRIPE"!==Z.code&&"STRIPE_EU"!==Z.code&&"PAYPAL"!==Z.code&&"KLARNA"!==Z.code||!(null===(e=U.successTransaction)||void 0===e?void 0:e.paymentMethod)?!!Z.description&&Z.type!==f.EXTERNAL&&t.createElement("div",{className:n.InfoText},t.createElement("div",{dangerouslySetInnerHTML:{__html:Z.description}})):t.createElement("div",{className:n.InfoText},ee(U.successTransaction.paymentMethod))),"E_PAY_KOLAY"===ae&&t.createElement(t.Fragment,null,t.createElement("div",{className:n.EPayKolayLogoContainer},t.createElement("img",{src:"https://cdn.myikas.com/sf/assets/payment/epaykolay.png"})),!!(null===(a=U.successTransaction)||void 0===a?void 0:a.paymentMethod)&&t.createElement("div",{className:n.InfoText},ee(null===(o=U.successTransaction)||void 0===o?void 0:o.paymentMethod))),"E_PAY_KOLAY"!==ae&&"STRIPE"!==ae&&"STRIPE_EU"!==ae&&"PAYPAL"!==ae&&"KLARNA"!==ae&&"CREDIT_CARD"===(null===(s=U.successTransaction)||void 0===s?void 0:s.paymentMethod)&&t.createElement(t.Fragment,null,t.createElement("div",{className:n.InfoText},t.createElement("div",{className:n.CardLogoContainer},$()),t.createElement("span",null,"**** ".concat((null==te?void 0:te.lastFourDigits)||""))),(null===(r=null==te?void 0:te.installment)||void 0===r?void 0:r.installmentCount)&&te.installment.installmentCount>1&&t.createElement(t.Fragment,null,t.createElement("div",{className:n.InfoText},"".concat(te.installment.installmentCount," ").concat(G("checkout-page:installments"))),null!==te.installment.installmentPrice&&t.createElement("div",{className:n.InfoText},"".concat(te.installment.installmentCount," x ").concat(u(te.installment.installmentPrice,U.checkout.currencyCode,U.checkout.currencySymbol))))))),!!U.isFree&&!!oe&&t.createElement("div",{className:n.PaymentMethodMain},t.createElement("div",{className:n.InfoTitle},G("checkout-page:paymentMethod")),ne),t.createElement("div",null,t.createElement("div",{className:n.InfoTitle},G("checkout-page:billingAddress")),!!(null===(i=U.checkout.billingAddress)||void 0===i?void 0:i.firstName)&&t.createElement("div",{className:[n.InfoText,n.InfoTextPrimary].join(" ")},U.checkout.billingAddress.firstName," ",U.checkout.billingAddress.lastName),!!(null===(c=U.checkout.billingAddress)||void 0===c?void 0:c.company)&&t.createElement("div",{className:n.InfoText},U.checkout.billingAddress.company),(!!(null===(l=U.checkout.billingAddress)||void 0===l?void 0:l.taxOffice)||!!(null===(d=U.checkout.billingAddress)||void 0===d?void 0:d.taxNumber))&&t.createElement("div",{className:n.InfoText},U.checkout.billingAddress.taxOffice," ",U.checkout.billingAddress.taxNumber),t.createElement("div",{className:n.InfoText},null===(m=U.checkout.billingAddress)||void 0===m?void 0:m.addressText)))}),[]),ie=t.useMemo((function(){return t.createElement(A,{vm:U,isSuccessPageSummary:!0})}),[]),ce=t.useMemo((function(){var e,a,o,s,r,i;return t.createElement("div",{className:[n.InfoGrid].join(" ")},t.createElement("div",null,t.createElement("div",{className:n.InfoTitle},G("checkout-page:contactInfo")),t.createElement("div",{className:n.InfoText},null===(e=U.checkout.customer)||void 0===e?void 0:e.email),t.createElement("div",{className:n.InfoText},X),!!(null===(a=U.checkout.shippingAddress)||void 0===a?void 0:a.phone)&&t.createElement("div",{className:n.InfoText},null===(o=U.checkout.shippingAddress)||void 0===o?void 0:o.phone)),t.createElement("div",null,"in-store"===U.deliveryMethod&&t.createElement(t.Fragment,null,t.createElement("div",{className:n.InfoTitle},G("checkout-page:receiver")),t.createElement("div",{className:[n.InfoText,n.withMBottom].join(" ")},W)),t.createElement("div",{className:n.InfoTitle},"address"===U.deliveryMethod?G("checkout-page:shippingAddress"):G("checkout-page:pickUpLocation")),!!(null===(s=U.checkout.shippingAddress)||void 0===s?void 0:s.firstName)&&t.createElement("div",{className:[n.InfoText,n.InfoTextPrimary].join(" ")},U.checkout.shippingAddress.firstName," ",U.checkout.shippingAddress.lastName),!!(null===(r=U.checkout.shippingAddress)||void 0===r?void 0:r.company)&&t.createElement("div",{className:n.InfoText},U.checkout.shippingAddress.company),t.createElement("div",{className:n.InfoText},null===(i=U.checkout.shippingAddress)||void 0===i?void 0:i.addressText)))}),[]),le=!!(null===(O=U.customizationProps)||void 0===O?void 0:O.campaignOffersEnableMiddlePhase)&&!!(null===(_=U.customizationProps)||void 0===_?void 0:_.showCampaignIsBiggerImage)&&q&&Q,de=!!(null===(F=U.customizationProps)||void 0===F?void 0:F.campaignOffersEnableMiddlePhase)&&!!(null===(w=U.customizationProps)||void 0===w?void 0:w.showCampaignIsBiggerImage)&&q&&!Q;return t.createElement(t.Fragment,null,!!(null===(Y=U.customizationProps)||void 0===Y?void 0:Y.campaignOffersEnableMiddlePhase)&&Q&&U.campaignOffers&&U.campaignOffers.length>0&&q&&t.createElement("div",{className:[n.MiddlePhaseOverlay,le?n.MiddlePhaseOverlayPopup:""].join(" ")}),U.campaignOffers&&!!U.campaignOffers.length&&U.isCampaignOfferLoaded&&t.createElement("div",{className:[n.CampaignOfferMain,le?n.OverlayPopupMain:""].join(" ")},t.createElement("div",{className:n.OfferSlider},U.campaignOffers.map((function(e,a){var o;return t.createElement(h,{vm:U,campaignOffer:e,index:a,activeIndex:J,offersLength:(null===(o=U.campaignOffers)||void 0===o?void 0:o.length)||0,handlePrev:H,handleNext:K,setActiveIndex:function(e){return z(e)},isPopupShow:le,closePopup:function(){return B(!1)},isPopupClosed:de,showPopup:function(){return B(!0)},step:U.step})}))),U.campaignOffers.length>1&&t.createElement(N,{handlePrev:H,handleNext:K}),U.campaignOffers.length>1&&t.createElement(I,{isPopupShow:le,vm:U,activeIndex:J})),t.createElement("div",{className:n.StepSuccess},t.createElement("div",{className:n.SuccessTitleContainer},t.createElement(r,{className:n.SuccessCircle}),t.createElement("span",{className:n.SuccessTitle},G("checkout-page:orderSuccessTitle"))),t.createElement("div",{className:n.SuccessSubTitle},G(U.isDigitalOnly?"checkout-page:orderSuccessDigitalOnlyDescription":"address"===U.deliveryMethod?"checkout-page:orderSuccessDescription":"checkout-page:orderSuccessInStoreDeliveryDescription",{customerName:X})),U.productFiles.length>0&&t.createElement(j,{vm:U}),t.createElement("div",null,t.createElement("div",{className:n.OrderSummaryMain},t.createElement("div",null,t.createElement("span",{className:n.InfoTitle},G("checkout-page:orderNo")),t.createElement("span",{className:n.InfoText},"#"+(U.checkout.orderNumber||""))),t.createElement("div",null,t.createElement("span",{className:n.InfoTitle},G("checkout-page:orderDate")),t.createElement("span",{className:n.InfoText},U.checkout.dateStr)),t.createElement("div",{className:n.OrderAmountInfoMain},t.createElement("span",{className:n.InfoTitle},G("checkout-page:orderAmount")),t.createElement("span",{className:n.OrderAmountInfo},t.createElement("span",null,"".concat(u(U.finalPrice||0,U.checkout.currencyCode,U.checkout.currencySymbol))),t.createElement("span",{className:n.Slash},"/"),t.createElement("span",{className:n.OrderItemCount},t.createElement(T,null),t.createElement("span",null," ",U.checkout.itemQuantity," ",G("checkout-page:cartItemProduct"))))))),U.hasQuickRegistration&&t.createElement(y,{vm:U}),t.createElement("div",{className:n.HideOnDesktop},t.createElement(i,{title:G("checkout-page:summary")},ie)),t.createElement(i,{expanded:!0,title:G("checkout-page:paymentSummary")},re),!U.isDigitalOnly&&t.createElement(i,{title:G("checkout-page:shippingSummary")},ce),t.createElement("div",{className:n.Actions},t.createElement("div",{className:n.HelpText},t.createElement("span",null,G("checkout-page:helpCtaQuestion")),t.createElement("span",{style:{marginLeft:"4px"},className:n.Cta,onClick:function(){return U.setContactModalVisible(!0)}},G("checkout-page:helpCta"))),t.createElement(o,{href:U.getBackToShoppingHref(),text:G("checkout-page:actions.backToShopping"),style:{flex:"0 0 auto"}}))))}));a((function(e){var a,o=e.vm,s=p().t,r=n.Yellow;switch(o.checkout.orderPackageStatus){case g.FULFILLED:case g.PARTIALLY_FULFILLED:case g.DELIVERED:case g.PARTIALLY_DELIVERED:r=n.Green;break;case g.CANCELLED:case g.PARTIALLY_CANCELLED:case g.CANCEL_REJECTED:case g.CANCEL_REQUESTED:r=n.Red}return t.createElement("div",{className:[n.OrderStatus,r].join(" ")},o.checkout.orderPackageStatus?null===(a=[{types:[g.UNFULFILLED],text:s("checkout-page:orderPackageStatus.unfulfilled")},{types:[g.READY_FOR_SHIPMENT],text:s("checkout-page:orderPackageStatus.readyForShipment")},{types:[g.PARTIALLY_FULFILLED],text:s("checkout-page:orderPackageStatus.partiallyFulfilled")},{types:[g.FULFILLED],text:s("checkout-page:orderPackageStatus.fulfilled")},{types:[g.DELIVERED],text:s("checkout-page:orderPackageStatus.delivered")},{types:[g.PARTIALLY_DELIVERED],text:s("checkout-page:orderPackageStatus.partiallyDelivered")},{types:[g.UNABLE_TO_DELIVER],text:s("checkout-page:orderPackageStatus.unableToDeliver")},{types:[g.CANCELLED,g.PARTIALLY_CANCELLED],text:s("checkout-page:orderPackageStatus.cancelled")},{types:[g.CANCEL_REJECTED],text:s("checkout-page:orderPackageStatus.cancelRejected")},{types:[g.REFUNDED,g.PARTIALLY_REFUNDED],text:s("checkout-page:orderPackageStatus.refunded")},{types:[g.REFUND_REQUEST_ACCEPTED],text:s("checkout-page:orderPackageStatus.refundRequestAccepted")},{types:[g.REFUND_REJECTED],text:s("checkout-page:orderPackageStatus.refundRejected")},{types:[g.REFUND_REQUESTED],text:s("checkout-page:orderPackageStatus.refundRequested")}].find((function(e){return e.types.includes(o.checkout.orderPackageStatus)})))||void 0===a?void 0:a.text:"")}));export{D as SENT_CART_IDS_LS_KEY,P as StepSuccess};
@@ -3,7 +3,6 @@ import { IkasBaseModel } from "../base";
3
3
  import { IkasPaymentGatewayTranslation } from "./translation";
4
4
  import { IkasPaymentGatewaySettings } from "./settings";
5
5
  import { IkasPaymentGatewayType, IkasPaymentMethod, IkasPaymentMethodType, IkasPaymentGateway as IPaymentGateway } from "@ikas/storefront-models";
6
- import { RewardSourceEnum } from "@ikas/storefront-api";
7
6
  export declare class IkasPaymentGateway extends IkasBaseModel implements IPaymentGateway {
8
7
  additionalPrices: IkasPaymentGatewayAdditionalPrice[] | null;
9
8
  availableCountries: string[] | null;
@@ -20,7 +19,7 @@ export declare class IkasPaymentGateway extends IkasBaseModel implements IPaymen
20
19
  paymentMethodType: IkasPaymentMethodType;
21
20
  settings?: IkasPaymentGatewaySettings[] | null;
22
21
  translations?: IkasPaymentGatewayTranslation[] | null;
23
- enabledRewardSources: RewardSourceEnum[] | null;
22
+ milesSmilesEnabled: boolean | null;
24
23
  constructor(data: IPaymentGateway);
25
24
  }
26
25
  export { IkasPaymentGatewayType, IkasPaymentMethodType };
@@ -1 +1 @@
1
- import{__extends as e}from'./../../../ext/tslib/tslib.es6.js';import{IkasPaymentGatewayAdditionalPrice as t}from"./additional-price/index.js";import{IkasBaseModel as n}from"../base/index.js";import{IkasPaymentGatewaySettings as o}from"./settings/index.js";import{IkasPaymentGatewayType as r,IkasPaymentMethodType as s}from"@ikas/storefront-models";export{IkasPaymentGatewayType,IkasPaymentMethodType}from"@ikas/storefront-models";import{makeObservable as a,observable as i}from"mobx";var l=function(n){function l(e){var l,d,p=this;return(p=n.call(this,e)||this).additionalPrices=(null===(l=e.additionalPrices)||void 0===l?void 0:l.map((function(e){return new t(e)})))||null,p.availableCountries=e.availableCountries||[],p.code=e.code||"",p.description=e.description||null,p.logoUrl=e.logoUrl||null,p.masterPassClientId=e.masterPassClientId||null,p.name=e.name||"",p.paymentGatewayProviderId=e.paymentGatewayProviderId||null,p.supportedCurrencies=e.supportedCurrencies||[],p.testMode=e.testMode||null,p.type=e.type||r.INTERNAL,p.paymentMethods=e.paymentMethods||[],p.paymentMethodType=e.paymentMethodType||s.OTHER,p.settings=(null===(d=e.settings)||void 0===d?void 0:d.map((function(e){return new o(e)})))||null,p.translations=e.translations||null,p.enabledRewardSources=e.enabledRewardSources||null,a(p,{additionalPrices:i,availableCountries:i,code:i,description:i,logoUrl:i,masterPassClientId:i,name:i,paymentGatewayProviderId:i,supportedCurrencies:i,testMode:i,type:i,paymentMethods:i,paymentMethodType:i,settings:i,translations:i}),p}return e(l,n),l}(n);export{l as IkasPaymentGateway};
1
+ import{__extends as e}from'./../../../ext/tslib/tslib.es6.js';import{IkasPaymentGatewayAdditionalPrice as t}from"./additional-price/index.js";import{IkasBaseModel as n}from"../base/index.js";import{IkasPaymentGatewaySettings as i}from"./settings/index.js";import{IkasPaymentGatewayType as o,IkasPaymentMethodType as s}from"@ikas/storefront-models";export{IkasPaymentGatewayType,IkasPaymentMethodType}from"@ikas/storefront-models";import{makeObservable as a,observable as r}from"mobx";var l=function(n){function l(e){var l,d,m,p=this;return(p=n.call(this,e)||this).additionalPrices=(null===(l=e.additionalPrices)||void 0===l?void 0:l.map((function(e){return new t(e)})))||null,p.availableCountries=e.availableCountries||[],p.code=e.code||"",p.description=e.description||null,p.logoUrl=e.logoUrl||null,p.masterPassClientId=e.masterPassClientId||null,p.name=e.name||"",p.paymentGatewayProviderId=e.paymentGatewayProviderId||null,p.supportedCurrencies=e.supportedCurrencies||[],p.testMode=e.testMode||null,p.type=e.type||o.INTERNAL,p.paymentMethods=e.paymentMethods||[],p.paymentMethodType=e.paymentMethodType||s.OTHER,p.settings=(null===(d=e.settings)||void 0===d?void 0:d.map((function(e){return new i(e)})))||null,p.translations=e.translations||null,p.milesSmilesEnabled=null!==(m=e.milesSmilesEnabled)&&void 0!==m?m:null,a(p,{additionalPrices:r,availableCountries:r,code:r,description:r,logoUrl:r,masterPassClientId:r,name:r,paymentGatewayProviderId:r,supportedCurrencies:r,testMode:r,type:r,paymentMethods:r,paymentMethodType:r,settings:r,translations:r,milesSmilesEnabled:r}),p}return e(l,n),l}(n);export{l as IkasPaymentGateway};
@@ -1,5 +1,5 @@
1
1
  import { APIResponse } from "@ikas/fe-api-client";
2
- import { CheckCustomerEmailQueryParams, SubscribeToMarketingNotificationsQueryParams, CreateCustomerReviewQueryParams, CreateOrderRefundRequestQueryParams, CustomerForgotPasswordQueryParams, CustomerLoginQueryParams, CustomerRecoverPasswordQueryParams, CustomerRefreshTokenQueryParams, CustomerSocialLoginQueryParams, GetCustomerOrdersQueryParams, GetLastViewedProductsQueryParams, GetOrderByEmailQueryParams, IsFavoriteProductQueryParams, ListCustomerReviewsQueryParams, ListCustomerReviewSummaryQueryParams, ListOrderRefundSettingsQueryParams, ListOrderTransactionsQueryParams, ListOrderTransactionsWithPricesQueryParams, RegisterCustomerQueryParams, SaveFavoriteProductQueryParams, SaveLastViewedProductsQueryParams, SaveMyCustomerQueryParams, SendContactFormToMerchantQueryParams, ActivateCustomerQueryParams, ResendCustomerActivationMailQueryParams, ValidateCustomerPhoneVerificationCodeQueryParams, SaveCustomerFormDataQueryParams, CustomerDeactiveQueryParams, ValidateOTPCodeQueryParams, GetLoyaltyCustomerInfoQueryParams, ListLoyaltyProgramPointHistoryQueryParams, ListSpendingMethodsByCartIdQueryParams, UseLoyaltyPointsQueryParams } from "@ikas/storefront-api";
2
+ import { GetExternalAccountLinkQueryParams, UnlinkExternalAccountQueryParams, CheckCustomerEmailQueryParams, SubscribeToMarketingNotificationsQueryParams, CreateCustomerReviewQueryParams, CreateOrderRefundRequestQueryParams, CustomerForgotPasswordQueryParams, CustomerLoginQueryParams, CustomerRecoverPasswordQueryParams, CustomerRefreshTokenQueryParams, CustomerSocialLoginQueryParams, GetCustomerOrdersQueryParams, GetLastViewedProductsQueryParams, GetOrderByEmailQueryParams, IsFavoriteProductQueryParams, ListCustomerReviewsQueryParams, ListCustomerReviewSummaryQueryParams, ListOrderRefundSettingsQueryParams, ListOrderTransactionsQueryParams, ListOrderTransactionsWithPricesQueryParams, RegisterCustomerQueryParams, SaveFavoriteProductQueryParams, SaveLastViewedProductsQueryParams, SaveMyCustomerQueryParams, SendContactFormToMerchantQueryParams, ActivateCustomerQueryParams, ResendCustomerActivationMailQueryParams, ValidateCustomerPhoneVerificationCodeQueryParams, SaveCustomerFormDataQueryParams, CustomerDeactiveQueryParams, ValidateOTPCodeQueryParams, GetLoyaltyCustomerInfoQueryParams, ListLoyaltyProgramPointHistoryQueryParams, ListSpendingMethodsByCartIdQueryParams, UseLoyaltyPointsQueryParams } from "@ikas/storefront-api";
3
3
  import { IkasCustomer, IkasCustomerAttribute, IkasCustomerReview, IkasCustomerReviewSummary, IkasFavoriteProduct, IkasLastViewedProduct, IkasOrder, IkasOrderRefundSettings, IkasOrderTransaction, IkasOrderTransactionWithPrices } from "../../models/data";
4
4
  export default class CustomerStoreAPI {
5
5
  static login(params: CustomerLoginQueryParams): Promise<APIResponse<{
@@ -9,6 +9,8 @@ export default class CustomerStoreAPI {
9
9
  token: string;
10
10
  tokenExpiry: number;
11
11
  } | null>>;
12
+ static getExternalAccountLink(params?: GetExternalAccountLinkQueryParams): Promise<APIResponse<import("@ikas/storefront-api").ExternalAccountLink | null>>;
13
+ static unlinkExternalAccount(params?: UnlinkExternalAccountQueryParams): Promise<APIResponse<boolean>>;
12
14
  static socialLogin(params: CustomerSocialLoginQueryParams): Promise<APIResponse<{
13
15
  customer: IkasCustomer | null;
14
16
  flowId: string | null;
@@ -24,8 +26,8 @@ export default class CustomerStoreAPI {
24
26
  tokenExpiry: number;
25
27
  } | null>>;
26
28
  static refreshToken(params: CustomerRefreshTokenQueryParams): Promise<APIResponse<undefined> | APIResponse<import("@ikas/storefront-api/build/__api/types").CustomerRefreshTokenResponse>>;
27
- static forgotPassword(params: CustomerForgotPasswordQueryParams): Promise<APIResponse<undefined> | APIResponse<boolean>>;
28
- static recoverPassword(params: CustomerRecoverPasswordQueryParams): Promise<APIResponse<undefined> | APIResponse<boolean>>;
29
+ static forgotPassword(params: CustomerForgotPasswordQueryParams): Promise<APIResponse<boolean> | APIResponse<undefined>>;
30
+ static recoverPassword(params: CustomerRecoverPasswordQueryParams): Promise<APIResponse<boolean> | APIResponse<undefined>>;
29
31
  static checkEmail(params: CheckCustomerEmailQueryParams): Promise<APIResponse<undefined> | APIResponse<import("@ikas/storefront-api/build/__api/types").CustomerCheckResponse>>;
30
32
  static getCustomer(): Promise<APIResponse<IkasCustomer | null>>;
31
33
  static saveCustomer(params: SaveMyCustomerQueryParams): Promise<APIResponse<IkasCustomer | null>>;
@@ -34,14 +36,14 @@ export default class CustomerStoreAPI {
34
36
  static listOrderTransactions(params: ListOrderTransactionsQueryParams): Promise<APIResponse<IkasOrderTransaction[]>>;
35
37
  static listOrderTransactionsWithPrices(params: ListOrderTransactionsWithPricesQueryParams): Promise<APIResponse<IkasOrderTransactionWithPrices | null>>;
36
38
  static createOrderRefundRequest(params: CreateOrderRefundRequestQueryParams): Promise<APIResponse<IkasOrder | null>>;
37
- static subscribeToMarketingNotifications(params: SubscribeToMarketingNotificationsQueryParams): Promise<APIResponse<undefined> | APIResponse<boolean>>;
39
+ static subscribeToMarketingNotifications(params: SubscribeToMarketingNotificationsQueryParams): Promise<APIResponse<boolean> | APIResponse<undefined>>;
38
40
  static getLastViewedProducts(params: GetLastViewedProductsQueryParams): Promise<APIResponse<IkasLastViewedProduct[]>>;
39
41
  static saveLastViewedProducts(params: SaveLastViewedProductsQueryParams): Promise<APIResponse<undefined> | APIResponse<import("@ikas/storefront-api/build/__api/types").ProductLastViewed>>;
40
42
  static listOrderRefundSettings(params: ListOrderRefundSettingsQueryParams): Promise<APIResponse<IkasOrderRefundSettings[]>>;
41
- static sendContactFormToMerchant(params: SendContactFormToMerchantQueryParams): Promise<APIResponse<undefined> | APIResponse<boolean>>;
43
+ static sendContactFormToMerchant(params: SendContactFormToMerchantQueryParams): Promise<APIResponse<boolean> | APIResponse<undefined>>;
42
44
  static listFavoriteProducts(): Promise<APIResponse<IkasFavoriteProduct[]>>;
43
- static saveFavoriteProduct(params: SaveFavoriteProductQueryParams): Promise<APIResponse<undefined> | APIResponse<boolean>>;
44
- static isFavoriteProduct(params: IsFavoriteProductQueryParams): Promise<APIResponse<undefined> | APIResponse<boolean>>;
45
+ static saveFavoriteProduct(params: SaveFavoriteProductQueryParams): Promise<APIResponse<boolean> | APIResponse<undefined>>;
46
+ static isFavoriteProduct(params: IsFavoriteProductQueryParams): Promise<APIResponse<boolean> | APIResponse<undefined>>;
45
47
  static createCustomerReview(params: CreateCustomerReviewQueryParams): Promise<APIResponse<IkasCustomerReview | null>>;
46
48
  static listCustomerReviews(params: ListCustomerReviewsQueryParams): Promise<APIResponse<{
47
49
  data: IkasCustomerReview[];
@@ -59,7 +61,7 @@ export default class CustomerStoreAPI {
59
61
  }>>;
60
62
  static listCustomerAttribute(): Promise<APIResponse<IkasCustomerAttribute[]>>;
61
63
  static activateCustomer(params: ActivateCustomerQueryParams): Promise<APIResponse<undefined> | APIResponse<string>>;
62
- static resendCustomerActivationMail(params: ResendCustomerActivationMailQueryParams): Promise<APIResponse<undefined> | APIResponse<boolean>>;
64
+ static resendCustomerActivationMail(params: ResendCustomerActivationMailQueryParams): Promise<APIResponse<boolean> | APIResponse<undefined>>;
63
65
  static resendCustomerPhoneVerificationCode(): Promise<APIResponse<boolean>>;
64
66
  static validateCustomerPhoneVerificationCode(params: ValidateCustomerPhoneVerificationCodeQueryParams): Promise<APIResponse<boolean>>;
65
67
  static validateOTPCode(params: ValidateOTPCodeQueryParams): Promise<APIResponse<{
@@ -69,9 +71,9 @@ export default class CustomerStoreAPI {
69
71
  token: string;
70
72
  tokenExpiry: number;
71
73
  } | null>>;
72
- static saveCustomerFormData(params: SaveCustomerFormDataQueryParams): Promise<APIResponse<undefined> | APIResponse<boolean>>;
74
+ static saveCustomerFormData(params: SaveCustomerFormDataQueryParams): Promise<APIResponse<boolean> | APIResponse<undefined>>;
73
75
  static exportCustomerPersonelData(): Promise<APIResponse<undefined> | APIResponse<string>>;
74
- static deactivateCustomer(params: CustomerDeactiveQueryParams): Promise<APIResponse<undefined> | APIResponse<boolean>>;
76
+ static deactivateCustomer(params: CustomerDeactiveQueryParams): Promise<APIResponse<boolean> | APIResponse<undefined>>;
75
77
  static getLoyaltyCustomerInfo(params: GetLoyaltyCustomerInfoQueryParams): Promise<APIResponse<import("@ikas/storefront-api").LoyaltyCustomerInfo>>;
76
78
  static listLoyaltyProgramPointHistory(params: ListLoyaltyProgramPointHistoryQueryParams): Promise<APIResponse<import("@ikas/storefront-api").LoyaltyProgramPointHistory[]>>;
77
79
  static listLoyaltyProgramTiers(): Promise<APIResponse<import("@ikas/storefront-api").LoyaltyProgramTier[]>>;
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as e,__assign as r}from'./../../ext/tslib/tslib.es6.js';import{APIResponse as n}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{login as i,socialLogin as o,register as s,refreshToken as a,forgotPassword as d,recoverPassword as u,checkEmail as c,getCustomer as l,saveCustomer as m,getOrders as f,getOrderByEmail as h,listOrderTransactions as p,listOrderTransactionsWithPrices as v,createOrderRefundRequest as w,subscribeToMarketingNotifications as j,getLastViewedProducts as x,saveLastViewedProducts as b,listOrderRefundSettings as g,sendContactFormToMerchant as y,listFavoriteProducts as L,saveFavoriteProduct as E,isFavoriteProduct as C,createCustomerReview as P,listCustomerReviews as Q,listCustomerReviewSummary as k,listCustomerAttribute as _,activateCustomer as T,resendCustomerActivationMail as O,resendCustomerPhoneVerificationCode as R,validateCustomerPhoneVerificationCode as F,validateOTPCode as I,saveCustomerFormData as M,exportCustomerPersonelData as S,deactivateCustomer as V,getLoyaltyCustomerInfo as z,listLoyaltyProgramPointHistory as A,listLoyaltyProgramTiers as B,listEarningMethods as D,listSpendingMethodsByCartId as q,useLoyaltyPoints as G}from"@ikas/storefront-api";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"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{IkasCustomerAttribute as H}from"../../models/data/customer/attribute/index.js";import{IkasCustomerReviewSummary as N}from"../../models/data/customer/review/summary/index.js";import{IkasCustomerReview as W}from"../../models/data/customer/review/index.js";import{IkasCustomer as J}from"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import{IkasFavoriteProduct as K}from"../../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{IkasLastViewedProduct as U}from"../../models/data/last-viewed-product/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{IkasOrderTransactionWithPrices as X}from"../../models/data/order/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import{IkasOrderRefundSettings as Y}from"../../models/data/order/refund/settings/index.js";import{IkasOrderTransaction as Z}from"../../models/data/order/transaction/index.js";import{IkasOrder as $}from"../../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";var tt=function(){function tt(){}return tt.login=function(o){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,i(o)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new J(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},tt.socialLogin=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,o(i)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new J(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},tt.register=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,s(i)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new J(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},tt.refreshToken=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,a(r)];case 1:return[2,t.sent()]}}))}))},tt.forgotPassword=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,d(r)];case 1:return[2,t.sent()]}}))}))},tt.recoverPassword=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,u(r)];case 1:return[2,t.sent()]}}))}))},tt.checkEmail=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,c(r)];case 1:return[2,t.sent()]}}))}))},tt.getCustomer=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,l()];case 1:return t=e.sent(),[2,new n(t.data?new J(t.data):null,t.graphQLErrors)]}}))}))},tt.saveCustomer=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,m(r)];case 1:return t=e.sent(),[2,new n(t.data?new J(t.data):null,t.graphQLErrors)]}}))}))},tt.getOrders=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,f(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new $(t)})),t.graphQLErrors)]}}))}))},tt.getOrderByEmail=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,h(r)];case 1:return t=e.sent(),[2,new n(t.data?new $(t.data):null,t.graphQLErrors)]}}))}))},tt.listOrderTransactions=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,p(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new Z(t)})),t.graphQLErrors)]}}))}))},tt.listOrderTransactionsWithPrices=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,v(r)];case 1:return t=e.sent(),[2,new n(t.data?new X(t.data):null,t.graphQLErrors)]}}))}))},tt.createOrderRefundRequest=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,w(r)];case 1:return t=e.sent(),[2,new n(t.data?new $(t.data):null,t.graphQLErrors)]}}))}))},tt.subscribeToMarketingNotifications=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,j(r)];case 1:return[2,t.sent()]}}))}))},tt.getLastViewedProducts=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,x(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new U(t)})),t.graphQLErrors)]}}))}))},tt.saveLastViewedProducts=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,b(r)];case 1:return[2,t.sent()]}}))}))},tt.listOrderRefundSettings=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,g(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new Y(t)})),t.graphQLErrors)]}}))}))},tt.sendContactFormToMerchant=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,y(r)];case 1:return[2,t.sent()]}}))}))},tt.listFavoriteProducts=function(){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,L()];case 1:return t=e.sent(),[2,new n(null===(r=t.data)||void 0===r?void 0:r.map((function(t){return new K(t)})),t.graphQLErrors)]}}))}))},tt.saveFavoriteProduct=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,E(r)];case 1:return[2,t.sent()]}}))}))},tt.isFavoriteProduct=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,C({productId:r.productId})];case 1:return[2,t.sent()]}}))}))},tt.createCustomerReview=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,P(r)];case 1:return t=e.sent(),[2,new n(t.data?new W(t.data):null,t.graphQLErrors)]}}))}))},tt.listCustomerReviews=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,Q(r({},i))];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{data:t.data.data.map((function(t){return new W(t)}))}):null,t.graphQLErrors)]}}))}))},tt.listCustomerReviewSummary=function(i){var o;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,k(i)];case 1:return t=e.sent(),[2,new n(r(r({},t.data),{data:null===(o=t.data)||void 0===o?void 0:o.data.map((function(t){return new N(t)}))}),t.graphQLErrors)]}}))}))},tt.listCustomerAttribute=function(){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,_()];case 1:return t=e.sent(),[2,new n(null===(r=t.data)||void 0===r?void 0:r.sort((function(t,e){return t.order&&e.order?t.order-e.order:-1})).map((function(t){return new H(t)}),t.graphQLErrors))]}}))}))},tt.activateCustomer=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,T(r)];case 1:return[2,t.sent()]}}))}))},tt.resendCustomerActivationMail=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,O(r)];case 1:return[2,t.sent()]}}))}))},tt.resendCustomerPhoneVerificationCode=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,R()];case 1:return[2,t.sent()]}}))}))},tt.validateCustomerPhoneVerificationCode=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,F(r)];case 1:return[2,t.sent()]}}))}))},tt.validateOTPCode=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,I(i)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new J(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},tt.saveCustomerFormData=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,M(r)];case 1:return[2,t.sent()]}}))}))},tt.exportCustomerPersonelData=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,S()];case 1:return[2,t.sent()]}}))}))},tt.deactivateCustomer=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,V(r)];case 1:return[2,t.sent()]}}))}))},tt.getLoyaltyCustomerInfo=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,z(r)];case 1:return[2,t.sent()]}}))}))},tt.listLoyaltyProgramPointHistory=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,A(r)];case 1:return[2,t.sent()]}}))}))},tt.listLoyaltyProgramTiers=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,B()];case 1:return[2,t.sent()]}}))}))},tt.listEarningMethods=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,D()];case 1:return[2,t.sent()]}}))}))},tt.listSpendingMethodsByCartId=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,q(r)];case 1:return[2,t.sent()]}}))}))},tt.useLoyaltyPoints=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,G(r)];case 1:return[2,t.sent()]}}))}))},tt}();export{tt as default};
1
+ import{__awaiter as t,__generator as e,__assign as r}from'./../../ext/tslib/tslib.es6.js';import{APIResponse as n}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{login as i,getExternalAccountLink as o,unlinkExternalAccount as s,socialLogin as a,register as d,refreshToken as u,forgotPassword as c,recoverPassword as l,checkEmail as m,getCustomer as f,saveCustomer as h,getOrders as p,getOrderByEmail as v,listOrderTransactions as w,listOrderTransactionsWithPrices as j,createOrderRefundRequest as x,subscribeToMarketingNotifications as b,getLastViewedProducts as g,saveLastViewedProducts as L,listOrderRefundSettings as y,sendContactFormToMerchant as E,listFavoriteProducts as Q,saveFavoriteProduct as C,isFavoriteProduct as P,createCustomerReview as k,listCustomerReviews as _,listCustomerReviewSummary as T,listCustomerAttribute as O,activateCustomer as R,resendCustomerActivationMail as A,resendCustomerPhoneVerificationCode as F,validateCustomerPhoneVerificationCode as I,validateOTPCode as M,saveCustomerFormData as S,exportCustomerPersonelData as V,deactivateCustomer as z,getLoyaltyCustomerInfo as B,listLoyaltyProgramPointHistory as D,listLoyaltyProgramTiers as q,listEarningMethods as G,listSpendingMethodsByCartId as H,useLoyaltyPoints as N}from"@ikas/storefront-api";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"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{IkasCustomerAttribute as W}from"../../models/data/customer/attribute/index.js";import{IkasCustomerReviewSummary as J}from"../../models/data/customer/review/summary/index.js";import{IkasCustomerReview as K}from"../../models/data/customer/review/index.js";import{IkasCustomer as U}from"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import{IkasFavoriteProduct as X}from"../../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{IkasLastViewedProduct as Y}from"../../models/data/last-viewed-product/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{IkasOrderTransactionWithPrices as Z}from"../../models/data/order/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import{IkasOrderRefundSettings as $}from"../../models/data/order/refund/settings/index.js";import{IkasOrderTransaction as tt}from"../../models/data/order/transaction/index.js";import{IkasOrder as et}from"../../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";var rt=function(){function rt(){}return rt.login=function(o){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,i(o)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new U(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},rt.getExternalAccountLink=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,o(r)];case 1:return t=e.sent(),[2,new n(null!==(i=t.data)&&void 0!==i?i:null,t.graphQLErrors)]}}))}))},rt.unlinkExternalAccount=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,s(r)];case 1:return t=e.sent(),[2,new n(!!t.data,t.graphQLErrors)]}}))}))},rt.socialLogin=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,a(i)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new U(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},rt.register=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,d(i)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new U(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},rt.refreshToken=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,u(r)];case 1:return[2,t.sent()]}}))}))},rt.forgotPassword=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,c(r)];case 1:return[2,t.sent()]}}))}))},rt.recoverPassword=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,l(r)];case 1:return[2,t.sent()]}}))}))},rt.checkEmail=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,m(r)];case 1:return[2,t.sent()]}}))}))},rt.getCustomer=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,f()];case 1:return t=e.sent(),[2,new n(t.data?new U(t.data):null,t.graphQLErrors)]}}))}))},rt.saveCustomer=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,h(r)];case 1:return t=e.sent(),[2,new n(t.data?new U(t.data):null,t.graphQLErrors)]}}))}))},rt.getOrders=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,p(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new et(t)})),t.graphQLErrors)]}}))}))},rt.getOrderByEmail=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,v(r)];case 1:return t=e.sent(),[2,new n(t.data?new et(t.data):null,t.graphQLErrors)]}}))}))},rt.listOrderTransactions=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,w(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new tt(t)})),t.graphQLErrors)]}}))}))},rt.listOrderTransactionsWithPrices=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,j(r)];case 1:return t=e.sent(),[2,new n(t.data?new Z(t.data):null,t.graphQLErrors)]}}))}))},rt.createOrderRefundRequest=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,x(r)];case 1:return t=e.sent(),[2,new n(t.data?new et(t.data):null,t.graphQLErrors)]}}))}))},rt.subscribeToMarketingNotifications=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,b(r)];case 1:return[2,t.sent()]}}))}))},rt.getLastViewedProducts=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,g(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new Y(t)})),t.graphQLErrors)]}}))}))},rt.saveLastViewedProducts=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,L(r)];case 1:return[2,t.sent()]}}))}))},rt.listOrderRefundSettings=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,y(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new $(t)})),t.graphQLErrors)]}}))}))},rt.sendContactFormToMerchant=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,E(r)];case 1:return[2,t.sent()]}}))}))},rt.listFavoriteProducts=function(){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,Q()];case 1:return t=e.sent(),[2,new n(null===(r=t.data)||void 0===r?void 0:r.map((function(t){return new X(t)})),t.graphQLErrors)]}}))}))},rt.saveFavoriteProduct=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,C(r)];case 1:return[2,t.sent()]}}))}))},rt.isFavoriteProduct=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,P({productId:r.productId})];case 1:return[2,t.sent()]}}))}))},rt.createCustomerReview=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,k(r)];case 1:return t=e.sent(),[2,new n(t.data?new K(t.data):null,t.graphQLErrors)]}}))}))},rt.listCustomerReviews=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,_(r({},i))];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{data:t.data.data.map((function(t){return new K(t)}))}):null,t.graphQLErrors)]}}))}))},rt.listCustomerReviewSummary=function(i){var o;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,T(i)];case 1:return t=e.sent(),[2,new n(r(r({},t.data),{data:null===(o=t.data)||void 0===o?void 0:o.data.map((function(t){return new J(t)}))}),t.graphQLErrors)]}}))}))},rt.listCustomerAttribute=function(){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,O()];case 1:return t=e.sent(),[2,new n(null===(r=t.data)||void 0===r?void 0:r.sort((function(t,e){return t.order&&e.order?t.order-e.order:-1})).map((function(t){return new W(t)}),t.graphQLErrors))]}}))}))},rt.activateCustomer=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,R(r)];case 1:return[2,t.sent()]}}))}))},rt.resendCustomerActivationMail=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,A(r)];case 1:return[2,t.sent()]}}))}))},rt.resendCustomerPhoneVerificationCode=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,F()];case 1:return[2,t.sent()]}}))}))},rt.validateCustomerPhoneVerificationCode=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,I(r)];case 1:return[2,t.sent()]}}))}))},rt.validateOTPCode=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,M(i)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new U(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},rt.saveCustomerFormData=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,S(r)];case 1:return[2,t.sent()]}}))}))},rt.exportCustomerPersonelData=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,V()];case 1:return[2,t.sent()]}}))}))},rt.deactivateCustomer=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,z(r)];case 1:return[2,t.sent()]}}))}))},rt.getLoyaltyCustomerInfo=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,B(r)];case 1:return[2,t.sent()]}}))}))},rt.listLoyaltyProgramPointHistory=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,D(r)];case 1:return[2,t.sent()]}}))}))},rt.listLoyaltyProgramTiers=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,q()];case 1:return[2,t.sent()]}}))}))},rt.listEarningMethods=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,G()];case 1:return[2,t.sent()]}}))}))},rt.listSpendingMethodsByCartId=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,H(r)];case 1:return[2,t.sent()]}}))}))},rt.useLoyaltyPoints=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,N(r)];case 1:return[2,t.sent()]}}))}))},rt}();export{rt as default};
@@ -1,9 +1,14 @@
1
1
  import { IkasContactForm, IkasCustomer, IkasCustomerAttributeValue, IkasFavoriteProduct, IkasOrderTransaction, IkasOrderTransactionWithPrices, IkasProduct, IkasOrder, IkasRaffleParticipant, IkasProductFile } from "../../models/data";
2
2
  import { APIResponse } from "@ikas/fe-api-client";
3
- import { IkasLoginError, IkasRegisterError } from "@ikas/storefront-api";
3
+ import { ExternalAccountLink, IkasLoginError, IkasRegisterError } from "@ikas/storefront-api";
4
4
  import { IkasBaseStore } from "../base";
5
5
  import { AddLoyaltyToCartInput, SaveCustomerFormDataInput } from "@ikas/storefront-api/src/__api/types";
6
6
  export declare type SocialLoginProvider = "facebook" | "google" | "twitch" | "apple";
7
+ export declare type MilesSmilesBindResult = {
8
+ isSuccess: boolean;
9
+ /** Error code from the bind flow (e.g. AUTHORIZATION_REQUIRED). */
10
+ errorCode?: string | null;
11
+ };
7
12
  export declare class IkasCustomerStore {
8
13
  customer?: IkasCustomer | null;
9
14
  private token?;
@@ -26,6 +31,20 @@ export declare class IkasCustomerStore {
26
31
  private toAnalyticsCustomer;
27
32
  socialLogin(provider: SocialLoginProvider): Promise<void>;
28
33
  socialLoginToken(token: string): Promise<boolean>;
34
+ /**
35
+ * Starts the Miles&Smiles account bind flow for the logged-in customer.
36
+ * The THY login page opens in a popup; once THY confirms, the token payload
37
+ * is posted to the ikas bind callback and the browser lands on `redirect`
38
+ * with `milesSmilesStatus` query params (see `readMilesSmilesBindResult`).
39
+ * Falls back to a full redirect when the popup is blocked.
40
+ *
41
+ * @param redirect Relative store path to land on after bind (e.g. "/checkout?id=..").
42
+ */
43
+ startMilesSmilesBind(redirect?: string | null): Promise<MilesSmilesBindResult>;
44
+ /** Durable Miles&Smiles link for the logged-in customer, or null when not linked. */
45
+ getMilesSmilesLink(): Promise<APIResponse<ExternalAccountLink | null>>;
46
+ /** Removes the Miles&Smiles link and the server-side checkout session token. */
47
+ unlinkMilesSmiles(): Promise<APIResponse<boolean>>;
29
48
  refundOrder(order: IkasOrder, email?: string | null): Promise<boolean>;
30
49
  /**
31
50
  * @deprecated Use customerLogin instead.
@@ -105,7 +124,7 @@ export declare class IkasCustomerStore {
105
124
  createEmailSubscription: (email: string) => Promise<boolean>;
106
125
  saveCustomerFormData: (input: SaveCustomerFormDataInput) => Promise<boolean>;
107
126
  sendReview: (input: IkasCustomerReviewForm) => Promise<import("../../models/data").IkasCustomerReview | null | undefined>;
108
- deactivateCustomer: (password?: string) => Promise<APIResponse<undefined> | APIResponse<boolean> | undefined>;
127
+ deactivateCustomer: (password?: string) => Promise<APIResponse<boolean> | APIResponse<undefined> | undefined>;
109
128
  exportCustomerPersonalData: () => Promise<APIResponse<undefined> | APIResponse<string> | undefined>;
110
129
  onCustomerConsentGrant: () => void;
111
130
  waitUntilInitialized: () => Promise<unknown>;