@justifi/webcomponents 4.7.0-rc.2 → 4.7.1-rc.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 (157) hide show
  1. package/dist/cjs/Api-548eaa62.js.map +1 -1
  2. package/dist/cjs/Payout-68a99ee3.js.map +1 -1
  3. package/dist/cjs/config-a156df17.js +17 -0
  4. package/dist/cjs/config-a156df17.js.map +1 -0
  5. package/dist/cjs/justifi-business-details.cjs.entry.js +1 -1
  6. package/dist/cjs/justifi-business-form-stepped.cjs.entry.js +1 -1
  7. package/dist/cjs/justifi-business-form.cjs.entry.js +1 -1
  8. package/dist/cjs/justifi-business-list.cjs.entry.js +1 -1
  9. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +1 -1
  10. package/dist/cjs/justifi-payment-balance-transactions.cjs.entry.js +2 -1
  11. package/dist/cjs/justifi-payment-balance-transactions.cjs.entry.js.map +1 -1
  12. package/dist/cjs/justifi-payment-details.cjs.entry.js +3 -5
  13. package/dist/cjs/justifi-payment-details.cjs.entry.js.map +1 -1
  14. package/dist/cjs/justifi-payment-method-form.cjs.entry.js +3 -6
  15. package/dist/cjs/justifi-payment-method-form.cjs.entry.js.map +1 -1
  16. package/dist/cjs/justifi-payments-list.cjs.entry.js +10 -2
  17. package/dist/cjs/justifi-payments-list.cjs.entry.js.map +1 -1
  18. package/dist/cjs/justifi-payout-details.cjs.entry.js +1 -1
  19. package/dist/cjs/justifi-payouts-list.cjs.entry.js +1 -1
  20. package/dist/cjs/justifi-proceeds-list.cjs.entry.js +1 -1
  21. package/dist/cjs/justifi-refund-form.cjs.entry.js +1 -1
  22. package/dist/cjs/justifi-subaccount-details.cjs.entry.js +1 -1
  23. package/dist/cjs/justifi-subaccounts-list.cjs.entry.js +1 -1
  24. package/dist/cjs/justifi-table_2.cjs.entry.js +1 -1
  25. package/dist/cjs/justifi-table_2.cjs.entry.js.map +1 -1
  26. package/dist/collection/api/Api.js.map +1 -1
  27. package/dist/collection/api/Payment.js.map +1 -1
  28. package/dist/collection/components/bank-account-form/bank-account-form.stories.js +0 -8
  29. package/dist/collection/components/bank-account-form/bank-account-form.stories.js.map +1 -1
  30. package/dist/collection/components/business-form/business-form-stepped.stories.js +4 -4
  31. package/dist/collection/components/business-form/business-form-stepped.stories.js.map +1 -1
  32. package/dist/collection/components/business-form/business-form.stories.js +2 -2
  33. package/dist/collection/components/business-form/business-form.stories.js.map +1 -1
  34. package/dist/collection/components/business-list/business-list.stories.js +1 -1
  35. package/dist/collection/components/business-list/business-list.stories.js.map +1 -1
  36. package/dist/collection/components/card-form/card-form.stories.js +0 -8
  37. package/dist/collection/components/card-form/card-form.stories.js.map +1 -1
  38. package/dist/collection/components/gross-payment-chart/gross-payment-chart.stories.js +3 -2
  39. package/dist/collection/components/gross-payment-chart/gross-payment-chart.stories.js.map +1 -1
  40. package/dist/collection/components/payment-balance-transactions/payment-balance-transactions.js +2 -1
  41. package/dist/collection/components/payment-balance-transactions/payment-balance-transactions.js.map +1 -1
  42. package/dist/collection/components/payment-balance-transactions/payment-balance-transactions.stories.js +5 -4
  43. package/dist/collection/components/payment-balance-transactions/payment-balance-transactions.stories.js.map +1 -1
  44. package/dist/collection/components/payment-details/payment-details.js +2 -4
  45. package/dist/collection/components/payment-details/payment-details.js.map +1 -1
  46. package/dist/collection/components/payments-list/payments-list.js +9 -1
  47. package/dist/collection/components/payments-list/payments-list.js.map +1 -1
  48. package/dist/collection/components/payments-list/payments-list.stories.js +1 -1
  49. package/dist/collection/components/payments-list/payments-list.stories.js.map +1 -1
  50. package/dist/collection/components/payouts-list/payouts-list.stories.js +1 -1
  51. package/dist/collection/components/payouts-list/payouts-list.stories.js.map +1 -1
  52. package/dist/collection/components/proceeds-list/proceeds-list.stories.js +1 -1
  53. package/dist/collection/components/proceeds-list/proceeds-list.stories.js.map +1 -1
  54. package/dist/collection/components/subaccount-details/subaccount-details.stories.js +1 -1
  55. package/dist/collection/components/subaccount-details/subaccount-details.stories.js.map +1 -1
  56. package/dist/collection/components/subaccounts-list/subaccounts-list.stories.js +1 -1
  57. package/dist/collection/components/subaccounts-list/subaccounts-list.stories.js.map +1 -1
  58. package/dist/collection/components/table/table.js +1 -1
  59. package/dist/collection/components/table/table.js.map +1 -1
  60. package/dist/components/Api.js.map +1 -1
  61. package/dist/components/Payout.js.map +1 -1
  62. package/dist/components/config.js +6 -8
  63. package/dist/components/config.js.map +1 -1
  64. package/dist/components/justifi-payment-balance-transactions.js +2 -1
  65. package/dist/components/justifi-payment-balance-transactions.js.map +1 -1
  66. package/dist/components/justifi-payment-details.js +2 -4
  67. package/dist/components/justifi-payment-details.js.map +1 -1
  68. package/dist/components/justifi-payments-list.js +9 -1
  69. package/dist/components/justifi-payments-list.js.map +1 -1
  70. package/dist/components/payment-method-form.js +2 -5
  71. package/dist/components/payment-method-form.js.map +1 -1
  72. package/dist/components/table.js +1 -1
  73. package/dist/components/table.js.map +1 -1
  74. package/dist/config.js +9 -11
  75. package/dist/config.js.map +1 -1
  76. package/dist/esm/Api-c65d3ed8.js.map +1 -1
  77. package/dist/esm/Payout-fcf16887.js.map +1 -1
  78. package/dist/esm/config-ceb0f902.js +15 -0
  79. package/dist/esm/config-ceb0f902.js.map +1 -0
  80. package/dist/esm/justifi-business-details.entry.js +1 -1
  81. package/dist/esm/justifi-business-form-stepped.entry.js +1 -1
  82. package/dist/esm/justifi-business-form.entry.js +1 -1
  83. package/dist/esm/justifi-business-list.entry.js +1 -1
  84. package/dist/esm/justifi-gross-payment-chart.entry.js +1 -1
  85. package/dist/esm/justifi-payment-balance-transactions.entry.js +2 -1
  86. package/dist/esm/justifi-payment-balance-transactions.entry.js.map +1 -1
  87. package/dist/esm/justifi-payment-details.entry.js +4 -6
  88. package/dist/esm/justifi-payment-details.entry.js.map +1 -1
  89. package/dist/esm/justifi-payment-method-form.entry.js +3 -6
  90. package/dist/esm/justifi-payment-method-form.entry.js.map +1 -1
  91. package/dist/esm/justifi-payments-list.entry.js +10 -2
  92. package/dist/esm/justifi-payments-list.entry.js.map +1 -1
  93. package/dist/esm/justifi-payout-details.entry.js +1 -1
  94. package/dist/esm/justifi-payouts-list.entry.js +1 -1
  95. package/dist/esm/justifi-proceeds-list.entry.js +1 -1
  96. package/dist/esm/justifi-refund-form.entry.js +1 -1
  97. package/dist/esm/justifi-subaccount-details.entry.js +1 -1
  98. package/dist/esm/justifi-subaccounts-list.entry.js +1 -1
  99. package/dist/esm/justifi-table_2.entry.js +1 -1
  100. package/dist/esm/justifi-table_2.entry.js.map +1 -1
  101. package/dist/types/api/Api.d.ts +1 -1
  102. package/dist/types/api/Payment.d.ts +2 -2
  103. package/dist/types/components/bank-account-form/bank-account-form.stories.d.ts +0 -1
  104. package/dist/types/components/card-form/card-form.stories.d.ts +0 -1
  105. package/dist/types/components/payments-list/payments-list.d.ts +2 -1
  106. package/dist/types/home/runner/work/web-component-library/web-component-library/stencil-library/.stencil/config.d.ts +2 -4
  107. package/dist/webcomponents/p-160c9fbb.entry.js +2 -0
  108. package/dist/webcomponents/p-160c9fbb.entry.js.map +1 -0
  109. package/dist/webcomponents/{p-8c4c3d60.entry.js → p-26245f01.entry.js} +2 -2
  110. package/dist/webcomponents/p-26dfa274.entry.js +2 -0
  111. package/dist/webcomponents/p-26dfa274.entry.js.map +1 -0
  112. package/dist/webcomponents/{p-c2845c5d.entry.js → p-285a50a6.entry.js} +2 -2
  113. package/dist/webcomponents/{p-ffcbf779.entry.js → p-378e163d.entry.js} +2 -2
  114. package/dist/webcomponents/{p-798483dd.entry.js → p-3d82c8a3.entry.js} +2 -2
  115. package/dist/webcomponents/p-3d82c8a3.entry.js.map +1 -0
  116. package/dist/webcomponents/{p-1920e118.entry.js → p-5b8f004d.entry.js} +2 -2
  117. package/dist/webcomponents/{p-d40718da.entry.js → p-64af0ae9.entry.js} +2 -2
  118. package/dist/webcomponents/p-76983a7e.js.map +1 -1
  119. package/dist/webcomponents/p-9b6dcac5.js +2 -0
  120. package/dist/webcomponents/p-9b6dcac5.js.map +1 -0
  121. package/dist/webcomponents/{p-d7630f46.entry.js → p-9ce9561a.entry.js} +2 -2
  122. package/dist/webcomponents/{p-d7630f46.entry.js.map → p-9ce9561a.entry.js.map} +1 -1
  123. package/dist/webcomponents/{p-b08a9520.entry.js → p-abc05a34.entry.js} +2 -2
  124. package/dist/webcomponents/{p-0e9a7fa7.entry.js → p-b12691c3.entry.js} +2 -2
  125. package/dist/webcomponents/p-b157f6ae.js.map +1 -1
  126. package/dist/webcomponents/{p-6c3236e8.entry.js → p-b98a3f94.entry.js} +2 -2
  127. package/dist/webcomponents/{p-64184a0c.entry.js → p-c1ae571b.entry.js} +2 -2
  128. package/dist/webcomponents/p-c1ae571b.entry.js.map +1 -0
  129. package/dist/webcomponents/{p-491d5c69.entry.js → p-c4c8fb44.entry.js} +2 -2
  130. package/dist/webcomponents/{p-a4c78757.entry.js → p-dbbd2611.entry.js} +2 -2
  131. package/dist/webcomponents/{p-b45453ea.entry.js → p-f0897468.entry.js} +2 -2
  132. package/dist/webcomponents/webcomponents.esm.js +1 -1
  133. package/package.json +3 -6
  134. package/readme.md +4 -9
  135. package/dist/cjs/config-70f62990.js +0 -19
  136. package/dist/cjs/config-70f62990.js.map +0 -1
  137. package/dist/esm/config-b1976dbd.js +0 -17
  138. package/dist/esm/config-b1976dbd.js.map +0 -1
  139. package/dist/webcomponents/p-301a23aa.js +0 -2
  140. package/dist/webcomponents/p-301a23aa.js.map +0 -1
  141. package/dist/webcomponents/p-64184a0c.entry.js.map +0 -1
  142. package/dist/webcomponents/p-798483dd.entry.js.map +0 -1
  143. package/dist/webcomponents/p-7a24ab66.entry.js +0 -2
  144. package/dist/webcomponents/p-7a24ab66.entry.js.map +0 -1
  145. package/dist/webcomponents/p-8367b46c.entry.js +0 -2
  146. package/dist/webcomponents/p-8367b46c.entry.js.map +0 -1
  147. /package/dist/webcomponents/{p-8c4c3d60.entry.js.map → p-26245f01.entry.js.map} +0 -0
  148. /package/dist/webcomponents/{p-c2845c5d.entry.js.map → p-285a50a6.entry.js.map} +0 -0
  149. /package/dist/webcomponents/{p-ffcbf779.entry.js.map → p-378e163d.entry.js.map} +0 -0
  150. /package/dist/webcomponents/{p-1920e118.entry.js.map → p-5b8f004d.entry.js.map} +0 -0
  151. /package/dist/webcomponents/{p-d40718da.entry.js.map → p-64af0ae9.entry.js.map} +0 -0
  152. /package/dist/webcomponents/{p-b08a9520.entry.js.map → p-abc05a34.entry.js.map} +0 -0
  153. /package/dist/webcomponents/{p-0e9a7fa7.entry.js.map → p-b12691c3.entry.js.map} +0 -0
  154. /package/dist/webcomponents/{p-6c3236e8.entry.js.map → p-b98a3f94.entry.js.map} +0 -0
  155. /package/dist/webcomponents/{p-491d5c69.entry.js.map → p-c4c8fb44.entry.js.map} +0 -0
  156. /package/dist/webcomponents/{p-a4c78757.entry.js.map → p-dbbd2611.entry.js.map} +0 -0
  157. /package/dist/webcomponents/{p-b45453ea.entry.js.map → p-f0897468.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["CaptureStrategy","PaymentMethodTypes","PaymentStatuses","PaymentDisputedStatuses","Payment","constructor","payment","this","id","account_id","amount","amount_disputed","amount_refundable","amount_refunded","balance","captured","capture_strategy","currency","description","disputed","disputes","error_code","error_description","fee_amount","is_test","metadata","payment_method","payment_intent_id","refunded","status","created_at","updated_at","disputedStatus","lost","some","dispute","open","PaymentBalanceTransaction","balanceTransaction","financial_transaction_id","payment_id","payment_balance_txn_type","source_id","source_type","displayTransactionId","PayoutStatuses","PayoutStatusesSafeNames","Payout","payout","bank_account","delivery_method","deposits_at","fees_total","refunds_count","refunds_total","payments_count","payments_total","payout_type","other_total"],"sources":["src/api/Payment.ts","src/api/Payout.ts"],"sourcesContent":["export enum CaptureStrategy {\n automatic = 'automatic',\n manual = 'manual',\n}\n\nexport enum PaymentMethodTypes {\n card = 'card',\n bankAccount = 'bankAccount',\n}\n\nexport enum PaymentStatuses {\n pending = 'pending',\n authorized = 'authorized',\n succeeded = 'succeeded',\n failed = 'failed',\n disputed = 'disputed',\n fully_refunded = 'fully_refunded',\n partially_refunded = 'partially_refunded',\n}\n\nexport enum PaymentDisputedStatuses {\n // if a dispute is 'won', we don't show a dispute status, just general status\n lost = 'lost',\n open = 'open',\n}\n\nexport interface IPaymentMethod {\n card?: ICard;\n bank_account?: IBankAccount;\n}\n\nexport type CardBrand =\n | 'american_express'\n | 'diners_club'\n | 'discover'\n | 'jcb'\n | 'mastercard'\n | 'china_unionpay'\n | 'visa'\n | 'unknown';\n\nexport interface IBankAccount {\n id: string;\n acct_last_four: string;\n name: string;\n brand: string;\n token: string\n created_at: string;\n updated_at: string;\n}\n\nexport interface ICard {\n id: string;\n acct_last_four: string;\n name: string;\n brand: CardBrand;\n token: string;\n created_at: string;\n updated_at: string;\n}\n\nexport interface IDispute {\n amount_cents: number;\n created_at: string;\n currency: string;\n gateway_ref_id: string;\n id: string;\n payment_id: string;\n reason: null;\n status: string;\n updated_at: string;\n}\n\nexport interface IPayment {\n id: string;\n account_id: string;\n amount: number;\n amount_disputed: number;\n amount_refundable: number;\n amount_refunded: number;\n balance: number;\n captured: boolean;\n capture_strategy: CaptureStrategy;\n currency: 'usd';\n description: string;\n disputed: boolean;\n disputes: IDispute[];\n error_code: string | null;\n error_description: string | null;\n fee_amount: number;\n is_test: boolean;\n metadata: Object | null;\n payment_method: IPaymentMethod;\n payment_intent_id: string | null;\n refunded: boolean;\n status: PaymentStatuses;\n created_at: string;\n updated_at: string;\n}\n\nexport class Payment implements IPayment {\n public id: string;\n public account_id: string;\n public amount: number;\n public amount_disputed: number;\n public amount_refundable: number;\n public amount_refunded: number;\n public balance: number;\n public captured: boolean;\n public capture_strategy: CaptureStrategy;\n public currency: 'usd';\n public description: string;\n public disputed: boolean;\n public disputes: IDispute[];\n public error_code: string | null;\n public error_description: string | null;\n public fee_amount: number;\n public is_test: boolean;\n public metadata: Object | null;\n public payment_method: IPaymentMethod;\n public payment_intent_id: string | null;\n public refunded: boolean;\n public status: PaymentStatuses;\n public created_at: string;\n public updated_at: string;\n public statement_descriptor?: string;\n\n constructor(payment: IPayment) {\n this.id = payment.id;\n this.account_id = payment.account_id;\n this.amount = payment.amount;\n this.amount_disputed = payment.amount_disputed;\n this.amount_refundable = payment.amount_refundable;\n this.amount_refunded = payment.amount_refunded;\n this.balance = payment.balance;\n this.captured = payment.captured;\n this.capture_strategy = payment.capture_strategy;\n this.currency = payment.currency;\n this.description = payment.description;\n this.disputed = payment.disputed;\n this.disputes = payment.disputes;\n this.error_code = payment.error_code;\n this.error_description = payment.error_description;\n this.fee_amount = payment.fee_amount;\n this.is_test = payment.is_test;\n this.metadata = payment.metadata;\n this.payment_method = payment.payment_method;\n this.payment_intent_id = payment.payment_intent_id;\n this.refunded = payment.refunded;\n this.status = payment.status;\n this.created_at = payment.created_at;\n this.updated_at = payment.updated_at;\n }\n\n get disputedStatus(): PaymentDisputedStatuses | null {\n const lost = this.disputes.some(\n dispute => dispute.status === PaymentDisputedStatuses.lost,\n );\n // if a dispute is 'won', we don't show a dispute status, just general status\n if (!this.disputed) {\n return null;\n } else if (lost) {\n return PaymentDisputedStatuses.lost;\n } else {\n return PaymentDisputedStatuses.open;\n }\n }\n}\n\nexport interface IPaymentBalanceTransaction {\n id: string;\n amount: number;\n balance: number;\n currency: 'usd';\n financial_transaction_id: string;\n payment_id: string;\n payment_balance_txn_type: string;\n source_id: string;\n source_type: string;\n created_at: string;\n updated_at: string;\n}\n\nexport class PaymentBalanceTransaction implements IPaymentBalanceTransaction {\n public id: string;\n public amount: number;\n public balance: number;\n public currency: 'usd';\n public financial_transaction_id: string;\n public payment_id: string;\n public payment_balance_txn_type: string;\n public source_id: string;\n public source_type: string;\n public created_at: string;\n public updated_at: string;\n\n constructor(balanceTransaction: IPaymentBalanceTransaction) {\n this.id = balanceTransaction.id;\n this.amount = balanceTransaction.amount;\n this.balance = balanceTransaction.balance;\n this.currency = balanceTransaction.currency;\n this.financial_transaction_id = balanceTransaction.financial_transaction_id;\n this.payment_id = balanceTransaction.payment_id;\n this.payment_balance_txn_type = balanceTransaction.payment_balance_txn_type;\n this.source_id = balanceTransaction.source_id;\n this.source_type = balanceTransaction.source_type;\n this.created_at = balanceTransaction.created_at;\n this.updated_at = balanceTransaction.updated_at;\n }\n\n get displayTransactionId(): string {\n return this.payment_balance_txn_type === 'payment_fee'\n ? '--'\n : this.source_id;\n }\n}\n","import { BankAccount } from \"./shared\";\n\nexport enum PayoutStatuses {\n paid = 'paid',\n failed = 'failed',\n forwarded = 'forwarded',\n scheduled = 'scheduled',\n in_transit = 'in_transit',\n canceled = 'canceled',\n}\n\nexport enum PayoutStatusesSafeNames {\n paid = 'Paid',\n failed = 'Failed',\n forwarded = 'Forwarded',\n scheduled = 'Scheduled',\n in_transit = 'In Transit',\n canceled = 'Canceled',\n}\n\nexport interface IPayout {\n id: string;\n account_id: string;\n amount: number;\n bank_account: BankAccount;\n currency: 'usd';\n delivery_method: string;\n description: string;\n deposits_at: string;\n fees_total: number;\n refunds_count: number;\n refunds_total: number;\n payments_count: number;\n payments_total: number;\n payout_type: 'ach' | 'cc';\n other_total: number;\n status: PayoutStatuses;\n metadata: any;\n created_at: string;\n updated_at: string;\n}\n\nexport class Payout implements IPayout {\n public id: string;\n public account_id: string;\n public amount: number;\n public bank_account: BankAccount;\n public currency: 'usd';\n public delivery_method: string;\n public description: string;\n public deposits_at: string;\n public fees_total: number;\n public refunds_count: number;\n public refunds_total: number;\n public payments_count: number;\n public payments_total: number;\n public payout_type: 'ach' | 'cc';\n public other_total: number;\n public status: PayoutStatuses;\n public metadata: any;\n public created_at: string;\n public updated_at: string;\n\n constructor(payout: IPayout) {\n this.id = payout.id;\n this.account_id = payout.account_id;\n this.amount = payout.amount;\n this.bank_account = payout.bank_account;\n this.currency = payout.currency;\n this.delivery_method = payout.delivery_method || 'standard';\n this.description = payout.description;\n this.deposits_at = payout.deposits_at;\n this.fees_total = payout.fees_total;\n this.refunds_count = payout.refunds_count;\n this.refunds_total = payout.refunds_total;\n this.payments_count = payout.payments_count;\n this.payments_total = payout.payments_total;\n this.payout_type = payout.payout_type;\n this.other_total = payout.other_total;\n this.status = payout.status;\n this.metadata = payout.metadata;\n this.created_at = payout.created_at;\n this.updated_at = payout.updated_at;\n }\n}\n"],"mappings":"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"}
