@ikas/storefront 4.9.0-beta.5 → 4.9.0-beta.7

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.
@@ -2,6 +2,7 @@ import { IkasCheckout, IkasProduct, IkasOrderLineItem } from "../models";
2
2
  import { IkasCart } from "../models/data/cart";
3
3
  export declare class FacebookPixel {
4
4
  constructor();
5
+ private static get fbpId();
5
6
  static productView(productDetail: IkasProduct): void;
6
7
  static addToCart(item: IkasOrderLineItem, quantity: number, eventId: string): void;
7
8
  static beginCheckout(checkout: IkasCheckout): void;
@@ -1 +1 @@
1
- import{makeAutoObservable as t}from"mobx";var n="undefined"==typeof window,r=function(){function r(){t(this)}return r.productView=function(t){try{return void(!n&&window.fbq&&window.fbq("track","ViewContent",(r=t,{content_name:r.name,content_category:r.categories.length>0?r.categories[0].path.map((function(t){return t.name})).join(" > "):"",content_ids:[r.selectedVariant.id],content_type:"product",value:r.selectedVariant.price.finalPrice,currency:""===r.selectedVariant.price.currency?"TRY":r.selectedVariant.price.currency})))}catch(t){console.error(t)}var r},r.addToCart=function(t,r,e){try{return void(!n&&window.fbq&&window.fbq("track","AddToCart",function(t,n){var r,e=[];t.variant.categories&&(null===(r=t.variant.categories[0].categoryPath)||void 0===r||r.map((function(t){return e.push(t.name)}))),t.variant.categories&&t.variant.categories.length>0&&e.push(t.variant.categories[0].name);var o=e.length>0?e.join(" > "):"";return{content_name:t.variant.name,content_category:o,content_ids:[t.variant.id],content_type:"product",value:t.finalPrice,currency:t.currencyCode}}(t),{eventID:e}))}catch(t){console.error(t)}},r.beginCheckout=function(t){try{return void(!n&&window.fbq&&window.fbq("track","InitiateCheckout",e(t)))}catch(t){console.error(t)}},r.purchase=function(t,r){try{return void(!n&&window.fbq&&window.fbq("track","Purchase",e(t),{eventID:r}))}catch(t){console.error(t)}},r.addToWishlist=function(t){try{return void(!n&&window.fbq&&window.fbq("track","AddToWishlist",{content_ids:[t]}))}catch(t){console.error(t)}},r.search=function(t){try{return void(!n&&window.fbq&&window.fbq("track","Search",{search_string:t}))}catch(t){console.error(t)}},r.completeRegistration=function(){try{return void(!n&&window.fbq&&window.fbq("track","CompleteRegistration",{status:!0,value:0,currency:"TRY"}))}catch(t){console.error(t)}},r.viewCart=function(t){try{return void(!n&&window.fbq&&window.fbq("track","ViewCart",function(t){var n=[],r=[];return t.items.map((function(t){n.push(t.variant.id||""),r.push({id:t.variant.id,quantity:t.quantity})})),{contents:r,content_type:"product_group",content_ids:n,currency:t.items[0].currencyCode,value:t.totalPrice,num_items:t.items.length}}(t)))}catch(t){console.error(t)}},r.viewCategory=function(t){try{return void(!n&&window.fbq&&window.fbq("track","ViewCategory",{content_name:t}))}catch(t){console.error(t)}},r.contactForm=function(){try{return void(!n&&window.fbq&&window.fbq("track","ContactForm",{}))}catch(t){console.error(t)}},r}();function e(t){var n=[],r=[];return t.items.map((function(t){n.push(t.variant.id||""),r.push({id:t.variant.id,quantity:t.quantity})})),{contents:r,content_category:"",content_type:"product",content_ids:n,currency:t.items[0].currencyCode,value:t.totalFinalPrice,num_items:t.items.length}}export{r as FacebookPixel};
1
+ import{makeAutoObservable as t}from"mobx";import{IkasStorefrontConfig as n}from"@ikas/storefront-config";var e="undefined"==typeof window,r=function(){function r(){t(this)}return Object.defineProperty(r,"fbpId",{get:function(){return n.getFbpId()},enumerable:!1,configurable:!0}),r.productView=function(t){try{return void(!e&&this.fbpId&&window.fbq&&window.fbq("track","ViewContent",(n=t,{content_name:n.name,content_category:n.categories.length>0?n.categories[0].path.map((function(t){return t.name})).join(" > "):"",content_ids:[n.selectedVariant.id],content_type:"product",value:n.selectedVariant.price.finalPrice,currency:""===n.selectedVariant.price.currency?"TRY":n.selectedVariant.price.currency})))}catch(t){console.error(t)}var n},r.addToCart=function(t,n,r){try{return void(!e&&this.fbpId&&window.fbq&&window.fbq("track","AddToCart",function(t,n){var e,r=[];t.variant.categories&&(null===(e=t.variant.categories[0].categoryPath)||void 0===e||e.map((function(t){return r.push(t.name)}))),t.variant.categories&&t.variant.categories.length>0&&r.push(t.variant.categories[0].name);var o=r.length>0?r.join(" > "):"";return{content_name:t.variant.name,content_category:o,content_ids:[t.variant.id],content_type:"product",value:t.finalPrice,currency:t.currencyCode}}(t),{eventID:r}))}catch(t){console.error(t)}},r.beginCheckout=function(t){try{return void(!e&&this.fbpId&&window.fbq&&window.fbq("track","InitiateCheckout",o(t)))}catch(t){console.error(t)}},r.purchase=function(t,n){try{return void(!e&&this.fbpId&&window.fbq&&window.fbq("track","Purchase",o(t),{eventID:n}))}catch(t){console.error(t)}},r.addToWishlist=function(t){try{return void(!e&&this.fbpId&&window.fbq&&window.fbq("track","AddToWishlist",{content_ids:[t]}))}catch(t){console.error(t)}},r.search=function(t){try{return void(!e&&this.fbpId&&window.fbq&&window.fbq("track","Search",{search_string:t}))}catch(t){console.error(t)}},r.completeRegistration=function(){try{return void(!e&&this.fbpId&&window.fbq&&window.fbq("track","CompleteRegistration",{status:!0,value:0,currency:"TRY"}))}catch(t){console.error(t)}},r.viewCart=function(t){try{return void(!e&&this.fbpId&&window.fbq&&window.fbq("track","ViewCart",function(t){var n=[],e=[];return t.items.map((function(t){n.push(t.variant.id||""),e.push({id:t.variant.id,quantity:t.quantity})})),{contents:e,content_type:"product_group",content_ids:n,currency:t.items[0].currencyCode,value:t.totalPrice,num_items:t.items.length}}(t)))}catch(t){console.error(t)}},r.viewCategory=function(t){try{return void(!e&&this.fbpId&&window.fbq&&window.fbq("track","ViewCategory",{content_name:t}))}catch(t){console.error(t)}},r.contactForm=function(){try{return void(!e&&this.fbpId&&window.fbq&&window.fbq("track","ContactForm",{}))}catch(t){console.error(t)}},r}();function o(t){var n=[],e=[];return t.items.map((function(t){n.push(t.variant.id||""),e.push({id:t.variant.id,quantity:t.quantity})})),{contents:e,content_category:"",content_type:"product",content_ids:n,currency:t.items[0].currencyCode,value:t.totalFinalPrice,num_items:t.items.length}}export{r as FacebookPixel};
@@ -1,6 +1,7 @@
1
1
  import { IkasCheckout, IkasProduct, IkasOrderLineItem, IkasCategory } from "../models";
2
2
  export declare class TiktokPixel {
3
3
  constructor();
4
+ private static get tiktokPixelId();
4
5
  static productView(productDetail: IkasProduct): void;
5
6
  static addToCart(item: IkasOrderLineItem, quantity: number): void;
6
7
  static beginCheckout(): void;
@@ -1 +1 @@
1
- import{makeAutoObservable as t}from"mobx";import{IkasBaseStore as n}from"../store/base.js";import"../store/customer/index.js";import"../store/cart/index.js";var r="undefined"==typeof window,e=function(){function n(){t(this)}return n.productView=function(t){try{return o(),void(!r&&window.ttq&&window.ttq.track("ViewContent",function(t,n){void 0===n&&(n=1);return{content_type:"product",quantity:n,content_id:t.selectedVariant.id,value:t.selectedVariant.price.finalPrice,currency:""===t.selectedVariant.price.currency?"TRY":t.selectedVariant.price.currency}}(t)))}catch(t){console.error(t)}},n.addToCart=function(t,n){try{return o(),void(!r&&window.ttq&&window.ttq.track("AddToCart",function(t,n){void 0===n&&(n=1);return{content_id:t.variant.id,content_type:"product",content_name:t.variant.name,quantity:n,value:t.finalPrice,currency:t.currencyCode}}(t,n)))}catch(t){console.error(t)}},n.beginCheckout=function(){try{return o(),void(!r&&window.ttq&&window.ttq.track("InitiateCheckout"))}catch(t){console.error(t)}},n.purchase=function(t){try{return o(),void(!r&&window.ttq&&window.ttq.track("CompletePayment",function(t){var n=[];return null==t||t.items.map((function(t){n.push({content_id:t.variant.id,content_type:"product",content_name:t.variant.name,price:t.finalPrice,quantity:t.quantity})})),{contents:n,content_type:"product_group",currency:t.items[0].currencyCode,value:t.totalPrice}}(t)))}catch(t){console.error(t)}},n.addToWishlist=function(t){try{return o(),void(!r&&window.ttq&&window.ttq.track("AddToWishlist",{content_id:t}))}catch(t){console.error(t)}},n.search=function(t){try{return o(),void(!r&&window.ttq&&window.ttq.track("Search",{query:t,content_id:"Search"}))}catch(t){console.error(t)}},n.completeRegistration=function(){try{return o(),void(!r&&window.ttq&&window.ttq.track("CompleteRegistration"))}catch(t){console.error(t)}},n.viewCategory=function(t){try{return o(),void(!r&&window.ttq&&window.ttq.track("ViewContent",{content_id:t.id,content_type:"product_group",content_category:t.name}))}catch(t){console.error(t)}},n.contactForm=function(){try{return o(),void(!r&&window.ttq&&window.ttq.track("Contact"))}catch(t){console.error(t)}},n}();function o(){try{var t=n.getInstance().customerStore.customer;if(!t)return;return void(!r&&window.ttq&&window.ttq.identify({external_id:t.id,email:t.email,phone_number:t.phone||""}))}catch(t){console.error(t)}}export{e as TiktokPixel};
1
+ import{makeAutoObservable as t}from"mobx";import{IkasBaseStore as e}from"../store/base.js";import"../store/customer/index.js";import"../store/cart/index.js";import{IkasStorefrontConfig as n}from"@ikas/storefront-config";var o="undefined"==typeof window,r=function(){function e(){t(this)}return Object.defineProperty(e,"tiktokPixelId",{get:function(){return n.getTiktokPixelId()},enumerable:!1,configurable:!0}),e.productView=function(t){try{return i(),void(!o&&this.tiktokPixelId&&window.ttq&&window.ttq.track("ViewContent",function(t,e){void 0===e&&(e=1);return{content_type:"product",quantity:e,content_id:t.selectedVariant.id,value:t.selectedVariant.price.finalPrice,currency:""===t.selectedVariant.price.currency?"TRY":t.selectedVariant.price.currency}}(t)))}catch(t){console.error(t)}},e.addToCart=function(t,e){try{return i(),void(!o&&this.tiktokPixelId&&window.ttq&&window.ttq.track("AddToCart",function(t,e){void 0===e&&(e=1);return{content_id:t.variant.id,content_type:"product",content_name:t.variant.name,quantity:e,value:t.finalPrice,currency:t.currencyCode}}(t,e)))}catch(t){console.error(t)}},e.beginCheckout=function(){try{return i(),void(!o&&this.tiktokPixelId&&window.ttq&&window.ttq.track("InitiateCheckout"))}catch(t){console.error(t)}},e.purchase=function(t){try{return i(),void(!o&&this.tiktokPixelId&&window.ttq&&window.ttq.track("CompletePayment",function(t){var e=[];return null==t||t.items.map((function(t){e.push({content_id:t.variant.id,content_type:"product",content_name:t.variant.name,price:t.finalPrice,quantity:t.quantity})})),{contents:e,content_type:"product_group",currency:t.items[0].currencyCode,value:t.totalPrice}}(t)))}catch(t){console.error(t)}},e.addToWishlist=function(t){try{return i(),void(!o&&this.tiktokPixelId&&window.ttq&&window.ttq.track("AddToWishlist",{content_id:t}))}catch(t){console.error(t)}},e.search=function(t){try{return i(),void(!o&&this.tiktokPixelId&&window.ttq&&window.ttq.track("Search",{query:t,content_id:"Search"}))}catch(t){console.error(t)}},e.completeRegistration=function(){try{return i(),void(!o&&this.tiktokPixelId&&window.ttq&&window.ttq.track("CompleteRegistration"))}catch(t){console.error(t)}},e.viewCategory=function(t){try{return i(),void(!o&&this.tiktokPixelId&&window.ttq&&window.ttq.track("ViewContent",{content_id:t.id,content_type:"product_group",content_category:t.name}))}catch(t){console.error(t)}},e.contactForm=function(){try{return i(),void(!o&&this.tiktokPixelId&&window.ttq&&window.ttq.track("Contact"))}catch(t){console.error(t)}},e}();function i(){try{var t=e.getInstance().customerStore.customer;if(!t)return;return void(!o&&n.getTiktokPixelId()&&window.ttq&&window.ttq.identify({external_id:t.id,email:t.email,phone_number:t.phone||""}))}catch(t){console.error(t)}}export{r as TiktokPixel};
@@ -1 +1 @@
1
- import*as e from"react";import{observer as t}from"mobx-react-lite";import{Button as a}from"../../components/button/index.js";import{CART_LS_KEY as o}from"../../../../store/cart/index.js";import s 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 n from"../../components/credit-card-form/svg/master-card.js";import d from"../../components/credit-card-form/svg/troy.js";import l from"../../components/credit-card-form/svg/visa.js";import"@ikas/storefront-config";import{formatCurrency as m}from"../../../../utils/currency.js";import{useTranslation as u}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 p,IkasPaymentGatewayType as E,IkasOrderPackageStatus as v,IkasTransactionCardAssociation as g}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/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/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/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/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 f from"../../components/offer-product/index.js";import{Analytics as h}from"../../../../analytics/analytics.js";import"../../../../analytics/head/index.js";import{QuickRegistration as x}from"../../components/quick-registration/index.js";var k=t((function(t){var v,k,T,y,I,N,A,L=t.vm,C=u().t;e.useEffect((function(){if("undefined"!=typeof localStorage){var e=localStorage.getItem(o);e&&e===L.checkout.id&&(L.successTransaction&&h.purchase(L.checkout,L.successTransaction),localStorage.removeItem(o)),window&&window.handleKlarna&&window.handleKlarna(void 0)}}),[]);var R=((null===(v=L.checkout.customer)||void 0===v?void 0:v.firstName)||"")+" "+((null===(k=L.checkout.customer)||void 0===k?void 0:k.lastName)||""),D=((null===(T=L.checkout.shippingAddress)||void 0===T?void 0:T.firstName)||"")+" "+((null===(y=L.checkout.shippingAddress)||void 0===y?void 0:y.lastName)||""),S=L.paymentGateways.find((function(e){var t;return e.id===(null===(t=L.successTransaction)||void 0===t?void 0:t.paymentGatewayId)})),_=function(e){switch(e){case p.APP_PAYMENT:return C("checkout-page:appPayment");case p.BANK_REDIRECT:return C("checkout-page:bankRedirect");case p.BUY_ONLINE_PAY_AT_STORE:return C("checkout-page:buyOnlinePayAtStore");case p.CASH:return C("checkout-page:cash");case p.CASH_ON_DELIVERY:return C("checkout-page:cashOnDelivery");case p.CREDIT_CARD:return C("checkout-page:creditCard");case p.CREDIT_CARD_ON_DELIVERY:return C("checkout-page:creditCardOnDelivery");case p.DIRECT_DEBIT:return C("checkout-page:directDebit");case p.GIFT_CARD:return C("checkout-page:giftCard");case p.MONEY_ORDER:return C("checkout-page:moneyOrder");case p.OTHER:return C("checkout-page:other");case p.PAY_LATER:return C("checkout-page:payLater");case p.SLICE_IT:return C("checkout-page:sliceIt");case p.WALLET:return C("checkout-page:wallet");default:return""}},P=null===(I=L.successTransaction)||void 0===I?void 0:I.paymentMethodDetail,b=null===(N=L.successTransaction)||void 0===N?void 0:N.paymentGatewayCode,F=e.useMemo((function(){var t,a,o,r,i,u;return e.createElement("div",{className:[s.InfoGrid].join(" ")},!L.isFree&&e.createElement("div",null,e.createElement("div",{className:s.InfoTitle},C("checkout-page:paymentMethod")),S&&e.createElement(e.Fragment,null,!!S.logoUrl&&e.createElement("div",{className:s.PaymentLogoContainer},e.createElement("img",{src:S.logoUrl})),!S.logoUrl&&e.createElement("div",{className:s.InfoText},S.paymentMethodType===p.CREDIT_CARD&&S.type===E.INTERNAL?C("checkout-page:creditCard"):S.name),"STRIPE"===S.code||"PAYPAL"===S.code||"KLARNA"===S.code?e.createElement("div",{className:s.InfoText},_(S.paymentMethodType)):!!S.description&&S.type!==E.EXTERNAL&&e.createElement("div",{className:s.InfoText},e.createElement("div",{dangerouslySetInnerHTML:{__html:S.description}}))),"E_PAY_KOLAY"===b&&e.createElement(e.Fragment,null,e.createElement("div",{className:s.EPayKolayLogoContainer},e.createElement("img",{src:"https://cdn.myikas.com/sf/assets/payment/epaykolay.png"})),!!(null===(t=L.successTransaction)||void 0===t?void 0:t.paymentMethod)&&e.createElement("div",{className:s.InfoText},_(null===(a=L.successTransaction)||void 0===a?void 0:a.paymentMethod))),"E_PAY_KOLAY"!==b&&"STRIPE"!==b&&"PAYPAL"!==b&&"KLARNA"!==b&&"CREDIT_CARD"===(null===(o=L.successTransaction)||void 0===o?void 0:o.paymentMethod)&&e.createElement(e.Fragment,null,e.createElement("div",{className:s.InfoText},e.createElement("div",{className:s.CardLogoContainer},function(){var t,a;switch(null===(a=null===(t=L.successTransaction)||void 0===t?void 0:t.paymentMethodDetail)||void 0===a?void 0:a.cardAssociation){case g.AMERICAN_EXPRESS:return e.createElement(c,null);case g.MASTER_CARD:return e.createElement(n,null);case g.TROY:return e.createElement(d,null);case g.VISA:return e.createElement(l,null);default:return e.createElement("div",null)}}()),e.createElement("span",null,"**** ".concat((null==P?void 0:P.lastFourDigits)||""))),(null===(r=null==P?void 0:P.installment)||void 0===r?void 0:r.installmentCount)&&P.installment.installmentCount>1&&e.createElement(e.Fragment,null,e.createElement("div",{className:s.InfoText},"".concat(P.installment.installmentCount," ").concat(C("checkout-page:installments"))),null!==P.installment.installmentPrice&&e.createElement("div",{className:s.InfoText},"".concat(P.installment.installmentCount," x ").concat(m(P.installment.installmentPrice,L.checkout.currencyCode,L.checkout.currencySymbol)))))),e.createElement("div",null,e.createElement("div",{className:s.InfoTitle},C("checkout-page:billingAddress")),!!(null===(i=L.checkout.billingAddress)||void 0===i?void 0:i.company)&&e.createElement("div",{className:[s.InfoText,s.InfoTextBold].join(" ")},L.checkout.billingAddress.company),e.createElement("div",{className:s.InfoText},null===(u=L.checkout.billingAddress)||void 0===u?void 0:u.addressText)))}),[]),w=e.useMemo((function(){var t,a,o,r,i;return e.createElement("div",{className:[s.InfoGrid].join(" ")},e.createElement("div",null,e.createElement("div",{className:s.InfoTitle},C("checkout-page:contactInfo")),e.createElement("div",{className:s.InfoText},null===(t=L.checkout.customer)||void 0===t?void 0:t.email),e.createElement("div",{className:s.InfoText},R),!!(null===(a=L.checkout.shippingAddress)||void 0===a?void 0:a.phone)&&e.createElement("div",{className:s.InfoText},null===(o=L.checkout.shippingAddress)||void 0===o?void 0:o.phone)),e.createElement("div",null,"in-store"===L.deliveryMethod&&e.createElement(e.Fragment,null,e.createElement("div",{className:s.InfoTitle},C("checkout-page:receiver")),e.createElement("div",{className:[s.InfoText,s.withMBottom].join(" ")},D)),e.createElement("div",{className:s.InfoTitle},"address"===L.deliveryMethod?C("checkout-page:shippingAddress"):C("checkout-page:pickUpLocation")),!!(null===(r=L.checkout.shippingAddress)||void 0===r?void 0:r.company)&&e.createElement("div",{className:[s.InfoText,s.InfoTextBold].join(" ")},L.checkout.shippingAddress.company),e.createElement("div",{className:s.InfoText},null===(i=L.checkout.shippingAddress)||void 0===i?void 0:i.addressText)))}),[]);return e.createElement("div",{className:s.StepSuccess},e.createElement("div",{className:s.SuccessTitleContainer},e.createElement(r,{className:s.SuccessCircle}),e.createElement("span",{className:s.SuccessTitle},C("checkout-page:orderSuccessTitle"))),e.createElement("div",{className:s.SuccessSubTitle},C("address"===L.deliveryMethod?"checkout-page:orderSuccessDescription":"checkout-page:orderSuccessInStoreDeliveryDescription",{customerName:R})),e.createElement("div",{className:[s.InfoGrid,s.WithBorder].join(" ")},e.createElement("div",null,e.createElement("div",{className:s.InfoTitle},C("checkout-page:orderNoAndDate")),e.createElement("div",{className:[s.InfoText,s.InfoTextBold].join(" ")},"#"+(L.checkout.orderNumber||"")),e.createElement("div",{className:s.InfoText},L.checkout.dateStr),e.createElement(j,{vm:L})),e.createElement("div",null,e.createElement("div",{className:s.InfoTitle},C("checkout-page:contactInfo")),e.createElement("div",{className:s.InfoText},null===(A=L.checkout.customer)||void 0===A?void 0:A.email),e.createElement("div",{className:s.InfoText},R))),L.postCheckoutCampaignOffer&&e.createElement(f,{vm:L,campaignOffer:L.postCheckoutCampaignOffer}),L.hasQuickRegistration&&e.createElement(x,{vm:L}),e.createElement(i,{title:C("checkout-page:paymentSummary")},F),!L.isDigitalOnly&&e.createElement(i,{title:C("checkout-page:shippingSummary")},w),e.createElement("div",{className:s.Actions},e.createElement("div",{className:s.HelpText},e.createElement("span",null,C("checkout-page:helpCtaQuestion")),e.createElement("span",{className:s.Cta,onClick:function(){return L.setContactModalVisible(!0)}},C("checkout-page:helpCta"))),e.createElement(a,{text:C("checkout-page:actions.backToShopping"),onClick:L.onBackToShoppingClick,style:{flex:"0 0 auto"}})))})),j=t((function(t){var a,o=t.vm,r=u().t,i=s.Yellow;switch(o.checkout.orderPackageStatus){case v.FULFILLED:case v.PARTIALLY_FULFILLED:case v.DELIVERED:case v.PARTIALLY_DELIVERED:i=s.Green;break;case v.CANCELLED:case v.PARTIALLY_CANCELLED:case v.CANCEL_REJECTED:case v.CANCEL_REQUESTED:i=s.Red}return e.createElement("div",{className:[s.OrderStatus,i].join(" ")},o.checkout.orderPackageStatus?null===(a=[{types:[v.UNFULFILLED],text:r("checkout-page:orderPackageStatus.unfulfilled")},{types:[v.READY_FOR_SHIPMENT],text:r("checkout-page:orderPackageStatus.readyForShipment")},{types:[v.PARTIALLY_FULFILLED],text:r("checkout-page:orderPackageStatus.partiallyFulfilled")},{types:[v.FULFILLED],text:r("checkout-page:orderPackageStatus.fulfilled")},{types:[v.DELIVERED,v.PARTIALLY_DELIVERED],text:r("checkout-page:orderPackageStatus.delivered")},{types:[v.UNABLE_TO_DELIVER],text:r("checkout-page:orderPackageStatus.unableToDeliver")},{types:[v.CANCELLED,v.PARTIALLY_CANCELLED],text:r("checkout-page:orderPackageStatus.cancelled")},{types:[v.CANCEL_REJECTED],text:r("checkout-page:orderPackageStatus.cancelRejected")},{types:[v.REFUNDED,v.PARTIALLY_REFUNDED],text:r("checkout-page:orderPackageStatus.refunded")},{types:[v.REFUND_REQUEST_ACCEPTED],text:r("checkout-page:orderPackageStatus.refundRequestAccepted")},{types:[v.REFUND_REJECTED],text:r("checkout-page:orderPackageStatus.refundRejected")},{types:[v.REFUND_REQUESTED],text:r("checkout-page:orderPackageStatus.refundRequested")}].find((function(e){return e.types.includes(o.checkout.orderPackageStatus)})))||void 0===a?void 0:a.text:"")}));export{k as StepSuccess};
1
+ import*as e from"react";import{observer as t}from"mobx-react-lite";import{Button as a}from"../../components/button/index.js";import{CART_LS_KEY as o}from"../../../../store/cart/index.js";import s 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 n from"../../components/credit-card-form/svg/master-card.js";import d from"../../components/credit-card-form/svg/troy.js";import l from"../../components/credit-card-form/svg/visa.js";import"@ikas/storefront-config";import{formatCurrency as m}from"../../../../utils/currency.js";import{useTranslation as u}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 p,IkasPaymentGatewayType as E,IkasOrderPackageStatus as v,IkasTransactionCardAssociation as g}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/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/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/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/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 f from"../../components/offer-product/index.js";import{Analytics as h}from"../../../../analytics/analytics.js";import"../../../../analytics/head/index.js";import{QuickRegistration as x}from"../../components/quick-registration/index.js";var k=t((function(t){var v,k,T,y,I,N,A,L=t.vm,C=u().t;e.useEffect((function(){if("undefined"!=typeof localStorage){var e=localStorage.getItem(o);e&&e===L.checkout.id&&(L.successTransaction&&h.purchase(L.checkout,L.successTransaction),localStorage.removeItem(o)),window&&window.handleKlarna&&window.handleKlarna(void 0)}}),[]);var R=((null===(v=L.checkout.customer)||void 0===v?void 0:v.firstName)||"")+" "+((null===(k=L.checkout.customer)||void 0===k?void 0:k.lastName)||""),D=((null===(T=L.checkout.shippingAddress)||void 0===T?void 0:T.firstName)||"")+" "+((null===(y=L.checkout.shippingAddress)||void 0===y?void 0:y.lastName)||""),S=L.paymentGateways.find((function(e){var t;return e.id===(null===(t=L.successTransaction)||void 0===t?void 0:t.paymentGatewayId)})),_=function(e){switch(e){case p.APP_PAYMENT:return C("checkout-page:appPayment");case p.BANK_REDIRECT:return C("checkout-page:bankRedirect");case p.BUY_ONLINE_PAY_AT_STORE:return C("checkout-page:buyOnlinePayAtStore");case p.CASH:return C("checkout-page:cash");case p.CASH_ON_DELIVERY:return C("checkout-page:cashOnDelivery");case p.CREDIT_CARD:return C("checkout-page:creditCard");case p.CREDIT_CARD_ON_DELIVERY:return C("checkout-page:creditCardOnDelivery");case p.DIRECT_DEBIT:return C("checkout-page:directDebit");case p.GIFT_CARD:return C("checkout-page:giftCard");case p.MONEY_ORDER:return C("checkout-page:moneyOrder");case p.OTHER:return C("checkout-page:other");case p.PAY_LATER:return C("checkout-page:payLater");case p.SLICE_IT:return C("checkout-page:sliceIt");case p.WALLET:return C("checkout-page:wallet");default:return""}},P=null===(I=L.successTransaction)||void 0===I?void 0:I.paymentMethodDetail,b=null===(N=L.successTransaction)||void 0===N?void 0:N.paymentGatewayCode,F=e.useMemo((function(){var t,a,o,r,i,u,v;return e.createElement("div",{className:[s.InfoGrid].join(" ")},!L.isFree&&e.createElement("div",null,e.createElement("div",{className:s.InfoTitle},C("checkout-page:paymentMethod")),S&&e.createElement(e.Fragment,null,!!S.logoUrl&&e.createElement("div",{className:s.PaymentLogoContainer},e.createElement("img",{src:S.logoUrl})),!S.logoUrl&&e.createElement("div",{className:s.InfoText},S.paymentMethodType===p.CREDIT_CARD&&S.type===E.INTERNAL?C("checkout-page:creditCard"):S.name),"STRIPE"!==S.code&&"PAYPAL"!==S.code&&"KLARNA"!==S.code||!(null===(t=L.successTransaction)||void 0===t?void 0:t.paymentMethod)?!!S.description&&S.type!==E.EXTERNAL&&e.createElement("div",{className:s.InfoText},e.createElement("div",{dangerouslySetInnerHTML:{__html:S.description}})):e.createElement("div",{className:s.InfoText},_(L.successTransaction.paymentMethod))),"E_PAY_KOLAY"===b&&e.createElement(e.Fragment,null,e.createElement("div",{className:s.EPayKolayLogoContainer},e.createElement("img",{src:"https://cdn.myikas.com/sf/assets/payment/epaykolay.png"})),!!(null===(a=L.successTransaction)||void 0===a?void 0:a.paymentMethod)&&e.createElement("div",{className:s.InfoText},_(null===(o=L.successTransaction)||void 0===o?void 0:o.paymentMethod))),"E_PAY_KOLAY"!==b&&"STRIPE"!==b&&"PAYPAL"!==b&&"KLARNA"!==b&&"CREDIT_CARD"===(null===(r=L.successTransaction)||void 0===r?void 0:r.paymentMethod)&&e.createElement(e.Fragment,null,e.createElement("div",{className:s.InfoText},e.createElement("div",{className:s.CardLogoContainer},function(){var t,a;switch(null===(a=null===(t=L.successTransaction)||void 0===t?void 0:t.paymentMethodDetail)||void 0===a?void 0:a.cardAssociation){case g.AMERICAN_EXPRESS:return e.createElement(c,null);case g.MASTER_CARD:return e.createElement(n,null);case g.TROY:return e.createElement(d,null);case g.VISA:return e.createElement(l,null);default:return e.createElement("div",null)}}()),e.createElement("span",null,"**** ".concat((null==P?void 0:P.lastFourDigits)||""))),(null===(i=null==P?void 0:P.installment)||void 0===i?void 0:i.installmentCount)&&P.installment.installmentCount>1&&e.createElement(e.Fragment,null,e.createElement("div",{className:s.InfoText},"".concat(P.installment.installmentCount," ").concat(C("checkout-page:installments"))),null!==P.installment.installmentPrice&&e.createElement("div",{className:s.InfoText},"".concat(P.installment.installmentCount," x ").concat(m(P.installment.installmentPrice,L.checkout.currencyCode,L.checkout.currencySymbol)))))),e.createElement("div",null,e.createElement("div",{className:s.InfoTitle},C("checkout-page:billingAddress")),!!(null===(u=L.checkout.billingAddress)||void 0===u?void 0:u.company)&&e.createElement("div",{className:[s.InfoText,s.InfoTextBold].join(" ")},L.checkout.billingAddress.company),e.createElement("div",{className:s.InfoText},null===(v=L.checkout.billingAddress)||void 0===v?void 0:v.addressText)))}),[]),w=e.useMemo((function(){var t,a,o,r,i;return e.createElement("div",{className:[s.InfoGrid].join(" ")},e.createElement("div",null,e.createElement("div",{className:s.InfoTitle},C("checkout-page:contactInfo")),e.createElement("div",{className:s.InfoText},null===(t=L.checkout.customer)||void 0===t?void 0:t.email),e.createElement("div",{className:s.InfoText},R),!!(null===(a=L.checkout.shippingAddress)||void 0===a?void 0:a.phone)&&e.createElement("div",{className:s.InfoText},null===(o=L.checkout.shippingAddress)||void 0===o?void 0:o.phone)),e.createElement("div",null,"in-store"===L.deliveryMethod&&e.createElement(e.Fragment,null,e.createElement("div",{className:s.InfoTitle},C("checkout-page:receiver")),e.createElement("div",{className:[s.InfoText,s.withMBottom].join(" ")},D)),e.createElement("div",{className:s.InfoTitle},"address"===L.deliveryMethod?C("checkout-page:shippingAddress"):C("checkout-page:pickUpLocation")),!!(null===(r=L.checkout.shippingAddress)||void 0===r?void 0:r.company)&&e.createElement("div",{className:[s.InfoText,s.InfoTextBold].join(" ")},L.checkout.shippingAddress.company),e.createElement("div",{className:s.InfoText},null===(i=L.checkout.shippingAddress)||void 0===i?void 0:i.addressText)))}),[]);return e.createElement("div",{className:s.StepSuccess},e.createElement("div",{className:s.SuccessTitleContainer},e.createElement(r,{className:s.SuccessCircle}),e.createElement("span",{className:s.SuccessTitle},C("checkout-page:orderSuccessTitle"))),e.createElement("div",{className:s.SuccessSubTitle},C("address"===L.deliveryMethod?"checkout-page:orderSuccessDescription":"checkout-page:orderSuccessInStoreDeliveryDescription",{customerName:R})),e.createElement("div",{className:[s.InfoGrid,s.WithBorder].join(" ")},e.createElement("div",null,e.createElement("div",{className:s.InfoTitle},C("checkout-page:orderNoAndDate")),e.createElement("div",{className:[s.InfoText,s.InfoTextBold].join(" ")},"#"+(L.checkout.orderNumber||"")),e.createElement("div",{className:s.InfoText},L.checkout.dateStr),e.createElement(j,{vm:L})),e.createElement("div",null,e.createElement("div",{className:s.InfoTitle},C("checkout-page:contactInfo")),e.createElement("div",{className:s.InfoText},null===(A=L.checkout.customer)||void 0===A?void 0:A.email),e.createElement("div",{className:s.InfoText},R))),L.postCheckoutCampaignOffer&&e.createElement(f,{vm:L,campaignOffer:L.postCheckoutCampaignOffer}),L.hasQuickRegistration&&e.createElement(x,{vm:L}),e.createElement(i,{title:C("checkout-page:paymentSummary")},F),!L.isDigitalOnly&&e.createElement(i,{title:C("checkout-page:shippingSummary")},w),e.createElement("div",{className:s.Actions},e.createElement("div",{className:s.HelpText},e.createElement("span",null,C("checkout-page:helpCtaQuestion")),e.createElement("span",{className:s.Cta,onClick:function(){return L.setContactModalVisible(!0)}},C("checkout-page:helpCta"))),e.createElement(a,{text:C("checkout-page:actions.backToShopping"),onClick:L.onBackToShoppingClick,style:{flex:"0 0 auto"}})))})),j=t((function(t){var a,o=t.vm,r=u().t,i=s.Yellow;switch(o.checkout.orderPackageStatus){case v.FULFILLED:case v.PARTIALLY_FULFILLED:case v.DELIVERED:case v.PARTIALLY_DELIVERED:i=s.Green;break;case v.CANCELLED:case v.PARTIALLY_CANCELLED:case v.CANCEL_REJECTED:case v.CANCEL_REQUESTED:i=s.Red}return e.createElement("div",{className:[s.OrderStatus,i].join(" ")},o.checkout.orderPackageStatus?null===(a=[{types:[v.UNFULFILLED],text:r("checkout-page:orderPackageStatus.unfulfilled")},{types:[v.READY_FOR_SHIPMENT],text:r("checkout-page:orderPackageStatus.readyForShipment")},{types:[v.PARTIALLY_FULFILLED],text:r("checkout-page:orderPackageStatus.partiallyFulfilled")},{types:[v.FULFILLED],text:r("checkout-page:orderPackageStatus.fulfilled")},{types:[v.DELIVERED,v.PARTIALLY_DELIVERED],text:r("checkout-page:orderPackageStatus.delivered")},{types:[v.UNABLE_TO_DELIVER],text:r("checkout-page:orderPackageStatus.unableToDeliver")},{types:[v.CANCELLED,v.PARTIALLY_CANCELLED],text:r("checkout-page:orderPackageStatus.cancelled")},{types:[v.CANCEL_REJECTED],text:r("checkout-page:orderPackageStatus.cancelRejected")},{types:[v.REFUNDED,v.PARTIALLY_REFUNDED],text:r("checkout-page:orderPackageStatus.refunded")},{types:[v.REFUND_REQUEST_ACCEPTED],text:r("checkout-page:orderPackageStatus.refundRequestAccepted")},{types:[v.REFUND_REJECTED],text:r("checkout-page:orderPackageStatus.refundRejected")},{types:[v.REFUND_REQUESTED],text:r("checkout-page:orderPackageStatus.refundRequested")}].find((function(e){return e.types.includes(o.checkout.orderPackageStatus)})))||void 0===a?void 0:a.text:"")}));export{k as StepSuccess};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "4.9.0-beta.5",
3
+ "version": "4.9.0-beta.7",
4
4
  "description": "Storefront functionality for ikas storefront themes.",
