@ikas/storefront 3.0.0-alpha.45 → 3.0.0-alpha.46
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/_virtual/index.js_commonjs-proxy13.js +1 -1
- package/build/_virtual/index.js_commonjs-proxy14.js +1 -1
- package/build/_virtual/index.js_commonjs-proxy3.js +1 -1
- package/build/_virtual/index.js_commonjs-proxy4.js +1 -1
- package/build/components/checkout/components/master-pass/credit-card-form/index.js +1 -0
- package/build/components/checkout/components/master-pass/credit-card-form/style.module.scss.js +1 -0
- package/build/components/checkout/components/master-pass/svg/master-pass-by-master-card.js +1 -0
- package/build/components/checkout/steps/step-payment/payment-gateways/index.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from'../ext/
|
|
1
|
+
import e from'../ext/safe-buffer/index.js';export{default}from"../node_modules/safe-buffer/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from'../ext/
|
|
1
|
+
import e from'../ext/inline-style-parser/index.js';export{default}from"../node_modules/inline-style-parser/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from'../ext/decode-uri-component/index.js';export{default}from"../node_modules/decode-uri-component/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from'../ext/split-on-first/index.js';export{default}from"../node_modules/split-on-first/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"react";import{observer as a}from"mobx-react-lite";import{IkasStorefrontConfig as t}from"../../../../../storefront/index.js";import'../../../../../ext/lodash/isArguments.js';import'../../../../../ext/lodash/isBuffer.js';import'../../../../../ext/lodash/isTypedArray.js';import'../../../../../ext/lodash/_baseGetTag.js';import{createTranslationInputData as o,useTranslation as s}from"../../../../../utils/i18n.js";import{Checkbox as r}from"../../checkbox/index.js";import{FormItem as n}from"../../form-item/index.js";import{FormItemType as m}from"../../form-item/model.js";import{Button as i}from"../../button/index.js";import c from"../svg/master-pass-by-master-card.js";import d from"../../../style.module.scss.js";import l from"./style.module.scss.js";var u=a((function(a){var u=a.vm,p=s().t,C=t.translations["checkout-page"],v=e.useMemo((function(){var e,a;return o(null===(a=null===(e=null==C?void 0:C.masterPass)||void 0===e?void 0:e.creditCardForm)||void 0===a?void 0:a.checkboxLabel)}),[C]),P=e.useMemo((function(){return e.createElement("div",{className:l.CheckboxLabel},v.map((function(a,t){return a.isVariable?e.createElement("span",{key:t,className:l.Logo},e.createElement(c,null)):e.createElement(e.Fragment,{key:t},a.value)})))}),[v]),h=u.mpVM.isSaveCardToMasterPassPhoneNumberInputDisabled?u.mpVM.saveCardToMasterPassPhoneNumberDisabledInputValue({withPlus:!0,store:u.store,checkout:u.checkout}):u.mpVM.saveCardToMasterPass.phoneNumber;return e.createElement("div",null,e.createElement(r,{label:P,value:u.mpVM.saveCardToMasterPass.isCheckboxChecked,onChange:u.mpVM.onSaveCardToMasterPassCheckedChange}),u.mpVM.saveCardToMasterPass.isCheckboxChecked&&e.createElement("div",{className:l.FormWrapper},e.createElement("div",{className:d.RowPB},e.createElement(n,{name:"masterPassCardName",type:m.TEXT,label:p("checkout-page:masterPass.creditCardForm.cardName"),value:u.mpVM.saveCardToMasterPass.cardName,onChange:u.mpVM.onSaveCardToMasterPassCardNameChange})),u.mpVM.isSaveCardToMasterPassPhoneNumberInputVisible&&e.createElement("div",{className:d.RowPB},e.createElement(n,{name:"masterPassPhoneNumber",type:m.TEL,disabled:u.mpVM.isSaveCardToMasterPassPhoneNumberInputDisabled,label:p("checkout-page:masterPass.creditCardForm.phoneNumber"),value:h,onChange:u.mpVM.onSaveCardToMasterPassPhoneNumberChange})),e.createElement(i,{style:{width:"100%"},text:p("checkout-page:masterPass.creditCardForm.button"),isDisabled:u.mpVM.isSendConfirmationButtonDisabled,isLoading:u.mpVM.saveCardToMasterPass.isSendConfirmationButtonPending,onClick:function(){if(!u.mpVM.saveCardToMasterPass.isSendConfirmationButtonPending&&(console.log("onSendConfirmationButtonClick 1"),u.checkout.selectedPaymentGateway&&(console.log("onSendConfirmationButtonClick 2"),u.cardData&&u.cardData.cardNumber&&u.cardData.expirationDate&&u.cardData.cvv&&(console.log("onSendConfirmationButtonClick 3"),u.mpVM.saveCardToMasterPass.cardName)))){console.log("onSendConfirmationButtonClick 4");var e=u.mpVM.isSaveCardToMasterPassPhoneNumberInputDisabled?u.mpVM.saveCardToMasterPassPhoneNumberDisabledInputValue({withPlus:!1,store:u.store,checkout:u.checkout}):u.mpVM.saveCardToMasterPass.phoneNumber.replace("+","");if(e){var a,t,o,s,r={creditCard:{rtaPan:u.cardData.cardNumber.replace(/ /g,""),expiryDate:(a=u.cardData.expirationDate,t=a.replace(" / ",""),o=t.substring(0,2),s=t.substring(2,4),"".concat(s).concat(o)),cvc:u.cardData.cvv,accountAliasName:u.mpVM.saveCardToMasterPass.cardName,phoneNumber:e},store:u.store,checkout:u.checkout,paymentGateway:u.checkout.selectedPaymentGateway,callback:function(){u.mpVM.saveCardToMasterPass.isSendConfirmationButtonPending=!1}};console.log("onSendConfirmationButtonClick 5",r),u.mpVM.saveCardToMasterPass.isSendConfirmationButtonPending=!0,u.mpVM.onSaveCardToMasterPassSendConfirmationButtonClick(r)}}}})))}));export{u as default};
|
package/build/components/checkout/components/master-pass/credit-card-form/style.module.scss.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from'../../../../../ext/style-inject/dist/style-inject.es.js';var o={FormWrapper:"style-module_FormWrapper__2ND8S",CheckboxLabel:"style-module_CheckboxLabel__1uzMC",Logo:"style-module_Logo__1x52P"};e(".style-module_FormWrapper__2ND8S {\n margin-top: 16px;\n}\n\n.style-module_CheckboxLabel__1uzMC {\n color: var(--checkout-primary-text-color);\n}\n.style-module_CheckboxLabel__1uzMC .style-module_Logo__1x52P {\n display: inline-block;\n vertical-align: middle;\n margin: 0 8px;\n}");export{o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import C from"react";var V=function(){return C.createElement("svg",{width:"89",height:"16",viewBox:"0 0 89 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M7.61913 15.6541C11.8271 15.6541 15.2383 12.2272 15.2383 8.00001C15.2383 3.77279 11.8271 0.345947 7.61913 0.345947C3.4112 0.345947 0 3.77279 0 8.00001C0 12.2272 3.4112 15.6541 7.61913 15.6541Z",fill:"#EB001B"}),C.createElement("path",{d:"M16.8222 15.6541C21.0302 15.6541 24.4414 12.2272 24.4414 8.00001C24.4414 3.77279 21.0302 0.345947 16.8222 0.345947C12.6143 0.345947 9.20312 3.77279 9.20312 8.00001C9.20312 12.2272 12.6143 15.6541 16.8222 15.6541Z",fill:"#F79E1B"}),C.createElement("path",{d:"M12.2189 1.88745C14.0534 3.28395 15.2346 5.49699 15.2346 7.98475C15.2346 10.4725 14.0534 12.6894 12.2189 14.0859C10.3844 12.6894 9.20312 10.4763 9.20312 7.98475C9.20312 5.49318 10.3882 3.28395 12.2189 1.88745Z",fill:"#FF5F00"}),C.createElement("path",{d:"M23.9646 13.0824V13.1472H23.8241V13.5134H23.7557V13.1472H23.6152V13.0824H23.9646ZM24.5 13.0824V13.5134H24.4316V13.1587L24.3063 13.4715H24.2304L24.1051 13.1625V13.5134H24.0367V13.0824H24.143L24.2683 13.3914L24.3937 13.0824H24.5Z",fill:"#F79E1B"}),C.createElement("path",{d:"M87.4696 8.25565V8.32052H87.3291V8.68681H87.2607V8.32052H87.1202V8.25565H87.4696ZM88.0014 8.25565V8.68681H87.933V8.33196L87.8077 8.64484H87.7355L87.6102 8.33578V8.68681H87.5418V8.25565H87.6482L87.7735 8.56471L87.8988 8.25565H88.0014ZM35.4157 3.41368C36.5818 3.41368 37.406 4.21876 37.406 5.37107V8.46169H36.3311V5.72592C36.3311 4.89794 35.9057 4.43625 35.1916 4.43625C34.5004 4.43625 33.923 4.89412 33.923 5.73737V8.46551H32.8482V5.72974C32.8482 4.90175 32.4228 4.44007 31.7087 4.44007C31.0174 4.44007 30.4401 4.89794 30.4401 5.74118V8.46932H29.3652V3.54722H30.4287V4.14627C30.8237 3.5663 31.4314 3.41749 31.9328 3.41749C32.681 3.41749 33.2887 3.74945 33.6268 4.29508C34.0522 3.58538 34.808 3.41368 35.4157 3.41368ZM43.6426 3.53959V8.46169H42.5753V7.87028C42.2372 8.30525 41.7321 8.58761 41.037 8.58761C39.6659 8.58761 38.5872 7.50398 38.5872 6.00064C38.5872 4.4973 39.6659 3.41368 41.037 3.41368C41.7321 3.41368 42.2372 3.69985 42.5753 4.13864V3.53959H43.6426ZM41.1623 4.42481C40.2432 4.42481 39.6849 5.13832 39.6849 6.00064C39.6849 6.86296 40.2432 7.57648 41.1623 7.57648C42.0473 7.57648 42.6398 6.8973 42.6398 6.00064C42.6398 5.10398 42.0473 4.42481 41.1623 4.42481ZM49.0208 3.93641L48.5612 4.77202C48.2649 4.58888 47.6572 4.35231 47.0495 4.35231C46.4684 4.35231 46.1228 4.58888 46.1228 4.93609C46.1228 5.2795 46.4798 5.3787 46.9318 5.44357L47.4369 5.51988C48.5042 5.6725 49.1385 6.13037 49.1385 6.97362C49.1385 7.91988 48.3219 8.57998 46.909 8.57998C46.4038 8.57998 45.5226 8.48077 44.8086 7.94659L45.3062 7.1415C45.6594 7.41241 46.1228 7.64516 46.9204 7.64516C47.6496 7.64516 48.0332 7.41241 48.0332 7.04611C48.0332 6.76757 47.7674 6.58443 47.1862 6.50048L46.6735 6.43562C45.591 6.28681 45.0137 5.78315 45.0137 4.99333C45.0137 4.01654 45.7923 3.41749 47.0381 3.41749C47.8053 3.41749 48.5156 3.60827 49.0208 3.93641ZM53.6431 3.53959V4.51638H51.7668V6.65692C51.7668 7.32083 52.1163 7.57648 52.5455 7.57648C52.8759 7.57648 53.2405 7.42767 53.533 7.24452L53.9584 8.10303C53.5634 8.37012 53.0696 8.59142 52.4543 8.59142C51.3452 8.59142 50.6958 7.99238 50.6958 6.67982V4.51638H49.7196V3.53959H50.6958V2.05151H51.7706V3.53959H53.6431ZM56.9399 3.41368C58.3111 3.41368 59.2492 4.46296 59.2568 5.99683C59.2568 6.13419 59.2454 6.27536 59.2378 6.39746H55.6182C55.7625 7.28268 56.3816 7.64897 57.0767 7.64897C57.5666 7.64897 58.0908 7.45438 58.4934 7.13005L59.0251 7.89699C58.4288 8.41209 57.7528 8.59142 57.0121 8.59142C55.546 8.59142 54.5053 7.56503 54.5053 6.00446C54.5015 4.45915 55.5004 3.41368 56.9399 3.41368ZM56.921 4.36757C56.1575 4.36757 55.7359 4.85978 55.622 5.58093H58.163C58.0452 4.814 57.6008 4.36757 56.921 4.36757ZM62.9676 3.41368C63.2943 3.41368 63.545 3.45565 63.7918 3.55104L63.5374 4.61559C63.3133 4.4973 62.9866 4.43625 62.7246 4.43625C62.0447 4.43625 61.5585 4.92083 61.5585 5.75645V8.46169H60.4912V3.53959H61.5509V4.09285C61.87 3.62735 62.3713 3.41368 62.9676 3.41368ZM67.3925 3.41368C68.7636 3.41368 69.8423 4.4973 69.8423 6.00064C69.8423 7.50398 68.7636 8.58761 67.3925 8.58761C66.6974 8.58761 66.1961 8.30525 65.8581 7.87409V10.5145H64.7908V3.53959H65.8581V4.12338C66.1961 3.69603 66.6974 3.41368 67.3925 3.41368ZM67.2634 4.42481C66.3784 4.42481 65.7859 5.10398 65.7859 6.00064C65.7859 6.8973 66.3784 7.57648 67.2634 7.57648C68.1825 7.57648 68.7409 6.86296 68.7409 6.00064C68.7409 5.13832 68.1825 4.42481 67.2634 4.42481ZM75.7751 3.53959V8.46169H74.7078V7.87028C74.3697 8.30525 73.8646 8.58761 73.1695 8.58761C71.7984 8.58761 70.7197 7.50398 70.7197 6.00064C70.7197 4.4973 71.7984 3.41368 73.1695 3.41368C73.8646 3.41368 74.3697 3.69985 74.7078 4.13864V3.53959H75.7751ZM73.2949 4.42481C72.3757 4.42481 71.8174 5.13832 71.8174 6.00064C71.8174 6.86296 72.3757 7.57648 73.2949 7.57648C74.1798 7.57648 74.7724 6.8973 74.7724 6.00064C74.7724 5.10398 74.1798 4.42481 73.2949 4.42481ZM81.1533 3.93641L80.6937 4.77202C80.3974 4.58888 79.7897 4.35231 79.182 4.35231C78.6009 4.35231 78.2553 4.58888 78.2553 4.93609C78.2553 5.2795 78.6123 5.3787 79.0643 5.44357L79.5694 5.51988C80.6367 5.6725 81.271 6.13037 81.271 6.97362C81.271 7.91988 80.4544 8.57998 79.0415 8.57998C78.5363 8.57998 77.6552 8.48077 76.9411 7.94659L77.4387 7.1415C77.7919 7.41241 78.2553 7.64516 79.0529 7.64516C79.7821 7.64516 80.1658 7.41241 80.1658 7.04611C80.1658 6.76757 79.8999 6.58443 79.3188 6.50048L78.806 6.43562C77.7235 6.28681 77.1462 5.78315 77.1462 4.99333C77.1462 4.01654 77.9248 3.41749 79.1706 3.41749C79.9379 3.41749 80.6481 3.60827 81.1533 3.93641ZM86.2314 3.93641L85.7719 4.77202C85.4756 4.58888 84.8679 4.35231 84.2602 4.35231C83.6791 4.35231 83.3334 4.58888 83.3334 4.93609C83.3334 5.2795 83.6905 5.3787 84.1424 5.44357L84.6476 5.51988C85.7149 5.6725 86.3492 6.13037 86.3492 6.97362C86.3492 7.91988 85.5326 8.57998 84.1196 8.57998C83.6145 8.57998 82.7333 8.48077 82.0193 7.94659L82.5168 7.1415C82.8701 7.41241 83.3334 7.64516 84.131 7.64516C84.8603 7.64516 85.2439 7.41241 85.2439 7.04611C85.2439 6.76757 84.978 6.58443 84.3969 6.50048L83.8842 6.43562C82.8017 6.28681 82.2244 5.78315 82.2244 4.99333C82.2244 4.01654 83.003 3.41749 84.2488 3.41749C85.016 3.41749 85.7263 3.60827 86.2314 3.93641ZM30.6604 11.1212C31.3061 11.1212 31.8113 11.6286 31.8113 12.3383C31.8113 13.048 31.3061 13.5555 30.6604 13.5555C30.3338 13.5555 30.0983 13.422 29.9388 13.2197V13.4944H29.4374V10.0185H29.9388V11.4569C30.0945 11.2547 30.3338 11.1212 30.6604 11.1212ZM30.5996 11.5981C30.1856 11.5981 29.9046 11.9186 29.9046 12.3383C29.9046 12.758 30.1818 13.0785 30.5996 13.0785C31.0326 13.0785 31.2947 12.7428 31.2947 12.3383C31.2947 11.9339 31.0326 11.5981 30.5996 11.5981ZM34.4852 11.1822L32.6658 14.4751H32.1075L32.9317 13.0213L31.9138 11.1822H32.4759L33.2166 12.51L33.9306 11.1822H34.4852ZM38.7657 11.1212C39.3126 11.1212 39.7001 11.4989 39.7001 12.0407V13.4944H39.1949V12.2086C39.1949 11.8194 38.9936 11.6019 38.6594 11.6019C38.3365 11.6019 38.063 11.8156 38.063 12.2124V13.4944H37.5579V12.2086C37.5579 11.8194 37.3604 11.6019 37.0223 11.6019C36.6995 11.6019 36.426 11.8156 36.426 12.2124V13.4944H35.9209V11.1822H36.4222V11.4646C36.6083 11.1898 36.8932 11.1212 37.1287 11.1212C37.4781 11.1212 37.7668 11.2776 37.9225 11.5332C38.1238 11.2051 38.4808 11.1212 38.7657 11.1212ZM42.5829 11.1822V13.4944H42.0815V13.2159C41.922 13.422 41.6865 13.5555 41.3599 13.5555C40.7142 13.5555 40.209 13.048 40.209 12.3383C40.209 11.6286 40.718 11.1212 41.3599 11.1212C41.6865 11.1212 41.9258 11.2547 42.0815 11.4607V11.1822H42.5829ZM41.4168 11.5981C40.9838 11.5981 40.7218 11.9339 40.7218 12.3383C40.7218 12.7428 40.9838 13.0785 41.4168 13.0785C41.8308 13.0785 42.1119 12.758 42.1119 12.3383C42.1119 11.9148 41.8346 11.5981 41.4168 11.5981ZM45.0631 11.3692L44.8466 11.7622C44.706 11.6744 44.4212 11.5638 44.1363 11.5638C43.8628 11.5638 43.6995 11.6744 43.6995 11.8385C43.6995 11.9987 43.8666 12.0445 44.0793 12.0789L44.3186 12.117C44.82 12.1895 45.12 12.4032 45.12 12.8C45.12 13.2426 44.7364 13.5555 44.0717 13.5555C43.8325 13.5555 43.4223 13.5097 43.0842 13.2579L43.3159 12.8801C43.483 13.0099 43.6995 13.1167 44.0755 13.1167C44.4174 13.1167 44.5997 13.0099 44.5997 12.8344C44.5997 12.7046 44.4744 12.6169 44.2009 12.5787L43.9616 12.5482C43.4526 12.4795 43.1792 12.2429 43.1792 11.869C43.1792 11.4111 43.5438 11.1288 44.1325 11.1288C44.4895 11.125 44.8238 11.2127 45.0631 11.3692ZM47.1862 11.1822V11.6401H46.3051V12.6474C46.3051 12.9603 46.4684 13.0785 46.6697 13.0785C46.8254 13.0785 46.9963 13.0099 47.1331 12.9221L47.3306 13.3266C47.1445 13.4525 46.9128 13.5555 46.6241 13.5555C46.1038 13.5555 45.7961 13.2731 45.7961 12.6588V11.6401H45.3365V11.1822H45.7961V10.484H46.3013V11.1822H47.1862ZM48.6865 11.1212C49.3322 11.1212 49.7728 11.6134 49.7766 12.3345C49.7766 12.3994 49.7728 12.4642 49.7652 12.5215H48.0636C48.132 12.9374 48.4207 13.1091 48.7473 13.1091C48.979 13.1091 49.2221 13.0175 49.412 12.8649L49.6627 13.2235C49.3816 13.4639 49.0625 13.5479 48.7169 13.5479C48.0256 13.5479 47.5395 13.0633 47.5395 12.3307C47.5433 11.6134 48.0105 11.1212 48.6865 11.1212ZM48.6789 11.5714C48.3219 11.5714 48.1206 11.8041 48.0674 12.1399H49.26C49.2069 11.7812 48.998 11.5714 48.6789 11.5714ZM51.4706 11.1212C51.6225 11.1212 51.7403 11.1402 51.858 11.186L51.7365 11.6859C51.6301 11.6286 51.4782 11.6019 51.3528 11.6019C51.0338 11.6019 50.8059 11.827 50.8059 12.2239V13.4944H50.3045V11.1822H50.8021V11.4417C50.954 11.2242 51.1895 11.1212 51.4706 11.1212ZM53.2291 11.1212C53.571 11.1212 53.8862 11.2471 54.0875 11.4913L53.7647 11.8347C53.6052 11.682 53.4342 11.5943 53.2101 11.5943C52.8227 11.5943 52.5303 11.8995 52.5303 12.3345C52.5303 12.7695 52.8227 13.0747 53.2101 13.0747C53.4304 13.0747 53.6279 12.9717 53.7761 12.8344L54.0875 13.1816C53.8786 13.4258 53.571 13.5517 53.2291 13.5517C52.4961 13.5517 52.0175 13.0289 52.0175 12.3345C52.0175 11.6439 52.4961 11.1212 53.2291 11.1212ZM56.7197 11.1822V13.4944H56.2183V13.2159C56.0588 13.422 55.8233 13.5555 55.4966 13.5555C54.851 13.5555 54.3458 13.048 54.3458 12.3383C54.3458 11.6286 54.851 11.1212 55.4966 11.1212C55.8233 11.1212 56.0626 11.2547 56.2183 11.4607V11.1822H56.7197ZM55.5574 11.5981C55.1244 11.5981 54.8623 11.9339 54.8623 12.3383C54.8623 12.7428 55.1244 13.0785 55.5574 13.0785C55.9714 13.0785 56.2525 12.758 56.2525 12.3383C56.2487 11.9148 55.9714 11.5981 55.5574 11.5981ZM58.5846 11.1212C58.7365 11.1212 58.8542 11.1402 58.972 11.186L58.8504 11.6859C58.7441 11.6286 58.5922 11.6019 58.4668 11.6019C58.1478 11.6019 57.9199 11.827 57.9199 12.2239V13.4944H57.4185V11.1822H57.9161V11.4417C58.0642 11.2242 58.2997 11.1212 58.5846 11.1212ZM60.3735 11.1212C60.7001 11.1212 60.9394 11.2547 61.0951 11.4607V10.0185H61.5965V13.4944H61.0951V13.2159C60.9356 13.422 60.7001 13.5555 60.3735 13.5555C59.7278 13.5555 59.2226 13.048 59.2226 12.3383C59.2226 11.6286 59.7316 11.1212 60.3735 11.1212ZM60.4343 11.5981C60.0013 11.5981 59.7392 11.9339 59.7392 12.3383C59.7392 12.7428 60.0013 13.0785 60.4343 13.0785C60.8483 13.0785 61.1293 12.758 61.1293 12.3383C61.1293 11.9148 60.8521 11.5981 60.4343 11.5981Z",fill:"black"}))};export{V as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{observer as t}from"mobx-react-lite";import"../../../../../models/data/payment-gateway/index.js";import{CreditCardForm as n}from"../../../components/credit-card-form/index.js";import{Installments as a}from"./installments/index.js";import o from"../../../components/select-box/index.js";import r from"./style.module.scss.js";import"../../../../../storefront/index.js";import'../../../../../ext/lodash/isArguments.js';import'../../../../../ext/lodash/isBuffer.js';import'../../../../../ext/lodash/isTypedArray.js';import'../../../../../ext/lodash/_baseGetTag.js';import{formatMoney as l}from"../../../../../utils/currency.js";import{useTranslation as m}from"../../../../../utils/i18n.js";import i from"../../../components/svg/external.js";import
|
|
1
|
+
import*as e from"react";import{observer as t}from"mobx-react-lite";import"../../../../../models/data/payment-gateway/index.js";import{CreditCardForm as n}from"../../../components/credit-card-form/index.js";import{Installments as a}from"./installments/index.js";import o from"../../../components/select-box/index.js";import r from"./style.module.scss.js";import"../../../../../storefront/index.js";import'../../../../../ext/lodash/isArguments.js';import'../../../../../ext/lodash/isBuffer.js';import'../../../../../ext/lodash/isTypedArray.js';import'../../../../../ext/lodash/_baseGetTag.js';import{formatMoney as l}from"../../../../../utils/currency.js";import{useTranslation as m}from"../../../../../utils/i18n.js";import i from"../../../components/svg/external.js";import s from"../../../components/master-pass/payment-gateway/svg/master-card.js";import{StripeForm as c}from"../../../components/stripe/index.js";import d from"../../../components/credit-card-form/model.js";import p from"../../../components/master-pass/credit-card-form/index.js";import{PaymentMethodEnum as u,PaymentGatewayTypeEnum as y,PaymentGatewayTransactionFeeTypeEnum as f,PaymentGatewayAdditionalPriceTypeEnum as E}from"../../../../../__api/types/index.js";var v=t((function(t){var v=t.vm,h=m().t,g=function(t){return e.createElement("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",flexWrap:"wrap"}},t.children)},I=function(t){return e.createElement("div",{className:r.AdditionalPrice},t.children)},C=function(e){var t;return"STRIPE"===e.code&&(null===(t=e.settings)||void 0===t?void 0:t.find((function(e){return"allow_custom_flow"===e.label&&"true"===e.value})))};return e.createElement(e.Fragment,null,!!v.mpVM.cards.length&&v.mpVM.cards.map((function(t,n){var l,m=v.paymentGateways.find((function(e){return e.id===t.paymentGatewayId})),i=e.createElement("button",{className:r.MasterPassSelectBoxDeleteButton,onClick:function(e){e.stopPropagation(),v.mpVM.deleteCard({store:v.store,checkout:v.checkout,card:t})}},h("checkout-page:masterPass.paymentGatewaySelectBox.delete")),c=e.createElement("div",{style:{display:"flex",alignItems:"center"}},e.createElement("span",{className:r.MasterPassSelectBoxLabelLogo},e.createElement(s,null)),t.Name," ",t.Value1),p=(null==m?void 0:m.id)&&m.paymentMethodType===u.CREDIT_CARD&&m.type===y.INTERNAL?v.installmentInfo&&e.createElement(a,{vm:v}):void 0;return e.createElement(o,{key:n,isSelected:(null===(l=v.mpVM.selectedCard)||void 0===l?void 0:l.UniqueId)===t.UniqueId,label:c,rightContent:i,bottomContent:p,onClick:function(){var e;(null===(e=v.mpVM.selectedCard)||void 0===e?void 0:e.UniqueId)!==t.UniqueId&&(v.checkout.selectedPaymentGateway=null,v.cardData=new d,v.installmentInfo=void 0,v.mpVM.selectedCard=t,t.Value1&&t.paymentGatewayId&&v.checkout.totalFinalPrice&&v.retrieveInstallmentInfo({input:{binNumber:t.Value1.slice(0,6),paymentGatewayId:t.paymentGatewayId,price:v.checkout.totalFinalPrice}}))}})})),v.paymentGateways.filter((function(e){return"in-store"!==v.deliveryMethod||e.paymentMethodType!==u.CASH_ON_DELIVERY&&e.paymentMethodType!==u.CREDIT_CARD_ON_DELIVERY})).map((function(t,m){var s,d,x=t.paymentMethodType===u.CREDIT_CARD&&t.type===y.INTERNAL?e.createElement(e.Fragment,null,C(t)?e.createElement(c,{vm:v,pg:t}):e.createElement("div",null,e.createElement(n,{vm:v}),v.isPaymentGatewayHasMasterPass&&e.createElement(p,{vm:v}),v.installmentInfo&&e.createElement(a,{vm:v}))):t.description?e.createElement(e.Fragment,null,t.type===y.EXTERNAL&&e.createElement("div",{style:{height:"52px",display:"flex",justifyContent:"center",margin:"24px 0"}},e.createElement(i,null)),e.createElement("div",{dangerouslySetInnerHTML:{__html:t.description}})):void 0;return e.createElement(o,{key:t.id,label:t.paymentMethodType===u.CREDIT_CARD&&t.type===y.INTERNAL?C(t)?" ":h("checkout-page:creditCard"):t.name,isSelected:v.selectedPaymentGatewayIndex===m,rightContent:(null===(s=t.additionalPrices)||void 0===s?void 0:s.length)?e.createElement(I,null,(d=t.additionalPrices[0],0===d.amount?"":"".concat(d.amountType===f.AMOUNT?l(d.amount,v.checkout.currencyCode):" %"+d.amount).concat(d.type===E.DECREMENT?" "+h("checkout-page:paymentMethodDiscount"):" "+h("checkout-page:paymentMethodAdditionalPrice")))):e.createElement(g,null,!!t.logoUrl&&e.createElement("div",{className:r.PaymentLogoContainer},e.createElement("img",{src:t.logoUrl}))),bottomContent:x,onClick:function(){v.selectedPaymentGatewayIndex!==m&&(v.setPaymentGateway(m),v.mpVM.selectedCard=void 0)}})})))}));export{v as PaymentGateways};
|