1
+ {"version":3,"names":["CaptureStrategy","PaymentMethodTypes","PaymentStatuses","PaymentDisputedStatuses","Payment","constructor","payment","this","id","account_id","amount","amount_disputed","amount_refundable","amount_refunded","balance","captured","capture_strategy","currency","description","disputed","disputes","error_code","error_description","fee_amount","is_test","metadata","payment_method","payment_intent_id","refunded","status","created_at","updated_at","disputedStatus","lost","some","dispute","open","PaymentBalanceTransaction","balanceTransaction","financial_transaction_id","payment_id","payment_balance_txn_type","source_id","source_type","displayTransactionId","PayoutStatuses","PayoutStatusesSafeNames","Payout","payout","bank_account","delivery_method","deposits_at","fees_total","refunds_count","refunds_total","payments_count","payments_total","payout_type","other_total"],"sources":["src/api/Payment.ts","src/api/Payout.ts"],"sourcesContent":["export enum CaptureStrategy {\n automatic = 'automatic',\n manual = 'manual',\n}\n\nexport enum PaymentMethodTypes {\n card = 'card',\n bankAccount = 'bankAccount',\n}\n\nexport enum PaymentStatuses {\n pending = 'pending',\n authorized = 'authorized',\n succeeded = 'succeeded',\n failed = 'failed',\n disputed = 'disputed',\n fully_refunded = 'fully_refunded',\n partially_refunded = 'partially_refunded',\n}\n\nexport enum PaymentDisputedStatuses {\n // if a dispute is 'won', we don't show a dispute status, just general status\n lost = 'lost',\n open = 'open',\n}\n\nexport interface IPaymentMethod {\n card?: ICard;\n bank_account?: IBankAccount;\n}\n\nexport type CardBrand =\n | 'american_express'\n | 'diners_club'\n | 'discover'\n | 'jcb'\n | 'mastercard'\n | 'china_unionpay'\n | 'visa'\n | 'unknown';\n\nexport interface IBankAccount {\n id: string;\n acct_last_four: string;\n account_owner_name: string;\n bank_name: string;\n token: string\n created_at: string;\n updated_at: string;\n}\n\nexport interface ICard {\n id: string;\n acct_last_four: string;\n name: string;\n brand: CardBrand;\n token: string;\n created_at: string;\n updated_at: string;\n}\n\nexport interface IDispute {\n amount_cents: number;\n created_at: string;\n currency: string;\n gateway_ref_id: string;\n id: string;\n payment_id: string;\n reason: null;\n status: string;\n updated_at: string;\n}\n\nexport interface IPayment {\n id: string;\n account_id: string;\n amount: number;\n amount_disputed: number;\n amount_refundable: number;\n amount_refunded: number;\n balance: number;\n captured: boolean;\n capture_strategy: CaptureStrategy;\n currency: 'usd';\n description: string;\n disputed: boolean;\n disputes: IDispute[];\n error_code: string | null;\n error_description: string | null;\n fee_amount: number;\n is_test: boolean;\n metadata: Object | null;\n payment_method: IPaymentMethod;\n payment_intent_id: string | null;\n refunded: boolean;\n status: PaymentStatuses;\n created_at: string;\n updated_at: string;\n}\n\nexport class Payment implements IPayment {\n public id: string;\n public account_id: string;\n public amount: number;\n public amount_disputed: number;\n public amount_refundable: number;\n public amount_refunded: number;\n public balance: number;\n public captured: boolean;\n public capture_strategy: CaptureStrategy;\n public currency: 'usd';\n public description: string;\n public disputed: boolean;\n public disputes: IDispute[];\n public error_code: string | null;\n public error_description: string | null;\n public fee_amount: number;\n public is_test: boolean;\n public metadata: Object | null;\n public payment_method: IPaymentMethod;\n public payment_intent_id: string | null;\n public refunded: boolean;\n public status: PaymentStatuses;\n public created_at: string;\n public updated_at: string;\n public statement_descriptor?: string;\n\n constructor(payment: IPayment) {\n this.id = payment.id;\n this.account_id = payment.account_id;\n this.amount = payment.amount;\n this.amount_disputed = payment.amount_disputed;\n this.amount_refundable = payment.amount_refundable;\n this.amount_refunded = payment.amount_refunded;\n this.balance = payment.balance;\n this.captured = payment.captured;\n this.capture_strategy = payment.capture_strategy;\n this.currency = payment.currency;\n this.description = payment.description;\n this.disputed = payment.disputed;\n this.disputes = payment.disputes;\n this.error_code = payment.error_code;\n this.error_description = payment.error_description;\n this.fee_amount = payment.fee_amount;\n this.is_test = payment.is_test;\n this.metadata = payment.metadata;\n this.payment_method = payment.payment_method;\n this.payment_intent_id = payment.payment_intent_id;\n this.refunded = payment.refunded;\n this.status = payment.status;\n this.created_at = payment.created_at;\n this.updated_at = payment.updated_at;\n }\n\n get disputedStatus(): PaymentDisputedStatuses | null {\n const lost = this.disputes.some(\n dispute => dispute.status === PaymentDisputedStatuses.lost,\n );\n // if a dispute is 'won', we don't show a dispute status, just general status\n if (!this.disputed) {\n return null;\n } else if (lost) {\n return PaymentDisputedStatuses.lost;\n } else {\n return PaymentDisputedStatuses.open;\n }\n }\n}\n\nexport interface IPaymentBalanceTransaction {\n id: string;\n amount: number;\n balance: number;\n currency: 'usd';\n financial_transaction_id: string;\n payment_id: string;\n payment_balance_txn_type: string;\n source_id: string;\n source_type: string;\n created_at: string;\n updated_at: string;\n}\n\nexport class PaymentBalanceTransaction implements IPaymentBalanceTransaction {\n public id: string;\n public amount: number;\n public balance: number;\n public currency: 'usd';\n public financial_transaction_id: string;\n public payment_id: string;\n public payment_balance_txn_type: string;\n public source_id: string;\n public source_type: string;\n public created_at: string;\n public updated_at: string;\n\n constructor(balanceTransaction: IPaymentBalanceTransaction) {\n this.id = balanceTransaction.id;\n this.amount = balanceTransaction.amount;\n this.balance = balanceTransaction.balance;\n this.currency = balanceTransaction.currency;\n this.financial_transaction_id = balanceTransaction.financial_transaction_id;\n this.payment_id = balanceTransaction.payment_id;\n this.payment_balance_txn_type = balanceTransaction.payment_balance_txn_type;\n this.source_id = balanceTransaction.source_id;\n this.source_type = balanceTransaction.source_type;\n this.created_at = balanceTransaction.created_at;\n this.updated_at = balanceTransaction.updated_at;\n }\n\n get displayTransactionId(): string {\n return this.payment_balance_txn_type === 'payment_fee'\n ? '--'\n : this.source_id;\n }\n}\n","import { BankAccount } from \"./shared\";\n\nexport enum PayoutStatuses {\n paid = 'paid',\n failed = 'failed',\n forwarded = 'forwarded',\n scheduled = 'scheduled',\n in_transit = 'in_transit',\n canceled = 'canceled',\n}\n\nexport enum PayoutStatusesSafeNames {\n paid = 'Paid',\n failed = 'Failed',\n forwarded = 'Forwarded',\n scheduled = 'Scheduled',\n in_transit = 'In Transit',\n canceled = 'Canceled',\n}\n\nexport interface IPayout {\n id: string;\n account_id: string;\n amount: number;\n bank_account: BankAccount;\n currency: 'usd';\n delivery_method: string;\n description: string;\n deposits_at: string;\n fees_total: number;\n refunds_count: number;\n refunds_total: number;\n payments_count: number;\n payments_total: number;\n payout_type: 'ach' | 'cc';\n other_total: number;\n status: PayoutStatuses;\n metadata: any;\n created_at: string;\n updated_at: string;\n}\n\nexport class Payout implements IPayout {\n public id: string;\n public account_id: string;\n public amount: number;\n public bank_account: BankAccount;\n public currency: 'usd';\n public delivery_method: string;\n public description: string;\n public deposits_at: string;\n public fees_total: number;\n public refunds_count: number;\n public refunds_total: number;\n public payments_count: number;\n public payments_total: number;\n public payout_type: 'ach' | 'cc';\n public other_total: number;\n public status: PayoutStatuses;\n public metadata: any;\n public created_at: string;\n public updated_at: string;\n\n constructor(payout: IPayout) {\n this.id = payout.id;\n this.account_id = payout.account_id;\n this.amount = payout.amount;\n this.bank_account = payout.bank_account;\n this.currency = payout.currency;\n this.delivery_method = payout.delivery_method || 'standard';\n this.description = payout.description;\n this.deposits_at = payout.deposits_at;\n this.fees_total = payout.fees_total;\n this.refunds_count = payout.refunds_count;\n this.refunds_total = payout.refunds_total;\n this.payments_count = payout.payments_count;\n this.payments_total = payout.payments_total;\n this.payout_type = payout.payout_type;\n this.other_total = payout.other_total;\n this.status = payout.status;\n this.metadata = payout.metadata;\n this.created_at = payout.created_at;\n this.updated_at = payout.updated_at;\n }\n}\n"],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ const i={iframeOrigin:"https://js.justifi.ai/v2",proxyApiOrigin:"https://wc-proxy.justifi.ai",proxyAuthToken:"eyJraWQiOiJqdXN0aWZpLWUyNDgyMmU3ODE1MmEzZjRkMjU1IiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJpc3MiOiJodHRwczovL2F1dGguanVzdGlmaS5haS8iLCJhenAiOiJvYXNfMmlsWHBqOHQ2WVlEQ0xWU0FiVFczMiIsInN1YiI6Im9hc18yaWxYcGo4dDZZWURDTFZTQWJUVzMyQHNlc3Npb25zIiwiYXVkIjoiaHR0cHM6Ly9hcGkuanVzdGlmaS5haS92MSIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyIsInBlcm1pc3Npb25zIjpbeyJyb2xlIjoicmVhZDphY2NvdW50IiwicmVzb3VyY2VfaWQiOiJhY2NfNUV0OWlYclNTQVpSMktTb3VRR0FXaSJ9LHsicm9sZSI6InJlYWQ6YnVzaW5lc3MiLCJyZXNvdXJjZV9pZCI6ImJpel8zYmg2OWJxMXJrM2RtWE5vQUtWb251In1dLCJleHAiOjE3MTE1NTk0MTQsImlhdCI6MTcwMzc4MzQxNCwicGxhdGZvcm1fYWNjb3VudF9pZCI6ImFjY18zcmVOYjRhTll5MmlXRFpRVmN6bXg0In0.oPOoDYxzrnpE8PRUaz-FCU4KqnSuNbFTeDkl3AtMscjUkIctP1OIFh-ZGBjbH5eVH5noXCbaiin0j92dS7jx4gLpxuYT2Q8gpZbuIsT7fa58elvGeRkUUJ-AC5ueZxlv90yPWMm0OIbyrV7XZhuwYyKbV-ZczEbl2JpvBMe40CM-LdClQV66d_-Kw9a23SabBVfYgP5V-5OsagOIESvzZoO-27tGlNkV2a-hxqddDCOZv0HvRYAtp5S7EQrmRdEBu5gCNbf1eRFG424hxZUFVr2LdetYuKQLxJjDdUjf86ZwEUecrEaDSupiN1VC3CitdOwBVf6-R_N0VpN4VLVD5g",exampleAccountId:"acc_5Et9iXrSSAZR2KSouQGAWi",exampleBusinessId:"biz_3bh69bq1rk3dmXNoAKVonu",examplePaymentId:"py_1NNeEnf4FbelxDCQN2RHcE",examplePayoutId:"po_17745yESnHyEgWNeunmhmR",privateApiOrigin:"",privateAuthToken:""};export{i as c};
2
+ //# sourceMappingURL=p-9b6dcac5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["config","iframeOrigin","proxyApiOrigin","proxyAuthToken","exampleAccountId","exampleBusinessId","examplePaymentId","examplePayoutId","privateApiOrigin","privateAuthToken"],"sources":["config.ts"],"sourcesContent":["export const config = {\n iframeOrigin: 'https://js.justifi.ai/v2',\n proxyApiOrigin: 'https://wc-proxy.justifi.ai',\n proxyAuthToken: 'eyJraWQiOiJqdXN0aWZpLWUyNDgyMmU3ODE1MmEzZjRkMjU1IiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJpc3MiOiJodHRwczovL2F1dGguanVzdGlmaS5haS8iLCJhenAiOiJvYXNfMmlsWHBqOHQ2WVlEQ0xWU0FiVFczMiIsInN1YiI6Im9hc18yaWxYcGo4dDZZWURDTFZTQWJUVzMyQHNlc3Npb25zIiwiYXVkIjoiaHR0cHM6Ly9hcGkuanVzdGlmaS5haS92MSIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyIsInBlcm1pc3Npb25zIjpbeyJyb2xlIjoicmVhZDphY2NvdW50IiwicmVzb3VyY2VfaWQiOiJhY2NfNUV0OWlYclNTQVpSMktTb3VRR0FXaSJ9LHsicm9sZSI6InJlYWQ6YnVzaW5lc3MiLCJyZXNvdXJjZV9pZCI6ImJpel8zYmg2OWJxMXJrM2RtWE5vQUtWb251In1dLCJleHAiOjE3MTE1NTk0MTQsImlhdCI6MTcwMzc4MzQxNCwicGxhdGZvcm1fYWNjb3VudF9pZCI6ImFjY18zcmVOYjRhTll5MmlXRFpRVmN6bXg0In0.oPOoDYxzrnpE8PRUaz-FCU4KqnSuNbFTeDkl3AtMscjUkIctP1OIFh-ZGBjbH5eVH5noXCbaiin0j92dS7jx4gLpxuYT2Q8gpZbuIsT7fa58elvGeRkUUJ-AC5ueZxlv90yPWMm0OIbyrV7XZhuwYyKbV-ZczEbl2JpvBMe40CM-LdClQV66d_-Kw9a23SabBVfYgP5V-5OsagOIESvzZoO-27tGlNkV2a-hxqddDCOZv0HvRYAtp5S7EQrmRdEBu5gCNbf1eRFG424hxZUFVr2LdetYuKQLxJjDdUjf86ZwEUecrEaDSupiN1VC3CitdOwBVf6-R_N0VpN4VLVD5g',\n exampleAccountId: 'acc_5Et9iXrSSAZR2KSouQGAWi',\n exampleBusinessId: 'biz_3bh69bq1rk3dmXNoAKVonu',\n examplePaymentId: 'py_1NNeEnf4FbelxDCQN2RHcE',\n examplePayoutId: 'po_17745yESnHyEgWNeunmhmR',\n privateApiOrigin: '',\n privateAuthToken: '',\n};\n"],"mappings":"MAAaA,EAAS,CACpBC,aAAc,2BACdC,eAAgB,8BAChBC,eAAgB,o9BAChBC,iBAAkB,6BAClBC,kBAAmB,6BACnBC,iBAAkB,4BAClBC,gBAAiB,4BACjBC,iBAAkB,GAClBC,iBAAkB,W"}
@@ -1,2 +1,2 @@
1
- import{r as e,c as n,h as t,H as o}from"./p-cbb60191.js";import{c as i}from"./p-301a23aa.js";function r(e,n,t){return t={path:n,exports:{},require:function(e,n){return s()}},e(t,t.exports),t.exports}function s(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var a=r((function(e){(function(n){if(typeof window==="undefined")return;var t=0,o=false,i=false,r="message",s=r.length,a="[iFrameSizer]",c=a.length,f=null,u=window.requestAnimationFrame,d=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),l={},m=null,b=Object.freeze({autoResize:true,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:true,inPageLinks:false,enablePublicMethods:true,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,log:false,maxHeight:Infinity,maxWidth:Infinity,minHeight:0,minWidth:0,mouseEvents:true,resizeFrom:"parent",scrolling:false,sizeHeight:true,sizeWidth:false,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return true},onClosed:function(){},onInit:function(){},onMessage:function(){z("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return true}});function h(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function w(e,n,t){e.addEventListener(n,t,false)}function g(e,n,t){e.removeEventListener(n,t,false)}function p(){var e=["moz","webkit","o","ms"];var n;for(n=0;n<e.length&&!u;n+=1){u=window[e[n]+"RequestAnimationFrame"]}if(u){u=u.bind(window)}else{k("setup","RequestAnimationFrame not supported")}}function y(e){var n="Host page: "+e;if(window.top!==window.self){n=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+e:"Nested host page: "+e}return n}function v(e){return a+"["+y(e)+"]"}function j(e){return l[e]?l[e].log:o}function k(e,n){M("log",e,n,j(e))}function x(e,n){M("info",e,n,j(e))}function z(e,n){M("warn",e,n,true)}function M(e,n,t,o){if(true===o&&"object"===typeof window.console){console[e](v(n),t)}}function F(e){function n(){function e(){E(_);T(Q);V("onResized",_)}r("Height");r("Width");N(e,_,"init")}function t(){var e=G.slice(c).split(":");var n=e[1]?parseInt(e[1],10):0;var t=l[e[0]]&&l[e[0]].iframe;var r=getComputedStyle(t);return{iframe:t,id:e[0],height:n+o(r)+i(r),width:e[2],type:e[3]}}function o(e){if(e.boxSizing!=="border-box"){return 0}var n=e.paddingTop?parseInt(e.paddingTop,10):0;var t=e.paddingBottom?parseInt(e.paddingBottom,10):0;return n+t}function i(e){if(e.boxSizing!=="border-box"){return 0}var n=e.borderTopWidth?parseInt(e.borderTopWidth,10):0;var t=e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0;return n+t}function r(e){var n=Number(l[Q]["max"+e]),t=Number(l[Q]["min"+e]),o=e.toLowerCase(),i=Number(_[o]);k(Q,"Checking "+o+" is in range "+t+"-"+n);if(i<t){i=t;k(Q,"Set "+o+" to min value")}if(i>n){i=n;k(Q,"Set "+o+" to max value")}_[o]=""+i}function u(){function n(){function e(){var e=0,n=false;k(Q,"Checking connection is from allowed list of origins: "+o);for(;e<o.length;e++){if(o[e]===t){n=true;break}}return n}function n(){var e=l[Q]&&l[Q].remoteHost;k(Q,"Checking connection is from: "+e);return t===e}return o.constructor===Array?e():n()}var t=e.origin,o=l[Q]&&l[Q].checkOrigin;if(o&&""+t!=="null"&&!n()){throw new Error("Unexpected message received from: "+t+" for "+_.iframe.id+". Message was: "+e.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.")}return true}function d(){return a===(""+G).slice(0,c)&&G.slice(c).split(":")[0]in l}function m(){var e=_.type in{true:1,false:1,undefined:1};if(e){k(Q,"Ignoring init message from meta parent page")}return e}function b(e){return G.slice(G.indexOf(":")+s+e)}function h(e){k(Q,"onMessage passed: {iframe: "+_.iframe.id+", message: "+e+"}");V("onMessage",{iframe:_.iframe,message:JSON.parse(e)});k(Q,"--")}function p(){var e=document.body.getBoundingClientRect(),n=_.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:n.height,iframeWidth:n.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(n.top-e.top,10),offsetLeft:parseInt(n.left-e.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})}function y(e,n){function t(){A("Send Page Info","pageInfo:"+p(),e,n)}D(t,32,n)}function v(){function e(e,t){function i(){if(l[o]){y(l[o].iframe,o)}else{n()}}["scroll","resize"].forEach((function(n){k(o,e+n+" listener for sendPageInfo");t(window,n,i)}))}function n(){e("Remove ",g)}function t(){e("Add ",w)}var o=Q;t();if(l[o]){l[o].stopPageInfo=n}}function j(){if(l[Q]&&l[Q].stopPageInfo){l[Q].stopPageInfo();delete l[Q].stopPageInfo}}function M(){var e=true;if(null===_.iframe){z(Q,"IFrame ("+_.id+") not found");e=false}return e}function F(e){var n=e.getBoundingClientRect();C(Q);return{x:Math.floor(Number(n.left)+Number(f.x)),y:Math.floor(Number(n.top)+Number(f.y))}}function S(e){function n(){f=r;L();k(Q,"--")}function t(){return{x:Number(_.width)+i.x,y:Number(_.height)+i.y}}function o(){if(window.parentIFrame){window.parentIFrame["scrollTo"+(e?"Offset":"")](r.x,r.y)}else{z(Q,"Unable to scroll to requested position, window.parentIFrame not found")}}var i=e?F(_.iframe):{x:0,y:0},r=t();k(Q,"Reposition requested from iFrame (offset x:"+i.x+" y:"+i.y+")");if(window.top===window.self){n()}else{o()}}function L(){if(false===V("onScroll",f)){W()}else{T(Q)}}function q(e){function n(){var e=F(r);k(Q,"Moving to in page link (#"+o+") at x: "+e.x+" y: "+e.y);f={x:e.x,y:e.y};L();k(Q,"--")}function t(){if(window.parentIFrame){window.parentIFrame.moveToAnchor(o)}else{k(Q,"In page link #"+o+" not found and window.parentIFrame not found")}}var o=e.split("#")[1]||"",i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];if(r){n()}else if(window.top===window.self){k(Q,"In page link #"+o+" not found")}else{t()}}function P(e){var n={};if(Number(_.width)===0&&Number(_.height)===0){var t=b(9).split(":");n={x:t[1],y:t[0]}}else{n={x:_.width,y:_.height}}V(e,{iframe:_.iframe,screenX:Number(n.x),screenY:Number(n.y),type:_.type})}function V(e,n){return I(Q,e,n)}function $(){if(l[Q]&&l[Q].firstRun)B();switch(_.type){case"close":{O(_.iframe);break}case"message":{h(b(6));break}case"mouseenter":{P("onMouseEnter");break}case"mouseleave":{P("onMouseLeave");break}case"autoResize":{l[Q].autoResize=JSON.parse(b(9));break}case"scrollTo":{S(false);break}case"scrollToOffset":{S(true);break}case"pageInfo":{y(l[Q]&&l[Q].iframe,Q);v();break}case"pageInfoStop":{j();break}case"inPageLink":{q(b(9));break}case"reset":{R(_);break}case"init":{n();V("onInit",_.iframe);break}default:{if(Number(_.width)===0&&Number(_.height)===0){z("Unsupported message received ("+_.type+"), this is likely due to the iframe containing a later "+"version of iframe-resizer than the parent page")}else{n()}}}}function U(e){var n=true;if(!l[e]){n=false;z(_.type+" No settings for "+e+". Message was: "+G)}return n}function J(){for(var e in l){A("iFrame requested init",H(e),l[e].iframe,e)}}function B(){if(l[Q]){l[Q].firstRun=false}}var G=e.data,_={},Q=null;if("[iFrameResizerChild]Ready"===G){J()}else if(d()){_=t();Q=_.id;if(l[Q]){l[Q].loaded=true}if(!m()&&U(Q)){k(Q,"Received: "+G);if(M()&&u()){$()}}}else{x(Q,"Ignored: "+G)}}function I(e,n,t){var o=null,i=null;if(l[e]){o=l[e][n];if("function"===typeof o){i=o(t)}else{throw new TypeError(n+" on iFrame["+e+"] is not a function")}}return i}function S(e){var n=e.id;delete l[n]}function O(e){var n=e.id;if(I(n,"onClose",n)===false){k(n,"Close iframe cancelled by onClose event");return}k(n,"Removing iFrame: "+n);try{if(e.parentNode){e.parentNode.removeChild(e)}}catch(e){z(e)}I(n,"onClosed",n);k(n,"--");S(e)}function C(e){if(null===f){f={x:window.pageXOffset===n?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===n?document.documentElement.scrollTop:window.pageYOffset};k(e,"Get page position: "+f.x+","+f.y)}}function T(e){if(null!==f){window.scrollTo(f.x,f.y);k(e,"Set page position: "+f.x+","+f.y);W()}}function W(){f=null}function R(e){function n(){E(e);A("reset","reset",e.iframe,e.id)}k(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame"));C(e.id);N(n,e,"reset")}function E(e){function n(n){if(!e.id){k("undefined","messageData id not set");return}e.iframe.style[n]=e[n]+"px";k(e.id,"IFrame ("+r+") "+n+" set to "+e[n]+"px")}function t(n){if(!i&&"0"===e[n]){i=true;k(r,"Hidden iFrame detected, creating visibility listener");$()}}function o(e){n(e);t(e)}var r=e.iframe.id;if(l[r]){if(l[r].sizeHeight){o("height")}if(l[r].sizeWidth){o("width")}}}function N(e,n,t){if(t!==n.type&&u&&!window.jasmine){k(n.id,"Requesting animation frame");u(e)}else{e()}}function A(e,n,t,o,i){function r(){var i=l[o]&&l[o].targetOrigin;k(o,"["+e+"] Sending msg to iframe["+o+"] ("+n+") targetOrigin: "+i);t.contentWindow.postMessage(a+n,i)}function s(){z(o,"["+e+"] IFrame("+o+") not found")}function c(){if(t&&"contentWindow"in t&&null!==t.contentWindow){r()}else{s()}}function f(){function e(){if(l[o]&&!l[o].loaded&&!u){u=true;z(o,"IFrame has not responded within "+l[o].warningTimeout/1e3+" 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.")}}if(!!i&&l[o]&&!!l[o].warningTimeout){l[o].msgTimeout=setTimeout(e,l[o].warningTimeout)}}var u=false;o=o||t.id;if(l[o]){c();f()}}function H(e){return e+":"+l[e].bodyMarginV1+":"+l[e].sizeWidth+":"+l[e].log+":"+l[e].interval+":"+l[e].enablePublicMethods+":"+l[e].autoResize+":"+l[e].bodyMargin+":"+l[e].heightCalculationMethod+":"+l[e].bodyBackground+":"+l[e].bodyPadding+":"+l[e].tolerance+":"+l[e].inPageLinks+":"+l[e].resizeFrom+":"+l[e].widthCalculationMethod+":"+l[e].mouseEvents}function L(e){return typeof e==="number"}function q(e,i){function r(){function n(n){var t=l[F][n];if(Infinity!==t&&0!==t){e.style[n]=L(t)?t+"px":t;k(F,"Set "+n+" = "+e.style[n])}}function t(e){if(l[F]["min"+e]>l[F]["max"+e]){throw new Error("Value for min"+e+" can not be greater than max"+e)}}t("Height");t("Width");n("maxHeight");n("minHeight");n("maxWidth");n("minWidth")}function s(){var e=i&&i.id||b.id+t++;if(null!==document.getElementById(e)){e+=t++}return e}function a(n){if(typeof n!=="string"){throw new TypeError("Invaild id for iFrame. Expected String")}if(""===n){e.id=n=s();o=(i||{}).log;k(n,"Added missing iframe ID: "+n+" ("+e.src+")")}return n}function c(){k(F,"IFrame scrolling "+(l[F]&&l[F].scrolling?"enabled":"disabled")+" for "+F);e.style.overflow=false===(l[F]&&l[F].scrolling)?"hidden":"auto";switch(l[F]&&l[F].scrolling){case"omit":{break}case true:{e.scrolling="yes";break}case false:{e.scrolling="no";break}default:{e.scrolling=l[F]?l[F].scrolling:"no"}}}function f(){if("number"===typeof(l[F]&&l[F].bodyMargin)||"0"===(l[F]&&l[F].bodyMargin)){l[F].bodyMarginV1=l[F].bodyMargin;l[F].bodyMargin=""+l[F].bodyMargin+"px"}}function u(){var n=l[F]&&l[F].firstRun,t=l[F]&&l[F].heightCalculationMethod in d;if(!n&&t){R({iframe:e,height:0,width:0,type:"init"})}}function m(){if(l[F]){l[F].iframe.iFrameResizer={close:O.bind(null,l[F].iframe),removeListeners:S.bind(null,l[F].iframe),resize:A.bind(null,"Window resize","resize",l[F].iframe),moveToAnchor:function(e){A("Move to anchor","moveToAnchor:"+e,l[F].iframe,F)},sendMessage:function(e){e=JSON.stringify(e);A("Send Message","message:"+e,l[F].iframe,F)}}}}function g(t){function o(){A("iFrame.onload",t,e,n,true);u()}function i(n){if(!e.parentNode){return}var t=new n((function(n){n.forEach((function(n){var t=Array.prototype.slice.call(n.removedNodes);t.forEach((function(n){if(n===e){O(e)}}))}))}));t.observe(e.parentNode,{childList:true})}var r=h();if(r){i(r)}w(e,"load",o);A("init",t,e,n,true)}function p(e){if("object"!==typeof e){throw new TypeError("Options is not an object")}}function y(e){for(var n in b){if(Object.prototype.hasOwnProperty.call(b,n)){l[F][n]=Object.prototype.hasOwnProperty.call(e,n)?e[n]:b[n]}}}function v(e){return""===e||null!==e.match(/^(about:blank|javascript:|file:\/\/)/)?"*":e}function j(e){var n=e.split("Callback");if(n.length===2){var t="on"+n[0].charAt(0).toUpperCase()+n[0].slice(1);this[t]=this[e];delete this[e];z(F,"Deprecated: '"+e+"' has been renamed '"+t+"'. The old method will be removed in the next major version.")}}function x(n){n=n||{};l[F]=Object.create(null);l[F].iframe=e;l[F].firstRun=true;l[F].remoteHost=e.src&&e.src.split("/").slice(0,3).join("/");p(n);Object.keys(n).forEach(j,n);y(n);if(l[F]){l[F].targetOrigin=true===l[F].checkOrigin?v(l[F].remoteHost):"*"}}function M(){return F in l&&"iFrameResizer"in e}var F=a(e.id);if(M()){z(F,"Ignored iFrame, already setup.")}else{x(i);c();r();f();g(H(F));m()}}function P(e,n){if(null===m){m=setTimeout((function(){m=null;e()}),n)}}var V={};function D(e,n,t){if(!V[t]){V[t]=setTimeout((function(){V[t]=null;e()}),n)}}function $(){function e(){function e(e){function n(n){return"0px"===(l[e]&&l[e].iframe.style[n])}function t(e){return null!==e.offsetParent}if(l[e]&&t(l[e].iframe)&&(n("height")||n("width"))){A("Visibility change","resize",l[e].iframe,e)}}Object.keys(l).forEach((function(n){e(n)}))}function n(n){k("window","Mutation observed: "+n[0].target+" "+n[0].type);P(e,16)}function t(){var e=document.querySelector("body"),t={attributes:true,attributeOldValue:false,characterData:true,characterDataOldValue:false,childList:true,subtree:true},i=new o(n);i.observe(e,t)}var o=h();if(o){t()}}function U(e){function n(){B("Window "+e,"resize")}k("window","Trigger event: "+e);P(n,16)}function J(){function e(){B("Tab Visible","resize")}if("hidden"!==document.visibilityState){k("document","Trigger event: Visibility change");P(e,16)}}function B(e,n){function t(e){return l[e]&&"parent"===l[e].resizeFrom&&l[e].autoResize&&!l[e].firstRun}Object.keys(l).forEach((function(o){if(t(o)){A(e,n,l[o].iframe,o)}}))}function G(){w(window,"message",F);w(window,"resize",(function(){U("resize")}));w(document,"visibilitychange",J);w(document,"-webkit-visibilitychange",J)}function _(){function e(e,n){function t(){if(!n.tagName){throw new TypeError("Object is not a valid DOM element")}else if("IFRAME"!==n.tagName.toUpperCase()){throw new TypeError("Expected <IFRAME> tag, found <"+n.tagName+">")}}if(n){t();q(n,e);o.push(n)}}function t(e){if(e&&e.enablePublicMethods){z("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}}var o;p();G();return function i(r,s){o=[];t(r);switch(typeof s){case"undefined":case"string":{Array.prototype.forEach.call(document.querySelectorAll(s||"iframe"),e.bind(n,r));break}case"object":{e(r,s);break}default:{throw new TypeError("Unexpected data type ("+typeof s+")")}}return o}}function Q(e){if(!e.fn){x("","Unable to bind to jQuery, it is not fully loaded.")}else if(!e.fn.iFrameResize){e.fn.iFrameResize=function e(n){function t(e,t){q(t,n)}return this.filter("iframe").each(t).end()}}}if(window.jQuery!==n){Q(window.jQuery)}if(typeof n==="function"&&n.amd){n([],_)}else{e.exports=_()}window.iFrameResize=window.iFrameResize||_()})()}));const c={card:{ready:"justifi.card.ready",tokenize:"justifi.card.tokenize",validate:"justifi.card.validate",resize:"justifi.card.resize",styleOverrides:"justifi.card.styleOverrides"},bankAccount:{ready:"justifi.bankAccount.ready",tokenize:"justifi.bankAccount.tokenize",validate:"justifi.bankAccount.validate",resize:"justifi.bankAccount.resize",styleOverrides:"justifi.bankAccount.styleOverrides"}};const f="@justifi/webcomponents";const u="4.7.0-rc.2";const d="JustiFi Web Components";const l="dist/index.cjs.js";const m="dist/components/index.js";const b="dist/esm/index.mjs";const h="dist/esm/index.mjs";const w="dist/types/index.d.ts";const g="dist/collection/collection-manifest.json";const p={type:"git",url:"git+https://github.com/justifi-tech/web-component-library.git"};const y={registry:"https://registry.npmjs.org"};const v=["dist/","loader/"];const j={build:"npm run build:prod","build:dev":"stencil build --docs","build:staging":"stencil build --docs","build:prod":"stencil build --docs",start:'concurrently --restart-tries 3 -c "bgBlue.bold,bgMagenta.bold,bgGreen.bold" "npm run start-stencil" "npm run storybook"',"start-stencil":"stencil build --watch",test:"stencil test --spec","test:watch":"stencil test --spec --watchAll","test:e2e":"stencil test --e2e",generate:"stencil generate",storybook:"storybook dev -p 6006 --quiet","build-storybook":"storybook build -o ../docs"};const k={"@stencil/core":"^4.0.5",bootstrap:"^5.2.3","chart.js":"^4.4.1","date-fns":"^2.29.3","dinero.js":"^1.9.1","iframe-resizer":"^4.3.7",imask:"^7.1.3",rxjs:"^7.8.1","ts-dedent":"^2.2.0",uuid:"^9.0.0",yup:"^1.0.0"};const x={"@babel/preset-env":"^7.21.5","@babel/preset-react":"^7.18.6","@babel/preset-typescript":"^7.21.5","@pxtrn/storybook-addon-docs-stencil":"^6.4.1","@stencil/angular-output-target":"^0.7.1","@stencil/react-output-target":"^0.5.3","@stencil/sass":"^3.0.1","@stencil/store":"^2.0.8","@stencil/vue-output-target":"^0.8.6","@storybook/addon-actions":"^7.0.4","@storybook/addon-essentials":"^7.0.4","@storybook/addon-interactions":"^7.0.4","@storybook/addon-links":"^7.0.4","@storybook/html":"^7.0.4","@storybook/html-webpack5":"^7.0.4","@storybook/jest":"^0.1.0","@storybook/testing-library":"^0.1.0","@types/jest":"27.0.3","@types/node":"^20.1.4","@types/react":"^18.0.37","@types/react-dom":"^18.0.11",concurrently:"^7.6.0",dotenv:"^16.3.1",jest:"^27.4.5","jest-cli":"^27.4.5",puppeteer:"^10.0.0",react:"^18.2.0","react-dom":"^18.2.0","rollup-plugin-replace":"^2.2.0",storybook:"^7.0.4"};const z="MIT";const M="507bac1d941eae6e1f56e185ecd9bc9d22637783";const F={name:f,version:u,description:d,main:l,module:m,es2015:b,es2017:h,types:w,collection:g,"collection:main":"dist/collection/index.js",repository:p,publishConfig:y,files:v,scripts:j,dependencies:k,devDependencies:x,license:z,gitHead:M};const I=()=>{const e=getComputedStyle(document.body);const n={loadGoogleFont:e.getPropertyValue("--jfi-load-google-font"),layout:{fontFamily:e.getPropertyValue("--jfi-layout-font-family"),padding:e.getPropertyValue("--jfi-layout-padding"),formControlSpacingHorizontal:e.getPropertyValue("--jfi-layout-form-control-spacing-x"),formControlSpacingVertical:e.getPropertyValue("--jfi-layout-form-control-spacing-y")},formControl:{backgroundColor:e.getPropertyValue("--jfi-form-control-background-color"),borderColor:e.getPropertyValue("--jfi-form-control-border-color"),borderColorFocus:e.getPropertyValue("--jfi-form-control-border-color-focus"),borderColorError:e.getPropertyValue("--jfi-form-control-border-color-error"),borderWidth:e.getPropertyValue("--jfi-form-control-border-width"),borderBottomWidth:e.getPropertyValue("--jfi-form-control-border-bottom-width"),borderLeftWidth:e.getPropertyValue("--jfi-form-control-border-left-width"),borderRightWidth:e.getPropertyValue("--jfi-form-control-border-right-width"),borderTopWidth:e.getPropertyValue("--jfi-form-control-border-top-width"),borderRadius:e.getPropertyValue("--jfi-form-control-border-radius"),borderStyle:e.getPropertyValue("--jfi-form-control-border-style"),boxShadow:e.getPropertyValue("--jfi-form-control-box-shadow"),boxShadowError:e.getPropertyValue("--jfi-form-control-box-shadow-error"),boxShadowErrorFocus:e.getPropertyValue("--jfi-form-control-box-shadow-error-focus"),boxShadowFocus:e.getPropertyValue("--jfi-form-control-box-shadow-focus"),color:e.getPropertyValue("--jfi-form-control-color"),colorFocus:e.getPropertyValue("--jfi-form-control-color-focus"),fontSize:e.getPropertyValue("--jfi-form-control-font-size"),fontWeight:e.getPropertyValue("--jfi-form-control-font-weight"),lineHeight:e.getPropertyValue("--jfi-form-control-line-height"),margin:e.getPropertyValue("--jfi-form-control-margin"),padding:e.getPropertyValue("--jfi-form-control-padding")},formLabel:{color:e.getPropertyValue("--jfi-form-label-color"),fontFamily:e.getPropertyValue("--jfi-form-label-font-family"),fontSize:e.getPropertyValue("--jfi-form-label-font-size"),fontWeight:e.getPropertyValue("--jfi-form-label-font-weight"),margin:e.getPropertyValue("--jfi-form-label-margin")},errorMessage:{color:e.getPropertyValue("--jfi-error-message-color"),margin:e.getPropertyValue("--jfi-error-message-margin"),fontSize:e.getPropertyValue("--jfi-error-message-font-size")}};return n};const S=":host{display:block}justifi-payment-method-form iframe{border:none;width:100%}iframe{width:1px;min-width:100%}";const O=class{constructor(t){e(this,t);this.paymentMethodFormReady=n(this,"paymentMethodFormReady",7);this.paymentMethodFormTokenize=n(this,"paymentMethodFormTokenize",7);this.computedTheme=I();this.paymentMethodFormType=undefined;this.paymentMethodFormValidationMode=undefined;this.iframeOrigin=undefined;this.singleLine=undefined}connectedCallback(){window.addEventListener("message",this.dispatchMessageEvent.bind(this))}disconnectedCallback(){window.removeEventListener("message",this.dispatchMessageEvent.bind(this))}sendStyleOverrides(){if(this.computedTheme){this.postMessage(c[this.paymentMethodFormType].styleOverrides,{styleOverrides:this.computedTheme})}}dispatchMessageEvent(e){const n=e.data;const t=n.eventType;const o=n.data;if(t===c[this.paymentMethodFormType].ready){this.paymentMethodFormReady.emit(o)}}postMessage(e,n){var t,o;(o=(t=this.iframeElement)===null||t===void 0?void 0:t.contentWindow)===null||o===void 0?void 0:o.postMessage(Object.assign({eventType:e},n),i.iframeOrigin)}async resize(){this.postMessage(c[this.paymentMethodFormType].resize)}async postMessageWithResponseListener(e,n){return new Promise((t=>{const o=n=>{if(n.data.eventType!==e)return;window.removeEventListener("message",o);t(n.data.data)};window.addEventListener("message",o);this.postMessage(e,n)}))}async tokenize(e,n,t){const o=c[this.paymentMethodFormType].tokenize;const i={clientId:e,componentVersion:F.version,paymentMethodMetadata:n,account:t};return this.postMessageWithResponseListener(o,i)}async validate(){return this.postMessageWithResponseListener(c[this.paymentMethodFormType].validate)}composeQueryParams(e){const n=e.map((n=>{if(n===e[0]){return n=`?${n}`}else{return n=`&${n}`}}));return n.join("")}getIframeSrc(){const e=i.iframeOrigin;let n=`${e}/${this.paymentMethodFormType}`;let t=[];if(this.paymentMethodFormValidationMode){t.push(`validationMode=${this.paymentMethodFormValidationMode}`)}if(this.singleLine){t.push(`singleLine=${this.singleLine}`)}return n.concat(this.composeQueryParams(t))}render(){return t(o,null,t("iframe",{id:`justifi-payment-method-form-${this.paymentMethodFormType}`,src:this.getIframeSrc(),ref:e=>{this.iframeElement=e},onLoad:()=>{a(this.iframeElement);this.sendStyleOverrides()}}))}};O.style=S;export{O as justifi_payment_method_form};
2
- //# sourceMappingURL=p-d7630f46.entry.js.map
1
+ import{r as e,c as n,h as t,H as o}from"./p-cbb60191.js";import{c as i}from"./p-9b6dcac5.js";function r(e,n,t){return t={path:n,exports:{},require:function(e,n){return s()}},e(t,t.exports),t.exports}function s(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var a=r((function(e){(function(n){if(typeof window==="undefined")return;var t=0,o=false,i=false,r="message",s=r.length,a="[iFrameSizer]",c=a.length,f=null,u=window.requestAnimationFrame,d=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),l={},m=null,h=Object.freeze({autoResize:true,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:true,inPageLinks:false,enablePublicMethods:true,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,log:false,maxHeight:Infinity,maxWidth:Infinity,minHeight:0,minWidth:0,mouseEvents:true,resizeFrom:"parent",scrolling:false,sizeHeight:true,sizeWidth:false,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return true},onClosed:function(){},onInit:function(){},onMessage:function(){z("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return true}});function b(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function w(e,n,t){e.addEventListener(n,t,false)}function g(e,n,t){e.removeEventListener(n,t,false)}function p(){var e=["moz","webkit","o","ms"];var n;for(n=0;n<e.length&&!u;n+=1){u=window[e[n]+"RequestAnimationFrame"]}if(u){u=u.bind(window)}else{k("setup","RequestAnimationFrame not supported")}}function y(e){var n="Host page: "+e;if(window.top!==window.self){n=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+e:"Nested host page: "+e}return n}function v(e){return a+"["+y(e)+"]"}function j(e){return l[e]?l[e].log:o}function k(e,n){M("log",e,n,j(e))}function x(e,n){M("info",e,n,j(e))}function z(e,n){M("warn",e,n,true)}function M(e,n,t,o){if(true===o&&"object"===typeof window.console){console[e](v(n),t)}}function F(e){function n(){function e(){E(_);T(Q);V("onResized",_)}r("Height");r("Width");N(e,_,"init")}function t(){var e=G.slice(c).split(":");var n=e[1]?parseInt(e[1],10):0;var t=l[e[0]]&&l[e[0]].iframe;var r=getComputedStyle(t);return{iframe:t,id:e[0],height:n+o(r)+i(r),width:e[2],type:e[3]}}function o(e){if(e.boxSizing!=="border-box"){return 0}var n=e.paddingTop?parseInt(e.paddingTop,10):0;var t=e.paddingBottom?parseInt(e.paddingBottom,10):0;return n+t}function i(e){if(e.boxSizing!=="border-box"){return 0}var n=e.borderTopWidth?parseInt(e.borderTopWidth,10):0;var t=e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0;return n+t}function r(e){var n=Number(l[Q]["max"+e]),t=Number(l[Q]["min"+e]),o=e.toLowerCase(),i=Number(_[o]);k(Q,"Checking "+o+" is in range "+t+"-"+n);if(i<t){i=t;k(Q,"Set "+o+" to min value")}if(i>n){i=n;k(Q,"Set "+o+" to max value")}_[o]=""+i}function u(){function n(){function e(){var e=0,n=false;k(Q,"Checking connection is from allowed list of origins: "+o);for(;e<o.length;e++){if(o[e]===t){n=true;break}}return n}function n(){var e=l[Q]&&l[Q].remoteHost;k(Q,"Checking connection is from: "+e);return t===e}return o.constructor===Array?e():n()}var t=e.origin,o=l[Q]&&l[Q].checkOrigin;if(o&&""+t!=="null"&&!n()){throw new Error("Unexpected message received from: "+t+" for "+_.iframe.id+". Message was: "+e.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.")}return true}function d(){return a===(""+G).slice(0,c)&&G.slice(c).split(":")[0]in l}function m(){var e=_.type in{true:1,false:1,undefined:1};if(e){k(Q,"Ignoring init message from meta parent page")}return e}function h(e){return G.slice(G.indexOf(":")+s+e)}function b(e){k(Q,"onMessage passed: {iframe: "+_.iframe.id+", message: "+e+"}");V("onMessage",{iframe:_.iframe,message:JSON.parse(e)});k(Q,"--")}function p(){var e=document.body.getBoundingClientRect(),n=_.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:n.height,iframeWidth:n.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(n.top-e.top,10),offsetLeft:parseInt(n.left-e.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})}function y(e,n){function t(){A("Send Page Info","pageInfo:"+p(),e,n)}D(t,32,n)}function v(){function e(e,t){function i(){if(l[o]){y(l[o].iframe,o)}else{n()}}["scroll","resize"].forEach((function(n){k(o,e+n+" listener for sendPageInfo");t(window,n,i)}))}function n(){e("Remove ",g)}function t(){e("Add ",w)}var o=Q;t();if(l[o]){l[o].stopPageInfo=n}}function j(){if(l[Q]&&l[Q].stopPageInfo){l[Q].stopPageInfo();delete l[Q].stopPageInfo}}function M(){var e=true;if(null===_.iframe){z(Q,"IFrame ("+_.id+") not found");e=false}return e}function F(e){var n=e.getBoundingClientRect();C(Q);return{x:Math.floor(Number(n.left)+Number(f.x)),y:Math.floor(Number(n.top)+Number(f.y))}}function S(e){function n(){f=r;L();k(Q,"--")}function t(){return{x:Number(_.width)+i.x,y:Number(_.height)+i.y}}function o(){if(window.parentIFrame){window.parentIFrame["scrollTo"+(e?"Offset":"")](r.x,r.y)}else{z(Q,"Unable to scroll to requested position, window.parentIFrame not found")}}var i=e?F(_.iframe):{x:0,y:0},r=t();k(Q,"Reposition requested from iFrame (offset x:"+i.x+" y:"+i.y+")");if(window.top===window.self){n()}else{o()}}function L(){if(false===V("onScroll",f)){W()}else{T(Q)}}function q(e){function n(){var e=F(r);k(Q,"Moving to in page link (#"+o+") at x: "+e.x+" y: "+e.y);f={x:e.x,y:e.y};L();k(Q,"--")}function t(){if(window.parentIFrame){window.parentIFrame.moveToAnchor(o)}else{k(Q,"In page link #"+o+" not found and window.parentIFrame not found")}}var o=e.split("#")[1]||"",i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];if(r){n()}else if(window.top===window.self){k(Q,"In page link #"+o+" not found")}else{t()}}function P(e){var n={};if(Number(_.width)===0&&Number(_.height)===0){var t=h(9).split(":");n={x:t[1],y:t[0]}}else{n={x:_.width,y:_.height}}V(e,{iframe:_.iframe,screenX:Number(n.x),screenY:Number(n.y),type:_.type})}function V(e,n){return I(Q,e,n)}function $(){if(l[Q]&&l[Q].firstRun)B();switch(_.type){case"close":{O(_.iframe);break}case"message":{b(h(6));break}case"mouseenter":{P("onMouseEnter");break}case"mouseleave":{P("onMouseLeave");break}case"autoResize":{l[Q].autoResize=JSON.parse(h(9));break}case"scrollTo":{S(false);break}case"scrollToOffset":{S(true);break}case"pageInfo":{y(l[Q]&&l[Q].iframe,Q);v();break}case"pageInfoStop":{j();break}case"inPageLink":{q(h(9));break}case"reset":{R(_);break}case"init":{n();V("onInit",_.iframe);break}default:{if(Number(_.width)===0&&Number(_.height)===0){z("Unsupported message received ("+_.type+"), this is likely due to the iframe containing a later "+"version of iframe-resizer than the parent page")}else{n()}}}}function U(e){var n=true;if(!l[e]){n=false;z(_.type+" No settings for "+e+". Message was: "+G)}return n}function J(){for(var e in l){A("iFrame requested init",H(e),l[e].iframe,e)}}function B(){if(l[Q]){l[Q].firstRun=false}}var G=e.data,_={},Q=null;if("[iFrameResizerChild]Ready"===G){J()}else if(d()){_=t();Q=_.id;if(l[Q]){l[Q].loaded=true}if(!m()&&U(Q)){k(Q,"Received: "+G);if(M()&&u()){$()}}}else{x(Q,"Ignored: "+G)}}function I(e,n,t){var o=null,i=null;if(l[e]){o=l[e][n];if("function"===typeof o){i=o(t)}else{throw new TypeError(n+" on iFrame["+e+"] is not a function")}}return i}function S(e){var n=e.id;delete l[n]}function O(e){var n=e.id;if(I(n,"onClose",n)===false){k(n,"Close iframe cancelled by onClose event");return}k(n,"Removing iFrame: "+n);try{if(e.parentNode){e.parentNode.removeChild(e)}}catch(e){z(e)}I(n,"onClosed",n);k(n,"--");S(e)}function C(e){if(null===f){f={x:window.pageXOffset===n?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===n?document.documentElement.scrollTop:window.pageYOffset};k(e,"Get page position: "+f.x+","+f.y)}}function T(e){if(null!==f){window.scrollTo(f.x,f.y);k(e,"Set page position: "+f.x+","+f.y);W()}}function W(){f=null}function R(e){function n(){E(e);A("reset","reset",e.iframe,e.id)}k(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame"));C(e.id);N(n,e,"reset")}function E(e){function n(n){if(!e.id){k("undefined","messageData id not set");return}e.iframe.style[n]=e[n]+"px";k(e.id,"IFrame ("+r+") "+n+" set to "+e[n]+"px")}function t(n){if(!i&&"0"===e[n]){i=true;k(r,"Hidden iFrame detected, creating visibility listener");$()}}function o(e){n(e);t(e)}var r=e.iframe.id;if(l[r]){if(l[r].sizeHeight){o("height")}if(l[r].sizeWidth){o("width")}}}function N(e,n,t){if(t!==n.type&&u&&!window.jasmine){k(n.id,"Requesting animation frame");u(e)}else{e()}}function A(e,n,t,o,i){function r(){var i=l[o]&&l[o].targetOrigin;k(o,"["+e+"] Sending msg to iframe["+o+"] ("+n+") targetOrigin: "+i);t.contentWindow.postMessage(a+n,i)}function s(){z(o,"["+e+"] IFrame("+o+") not found")}function c(){if(t&&"contentWindow"in t&&null!==t.contentWindow){r()}else{s()}}function f(){function e(){if(l[o]&&!l[o].loaded&&!u){u=true;z(o,"IFrame has not responded within "+l[o].warningTimeout/1e3+" 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.")}}if(!!i&&l[o]&&!!l[o].warningTimeout){l[o].msgTimeout=setTimeout(e,l[o].warningTimeout)}}var u=false;o=o||t.id;if(l[o]){c();f()}}function H(e){return e+":"+l[e].bodyMarginV1+":"+l[e].sizeWidth+":"+l[e].log+":"+l[e].interval+":"+l[e].enablePublicMethods+":"+l[e].autoResize+":"+l[e].bodyMargin+":"+l[e].heightCalculationMethod+":"+l[e].bodyBackground+":"+l[e].bodyPadding+":"+l[e].tolerance+":"+l[e].inPageLinks+":"+l[e].resizeFrom+":"+l[e].widthCalculationMethod+":"+l[e].mouseEvents}function L(e){return typeof e==="number"}function q(e,i){function r(){function n(n){var t=l[F][n];if(Infinity!==t&&0!==t){e.style[n]=L(t)?t+"px":t;k(F,"Set "+n+" = "+e.style[n])}}function t(e){if(l[F]["min"+e]>l[F]["max"+e]){throw new Error("Value for min"+e+" can not be greater than max"+e)}}t("Height");t("Width");n("maxHeight");n("minHeight");n("maxWidth");n("minWidth")}function s(){var e=i&&i.id||h.id+t++;if(null!==document.getElementById(e)){e+=t++}return e}function a(n){if(typeof n!=="string"){throw new TypeError("Invaild id for iFrame. Expected String")}if(""===n){e.id=n=s();o=(i||{}).log;k(n,"Added missing iframe ID: "+n+" ("+e.src+")")}return n}function c(){k(F,"IFrame scrolling "+(l[F]&&l[F].scrolling?"enabled":"disabled")+" for "+F);e.style.overflow=false===(l[F]&&l[F].scrolling)?"hidden":"auto";switch(l[F]&&l[F].scrolling){case"omit":{break}case true:{e.scrolling="yes";break}case false:{e.scrolling="no";break}default:{e.scrolling=l[F]?l[F].scrolling:"no"}}}function f(){if("number"===typeof(l[F]&&l[F].bodyMargin)||"0"===(l[F]&&l[F].bodyMargin)){l[F].bodyMarginV1=l[F].bodyMargin;l[F].bodyMargin=""+l[F].bodyMargin+"px"}}function u(){var n=l[F]&&l[F].firstRun,t=l[F]&&l[F].heightCalculationMethod in d;if(!n&&t){R({iframe:e,height:0,width:0,type:"init"})}}function m(){if(l[F]){l[F].iframe.iFrameResizer={close:O.bind(null,l[F].iframe),removeListeners:S.bind(null,l[F].iframe),resize:A.bind(null,"Window resize","resize",l[F].iframe),moveToAnchor:function(e){A("Move to anchor","moveToAnchor:"+e,l[F].iframe,F)},sendMessage:function(e){e=JSON.stringify(e);A("Send Message","message:"+e,l[F].iframe,F)}}}}function g(t){function o(){A("iFrame.onload",t,e,n,true);u()}function i(n){if(!e.parentNode){return}var t=new n((function(n){n.forEach((function(n){var t=Array.prototype.slice.call(n.removedNodes);t.forEach((function(n){if(n===e){O(e)}}))}))}));t.observe(e.parentNode,{childList:true})}var r=b();if(r){i(r)}w(e,"load",o);A("init",t,e,n,true)}function p(e){if("object"!==typeof e){throw new TypeError("Options is not an object")}}function y(e){for(var n in h){if(Object.prototype.hasOwnProperty.call(h,n)){l[F][n]=Object.prototype.hasOwnProperty.call(e,n)?e[n]:h[n]}}}function v(e){return""===e||null!==e.match(/^(about:blank|javascript:|file:\/\/)/)?"*":e}function j(e){var n=e.split("Callback");if(n.length===2){var t="on"+n[0].charAt(0).toUpperCase()+n[0].slice(1);this[t]=this[e];delete this[e];z(F,"Deprecated: '"+e+"' has been renamed '"+t+"'. The old method will be removed in the next major version.")}}function x(n){n=n||{};l[F]=Object.create(null);l[F].iframe=e;l[F].firstRun=true;l[F].remoteHost=e.src&&e.src.split("/").slice(0,3).join("/");p(n);Object.keys(n).forEach(j,n);y(n);if(l[F]){l[F].targetOrigin=true===l[F].checkOrigin?v(l[F].remoteHost):"*"}}function M(){return F in l&&"iFrameResizer"in e}var F=a(e.id);if(M()){z(F,"Ignored iFrame, already setup.")}else{x(i);c();r();f();g(H(F));m()}}function P(e,n){if(null===m){m=setTimeout((function(){m=null;e()}),n)}}var V={};function D(e,n,t){if(!V[t]){V[t]=setTimeout((function(){V[t]=null;e()}),n)}}function $(){function e(){function e(e){function n(n){return"0px"===(l[e]&&l[e].iframe.style[n])}function t(e){return null!==e.offsetParent}if(l[e]&&t(l[e].iframe)&&(n("height")||n("width"))){A("Visibility change","resize",l[e].iframe,e)}}Object.keys(l).forEach((function(n){e(n)}))}function n(n){k("window","Mutation observed: "+n[0].target+" "+n[0].type);P(e,16)}function t(){var e=document.querySelector("body"),t={attributes:true,attributeOldValue:false,characterData:true,characterDataOldValue:false,childList:true,subtree:true},i=new o(n);i.observe(e,t)}var o=b();if(o){t()}}function U(e){function n(){B("Window "+e,"resize")}k("window","Trigger event: "+e);P(n,16)}function J(){function e(){B("Tab Visible","resize")}if("hidden"!==document.visibilityState){k("document","Trigger event: Visibility change");P(e,16)}}function B(e,n){function t(e){return l[e]&&"parent"===l[e].resizeFrom&&l[e].autoResize&&!l[e].firstRun}Object.keys(l).forEach((function(o){if(t(o)){A(e,n,l[o].iframe,o)}}))}function G(){w(window,"message",F);w(window,"resize",(function(){U("resize")}));w(document,"visibilitychange",J);w(document,"-webkit-visibilitychange",J)}function _(){function e(e,n){function t(){if(!n.tagName){throw new TypeError("Object is not a valid DOM element")}else if("IFRAME"!==n.tagName.toUpperCase()){throw new TypeError("Expected <IFRAME> tag, found <"+n.tagName+">")}}if(n){t();q(n,e);o.push(n)}}function t(e){if(e&&e.enablePublicMethods){z("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}}var o;p();G();return function i(r,s){o=[];t(r);switch(typeof s){case"undefined":case"string":{Array.prototype.forEach.call(document.querySelectorAll(s||"iframe"),e.bind(n,r));break}case"object":{e(r,s);break}default:{throw new TypeError("Unexpected data type ("+typeof s+")")}}return o}}function Q(e){if(!e.fn){x("","Unable to bind to jQuery, it is not fully loaded.")}else if(!e.fn.iFrameResize){e.fn.iFrameResize=function e(n){function t(e,t){q(t,n)}return this.filter("iframe").each(t).end()}}}if(window.jQuery!==n){Q(window.jQuery)}if(typeof n==="function"&&n.amd){n([],_)}else{e.exports=_()}window.iFrameResize=window.iFrameResize||_()})()}));const c={card:{ready:"justifi.card.ready",tokenize:"justifi.card.tokenize",validate:"justifi.card.validate",resize:"justifi.card.resize",styleOverrides:"justifi.card.styleOverrides"},bankAccount:{ready:"justifi.bankAccount.ready",tokenize:"justifi.bankAccount.tokenize",validate:"justifi.bankAccount.validate",resize:"justifi.bankAccount.resize",styleOverrides:"justifi.bankAccount.styleOverrides"}};const f="@justifi/webcomponents";const u="4.7.1-rc.0";const d="JustiFi Web Components";const l="dist/index.cjs.js";const m="dist/components/index.js";const h="dist/esm/index.mjs";const b="dist/esm/index.mjs";const w="dist/types/index.d.ts";const g="dist/collection/collection-manifest.json";const p={type:"git",url:"git+https://github.com/justifi-tech/web-component-library.git"};const y={registry:"https://registry.npmjs.org"};const v=["dist/","loader/"];const j={build:"stencil build --docs",start:'concurrently --restart-tries 3 -c "bgBlue.bold,bgMagenta.bold,bgGreen.bold" "npm run start-stencil" "npm run storybook"',"start-stencil":"stencil build --watch",test:"stencil test --spec","test:watch":"stencil test --spec --watchAll","test:e2e":"stencil test --e2e",generate:"stencil generate",storybook:"storybook dev -p 6006 --quiet","build-storybook":"storybook build -o ../docs"};const k={"@stencil/core":"^4.0.5",bootstrap:"^5.2.3","chart.js":"^4.4.1","date-fns":"^2.29.3","dinero.js":"^1.9.1","iframe-resizer":"^4.3.7",imask:"^7.1.3",rxjs:"^7.8.1","ts-dedent":"^2.2.0",uuid:"^9.0.0",yup:"^1.0.0"};const x={"@babel/preset-env":"^7.21.5","@babel/preset-react":"^7.18.6","@babel/preset-typescript":"^7.21.5","@pxtrn/storybook-addon-docs-stencil":"^6.4.1","@stencil/angular-output-target":"^0.7.1","@stencil/react-output-target":"^0.5.3","@stencil/sass":"^3.0.1","@stencil/store":"^2.0.8","@stencil/vue-output-target":"^0.8.6","@storybook/addon-actions":"^7.0.4","@storybook/addon-essentials":"^7.0.4","@storybook/addon-interactions":"^7.0.4","@storybook/addon-links":"^7.0.4","@storybook/html":"^7.0.4","@storybook/html-webpack5":"^7.0.4","@storybook/jest":"^0.1.0","@storybook/testing-library":"^0.1.0","@types/jest":"27.0.3","@types/node":"^20.1.4","@types/react":"^18.0.37","@types/react-dom":"^18.0.11",concurrently:"^7.6.0",dotenv:"^16.3.1",jest:"^27.4.5","jest-cli":"^27.4.5",puppeteer:"^10.0.0",react:"^18.2.0","react-dom":"^18.2.0","rollup-plugin-replace":"^2.2.0",storybook:"^7.0.4"};const z="MIT";const M="507bac1d941eae6e1f56e185ecd9bc9d22637783";const F={name:f,version:u,description:d,main:l,module:m,es2015:h,es2017:b,types:w,collection:g,"collection:main":"dist/collection/index.js",repository:p,publishConfig:y,files:v,scripts:j,dependencies:k,devDependencies:x,license:z,gitHead:M};const I=()=>{const e=getComputedStyle(document.body);const n={loadGoogleFont:e.getPropertyValue("--jfi-load-google-font"),layout:{fontFamily:e.getPropertyValue("--jfi-layout-font-family"),padding:e.getPropertyValue("--jfi-layout-padding"),formControlSpacingHorizontal:e.getPropertyValue("--jfi-layout-form-control-spacing-x"),formControlSpacingVertical:e.getPropertyValue("--jfi-layout-form-control-spacing-y")},formControl:{backgroundColor:e.getPropertyValue("--jfi-form-control-background-color"),borderColor:e.getPropertyValue("--jfi-form-control-border-color"),borderColorFocus:e.getPropertyValue("--jfi-form-control-border-color-focus"),borderColorError:e.getPropertyValue("--jfi-form-control-border-color-error"),borderWidth:e.getPropertyValue("--jfi-form-control-border-width"),borderBottomWidth:e.getPropertyValue("--jfi-form-control-border-bottom-width"),borderLeftWidth:e.getPropertyValue("--jfi-form-control-border-left-width"),borderRightWidth:e.getPropertyValue("--jfi-form-control-border-right-width"),borderTopWidth:e.getPropertyValue("--jfi-form-control-border-top-width"),borderRadius:e.getPropertyValue("--jfi-form-control-border-radius"),borderStyle:e.getPropertyValue("--jfi-form-control-border-style"),boxShadow:e.getPropertyValue("--jfi-form-control-box-shadow"),boxShadowError:e.getPropertyValue("--jfi-form-control-box-shadow-error"),boxShadowErrorFocus:e.getPropertyValue("--jfi-form-control-box-shadow-error-focus"),boxShadowFocus:e.getPropertyValue("--jfi-form-control-box-shadow-focus"),color:e.getPropertyValue("--jfi-form-control-color"),colorFocus:e.getPropertyValue("--jfi-form-control-color-focus"),fontSize:e.getPropertyValue("--jfi-form-control-font-size"),fontWeight:e.getPropertyValue("--jfi-form-control-font-weight"),lineHeight:e.getPropertyValue("--jfi-form-control-line-height"),margin:e.getPropertyValue("--jfi-form-control-margin"),padding:e.getPropertyValue("--jfi-form-control-padding")},formLabel:{color:e.getPropertyValue("--jfi-form-label-color"),fontFamily:e.getPropertyValue("--jfi-form-label-font-family"),fontSize:e.getPropertyValue("--jfi-form-label-font-size"),fontWeight:e.getPropertyValue("--jfi-form-label-font-weight"),margin:e.getPropertyValue("--jfi-form-label-margin")},errorMessage:{color:e.getPropertyValue("--jfi-error-message-color"),margin:e.getPropertyValue("--jfi-error-message-margin"),fontSize:e.getPropertyValue("--jfi-error-message-font-size")}};return n};const S=":host{display:block}justifi-payment-method-form iframe{border:none;width:100%}iframe{width:1px;min-width:100%}";const O=class{constructor(t){e(this,t);this.paymentMethodFormReady=n(this,"paymentMethodFormReady",7);this.paymentMethodFormTokenize=n(this,"paymentMethodFormTokenize",7);this.computedTheme=I();this.paymentMethodFormType=undefined;this.paymentMethodFormValidationMode=undefined;this.iframeOrigin=undefined;this.singleLine=undefined}connectedCallback(){window.addEventListener("message",this.dispatchMessageEvent.bind(this))}disconnectedCallback(){window.removeEventListener("message",this.dispatchMessageEvent.bind(this))}sendStyleOverrides(){if(this.computedTheme){this.postMessage(c[this.paymentMethodFormType].styleOverrides,{styleOverrides:this.computedTheme})}}dispatchMessageEvent(e){const n=e.data;const t=n.eventType;const o=n.data;if(t===c[this.paymentMethodFormType].ready){this.paymentMethodFormReady.emit(o)}}postMessage(e,n){var t,o;(o=(t=this.iframeElement)===null||t===void 0?void 0:t.contentWindow)===null||o===void 0?void 0:o.postMessage(Object.assign({eventType:e},n),i.iframeOrigin)}async resize(){this.postMessage(c[this.paymentMethodFormType].resize)}async postMessageWithResponseListener(e,n){return new Promise((t=>{const o=n=>{if(n.data.eventType!==e)return;window.removeEventListener("message",o);t(n.data.data)};window.addEventListener("message",o);this.postMessage(e,n)}))}async tokenize(e,n,t){const o=c[this.paymentMethodFormType].tokenize;const i={clientId:e,componentVersion:F.version,paymentMethodMetadata:n,account:t};return this.postMessageWithResponseListener(o,i)}async validate(){return this.postMessageWithResponseListener(c[this.paymentMethodFormType].validate)}composeQueryParams(e){const n=e.map((n=>{if(n===e[0]){return n=`?${n}`}else{return n=`&${n}`}}));return n.join("")}getIframeSrc(){const e=i.iframeOrigin;let n=`${e}/${this.paymentMethodFormType}`;let t=[];if(this.paymentMethodFormValidationMode){t.push(`validationMode=${this.paymentMethodFormValidationMode}`)}if(this.singleLine){t.push(`singleLine=${this.singleLine}`)}return n.concat(this.composeQueryParams(t))}render(){return t(o,null,t("iframe",{id:`justifi-payment-method-form-${this.paymentMethodFormType}`,src:this.getIframeSrc(),ref:e=>{this.iframeElement=e},onLoad:()=>{a(this.iframeElement);this.sendStyleOverrides()}}))}};O.style=S;export{O as justifi_payment_method_form};
2
+ //# sourceMappingURL=p-9ce9561a.entry.js.map