@solvimon/solvimon-web 0.1.0-alpha.7 → 0.1.0-alpha.8

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.
Files changed (202) hide show
  1. package/dist/ApiStatus-CyNDp_op.mjs +9 -0
  2. package/dist/ApiStatus-oqvUEWJx.js +1 -0
  3. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-C-C0i6i6.js +1 -0
  4. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-CupcH8TZ.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-CT0Tjsnw.mjs} +2 -4
  5. package/dist/{ContentWithAsideLayout-Ct24RV-2.mjs → ContentWithAsideLayout-BTdixy3L.mjs} +2 -11
  6. package/dist/ContentWithAsideLayout-oAYVrLvL.js +1 -0
  7. package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-DZJ0xukI.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CK73bYUe.mjs} +2 -5
  8. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CLU7Yiyx.js +1 -0
  9. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-B_WLgBur.js +1 -0
  10. package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DsrBsrtk.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-Dt_Vb7Wz.mjs} +1 -2
  11. package/dist/PaymentHistoryBlock-DHM-3fh-.js +1 -0
  12. package/dist/PaymentHistoryBlock-YzJ6bxKr.mjs +4 -0
  13. package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-BnKwmJ2s.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-D6Cr2Uga.mjs} +1 -5
  14. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DFw8lrDv.js +1 -0
  15. package/dist/PaymentIntegrationForm-Cl5ua8v8.js +1 -0
  16. package/dist/PaymentIntegrationForm-ID4QnvA3.mjs +4 -0
  17. package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BE1lWOk9.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CVWPT3Ni.mjs} +32 -189
  18. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DifRn1ok.js +1 -0
  19. package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-CKNMt-JH.js +1 -0
  20. package/dist/{PricingGroupContent.vue_vue_type_script_setup_true_lang-BbvDXvIS.mjs → PricingGroupContent.vue_vue_type_script_setup_true_lang-CzS32ZUt.mjs} +5 -31
  21. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DVhJy0t8.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-BIxGqr9U.mjs} +4 -7
  22. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-CpEqDnO3.js +1 -0
  23. package/dist/adyenLoader-CEH4A2b2.js +1 -0
  24. package/dist/adyenLoader-gsbzSjYV.mjs +177 -0
  25. package/dist/component-C2Gc-wsE.js +1 -0
  26. package/dist/component-CM9g6tbD.mjs +804 -0
  27. package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -1
  28. package/dist/components/BillingInformation/BillingInformation.es.js +3 -7
  29. package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -1
  30. package/dist/components/BillingInformationForm/BillingInformationForm.es.js +9 -17
  31. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -1
  32. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +3 -7
  33. package/dist/components/Invoice/Invoice.cjs.js +1 -1
  34. package/dist/components/Invoice/Invoice.es.js +42 -2659
  35. package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
  36. package/dist/components/InvoiceDetails/InvoiceDetails.es.js +3 -7
  37. package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -1
  38. package/dist/components/InvoicesList/InvoicesList.es.js +2 -6
  39. package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -1
  40. package/dist/components/PaymentHistory/PaymentHistory.es.js +3 -7
  41. package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -1
  42. package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +7 -33
  43. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
  44. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +8 -4824
  45. package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -1
  46. package/dist/components/SubscriptionsList/SubscriptionsList.es.js +4 -8
  47. package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -1
  48. package/dist/components/WalletBalances/WalletBalances.es.js +3 -7
  49. package/dist/core/index.cjs.js +1 -1
  50. package/dist/core/index.es.js +1 -1
  51. package/dist/core/types.d.ts +2 -0
  52. package/dist/{customer-CcQR-JIm.js → customer-C_Hz_npf.js} +1 -1
  53. package/dist/{customer-CJrpbGX4.mjs → customer-TIi7iZFw.mjs} +1 -1
  54. package/dist/en-US-CBoPxQwX.mjs +199 -0
  55. package/dist/en-US-DJq-9dD8.js +1 -0
  56. package/dist/index-CzL1ZcGi.mjs +85 -0
  57. package/dist/index-DRdBmZ2-.js +1 -0
  58. package/dist/index.cjs.js +1 -1
  59. package/dist/index.d.ts +1 -0
  60. package/dist/index.es.js +4 -1
  61. package/dist/{invoices-CNK1Ushv.mjs → invoices-BuVOuTOm.mjs} +2 -15
  62. package/dist/invoices-DbvwXAsm.js +1 -0
  63. package/dist/nl-NL-BB7KbK-h.mjs +181 -0
  64. package/dist/nl-NL-CtU1Lg2F.js +1 -0
  65. package/dist/paymentMethods-B4AYGf0K.js +1 -0
  66. package/dist/{paymentMethods-C-ApE-G4.mjs → paymentMethods-Di32oJ39.mjs} +2 -2
  67. package/dist/{payments-CE9U7aKK.mjs → payments-C5fD1PXB.mjs} +1 -1
  68. package/dist/{payments-CLt0SExf.js → payments-DeutKq9x.js} +1 -1
  69. package/dist/{registry-B99ZnfEn.mjs → registry-BLwMl1bK.mjs} +6 -4
  70. package/dist/registry-CMSmkLcy.js +1 -0
  71. package/dist/screens/Checkout/Checkout.cjs.js +1 -1
  72. package/dist/screens/Checkout/Checkout.es.js +420 -2388
  73. package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
  74. package/dist/screens/CustomerOverview/CustomerOverview.es.js +13 -14
  75. package/dist/screens/PayInvoice/PayInvoice.ce.d.ts +3 -0
  76. package/dist/screens/PayInvoice/PayInvoice.cjs.js +1 -0
  77. package/dist/screens/PayInvoice/PayInvoice.es.js +456 -0
  78. package/dist/screens/UpgradeSubscription/UpgradeSubscription.cjs.js +1 -1
  79. package/dist/screens/UpgradeSubscription/UpgradeSubscription.es.js +79 -61
  80. package/dist/solvimon-web.css +1 -1
  81. package/dist/source-DKDKBlUm.mjs +179 -0
  82. package/dist/source-dkMNFWDc.js +1 -0
  83. package/dist/{subscriptions-CoeCrY1I.mjs → subscriptions-mOgjjzUi.mjs} +2 -2
  84. package/dist/subscriptions-wdMADcQZ.js +1 -0
  85. package/dist/{useActionDispatchProvider-eO2qFPGv.mjs → useActionDispatchProvider-B4gszz0Q.mjs} +1 -1
  86. package/dist/{useActionDispatchProvider-CWVV_xsi.js → useActionDispatchProvider-DfS2P0bd.js} +1 -1
  87. package/dist/{useCustomer-PthyTFLl.js → useCustomer-DanZzn-l.js} +1 -1
  88. package/dist/{useCustomer--jycAz--.mjs → useCustomer-cbhDyWJL.mjs} +2 -2
  89. package/dist/useIncrementalLoading-DFe5Yh8M.js +1 -0
  90. package/dist/{useIncrementalLoading-CcnL3flF.mjs → useIncrementalLoading-RRicokf1.mjs} +3 -8
  91. package/dist/useInvoiceData-CxxHa5R2.js +1 -0
  92. package/dist/{useInvoiceData-BiMMoVoW.mjs → useInvoiceData-fS6G_244.mjs} +6 -12
  93. package/dist/{useInvoicesList-DFhF_gp7.mjs → useInvoicesList-BQQxcPdz.mjs} +23 -260
  94. package/dist/useInvoicesList-CtJqmblZ.js +1 -0
  95. package/dist/usePaymentMethodOptions-2MloZ9bY.mjs +26 -0
  96. package/dist/usePaymentMethodOptions-D01YWW3G.js +1 -0
  97. package/dist/{usePaymentMethods-BRQ7-dUr.js → usePaymentMethods-Cm9WdSW0.js} +1 -1
  98. package/dist/{usePaymentMethods-BX2RnHZN.mjs → usePaymentMethods-DZvfWSlx.mjs} +2 -2
  99. package/dist/usePayments-B13S_yai.js +1 -0
  100. package/dist/usePayments-D4uGKBsV.mjs +36 -0
  101. package/dist/usePortal-DJDJNLbo.mjs +12 -0
  102. package/dist/usePortal-DWJEVkTj.js +1 -0
  103. package/dist/useService-9fCKPTmu.js +1 -0
  104. package/dist/useService-BuWWE5ND.mjs +68 -0
  105. package/dist/useViewport-Bu0cyeSi.mjs +38 -0
  106. package/dist/useViewport-CKRY1CKR.js +1 -0
  107. package/dist/useWalletBalanceItems-B53Gkjro.mjs +106 -0
  108. package/dist/useWalletBalanceItems-BMaVT4TW.js +1 -0
  109. package/dist/useWatchDebounced-2ZLnfgvG.js +1 -0
  110. package/dist/useWatchDebounced-D1xuIX6_.mjs +12 -0
  111. package/dist/vendor-ui-BwxuPDg8.mjs +28598 -0
  112. package/dist/vendor-ui-Ce_Yp7xA.js +1 -0
  113. package/package.json +17 -10
  114. package/dist/Alert.vue.es-DMPvSykx.js +0 -1
  115. package/dist/Alert.vue.es-DsJ1ckRU.mjs +0 -172
  116. package/dist/Amount.vue.es-C6JE5rL8.mjs +0 -23
  117. package/dist/Amount.vue.es-h8wulbBG.js +0 -1
  118. package/dist/Avatar.vue.es-Ba8ZGfm4.mjs +0 -93
  119. package/dist/Avatar.vue.es-BbyE0AjW.js +0 -1
  120. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-C4Ndo83E.js +0 -1
  121. package/dist/Button.vue.es-6sBk5tBL.mjs +0 -408
  122. package/dist/Button.vue.es-BC4_TItq.js +0 -1
  123. package/dist/CardContent.vue.es-ChEMrFCc.mjs +0 -115
  124. package/dist/CardContent.vue.es-i9ivuGKG.js +0 -1
  125. package/dist/Chip.vue.es-D0fkSe8a.js +0 -1
  126. package/dist/Chip.vue.es-DcW2CjUA.mjs +0 -1576
  127. package/dist/Comparators.vue.es-BdxDqU8o.js +0 -1
  128. package/dist/Comparators.vue.es-DdTKGB80.mjs +0 -406
  129. package/dist/ContentWithAsideLayout-UHovpjZu.js +0 -1
  130. package/dist/CustomerBillingInformation.vue.es-9rP7-RzN.js +0 -1
  131. package/dist/CustomerBillingInformation.vue.es-DBMl01Es.mjs +0 -175
  132. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CYTCcMgP.js +0 -1
  133. package/dist/Divider.vue.es-ClFG8QtG.js +0 -1
  134. package/dist/Divider.vue.es-wKkIVBgb.mjs +0 -24
  135. package/dist/DividerText.vue.es-B7oa5Xpn.mjs +0 -72
  136. package/dist/DividerText.vue.es-yiFdPQvo.js +0 -1
  137. package/dist/ErrorNotification.vue.es-Bgw0MIl8.mjs +0 -30
  138. package/dist/ErrorNotification.vue.es-FpRyg0De.js +0 -1
  139. package/dist/FormMessage.vue.es-DFQXxiSC.mjs +0 -46
  140. package/dist/FormMessage.vue.es-LeWoj774.js +0 -1
  141. package/dist/IconButton.vue.es-DNCwwH_j.mjs +0 -825
  142. package/dist/IconButton.vue.es-DiSiGPWO.js +0 -1
  143. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BDitcx8B.js +0 -1
  144. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-6yi47YWd.js +0 -1
  145. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CC3hm3nx.js +0 -1
  146. package/dist/PaymentMethod.vue.es-DYlnmZh7.js +0 -1
  147. package/dist/PaymentMethod.vue.es-nXZoQjG3.mjs +0 -1255
  148. package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-CmQILA3q.js +0 -1
  149. package/dist/Section.vue.es-3-H1pUTB.mjs +0 -79
  150. package/dist/Section.vue.es-BuzTXRLP.js +0 -1
  151. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-Pq3d7DTb.js +0 -1
  152. package/dist/TooltipParagraph.vue.es-DVJLF9Kv.mjs +0 -136
  153. package/dist/TooltipParagraph.vue.es-kTbRGoPF.js +0 -1
  154. package/dist/TrialChip.vue.es-BHYbW8b6.mjs +0 -759
  155. package/dist/TrialChip.vue.es-C6Xg_5rR.js +0 -1
  156. package/dist/_Uint8Array-DHE03FZr.mjs +0 -507
  157. package/dist/_Uint8Array-DxISR7XF.js +0 -1
  158. package/dist/_flatRest.es-BHFPCqZh.mjs +0 -642
  159. package/dist/_flatRest.es-dFffnTpX.js +0 -1
  160. package/dist/api.es-B4qAAJKr.js +0 -1
  161. package/dist/api.es-UkfpLiLL.mjs +0 -83
  162. package/dist/cloneDeep-Hs8Pp07F.js +0 -1
  163. package/dist/cloneDeep-sm9cY-u2.mjs +0 -212
  164. package/dist/cn.es-C7xoIs3C.js +0 -1
  165. package/dist/cn.es-tfxVlz02.mjs +0 -3191
  166. package/dist/component-ZRZIt3ZW.js +0 -1
  167. package/dist/component-dpA83LIN.mjs +0 -6569
  168. package/dist/countryData.es--zJAd6LA.mjs +0 -252
  169. package/dist/countryData.es-D3MFzU92.js +0 -1
  170. package/dist/customer.es-D42Md24r.js +0 -1
  171. package/dist/customer.es-LIW2YmLL.mjs +0 -30
  172. package/dist/formatting.es-9hM8aHSg.js +0 -1
  173. package/dist/formatting.es-D5H_ySFv.mjs +0 -68
  174. package/dist/getCountryNameByCode.es-fP52nO_7.js +0 -1
  175. package/dist/getCountryNameByCode.es-ymC9R46j.mjs +0 -8
  176. package/dist/index-2jo9BSPM.js +0 -1
  177. package/dist/index-BFZ0dPh9.mjs +0 -179
  178. package/dist/index-CI71bVGE.mjs +0 -2521
  179. package/dist/index-CWSXne1Q.js +0 -1
  180. package/dist/index-D3v7hAtc.mjs +0 -253
  181. package/dist/index-WLSPwi90.js +0 -1
  182. package/dist/index.es-BBJF2O2l.js +0 -1
  183. package/dist/index.es-LCAKs4tH.mjs +0 -438
  184. package/dist/invoices-3kVHsAXr.js +0 -1
  185. package/dist/isEmpty.es-Bp1SbWFu.mjs +0 -131
  186. package/dist/isEmpty.es-Dycf-CD_.js +0 -1
  187. package/dist/paymentMethods-DZRf0WRl.js +0 -1
  188. package/dist/pick.es-BgDAfhAl.js +0 -1
  189. package/dist/pick.es-DdVOyp0Q.mjs +0 -45
  190. package/dist/registry-ClZ43bQn.js +0 -1
  191. package/dist/sprite.svg.es-CCc3Mz1x.js +0 -1
  192. package/dist/sprite.svg.es-DZD704h3.mjs +0 -4
  193. package/dist/subscriptions-CS8HTxzC.js +0 -1
  194. package/dist/typeGuards.es-C4nR5FkL.js +0 -1
  195. package/dist/typeGuards.es-fwUoeMCe.mjs +0 -12
  196. package/dist/useIncrementalLoading-CAdNW-Bf.js +0 -1
  197. package/dist/useInvoiceData-DvQO_nKz.js +0 -1
  198. package/dist/useInvoicesList-CHkwSNO9.js +0 -1
  199. package/dist/useService-B67YWAcN.js +0 -1
  200. package/dist/useService-DG_zedHV.mjs +0 -282
  201. package/dist/useWalletBalanceItems-B5FMmoU2.mjs +0 -308
  202. package/dist/useWalletBalanceItems-BY3gq0fc.js +0 -1
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../component-ZRZIt3ZW.js"),o=require("../../countryData.es-D3MFzU92.js"),n=require("../../TrialChip.vue.es-C6Xg_5rR.js"),a=require("../../formatting.es-9hM8aHSg.js"),i=require("../../Button.vue.es-BC4_TItq.js"),l=require("../../ErrorNotification.vue.es-FpRyg0De.js"),r=require("../../subscriptions-CS8HTxzC.js"),c=require("../../_Uint8Array-DxISR7XF.js"),u=require("../../invoices-3kVHsAXr.js"),s=require("../../useService-B67YWAcN.js"),d=require("../../index-WLSPwi90.js"),p=require("../../index-2jo9BSPM.js"),m=require("../../cloneDeep-Hs8Pp07F.js"),g=require("../../paymentMethods-DZRf0WRl.js"),v=require("../../ContentWithAsideLayout-UHovpjZu.js"),f=require("../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CC3hm3nx.js"),y=require("../../PricingGroupContent.vue_vue_type_script_setup_true_lang-CmQILA3q.js"),_=require("../../Section.vue.es-BuzTXRLP.js"),b=require("../../getCountryNameByCode.es-fP52nO_7.js"),h=require("../../Alert.vue.es-DMPvSykx.js"),k=require("../../customer-CcQR-JIm.js"),x=require("../../TooltipParagraph.vue.es-kTbRGoPF.js"),M=require("../../Chip.vue.es-D0fkSe8a.js"),C=require("../../Avatar.vue.es-BbyE0AjW.js"),N=require("../../Amount.vue.es-h8wulbBG.js"),I=require("../../isEmpty.es-Dycf-CD_.js"),w=require("../../Divider.vue.es-ClFG8QtG.js"),E=require("../../index.es-BBJF2O2l.js"),B=require("../../IconButton.vue.es-DiSiGPWO.js"),D=require("../../index-CWSXne1Q.js"),V=require("../../Skeleton.vue_vue_type_script_setup_true_lang-D1Xzfc70.js"),A=require("../../DividerText.vue.es-yiFdPQvo.js"),S=require("../../payments-CLt0SExf.js"),P=require("../../FormMessage.vue.es-LeWoj774.js"),T={AT:"Austria",BE:"Belgium",BG:"Bulgaria",CY:"Cyprus",CZ:"Czech Republic",DE:"Germany",DK:"Denmark",EE:"Estonia",ES:"Spain",FI:"Finland",FR:"France",GR:"Greece",HR:"Croatia",HU:"Hungary",IE:"Ireland",IT:"Italy",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",MT:"Malta",NL:"Netherlands",PL:"Poland",PT:"Portugal",RO:"Romania",SE:"Sweden",SI:"Slovenia",SK:"Slovakia"};function L(e){return Object.keys(T).includes(e)}const z=e.defineComponent({__name:"DeltaChip",props:{oldValue:{},newValue:{},color:{default:"dark"},content:{},dark:{type:Boolean},removable:{type:Boolean},size:{},variant:{},textClass:{},tag:{},hasChipBefore:{type:Boolean},hasChipAfter:{type:Boolean}},setup(t){const o=e.createPropsRestProxy(t,["oldValue","newValue","color"]),n=e.computed(()=>{const e=t.newValue-t.oldValue;return`${e>=0?"+":""}${e}`});return(a,i)=>(e.openBlock(),e.createBlock(e.unref(M._sfc_main),e.mergeProps(o,{color:t.color,class:"pointer-events-none select-none"}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.value),1)]),_:1},16,["color"]))}}),j=e.defineComponent({__name:"invoicePreviewRow",props:{weight:{default:"normal"},variant:{default:"body-xs"},noSpacing:{type:Boolean,default:!1}},setup:o=>(n,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-row gap-2",{"py-1.5":!o.noSpacing}])},[e.createVNode(t._sfc_main,{tag:"span",variant:o.variant,class:"grow",weight:o.weight},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"label")]),_:3},8,["variant","weight"]),e.createVNode(t._sfc_main,{tag:"span",variant:o.variant,weight:o.weight},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"value")]),_:3},8,["variant","weight"])],2))}),O=e.defineComponent({__name:"Skeleton",props:{widthClass:{default:"w-10"},heightClass:{default:"h-3"},shade:{default:"default"}},setup:t=>(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["rounded",[t.widthClass,t.heightClass,{"bg-gray-50/50":"default"===t.shade,"bg-gray-100/50":"dark"===t.shade,"bg-gray-200/50":"darker"===t.shade,"bg-gray-400/50":"darkest"===t.shade}]])},null,2))}),R=e.defineComponent({__name:"InvoicePreviewNoTaxesSkeleton",props:{widthClass:{default:"w-12"},heightClass:{default:"h-5"}},setup(o){const{$t:n}=t.useIntl();return(t,a)=>(e.openBlock(),e.createBlock(x._sfc_main,{"is-dark-mode":""},{tooltip:e.withCtx(()=>[e.createVNode(x.TooltipContent,null,{default:e.withCtx(()=>[e.createVNode(x._sfc_main$1,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(O,{"width-class":o.widthClass,"height-class":o.heightClass,shade:"darker"},null,8,["width-class","height-class"])]),_:1}))}}),$=e.defineComponent({__name:"InvoicePreviewGroups",props:{invoice:{},wrapperComponent:{}},setup(t){const o=e=>e.groups.reduce((e,t)=>t.type in e?{...e,[t.type]:[...e[t.type],t]}:{...e,[t.type]:[t]},{}),n=e=>{var t,o,n;return(null==(t=e.pricing)?void 0:t.name)&&!I.isEmpty(null==(o=e.pricing)?void 0:o.name)?e.pricing.name:C.getComposedString((null==(n=e.products)?void 0:n.map(e=>e.name))??[])};return(a,i)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.invoice.periods,(a,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.entries(o(a)),([o,a])=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:o},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a,(o,a)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.wrapperComponent??"div"),{key:a},{default:e.withCtx(()=>[e.createVNode(j,{"no-spacing":void 0!==t.wrapperComponent},{label:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n(o)),1)]),value:e.withCtx(()=>[e.createVNode(N._sfc_main,{value:o.amount_excluding_tax},null,8,["value"])]),_:2},1032,["no-spacing"])]),_:2},1024))),128))],64))),128))],64))),128))}}),U={class:"flex flex-col"},F={key:0},G=e.defineComponent({__name:"InvoicePreview",props:{invoice:{},trialInvoice:{},isCustomerFacing:{type:Boolean,default:!1},variant:{default:"default"},isPaid:{type:Boolean,default:!1},collapsible:{default:void 0},isPreviewWithoutTaxes:{type:Boolean}},setup(o){const a=o,{$t:l}=t.useIntl(),r=e.ref(void 0!==a.collapsible&&"expanded"!==a.collapsible),c=e.computed(()=>void 0!==a.collapsible),u=e.computed(()=>!!a.trialInvoice),s=e.computed(()=>a.trialInvoice?a.trialInvoice.tax_summary.total_amount:a.invoice.tax_summary.total_amount),d=()=>{c.value&&(r.value=!r.value)};return(a,p)=>(e.openBlock(),e.createElementBlock("div",U,[e.createVNode(n._sfc_main,null,{default:e.withCtx(()=>[r.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",F,[u.value?(e.openBlock(),e.createBlock(t._sfc_main,{key:0,variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({id:"invoice_preview.after_trial_heading",defaultMessage:"After trial",description:"After trial heading for the invoice preview"})),1)]),_:1})):e.createCommentVNode("",!0),"without-products"!==o.variant?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode($,{invoice:o.invoice},null,8,["invoice"]),e.createVNode(w._sfc_main,{spacing:"xxs"})],64)):e.createCommentVNode("",!0),e.createVNode(j,null,{label:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({id:"invoice_preview.total_excluding_taxes_heading",defaultMessage:"Total excluding taxes",description:"Total excluding taxes heading for the invoice preview"})),1)]),value:e.withCtx(()=>[e.createVNode(N._sfc_main,{value:o.invoice.tax_summary.base_amount},null,8,["value"])]),_:1}),e.createVNode(j,null,{label:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({id:"invoice_preview.taxes_heading",defaultMessage:"Taxes",description:"Taxes heading for the invoice preview"})),1)]),value:e.withCtx(()=>[o.isPreviewWithoutTaxes?(e.openBlock(),e.createBlock(R,{key:0,"width-class":"w-10","height-class":"h-4"})):(e.openBlock(),e.createBlock(N._sfc_main,{key:1,value:o.invoice.tax_summary.tax_amount},null,8,["value"]))]),_:1}),u.value?(e.openBlock(),e.createBlock(j,{key:2},{label:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({id:"invoice_preview.total_including_taxes_heading",defaultMessage:"Total including taxes",description:"Total including taxes heading for the invoice preview"})),1)]),value:e.withCtx(()=>[o.isPreviewWithoutTaxes?(e.openBlock(),e.createBlock(R,{key:0,"width-class":"w-10","height-class":"h-4"})):(e.openBlock(),e.createBlock(N._sfc_main,{key:1,value:o.invoice.tax_summary.total_amount},null,8,["value"]))]),_:1})):e.createCommentVNode("",!0),e.createVNode(w._sfc_main,{spacing:"xxs"})]))]),_:1}),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c.value?"button":"div"),{class:e.normalizeClass({"hover:cursor-pointer text-left":c.value}),onClick:d},{default:e.withCtx(()=>[e.createVNode(j,{weight:"semibold",variant:"body-sm"},{label:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.isPaid?e.unref(l)({id:"invoice_preview.total_paid_heading",defaultMessage:"Total paid",description:"Total paid heading for the invoice preview"}):e.unref(l)({id:"invoice_preview.total_due_today_heading",defaultMessage:"Total due today",description:"Total due today heading for the invoice preview"}))+" ",1),c.value?(e.openBlock(),e.createBlock(i._sfc_main$1,{key:0,size:"xs",icon:"keyboard_arrow_down",class:e.normalizeClass(["transition ease-in-out text-gray-400",{"rotate-0":r.value,"rotate-180":!r.value}])},null,8,["class"])):e.createCommentVNode("",!0)]),value:e.withCtx(()=>[o.isPreviewWithoutTaxes&&(!u.value||u.value&&"0.00"!==s.value.quantity)?(e.openBlock(),e.createBlock(R,{key:0})):(e.openBlock(),e.createBlock(N._sfc_main,{key:1,value:s.value},null,8,["value"]))]),_:1})]),_:1},8,["class"]))]))}}),q=["disabled"],Y=["aria-label"],K=["id","disabled","value","aria-checked","aria-describedby"],H=["tabindex","data-testid","for","aria-label","onKeydown"],Q={class:"text-xs"},Z={key:1,class:"mt-2 text-sm text-gray-500"},X=e.defineComponent({__name:"RadioGroupExtended",props:{options:{},direction:{default:"row"},showRadio:{type:Boolean,default:!0},disabled:{type:Boolean},label:{},modelValue:{type:[String,Boolean]},name:{},required:{type:Boolean},rootClass:{},error:{},variant:{}},emits:["update:modelValue"],setup(o,{emit:n}){const a=o,i=n,l=E.useVModel(a,"modelValue",i),r=B.uniqueId(a.name?`radio_${a.name}_`:"radio_");return(n,i)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(o.rootClass),disabled:o.disabled},[o.label?(e.openBlock(),e.createBlock(e.unref(B._sfc_main),{key:0,tag:"legend",required:o.required},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.label),1)]),_:1},8,["required"])):e.createCommentVNode("",!0),e.createElementVNode("div",{role:"group","aria-label":o.label,class:e.normalizeClass([["column"===o.direction?"flex-col":"flex-row"],"rounded flex gap-1"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.options,c=>(e.openBlock(),e.createElementBlock("div",{key:c.value.toString(),class:"flex-1"},[e.withDirectives(e.createElementVNode("input",e.mergeProps({ref_for:!0},n.$attrs,{id:`${e.unref(r)}${c.value}`,"onUpdate:modelValue":i[0]||(i[0]=t=>e.isRef(l)?l.value=t:null),disabled:o.disabled,value:c.value,type:"radio","aria-checked":e.unref(l)===c.value,"aria-describedby":c.warning?`${e.unref(r)}${c.value}-warning`:void 0,tabindex:"-1",class:"sr-only"}),null,16,K),[[e.vModelRadio,e.unref(l)]]),e.createElementVNode("label",{tabindex:o.disabled?void 0:0,"data-testid":`radio-group-item-${c.value}`,for:`${e.unref(r)}${c.value}`,"aria-label":c.label+(c.description?`: ${c.description}`:""),class:e.normalizeClass(["relative label px-4 py-3 h-full flex gap-3 border bg-gray-50/50 border-gray-100 rounded outline-none hover:bg-primary-50/50 focus-visible:bg-primary-50 focus-visible:border-primary-600 focus-visible:ring-1 focus-visible:ring-primary-600 focus:bg-primary-50",{"cursor-pointer":!o.disabled,"cursor-not-allowed":o.disabled,"bg-white border border-primary-600 ring-1 ring-primary-600":e.unref(l)===c.value&&!o.disabled,"opacity-60":o.disabled}]),onKeydown:e=>{return t=e,o=c.value,void(a.disabled||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),l.value=o));var t,o}},[o.showRadio?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["material-symbols-outlined leading-4 h-4 w-4 min-w-4 inline-block mt-px rounded-full",{"border-4 border-primary-800":e.unref(l)===c.value,"border border-gray-300":e.unref(l)!==c.value}])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["flex flex-col",{"opacity-50":o.disabled}])},[e.createVNode(e.unref(t._sfc_main),{tag:"div",weight:"semibold","no-spacing":"",variant:"body-sm",class:"flex justify-between align-center"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.label),1)]),_:2},1024),c.description?(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:0,tag:"div",variant:"body-xs","no-spacing":"",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.description),1)]),_:2},1024)):e.createCommentVNode("",!0),c.description?e.createCommentVNode("",!0):e.renderSlot(n.$slots,"description",{key:1,optionValue:c.value})],2)],42,H),c.warning?(e.openBlock(),e.createBlock(e.unref(h._sfc_main),{key:0,id:`${e.unref(r)}${c.value}-warning`,class:"mt-1",type:e.unref(l)===c.value?"danger":"dark",role:"alert"},{default:e.withCtx(()=>[e.createElementVNode("span",Q,e.toDisplayString(c.warning),1)]),_:2},1032,["id","type"])):e.createCommentVNode("",!0)]))),128))],10,Y),o.error||n.$slots.helper?(e.openBlock(),e.createElementBlock("div",Z,[o.error?(e.openBlock(),e.createBlock(e.unref(P._sfc_main),{key:0,message:o.error},null,8,["message"])):n.$slots.helper?e.renderSlot(n.$slots,"helper",{key:1}):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],10,q))}}),W={},J={class:"flex items-center pt-1"},ee={class:"px-1.5 text-gray-500 text-xs font-semibold"};const te=M._export_sfc(W,[["render",function(t,o){return e.openBlock(),e.createElementBlock("div",J,[o[0]||(o[0]=e.createElementVNode("div",{class:"border-t w-2"},null,-1)),e.createElementVNode("span",ee,[e.renderSlot(t.$slots,"default")]),o[1]||(o[1]=e.createElementVNode("div",{class:"border-t grow"},null,-1))])}]]),oe=["aria-selected","aria-disabled","data-testid"],ne=["id","value","checked","disabled"],ae=["for"],ie={class:"flex items-center gap-1"},le={class:"flex flex-grow flex-col"},re={class:"flex flex-grow gap-2"},ce={class:"flex flex-grow flex-col"},ue={class:"flex flex-grow items-start justify-between gap-2"},se={class:"flex items-center gap-2"},de=e.defineComponent({__name:"SelectExtendedOption",props:{multiple:{type:Boolean},inputValue:{},condensed:{type:Boolean},label:{},checked:{type:Boolean},disabled:{type:Boolean},subLabel:{},labelPrefixComponent:{},labelSuffixComponent:{},labelInlineComponent:{},value:{},labelSrOnly:{type:Boolean}},emits:["value-changed"],setup(t,{emit:o}){const n=o,a=t,i=e=>{const t=e.target;n("value-changed",{value:t.value,checked:t.checked})},l=()=>{a.multiple||a.disabled||n("value-changed",{value:a.value})},r=e.computed(()=>`checkbox-item-${a.value}`),c=e.computed(()=>d.escapeUserInput(a.inputValue??""));return(o,n)=>(e.openBlock(),e.createElementBlock("li",{role:"option","aria-selected":t.checked,"aria-disabled":t.disabled,class:e.normalizeClass([{"hover:bg-gray-50":!t.disabled},"flex relative"]),"data-testid":r.value,tabindex:"0",onClick:l,onKeydown:e.withKeys(l,["enter"])},[t.multiple?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("input",e.mergeProps(o.$attrs,{id:r.value,ref:"inputRef",value:t.value,checked:t.checked,disabled:t.disabled,type:"checkbox",class:["absolute top-[50%] -translate-y-2 left-3.5 w-4 h-4 bg-gray-100 border-gray-300 rounded focus:ring-primary-500 focus:ring-2",t.disabled?"text-gray-400 placeholder-gray-500":"text-primary-600"],tabindex:"-1",onChange:i}),null,16,ne),e.createElementVNode("label",{for:r.value,class:e.normalizeClass([t.disabled?"text-gray-400":"text-gray-900 rounded","w-full px-4 py-3 pl-10 text-sm font-medium"])},[e.createElementVNode("div",ie,[t.labelPrefixComponent?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.labelPrefixComponent.component),{key:0})):e.createCommentVNode("",!0),e.createElementVNode("div",le,[e.createElementVNode("div",re,[e.createVNode(d._sfc_main$3,{text:t.label,search:c.value,class:e.normalizeClass(["font-semibold",{"sr-only":t.labelSrOnly}])},null,8,["text","search","class"]),t.labelInlineComponent?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.labelInlineComponent.component),e.normalizeProps(e.mergeProps({key:0},t.labelInlineComponent.props)),null,16)):e.createCommentVNode("",!0),t.subLabel&&t.condensed?(e.openBlock(),e.createBlock(d._sfc_main$3,{key:1,class:"text-xs text-slate-500",text:t.subLabel,search:c.value},null,8,["text","search"])):e.createCommentVNode("",!0)]),t.subLabel&&!t.condensed?(e.openBlock(),e.createBlock(d._sfc_main$3,{key:0,class:"text-xs text-slate-500",text:t.subLabel,search:c.value},null,8,["text","search"])):e.createCommentVNode("",!0)]),t.labelSuffixComponent?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.labelSuffixComponent.component),e.normalizeProps(e.mergeProps({key:1},t.labelSuffixComponent.props)),null,16)):e.createCommentVNode("",!0)])],10,ae)],64)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["w-full px-4 text-sm font-medium flex items-start gap-3",[t.condensed?"p-2":"py-3",t.disabled??"cursor-not-allowed",!t.disabled&&"cursor-pointer"]])},[t.labelPrefixComponent?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.labelPrefixComponent.component),e.normalizeProps(e.mergeProps({key:0},t.labelPrefixComponent.props)),null,16)):e.createCommentVNode("",!0),e.createElementVNode("div",ce,[e.createElementVNode("div",ue,[e.createVNode(d._sfc_main$3,{text:t.label,search:c.value,class:e.normalizeClass(["font-semibold",{"text-gray-400":t.disabled}])},null,8,["text","search","class"]),e.createElementVNode("div",se,[t.labelInlineComponent?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.labelInlineComponent.component),e.normalizeProps(e.mergeProps({key:0},t.labelInlineComponent.props)),null,16)):e.createCommentVNode("",!0),t.labelSuffixComponent?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.labelSuffixComponent.component),e.normalizeProps(e.mergeProps({key:1},t.labelSuffixComponent.props)),null,16)):e.createCommentVNode("",!0)])]),t.subLabel&&t.condensed?(e.openBlock(),e.createBlock(d._sfc_main$3,{key:0,class:"text-xs text-slate-500",text:t.subLabel,search:c.value},null,8,["text","search"])):e.createCommentVNode("",!0),t.subLabel&&!t.condensed?(e.openBlock(),e.createBlock(d._sfc_main$3,{key:1,class:"text-xs text-slate-500",text:t.subLabel,search:c.value},null,8,["text","search"])):e.createCommentVNode("",!0)])],2))],42,oe))}}),pe={class:"flex flex-col rounded-bl rounded-br"},me={key:0},ge={key:2,class:"border-t border-gray-200"},ve=e.defineComponent({__name:"SelectExtendedOptions",props:{model:{},multiple:{type:Boolean},condensed:{type:Boolean},hasLargeDropdown:{type:Boolean},inputValue:{},addOnly:{type:Boolean},options:{}},emits:["value-changed"],setup(o,{emit:n}){const a=o,i=n,l=e=>i("value-changed",e),r=e.computed(()=>d.sortedUniqBy(a.options,"group").reduce((e,t)=>""===t.value?e:{...e,[t.value]:t.group},{})),c=e.computed(()=>0===a.options.length);return(n,a)=>(e.openBlock(),e.createElementBlock("div",pe,[c.value?(e.openBlock(),e.createBlock(t._sfc_main,{key:0,tag:"div","no-spacing":"",variant:"body-sm",shade:"lighter",class:"px-5 py-5"},{default:e.withCtx(()=>[...a[0]||(a[0]=[e.createTextVNode("No results",-1)])]),_:1})):(e.openBlock(),e.createElementBlock("ul",{key:1,class:e.normalizeClass(["list-none overflow-y-auto text-gray-700",[o.hasLargeDropdown?"max-h-76":"max-h-48"]])},[o.addOnly?(e.openBlock(),e.createElementBlock("div",me,[e.createVNode(t._sfc_main,{tag:"p","no-spacing":"",variant:"body-sm",shade:"lighter",class:"px-3 py-2 mt-1"},{default:e.withCtx(()=>[...a[1]||(a[1]=[e.createTextVNode(e.toDisplayString("You can only select currently unselected options."),-1)])]),_:1})])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.options,({label:t,subLabel:n,value:a,checked:i,disabled:c,labelInlineComponent:u,labelSuffixComponent:s,labelSrOnly:d,labelPrefixComponent:p,hidden:m})=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a},[r.value[a]?(e.openBlock(),e.createBlock(te,{key:0},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value[a]),1)]),_:2},1024)):e.createCommentVNode("",!0),m?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(de,{key:1,label:t,"sub-label":n,value:a,checked:i,disabled:c,multiple:o.multiple,condensed:o.condensed,"label-suffix-component":s,"label-prefix-component":p,"label-inline-component":u,"label-sr-only":d,"input-value":o.inputValue,onValueChanged:l},null,8,["label","sub-label","value","checked","disabled","multiple","condensed","label-suffix-component","label-prefix-component","label-inline-component","label-sr-only","input-value"]))],64))),128))],2)),n.$slots["list-footer-content"]?(e.openBlock(),e.createElementBlock("div",ge,[e.renderSlot(n.$slots,"list-footer-content")])):e.createCommentVNode("",!0)]))}}),fe=["aria-expanded","aria-controls"],ye={class:"flex gap-2 items-center"},_e={key:1},be={class:"flex items-center gap-2"},he={key:0,class:"flex flex-wrap gap-2 mt-2"},ke=["innerHTML"],xe=["id"],Me=e.defineComponent({__name:"SelectExtended",props:{addOnly:{type:Boolean,default:!1},disabled:{type:Boolean},label:{},labelScreenReaderOnly:{type:Boolean},inputModel:{},singleModelValue:{},multiModelValue:{},options:{default:()=>[]},optionsOrder:{default:()=>["asc","asc"]},optionsOrderProperties:{default:()=>["group","label"]},required:{type:Boolean,default:!1},rootClass:{},size:{default:"md"},withChips:{type:Boolean,default:!1},chipColor:{},error:{},hasReset:{type:Boolean},name:{},hasLargeDropdown:{type:Boolean,default:!1},showSuffixInClosedInput:{type:Boolean},showSuffixLabelInInput:{type:Boolean},showSubLabelInInput:{type:Boolean,default:!1},condensed:{type:Boolean},form:{},isInputReadOnly:{type:Boolean,default:!0},textContent:{default:()=>({placeholderSingleOpen:"Search",placeholderSingleEmpty:"Select an option",placeholderMultipleOpen:"Search",placeholderMultipleEmpty:"Select one or more options",buttonAddLabel:"Add",buttonClearLabel:"Reset",buttonDoneLabel:"Done"})}},emits:["update:inputModel","update:singleModelValue","update:multiModelValue","blur","change","focus","add-option"],setup(o,{emit:n}){var a;const l=o,r=n,c=null==(a=e.getCurrentInstance())?void 0:a.vnode.props,u=E.useVModel(l,"inputModel",r),s=E.useVModel(l,"singleModelValue",r),p=E.useVModel(l,"multiModelValue",r),m=e.computed(()=>v.value?p.value??[]:s.value?[s.value]:[]),g=e.ref(l.multiModelValue??[]),v=e.computed(()=>Array.isArray(l.multiModelValue)),f=e.computed({get:()=>v.value?g.value??[]:"string"==typeof s.value?[s.value]:[],set(e){v.value?g.value=e:s.value=(null==e?void 0:e[0])??""}}),y=e.ref(!1),_=d.useIsMounted(),b=e.ref(),h=e.ref(),k=e.inject(t.SEARCH_SELECT_TELEPORT_TARGET),x=e.computed(()=>{return e=f.value,l.options.filter(t=>e.some(e=>t.value===e));var e}),C=e.computed(()=>x.value[0]),N=e.computed(()=>K.value[0]),w=e.computed(()=>{var e;return!y.value&&!v.value&&(null==(e=C.value)?void 0:e.labelPrefixComponent)}),D=!!(null==c?void 0:c.onAddOption),V=()=>{r("add-option"),S()},A=e.computed(()=>{var e,t,o,n;if(!v.value){if(C.value)return null==(e=C.value)?void 0:e.label;if(0===x.value.length)return l.textContent.placeholderSingleEmpty}if(v.value){if(1===x.value.length)return null==(t=C.value)?void 0:t.label;if(x.value.length>=2)return`${null==(o=C.value)?void 0:o.label} +${x.value.length-1}`;if(0===x.value.length)return l.textContent.placeholderMultipleEmpty}return null==(n=N.value)?void 0:n.label}),S=()=>{v.value,y.value=!1},P=({value:e,checked:t})=>{let o;v.value?o=t?[...f.value,e]:f.value.filter(t=>t!==e):(o=[e],y.value=!1),f.value=o,r("change")},T=e.computed(()=>!(!l.addOnly||B.isEqual(g.value,l.multiModelValue))||!l.addOnly&&f.value.length>0&&!l.disabled&&(1!==f.value.length||""!==f.value[0])),L=()=>{if(l.addOnly)return g.value=m.value,u.value="",void S();f.value=[],g.value=[],u.value&&(u.value=""),S()},z=()=>b.value?Array.from(b.value.querySelectorAll('li[tabindex="0"], button:not([disabled])')):[],j=()=>{var e;let t=document.activeElement;for(;null==(e=null==t?void 0:t.shadowRoot)?void 0:e.activeElement;)t=t.shadowRoot.activeElement;return t},O=()=>{if(!h.value)return null;let e=h.value.querySelector("input");if(e)return e;const t=h.value.querySelectorAll("*");for(const o of t)if(o.shadowRoot&&(e=o.shadowRoot.querySelector("input"),e))return e;return null},R=e=>{var t,o;if(!y.value)return;const n=z(),a=O();if(j()===a)switch(e.key){case"ArrowDown":n.length>0&&(e.preventDefault(),null==(t=n[0])||t.focus());break;case"Tab":!e.shiftKey&&n.length>0&&(e.preventDefault(),null==(o=n[0])||o.focus());break;case"Escape":e.preventDefault(),S()}},$=t=>{var o,n,a,i;const l=z(),r=j(),c=l.indexOf(r),u=O();switch(t.key){case"ArrowDown":c<l.length-1&&(t.preventDefault(),null==(o=l[c+1])||o.focus());break;case"ArrowUp":t.preventDefault(),c<=0?null==u||u.focus():null==(n=l[c-1])||n.focus();break;case"Tab":t.shiftKey?c<=0?(t.preventDefault(),null==u||u.focus()):(t.preventDefault(),null==(a=l[c-1])||a.focus()):c>=l.length-1?(t.preventDefault(),S(),null==u||u.focus()):(t.preventDefault(),null==(i=l[c+1])||i.focus());break;case"Escape":t.preventDefault(),S(),e.nextTick(()=>{null==u||u.focus()})}};E.useEventListener("mousedown",e=>{const t=e.composedPath();b.value&&t.includes(b.value)||h.value&&t.includes(h.value)||y.value&&S()});const{floatingStyles:U}=M.useFloating(h,b,{whileElementsMounted:M.autoUpdate,placement:"bottom",middleware:[M.offset(4),M.flip({mainAxis:!0})]}),F=B.uniqueId("search-select-options-"),{width:G}=E.useElementSize(h),q=()=>{const e=O();e&&e.focus()},Y=e.computed(()=>l.options.map(e=>({...e,checked:x.value.some(t=>t.value===e.value),disabled:l.disabled||!l.disabled&&l.addOnly&&!!m.value.includes(e.value)}))),K=e.computed(()=>Y.value.filter(e=>{var t;return null==(t=f.value)?void 0:t.includes(e.value)}));return(n,a)=>{var l;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{ref_key:"wrapperRef",ref:h,class:e.normalizeClass(["relative flex items-end",{rootClass:o.rootClass,"z-30":y.value,"cursor-text":!o.disabled}]),role:"combobox","aria-expanded":y.value,"aria-haspopup":!0,"aria-controls":e.unref(F),onKeydown:R,onClick:q},[e.createVNode(e.unref(d._sfc_main),{modelValue:e.unref(u),"onUpdate:modelValue":a[0]||(a[0]=t=>e.isRef(u)?u.value=t:null),readonly:o.isInputReadOnly,required:o.required,label:o.label,name:o.name,form:o.form,"label-screen-reader-only":o.labelScreenReaderOnly,placeholder:A.value,class:e.normalizeClass(["grow !outline-none",{"placeholder:text-gray-900":!y.value&&(!v.value&&e.unref(s)||v.value&&!e.unref(I.isEmpty)(o.multiModelValue)),"cursor-default":o.isInputReadOnly}]),"wrapper-class":{"border-transparent border-b-gray-200 focus-within:border-b relative z-10":y.value},"suffix-class":"border-l-0 pl-0",disabled:o.disabled,size:o.size,error:o.error,"prefix-has-border":!1,"aria-autocomplete":"list",onFocus:a[1]||(a[1]=()=>y.value=!0),onBlur:a[2]||(a[2]=e=>n.$emit("blur"))},e.createSlots({"label-suffix":e.withCtx(()=>[e.renderSlot(n.$slots,"label-suffix")]),suffix:e.withCtx(()=>{var t,n;return[e.createElementVNode("div",be,[y.value||v.value||!(null==(t=C.value)?void 0:t.labelInlineComponent)||o.showSuffixInClosedInput&&!o.showSuffixLabelInInput?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(C.value.labelInlineComponent.component),e.normalizeProps(e.mergeProps({key:0},C.value.labelInlineComponent.props)),null,16)),!y.value&&!v.value&&(null==(n=C.value)?void 0:n.labelSuffixComponent)&&o.showSuffixInClosedInput?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(C.value.labelSuffixComponent.component),e.normalizeProps(e.mergeProps({key:1},C.value.labelSuffixComponent.props)),null,16)):e.createCommentVNode("",!0),e.unref(u)||T.value&&o.hasReset?(e.openBlock(),e.createBlock(B._sfc_main$1,{key:2,icon:"close",size:"xs",variant:"ghost",color:"gray",type:"button",onClick:L})):e.createCommentVNode("",!0),e.createVNode(i._sfc_main$1,{icon:"keyboard_arrow_down",size:"xs",class:e.normalizeClass(["transition-transform",{"rotate-180":y.value}])},null,8,["class"])])]}),_:2},[o.showSubLabelInInput&&(null==(l=C.value)?void 0:l.subLabel)?{name:"input",fn:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["pointer-events-none absolute inset-0 bg-white",{"px-4 py-3":"xl"===o.size}])},[e.createVNode(t._sfc_main,{tag:"span",class:"block",variant:"body-sm",weight:"semibold"},{default:e.withCtx(()=>{var t;return[e.createTextVNode(e.toDisplayString(null==(t=C.value)?void 0:t.label),1)]}),_:1}),e.createVNode(t._sfc_main,{tag:"span",class:"block",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>{var t;return[e.createTextVNode(e.toDisplayString(null==(t=C.value)?void 0:t.subLabel),1)]}),_:1})],2)]),key:"0"}:void 0,n.$slots.tooltip?{name:"tooltip",fn:e.withCtx(()=>[e.renderSlot(n.$slots,"tooltip")]),key:"1"}:void 0,w.value||n.$slots.prefix?{name:"prefix",fn:e.withCtx(()=>{var t;return[e.createElementVNode("div",ye,[n.$slots.prefix?e.renderSlot(n.$slots,"prefix",{key:0}):w.value&&(null==(t=C.value)?void 0:t.labelPrefixComponent)?(e.openBlock(),e.createElementBlock("div",_e,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(C.value.labelPrefixComponent.component),e.normalizeProps(e.guardReactiveProps(C.value.labelPrefixComponent.props)),null,16))])):e.createCommentVNode("",!0)])]}),key:"2"}:void 0,n.$slots.helper?{name:"helper",fn:e.withCtx(()=>[e.renderSlot(n.$slots,"helper")]),key:"3"}:void 0]),1032,["modelValue","readonly","required","label","name","form","label-screen-reader-only","placeholder","wrapper-class","class","disabled","size","error"])],42,fe),o.withChips?(e.openBlock(),e.createElementBlock("div",he,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value,({value:t,label:n,disabled:a})=>(e.openBlock(),e.createBlock(M._sfc_main,{key:t,removable:!a,color:a?"dark":o.chipColor,onRemoved:e=>P({value:t,checked:!1})},{default:e.withCtx(()=>[e.createElementVNode("span",{innerHTML:n},null,8,ke)]),_:2},1032,["removable","color","onRemoved"]))),128))])):e.createCommentVNode("",!0),e.unref(_)&&e.unref(k)?(e.openBlock(),e.createBlock(e.Teleport,{key:1,to:e.unref(k)},[y.value&&!o.disabled?(e.openBlock(),e.createElementBlock("div",{key:0,id:e.unref(F),ref_key:"optionsRef",ref:b,role:"listbox",style:e.normalizeStyle(e.unref(U)),class:"drop-shadow-md bg-white rounded z-70",onMouseenter:a[3]||(a[3]=e=>y.value=!0),onKeydown:$},[e.createElementVNode("div",{class:"rounded pt-0",style:e.normalizeStyle({width:`${e.unref(G)}px`})},[e.createVNode(ve,{options:Y.value,multiple:v.value,model:f.value,"add-only":o.addOnly,"allows-multiple-values":!!v.value,condensed:o.condensed,"has-large-dropdown":o.hasLargeDropdown,"input-value":e.unref(u),onValueChanged:P},{"list-footer-content":e.withCtx(()=>[D?(e.openBlock(),e.createBlock(i._sfc_main,{key:0,variant:"ghost",class:"w-full",type:"button","icon-prefix":"add",onClick:V},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.textContent.buttonAddLabel),1)]),_:1})):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["flex justify-between items-center",{"py-2":!n.$slots["list-footer-content"]}])},[T.value?(e.openBlock(),e.createBlock(i._sfc_main,{key:0,type:"button",color:"gray",variant:"ghost",size:"sm",class:"ml-2",onClick:L},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.textContent.buttonClearLabel),1)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",null,[e.renderSlot(n.$slots,"list-footer-content")]),e.createVNode(i._sfc_main,{type:"button",size:"sm",class:"mr-2","data-testid":e.unref("select-search-done-button"),onClick:S},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.textContent.buttonDoneLabel),1)]),_:1},8,["data-testid"])],2)):e.renderSlot(n.$slots,"list-footer-content",{key:2})]),_:3},8,["options","multiple","model","add-only","allows-multiple-values","condensed","has-large-dropdown","input-value"])],4)],44,xe)):e.createCommentVNode("",!0)],8,["to"])):e.createCommentVNode("",!0)],64)}}}),Ce={class:"flex items-center gap-1.5 text-gray-800"},Ne=e.defineComponent({__name:"StepInput",props:e.mergeModels({step:{default:1},min:{default:0},max:{},initialValue:{default:1},unitName:{},showDelta:{type:Boolean,default:!1},size:{default:"md"},name:{},required:{type:Boolean},label:{},error:{},disabled:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const n=o,a=e.useModel(o,"modelValue"),i=e.ref(null),l=e.computed(()=>{if(n.unitName)return n.unitName[1===a.value?"singular":"plural"]}),r=()=>{n.max&&a.value+n.step>n.max||(a.value+=n.step)},c=()=>{a.value-n.step<n.min||(a.value-=n.step)};function u(e){var t;const o=null==(t=i.value)?void 0:t.el;if(!o)return;const n=parseInt(`${e}`);a.value=n,o.innerText=`${n}`,o.focus();const l=document.createRange();l.selectNodeContents(o),l.collapse(!1);const r=window.getSelection();null==r||r.removeAllRanges(),null==r||r.addRange(l)}const s=e=>{const t=e.target;t instanceof HTMLElement&&u(t.innerText)},p=e.computed(()=>!n.disabled&&(!n.max||a.value+n.step<n.max)),m=e.computed(()=>!n.disabled&&a.value-n.step>=n.min);function g(){var e;const t=null==(e=i.value)?void 0:e.el;if(!t)return;t.focus();const o=document.createRange();o.selectNodeContents(t);const n=window.getSelection();null==n||n.removeAllRanges(),null==n||n.addRange(o)}return e.onMounted(()=>{var e;const t=null==(e=i.value)?void 0:e.el;t&&(t.innerText=`${a.value}`)}),e.watch(()=>a.value,e=>{u(e)}),(u,v)=>(e.openBlock(),e.createBlock(d._sfc_main,{modelValue:a.value,"onUpdate:modelValue":v[0]||(v[0]=e=>a.value=e),type:"number",class:"[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none text-transparent","prefix-class":{"!px-0 w-5":"sm"===o.size,"!px-0 w-6":"md"===o.size,"!px-0 w-7":"lg"===o.size},"suffix-class":{"!px-0 w-5":"sm"===o.size,"!px-0 w-6":"md"===o.size,"!px-0 w-7":"lg"===o.size},size:o.size,label:o.label,disabled:o.disabled,name:o.name,required:o.required},e.createSlots({prefix:e.withCtx(()=>[e.createElementVNode("div",{class:"absolute inset-0 flex items-center justify-center",onMousedown:g},[e.createElementVNode("div",Ce,[e.createVNode(t._sfc_main,{ref_key:"contentEditableRef",ref:i,tag:"span",variant:"sm"===o.size?"body":"body-lg",contenteditable:!o.disabled,class:e.normalizeClass(["outline-none",{"pointer-events-none select-none":o.disabled}]),weight:"semibold",onInput:s},null,8,["variant","contenteditable","class"]),l.value?(e.openBlock(),e.createBlock(t._sfc_main,{key:0,tag:"span",shade:"lighter",class:"pointer-events-none select-none"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(" ")+e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0),o.showDelta?(e.openBlock(),e.createBlock(z,{key:1,"old-value":n.initialValue,"new-value":a.value,class:"ml-0.5 pointer-events-none select-none"},null,8,["old-value","new-value"])):e.createCommentVNode("",!0)])],32),e.createVNode(B._sfc_main$1,{disabled:!m.value,type:"button",color:"gray",variant:"ghost",size:"sm",class:e.normalizeClass(["select-none rounded-tr-none rounded-br-none !h-full",{"!w-7":"lg"===o.size,"!w-5":"sm"===o.size,"!w-6":"md"===o.size}]),icon:"remove",onMousedown:c},null,8,["disabled","class"])]),suffix:e.withCtx(()=>[e.createVNode(B._sfc_main$1,{disabled:!p.value,type:"button",color:"gray",variant:"ghost",size:"sm",class:e.normalizeClass(["select-none rounded-tl-none rounded-bl-none !h-full",{"!w-7":"lg"===o.size,"!w-5":"sm"===o.size,"!w-6":"md"===o.size}]),icon:"add",onMousedown:r},null,8,["disabled","class"])]),_:2},[u.$slots.helper?{name:"helper",fn:e.withCtx(()=>[e.renderSlot(u.$slots,"helper")]),key:"0"}:void 0]),1032,["modelValue","prefix-class","suffix-class","size","label","disabled","name","required"]))}});function Ie(e){return!!o.countryData.find(t=>t.key===e)}var we=c.Symbol?c.Symbol.prototype:void 0;we&&we.toString;var Ee=Object.prototype.hasOwnProperty;var Be=0;function De(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,n)}return o}function Ve(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?De(Object(o),!0).forEach(function(t){Ae(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):De(Object(o)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}function Ae(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function Se(e){return"function"==typeof e}function Pe(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function Te(e){return Se(e.$validator)?Ve({},e):{$validator:e}}function Le(e){return"object"==typeof e?e.$valid:e}function ze(e){return e.$validator||e}const je=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 Oe(){for(var t=arguments.length,o=new Array(t),n=0;n<t;n++)o[n]=arguments[n];return t=>(t=e.unref(t),!je(t)||o.every(e=>(e.lastIndex=0,e.test(t))))}var Re=Object.freeze({__proto__:null,forEach:function(t){return{$validator(o){for(var n=arguments.length,a=new Array(n>1?n-1:0),i=1;i<n;i++)a[i-1]=arguments[i];return e.unref(o).reduce((e,o,n)=>{const i=Object.entries(o).reduce((e,i)=>{let[l,r]=i;const c=t[l]||{},u=Object.entries(c).reduce((e,t)=>{let[i,c]=t;const u=ze(c).call(this,r,o,n,...a),s=Le(u);if(e.$data[i]=u,e.$data.$invalid=!s||!!e.$data.$invalid,e.$data.$error=e.$data.$invalid,!s){let t=c.$message||"";const o=c.$params||{};"function"==typeof t&&(t=t({$pending:!1,$invalid:!s,$params:o,$model:r,$response:u})),e.$errors.push({$property:l,$message:t,$params:o,$response:u,$model:r,$pending:!1,$validator:i})}return{$valid:e.$valid&&s,$data:e.$data,$errors:e.$errors}},{$valid:!0,$data:{},$errors:[]});return e.$data[l]=u.$data,e.$errors[l]=u.$errors,{$valid:e.$valid&&u.$valid,$data:e.$data,$errors:e.$errors}},{$valid:!0,$data:{},$errors:{}});return{$valid:e.$valid&&i.$valid,$data:e.$data.concat(i.$data),$errors:e.$errors.concat(i.$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:Te,regex:Oe,req:je,unwrap:e.unref,unwrapNormalizedValidator:ze,unwrapValidatorResponse:Le,withAsync:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Ve(Ve({},Te(e)),{},{$async:!0,$watchTargets:t})},withMessage:function(t,o){if(!Se(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(!Pe(o)&&!Se(o))throw new Error("[@vuelidate/validators]: Validator must be a function or object with $validator parameter");const n=Te(o);return n.$message=t,n},withParams:function(e,t){if(!Pe(e))throw new Error('[@vuelidate/validators]: First parameter to "withParams" should be an object, provided '+typeof e);if(!Pe(t)&&!Se(t))throw new Error("[@vuelidate/validators]: Validator must be a function or object with $validator parameter");const o=Te(t);return o.$params=Ve(Ve({},o.$params||{}),e),o}});Oe(/^[a-zA-Z]*$/),Oe(/^[a-zA-Z0-9]*$/),Oe(/^\d*(\.\d+)?$/);Oe(/^(?:[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);Oe(/^(?:(?:(?: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),Oe(/(^[0-9]*$)|(^-[0-9]+$)/),Oe(/^[-]?\d*(\.\d+)?$/);const $e={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"}},Ue=Re.withMessage(({$model:o})=>{if(!o||"string"!=typeof o||""===o.trim())return"";const n=e.inject(t.I18N_INJECTION_KEY,null);if(!n)return"Invalid tax ID";const{formatMessage:a}=n,i=Object.values($e).find(e=>o.toUpperCase().startsWith(e.prefix.toUpperCase()));return i?a({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:i.example}):a({defaultMessage:"Invalid tax ID",id:"taxId.invalid",description:"Error message when tax ID is invalid"})},e=>!e||"string"!=typeof e||""===e.trim()||Object.values($e).some(t=>t.regex.test(e)));function Fe({pricingPlanScheduleInfos:e,type:t}){return e.find(e=>e.pricing_plan_schedule.type===t)}function Ge({enabledPricings:e,seatsValues:t,pricingPlanScheduleInfos:o,pricingCurrency:n,billingPeriod:a}){const i=Fe({pricingPlanScheduleInfos:o,type:"DEFAULT"});if(i&&(e||t))return[{pricing_plan_schedule_id:i.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},...a&&{billing_period:a}}]}const qe={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"},Ye=({country:e,pricingCurrencySettings:t,fallbackCurrency:o})=>{const n=(e=>{if(e)return qe[e]})(e),a=(null==t?void 0:t.pricing_currencies)??[];return n&&a.includes(n)?n:(null==t?void 0:t.default_pricing_currency)??o??n},Ke=["email","country"],He={US:["addressLine1","postalCode"],CA:["state"]};function Qe({initialState:t,onRequiredFieldChange:o}){const n=e.ref(Ze(t)),a=e.ref(Ze(t)),i=e.computed(()=>{return(e=n.value.country)&&He[e]?[...He[e],...Ke]:Ke;var e}),l=e=>i.value.includes(e),r=d.useValidation({email:{required:d.required,email:d.email},country:{required:d.required},state:{required:d.requiredIf(()=>l("state"))},addressLine1:{required:d.requiredIf(()=>l("addressLine1"))},postalCode:{required:d.requiredIf(()=>l("postalCode"))},companyLegalName:d.requiredIf("ORGANIZATION"===n.value.type),companyVatNumber:{taxId:Ue}},n),c=e=>{e||fetch("https://api.country.is/").then(e=>e.json()).then(({country:e})=>{n.value.country=e})};return e.onMounted(async()=>{await c(null==t?void 0:t.country)}),p.watchDebounced(()=>m.cloneDeep(n.value),(e,t)=>{const n=d.objectDiff({from:t,to:e}),a=Object.keys(n).find(Xe);a&&(["type","companyVatNumber"].includes(a)?o(e):"seatsValues"!==a&&"enabledPricingIds"!==a?"email"!==a&&l(a)&&o(e):o(e))},{debounce:200}),{form:n,validation:r,getIsFieldRequired:l,updateInitialState:e=>{const t=Ze({...n.value,...e});n.value=t,a.value=m.cloneDeep(t)},initialState:a}}const Ze=(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 Xe(e){return e in Ze()}function We(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 Je(e){var t,o;return function(e){if(null==e)return!0;if(c.isArrayLike(e)&&(c.isArray(e)||"string"==typeof e||"function"==typeof e.splice||c.isBuffer(e)||c.isTypedArray(e)||c.isArguments(e)))return!e.length;var t=c.getTag(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(c.isPrototype(e))return!c.baseKeys(e).length;for(var o in e)if(Ee.call(e,o))return!1;return!0}(e.name)?null==(o=null==(t=e.products)?void 0:t[0])?void 0:o.name:e.name}function et(e,t=void 0){const o=t??[],n=We(e);for(const a of n)if(["EXACTLY_ONE","AT_LEAST_ONE"].includes(a.selection_constraint)){const e=a.pricings.map(e=>e.id);if(null==t?void 0:t.some(t=>e.includes(t)))continue;o.push(a.pricings[0].id)}return o}function tt({initialCountry:t,initialEmail:o,subscriptionId:a,enabledPricingIds:i}){const l=e.ref(!1),d=e.ref(),{getSubscription:m}=r.createSubscriptionsService(),v=(()=>{const{getInvoicePreview:t}=u.createInvoicesService(),o=e.ref(),a=e.ref(),i=e.ref(),l=e.ref({}),r=e.ref(c.ApiStatus.Initial),d=e.ref({}),p=e.ref(),m=e=>`${e.type}:${e.value}`;return{loadInvoicePreview:async({subscription:e,subscriptionStartAt:u,checkoutForm:g,enabledPricingIds:v,promotionCode:f})=>{var y,_,b,h,k;const x={...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}};r.value=c.ApiStatus.Loading;const M=Fe({pricingPlanScheduleInfos:e.pricing_plan_schedule_infos,type:"DEFAULT"}),C=null==(y=null==M?void 0:M.pricing_plan_version)?void 0:y.pricing_currency_settings,N=((null==(_=null==C?void 0:C.pricing_currencies)?void 0:_.length)??0)>1,I=(null==(h=null==(b=null==M?void 0:M.pricing_plan_version)?void 0:b.billing_period_settings)?void 0:h.billing_periods)??[],w=I.length>1,E=I.length>0?I.map(({period:e})=>e):e.billing_period?[e.billing_period]:[],B=Ye({country:g.country,pricingCurrencySettings:C,fallbackCurrency:e.billing_currency});if(!E.length)return void(r.value=c.ApiStatus.Done);const D=e.billing_period?m(e.billing_period):m(E[0]),V=E.map(async o=>{var n;const a=m(o),i=Ge({enabledPricings:null==v?void 0:v.map(e=>({pricing_id:e})),seatsValues:g.seatsValues,pricingPlanScheduleInfos:e.pricing_plan_schedule_infos,pricingCurrency:N?B:void 0,billingPeriod:w?o:void 0})??[];if(f){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=i.find(({pricing_plan_schedule_id:e})=>e===t);e?e.promotion_codes=[f]:i.push({pricing_plan_schedule_id:t,promotion_codes:[f]})}}const l={pricingPlanSubscriptionId:e.id,startAt:u,customizations:i,customer:{type:g.type||"INDIVIDUAL",..."INDIVIDUAL"===g.type&&{individual:{residential_address:x}},..."ORGANIZATION"===g.type&&{organization:{legal_name:g.companyLegalName||"preview",registered_address:x,...g.companyVatNumber&&{tax_id:Ue.$validator(g.companyVatNumber,{},{})?g.companyVatNumber:void 0}}}}},r=d.value[a];return r&&s.isEqual(l,r)?{periodKey:a,response:void 0}:(d.value={...d.value,[a]:l},{periodKey:a,response:await t(l)})});try{const t={...l.value},r=await Promise.all(V),c=e.pricing_plan_schedule_infos.find(({pricing_plan_schedule:e})=>"TRIAL"===e.type),u=null==(k=e.pricing_plan_schedule_infos.find(({pricing_plan_schedule:e})=>"DEFAULT"===e.type))?void 0:k.id;r.forEach(({periodKey:e,response:i})=>{var l;if(!i)return;p.value=null==(l=i.invoice_infos.at(-1))?void 0:l.pricing_plan_schedule_id,c&&(a.value=i.first_invoice,c.start_at&&c.end_at&&(o.value=n.convertDateRangeToTimePeriod(new Date(c.start_at),new Date(c.end_at))));const r=i.invoice_infos.find(({pricing_plan_schedule_id:e})=>e===u),s=null==r?void 0:r.invoices[0];s&&(t[e]=s)}),l.value=t,i.value=t[D]}catch(A){throw r.value=c.ApiStatus.Failed,A}finally{r.value=c.ApiStatus.Done}},invoicePreview:i,invoicePreviewByBillingPeriod:l,trialInvoicePreview:a,trialPeriod:o,lastPreviewScheduleId:p,isPending:e.computed(()=>r.value===c.ApiStatus.Loading)}})(),f=e.computed(()=>d.value&&k.form.value.country&&M.value),{paymentMethodOptions:y,loadPaymentMethodOptions:_,isPending:b}=(()=>{const t=e.ref(),{getPaymentMethodOptions:o}=g.createPaymentMethodsService(),{data:n,execute:a,isPending:i}=s.useService({initialValue:[],service:o});return{loadPaymentMethodOptions:async({subscriptionId:e,country:o,amount:n})=>{const i={subscriptionId:e,country:o,amount:n};s.isEqual(i,t.value)||(t.value=i,await a(i))},paymentMethodOptions:n,isPending:i}})(),h=()=>{const e={subscription:d.value,checkoutForm:k.form.value,enabledPricingIds:i,promotionCode:k.form.value.promotionCode};return k.form.value.enabledPricingIds&&(e.enabledPricingIds=k.form.value.enabledPricingIds),v.loadInvoicePreview(e)},k=Qe({initialState:{country:t,email:o},onRequiredFieldChange:()=>{d.value&&h().catch(()=>{})}}),x=e.computed(()=>{var e,t,o,n,i,l,r,c,u;const s=k.form.value.firstName||k.form.value.infix||k.form.value.lastName?{...k.form.value.firstName?{first_name:k.form.value.firstName}:{},...k.form.value.infix?{infix:k.form.value.infix}:{},...k.form.value.lastName?{last_name:k.form.value.lastName}:{}}:{},p={...k.form.value.addressLine1&&{line1:k.form.value.addressLine1},...k.form.value.addressLine2&&{line2:k.form.value.addressLine2},...k.form.value.city&&{city:k.form.value.city},...k.form.value.postalCode&&{postal_code:k.form.value.postalCode},...k.form.value.state&&{state:k.form.value.state},country:k.form.value.country??""},m=Fe({pricingPlanScheduleInfos:(null==(e=d.value)?void 0:e.pricing_plan_schedule_infos)??[],type:"DEFAULT"}),g=null==(t=null==m?void 0:m.pricing_plan_version)?void 0:t.pricing_currency_settings,v=((null==(o=null==g?void 0:g.pricing_currencies)?void 0:o.length)??0)>1,f=((null==(i=null==(n=null==m?void 0:m.pricing_plan_version)?void 0:n.billing_period_settings)?void 0:i.billing_periods)??[]).length>1,y=Ge({enabledPricings:null==(l=k.form.value.enabledPricingIds)?void 0:l.map(e=>({pricing_id:e})),seatsValues:k.form.value.seatsValues,pricingPlanScheduleInfos:(null==(r=d.value)?void 0:r.pricing_plan_schedule_infos)??[],pricingCurrency:v?null==(c=d.value)?void 0:c.billing_currency:void 0,billingPeriod:f?null==(u=d.value)?void 0:u.billing_period:void 0}),_=k.form.value.promotionCode,b=_&&d.value?(()=>{var e,t,o;const n=y?[...y]:[],a=(null==(e=n[0])?void 0:e.pricing_plan_schedule_id)??(null==(o=Fe({pricingPlanScheduleInfos:(null==(t=d.value)?void 0:t.pricing_plan_schedule_infos)??[],type:"DEFAULT"}))?void 0:o.id);if(!a)return y;const i=n.find(({pricing_plan_schedule_id:e})=>e===a);if(i)i.promotion_codes=[_];else{const e=null==y?void 0:y[0];n.push({pricing_plan_schedule_id:a,...(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:a,...b&&{pricing_plan_schedule_customizations:b},customer_details:{email:k.form.value.email??"",type:k.form.value.type,..."INDIVIDUAL"===k.form.value.type?{individual:{residential_address:p,...s?{name:s}:{}}}:{organization:{registered_address:p,legal_name:k.form.value.companyLegalName??"",...k.form.value.companyVatNumber&&Ue.$validator(k.form.value.companyVatNumber,{},{})?{tax_ids:[{id:k.form.value.companyVatNumber,type:"GENERIC_TAX_ID"}]}:{}}}}}}}),M=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([()=>k.form.value.country,M],([e,t])=>{d.value&&e&&t&&_({subscriptionId:d.value.id,country:e,amount:t})}),e.onMounted(async()=>{await(async()=>{var e,t,o,n,l,r;const c=await m({id:a,expanded:!0}),u=Fe({pricingPlanScheduleInfos:c.pricing_plan_schedule_infos,type:"DEFAULT"}),s=null==(n=null==(o=null==(t=null==(e=null==u?void 0:u.pricing_plan_version)?void 0:e.billing_period_settings)?void 0:t.billing_periods)?void 0:o[0])?void 0:n.period;d.value={...c,billing_period:s??c.billing_period},k.updateInitialState({...k.form.value,enabledPricingIds:et(c,i),...(null==(l=null==u?void 0:u.pricing_plan_schedule)?void 0:l.seats_values)?{seatsValues:null==(r=null==u?void 0:u.pricing_plan_schedule)?void 0:r.seats_values.map(({pricing_item_config_id:e,number:t})=>({pricing_item_config_id:e,number:t}))}:{}})})();try{await h()}catch{}}),p.watchOnce(f,e=>{e&&_({subscriptionId:d.value.id,country:k.form.value.country,amount:M.value})}),{invoicePreview:v.invoicePreview,invoicePreviewByBillingPeriod:v.invoicePreviewByBillingPeriod,trialInvoicePreview:v.trialInvoicePreview,trialPeriod:v.trialPeriod,loadInvoicePreview:h,updateInvoicePreviewOnBillingInformationChange:async e=>{const t=e.promotionCode??k.form.value.promotionCode,o=e.enabledPricingIds??k.form.value.enabledPricingIds;return await v.loadInvoicePreview({subscription:d.value,checkoutForm:{...k.form.value,...e},enabledPricingIds:o,promotionCode:t}),{trialInvoicePreview:v.trialInvoicePreview.value,invoicePreview:v.invoicePreview.value}},lastPreviewScheduleId:v.lastPreviewScheduleId,paymentMethodOptions:y,isPaymentMethodsPending:b,isInvoicePreviewPending:v.isPending,subscription:d,checkoutForm:k,authorizationContext:x,isPaid:l,amount:M}}const ot={class:"flex items-center gap-2"},nt=e.defineComponent({__name:"TaxIDCheckNotice",props:{taxIdValidationResult:{type:Object}},setup(o){const n=o,{formatMessage:a}=t.useIntl(),i=e.computed(()=>"VALID"===n.taxIdValidationResult.valid),l=e.computed(()=>i.value?a({defaultMessage:"VAT number is valid.",id:"damFt1",description:"The message shown when the VAT number is valid"}):a({defaultMessage:"VAT number is invalid.",id:"gR9xe+",description:"The message shown when the VAT number is invalid"}));return(o,n)=>(e.openBlock(),e.createBlock(e.unref(h._sfc_main),{type:i.value?"success":"danger",icon:!1},{default:e.withCtx(()=>[e.createElementVNode("div",ot,[e.createVNode(e.unref(t._sfc_main),{variant:"body-xs"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})])]),_:1},8,["type"]))}});const at={class:"grid grid-cols-1 gap-1"},it={class:"grid grid-cols-1 gap-2"},lt={key:0},rt={class:"mt-2 flex flex-col gap-3"},ct={class:"grid grid-cols-3 gap-2"},ut={class:"flex grow flex-col"},st={key:0},dt={class:"mt-4 grid grid-cols-1 gap-3"},pt=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(o){const a=o,l=e.ref(!1),r=e.useModel(o,"modelValue"),c=e.computed({get:()=>"ORGANIZATION"===r.value.type,set:e=>{r.value.type=e?"ORGANIZATION":"INDIVIDUAL"}}),u=e.computed(()=>"ORGANIZATION"===r.value.type),s=e.computed({get:()=>r.value.country,set:e=>{r.value.country=e&&Ie(e)?e:void 0}}),p=e.computed(()=>"US"!==r.value.country),{isTaxIDCheckEnabled:m,isTaxIDCheckPending:g,taxIdValidationData:v,runTaxIDCheck:f}=function(t){const{checkTaxID:o}=k.createCustomerService(),n=e.ref(void 0),a=e.computed(()=>{var e;return(null==(e=t.value.companyVatNumber)?void 0:e.trim())??""}),i=e.computed(()=>t.value.companyLegalName??""),l=e.computed(()=>t.value.country),r=e.ref(!1),c=e.computed(()=>L(l.value??"")),u=e.computed(()=>!!(a.value&&i.value&&l.value)),s=e.computed(()=>c.value&&a.value);return{runTaxIDCheck:async function(){var e;if(u.value&&c.value&&l.value){r.value=!0;try{const t=await o({type:"ORGANIZATION",organization:{legal_name:i.value,tax_ids:[{id:a.value,type:"GENERIC_TAX_ID"}],registered_address:{country:l.value}}});(null==(e=null==t?void 0:t.data)?void 0:e.length)?n.value=t.data[0]:n.value=void 0}finally{r.value=!1}}},taxIdValidationData:n,isTaxIDCheckPending:r,isTaxIDCheckEnabled:u,showViesCheckNotice:s,isSelectedCountryEU:c}}(r),{$t:y}=t.useIntl(),h=e=>a.getIsFieldRequired(e)?"":" "+y({defaultMessage:"(optional)",id:"checkout.optional_suffix.label",description:"The suffix for optional fields in the checkout form"}),x=e.computed(()=>r.value.country?b.getCountryNameByCode(r.value.country):void 0);return(a,b)=>(e.openBlock(),e.createElementBlock("form",{id:"checkout-form",onSubmit:b[12]||(b[12]=e.withModifiers(e=>a.$emit("submit",r.value),["prevent"]))},[e.createElementVNode("div",at,[e.createVNode(e.unref(_._sfc_main),{title:e.unref(y)({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",it,[o.readOnly?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(t._sfc_main),{variant:"body",tag:"span",weight:"semibold","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value.email),1)]),_:1}),e.createVNode(e.unref(t._sfc_main),{variant:"body-sm",tag:"span",shade:"lighter","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.value),1)]),_:1})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(d._sfc_main),{modelValue:r.value.email,"onUpdate:modelValue":b[0]||(b[0]=e=>r.value.email=e),required:"",type:"email",name:"email",disabled:!!o.readOnlyEmail,label:e.unref(y)({defaultMessage:"Email address",id:"checkout.email_address.label",description:"The email address of the customer in the checkout form"}),placeholder:e.unref(y)({defaultMessage:"Email address...",id:"checkout.email_address.placeholder",description:"The email address of the customer in the checkout form"})+h("email"),error:o.validation.value.email.$errors},null,8,["modelValue","disabled","label","placeholder","error"]),e.createVNode(e.unref(d._sfc_main$1),{"single-model-value":s.value,"onUpdate:singleModelValue":b[3]||(b[3]=e=>s.value=e),required:"",name:"country",label:e.unref(y)({defaultMessage:"Billing country",id:"checkout.country.label",description:"The country of the customer in the checkout form"})+h("country"),error:o.validation.value.country.$errors},{"label-suffix":e.withCtx(()=>[l.value||o.isBillingInformationMandatory?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(i._sfc_main),{key:0,size:"xs",variant:"ghost","icon-prefix":"add",class:"py-0.5",onClick:b[1]||(b[1]=e=>l.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)({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})),l.value&&!o.isBillingInformationMandatory?(e.openBlock(),e.createBlock(e.unref(i._sfc_main),{key:1,size:"sm",variant:"ghost","icon-prefix":"close",class:"py-0.5",onClick:b[2]||(b[2]=e=>l.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)({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(n._sfc_main),null,{default:e.withCtx(()=>[l.value||o.isBillingInformationMandatory?(e.openBlock(),e.createElementBlock("div",lt,[e.createElementVNode("div",rt,[e.createVNode(e.unref(d._sfc_main),{modelValue:r.value.addressLine1,"onUpdate:modelValue":b[4]||(b[4]=e=>r.value.addressLine1=e),name:"address_line_1",label:e.unref(y)({defaultMessage:"Billing address",id:"checkout.address.title",description:"Address line 1 of the customer address in the checkout form"}),placeholder:e.unref(y)({defaultMessage:"Address line 1...",id:"checkout.address.line1.placeholder",description:"Address line 1 of the customer address in the checkout form"})+h("addressLine1"),required:"",error:o.validation.value.addressLine1.$errors},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(d._sfc_main),{modelValue:r.value.addressLine2,"onUpdate:modelValue":b[5]||(b[5]=e=>r.value.addressLine2=e),name:"address_line_2",placeholder:e.unref(y)({defaultMessage:"Address line 2...",id:"checkout.address.line2.placeholder",description:"Address line 2 of the customer address in the checkout form"})+h("addressLine2")},null,8,["modelValue","placeholder"]),e.createElementVNode("div",ct,[e.createVNode(e.unref(d._sfc_main),{modelValue:r.value.postalCode,"onUpdate:modelValue":b[6]||(b[6]=e=>r.value.postalCode=e),name:"postal_code",placeholder:e.unref(y)({defaultMessage:"Postal code...",id:"checkout.address.portal_code.placeholder",description:"Postal code of the customer address in the checkout form"})+h("postalCode"),error:o.validation.value.addressLine1.$errors},null,8,["modelValue","placeholder","error"]),e.createVNode(e.unref(d._sfc_main),{modelValue:r.value.city,"onUpdate:modelValue":b[7]||(b[7]=e=>r.value.city=e),name:"city",placeholder:e.unref(y)({defaultMessage:"City...",id:"checkout.address.city.placeholder",description:"City of the customer address in the checkout form"})+h("city")},null,8,["modelValue","placeholder"]),e.createVNode(e.unref(d._sfc_main),{modelValue:r.value.state,"onUpdate:modelValue":b[8]||(b[8]=e=>r.value.state=e),name:"state",placeholder:e.unref(y)({defaultMessage:"State...",id:"checkout.address.state.placeholder",description:"State of the customer address in the checkout form"})+h("state"),error:o.validation.value.state.$errors},null,8,["modelValue","placeholder","error"])])])])):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["title"]),o.readOnly?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(_._sfc_main),{key:0},{default:e.withCtx(()=>[e.createVNode(e.unref(d._sfc_main$2),{modelValue:c.value,"onUpdate:modelValue":b[9]||(b[9]=e=>c.value=e),"no-spacing":"","label-position":"before",class:"!flex"},{"inline-label":e.withCtx(()=>[e.createElementVNode("div",ut,[e.createVNode(e.unref(t._sfc_main),{tag:"span"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)({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),{tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)({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(n._sfc_main),null,{default:e.withCtx(()=>[u.value?(e.openBlock(),e.createElementBlock("div",st,[e.createElementVNode("div",dt,[e.createVNode(e.unref(d._sfc_main),{modelValue:r.value.companyLegalName,"onUpdate:modelValue":b[10]||(b[10]=e=>r.value.companyLegalName=e),required:"",name:"legal_name",label:e.unref(y)({defaultMessage:"Legal entity name",id:"checkout.legal_name.label",description:"The legal name of the organization customer in the checkout form"}),placeholder:e.unref(y)({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"]),p.value?(e.openBlock(),e.createBlock(e.unref(d._sfc_main),{key:0,modelValue:r.value.companyVatNumber,"onUpdate:modelValue":b[11]||(b[11]=e=>r.value.companyVatNumber=e),name:"vat_number","input-class":"focus:outline-none focus:ring-0",label:e.unref(y)({defaultMessage:"VAT number",id:"checkout.vat_number.label",description:"The label for the vat number in the checkout form"}),placeholder:e.unref(y)({defaultMessage:"VAT number...",id:"checkout.vat_number.placeholder",description:"The label for the vat number in the checkout form"}),error:o.validation.value.companyVatNumber.$errors,"suffix-class":"px-2 border-l-0"},e.createSlots({_:2},[e.unref(L)(r.value.country??"")?{name:"suffix",fn:e.withCtx(()=>[e.createVNode(e.unref(i._sfc_main),{type:"button",size:"sm",color:"green",disabled:!e.unref(m)||e.unref(g)||o.validation.value.companyVatNumber.$invalid,onClick:e.unref(f)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)({defaultMessage:"Check",id:"checkout.vat_number.check_button.label",description:"The label for the check button in the checkout form"})),1)]),_:1},8,["disabled","onClick"])]),key:"0"}:void 0]),1032,["modelValue","label","placeholder","error"])):e.createCommentVNode("",!0),e.unref(v)?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass({"opacity-75":e.unref(g)})},[e.createVNode(nt,{"tax-id-validation-result":e.unref(v)},null,8,["tax-id-validation-result"])],2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),_:1})]),_:1}))])],32))}}),mt={key:0,class:"flex items-center"},gt=["innerHTML"],vt=["innerHTML"],ft=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(o){const{$t:i}=t.useIntl();return(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",null,[e.createVNode(e.unref(t._sfc_main),{variant:"heading-1",class:"inline-block"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.trialStartDate?o.subscriptionName:e.unref(i)({defaultMessage:"Pay and subscribe",id:"checkout.page_title",description:"The title of the checkout page"}))+e.toDisplayString(" "),1),o.trialPeriod?(e.openBlock(),e.createBlock(e.unref(n._sfc_main$1),{key:0,"trial-period":o.trialPeriod,size:"lg",class:"-translate-y-0.5"},null,8,["trial-period"])):e.createCommentVNode("",!0)]),_:1})]),e.createVNode(e.unref(t._sfc_main),{variant:"body-sm",shade:"lighter","no-spacing":""},{default:e.withCtx(()=>[o.countryCode?(e.openBlock(),e.createElementBlock("span",{key:1,innerHTML:o.trialStartDate?e.unref(i)({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(a.formatAmount)(o.amount),startDate:o.subscriptionStartDate,period_name:e.unref(a.formatBillingPeriod)(o.billingPeriod,{short:!0,hideValueForExactPeriods:!0}),strong:e=>`<strong>${e}</strong>`}):e.unref(i)({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(a.formatAmount)(o.amount),period_name:e.unref(a.formatBillingPeriod)(o.billingPeriod,{short:!0,hideValueForExactPeriods:!0}),strong:e=>`<strong>${e}</strong>`})},null,8,vt)):(e.openBlock(),e.createElementBlock("span",mt,[e.createVNode(e.unref(x._sfc_main),{"is-dark-mode":""},{tooltip:e.withCtx(()=>[e.createVNode(e.unref(x.TooltipContent),null,{default:e.withCtx(()=>[e.createVNode(e.unref(x._sfc_main$1),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({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(O),{"width-class":"w-10","height-class":"h-4",shade:"darker",class:"inline-block mr-1.5"})]),_:1}),e.createElementVNode("span",{innerHTML:o.trialStartDate?e.unref(i)({defaultMessage:"per {period_name} starting, {startDate, date, long}",id:"checkout.trial_period_description",description:"The description of the trial period"},{startDate:o.subscriptionStartDate,period_name:e.unref(a.formatBillingPeriod)(o.billingPeriod,{short:!0,hideValueForExactPeriods:!0})}):e.unref(i)({defaultMessage:"per {period_name}, starting today",id:"checkout.subscription_description",description:"The description of the subscription"},{period_name:e.unref(a.formatBillingPeriod)(o.billingPeriod,{short:!0,hideValueForExactPeriods:!0})})},null,8,gt)]))]),_:1})],64))}}),yt={class:"flex w-full min-h-96 justify-center items-center"},_t={class:"max-w-sm"},bt=e.defineComponent({__name:"CheckoutNotAvailable",setup(o){const{$t:n}=t.useIntl(),a=()=>{window.location.reload()};return(o,i)=>(e.openBlock(),e.createElementBlock("div",yt,[e.createElementVNode("div",_t,[e.createVNode(e.unref(t._sfc_main),{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),{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(a,["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})])]))}}),ht=e.defineComponent({__name:"SubscriptionPaymentCompletedCard",props:{redirectUrl:{type:String}},setup(o){const n=o,{$t:a}=t.useIntl();return e.onMounted(()=>{n.redirectUrl&&window.location.replace(n.redirectUrl)}),(n,l)=>(e.openBlock(),e.createBlock(f._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),{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}),o.redirectUrl?(e.openBlock(),e.createBlock(e.unref(i._sfc_main),{key:0,tag:"a",href:o.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,["href"])):e.createCommentVNode("",!0)]),_:1},8,["title"]))}}),kt={class:"flex flex-row gap-3 px-3 py-2"},xt={class:"grow"},Mt=e.defineComponent({__name:"SubscriptionSummary",props:{subscription:{type:Object},invoice:{type:Object},loading:{type:Boolean},enabledPricingIds:{type:Array},avatar:{type:String},trialPeriod:{type:Object}},setup(o){const n=o,{$t:a}=t.useIntl(),i=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}),l=e.computed(()=>{var e;return(null==(e=i.value)?void 0:e.name)||n.subscription.name||a({defaultMessage:"Subscription",description:"The fallback name for when no subscription name can be determined",id:"customer_overview.subscriptions_block.fallback_subscription_name"})}),r=e.computed(()=>{var e;return n.subscription.description||(null==(e=i.value)?void 0:e.description)}),c=e.computed(()=>{if(!n.subscription||!n.enabledPricingIds)return;const e=function(e,t){const o=[];return function e(n){Array.isArray(n)?n.forEach(e):n&&"object"==typeof n&&("PRICING"===n.object_type&&t.includes(n.id)&&o.push(n),Object.values(n).forEach(e))}(e),o}(n.subscription,n.enabledPricingIds);return null==e?void 0:e.map(e=>{var t,o;return e.name??(null==(o=null==(t=e.products)?void 0:t[0])?void 0:o.name)}).join(" - ")});return(n,a)=>(e.openBlock(),e.createElementBlock("div",kt,[o.avatar?(e.openBlock(),e.createBlock(e.unref(C._sfc_main),{key:0,"image-src":o.avatar,size:"lg",class:"my-1"},null,8,["image-src"])):e.createCommentVNode("",!0),e.createElementVNode("div",xt,[e.createVNode(e.unref(t._sfc_main),{variant:"body",weight:"semibold","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1}),c.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:0,variant:"body-xs",shade:"lighter","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1})):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{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(r.value),1)]),_:1})):e.createCommentVNode("",!0)])]))}}),Ct={class:"grid grid-cols-1 gap-1"},Nt={class:"px-3 py-2"},It={class:"flex flex-col gap-3"},wt={class:"px-3 py-2"},Et=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(o,{emit:i}){const l=o,r=i,{$t:c}=t.useIntl(),{map:u,formatTimePeriod:s}=n.useTimePeriod(),p=D.useBreakpoints(D.breakpointsTailwind).smaller("md"),m=e.computed(()=>p.value?"sm":"xs"),g=e=>`${e.type}:${e.value}`,v=["DAY","WEEK","MONTH","YEAR"],f=e=>v.includes(e),b=e=>{if(!e)return;const[t,o]=e.split(":"),n=Number(o);return n&&f(t)?{type:t,value:n}:void 0},h=e.computed({get:()=>{const e=l.subscription.billing_period;return e?`${e.type}:${e.value}`:void 0},set:e=>{if(!e)return;const[t,o]=e.split(":"),n=Number(o);n&&f(t)&&r("billing-period-change",{type:t,value:n})}}),k=e=>{var t,o,n,i;const r=null==(i=null==(n=null==(o=null==(t=l.invoicePreviewByBillingPeriod)?void 0:t[g(e)])?void 0:o.periods)?void 0:n[0])?void 0:i.amount_including_tax;if(!r)return;const u="MONTH"===e.type&&3===e.value?c({defaultMessage:"/quarter",id:"checkout.order_summary_block.billing_period.per_quarter",description:"Period label for quarterly billing"}):c({defaultMessage:"/{period}",id:"checkout.order_summary_block.billing_period.per_label",description:"Period label for billing cycles"},{period:s(e,{prefix:!1,hideValueForExactPeriods:!0})});return c({defaultMessage:"{amount}{period}",id:"checkout.order_summary_block.billing_period.sub_label",description:"Billing period option sublabel showing price per period"},{amount:a.formatAmount(r),period:u})},x=e=>{var t,o,n,a;return null==(a=null==(n=null==(o=null==(t=l.invoicePreviewByBillingPeriod)?void 0:t[g(e)])?void 0:o.periods)?void 0:n[0])?void 0:a.amount_including_tax},C=e=>Number(e.quantity),N=(e,t)=>{if(!t)return;const o={DAY:365,WEEK:52,MONTH:12,YEAR:1}[e.type]/Math.max(e.value??1,1),n=C(t)*o;return Number.isFinite(n)?{quantity:n.toFixed(2),currency:t.currency}:void 0},I=(e,t)=>{if(!e||!t)return;const o=C(e)-C(t);return!Number.isFinite(o)||o<=0?void 0:{quantity:o.toFixed(2),currency:e.currency}},w=e=>{if(!e)return;return`${c({defaultMessage:"Save {amount}",id:"checkout.order_summary_block.billing_period.save_badge.prefix",description:"First line for the savings badge label"},{amount:a.formatAmount(e)})}${c({defaultMessage:"/year",id:"checkout.order_summary_block.billing_period.save_badge.suffix",description:"Second line for the savings badge label"})}`},E=e.computed(()=>{var e,t,o;const n=Fe({pricingPlanScheduleInfos:l.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)??[],i=new Map,r=e=>{e&&i.set(g(e),e)},c=e=>{var t;null==(t=null==e?void 0:e.items)||t.forEach(e=>{var t,o,n;null==(t=e.configs)||t.forEach(e=>r(e.billing_period)),null==(o=e.billing_period_configs)||o.forEach(e=>r(e.billing_period)),null==(n=e.pricing_currency_configs)||n.forEach(e=>{var t,o;null==(t=e.configs)||t.forEach(e=>r(e.billing_period)),null==(o=e.billing_period_configs)||o.forEach(e=>r(e.billing_period))})})};if(((null==(o=null==n?void 0:n.pricing_plan_version)?void 0:o.pricing_categories)??[]).forEach(e=>{var t,o;null==(t=e.pricings)||t.forEach(e=>c(e)),null==(o=e.pricing_groups)||o.forEach(e=>{var t;return null==(t=e.pricings)?void 0:t.forEach(e=>c(e))})}),!i.size)return[];const u=a.map(e=>i.get(g(e.period))).filter(e=>!!e),s=new Set(u.map(g)),d=[...i.values()].filter(e=>!s.has(g(e)));return[...u,...d]}),B=e.computed(()=>{const e=E.value[E.value.length-1],t=e?N(e,x(e)):void 0;return E.value.map(o=>{const n="MONTH"===o.type&&3===o.value?c({defaultMessage:"Billed quarterly",id:"checkout.order_summary_block.billing_period.quarterly",description:"Billing period option label for quarterly billing"}):c({defaultMessage:"Billed {period}",id:"checkout.order_summary_block.billing_period.label",description:"Billing period option label for the selected period"},{period:u.value[o.type].full}),a=x(o),i=N(o,a),l=e&&o.type===e.type&&o.value===e.value?void 0:I(i,t),r=w(l);return{label:n,subLabel:k(o),labelSuffixComponent:r?{component:M._sfc_main,props:{color:"primary",content:r,size:m.value,class:"whitespace-nowrap text-left leading-tight"}}:void 0,hidden:h.value===`${o.type}:${o.value}`,value:`${o.type}:${o.value}`}})}),V=e.computed(()=>{const e=B.value,t=e[0],o=e[e.length-1];return{smallestPeriod:null==t?void 0:t.value,biggestPeriod:null==o?void 0:o.value}}),A=e.computed(()=>B.value.find(e=>e.value===V.value.biggestPeriod)),S=e.computed(()=>B.value.find(e=>e.value===h.value)),P=e.computed(()=>{var e,t,o,n,a,i,r,c;const u=B.value,s=u[u.length-1],d=h.value;if(!s||!d)return"";if(d===s.value)return"";const p=b(s.value);if(!p)return"";const m=null==(n=null==(o=null==(t=null==(e=l.invoicePreviewByBillingPeriod)?void 0:e[s.value])?void 0:t.periods)?void 0:o[0])?void 0:n.amount_including_tax,g=b(d),v=null==(c=null==(r=null==(i=null==(a=l.invoicePreviewByBillingPeriod)?void 0:a[d])?void 0:i.periods)?void 0:r[0])?void 0:c.amount_including_tax;if(!g||!v)return"";const f=N(g,v),y=N(p,m);return w(I(f,y))??""}),T=e=>{const{smallestPeriod:t,biggestPeriod:o}=V.value;h.value=e?o:t};return(n,a)=>(e.openBlock(),e.createBlock(e.unref(_._sfc_main),{"no-border":"","no-spacing":"","content-background":"none",title:o.noTitle?void 0:e.unref(c)({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",Ct,[e.createVNode(e.unref(_._sfc_main),{"no-spacing":""},{default:e.withCtx(()=>[o.subscription?(e.openBlock(),e.createBlock(Mt,{key:0,avatar:o.avatar,invoice:o.invoice,subscription:o.subscription,"enabled-pricing-ids":o.enabledPricingIds,loading:o.isPreviewAndPaymentMethodsPending,"trial-period":o.trialPeriod},null,8,["avatar","invoice","subscription","enabled-pricing-ids","loading","trial-period"])):e.createCommentVNode("",!0)]),_:1}),2===B.value.length?(e.openBlock(),e.createBlock(e.unref(_._sfc_main),{key:0,"no-spacing":"","content-classes":h.value===V.value.biggestPeriod?"border-primary-500":void 0},{default:e.withCtx(()=>{var t;return[e.createElementVNode("div",Nt,[e.createElementVNode("div",It,[A.value?(e.openBlock(),e.createBlock(y._sfc_main,{key:0,name:A.value.label,description:(null==(t=S.value)?void 0:t.subLabel)??""},e.createSlots({default:e.withCtx(()=>[e.createVNode(e.unref(d._sfc_main$2),{"model-value":h.value===V.value.biggestPeriod,"onUpdate:modelValue":T},null,8,["model-value"])]),_:2},[P.value?{name:"badge",fn:e.withCtx(()=>[e.createVNode(e.unref(M._sfc_main),{color:"primary",content:P.value,size:m.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"])):B.value.length>2?(e.openBlock(),e.createBlock(e.unref(Me),{key:1,"single-model-value":h.value,"onUpdate:singleModelValue":a[0]||(a[0]=e=>h.value=e),options:B.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),o.isUsageBased?(e.openBlock(),e.createBlock(e.unref(_._sfc_main),{key:2,"no-spacing":""},{default:e.withCtx(()=>[e.createElementVNode("div",wt,[e.createVNode(e.unref(t._sfc_main),{"no-spacing":"",variant:"body-sm",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)({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),o.invoice&&"products-inline"!==o.variant?(e.openBlock(),e.createBlock(e.unref($),{key:3,invoice:o.invoice,"wrapper-component":e.unref(_._sfc_main)},null,8,["invoice","wrapper-component"])):e.createCommentVNode("",!0),e.createVNode(e.unref(_._sfc_main),null,{default:e.withCtx(()=>[o.invoice?(e.openBlock(),e.createBlock(e.unref(G),{key:0,variant:"products-inline"===o.variant?"default":"without-products",invoice:o.invoice,"trial-invoice":o.trialInvoice,"is-paid":o.isPaid,collapsible:o.collapsible,"is-preview-without-taxes":!o.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),{key:1,variant:"body-sm",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)({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"]))}}),Bt={class:"py-4 flex flex-col items-center justify-center"},Dt=e.defineComponent({__name:"EmptyStatePlaceholder",props:{icon:{type:null}},setup:o=>(n,a)=>(e.openBlock(),e.createBlock(e.unref(_._sfc_main),null,{default:e.withCtx(()=>[e.createElementVNode("div",Bt,[e.createVNode(e.unref(i._sfc_main$1),{icon:o.icon,size:"lg",class:"text-gray-500"},null,8,["icon"]),e.createVNode(e.unref(t._sfc_main),{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),{center:"",tag:"span",variant:"body-xs",shade:"lightest",class:"mt-1"},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"message")]),_:3})])]),_:3}))}),Vt={key:0,id:"svg-logo",viewBox:"0 0 35 15",class:"h-[44px]"},At={key:1,src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAxcHgiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAxMDEgMzIiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaW5ZTWluIG1lZXQiIHhtbG5zPSJodHRwOiYjeDJGOyYjeDJGO3d3dy53My5vcmcmI3gyRjsyMDAwJiN4MkY7c3ZnIj48cGF0aCBmaWxsPSIjMDAzMDg3IiBkPSJNIDEyLjIzNyAyLjggTCA0LjQzNyAyLjggQyAzLjkzNyAyLjggMy40MzcgMy4yIDMuMzM3IDMuNyBMIDAuMjM3IDIzLjcgQyAwLjEzNyAyNC4xIDAuNDM3IDI0LjQgMC44MzcgMjQuNCBMIDQuNTM3IDI0LjQgQyA1LjAzNyAyNC40IDUuNTM3IDI0IDUuNjM3IDIzLjUgTCA2LjQzNyAxOC4xIEMgNi41MzcgMTcuNiA2LjkzNyAxNy4yIDcuNTM3IDE3LjIgTCAxMC4wMzcgMTcuMiBDIDE1LjEzNyAxNy4yIDE4LjEzNyAxNC43IDE4LjkzNyA5LjggQyAxOS4yMzcgNy43IDE4LjkzNyA2IDE3LjkzNyA0LjggQyAxNi44MzcgMy41IDE0LjgzNyAyLjggMTIuMjM3IDIuOCBaIE0gMTMuMTM3IDEwLjEgQyAxMi43MzcgMTIuOSAxMC41MzcgMTIuOSA4LjUzNyAxMi45IEwgNy4zMzcgMTIuOSBMIDguMTM3IDcuNyBDIDguMTM3IDcuNCA4LjQzNyA3LjIgOC43MzcgNy4yIEwgOS4yMzcgNy4yIEMgMTAuNjM3IDcuMiAxMS45MzcgNy4yIDEyLjYzNyA4IEMgMTMuMTM3IDguNCAxMy4zMzcgOS4xIDEzLjEzNyAxMC4xIFoiPjwvcGF0aD48cGF0aCBmaWxsPSIjMDAzMDg3IiBkPSJNIDM1LjQzNyAxMCBMIDMxLjczNyAxMCBDIDMxLjQzNyAxMCAzMS4xMzcgMTAuMiAzMS4xMzcgMTAuNSBMIDMwLjkzNyAxMS41IEwgMzAuNjM3IDExLjEgQyAyOS44MzcgOS45IDI4LjAzNyA5LjUgMjYuMjM3IDkuNSBDIDIyLjEzNyA5LjUgMTguNjM3IDEyLjYgMTcuOTM3IDE3IEMgMTcuNTM3IDE5LjIgMTguMDM3IDIxLjMgMTkuMzM3IDIyLjcgQyAyMC40MzcgMjQgMjIuMTM3IDI0LjYgMjQuMDM3IDI0LjYgQyAyNy4zMzcgMjQuNiAyOS4yMzcgMjIuNSAyOS4yMzcgMjIuNSBMIDI5LjAzNyAyMy41IEMgMjguOTM3IDIzLjkgMjkuMjM3IDI0LjMgMjkuNjM3IDI0LjMgTCAzMy4wMzcgMjQuMyBDIDMzLjUzNyAyNC4zIDM0LjAzNyAyMy45IDM0LjEzNyAyMy40IEwgMzYuMTM3IDEwLjYgQyAzNi4yMzcgMTAuNCAzNS44MzcgMTAgMzUuNDM3IDEwIFogTSAzMC4zMzcgMTcuMiBDIDI5LjkzNyAxOS4zIDI4LjMzNyAyMC44IDI2LjEzNyAyMC44IEMgMjUuMDM3IDIwLjggMjQuMjM3IDIwLjUgMjMuNjM3IDE5LjggQyAyMy4wMzcgMTkuMSAyMi44MzcgMTguMiAyMy4wMzcgMTcuMiBDIDIzLjMzNyAxNS4xIDI1LjEzNyAxMy42IDI3LjIzNyAxMy42IEMgMjguMzM3IDEzLjYgMjkuMTM3IDE0IDI5LjczNyAxNC42IEMgMzAuMjM3IDE1LjMgMzAuNDM3IDE2LjIgMzAuMzM3IDE3LjIgWiI+PC9wYXRoPjxwYXRoIGZpbGw9IiMwMDMwODciIGQ9Ik0gNTUuMzM3IDEwIEwgNTEuNjM3IDEwIEMgNTEuMjM3IDEwIDUwLjkzNyAxMC4yIDUwLjczNyAxMC41IEwgNDUuNTM3IDE4LjEgTCA0My4zMzcgMTAuOCBDIDQzLjIzNyAxMC4zIDQyLjczNyAxMCA0Mi4zMzcgMTAgTCAzOC42MzcgMTAgQyAzOC4yMzcgMTAgMzcuODM3IDEwLjQgMzguMDM3IDEwLjkgTCA0Mi4xMzcgMjMgTCAzOC4yMzcgMjguNCBDIDM3LjkzNyAyOC44IDM4LjIzNyAyOS40IDM4LjczNyAyOS40IEwgNDIuNDM3IDI5LjQgQyA0Mi44MzcgMjkuNCA0My4xMzcgMjkuMiA0My4zMzcgMjguOSBMIDU1LjgzNyAxMC45IEMgNTYuMTM3IDEwLjYgNTUuODM3IDEwIDU1LjMzNyAxMCBaIj48L3BhdGg+PHBhdGggZmlsbD0iIzAwOWNkZSIgZD0iTSA2Ny43MzcgMi44IEwgNTkuOTM3IDIuOCBDIDU5LjQzNyAyLjggNTguOTM3IDMuMiA1OC44MzcgMy43IEwgNTUuNzM3IDIzLjYgQyA1NS42MzcgMjQgNTUuOTM3IDI0LjMgNTYuMzM3IDI0LjMgTCA2MC4zMzcgMjQuMyBDIDYwLjczNyAyNC4zIDYxLjAzNyAyNCA2MS4wMzcgMjMuNyBMIDYxLjkzNyAxOCBDIDYyLjAzNyAxNy41IDYyLjQzNyAxNy4xIDYzLjAzNyAxNy4xIEwgNjUuNTM3IDE3LjEgQyA3MC42MzcgMTcuMSA3My42MzcgMTQuNiA3NC40MzcgOS43IEMgNzQuNzM3IDcuNiA3NC40MzcgNS45IDczLjQzNyA0LjcgQyA3Mi4yMzcgMy41IDcwLjMzNyAyLjggNjcuNzM3IDIuOCBaIE0gNjguNjM3IDEwLjEgQyA2OC4yMzcgMTIuOSA2Ni4wMzcgMTIuOSA2NC4wMzcgMTIuOSBMIDYyLjgzNyAxMi45IEwgNjMuNjM3IDcuNyBDIDYzLjYzNyA3LjQgNjMuOTM3IDcuMiA2NC4yMzcgNy4yIEwgNjQuNzM3IDcuMiBDIDY2LjEzNyA3LjIgNjcuNDM3IDcuMiA2OC4xMzcgOCBDIDY4LjYzNyA4LjQgNjguNzM3IDkuMSA2OC42MzcgMTAuMSBaIj48L3BhdGg+PHBhdGggZmlsbD0iIzAwOWNkZSIgZD0iTSA5MC45MzcgMTAgTCA4Ny4yMzcgMTAgQyA4Ni45MzcgMTAgODYuNjM3IDEwLjIgODYuNjM3IDEwLjUgTCA4Ni40MzcgMTEuNSBMIDg2LjEzNyAxMS4xIEMgODUuMzM3IDkuOSA4My41MzcgOS41IDgxLjczNyA5LjUgQyA3Ny42MzcgOS41IDc0LjEzNyAxMi42IDczLjQzNyAxNyBDIDczLjAzNyAxOS4yIDczLjUzNyAyMS4zIDc0LjgzNyAyMi43IEMgNzUuOTM3IDI0IDc3LjYzNyAyNC42IDc5LjUzNyAyNC42IEMgODIuODM3IDI0LjYgODQuNzM3IDIyLjUgODQuNzM3IDIyLjUgTCA4NC41MzcgMjMuNSBDIDg0LjQzNyAyMy45IDg0LjczNyAyNC4zIDg1LjEzNyAyNC4zIEwgODguNTM3IDI0LjMgQyA4OS4wMzcgMjQuMyA4OS41MzcgMjMuOSA4OS42MzcgMjMuNCBMIDkxLjYzNyAxMC42IEMgOTEuNjM3IDEwLjQgOTEuMzM3IDEwIDkwLjkzNyAxMCBaIE0gODUuNzM3IDE3LjIgQyA4NS4zMzcgMTkuMyA4My43MzcgMjAuOCA4MS41MzcgMjAuOCBDIDgwLjQzNyAyMC44IDc5LjYzNyAyMC41IDc5LjAzNyAxOS44IEMgNzguNDM3IDE5LjEgNzguMjM3IDE4LjIgNzguNDM3IDE3LjIgQyA3OC43MzcgMTUuMSA4MC41MzcgMTMuNiA4Mi42MzcgMTMuNiBDIDgzLjczNyAxMy42IDg0LjUzNyAxNCA4NS4xMzcgMTQuNiBDIDg1LjczNyAxNS4zIDg1LjkzNyAxNi4yIDg1LjczNyAxNy4yIFoiPjwvcGF0aD48cGF0aCBmaWxsPSIjMDA5Y2RlIiBkPSJNIDk1LjMzNyAzLjMgTCA5Mi4xMzcgMjMuNiBDIDkyLjAzNyAyNCA5Mi4zMzcgMjQuMyA5Mi43MzcgMjQuMyBMIDk1LjkzNyAyNC4zIEMgOTYuNDM3IDI0LjMgOTYuOTM3IDIzLjkgOTcuMDM3IDIzLjQgTCAxMDAuMjM3IDMuNSBDIDEwMC4zMzcgMy4xIDEwMC4wMzcgMi44IDk5LjYzNyAyLjggTCA5Ni4wMzcgMi44IEMgOTUuNjM3IDIuOCA5NS40MzcgMyA5NS4zMzcgMy4zIFoiPjwvcGF0aD48L3N2Zz4",role:"presentation",class:"h-[22px]"},St=e.defineComponent({__name:"ExpressPaymentMethodButton",props:{type:{type:String}},emits:["click"],setup(t,{emit:o}){const n=t,a=o,l=e.computed(()=>{switch(n.type){case"applepay":return"Apple Pay";case"googlepay":return"Google Pay";case"paypal":return"PayPal";default:return}}),r=e.computed(()=>{switch(n.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(t,o)=>(e.openBlock(),e.createBlock(e.unref(i._sfc_main),{size:"lg","aria-label":l.value,class:e.normalizeClass([r.value,"!block w-full h-11 bg-center bg-no-repeat"]),onClick:c},{default:e.withCtx(()=>["applepay"===n.type?(e.openBlock(),e.createElementBlock("svg",Vt,[...o[0]||(o[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"},[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"===n.type?(e.openBlock(),e.createElementBlock("img",At)):e.createCommentVNode("",!0)]),_:1},8,["aria-label","class"]))}}),Pt={class:"absolute h-[1px] w-[1px] overflow-hidden opacity-0"},Tt=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:o}){const n=t,a=o,i=e.ref(),l=f.useLogger(),{authorizePayment:r}=S.createPaymentsService(),c=n.paymentMethodOptionsResponse.payment_acceptor.id,u=e=>{if(!e.value)return;let t=e.value??1,o=e.type.toLowerCase();return"WEEK"===e.type&&(o="day",t=7*e.value),"day"===o||"month"===o||"year"===o||"hour"===o||"minute"===o?{recurringPaymentIntervalUnit:o,recurringPaymentIntervalCount:t}:void 0},s=e=>({postal_code:e.postalCode,city:e.locality,country:e.countryCode}),d=e=>({postal_code:e.postalCode,city:e.city,country:e.country}),p=e=>e&&m(e)?e:void 0,m=e=>Ie(e),g=()=>{var e;const t=null==(e=i.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-PpnAChnH.js")),o=new t(await e(f.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,...u(n.billingInformation.regular.interval??{type:"MONTH",value:1})}}},requiredBillingContactFields:["postalAddress"],requiredShippingContactFields:["email"],onPaymentMethodSelected:async(e,t,o)=>{var i,l,r,c,u,s,d;const{invoicePreview:m,trialInvoicePreview:g}=await n.onBillingInformationChange({...(null==(i=o.paymentMethod.billingContact)?void 0:i.postalCode)&&{postal_code:o.paymentMethod.billingContact.postalCode},...(null==(l=o.paymentMethod.billingContact)?void 0:l.locality)&&{city:o.paymentMethod.billingContact.locality},...p(null==(r=o.paymentMethod.billingContact)?void 0:r.countryCode)&&{country:p(null==(c=o.paymentMethod.billingContact)?void 0:c.countryCode)}}),v=g?g.invoice_amount_including_tax.quantity.toString():m.invoice_amount_including_tax.quantity.toString();a("update-billing-information",{postal_code:null==(u=o.paymentMethod.billingContact)?void 0:u.postalCode,city:null==(s=o.paymentMethod.billingContact)?void 0:s.locality,country:null==(d=o.paymentMethod.billingContact)?void 0:d.countryCode}),e({newTotal:{label:n.billingInformation.regular.label,amount:v,type:"final"}})},onError:e=>{l.error("APPLE_PAY_ERROR","Apple Pay error",{error:e})},onAuthorized:async(e,t)=>{try{l.info("APPLE_PAY_AUTHORIZED","Apple Pay authorized",{data:e});const o=e.authorizedEvent;l.info("APPLE_PAY_EVENT_DATA","Apple Pay event data structure",{eventData:o,hasPaymentMethod:!!o.payment.token.paymentMethod,hasBrowserInfo:!!o.payment.token.paymentData,billingAddress:e.billingAddress});const i=o.payment.billingContact,u=e.billingAddress;i?a("update-billing-information",s(i)):u&&a("update-billing-information",d(u));const p={payment_method:f.transformObjectToAdyenObject(o.payment.token.paymentMethod),browser_info:f.transformObjectToAdyenObject(o.payment.token.paymentData)};l.info("APPLE_PAY_ADYEN_PAYLOAD","Adyen payload prepared",{adyen:p});const m=f.createReturnUrl({paymentAcceptorId:c,redirectUrl:window.location.href});l.info("APPLE_PAY_CALLING_API","Calling authorizePayment API",{paymentAcceptorId:c,amount:n.amount});const g=await r({payment_acceptor_id:c,payment_gateway_variant:"ADYEN",adyen:{...p,store_payment_method:!0},amount:n.amount,return_url:m});if(l.info("APPLE_PAY_API_RESPONSE","Payment API response received",{status:g.status,paymentResult:g}),"FAILURE"===g.status)return l.error("APPLE_PAY_AUTHORIZATION_FAILED","Payment authorization failed",{error:g}),void t.reject();if("ACTION_REQUIRED"===g.status)return l.warn("APPLE_PAY_ACTION_REQUIRED","Payment requires additional action",{action:g.action}),void t.reject();l.info("APPLE_PAY_SUCCESS","Apple Pay payment successful, resolving"),t.resolve()}catch(o){l.error("APPLE_PAY_AUTHORIZATION_FAILED","Apple Pay authorization failed",{error:o}),t.reject()}}});if(i.value)try{await o.isAvailable(),o.mount(i.value),a("ready")}catch(m){}})()}),(o,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[t.isVisible?(e.openBlock(),e.createBlock(St,{key:0,type:"applepay",onClick:g})):e.createCommentVNode("",!0),e.createElementVNode("div",Pt,[e.createElementVNode("div",{ref_key:"applePayButtonRef",ref:i},null,512)])],64))}}),Lt={class:"relative overflow-hidden"},zt=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:o}){const n=t,a=o,i=e.ref(),l=f.useLogger();return e.onMounted(()=>{(async()=>{const{AdyenCheckout:e,PayPal:t}=await Promise.resolve().then(()=>require("../../auto-PpnAChnH.js")),o=new t(await e(f.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(i.value)try{await o.isAvailable(),o.mount(i.value)}catch(r){l.error("EXPRESS_CHECKOUT_PAYPAL_ERROR","Failed mounting PayPal express button",{error:r})}else l.error("EXPRESS_CHECKOUT_PAYPAL_ERROR","The PayPal button reference is not found and cannot be mounted")})()}),(o,n)=>(e.openBlock(),e.createElementBlock("div",Lt,[t.isVisible?(e.openBlock(),e.createBlock(St,{key:0,type:"paypal",class:"w-full"})):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"paypalButtonRef",ref:i,class:"absolute inset-0 opacity-[0.0001]"},null,512)]))}}),jt={class:"w-[1px] h-[1px] overflow-hidden opacity-0 absolute"},Ot=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:o}){const n=t,a=o,i=e.ref(),l=f.useLogger(),r=()=>{var e;const t=null==(e=i.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-PpnAChnH.js")),o=new t(await e(f.getAdyenExpressCheckoutConfiguration({locale:n.locale,amount:n.amount,countryCode:n.countryCode,paymentMethodOptionResponse:n.paymentMethodOptionsResponse})),{isExpress:!0});if(i.value)try{await o.isAvailable(),o.mount(i.value),a("ready")}catch(r){l.error("EXPRESS_CHECKOUT_GOOGLE_PAY_ERROR","Failed mounting Google Pay express button",{error:r})}else l.error("EXPRESS_CHECKOUT_GOOGLE_PAY_ERROR","The Google Pay button reference is not found and cannot be mounted")})()}),(o,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[t.isVisible?(e.openBlock(),e.createBlock(St,{key:0,type:"googlepay",onClick:r})):e.createCommentVNode("",!0),e.createElementVNode("div",jt,[e.createElementVNode("div",{ref_key:"googlePayButtonRef",ref:i},null,512)])],64))}}),Rt={key:0,class:"mt-4n"},$t={class:"mb-2"},Ut={class:"grid grid-cols-6 gap-1 md:gap-2"},Ft={class:"h-4 mt-4"},Gt=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(o){const n=["applepay"],a=o,{$t:i}=t.useIntl(),l=e.ref(!1),r=e.ref(!1),c=e.ref(!1),u=e.computed(()=>{var e;if(n.includes("applepay"))return null==(e=a.paymentMethodsOptionsResponse)?void 0:e.find(e=>{var t;return null==(t=e.options)?void 0:t.some(e=>"apple pay"===e.name.toLowerCase())})}),s=e.computed(()=>{var e;if(n.includes("paypal"))return null==(e=a.paymentMethodsOptionsResponse)?void 0:e.find(e=>{var t;return null==(t=e.options)?void 0:t.some(e=>"paypal"===e.name.toLowerCase())})}),d=e.computed(()=>{var e;if(n.includes("googlepay"))return null==(e=a.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||d.value||s.value)),m=e.computed(()=>{var e;if(0===(null==(e=a.paymentMethodsOptionsResponse)?void 0:e.length))return!1;const t=!u.value||l.value,o=!d.value||r.value,n=!s.value||c.value;return t&&o&&n}),g=e.computed(()=>m.value?(u.value?1:0)+(d.value?1:0)+(s.value?1:0):2);return(n,a)=>p.value?(e.openBlock(),e.createElementBlock("div",Rt,[e.createElementVNode("div",$t,[m.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:1,variant:"heading-3",tag:"h2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({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(V._sfc_main,{key:0,variant:"title"}))]),e.createElementVNode("div",Ut,[m.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(V._sfc_main,{class:"h-11 col-span-3"}),e.createVNode(V._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===g.value,"md:!col-span-3":2===g.value,"!col-span-6 md:!col-span-2":3===g.value}])},[u.value?(e.openBlock(),e.createBlock(Tt,{key:0,amount:o.amount,"billing-information":o.billingInformation,"country-code":o.countryCode,locale:o.locale,"is-visible":m.value,"payment-method-options-response":u.value,"on-billing-information-change":o.onBillingInformationChange,onReady:a[0]||(a[0]=e=>l.value=!0),onUpdateBillingInformation:a[1]||(a[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:!d.value,"col-span-6 md:col-span-6":1===g.value,"md:!col-span-3":2===g.value}])},[d.value?(e.openBlock(),e.createBlock(Ot,{key:0,amount:o.amount,"billing-information":o.billingInformation,"country-code":o.countryCode,locale:o.locale,"is-visible":m.value,"payment-method-options-response":d.value,onReady:a[2]||(a[2]=e=>r.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:!s.value,"col-span-6 md:col-span-6":1===g.value,"md:!col-span-3":2===g.value}])},[s.value?(e.openBlock(),e.createBlock(zt,{key:0,amount:o.amount,"billing-information":o.billingInformation,"country-code":o.countryCode,locale:o.locale,"is-visible":m.value,"payment-method-options-response":s.value,onReady:a[3]||(a[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",Ft,[m.value?(e.openBlock(),e.createBlock(e.unref(A._sfc_main),{key:1,text:e.unref(i)({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(V._sfc_main,{key:0,variant:"divider-text"}))])])):e.createCommentVNode("",!0)}}),qt={class:"grid grid-cols-2 gap-2"},Yt=e.defineComponent({__name:"TieredTableRow",props:{band:{type:Object},previousBand:{type:Object},isFirst:{type:Boolean},period:{type:Object}},setup(o){const i=o,{$t:l}=t.useIntl(),{formatTimePeriod:r}=n.useTimePeriod(),c=e.computed(()=>{var e;return i.isFirst?"0":(null==(e=i.previousBand)?void 0:e.tier_top_bound)&&"number"in i.previousBand.tier_top_bound?i.previousBand.tier_top_bound.number:void 0}),u=e.computed(()=>{if(i.band.tier_top_bound&&"number"in i.band.tier_top_bound)return i.band.tier_top_bound.number});return(n,i)=>(e.openBlock(),e.createElementBlock("div",qt,[e.createVNode(e.unref(t._sfc_main),{variant:"body-xs",shade:"lighter",tag:"div"},{default:e.withCtx(()=>[u.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(e.unref(l)({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:c.value??"0",upper_bound:u.value})),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(e.unref(l)({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:c.value??"0"})),1)],64))]),_:1}),e.createVNode(e.unref(t._sfc_main),{variant:"body-xs",shade:"lighter",tag:"div",class:"text-right"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.band.amount&&e.unref(l)({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(a.formatAmount)(o.band.amount),period:o.period?e.unref(r)(o.period,{short:!0,hideValueForExactPeriods:!0}):""})),1)]),_:1})]))}}),Kt={class:"grid grid-cols-1 gap-0.5 pt-1.5"},Ht=e.defineComponent({__name:"TieredTable",props:{bands:{type:Array},period:{type:Object}},setup:t=>(o,n)=>(e.openBlock(),e.createElementBlock("div",Kt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.bands,(o,n)=>(e.openBlock(),e.createBlock(Yt,{key:n,band:o,"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 Qt={class:"flex flex-row-reverse md:flex-row gap-4"},Zt={class:"w-24 md:w-32 shrink-0 justify-start"},Xt=["tabindex"],Wt={key:0},Jt={key:0},eo=e.defineComponent({__name:"SeatsEditorItem",props:e.mergeModels({modelValue:{type:Object},defaultValue:{type:Object},pricings:{type:Array}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const l=o,r=e.useModel(o,"modelValue"),{$t:c}=t.useIntl(),{formatTimePeriod:u}=n.useTimePeriod(),s=e.ref(!1),d=e.computed({get:()=>r.value.number?+r.value.number:1,set(e){r.value={...r.value,number:void 0!==e?e.toString():void 0}}}),p=function({pricings:t,pricingItemConfigId:o}){return e.computed(()=>{var e,n;const{config:a,productItem:i}=function({pricings:e,pricingItemConfigId:t}){var o,n;const a=e.flatMap(e=>e.items??[]).find(e=>{var o;return null==(o=e.configs)?void 0:o.some(e=>e.id===t)});return{config:null==(o=null==a?void 0:a.configs)?void 0:o.find(e=>e.id===t),productItem:null==(n=null==a?void 0:a.product_items)?void 0:n[0]}}({pricings:t,pricingItemConfigId:o});return{billing:{period:null==a?void 0:a.billing_period,billedInAdvance:null==a?void 0:a.billing_in_advance},product:{name:null==i?void 0:i.name,description:null==i?void 0:i.description},pricing:{..."FLAT"===(null==a?void 0:a.type)&&{amount:null==(n=null==(e=a.bands)?void 0:e[0])?void 0:n.amount},..."TIERED"===(null==a?void 0:a.type)&&{tiered:{bands:a.bands}}}}})}({pricings:l.pricings,pricingItemConfigId:r.value.pricing_item_config_id}),m=e.computed(()=>{var e,t;return!!(null==(t=null==(e=p.value.pricing)?void 0:e.tiered)?void 0:t.bands)});return(l,r)=>{var g,v,f;return e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",Qt,[e.createElementVNode("div",Zt,[e.createVNode(e.unref(Ne),{modelValue:d.value,"onUpdate:modelValue":r[0]||(r[0]=e=>d.value=e),size:"sm",min:(null==(g=o.defaultValue)?void 0:g.number)?+o.defaultValue.number:void 0},null,8,["modelValue","min"])]),e.createElementVNode("div",{class:e.normalizeClass(["flex flex-col grow",{"hover:cursor-pointer":m.value}]),tabindex:m.value?0:void 0,onClick:r[1]||(r[1]=e=>m.value?s.value=!s.value:void 0)},[e.createVNode(e.unref(t._sfc_main),{tag:"span",variant:"body-sm",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(p).product.name||e.unref(c)({defaultMessage:"Seats",id:"seats.label",description:"The label for the seats input field"})),1)]),_:1}),e.unref(p).pricing.amount?(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:0,tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)({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(a.formatAmount)(e.unref(p).pricing.amount),period:e.unref(p).billing.period?e.unref(u)(e.unref(p).billing.period,{short:!0,hideValueForExactPeriods:!0}):""})),1)]),_:1})):e.unref(p).pricing.tiered?(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:1,tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)({defaultMessage:"Tiered pricing",id:"seats.tiered_pricing_label",description:"The label indicating tiered pricing structure for seats"}))+" ",1),e.createVNode(e.unref(i._sfc_main$1),{icon:"keyboard_arrow_down",size:"xs",class:e.normalizeClass(["absolute transition ease-in-out text-gray-400",{"rotate-0":!s.value,"rotate-180":s.value}])},null,8,["class"])]),_:1})):e.createCommentVNode("",!0)],10,Xt)]),(null==(f=null==(v=e.unref(p).pricing)?void 0:v.tiered)?void 0:f.bands)?(e.openBlock(),e.createElementBlock("div",Wt,[e.createVNode(e.unref(n._sfc_main),null,{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createElementBlock("div",Jt,[e.createVNode(Ht,{bands:e.unref(p).pricing.tiered.bands,period:e.unref(p).billing.period},null,8,["bands","period"])])):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0)])}}}),to=e.defineComponent({__name:"SeatsEditor",props:e.mergeModels({modelValue:{type:Array},initialSeatsValues:{type:Array},pricings:{type:Array}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const o=e.useModel(t,"modelValue"),n=t=>e.computed({get:()=>o.value[t],set:e=>{const n=o.value.slice();n[t]=e,o.value=n}});return(o,a)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.modelValue,(o,a)=>(e.openBlock(),e.createBlock(e.unref(_._sfc_main),{key:a},{default:e.withCtx(()=>{var i;return[o.pricing_item_config_id?(e.openBlock(),e.createBlock(eo,{key:o.pricing_item_config_id,modelValue:n(a).value,"onUpdate:modelValue":e=>n(a).value=e,"default-value":null==(i=t.initialSeatsValues)?void 0:i[a],pricings:t.pricings},null,8,["modelValue","onUpdate:modelValue","default-value","pricings"])):e.createCommentVNode("",!0)]}),_:2},1024))),128))}}),oo={class:"flex gap-4 border-l-2 border-primary-600 px-2"},no={class:"grow"},ao=e.defineComponent({__name:"PricingGroupTitle",setup:o=>(o,n)=>(e.openBlock(),e.createElementBlock("div",oo,[e.createElementVNode("div",no,[e.createVNode(e.unref(t._sfc_main),{tag:"span",variant:"body-sm",weight:"semibold"},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"title")]),_:3})]),e.createElementVNode("div",null,[e.createVNode(e.unref(t._sfc_main),{tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"description")]),_:3})])]))}),io={class:"p-1"},lo={class:"grid grid-cols-1 gap-1 pt-1"},ro=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(o){const a=o,i=e.useModel(o,"modelValue"),{$t:l}=t.useIntl(),{renderPricingForPricingItem:r}=n.usePricingItem({currency:e.toRef(a,"currency"),billingPeriod:e.toRef(a,"billingPeriod")}),c=a.pricings.map(e=>e.id),u=e.computed(()=>"AT_MOST_ONE"===a.constraint?l({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"===a.constraint?l({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"===a.constraint?l({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"}):""),s=e=>a.modelValue.includes(e);return(t,n)=>(e.openBlock(),e.createBlock(e.unref(_._sfc_main),{"no-spacing":""},{default:e.withCtx(()=>[e.createElementVNode("div",io,[e.createVNode(ao,null,{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.groupName),1)]),description:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1}),e.createElementVNode("div",lo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.pricings,t=>(e.openBlock(),e.createBlock(e.unref(_._sfc_main),{key:t.id,"content-background":"none",class:e.normalizeClass({"!bg-white":s(t.id)})},{default:e.withCtx(()=>{var o,n;return[e.createVNode(y._sfc_main,{name:e.unref(Je)(t)??"",description:(null==(o=t.items)?void 0:o[0])?e.unref(r)({pricingItem:null==(n=t.items)?void 0:n[0]}):e.unref(l)({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(d._sfc_main$2),{"model-value":s(t.id),"onUpdate:modelValue":e=>(e=>{if(s(e))i.value=i.value.filter(t=>t!==e);else{const t=i.value.filter(e=>!c.includes(e));i.value=[...t,e]}})(t.id)},null,8,["model-value","onUpdate:modelValue"])]),_:2},1032,["name","description"])]}),_:2},1032,["class"]))),128))])])]),_:1}))}}),co={class:"grid grid-cols-1 gap-1"},uo=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(o){const a=o,l=e.useModel(o,"modelValue"),{$t:r}=t.useIntl(),{renderPricingForPricingItem:c}=n.usePricingItem({currency:e.toRef(a,"currency"),billingPeriod:e.toRef(a,"billingPeriod")}),u=e=>l.value.includes(e),s=e=>{u(e)?l.value=l.value.filter(t=>t!==e):l.value=[...l.value,e]};return(t,n)=>(e.openBlock(),e.createBlock(e.unref(_._sfc_main),{"no-spacing":"","no-border":!o.groupName,"content-background":o.groupName?"gray":"none"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["grid grid-cols-1 gap-1",{"p-1":o.groupName}])},[o.groupName?(e.openBlock(),e.createBlock(ao,{key:0},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.groupName),1)]),description:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({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",co,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.pricings,t=>(e.openBlock(),e.createBlock(e.unref(_._sfc_main),{key:t.id,"content-background":o.groupName||u(t.id)?"none":"gray",class:e.normalizeClass({"!bg-white":u(t.id)})},{default:e.withCtx(()=>{var o,n;return[e.createVNode(y._sfc_main,{name:e.unref(Je)(t)??"",description:(null==(o=t.items)?void 0:o[0])?e.unref(c)({pricingItem:null==(n=t.items)?void 0:n[0]}):e.unref(r)({defaultMessage:"Unsupported pricing",id:"addon_multiple_editor.unsupported_pricing_error",description:"Text displayed when the pricing item pricing is unsupported"})},{default:e.withCtx(()=>[u(t.id)?(e.openBlock(),e.createBlock(e.unref(i._sfc_main),{key:0,color:"gray",variant:"outline",square:"",size:"sm","icon-prefix":"remove_shopping_cart",onClick:e=>s(t.id)},null,8,["onClick"])):(e.openBlock(),e.createBlock(e.unref(i._sfc_main),{key:1,color:"primary","icon-prefix":"add",size:"sm",onClick:e=>s(t.id)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({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 so(){return{isMobileViewport:D.useBreakpoints(D.breakpointsTailwind).smallerOrEqual("sm")}}const po={class:"p-1"},mo={class:"pt-1"},go=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(o){const a=o,i=e.useModel(o,"modelValue"),{$t:l}=t.useIntl(),{renderPricingForPricingItem:r}=n.usePricingItem({currency:e.toRef(a,"currency"),billingPeriod:e.toRef(a,"billingPeriod")}),{isMobileViewport:c}=so(),u=e.computed(()=>a.pricings.map(e=>e.id)),s=e.computed({get:()=>i.value.find(e=>u.value.includes(e))??void 0,set:e=>{const t=i.value.filter(e=>!u.value.includes(e));i.value=e?[...t,e]:t}}),d=e.computed(()=>a.pricings.map(e=>{var t;const o=null==(t=e.items)?void 0:t[0];return{label:Je(e)??"",value:e.id,description:o?r({pricingItem:o}):l({defaultMessage:"Unsupported pricing",id:"pricing_item_pricing.unsupported_pricing_error",description:"Text displayed when the pricing item pricing is unsupported"})}}));return(t,a)=>(e.openBlock(),e.createBlock(e.unref(_._sfc_main),{"no-spacing":""},{default:e.withCtx(()=>[e.createElementVNode("div",po,[e.createVNode(ao,null,{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.groupName),1)]),_:1}),e.createElementVNode("div",mo,[d.value.length<=3?(e.openBlock(),e.createBlock(e.unref(X),{key:0,modelValue:s.value,"onUpdate:modelValue":a[0]||(a[0]=e=>s.value=e),options:d.value.slice(0,3),direction:e.unref(c)?"column":"row","show-radio":!1},null,8,["modelValue","options","direction"])):d.value.length<=6?(e.openBlock(),e.createBlock(e.unref(Me),{key:1,"single-model-value":s.value,"onUpdate:singleModelValue":a[1]||(a[1]=e=>s.value=e),options:d.value.map(({value:e,label:t,description:o})=>({label:t,subLabel:o,value:e})),size:"xl","show-sub-label-in-input":""},null,8,["single-model-value","options"])):(e.openBlock(),e.createBlock(e.unref(n._sfc_main$2),{key:2,modelValue:s.value,"onUpdate:modelValue":a[2]||(a[2]=e=>s.value=e),options:d.value,name:`pricing-group-range-input-${o.groupName}`},null,8,["modelValue","options","name"]))])])]),_:1}))}});const vo={class:"grid grid-cols-1 gap-1"},fo=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(o){const n=o,a=e.useModel(o,"seatsValues"),i=e.useModel(o,"enabledPricingIds"),{$t:l}=t.useIntl(),r=e.computed(()=>{var e;const t=null==(e=Fe({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(()=>r.value.filter(e=>"ADDON"===e.product_type)),u=e.computed(()=>We(n.subscription));return(t,n)=>(e.openBlock(),e.createBlock(e.unref(_._sfc_main),{title:e.unref(l)({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",vo,[e.createVNode(to,{modelValue:a.value,"onUpdate:modelValue":n[0]||(n[0]=e=>a.value=e),"initial-seats-values":o.initialSeatsValues,pricings:r.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(go,{key:0,modelValue:i.value,"onUpdate:modelValue":n[1]||(n[1]=e=>i.value=e),"group-name":t.name,pricings:t.pricings,"billing-period":o.billingPeriod,currency:o.currency},null,8,["modelValue","group-name","pricings","billing-period","currency"])):"ADDON"===t.product_type&&"AT_MOST_ONE"===t.selection_constraint?(e.openBlock(),e.createBlock(ro,{key:1,modelValue:i.value,"onUpdate:modelValue":n[2]||(n[2]=e=>i.value=e),"group-name":t.name,pricings:t.pricings,constraint:t.selection_constraint,"billing-period":o.billingPeriod,currency:o.currency},null,8,["modelValue","group-name","pricings","constraint","billing-period","currency"])):"ADDON"===t.product_type&&"ANY"===t.selection_constraint?(e.openBlock(),e.createBlock(uo,{key:2,modelValue:i.value,"onUpdate:modelValue":n[3]||(n[3]=e=>i.value=e),pricings:t.pricings,"group-name":t.name,"billing-period":o.billingPeriod,currency:o.currency},null,8,["modelValue","pricings","group-name","billing-period","currency"])):e.createCommentVNode("",!0)],64))),128)),e.createVNode(uo,{modelValue:i.value,"onUpdate:modelValue":n[4]||(n[4]=e=>i.value=e),pricings:c.value,"billing-period":o.billingPeriod,currency:o.currency},null,8,["modelValue","pricings","billing-period","currency"])])]),_:1},8,["title"]))}}),yo=["aria-expanded","aria-label"],_o={class:"flex flex-row items-center justify-between w-full gap-3 px-3 py-2 cursor-pointer"},bo={class:"flex flex-row gap-2 items-center"},ho=["onKeydown"],ko=["aria-label"],xo={class:"flex flex-row items-center justify-between w-full gap-3 px-3 py-2 cursor-pointer"},Mo={class:"flex flex-row gap-2 items-center"},Co={class:"sr-only","aria-live":"polite"},No=e.defineComponent({__name:"PromotionCodeSection",props:{promotionCode:{default:null,type:[String,null]}},emits:["update:appliedCode","apply","remove"],setup(o,{emit:n}){const{$t:a}=t.useIntl(),l=o,r=n,c=e.ref(!1),u=e.ref(""),s=e.ref(""),p=e.ref(null),m=e.ref(null),g="promotion-code-"+ ++Be;const v=`${g}-label`,f=`${g}-panel`,y=e.computed(()=>null!==l.promotionCode&&""!==l.promotionCode),b=e.computed(()=>u.value.trim().length>0),h=e.computed(()=>l.promotionCode??a({defaultMessage:"Promotion applied",id:"checkout.promotion_code.applied_label",description:"Fallback label for an applied promotion code in checkout"})),k=e.computed(()=>a({defaultMessage:c.value?"Collapse promotion code input":"Expand promotion code input",id:c.value?"checkout.promotion_code.collapse_aria_label":"checkout.promotion_code.expand_aria_label",description:"Aria label for the promotion code toggle button in checkout"})),x=e.computed(()=>a({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(()=>a({defaultMessage:"Remove promotion code",id:"checkout.promotion_code.remove_aria_label",description:"Aria label for the promotion code remove button in checkout"})),C=()=>{u.value=""},N=()=>{c.value&&(c.value=!1)},I=()=>{y.value||(c.value=!c.value)},w=()=>{if(!b.value)return;const e=u.value.trim();r("update:appliedCode",e),r("apply",e),s.value=a({defaultMessage:"Promotion code applied",id:"checkout.promotion_code.applied_status",description:"Aria live message when a promotion code is applied in checkout"}),c.value=!1},E=()=>{r("update:appliedCode",null),r("remove"),s.value=a({defaultMessage:"Promotion code removed",id:"checkout.promotion_code.removed_status",description:"Aria live message when a promotion code is removed in checkout"}),C(),e.nextTick(()=>{var e;null==(e=p.value)||e.focus()})};return e.watch(c,t=>{if(!t)return C(),void e.nextTick(()=>{var e;null==(e=p.value)||e.focus()});e.nextTick(()=>{(()=>{var e;const t=null==(e=m.value)?void 0:e.querySelector("input");t instanceof HTMLInputElement&&t.focus()})()})}),e.watch(()=>l.promotionCode,e=>{e||C()}),(o,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[y.value?(e.openBlock(),e.createBlock(e.unref(_._sfc_main),{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:E},[e.createElementVNode("div",xo,[e.createElementVNode("div",Mo,[e.createVNode(e.unref(i._sfc_main$1),{icon:"local_activity"}),e.createVNode(e.unref(t._sfc_main),{variant:"body-sm",class:"font-semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.value),1)]),_:1})]),e.createVNode(e.unref(i._sfc_main$1),{icon:"close"})])],8,ko)]),_:1})):(e.openBlock(),e.createBlock(e.unref(_._sfc_main),{key:0,"no-spacing":"",class:"w-full relative"},{default:e.withCtx(()=>[e.createElementVNode("button",{ref_key:"toggleRef",ref:p,type:"button",class:"w-full","aria-expanded":c.value,"aria-controls":f,"aria-label":k.value,onClick:I},[e.createElementVNode("div",_o,[e.createElementVNode("div",bo,[e.createVNode(e.unref(i._sfc_main$1),{icon:"local_activity"}),e.createVNode(e.unref(t._sfc_main),{id:v,variant:"body-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({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(i._sfc_main$1),{icon:c.value?"remove":"add"},null,8,["icon"])])],8,yo),e.withDirectives(e.createElementVNode("div",{id:f,ref_key:"panelRef",ref:m,role:"region","aria-labelledby":v,class:"w-full border-t px-3 py-2 flex flex-row gap-2 items-center overflow-hidden",onKeydown:e.withKeys(e.withModifiers(N,["prevent"]),["esc"])},[e.createVNode(e.unref(d._sfc_main),{modelValue:u.value,"onUpdate:modelValue":n[0]||(n[0]=e=>u.value=e),placeholder:e.unref(a)({defaultMessage:"Promotion code",id:"checkout.promotion_code.placeholder",description:"Placeholder for promotion code input in checkout"}),"aria-label":e.unref(a)({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(w,["prevent"]),["enter"])},null,8,["modelValue","placeholder","aria-label","onKeydown"]),e.createVNode(e.unref(i._sfc_main),{type:"button",disabled:!b.value,"aria-label":x.value,"aria-disabled":!b.value,onClick:w},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({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,ho),[[e.vShow,c.value]])]),_:1})),e.createElementVNode("span",Co,e.toDisplayString(s.value),1)],64))}}),Io={key:0},wo=e.defineComponent({__name:"Checkout",props:{configuration:{type:Object}},emits:["error","ready"],setup(o,{emit:r}){var c,u,s,d,p,m,g,_;const b=o,h=r,k=e.computed(()=>b.configuration),x=e.ref(),M=e.ref(),C=f.useLogger(),{$t:N,locale:I}=t.useIntl(),{formatTimePeriod:w}=n.useTimePeriod(),E=v.usePortal(),{isMobileViewport:B}=so();if(C.info("COMPONENT_INITIALIZED","Checkout component initialized"),"INIT_PRICING_PLAN_SUBSCRIPTION"!==(null==(c=E.value)?void 0:c.type))throw C.error("INVALID_TOKEN","Invalid token"),Error("Invalid token");"REVOKED"===E.value.status&&(x.value={code:"RESOURCE_REVOKED",message:`Portal url with resource id "${E.value.id}" is revoked`},C.error("RESOURCE_REVOKED",`Portal url with resource id "${E.value.id}" is revoked`));const D=null==(s=null==(u=E.value)?void 0:u.init_pricing_plan_subscription)?void 0:s.pricing_plan_subscription_id,A=null==(p=null==(d=E.value)?void 0:d.init_pricing_plan_subscription)?void 0:p.success_url,{paymentMethodOptions:S,subscription:P,isPaymentMethodsPending:T,isInvoicePreviewPending:L,checkoutForm:z,invoicePreview:j,invoicePreviewByBillingPeriod:O,trialInvoicePreview:R,trialPeriod:$,authorizationContext:U,isPaid:F,amount:G,loadInvoicePreview:q,updateInvoicePreviewOnBillingInformationChange:Y}=tt({initialCountry:null==(m=b.configuration)?void 0:m.countryCode,initialEmail:null==(g=b.configuration)?void 0:g.email,subscriptionId:D,enabledPricingIds:null==(_=b.configuration)?void 0:_.enabledPricingIds}),K=async()=>{var e;await z.validation.value.$validate(),z.validation.value.$invalid||null==(e=M.value)||e.submit()},H=async()=>(await z.validation.value.$validate(),!z.validation.value.$invalid),Q=e.computed(()=>!!R.value),Z=e.computed(()=>!!j.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})(j.value)),X=e.computed(()=>z.form.value.country&&["US","CA"].includes(z.form.value.country)||!1),W=e.computed({get:()=>z.form.value.enabledPricingIds??[],set:e=>{z.form.value.enabledPricingIds=e}}),J=e.computed(()=>P.value?Fe({pricingPlanScheduleInfos:P.value.pricing_plan_schedule_infos,type:"DEFAULT"}):void 0),ee=e.computed(()=>{var e,t;if(!P.value)return;const o=null==(t=null==(e=J.value)?void 0:e.pricing_plan_version)?void 0:t.pricing_currency_settings;return Ye({country:z.form.value.country,pricingCurrencySettings:o,fallbackCurrency:P.value.billing_currency})}),te=e.computed(()=>{if(!J.value||!P.value)return new Set;const e=function({pricingPlanScheduleInfo:e}){const t=new Map;return(e.pricing_plan_version.pricing_categories??[]).forEach(e=>{var o;null==(o=e.pricings)||o.forEach(e=>{var o;null==(o=e.items)||o.forEach(e=>{var o,n,a;null==(o=e.billing_period_configs)||o.forEach(e=>{var o;null==(o=e.configs)||o.forEach(o=>{var n,a,i;if(o.id){const l=null==(i=null==(a=null==(n=o.bands)?void 0:n.find(e=>{var t;return null==(t=e.amount)?void 0:t.currency}))?void 0:a.amount)?void 0:i.currency;t.set(o.id,{...l&&{currency:l},billingPeriod:e.billing_period})}})}),null==(n=e.configs)||n.forEach(e=>{var o,n,a;if(e.id){const i=null==(a=null==(n=null==(o=e.bands)?void 0:o.find(e=>{var t;return null==(t=e.amount)?void 0:t.currency}))?void 0:n.amount)?void 0:a.currency;t.set(e.id,{...i&&{currency:i}})}}),null==(a=e.pricing_currency_configs)||a.forEach(e=>{var o,n;const a=e.currency;null==(o=e.billing_period_configs)||o.forEach(e=>{var o;null==(o=e.configs)||o.forEach(o=>{o.id&&t.set(o.id,{currency:a,billingPeriod:e.billing_period})})}),null==(n=e.configs)||n.forEach(e=>{e.id&&t.set(e.id,{currency:a})})})})})}),t}({pricingPlanScheduleInfo:J.value}),t=ee.value,o=P.value.billing_period,n=new Set;return e.forEach((e,a)=>{t&&e.currency!==t||o&&e.billingPeriod&&(e.billingPeriod.type!==o.type||e.billingPeriod.value!==o.value)||n.add(a)}),n}),oe=e.computed({get:()=>{const e=z.form.value.seatsValues??[],t=te.value;return t.size?e.filter(({pricing_item_config_id:e})=>t.has(e)):e},set:e=>{const t=z.form.value.seatsValues??[],o=te.value;if(!o.size)return void(z.form.value.seatsValues=e);const n=t.filter(({pricing_item_config_id:e})=>!o.has(e));z.form.value.seatsValues=n.concat(e)}}),ne=e.computed(()=>{var e,t,o,n,i;return R.value?N({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"===R.value.tax_summary.total_amount.quantity?N({defaultMessage:"Free",id:"checkout.agreement.trial.free",description:"The free amount for the trial period"}):a.formatAmount(R.value.tax_summary.total_amount),trial_period:w($.value,{short:!0}),subscription_amount:a.formatAmount((null==(e=j.value)?void 0:e.tax_summary.total_amount)??{quantity:"0.00",currency:"EUR"}),billing_period:w((null==(t=j.value)?void 0:t.billing_period)??{type:"MONTH",value:1},{short:!0,singular:!0,hideValueForExactPeriods:!0}),start_date:new Date(de.value)}):N({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==(o=j.value)?void 0:o.tax_summary.total_amount)?a.formatAmount(null==(n=j.value)?void 0:n.tax_summary.total_amount):"",billing_period:w((null==(i=j.value)?void 0:i.billing_period)??{type:"MONTH",value:1},{short:!0,singular:!0,hideValueForExactPeriods:!0}),start_date:new Date(de.value)})}),ae=e.computed(()=>{var e,t,o,n,a,i;if(!j.value)return;const l=(null==(e=P.value)?void 0:e.name)??(null==(a=null==(n=null==(o=null==(t=P.value)?void 0:t.pricing_plan_schedule_infos)?void 0:o.at(-1))?void 0:n.pricing_plan_version.pricing_plan)?void 0:a.name)??"Subscription";return{description:l,managementURL:"https://www.solvimon.com/account/billing",agreement:ne.value,...R.value&&$.value&&{trial:{label:N({defaultMessage:"Trial",id:"checkout.trial.label",description:"The label of the trial"}),amount:R.value.tax_summary.total_amount,startDate:ce.value?new Date(ce.value):void 0,endDate:se.value?new Date(se.value):void 0}},regular:{label:l,amount:j.value.tax_summary.total_amount,startDate:de.value?new Date(de.value):void 0,interval:(null==(i=P.value)?void 0:i.billing_period)??{type:"MONTH",value:1}}}}),ie=e=>Ie(e),le=e=>{const{country:t,...o}=e;z.updateInitialState({...o,...t&&ie(t)?{country:t}:{}})},re=e.computed(()=>{var e,t;return!((null==(e=b.configuration)?void 0:e.email)&&(null==(t=b.configuration)?void 0:t.countryCode))}),ce=e.computed(()=>{var e,t,o;const n=null==(t=null==(e=R.value)?void 0:e.periods)?void 0:t[0],a=null==(o=ue.value)?void 0:o.trialStartDate;return(null==n?void 0:n.start_at)?new Date(n.start_at):a}),ue=e.computed(()=>function(e){var t;const o={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 o;const n=new Date,a=Fe({type:"TRIAL",pricingPlanScheduleInfos:e.pricing_plan_schedule_infos});if((null==a?void 0:a.start_at)&&(o.trialStartDate=n,a.end_at)){const e=new Date(a.end_at).getTime()-new Date(a.start_at).getTime();o.trialEndDate=new Date(n.getTime()+e)}const i=Fe({type:"DEFAULT",pricingPlanScheduleInfos:e.pricing_plan_schedule_infos});if((null==i?void 0:i.start_at)&&(o.trialEndDate?o.subscriptionStartDate=o.trialEndDate:o.subscriptionStartDate=n,i.end_at)){const e=new Date(i.end_at).getTime()-new Date(i.start_at).getTime();o.subscriptionEndDate=new Date(n.getTime()+e)}return o}(P.value)),se=e.computed(()=>{var e,t,o;const n=null==(t=null==(e=R.value)?void 0:e.periods)?void 0:t[0],a=null==(o=ue.value)?void 0:o.trialEndDate;return(null==n?void 0:n.end_at)?new Date(n.end_at):a}),de=e.computed(()=>{var e,t,o;const n=null==(t=null==(e=j.value)?void 0:e.periods)?void 0:t[0],a=null==(o=ue.value)?void 0:o.subscriptionStartDate;return(null==n?void 0:n.start_at)?new Date(n.start_at):a}),pe=e.computed(()=>!!(z.form.value.seatsValues&&z.form.value.seatsValues.length>0)||(!(!P.value||!function(e){return We(e).some(e=>"EXACTLY_ONE"===e.selection_constraint||"AT_LEAST_ONE"===e.selection_constraint)}(P.value))||!(!P.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??[]))??[]}),o=We(e);return t.some(e=>"ADDON"===e.product_type)||o.some(e=>"ADDON"===e.object_type)}(P.value)))),me=e.ref(null),{applyPromotionCode:ge,removePromotionCode:ve,isPromotionCodePending:fe,promotionCodeErrorMessage:ye}=function({checkoutForm:t,updateInvoicePreviewOnBillingInformationChange:o,logger:n,formatErrorMessage:a,onInvalidPromotionCode:i,onApplyError:l}){const r=e.ref(!1),c=e.ref(null),u=(e,t)=>{c.value=a?a({action:e,error:t}):"apply"===e?"Promotion code could not be applied. Please try again.":"Promotion code could not be removed. Please try again."},s=async({suppressError:e=!1,preserveErrorMessage:a=!1}={})=>{a||(c.value=null),delete t.form.value.promotionCode,r.value=!0;try{await o({})}catch(i){null==n||n.capture(i,{code:"PROMOTION_CODE_REMOVE_FAILED",message:"Failed to remove promotion code"}),e||u("remove",i)}finally{r.value=!1}};return{applyPromotionCode:async e=>{const a=null==e?void 0:e.trim();if(a){c.value=null,t.form.value.promotionCode=a,r.value=!0;try{await o({promotionCode:a})}catch(d){null==n||n.capture(d,{code:"PROMOTION_CODE_APPLY_FAILED",message:"Failed to apply promotion code"}),u("apply",d),null==l||l(),(e=>function(e){return"object"==typeof e&&null!==e&&"field"in e}(e)&&"promotion_codes"===e.field)(d)&&(null==i||i()),await s({suppressError:!0,preserveErrorMessage:!0})}finally{r.value=!1}}},removePromotionCode:s,isPromotionCodePending:r,promotionCodeErrorMessage:c}}({checkoutForm:z,updateInvoicePreviewOnBillingInformationChange:Y,logger:C,formatErrorMessage:({action:e})=>N("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:()=>{me.value=null},onApplyError:()=>{me.value=null}}),_e=()=>{F.value=!0,ye.value=null},be=e=>{P.value&&(P.value={...P.value,billing_period:e},q())};return e.onMounted(()=>{h("ready")}),(o,n)=>x.value?(e.openBlock(),e.createBlock(bt,{key:0})):(e.openBlock(),e.createBlock(e.unref(v.ContentWithAsideLayout),{key:1},{header:e.withCtx(()=>[e.createVNode(V._sfc_main,{class:"min-h-[52px] w-96"},{default:e.withCtx(()=>{var t,o,n;return[e.unref(j)&&e.unref(P)&&de.value?(e.openBlock(),e.createBlock(ft,{key:0,"trial-start-date":ce.value,"trial-period":e.unref($),"subscription-start-date":de.value,"subscription-name":(null==(t=e.unref(P))?void 0:t.name)??"",amount:null==(o=e.unref(j))?void 0:o.invoice_amount_including_tax,"billing-period":null==(n=e.unref(P))?void 0:n.billing_period,"country-code":e.unref(z).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 o,a,i;return[e.unref(P)&&e.unref(B)?(e.openBlock(),e.createBlock(Et,{key:0,subscription:e.unref(P),invoice:e.unref(j),"invoice-preview-by-billing-period":e.unref(O),"trial-invoice":e.unref(R),"enabled-pricing-ids":W.value,"trial-period":e.unref($),avatar:null==(o=k.value)?void 0:o.avatar,"is-paid":e.unref(F),"is-usage-based":Z.value,"is-preview-and-payment-methods-pending":e.unref(T)||e.unref(L),"country-code":e.unref(z).form.value.country,collapsible:"collapsed",variant:"products-inline",onBillingPeriodChange:be},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),pe.value&&e.unref(P)?(e.openBlock(),e.createBlock(fo,{key:1,"seats-values":oe.value,"onUpdate:seatsValues":n[0]||(n[0]=e=>oe.value=e),"enabled-pricing-ids":W.value,"onUpdate:enabledPricingIds":n[1]||(n[1]=e=>W.value=e),subscription:e.unref(P),"initial-seats-values":null==(a=e.unref(z).initialState)?void 0:a.value.seatsValues,"billing-period":e.unref(P).billing_period,currency:ee.value},null,8,["seats-values","enabled-pricing-ids","subscription","initial-seats-values","billing-period","currency"])):e.createCommentVNode("",!0),!e.unref(F)&&e.unref(z).form.value.country&&e.unref(G)&&ae.value?(e.openBlock(),e.createBlock(Gt,{key:2,amount:e.unref(G),"country-code":e.unref(z).form.value.country,locale:e.unref(I),"payment-methods-options-response":e.unref(S)??[],"billing-information":ae.value,"on-billing-information-change":e.unref(Y),onUpdateBillingInformation:le},null,8,["amount","country-code","locale","payment-methods-options-response","billing-information","on-billing-information-change"])):e.createCommentVNode("",!0),e.unref(F)?(e.openBlock(),e.createBlock(ht,{key:3,"redirect-url":e.unref(A)},null,8,["redirect-url"])):e.createCommentVNode("",!0),e.unref(F)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(pt,{key:4,modelValue:e.unref(z).form.value,"onUpdate:modelValue":n[2]||(n[2]=t=>e.unref(z).form.value=t),validation:e.unref(z).validation,"read-only-email":null==(i=b.configuration)?void 0:i.email,"show-customer-info-on-top":re.value||e.unref(F),"is-billing-information-mandatory":X.value,"get-is-field-required":e.unref(z).getIsFieldRequired,"read-only":e.unref(F)},null,8,["modelValue","validation","read-only-email","show-customer-info-on-top","is-billing-information-mandatory","get-is-field-required","read-only"])),e.unref(F)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(V._sfc_main,{key:5,variant:"section",class:"min-h-[130px]"},{default:e.withCtx(()=>[!e.unref(T)||e.unref(T)&&e.unref(S).length>0?(e.openBlock(),e.createElementBlock("div",Io,[e.createVNode(e.unref(t._sfc_main),{variant:"heading-3",tag:"h2",class:"mb-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(N)({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(z).form.value.country?0===e.unref(S).length?(e.openBlock(),e.createBlock(Dt,{key:1,icon:"credit_card_off"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(N)({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(N)({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(G)&&e.unref(z).form.value.country?(e.openBlock(),e.createBlock(f._sfc_main,{key:2,ref_key:"paymentIntegrationFormRef",ref:M,"country-code":e.unref(z).form.value.country,context:e.unref(U),amount:e.unref(G),variant:"AUTHORIZE","payment-method-options":e.unref(S)??[],"success-redirect-url":e.unref(A),"validate-on-submit":H,"force-store-payment-method":"",onPaymentSuccess:_e,onReady:n[3]||(n[3]=e=>h("ready"))},null,8,["country-code","context","amount","payment-method-options","success-redirect-url"])):e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Dt,{key:0,icon:"captive_portal"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(N)({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(N)({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(V._sfc_main,{variant:"section",class:"min-h-[220px]"},{default:e.withCtx(()=>{var t;return[e.unref(P)&&e.unref(j)?(e.openBlock(),e.createBlock(Et,{key:0,subscription:e.unref(P),invoice:e.unref(j),"invoice-preview-by-billing-period":e.unref(O),"trial-invoice":e.unref(R),"enabled-pricing-ids":W.value,"trial-period":e.unref($),"country-code":e.unref(z).form.value.country,avatar:null==(t=k.value)?void 0:t.avatar,"is-paid":e.unref(F),"is-usage-based":Z.value,"is-preview-and-payment-methods-pending":e.unref(T)||e.unref(L),onBillingPeriodChange:be},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(F)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(No,{key:0,"promotion-code":me.value,"onUpdate:appliedCode":n[4]||(n[4]=e=>me.value=e),onRemove:e.unref(ve),onApply:e.unref(ge)},null,8,["promotion-code","onRemove","onApply"])),e.unref(ye)?(e.openBlock(),e.createBlock(e.unref(l._sfc_main),{key:1,class:"mt-2",title:e.unref(ye)},null,8,["title"])):e.createCommentVNode("",!0),e.unref(F)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(V._sfc_main,{key:2,class:"min-h-[44px]"},{default:e.withCtx(()=>[e.unref(j)?(e.openBlock(),e.createBlock(e.unref(i._sfc_main),{key:0,type:"button",size:"lg",class:"full-width",disabled:e.unref(fe)||0===e.unref(S).length,onClick:K},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Q.value?e.unref(N)({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(N)({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),{tag:"div",variant:"body-sm",shade:"lighter",class:"flex grow justify-center"},{default:e.withCtx(()=>[e.createVNode(y._sfc_main$1,{icon:"lock",kpi:e.unref(N)({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}))}}),Eo=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(o,{emit:n}){var a,i;const l=o,r=n,c=f.useLogger(),u=(e=>{if(e)return Ie(e)?e:void c.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 c.error("INVALID_EMAIL",`invalid email provided: "${e}"`)})(null==(i=l.configuration)?void 0:i.email);return(n,a)=>{var i,l,c,d;return e.openBlock(),e.createBlock(t._sfc_main$1,{"custom-element-name":e.unref(Do),environment:o.environment,locale:o.locale,"portal-object":o.portalObject,"allowed-portal-types":["INIT_PRICING_PLAN_SUBSCRIPTION"],"primary-color":null==(l=null==(i=o.branding)?void 0:i.colors)?void 0:l.primary,"secondary-color":null==(d=null==(c=o.branding)?void 0:c.colors)?void 0:d.secondary,"experimental-features":o.experimentalFeatures,"log-level":o.logLevel,"on-log":o.onLog,onError:a[1]||(a[1]=e=>n.$emit("error",e))},{default:e.withCtx(()=>{var t,i,l;return[e.createVNode(wo,{configuration:{avatar:null==(i=null==(t=o.branding)?void 0:t.emblem)?void 0:i.public_url,email:e.unref(s),countryCode:e.unref(u),enabledPricingIds:null==(l=o.configuration)?void 0:l.enabledPricingIds},onReady:a[0]||(a[0]=e=>r("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,["configuration"])]}),_:3},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}}),Bo=t.defineCustomElement(Eo),Do=t.getComponentName("checkout");exports.COMPONENT_NAME=Do,exports.SolvimonCheckout=Bo,exports.defineSolvimonCheckout=()=>{customElements.get(Do)||customElements.define(Do,Bo)};
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../vendor-ui-Ce_Yp7xA.js"),i=require("../../component-C2Gc-wsE.js"),n=require("../../subscriptions-wdMADcQZ.js"),o=require("../../ApiStatus-oqvUEWJx.js"),a=require("../../useService-9fCKPTmu.js"),l=require("../../invoices-DbvwXAsm.js"),r=require("../../index-DRdBmZ2-.js"),c=require("../../useWatchDebounced-2ZLnfgvG.js"),u=require("../../paymentMethods-B4AYGf0K.js"),d=require("../../usePortal-DWJEVkTj.js"),s=require("../../customer-C_Hz_npf.js"),p=require("../../adyenLoader-CEH4A2b2.js"),m=require("../../PricingGroupContent.vue_vue_type_script_setup_true_lang-CKNMt-JH.js"),g=require("../../useViewport-CKRY1CKR.js"),v=require("../../Skeleton.vue_vue_type_script_setup_true_lang-D1Xzfc70.js"),f=require("../../payments-DeutKq9x.js"),y=require("../../ContentWithAsideLayout-oAYVrLvL.js");function _({pricingPlanScheduleInfos:e,type:t}){return e.find(e=>e.pricing_plan_schedule.type===t)}function h({enabledPricings:e,seatsValues:t,pricingPlanScheduleInfos:i,pricingCurrency:n,billingPeriod:o}){const a=_({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}}]}const b={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"},M=({country:e,pricingCurrencySettings:t,fallbackCurrency:i})=>{const n=(e=>{if(e)return b[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},N=["email","country"],I={US:["addressLine1","postalCode"],CA:["state"]};function C({initialState:i,onRequiredFieldChange:n}){const o=e.ref(k(i)),a=e.ref(k(i)),l=e.computed(()=>{return(e=o.value.country)&&I[e]?[...I[e],...N]:N;var e}),u=e=>l.value.includes(e),d=t.useValidation({email:{required:r.required,email:r.email},country:{required:r.required},state:{required:r.requiredIf(()=>u("state"))},addressLine1:{required:r.requiredIf(()=>u("addressLine1"))},postalCode:{required:r.requiredIf(()=>u("postalCode"))},companyLegalName:r.requiredIf("ORGANIZATION"===o.value.type),companyVatNumber:{taxId:t.taxId}},o),s=e=>{e||fetch("https://api.country.is/").then(e=>e.json()).then(({country:e})=>{o.value.country=e})};return e.onMounted(async()=>{await s(null==i?void 0:i.country)}),c.useWatchDebounced(()=>structuredClone(o.value),(e,i)=>{const o=t.objectDiff({from:i,to:e}),a=Object.keys(o).find(D);a&&(["type","companyVatNumber"].includes(a)?n(e):"seatsValues"!==a&&"enabledPricingIds"!==a?"email"!==a&&u(a)&&n(e):n(e))},{debounce:200}),{form:o,validation:d,getIsFieldRequired:u,updateInitialState:e=>{const t=k({...o.value,...e});o.value=t,a.value=structuredClone(t)},initialState:a}}const k=(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 D(e){return e in k()}function A(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 E(e){var t,i;return a.isEmpty(e.name)?null==(i=null==(t=e.products)?void 0:t[0])?void 0:i.name:e.name}function w(e,t=void 0){const i=t??[],n=A(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 P({initialCountry:i,initialEmail:r,subscriptionId:c,enabledPricingIds:d}){const s=e.ref(!1),p=e.ref(),{getSubscription:m}=n.createSubscriptionsService(),g=(()=>{const{getInvoicePreview:i}=l.createInvoicesService(),n=e.ref(),r=e.ref(),c=e.ref(),u=e.ref({}),d=e.ref(o.ApiStatus.Initial),s=e.ref({}),p=e.ref(),m=e=>`${e.type}:${e.value}`;return{loadInvoicePreview:async({subscription:e,subscriptionStartAt:l,checkoutForm:g,enabledPricingIds:v,promotionCode:f})=>{var y,b,N,I,C;const k={...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=o.ApiStatus.Loading;const D=_({pricingPlanScheduleInfos:e.pricing_plan_schedule_infos,type:"DEFAULT"}),A=null==(y=null==D?void 0:D.pricing_plan_version)?void 0:y.pricing_currency_settings,E=((null==(b=null==A?void 0:A.pricing_currencies)?void 0:b.length)??0)>1,w=(null==(I=null==(N=null==D?void 0:D.pricing_plan_version)?void 0:N.billing_period_settings)?void 0:I.billing_periods)??[],P=w.length>1,V=w.length>0?w.map(({period:e})=>e):e.billing_period?[e.billing_period]:[],x=M({country:g.country,pricingCurrencySettings:A,fallbackCurrency:e.billing_currency});if(!V.length)return void(d.value=o.ApiStatus.Done);const B=e.billing_period?m(e.billing_period):m(V[0]),T=V.map(async n=>{var o;const r=m(n),c=h({enabledPricings:null==v?void 0:v.map(e=>({pricing_id:e})),seatsValues:g.seatsValues,pricingPlanScheduleInfos:e.pricing_plan_schedule_infos,pricingCurrency:E?x:void 0,billingPeriod:P?n:void 0})??[];if(f){const t=null==(o=e.pricing_plan_schedule_infos.find(({pricing_plan_schedule:e})=>"DEFAULT"===e.type))?void 0:o.id;if(t){const e=c.find(({pricing_plan_schedule_id:e})=>e===t);e?e.promotion_codes=[f]:c.push({pricing_plan_schedule_id:t,promotion_codes:[f]})}}const u={pricingPlanSubscriptionId:e.id,startAt:l,customizations:c,customer:{type:g.type||"INDIVIDUAL",..."INDIVIDUAL"===g.type&&{individual:{residential_address:k}},..."ORGANIZATION"===g.type&&{organization:{legal_name:g.companyLegalName||"preview",registered_address:k,...g.companyVatNumber&&{tax_id:t.taxId.$validator(g.companyVatNumber,{},{})?g.companyVatNumber:void 0}}}}},d=s.value[r];return d&&a.isEqual(u,d)?{periodKey:r,response:void 0}:(s.value={...s.value,[r]:u},{periodKey:r,response:await i(u)})});try{const i={...u.value},o=await Promise.all(T),a=e.pricing_plan_schedule_infos.find(({pricing_plan_schedule:e})=>"TRIAL"===e.type),l=null==(C=e.pricing_plan_schedule_infos.find(({pricing_plan_schedule:e})=>"DEFAULT"===e.type))?void 0:C.id;o.forEach(({periodKey:e,response:o})=>{var c;if(!o)return;p.value=null==(c=o.invoice_infos.at(-1))?void 0:c.pricing_plan_schedule_id,a&&(r.value=o.first_invoice,a.start_at&&a.end_at&&(n.value=t.convertDateRangeToTimePeriod(new Date(a.start_at),new Date(a.end_at))));const u=o.invoice_infos.find(({pricing_plan_schedule_id:e})=>e===l),d=null==u?void 0:u.invoices[0];d&&(i[e]=d)}),u.value=i,c.value=i[B]}catch(S){throw d.value=o.ApiStatus.Failed,S}finally{d.value=o.ApiStatus.Done}},invoicePreview:c,invoicePreviewByBillingPeriod:u,trialInvoicePreview:r,trialPeriod:n,lastPreviewScheduleId:p,isPending:e.computed(()=>d.value===o.ApiStatus.Loading)}})(),v=e.computed(()=>p.value&&I.form.value.country&&D.value),{paymentMethodOptions:f,loadPaymentMethodOptions:y,isPending:b}=(()=>{const t=e.ref(),{getPaymentMethodOptions:i}=u.createPaymentMethodsService(),{data:n,execute:o,isPending:l}=a.useService({initialValue:[],service:i});return{loadPaymentMethodOptions:async({subscriptionId:e,country:i,amount:n})=>{const l={subscriptionId:e,country:i,amount:n};a.isEqual(l,t.value)||(t.value=l,await o(l))},paymentMethodOptions:n,isPending:l}})(),N=()=>{const e={subscription:p.value,checkoutForm:I.form.value,enabledPricingIds:d,promotionCode:I.form.value.promotionCode};return I.form.value.enabledPricingIds&&(e.enabledPricingIds=I.form.value.enabledPricingIds),g.loadInvoicePreview(e)},I=C({initialState:{country:i,email:r},onRequiredFieldChange:()=>{p.value&&N().catch(()=>{})}}),k=e.computed(()=>{var e,i,n,o,a,l,r,u,d;const s=I.form.value.firstName||I.form.value.infix||I.form.value.lastName?{...I.form.value.firstName?{first_name:I.form.value.firstName}:{},...I.form.value.infix?{infix:I.form.value.infix}:{},...I.form.value.lastName?{last_name:I.form.value.lastName}:{}}:{},m={...I.form.value.addressLine1&&{line1:I.form.value.addressLine1},...I.form.value.addressLine2&&{line2:I.form.value.addressLine2},...I.form.value.city&&{city:I.form.value.city},...I.form.value.postalCode&&{postal_code:I.form.value.postalCode},...I.form.value.state&&{state:I.form.value.state},country:I.form.value.country??""},g=_({pricingPlanScheduleInfos:(null==(e=p.value)?void 0:e.pricing_plan_schedule_infos)??[],type:"DEFAULT"}),v=null==(i=null==g?void 0:g.pricing_plan_version)?void 0:i.pricing_currency_settings,f=((null==(n=null==v?void 0:v.pricing_currencies)?void 0:n.length)??0)>1,y=((null==(a=null==(o=null==g?void 0:g.pricing_plan_version)?void 0:o.billing_period_settings)?void 0:a.billing_periods)??[]).length>1,b=h({enabledPricings:null==(l=I.form.value.enabledPricingIds)?void 0:l.map(e=>({pricing_id:e})),seatsValues:I.form.value.seatsValues,pricingPlanScheduleInfos:(null==(r=p.value)?void 0:r.pricing_plan_schedule_infos)??[],pricingCurrency:f?null==(u=p.value)?void 0:u.billing_currency:void 0,billingPeriod:y?null==(d=p.value)?void 0:d.billing_period:void 0}),M=I.form.value.promotionCode,N=M&&p.value?(()=>{var e,t,i;const n=b?[...b]:[],o=(null==(e=n[0])?void 0:e.pricing_plan_schedule_id)??(null==(i=_({pricingPlanScheduleInfos:(null==(t=p.value)?void 0:t.pricing_plan_schedule_infos)??[],type:"DEFAULT"}))?void 0:i.id);if(!o)return b;const a=n.find(({pricing_plan_schedule_id:e})=>e===o);if(a)a.promotion_codes=[M];else{const e=null==b?void 0:b[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:[M]})}return n})():b;return{type:"INIT_PRICING_PLAN_SUBSCRIPTION",init_pricing_plan_subscription:{template_pricing_plan_subscription_id:c,...N&&{pricing_plan_schedule_customizations:N},customer_details:{email:I.form.value.email??"",type:I.form.value.type,..."INDIVIDUAL"===I.form.value.type?{individual:{residential_address:m,...s?{name:s}:{}}}:{organization:{registered_address:m,legal_name:I.form.value.companyLegalName??"",...I.form.value.companyVatNumber&&t.taxId.$validator(I.form.value.companyVatNumber,{},{})?{tax_ids:[{id:I.form.value.companyVatNumber,type:"GENERIC_TAX_ID"}]}:{}}}}}}}),D=e.computed(()=>{var e,t;return(null==(e=g.trialInvoicePreview.value)?void 0:e.invoice_amount_including_tax)??(null==(t=g.invoicePreview.value)?void 0:t.invoice_amount_including_tax)});return e.watch([()=>I.form.value.country,D],([e,t])=>{p.value&&e&&t&&y({subscriptionId:p.value.id,country:e,amount:t})}),e.onMounted(async()=>{await(async()=>{var e,t,i,n,o,a;const l=await m({id:c,expanded:!0}),r=_({pricingPlanScheduleInfos:l.pricing_plan_schedule_infos,type:"DEFAULT"}),u=null==(n=null==(i=null==(t=null==(e=null==r?void 0:r.pricing_plan_version)?void 0:e.billing_period_settings)?void 0:t.billing_periods)?void 0:i[0])?void 0:n.period;p.value={...l,billing_period:u??l.billing_period},I.updateInitialState({...I.form.value,enabledPricingIds:w(l,d),...(null==(o=null==r?void 0:r.pricing_plan_schedule)?void 0:o.seats_values)?{seatsValues:null==(a=null==r?void 0:r.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 N()}catch{}}),e.watch(v,e=>{e&&y({subscriptionId:p.value.id,country:I.form.value.country,amount:D.value})},{once:!0}),{invoicePreview:g.invoicePreview,invoicePreviewByBillingPeriod:g.invoicePreviewByBillingPeriod,trialInvoicePreview:g.trialInvoicePreview,trialPeriod:g.trialPeriod,loadInvoicePreview:N,updateInvoicePreviewOnBillingInformationChange:async e=>{const t=e.promotionCode??I.form.value.promotionCode,i=e.enabledPricingIds??I.form.value.enabledPricingIds;return await g.loadInvoicePreview({subscription:p.value,checkoutForm:{...I.form.value,...e},enabledPricingIds:i,promotionCode:t}),{trialInvoicePreview:g.trialInvoicePreview.value,invoicePreview:g.invoicePreview.value}},lastPreviewScheduleId:g.lastPreviewScheduleId,paymentMethodOptions:f,isPaymentMethodsPending:b,isInvoicePreviewPending:g.isPending,subscription:p,checkoutForm:I,authorizationContext:k,isPaid:s,amount:D}}const V={class:"flex items-center gap-2"},x=e.defineComponent({__name:"TaxIDCheckNotice",props:{taxIdValidationResult:{type:Object}},setup(i){const n=i,{formatMessage:o}=t.useIntl(),a=e.computed(()=>"VALID"===n.taxIdValidationResult.valid),l=e.computed(()=>a.value?o({defaultMessage:"VAT number is valid.",id:"tax_check.valid_vat_number",description:"The message shown when the VAT number is valid"}):o({defaultMessage:"VAT number is invalid.",id:"tax_check.invalid_vat_number",description:"The message shown when the VAT number is invalid"}));return(i,n)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$32),{type:a.value?"success":"danger",icon:!1},{default:e.withCtx(()=>[e.createElementVNode("div",V,[e.createVNode(e.unref(t._sfc_main),{variant:"body-xs"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})])]),_:1},8,["type"]))}});const B={class:"grid grid-cols-1 gap-1"},T={class:"grid grid-cols-1 gap-2"},S={key:0},L={class:"mt-2 flex flex-col gap-3"},j={class:"grid grid-cols-3 gap-2"},z={class:"flex grow flex-col"},O={key:0},U={class:"mt-4 grid grid-cols-1 gap-3"},R=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"),l=e.computed({get:()=>"ORGANIZATION"===a.value.type,set:e=>{a.value.type=e?"ORGANIZATION":"INDIVIDUAL"}}),r=e.computed(()=>"ORGANIZATION"===a.value.type),c=e.computed({get:()=>a.value.country,set:e=>{a.value.country=e&&t.isValidCountryCode(e)?e:void 0}}),u=e.computed(()=>"US"!==a.value.country),{isTaxIDCheckEnabled:d,isTaxIDCheckPending:p,taxIdValidationData:m,runTaxIDCheck:g}=function(i){const{checkTaxID:n}=s.createCustomerService(),o=e.ref(void 0),a=e.computed(()=>{var e;return(null==(e=i.value.companyVatNumber)?void 0:e.trim())??""}),l=e.computed(()=>i.value.companyLegalName??""),r=e.computed(()=>i.value.country),c=e.ref(!1),u=e.computed(()=>t.isEUCountry(r.value??"")),d=e.computed(()=>!!(a.value&&l.value&&r.value)),p=e.computed(()=>u.value&&a.value);return{runTaxIDCheck:async function(){var e;if(d.value&&u.value&&r.value){c.value=!0;try{const t=await n({type:"ORGANIZATION",organization:{legal_name:l.value,tax_ids:[{id:a.value,type:"GENERIC_TAX_ID"}],registered_address:{country:r.value}}});(null==(e=null==t?void 0:t.data)?void 0:e.length)?o.value=t.data[0]:o.value=void 0}finally{c.value=!1}}},taxIdValidationData:o,isTaxIDCheckPending:c,isTaxIDCheckEnabled:d,showViesCheckNotice:p,isSelectedCountryEU:u}}(a),{$t:v}=t.useIntl(),f=e=>n.getIsFieldRequired(e)?"":" "+v({defaultMessage:"(optional)",id:"checkout.optional_suffix.label",description:"The suffix for optional fields in the checkout form"}),y=e.computed(()=>a.value.country?t.getCountryNameByCode(a.value.country):void 0);return(n,s)=>(e.openBlock(),e.createElementBlock("form",{id:"checkout-form",onSubmit:s[12]||(s[12]=e.withModifiers(e=>n.$emit("submit",a.value),["prevent"]))},[e.createElementVNode("div",B,[e.createVNode(e.unref(t._sfc_main$1),{title:e.unref(v)({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",T,[i.readOnly?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(t._sfc_main),{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),{variant:"body-sm",tag:"span",shade:"lighter","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y.value),1)]),_:1})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(t._sfc_main$21),{modelValue:a.value.email,"onUpdate:modelValue":s[0]||(s[0]=e=>a.value.email=e),required:"",type:"email",name:"email",disabled:!!i.readOnlyEmail,label:e.unref(v)({defaultMessage:"Email address",id:"checkout.email_address.label",description:"The email address of the customer in the checkout form"}),placeholder:e.unref(v)({defaultMessage:"Email address...",id:"checkout.email_address.placeholder",description:"The email address of the customer in the checkout form"})+f("email"),error:i.validation.value.email.$errors},null,8,["modelValue","disabled","label","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$22),{"single-model-value":c.value,"onUpdate:singleModelValue":s[3]||(s[3]=e=>c.value=e),required:"",name:"country",label:e.unref(v)({defaultMessage:"Billing country",id:"checkout.country.label",description:"The country of the customer in the checkout form"})+f("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$3),{key:0,size:"xs",variant:"ghost","icon-prefix":"add",class:"py-0.5",onClick:s[1]||(s[1]=e=>o.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(v)({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$3),{key:1,size:"sm",variant:"ghost","icon-prefix":"close",class:"py-0.5",onClick:s[2]||(s[2]=e=>o.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(v)({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$33),null,{default:e.withCtx(()=>[o.value||i.isBillingInformationMandatory?(e.openBlock(),e.createElementBlock("div",S,[e.createElementVNode("div",L,[e.createVNode(e.unref(t._sfc_main$21),{modelValue:a.value.addressLine1,"onUpdate:modelValue":s[4]||(s[4]=e=>a.value.addressLine1=e),name:"address_line_1",label:e.unref(v)({defaultMessage:"Billing address",id:"checkout.address.title",description:"Address line 1 of the customer address in the checkout form"}),placeholder:e.unref(v)({defaultMessage:"Address line 1...",id:"checkout.address.line1.placeholder",description:"Address line 1 of the customer address in the checkout form"})+f("addressLine1"),required:"",error:i.validation.value.addressLine1.$errors},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$21),{modelValue:a.value.addressLine2,"onUpdate:modelValue":s[5]||(s[5]=e=>a.value.addressLine2=e),name:"address_line_2",placeholder:e.unref(v)({defaultMessage:"Address line 2...",id:"checkout.address.line2.placeholder",description:"Address line 2 of the customer address in the checkout form"})+f("addressLine2")},null,8,["modelValue","placeholder"]),e.createElementVNode("div",j,[e.createVNode(e.unref(t._sfc_main$21),{modelValue:a.value.postalCode,"onUpdate:modelValue":s[6]||(s[6]=e=>a.value.postalCode=e),name:"postal_code",placeholder:e.unref(v)({defaultMessage:"Postal code...",id:"checkout.address.portal_code.placeholder",description:"Postal code of the customer address in the checkout form"})+f("postalCode"),error:i.validation.value.addressLine1.$errors},null,8,["modelValue","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$21),{modelValue:a.value.city,"onUpdate:modelValue":s[7]||(s[7]=e=>a.value.city=e),name:"city",placeholder:e.unref(v)({defaultMessage:"City...",id:"checkout.address.city.placeholder",description:"City of the customer address in the checkout form"})+f("city")},null,8,["modelValue","placeholder"]),e.createVNode(e.unref(t._sfc_main$21),{modelValue:a.value.state,"onUpdate:modelValue":s[8]||(s[8]=e=>a.value.state=e),name:"state",placeholder:e.unref(v)({defaultMessage:"State...",id:"checkout.address.state.placeholder",description:"State of the customer address in the checkout form"})+f("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$1),{key:0},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$23),{modelValue:l.value,"onUpdate:modelValue":s[9]||(s[9]=e=>l.value=e),"no-spacing":"","label-position":"before",class:"!flex"},{"inline-label":e.withCtx(()=>[e.createElementVNode("div",z,[e.createVNode(e.unref(t._sfc_main),{tag:"span"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(v)({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),{tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(v)({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$33),null,{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",O,[e.createElementVNode("div",U,[e.createVNode(e.unref(t._sfc_main$21),{modelValue:a.value.companyLegalName,"onUpdate:modelValue":s[10]||(s[10]=e=>a.value.companyLegalName=e),required:"",name:"legal_name",label:e.unref(v)({defaultMessage:"Legal entity name",id:"checkout.legal_name.label",description:"The legal name of the organization customer in the checkout form"}),placeholder:e.unref(v)({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"]),u.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$21),{key:0,modelValue:a.value.companyVatNumber,"onUpdate:modelValue":s[11]||(s[11]=e=>a.value.companyVatNumber=e),name:"vat_number","input-class":"focus:outline-none focus:ring-0",label:e.unref(v)({defaultMessage:"VAT number",id:"checkout.vat_number.label",description:"The label for the vat number in the checkout form"}),placeholder:e.unref(v)({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,"suffix-class":"px-2 border-l-0"},e.createSlots({_:2},[e.unref(t.isEUCountry)(a.value.country??"")?{name:"suffix",fn:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$3),{type:"button",size:"sm",color:"green",disabled:!e.unref(d)||e.unref(p)||i.validation.value.companyVatNumber.$invalid,onClick:e.unref(g)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(v)({defaultMessage:"Check",id:"checkout.vat_number.check_button.label",description:"The label for the check button in the checkout form"})),1)]),_:1},8,["disabled","onClick"])]),key:"0"}:void 0]),1032,["modelValue","label","placeholder","error"])):e.createCommentVNode("",!0),e.unref(m)?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass({"opacity-75":e.unref(p)})},[e.createVNode(x,{"tax-id-validation-result":e.unref(m)},null,8,["tax-id-validation-result"])],2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),_:1})]),_:1}))])],32))}}),F={key:0,class:"flex items-center"},$=["innerHTML"],G=["innerHTML"],Y=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),{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$34),{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),{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,G)):(e.openBlock(),e.createElementBlock("span",F,[e.createVNode(e.unref(t._sfc_main$35),{"is-dark-mode":""},{tooltip:e.withCtx(()=>[e.createVNode(e.unref(t.TooltipContent),null,{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$37),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$36),{"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,$)]))]),_:1})],64))}}),q={class:"flex w-full min-h-96 justify-center items-center"},Q={class:"max-w-sm"},K=e.defineComponent({__name:"CheckoutNotAvailable",setup(i){const{$t:n}=t.useIntl(),o=()=>{window.location.reload()};return(i,a)=>(e.openBlock(),e.createElementBlock("div",q,[e.createElementVNode("div",Q,[e.createVNode(e.unref(t._sfc_main),{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),{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})])]))}}),H=e.defineComponent({__name:"SubscriptionPaymentCompletedCard",emits:["continue-to-merchant"],setup(i){const{$t:n}=t.useIntl();return(i,o)=>(e.openBlock(),e.createBlock(p._sfc_main,{status:"success",title:e.unref(n)({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),{variant:"body-xs",shade:"lighter",tag:"span"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({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}),e.createVNode(e.unref(t._sfc_main$3),{color:"gray",variant:"outline",size:"xs",class:"align-center",onClick:o[0]||(o[0]=e=>i.$emit("continue-to-merchant"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Continue to merchant",id:"subscription_payment_completed_card.continue",description:"The text for the continue button"})),1)]),_:1})]),_:1},8,["title"]))}}),Z={class:"flex flex-row gap-3 px-3 py-2"},X={class:"grow"},W=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}),l=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"})}),r=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",Z,[i.avatar?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$38),{key:0,"image-src":i.avatar,size:"lg",class:"my-1"},null,8,["image-src"])):e.createCommentVNode("",!0),e.createElementVNode("div",X,[e.createVNode(e.unref(t._sfc_main),{variant:"body",weight:"semibold","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1}),c.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:0,variant:"body-xs",shade:"lighter","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1})):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{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(r.value),1)]),_:1})):e.createCommentVNode("",!0)])]))}}),J={class:"grid grid-cols-1 gap-1"},ee={class:"px-3 py-2"},te={class:"flex flex-col gap-3"},ie={class:"px-3 py-2"},ne=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:l}=t.useIntl(),{map:r,formatTimePeriod:c}=t.useTimePeriod(),{isMobileViewport:u}=g.useViewport(),d=e.computed(()=>u.value?"sm":"xs"),s=e=>`${e.type}:${e.value}`,p=["DAY","WEEK","MONTH","YEAR"],v=e=>p.includes(e),f=e=>{if(!e)return;const[t,i]=e.split(":"),n=Number(i);return n&&v(t)?{type:t,value:n}:void 0},y=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&&v(t)&&a("billing-period-change",{type:t,value:n})}}),h=e=>{var i,n,a,r;const u=null==(r=null==(a=null==(n=null==(i=o.invoicePreviewByBillingPeriod)?void 0:i[s(e)])?void 0:n.periods)?void 0:a[0])?void 0:r.amount_including_tax;if(!u)return;const d="MONTH"===e.type&&3===e.value?l({defaultMessage:"/quarter",id:"checkout.order_summary_block.billing_period.per_quarter",description:"Period label for quarterly billing"}):l({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 l({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})},b=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},M=e=>Number(e.quantity),N=(e,t)=>{if(!t)return;const i={DAY:365,WEEK:52,MONTH:12,YEAR:1}[e.type]/Math.max(e.value??1,1),n=M(t)*i;return Number.isFinite(n)?{quantity:n.toFixed(2),currency:t.currency}:void 0},I=(e,t)=>{if(!e||!t)return;const i=M(e)-M(t);return!Number.isFinite(i)||i<=0?void 0:{quantity:i.toFixed(2),currency:e.currency}},C=e=>{if(!e)return;return`${l({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)})}${l({defaultMessage:"/year",id:"checkout.order_summary_block.billing_period.save_badge.suffix",description:"Second line for the savings badge label"})}`},k=e.computed(()=>{var e,t,i;const n=_({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)??[],l=new Map,r=e=>{e&&l.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=>r(e.billing_period)),null==(i=e.billing_period_configs)||i.forEach(e=>r(e.billing_period)),null==(n=e.pricing_currency_configs)||n.forEach(e=>{var t,i;null==(t=e.configs)||t.forEach(e=>r(e.billing_period)),null==(i=e.billing_period_configs)||i.forEach(e=>r(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))})}),!l.size)return[];const u=a.map(e=>l.get(s(e.period))).filter(e=>!!e),d=new Set(u.map(s)),p=[...l.values()].filter(e=>!d.has(s(e)));return[...u,...p]}),D=e.computed(()=>{const e=k.value[k.value.length-1],i=e?N(e,b(e)):void 0;return k.value.map(n=>{const o="MONTH"===n.type&&3===n.value?l({defaultMessage:"Billed quarterly",id:"checkout.order_summary_block.billing_period.quarterly",description:"Billing period option label for quarterly billing"}):l({defaultMessage:"Billed {period}",id:"checkout.order_summary_block.billing_period.label",description:"Billing period option label for the selected period"},{period:r.value[n.type].full}),a=b(n),c=N(n,a),u=e&&n.type===e.type&&n.value===e.value?void 0:I(c,i),s=C(u);return{label:o,subLabel:h(n),labelSuffixComponent:s?{component:t._sfc_main$4,props:{color:"primary",content:s,size:d.value,class:"whitespace-nowrap text-left leading-tight"}}:void 0,hidden:y.value===`${n.type}:${n.value}`,value:`${n.type}:${n.value}`}})}),A=e.computed(()=>{const e=D.value,t=e[0],i=e[e.length-1];return{smallestPeriod:null==t?void 0:t.value,biggestPeriod:null==i?void 0:i.value}}),E=e.computed(()=>D.value.find(e=>e.value===A.value.biggestPeriod)),w=e.computed(()=>D.value.find(e=>e.value===y.value)),P=e.computed(()=>{var e,t,i,n,a,l,r,c;const u=D.value,d=u[u.length-1],s=y.value;if(!d||!s)return"";if(s===d.value)return"";const p=f(d.value);if(!p)return"";const m=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,g=f(s),v=null==(c=null==(r=null==(l=null==(a=o.invoicePreviewByBillingPeriod)?void 0:a[s])?void 0:l.periods)?void 0:r[0])?void 0:c.amount_including_tax;if(!g||!v)return"";const _=N(g,v),h=N(p,m);return C(I(_,h))??""}),V=e=>{const{smallestPeriod:t,biggestPeriod:i}=A.value;y.value=e?i:t};return(n,o)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{"no-border":"","no-spacing":"","content-background":"none",title:i.noTitle?void 0:e.unref(l)({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",J,[e.createVNode(e.unref(t._sfc_main$1),{"no-spacing":""},{default:e.withCtx(()=>[i.subscription?(e.openBlock(),e.createBlock(W,{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===D.value.length?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{key:0,"no-spacing":"","content-classes":y.value===A.value.biggestPeriod?"border-primary-500":void 0},{default:e.withCtx(()=>{var i;return[e.createElementVNode("div",ee,[e.createElementVNode("div",te,[E.value?(e.openBlock(),e.createBlock(m._sfc_main,{key:0,name:E.value.label,description:(null==(i=w.value)?void 0:i.subLabel)??""},e.createSlots({default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$23),{"model-value":y.value===A.value.biggestPeriod,"onUpdate:modelValue":V},null,8,["model-value"])]),_:2},[P.value?{name:"badge",fn:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$4),{color:"primary",content:P.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"])):D.value.length>2?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$39),{key:1,"single-model-value":y.value,"onUpdate:singleModelValue":o[0]||(o[0]=e=>y.value=e),options:D.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$1),{key:2,"no-spacing":""},{default:e.withCtx(()=>[e.createElementVNode("div",ie,[e.createVNode(e.unref(t._sfc_main),{"no-spacing":"",variant:"body-sm",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({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$40),{key:3,invoice:i.invoice,"wrapper-component":e.unref(t._sfc_main$1)},null,8,["invoice","wrapper-component"])):e.createCommentVNode("",!0),e.createVNode(e.unref(t._sfc_main$1),null,{default:e.withCtx(()=>[i.invoice?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$41),{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),{key:1,variant:"body-sm",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({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"]))}}),oe={class:"py-4 flex flex-col items-center justify-center"},ae=e.defineComponent({__name:"EmptyStatePlaceholder",props:{icon:{type:null}},setup:i=>(n,o)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),null,{default:e.withCtx(()=>[e.createElementVNode("div",oe,[e.createVNode(e.unref(t._sfc_main$11),{icon:i.icon,size:"lg",class:"text-gray-500"},null,8,["icon"]),e.createVNode(e.unref(t._sfc_main),{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),{center:"",tag:"span",variant:"body-xs",shade:"lightest",class:"mt-1"},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"message")]),_:3})])]),_:3}))}),le={key:0,id:"svg-logo",viewBox:"0 0 35 15",class:"h-[44px]"},re={key:1,src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAxcHgiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAxMDEgMzIiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaW5ZTWluIG1lZXQiIHhtbG5zPSJodHRwOiYjeDJGOyYjeDJGO3d3dy53My5vcmcmI3gyRjsyMDAwJiN4MkY7c3ZnIj48cGF0aCBmaWxsPSIjMDAzMDg3IiBkPSJNIDEyLjIzNyAyLjggTCA0LjQzNyAyLjggQyAzLjkzNyAyLjggMy40MzcgMy4yIDMuMzM3IDMuNyBMIDAuMjM3IDIzLjcgQyAwLjEzNyAyNC4xIDAuNDM3IDI0LjQgMC44MzcgMjQuNCBMIDQuNTM3IDI0LjQgQyA1LjAzNyAyNC40IDUuNTM3IDI0IDUuNjM3IDIzLjUgTCA2LjQzNyAxOC4xIEMgNi41MzcgMTcuNiA2LjkzNyAxNy4yIDcuNTM3IDE3LjIgTCAxMC4wMzcgMTcuMiBDIDE1LjEzNyAxNy4yIDE4LjEzNyAxNC43IDE4LjkzNyA5LjggQyAxOS4yMzcgNy43IDE4LjkzNyA2IDE3LjkzNyA0LjggQyAxNi44MzcgMy41IDE0LjgzNyAyLjggMTIuMjM3IDIuOCBaIE0gMTMuMTM3IDEwLjEgQyAxMi43MzcgMTIuOSAxMC41MzcgMTIuOSA4LjUzNyAxMi45IEwgNy4zMzcgMTIuOSBMIDguMTM3IDcuNyBDIDguMTM3IDcuNCA4LjQzNyA3LjIgOC43MzcgNy4yIEwgOS4yMzcgNy4yIEMgMTAuNjM3IDcuMiAxMS45MzcgNy4yIDEyLjYzNyA4IEMgMTMuMTM3IDguNCAxMy4zMzcgOS4xIDEzLjEzNyAxMC4xIFoiPjwvcGF0aD48cGF0aCBmaWxsPSIjMDAzMDg3IiBkPSJNIDM1LjQzNyAxMCBMIDMxLjczNyAxMCBDIDMxLjQzNyAxMCAzMS4xMzcgMTAuMiAzMS4xMzcgMTAuNSBMIDMwLjkzNyAxMS41IEwgMzAuNjM3IDExLjEgQyAyOS44MzcgOS45IDI4LjAzNyA5LjUgMjYuMjM3IDkuNSBDIDIyLjEzNyA5LjUgMTguNjM3IDEyLjYgMTcuOTM3IDE3IEMgMTcuNTM3IDE5LjIgMTguMDM3IDIxLjMgMTkuMzM3IDIyLjcgQyAyMC40MzcgMjQgMjIuMTM3IDI0LjYgMjQuMDM3IDI0LjYgQyAyNy4zMzcgMjQuNiAyOS4yMzcgMjIuNSAyOS4yMzcgMjIuNSBMIDI5LjAzNyAyMy41IEMgMjguOTM3IDIzLjkgMjkuMjM3IDI0LjMgMjkuNjM3IDI0LjMgTCAzMy4wMzcgMjQuMyBDIDMzLjUzNyAyNC4zIDM0LjAzNyAyMy45IDM0LjEzNyAyMy40IEwgMzYuMTM3IDEwLjYgQyAzNi4yMzcgMTAuNCAzNS44MzcgMTAgMzUuNDM3IDEwIFogTSAzMC4zMzcgMTcuMiBDIDI5LjkzNyAxOS4zIDI4LjMzNyAyMC44IDI2LjEzNyAyMC44IEMgMjUuMDM3IDIwLjggMjQuMjM3IDIwLjUgMjMuNjM3IDE5LjggQyAyMy4wMzcgMTkuMSAyMi44MzcgMTguMiAyMy4wMzcgMTcuMiBDIDIzLjMzNyAxNS4xIDI1LjEzNyAxMy42IDI3LjIzNyAxMy42IEMgMjguMzM3IDEzLjYgMjkuMTM3IDE0IDI5LjczNyAxNC42IEMgMzAuMjM3IDE1LjMgMzAuNDM3IDE2LjIgMzAuMzM3IDE3LjIgWiI+PC9wYXRoPjxwYXRoIGZpbGw9IiMwMDMwODciIGQ9Ik0gNTUuMzM3IDEwIEwgNTEuNjM3IDEwIEMgNTEuMjM3IDEwIDUwLjkzNyAxMC4yIDUwLjczNyAxMC41IEwgNDUuNTM3IDE4LjEgTCA0My4zMzcgMTAuOCBDIDQzLjIzNyAxMC4zIDQyLjczNyAxMCA0Mi4zMzcgMTAgTCAzOC42MzcgMTAgQyAzOC4yMzcgMTAgMzcuODM3IDEwLjQgMzguMDM3IDEwLjkgTCA0Mi4xMzcgMjMgTCAzOC4yMzcgMjguNCBDIDM3LjkzNyAyOC44IDM4LjIzNyAyOS40IDM4LjczNyAyOS40IEwgNDIuNDM3IDI5LjQgQyA0Mi44MzcgMjkuNCA0My4xMzcgMjkuMiA0My4zMzcgMjguOSBMIDU1LjgzNyAxMC45IEMgNTYuMTM3IDEwLjYgNTUuODM3IDEwIDU1LjMzNyAxMCBaIj48L3BhdGg+PHBhdGggZmlsbD0iIzAwOWNkZSIgZD0iTSA2Ny43MzcgMi44IEwgNTkuOTM3IDIuOCBDIDU5LjQzNyAyLjggNTguOTM3IDMuMiA1OC44MzcgMy43IEwgNTUuNzM3IDIzLjYgQyA1NS42MzcgMjQgNTUuOTM3IDI0LjMgNTYuMzM3IDI0LjMgTCA2MC4zMzcgMjQuMyBDIDYwLjczNyAyNC4zIDYxLjAzNyAyNCA2MS4wMzcgMjMuNyBMIDYxLjkzNyAxOCBDIDYyLjAzNyAxNy41IDYyLjQzNyAxNy4xIDYzLjAzNyAxNy4xIEwgNjUuNTM3IDE3LjEgQyA3MC42MzcgMTcuMSA3My42MzcgMTQuNiA3NC40MzcgOS43IEMgNzQuNzM3IDcuNiA3NC40MzcgNS45IDczLjQzNyA0LjcgQyA3Mi4yMzcgMy41IDcwLjMzNyAyLjggNjcuNzM3IDIuOCBaIE0gNjguNjM3IDEwLjEgQyA2OC4yMzcgMTIuOSA2Ni4wMzcgMTIuOSA2NC4wMzcgMTIuOSBMIDYyLjgzNyAxMi45IEwgNjMuNjM3IDcuNyBDIDYzLjYzNyA3LjQgNjMuOTM3IDcuMiA2NC4yMzcgNy4yIEwgNjQuNzM3IDcuMiBDIDY2LjEzNyA3LjIgNjcuNDM3IDcuMiA2OC4xMzcgOCBDIDY4LjYzNyA4LjQgNjguNzM3IDkuMSA2OC42MzcgMTAuMSBaIj48L3BhdGg+PHBhdGggZmlsbD0iIzAwOWNkZSIgZD0iTSA5MC45MzcgMTAgTCA4Ny4yMzcgMTAgQyA4Ni45MzcgMTAgODYuNjM3IDEwLjIgODYuNjM3IDEwLjUgTCA4Ni40MzcgMTEuNSBMIDg2LjEzNyAxMS4xIEMgODUuMzM3IDkuOSA4My41MzcgOS41IDgxLjczNyA5LjUgQyA3Ny42MzcgOS41IDc0LjEzNyAxMi42IDczLjQzNyAxNyBDIDczLjAzNyAxOS4yIDczLjUzNyAyMS4zIDc0LjgzNyAyMi43IEMgNzUuOTM3IDI0IDc3LjYzNyAyNC42IDc5LjUzNyAyNC42IEMgODIuODM3IDI0LjYgODQuNzM3IDIyLjUgODQuNzM3IDIyLjUgTCA4NC41MzcgMjMuNSBDIDg0LjQzNyAyMy45IDg0LjczNyAyNC4zIDg1LjEzNyAyNC4zIEwgODguNTM3IDI0LjMgQyA4OS4wMzcgMjQuMyA4OS41MzcgMjMuOSA4OS42MzcgMjMuNCBMIDkxLjYzNyAxMC42IEMgOTEuNjM3IDEwLjQgOTEuMzM3IDEwIDkwLjkzNyAxMCBaIE0gODUuNzM3IDE3LjIgQyA4NS4zMzcgMTkuMyA4My43MzcgMjAuOCA4MS41MzcgMjAuOCBDIDgwLjQzNyAyMC44IDc5LjYzNyAyMC41IDc5LjAzNyAxOS44IEMgNzguNDM3IDE5LjEgNzguMjM3IDE4LjIgNzguNDM3IDE3LjIgQyA3OC43MzcgMTUuMSA4MC41MzcgMTMuNiA4Mi42MzcgMTMuNiBDIDgzLjczNyAxMy42IDg0LjUzNyAxNCA4NS4xMzcgMTQuNiBDIDg1LjczNyAxNS4zIDg1LjkzNyAxNi4yIDg1LjczNyAxNy4yIFoiPjwvcGF0aD48cGF0aCBmaWxsPSIjMDA5Y2RlIiBkPSJNIDk1LjMzNyAzLjMgTCA5Mi4xMzcgMjMuNiBDIDkyLjAzNyAyNCA5Mi4zMzcgMjQuMyA5Mi43MzcgMjQuMyBMIDk1LjkzNyAyNC4zIEMgOTYuNDM3IDI0LjMgOTYuOTM3IDIzLjkgOTcuMDM3IDIzLjQgTCAxMDAuMjM3IDMuNSBDIDEwMC4zMzcgMy4xIDEwMC4wMzcgMi44IDk5LjYzNyAyLjggTCA5Ni4wMzcgMi44IEMgOTUuNjM3IDIuOCA5NS40MzcgMyA5NS4zMzcgMy4zIFoiPjwvcGF0aD48L3N2Zz4",role:"presentation",class:"h-[22px]"},ce=e.defineComponent({__name:"ExpressPaymentMethodButton",props:{type:{type:String}},emits:["click"],setup(i,{emit:n}){const o=i,a=n,l=e.computed(()=>{switch(o.type){case"applepay":return"Apple Pay";case"googlepay":return"Google Pay";case"paypal":return"PayPal";default:return}}),r=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$3),{size:"lg","aria-label":l.value,class:e.normalizeClass([r.value,"!block w-full h-11 bg-center bg-no-repeat"]),onClick:c},{default:e.withCtx(()=>["applepay"===o.type?(e.openBlock(),e.createElementBlock("svg",le,[...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"},[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",re)):e.createCommentVNode("",!0)]),_:1},8,["aria-label","class"]))}}),ue={class:"absolute h-[1px] w-[1px] overflow-hidden opacity-0"},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(n,{emit:o}){const a=n,l=o,r=e.ref(),c=i.useLogger(),{authorizePayment:u}=f.createPaymentsService(),d=a.paymentMethodOptionsResponse.payment_acceptor.id,s=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},m=e=>({postal_code:e.postalCode,city:e.locality,country:e.countryCode}),g=e=>({postal_code:e.postalCode,city:e.city,country:e.country}),v=e=>e&&y(e)?e:void 0,y=e=>t.isValidCountryCode(e),_=()=>{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 p.loadAdyen(),i=new t(await e(p.getAdyenExpressCheckoutConfiguration({amount:a.amount,locale:a.locale,countryCode:a.countryCode,paymentMethodOptionResponse:a.paymentMethodOptionsResponse})),{isExpress:!0,recurringPaymentRequest:{paymentDescription:a.billingInformation.description,billingAgreement:a.billingInformation.agreement,managementURL:"https://www.google.com",...a.billingInformation.trial&&{trialBilling:{label:a.billingInformation.trial.label,amount:a.billingInformation.trial.amount.quantity.toString(),type:"final",paymentTiming:"recurring",recurringPaymentStartDate:a.billingInformation.trial.startDate,recurringPaymentEndDate:a.billingInformation.trial.endDate}},...a.billingInformation.regular&&{regularBilling:{label:a.billingInformation.regular.label,amount:a.billingInformation.regular.amount.quantity.toString(),type:"final",paymentTiming:"recurring",recurringPaymentStartDate:a.billingInformation.regular.startDate,...s(a.billingInformation.regular.interval??{type:"MONTH",value:1})}}},requiredBillingContactFields:["postalAddress"],requiredShippingContactFields:["email"],onPaymentMethodSelected:async(e,t,i)=>{var n,o,r,c,u,d,s;const{invoicePreview:p,trialInvoicePreview:m}=await a.onBillingInformationChange({...(null==(n=i.paymentMethod.billingContact)?void 0:n.postalCode)&&{postal_code:i.paymentMethod.billingContact.postalCode},...(null==(o=i.paymentMethod.billingContact)?void 0:o.locality)&&{city:i.paymentMethod.billingContact.locality},...v(null==(r=i.paymentMethod.billingContact)?void 0:r.countryCode)&&{country:v(null==(c=i.paymentMethod.billingContact)?void 0:c.countryCode)}}),g=m?m.invoice_amount_including_tax.quantity.toString():p.invoice_amount_including_tax.quantity.toString();l("update-billing-information",{postal_code:null==(u=i.paymentMethod.billingContact)?void 0:u.postalCode,city:null==(d=i.paymentMethod.billingContact)?void 0:d.locality,country:null==(s=i.paymentMethod.billingContact)?void 0:s.countryCode}),e({newTotal:{label:a.billingInformation.regular.label,amount:g,type:"final"}})},onError:e=>{c.error("APPLE_PAY_ERROR","Apple Pay error",{error:e})},onAuthorized:async(e,t)=>{try{c.info("APPLE_PAY_AUTHORIZED","Apple Pay authorized",{data:e});const i=e.authorizedEvent;c.info("APPLE_PAY_EVENT_DATA","Apple Pay event data structure",{eventData:i,hasPaymentMethod:!!i.payment.token.paymentMethod,hasBrowserInfo:!!i.payment.token.paymentData,billingAddress:e.billingAddress});const n=i.payment.billingContact,o=e.billingAddress;n?l("update-billing-information",m(n)):o&&l("update-billing-information",g(o));const r={payment_method:p.transformObjectToAdyenObject(i.payment.token.paymentMethod),browser_info:p.transformObjectToAdyenObject(i.payment.token.paymentData)};c.info("APPLE_PAY_ADYEN_PAYLOAD","Adyen payload prepared",{adyen:r});const s=p.createReturnUrl({paymentAcceptorId:d,redirectUrl:window.location.href});c.info("APPLE_PAY_CALLING_API","Calling authorizePayment API",{paymentAcceptorId:d,amount:a.amount});const v=await u({payment_acceptor_id:d,payment_gateway_variant:"ADYEN",adyen:{...r,store_payment_method:!0},amount:a.amount,return_url:s});if(c.info("APPLE_PAY_API_RESPONSE","Payment API response received",{status:v.status,paymentResult:v}),"FAILURE"===v.status)return c.error("APPLE_PAY_AUTHORIZATION_FAILED","Payment authorization failed",{error:v}),void t.reject();if("ACTION_REQUIRED"===v.status)return c.warn("APPLE_PAY_ACTION_REQUIRED","Payment requires additional action",{action:v.action}),void t.reject();c.info("APPLE_PAY_SUCCESS","Apple Pay payment successful, resolving"),t.resolve()}catch(i){c.error("APPLE_PAY_AUTHORIZATION_FAILED","Apple Pay authorization failed",{error:i}),t.reject()}}});if(r.value)try{await i.isAvailable(),i.mount(r.value),l("ready")}catch(n){}})()}),(t,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[n.isVisible?(e.openBlock(),e.createBlock(ce,{key:0,type:"applepay",onClick:_})):e.createCommentVNode("",!0),e.createElementVNode("div",ue,[e.createElementVNode("div",{ref_key:"applePayButtonRef",ref:r},null,512)])],64))}}),se={class:"relative overflow-hidden"},pe=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:n}){const o=t,a=n,l=e.ref(),r=i.useLogger();return e.onMounted(()=>{(async()=>{const{AdyenCheckout:e,PayPal:t}=await p.loadAdyen(),i=new t(await e(p.getAdyenExpressCheckoutConfiguration({locale:o.locale,amount:o.amount,countryCode:o.countryCode,paymentMethodOptionResponse:o.paymentMethodOptionsResponse})),{isExpress:!0,blockPayPalPayLaterButton:!0,blockPayPalCreditButton:!0,blockPayPalVenmoButton:!0,style:{height:55},onInit:()=>{a("ready")}});if(l.value)try{await i.isAvailable(),i.mount(l.value)}catch(n){r.error("EXPRESS_CHECKOUT_PAYPAL_ERROR","Failed mounting PayPal express button",{error:n})}else r.error("EXPRESS_CHECKOUT_PAYPAL_ERROR","The PayPal button reference is not found and cannot be mounted")})()}),(i,n)=>(e.openBlock(),e.createElementBlock("div",se,[t.isVisible?(e.openBlock(),e.createBlock(ce,{key:0,type:"paypal",class:"w-full"})):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"paypalButtonRef",ref:l,class:"absolute inset-0 opacity-[0.0001]"},null,512)]))}}),me={class:"w-[1px] h-[1px] overflow-hidden opacity-0 absolute"},ge=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:n}){const o=t,a=n,l=e.ref(),r=i.useLogger(),c=()=>{var e;const t=null==(e=l.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 p.loadAdyen(),i=new t(await e(p.getAdyenExpressCheckoutConfiguration({locale:o.locale,amount:o.amount,countryCode:o.countryCode,paymentMethodOptionResponse:o.paymentMethodOptionsResponse})),{isExpress:!0});if(l.value)try{await i.isAvailable(),i.mount(l.value),a("ready")}catch(n){r.error("EXPRESS_CHECKOUT_GOOGLE_PAY_ERROR","Failed mounting Google Pay express button",{error:n})}else r.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(ce,{key:0,type:"googlepay",onClick:c})):e.createCommentVNode("",!0),e.createElementVNode("div",me,[e.createElementVNode("div",{ref_key:"googlePayButtonRef",ref:l},null,512)])],64))}}),ve={key:0,class:"mt-4n"},fe={class:"mb-2"},ye={class:"grid grid-cols-6 gap-1 md:gap-2"},_e={class:"h-4 mt-4"},he=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(),l=e.ref(!1),r=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)),m=e.computed(()=>{var e;if(0===(null==(e=o.paymentMethodsOptionsResponse)?void 0:e.length))return!1;const t=!u.value||l.value,i=!s.value||r.value,n=!d.value||c.value;return t&&i&&n}),g=e.computed(()=>m.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",fe,[m.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{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(v._sfc_main,{key:0,variant:"title"}))]),e.createElementVNode("div",ye,[m.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(v._sfc_main,{class:"h-11 col-span-3"}),e.createVNode(v._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===g.value,"md:!col-span-3":2===g.value,"!col-span-6 md:!col-span-2":3===g.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":m.value,"payment-method-options-response":u.value,"on-billing-information-change":i.onBillingInformationChange,onReady:o[0]||(o[0]=e=>l.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===g.value,"md:!col-span-3":2===g.value}])},[s.value?(e.openBlock(),e.createBlock(ge,{key:0,amount:i.amount,"billing-information":i.billingInformation,"country-code":i.countryCode,locale:i.locale,"is-visible":m.value,"payment-method-options-response":s.value,onReady:o[2]||(o[2]=e=>r.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===g.value,"md:!col-span-3":2===g.value}])},[d.value?(e.openBlock(),e.createBlock(pe,{key:0,amount:i.amount,"billing-information":i.billingInformation,"country-code":i.countryCode,locale:i.locale,"is-visible":m.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",_e,[m.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$17),{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(v._sfc_main,{key:0,variant:"divider-text"}))])])):e.createCommentVNode("",!0)}}),be={class:"grid grid-cols-2 gap-2"},Me=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(),l=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}),r=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",be,[e.createVNode(e.unref(t._sfc_main),{variant:"body-xs",shade:"lighter",tag:"div"},{default:e.withCtx(()=>[r.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:l.value??"0",upper_bound:r.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:l.value??"0"})),1)],64))]),_:1}),e.createVNode(e.unref(t._sfc_main),{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})]))}}),Ne={class:"grid grid-cols-1 gap-0.5 pt-1.5"},Ie=e.defineComponent({__name:"TieredTable",props:{bands:{type:Array},period:{type:Object}},setup:t=>(i,n)=>(e.openBlock(),e.createElementBlock("div",Ne,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.bands,(i,n)=>(e.openBlock(),e.createBlock(Me,{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 Ce={class:"flex flex-row-reverse md:flex-row gap-4"},ke={class:"w-24 md:w-32 shrink-0 justify-start"},De=["tabindex"],Ae={key:0},Ee={key:0},we=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:l}=t.useTimePeriod(),r=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,o,a,l,r;const{config:c,productItem:u}=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==c?void 0:c.billing_period,billedInAdvance:null==c?void 0:c.billing_in_advance},product:{name:null==u?void 0:u.name,description:null==u?void 0:u.description},pricing:{..."FLAT"===(null==(e=null==c?void 0:c.details)?void 0:e.pricing_type)&&{amount:null==(a=null==(o=null==(n=c.details)?void 0:n.bands)?void 0:o[0])?void 0:a.amount},..."TIERED"===(null==(l=null==c?void 0:c.details)?void 0:l.pricing_type)&&{tiered:{bands:null==(r=c.details)?void 0:r.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",Ce,[e.createElementVNode("div",ke,[e.createVNode(e.unref(t._sfc_main$42),{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?r.value=!r.value:void 0)},[e.createVNode(e.unref(t._sfc_main),{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),{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(l)(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),{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$11),{icon:"keyboard_arrow_down",size:"xs",class:e.normalizeClass(["absolute transition ease-in-out text-gray-400",{"rotate-0":!r.value,"rotate-180":r.value}])},null,8,["class"])]),_:1})):e.createCommentVNode("",!0)],10,De)]),(null==(m=null==(p=e.unref(u).pricing)?void 0:p.tiered)?void 0:m.bands)?(e.openBlock(),e.createElementBlock("div",Ae,[e.createVNode(e.unref(t._sfc_main$33),null,{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",Ee,[e.createVNode(Ie,{bands:e.unref(u).pricing.tiered.bands,period:e.unref(u).billing.period},null,8,["bands","period"])])):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0)])}}}),Pe=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$1),{key:a},{default:e.withCtx(()=>{var t;return[n.pricing_item_config_id?(e.openBlock(),e.createBlock(we,{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))}}),Ve={class:"flex gap-4 border-l-2 border-primary-600 px-2"},xe={class:"grow"},Be=e.defineComponent({__name:"PricingGroupTitle",setup:i=>(i,n)=>(e.openBlock(),e.createElementBlock("div",Ve,[e.createElementVNode("div",xe,[e.createVNode(e.unref(t._sfc_main),{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),{tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.renderSlot(i.$slots,"description")]),_:3})])]))}),Te={class:"p-1"},Se={class:"grid grid-cols-1 gap-1 pt-1"},Le=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:l}=t.usePricingItem({currency:e.toRef(n,"currency"),billingPeriod:e.toRef(n,"billingPeriod")}),r=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$1),{"no-spacing":""},{default:e.withCtx(()=>[e.createElementVNode("div",Te,[e.createVNode(Be,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",Se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.pricings,i=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{key:i.id,"content-background":"none",class:e.normalizeClass({"!bg-white":u(i.id)})},{default:e.withCtx(()=>{var n,c;return[e.createVNode(m._sfc_main,{name:e.unref(E)(i)??"",description:(null==(n=i.items)?void 0:n[0])?e.unref(l)({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$23),{"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=>!r.includes(e));o.value=[...t,e]}})(i.id)},null,8,["model-value","onUpdate:modelValue"])]),_:2},1032,["name","description"])]}),_:2},1032,["class"]))),128))])])]),_:1}))}}),je={class:"grid grid-cols-1 gap-1"},ze=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:l}=t.usePricingItem({currency:e.toRef(n,"currency"),billingPeriod:e.toRef(n,"billingPeriod")}),r=e=>o.value.includes(e),c=e=>{r(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$1),{"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(Be,{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",je,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.pricings,n=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{key:n.id,"content-background":i.groupName||r(n.id)?"none":"gray",class:e.normalizeClass({"!bg-white":r(n.id)})},{default:e.withCtx(()=>{var i,o;return[e.createVNode(m._sfc_main,{name:e.unref(E)(n)??"",description:(null==(i=n.items)?void 0:i[0])?e.unref(l)({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(()=>[r(n.id)?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$3),{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$3),{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"]))}}),Oe={class:"p-1"},Ue={class:"pt-1"},Re=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:l}=t.usePricingItem({currency:e.toRef(n,"currency"),billingPeriod:e.toRef(n,"billingPeriod")}),{isMobileViewport:r}=g.useViewport(),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:E(e)??"",value:e.id,description:i?l({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$1),{"no-spacing":""},{default:e.withCtx(()=>[e.createElementVNode("div",Oe,[e.createVNode(Be,null,{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.groupName),1)]),_:1}),e.createElementVNode("div",Ue,[d.value.length<=3?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$43),{key:0,modelValue:u.value,"onUpdate:modelValue":o[0]||(o[0]=e=>u.value=e),options:d.value.slice(0,3),direction:e.unref(r)?"column":"row","show-radio":!1},null,8,["modelValue","options","direction"])):d.value.length<=6?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$39),{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$44),{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 Fe={class:"grid grid-cols-1 gap-1"},$e=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:l}=t.useIntl(),r=e.computed(()=>{var e;const t=null==(e=_({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(()=>r.value.filter(e=>"ADDON"===e.product_type)),u=e.computed(()=>A(n.subscription));return(n,d)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{title:e.unref(l)({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",Fe,[e.createVNode(Pe,{modelValue:o.value,"onUpdate:modelValue":d[0]||(d[0]=e=>o.value=e),"initial-seats-values":i.initialSeatsValues,pricings:r.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(Re,{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(Le,{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(ze,{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(ze,{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"]))}});const Ge=["aria-expanded","aria-label"],Ye={class:"flex w-full cursor-pointer flex-row items-center justify-between gap-3 px-3 py-2"},qe={class:"flex flex-row items-center gap-2"},Qe=["onKeydown"],Ke=["aria-label"],He={class:"flex w-full cursor-pointer flex-row items-center justify-between gap-3 px-3 py-2"},Ze={class:"flex flex-row items-center gap-2"},Xe={class:"sr-only","aria-live":"polite"},We=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,l=n,r=e.ref(!1),c=e.ref(""),u=e.ref(""),d=e.ref(null),s=e.ref(null),p=function(e=""){return`${e}${crypto.randomUUID()}`}("promotion-code-"),m=`${p}-label`,g=`${p}-panel`,v=e.computed(()=>null!==a.promotionCode&&""!==a.promotionCode),f=e.computed(()=>c.value.trim().length>0),y=e.computed(()=>a.promotionCode??o({defaultMessage:"Promotion applied",id:"checkout.promotion_code.applied_label",description:"Fallback label for an applied promotion code in checkout"})),_=e.computed(()=>o({defaultMessage:r.value?"Collapse promotion code input":"Expand promotion code input",id:r.value?"checkout.promotion_code.collapse_aria_label":"checkout.promotion_code.expand_aria_label",description:"Aria label for the promotion code toggle button in checkout"})),h=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"})),b=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"})),M=()=>{c.value=""},N=()=>{r.value&&(r.value=!1)},I=()=>{v.value||(r.value=!r.value)},C=()=>{if(!f.value)return;const e=c.value.trim();l("update:appliedCode",e),l("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"}),r.value=!1},k=()=>{l("update:appliedCode",null),l("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"}),M(),e.nextTick(()=>{var e;null==(e=d.value)||e.focus()})};return e.watch(r,t=>{if(!t)return M(),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||M()}),(i,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[v.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{key:1,"no-border":"","no-spacing":"","content-background":"none",class:"relative w-full"},{default:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"w-full rounded border border-primary-900 bg-white","aria-label":b.value,onClick:k},[e.createElementVNode("div",He,[e.createElementVNode("div",Ze,[e.createVNode(e.unref(t._sfc_main$11),{icon:"local_activity"}),e.createVNode(e.unref(t._sfc_main),{variant:"body-sm",class:"font-semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y.value),1)]),_:1})]),e.createVNode(e.unref(t._sfc_main$11),{icon:"close"})])],8,Ke)]),_:1})):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{key:0,"no-spacing":"",class:"relative w-full"},{default:e.withCtx(()=>[e.createElementVNode("button",{ref_key:"toggleRef",ref:d,type:"button",class:"w-full","aria-expanded":r.value,"aria-controls":g,"aria-label":_.value,onClick:I},[e.createElementVNode("div",Ye,[e.createElementVNode("div",qe,[e.createVNode(e.unref(t._sfc_main$11),{icon:"local_activity"}),e.createVNode(e.unref(t._sfc_main),{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$11),{icon:r.value?"remove":"add"},null,8,["icon"])])],8,Ge),e.withDirectives(e.createElementVNode("div",{id:g,ref_key:"panelRef",ref:s,role:"region","aria-labelledby":m,class:"flex w-full flex-row items-center gap-2 overflow-hidden border-t px-3 py-2",onKeydown:e.withKeys(e.withModifiers(N,["prevent"]),["esc"])},[e.createVNode(e.unref(t._sfc_main$21),{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$3),{type:"button",disabled:!f.value,"aria-label":h.value,"aria-disabled":!f.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,Qe),[[e.vShow,r.value]])]),_:1})),e.createElementVNode("span",Xe,e.toDisplayString(u.value),1)],64))}}),Je={class:"flex justify-around"},et={class:"flex items-center gap-0.5"},tt={key:0,xmlns:"http://www.w3.org/2000/svg",width:"40",height:"15",fill:"none",viewBox:"0 0 40 15",class:"inline-block translate-y-[1px]"},it=e.defineComponent({__name:"SecurePaymentsKPI",props:{paymentMethodOptions:{type:Array}},setup(i){const n=i,{$t:o}=t.useIntl(),a=e.computed(()=>n.paymentMethodOptions.find(({integration:e})=>{var t;return"ADYEN"===(null==(t=e.payment_gateway)?void 0:t.variant)})),l=e.computed(()=>a.value?o({defaultMessage:"Secure and encrypted payments by",description:"Secure encrypted payments KPI for a specific vendor, followed by a vendor logo",id:"secure_payments_kpi.specific_vendor"}):o({defaultMessage:"Secure and encrypted payments",description:"Secure encrypted payments KPI",id:"secure_payments_kpi.generic"}));return(i,n)=>(e.openBlock(),e.createElementBlock("div",Je,[e.createElementVNode("div",et,[e.createVNode(e.unref(t._sfc_main$11),{icon:"lock",size:"xs"}),e.createVNode(e.unref(t._sfc_main),{tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value)+" ",1),a.value?(e.openBlock(),e.createElementBlock("svg",tt,[...n[0]||(n[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M.049 2.917h5.845c.646 0 1.17.522 1.17 1.166v5.834H1.217c-.646 0-1.17-.522-1.17-1.167V5.833h2.924v2.334H4.14v-3.5H.049zM32.784 2.917v7h2.922v-5.25h1.17v5.25h2.922V4.083c0-.644-.523-1.166-1.169-1.166zM16.417 12.833h5.845c.646 0 1.17-.522 1.17-1.166v-8.75h-2.924v5.25H19.34v-5.25h-2.922V8.75c0 .645.523 1.167 1.169 1.167h2.922v1.166h-4.091zM31.614 9.917H25.77c-.646 0-1.17-.522-1.17-1.167V2.917h5.846c.646 0 1.17.522 1.17 1.166V7h-2.923V4.667h-1.17v3.5h4.092zM15.248 0v9.917H9.402c-.646 0-1.17-.522-1.17-1.167V4.083c0-.644.524-1.166 1.17-1.166h1.754v5.25h1.169V0z"},null,-1)])])):e.createCommentVNode("",!0)]),_:1})])]))}}),nt={key:0},ot={class:"flex flex-col gap-2"},at=e.defineComponent({__name:"Checkout",props:{configuration:{type:Object}},emits:["error","ready"],setup(n,{emit:o}){var a,l,r,c,u,s,m,f;const h=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("../../PaymentIntegrationForm-Cl5ua8v8.js"))),b=n,N=o,I=e.computed(()=>b.configuration),C=e.ref(),k=e.ref(),D=i.useLogger(),{$t:E,locale:w}=t.useIntl(),{formatTimePeriod:V}=t.useTimePeriod(),x=d.usePortal(),{isMobileViewport:B}=g.useViewport();if(D.info("COMPONENT_INITIALIZED","Checkout component initialized"),"INIT_PRICING_PLAN_SUBSCRIPTION"!==(null==(a=x.value)?void 0:a.type))throw D.error("INVALID_TOKEN","Invalid token"),Error("Invalid token");"REVOKED"===x.value.status&&(C.value={code:"RESOURCE_REVOKED",message:`Portal url with resource id "${x.value.id}" is revoked`},D.error("RESOURCE_REVOKED",`Portal url with resource id "${x.value.id}" is revoked`));const T=null==(r=null==(l=x.value)?void 0:l.init_pricing_plan_subscription)?void 0:r.pricing_plan_subscription_id,S=null==(u=null==(c=x.value)?void 0:c.init_pricing_plan_subscription)?void 0:u.success_url,{paymentMethodOptions:L,subscription:j,isPaymentMethodsPending:z,isInvoicePreviewPending:O,checkoutForm:U,invoicePreview:F,invoicePreviewByBillingPeriod:$,trialInvoicePreview:G,trialPeriod:q,authorizationContext:Q,isPaid:Z,amount:X,loadInvoicePreview:W,updateInvoicePreviewOnBillingInformationChange:J}=P({initialCountry:null==(s=b.configuration)?void 0:s.countryCode,initialEmail:null==(m=b.configuration)?void 0:m.email,subscriptionId:T,enabledPricingIds:null==(f=b.configuration)?void 0:f.enabledPricingIds}),ee=async()=>{var e;await U.validation.value.$validate(),U.validation.value.$invalid||null==(e=k.value)||e.submit()},te=async()=>(await U.validation.value.$validate(),!U.validation.value.$invalid),ie=e.computed(()=>!!G.value),oe=e.computed(()=>!!F.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})(F.value)),le=e.computed(()=>U.form.value.country&&["US","CA"].includes(U.form.value.country)||!1),re=e.computed({get:()=>U.form.value.enabledPricingIds??[],set:e=>{U.form.value.enabledPricingIds=e}}),ce=e.computed(()=>j.value?_({pricingPlanScheduleInfos:j.value.pricing_plan_schedule_infos,type:"DEFAULT"}):void 0),ue=e.computed(()=>{var e,t;if(!j.value)return;const i=null==(t=null==(e=ce.value)?void 0:e.pricing_plan_version)?void 0:t.pricing_currency_settings;return M({country:U.form.value.country,pricingCurrencySettings:i,fallbackCurrency:j.value.billing_currency})}),de=e.computed(()=>{if(!ce.value||!j.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,n,o;null==(i=e.billing_period_configs)||i.forEach(e=>{var i;null==(i=e.configs)||i.forEach(i=>{var n,o,a,l;if(i.id){const r=null==(l=null==(a=null==(o=null==(n=i.details)?void 0:n.bands)?void 0:o.find(e=>{var t;return null==(t=e.amount)?void 0:t.currency}))?void 0:a.amount)?void 0:l.currency;t.set(i.id,{...r&&{currency:r},billingPeriod:e.billing_period})}})}),null==(n=e.configs)||n.forEach(e=>{var i,n,o,a;if(e.id){const l=null==(a=null==(o=null==(n=null==(i=e.details)?void 0:i.bands)?void 0:n.find(e=>{var t;return null==(t=e.amount)?void 0:t.currency}))?void 0:o.amount)?void 0:a.currency;t.set(e.id,{...l&&{currency:l}})}}),null==(o=e.pricing_currency_configs)||o.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:ce.value}),t=ue.value,i=j.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}),se=e.computed({get:()=>{const e=U.form.value.seatsValues??[],t=de.value;return t.size?e.filter(({pricing_item_config_id:e})=>t.has(e)):e},set:e=>{const t=U.form.value.seatsValues??[],i=de.value;if(!i.size)return void(U.form.value.seatsValues=e);const n=t.filter(({pricing_item_config_id:e})=>!i.has(e));U.form.value.seatsValues=n.concat(e)}}),pe=e.computed(()=>{var e,i,n,o,a;return G.value?E({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"===G.value.tax_summary.total_amount.quantity?E({defaultMessage:"Free",id:"checkout.agreement.trial.free",description:"The free amount for the trial period"}):t.formatAmount(G.value.tax_summary.total_amount),trial_period:V(q.value,{short:!0}),subscription_amount:t.formatAmount((null==(e=F.value)?void 0:e.tax_summary.total_amount)??{quantity:"0.00",currency:"EUR"}),billing_period:V((null==(i=F.value)?void 0:i.billing_period)??{type:"MONTH",value:1},{short:!0,singular:!0,hideValueForExactPeriods:!0}),start_date:new Date(Me.value)}):E({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=F.value)?void 0:n.tax_summary.total_amount)?t.formatAmount(null==(o=F.value)?void 0:o.tax_summary.total_amount):"",billing_period:V((null==(a=F.value)?void 0:a.billing_period)??{type:"MONTH",value:1},{short:!0,singular:!0,hideValueForExactPeriods:!0}),start_date:new Date(Me.value)})}),me=e.computed(()=>{var e,t,i,n,o,a;if(!F.value)return;const l=(null==(e=j.value)?void 0:e.name)??(null==(o=null==(n=null==(i=null==(t=j.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:l,managementURL:"https://www.solvimon.com/account/billing",agreement:pe.value,...G.value&&q.value&&{trial:{label:E({defaultMessage:"Trial",id:"checkout.trial.label",description:"The label of the trial"}),amount:G.value.tax_summary.total_amount,startDate:ye.value?new Date(ye.value):void 0,endDate:be.value?new Date(be.value):void 0}},regular:{label:l,amount:F.value.tax_summary.total_amount,startDate:Me.value?new Date(Me.value):void 0,interval:(null==(a=j.value)?void 0:a.billing_period)??{type:"MONTH",value:1}}}}),ge=e=>t.isValidCountryCode(e),ve=e=>{const{country:t,...i}=e;U.updateInitialState({...i,...t&&ge(t)?{country:t}:{}})},fe=e.computed(()=>{var e,t;return!((null==(e=b.configuration)?void 0:e.email)&&(null==(t=b.configuration)?void 0:t.countryCode))}),ye=e.computed(()=>{var e,t,i;const n=null==(t=null==(e=G.value)?void 0:e.periods)?void 0:t[0],o=null==(i=_e.value)?void 0:i.trialStartDate;return(null==n?void 0:n.start_at)?new Date(n.start_at):o}),_e=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=_({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=_({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}(j.value)),be=e.computed(()=>{var e,t,i;const n=null==(t=null==(e=G.value)?void 0:e.periods)?void 0:t[0],o=null==(i=_e.value)?void 0:i.trialEndDate;return(null==n?void 0:n.end_at)?new Date(n.end_at):o}),Me=e.computed(()=>{var e,t,i;const n=null==(t=null==(e=F.value)?void 0:e.periods)?void 0:t[0],o=null==(i=_e.value)?void 0:i.subscriptionStartDate;return(null==n?void 0:n.start_at)?new Date(n.start_at):o}),Ne=e.computed(()=>!!(U.form.value.seatsValues&&U.form.value.seatsValues.length>0)||(!(!j.value||!function(e){return A(e).some(e=>"EXACTLY_ONE"===e.selection_constraint||"AT_LEAST_ONE"===e.selection_constraint)}(j.value))||!(!j.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=A(e);return t.some(e=>"ADDON"===e.product_type)||i.some(e=>"ADDON"===e.object_type)}(j.value)))),Ie=e.ref(null),{applyPromotionCode:Ce,removePromotionCode:ke,isPromotionCodePending:De,promotionCodeErrorMessage:Ae}=function({checkoutForm:t,updateInvoicePreviewOnBillingInformationChange:i,logger:n,formatErrorMessage:o,onInvalidPromotionCode:a,onApplyError:l}){const r=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,r.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{r.value=!1}};return{applyPromotionCode:async e=>{const o=null==e?void 0:e.trim();if(o){c.value=null,t.form.value.promotionCode=o,r.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==l||l(),(e=>function(e){return"object"==typeof e&&null!==e&&"field"in e}(e)&&"promotion_codes"===e.field)(s)&&(null==a||a()),await d({suppressError:!0,preserveErrorMessage:!0})}finally{r.value=!1}}},removePromotionCode:d,isPromotionCodePending:r,promotionCodeErrorMessage:c}}({checkoutForm:U,updateInvoicePreviewOnBillingInformationChange:J,logger:D,formatErrorMessage:({action:e})=>E("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:()=>{Ie.value=null},onApplyError:()=>{Ie.value=null}}),Ee=()=>{S&&p.safeUrlRedirect(S)},we=()=>{var e;Z.value=!0,Ae.value=null,(null==(e=b.configuration)?void 0:e.onPaymentSuccess)?b.configuration.onPaymentSuccess():S&&Ee()},Pe=e=>{j.value&&(j.value={...j.value,billing_period:e},W())};return e.onMounted(()=>{N("ready")}),(i,n)=>C.value?(e.openBlock(),e.createBlock(K,{key:0})):(e.openBlock(),e.createBlock(e.unref(y.ContentWithAsideLayout),{key:1},{header:e.withCtx(()=>[e.createVNode(v._sfc_main,{class:"min-h-[52px] w-96"},{default:e.withCtx(()=>{var t,i,n;return[e.unref(F)&&e.unref(j)&&Me.value?(e.openBlock(),e.createBlock(Y,{key:0,"trial-start-date":ye.value,"trial-period":e.unref(q),"subscription-start-date":Me.value,"subscription-name":(null==(t=e.unref(j))?void 0:t.name)??"",amount:null==(i=e.unref(F))?void 0:i.invoice_amount_including_tax,"billing-period":null==(n=e.unref(j))?void 0:n.billing_period,"country-code":e.unref(U).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,o,a;return[e.unref(j)&&e.unref(B)?(e.openBlock(),e.createBlock(ne,{key:0,subscription:e.unref(j),invoice:e.unref(F),"invoice-preview-by-billing-period":e.unref($),"trial-invoice":e.unref(G),"enabled-pricing-ids":re.value,"trial-period":e.unref(q),avatar:null==(i=I.value)?void 0:i.avatar,"is-paid":e.unref(Z),"is-usage-based":oe.value,"is-preview-and-payment-methods-pending":e.unref(z)||e.unref(O),"country-code":e.unref(U).form.value.country,collapsible:"collapsed",variant:"products-inline",onBillingPeriodChange:Pe},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),Ne.value&&e.unref(j)?(e.openBlock(),e.createBlock($e,{key:1,"seats-values":se.value,"onUpdate:seatsValues":n[0]||(n[0]=e=>se.value=e),"enabled-pricing-ids":re.value,"onUpdate:enabledPricingIds":n[1]||(n[1]=e=>re.value=e),subscription:e.unref(j),"initial-seats-values":null==(o=e.unref(U).initialState)?void 0:o.value.seatsValues,"billing-period":e.unref(j).billing_period,currency:ue.value},null,8,["seats-values","enabled-pricing-ids","subscription","initial-seats-values","billing-period","currency"])):e.createCommentVNode("",!0),!e.unref(Z)&&e.unref(U).form.value.country&&e.unref(X)&&me.value?(e.openBlock(),e.createBlock(he,{key:2,amount:e.unref(X),"country-code":e.unref(U).form.value.country,locale:e.unref(w),"payment-methods-options-response":e.unref(L)??[],"billing-information":me.value,"on-billing-information-change":e.unref(J),onUpdateBillingInformation:ve},null,8,["amount","country-code","locale","payment-methods-options-response","billing-information","on-billing-information-change"])):e.createCommentVNode("",!0),e.unref(Z)?(e.openBlock(),e.createBlock(H,{key:3,onContinueToMerchant:Ee})):e.createCommentVNode("",!0),e.unref(Z)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(R,{key:4,modelValue:e.unref(U).form.value,"onUpdate:modelValue":n[2]||(n[2]=t=>e.unref(U).form.value=t),validation:e.unref(U).validation,"read-only-email":null==(a=b.configuration)?void 0:a.email,"show-customer-info-on-top":fe.value||e.unref(Z),"is-billing-information-mandatory":le.value,"get-is-field-required":e.unref(U).getIsFieldRequired,"read-only":e.unref(Z)},null,8,["modelValue","validation","read-only-email","show-customer-info-on-top","is-billing-information-mandatory","get-is-field-required","read-only"])),e.unref(Z)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(v._sfc_main,{key:5,variant:"section",class:"min-h-[130px]"},{default:e.withCtx(()=>[!e.unref(z)||e.unref(z)&&e.unref(L).length>0?(e.openBlock(),e.createElementBlock("div",nt,[e.createVNode(e.unref(t._sfc_main),{variant:"heading-3",tag:"h2",class:"mb-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(E)({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(U).form.value.country?0===e.unref(L).length?(e.openBlock(),e.createBlock(ae,{key:1,icon:"credit_card_off"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(E)({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(E)({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(X)&&e.unref(U).form.value.country?(e.openBlock(),e.createBlock(e.unref(h),{key:2,ref_key:"paymentIntegrationFormRef",ref:k,"country-code":e.unref(U).form.value.country,context:e.unref(Q),amount:e.unref(X),variant:"AUTHORIZE","payment-method-options":e.unref(L)??[],"validate-on-submit":te,"force-store-payment-method":"",onPaymentSuccess:we,onReady:n[3]||(n[3]=e=>N("ready"))},null,8,["country-code","context","amount","payment-method-options"])):e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ae,{key:0,icon:"captive_portal"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(E)({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(E)({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(v._sfc_main,{variant:"section",class:"min-h-[220px]"},{default:e.withCtx(()=>{var t;return[e.unref(j)&&e.unref(F)?(e.openBlock(),e.createBlock(ne,{key:0,subscription:e.unref(j),invoice:e.unref(F),"invoice-preview-by-billing-period":e.unref($),"trial-invoice":e.unref(G),"enabled-pricing-ids":re.value,"trial-period":e.unref(q),"country-code":e.unref(U).form.value.country,avatar:null==(t=I.value)?void 0:t.avatar,"is-paid":e.unref(Z),"is-usage-based":oe.value,"is-preview-and-payment-methods-pending":e.unref(z)||e.unref(O),onBillingPeriodChange:Pe},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(Z)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(We,{key:0,"promotion-code":Ie.value,"onUpdate:appliedCode":n[4]||(n[4]=e=>Ie.value=e),onRemove:e.unref(ke),onApply:e.unref(Ce)},null,8,["promotion-code","onRemove","onApply"])),e.unref(Ae)?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$15),{key:1,class:"mt-2",title:e.unref(Ae)},null,8,["title"])):e.createCommentVNode("",!0),e.createElementVNode("div",ot,[e.unref(Z)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(v._sfc_main,{key:0,class:"min-h-[44px]"},{default:e.withCtx(()=>[e.unref(F)?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$3),{key:0,type:"button",size:"lg",class:"w-full",disabled:e.unref(De)||0===e.unref(L).length,onClick:ee},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(ie.value?e.unref(E)({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(E)({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(it,{"payment-method-options":e.unref(L)},null,8,["payment-method-options"])])]),_:1}))}}),lt=e.defineComponent({__name:"Checkout.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},branding:{type:Object},configuration:{type:Object}},emits:["error","ready"],setup(n,{emit:o}){var a,l;const r=n,c=o,u=i.useLogger(),d=(e=>{if(e)return t.isValidCountryCode(e)?e:void u.error("INVALID_COUNTRY_CODE",`invalid country code provided: "${e}"`)})(null==(a=r.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==(l=r.configuration)?void 0:l.email);return(t,o)=>{var a,l,r,u;return e.openBlock(),e.createBlock(i._sfc_main,{"custom-element-name":e.unref(ct),environment:n.environment,locale:n.locale,"portal-object":n.portalObject,"allowed-portal-types":["INIT_PRICING_PLAN_SUBSCRIPTION"],"primary-color":null==(l=null==(a=n.branding)?void 0:a.colors)?void 0:l.primary,"secondary-color":null==(u=null==(r=n.branding)?void 0:r.colors)?void 0:u.secondary,"experimental-features":n.experimentalFeatures,"log-level":n.logLevel,"on-log":n.onLog,onError:o[1]||(o[1]=e=>t.$emit("error",e))},{default:e.withCtx(()=>{var i,a,l;return[e.createVNode(at,{configuration:{avatar:null==(a=null==(i=n.branding)?void 0:i.emblem)?void 0:a.public_url,email:e.unref(s),countryCode:e.unref(d),enabledPricingIds:null==(l=n.configuration)?void 0:l.enabledPricingIds},onReady:o[0]||(o[0]=e=>c("ready"))},e.createSlots({_:2},[t.$slots["terms-and-conditions"]?{name:"terms-and-conditions",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"terms-and-conditions")]),key:"0"}:void 0]),1032,["configuration"])]}),_:3},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}}),rt=i.defineCustomElement(lt),ct=i.getComponentName("checkout");exports.COMPONENT_NAME=ct,exports.SolvimonCheckout=rt,exports.defineSolvimonCheckout=()=>{customElements.get(ct)||customElements.define(ct,rt)};