@solvimon/solvimon-web 0.1.0-alpha.1 → 0.1.0-alpha.3
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/README.md +5 -5
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-VMlVPI4O.js → BillingInformation.vue_vue_type_script_setup_true_lang-BD3CrJzj.js} +1 -1
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-B42EzZ97.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-DQAp1xwu.mjs} +2 -2
- package/dist/{ContentWithAsideLayout-BC-C5Gjt.mjs → ContentWithAsideLayout-CRsFr9TH.mjs} +1 -1
- package/dist/{ContentWithAsideLayout-CIVSoqFr.js → ContentWithAsideLayout-DczcgSrt.js} +1 -1
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-t6E9_dWJ.js → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BE3I7Oe1.js} +1 -1
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-5yBnSRap.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-D0ie9Krt.mjs} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CknZKCmY.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DVDOsMnT.mjs} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-8UxAr2hU.js → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-sNdlKgdU.js} +1 -1
- package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BCdv5DbH.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DJEZEEwZ.mjs} +5 -5
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-Sn1Jq19s.js +1 -0
- package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-Bifo4jTH.js +1 -0
- package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-DWp42_G4.mjs +75 -0
- package/dist/{Skeleton.vue_vue_type_script_setup_true_lang-BFFJw-5h.mjs → Skeleton.vue_vue_type_script_setup_true_lang-C-taYlG4.mjs} +5 -4
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-C_BwMlBE.js +1 -0
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DfB5BqiH.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-Bp5RvQVS.mjs} +5 -5
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DqZLFDCv.js → SubscriptionsList.vue_vue_type_script_setup_true_lang-yyhwzYSM.js} +1 -1
- package/dist/auto-DzZuCneB.mjs +14387 -0
- package/dist/auto-PpnAChnH.js +6 -0
- package/dist/{cloneDeep-Hs8Pp07F.js → cloneDeep-DranHQkY.js} +1 -1
- package/dist/{component-BkmcE85U.mjs → component-DEo_ndpK.mjs} +92 -78
- package/dist/component-XHQYFLA_.js +1 -0
- package/dist/components/BillingInformation/BillingInformation.ce.d.ts +1 -1
- package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -1
- package/dist/components/BillingInformation/BillingInformation.es.js +96 -5
- package/dist/components/BillingInformationForm/BillingInformationForm.ce.d.ts +1 -1
- package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -1
- package/dist/components/BillingInformationForm/BillingInformationForm.es.js +582 -5
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.ce.d.ts +1 -1
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -1
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +132 -5
- package/dist/components/Invoice/Invoice.ce.d.ts +1 -1
- package/dist/components/Invoice/Invoice.cjs.js +1 -1
- package/dist/components/Invoice/Invoice.es.js +580 -5
- package/dist/components/InvoiceDetails/InvoiceDetails.ce.d.ts +1 -1
- package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
- package/dist/components/InvoiceDetails/InvoiceDetails.es.js +127 -5
- package/dist/components/InvoicesList/InvoicesList.ce.d.ts +1 -1
- package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -1
- package/dist/components/InvoicesList/InvoicesList.es.js +102 -5
- package/dist/components/PaymentHistory/PaymentHistory.ce.d.ts +1 -1
- package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -1
- package/dist/components/PaymentHistory/PaymentHistory.es.js +131 -5
- package/dist/components/PaymentMethodForm/PaymentMethodForm.ce.d.ts +1 -1
- package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -1
- package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +236 -5
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.ce.d.ts +1 -1
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +150 -5
- package/dist/components/SubscriptionsList/SubscriptionsList.ce.d.ts +1 -1
- package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -1
- package/dist/components/SubscriptionsList/SubscriptionsList.es.js +132 -5
- package/dist/components/WalletBalances/WalletBalances.ce.d.ts +3 -0
- package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -0
- package/dist/{InvoiceDetails.entry.ce-Cnpz8CLJ.mjs → components/WalletBalances/WalletBalances.es.js} +41 -51
- package/dist/core/configuration.d.ts +2 -1
- package/dist/core/index.cjs.js +1 -1
- package/dist/core/index.es.js +1 -1
- package/dist/core/registry.d.ts +1 -1
- package/dist/core/types.d.ts +4 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +40 -34
- package/dist/invoices-BW1notiX.js +1 -0
- package/dist/{invoices-C31Wz1Bu.mjs → invoices-M5oYVch6.mjs} +1 -1
- package/dist/{paymentMethods-CzUqDlvc.js → paymentMethods-BX80t2zk.js} +1 -1
- package/dist/{paymentMethods-CrU4G_2Y.mjs → paymentMethods-CqKUfc3w.mjs} +1 -1
- package/dist/{payments-C3LPk9k9.js → payments-BHv4hCeJ.js} +1 -1
- package/dist/{payments-NtWI8KlU.mjs → payments-CosaPZwo.mjs} +1 -1
- package/dist/registry-BwKEYOf7.js +1 -0
- package/dist/registry-Cag1Jj7P.mjs +143 -0
- package/dist/screens/Checkout/Checkout.ce.d.ts +1 -1
- package/dist/screens/Checkout/Checkout.cjs.js +1 -1
- package/dist/screens/Checkout/Checkout.es.js +5140 -5
- package/dist/screens/CustomerOverview/CustomerOverview.ce.d.ts +1 -1
- package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
- package/dist/screens/CustomerOverview/CustomerOverview.es.js +134 -5
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.ce.d.ts +3 -0
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.cjs.js +1 -0
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.es.js +1012 -0
- package/dist/{subscriptions-3R7aMoky.mjs → subscriptions-Bs4DIE8f.mjs} +1 -1
- package/dist/{subscriptions-CqK7t-fF.js → subscriptions-CnxvsBXd.js} +1 -1
- package/dist/{useActionDispatchProvider-CBo_Hwu5.mjs → useActionDispatchProvider-CgRcOqv3.mjs} +1 -1
- package/dist/useActionDispatchProvider-Cru69mAl.js +1 -0
- package/dist/{useCustomer-Dp8sGHI0.js → useCustomer-B0NK96dA.js} +1 -1
- package/dist/{useCustomer-BRY0tuBH.mjs → useCustomer-DlcjY3fP.mjs} +2 -2
- package/dist/{useCustomerPaymentMethodOptions-Fe_dLxfv.mjs → useCustomerPaymentMethodOptions-BzEquyUV.mjs} +7 -6
- package/dist/{useCustomerPaymentMethodOptions-DYpMDnJR.js → useCustomerPaymentMethodOptions-C-8BLzqb.js} +1 -1
- package/dist/{useIncrementalLoading-fHCizCSo.mjs → useIncrementalLoading-C7ToTmZK.mjs} +9 -7
- package/dist/useIncrementalLoading-D60Vttil.js +1 -0
- package/dist/{useInvoiceData-dyvoDwFF.mjs → useInvoiceData-CcueV3We.mjs} +2 -2
- package/dist/{useInvoiceData-DImEH1ca.js → useInvoiceData-DstXfI7t.js} +1 -1
- package/dist/{useInvoicesList-rDvRzMqe.mjs → useInvoicesList-CXng3aUm.mjs} +4 -4
- package/dist/{useInvoicesList-BZQ9Y0qN.js → useInvoicesList-DmzjgMlW.js} +1 -1
- package/dist/{usePaymentMethods-Dbimodf0.js → usePaymentMethods-DCGVRXA4.js} +1 -1
- package/dist/{usePaymentMethods-Bq5fWl1Q.mjs → usePaymentMethods-Db-1R6rI.mjs} +2 -2
- package/dist/{useService-Dz13Nxbi.mjs → useService-B4qv5N2D.mjs} +14 -5
- package/dist/useService-D-CUtlp3.js +1 -0
- package/dist/useWalletBalanceItems-BZyiAhcV.js +1 -0
- package/dist/useWalletBalanceItems-CHkLaccm.mjs +105 -0
- package/package.json +16 -3
- package/dist/BillingInformation.entry.ce-1xVdsWlL.mjs +0 -99
- package/dist/BillingInformation.entry.ce-DkrfEvK_.js +0 -1
- package/dist/BillingInformationForm.entry.ce-MPMirEsk.js +0 -1
- package/dist/BillingInformationForm.entry.ce-xfT0Jqps.mjs +0 -579
- package/dist/Checkout.entry.ce-Bif6vR1K.mjs +0 -5185
- package/dist/Checkout.entry.ce-CkQnLAn4.js +0 -1
- package/dist/CustomerOverview.entry.ce-C__omsVl.js +0 -1
- package/dist/CustomerOverview.entry.ce-Ce_Yk8-i.mjs +0 -231
- package/dist/CustomerPaymentMethods.entry.ce-CZwy8Aqq.mjs +0 -135
- package/dist/CustomerPaymentMethods.entry.ce-DnjlRHPA.js +0 -1
- package/dist/Invoice.entry.ce-CdJ9TPZe.mjs +0 -583
- package/dist/Invoice.entry.ce-Cgr43ome.js +0 -1
- package/dist/InvoiceDetails.entry.ce-jHDyWra2.js +0 -1
- package/dist/InvoicesList.entry.ce-38iOW5qh.js +0 -1
- package/dist/InvoicesList.entry.ce-BBaHEtAD.mjs +0 -105
- package/dist/PaymentHistory.entry.ce-DDeHMhK_.js +0 -1
- package/dist/PaymentHistory.entry.ce-Dw2NiP4l.mjs +0 -134
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-xJ8kJbRo.js +0 -1
- package/dist/PaymentMethodForm.entry.ce-f4cFExKc.mjs +0 -238
- package/dist/PaymentMethodForm.entry.ce-zxeBXZW6.js +0 -1
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-CQqTurIt.js +0 -1
- package/dist/SubscriptionSchedules.entry.ce-B4T_yQC1.js +0 -1
- package/dist/SubscriptionSchedules.entry.ce-B4vQ7QLk.mjs +0 -153
- package/dist/SubscriptionsList.entry.ce-B5SJCQW0.js +0 -1
- package/dist/SubscriptionsList.entry.ce-cNYuQZZj.mjs +0 -135
- package/dist/auto-B_36W1Fc.js +0 -6
- package/dist/auto-BfMZdgp-.mjs +0 -14207
- package/dist/component-Df5eNqYX.js +0 -1
- package/dist/invoices-8M_3ur_U.js +0 -1
- package/dist/registry-By94DXE2.js +0 -1
- package/dist/registry-shRKDl3K.mjs +0 -127
- package/dist/useActionDispatchProvider-DsIljrhi.js +0 -1
- package/dist/useIncrementalLoading-D8oKNxX7.js +0 -1
- package/dist/useService-bNNi4GB8.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("vue"),t=require("./component-Df5eNqYX.js"),i=require("./subscriptions-CqK7t-fF.js"),n=require("./_Uint8Array-DxISR7XF.js"),o=require("./PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-xJ8kJbRo.js"),a=require("./invoices-8M_3ur_U.js"),r=require("./index-DRdBmZ2-.js"),l=require("./index-2jo9BSPM.js"),c=require("./cloneDeep-Hs8Pp07F.js"),u=require("./paymentMethods-CzUqDlvc.js"),d=require("./useService-bNNi4GB8.js"),s=require("./ContentWithAsideLayout-CIVSoqFr.js"),p=require("./index-CWSXne1Q.js"),m=require("./Skeleton.vue_vue_type_script_setup_true_lang-CQqTurIt.js"),g=require("./payments-C3LPk9k9.js");var f=n.Symbol?n.Symbol.prototype:void 0;f&&f.toString;var v=Object.prototype.hasOwnProperty;var y=0;function _(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function h(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?_(Object(i),!0).forEach(function(t){b(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):_(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function b(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function M(e){return"function"==typeof e}function N(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function I(e){return M(e.$validator)?h({},e):{$validator:e}}function k(e){return"object"==typeof e?e.$valid:e}function C(e){return e.$validator||e}const x=t=>{if(t=e.unref(t),Array.isArray(t))return!!t.length;if(null==t)return!1;if(!1===t)return!0;if(t instanceof Date)return!isNaN(t.getTime());if("object"==typeof t){for(let e in t)return!0;return!1}return!!String(t).length};function E(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return t=>(t=e.unref(t),!x(t)||i.every(e=>(e.lastIndex=0,e.test(t))))}var D=Object.freeze({__proto__:null,forEach:function(t){return{$validator(i){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];return e.unref(i).reduce((e,i,n)=>{const a=Object.entries(i).reduce((e,a)=>{let[r,l]=a;const c=t[r]||{},u=Object.entries(c).reduce((e,t)=>{let[a,c]=t;const u=C(c).call(this,l,i,n,...o),d=k(u);if(e.$data[a]=u,e.$data.$invalid=!d||!!e.$data.$invalid,e.$data.$error=e.$data.$invalid,!d){let t=c.$message||"";const i=c.$params||{};"function"==typeof t&&(t=t({$pending:!1,$invalid:!d,$params:i,$model:l,$response:u})),e.$errors.push({$property:r,$message:t,$params:i,$response:u,$model:l,$pending:!1,$validator:a})}return{$valid:e.$valid&&d,$data:e.$data,$errors:e.$errors}},{$valid:!0,$data:{},$errors:[]});return e.$data[r]=u.$data,e.$errors[r]=u.$errors,{$valid:e.$valid&&u.$valid,$data:e.$data,$errors:e.$errors}},{$valid:!0,$data:{},$errors:{}});return{$valid:e.$valid&&a.$valid,$data:e.$data.concat(a.$data),$errors:e.$errors.concat(a.$errors)}},{$valid:!0,$data:[],$errors:[]})},$message:e=>{let{$response:t}=e;return t?t.$errors.map(e=>Object.values(e).map(e=>e.map(e=>e.$message)).reduce((e,t)=>e.concat(t),[])):[]}}},len:t=>(t=e.unref(t),Array.isArray(t)?t.length:"object"==typeof t?Object.keys(t).length:String(t).length),normalizeValidatorObject:I,regex:E,req:x,unwrap:e.unref,unwrapNormalizedValidator:C,unwrapValidatorResponse:k,withAsync:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return h(h({},I(e)),{},{$async:!0,$watchTargets:t})},withMessage:function(t,i){if(!M(t)&&"string"!=typeof e.unref(t))throw new Error('[@vuelidate/validators]: First parameter to "withMessage" should be string or a function returning a string, provided '+typeof t);if(!N(i)&&!M(i))throw new Error("[@vuelidate/validators]: Validator must be a function or object with $validator parameter");const n=I(i);return n.$message=t,n},withParams:function(e,t){if(!N(e))throw new Error('[@vuelidate/validators]: First parameter to "withParams" should be an object, provided '+typeof e);if(!N(t)&&!M(t))throw new Error("[@vuelidate/validators]: Validator must be a function or object with $validator parameter");const i=I(t);return i.$params=h(h({},i.$params||{}),e),i}});E(/^[a-zA-Z]*$/),E(/^[a-zA-Z0-9]*$/),E(/^\d*(\.\d+)?$/);E(/^(?:[A-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i);E(/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i),E(/(^[0-9]*$)|(^-[0-9]+$)/),E(/^[-]?\d*(\.\d+)?$/);const A={AT:{regex:/^ATU\d{8}$/,prefix:"AT",example:"ATU12345678"},BE:{regex:/^BE0?\d{9}$/,prefix:"BE",example:"BE0123456789"},BG:{regex:/^BG\d{9,10}$/,prefix:"BG",example:"BG123456789"},HR:{regex:/^HR\d{11}$/,prefix:"HR",example:"HR12345678901"},CY:{regex:/^CY\d{8}[A-Z]$/,prefix:"CY",example:"CY12345678X"},CZ:{regex:/^CZ\d{8,10}$/,prefix:"CZ",example:"CZ12345678"},DE:{regex:/^DE\d{9}$/,prefix:"DE",example:"DE123456789"},DK:{regex:/^DK\d{8}$/,prefix:"DK",example:"DK12345678"},EE:{regex:/^EE\d{9}$/,prefix:"EE",example:"EE123456789"},GR:{regex:/^(EL|GR)\d{9}$/,prefix:"GR",example:"GR123456789"},ES:{regex:/^ES[A-Z0-9]\d{7}[A-Z0-9]$/,prefix:"ES",example:"ESX1234567X"},FI:{regex:/^FI\d{8}$/,prefix:"FI",example:"FI12345678"},FR:{regex:/^FR[0-9A-Z]{2}\d{9}$/,prefix:"FR",example:"FRXX123456789"},HU:{regex:/^HU\d{8}$/,prefix:"HU",example:"HU12345678"},IE:{regex:/^IE[0-9A-Z]{8,9}$/,prefix:"IE",example:"IE1234567A"},IS:{regex:/^IS\d{5}$/,prefix:"IS",example:"IS12345"},IT:{regex:/^IT\d{11}$/,prefix:"IT",example:"IT12345678901"},LT:{regex:/^LT(\d{9}|\d{12})$/,prefix:"LT",example:"LT123456789 or LT123456789012"},LU:{regex:/^LU\d{8}$/,prefix:"LU",example:"LU12345678"},LV:{regex:/^LV\d{11}$/,prefix:"LV",example:"LV12345678901"},ME:{regex:/^ME\d{9}$/,prefix:"ME",example:"ME123456789"},MT:{regex:/^MT\d{8}$/,prefix:"MT",example:"MT12345678"},NL:{regex:/^NL\d{9}B\d{2}$/,prefix:"NL",example:"NL123456789B01"},PL:{regex:/^PL\d{10}$/,prefix:"PL",example:"PL1234567890"},PT:{regex:/^PT\d{9}$/,prefix:"PT",example:"PT123456789"},RO:{regex:/^RO\d{2,10}$/,prefix:"RO",example:"RO1234567890"},RU:{regex:/^RU(\d{9}|\d{10}|\d{12})$/,prefix:"RU",example:"RU123456789 or RU1234567890 or RU123456789012"},SE:{regex:/^SE\d{10}01$/,prefix:"SE",example:"SE123456789001"},SI:{regex:/^SI\d{8}$/,prefix:"SI",example:"SI12345678"},SK:{regex:/^SK\d{10}$/,prefix:"SK",example:"SK1234567890"},CH:{regex:/^CHE\d{9}(MWST|TVA|IVA)?$/,prefix:"CHE",example:"CHE123456789MWST"},NO:{regex:/^NO\d{9}MVA$/,prefix:"NO",example:"NO123456789MVA"},GB:{regex:/^GB(\d{9}|\d{12}|GD\d{3}|HA\d{3})$/,prefix:"GB",example:"GB123456789"},XI:{regex:/^XI(\d{9}|\d{12})$/,prefix:"XI",example:"XI123456789"}},w=D.withMessage(({$model:i})=>{if(!i||"string"!=typeof i||""===i.trim())return"";const n=e.inject(t.I18N_INJECTION_KEY,null);if(!n)return"Invalid tax ID";const{formatMessage:o}=n,a=Object.values(A).find(e=>i.toUpperCase().startsWith(e.prefix.toUpperCase()));return a?o({defaultMessage:"Invalid tax ID format. Example: {example}",id:"form_validation.tax_id.invalid_format",description:"Error message when tax ID format is invalid but prefix matches"},{example:a.example}):o({defaultMessage:"Invalid tax ID",id:"taxId.invalid",description:"Error message when tax ID is invalid"})},e=>!e||"string"!=typeof e||""===e.trim()||Object.values(A).some(t=>t.regex.test(e))),P=e=>{if(null==e)return!1;const t=String(e);return/^\S+$/.test(t)};D.withMessage("Everything but whitespace",P);function B({pricingPlanScheduleInfos:e,type:t}){return e.find(e=>e.pricing_plan_schedule.type===t)}function V({enabledPricings:e,seatsValues:t,pricingPlanScheduleInfos:i,pricingCurrency:n,billingPeriod:o}){const a=B({pricingPlanScheduleInfos:i,type:"DEFAULT"});if(a&&(e||t))return[{pricing_plan_schedule_id:a.id,enabled_pricings:e,seats_values:null==t?void 0:t.map(({pricing_item_config_id:e,number:t})=>({pricing_item_config_id:e,number:t})),...n&&{pricing_currency:n},...o&&{billing_period:o}}]}D.withMessage("Everything but whitespace",e=>!D.req(e)||P(String(e)));const S={AD:"EUR",AE:"AED",AF:"AFN",AG:"XCD",AI:"XCD",AL:"ALL",AM:"AMD",AO:"AOA",AR:"ARS",AS:"USD",AT:"EUR",AU:"AUD",AW:"AWG",AX:"EUR",AZ:"AZN",BA:"BAM",BB:"BBD",BD:"BDT",BE:"EUR",BF:"XOF",BG:"BGN",BH:"BHD",BI:"BIF",BJ:"XOF",BL:"EUR",BM:"BMD",BN:"BND",BO:"BOB",BQ:"USD",BR:"BRL",BS:"BSD",BT:"BTN",BV:"NOK",BW:"BWP",BY:"BYN",BZ:"BZD",CA:"CAD",CC:"AUD",CD:"CDF",CF:"XAF",CG:"XAF",CH:"CHF",CI:"XOF",CK:"NZD",CL:"CLP",CM:"XAF",CN:"CNY",CO:"COP",CR:"CRC",CU:"CUP",CV:"CVE",CW:"ANG",CX:"AUD",CY:"EUR",CZ:"CZK",DE:"EUR",DJ:"DJF",DK:"DKK",DM:"XCD",DO:"DOP",DZ:"DZD",EC:"USD",EE:"EUR",EG:"EGP",EH:"MAD",ER:"ERN",ES:"EUR",ET:"ETB",FI:"EUR",FJ:"FJD",FK:"FKP",FM:"USD",FO:"DKK",FR:"EUR",GA:"XAF",GB:"GBP",GD:"XCD",GE:"GEL",GF:"EUR",GG:"GBP",GH:"GHS",GI:"GIP",GL:"DKK",GM:"GMD",GN:"GNF",GP:"EUR",GQ:"XAF",GR:"EUR",GS:"GBP",GT:"GTQ",GU:"USD",GW:"XOF",GY:"GYD",HK:"HKD",HM:"AUD",HN:"HNL",HR:"EUR",HT:"HTG",HU:"HUF",ID:"IDR",IE:"EUR",IL:"ILS",IM:"GBP",IN:"INR",IO:"USD",IQ:"IQD",IR:"IRR",IS:"ISK",IT:"EUR",JE:"GBP",JM:"JMD",JO:"JOD",JP:"JPY",KE:"KES",KG:"KGS",KH:"KHR",KI:"AUD",KM:"KMF",KN:"XCD",KP:"KPW",KR:"KRW",KW:"KWD",KY:"KYD",KZ:"KZT",LA:"LAK",LB:"LBP",LC:"XCD",LI:"CHF",LK:"LKR",LR:"LRD",LS:"LSL",LT:"EUR",LU:"EUR",LV:"EUR",LY:"LYD",MA:"MAD",MC:"EUR",MD:"MDL",ME:"EUR",MF:"EUR",MG:"MGA",MH:"USD",MK:"MKD",ML:"XOF",MM:"MMK",MN:"MNT",MO:"MOP",MP:"USD",MQ:"EUR",MR:"MRU",MS:"XCD",MT:"EUR",MU:"MUR",MV:"MVR",MW:"MWK",MX:"MXN",MY:"MYR",MZ:"MZN",NA:"NAD",NC:"XPF",NE:"XOF",NF:"AUD",NG:"NGN",NI:"NIO",NL:"EUR",NO:"NOK",NP:"NPR",NR:"AUD",NU:"NZD",NZ:"NZD",OM:"OMR",PA:"PAB",PE:"PEN",PF:"XPF",PG:"PGK",PH:"PHP",PK:"PKR",PL:"PLN",PM:"EUR",PN:"NZD",PR:"USD",PS:"ILS",PT:"EUR",PW:"USD",PY:"PYG",QA:"QAR",RE:"EUR",RO:"RON",RS:"RSD",RU:"RUB",RW:"RWF",SA:"SAR",SB:"SBD",SC:"SCR",SD:"SDG",SE:"SEK",SG:"SGD",SH:"SHP",SI:"EUR",SJ:"NOK",SK:"EUR",SL:"SLE",SM:"EUR",SN:"XOF",SO:"SOS",SR:"SRD",SS:"SSP",ST:"STN",SV:"USD",SX:"ANG",SY:"SYP",SZ:"SZL",TC:"USD",TD:"XAF",TF:"EUR",TG:"XOF",TH:"THB",TJ:"TJS",TK:"NZD",TL:"USD",TM:"TMT",TN:"TND",TO:"TOP",TR:"TRY",TT:"TTD",TV:"AUD",TW:"TWD",TZ:"TZS",UA:"UAH",UG:"UGX",US:"USD",UY:"UYU",UZ:"UZS",VA:"EUR",VC:"XCD",VE:"VES",VG:"USD",VI:"USD",VN:"VND",VU:"VUV",WF:"XPF",WS:"WST",YE:"YER",YT:"EUR",ZA:"ZAR",ZM:"ZMW",ZW:"ZWL"},T=({country:e,pricingCurrencySettings:t,fallbackCurrency:i})=>{const n=(e=>{if(e)return S[e]})(e),o=(null==t?void 0:t.pricing_currencies)??[];return n&&o.includes(n)?n:(null==t?void 0:t.default_pricing_currency)??i??n},L=["email","country"],j={US:["addressLine1","postalCode"],CA:["state"]};function z({initialState:i,onRequiredFieldChange:n}){const o=e.ref(O(i)),a=e.ref(O(i)),u=e.computed(()=>{return(e=o.value.country)&&j[e]?[...j[e],...L]:L;var e}),d=e=>u.value.includes(e),s=t.useValidation({email:{required:r.required,email:r.email},country:{required:r.required},state:{required:r.requiredIf(()=>d("state"))},addressLine1:{required:r.requiredIf(()=>d("addressLine1"))},postalCode:{required:r.requiredIf(()=>d("postalCode"))},companyLegalName:r.requiredIf("ORGANIZATION"===o.value.type),companyVatNumber:{taxId:w}},o),p=e=>{e||fetch("https://api.country.is/").then(e=>e.json()).then(({country:e})=>{o.value.country=e})};return e.onMounted(async()=>{await p(null==i?void 0:i.country)}),l.watchDebounced(()=>c.cloneDeep(o.value),(e,i)=>{const o=t.objectDiff({from:i,to:e}),a=Object.keys(o)[0];["type","companyVatNumber"].includes(a)?n(e):"seatsValues"!==a&&"enabledPricingIds"!==a?"email"!==a&&d(a)&&n(e):n(e)},{debounce:200}),{form:o,validation:s,getIsFieldRequired:d,updateInitialState:e=>{const t=O({...o.value,...e});o.value=t,a.value=c.cloneDeep(t)},initialState:a}}const O=(e={})=>({email:void 0,country:void 0,type:"INDIVIDUAL",companyLegalName:void 0,firstName:void 0,infix:void 0,lastName:void 0,addressLine1:void 0,addressLine2:void 0,postalCode:void 0,city:void 0,state:void 0,companyVatNumber:void 0,seatsValues:void 0,enabledPricingIds:void 0,...e});function $(e){return e.pricing_plan_schedule_infos.flatMap(e=>{var t;return(null==(t=e.pricing_plan_version.pricing_categories)?void 0:t.flatMap(e=>e.pricing_groups??[]))??[]})}function U(e){var t,i;return function(e){if(null==e)return!0;if(n.isArrayLike(e)&&(n.isArray(e)||"string"==typeof e||"function"==typeof e.splice||n.isBuffer(e)||n.isTypedArray(e)||n.isArguments(e)))return!e.length;var t=n.getTag(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(n.isPrototype(e))return!n.baseKeys(e).length;for(var i in e)if(v.call(e,i))return!1;return!0}(e.name)?null==(i=null==(t=e.products)?void 0:t[0])?void 0:i.name:e.name}function R(e,t=void 0){const i=t??[],n=$(e);for(const o of n)if(["EXACTLY_ONE","AT_LEAST_ONE"].includes(o.selection_constraint)){const e=o.pricings.map(e=>e.id);if(null==t?void 0:t.some(t=>e.includes(t)))continue;i.push(o.pricings[0].id)}return i}function F({initialCountry:r,initialEmail:c,subscriptionId:s,enabledPricingIds:p}){const m=e.ref(!1),g=e.ref(),{getSubscription:f}=i.createSubscriptionsService(),v=(()=>{const{getInvoicePreview:i}=a.createInvoicesService(),r=e.ref(),l=e.ref(),c=e.ref(),u=e.ref({}),d=e.ref(n.ApiStatus.Initial),s=e.ref({}),p=e.ref(),m=e=>`${e.type}:${e.value}`;return{loadInvoicePreview:async({subscription:e,subscriptionStartAt:a,checkoutForm:g,enabledPricingIds:f,promotionCode:v})=>{var y,_,h,b,M;const N={...g.addressLine1&&{line1:g.addressLine1},...g.addressLine2&&{line2:g.addressLine2},...g.city&&{city:g.city},...g.state&&{state:g.state},...g.country?{country:g.country||"NL"}:{country:"NL"},...g.postalCode&&{postal_code:g.postalCode}};d.value=n.ApiStatus.Loading;const I=B({pricingPlanScheduleInfos:e.pricing_plan_schedule_infos,type:"DEFAULT"}),k=null==(y=null==I?void 0:I.pricing_plan_version)?void 0:y.pricing_currency_settings,C=((null==(_=null==k?void 0:k.pricing_currencies)?void 0:_.length)??0)>1,x=(null==(b=null==(h=null==I?void 0:I.pricing_plan_version)?void 0:h.billing_period_settings)?void 0:b.billing_periods)??[],E=x.length>1,D=x.length>0?x.map(({period:e})=>e):e.billing_period?[e.billing_period]:[],A=T({country:g.country,pricingCurrencySettings:k,fallbackCurrency:e.billing_currency});if(!D.length)return void(d.value=n.ApiStatus.Done);const P=e.billing_period?m(e.billing_period):m(D[0]),S=D.map(async t=>{var n;const r=m(t),l=V({enabledPricings:null==f?void 0:f.map(e=>({pricing_id:e})),seatsValues:g.seatsValues,pricingPlanScheduleInfos:e.pricing_plan_schedule_infos,pricingCurrency:C?A:void 0,billingPeriod:E?t:void 0})??[];if(v){const t=null==(n=e.pricing_plan_schedule_infos.find(({pricing_plan_schedule:e})=>"DEFAULT"===e.type))?void 0:n.id;if(t){const e=l.find(({pricing_plan_schedule_id:e})=>e===t);e?e.promotion_codes=[v]:l.push({pricing_plan_schedule_id:t,promotion_codes:[v]})}}const c={pricingPlanSubscriptionId:e.id,startAt:a,customizations:l,customer:{type:g.type||"INDIVIDUAL",..."INDIVIDUAL"===g.type&&{individual:{residential_address:N}},..."ORGANIZATION"===g.type&&{organization:{legal_name:g.companyLegalName||"preview",registered_address:N,...g.companyVatNumber&&{tax_id:w.$validator(g.companyVatNumber,{},{})?g.companyVatNumber:void 0}}}}},u=s.value[r];return u&&o.lodashExports.isEqual(c,u)?{periodKey:r,response:void 0}:(s.value={...s.value,[r]:c},{periodKey:r,response:await i(c)})});try{const i={...u.value},n=await Promise.all(S),o=e.pricing_plan_schedule_infos.find(({pricing_plan_schedule:e})=>"TRIAL"===e.type),a=null==(M=e.pricing_plan_schedule_infos.find(({pricing_plan_schedule:e})=>"DEFAULT"===e.type))?void 0:M.id;n.forEach(({periodKey:e,response:n})=>{var c;if(!n)return;p.value=null==(c=n.invoice_infos.at(-1))?void 0:c.pricing_plan_schedule_id,o&&(l.value=n.first_invoice,o.start_at&&o.end_at&&(r.value=t.convertDateRangeToTimePeriod(new Date(o.start_at),new Date(o.end_at))));const u=n.invoice_infos.find(({pricing_plan_schedule_id:e})=>e===a),d=null==u?void 0:u.invoices[0];d&&(i[e]=d)}),u.value=i,c.value=i[P]}catch(L){throw d.value=n.ApiStatus.Failed,L}finally{d.value=n.ApiStatus.Done}},invoicePreview:c,invoicePreviewByBillingPeriod:u,trialInvoicePreview:l,trialPeriod:r,lastPreviewScheduleId:p,isPending:e.computed(()=>d.value===n.ApiStatus.Loading)}})(),y=e.computed(()=>g.value&&N.form.value.country&&k.value),{paymentMethodOptions:_,loadPaymentMethodOptions:h,isPending:b}=(()=>{const t=e.ref(),{getPaymentMethodOptions:i}=u.createPaymentMethodsService(),{data:n,execute:a,isPending:r}=d.useService({initialValue:[],service:i});return{loadPaymentMethodOptions:async({subscriptionId:e,country:i,amount:n})=>{const r={subscriptionId:e,country:i,amount:n};o.lodashExports.isEqual(r,t.value)||(t.value=r,await a(r))},paymentMethodOptions:n,isPending:r}})(),M=()=>{const e={subscription:g.value,checkoutForm:N.form.value,enabledPricingIds:p,promotionCode:N.form.value.promotionCode};return N.form.value.enabledPricingIds&&(e.enabledPricingIds=N.form.value.enabledPricingIds),v.loadInvoicePreview(e)},N=z({initialState:{country:r,email:c},onRequiredFieldChange:()=>{g.value&&M().catch(()=>{})}}),I=e.computed(()=>{var e,t,i,n,o,a,r,l,c;const u=N.form.value.firstName||N.form.value.infix||N.form.value.lastName?{...N.form.value.firstName?{first_name:N.form.value.firstName}:{},...N.form.value.infix?{infix:N.form.value.infix}:{},...N.form.value.lastName?{last_name:N.form.value.lastName}:{}}:{},d={...N.form.value.addressLine1&&{line1:N.form.value.addressLine1},...N.form.value.addressLine2&&{line2:N.form.value.addressLine2},...N.form.value.city&&{city:N.form.value.city},...N.form.value.postalCode&&{postal_code:N.form.value.postalCode},...N.form.value.state&&{state:N.form.value.state},country:N.form.value.country??""},p=B({pricingPlanScheduleInfos:(null==(e=g.value)?void 0:e.pricing_plan_schedule_infos)??[],type:"DEFAULT"}),m=null==(t=null==p?void 0:p.pricing_plan_version)?void 0:t.pricing_currency_settings,f=((null==(i=null==m?void 0:m.pricing_currencies)?void 0:i.length)??0)>1,v=((null==(o=null==(n=null==p?void 0:p.pricing_plan_version)?void 0:n.billing_period_settings)?void 0:o.billing_periods)??[]).length>1,y=V({enabledPricings:null==(a=N.form.value.enabledPricingIds)?void 0:a.map(e=>({pricing_id:e})),seatsValues:N.form.value.seatsValues,pricingPlanScheduleInfos:(null==(r=g.value)?void 0:r.pricing_plan_schedule_infos)??[],pricingCurrency:f?null==(l=g.value)?void 0:l.billing_currency:void 0,billingPeriod:v?null==(c=g.value)?void 0:c.billing_period:void 0}),_=N.form.value.promotionCode,h=_&&g.value?(()=>{var e,t,i;const n=y?[...y]:[],o=(null==(e=n[0])?void 0:e.pricing_plan_schedule_id)??(null==(i=B({pricingPlanScheduleInfos:(null==(t=g.value)?void 0:t.pricing_plan_schedule_infos)??[],type:"DEFAULT"}))?void 0:i.id);if(!o)return y;const a=n.find(({pricing_plan_schedule_id:e})=>e===o);if(a)a.promotion_codes=[_];else{const e=null==y?void 0:y[0];n.push({pricing_plan_schedule_id:o,...(null==e?void 0:e.enabled_pricings)&&{enabled_pricings:e.enabled_pricings},...(null==e?void 0:e.seats_values)&&{seats_values:e.seats_values},promotion_codes:[_]})}return n})():y;return{type:"INIT_PRICING_PLAN_SUBSCRIPTION",init_pricing_plan_subscription:{template_pricing_plan_subscription_id:s,...h&&{pricing_plan_schedule_customizations:h},customer_details:{email:N.form.value.email??"",type:N.form.value.type,..."INDIVIDUAL"===N.form.value.type?{individual:{residential_address:d,...u?{name:u}:{}}}:{organization:{registered_address:d,legal_name:N.form.value.companyLegalName??"",...N.form.value.companyVatNumber&&w.$validator(N.form.value.companyVatNumber,{},{})?{tax_id:N.form.value.companyVatNumber}:{}}}}}}}),k=e.computed(()=>{var e,t;return(null==(e=v.trialInvoicePreview.value)?void 0:e.invoice_amount_including_tax)??(null==(t=v.invoicePreview.value)?void 0:t.invoice_amount_including_tax)});return e.watch([()=>N.form.value.country,k],([e,t])=>{g.value&&e&&t&&h({subscriptionId:g.value.id,country:e,amount:t})}),e.onMounted(async()=>{await(async()=>{var e,t,i,n,o,a;const r=await f({id:s,expanded:!0}),l=B({pricingPlanScheduleInfos:r.pricing_plan_schedule_infos,type:"DEFAULT"}),c=null==(n=null==(i=null==(t=null==(e=null==l?void 0:l.pricing_plan_version)?void 0:e.billing_period_settings)?void 0:t.billing_periods)?void 0:i[0])?void 0:n.period;g.value={...r,billing_period:c??r.billing_period},N.updateInitialState({...N.form.value,enabledPricingIds:R(r,p),...(null==(o=null==l?void 0:l.pricing_plan_schedule)?void 0:o.seats_values)?{seatsValues:null==(a=null==l?void 0:l.pricing_plan_schedule)?void 0:a.seats_values.map(({pricing_item_config_id:e,number:t})=>({pricing_item_config_id:e,number:t}))}:{}})})();try{await M()}catch{}}),l.watchOnce(y,e=>{e&&h({subscriptionId:g.value.id,country:N.form.value.country,amount:k.value})}),{invoicePreview:v.invoicePreview,invoicePreviewByBillingPeriod:v.invoicePreviewByBillingPeriod,trialInvoicePreview:v.trialInvoicePreview,trialPeriod:v.trialPeriod,loadInvoicePreview:M,updateInvoicePreviewOnBillingInformationChange:async e=>{const t=e.promotionCode??N.form.value.promotionCode,i=e.enabledPricingIds??N.form.value.enabledPricingIds;return await v.loadInvoicePreview({subscription:g.value,checkoutForm:{...N.form.value,...e},enabledPricingIds:i,promotionCode:t}),{trialInvoicePreview:v.trialInvoicePreview.value,invoicePreview:v.invoicePreview.value}},lastPreviewScheduleId:v.lastPreviewScheduleId,paymentMethodOptions:_,isPaymentMethodsPending:b,isInvoicePreviewPending:v.isPending,subscription:g,checkoutForm:N,authorizationContext:I,isPaid:m,amount:k}}const G={class:"flex gap-1"},Y=e.defineComponent({__name:"Kpi",props:{icon:{type:null},kpi:{type:String}},setup:i=>(n,o)=>(e.openBlock(),e.createElementBlock("div",G,[e.createVNode(e.unref(t._sfc_main$4),{icon:i.icon,size:"xs"},null,8,["icon"]),e.createVNode(e.unref(t._sfc_main$2),{variant:"body-xs"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.kpi),1)]),_:1})]))}),K={class:"grid grid-cols-1 gap-1"},q={class:"grid grid-cols-1 gap-2"},H={key:0},Q={class:"mt-2 flex flex-col gap-3"},Z={class:"grid grid-cols-3 gap-2"},X={class:"flex grow flex-col"},W={key:0},J={class:"mt-4 grid grid-cols-1 gap-3"},ee=e.defineComponent({__name:"CheckoutForm",props:e.mergeModels({validation:{type:null},initialState:{type:Object},readOnlyEmail:{type:String},showCustomerInfoOnTop:{type:Boolean},isBillingInformationMandatory:{type:Boolean},getIsFieldRequired:{type:Function},readOnly:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:e.mergeModels(["submit"],["update:modelValue"]),setup(i){const n=i,o=e.ref(!1),a=e.useModel(i,"modelValue"),r=e.computed({get:()=>"ORGANIZATION"===a.value.type,set:e=>{a.value.type=e?"ORGANIZATION":"INDIVIDUAL"}}),l=e.computed(()=>"ORGANIZATION"===a.value.type),c=e.computed(()=>"US"!==a.value.country),{$t:u}=t.useIntl(),d=e=>n.getIsFieldRequired(e)?"":" "+u({defaultMessage:"(optional)",id:"checkout.optional_suffix.label",description:"The suffix for optional fields in the checkout form"}),s=e.computed(()=>a.value.country?t.getCountryNameByCode(a.value.country):void 0);return(n,p)=>(e.openBlock(),e.createElementBlock("form",{id:"checkout-form",onSubmit:p[12]||(p[12]=e.withModifiers(e=>n.$emit("submit",a.value),["prevent"]))},[e.createElementVNode("div",K,[e.createVNode(e.unref(t._sfc_main$1g),{title:e.unref(u)({defaultMessage:"Customer information",id:"checkout.contact_information_block.title",description:"The title of the contact information block in the checkout form"})},{default:e.withCtx(()=>[e.createElementVNode("div",q,[i.readOnly?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(t._sfc_main$2),{variant:"body",tag:"span",weight:"semibold","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.value.email),1)]),_:1}),e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm",tag:"span",shade:"lighter","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.value),1)]),_:1})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(t._sfc_main$2a),{modelValue:a.value.email,"onUpdate:modelValue":p[0]||(p[0]=e=>a.value.email=e),required:"",type:"email",name:"email",disabled:!!i.readOnlyEmail,label:e.unref(u)({defaultMessage:"Email address",id:"checkout.email_address.label",description:"The email address of the customer in the checkout form"}),placeholder:e.unref(u)({defaultMessage:"Email address...",id:"checkout.email_address.placeholder",description:"The email address of the customer in the checkout form"})+d("email"),error:i.validation.value.email.$errors},null,8,["modelValue","disabled","label","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$1$),{"single-model-value":a.value.country,"onUpdate:singleModelValue":p[3]||(p[3]=e=>a.value.country=e),required:"",name:"country",label:e.unref(u)({defaultMessage:"Billing country",id:"checkout.country.label",description:"The country of the customer in the checkout form"})+d("country"),error:i.validation.value.country.$errors},{"label-suffix":e.withCtx(()=>[o.value||i.isBillingInformationMandatory?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2H),{key:0,size:"xs",variant:"ghost","icon-prefix":"add",class:"py-0.5",onClick:p[1]||(p[1]=e=>o.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)({defaultMessage:"More billing details",description:"Label of the button in the checkout that lets you fill out all billing details",id:"checkout.billing_details.add_billing_details_button.label"})),1)]),_:1})),o.value&&!i.isBillingInformationMandatory?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2H),{key:1,size:"sm",variant:"ghost","icon-prefix":"close",class:"py-0.5",onClick:p[2]||(p[2]=e=>o.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)({defaultMessage:"Remove billing details",id:"checkout.billing_details.remove_billing_details_button.label",description:"Label of the button in the checkout that lets you remove the billing details"})),1)]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["single-model-value","label","error"])],64))]),e.createVNode(e.unref(t._sfc_main$2j),null,{default:e.withCtx(()=>[o.value||i.isBillingInformationMandatory?(e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("div",Q,[e.createVNode(e.unref(t._sfc_main$2a),{modelValue:a.value.addressLine1,"onUpdate:modelValue":p[4]||(p[4]=e=>a.value.addressLine1=e),name:"address_line_1",label:e.unref(u)({defaultMessage:"Billing address",id:"checkout.address.title",description:"Address line 1 of the customer address in the checkout form"}),placeholder:e.unref(u)({defaultMessage:"Address line 1...",id:"checkout.address.line1.placeholder",description:"Address line 1 of the customer address in the checkout form"})+d("addressLine1"),required:"",error:i.validation.value.addressLine1.$errors},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$2a),{modelValue:a.value.addressLine2,"onUpdate:modelValue":p[5]||(p[5]=e=>a.value.addressLine2=e),name:"address_line_2",placeholder:e.unref(u)({defaultMessage:"Address line 2...",id:"checkout.address.line2.placeholder",description:"Address line 2 of the customer address in the checkout form"})+d("addressLine2")},null,8,["modelValue","placeholder"]),e.createElementVNode("div",Z,[e.createVNode(e.unref(t._sfc_main$2a),{modelValue:a.value.postalCode,"onUpdate:modelValue":p[6]||(p[6]=e=>a.value.postalCode=e),name:"postal_code",placeholder:e.unref(u)({defaultMessage:"Postal code...",id:"checkout.address.portal_code.placeholder",description:"Postal code of the customer address in the checkout form"})+d("postalCode"),error:i.validation.value.addressLine1.$errors},null,8,["modelValue","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$2a),{modelValue:a.value.city,"onUpdate:modelValue":p[7]||(p[7]=e=>a.value.city=e),name:"city",placeholder:e.unref(u)({defaultMessage:"City...",id:"checkout.address.city.placeholder",description:"City of the customer address in the checkout form"})+d("city")},null,8,["modelValue","placeholder"]),e.createVNode(e.unref(t._sfc_main$2a),{modelValue:a.value.state,"onUpdate:modelValue":p[8]||(p[8]=e=>a.value.state=e),name:"state",placeholder:e.unref(u)({defaultMessage:"State...",id:"checkout.address.state.placeholder",description:"State of the customer address in the checkout form"})+d("state"),error:i.validation.value.state.$errors},null,8,["modelValue","placeholder","error"])])])])):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["title"]),i.readOnly?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:0},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$20),{modelValue:r.value,"onUpdate:modelValue":p[9]||(p[9]=e=>r.value=e),"no-spacing":"","label-position":"before",class:"!flex"},{"inline-label":e.withCtx(()=>[e.createElementVNode("div",X,[e.createVNode(e.unref(t._sfc_main$2),{tag:"span"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)({defaultMessage:"Company purchase",id:"checkout.company_purchase_toggle.title",description:"The title of the company purchase toggle in the checkout"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main$2),{tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)({defaultMessage:"I am purchasing on behalf of a company",id:"checkout.company_purchase_toggle.sub_title",description:"The subtitle of the company purchase toggle in the checkout"})),1)]),_:1})])]),_:1},8,["modelValue"]),e.createVNode(e.unref(t._sfc_main$2j),null,{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",W,[e.createElementVNode("div",J,[c.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2a),{key:0,modelValue:a.value.companyVatNumber,"onUpdate:modelValue":p[10]||(p[10]=e=>a.value.companyVatNumber=e),name:"vat_number",label:e.unref(u)({defaultMessage:"VAT number",id:"checkout.vat_number.label",description:"The label for the vat number in the checkout form"}),placeholder:e.unref(u)({defaultMessage:"VAT number...",id:"checkout.vat_number.placeholder",description:"The label for the vat number in the checkout form"}),error:i.validation.value.companyVatNumber.$errors},null,8,["modelValue","label","placeholder","error"])):e.createCommentVNode("",!0),e.createVNode(e.unref(t._sfc_main$2a),{modelValue:a.value.companyLegalName,"onUpdate:modelValue":p[11]||(p[11]=e=>a.value.companyLegalName=e),required:"",name:"legal_name",label:e.unref(u)({defaultMessage:"Legal entity name",id:"checkout.legal_name.label",description:"The legal name of the organization customer in the checkout form"}),placeholder:e.unref(u)({defaultMessage:"Legal entity name...",id:"checkout.legal_name.placeholder",description:"The legal name of the organization customer in the checkout form"})},null,8,["modelValue","label","placeholder"])])])):e.createCommentVNode("",!0)]),_:1})]),_:1}))])],32))}}),te={key:0,class:"flex items-center"},ie=["innerHTML"],ne=["innerHTML"],oe=e.defineComponent({__name:"CheckoutTitle",props:{trialPeriod:{type:Object},subscriptionName:{type:String},amount:{type:Object},billingPeriod:{type:Object},countryCode:{type:null},trialStartDate:{type:Date},subscriptionStartDate:{type:Date}},setup(i){const{$t:n}=t.useIntl();return(o,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",null,[e.createVNode(e.unref(t._sfc_main$2),{variant:"heading-1",class:"inline-block"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.trialStartDate?i.subscriptionName:e.unref(n)({defaultMessage:"Pay and subscribe",id:"checkout.page_title",description:"The title of the checkout page"}))+e.toDisplayString(" "),1),i.trialPeriod?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$15),{key:0,"trial-period":i.trialPeriod,size:"lg",class:"-translate-y-0.5"},null,8,["trial-period"])):e.createCommentVNode("",!0)]),_:1})]),e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm",shade:"lighter","no-spacing":""},{default:e.withCtx(()=>[i.countryCode?(e.openBlock(),e.createElementBlock("span",{key:1,innerHTML:i.trialStartDate?e.unref(n)({defaultMessage:"You will be billed <strong>{price}</strong> per {period_name}, starting {startDate, date, long}.",id:"checkout.trial_period_description",description:"The description of the trial period"},{price:e.unref(t.formatAmount)(i.amount),startDate:i.subscriptionStartDate,period_name:e.unref(t.formatBillingPeriod)(i.billingPeriod,{short:!0,hideValueForExactPeriods:!0}),strong:e=>`<strong>${e}</strong>`}):e.unref(n)({defaultMessage:"You will be billed <strong>{price}</strong> per {period_name}, starting today.",id:"checkout.subscription_description",description:"The description of the subscription"},{price:e.unref(t.formatAmount)(i.amount),period_name:e.unref(t.formatBillingPeriod)(i.billingPeriod,{short:!0,hideValueForExactPeriods:!0}),strong:e=>`<strong>${e}</strong>`})},null,8,ne)):(e.openBlock(),e.createElementBlock("span",te,[e.createVNode(e.unref(t._sfc_main$2e),{"is-dark-mode":""},{tooltip:e.withCtx(()=>[e.createVNode(e.unref(t.TooltipContent),null,{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$1s),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Will be determined by billing information",description:"Tooltip content for the invoice preview when taxes are not determined by billing information",id:"invoice_preview.taxes_not_determined_by_billing_information_tooltip"})),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$14),{"width-class":"w-10","height-class":"h-4",shade:"darker",class:"inline-block mr-1.5"})]),_:1}),e.createElementVNode("span",{innerHTML:i.trialStartDate?e.unref(n)({defaultMessage:"per {period_name} starting, {startDate, date, long}",id:"checkout.trial_period_description",description:"The description of the trial period"},{startDate:i.subscriptionStartDate,period_name:e.unref(t.formatBillingPeriod)(i.billingPeriod,{short:!0,hideValueForExactPeriods:!0})}):e.unref(n)({defaultMessage:"per {period_name}, starting today",id:"checkout.subscription_description",description:"The description of the subscription"},{period_name:e.unref(t.formatBillingPeriod)(i.billingPeriod,{short:!0,hideValueForExactPeriods:!0})})},null,8,ie)]))]),_:1})],64))}}),ae={class:"flex w-full min-h-96 justify-center items-center"},re={class:"max-w-sm"},le=e.defineComponent({__name:"CheckoutNotAvailable",setup(i){const{$t:n}=t.useIntl(),o=()=>{window.location.reload()};return(i,a)=>(e.openBlock(),e.createElementBlock("div",ae,[e.createElementVNode("div",re,[e.createVNode(e.unref(t._sfc_main$2),{variant:"heading-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Checkout not available",id:"checkout.not_available.title",description:"The title of the checkout not available page"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"The checkout is currently not available.",id:"checkout.not_available.description",description:"The description of the checkout not available page"}))+" ",1),e.createElementVNode("a",{href:"#",class:"text-primary-900 hover:underline",onClick:e.withModifiers(o,["prevent"])},e.toDisplayString(e.unref(n)({defaultMessage:"Reload",id:"checkout.not_available.reload_button",description:"The label of the reload button"})),1),e.createTextVNode(" "+e.toDisplayString(e.unref(n)({defaultMessage:"this page to try again, or contact customer support.",id:"checkout.not_available.contact_support_message",description:"The message shown when the user wants to contact customer support"})),1)]),_:1})])]))}}),ce=e.defineComponent({__name:"SubscriptionPaymentCompletedCard",props:{redirectUrl:{type:String}},setup(i){const n=i,{$t:a}=t.useIntl();return e.onMounted(()=>{n.redirectUrl&&window.location.replace(n.redirectUrl)}),(n,r)=>(e.openBlock(),e.createBlock(o._sfc_main$1,{status:"success",title:e.unref(a)({defaultMessage:"Payment successful",id:"subscription_payment_completed_card.title",description:"The title for when a payment has been successful"})},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$2),{variant:"body-xs",shade:"lighter",tag:"span"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Thank you for subscribing.",id:"subscription_payment_completed_card.thank_you_for_subscribing",description:"The text shown after a successful message before a redirect"})),1)]),_:1}),i.redirectUrl?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2H),{key:0,to:i.redirectUrl,color:"gray",variant:"outline",size:"xs",class:"align-center"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Continue to merchant",id:"subscription_payment_completed_card.continue",description:"The text for the continue button"})),1)]),_:1},8,["to"])):e.createCommentVNode("",!0)]),_:1},8,["title"]))}}),ue={class:"flex flex-row gap-3 px-3 py-2"},de={class:"grow"},se=e.defineComponent({__name:"SubscriptionSummary",props:{subscription:{type:Object},invoice:{type:Object},loading:{type:Boolean},enabledPricingIds:{type:Array},avatar:{type:String},trialPeriod:{type:Object}},setup(i){const n=i,{$t:o}=t.useIntl(),a=e.computed(()=>{var e,t;return null==(t=null==(e=n.subscription.pricing_plan_schedule_infos)?void 0:e.at(-1))?void 0:t.pricing_plan_version.pricing_plan}),r=e.computed(()=>{var e;return(null==(e=a.value)?void 0:e.name)||n.subscription.name||o({defaultMessage:"Subscription",description:"The fallback name for when no subscription name can be determined",id:"customer_overview.subscriptions_block.fallback_subscription_name"})}),l=e.computed(()=>{var e;return n.subscription.description||(null==(e=a.value)?void 0:e.description)}),c=e.computed(()=>{if(!n.subscription||!n.enabledPricingIds)return;const e=function(e,t){const i=[];return function e(n){Array.isArray(n)?n.forEach(e):n&&"object"==typeof n&&("PRICING"===n.object_type&&t.includes(n.id)&&i.push(n),Object.values(n).forEach(e))}(e),i}(n.subscription,n.enabledPricingIds);return null==e?void 0:e.map(e=>{var t,i;return e.name??(null==(i=null==(t=e.products)?void 0:t[0])?void 0:i.name)}).join(" - ")});return(n,o)=>(e.openBlock(),e.createElementBlock("div",ue,[i.avatar?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2K),{key:0,"image-src":i.avatar,size:"lg",class:"my-1"},null,8,["image-src"])):e.createCommentVNode("",!0),e.createElementVNode("div",de,[e.createVNode(e.unref(t._sfc_main$2),{variant:"body",weight:"semibold","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1}),c.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2),{key:0,variant:"body-xs",shade:"lighter","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1})):e.createCommentVNode("",!0),l.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2),{key:1,variant:"body-xs",shade:"lighter","no-spacing":""},{default:e.withCtx(()=>[c.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(" • ")],64)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0)])]))}}),pe={class:"flex items-start"},me={class:"flex flex-col grow"},ge={class:"flex items-center gap-1"},fe={class:"flex items-center ml-4 self-center"},ve=e.defineComponent({__name:"PricingGroupContent",props:{name:{type:String},description:{type:String}},setup:i=>(n,o)=>(e.openBlock(),e.createElementBlock("div",pe,[e.createElementVNode("div",me,[e.createElementVNode("div",ge,[e.createVNode(e.unref(t._sfc_main$2),{tag:"span",variant:"body-sm",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.name),1)]),_:1}),e.renderSlot(n.$slots,"badge")]),e.createVNode(e.unref(t._sfc_main$2),{tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.description),1)]),_:1})]),e.createElementVNode("div",fe,[e.renderSlot(n.$slots,"default")])]))}),ye={class:"grid grid-cols-1 gap-1"},_e={class:"px-3 py-2"},he={class:"flex flex-col gap-3"},be={class:"px-3 py-2"},Me=e.defineComponent({__name:"OrderSummary",props:{subscription:{type:Object},invoice:{type:Object},invoicePreviewByBillingPeriod:{type:Object},trialInvoice:{type:Object},enabledPricingIds:{type:Array},trialPeriod:{type:Object},avatar:{type:String},isPaid:{type:Boolean},isUsageBased:{type:Boolean},isPreviewAndPaymentMethodsPending:{type:Boolean},collapsible:{type:String},noTitle:{type:Boolean},countryCode:{type:null},variant:{type:String}},emits:["billing-period-change"],setup(i,{emit:n}){const o=i,a=n,{$t:r}=t.useIntl(),{map:l,formatTimePeriod:c}=t.useTimePeriod(),u=p.useBreakpoints(p.breakpointsTailwind).smaller("md"),d=e.computed(()=>u.value?"sm":"xs"),s=e=>`${e.type}:${e.value}`,m=e=>{if(!e)return;const[t,i]=e.split(":"),n=Number(i);return n?{type:t,value:n}:void 0},g=e.computed({get:()=>{const e=o.subscription.billing_period;return e?`${e.type}:${e.value}`:void 0},set:e=>{if(!e)return;const[t,i]=e.split(":"),n=Number(i);n&&a("billing-period-change",{type:t,value:n})}}),f=e=>{var i,n,a,l;const u=null==(l=null==(a=null==(n=null==(i=o.invoicePreviewByBillingPeriod)?void 0:i[s(e)])?void 0:n.periods)?void 0:a[0])?void 0:l.amount_including_tax;if(!u)return;const d="MONTH"===e.type&&3===e.value?r({defaultMessage:"/quarter",id:"checkout.order_summary_block.billing_period.per_quarter",description:"Period label for quarterly billing"}):r({defaultMessage:"/{period}",id:"checkout.order_summary_block.billing_period.per_label",description:"Period label for billing cycles"},{period:c(e,{prefix:!1,hideValueForExactPeriods:!0})});return r({defaultMessage:"{amount}{period}",id:"checkout.order_summary_block.billing_period.sub_label",description:"Billing period option sublabel showing price per period"},{amount:t.formatAmount(u),period:d})},v=e=>{var t,i,n,a;return null==(a=null==(n=null==(i=null==(t=o.invoicePreviewByBillingPeriod)?void 0:t[s(e)])?void 0:i.periods)?void 0:n[0])?void 0:a.amount_including_tax},y=e=>Number(e.quantity),_=(e,t)=>{if(!t)return;const i={DAY:365,WEEK:52,MONTH:12,YEAR:1}[e.type]/Math.max(e.value??1,1),n=y(t)*i;return Number.isFinite(n)?{quantity:n.toFixed(2),currency:t.currency}:void 0},h=(e,t)=>{if(!e||!t)return;const i=y(e)-y(t);return!Number.isFinite(i)||i<=0?void 0:{quantity:i.toFixed(2),currency:e.currency}},b=e=>{if(!e)return;return`${r({defaultMessage:"Save {amount}",id:"checkout.order_summary_block.billing_period.save_badge.prefix",description:"First line for the savings badge label"},{amount:t.formatAmount(e)})}${r({defaultMessage:"/year",id:"checkout.order_summary_block.billing_period.save_badge.suffix",description:"Second line for the savings badge label"})}`},M=e.computed(()=>{var e,t,i;const n=B({pricingPlanScheduleInfos:o.subscription.pricing_plan_schedule_infos??[],type:"DEFAULT"}),a=(null==(t=null==(e=null==n?void 0:n.pricing_plan_version)?void 0:e.billing_period_settings)?void 0:t.billing_periods)??[],r=new Map,l=e=>{e&&r.set(s(e),e)},c=e=>{var t;null==(t=null==e?void 0:e.items)||t.forEach(e=>{var t,i,n;null==(t=e.configs)||t.forEach(e=>l(e.billing_period)),null==(i=e.billing_period_configs)||i.forEach(e=>l(e.billing_period)),null==(n=e.pricing_currency_configs)||n.forEach(e=>{var t,i;null==(t=e.configs)||t.forEach(e=>l(e.billing_period)),null==(i=e.billing_period_configs)||i.forEach(e=>l(e.billing_period))})})};if(((null==(i=null==n?void 0:n.pricing_plan_version)?void 0:i.pricing_categories)??[]).forEach(e=>{var t,i;null==(t=e.pricings)||t.forEach(e=>c(e)),null==(i=e.pricing_groups)||i.forEach(e=>{var t;return null==(t=e.pricings)?void 0:t.forEach(e=>c(e))})}),!r.size)return[];const u=a.map(e=>r.get(s(e.period))).filter(e=>!!e),d=new Set(u.map(s)),p=[...r.values()].filter(e=>!d.has(s(e)));return[...u,...p]}),N=e.computed(()=>{const e=M.value[M.value.length-1],i=e?_(e,v(e)):void 0;return M.value.map(n=>{const o="MONTH"===n.type&&3===n.value?r({defaultMessage:"Billed quarterly",id:"checkout.order_summary_block.billing_period.quarterly",description:"Billing period option label for quarterly billing"}):r({defaultMessage:"Billed {period}",id:"checkout.order_summary_block.billing_period.label",description:"Billing period option label for the selected period"},{period:l.value[n.type].full}),a=v(n),c=_(n,a),u=e&&n.type===e.type&&n.value===e.value?void 0:h(c,i),s=b(u);return{label:o,subLabel:f(n),labelSuffixComponent:s?{component:t._sfc_main$3,props:{color:"primary",content:s,size:d.value,class:"whitespace-nowrap text-left leading-tight"}}:void 0,hidden:g.value===`${n.type}:${n.value}`,value:`${n.type}:${n.value}`}})}),I=e.computed(()=>{const e=N.value,t=e[0],i=e[e.length-1];return{smallestPeriod:null==t?void 0:t.value,biggestPeriod:null==i?void 0:i.value}}),k=e.computed(()=>N.value.find(e=>e.value===I.value.biggestPeriod)),C=e.computed(()=>N.value.find(e=>e.value===g.value)),x=e.computed(()=>{var e,t,i,n,a,r,l,c;const u=N.value,d=u[u.length-1],s=g.value;if(!d||!s)return"";if(s===d.value)return"";const p=m(d.value);if(!p)return"";const f=null==(n=null==(i=null==(t=null==(e=o.invoicePreviewByBillingPeriod)?void 0:e[d.value])?void 0:t.periods)?void 0:i[0])?void 0:n.amount_including_tax,v=m(s),y=null==(c=null==(l=null==(r=null==(a=o.invoicePreviewByBillingPeriod)?void 0:a[s])?void 0:r.periods)?void 0:l[0])?void 0:c.amount_including_tax;if(!v||!y)return"";const M=_(v,y),I=_(p,f);return b(h(M,I))??""}),E=e=>{const{smallestPeriod:t,biggestPeriod:i}=I.value;g.value=e?i:t};return(n,o)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{"no-border":"","no-spacing":"","content-background":"none",title:i.noTitle?void 0:e.unref(r)({defaultMessage:"Order summary",id:"checkout.order_summary_block.title",description:"The title of the order summary block that lists the subscription cost in the checkout"})},{default:e.withCtx(()=>[e.createElementVNode("div",ye,[e.createVNode(e.unref(t._sfc_main$1g),{"no-spacing":""},{default:e.withCtx(()=>[i.subscription?(e.openBlock(),e.createBlock(se,{key:0,avatar:i.avatar,invoice:i.invoice,subscription:i.subscription,"enabled-pricing-ids":i.enabledPricingIds,loading:i.isPreviewAndPaymentMethodsPending,"trial-period":i.trialPeriod},null,8,["avatar","invoice","subscription","enabled-pricing-ids","loading","trial-period"])):e.createCommentVNode("",!0)]),_:1}),2===N.value.length?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:0,"no-spacing":"","content-classes":g.value===I.value.biggestPeriod?"border-primary-500":void 0},{default:e.withCtx(()=>{var i;return[e.createElementVNode("div",_e,[e.createElementVNode("div",he,[k.value?(e.openBlock(),e.createBlock(ve,{key:0,name:k.value.label,description:(null==(i=C.value)?void 0:i.subLabel)??""},e.createSlots({default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$20),{"model-value":g.value===I.value.biggestPeriod,"show-suffix-label-in-input":"","onUpdate:modelValue":E},null,8,["model-value"])]),_:2},[x.value?{name:"badge",fn:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$3),{color:"primary",content:x.value,size:d.value,class:"whitespace-nowrap text-left leading-tight"},null,8,["content","size"])]),key:"0"}:void 0]),1032,["name","description"])):e.createCommentVNode("",!0)])])]}),_:1},8,["content-classes"])):N.value.length>2?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1T),{key:1,"single-model-value":g.value,"onUpdate:singleModelValue":o[0]||(o[0]=e=>g.value=e),options:N.value,size:"xl","has-large-dropdown":"","show-sub-label-in-input":"","show-suffix-in-closed-input":""},null,8,["single-model-value","options"])):e.createCommentVNode("",!0),i.isUsageBased?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:2,"no-spacing":""},{default:e.withCtx(()=>[e.createElementVNode("div",be,[e.createVNode(e.unref(t._sfc_main$2),{"no-spacing":"",variant:"body-sm",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"+ Usage",id:"checkout.invoice_preview.usage_based_message",description:"The message shown for the usage based invoice preview"})),1)]),_:1})])]),_:1})):e.createCommentVNode("",!0),i.invoice&&"products-inline"!==i.variant?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$a),{key:3,invoice:i.invoice,"wrapper-component":e.unref(t._sfc_main$1g)},null,8,["invoice","wrapper-component"])):e.createCommentVNode("",!0),e.createVNode(e.unref(t._sfc_main$1g),null,{default:e.withCtx(()=>[i.invoice?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$9),{key:0,variant:"products-inline"===i.variant?"default":"without-products",invoice:i.invoice,"trial-invoice":i.trialInvoice,"is-paid":i.isPaid,collapsible:i.collapsible,"is-preview-without-taxes":!i.countryCode,"is-customer-facing":""},null,8,["variant","invoice","trial-invoice","is-paid","collapsible","is-preview-without-taxes"])):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2),{key:1,variant:"body-sm",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Please select a country first",description:"The message shown for the invoice preview when no country is set",id:"checkout.invoice_preview.no_country_selected_message"})),1)]),_:1}))]),_:1})])]),_:1},8,["title"]))}}),Ne={class:"py-4 flex flex-col items-center justify-center"},Ie=e.defineComponent({__name:"EmptyStatePlaceholder",props:{icon:{type:null}},setup:i=>(n,o)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),null,{default:e.withCtx(()=>[e.createElementVNode("div",Ne,[e.createVNode(e.unref(t._sfc_main$4),{icon:i.icon,size:"lg",class:"text-gray-500"},null,8,["icon"]),e.createVNode(e.unref(t._sfc_main$2),{center:"",tag:"span",variant:"body-sm",weight:"semibold",shade:"lighter",class:"mt-2"},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"title")]),_:3}),e.createVNode(e.unref(t._sfc_main$2),{center:"",tag:"span",variant:"body-xs",shade:"lightest",class:"mt-1"},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"message")]),_:3})])]),_:3}))}),ke={key:0,id:"svg-logo",viewBox:"0 0 35 15",class:"h-[44px]"},Ce={key:1,src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAxcHgiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAxMDEgMzIiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaW5ZTWluIG1lZXQiIHhtbG5zPSJodHRwOiYjeDJGOyYjeDJGO3d3dy53My5vcmcmI3gyRjsyMDAwJiN4MkY7c3ZnIj48cGF0aCBmaWxsPSIjMDAzMDg3IiBkPSJNIDEyLjIzNyAyLjggTCA0LjQzNyAyLjggQyAzLjkzNyAyLjggMy40MzcgMy4yIDMuMzM3IDMuNyBMIDAuMjM3IDIzLjcgQyAwLjEzNyAyNC4xIDAuNDM3IDI0LjQgMC44MzcgMjQuNCBMIDQuNTM3IDI0LjQgQyA1LjAzNyAyNC40IDUuNTM3IDI0IDUuNjM3IDIzLjUgTCA2LjQzNyAxOC4xIEMgNi41MzcgMTcuNiA2LjkzNyAxNy4yIDcuNTM3IDE3LjIgTCAxMC4wMzcgMTcuMiBDIDE1LjEzNyAxNy4yIDE4LjEzNyAxNC43IDE4LjkzNyA5LjggQyAxOS4yMzcgNy43IDE4LjkzNyA2IDE3LjkzNyA0LjggQyAxNi44MzcgMy41IDE0LjgzNyAyLjggMTIuMjM3IDIuOCBaIE0gMTMuMTM3IDEwLjEgQyAxMi43MzcgMTIuOSAxMC41MzcgMTIuOSA4LjUzNyAxMi45IEwgNy4zMzcgMTIuOSBMIDguMTM3IDcuNyBDIDguMTM3IDcuNCA4LjQzNyA3LjIgOC43MzcgNy4yIEwgOS4yMzcgNy4yIEMgMTAuNjM3IDcuMiAxMS45MzcgNy4yIDEyLjYzNyA4IEMgMTMuMTM3IDguNCAxMy4zMzcgOS4xIDEzLjEzNyAxMC4xIFoiPjwvcGF0aD48cGF0aCBmaWxsPSIjMDAzMDg3IiBkPSJNIDM1LjQzNyAxMCBMIDMxLjczNyAxMCBDIDMxLjQzNyAxMCAzMS4xMzcgMTAuMiAzMS4xMzcgMTAuNSBMIDMwLjkzNyAxMS41IEwgMzAuNjM3IDExLjEgQyAyOS44MzcgOS45IDI4LjAzNyA5LjUgMjYuMjM3IDkuNSBDIDIyLjEzNyA5LjUgMTguNjM3IDEyLjYgMTcuOTM3IDE3IEMgMTcuNTM3IDE5LjIgMTguMDM3IDIxLjMgMTkuMzM3IDIyLjcgQyAyMC40MzcgMjQgMjIuMTM3IDI0LjYgMjQuMDM3IDI0LjYgQyAyNy4zMzcgMjQuNiAyOS4yMzcgMjIuNSAyOS4yMzcgMjIuNSBMIDI5LjAzNyAyMy41IEMgMjguOTM3IDIzLjkgMjkuMjM3IDI0LjMgMjkuNjM3IDI0LjMgTCAzMy4wMzcgMjQuMyBDIDMzLjUzNyAyNC4zIDM0LjAzNyAyMy45IDM0LjEzNyAyMy40IEwgMzYuMTM3IDEwLjYgQyAzNi4yMzcgMTAuNCAzNS44MzcgMTAgMzUuNDM3IDEwIFogTSAzMC4zMzcgMTcuMiBDIDI5LjkzNyAxOS4zIDI4LjMzNyAyMC44IDI2LjEzNyAyMC44IEMgMjUuMDM3IDIwLjggMjQuMjM3IDIwLjUgMjMuNjM3IDE5LjggQyAyMy4wMzcgMTkuMSAyMi44MzcgMTguMiAyMy4wMzcgMTcuMiBDIDIzLjMzNyAxNS4xIDI1LjEzNyAxMy42IDI3LjIzNyAxMy42IEMgMjguMzM3IDEzLjYgMjkuMTM3IDE0IDI5LjczNyAxNC42IEMgMzAuMjM3IDE1LjMgMzAuNDM3IDE2LjIgMzAuMzM3IDE3LjIgWiI+PC9wYXRoPjxwYXRoIGZpbGw9IiMwMDMwODciIGQ9Ik0gNTUuMzM3IDEwIEwgNTEuNjM3IDEwIEMgNTEuMjM3IDEwIDUwLjkzNyAxMC4yIDUwLjczNyAxMC41IEwgNDUuNTM3IDE4LjEgTCA0My4zMzcgMTAuOCBDIDQzLjIzNyAxMC4zIDQyLjczNyAxMCA0Mi4zMzcgMTAgTCAzOC42MzcgMTAgQyAzOC4yMzcgMTAgMzcuODM3IDEwLjQgMzguMDM3IDEwLjkgTCA0Mi4xMzcgMjMgTCAzOC4yMzcgMjguNCBDIDM3LjkzNyAyOC44IDM4LjIzNyAyOS40IDM4LjczNyAyOS40IEwgNDIuNDM3IDI5LjQgQyA0Mi44MzcgMjkuNCA0My4xMzcgMjkuMiA0My4zMzcgMjguOSBMIDU1LjgzNyAxMC45IEMgNTYuMTM3IDEwLjYgNTUuODM3IDEwIDU1LjMzNyAxMCBaIj48L3BhdGg+PHBhdGggZmlsbD0iIzAwOWNkZSIgZD0iTSA2Ny43MzcgMi44IEwgNTkuOTM3IDIuOCBDIDU5LjQzNyAyLjggNTguOTM3IDMuMiA1OC44MzcgMy43IEwgNTUuNzM3IDIzLjYgQyA1NS42MzcgMjQgNTUuOTM3IDI0LjMgNTYuMzM3IDI0LjMgTCA2MC4zMzcgMjQuMyBDIDYwLjczNyAyNC4zIDYxLjAzNyAyNCA2MS4wMzcgMjMuNyBMIDYxLjkzNyAxOCBDIDYyLjAzNyAxNy41IDYyLjQzNyAxNy4xIDYzLjAzNyAxNy4xIEwgNjUuNTM3IDE3LjEgQyA3MC42MzcgMTcuMSA3My42MzcgMTQuNiA3NC40MzcgOS43IEMgNzQuNzM3IDcuNiA3NC40MzcgNS45IDczLjQzNyA0LjcgQyA3Mi4yMzcgMy41IDcwLjMzNyAyLjggNjcuNzM3IDIuOCBaIE0gNjguNjM3IDEwLjEgQyA2OC4yMzcgMTIuOSA2Ni4wMzcgMTIuOSA2NC4wMzcgMTIuOSBMIDYyLjgzNyAxMi45IEwgNjMuNjM3IDcuNyBDIDYzLjYzNyA3LjQgNjMuOTM3IDcuMiA2NC4yMzcgNy4yIEwgNjQuNzM3IDcuMiBDIDY2LjEzNyA3LjIgNjcuNDM3IDcuMiA2OC4xMzcgOCBDIDY4LjYzNyA4LjQgNjguNzM3IDkuMSA2OC42MzcgMTAuMSBaIj48L3BhdGg+PHBhdGggZmlsbD0iIzAwOWNkZSIgZD0iTSA5MC45MzcgMTAgTCA4Ny4yMzcgMTAgQyA4Ni45MzcgMTAgODYuNjM3IDEwLjIgODYuNjM3IDEwLjUgTCA4Ni40MzcgMTEuNSBMIDg2LjEzNyAxMS4xIEMgODUuMzM3IDkuOSA4My41MzcgOS41IDgxLjczNyA5LjUgQyA3Ny42MzcgOS41IDc0LjEzNyAxMi42IDczLjQzNyAxNyBDIDczLjAzNyAxOS4yIDczLjUzNyAyMS4zIDc0LjgzNyAyMi43IEMgNzUuOTM3IDI0IDc3LjYzNyAyNC42IDc5LjUzNyAyNC42IEMgODIuODM3IDI0LjYgODQuNzM3IDIyLjUgODQuNzM3IDIyLjUgTCA4NC41MzcgMjMuNSBDIDg0LjQzNyAyMy45IDg0LjczNyAyNC4zIDg1LjEzNyAyNC4zIEwgODguNTM3IDI0LjMgQyA4OS4wMzcgMjQuMyA4OS41MzcgMjMuOSA4OS42MzcgMjMuNCBMIDkxLjYzNyAxMC42IEMgOTEuNjM3IDEwLjQgOTEuMzM3IDEwIDkwLjkzNyAxMCBaIE0gODUuNzM3IDE3LjIgQyA4NS4zMzcgMTkuMyA4My43MzcgMjAuOCA4MS41MzcgMjAuOCBDIDgwLjQzNyAyMC44IDc5LjYzNyAyMC41IDc5LjAzNyAxOS44IEMgNzguNDM3IDE5LjEgNzguMjM3IDE4LjIgNzguNDM3IDE3LjIgQyA3OC43MzcgMTUuMSA4MC41MzcgMTMuNiA4Mi42MzcgMTMuNiBDIDgzLjczNyAxMy42IDg0LjUzNyAxNCA4NS4xMzcgMTQuNiBDIDg1LjczNyAxNS4zIDg1LjkzNyAxNi4yIDg1LjczNyAxNy4yIFoiPjwvcGF0aD48cGF0aCBmaWxsPSIjMDA5Y2RlIiBkPSJNIDk1LjMzNyAzLjMgTCA5Mi4xMzcgMjMuNiBDIDkyLjAzNyAyNCA5Mi4zMzcgMjQuMyA5Mi43MzcgMjQuMyBMIDk1LjkzNyAyNC4zIEMgOTYuNDM3IDI0LjMgOTYuOTM3IDIzLjkgOTcuMDM3IDIzLjQgTCAxMDAuMjM3IDMuNSBDIDEwMC4zMzcgMy4xIDEwMC4wMzcgMi44IDk5LjYzNyAyLjggTCA5Ni4wMzcgMi44IEMgOTUuNjM3IDIuOCA5NS40MzcgMyA5NS4zMzcgMy4zIFoiPjwvcGF0aD48L3N2Zz4",role:"presentation",class:"h-[22px]"},xe=e.defineComponent({__name:"ExpressPaymentMethodButton",props:{type:{type:String}},emits:["click"],setup(i,{emit:n}){const o=i,a=n,r=e.computed(()=>{switch(o.type){case"applepay":return"Apple Pay";case"googlepay":return"Google Pay";case"paypal":return"PayPal";default:return}}),l=e.computed(()=>{switch(o.type){case"applepay":return"!bg-black !py-0";case"googlepay":return"!bg-black bg-[url(https://www.gstatic.com/instantbuy/svg/dark_gpay.svg)] bg-[length:auto_42.5%]";case"paypal":return"!bg-[#ffc439]";default:return}});function c(){a("click")}return(i,n)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2H),{size:"lg","aria-label":r.value,class:e.normalizeClass([l.value,"!block w-full h-11 bg-center bg-no-repeat"]),onClick:c},{default:e.withCtx(()=>["applepay"===o.type?(e.openBlock(),e.createElementBlock("svg",ke,[...n[0]||(n[0]=[e.createElementVNode("svg",{id:"svg-logo",x:"0",y:"3.85",height:"7.3",width:"35",class:"logo",viewBox:"0 0 105 43",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[e.createElementVNode("title",null,"Apple Logo"),e.createElementVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createElementVNode("g",{fill:"#FFF"},[e.createElementVNode("path",{d:"M19.4028,5.5674 C20.6008,4.0684 21.4138,2.0564 21.1998,0.0004 C19.4458,0.0874 17.3058,1.1574 16.0668,2.6564 C14.9538,3.9414 13.9688,6.0374 14.2258,8.0074 C16.1948,8.1784 18.1618,7.0244 19.4028,5.5674"}),e.createElementVNode("path",{d:"M21.1772,8.3926 C18.3182,8.2226 15.8872,10.0156 14.5212,10.0156 C13.1552,10.0156 11.0642,8.4786 8.8022,8.5196 C5.8592,8.5626 3.1282,10.2276 1.6342,12.8746 C-1.4378,18.1696 0.8232,26.0246 3.8112,30.3376 C5.2622,32.4716 7.0102,34.8206 9.3142,34.7366 C11.4912,34.6506 12.3442,33.3266 14.9902,33.3266 C17.6352,33.3266 18.4042,34.7366 20.7082,34.6936 C23.0972,34.6506 24.5922,32.5586 26.0422,30.4226 C27.7072,27.9906 28.3882,25.6426 28.4312,25.5126 C28.3882,25.4706 23.8232,23.7186 23.7812,18.4676 C23.7382,14.0706 27.3652,11.9786 27.5362,11.8496 C25.4882,8.8196 22.2872,8.4786 21.1772,8.3926"}),e.createElementVNode("path",{d:"M85.5508,43.0381 L85.5508,39.1991 C85.8628,39.2421 86.6158,39.2871 87.0158,39.2871 C89.2138,39.2871 90.4558,38.3551 91.2108,35.9581 L91.6548,34.5371 L83.2428,11.2321 L88.4368,11.2321 L94.2958,30.1421 L94.4068,30.1421 L100.2668,11.2321 L105.3278,11.2321 L96.6048,35.7141 C94.6078,41.3291 92.3208,43.1721 87.4828,43.1721 C87.1048,43.1721 85.8838,43.1271 85.5508,43.0381"}),e.createElementVNode("path",{d:"M42.6499,19.3555 L48.3549,19.3555 C52.6829,19.3555 55.1469,17.0255 55.1469,12.9855 C55.1469,8.9455 52.6829,6.6375 48.3769,6.6375 L42.6499,6.6375 L42.6499,19.3555 Z M49.6869,2.4425 C55.9009,2.4425 60.2289,6.7265 60.2289,12.9625 C60.2289,19.2225 55.8129,23.5285 49.5309,23.5285 L42.6499,23.5285 L42.6499,34.4705 L37.6779,34.4705 L37.6779,2.4425 L49.6869,2.4425 Z"}),e.createElementVNode("path",{d:"M76.5547,25.7705 L76.5547,23.9715 L71.0287,24.3275 C67.9207,24.5275 66.3007,25.6815 66.3007,27.7015 C66.3007,29.6545 67.9887,30.9195 70.6287,30.9195 C74.0027,30.9195 76.5547,28.7665 76.5547,25.7705 M61.4617,27.8345 C61.4617,23.7285 64.5917,21.3755 70.3627,21.0205 L76.5547,20.6425 L76.5547,18.8675 C76.5547,16.2705 74.8457,14.8495 71.8057,14.8495 C69.2967,14.8495 67.4777,16.1375 67.0997,18.1125 L62.6167,18.1125 C62.7497,13.9615 66.6567,10.9435 71.9387,10.9435 C77.6207,10.9435 81.3267,13.9175 81.3267,18.5345 L81.3267,34.4705 L76.7327,34.4705 L76.7327,30.6305 L76.6217,30.6305 C75.3127,33.1395 72.4267,34.7145 69.2967,34.7145 C64.6807,34.7145 61.4617,31.9625 61.4617,27.8345"})])])],-1)])])):"paypal"===o.type?(e.openBlock(),e.createElementBlock("img",Ce)):e.createCommentVNode("",!0)]),_:1},8,["aria-label","class"]))}}),Ee={class:"w-[1px] h-[1px] overflow-hidden opacity-0 absolute"},De=e.defineComponent({__name:"ExpressPaymentMethodApplePay",props:{onBillingInformationChange:{type:Function},amount:{type:Object},countryCode:{type:String},locale:{type:String},isVisible:{type:Boolean},paymentMethodOptionsResponse:{type:Object},billingInformation:{type:Object}},emits:["ready","update-billing-information"],setup(t,{emit:i}){const n=t,a=i,r=e.ref(),l=o.useLogger(),{authorizePayment:c}=g.createPaymentsService(),u=n.paymentMethodOptionsResponse.payment_acceptor.id,d=e=>{if(!e.value)return;let t=e.value??1,i=e.type.toLowerCase();return"WEEK"===e.type&&(i="day",t=7*e.value),"day"===i||"month"===i||"year"===i||"hour"===i||"minute"===i?{recurringPaymentIntervalUnit:i,recurringPaymentIntervalCount:t}:void 0},s=()=>{var e;const t=null==(e=r.value)?void 0:e.querySelector("apple-pay-button");if(t){const e=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});t.dispatchEvent(e)}};return e.onMounted(()=>{(async()=>{const{AdyenCheckout:e,ApplePay:t}=await Promise.resolve().then(()=>require("./auto-B_36W1Fc.js")),i=new t(await e(o.getAdyenExpressCheckoutConfiguration({amount:n.amount,locale:n.locale,countryCode:n.countryCode,paymentMethodOptionResponse:n.paymentMethodOptionsResponse})),{isExpress:!0,recurringPaymentRequest:{paymentDescription:n.billingInformation.description,billingAgreement:n.billingInformation.agreement,managementURL:"https://www.google.com",...n.billingInformation.trial&&{trialBilling:{label:n.billingInformation.trial.label,amount:n.billingInformation.trial.amount.quantity.toString(),type:"final",paymentTiming:"recurring",recurringPaymentStartDate:n.billingInformation.trial.startDate,recurringPaymentEndDate:n.billingInformation.trial.endDate}},...n.billingInformation.regular&&{regularBilling:{label:n.billingInformation.regular.label,amount:n.billingInformation.regular.amount.quantity.toString(),type:"final",paymentTiming:"recurring",recurringPaymentStartDate:n.billingInformation.regular.startDate,...d(n.billingInformation.regular.interval??{type:"MONTH",value:1})}}},requiredBillingContactFields:["postalAddress"],requiredShippingContactFields:["email"],onPaymentMethodSelected:async(e,t,i)=>{var o,r,l,c,u,d;const{invoicePreview:s,trialInvoicePreview:p}=await n.onBillingInformationChange({...(null==(o=i.paymentMethod.billingContact)?void 0:o.postalCode)&&{postal_code:i.paymentMethod.billingContact.postalCode},...(null==(r=i.paymentMethod.billingContact)?void 0:r.locality)&&{city:i.paymentMethod.billingContact.locality},...(null==(l=i.paymentMethod.billingContact)?void 0:l.countryCode)&&{country:i.paymentMethod.billingContact.countryCode}}),m=p?p.invoice_amount_including_tax.quantity.toString():s.invoice_amount_including_tax.quantity.toString();a("update-billing-information",{postal_code:null==(c=i.paymentMethod.billingContact)?void 0:c.postalCode,city:null==(u=i.paymentMethod.billingContact)?void 0:u.locality,country:null==(d=i.paymentMethod.billingContact)?void 0:d.countryCode}),e({newTotal:{label:n.billingInformation.regular.label,amount:m,type:"final"}})},onError:e=>{l.error("APPLE_PAY_ERROR","Apple Pay error",{error:e})},onAuthorized:async(e,t)=>{var i,r;try{l.info("APPLE_PAY_AUTHORIZED","Apple Pay authorized",{data:e});const d=e.authorizedEvent;l.info("APPLE_PAY_EVENT_DATA","Apple Pay event data structure",{eventData:d,hasPaymentMethod:!!d.paymentMethod,hasBrowserInfo:!!d.browserInfo,hasRiskData:!!d.riskData,billingAddress:e.billingAddress});const s=(null==(i=d.paymentMethod)?void 0:i.billingContact)||(null==(r=d.payment)?void 0:r.billingContact),p=e.billingAddress;if(s?a("update-billing-information",{postal_code:s.postalCode,city:s.locality,country:s.countryCode}):p&&a("update-billing-information",{postal_code:p.postalCode,city:p.city,country:p.countryCode||p.country}),!d.paymentMethod)return l.error("APPLE_PAY_ERROR","Apple Pay event data missing paymentMethod",{eventData:d}),void t.reject();const m={payment_method:o.transformObjectToAdyenObject(d.paymentMethod),browser_info:o.transformObjectToAdyenObject(d.browserInfo),risk_data:o.transformObjectToAdyenObject(d.riskData)};l.info("APPLE_PAY_ADYEN_PAYLOAD","Adyen payload prepared",{adyen:m});const g=o.createReturnUrl({paymentAcceptorId:u,redirectUrl:window.location.href});l.info("APPLE_PAY_CALLING_API","Calling authorizePayment API",{paymentAcceptorId:u,amount:n.amount});const f=await c({payment_acceptor_id:u,payment_gateway_variant:"ADYEN",adyen:{...m,store_payment_method:!0},amount:n.amount,return_url:g});if(l.info("APPLE_PAY_API_RESPONSE","Payment API response received",{status:f.status,paymentResult:f}),"FAILURE"===f.status)return l.error("APPLE_PAY_AUTHORIZATION_FAILED","Payment authorization failed",{error:f}),void t.reject();if("ACTION_REQUIRED"===f.status)return l.warn("APPLE_PAY_ACTION_REQUIRED","Payment requires additional action",{action:f.action}),void t.reject();l.info("APPLE_PAY_SUCCESS","Apple Pay payment successful, resolving"),t.resolve()}catch(d){l.error("APPLE_PAY_AUTHORIZATION_FAILED","Apple Pay authorization failed",{error:d}),t.reject()}}});if(r.value)try{await i.isAvailable(),i.mount(r.value),a("ready")}catch(s){}})()}),(i,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[t.isVisible?(e.openBlock(),e.createBlock(xe,{key:0,type:"applepay",onClick:s})):e.createCommentVNode("",!0),e.createElementVNode("div",Ee,[e.createElementVNode("div",{ref_key:"applePayButtonRef",ref:r},null,512)])],64))}}),Ae={class:"relative overflow-hidden"},we=e.defineComponent({__name:"ExpressPaymentMethodPaypal",props:{amount:{type:Object},countryCode:{type:String},locale:{type:String},isVisible:{type:Boolean},paymentMethodOptionsResponse:{type:Object},billingInformation:{type:Object}},emits:["ready","update-billing-information"],setup(t,{emit:i}){const n=t,a=i,r=e.ref(),l=o.useLogger();return e.onMounted(()=>{(async()=>{const{AdyenCheckout:e,PayPal:t}=await Promise.resolve().then(()=>require("./auto-B_36W1Fc.js")),i=new t(await e(o.getAdyenExpressCheckoutConfiguration({locale:n.locale,amount:n.amount,countryCode:n.countryCode,paymentMethodOptionResponse:n.paymentMethodOptionsResponse})),{isExpress:!0,blockPayPalPayLaterButton:!0,blockPayPalCreditButton:!0,blockPayPalVenmoButton:!0,style:{height:55},onInit:()=>{a("ready")}});if(r.value)try{await i.isAvailable(),i.mount(r.value)}catch(c){l.error("EXPRESS_CHECKOUT_PAYPAL_ERROR","Failed mounting PayPal express button",{error:c})}else l.error("EXPRESS_CHECKOUT_PAYPAL_ERROR","The PayPal button reference is not found and cannot be mounted")})()}),(i,n)=>(e.openBlock(),e.createElementBlock("div",Ae,[t.isVisible?(e.openBlock(),e.createBlock(xe,{key:0,type:"paypal",class:"w-full"})):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"paypalButtonRef",ref:r,class:"absolute inset-0 opacity-[0.0001]"},null,512)]))}}),Pe={class:"w-[1px] h-[1px] overflow-hidden opacity-0 absolute"},Be=e.defineComponent({__name:"ExpressPaymentMethodGooglePay",props:{amount:{type:Object},countryCode:{type:String},locale:{type:String},isVisible:{type:Boolean},paymentMethodOptionsResponse:{type:Object},billingInformation:{type:Object}},emits:["ready","update-billing-information"],setup(t,{emit:i}){const n=t,a=i,r=e.ref(),l=o.useLogger(),c=()=>{var e;const t=null==(e=r.value)?void 0:e.querySelector("#gpay-button-online-api-id");if(t){const e=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});t.dispatchEvent(e)}};return e.onMounted(()=>{(async()=>{const{AdyenCheckout:e,GooglePay:t}=await Promise.resolve().then(()=>require("./auto-B_36W1Fc.js")),i=new t(await e(o.getAdyenExpressCheckoutConfiguration({locale:n.locale,amount:n.amount,countryCode:n.countryCode,paymentMethodOptionResponse:n.paymentMethodOptionsResponse})),{isExpress:!0});if(r.value)try{await i.isAvailable(),i.mount(r.value),a("ready")}catch(c){l.error("EXPRESS_CHECKOUT_GOOGLE_PAY_ERROR","Failed mounting Google Pay express button",{error:c})}else l.error("EXPRESS_CHECKOUT_GOOGLE_PAY_ERROR","The Google Pay button reference is not found and cannot be mounted")})()}),(i,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[t.isVisible?(e.openBlock(),e.createBlock(xe,{key:0,type:"googlepay",onClick:c})):e.createCommentVNode("",!0),e.createElementVNode("div",Pe,[e.createElementVNode("div",{ref_key:"googlePayButtonRef",ref:r},null,512)])],64))}}),Ve={key:0,class:"mt-4n"},Se={class:"mb-2"},Te={class:"grid grid-cols-6 gap-1 md:gap-2"},Le={class:"h-4 mt-4"},je=e.defineComponent({__name:"ExpressPaymentMethods",props:{amount:{type:Object},countryCode:{type:String},locale:{type:String},paymentMethodsOptionsResponse:{type:null},billingInformation:{type:Object},onBillingInformationChange:{type:Function}},emits:["update-billing-information"],setup(i){const n=["applepay"],o=i,{$t:a}=t.useIntl(),r=e.ref(!1),l=e.ref(!1),c=e.ref(!1),u=e.computed(()=>{var e;if(n.includes("applepay"))return null==(e=o.paymentMethodsOptionsResponse)?void 0:e.find(e=>{var t;return null==(t=e.options)?void 0:t.some(e=>"apple pay"===e.name.toLowerCase())})}),d=e.computed(()=>{var e;if(n.includes("paypal"))return null==(e=o.paymentMethodsOptionsResponse)?void 0:e.find(e=>{var t;return null==(t=e.options)?void 0:t.some(e=>"paypal"===e.name.toLowerCase())})}),s=e.computed(()=>{var e;if(n.includes("googlepay"))return null==(e=o.paymentMethodsOptionsResponse)?void 0:e.find(e=>{var t;return null==(t=e.options)?void 0:t.some(e=>"google pay"===e.name.toLowerCase())})}),p=e.computed(()=>!!(u.value||s.value||d.value)),g=e.computed(()=>{var e;if(0===(null==(e=o.paymentMethodsOptionsResponse)?void 0:e.length))return!1;const t=!u.value||r.value,i=!s.value||l.value,n=!d.value||c.value;return t&&i&&n}),f=e.computed(()=>g.value?(u.value?1:0)+(s.value?1:0)+(d.value?1:0):2);return(n,o)=>p.value?(e.openBlock(),e.createElementBlock("div",Ve,[e.createElementVNode("div",Se,[g.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2),{key:1,variant:"heading-3",tag:"h2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Subscribe instantly with",id:"checkout.express_payment_methods.title",description:"The title of the express payment methods block in the checkout form"})),1)]),_:1})):(e.openBlock(),e.createBlock(m._sfc_main,{key:0,variant:"title"}))]),e.createElementVNode("div",Te,[g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(m._sfc_main,{class:"h-11 col-span-3"}),e.createVNode(m._sfc_main,{class:"h-11 col-span-3"})],64)),e.createElementVNode("div",{class:e.normalizeClass(["col-span-3 md:col-span-2",{hidden:!u.value,"!col-span-6":1===f.value,"md:!col-span-3":2===f.value,"!col-span-6 md:!col-span-2":3===f.value}])},[u.value?(e.openBlock(),e.createBlock(De,{key:0,amount:i.amount,"billing-information":i.billingInformation,"country-code":i.countryCode,locale:i.locale,"is-visible":g.value,"payment-method-options-response":u.value,"on-billing-information-change":i.onBillingInformationChange,onReady:o[0]||(o[0]=e=>r.value=!0),onUpdateBillingInformation:o[1]||(o[1]=e=>n.$emit("update-billing-information",e))},null,8,["amount","billing-information","country-code","locale","is-visible","payment-method-options-response","on-billing-information-change"])):e.createCommentVNode("",!0)],2),e.createElementVNode("div",{class:e.normalizeClass(["col-span-3 md:col-span-2",{hidden:!s.value,"col-span-6 md:col-span-6":1===f.value,"md:!col-span-3":2===f.value}])},[s.value?(e.openBlock(),e.createBlock(Be,{key:0,amount:i.amount,"billing-information":i.billingInformation,"country-code":i.countryCode,locale:i.locale,"is-visible":g.value,"payment-method-options-response":s.value,onReady:o[2]||(o[2]=e=>l.value=!0)},null,8,["amount","billing-information","country-code","locale","is-visible","payment-method-options-response"])):e.createCommentVNode("",!0)],2),e.createElementVNode("div",{class:e.normalizeClass(["col-span-3 md:col-span-2",{hidden:!d.value,"col-span-6 md:col-span-6":1===f.value,"md:!col-span-3":2===f.value}])},[d.value?(e.openBlock(),e.createBlock(we,{key:0,amount:i.amount,"billing-information":i.billingInformation,"country-code":i.countryCode,locale:i.locale,"is-visible":g.value,"payment-method-options-response":d.value,onReady:o[3]||(o[3]=e=>c.value=!0)},null,8,["amount","billing-information","country-code","locale","is-visible","payment-method-options-response"])):e.createCommentVNode("",!0)],2)]),e.createElementVNode("div",Le,[g.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2q),{key:1,text:e.unref(a)({defaultMessage:"Or",id:"checkout.express_payment_methods.divider_text",description:"The text of the divider text in the express payment methods block in the checkout form"}),"text-position":"center"},null,8,["text"])):(e.openBlock(),e.createBlock(m._sfc_main,{key:0,variant:"divider-text"}))])])):e.createCommentVNode("",!0)}}),ze={class:"grid grid-cols-2 gap-2"},Oe=e.defineComponent({__name:"TieredTableRow",props:{band:{type:Object},previousBand:{type:Object},isFirst:{type:Boolean},period:{type:Object}},setup(i){const n=i,{$t:o}=t.useIntl(),{formatTimePeriod:a}=t.useTimePeriod(),r=e.computed(()=>{var e;return n.isFirst?"0":(null==(e=n.previousBand)?void 0:e.tier_top_bound)&&"number"in n.previousBand.tier_top_bound?n.previousBand.tier_top_bound.number:void 0}),l=e.computed(()=>{if(n.band.tier_top_bound&&"number"in n.band.tier_top_bound)return n.band.tier_top_bound.number});return(n,c)=>(e.openBlock(),e.createElementBlock("div",ze,[e.createVNode(e.unref(t._sfc_main$2),{variant:"body-xs",shade:"lighter",tag:"div"},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"{lower_bound} - {upper_bound} seats",id:"seats.tiered_range_label",description:"The label showing the seat count range for a tiered pricing tier"},{lower_bound:r.value??"0",upper_bound:l.value})),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"> {lower_bound} seats",id:"seats.tiered_unbounded_range_label",description:"The label showing the unbounded seat count range (greater than) for a tiered pricing tier"},{lower_bound:r.value??"0"})),1)],64))]),_:1}),e.createVNode(e.unref(t._sfc_main$2),{variant:"body-xs",shade:"lighter",tag:"div",class:"text-right"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.band.amount&&e.unref(o)({defaultMessage:"{amount} per seat/{period}",id:"seats.tiered_price_per_seat_period",description:"The price per seat and billing period label for a tiered pricing tier"},{amount:e.unref(t.formatAmount)(i.band.amount),period:i.period?e.unref(a)(i.period,{short:!0,hideValueForExactPeriods:!0}):""})),1)]),_:1})]))}}),$e={class:"grid grid-cols-1 gap-0.5 pt-1.5"},Ue=e.defineComponent({__name:"TieredTable",props:{bands:{type:Array},period:{type:Object}},setup:t=>(i,n)=>(e.openBlock(),e.createElementBlock("div",$e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.bands,(i,n)=>(e.openBlock(),e.createBlock(Oe,{key:n,band:i,"is-first":0===n,"previous-band":n>0?t.bands[n-1]:void 0,period:t.period},null,8,["band","is-first","previous-band","period"]))),128))]))});const Re={class:"flex flex-row-reverse md:flex-row gap-4"},Fe={class:"w-24 md:w-32 shrink-0 justify-start"},Ge=["tabindex"],Ye={key:0},Ke={key:0},qe=e.defineComponent({__name:"SeatsEditorItem",props:e.mergeModels({modelValue:{type:Object},defaultValue:{type:Object},pricings:{type:Array}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(i){const n=i,o=e.useModel(i,"modelValue"),{$t:a}=t.useIntl(),{formatTimePeriod:r}=t.useTimePeriod(),l=e.ref(!1),c=e.computed({get:()=>o.value.number?+o.value.number:1,set(e){o.value={...o.value,number:void 0!==e?e.toString():void 0}}}),u=function({pricings:t,pricingItemConfigId:i}){return e.computed(()=>{var e,n;const{config:o,productItem:a}=function({pricings:e,pricingItemConfigId:t}){var i,n;const o=e.flatMap(e=>e.items??[]).find(e=>{var i;return null==(i=e.configs)?void 0:i.some(e=>e.id===t)});return{config:null==(i=null==o?void 0:o.configs)?void 0:i.find(e=>e.id===t),productItem:null==(n=null==o?void 0:o.product_items)?void 0:n[0]}}({pricings:t,pricingItemConfigId:i});return{billing:{period:null==o?void 0:o.billing_period,billedInAdvance:null==o?void 0:o.billing_in_advance},product:{name:null==a?void 0:a.name,description:null==a?void 0:a.description},pricing:{..."FLAT"===(null==o?void 0:o.type)&&{amount:null==(n=null==(e=o.bands)?void 0:e[0])?void 0:n.amount},..."TIERED"===(null==o?void 0:o.type)&&{tiered:{bands:o.bands}}}}})}({pricings:n.pricings,pricingItemConfigId:o.value.pricing_item_config_id}),d=e.computed(()=>{var e,t;return!!(null==(t=null==(e=u.value.pricing)?void 0:e.tiered)?void 0:t.bands)});return(n,o)=>{var s,p,m;return e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",Re,[e.createElementVNode("div",Fe,[e.createVNode(e.unref(t._sfc_main$1Y),{modelValue:c.value,"onUpdate:modelValue":o[0]||(o[0]=e=>c.value=e),size:"sm",min:(null==(s=i.defaultValue)?void 0:s.number)?+i.defaultValue.number:void 0},null,8,["modelValue","min"])]),e.createElementVNode("div",{class:e.normalizeClass(["flex flex-col grow",{"hover:cursor-pointer":d.value}]),tabindex:d.value?0:void 0,onClick:o[1]||(o[1]=e=>d.value?l.value=!l.value:void 0)},[e.createVNode(e.unref(t._sfc_main$2),{tag:"span",variant:"body-sm",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u).product.name||e.unref(a)({defaultMessage:"Seats",id:"seats.label",description:"The label for the seats input field"})),1)]),_:1}),e.unref(u).pricing.amount?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2),{key:0,tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"{amount} per seat/{period}",id:"seats.price_per_seat_period",description:"The price per seat and billing period label for seat-based pricing"},{amount:e.unref(t.formatAmount)(e.unref(u).pricing.amount),period:e.unref(u).billing.period?e.unref(r)(e.unref(u).billing.period,{short:!0,hideValueForExactPeriods:!0}):""})),1)]),_:1})):e.unref(u).pricing.tiered?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2),{key:1,tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Tiered pricing",id:"seats.tiered_pricing_label",description:"The label indicating tiered pricing structure for seats"}))+" ",1),e.createVNode(e.unref(t._sfc_main$4),{icon:"keyboard_arrow_down",size:"xs",class:e.normalizeClass(["absolute transition ease-in-out text-gray-400",{"rotate-0":!l.value,"rotate-180":l.value}])},null,8,["class"])]),_:1})):e.createCommentVNode("",!0)],10,Ge)]),(null==(m=null==(p=e.unref(u).pricing)?void 0:p.tiered)?void 0:m.bands)?(e.openBlock(),e.createElementBlock("div",Ye,[e.createVNode(e.unref(t._sfc_main$2j),null,{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",Ke,[e.createVNode(Ue,{bands:e.unref(u).pricing.tiered.bands,period:e.unref(u).billing.period},null,8,["bands","period"])])):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0)])}}}),He=e.defineComponent({__name:"SeatsEditor",props:e.mergeModels({modelValue:{type:Array},initialSeatsValues:{type:Array},pricings:{type:Array}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(i){const n=e.useModel(i,"modelValue"),o=t=>e.computed({get:()=>n.value[t],set:e=>{const i=n.value.slice();i[t]=e,n.value=i}});return(n,a)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.modelValue,(n,a)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:a},{default:e.withCtx(()=>{var t;return[n.pricing_item_config_id?(e.openBlock(),e.createBlock(qe,{key:n.pricing_item_config_id,modelValue:o(a).value,"onUpdate:modelValue":e=>o(a).value=e,"default-value":null==(t=i.initialSeatsValues)?void 0:t[a],pricings:i.pricings},null,8,["modelValue","onUpdate:modelValue","default-value","pricings"])):e.createCommentVNode("",!0)]}),_:2},1024))),128))}}),Qe={class:"flex gap-4 border-l-2 border-primary-600 px-2"},Ze={class:"grow"},Xe=e.defineComponent({__name:"PricingGroupTitle",setup:i=>(i,n)=>(e.openBlock(),e.createElementBlock("div",Qe,[e.createElementVNode("div",Ze,[e.createVNode(e.unref(t._sfc_main$2),{tag:"span",variant:"body-sm",weight:"semibold"},{default:e.withCtx(()=>[e.renderSlot(i.$slots,"title")]),_:3})]),e.createElementVNode("div",null,[e.createVNode(e.unref(t._sfc_main$2),{tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.renderSlot(i.$slots,"description")]),_:3})])]))}),We={class:"p-1"},Je={class:"grid grid-cols-1 gap-1 pt-1"},et=e.defineComponent({__name:"AddonSingleEditor",props:e.mergeModels({constraint:{type:String},modelValue:{type:Array},pricings:{type:Array},billingPeriod:{type:Object},currency:{type:String},groupName:{type:String}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(i){const n=i,o=e.useModel(i,"modelValue"),{$t:a}=t.useIntl(),{renderPricingForPricingItem:r}=t.usePricingItem({currency:e.computed(()=>n.currency),billingPeriod:e.computed(()=>n.billingPeriod)}),l=n.pricings.map(e=>e.id),c=e.computed(()=>"AT_MOST_ONE"===n.constraint?a({defaultMessage:"Select up to one product",id:"addon_single_editor.description.at_most_one",description:"The description of the addon single editor for at most one product"}):"EXACTLY_ONE"===n.constraint?a({defaultMessage:"Select one product",id:"addon_single_editor.description.exactly_one",description:"The description of the addon single editor for exactly one product"}):"AT_LEAST_ONE"===n.constraint?a({defaultMessage:"Select at least one product",id:"addon_single_editor.description.at_least_one",description:"The description of the addon single editor for at least one product"}):""),u=e=>n.modelValue.includes(e);return(n,d)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{"no-spacing":""},{default:e.withCtx(()=>[e.createElementVNode("div",We,[e.createVNode(Xe,null,{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.groupName),1)]),description:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1}),e.createElementVNode("div",Je,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.pricings,i=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:i.id,"content-background":"none",class:e.normalizeClass({"!bg-white":u(i.id)})},{default:e.withCtx(()=>{var n,c;return[e.createVNode(ve,{name:e.unref(U)(i)??"",description:(null==(n=i.items)?void 0:n[0])?e.unref(r)({pricingItem:null==(c=i.items)?void 0:c[0]}):e.unref(a)({defaultMessage:"Unsupported pricing",id:"pricing_item_pricing.unsupported_pricing_error",description:"Text displayed when the pricing item pricing is unsupported"})},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$20),{"model-value":u(i.id),"onUpdate:modelValue":e=>(e=>{if(u(e))o.value=o.value.filter(t=>t!==e);else{const t=o.value.filter(e=>!l.includes(e));o.value=[...t,e]}})(i.id)},null,8,["model-value","onUpdate:modelValue"])]),_:2},1032,["name","description"])]}),_:2},1032,["class"]))),128))])])]),_:1}))}}),tt={class:"grid grid-cols-1 gap-1"},it=e.defineComponent({__name:"AddonMultipleEditor",props:e.mergeModels({modelValue:{type:Array},pricings:{type:Array},billingPeriod:{type:Object},currency:{type:String},groupName:{type:String}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(i){const n=i,o=e.useModel(i,"modelValue"),{$t:a}=t.useIntl(),{renderPricingForPricingItem:r}=t.usePricingItem({currency:e.computed(()=>n.currency),billingPeriod:e.computed(()=>n.billingPeriod)}),l=e=>o.value.includes(e),c=e=>{l(e)?o.value=o.value.filter(t=>t!==e):o.value=[...o.value,e]};return(n,o)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{"no-spacing":"","no-border":!i.groupName,"content-background":i.groupName?"gray":"none"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["grid grid-cols-1 gap-1",{"p-1":i.groupName}])},[i.groupName?(e.openBlock(),e.createBlock(Xe,{key:0},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.groupName),1)]),description:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Select any number of products",id:"addon_multiple_editor.description",description:"The description of the addon multiple editor"})),1)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",tt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.pricings,n=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:n.id,"content-background":i.groupName||l(n.id)?"none":"gray",class:e.normalizeClass({"!bg-white":l(n.id)})},{default:e.withCtx(()=>{var i,o;return[e.createVNode(ve,{name:e.unref(U)(n)??"",description:(null==(i=n.items)?void 0:i[0])?e.unref(r)({pricingItem:null==(o=n.items)?void 0:o[0]}):e.unref(a)({defaultMessage:"Unsupported pricing",id:"addon_multiple_editor.unsupported_pricing_error",description:"Text displayed when the pricing item pricing is unsupported"})},{default:e.withCtx(()=>[l(n.id)?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2H),{key:0,color:"gray",variant:"outline",square:"",size:"sm","icon-prefix":"remove_shopping_cart",onClick:e=>c(n.id)},null,8,["onClick"])):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2H),{key:1,color:"primary","icon-prefix":"add",size:"sm",onClick:e=>c(n.id)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Add to subscription ",id:"addon_multiple_editor.add_to_subscription_button",description:"The button to add a pricing to the subscription"})),1)]),_:1},8,["onClick"]))]),_:2},1032,["name","description"])]}),_:2},1032,["content-background","class"]))),128))])],2)]),_:1},8,["no-border","content-background"]))}});function nt(){return{isMobileViewport:p.useBreakpoints(p.breakpointsTailwind).smallerOrEqual("sm")}}const ot={class:"p-1"},at={class:"pt-1"},rt=e.defineComponent({__name:"PricingGroupSingleEditor",props:e.mergeModels({modelValue:{type:Array},pricings:{type:Array},billingPeriod:{type:Object},currency:{type:String},groupName:{type:String}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(i){const n=i,o=e.useModel(i,"modelValue"),{$t:a}=t.useIntl(),{renderPricingForPricingItem:r}=t.usePricingItem({currency:e.computed(()=>n.currency),billingPeriod:e.computed(()=>n.billingPeriod)}),{isMobileViewport:l}=nt(),c=e.computed(()=>n.pricings.map(e=>e.id)),u=e.computed({get:()=>o.value.find(e=>c.value.includes(e))??void 0,set:e=>{const t=o.value.filter(e=>!c.value.includes(e));o.value=e?[...t,e]:t}}),d=e.computed(()=>n.pricings.map(e=>{var t;const i=null==(t=e.items)?void 0:t[0];return{label:U(e)??"",value:e.id,description:i?r({pricingItem:i}):a({defaultMessage:"Unsupported pricing",id:"pricing_item_pricing.unsupported_pricing_error",description:"Text displayed when the pricing item pricing is unsupported"})}}));return(n,o)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{"no-spacing":""},{default:e.withCtx(()=>[e.createElementVNode("div",ot,[e.createVNode(Xe,null,{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.groupName),1)]),_:1}),e.createElementVNode("div",at,[d.value.length<=3?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1X),{key:0,modelValue:u.value,"onUpdate:modelValue":o[0]||(o[0]=e=>u.value=e),options:d.value.slice(0,3),direction:e.unref(l)?"column":"row","show-radio":!1},null,8,["modelValue","options","direction"])):d.value.length<=6?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1T),{key:1,"single-model-value":u.value,"onUpdate:singleModelValue":o[1]||(o[1]=e=>u.value=e),options:d.value.map(({value:e,label:t,description:i})=>({label:t,subLabel:i,value:e})),size:"xl","show-sub-label-in-input":""},null,8,["single-model-value","options"])):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1L),{key:2,modelValue:u.value,"onUpdate:modelValue":o[2]||(o[2]=e=>u.value=e),options:d.value,name:`pricing-group-range-input-${i.groupName}`},null,8,["modelValue","options","name"]))])])]),_:1}))}});const lt={class:"grid grid-cols-1 gap-1"},ct=e.defineComponent({__name:"PlanCustomizationEditor",props:e.mergeModels({subscription:{type:Object},enabledPricingIds:{type:Array},initialSeatsValues:{type:Array},billingPeriod:{type:Object},currency:{type:String}},{seatsValues:{required:!0},seatsValuesModifiers:{},enabledPricingIds:{required:!0},enabledPricingIdsModifiers:{}}),emits:["update:seatsValues","update:enabledPricingIds"],setup(i){const n=i,o=e.useModel(i,"seatsValues"),a=e.useModel(i,"enabledPricingIds"),{$t:r}=t.useIntl(),l=e.computed(()=>{var e;const t=null==(e=B({pricingPlanScheduleInfos:n.subscription.pricing_plan_schedule_infos,type:"DEFAULT"}))?void 0:e.pricing_plan_version;return t?function(e){var t;return((null==(t=e.pricing_categories)?void 0:t.flatMap(e=>e.pricings??[]))??[]).filter(e=>null!==e)}(t):[]}),c=e.computed(()=>l.value.filter(e=>"ADDON"===e.product_type)),u=e.computed(()=>$(n.subscription));return(n,d)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{title:e.unref(r)({defaultMessage:"Customize plan",id:"checkout.customize_plan_block.title",description:"The title of the customize plan block in the checkout form"}),"no-spacing":"","no-border":"","content-background":"none"},{default:e.withCtx(()=>[e.createElementVNode("div",lt,[e.createVNode(He,{modelValue:o.value,"onUpdate:modelValue":d[0]||(d[0]=e=>o.value=e),"initial-seats-values":i.initialSeatsValues,pricings:l.value},null,8,["modelValue","initial-seats-values","pricings"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,t=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.id},["DEFAULT"===t.product_type&&"EXACTLY_ONE"===t.selection_constraint?(e.openBlock(),e.createBlock(rt,{key:0,modelValue:a.value,"onUpdate:modelValue":d[1]||(d[1]=e=>a.value=e),"group-name":t.name,pricings:t.pricings,"billing-period":i.billingPeriod,currency:i.currency},null,8,["modelValue","group-name","pricings","billing-period","currency"])):"ADDON"===t.product_type&&"AT_MOST_ONE"===t.selection_constraint?(e.openBlock(),e.createBlock(et,{key:1,modelValue:a.value,"onUpdate:modelValue":d[2]||(d[2]=e=>a.value=e),"group-name":t.name,pricings:t.pricings,constraint:t.selection_constraint,"billing-period":i.billingPeriod,currency:i.currency},null,8,["modelValue","group-name","pricings","constraint","billing-period","currency"])):"ADDON"===t.product_type&&"ANY"===t.selection_constraint?(e.openBlock(),e.createBlock(it,{key:2,modelValue:a.value,"onUpdate:modelValue":d[3]||(d[3]=e=>a.value=e),pricings:t.pricings,"group-name":t.name,"billing-period":i.billingPeriod,currency:i.currency},null,8,["modelValue","pricings","group-name","billing-period","currency"])):e.createCommentVNode("",!0)],64))),128)),e.createVNode(it,{modelValue:a.value,"onUpdate:modelValue":d[4]||(d[4]=e=>a.value=e),pricings:c.value,"billing-period":i.billingPeriod,currency:i.currency},null,8,["modelValue","pricings","billing-period","currency"])])]),_:1},8,["title"]))}}),ut=["aria-expanded","aria-label"],dt={class:"flex flex-row items-center justify-between w-full gap-3 px-3 py-2 cursor-pointer"},st={class:"flex flex-row gap-2 items-center"},pt=["onKeydown"],mt=["aria-label"],gt={class:"flex flex-row items-center justify-between w-full gap-3 px-3 py-2 cursor-pointer"},ft={class:"flex flex-row gap-2 items-center"},vt={class:"sr-only","aria-live":"polite"},yt=e.defineComponent({__name:"PromotionCodeSection",props:{promotionCode:{default:null,type:[String,null]}},emits:["update:appliedCode","apply","remove"],setup(i,{emit:n}){const{$t:o}=t.useIntl(),a=i,r=n,l=e.ref(!1),c=e.ref(""),u=e.ref(""),d=e.ref(null),s=e.ref(null),p="promotion-code-"+ ++y;const m=`${p}-label`,g=`${p}-panel`,f=e.computed(()=>null!==a.promotionCode&&""!==a.promotionCode),v=e.computed(()=>c.value.trim().length>0),_=e.computed(()=>a.promotionCode??o({defaultMessage:"Promotion applied",id:"checkout.promotion_code.applied_label",description:"Fallback label for an applied promotion code in checkout"})),h=e.computed(()=>o({defaultMessage:l.value?"Collapse promotion code input":"Expand promotion code input",id:l.value?"checkout.promotion_code.collapse_aria_label":"checkout.promotion_code.expand_aria_label",description:"Aria label for the promotion code toggle button in checkout"})),b=e.computed(()=>o({defaultMessage:"Apply promotion code",id:"checkout.promotion_code.apply_aria_label",description:"Aria label for the promotion code apply button in checkout"})),M=e.computed(()=>o({defaultMessage:"Remove promotion code",id:"checkout.promotion_code.remove_aria_label",description:"Aria label for the promotion code remove button in checkout"})),N=()=>{c.value=""},I=()=>{l.value&&(l.value=!1)},k=()=>{f.value||(l.value=!l.value)},C=()=>{if(!v.value)return;const e=c.value.trim();r("update:appliedCode",e),r("apply",e),u.value=o({defaultMessage:"Promotion code applied",id:"checkout.promotion_code.applied_status",description:"Aria live message when a promotion code is applied in checkout"}),l.value=!1},x=()=>{r("update:appliedCode",null),r("remove"),u.value=o({defaultMessage:"Promotion code removed",id:"checkout.promotion_code.removed_status",description:"Aria live message when a promotion code is removed in checkout"}),N(),e.nextTick(()=>{var e;null==(e=d.value)||e.focus()})};return e.watch(l,t=>{if(!t)return N(),void e.nextTick(()=>{var e;null==(e=d.value)||e.focus()});e.nextTick(()=>{(()=>{var e;const t=null==(e=s.value)?void 0:e.querySelector("input");t instanceof HTMLInputElement&&t.focus()})()})}),e.watch(()=>a.promotionCode,e=>{e||N()}),(i,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[f.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:1,"no-border":"","no-spacing":"","content-background":"none",class:"w-full relative"},{default:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"w-full bg-white border border-primary-900 rounded","aria-label":M.value,onClick:x},[e.createElementVNode("div",gt,[e.createElementVNode("div",ft,[e.createVNode(e.unref(t._sfc_main$4),{icon:"local_activity"}),e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm",class:"font-semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(_.value),1)]),_:1})]),e.createVNode(e.unref(t._sfc_main$4),{icon:"close"})])],8,mt)]),_:1})):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:0,"no-spacing":"",class:"w-full relative"},{default:e.withCtx(()=>[e.createElementVNode("button",{ref_key:"toggleRef",ref:d,type:"button",class:"w-full","aria-expanded":l.value,"aria-controls":g,"aria-label":h.value,onClick:k},[e.createElementVNode("div",dt,[e.createElementVNode("div",st,[e.createVNode(e.unref(t._sfc_main$4),{icon:"local_activity"}),e.createVNode(e.unref(t._sfc_main$2),{id:m,variant:"body-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Add promotion code",id:"checkout.promotion_code.add_label",description:"Label for adding a promotion code in checkout"})),1)]),_:1})]),e.createVNode(e.unref(t._sfc_main$4),{icon:l.value?"remove":"add"},null,8,["icon"])])],8,ut),e.withDirectives(e.createElementVNode("div",{id:g,ref_key:"panelRef",ref:s,role:"region","aria-labelledby":m,class:"w-full border-t px-3 py-2 flex flex-row gap-2 items-center overflow-hidden",onKeydown:e.withKeys(e.withModifiers(I,["prevent"]),["esc"])},[e.createVNode(e.unref(t._sfc_main$2a),{modelValue:c.value,"onUpdate:modelValue":n[0]||(n[0]=e=>c.value=e),placeholder:e.unref(o)({defaultMessage:"Promotion code",id:"checkout.promotion_code.placeholder",description:"Placeholder for promotion code input in checkout"}),"aria-label":e.unref(o)({defaultMessage:"Promotion code",id:"checkout.promotion_code.input_aria_label",description:"Aria label for promotion code input in checkout"}),class:"w-full",onKeydown:e.withKeys(e.withModifiers(C,["prevent"]),["enter"])},null,8,["modelValue","placeholder","aria-label","onKeydown"]),e.createVNode(e.unref(t._sfc_main$2H),{type:"button",disabled:!v.value,"aria-label":b.value,"aria-disabled":!v.value,onClick:C},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Apply",id:"checkout.promotion_code.apply_button",description:"Button label for applying a promotion code in checkout"})),1)]),_:1},8,["disabled","aria-label","aria-disabled"])],40,pt),[[e.vShow,l.value]])]),_:1})),e.createElementVNode("span",vt,e.toDisplayString(u.value),1)],64))}}),_t={key:0},ht=e.defineComponent({__name:"Checkout",props:{configuration:{type:Object}},emits:["error","ready"],setup(i,{emit:n}){var a,r,l,c,u,d,p,g;const f=i,v=n,y=e.computed(()=>f.configuration),_=e.ref(),h=e.ref(),b=o.useLogger(),{$t:M,locale:N}=t.useIntl(),{formatTimePeriod:I}=t.useTimePeriod(),k=s.usePortal(),{isMobileViewport:C}=nt();if(b.info("COMPONENT_INITIALIZED","Checkout component initialized"),"INIT_PRICING_PLAN_SUBSCRIPTION"!==(null==(a=k.value)?void 0:a.type))throw b.error("INVALID_TOKEN","Invalid token"),Error("Invalid token");"REVOKED"===k.value.status&&(_.value={code:"RESOURCE_REVOKED",message:`Portal url with resource id "${k.value.id}" is revoked`},b.error("RESOURCE_REVOKED",`Portal url with resource id "${k.value.id}" is revoked`));const x=null==(l=null==(r=k.value)?void 0:r.init_pricing_plan_subscription)?void 0:l.pricing_plan_subscription_id,E=null==(u=null==(c=k.value)?void 0:c.init_pricing_plan_subscription)?void 0:u.success_url,{paymentMethodOptions:D,subscription:A,isPaymentMethodsPending:w,isInvoicePreviewPending:P,checkoutForm:V,invoicePreview:S,invoicePreviewByBillingPeriod:L,trialInvoicePreview:j,trialPeriod:z,authorizationContext:O,isPaid:U,amount:R,loadInvoicePreview:G,updateInvoicePreviewOnBillingInformationChange:K}=F({initialCountry:null==(d=f.configuration)?void 0:d.countryCode,initialEmail:null==(p=f.configuration)?void 0:p.email,subscriptionId:x,enabledPricingIds:null==(g=f.configuration)?void 0:g.enabledPricingIds}),q=async()=>{var e;await V.validation.value.$validate(),V.validation.value.$invalid||null==(e=h.value)||e.submit()},H=async()=>(await V.validation.value.$validate(),!V.validation.value.$invalid),Q=e.computed(()=>!!j.value),Z=e.computed(()=>!!S.value&&(e=>{var t;return(null==(t=e.periods)?void 0:t.some(e=>e.groups.some(e=>{var t;return null==(t=e.lines)?void 0:t.some(e=>e.product_items.some(e=>"USAGE_BASED"===e.model_type))})))??!1})(S.value)),X=e.computed(()=>V.form.value.country&&["US","CA"].includes(V.form.value.country)||!1),W=e.computed({get:()=>V.form.value.enabledPricingIds??[],set:e=>{V.form.value.enabledPricingIds=e}}),J=e.computed(()=>A.value?B({pricingPlanScheduleInfos:A.value.pricing_plan_schedule_infos,type:"DEFAULT"}):void 0),te=e.computed(()=>{var e,t;if(!A.value)return;const i=null==(t=null==(e=J.value)?void 0:e.pricing_plan_version)?void 0:t.pricing_currency_settings;return T({country:V.form.value.country,pricingCurrencySettings:i,fallbackCurrency:A.value.billing_currency})}),ie=e.computed(()=>{if(!J.value||!A.value)return new Set;const e=function({pricingPlanScheduleInfo:e}){const t=new Map;return(e.pricing_plan_version.pricing_categories??[]).forEach(e=>{var i;null==(i=e.pricings)||i.forEach(e=>{var i;null==(i=e.items)||i.forEach(e=>{var i;null==(i=e.pricing_currency_configs)||i.forEach(e=>{var i,n;const o=e.currency;null==(i=e.billing_period_configs)||i.forEach(e=>{var i;null==(i=e.configs)||i.forEach(i=>{i.id&&t.set(i.id,{currency:o,billingPeriod:e.billing_period})})}),null==(n=e.configs)||n.forEach(e=>{e.id&&t.set(e.id,{currency:o})})})})})}),t}({pricingPlanScheduleInfo:J.value}),t=te.value,i=A.value.billing_period,n=new Set;return e.forEach((e,o)=>{t&&e.currency!==t||i&&e.billingPeriod&&(e.billingPeriod.type!==i.type||e.billingPeriod.value!==i.value)||n.add(o)}),n}),ne=e.computed({get:()=>{const e=V.form.value.seatsValues??[],t=ie.value;return t.size?e.filter(({pricing_item_config_id:e})=>t.has(e)):e},set:e=>{const t=V.form.value.seatsValues??[],i=ie.value;if(!i.size)return void(V.form.value.seatsValues=e);const n=t.filter(({pricing_item_config_id:e})=>!i.has(e));V.form.value.seatsValues=n.concat(e)}}),ae=e.computed(()=>{var e,i,n,o,a;return j.value?M({defaultMessage:"{discounted_amount} for {trial_period}, then {subscription_amount}/{billing_period} until canceled, starting {start_date, date, ::MMMMd}.",id:"checkout.agreement.trial",description:"The agreement for the trial period"},{discounted_amount:"0.00"===j.value.tax_summary.total_amount.quantity?M({defaultMessage:"Free",id:"checkout.agreement.trial.free",description:"The free amount for the trial period"}):t.formatAmount(j.value.tax_summary.total_amount),trial_period:I(z.value,{short:!0}),subscription_amount:t.formatAmount((null==(e=S.value)?void 0:e.tax_summary.total_amount)??{quantity:"0.00",currency:"EUR"}),billing_period:I((null==(i=S.value)?void 0:i.billing_period)??{type:"MONTH",value:1},{short:!0,singular:!0,hideValueForExactPeriods:!0}),start_date:new Date(ge.value)}):M({defaultMessage:"{subscription_amount}/{billing_period} until canceled, starting {start_date, date, long}.",id:"checkout.agreement.subscription",description:"The agreement for the subscription"},{subscription_amount:(null==(n=S.value)?void 0:n.tax_summary.total_amount)?t.formatAmount(null==(o=S.value)?void 0:o.tax_summary.total_amount):"",billing_period:I((null==(a=S.value)?void 0:a.billing_period)??{type:"MONTH",value:1},{short:!0,singular:!0,hideValueForExactPeriods:!0}),start_date:new Date(ge.value)})}),re=e.computed(()=>{var e,t,i,n,o,a;if(!S.value)return;const r=(null==(e=A.value)?void 0:e.name)??(null==(o=null==(n=null==(i=null==(t=A.value)?void 0:t.pricing_plan_schedule_infos)?void 0:i.at(-1))?void 0:n.pricing_plan_version.pricing_plan)?void 0:o.name)??"Subscription";return{description:r,managementURL:"https://www.solvimon.com/account/billing",agreement:ae.value,...j.value&&z.value&&{trial:{label:M({defaultMessage:"Trial",id:"checkout.trial.label",description:"The label of the trial"}),amount:j.value.tax_summary.total_amount,startDate:se.value?new Date(se.value):void 0,endDate:me.value?new Date(me.value):void 0}},regular:{label:r,amount:S.value.tax_summary.total_amount,startDate:ge.value?new Date(ge.value):void 0,interval:(null==(a=A.value)?void 0:a.billing_period)??{type:"MONTH",value:1}}}}),ue=e=>{const{country:t,...i}=e;V.updateInitialState({...i,...t?{country:t}:{}})},de=e.computed(()=>{var e,t;return!((null==(e=f.configuration)?void 0:e.email)&&(null==(t=f.configuration)?void 0:t.countryCode))}),se=e.computed(()=>{var e,t,i;const n=null==(t=null==(e=j.value)?void 0:e.periods)?void 0:t[0],o=null==(i=pe.value)?void 0:i.trialStartDate;return(null==n?void 0:n.start_at)?new Date(n.start_at):o}),pe=e.computed(()=>function(e){var t;const i={trialStartDate:void 0,trialEndDate:void 0,subscriptionStartDate:void 0,subscriptionEndDate:void 0};if(!(null==(t=null==e?void 0:e.pricing_plan_schedule_infos)?void 0:t.length))return i;const n=new Date,o=B({type:"TRIAL",pricingPlanScheduleInfos:e.pricing_plan_schedule_infos});if((null==o?void 0:o.start_at)&&(i.trialStartDate=n,o.end_at)){const e=new Date(o.end_at).getTime()-new Date(o.start_at).getTime();i.trialEndDate=new Date(n.getTime()+e)}const a=B({type:"DEFAULT",pricingPlanScheduleInfos:e.pricing_plan_schedule_infos});if((null==a?void 0:a.start_at)&&(i.trialEndDate?i.subscriptionStartDate=i.trialEndDate:i.subscriptionStartDate=n,a.end_at)){const e=new Date(a.end_at).getTime()-new Date(a.start_at).getTime();i.subscriptionEndDate=new Date(n.getTime()+e)}return i}(A.value)),me=e.computed(()=>{var e,t,i;const n=null==(t=null==(e=j.value)?void 0:e.periods)?void 0:t[0],o=null==(i=pe.value)?void 0:i.trialEndDate;return(null==n?void 0:n.end_at)?new Date(n.end_at):o}),ge=e.computed(()=>{var e,t,i;const n=null==(t=null==(e=S.value)?void 0:e.periods)?void 0:t[0],o=null==(i=pe.value)?void 0:i.subscriptionStartDate;return(null==n?void 0:n.start_at)?new Date(n.start_at):o}),fe=e.computed(()=>!!(V.form.value.seatsValues&&V.form.value.seatsValues.length>0)||(!(!A.value||!function(e){return $(e).some(e=>"EXACTLY_ONE"===e.selection_constraint||"AT_LEAST_ONE"===e.selection_constraint)}(A.value))||!(!A.value||!function(e){const t=e.pricing_plan_schedule_infos.flatMap(e=>{var t;return(null==(t=e.pricing_plan_version.pricing_categories)?void 0:t.flatMap(e=>e.pricings??[]))??[]}),i=$(e);return t.some(e=>"ADDON"===e.product_type)||i.some(e=>"ADDON"===e.object_type)}(A.value)))),ve=e.ref(null),{applyPromotionCode:ye,removePromotionCode:_e,isPromotionCodePending:he,promotionCodeErrorMessage:be}=function({checkoutForm:t,updateInvoicePreviewOnBillingInformationChange:i,logger:n,formatErrorMessage:o,onInvalidPromotionCode:a,onApplyError:r}){const l=e.ref(!1),c=e.ref(null),u=(e,t)=>{c.value=o?o({action:e,error:t}):"apply"===e?"Promotion code could not be applied. Please try again.":"Promotion code could not be removed. Please try again."},d=async({suppressError:e=!1,preserveErrorMessage:o=!1}={})=>{o||(c.value=null),delete t.form.value.promotionCode,l.value=!0;try{await i({})}catch(a){null==n||n.capture(a,{code:"PROMOTION_CODE_REMOVE_FAILED",message:"Failed to remove promotion code"}),e||u("remove",a)}finally{l.value=!1}};return{applyPromotionCode:async e=>{const o=null==e?void 0:e.trim();if(o){c.value=null,t.form.value.promotionCode=o,l.value=!0;try{await i({promotionCode:o})}catch(s){null==n||n.capture(s,{code:"PROMOTION_CODE_APPLY_FAILED",message:"Failed to apply promotion code"}),u("apply",s),null==r||r(),(e=>"object"==typeof e&&null!==e&&"field"in e&&"promotion_codes"===e.field)(s)&&(null==a||a()),await d({suppressError:!0,preserveErrorMessage:!0})}finally{l.value=!1}}},removePromotionCode:d,isPromotionCodePending:l,promotionCodeErrorMessage:c}}({checkoutForm:V,updateInvoicePreviewOnBillingInformationChange:K,logger:b,formatErrorMessage:({action:e})=>M("apply"===e?{defaultMessage:"Promotion code could not be applied. Please try again.",id:"checkout.promotion_code.apply_failed",description:"Error message when applying a promotion code in checkout failed"}:{defaultMessage:"Promotion code could not be removed. Please try again.",id:"checkout.promotion_code.remove_failed",description:"Error message when removing a promotion code in checkout failed"}),onInvalidPromotionCode:()=>{ve.value=null},onApplyError:()=>{ve.value=null}}),Ne=()=>{U.value=!0,be.value=null},ke=e=>{A.value&&(A.value={...A.value,billing_period:e},G())};return e.onMounted(()=>{v("ready")}),(i,n)=>_.value?(e.openBlock(),e.createBlock(le,{key:0})):(e.openBlock(),e.createBlock(e.unref(s.ContentWithAsideLayout),{key:1},{header:e.withCtx(()=>[e.createVNode(m._sfc_main,{class:"min-h-[52px] w-96"},{default:e.withCtx(()=>{var t,i,n;return[e.unref(S)&&e.unref(A)&&ge.value?(e.openBlock(),e.createBlock(oe,{key:0,"trial-start-date":se.value,"trial-period":e.unref(z),"subscription-start-date":ge.value,"subscription-name":(null==(t=e.unref(A))?void 0:t.name)??"",amount:null==(i=e.unref(S))?void 0:i.invoice_amount_including_tax,"billing-period":null==(n=e.unref(A))?void 0:n.billing_period,"country-code":e.unref(V).form.value.country},null,8,["trial-start-date","trial-period","subscription-start-date","subscription-name","amount","billing-period","country-code"])):e.createCommentVNode("",!0)]}),_:1})]),content:e.withCtx(()=>{var i,a,r;return[e.unref(A)&&e.unref(C)?(e.openBlock(),e.createBlock(Me,{key:0,subscription:e.unref(A),invoice:e.unref(S),"invoice-preview-by-billing-period":e.unref(L),"trial-invoice":e.unref(j),"enabled-pricing-ids":W.value,"trial-period":e.unref(z),avatar:null==(i=y.value)?void 0:i.avatar,"is-paid":e.unref(U),"is-usage-based":Z.value,"is-preview-and-payment-methods-pending":e.unref(w)||e.unref(P),"country-code":e.unref(V).form.value.country,collapsible:"collapsed",variant:"products-inline",onBillingPeriodChange:ke},null,8,["subscription","invoice","invoice-preview-by-billing-period","trial-invoice","enabled-pricing-ids","trial-period","avatar","is-paid","is-usage-based","is-preview-and-payment-methods-pending","country-code"])):e.createCommentVNode("",!0),fe.value&&e.unref(A)?(e.openBlock(),e.createBlock(ct,{key:1,"seats-values":ne.value,"onUpdate:seatsValues":n[0]||(n[0]=e=>ne.value=e),"enabled-pricing-ids":W.value,"onUpdate:enabledPricingIds":n[1]||(n[1]=e=>W.value=e),subscription:e.unref(A),"initial-seats-values":null==(a=e.unref(V).initialState)?void 0:a.value.seatsValues,"billing-period":e.unref(A).billing_period,currency:te.value},null,8,["seats-values","enabled-pricing-ids","subscription","initial-seats-values","billing-period","currency"])):e.createCommentVNode("",!0),!e.unref(U)&&e.unref(V).form.value.country&&e.unref(R)&&re.value?(e.openBlock(),e.createBlock(je,{key:2,amount:e.unref(R),"country-code":e.unref(V).form.value.country,locale:e.unref(N),"payment-methods-options-response":e.unref(D)??[],"billing-information":re.value,"on-billing-information-change":e.unref(K),onUpdateBillingInformation:ue},null,8,["amount","country-code","locale","payment-methods-options-response","billing-information","on-billing-information-change"])):e.createCommentVNode("",!0),e.unref(U)?(e.openBlock(),e.createBlock(ce,{key:3,"redirect-url":e.unref(E)},null,8,["redirect-url"])):e.createCommentVNode("",!0),e.unref(U)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ee,{key:4,modelValue:e.unref(V).form.value,"onUpdate:modelValue":n[2]||(n[2]=t=>e.unref(V).form.value=t),validation:e.unref(V).validation,"read-only-email":null==(r=f.configuration)?void 0:r.email,"show-customer-info-on-top":de.value||e.unref(U),"is-billing-information-mandatory":X.value,"get-is-field-required":e.unref(V).getIsFieldRequired,"read-only":e.unref(U)},null,8,["modelValue","validation","read-only-email","show-customer-info-on-top","is-billing-information-mandatory","get-is-field-required","read-only"])),e.unref(U)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(m._sfc_main,{key:5,variant:"section",class:"min-h-[130px]"},{default:e.withCtx(()=>[!e.unref(w)||e.unref(w)&&e.unref(D).length>0?(e.openBlock(),e.createElementBlock("div",_t,[e.createVNode(e.unref(t._sfc_main$2),{variant:"heading-3",tag:"h2",class:"mb-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(M)({defaultMessage:"Payment method",id:"checkout.payment_method_block.title",description:"The title of the payment method block in the checkout form"})),1)]),_:1}),e.unref(V).form.value.country?0===e.unref(D).length?(e.openBlock(),e.createBlock(Ie,{key:1,icon:"credit_card_off"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(M)({defaultMessage:"No payment methods available",id:"checkout.payment_method_block.no_payment_methods_available_title",description:"The title shown when there are no available payment methods"})),1)]),message:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(M)({defaultMessage:"There are no available payment methods. Please contact support for more information.",id:"checkout.payment_method_block.no_payment_methods_available_message",description:"The message shown when there are no available payment methods"})),1)]),_:1})):e.unref(R)&&e.unref(V).form.value.country?(e.openBlock(),e.createBlock(o._sfc_main,{key:2,ref_key:"paymentIntegrationFormRef",ref:h,"country-code":e.unref(V).form.value.country,context:e.unref(O),amount:e.unref(R),variant:"AUTHORIZE","payment-method-options":e.unref(D)??[],"success-redirect-url":e.unref(E),"validate-on-submit":H,"force-store-payment-method":"",onPaymentSuccess:Ne,onReady:n[3]||(n[3]=e=>v("ready"))},null,8,["country-code","context","amount","payment-method-options","success-redirect-url"])):e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ie,{key:0,icon:"captive_portal"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(M)({defaultMessage:"Select your billing country",id:"checkout.payment_method_block.no_country_selected_title",description:"The title shown when no country is selected"})),1)]),message:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(M)({defaultMessage:"Payment methods will be shown after you select the billing country.",id:"checkout.payment_method_block.no_country_selected_message",description:"The message shown when no country is selected"})),1)]),_:1}))])):e.createCommentVNode("",!0)]),_:1}))]}),aside:e.withCtx(()=>[e.createVNode(m._sfc_main,{variant:"section",class:"min-h-[220px]"},{default:e.withCtx(()=>{var t;return[e.unref(A)&&e.unref(S)?(e.openBlock(),e.createBlock(Me,{key:0,subscription:e.unref(A),invoice:e.unref(S),"invoice-preview-by-billing-period":e.unref(L),"trial-invoice":e.unref(j),"enabled-pricing-ids":W.value,"trial-period":e.unref(z),"country-code":e.unref(V).form.value.country,avatar:null==(t=y.value)?void 0:t.avatar,"is-paid":e.unref(U),"is-usage-based":Z.value,"is-preview-and-payment-methods-pending":e.unref(w)||e.unref(P),onBillingPeriodChange:ke},null,8,["subscription","invoice","invoice-preview-by-billing-period","trial-invoice","enabled-pricing-ids","trial-period","country-code","avatar","is-paid","is-usage-based","is-preview-and-payment-methods-pending"])):e.createCommentVNode("",!0)]}),_:1}),e.unref(U)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(yt,{key:0,"promotion-code":ve.value,"onUpdate:appliedCode":n[4]||(n[4]=e=>ve.value=e),onRemove:e.unref(_e),onApply:e.unref(ye)},null,8,["promotion-code","onRemove","onApply"])),e.unref(be)?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$16),{key:1,class:"mt-2",title:e.unref(be)},null,8,["title"])):e.createCommentVNode("",!0),e.unref(U)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(m._sfc_main,{key:2,class:"min-h-[44px]"},{default:e.withCtx(()=>[e.unref(S)?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2H),{key:0,type:"button",size:"lg",class:"full-width",disabled:e.unref(he)||0===e.unref(D).length,onClick:q},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Q.value?e.unref(M)({defaultMessage:"Start trial",id:"checkout.pay_and_subscribe_button_trial.label",description:"The label of the start trial button in the checkout form"}):e.unref(M)({defaultMessage:"Pay and subscribe",id:"checkout.pay_and_subscribe_button.label",description:"The label of the pay and subscribe button in the checkout form"})),1)]),_:1},8,["disabled"])):e.createCommentVNode("",!0)]),_:1})),e.createVNode(e.unref(t._sfc_main$2),{tag:"div",variant:"body-sm",shade:"lighter",class:"flex grow justify-center"},{default:e.withCtx(()=>[e.createVNode(Y,{icon:"lock",kpi:e.unref(M)({defaultMessage:"Secure and encrypted payments",id:"checkout.kpi.encrypted_payments.label",description:"The encrypted payments KPI shown in the checkout"})},null,8,["kpi"])]),_:1})]),_:1}))}}),bt=e.defineComponent({__name:"Checkout.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},emits:["error","ready"],setup(i,{emit:n}){var a,r;const l=i,c=n,u=o.useLogger(),d=(e=>{if(e)return t.isValidCountryCode(e)?e:void u.error("INVALID_COUNTRY_CODE",`invalid country code provided: "${e}"`)})(null==(a=l.configuration)?void 0:a.countryCode),s=(e=>{if(e)return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?e:void u.error("INVALID_EMAIL",`invalid email provided: "${e}"`)})(null==(r=l.configuration)?void 0:r.email);return(n,o)=>{var a,r,l,u;return e.openBlock(),e.createBlock(t._sfc_main$1,{"custom-element-name":e.unref(Nt),environment:i.environment,locale:i.locale,"portal-object":i.portalObject,"allowed-portal-types":["INIT_PRICING_PLAN_SUBSCRIPTION"],"primary-color":null==(r=null==(a=i.branding)?void 0:a.colors)?void 0:r.primary,"secondary-color":null==(u=null==(l=i.branding)?void 0:l.colors)?void 0:u.secondary,"experimental-features":i.experimentalFeatures,"log-level":i.logLevel,"on-log":i.onLog,onError:o[1]||(o[1]=e=>n.$emit("error",e))},{default:e.withCtx(()=>{var t,a,r;return[e.createVNode(ht,{avatar:null==(a=null==(t=i.branding)?void 0:t.emblem)?void 0:a.public_url,email:e.unref(s),"country-code":e.unref(d),"enabled-pricing-ids":null==(r=i.configuration)?void 0:r.enabledPricingIds,onReady:o[0]||(o[0]=e=>c("ready"))},e.createSlots({_:2},[n.$slots["terms-and-conditions"]?{name:"terms-and-conditions",fn:e.withCtx(()=>[e.renderSlot(n.$slots,"terms-and-conditions")]),key:"0"}:void 0]),1032,["avatar","email","country-code","enabled-pricing-ids"])]}),_:3},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}}),Mt=t.defineCustomElement(bt),Nt=t.getComponentName("checkout");exports.COMPONENT_NAME=Nt,exports.SolvimonCheckout=Mt,exports._sfc_main=bt,exports.defineSolvimonCheckout=()=>{customElements.get(Nt)||customElements.define(Nt,Mt)};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("vue"),t=require("./_Uint8Array-DxISR7XF.js"),a=require("./component-Df5eNqYX.js"),o=require("./ContentWithAsideLayout-CIVSoqFr.js"),n=require("./useInvoicesList-BZQ9Y0qN.js"),l=require("./SubscriptionsList.vue_vue_type_script_setup_true_lang-DqZLFDCv.js"),r=require("./useCustomer-Dp8sGHI0.js"),s=require("./usePaymentMethods-Dbimodf0.js"),i=require("./BillingInformation.vue_vue_type_script_setup_true_lang-VMlVPI4O.js"),u=require("./useLoadInitialData-BRg7IWqW.js"),c=require("./useCustomerPaymentMethodOptions-DYpMDnJR.js"),m=require("./useService-bNNi4GB8.js"),p=require("./Skeleton.vue_vue_type_script_setup_true_lang-CQqTurIt.js");function d({customerId:t}){const{getCustomerWalletBalances:o}=function(){const e=a.createRequestService(),t=a.useConfig();return{getCustomerWalletBalances:function(a){return e({url:`${t.apiUrls.config}/portal/customers/${a}/wallets/balance`,options:{method:"POST"},data:{}})}}}(),{data:n,execute:l,apiStatus:r,error:s,isPending:i}=m.useService({service:()=>o(t)});return{walletBalances:e.computed(()=>n.value??null),apiStatus:r,error:s,fetch:l,isPending:i}}const v=e.defineComponent({__name:"CustomerWalletBalancesBlock",props:{walletBalances:{type:Array}},setup(t){const{$t:o}=a.useIntl();return(n,l)=>(e.openBlock(),e.createBlock(e.unref(a._sfc_main$1f),{items:t.walletBalances,title:e.unref(o)({defaultMessage:"{count, plural, one {Wallet} other {Wallets}}",description:"Title for the wallets block on the customer overview page",id:"customer_overview.wallet_balances_block.title"},{count:String(t.walletBalances.length)})},null,8,["items","title"]))}}),f=e.defineComponent({__name:"CustomerWalletBalances",props:{hasError:{type:Boolean},isLoading:{type:Boolean},walletBalances:{type:Array}},setup(t){const{$t:o}=a.useIntl();return(n,l)=>t.isLoading?(e.openBlock(),e.createBlock(p._sfc_main,{key:0,variant:"section",class:"min-h-48","data-testid":"customer-wallet-balances-skeleton"})):t.hasError?(e.openBlock(),e.createBlock(e.unref(a._sfc_main$16),{key:1,title:e.unref(o)({defaultMessage:"Could not load wallet balances",description:"Error shown when wallet balances fail to load",id:"wallet_balance.load_failed"})},null,8,["title"])):t.walletBalances.length>0?(e.openBlock(),e.createBlock(v,{key:2,"wallet-balances":t.walletBalances},null,8,["wallet-balances"])):e.createCommentVNode("",!0)}}),_=e.defineComponent({__name:"CustomerOverview",props:{configuration:{type:Object}},setup(m){var p;const v=null==(p=o.usePortal().value)?void 0:p.customer_id,_=r.useCustomer({customerId:v}),y=n.useInvoicesList({customerId:v,batchSize:5}),g=l.useSubscriptionsList({customerId:v,batchSize:2}),h=s.usePaymentMethods({customerId:v}),w=c.useCustomerPaymentMethodOptions({customerId:v}),b=d({customerId:v}),{$t:B}=a.useIntl(),C=e.computed(()=>{var e;return((null==(e=b.walletBalances.value)?void 0:e.wallet_balances)??[]).map(e=>{var t;return{walletId:e.wallet_id,title:B({defaultMessage:"Balance",description:"Fallback wallet title on the customer overview page",id:"H5+NAX"}),balance:e.wallet_balance.open_balance,balanceAt:e.wallet_balance.balance_at??(null==(t=b.walletBalances.value)?void 0:t.balance_at)??null}})}),{isLoading:k}=u.useLoadInitialData(_.get.execute(),y.fetchInitial(),g.fetchInitial(),h.fetchAll(),w.fetch(),b.fetch());return(a,r)=>(e.openBlock(),e.createBlock(e.unref(o.ContentWithAsideLayout),null,{header:e.withCtx(()=>[e.unref(_).customer.value?(e.openBlock(),e.createBlock(l._sfc_main,{key:0,customer:e.unref(_).customer.value,subscriptions:e.unref(g).items.value,"payment-methods":e.unref(h).items.value,"is-loading":e.unref(k),"has-more-items":e.unref(g).hasNextBatch.value,onLoadMore:e.unref(g).fetchMore},null,8,["customer","subscriptions","payment-methods","is-loading","has-more-items","onLoadMore"])):e.createCommentVNode("",!0)]),content:e.withCtx(()=>[e.createVNode(n._sfc_main,{invoices:e.unref(y).items.value,"has-more-items":e.unref(y).hasNextBatch.value,"is-loading":e.unref(k),onLoadMore:e.unref(y).fetchMore},null,8,["invoices","has-more-items","is-loading","onLoadMore"])]),aside:e.withCtx(()=>[e.createVNode(f,{"has-error":e.unref(b).apiStatus.value===e.unref(t.ApiStatus).Failed,"is-loading":e.unref(k),"wallet-balances":C.value},null,8,["has-error","is-loading","wallet-balances"]),e.createVNode(c._sfc_main,{"is-loading":e.unref(k),"payment-methods":e.unref(h).items.value,"payment-methods-options":e.unref(w).items.value},null,8,["is-loading","payment-methods","payment-methods-options"]),e.unref(_).customer.value?(e.openBlock(),e.createBlock(i._sfc_main,{key:0,"is-loading":e.unref(k),customer:e.unref(_).customer.value,"payment-methods":e.unref(h).items.value},null,8,["is-loading","customer","payment-methods"])):e.createCommentVNode("",!0)]),_:1}))}}),y=e.defineComponent({__name:"CustomerOverview.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup:t=>(o,n)=>{var l,r,s,i;return e.openBlock(),e.createBlock(a._sfc_main$1,{"custom-element-name":e.unref(h),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(r=null==(l=t.branding)?void 0:l.colors)?void 0:r.primary,"secondary-color":null==(i=null==(s=t.branding)?void 0:s.colors)?void 0:i.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,onError:n[0]||(n[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(_)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),g=a.defineCustomElement(y),h=a.getComponentName("customer-overview");exports.COMPONENT_NAME=h,exports.SolvimonCustomerOverview=g,exports._sfc_main=y,exports.defineSolvimonCustomerOverview=()=>{customElements.get(h)||customElements.define(h,g)};
|
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
import { computed, defineComponent, openBlock, createBlock, unref, createCommentVNode, withCtx, createVNode } from "vue";
|
|
2
|
-
import { A as ApiStatus } from "./_Uint8Array-DHE03FZr.mjs";
|
|
3
|
-
import { c as createRequestService, u as useConfig, b as useIntl, D as _sfc_main$1f, E as _sfc_main$16, o as _sfc_main$9, p as defineCustomElement, n as getComponentName } from "./component-BkmcE85U.mjs";
|
|
4
|
-
import { u as usePortal, C as ContentWithAsideLayout } from "./ContentWithAsideLayout-BC-C5Gjt.mjs";
|
|
5
|
-
import { u as useInvoicesList, _ as _sfc_main$7 } from "./useInvoicesList-rDvRzMqe.mjs";
|
|
6
|
-
import { u as useSubscriptionsList, _ as _sfc_main$8 } from "./SubscriptionsList.vue_vue_type_script_setup_true_lang-DfB5BqiH.mjs";
|
|
7
|
-
import { u as useCustomer } from "./useCustomer-BRY0tuBH.mjs";
|
|
8
|
-
import { u as usePaymentMethods } from "./usePaymentMethods-Bq5fWl1Q.mjs";
|
|
9
|
-
import { _ as _sfc_main$6 } from "./BillingInformation.vue_vue_type_script_setup_true_lang-B42EzZ97.mjs";
|
|
10
|
-
import { u as useLoadInitialData } from "./useLoadInitialData-Dm48tlSO.mjs";
|
|
11
|
-
import { u as useCustomerPaymentMethodOptions, _ as _sfc_main$5 } from "./useCustomerPaymentMethodOptions-Fe_dLxfv.mjs";
|
|
12
|
-
import { u as useService } from "./useService-Dz13Nxbi.mjs";
|
|
13
|
-
import { _ as _sfc_main$4 } from "./Skeleton.vue_vue_type_script_setup_true_lang-BFFJw-5h.mjs";
|
|
14
|
-
function createWalletsService() {
|
|
15
|
-
const request = createRequestService();
|
|
16
|
-
const config = useConfig();
|
|
17
|
-
function getCustomerWalletBalances(customerId) {
|
|
18
|
-
return request({
|
|
19
|
-
url: `${config.apiUrls.config}/portal/customers/${customerId}/wallets/balance`,
|
|
20
|
-
options: { method: "POST" },
|
|
21
|
-
data: {}
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
return {
|
|
25
|
-
getCustomerWalletBalances
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
function useCustomerWalletBalances({ customerId }) {
|
|
29
|
-
const { getCustomerWalletBalances } = createWalletsService();
|
|
30
|
-
const { data, execute, apiStatus, error, isPending } = useService({
|
|
31
|
-
service: () => getCustomerWalletBalances(customerId)
|
|
32
|
-
});
|
|
33
|
-
const walletBalances = computed(
|
|
34
|
-
() => data.value ?? null
|
|
35
|
-
);
|
|
36
|
-
return { walletBalances, apiStatus, error, fetch: execute, isPending };
|
|
37
|
-
}
|
|
38
|
-
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
39
|
-
__name: "CustomerWalletBalancesBlock",
|
|
40
|
-
props: {
|
|
41
|
-
walletBalances: { type: Array }
|
|
42
|
-
},
|
|
43
|
-
setup(__props) {
|
|
44
|
-
const { $t } = useIntl();
|
|
45
|
-
return (_ctx, _cache) => {
|
|
46
|
-
return openBlock(), createBlock(unref(_sfc_main$1f), {
|
|
47
|
-
items: __props.walletBalances,
|
|
48
|
-
title: unref($t)(
|
|
49
|
-
{
|
|
50
|
-
defaultMessage: "{count, plural, one {Wallet} other {Wallets}}",
|
|
51
|
-
description: "Title for the wallets block on the customer overview page",
|
|
52
|
-
id: "customer_overview.wallet_balances_block.title"
|
|
53
|
-
},
|
|
54
|
-
{ count: String(__props.walletBalances.length) }
|
|
55
|
-
)
|
|
56
|
-
}, null, 8, ["items", "title"]);
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
61
|
-
__name: "CustomerWalletBalances",
|
|
62
|
-
props: {
|
|
63
|
-
hasError: { type: Boolean },
|
|
64
|
-
isLoading: { type: Boolean },
|
|
65
|
-
walletBalances: { type: Array }
|
|
66
|
-
},
|
|
67
|
-
setup(__props) {
|
|
68
|
-
const { $t } = useIntl();
|
|
69
|
-
return (_ctx, _cache) => {
|
|
70
|
-
return __props.isLoading ? (openBlock(), createBlock(_sfc_main$4, {
|
|
71
|
-
key: 0,
|
|
72
|
-
variant: "section",
|
|
73
|
-
class: "min-h-48",
|
|
74
|
-
"data-testid": "customer-wallet-balances-skeleton"
|
|
75
|
-
})) : __props.hasError ? (openBlock(), createBlock(unref(_sfc_main$16), {
|
|
76
|
-
key: 1,
|
|
77
|
-
title: unref($t)({
|
|
78
|
-
defaultMessage: "Could not load wallet balances",
|
|
79
|
-
description: "Error shown when wallet balances fail to load",
|
|
80
|
-
id: "wallet_balance.load_failed"
|
|
81
|
-
})
|
|
82
|
-
}, null, 8, ["title"])) : __props.walletBalances.length > 0 ? (openBlock(), createBlock(_sfc_main$3, {
|
|
83
|
-
key: 2,
|
|
84
|
-
"wallet-balances": __props.walletBalances
|
|
85
|
-
}, null, 8, ["wallet-balances"])) : createCommentVNode("", true);
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
90
|
-
__name: "CustomerOverview",
|
|
91
|
-
props: {
|
|
92
|
-
configuration: { type: Object }
|
|
93
|
-
},
|
|
94
|
-
setup(__props) {
|
|
95
|
-
var _a;
|
|
96
|
-
const portal = usePortal();
|
|
97
|
-
const customerId = (_a = portal.value) == null ? void 0 : _a.customer_id;
|
|
98
|
-
const customer = useCustomer({ customerId });
|
|
99
|
-
const invoices = useInvoicesList({ customerId, batchSize: 5 });
|
|
100
|
-
const subscriptions = useSubscriptionsList({ customerId, batchSize: 2 });
|
|
101
|
-
const paymentMethods = usePaymentMethods({ customerId });
|
|
102
|
-
const customerPaymentMethodOptions = useCustomerPaymentMethodOptions({ customerId });
|
|
103
|
-
const customerWalletBalances = useCustomerWalletBalances({ customerId });
|
|
104
|
-
const { $t } = useIntl();
|
|
105
|
-
const walletBalanceItems = computed(
|
|
106
|
-
() => {
|
|
107
|
-
var _a2;
|
|
108
|
-
return (((_a2 = customerWalletBalances.walletBalances.value) == null ? void 0 : _a2.wallet_balances) ?? []).map((walletBalance) => {
|
|
109
|
-
var _a3;
|
|
110
|
-
return {
|
|
111
|
-
walletId: walletBalance.wallet_id,
|
|
112
|
-
title: $t({
|
|
113
|
-
defaultMessage: "Balance",
|
|
114
|
-
description: "Fallback wallet title on the customer overview page",
|
|
115
|
-
id: "H5+NAX"
|
|
116
|
-
}),
|
|
117
|
-
balance: walletBalance.wallet_balance.open_balance,
|
|
118
|
-
balanceAt: walletBalance.wallet_balance.balance_at ?? ((_a3 = customerWalletBalances.walletBalances.value) == null ? void 0 : _a3.balance_at) ?? null
|
|
119
|
-
};
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
);
|
|
123
|
-
const { isLoading } = useLoadInitialData(
|
|
124
|
-
customer.get.execute(),
|
|
125
|
-
invoices.fetchInitial(),
|
|
126
|
-
subscriptions.fetchInitial(),
|
|
127
|
-
paymentMethods.fetchAll(),
|
|
128
|
-
customerPaymentMethodOptions.fetch(),
|
|
129
|
-
customerWalletBalances.fetch()
|
|
130
|
-
);
|
|
131
|
-
return (_ctx, _cache) => {
|
|
132
|
-
return openBlock(), createBlock(unref(ContentWithAsideLayout), null, {
|
|
133
|
-
header: withCtx(() => [
|
|
134
|
-
unref(customer).customer.value ? (openBlock(), createBlock(_sfc_main$8, {
|
|
135
|
-
key: 0,
|
|
136
|
-
customer: unref(customer).customer.value,
|
|
137
|
-
subscriptions: unref(subscriptions).items.value,
|
|
138
|
-
"payment-methods": unref(paymentMethods).items.value,
|
|
139
|
-
"is-loading": unref(isLoading),
|
|
140
|
-
"has-more-items": unref(subscriptions).hasNextBatch.value,
|
|
141
|
-
onLoadMore: unref(subscriptions).fetchMore
|
|
142
|
-
}, null, 8, ["customer", "subscriptions", "payment-methods", "is-loading", "has-more-items", "onLoadMore"])) : createCommentVNode("", true)
|
|
143
|
-
]),
|
|
144
|
-
content: withCtx(() => [
|
|
145
|
-
createVNode(_sfc_main$7, {
|
|
146
|
-
invoices: unref(invoices).items.value,
|
|
147
|
-
"has-more-items": unref(invoices).hasNextBatch.value,
|
|
148
|
-
"is-loading": unref(isLoading),
|
|
149
|
-
onLoadMore: unref(invoices).fetchMore
|
|
150
|
-
}, null, 8, ["invoices", "has-more-items", "is-loading", "onLoadMore"])
|
|
151
|
-
]),
|
|
152
|
-
aside: withCtx(() => [
|
|
153
|
-
createVNode(_sfc_main$2, {
|
|
154
|
-
"has-error": unref(customerWalletBalances).apiStatus.value === unref(ApiStatus).Failed,
|
|
155
|
-
"is-loading": unref(isLoading),
|
|
156
|
-
"wallet-balances": walletBalanceItems.value
|
|
157
|
-
}, null, 8, ["has-error", "is-loading", "wallet-balances"]),
|
|
158
|
-
createVNode(_sfc_main$5, {
|
|
159
|
-
"is-loading": unref(isLoading),
|
|
160
|
-
"payment-methods": unref(paymentMethods).items.value,
|
|
161
|
-
"payment-methods-options": unref(customerPaymentMethodOptions).items.value
|
|
162
|
-
}, null, 8, ["is-loading", "payment-methods", "payment-methods-options"]),
|
|
163
|
-
unref(customer).customer.value ? (openBlock(), createBlock(_sfc_main$6, {
|
|
164
|
-
key: 0,
|
|
165
|
-
"is-loading": unref(isLoading),
|
|
166
|
-
customer: unref(customer).customer.value,
|
|
167
|
-
"payment-methods": unref(paymentMethods).items.value
|
|
168
|
-
}, null, 8, ["is-loading", "customer", "payment-methods"])) : createCommentVNode("", true)
|
|
169
|
-
]),
|
|
170
|
-
_: 1
|
|
171
|
-
});
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
176
|
-
__name: "CustomerOverview.entry",
|
|
177
|
-
props: {
|
|
178
|
-
environment: { type: String },
|
|
179
|
-
locale: { type: String },
|
|
180
|
-
dateLocale: { type: String },
|
|
181
|
-
messages: { type: Object },
|
|
182
|
-
showTimezones: { type: Boolean },
|
|
183
|
-
primaryColor: { type: String },
|
|
184
|
-
secondaryColor: { type: String },
|
|
185
|
-
isShadowRoot: { type: Boolean },
|
|
186
|
-
experimentalFeatures: { type: Array },
|
|
187
|
-
logLevel: { type: String },
|
|
188
|
-
onLog: { type: Function },
|
|
189
|
-
allowedPortalTypes: { type: Array },
|
|
190
|
-
portalObject: { type: Object },
|
|
191
|
-
customElementName: { type: String },
|
|
192
|
-
branding: { type: Object },
|
|
193
|
-
configuration: { type: Object }
|
|
194
|
-
},
|
|
195
|
-
setup(__props) {
|
|
196
|
-
return (_ctx, _cache) => {
|
|
197
|
-
var _a, _b, _c, _d;
|
|
198
|
-
return openBlock(), createBlock(_sfc_main$9, {
|
|
199
|
-
"custom-element-name": unref(COMPONENT_NAME),
|
|
200
|
-
environment: __props.environment,
|
|
201
|
-
locale: __props.locale,
|
|
202
|
-
"portal-object": __props.portalObject,
|
|
203
|
-
"allowed-portal-types": ["CUSTOMER"],
|
|
204
|
-
"primary-color": (_b = (_a = __props.branding) == null ? void 0 : _a.colors) == null ? void 0 : _b.primary,
|
|
205
|
-
"secondary-color": (_d = (_c = __props.branding) == null ? void 0 : _c.colors) == null ? void 0 : _d.secondary,
|
|
206
|
-
"experimental-features": __props.experimentalFeatures,
|
|
207
|
-
"log-level": __props.logLevel,
|
|
208
|
-
"on-log": __props.onLog,
|
|
209
|
-
onError: _cache[0] || (_cache[0] = (error) => _ctx.$emit("error", error))
|
|
210
|
-
}, {
|
|
211
|
-
default: withCtx(() => [
|
|
212
|
-
createVNode(_sfc_main$1)
|
|
213
|
-
]),
|
|
214
|
-
_: 1
|
|
215
|
-
}, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log"]);
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
const SolvimonCustomerOverview = defineCustomElement(_sfc_main);
|
|
220
|
-
const COMPONENT_NAME = getComponentName("customer-overview");
|
|
221
|
-
const defineSolvimonCustomerOverview = () => {
|
|
222
|
-
if (!customElements.get(COMPONENT_NAME)) {
|
|
223
|
-
customElements.define(COMPONENT_NAME, SolvimonCustomerOverview);
|
|
224
|
-
}
|
|
225
|
-
};
|
|
226
|
-
export {
|
|
227
|
-
COMPONENT_NAME as C,
|
|
228
|
-
SolvimonCustomerOverview as S,
|
|
229
|
-
_sfc_main as _,
|
|
230
|
-
defineSolvimonCustomerOverview as d
|
|
231
|
-
};
|