5
5
  "author": "ikas",
6
6
  "license": "ISC",
@@ -17,11 +17,11 @@
17
17
  "build": "rm -rf build && rollup -c"
18
18
  },
19
19
  "devDependencies": {
20
- "@ikas/storefront-api": "^4.9.0-beta.5",
21
- "@ikas/storefront-config": "^4.9.0-beta.5",
22
- "@ikas/storefront-model-functions": "^4.9.0-beta.5",
23
- "@ikas/storefront-models": "^4.9.0-beta.5",
24
- "@ikas/storefront-providers": "^4.9.0-beta.5",
20
+ "@ikas/storefront-api": "^4.9.0-beta.7",
21
+ "@ikas/storefront-config": "^4.9.0-beta.7",
22
+ "@ikas/storefront-model-functions": "^4.9.0-beta.7",
23
+ "@ikas/storefront-models": "^4.9.0-beta.7",
24
+ "@ikas/storefront-providers": "^4.9.0-beta.7",
25
25
  "@ikas/localized-address": "^1.0.0-beta.3",
26
26
  "@adyen/adyen-web": "^5.28.2",
27
27
  "@rollup/plugin-commonjs": "^22.0.0",
@@ -55,11 +55,11 @@
55
55
  },
56
56
  "peerDependencies": {
57
57
  "@ikas/localized-address": "^1.0.0-beta.3",
58
- "@ikas/storefront-api": "^4.9.0-beta.5",
59
- "@ikas/storefront-config": "^4.9.0-beta.5",
60
- "@ikas/storefront-model-functions": "^4.9.0-beta.5",
61
- "@ikas/storefront-models": "^4.9.0-beta.5",
62
- "@ikas/storefront-providers": "^4.9.0-beta.5",
58
+ "@ikas/storefront-api": "^4.9.0-beta.7",
59
+ "@ikas/storefront-config": "^4.9.0-beta.7",
60
+ "@ikas/storefront-model-functions": "^4.9.0-beta.7",
61
+ "@ikas/storefront-models": "^4.9.0-beta.7",
62
+ "@ikas/storefront-providers": "^4.9.0-beta.7",
63
63
  "mobx": "^6.1.3",
64
64
  "mobx-react-lite": "^3.1.5",
65
65
  "next": "12.2.0",