@justifi/webcomponents 4.13.0 → 4.15.0

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 (263) hide show
  1. package/dist/cjs/{Api-ab34a402.js → Api-3bc6e43f.js} +7 -2
  2. package/dist/cjs/{Payment-eceed10f.js → Payment-24f22eca.js} +2 -1
  3. package/dist/cjs/{SubAccount-b3902202.js → SubAccount-f1eda5da.js} +1 -1
  4. package/dist/cjs/additional-questions-details_5.cjs.entry.js +1 -1
  5. package/dist/cjs/business-additional-questions-schema-e7dd7bc3.js +57 -0
  6. package/dist/cjs/gross-payment-chart-core.cjs.entry.js +1 -1
  7. package/dist/cjs/{index.esm-d25bd7bf.js → index.esm-a32e1831.js} +727 -0
  8. package/dist/cjs/justifi-additional-questions-form-step_5.cjs.entry.js +20 -17
  9. package/dist/cjs/justifi-additional-questions_4.cjs.entry.js +4 -1
  10. package/dist/cjs/justifi-billing-form_2.cjs.entry.js +1796 -0
  11. package/dist/cjs/justifi-business-details.cjs.entry.js +2 -2
  12. package/dist/cjs/justifi-business-form.cjs.entry.js +8 -8
  13. package/dist/cjs/justifi-business-list.cjs.entry.js +4 -4
  14. package/dist/cjs/justifi-checkout-core.cjs.entry.js +7 -3
  15. package/dist/cjs/justifi-checkout.cjs.entry.js +12 -6
  16. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
  17. package/dist/cjs/justifi-new-payment-method_4.cjs.entry.js +13 -11
  18. package/dist/cjs/justifi-owner-form.cjs.entry.js +12 -8
  19. package/dist/cjs/justifi-payment-balance-transactions.cjs.entry.js +4 -4
  20. package/dist/cjs/justifi-payment-details.cjs.entry.js +3 -3
  21. package/dist/cjs/justifi-payment-form.cjs.entry.js +39 -5
  22. package/dist/cjs/justifi-payment-method-selector.cjs.entry.js +1 -1
  23. package/dist/cjs/justifi-payments-list.cjs.entry.js +3 -3
  24. package/dist/cjs/justifi-payout-details.cjs.entry.js +3 -3
  25. package/dist/cjs/justifi-payouts-list.cjs.entry.js +3 -3
  26. package/dist/cjs/justifi-proceeds-list.cjs.entry.js +4 -4
  27. package/dist/cjs/justifi-refund-form.cjs.entry.js +5 -6
  28. package/dist/cjs/justifi-subaccount-details.cjs.entry.js +6 -6
  29. package/dist/cjs/justifi-subaccounts-list.cjs.entry.js +5 -5
  30. package/dist/cjs/loader.cjs.js +1 -1
  31. package/dist/cjs/payload-parsers-c2df4b29.js +95 -0
  32. package/dist/cjs/payment-details-core.cjs.entry.js +1 -1
  33. package/dist/cjs/{payment.service-336189d3.js → payment.service-35298e95.js} +4 -4
  34. package/dist/cjs/payments-list-core.cjs.entry.js +2 -2
  35. package/dist/cjs/payout-details-core.cjs.entry.js +1 -1
  36. package/dist/cjs/{payout.service-6012d576.js → payout.service-eec372aa.js} +4 -4
  37. package/dist/cjs/payouts-list-core.cjs.entry.js +2 -2
  38. package/dist/cjs/{payload-parsers-6c4b5323.js → schema-validations-3c70335c.js} +15 -89
  39. package/dist/cjs/select-input.cjs.entry.js +31 -0
  40. package/dist/cjs/subaccount-account-details_4.cjs.entry.js +1 -1
  41. package/dist/cjs/text-input.cjs.entry.js +30 -0
  42. package/dist/cjs/{utils-6f62f7a1.js → utils-e58fe016.js} +0 -2
  43. package/dist/cjs/webcomponents.cjs.js +1 -1
  44. package/dist/collection/api/Api.js +7 -2
  45. package/dist/collection/api/Payment.js +2 -1
  46. package/dist/collection/api/services/business.service.js +1 -1
  47. package/dist/collection/api/services/checkout.service.js +5 -3
  48. package/dist/collection/api/services/payment.service.js +2 -2
  49. package/dist/collection/api/services/payout.service.js +2 -2
  50. package/dist/collection/api/services/reports.service.js +1 -1
  51. package/dist/collection/collection-manifest.json +1 -1
  52. package/dist/collection/components/billing-form/billing-form-schema.js +8 -8
  53. package/dist/collection/components/billing-form/billing-form.js +49 -89
  54. package/dist/collection/components/billing-form/test/billing-form.spec.js +2 -1
  55. package/dist/collection/components/business-forms/business-form/business-form.js +1 -1
  56. package/dist/collection/components/business-forms/business-form/business-representative/business-representative.js +4 -1
  57. package/dist/collection/components/business-forms/owner-form/owner-form.js +6 -2
  58. package/dist/collection/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step.js +1 -1
  59. package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.js +1 -1
  60. package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.js +1 -1
  61. package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-step.js +5 -2
  62. package/dist/collection/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step.js +1 -1
  63. package/dist/collection/components/business-forms/schemas/business-identity-schema.js +4 -2
  64. package/dist/collection/components/business-forms/schemas/schema-validations.js +5 -0
  65. package/dist/collection/components/business-list/business-list.js +1 -1
  66. package/dist/collection/components/checkout/checkout-core.js +74 -2
  67. package/dist/collection/components/checkout/checkout.js +73 -1
  68. package/dist/collection/components/checkout/payment-method-options.css +6 -6
  69. package/dist/collection/components/checkout/payment-method-options.js +42 -6
  70. package/dist/collection/components/checkout/{sezzel-payment-method.js → sezzle-payment-method.js} +2 -2
  71. package/dist/collection/components/checkout/test/checkout-core.spec.js +1 -1
  72. package/dist/collection/components/payment-balance-transactions/payment-balance-transactions.js +1 -1
  73. package/dist/collection/components/payment-form/payment-form.js +56 -6
  74. package/dist/collection/components/payment-form/payment-method-selector.js +1 -1
  75. package/dist/collection/components/payment-form/test/payment-form.spec.js +18 -35
  76. package/dist/collection/components/payment-method-form/payment-method-form.js +1 -1
  77. package/dist/collection/components/proceeds-list/proceeds-list.js +1 -1
  78. package/dist/collection/components/refund-form/refund-form.js +1 -1
  79. package/dist/collection/components/subaccount-details/subaccount-details.js +2 -2
  80. package/dist/collection/components/subaccounts-list/subaccounts-list.js +1 -1
  81. package/dist/docs.json +287 -81
  82. package/dist/esm/{Api-e9d568c7.js → Api-b09a2f6a.js} +7 -2
  83. package/dist/esm/{Payment-ef9fc1ae.js → Payment-3e94da9c.js} +2 -1
  84. package/dist/esm/{SubAccount-f4ae9809.js → SubAccount-80d46814.js} +1 -1
  85. package/dist/esm/additional-questions-details_5.entry.js +1 -1
  86. package/dist/esm/{business-additional-questions-schema-e96b0509.js → business-additional-questions-schema-1fdc5c40.js} +2 -2
  87. package/dist/esm/gross-payment-chart-core.entry.js +1 -1
  88. package/dist/esm/{index.esm-22b47398.js → index.esm-d98bc080.js} +727 -1
  89. package/dist/esm/justifi-additional-questions-form-step_5.entry.js +16 -13
  90. package/dist/esm/justifi-additional-questions_4.entry.js +4 -1
  91. package/dist/esm/justifi-billing-form_2.entry.js +1791 -0
  92. package/dist/esm/justifi-business-details.entry.js +2 -2
  93. package/dist/esm/justifi-business-form.entry.js +7 -7
  94. package/dist/esm/justifi-business-list.entry.js +4 -4
  95. package/dist/esm/justifi-checkout-core.entry.js +7 -3
  96. package/dist/esm/justifi-checkout.entry.js +12 -6
  97. package/dist/esm/justifi-gross-payment-chart.entry.js +2 -2
  98. package/dist/esm/justifi-new-payment-method_4.entry.js +13 -11
  99. package/dist/esm/justifi-owner-form.entry.js +11 -7
  100. package/dist/esm/justifi-payment-balance-transactions.entry.js +4 -4
  101. package/dist/esm/justifi-payment-details.entry.js +3 -3
  102. package/dist/esm/justifi-payment-form.entry.js +39 -5
  103. package/dist/esm/justifi-payment-method-selector.entry.js +1 -1
  104. package/dist/esm/justifi-payments-list.entry.js +3 -3
  105. package/dist/esm/justifi-payout-details.entry.js +3 -3
  106. package/dist/esm/justifi-payouts-list.entry.js +3 -3
  107. package/dist/esm/justifi-proceeds-list.entry.js +4 -4
  108. package/dist/esm/justifi-refund-form.entry.js +4 -5
  109. package/dist/esm/justifi-subaccount-details.entry.js +6 -6
  110. package/dist/esm/justifi-subaccounts-list.entry.js +5 -5
  111. package/dist/esm/loader.js +1 -1
  112. package/dist/esm/payload-parsers-fd35eeca.js +88 -0
  113. package/dist/esm/payment-details-core.entry.js +1 -1
  114. package/dist/esm/{payment.service-2fdc5018.js → payment.service-c62d82d3.js} +4 -4
  115. package/dist/esm/payments-list-core.entry.js +2 -2
  116. package/dist/esm/payout-details-core.entry.js +1 -1
  117. package/dist/esm/{payout.service-15064bcc.js → payout.service-28b9594f.js} +4 -4
  118. package/dist/esm/payouts-list-core.entry.js +2 -2
  119. package/dist/esm/{payload-parsers-32028700.js → schema-validations-31feaa53.js} +7 -84
  120. package/dist/{module/select-input2.js → esm/select-input.entry.js} +7 -30
  121. package/dist/esm/subaccount-account-details_4.entry.js +1 -1
  122. package/dist/{module/text-input2.js → esm/text-input.entry.js} +7 -29
  123. package/dist/esm/{utils-243abdb4.js → utils-37533368.js} +1 -2
  124. package/dist/esm/webcomponents.js +1 -1
  125. package/dist/module/Api.js +7 -2
  126. package/dist/module/Payment.js +2 -1
  127. package/dist/module/billing-form.js +41 -62
  128. package/dist/module/business-additional-questions-form-step.js +2 -2
  129. package/dist/module/business-additional-questions-schema.js +1 -1
  130. package/dist/module/business-address-schema.js +1 -1
  131. package/dist/module/business-core-info-form-step.js +2 -2
  132. package/dist/module/business-core-info-schema.js +1 -1
  133. package/dist/module/business-form-types.js +1 -154
  134. package/dist/module/business-identity-schema.js +5 -3
  135. package/dist/module/business-owners-form-step.js +1 -1
  136. package/dist/module/business-representative-form-step.js +6 -3
  137. package/dist/module/business-representative.js +4 -1
  138. package/dist/module/checkout-core.js +27 -19
  139. package/dist/module/identity-address-form.js +1 -1
  140. package/dist/module/index.esm.js +727 -1
  141. package/dist/module/justifi-business-details.js +2 -2
  142. package/dist/module/justifi-business-form.js +4 -5
  143. package/dist/module/justifi-business-list.js +1 -1
  144. package/dist/module/justifi-checkout.js +34 -24
  145. package/dist/module/justifi-gross-payment-chart.js +2 -2
  146. package/dist/module/justifi-payment-balance-transactions.js +1 -1
  147. package/dist/module/justifi-payment-details.js +1 -1
  148. package/dist/module/justifi-payment-form.js +50 -15
  149. package/dist/module/justifi-payment-provisioning.js +2 -2
  150. package/dist/module/justifi-payments-list.js +1 -1
  151. package/dist/module/justifi-payout-details.js +1 -1
  152. package/dist/module/justifi-payouts-list.js +1 -1
  153. package/dist/module/justifi-proceeds-list.js +1 -1
  154. package/dist/module/justifi-refund-form.js +2 -3
  155. package/dist/module/justifi-sezzle-payment-method.d.ts +11 -0
  156. package/dist/module/justifi-sezzle-payment-method.js +6 -0
  157. package/dist/module/justifi-subaccount-details.js +2 -2
  158. package/dist/module/justifi-subaccounts-list.js +1 -1
  159. package/dist/module/legal-address-form-step.js +3 -3
  160. package/dist/module/legal-address-form.js +1 -1
  161. package/dist/module/new-payment-method.js +9 -9
  162. package/dist/module/owner-form.js +9 -5
  163. package/dist/module/payment-method-form.js +1 -1
  164. package/dist/module/payment-method-options.js +26 -22
  165. package/dist/module/payment.service.js +2 -2
  166. package/dist/module/payout.service.js +2 -2
  167. package/dist/module/schema-validations.js +159 -0
  168. package/dist/module/select-input.js +48 -1
  169. package/dist/module/{sezzel-payment-method.js → sezzle-payment-method.js} +6 -6
  170. package/dist/module/text-input.js +46 -1
  171. package/dist/module/utils2.js +1 -2
  172. package/dist/module/utils3.js +12 -21
  173. package/dist/module/utils4.js +21 -12
  174. package/dist/types/api/Api.d.ts +5 -1
  175. package/dist/types/api/Payment.d.ts +2 -1
  176. package/dist/types/components/billing-form/billing-form.d.ts +8 -15
  177. package/dist/types/components/business-forms/business-form/business-representative/business-representative.d.ts +1 -0
  178. package/dist/types/components/business-forms/owner-form/owner-form.d.ts +1 -0
  179. package/dist/types/components/business-forms/payment-provisioning/business-representative/business-representative-form-step.d.ts +1 -0
  180. package/dist/types/components/business-forms/schemas/business-form-schema.d.ts +3 -1
  181. package/dist/types/components/business-forms/schemas/business-identity-schema.d.ts +2 -0
  182. package/dist/types/components/checkout/checkout-core.d.ts +4 -0
  183. package/dist/types/components/checkout/checkout.d.ts +4 -0
  184. package/dist/types/components/checkout/payment-method-options.d.ts +2 -0
  185. package/dist/types/components/checkout/{sezzel-payment-method.d.ts → sezzle-payment-method.d.ts} +1 -1
  186. package/dist/types/components/payment-form/payment-form.d.ts +7 -1
  187. package/dist/types/components.d.ts +38 -29
  188. package/dist/webcomponents/p-0603a526.entry.js +1 -0
  189. package/dist/webcomponents/{p-3917edbf.entry.js → p-09a6df17.entry.js} +1 -1
  190. package/dist/webcomponents/{p-7da249b8.entry.js → p-1367c4c7.entry.js} +1 -1
  191. package/dist/webcomponents/p-1b959678.entry.js +1 -0
  192. package/dist/webcomponents/{p-a6f170ba.entry.js → p-1f23c9d5.entry.js} +1 -1
  193. package/dist/webcomponents/p-21f301a0.entry.js +1 -0
  194. package/dist/webcomponents/p-243caf7c.entry.js +1 -0
  195. package/dist/webcomponents/{p-c6e207f6.entry.js → p-27ea1f3f.entry.js} +1 -1
  196. package/dist/webcomponents/{p-13e2f667.js → p-29c0b182.js} +1 -1
  197. package/dist/webcomponents/{p-28b38699.js → p-3cd675e7.js} +1 -1
  198. package/dist/webcomponents/p-3d70b0f1.entry.js +1 -0
  199. package/dist/webcomponents/{p-41bdee27.entry.js → p-55d37253.entry.js} +1 -1
  200. package/dist/webcomponents/{p-02b18979.entry.js → p-60ea8fd1.entry.js} +1 -1
  201. package/dist/webcomponents/p-624ed594.entry.js +1 -0
  202. package/dist/webcomponents/p-62bbcdfb.entry.js +1 -0
  203. package/dist/webcomponents/p-76e74f01.js +1 -0
  204. package/dist/webcomponents/p-7ca334d6.entry.js +1 -0
  205. package/dist/webcomponents/p-7d6c67bb.js +1 -0
  206. package/dist/webcomponents/{p-78b32fb9.entry.js → p-7ea5b11c.entry.js} +1 -1
  207. package/dist/webcomponents/p-83ae34bf.js +1 -0
  208. package/dist/webcomponents/p-84aea66c.entry.js +1 -0
  209. package/dist/webcomponents/p-8960e936.entry.js +1 -0
  210. package/dist/webcomponents/p-8d53f1de.entry.js +1 -0
  211. package/dist/webcomponents/p-969572f2.entry.js +1 -0
  212. package/dist/webcomponents/{p-fce2b224.entry.js → p-9a36fca6.entry.js} +1 -1
  213. package/dist/webcomponents/p-a38fdda7.entry.js +1 -0
  214. package/dist/webcomponents/{p-1334f776.entry.js → p-adc9ae0f.entry.js} +1 -1
  215. package/dist/webcomponents/p-b53d7b7f.js +1 -0
  216. package/dist/webcomponents/p-b8d70349.entry.js +1 -0
  217. package/dist/webcomponents/p-b9db1c52.entry.js +1 -0
  218. package/dist/webcomponents/p-ca39c89f.js +1 -0
  219. package/dist/webcomponents/p-d6b980a3.entry.js +1 -0
  220. package/dist/webcomponents/p-dd609661.js +1 -0
  221. package/dist/webcomponents/{p-9ba31a6a.entry.js → p-de4ffaa1.entry.js} +1 -1
  222. package/dist/webcomponents/{p-9f529959.entry.js → p-e1a3a670.entry.js} +1 -1
  223. package/dist/webcomponents/p-e4be71ee.entry.js +1 -0
  224. package/dist/webcomponents/p-e8706cc4.js +1 -0
  225. package/dist/webcomponents/{p-65510838.js → p-f4dec164.js} +1 -1
  226. package/dist/webcomponents/p-f942f90b.entry.js +1 -0
  227. package/dist/webcomponents/p-fea93cb9.entry.js +1 -0
  228. package/dist/webcomponents/{p-f76283a5.entry.js → p-fee64d38.entry.js} +1 -1
  229. package/dist/webcomponents/webcomponents.css +1 -1
  230. package/dist/webcomponents/webcomponents.esm.js +1 -1
  231. package/package.json +1 -1
  232. package/dist/cjs/business-additional-questions-schema-0a35f597.js +0 -57
  233. package/dist/cjs/form-2ad3d374.js +0 -729
  234. package/dist/cjs/justifi-billing-form_4.cjs.entry.js +0 -1864
  235. package/dist/esm/form-5279c05a.js +0 -727
  236. package/dist/esm/justifi-billing-form_4.entry.js +0 -1857
  237. package/dist/module/form.js +0 -727
  238. package/dist/module/justifi-sezzel-payment-method.d.ts +0 -11
  239. package/dist/module/justifi-sezzel-payment-method.js +0 -6
  240. package/dist/webcomponents/p-02fa533c.js +0 -1
  241. package/dist/webcomponents/p-101b2648.entry.js +0 -1
  242. package/dist/webcomponents/p-132ba228.js +0 -1
  243. package/dist/webcomponents/p-1885c478.entry.js +0 -1
  244. package/dist/webcomponents/p-23099f1f.entry.js +0 -1
  245. package/dist/webcomponents/p-230b96df.entry.js +0 -1
  246. package/dist/webcomponents/p-3da23f21.js +0 -1
  247. package/dist/webcomponents/p-4c84952f.entry.js +0 -1
  248. package/dist/webcomponents/p-64710363.entry.js +0 -1
  249. package/dist/webcomponents/p-731085e3.js +0 -1
  250. package/dist/webcomponents/p-7e334dce.entry.js +0 -1
  251. package/dist/webcomponents/p-7faacb1e.entry.js +0 -1
  252. package/dist/webcomponents/p-9b4b91ba.js +0 -1
  253. package/dist/webcomponents/p-a9af8f40.entry.js +0 -1
  254. package/dist/webcomponents/p-ade12f56.js +0 -1
  255. package/dist/webcomponents/p-b81afd51.entry.js +0 -1
  256. package/dist/webcomponents/p-bb58e656.entry.js +0 -1
  257. package/dist/webcomponents/p-bc12b8b9.js +0 -1
  258. package/dist/webcomponents/p-bfe7c55c.entry.js +0 -1
  259. package/dist/webcomponents/p-c1be3378.entry.js +0 -1
  260. package/dist/webcomponents/p-cb31488b.entry.js +0 -1
  261. package/dist/webcomponents/p-d0a8c631.entry.js +0 -1
  262. package/dist/webcomponents/p-d7d40d26.entry.js +0 -1
  263. package/dist/webcomponents/p-efbc8ffc.entry.js +0 -1
