@ikas/storefront 5.0.0-beta.25 → 5.0.0-beta.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/analytics/analytics.js +1 -1
- package/build/analytics/head/index.js +1 -1
- package/build/analytics/ikas.js +1 -1
- package/build/components/checkout/components/address-form/index.js +1 -1
- package/build/components/checkout/components/address-form/model.js +1 -1
- package/build/components/checkout/components/adyen/adyen.module.scss.js +1 -1
- package/build/components/checkout/components/adyen/index.js +1 -1
- package/build/components/checkout/components/button/style.module.scss.js +1 -1
- package/build/components/checkout/components/cart-summary/cart-item/style.module.scss.js +1 -1
- package/build/components/checkout/components/cart-summary/index.js +1 -1
- package/build/components/checkout/components/cart-summary/style.module.scss.js +1 -1
- package/build/components/checkout/components/checkbox/style.module.scss.js +1 -1
- package/build/components/checkout/components/credit-card-form/style.module.scss.js +1 -1
- package/build/components/checkout/components/customer-addresses/model.js +1 -1
- package/build/components/checkout/components/customer-addresses/style.module.scss.js +1 -1
- package/build/components/checkout/components/delivery-methods/icon-button/style.module.scss.js +1 -1
- package/build/components/checkout/components/delivery-methods/style.module.scss.js +1 -1
- package/build/components/checkout/components/epaykolay-button/style.module.scss.js +1 -1
- package/build/components/checkout/components/error/stock-error/index.js +1 -1
- package/build/components/checkout/components/error/stock-error/style.module.scss.js +1 -1
- package/build/components/checkout/components/expandable-section/style.module.scss.js +1 -1
- package/build/components/checkout/components/form-item/style.module.scss.js +1 -1
- package/build/components/checkout/components/fullscreen-loading/style.module.scss.js +1 -1
- package/build/components/checkout/components/input-with-button/style.module.scss.js +1 -1
- package/build/components/checkout/components/master-pass/credit-card-form/style.module.scss.js +1 -1
- package/build/components/checkout/components/master-pass/link-card-to-client/style.module.scss.js +1 -1
- package/build/components/checkout/components/master-pass/modal/style.module.scss.js +1 -1
- package/build/components/checkout/components/master-pass/modal-otp/style.module.scss.js +1 -1
- package/build/components/checkout/components/master-pass/modal-response/style.module.scss.js +1 -1
- package/build/components/checkout/components/master-pass/modal-success/style.module.scss.js +1 -1
- package/build/components/checkout/components/modal/style.module.scss.js +1 -1
- package/build/components/checkout/components/notification-box/style.module.scss.js +1 -1
- package/build/components/checkout/components/offer-product/select/style.module.scss.js +1 -1
- package/build/components/checkout/components/offer-product/style.module.scss.js +1 -1
- package/build/components/checkout/components/paypal/index.js +1 -1
- package/build/components/checkout/components/paypal/style.module.scss.js +1 -1
- package/build/components/checkout/components/phone-number-input/get-countries.js +1 -1
- package/build/components/checkout/components/phone-number-input/index.js +1 -1
- package/build/components/checkout/components/phone-number-input/style.module.scss.js +1 -1
- package/build/components/checkout/components/quick-registration/model.js +1 -1
- package/build/components/checkout/components/quick-registration/style.module.scss.js +1 -1
- package/build/components/checkout/components/select-box/style.module.scss.js +1 -1
- package/build/components/checkout/components/step-container/style.module.scss.js +1 -1
- package/build/components/checkout/components/stripe/checkout-form.js +1 -1
- package/build/components/checkout/components/stripe/index.js +1 -1
- package/build/components/checkout/components/stripe/style.module.scss.js +1 -1
- package/build/components/checkout/components/toggle/style.module.scss.js +1 -1
- package/build/components/checkout/components/tooltip/style.module.scss.js +1 -1
- package/build/components/checkout/index.js +1 -1
- package/build/components/checkout/model.js +1 -1
- package/build/components/checkout/modelMasterPass.js +1 -1
- package/build/components/checkout/steps/step-payment/payment-gateways/installments/style.module.scss.js +1 -1
- package/build/components/checkout/steps/step-payment/payment-gateways/style.module.scss.js +1 -1
- package/build/components/checkout/steps/step-payment/style.module.scss.js +1 -1
- package/build/components/checkout/steps/step-shipping/style.module.scss.js +1 -1
- package/build/components/checkout/steps/step-success/style.module.scss.js +1 -1
- package/build/components/checkout/style.module.scss.js +1 -1
- package/build/components/checkout/styles/common.module.scss.js +1 -1
- package/build/components/google-captcha/index.js +1 -1
- package/build/components/image/index.js +1 -1
- package/build/components/link/index.js +1 -1
- package/build/components/page/ThemeComponent.js +1 -1
- package/build/components/page/head.js +1 -1
- package/build/components/page/index.js +1 -1
- package/build/components/page-editor/ThemeComponentEditor.js +1 -1
- package/build/components/page-editor/index.js +1 -1
- package/build/components/page-editor/loader/style.module.scss.js +1 -1
- package/build/components/page-editor/model.js +1 -1
- package/build/ext/style-inject/dist/style-inject.es.js +1 -0
- package/build/ext/tslib/tslib.es6.js +1 -0
- package/build/hooks/useCustomerReviews.js +1 -1
- package/build/model-helpers/order/line-item/option/value/functions.js +1 -1
- package/build/model-helpers/product/attribute-value/functions.js +1 -1
- package/build/model-helpers/product/functions.js +1 -1
- package/build/model-helpers/product/option-set/option/functions.js +1 -1
- package/build/model-helpers/product/variant/functions.js +1 -1
- package/build/models/data/localized-customer-address/functions.js +1 -1
- package/build/models/data/theme-json/custom-data/index.js +1 -1
- package/build/models/ui/blog-category-list/functions.js +1 -1
- package/build/models/ui/blog-list/functions.js +1 -1
- package/build/models/ui/brand-list/functions.js +1 -1
- package/build/models/ui/category-list/functions.js +1 -1
- package/build/models/ui/customer-review-list/functions.js +1 -1
- package/build/models/ui/customer-review-summary-list/functions.js +1 -1
- package/build/models/ui/product-list/functions.js +1 -1
- package/build/models/ui/raffle-list/functions.js +1 -1
- package/build/models/ui/validator/form/account-info.js +1 -1
- package/build/models/ui/validator/form/address.js +1 -1
- package/build/models/ui/validator/form/contact-form.js +1 -1
- package/build/models/ui/validator/form/customer-review.js +1 -1
- package/build/models/ui/validator/form/forgot-password.js +1 -1
- package/build/models/ui/validator/form/ikas-address.js +1 -1
- package/build/models/ui/validator/form/login.js +1 -1
- package/build/models/ui/validator/form/raffle-form.js +1 -1
- package/build/models/ui/validator/form/recover-password.js +1 -1
- package/build/models/ui/validator/form/register.js +1 -1
- package/build/models/ui/validator/index.js +1 -1
- package/build/models/ui/validator/rules/index.js +1 -1
- package/build/page-data-init/index.js +1 -1
- package/build/pages/404.js +1 -1
- package/build/pages/_slug_/index.js +1 -1
- package/build/pages/account/activate.js +1 -1
- package/build/pages/account/addresses.js +1 -1
- package/build/pages/account/favorite-products.js +1 -1
- package/build/pages/account/forgot-password.js +1 -1
- package/build/pages/account/index.js +1 -1
- package/build/pages/account/login.js +1 -1
- package/build/pages/account/orders/_id_.js +1 -1
- package/build/pages/account/orders/index.js +1 -1
- package/build/pages/account/raffles.js +1 -1
- package/build/pages/account/recover-password.js +1 -1
- package/build/pages/account/register.js +1 -1
- package/build/pages/blog/_slug_.js +1 -1
- package/build/pages/blog/index.js +1 -1
- package/build/pages/cart.js +1 -1
- package/build/pages/checkout.js +1 -1
- package/build/pages/editor.js +1 -1
- package/build/pages/home.js +1 -1
- package/build/pages/pages/_slug_.js +1 -1
- package/build/pages/raffle/_slug_.js +1 -1
- package/build/pages/raffle/index.js +1 -1
- package/build/pages/search.js +1 -1
- package/build/store/base/functions.js +1 -1
- package/build/store/cart/functions.js +1 -1
- package/build/store/customer/account-auth/functions.js +1 -1
- package/build/store/customer/captcha/functions.js +1 -1
- package/build/store/customer/functions.js +1 -1
- package/build/store/customer/marketing/functions.js +1 -1
- package/build/store/customer/order/functions.js +1 -1
- package/build/store/customer/product/functions.js +1 -1
- package/build/store/customer/raffle/functions.js +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as n,__spreadArray as e,__assign as r}from
|
|
1
|
+
import{__awaiter as t,__generator as n,__spreadArray as e,__assign as r}from'./../../ext/tslib/tslib.es6.js';import{useCartStore as i,IkasCartStore as o,IkasCartOperationValidationError as s}from"./index.js";import{IkasProductFunctions as u,IkasProductVariantFunctions as a,IkasProductOptionSetFunctions as c,IkasOrderFunctions as d}from"@ikas/storefront-model-functions";import{addItemToCart as l,saveCartCouponCode as v,SaveCartInput as p,saveCart as f,getCartById as h}from"@ikas/storefront-api";import{IkasStorefrontConfig as I}from"@ikas/storefront-config";import{addToCart as m,removeFromCart as S}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{IkasCustomerStore as g}from"../customer/index.js";var O="cartId";function b(){var t=i().cart;return null==t?void 0:t.id}function C(){var t=b();if(t)return"/checkout?id=".concat(t,"&step=info")}function L(e,r,i){var d;return void 0===i&&(i=1),t(this,void 0,void 0,(function(){var t,v,p,f,h,S,g,b,C,L,T;return n(this,(function(n){switch(n.label){case 0:t=u.hasValidProductOptionValues,v=a.hasVariantStock,p=c.initOptionValues,n.label=1;case 1:return n.trys.push([1,6,,7]),t(r)?v(e)||e.sellIfOutOfStock?[4,x()]:[2,{success:!1,validationError:s.INSUFFICIENT_STOCK}]:[2,{success:!1,validationError:s.INVALID_PRODUCT_OPTION_VALUES}];case 2:return n.sent(),(f=o.cart)&&(h=E(e,r))?(r.productOptionSet&&p(r.productOptionSet),[2,y(h,h.quantity+1)]):((null===(d=r.productOptionSet)||void 0===d?void 0:d.options.length)&&(r.productOptionSet.options=R(r)),S=N(r),g=(null==f?void 0:f.id)||localStorage.getItem(O),[4,l({input:{cartId:g,item:{id:null,quantity:i,variant:{id:e.id,name:r.name}},options:S.length?S:null,priceListId:I.getPriceListId()||null,salesChannelId:I.getSalesChannelId(),storefrontThemeId:I.getStorefrontThemeId()}})]);case 3:return(b=n.sent()).isSuccess&&b.data?[4,q(b.data)]:[3,5];case 4:n.sent(),n.label=5;case 5:return(f=o.cart)&&(C="".concat(f.id,"-").concat(f.updatedAt),(L=f.orderLineItems.find((function(t){return t.variant.id===e.id})))&&m(L,i,C,f)),r.productOptionSet&&p(r.productOptionSet),[2,{success:b.isSuccess,response:b}];case 6:return T=n.sent(),console.log(T),[2,{success:!1}];case 7:return[2]}}))}))}function y(e,r){return t(this,void 0,void 0,(function(){var t,i,s,u,a;return n(this,(function(n){switch(n.label){case 0:return n.trys.push([0,5,,6]),[4,x()];case 1:return n.sent(),t=o.cart,[4,l({input:{cartId:(null==t?void 0:t.id)||null,item:{id:e.id,quantity:r,variant:{id:e.variant.id,name:e.variant.name}},options:F(e),priceListId:I.getPriceListId()||null,salesChannelId:I.getSalesChannelId(),storefrontThemeId:I.getStorefrontThemeId()}})];case 2:return(i=n.sent()).isSuccess&&i.data?[4,q(i.data)]:[3,4];case 3:n.sent(),n.label=4;case 4:return _(),(t=o.cart)&&(s="".concat(t.id,"-").concat(t.updatedAt),(u=e.quantity)>r?S(e,u-r,t):m(e,r-u,s,t)),[2,{success:i.isSuccess,response:i}];case 5:return a=n.sent(),console.log(a),[2,{success:!1}];case 6:return[2]}}))}))}function T(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,y(e,0)];case 1:return[2,t.sent()]}}))}))}function k(){localStorage.removeItem(O),o.cart=null}function w(){return new Promise((function(t){var n=setInterval((function(){o.isCartLoadFinished&&(clearInterval(n),t(null))}),100)}))}function E(t,n){var e,r,i,s,u=o.cart;if(!n.productOptionSetId)return null==u?void 0:u.orderLineItems.find((function(n){return n.variant.id===t.id}));(null===(e=n.productOptionSet)||void 0===e?void 0:e.options.length)&&(n.productOptionSet.options=R(n));for(var a=N(n),c=(null==u?void 0:u.orderLineItems.filter((function(n){var e;return n.variant.id===t.id&&(null===(e=n.options)||void 0===e?void 0:e.length)===a.length})))||[],d=0,l=c;d<l.length;d++){var v=l[d];if(v.options){for(var p=!0,f=function(t){var e=t.values.map((function(t){return t.value})),o=null===(s=null===(i=null===(r=n.productOptionSet)||void 0===r?void 0:r.options)||void 0===i?void 0:i.find((function(n){return n.id===t.productOptionId})))||void 0===s?void 0:s.values;if(!(p=p&&e.length===(null==o?void 0:o.length)&&e.every((function(t){return null==o?void 0:o.includes(t)}))))return"break"},h=0,I=v.options;h<I.length;h++){if("break"===f(I[h]))break}if(p)return v}}}function P(e){return t(this,void 0,void 0,(function(){var t,r;return n(this,(function(n){switch(n.label){case 0:return(t=o.cart)?[4,v({cartId:t.id,couponCode:e})]:[2,{success:!1,validationError:s.EMPTY_CART}];case 1:return(r=n.sent()).isSuccess&&r.data&&(o.cart=r.data),[2,{success:r.isSuccess,response:r}]}}))}))}function j(){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,P(null)]}))}))}function V(e){return t(this,void 0,void 0,(function(){var t,r;return n(this,(function(n){switch(n.label){case 0:return t=new p(e),[4,f({input:t})];case 1:return[2,{success:(r=n.sent()).isSuccess,response:r}]}}))}))}function _(){o.cart&&0===d.getItemCount(o.cart)&&k()}function A(){var e,r;return t(this,void 0,void 0,(function(){var t,i,s,u;return n(this,(function(n){switch(n.label){case 0:if(!("undefined"!=typeof localStorage))return[2];n.label=1;case 1:return n.trys.push([1,6,7,8]),o.isLoadingCart=!0,t=null===(e=g.customer)||void 0===e?void 0:e.id,(i=(null===(r=o.cart)||void 0===r?void 0:r.id)||localStorage.getItem(O))||t?[4,h({id:i})]:[2];case 2:return(s=n.sent()).isSuccess&&s.data?[4,q(s.data)]:[3,4];case 3:return n.sent(),[3,5];case 4:k(),n.label=5;case 5:return[3,8];case 6:return u=n.sent(),console.log(u),[3,8];case 7:return o.isLoadingCart=!1,o.isCartLoadFinished=!0,[7];case 8:return[2]}}))}))}function q(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return localStorage.setItem(O,e.id),o.cart=e,[2]}))}))}function x(){return t(this,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return t=localStorage.getItem(O),!o.cart||t?[3,1]:(k(),[3,3]);case 1:return o.cart||!t?[3,3]:[4,A()];case 2:n.sent(),n.label=3;case 3:return[2]}}))}))}function F(t){if(t&&t.options){for(var n=[],e=0,r=t.options;e<r.length;e++){var i=r[e],o={productOptionId:i.productOptionId,productOptionsSetId:i.productOptionsSetId,values:i.values.map((function(t){return t.value}))};n.push(o)}return n}return null}function N(t){var n,e=[];return null===(n=t.productOptionSet)||void 0===n||n.options.forEach((function(t){t.values.length&&e.push({productOptionId:t.id,productOptionsSetId:t.productOptionSetId,values:t.values})})),e}function U(t){for(var n=[],e=0,r=t;e<r.length;e++){var i=r[e];n.push(i),n=n.concat(U(i.childOptions))}return n}function D(t){return t.reduce((function(t,n){return t[n.id]?t[n.id].values=e([],t[n.id].values,!0):t[n.id]=r({},n),t}),{})}function R(t){var n,e,r=[],i=(null===(n=t.productOptionSet)||void 0===n?void 0:n.options.length)?U(t.productOptionSet.options):[];return(null===(e=t.productOptionSet)||void 0===e?void 0:e.options.length)&&i.length&&(r=Object.values(D(i))),r}export{O as CART_LS_KEY,L as addItem,x as beforeCartOperationCheck,y as changeItemQuantity,U as checkOptionValues,F as createCartLineOptions,E as findExistingItem,A as getCart,b as getCheckoutId,C as getCheckoutUrl,N as getOptionValues,D as mergedProductOptions,_ as removeCardIfEmpty,k as removeCart,j as removeCouponCode,T as removeItem,V as saveCart,P as saveCouponCode,q as setCart,R as setNewProductOptionValues,w as waitForCartStoreInit};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as e,__assign as n}from
|
|
1
|
+
import{__awaiter as t,__generator as e,__assign as n}from'./../../../ext/tslib/tslib.es6.js';import{IkasStorefrontConfig as r}from"@ikas/storefront-config";import{IkasCustomerConsentData as o}from"../consent/data.js";import{customerLogout as s,completeRegistration as i,customerLogin as a}from"../../../analytics/analytics.js";import"../../../analytics/head/index.js";import{getCaptcha as c,clearCaptchaToken as u}from"../captcha/functions.js";import{IkasCustomerCaptchaData as d}from"../captcha/data.js";import{saveLocalLastViewedProducts as l}from"../product/functions.js";import{isServer as f}from"../../../utils/helper.js";import{IkasCustomerAuthData as m}from"./data.js";import{saveCustomer as v,SaveMyCustomerInput as h,socialLogin as p,login as k,IkasRegisterError as w,register as b,activateCustomer as S,resendCustomerActivationMail as g,checkEmail as T,forgotPassword as x,recoverPassword as y,refreshToken as E,listCustomerAttribute as j}from"@ikas/storefront-api";import{Config as I}from"@ikas/fe-api-client";import{setCustomer as A,useCustomerStore as C}from"../index.js";import{removeCart as N}from"../../cart/functions.js";var O="customerToken",U="customerTokenExpiry";function L(n){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,v({input:new h(n)})];case 1:return(t=e.sent()).isSuccess&&t.data?(A(t.data),[2,!0]):[2,!1]}}))}))}function P(n){return t(this,void 0,void 0,(function(){var t,o,s;return e(this,(function(e){switch(e.label){case 0:return"undefined"==typeof window?[2]:(t=new URLSearchParams(window.location.search).get("redirect")||"",o="".concat(process.env.NEXT_PUBLIC_BASE_URL,"/ms/").concat(n,"/login/authenticate?redirect=").concat(t),[4,fetch(o,{headers:{"x-api-key":r.getApiKey()||"","x-sfid":r.getStorefrontId()||"","x-sfrid":r.getStorefrontRoutingId()||""}})]);case 1:return[4,e.sent().json()];case 2:return s=e.sent(),window.location.href=s.redirectUrl,[2]}}))}))}function K(n){var r;return t(this,void 0,void 0,(function(){var t,o;return e(this,(function(e){switch(e.label){case 0:return t=C(),[4,p({code:n})];case 1:return(null==(o=e.sent())?void 0:o.isSuccess)&&(null===(r=o.data)||void 0===r?void 0:r.customer)?(F(o.data.token,o.data.tokenExpiry),A(o.data.customer),t.customer&&a(),[2,!0]):[2,!1]}}))}))}function R(n,r){return t(this,void 0,void 0,(function(){var t,o,s;return e(this,(function(e){switch(e.label){case 0:return[4,c()];case 1:return e.sent(),t=C(),[4,k({email:n,password:r,captchaToken:d.captchaToken})];case 2:return o=e.sent(),u(),o&&o.isSuccess&&o.data?(F((s=o.data).token,s.tokenExpiry),s.customer&&A(s.customer),t.customer&&a(),l(),[2,!0]):[2,!1]}}))}))}function _(){Q(),N(),s()}function B(r,s,a,f,m,v,h){var p;return t(this,void 0,void 0,(function(){var t,k;return e(this,(function(e){switch(e.label){case 0:return[4,c()];case 1:return e.sent(),t=C(),[4,b({email:a,password:f,firstName:r,lastName:s,isAcceptMarketing:m,attributes:v,captchaToken:d.captchaToken,phone:h})];case 2:return k=e.sent(),u(),k&&k.isSuccess&&(null===(p=k.data)||void 0===p?void 0:p.customer)?(F(k.data.token,k.data.tokenExpiry),A(k.data.customer),l(),i((S=t.customer,n(n({},S),{consentGranted:o.customerConsentGranted}))),[2,{isSuccess:!0,errorCodes:[]}]):[2,{isSuccess:!1,errorCodes:k.errorCodes.map((function(t){return Object.values(w).includes(t)?t:w.UNKOWN}))}]}var S}))}))}function G(){return t(this,void 0,void 0,(function(){var t,n,r;return e(this,(function(e){switch(e.label){case 0:return t=new URLSearchParams(window.location.search),(n=t.get("token"))?[4,c()]:[3,3];case 1:return e.sent(),[4,S({token:n,captchaToken:d.captchaToken})];case 2:return r=e.sent(),u(),[2,r.isSuccess];case 3:return[2,!1]}}))}))}function M(n){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return n?[4,c()]:[3,3];case 1:return e.sent(),[4,g({email:n,captchaToken:d.captchaToken})];case 2:return t=e.sent(),u(),[2,t.isSuccess];case 3:return[2,!1]}}))}))}function W(n){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,c()];case 1:return e.sent(),[4,T({email:n,captchaToken:d.captchaToken})];case 2:return t=e.sent(),u(),[2,!!t.isSuccess&&!!(null===(r=t.data)||void 0===r?void 0:r.exists)]}}))}))}function X(n){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,c()];case 1:return e.sent(),[4,x({email:n,captchaToken:d.captchaToken})];case 2:return t=e.sent(),u(),[2,t.isSuccess]}}))}))}function q(n,r,o){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,c()];case 1:return e.sent(),[4,y({password:n,passwordAgain:r,token:o,captchaToken:d.captchaToken})];case 2:return t=e.sent(),u(),[2,t.isSuccess]}}))}))}function z(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return m.token?[4,E({token:m.token})]:[2];case 1:return(t=e.sent()).isSuccess&&t.data?F(t.data.token,t.data.tokenExpiry):(m.token=null,m.tokenExpiry=null,Q()),[2]}}))}))}function D(){var n;return t(this,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return[4,j()];case 1:return t=e.sent(),(r=C()).customer&&(null===(n=r.customer.attributes)||void 0===n||n.forEach((function(e){var n,r,o;e.customerAttribute=(null===(n=t.data)||void 0===n?void 0:n.find((function(t){return t.id===e.customerAttributeId})))||null,e.customerAttributeOptionId&&(e.customerAttributeOption=(null===(o=null===(r=e.customerAttribute)||void 0===r?void 0:r.options)||void 0===o?void 0:o.find((function(t){return t.id===e.customerAttributeOptionId})))||null)}))),[2,t.data||[]]}}))}))}function F(t,e){f()||(m.token=t,m.tokenExpiry=e,localStorage.setItem(O,t),localStorage.setItem(U,e+""),r.init({customerToken:t}),I.TOKEN=t)}function H(){if(!f()){var t=localStorage.getItem(O),e=localStorage.getItem(U);t&&e?F(t,parseInt(e)):J()}}function J(){localStorage.removeItem(O),localStorage.removeItem(U),m.token=null,m.tokenExpiry=null}function Q(){J(),C().customer=void 0,r.init({customerToken:""}),I.TOKEN="",u()}export{U as LS_TOKEN_EXPIRY,O as LS_TOKEN_KEY,G as activateCustomer,W as checkEmail,Q as clearLocalData,J as clearLocalTokenData,X as forgotPassword,D as getCustomerAttributes,H as loadToken,R as login,_ as logout,q as recoverPassword,z as refreshToken,B as register,M as resendCustomerActivationMail,L as saveCustomer,F as setToken,P as socialLogin,K as socialLoginToken};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as e}from
|
|
1
|
+
import{__awaiter as t,__generator as e}from'./../../../ext/tslib/tslib.es6.js';import{IkasStorefrontConfig as n}from"@ikas/storefront-config";import{IkasCustomerCaptchaData as r}from"./data.js";function o(){var t;return(null===(t=n.getCustomerSettings())||void 0===t?void 0:t.requireCaptchaValidation)||!1}function a(){return new Promise((function(t){var e=setInterval((function(){r.captchaToken&&(clearInterval(e),t(null))}),100)}))}function c(){r.captchaToken=null}function i(t){r.captchaToken=t}function s(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),o()?(window.grecaptcha.execute(),[4,a()]):[3,2];case 1:e.sent(),window.grecaptcha.reset(),e.label=2;case 2:return[3,4];case 3:return t=e.sent(),console.log("Get captcha error",t),[3,4];case 4:return[2]}}))}))}export{c as clearCaptchaToken,s as getCaptcha,o as isCaptchaRequired,i as setCaptchaToken,a as waitUntilCaptchaTokenInitialized};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as n}from
|
|
1
|
+
import{__awaiter as t,__generator as n}from'./../../ext/tslib/tslib.es6.js';import{customerVisit as r}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{isServer as o}from"../../utils/helper.js";import{IkasCustomerAuthData as i}from"./account-auth/data.js";import{loadToken as e,refreshToken as s,clearLocalData as u}from"./account-auth/functions.js";import{loadLastViewedProducts as a}from"./product/functions.js";import{loadCustomerConsent as c}from"./consent/functions.js";import{getCustomer as m}from"@ikas/storefront-api";import{IkasCustomerStore as f,setCustomer as l}from"./index.js";function d(){return new Promise((function(t){var n=setInterval((function(){f.initialized&&(clearInterval(n),t(null))}),100)}))}function p(){return t(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return e(),a(),c(),[4,s()];case 1:return t.sent(),[4,j()];case 2:return t.sent(),f.initialized=!0,f.customer&&r(),[2]}}))}))}function h(){e(),!i.token&&f.customer&&u(),i.token&&!f.customer&&j()}function j(){return t(this,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return o()||!i.token?[2]:[4,m()];case 1:return(t=n.sent()).data&&l(t.data),[2]}}))}))}export{j as getCustomer,p as initCustomerStore,h as routeChangeInit,d as waitForCustomerStoreInit};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as r,__assign as s}from
|
|
1
|
+
import{__awaiter as t,__generator as r,__assign as s}from'./../../../ext/tslib/tslib.es6.js';import{sendContactFormToMerchant as i,subscribeToMarketingNotifications as o}from"@ikas/storefront-api";import{IkasCustomerFunctions as e}from"@ikas/storefront-model-functions";import{IkasCustomerStore as a}from"../index.js";import{contactForm as c,createEmailSubscripition as n}from"../../../analytics/analytics.js";import"../../../analytics/head/index.js";import{IkasCustomerEmailSubscriptionStatus as u}from"@ikas/storefront-models";import"@ikas/localized-address";import{isServer as m}from"../../../utils/helper.js";import{IkasCustomerCaptchaData as l}from"../captcha/data.js";import{clearCaptchaToken as p,getCaptcha as f}from"../captcha/functions.js";import{IkasCustomerMarketingData as d}from"./data.js";var h="customerEmailSubscription";function b(){var t=a,r=e.isCustomerSubscribedToEmails;return!(t.customer&&r(t.customer)||m()||d.visitorSubscribedEmail)&&!window.localStorage.getItem(h)}function S(o){return t(this,void 0,void 0,(function(){var t;return r(this,(function(r){switch(r.label){case 0:return c(o),[4,f()];case 1:return r.sent(),[4,i(s(s({},o),{captchaToken:l.captchaToken}))];case 2:return t=r.sent(),p(),[2,t.isSuccess]}}))}))}function v(s){return t(this,void 0,void 0,(function(){var t,i;return r(this,(function(r){switch(r.label){case 0:return[4,f()];case 1:return r.sent(),t=a,[4,o({input:{email:s,captchaToken:l.captchaToken}})];case 2:return(i=r.sent()).isSuccess&&(window.localStorage.setItem(h,"true"),t.customer?(t.customer.subscriptionStatus,u.SUBSCRIBED):d.visitorSubscribedEmail=!0,n(s)),[2,i.isSuccess]}}))}))}export{h as LS_CUSTOMER_SUB_KEY,b as canCreateEmailSubscription,v as createEmailSubscription,S as saveContactForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as e}from
|
|
1
|
+
import{__awaiter as t,__generator as e}from'./../../../ext/tslib/tslib.es6.js';import{getOrders as n,getOrderByEmail as r,listOrderTransactions as i,createOrderRefundRequest as u,listOrderRefundSettings as s}from"@ikas/storefront-api";import{IkasCustomerOrderData as a}from"./data.js";function o(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,n({})];case 1:return[2,t.sent().data||[]]}}))}))}function d(r){var i;return t(this,void 0,void 0,(function(){var t,u;return e(this,(function(e){switch(e.label){case 0:return[4,n({orderId:r})];case 1:return(t=e.sent()).isSuccess&&(null===(i=t.data)||void 0===i?void 0:i.length)?(u=t.data[0],[4,h()]):[2,null];case 2:return e.sent(),u.refundSettings=a.refundSettings,[2,u]}}))}))}function c(n,i){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,r({email:n,orderNumber:i})];case 1:return[2,t.sent().data||null]}}))}))}function l(n){return void 0===n&&(n={}),t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,i({checkoutId:{eq:n.checkoutId},id:{eq:n.checkoutId},orderId:{eq:n.orderId}})];case 1:return[2,t.sent().data||[]]}}))}))}function f(n){return t(this,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=[],n.orderLineItems.map((function(e){null!==e.refundQuantity&&(null==t||t.push({orderLineItemId:e.id,quantity:e.refundQuantity?e.refundQuantity:0}))})),[4,u({input:{orderId:n.id,orderLineItems:t}})];case 1:return(r=e.sent()).isSuccess&&r.data?(Object.entries(r.data).forEach((function(t){var e=t[0],r=t[1];n[e]=r})),[2,!0]):[3,3];case 2:return e.sent(),[3,3];case 3:return[2,!1]}}))}))}function h(){var n;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return a.refundSettings?[3,2]:[4,s({})];case 1:(t=e.sent()).isSuccess&&(null===(n=t.data)||void 0===n?void 0:n.length)&&(a.refundSettings=t.data[0]),e.label=2;case 2:return[2]}}))}))}export{d as getOrder,c as getOrderByEmail,h as getOrderRefundSettings,l as getOrderTransactions,o as getOrders,f as refundOrder};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as e,__assign as r}from
|
|
1
|
+
import{__awaiter as t,__generator as e,__assign as r}from'./../../../ext/tslib/tslib.es6.js';import{IkasStorefrontConfig as i}from"@ikas/storefront-config";import{addToWishlist as n}from"../../../analytics/analytics.js";import"../../../analytics/head/index.js";import{IkasCustomerProductData as o}from"./data.js";import{isServer as s}from"../../../utils/helper.js";import u from"lodash/xorBy";import d from"lodash/cloneDeep";import{IkasCustomerStore as a}from"../index.js";import{listFavoriteProducts as c,searchProducts as l,saveFavoriteProduct as v,isFavoriteProduct as f,createCustomerReview as h,saveLastViewedProducts as m,getLastViewedProducts as w}from"@ikas/storefront-api";var p="lastViewedProducts";function I(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return a.customer?[4,c()]:[2,[]];case 1:return[2,t.sent().data||[]]}}))}))}function V(){var r,n,o,s;return t(this,void 0,void 0,(function(){var t,u;return e(this,(function(e){switch(e.label){case 0:return a.customer?[4,c()]:[2,[]];case 1:return(t=e.sent()).isSuccess&&(null===(r=t.data)||void 0===r?void 0:r.length)?[4,l({input:{productIdList:t.data.map((function(t){return t.productId})),priceListId:i.getPriceListId(),salesChannelId:i.getSalesChannelId()}})]:[2,[]];case 2:return u=e.sent(),null===(o=null===(n=u.data)||void 0===n?void 0:n.data)||void 0===o||o.forEach((function(t){t.selectedVariantValues=t.variants[0].variantValues})),[2,(null===(s=null==u?void 0:u.data)||void 0===s?void 0:s.data)||[]]}}))}))}function P(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if(!(null===(i=a.customer)||void 0===i?void 0:i.id))throw Error("Unauthorized");return[4,v({isFavorite:!0,productId:r})];case 1:return t=e.sent(),n(r),[2,t.data||!1]}}))}))}function g(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if(!(null===(i=a.customer)||void 0===i?void 0:i.id))throw Error("Unauthorized");return[4,v({isFavorite:!1,productId:r})];case 1:return t=e.sent(),n(r),[2,t.data||!1]}}))}))}function b(r){var i;return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:if(!(null===(i=a.customer)||void 0===i?void 0:i.id))throw Error("Unauthorized");return[4,f({productId:r})];case 1:return[2,t.sent().data||!1]}}))}))}function L(n){var o;return t(this,void 0,void 0,(function(){var t,s,u,d;return e(this,(function(e){switch(e.label){case 0:if(t=i.getCustomerReviewSettings(),s=i.getSalesChannelId(),u=a,!t)return[2];if(!(d=null===(o=u.customer)||void 0===o?void 0:o.id)&&t.customerLoginRequired)throw Error("Unauthorized");return[4,h({input:r(r({},n),{customerId:t.customerLoginRequired?d:void 0,salesChannelId:s||""})})];case 1:return[2,e.sent().data]}}))}))}function S(){var t;return!!(null===(t=o.savedLastViewedProducts)||void 0===t?void 0:t.length)&&!!o.savedLastViewedProductsResponse&&0===u(o.lastViewedProducts,o.savedLastViewedProducts,"productId").length}function y(r,i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return(t=a).customer?o.lastViewedProducts.find((function(t){return t.productId===r}))?[2]:[4,m({input:{customerId:t.customer.id,products:[{productId:r,variantId:i}]}})]:[3,2];case 1:return e.sent()&&o.lastViewedProducts.push({productId:r,variantId:i}),[3,3];case 2:o.lastViewedProducts=R(),o.lastViewedProducts=o.lastViewedProducts.filter((function(t){return t.productId!==r})),o.lastViewedProducts.push({productId:r,variantId:i}),o.lastViewedProducts=o.lastViewedProducts.slice(-20),C(),e.label=3;case 3:return[2]}}))}))}function j(){var r;return t(this,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return(t=a).customer?[4,w({customerId:t.customer.id})]:[3,2];case 1:return i=e.sent(),o.lastViewedProducts=(null===(r=i.data)||void 0===r?void 0:r.reverse())||[],[3,3];case 2:E(),e.label=3;case 3:return[2,o.lastViewedProducts]}}))}))}function k(t){o.savedLastViewedProducts=d(o.lastViewedProducts),o.savedLastViewedProductsResponse=t}function C(){s()||window.localStorage.setItem(p,JSON.stringify(o.lastViewedProducts))}function E(){s()||(o.lastViewedProducts=R(),o.lastViewedProducts=d(o.lastViewedProducts).reverse())}function R(){if(s())return[];try{var t=window.localStorage.getItem(p);if(t)return JSON.parse(t)}catch(t){}return[]}function x(){s()||window.localStorage.removeItem(p)}function z(){return t(this,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:if(s())return[2];e.label=1;case 1:return e.trys.push([1,4,,5]),t=a,(r=R()).length?[4,m({input:{customerId:t.customer.id,products:r}})]:[3,3];case 2:e.sent()&&x(),e.label=3;case 3:return[3,5];case 4:return e.sent(),[3,5];case 5:return[2]}}))}))}function U(){return i.isBackInStockEnabled()}function q(){return i.isCustomerLoginRequiredForBackInStock()}export{p as LS_LAST_VIEWED_PRODUCTS_KEY,P as addProductToFavorites,V as getFavoriteProducts,I as getFavoriteProductsIds,j as getLastViewedProducts,R as getLocalLastViewedProducts,y as handleProductViewEvent,q as isBackInStockCustomerLoginRequired,U as isBackInStockEnabled,b as isProductFavorite,E as loadLastViewedProducts,x as removeLastViewedProducts,g as removeProductFromFavorites,C as saveLastViewedProducts,z as saveLocalLastViewedProducts,L as sendReview,k as setSavedLastViewedProductsResponse,S as shouldUseLastViewedProductResponse};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as r}from
|
|
1
|
+
import{__awaiter as t,__generator as r}from'./../../../ext/tslib/tslib.es6.js';import{listRaffleParticipants as e}from"@ikas/storefront-api";import{populateRaffleParticipantProducts as o}from"@ikas/storefront-providers";function s(){return t(this,void 0,void 0,(function(){var t;return r(this,(function(r){switch(r.label){case 0:return[4,e()];case 1:return(t=r.sent())&&t.data?[4,o(t.data)]:[3,3];case 2:r.sent(),r.label=3;case 3:return[2,t.data]}}))}))}export{s as getRaffles};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.26",
|
|
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
|
"dependencies": {
|
|
20
|
-
"@ikas/storefront-api": "^5.0.0-beta.
|
|
21
|
-
"@ikas/storefront-config": "^5.0.0-beta.
|
|
22
|
-
"@ikas/storefront-model-functions": "^5.0.0-beta.
|
|
23
|
-
"@ikas/storefront-models": "^5.0.0-beta.
|
|
24
|
-
"@ikas/storefront-providers": "^5.0.0-beta.
|
|
20
|
+
"@ikas/storefront-api": "^5.0.0-beta.26",
|
|
21
|
+
"@ikas/storefront-config": "^5.0.0-beta.26",
|
|
22
|
+
"@ikas/storefront-model-functions": "^5.0.0-beta.26",
|
|
23
|
+
"@ikas/storefront-models": "^5.0.0-beta.26",
|
|
24
|
+
"@ikas/storefront-providers": "^5.0.0-beta.26",
|
|
25
25
|
"@ikas/localized-address": "^1.0.0-beta.2",
|
|
26
26
|
"@ikas/fe-api-client": "^1.0.20-beta.1",
|
|
27
27
|
"@adyen/adyen-web": "^5.28.2",
|