@@ -0,0 +1,1791 @@
1
+ import { r as registerInstance, h, H as Host, c as createEvent } from './index-83dcf934.js';
2
+ import { c as create$3, F as FormController } from './index.esm-d98bc080.js';
3
+ import { i as identityNameValidation, l as lineOneValidation, a as lineTwoValidation, c as cityValidation, s as stateValidation, p as postalValidation } from './schema-validations-31feaa53.js';
4
+ import { S as StateOptions } from './state-options-a356fb11.js';
5
+ import { f as filterPostalInput } from './utils-6f05d9d7.js';
6
+ import { n as composeQueryParams } from './utils-37533368.js';
7
+ import './business-form-options-de11bc46.js';
8
+ import './Business-d83fbdb4.js';
9
+
10
+ const BillingFormSchema = create$3({
11
+ name: identityNameValidation.required('Enter full name'),
12
+ address_line1: lineOneValidation.required('Enter street address'),
13
+ address_line2: lineTwoValidation.nullable(),
14
+ address_city: cityValidation.required('Enter city'),
15
+ address_state: stateValidation.required('Select state'),
16
+ address_postal_code: postalValidation.required('Enter postal code'),
17
+ });
18
+
19
+ const billingFormCss = ":root,[data-bs-theme=light]{--bs-blue:#0d6efd;--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#d63384;--bs-red:#dc3545;--bs-orange:#fd7e14;--bs-yellow:#ffc107;--bs-green:#198754;--bs-teal:#20c997;--bs-cyan:#0dcaf0;--bs-black:#000;--bs-white:#fff;--bs-gray:#6c757d;--bs-gray-dark:#343a40;--bs-gray-100:#f8f9fa;--bs-gray-200:#e9ecef;--bs-gray-300:#dee2e6;--bs-gray-400:#ced4da;--bs-gray-500:#adb5bd;--bs-gray-600:#6c757d;--bs-gray-700:#495057;--bs-gray-800:#343a40;--bs-gray-900:#212529;--bs-primary:#0d6efd;--bs-secondary:#6c757d;--bs-success:#198754;--bs-info:#0dcaf0;--bs-warning:#ffc107;--bs-danger:#dc3545;--bs-light:#f8f9fa;--bs-dark:#212529;--bs-primary-rgb:13, 110, 253;--bs-secondary-rgb:108, 117, 125;--bs-success-rgb:25, 135, 84;--bs-info-rgb:13, 202, 240;--bs-warning-rgb:255, 193, 7;--bs-danger-rgb:220, 53, 69;--bs-light-rgb:248, 249, 250;--bs-dark-rgb:33, 37, 41;--bs-primary-text-emphasis:#052c65;--bs-secondary-text-emphasis:#2b2f32;--bs-success-text-emphasis:#0a3622;--bs-info-text-emphasis:#055160;--bs-warning-text-emphasis:#664d03;--bs-danger-text-emphasis:#58151c;--bs-light-text-emphasis:#495057;--bs-dark-text-emphasis:#495057;--bs-primary-bg-subtle:#cfe2ff;--bs-secondary-bg-subtle:#e2e3e5;--bs-success-bg-subtle:#d1e7dd;--bs-info-bg-subtle:#cff4fc;--bs-warning-bg-subtle:#fff3cd;--bs-danger-bg-subtle:#f8d7da;--bs-light-bg-subtle:#fcfcfd;--bs-dark-bg-subtle:#ced4da;--bs-primary-border-subtle:#9ec5fe;--bs-secondary-border-subtle:#c4c8cb;--bs-success-border-subtle:#a3cfbb;--bs-info-border-subtle:#9eeaf9;--bs-warning-border-subtle:#ffe69c;--bs-danger-border-subtle:#f1aeb5;--bs-light-border-subtle:#e9ecef;--bs-dark-border-subtle:#adb5bd;--bs-white-rgb:255, 255, 255;--bs-black-rgb:0, 0, 0;--bs-font-sans-serif:system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", \"Liberation Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\";--bs-font-monospace:SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;--bs-gradient:linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));--bs-body-font-family:var(--bs-font-sans-serif);--bs-body-font-size:1rem;--bs-body-font-weight:400;--bs-body-line-height:1.5;--bs-body-color:#212529;--bs-body-color-rgb:33, 37, 41;--bs-body-bg:#fff;--bs-body-bg-rgb:255, 255, 255;--bs-emphasis-color:#000;--bs-emphasis-color-rgb:0, 0, 0;--bs-secondary-color:rgba(33, 37, 41, 0.75);--bs-secondary-color-rgb:33, 37, 41;--bs-secondary-bg:#e9ecef;--bs-secondary-bg-rgb:233, 236, 239;--bs-tertiary-color:rgba(33, 37, 41, 0.5);--bs-tertiary-color-rgb:33, 37, 41;--bs-tertiary-bg:#f8f9fa;--bs-tertiary-bg-rgb:248, 249, 250;--bs-heading-color:inherit;--bs-link-color:#0d6efd;--bs-link-color-rgb:13, 110, 253;--bs-link-decoration:underline;--bs-link-hover-color:#0a58ca;--bs-link-hover-color-rgb:10, 88, 202;--bs-code-color:#d63384;--bs-highlight-color:#212529;--bs-highlight-bg:#fff3cd;--bs-border-width:1px;--bs-border-style:solid;--bs-border-color:#dee2e6;--bs-border-color-translucent:rgba(0, 0, 0, 0.175);--bs-border-radius:0.375rem;--bs-border-radius-sm:0.25rem;--bs-border-radius-lg:0.5rem;--bs-border-radius-xl:1rem;--bs-border-radius-xxl:2rem;--bs-border-radius-2xl:var(--bs-border-radius-xxl);--bs-border-radius-pill:50rem;--bs-box-shadow:0 0.5rem 1rem rgba(0, 0, 0, 0.15);--bs-box-shadow-sm:0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);--bs-box-shadow-lg:0 1rem 3rem rgba(0, 0, 0, 0.175);--bs-box-shadow-inset:inset 0 1px 2px rgba(0, 0, 0, 0.075);--bs-focus-ring-width:0.25rem;--bs-focus-ring-opacity:0.25;--bs-focus-ring-color:rgba(13, 110, 253, 0.25);--bs-form-valid-color:#198754;--bs-form-valid-border-color:#198754;--bs-form-invalid-color:#dc3545;--bs-form-invalid-border-color:#dc3545}[data-bs-theme=dark]{color-scheme:dark;--bs-body-color:#dee2e6;--bs-body-color-rgb:222, 226, 230;--bs-body-bg:#212529;--bs-body-bg-rgb:33, 37, 41;--bs-emphasis-color:#fff;--bs-emphasis-color-rgb:255, 255, 255;--bs-secondary-color:rgba(222, 226, 230, 0.75);--bs-secondary-color-rgb:222, 226, 230;--bs-secondary-bg:#343a40;--bs-secondary-bg-rgb:52, 58, 64;--bs-tertiary-color:rgba(222, 226, 230, 0.5);--bs-tertiary-color-rgb:222, 226, 230;--bs-tertiary-bg:#2b3035;--bs-tertiary-bg-rgb:43, 48, 53;--bs-primary-text-emphasis:#6ea8fe;--bs-secondary-text-emphasis:#a7acb1;--bs-success-text-emphasis:#75b798;--bs-info-text-emphasis:#6edff6;--bs-warning-text-emphasis:#ffda6a;--bs-danger-text-emphasis:#ea868f;--bs-light-text-emphasis:#f8f9fa;--bs-dark-text-emphasis:#dee2e6;--bs-primary-bg-subtle:#031633;--bs-secondary-bg-subtle:#161719;--bs-success-bg-subtle:#051b11;--bs-info-bg-subtle:#032830;--bs-warning-bg-subtle:#332701;--bs-danger-bg-subtle:#2c0b0e;--bs-light-bg-subtle:#343a40;--bs-dark-bg-subtle:#1a1d20;--bs-primary-border-subtle:#084298;--bs-secondary-border-subtle:#41464b;--bs-success-border-subtle:#0f5132;--bs-info-border-subtle:#087990;--bs-warning-border-subtle:#997404;--bs-danger-border-subtle:#842029;--bs-light-border-subtle:#495057;--bs-dark-border-subtle:#343a40;--bs-heading-color:inherit;--bs-link-color:#6ea8fe;--bs-link-hover-color:#8bb9fe;--bs-link-color-rgb:110, 168, 254;--bs-link-hover-color-rgb:139, 185, 254;--bs-code-color:#e685b5;--bs-highlight-color:#dee2e6;--bs-highlight-bg:#664d03;--bs-border-color:#495057;--bs-border-color-translucent:rgba(255, 255, 255, 0.15);--bs-form-valid-color:#75b798;--bs-form-valid-border-color:#75b798;--bs-form-invalid-color:#ea868f;--bs-form-invalid-border-color:#ea868f}.spinner-grow,.spinner-border{display:inline-block;width:var(--bs-spinner-width);height:var(--bs-spinner-height);vertical-align:var(--bs-spinner-vertical-align);border-radius:50%;animation:var(--bs-spinner-animation-speed) linear infinite var(--bs-spinner-animation-name)}@keyframes spinner-border{to{transform:rotate(360deg) }}.spinner-border{--bs-spinner-width:2rem;--bs-spinner-height:2rem;--bs-spinner-vertical-align:-0.125em;--bs-spinner-border-width:0.25em;--bs-spinner-animation-speed:0.75s;--bs-spinner-animation-name:spinner-border;border:var(--bs-spinner-border-width) solid currentcolor;border-right-color:transparent}.spinner-border-sm{--bs-spinner-width:1rem;--bs-spinner-height:1rem;--bs-spinner-border-width:0.2em}@keyframes spinner-grow{0%{transform:scale(0)}50%{opacity:1;transform:none}}.spinner-grow{--bs-spinner-width:2rem;--bs-spinner-height:2rem;--bs-spinner-vertical-align:-0.125em;--bs-spinner-animation-speed:0.75s;--bs-spinner-animation-name:spinner-grow;background-color:currentcolor;opacity:0}.spinner-grow-sm{--bs-spinner-width:1rem;--bs-spinner-height:1rem}@media (prefers-reduced-motion: reduce){.spinner-border,.spinner-grow{--bs-spinner-animation-speed:1.5s}}.clearfix::after{display:block;clear:both;content:\"\"}.text-bg-primary{color:#fff !important;background-color:RGBA(var(--bs-primary-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-secondary{color:#fff !important;background-color:RGBA(var(--bs-secondary-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-success{color:#fff !important;background-color:RGBA(var(--bs-success-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-info{color:#000 !important;background-color:RGBA(var(--bs-info-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-warning{color:#000 !important;background-color:RGBA(var(--bs-warning-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-danger{color:#fff !important;background-color:RGBA(var(--bs-danger-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-light{color:#000 !important;background-color:RGBA(var(--bs-light-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-dark{color:#fff !important;background-color:RGBA(var(--bs-dark-rgb), var(--bs-bg-opacity, 1)) !important}.link-primary{color:RGBA(var(--bs-primary-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-primary-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-primary:hover,.link-primary:focus{color:RGBA(10, 88, 202, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(10, 88, 202, var(--bs-link-underline-opacity, 1)) !important}.link-secondary{color:RGBA(var(--bs-secondary-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-secondary-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-secondary:hover,.link-secondary:focus{color:RGBA(86, 94, 100, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(86, 94, 100, var(--bs-link-underline-opacity, 1)) !important}.link-success{color:RGBA(var(--bs-success-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-success-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-success:hover,.link-success:focus{color:RGBA(20, 108, 67, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(20, 108, 67, var(--bs-link-underline-opacity, 1)) !important}.link-info{color:RGBA(var(--bs-info-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-info-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-info:hover,.link-info:focus{color:RGBA(61, 213, 243, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(61, 213, 243, var(--bs-link-underline-opacity, 1)) !important}.link-warning{color:RGBA(var(--bs-warning-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-warning-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-warning:hover,.link-warning:focus{color:RGBA(255, 205, 57, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(255, 205, 57, var(--bs-link-underline-opacity, 1)) !important}.link-danger{color:RGBA(var(--bs-danger-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-danger-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-danger:hover,.link-danger:focus{color:RGBA(176, 42, 55, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(176, 42, 55, var(--bs-link-underline-opacity, 1)) !important}.link-light{color:RGBA(var(--bs-light-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-light-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-light:hover,.link-light:focus{color:RGBA(249, 250, 251, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(249, 250, 251, var(--bs-link-underline-opacity, 1)) !important}.link-dark{color:RGBA(var(--bs-dark-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-dark-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-dark:hover,.link-dark:focus{color:RGBA(26, 30, 33, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(26, 30, 33, var(--bs-link-underline-opacity, 1)) !important}.link-body-emphasis{color:RGBA(var(--bs-emphasis-color-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-emphasis-color-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-body-emphasis:hover,.link-body-emphasis:focus{color:RGBA(var(--bs-emphasis-color-rgb), var(--bs-link-opacity, 0.75)) !important;text-decoration-color:RGBA(var(--bs-emphasis-color-rgb), var(--bs-link-underline-opacity, 0.75)) !important}.focus-ring:focus{outline:0;box-shadow:var(--bs-focus-ring-x, 0) var(--bs-focus-ring-y, 0) var(--bs-focus-ring-blur, 0) var(--bs-focus-ring-width) var(--bs-focus-ring-color)}.icon-link{display:inline-flex;gap:0.375rem;align-items:center;text-decoration-color:rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 0.5));text-underline-offset:0.25em;backface-visibility:hidden}.icon-link>.bi{flex-shrink:0;width:1em;height:1em;fill:currentcolor;transition:0.2s ease-in-out transform}@media (prefers-reduced-motion: reduce){.icon-link>.bi{transition:none}}.icon-link-hover:hover>.bi,.icon-link-hover:focus-visible>.bi{transform:var(--bs-icon-link-transform, translate3d(0.25em, 0, 0))}.ratio{position:relative;width:100%}.ratio::before{display:block;padding-top:var(--bs-aspect-ratio);content:\"\"}.ratio>*{position:absolute;top:0;left:0;width:100%;height:100%}.ratio-1x1{--bs-aspect-ratio:100%}.ratio-4x3{--bs-aspect-ratio:75%}.ratio-16x9{--bs-aspect-ratio:56.25%}.ratio-21x9{--bs-aspect-ratio:42.8571428571%}.fixed-top{position:fixed;top:0;right:0;left:0;z-index:1030}.fixed-bottom{position:fixed;right:0;bottom:0;left:0;z-index:1030}.sticky-top{position:sticky;top:0;z-index:1020}.sticky-bottom{position:sticky;bottom:0;z-index:1020}@media (min-width: 576px){.sticky-sm-top{position:sticky;top:0;z-index:1020}.sticky-sm-bottom{position:sticky;bottom:0;z-index:1020}}@media (min-width: 768px){.sticky-md-top{position:sticky;top:0;z-index:1020}.sticky-md-bottom{position:sticky;bottom:0;z-index:1020}}@media (min-width: 992px){.sticky-lg-top{position:sticky;top:0;z-index:1020}.sticky-lg-bottom{position:sticky;bottom:0;z-index:1020}}@media (min-width: 1200px){.sticky-xl-top{position:sticky;top:0;z-index:1020}.sticky-xl-bottom{position:sticky;bottom:0;z-index:1020}}@media (min-width: 1400px){.sticky-xxl-top{position:sticky;top:0;z-index:1020}.sticky-xxl-bottom{position:sticky;bottom:0;z-index:1020}}.hstack{display:flex;flex-direction:row;align-items:center;align-self:stretch}.vstack{display:flex;flex:1 1 auto;flex-direction:column;align-self:stretch}.visually-hidden,.visually-hidden-focusable:not(:focus):not(:focus-within){width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.visually-hidden:not(caption),.visually-hidden-focusable:not(:focus):not(:focus-within):not(caption){position:absolute !important}.stretched-link::after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;content:\"\"}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vr{display:inline-block;align-self:stretch;width:var(--bs-border-width);min-height:1em;background-color:currentcolor;opacity:0.25}*,*::before,*::after{box-sizing:border-box}@media (prefers-reduced-motion: no-preference){:root{scroll-behavior:smooth}}body{margin:0;font-family:var(--bs-body-font-family);font-size:var(--bs-body-font-size);font-weight:var(--bs-body-font-weight);line-height:var(--bs-body-line-height);color:var(--bs-body-color);text-align:var(--bs-body-text-align);background-color:var(--bs-body-bg);-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0, 0, 0, 0)}hr{margin:1rem 0;color:inherit;border:0;border-top:var(--bs-border-width) solid;opacity:0.25}h6,h5,h4,h3,h2,h1{margin-top:0;margin-bottom:0.5rem;font-weight:500;line-height:1.2;color:var(--bs-heading-color)}h1{font-size:calc(1.375rem + 1.5vw)}@media (min-width: 1200px){h1{font-size:2.5rem}}h2{font-size:calc(1.325rem + 0.9vw)}@media (min-width: 1200px){h2{font-size:2rem}}h3{font-size:calc(1.3rem + 0.6vw)}@media (min-width: 1200px){h3{font-size:1.75rem}}h4{font-size:calc(1.275rem + 0.3vw)}@media (min-width: 1200px){h4{font-size:1.5rem}}h5{font-size:1.25rem}h6{font-size:1rem}p{margin-top:0;margin-bottom:1rem}abbr[title]{text-decoration:underline dotted;cursor:help;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}ol,ul{padding-left:2rem}ol,ul,dl{margin-top:0;margin-bottom:1rem}ol ol,ul ul,ol ul,ul ol{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:0.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:0.875em}mark{padding:0.1875em;color:var(--bs-highlight-color);background-color:var(--bs-highlight-bg)}sub,sup{position:relative;font-size:0.75em;line-height:0;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}a{color:rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1));text-decoration:underline}a:hover{--bs-link-color-rgb:var(--bs-link-hover-color-rgb)}a:not([href]):not([class]),a:not([href]):not([class]):hover{color:inherit;text-decoration:none}pre,code,kbd,samp{font-family:var(--bs-font-monospace);font-size:1em}pre{display:block;margin-top:0;margin-bottom:1rem;overflow:auto;font-size:0.875em}pre code{font-size:inherit;color:inherit;word-break:normal}code{font-size:0.875em;color:var(--bs-code-color);word-wrap:break-word}a>code{color:inherit}kbd{padding:0.1875rem 0.375rem;font-size:0.875em;color:var(--bs-body-bg);background-color:var(--bs-body-color);border-radius:0.25rem}kbd kbd{padding:0;font-size:1em}figure{margin:0 0 1rem}img,svg{vertical-align:middle}table{caption-side:bottom;border-collapse:collapse}caption{padding-top:0.5rem;padding-bottom:0.5rem;color:var(--bs-secondary-color);text-align:left}th{text-align:inherit;text-align:-webkit-match-parent}thead,tbody,tfoot,tr,td,th{border-color:inherit;border-style:solid;border-width:0}label{display:inline-block}button{border-radius:0}button:focus:not(:focus-visible){outline:0}input,button,select,optgroup,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}select:disabled{opacity:1}[list]:not([type=date]):not([type=datetime-local]):not([type=month]):not([type=week]):not([type=time])::-webkit-calendar-picker-indicator{display:none !important}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button:not(:disabled),[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled){cursor:pointer}::-moz-focus-inner{padding:0;border-style:none}textarea{resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{float:left;width:100%;padding:0;margin-bottom:0.5rem;font-size:calc(1.275rem + 0.3vw);line-height:inherit}@media (min-width: 1200px){legend{font-size:1.5rem}}legend+*{clear:left}::-webkit-datetime-edit-fields-wrapper,::-webkit-datetime-edit-text,::-webkit-datetime-edit-minute,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-year-field{padding:0}::-webkit-inner-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-color-swatch-wrapper{padding:0}::file-selector-button{font:inherit;-webkit-appearance:button}output{display:inline-block}iframe{border:0}summary{display:list-item;cursor:pointer}progress{vertical-align:baseline}[hidden]{display:none !important}:root{--bs-breakpoint-xs:0;--bs-breakpoint-sm:576px;--bs-breakpoint-md:768px;--bs-breakpoint-lg:992px;--bs-breakpoint-xl:1200px;--bs-breakpoint-xxl:1400px}.row{--bs-gutter-x:1.5rem;--bs-gutter-y:0;display:flex;flex-wrap:wrap;margin-top:calc(-1 * var(--bs-gutter-y));margin-right:calc(-0.5 * var(--bs-gutter-x));margin-left:calc(-0.5 * var(--bs-gutter-x))}.row>*{flex-shrink:0;width:100%;max-width:100%;padding-right:calc(var(--bs-gutter-x) * 0.5);padding-left:calc(var(--bs-gutter-x) * 0.5);margin-top:var(--bs-gutter-y)}.col{flex:1 0 0%}.row-cols-auto>*{flex:0 0 auto;width:auto}.row-cols-1>*{flex:0 0 auto;width:100%}.row-cols-2>*{flex:0 0 auto;width:50%}.row-cols-3>*{flex:0 0 auto;width:33.33333333%}.row-cols-4>*{flex:0 0 auto;width:25%}.row-cols-5>*{flex:0 0 auto;width:20%}.row-cols-6>*{flex:0 0 auto;width:16.66666667%}.col-auto{flex:0 0 auto;width:auto}.col-1{flex:0 0 auto;width:8.33333333%}.col-2{flex:0 0 auto;width:16.66666667%}.col-3{flex:0 0 auto;width:25%}.col-4{flex:0 0 auto;width:33.33333333%}.col-5{flex:0 0 auto;width:41.66666667%}.col-6{flex:0 0 auto;width:50%}.col-7{flex:0 0 auto;width:58.33333333%}.col-8{flex:0 0 auto;width:66.66666667%}.col-9{flex:0 0 auto;width:75%}.col-10{flex:0 0 auto;width:83.33333333%}.col-11{flex:0 0 auto;width:91.66666667%}.col-12{flex:0 0 auto;width:100%}.offset-1{margin-left:8.33333333%}.offset-2{margin-left:16.66666667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.33333333%}.offset-5{margin-left:41.66666667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.33333333%}.offset-8{margin-left:66.66666667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.33333333%}.offset-11{margin-left:91.66666667%}.g-0,.gx-0{--bs-gutter-x:0}.g-0,.gy-0{--bs-gutter-y:0}.g-1,.gx-1{--bs-gutter-x:0.25rem}.g-1,.gy-1{--bs-gutter-y:0.25rem}.g-2,.gx-2{--bs-gutter-x:0.5rem}.g-2,.gy-2{--bs-gutter-y:0.5rem}.g-3,.gx-3{--bs-gutter-x:1rem}.g-3,.gy-3{--bs-gutter-y:1rem}.g-4,.gx-4{--bs-gutter-x:1.5rem}.g-4,.gy-4{--bs-gutter-y:1.5rem}.g-5,.gx-5{--bs-gutter-x:3rem}.g-5,.gy-5{--bs-gutter-y:3rem}@media (min-width: 576px){.col-sm{flex:1 0 0%}.row-cols-sm-auto>*{flex:0 0 auto;width:auto}.row-cols-sm-1>*{flex:0 0 auto;width:100%}.row-cols-sm-2>*{flex:0 0 auto;width:50%}.row-cols-sm-3>*{flex:0 0 auto;width:33.33333333%}.row-cols-sm-4>*{flex:0 0 auto;width:25%}.row-cols-sm-5>*{flex:0 0 auto;width:20%}.row-cols-sm-6>*{flex:0 0 auto;width:16.66666667%}.col-sm-auto{flex:0 0 auto;width:auto}.col-sm-1{flex:0 0 auto;width:8.33333333%}.col-sm-2{flex:0 0 auto;width:16.66666667%}.col-sm-3{flex:0 0 auto;width:25%}.col-sm-4{flex:0 0 auto;width:33.33333333%}.col-sm-5{flex:0 0 auto;width:41.66666667%}.col-sm-6{flex:0 0 auto;width:50%}.col-sm-7{flex:0 0 auto;width:58.33333333%}.col-sm-8{flex:0 0 auto;width:66.66666667%}.col-sm-9{flex:0 0 auto;width:75%}.col-sm-10{flex:0 0 auto;width:83.33333333%}.col-sm-11{flex:0 0 auto;width:91.66666667%}.col-sm-12{flex:0 0 auto;width:100%}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.33333333%}.offset-sm-2{margin-left:16.66666667%}.offset-sm-3{margin-left:25%}.offset-sm-4{margin-left:33.33333333%}.offset-sm-5{margin-left:41.66666667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.33333333%}.offset-sm-8{margin-left:66.66666667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.33333333%}.offset-sm-11{margin-left:91.66666667%}.g-sm-0,.gx-sm-0{--bs-gutter-x:0}.g-sm-0,.gy-sm-0{--bs-gutter-y:0}.g-sm-1,.gx-sm-1{--bs-gutter-x:0.25rem}.g-sm-1,.gy-sm-1{--bs-gutter-y:0.25rem}.g-sm-2,.gx-sm-2{--bs-gutter-x:0.5rem}.g-sm-2,.gy-sm-2{--bs-gutter-y:0.5rem}.g-sm-3,.gx-sm-3{--bs-gutter-x:1rem}.g-sm-3,.gy-sm-3{--bs-gutter-y:1rem}.g-sm-4,.gx-sm-4{--bs-gutter-x:1.5rem}.g-sm-4,.gy-sm-4{--bs-gutter-y:1.5rem}.g-sm-5,.gx-sm-5{--bs-gutter-x:3rem}.g-sm-5,.gy-sm-5{--bs-gutter-y:3rem}}@media (min-width: 768px){.col-md{flex:1 0 0%}.row-cols-md-auto>*{flex:0 0 auto;width:auto}.row-cols-md-1>*{flex:0 0 auto;width:100%}.row-cols-md-2>*{flex:0 0 auto;width:50%}.row-cols-md-3>*{flex:0 0 auto;width:33.33333333%}.row-cols-md-4>*{flex:0 0 auto;width:25%}.row-cols-md-5>*{flex:0 0 auto;width:20%}.row-cols-md-6>*{flex:0 0 auto;width:16.66666667%}.col-md-auto{flex:0 0 auto;width:auto}.col-md-1{flex:0 0 auto;width:8.33333333%}.col-md-2{flex:0 0 auto;width:16.66666667%}.col-md-3{flex:0 0 auto;width:25%}.col-md-4{flex:0 0 auto;width:33.33333333%}.col-md-5{flex:0 0 auto;width:41.66666667%}.col-md-6{flex:0 0 auto;width:50%}.col-md-7{flex:0 0 auto;width:58.33333333%}.col-md-8{flex:0 0 auto;width:66.66666667%}.col-md-9{flex:0 0 auto;width:75%}.col-md-10{flex:0 0 auto;width:83.33333333%}.col-md-11{flex:0 0 auto;width:91.66666667%}.col-md-12{flex:0 0 auto;width:100%}.offset-md-0{margin-left:0}.offset-md-1{margin-left:8.33333333%}.offset-md-2{margin-left:16.66666667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.33333333%}.offset-md-5{margin-left:41.66666667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.33333333%}.offset-md-8{margin-left:66.66666667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.33333333%}.offset-md-11{margin-left:91.66666667%}.g-md-0,.gx-md-0{--bs-gutter-x:0}.g-md-0,.gy-md-0{--bs-gutter-y:0}.g-md-1,.gx-md-1{--bs-gutter-x:0.25rem}.g-md-1,.gy-md-1{--bs-gutter-y:0.25rem}.g-md-2,.gx-md-2{--bs-gutter-x:0.5rem}.g-md-2,.gy-md-2{--bs-gutter-y:0.5rem}.g-md-3,.gx-md-3{--bs-gutter-x:1rem}.g-md-3,.gy-md-3{--bs-gutter-y:1rem}.g-md-4,.gx-md-4{--bs-gutter-x:1.5rem}.g-md-4,.gy-md-4{--bs-gutter-y:1.5rem}.g-md-5,.gx-md-5{--bs-gutter-x:3rem}.g-md-5,.gy-md-5{--bs-gutter-y:3rem}}@media (min-width: 992px){.col-lg{flex:1 0 0%}.row-cols-lg-auto>*{flex:0 0 auto;width:auto}.row-cols-lg-1>*{flex:0 0 auto;width:100%}.row-cols-lg-2>*{flex:0 0 auto;width:50%}.row-cols-lg-3>*{flex:0 0 auto;width:33.33333333%}.row-cols-lg-4>*{flex:0 0 auto;width:25%}.row-cols-lg-5>*{flex:0 0 auto;width:20%}.row-cols-lg-6>*{flex:0 0 auto;width:16.66666667%}.col-lg-auto{flex:0 0 auto;width:auto}.col-lg-1{flex:0 0 auto;width:8.33333333%}.col-lg-2{flex:0 0 auto;width:16.66666667%}.col-lg-3{flex:0 0 auto;width:25%}.col-lg-4{flex:0 0 auto;width:33.33333333%}.col-lg-5{flex:0 0 auto;width:41.66666667%}.col-lg-6{flex:0 0 auto;width:50%}.col-lg-7{flex:0 0 auto;width:58.33333333%}.col-lg-8{flex:0 0 auto;width:66.66666667%}.col-lg-9{flex:0 0 auto;width:75%}.col-lg-10{flex:0 0 auto;width:83.33333333%}.col-lg-11{flex:0 0 auto;width:91.66666667%}.col-lg-12{flex:0 0 auto;width:100%}.offset-lg-0{margin-left:0}.offset-lg-1{margin-left:8.33333333%}.offset-lg-2{margin-left:16.66666667%}.offset-lg-3{margin-left:25%}.offset-lg-4{margin-left:33.33333333%}.offset-lg-5{margin-left:41.66666667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.33333333%}.offset-lg-8{margin-left:66.66666667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.33333333%}.offset-lg-11{margin-left:91.66666667%}.g-lg-0,.gx-lg-0{--bs-gutter-x:0}.g-lg-0,.gy-lg-0{--bs-gutter-y:0}.g-lg-1,.gx-lg-1{--bs-gutter-x:0.25rem}.g-lg-1,.gy-lg-1{--bs-gutter-y:0.25rem}.g-lg-2,.gx-lg-2{--bs-gutter-x:0.5rem}.g-lg-2,.gy-lg-2{--bs-gutter-y:0.5rem}.g-lg-3,.gx-lg-3{--bs-gutter-x:1rem}.g-lg-3,.gy-lg-3{--bs-gutter-y:1rem}.g-lg-4,.gx-lg-4{--bs-gutter-x:1.5rem}.g-lg-4,.gy-lg-4{--bs-gutter-y:1.5rem}.g-lg-5,.gx-lg-5{--bs-gutter-x:3rem}.g-lg-5,.gy-lg-5{--bs-gutter-y:3rem}}@media (min-width: 1200px){.col-xl{flex:1 0 0%}.row-cols-xl-auto>*{flex:0 0 auto;width:auto}.row-cols-xl-1>*{flex:0 0 auto;width:100%}.row-cols-xl-2>*{flex:0 0 auto;width:50%}.row-cols-xl-3>*{flex:0 0 auto;width:33.33333333%}.row-cols-xl-4>*{flex:0 0 auto;width:25%}.row-cols-xl-5>*{flex:0 0 auto;width:20%}.row-cols-xl-6>*{flex:0 0 auto;width:16.66666667%}.col-xl-auto{flex:0 0 auto;width:auto}.col-xl-1{flex:0 0 auto;width:8.33333333%}.col-xl-2{flex:0 0 auto;width:16.66666667%}.col-xl-3{flex:0 0 auto;width:25%}.col-xl-4{flex:0 0 auto;width:33.33333333%}.col-xl-5{flex:0 0 auto;width:41.66666667%}.col-xl-6{flex:0 0 auto;width:50%}.col-xl-7{flex:0 0 auto;width:58.33333333%}.col-xl-8{flex:0 0 auto;width:66.66666667%}.col-xl-9{flex:0 0 auto;width:75%}.col-xl-10{flex:0 0 auto;width:83.33333333%}.col-xl-11{flex:0 0 auto;width:91.66666667%}.col-xl-12{flex:0 0 auto;width:100%}.offset-xl-0{margin-left:0}.offset-xl-1{margin-left:8.33333333%}.offset-xl-2{margin-left:16.66666667%}.offset-xl-3{margin-left:25%}.offset-xl-4{margin-left:33.33333333%}.offset-xl-5{margin-left:41.66666667%}.offset-xl-6{margin-left:50%}.offset-xl-7{margin-left:58.33333333%}.offset-xl-8{margin-left:66.66666667%}.offset-xl-9{margin-left:75%}.offset-xl-10{margin-left:83.33333333%}.offset-xl-11{margin-left:91.66666667%}.g-xl-0,.gx-xl-0{--bs-gutter-x:0}.g-xl-0,.gy-xl-0{--bs-gutter-y:0}.g-xl-1,.gx-xl-1{--bs-gutter-x:0.25rem}.g-xl-1,.gy-xl-1{--bs-gutter-y:0.25rem}.g-xl-2,.gx-xl-2{--bs-gutter-x:0.5rem}.g-xl-2,.gy-xl-2{--bs-gutter-y:0.5rem}.g-xl-3,.gx-xl-3{--bs-gutter-x:1rem}.g-xl-3,.gy-xl-3{--bs-gutter-y:1rem}.g-xl-4,.gx-xl-4{--bs-gutter-x:1.5rem}.g-xl-4,.gy-xl-4{--bs-gutter-y:1.5rem}.g-xl-5,.gx-xl-5{--bs-gutter-x:3rem}.g-xl-5,.gy-xl-5{--bs-gutter-y:3rem}}@media (min-width: 1400px){.col-xxl{flex:1 0 0%}.row-cols-xxl-auto>*{flex:0 0 auto;width:auto}.row-cols-xxl-1>*{flex:0 0 auto;width:100%}.row-cols-xxl-2>*{flex:0 0 auto;width:50%}.row-cols-xxl-3>*{flex:0 0 auto;width:33.33333333%}.row-cols-xxl-4>*{flex:0 0 auto;width:25%}.row-cols-xxl-5>*{flex:0 0 auto;width:20%}.row-cols-xxl-6>*{flex:0 0 auto;width:16.66666667%}.col-xxl-auto{flex:0 0 auto;width:auto}.col-xxl-1{flex:0 0 auto;width:8.33333333%}.col-xxl-2{flex:0 0 auto;width:16.66666667%}.col-xxl-3{flex:0 0 auto;width:25%}.col-xxl-4{flex:0 0 auto;width:33.33333333%}.col-xxl-5{flex:0 0 auto;width:41.66666667%}.col-xxl-6{flex:0 0 auto;width:50%}.col-xxl-7{flex:0 0 auto;width:58.33333333%}.col-xxl-8{flex:0 0 auto;width:66.66666667%}.col-xxl-9{flex:0 0 auto;width:75%}.col-xxl-10{flex:0 0 auto;width:83.33333333%}.col-xxl-11{flex:0 0 auto;width:91.66666667%}.col-xxl-12{flex:0 0 auto;width:100%}.offset-xxl-0{margin-left:0}.offset-xxl-1{margin-left:8.33333333%}.offset-xxl-2{margin-left:16.66666667%}.offset-xxl-3{margin-left:25%}.offset-xxl-4{margin-left:33.33333333%}.offset-xxl-5{margin-left:41.66666667%}.offset-xxl-6{margin-left:50%}.offset-xxl-7{margin-left:58.33333333%}.offset-xxl-8{margin-left:66.66666667%}.offset-xxl-9{margin-left:75%}.offset-xxl-10{margin-left:83.33333333%}.offset-xxl-11{margin-left:91.66666667%}.g-xxl-0,.gx-xxl-0{--bs-gutter-x:0}.g-xxl-0,.gy-xxl-0{--bs-gutter-y:0}.g-xxl-1,.gx-xxl-1{--bs-gutter-x:0.25rem}.g-xxl-1,.gy-xxl-1{--bs-gutter-y:0.25rem}.g-xxl-2,.gx-xxl-2{--bs-gutter-x:0.5rem}.g-xxl-2,.gy-xxl-2{--bs-gutter-y:0.5rem}.g-xxl-3,.gx-xxl-3{--bs-gutter-x:1rem}.g-xxl-3,.gy-xxl-3{--bs-gutter-y:1rem}.g-xxl-4,.gx-xxl-4{--bs-gutter-x:1.5rem}.g-xxl-4,.gy-xxl-4{--bs-gutter-y:1.5rem}.g-xxl-5,.gx-xxl-5{--bs-gutter-x:3rem}.g-xxl-5,.gy-xxl-5{--bs-gutter-y:3rem}}:host{font-family:system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", \"Liberation Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;display:block}justifi-billing-form{margin-left:calc(var(--jfi-layout-padding) * -1);margin-right:calc(var(--jfi-layout-padding) * -1)}*::part(label){color:var(--jfi-form-label-color);font-family:var(--jfi-form-label-font-family);font-weight:var(--jfi-form-label-font-weight);font-size:var(--jfi-form-label-font-size);margin:var(--jfi-form-label-margin)}*::part(input){background-color:var(--jfi-form-control-background-color);border-color:var(--jfi-form-control-border-color);border-width:var(--jfi-form-control-border-width);border-bottom-width:var(--jfi-form-control-border-bottom-width);border-left-width:var(--jfi-form-control-border-left-width);border-right-width:var(--jfi-form-control-border-right-width);border-top-width:var(--jfi-form-control-border-top-width);border-radius:var(--jfi-form-control-border-radius);border-style:var(--jfi-form-control-border-style);box-shadow:var(--jfi-form-control-box-shadow);color:var(--jfi-form-control-color);font-size:var(--jfi-form-control-font-size);font-weight:var(--jfi-form-control-font-weight);line-height:var(--jfi-form-control-line-height);margin:var(--jfi-form-control-margin);padding:var(--jfi-form-control-padding)}*::part(input):focus{color:var(--jfi-form-control-color-focus);border-color:var(--jfi-form-control-border-color-focus);box-shadow:var(--jfi-form-control-box-shadow-focus)}*::part(input-invalid){border-color:var(--jfi-form-control-border-color-error);box-shadow:var(--jfi-form-control-box-shadow-error)}*::part(input-invalid):focus{border-color:var(--jfi-form-control-border-color-error);box-shadow:var(--jfi-form-control-box-shadow-error-focus)}";
20
+
21
+ const BillingForm = class {
22
+ constructor(hostRef) {
23
+ registerInstance(this, hostRef);
24
+ this.inputHandler = (name, value) => {
25
+ this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { [name]: value }));
26
+ };
27
+ this.legend = undefined;
28
+ this.formController = undefined;
29
+ this.billingInfo = undefined;
30
+ this.errors = {};
31
+ }
32
+ componentWillLoad() {
33
+ this.formController = new FormController(BillingFormSchema);
34
+ }
35
+ componentDidLoad() {
36
+ this.formController.values.subscribe(values => this.billingInfo = Object.assign({}, values));
37
+ this.formController.errors.subscribe(errors => {
38
+ this.errors = Object.assign({}, errors);
39
+ });
40
+ }
41
+ async getValues() {
42
+ return this.formController.values.getValue();
43
+ }
44
+ async fill(fields) {
45
+ this.formController.setValues(fields);
46
+ }
47
+ async validate() {
48
+ let isValid = await this.formController.validate();
49
+ return { isValid: isValid };
50
+ }
51
+ render() {
52
+ const billingFormDefaultValue = this.formController.getInitialValues();
53
+ return (h(Host, { exportparts: "label,input,input-invalid" }, h("form", null, h("fieldset", null, this.legend && h("legend", null, this.legend), h("div", { class: "row gy-3" }, h("div", { class: "col-12" }, h("form-control-text", { name: 'name', label: 'Full Name', defaultValue: billingFormDefaultValue.name, error: this.errors.name, inputHandler: this.inputHandler })), h("div", { class: "col-12" }, h("form-control-text", { name: 'address_line1', label: 'Street Address', defaultValue: billingFormDefaultValue.address_line1, error: this.errors.address_line1, inputHandler: this.inputHandler })), h("div", { class: "col-12" }, h("form-control-text", { name: 'address_line2', label: "Apartment, Suite, etc. (optional)", defaultValue: billingFormDefaultValue.address_line2, error: this.errors.address_line2, inputHandler: this.inputHandler })), h("div", { class: "col-12" }, h("form-control-text", { name: 'address_city', label: "City", defaultValue: billingFormDefaultValue.address_city, error: this.errors.address_city, inputHandler: this.inputHandler })), h("div", { class: "col-12" }, h("form-control-select", { name: 'address_state', label: 'State', options: StateOptions, defaultValue: billingFormDefaultValue.address_state, error: this.errors.address_state, inputHandler: this.inputHandler })), h("div", { class: "col-12" }, h("form-control-text", { name: 'address_postal_code', label: "ZIP", defaultValue: billingFormDefaultValue.address_postal_code, error: this.errors.address_postal_code, inputHandler: this.inputHandler, maxLength: 5, keyDownHandler: filterPostalInput })))))));
54
+ }
55
+ };
56
+ BillingForm.style = billingFormCss;
57
+
58
+ function createCommonjsModule(fn, basedir, module) {
59
+ return module = {
60
+ path: basedir,
61
+ exports: {},
62
+ require: function (path, base) {
63
+ return commonjsRequire();
64
+ }
65
+ }, fn(module, module.exports), module.exports;
66
+ }
67
+
68
+ function commonjsRequire () {
69
+ throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
70
+ }
71
+
72
+ var iframeResizer = createCommonjsModule(function (module) {
73
+ (function (undefined$1) {
74
+ if (typeof window === 'undefined') return // don't run for server side render
75
+
76
+ var count = 0,
77
+ logEnabled = false,
78
+ hiddenCheckEnabled = false,
79
+ msgHeader = 'message',
80
+ msgHeaderLen = msgHeader.length,
81
+ msgId = '[iFrameSizer]', // Must match iframe msg ID
82
+ msgIdLen = msgId.length,
83
+ pagePosition = null,
84
+ requestAnimationFrame = window.requestAnimationFrame,
85
+ resetRequiredMethods = Object.freeze({
86
+ max: 1,
87
+ scroll: 1,
88
+ bodyScroll: 1,
89
+ documentElementScroll: 1
90
+ }),
91
+ settings = {},
92
+ timer = null,
93
+ defaults = Object.freeze({
94
+ autoResize: true,
95
+ bodyBackground: null,
96
+ bodyMargin: null,
97
+ bodyMarginV1: 8,
98
+ bodyPadding: null,
99
+ checkOrigin: true,
100
+ inPageLinks: false,
101
+ enablePublicMethods: true,
102
+ heightCalculationMethod: 'bodyOffset',
103
+ id: 'iFrameResizer',
104
+ interval: 32,
105
+ log: false,
106
+ maxHeight: Infinity,
107
+ maxWidth: Infinity,
108
+ minHeight: 0,
109
+ minWidth: 0,
110
+ mouseEvents: true,
111
+ resizeFrom: 'parent',
112
+ scrolling: false,
113
+ sizeHeight: true,
114
+ sizeWidth: false,
115
+ warningTimeout: 5000,
116
+ tolerance: 0,
117
+ widthCalculationMethod: 'scroll',
118
+ onClose: function () {
119
+ return true
120
+ },
121
+ onClosed: function () {},
122
+ onInit: function () {},
123
+ onMessage: function () {
124
+ warn('onMessage function not defined');
125
+ },
126
+ onMouseEnter: function () {},
127
+ onMouseLeave: function () {},
128
+ onResized: function () {},
129
+ onScroll: function () {
130
+ return true
131
+ }
132
+ });
133
+
134
+ function getMutationObserver() {
135
+ return (
136
+ window.MutationObserver ||
137
+ window.WebKitMutationObserver ||
138
+ window.MozMutationObserver
139
+ )
140
+ }
141
+
142
+ function addEventListener(el, evt, func) {
143
+ el.addEventListener(evt, func, false);
144
+ }
145
+
146
+ function removeEventListener(el, evt, func) {
147
+ el.removeEventListener(evt, func, false);
148
+ }
149
+
150
+ function setupRequestAnimationFrame() {
151
+ var vendors = ['moz', 'webkit', 'o', 'ms'];
152
+ var x;
153
+
154
+ // Remove vendor prefixing if prefixed and break early if not
155
+ for (x = 0; x < vendors.length && !requestAnimationFrame; x += 1) {
156
+ requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
157
+ }
158
+
159
+ if (requestAnimationFrame) {
160
+ // Firefox extension content-scripts have a globalThis object that is not the same as window.
161
+ // Binding `requestAnimationFrame` to window allows the function to work and prevents errors
162
+ // being thrown when run in that context, and should be a no-op in every other context.
163
+ requestAnimationFrame = requestAnimationFrame.bind(window);
164
+ } else {
165
+ log('setup', 'RequestAnimationFrame not supported');
166
+ }
167
+ }
168
+
169
+ function getMyID(iframeId) {
170
+ var retStr = 'Host page: ' + iframeId;
171
+
172
+ if (window.top !== window.self) {
173
+ retStr =
174
+ window.parentIFrame && window.parentIFrame.getId
175
+ ? window.parentIFrame.getId() + ': ' + iframeId
176
+ : 'Nested host page: ' + iframeId;
177
+ }
178
+
179
+ return retStr
180
+ }
181
+
182
+ function formatLogHeader(iframeId) {
183
+ return msgId + '[' + getMyID(iframeId) + ']'
184
+ }
185
+
186
+ function isLogEnabled(iframeId) {
187
+ return settings[iframeId] ? settings[iframeId].log : logEnabled
188
+ }
189
+
190
+ function log(iframeId, msg) {
191
+ output('log', iframeId, msg, isLogEnabled(iframeId));
192
+ }
193
+
194
+ function info(iframeId, msg) {
195
+ output('info', iframeId, msg, isLogEnabled(iframeId));
196
+ }
197
+
198
+ function warn(iframeId, msg) {
199
+ output('warn', iframeId, msg, true);
200
+ }
201
+
202
+ function output(type, iframeId, msg, enabled) {
203
+ if (true === enabled && 'object' === typeof window.console) {
204
+ // eslint-disable-next-line no-console
205
+ console[type](formatLogHeader(iframeId), msg);
206
+ }
207
+ }
208
+
209
+ function iFrameListener(event) {
210
+ function resizeIFrame() {
211
+ function resize() {
212
+ setSize(messageData);
213
+ setPagePosition(iframeId);
214
+ on('onResized', messageData);
215
+ }
216
+
217
+ ensureInRange('Height');
218
+ ensureInRange('Width');
219
+
220
+ syncResize(resize, messageData, 'init');
221
+ }
222
+
223
+ function processMsg() {
224
+ var data = msg.slice(msgIdLen).split(':');
225
+ var height = data[1] ? parseInt(data[1], 10) : 0;
226
+ var iframe = settings[data[0]] && settings[data[0]].iframe;
227
+ var compStyle = getComputedStyle(iframe);
228
+
229
+ return {
230
+ iframe: iframe,
231
+ id: data[0],
232
+ height: height + getPaddingEnds(compStyle) + getBorderEnds(compStyle),
233
+ width: data[2],
234
+ type: data[3]
235
+ }
236
+ }
237
+
238
+ function getPaddingEnds(compStyle) {
239
+ if (compStyle.boxSizing !== 'border-box') {
240
+ return 0
241
+ }
242
+ var top = compStyle.paddingTop ? parseInt(compStyle.paddingTop, 10) : 0;
243
+ var bot = compStyle.paddingBottom
244
+ ? parseInt(compStyle.paddingBottom, 10)
245
+ : 0;
246
+ return top + bot
247
+ }
248
+
249
+ function getBorderEnds(compStyle) {
250
+ if (compStyle.boxSizing !== 'border-box') {
251
+ return 0
252
+ }
253
+ var top = compStyle.borderTopWidth
254
+ ? parseInt(compStyle.borderTopWidth, 10)
255
+ : 0;
256
+ var bot = compStyle.borderBottomWidth
257
+ ? parseInt(compStyle.borderBottomWidth, 10)
258
+ : 0;
259
+ return top + bot
260
+ }
261
+
262
+ function ensureInRange(Dimension) {
263
+ var max = Number(settings[iframeId]['max' + Dimension]),
264
+ min = Number(settings[iframeId]['min' + Dimension]),
265
+ dimension = Dimension.toLowerCase(),
266
+ size = Number(messageData[dimension]);
267
+
268
+ log(iframeId, 'Checking ' + dimension + ' is in range ' + min + '-' + max);
269
+
270
+ if (size < min) {
271
+ size = min;
272
+ log(iframeId, 'Set ' + dimension + ' to min value');
273
+ }
274
+
275
+ if (size > max) {
276
+ size = max;
277
+ log(iframeId, 'Set ' + dimension + ' to max value');
278
+ }
279
+
280
+ messageData[dimension] = '' + size;
281
+ }
282
+
283
+ function isMessageFromIFrame() {
284
+ function checkAllowedOrigin() {
285
+ function checkList() {
286
+ var i = 0,
287
+ retCode = false;
288
+
289
+ log(
290
+ iframeId,
291
+ 'Checking connection is from allowed list of origins: ' +
292
+ checkOrigin
293
+ );
294
+
295
+ for (; i < checkOrigin.length; i++) {
296
+ if (checkOrigin[i] === origin) {
297
+ retCode = true;
298
+ break
299
+ }
300
+ }
301
+ return retCode
302
+ }
303
+
304
+ function checkSingle() {
305
+ var remoteHost = settings[iframeId] && settings[iframeId].remoteHost;
306
+ log(iframeId, 'Checking connection is from: ' + remoteHost);
307
+ return origin === remoteHost
308
+ }
309
+
310
+ return checkOrigin.constructor === Array ? checkList() : checkSingle()
311
+ }
312
+
313
+ var origin = event.origin,
314
+ checkOrigin = settings[iframeId] && settings[iframeId].checkOrigin;
315
+
316
+ if (checkOrigin && '' + origin !== 'null' && !checkAllowedOrigin()) {
317
+ throw new Error(
318
+ 'Unexpected message received from: ' +
319
+ origin +
320
+ ' for ' +
321
+ messageData.iframe.id +
322
+ '. Message was: ' +
323
+ event.data +
324
+ '. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.'
325
+ )
326
+ }
327
+
328
+ return true
329
+ }
330
+
331
+ function isMessageForUs() {
332
+ return (
333
+ msgId === ('' + msg).slice(0, msgIdLen) &&
334
+ msg.slice(msgIdLen).split(':')[0] in settings
335
+ ) // ''+Protects against non-string msg
336
+ }
337
+
338
+ function isMessageFromMetaParent() {
339
+ // Test if this message is from a parent above us. This is an ugly test, however, updating
340
+ // the message format would break backwards compatibility.
341
+ var retCode = messageData.type in { true: 1, false: 1, undefined: 1 };
342
+
343
+ if (retCode) {
344
+ log(iframeId, 'Ignoring init message from meta parent page');
345
+ }
346
+
347
+ return retCode
348
+ }
349
+
350
+ function getMsgBody(offset) {
351
+ return msg.slice(msg.indexOf(':') + msgHeaderLen + offset)
352
+ }
353
+
354
+ function forwardMsgFromIFrame(msgBody) {
355
+ log(
356
+ iframeId,
357
+ 'onMessage passed: {iframe: ' +
358
+ messageData.iframe.id +
359
+ ', message: ' +
360
+ msgBody +
361
+ '}'
362
+ );
363
+
364
+ on('onMessage', {
365
+ iframe: messageData.iframe,
366
+ message: JSON.parse(msgBody)
367
+ });
368
+
369
+ log(iframeId, '--');
370
+ }
371
+
372
+ function getPageInfo() {
373
+ var bodyPosition = document.body.getBoundingClientRect(),
374
+ iFramePosition = messageData.iframe.getBoundingClientRect();
375
+
376
+ return JSON.stringify({
377
+ iframeHeight: iFramePosition.height,
378
+ iframeWidth: iFramePosition.width,
379
+ clientHeight: Math.max(
380
+ document.documentElement.clientHeight,
381
+ window.innerHeight || 0
382
+ ),
383
+ clientWidth: Math.max(
384
+ document.documentElement.clientWidth,
385
+ window.innerWidth || 0
386
+ ),
387
+ offsetTop: parseInt(iFramePosition.top - bodyPosition.top, 10),
388
+ offsetLeft: parseInt(iFramePosition.left - bodyPosition.left, 10),
389
+ scrollTop: window.pageYOffset,
390
+ scrollLeft: window.pageXOffset,
391
+ documentHeight: document.documentElement.clientHeight,
392
+ documentWidth: document.documentElement.clientWidth,
393
+ windowHeight: window.innerHeight,
394
+ windowWidth: window.innerWidth
395
+ })
396
+ }
397
+
398
+ function sendPageInfoToIframe(iframe, iframeId) {
399
+ function debouncedTrigger() {
400
+ trigger('Send Page Info', 'pageInfo:' + getPageInfo(), iframe, iframeId);
401
+ }
402
+ debounceFrameEvents(debouncedTrigger, 32, iframeId);
403
+ }
404
+
405
+ function startPageInfoMonitor() {
406
+ function setListener(type, func) {
407
+ function sendPageInfo() {
408
+ if (settings[id]) {
409
+ sendPageInfoToIframe(settings[id].iframe, id);
410
+ } else {
411
+ stop();
412
+ }
413
+ }
414
+ ['scroll', 'resize'].forEach(function (evt) {
415
+ log(id, type + evt + ' listener for sendPageInfo');
416
+ func(window, evt, sendPageInfo);
417
+ });
418
+ }
419
+
420
+ function stop() {
421
+ setListener('Remove ', removeEventListener);
422
+ }
423
+
424
+ function start() {
425
+ setListener('Add ', addEventListener);
426
+ }
427
+
428
+ var id = iframeId; // Create locally scoped copy of iFrame ID
429
+
430
+ start();
431
+
432
+ if (settings[id]) {
433
+ settings[id].stopPageInfo = stop;
434
+ }
435
+ }
436
+
437
+ function stopPageInfoMonitor() {
438
+ if (settings[iframeId] && settings[iframeId].stopPageInfo) {
439
+ settings[iframeId].stopPageInfo();
440
+ delete settings[iframeId].stopPageInfo;
441
+ }
442
+ }
443
+
444
+ function checkIFrameExists() {
445
+ var retBool = true;
446
+
447
+ if (null === messageData.iframe) {
448
+ warn(iframeId, 'IFrame (' + messageData.id + ') not found');
449
+ retBool = false;
450
+ }
451
+ return retBool
452
+ }
453
+
454
+ function getElementPosition(target) {
455
+ var iFramePosition = target.getBoundingClientRect();
456
+
457
+ getPagePosition(iframeId);
458
+
459
+ return {
460
+ x: Math.floor(Number(iFramePosition.left) + Number(pagePosition.x)),
461
+ y: Math.floor(Number(iFramePosition.top) + Number(pagePosition.y))
462
+ }
463
+ }
464
+
465
+ function scrollRequestFromChild(addOffset) {
466
+ /* istanbul ignore next */ // Not testable in Karma
467
+ function reposition() {
468
+ pagePosition = newPosition;
469
+ scrollTo();
470
+ log(iframeId, '--');
471
+ }
472
+
473
+ function calcOffset() {
474
+ return {
475
+ x: Number(messageData.width) + offset.x,
476
+ y: Number(messageData.height) + offset.y
477
+ }
478
+ }
479
+
480
+ function scrollParent() {
481
+ if (window.parentIFrame) {
482
+ window.parentIFrame['scrollTo' + (addOffset ? 'Offset' : '')](
483
+ newPosition.x,
484
+ newPosition.y
485
+ );
486
+ } else {
487
+ warn(
488
+ iframeId,
489
+ 'Unable to scroll to requested position, window.parentIFrame not found'
490
+ );
491
+ }
492
+ }
493
+
494
+ var offset = addOffset
495
+ ? getElementPosition(messageData.iframe)
496
+ : { x: 0, y: 0 },
497
+ newPosition = calcOffset();
498
+
499
+ log(
500
+ iframeId,
501
+ 'Reposition requested from iFrame (offset x:' +
502
+ offset.x +
503
+ ' y:' +
504
+ offset.y +
505
+ ')'
506
+ );
507
+
508
+ if (window.top === window.self) {
509
+ reposition();
510
+ } else {
511
+ scrollParent();
512
+ }
513
+ }
514
+
515
+ function scrollTo() {
516
+ if (false === on('onScroll', pagePosition)) {
517
+ unsetPagePosition();
518
+ } else {
519
+ setPagePosition(iframeId);
520
+ }
521
+ }
522
+
523
+ function findTarget(location) {
524
+ function jumpToTarget() {
525
+ var jumpPosition = getElementPosition(target);
526
+
527
+ log(
528
+ iframeId,
529
+ 'Moving to in page link (#' +
530
+ hash +
531
+ ') at x: ' +
532
+ jumpPosition.x +
533
+ ' y: ' +
534
+ jumpPosition.y
535
+ );
536
+ pagePosition = {
537
+ x: jumpPosition.x,
538
+ y: jumpPosition.y
539
+ };
540
+
541
+ scrollTo();
542
+ log(iframeId, '--');
543
+ }
544
+
545
+ function jumpToParent() {
546
+ if (window.parentIFrame) {
547
+ window.parentIFrame.moveToAnchor(hash);
548
+ } else {
549
+ log(
550
+ iframeId,
551
+ 'In page link #' +
552
+ hash +
553
+ ' not found and window.parentIFrame not found'
554
+ );
555
+ }
556
+ }
557
+
558
+ var hash = location.split('#')[1] || '',
559
+ hashData = decodeURIComponent(hash),
560
+ target =
561
+ document.getElementById(hashData) ||
562
+ document.getElementsByName(hashData)[0];
563
+
564
+ if (target) {
565
+ jumpToTarget();
566
+ } else if (window.top === window.self) {
567
+ log(iframeId, 'In page link #' + hash + ' not found');
568
+ } else {
569
+ jumpToParent();
570
+ }
571
+ }
572
+
573
+ function onMouse(event) {
574
+ var mousePos = {};
575
+
576
+ if (Number(messageData.width) === 0 && Number(messageData.height) === 0) {
577
+ var data = getMsgBody(9).split(':');
578
+ mousePos = {
579
+ x: data[1],
580
+ y: data[0]
581
+ };
582
+ } else {
583
+ mousePos = {
584
+ x: messageData.width,
585
+ y: messageData.height
586
+ };
587
+ }
588
+
589
+ on(event, {
590
+ iframe: messageData.iframe,
591
+ screenX: Number(mousePos.x),
592
+ screenY: Number(mousePos.y),
593
+ type: messageData.type
594
+ });
595
+ }
596
+
597
+ function on(funcName, val) {
598
+ return chkEvent(iframeId, funcName, val)
599
+ }
600
+
601
+ function actionMsg() {
602
+ if (settings[iframeId] && settings[iframeId].firstRun) firstRun();
603
+
604
+ switch (messageData.type) {
605
+ case 'close': {
606
+ closeIFrame(messageData.iframe);
607
+ break
608
+ }
609
+
610
+ case 'message': {
611
+ forwardMsgFromIFrame(getMsgBody(6));
612
+ break
613
+ }
614
+
615
+ case 'mouseenter': {
616
+ onMouse('onMouseEnter');
617
+ break
618
+ }
619
+
620
+ case 'mouseleave': {
621
+ onMouse('onMouseLeave');
622
+ break
623
+ }
624
+
625
+ case 'autoResize': {
626
+ settings[iframeId].autoResize = JSON.parse(getMsgBody(9));
627
+ break
628
+ }
629
+
630
+ case 'scrollTo': {
631
+ scrollRequestFromChild(false);
632
+ break
633
+ }
634
+
635
+ case 'scrollToOffset': {
636
+ scrollRequestFromChild(true);
637
+ break
638
+ }
639
+
640
+ case 'pageInfo': {
641
+ sendPageInfoToIframe(
642
+ settings[iframeId] && settings[iframeId].iframe,
643
+ iframeId
644
+ );
645
+ startPageInfoMonitor();
646
+ break
647
+ }
648
+
649
+ case 'pageInfoStop': {
650
+ stopPageInfoMonitor();
651
+ break
652
+ }
653
+
654
+ case 'inPageLink': {
655
+ findTarget(getMsgBody(9));
656
+ break
657
+ }
658
+
659
+ case 'reset': {
660
+ resetIFrame(messageData);
661
+ break
662
+ }
663
+
664
+ case 'init': {
665
+ resizeIFrame();
666
+ on('onInit', messageData.iframe);
667
+ break
668
+ }
669
+
670
+ default: {
671
+ if (
672
+ Number(messageData.width) === 0 &&
673
+ Number(messageData.height) === 0
674
+ ) {
675
+ warn(
676
+ 'Unsupported message received (' +
677
+ messageData.type +
678
+ '), this is likely due to the iframe containing a later ' +
679
+ 'version of iframe-resizer than the parent page'
680
+ );
681
+ } else {
682
+ resizeIFrame();
683
+ }
684
+ }
685
+ }
686
+ }
687
+
688
+ function hasSettings(iframeId) {
689
+ var retBool = true;
690
+
691
+ if (!settings[iframeId]) {
692
+ retBool = false;
693
+ warn(
694
+ messageData.type +
695
+ ' No settings for ' +
696
+ iframeId +
697
+ '. Message was: ' +
698
+ msg
699
+ );
700
+ }
701
+
702
+ return retBool
703
+ }
704
+
705
+ function iFrameReadyMsgReceived() {
706
+ // eslint-disable-next-line no-restricted-syntax, guard-for-in
707
+ for (var iframeId in settings) {
708
+ trigger(
709
+ 'iFrame requested init',
710
+ createOutgoingMsg(iframeId),
711
+ settings[iframeId].iframe,
712
+ iframeId
713
+ );
714
+ }
715
+ }
716
+
717
+ function firstRun() {
718
+ if (settings[iframeId]) {
719
+ settings[iframeId].firstRun = false;
720
+ }
721
+ }
722
+
723
+ var msg = event.data,
724
+ messageData = {},
725
+ iframeId = null;
726
+
727
+ if ('[iFrameResizerChild]Ready' === msg) {
728
+ iFrameReadyMsgReceived();
729
+ } else if (isMessageForUs()) {
730
+ messageData = processMsg();
731
+ iframeId = messageData.id;
732
+ if (settings[iframeId]) {
733
+ settings[iframeId].loaded = true;
734
+ }
735
+
736
+ if (!isMessageFromMetaParent() && hasSettings(iframeId)) {
737
+ log(iframeId, 'Received: ' + msg);
738
+
739
+ if (checkIFrameExists() && isMessageFromIFrame()) {
740
+ actionMsg();
741
+ }
742
+ }
743
+ } else {
744
+ info(iframeId, 'Ignored: ' + msg);
745
+ }
746
+ }
747
+
748
+ function chkEvent(iframeId, funcName, val) {
749
+ var func = null,
750
+ retVal = null;
751
+
752
+ if (settings[iframeId]) {
753
+ func = settings[iframeId][funcName];
754
+
755
+ if ('function' === typeof func) {
756
+ retVal = func(val);
757
+ } else {
758
+ throw new TypeError(
759
+ funcName + ' on iFrame[' + iframeId + '] is not a function'
760
+ )
761
+ }
762
+ }
763
+
764
+ return retVal
765
+ }
766
+
767
+ function removeIframeListeners(iframe) {
768
+ var iframeId = iframe.id;
769
+ delete settings[iframeId];
770
+ }
771
+
772
+ function closeIFrame(iframe) {
773
+ var iframeId = iframe.id;
774
+ if (chkEvent(iframeId, 'onClose', iframeId) === false) {
775
+ log(iframeId, 'Close iframe cancelled by onClose event');
776
+ return
777
+ }
778
+ log(iframeId, 'Removing iFrame: ' + iframeId);
779
+
780
+ try {
781
+ // Catch race condition error with React
782
+ if (iframe.parentNode) {
783
+ iframe.parentNode.removeChild(iframe);
784
+ }
785
+ } catch (error) {
786
+ warn(error);
787
+ }
788
+
789
+ chkEvent(iframeId, 'onClosed', iframeId);
790
+ log(iframeId, '--');
791
+ removeIframeListeners(iframe);
792
+ }
793
+
794
+ function getPagePosition(iframeId) {
795
+ if (null === pagePosition) {
796
+ pagePosition = {
797
+ x:
798
+ window.pageXOffset === undefined$1
799
+ ? document.documentElement.scrollLeft
800
+ : window.pageXOffset,
801
+ y:
802
+ window.pageYOffset === undefined$1
803
+ ? document.documentElement.scrollTop
804
+ : window.pageYOffset
805
+ };
806
+ log(
807
+ iframeId,
808
+ 'Get page position: ' + pagePosition.x + ',' + pagePosition.y
809
+ );
810
+ }
811
+ }
812
+
813
+ function setPagePosition(iframeId) {
814
+ if (null !== pagePosition) {
815
+ window.scrollTo(pagePosition.x, pagePosition.y);
816
+ log(
817
+ iframeId,
818
+ 'Set page position: ' + pagePosition.x + ',' + pagePosition.y
819
+ );
820
+ unsetPagePosition();
821
+ }
822
+ }
823
+
824
+ function unsetPagePosition() {
825
+ pagePosition = null;
826
+ }
827
+
828
+ function resetIFrame(messageData) {
829
+ function reset() {
830
+ setSize(messageData);
831
+ trigger('reset', 'reset', messageData.iframe, messageData.id);
832
+ }
833
+
834
+ log(
835
+ messageData.id,
836
+ 'Size reset requested by ' +
837
+ ('init' === messageData.type ? 'host page' : 'iFrame')
838
+ );
839
+ getPagePosition(messageData.id);
840
+ syncResize(reset, messageData, 'reset');
841
+ }
842
+
843
+ function setSize(messageData) {
844
+ function setDimension(dimension) {
845
+ if (!messageData.id) {
846
+ log('undefined', 'messageData id not set');
847
+ return
848
+ }
849
+ messageData.iframe.style[dimension] = messageData[dimension] + 'px';
850
+ log(
851
+ messageData.id,
852
+ 'IFrame (' +
853
+ iframeId +
854
+ ') ' +
855
+ dimension +
856
+ ' set to ' +
857
+ messageData[dimension] +
858
+ 'px'
859
+ );
860
+ }
861
+
862
+ function chkZero(dimension) {
863
+ // FireFox sets dimension of hidden iFrames to zero.
864
+ // So if we detect that set up an event to check for
865
+ // when iFrame becomes visible.
866
+
867
+ /* istanbul ignore next */ // Not testable in PhantomJS
868
+ if (!hiddenCheckEnabled && '0' === messageData[dimension]) {
869
+ hiddenCheckEnabled = true;
870
+ log(iframeId, 'Hidden iFrame detected, creating visibility listener');
871
+ fixHiddenIFrames();
872
+ }
873
+ }
874
+
875
+ function processDimension(dimension) {
876
+ setDimension(dimension);
877
+ chkZero(dimension);
878
+ }
879
+
880
+ var iframeId = messageData.iframe.id;
881
+
882
+ if (settings[iframeId]) {
883
+ if (settings[iframeId].sizeHeight) {
884
+ processDimension('height');
885
+ }
886
+ if (settings[iframeId].sizeWidth) {
887
+ processDimension('width');
888
+ }
889
+ }
890
+ }
891
+
892
+ function syncResize(func, messageData, doNotSync) {
893
+ /* istanbul ignore if */ // Not testable in PhantomJS
894
+ if (
895
+ doNotSync !== messageData.type &&
896
+ requestAnimationFrame &&
897
+ // including check for jasmine because had trouble getting spy to work in unit test using requestAnimationFrame
898
+ !window.jasmine
899
+ ) {
900
+ log(messageData.id, 'Requesting animation frame');
901
+ requestAnimationFrame(func);
902
+ } else {
903
+ func();
904
+ }
905
+ }
906
+
907
+ function trigger(calleeMsg, msg, iframe, id, noResponseWarning) {
908
+ function postMessageToIFrame() {
909
+ var target = settings[id] && settings[id].targetOrigin;
910
+ log(
911
+ id,
912
+ '[' +
913
+ calleeMsg +
914
+ '] Sending msg to iframe[' +
915
+ id +
916
+ '] (' +
917
+ msg +
918
+ ') targetOrigin: ' +
919
+ target
920
+ );
921
+ iframe.contentWindow.postMessage(msgId + msg, target);
922
+ }
923
+
924
+ function iFrameNotFound() {
925
+ warn(id, '[' + calleeMsg + '] IFrame(' + id + ') not found');
926
+ }
927
+
928
+ function chkAndSend() {
929
+ if (
930
+ iframe &&
931
+ 'contentWindow' in iframe &&
932
+ null !== iframe.contentWindow
933
+ ) {
934
+ // Null test for PhantomJS
935
+ postMessageToIFrame();
936
+ } else {
937
+ iFrameNotFound();
938
+ }
939
+ }
940
+
941
+ function warnOnNoResponse() {
942
+ function warning() {
943
+ if (settings[id] && !settings[id].loaded && !errorShown) {
944
+ errorShown = true;
945
+ warn(
946
+ id,
947
+ 'IFrame has not responded within ' +
948
+ settings[id].warningTimeout / 1000 +
949
+ ' seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning.'
950
+ );
951
+ }
952
+ }
953
+
954
+ if (
955
+ !!noResponseWarning &&
956
+ settings[id] &&
957
+ !!settings[id].warningTimeout
958
+ ) {
959
+ settings[id].msgTimeout = setTimeout(
960
+ warning,
961
+ settings[id].warningTimeout
962
+ );
963
+ }
964
+ }
965
+
966
+ var errorShown = false;
967
+
968
+ id = id || iframe.id;
969
+
970
+ if (settings[id]) {
971
+ chkAndSend();
972
+ warnOnNoResponse();
973
+ }
974
+ }
975
+
976
+ function createOutgoingMsg(iframeId) {
977
+ return (
978
+ iframeId +
979
+ ':' +
980
+ settings[iframeId].bodyMarginV1 +
981
+ ':' +
982
+ settings[iframeId].sizeWidth +
983
+ ':' +
984
+ settings[iframeId].log +
985
+ ':' +
986
+ settings[iframeId].interval +
987
+ ':' +
988
+ settings[iframeId].enablePublicMethods +
989
+ ':' +
990
+ settings[iframeId].autoResize +
991
+ ':' +
992
+ settings[iframeId].bodyMargin +
993
+ ':' +
994
+ settings[iframeId].heightCalculationMethod +
995
+ ':' +
996
+ settings[iframeId].bodyBackground +
997
+ ':' +
998
+ settings[iframeId].bodyPadding +
999
+ ':' +
1000
+ settings[iframeId].tolerance +
1001
+ ':' +
1002
+ settings[iframeId].inPageLinks +
1003
+ ':' +
1004
+ settings[iframeId].resizeFrom +
1005
+ ':' +
1006
+ settings[iframeId].widthCalculationMethod +
1007
+ ':' +
1008
+ settings[iframeId].mouseEvents
1009
+ )
1010
+ }
1011
+
1012
+ function isNumber(value) {
1013
+ return typeof value === 'number'
1014
+ }
1015
+
1016
+ function setupIFrame(iframe, options) {
1017
+ function setLimits() {
1018
+ function addStyle(style) {
1019
+ var styleValue = settings[iframeId][style];
1020
+ if (Infinity !== styleValue && 0 !== styleValue) {
1021
+ iframe.style[style] = isNumber(styleValue)
1022
+ ? styleValue + 'px'
1023
+ : styleValue;
1024
+ log(iframeId, 'Set ' + style + ' = ' + iframe.style[style]);
1025
+ }
1026
+ }
1027
+
1028
+ function chkMinMax(dimension) {
1029
+ if (
1030
+ settings[iframeId]['min' + dimension] >
1031
+ settings[iframeId]['max' + dimension]
1032
+ ) {
1033
+ throw new Error(
1034
+ 'Value for min' +
1035
+ dimension +
1036
+ ' can not be greater than max' +
1037
+ dimension
1038
+ )
1039
+ }
1040
+ }
1041
+
1042
+ chkMinMax('Height');
1043
+ chkMinMax('Width');
1044
+
1045
+ addStyle('maxHeight');
1046
+ addStyle('minHeight');
1047
+ addStyle('maxWidth');
1048
+ addStyle('minWidth');
1049
+ }
1050
+
1051
+ function newId() {
1052
+ var id = (options && options.id) || defaults.id + count++;
1053
+ if (null !== document.getElementById(id)) {
1054
+ id += count++;
1055
+ }
1056
+ return id
1057
+ }
1058
+
1059
+ function ensureHasId(iframeId) {
1060
+ if (typeof iframeId !== 'string') {
1061
+ throw new TypeError('Invaild id for iFrame. Expected String')
1062
+ }
1063
+
1064
+ if ('' === iframeId) {
1065
+ // eslint-disable-next-line no-multi-assign
1066
+ iframe.id = iframeId = newId();
1067
+ logEnabled = (options || {}).log;
1068
+ log(
1069
+ iframeId,
1070
+ 'Added missing iframe ID: ' + iframeId + ' (' + iframe.src + ')'
1071
+ );
1072
+ }
1073
+
1074
+ return iframeId
1075
+ }
1076
+
1077
+ function setScrolling() {
1078
+ log(
1079
+ iframeId,
1080
+ 'IFrame scrolling ' +
1081
+ (settings[iframeId] && settings[iframeId].scrolling
1082
+ ? 'enabled'
1083
+ : 'disabled') +
1084
+ ' for ' +
1085
+ iframeId
1086
+ );
1087
+ iframe.style.overflow =
1088
+ false === (settings[iframeId] && settings[iframeId].scrolling)
1089
+ ? 'hidden'
1090
+ : 'auto';
1091
+ switch (settings[iframeId] && settings[iframeId].scrolling) {
1092
+ case 'omit': {
1093
+ break
1094
+ }
1095
+
1096
+ case true: {
1097
+ iframe.scrolling = 'yes';
1098
+ break
1099
+ }
1100
+
1101
+ case false: {
1102
+ iframe.scrolling = 'no';
1103
+ break
1104
+ }
1105
+
1106
+ default: {
1107
+ iframe.scrolling = settings[iframeId]
1108
+ ? settings[iframeId].scrolling
1109
+ : 'no';
1110
+ }
1111
+ }
1112
+ }
1113
+
1114
+ // The V1 iFrame script expects an int, where as in V2 expects a CSS
1115
+ // string value such as '1px 3em', so if we have an int for V2, set V1=V2
1116
+ // and then convert V2 to a string PX value.
1117
+ function setupBodyMarginValues() {
1118
+ if (
1119
+ 'number' ===
1120
+ typeof (settings[iframeId] && settings[iframeId].bodyMargin) ||
1121
+ '0' === (settings[iframeId] && settings[iframeId].bodyMargin)
1122
+ ) {
1123
+ settings[iframeId].bodyMarginV1 = settings[iframeId].bodyMargin;
1124
+ settings[iframeId].bodyMargin =
1125
+ '' + settings[iframeId].bodyMargin + 'px';
1126
+ }
1127
+ }
1128
+
1129
+ function checkReset() {
1130
+ // Reduce scope of firstRun to function, because IE8's JS execution
1131
+ // context stack is borked and this value gets externally
1132
+ // changed midway through running this function!!!
1133
+ var firstRun = settings[iframeId] && settings[iframeId].firstRun,
1134
+ resetRequertMethod =
1135
+ settings[iframeId] &&
1136
+ settings[iframeId].heightCalculationMethod in resetRequiredMethods;
1137
+
1138
+ if (!firstRun && resetRequertMethod) {
1139
+ resetIFrame({ iframe: iframe, height: 0, width: 0, type: 'init' });
1140
+ }
1141
+ }
1142
+
1143
+ function setupIFrameObject() {
1144
+ if (settings[iframeId]) {
1145
+ settings[iframeId].iframe.iFrameResizer = {
1146
+ close: closeIFrame.bind(null, settings[iframeId].iframe),
1147
+
1148
+ removeListeners: removeIframeListeners.bind(
1149
+ null,
1150
+ settings[iframeId].iframe
1151
+ ),
1152
+
1153
+ resize: trigger.bind(
1154
+ null,
1155
+ 'Window resize',
1156
+ 'resize',
1157
+ settings[iframeId].iframe
1158
+ ),
1159
+
1160
+ moveToAnchor: function (anchor) {
1161
+ trigger(
1162
+ 'Move to anchor',
1163
+ 'moveToAnchor:' + anchor,
1164
+ settings[iframeId].iframe,
1165
+ iframeId
1166
+ );
1167
+ },
1168
+
1169
+ sendMessage: function (message) {
1170
+ message = JSON.stringify(message);
1171
+ trigger(
1172
+ 'Send Message',
1173
+ 'message:' + message,
1174
+ settings[iframeId].iframe,
1175
+ iframeId
1176
+ );
1177
+ }
1178
+ };
1179
+ }
1180
+ }
1181
+
1182
+ // We have to call trigger twice, as we can not be sure if all
1183
+ // iframes have completed loading when this code runs. The
1184
+ // event listener also catches the page changing in the iFrame.
1185
+ function init(msg) {
1186
+ function iFrameLoaded() {
1187
+ trigger('iFrame.onload', msg, iframe, undefined$1, true);
1188
+ checkReset();
1189
+ }
1190
+
1191
+ function createDestroyObserver(MutationObserver) {
1192
+ if (!iframe.parentNode) {
1193
+ return
1194
+ }
1195
+
1196
+ var destroyObserver = new MutationObserver(function (mutations) {
1197
+ mutations.forEach(function (mutation) {
1198
+ var removedNodes = Array.prototype.slice.call(mutation.removedNodes); // Transform NodeList into an Array
1199
+ removedNodes.forEach(function (removedNode) {
1200
+ if (removedNode === iframe) {
1201
+ closeIFrame(iframe);
1202
+ }
1203
+ });
1204
+ });
1205
+ });
1206
+ destroyObserver.observe(iframe.parentNode, {
1207
+ childList: true
1208
+ });
1209
+ }
1210
+
1211
+ var MutationObserver = getMutationObserver();
1212
+ if (MutationObserver) {
1213
+ createDestroyObserver(MutationObserver);
1214
+ }
1215
+
1216
+ addEventListener(iframe, 'load', iFrameLoaded);
1217
+ trigger('init', msg, iframe, undefined$1, true);
1218
+ }
1219
+
1220
+ function checkOptions(options) {
1221
+ if ('object' !== typeof options) {
1222
+ throw new TypeError('Options is not an object')
1223
+ }
1224
+ }
1225
+
1226
+ function copyOptions(options) {
1227
+ // eslint-disable-next-line no-restricted-syntax
1228
+ for (var option in defaults) {
1229
+ if (Object.prototype.hasOwnProperty.call(defaults, option)) {
1230
+ settings[iframeId][option] = Object.prototype.hasOwnProperty.call(
1231
+ options,
1232
+ option
1233
+ )
1234
+ ? options[option]
1235
+ : defaults[option];
1236
+ }
1237
+ }
1238
+ }
1239
+
1240
+ function getTargetOrigin(remoteHost) {
1241
+ return '' === remoteHost ||
1242
+ null !== remoteHost.match(/^(about:blank|javascript:|file:\/\/)/)
1243
+ ? '*'
1244
+ : remoteHost
1245
+ }
1246
+
1247
+ function depricate(key) {
1248
+ var splitName = key.split('Callback');
1249
+
1250
+ if (splitName.length === 2) {
1251
+ var name =
1252
+ 'on' + splitName[0].charAt(0).toUpperCase() + splitName[0].slice(1);
1253
+ this[name] = this[key];
1254
+ delete this[key];
1255
+ warn(
1256
+ iframeId,
1257
+ "Deprecated: '" +
1258
+ key +
1259
+ "' has been renamed '" +
1260
+ name +
1261
+ "'. The old method will be removed in the next major version."
1262
+ );
1263
+ }
1264
+ }
1265
+
1266
+ function processOptions(options) {
1267
+ options = options || {};
1268
+
1269
+ settings[iframeId] = Object.create(null); // Protect against prototype attacks
1270
+ settings[iframeId].iframe = iframe;
1271
+ settings[iframeId].firstRun = true;
1272
+ settings[iframeId].remoteHost =
1273
+ iframe.src && iframe.src.split('/').slice(0, 3).join('/');
1274
+
1275
+ checkOptions(options);
1276
+ Object.keys(options).forEach(depricate, options);
1277
+ copyOptions(options);
1278
+
1279
+ if (settings[iframeId]) {
1280
+ settings[iframeId].targetOrigin =
1281
+ true === settings[iframeId].checkOrigin
1282
+ ? getTargetOrigin(settings[iframeId].remoteHost)
1283
+ : '*';
1284
+ }
1285
+ }
1286
+
1287
+ function beenHere() {
1288
+ return iframeId in settings && 'iFrameResizer' in iframe
1289
+ }
1290
+
1291
+ var iframeId = ensureHasId(iframe.id);
1292
+
1293
+ if (beenHere()) {
1294
+ warn(iframeId, 'Ignored iFrame, already setup.');
1295
+ } else {
1296
+ processOptions(options);
1297
+ setScrolling();
1298
+ setLimits();
1299
+ setupBodyMarginValues();
1300
+ init(createOutgoingMsg(iframeId));
1301
+ setupIFrameObject();
1302
+ }
1303
+ }
1304
+
1305
+ function debouce(fn, time) {
1306
+ if (null === timer) {
1307
+ timer = setTimeout(function () {
1308
+ timer = null;
1309
+ fn();
1310
+ }, time);
1311
+ }
1312
+ }
1313
+
1314
+ var frameTimer = {};
1315
+ function debounceFrameEvents(fn, time, frameId) {
1316
+ if (!frameTimer[frameId]) {
1317
+ frameTimer[frameId] = setTimeout(function () {
1318
+ frameTimer[frameId] = null;
1319
+ fn();
1320
+ }, time);
1321
+ }
1322
+ }
1323
+
1324
+ // Not testable in PhantomJS
1325
+ /* istanbul ignore next */
1326
+
1327
+ function fixHiddenIFrames() {
1328
+ function checkIFrames() {
1329
+ function checkIFrame(settingId) {
1330
+ function chkDimension(dimension) {
1331
+ return (
1332
+ '0px' ===
1333
+ (settings[settingId] && settings[settingId].iframe.style[dimension])
1334
+ )
1335
+ }
1336
+
1337
+ function isVisible(el) {
1338
+ return null !== el.offsetParent
1339
+ }
1340
+
1341
+ if (
1342
+ settings[settingId] &&
1343
+ isVisible(settings[settingId].iframe) &&
1344
+ (chkDimension('height') || chkDimension('width'))
1345
+ ) {
1346
+ trigger(
1347
+ 'Visibility change',
1348
+ 'resize',
1349
+ settings[settingId].iframe,
1350
+ settingId
1351
+ );
1352
+ }
1353
+ }
1354
+
1355
+ Object.keys(settings).forEach(function (key) {
1356
+ checkIFrame(key);
1357
+ });
1358
+ }
1359
+
1360
+ function mutationObserved(mutations) {
1361
+ log(
1362
+ 'window',
1363
+ 'Mutation observed: ' + mutations[0].target + ' ' + mutations[0].type
1364
+ );
1365
+ debouce(checkIFrames, 16);
1366
+ }
1367
+
1368
+ function createMutationObserver() {
1369
+ var target = document.querySelector('body'),
1370
+ config = {
1371
+ attributes: true,
1372
+ attributeOldValue: false,
1373
+ characterData: true,
1374
+ characterDataOldValue: false,
1375
+ childList: true,
1376
+ subtree: true
1377
+ },
1378
+ observer = new MutationObserver(mutationObserved);
1379
+
1380
+ observer.observe(target, config);
1381
+ }
1382
+
1383
+ var MutationObserver = getMutationObserver();
1384
+ if (MutationObserver) {
1385
+ createMutationObserver();
1386
+ }
1387
+ }
1388
+
1389
+ function resizeIFrames(event) {
1390
+ function resize() {
1391
+ sendTriggerMsg('Window ' + event, 'resize');
1392
+ }
1393
+
1394
+ log('window', 'Trigger event: ' + event);
1395
+ debouce(resize, 16);
1396
+ }
1397
+
1398
+ // Not testable in PhantomJS
1399
+ /* istanbul ignore next */
1400
+ function tabVisible() {
1401
+ function resize() {
1402
+ sendTriggerMsg('Tab Visible', 'resize');
1403
+ }
1404
+
1405
+ if ('hidden' !== document.visibilityState) {
1406
+ log('document', 'Trigger event: Visibility change');
1407
+ debouce(resize, 16);
1408
+ }
1409
+ }
1410
+
1411
+ function sendTriggerMsg(eventName, event) {
1412
+ function isIFrameResizeEnabled(iframeId) {
1413
+ return (
1414
+ settings[iframeId] &&
1415
+ 'parent' === settings[iframeId].resizeFrom &&
1416
+ settings[iframeId].autoResize &&
1417
+ !settings[iframeId].firstRun
1418
+ )
1419
+ }
1420
+
1421
+ Object.keys(settings).forEach(function (iframeId) {
1422
+ if (isIFrameResizeEnabled(iframeId)) {
1423
+ trigger(eventName, event, settings[iframeId].iframe, iframeId);
1424
+ }
1425
+ });
1426
+ }
1427
+
1428
+ function setupEventListeners() {
1429
+ addEventListener(window, 'message', iFrameListener);
1430
+
1431
+ addEventListener(window, 'resize', function () {
1432
+ resizeIFrames('resize');
1433
+ });
1434
+
1435
+ addEventListener(document, 'visibilitychange', tabVisible);
1436
+
1437
+ addEventListener(document, '-webkit-visibilitychange', tabVisible);
1438
+ }
1439
+
1440
+ function factory() {
1441
+ function init(options, element) {
1442
+ function chkType() {
1443
+ if (!element.tagName) {
1444
+ throw new TypeError('Object is not a valid DOM element')
1445
+ } else if ('IFRAME' !== element.tagName.toUpperCase()) {
1446
+ throw new TypeError(
1447
+ 'Expected <IFRAME> tag, found <' + element.tagName + '>'
1448
+ )
1449
+ }
1450
+ }
1451
+
1452
+ if (element) {
1453
+ chkType();
1454
+ setupIFrame(element, options);
1455
+ iFrames.push(element);
1456
+ }
1457
+ }
1458
+
1459
+ function warnDeprecatedOptions(options) {
1460
+ if (options && options.enablePublicMethods) {
1461
+ warn(
1462
+ 'enablePublicMethods option has been removed, public methods are now always available in the iFrame'
1463
+ );
1464
+ }
1465
+ }
1466
+
1467
+ var iFrames;
1468
+
1469
+ setupRequestAnimationFrame();
1470
+ setupEventListeners();
1471
+
1472
+ return function iFrameResizeF(options, target) {
1473
+ iFrames = []; // Only return iFrames past in on this call
1474
+
1475
+ warnDeprecatedOptions(options);
1476
+
1477
+ switch (typeof target) {
1478
+ case 'undefined':
1479
+ case 'string': {
1480
+ Array.prototype.forEach.call(
1481
+ document.querySelectorAll(target || 'iframe'),
1482
+ init.bind(undefined$1, options)
1483
+ );
1484
+ break
1485
+ }
1486
+
1487
+ case 'object': {
1488
+ init(options, target);
1489
+ break
1490
+ }
1491
+
1492
+ default: {
1493
+ throw new TypeError('Unexpected data type (' + typeof target + ')')
1494
+ }
1495
+ }
1496
+
1497
+ return iFrames
1498
+ }
1499
+ }
1500
+
1501
+ function createJQueryPublicMethod($) {
1502
+ if (!$.fn) {
1503
+ info('', 'Unable to bind to jQuery, it is not fully loaded.');
1504
+ } else if (!$.fn.iFrameResize) {
1505
+ $.fn.iFrameResize = function $iFrameResizeF(options) {
1506
+ function init(index, element) {
1507
+ setupIFrame(element, options);
1508
+ }
1509
+
1510
+ return this.filter('iframe').each(init).end()
1511
+ };
1512
+ }
1513
+ }
1514
+
1515
+ if (window.jQuery !== undefined$1) {
1516
+ createJQueryPublicMethod(window.jQuery);
1517
+ }
1518
+
1519
+ if (typeof undefined$1 === 'function' && undefined$1.amd) {
1520
+ undefined$1([], factory);
1521
+ } else {
1522
+ // Node for browserfy
1523
+ module.exports = factory();
1524
+ }
1525
+ window.iFrameResize = window.iFrameResize || factory();
1526
+ })();
1527
+ });
1528
+
1529
+ const MessageEventType = {
1530
+ card: {
1531
+ ready: 'justifi.card.ready',
1532
+ tokenize: 'justifi.card.tokenize',
1533
+ validate: 'justifi.card.validate',
1534
+ resize: 'justifi.card.resize',
1535
+ styleOverrides: 'justifi.card.styleOverrides',
1536
+ },
1537
+ bankAccount: {
1538
+ ready: 'justifi.bankAccount.ready',
1539
+ tokenize: 'justifi.bankAccount.tokenize',
1540
+ validate: 'justifi.bankAccount.validate',
1541
+ resize: 'justifi.bankAccount.resize',
1542
+ styleOverrides: 'justifi.bankAccount.styleOverrides',
1543
+ },
1544
+ };
1545
+
1546
+ const name = "@justifi/webcomponents";
1547
+ const version = "4.15.0";
1548
+ const description = "JustiFi Web Components";
1549
+ const main = "dist/module/index.js";
1550
+ const module = "dist/module/index.js";
1551
+ const types = "./dist/types/index.d.ts";
1552
+ const repository = {
1553
+ type: "git",
1554
+ url: "git+https://github.com/justifi-tech/web-component-library.git"
1555
+ };
1556
+ const homepage = "https://storybook.justifi.ai/?path=/docs/introduction--docs";
1557
+ const publishConfig = {
1558
+ registry: "https://registry.npmjs.org"
1559
+ };
1560
+ const files = [
1561
+ "dist/"
1562
+ ];
1563
+ const scripts = {
1564
+ build: "stencil build --docs",
1565
+ dev: "stencil build --watch",
1566
+ lint: "eslint . --max-warnings 0",
1567
+ clean: "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
1568
+ generate: "stencil generate",
1569
+ test: "TZ=utc stencil test --spec",
1570
+ "test:watch": "TZ=utc stencil test --spec --watchAll",
1571
+ "test:e2e": "stencil test --e2e",
1572
+ "test:file": "stencil test --spec --watch --"
1573
+ };
1574
+ const dependencies = {
1575
+ "@stencil/core": "^4.0.5",
1576
+ bootstrap: "^5.2.3",
1577
+ "chart.js": "^4.4.1",
1578
+ "date-fns": "^2.29.3",
1579
+ "dinero.js": "^1.9.1",
1580
+ "iframe-resizer": "^4.3.7",
1581
+ imask: "^7.6.0",
1582
+ rxjs: "^7.8.1",
1583
+ "ts-dedent": "^2.2.0",
1584
+ uuid: "^9.0.0",
1585
+ yup: "^1.0.0"
1586
+ };
1587
+ const devDependencies = {
1588
+ "@babel/preset-env": "^7.21.5",
1589
+ "@babel/preset-react": "^7.18.6",
1590
+ "@babel/preset-typescript": "^7.21.5",
1591
+ "@stencil/sass": "^3.0.1",
1592
+ "@stencil/store": "^2.0.8",
1593
+ "@types/jest": "27.0.3",
1594
+ "@types/node": "^20.1.4",
1595
+ "@types/react": "^18.0.37",
1596
+ "@types/react-dom": "^18.0.11",
1597
+ dotenv: "^16.3.1",
1598
+ jest: "^29.7.0",
1599
+ "jest-cli": "^29.7.0",
1600
+ "jest-environment-node": "^29.7.0",
1601
+ puppeteer: "^21.0.0",
1602
+ "ts-jest": "^29.1.2"
1603
+ };
1604
+ const license = "MIT";
1605
+ const gitHead = "507bac1d941eae6e1f56e185ecd9bc9d22637783";
1606
+ const packageJson = {
1607
+ name: name,
1608
+ version: version,
1609
+ description: description,
1610
+ main: main,
1611
+ module: module,
1612
+ types: types,
1613
+ repository: repository,
1614
+ homepage: homepage,
1615
+ publishConfig: publishConfig,
1616
+ files: files,
1617
+ scripts: scripts,
1618
+ dependencies: dependencies,
1619
+ devDependencies: devDependencies,
1620
+ license: license,
1621
+ gitHead: gitHead
1622
+ };
1623
+
1624
+ const getComputedTheme = () => {
1625
+ const computedStyles = getComputedStyle(document.body);
1626
+ const computedTheme = {
1627
+ loadGoogleFont: computedStyles.getPropertyValue('--jfi-load-google-font'),
1628
+ layout: {
1629
+ fontFamily: computedStyles.getPropertyValue('--jfi-layout-font-family'),
1630
+ padding: computedStyles.getPropertyValue('--jfi-layout-padding'),
1631
+ formControlSpacingHorizontal: computedStyles.getPropertyValue('--jfi-layout-form-control-spacing-x'),
1632
+ formControlSpacingVertical: computedStyles.getPropertyValue('--jfi-layout-form-control-spacing-y'),
1633
+ },
1634
+ formControl: {
1635
+ backgroundColor: computedStyles.getPropertyValue('--jfi-form-control-background-color'),
1636
+ borderColor: computedStyles.getPropertyValue('--jfi-form-control-border-color'),
1637
+ borderColorFocus: computedStyles.getPropertyValue('--jfi-form-control-border-color-focus'),
1638
+ borderColorError: computedStyles.getPropertyValue('--jfi-form-control-border-color-error'),
1639
+ borderWidth: computedStyles.getPropertyValue('--jfi-form-control-border-width'),
1640
+ borderBottomWidth: computedStyles.getPropertyValue('--jfi-form-control-border-bottom-width'),
1641
+ borderLeftWidth: computedStyles.getPropertyValue('--jfi-form-control-border-left-width'),
1642
+ borderRightWidth: computedStyles.getPropertyValue('--jfi-form-control-border-right-width'),
1643
+ borderTopWidth: computedStyles.getPropertyValue('--jfi-form-control-border-top-width'),
1644
+ borderRadius: computedStyles.getPropertyValue('--jfi-form-control-border-radius'),
1645
+ borderStyle: computedStyles.getPropertyValue('--jfi-form-control-border-style'),
1646
+ boxShadow: computedStyles.getPropertyValue('--jfi-form-control-box-shadow'),
1647
+ boxShadowError: computedStyles.getPropertyValue('--jfi-form-control-box-shadow-error'),
1648
+ boxShadowErrorFocus: computedStyles.getPropertyValue('--jfi-form-control-box-shadow-error-focus'),
1649
+ boxShadowFocus: computedStyles.getPropertyValue('--jfi-form-control-box-shadow-focus'),
1650
+ color: computedStyles.getPropertyValue('--jfi-form-control-color'),
1651
+ colorFocus: computedStyles.getPropertyValue('--jfi-form-control-color-focus'),
1652
+ fontSize: computedStyles.getPropertyValue('--jfi-form-control-font-size'),
1653
+ fontWeight: computedStyles.getPropertyValue('--jfi-form-control-font-weight'),
1654
+ lineHeight: computedStyles.getPropertyValue('--jfi-form-control-line-height'),
1655
+ margin: computedStyles.getPropertyValue('--jfi-form-control-margin'),
1656
+ padding: computedStyles.getPropertyValue('--jfi-form-control-padding'),
1657
+ },
1658
+ formLabel: {
1659
+ color: computedStyles.getPropertyValue('--jfi-form-label-color'),
1660
+ fontFamily: computedStyles.getPropertyValue('--jfi-form-label-font-family'),
1661
+ fontSize: computedStyles.getPropertyValue('--jfi-form-label-font-size'),
1662
+ fontWeight: computedStyles.getPropertyValue('--jfi-form-label-font-weight'),
1663
+ margin: computedStyles.getPropertyValue('--jfi-form-label-margin'),
1664
+ },
1665
+ errorMessage: {
1666
+ color: computedStyles.getPropertyValue('--jfi-error-message-color'),
1667
+ margin: computedStyles.getPropertyValue('--jfi-error-message-margin'),
1668
+ fontSize: computedStyles.getPropertyValue('--jfi-error-message-font-size'),
1669
+ },
1670
+ };
1671
+ return computedTheme;
1672
+ };
1673
+
1674
+ /**
1675
+ * This approach decouples the communication logic from PaymentMethodForm component,
1676
+ * making it cleaner, more maintainable, and easier to test
1677
+ */
1678
+ class FrameCommunicationService {
1679
+ constructor(iframe, iframeOrigin) {
1680
+ this.iframe = iframe;
1681
+ this.iframeOrigin = iframeOrigin;
1682
+ }
1683
+ postMessage(eventType, payload) {
1684
+ const message = Object.assign({ eventType }, payload);
1685
+ this.iframe.contentWindow.postMessage(message, this.iframeOrigin);
1686
+ }
1687
+ addMessageListener(callback) {
1688
+ window.addEventListener('message', callback);
1689
+ }
1690
+ removeMessageListener(callback) {
1691
+ window.removeEventListener('message', callback);
1692
+ }
1693
+ postMessageWithResponseListener(eventType, payload) {
1694
+ return new Promise((resolve) => {
1695
+ const responseListener = (event) => {
1696
+ if (event.data.eventType !== eventType)
1697
+ return;
1698
+ window.removeEventListener('message', responseListener);
1699
+ resolve(event.data.data);
1700
+ };
1701
+ window.addEventListener('message', responseListener);
1702
+ this.postMessage(eventType, payload);
1703
+ });
1704
+ }
1705
+ }
1706
+
1707
+ const paymentMethodFormCss = ":host{display:block}justifi-payment-method-form iframe{border:none;width:100%}iframe{width:1px;min-width:100%}";
1708
+
1709
+ const PaymentMethodForm = class {
1710
+ constructor(hostRef) {
1711
+ registerInstance(this, hostRef);
1712
+ this.paymentMethodFormReady = createEvent(this, "paymentMethodFormReady", 7);
1713
+ this.paymentMethodFormValidated = createEvent(this, "paymentMethodFormValidated", 7);
1714
+ this.paymentMethodFormTokenized = createEvent(this, "paymentMethodFormTokenized", 7);
1715
+ this.computedTheme = getComputedTheme();
1716
+ this.dispatchMessageEvent = (messageEvent) => {
1717
+ const { eventType, data } = messageEvent.data;
1718
+ const eventTypeMessage = MessageEventType[this.paymentMethodFormType];
1719
+ if (eventType === eventTypeMessage.ready) {
1720
+ this.paymentMethodFormReady.emit(data);
1721
+ }
1722
+ else if (eventType === eventTypeMessage.tokenize) {
1723
+ this.paymentMethodFormTokenized.emit(data);
1724
+ }
1725
+ else if (eventType === eventTypeMessage.validate) {
1726
+ this.paymentMethodFormValidated.emit(data);
1727
+ }
1728
+ };
1729
+ this.postMessage = (eventType, payload) => {
1730
+ this.frameService.postMessage(eventType, payload);
1731
+ };
1732
+ this.paymentMethodFormType = undefined;
1733
+ this.paymentMethodFormValidationMode = undefined;
1734
+ this.iframeOrigin = undefined;
1735
+ this.singleLine = undefined;
1736
+ }
1737
+ disconnectedCallback() {
1738
+ this.frameService.removeMessageListener(this.dispatchMessageEvent);
1739
+ }
1740
+ async resize() {
1741
+ this.postMessage(MessageEventType[this.paymentMethodFormType].resize);
1742
+ }
1743
+ async tokenize(clientId, paymentMethodMetadata, account) {
1744
+ const eventType = MessageEventType[this.paymentMethodFormType].tokenize;
1745
+ return this.frameService.postMessageWithResponseListener(eventType, {
1746
+ clientId,
1747
+ paymentMethodMetadata,
1748
+ account,
1749
+ componentVersion: packageJson.version,
1750
+ });
1751
+ }
1752
+ async validate() {
1753
+ const eventType = MessageEventType[this.paymentMethodFormType].validate;
1754
+ return this.frameService.postMessageWithResponseListener(eventType);
1755
+ }
1756
+ sendStyleOverrides() {
1757
+ if (this.computedTheme) {
1758
+ this.postMessage(MessageEventType[this.paymentMethodFormType].styleOverrides, { styleOverrides: this.computedTheme });
1759
+ }
1760
+ }
1761
+ getIframeSrc() {
1762
+ let paramsList = [];
1763
+ if (this.paymentMethodFormValidationMode) {
1764
+ paramsList.push(`validationMode=${this.paymentMethodFormValidationMode}`);
1765
+ }
1766
+ if (this.singleLine) {
1767
+ paramsList.push(`singleLine=${this.singleLine}`);
1768
+ }
1769
+ let iframeSrc = `${this.iframeOrigin}/${this.paymentMethodFormType}${composeQueryParams(paramsList)}`;
1770
+ return iframeSrc;
1771
+ }
1772
+ initializeFrameCommunicationService() {
1773
+ var _a;
1774
+ this.frameService = new FrameCommunicationService(this.iframeElement, this.iframeOrigin);
1775
+ (_a = this.frameService) === null || _a === void 0 ? void 0 : _a.addMessageListener(this.dispatchMessageEvent);
1776
+ }
1777
+ render() {
1778
+ return (h(Host, null, h("iframe", { id: `justifi-payment-method-form-${this.paymentMethodFormType}`, src: this.getIframeSrc(), ref: el => {
1779
+ this.iframeElement = el;
1780
+ this.initializeFrameCommunicationService();
1781
+ }, onLoad: () => {
1782
+ iframeResizer({
1783
+ scrollbars: false,
1784
+ }, this.iframeElement);
1785
+ this.sendStyleOverrides();
1786
+ } })));
1787
+ }
1788
+ };
1789
+ PaymentMethodForm.style = paymentMethodFormCss;
1790
+
1791
+ export { BillingForm as justifi_billing_form, PaymentMethodForm as justifi_payment_method_form };