@justifi/webcomponents 4.12.2 → 4.13.0-rc.1

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 (244) hide show
  1. package/dist/cjs/{Api-a06b996e.js → Api-ab34a402.js} +4 -1
  2. package/dist/cjs/{Business-21cef37d.js → Business-32a53780.js} +8 -3
  3. package/dist/cjs/{utils-f8079741.js → ComponentError-8ba0c0e7.js} +0 -25
  4. package/dist/cjs/additional-questions-details_5.cjs.entry.js +2 -2
  5. package/dist/cjs/{business-additional-questions-schema-f5f303fb.js → business-additional-questions-schema-0a35f597.js} +17 -9
  6. package/dist/cjs/{business-form-types-a3cc374d.js → business-form-options-43366c9a.js} +50 -33
  7. package/dist/cjs/business-form-types-29b2bad9.js +26 -0
  8. package/dist/cjs/form-control-date_3.cjs.entry.js +1 -1
  9. package/dist/cjs/form-control-datepart_2.cjs.entry.js +1 -1
  10. package/dist/cjs/form-control-file.cjs.entry.js +44 -0
  11. package/dist/cjs/form-control-monetary.cjs.entry.js +7 -12
  12. package/dist/cjs/form-input-masks-0879c139.js +27 -0
  13. package/dist/cjs/{index-fc5339a5.js → index-d8e99b54.js} +352 -198
  14. package/dist/cjs/justifi-additional-questions-form-step_5.cjs.entry.js +10 -9
  15. package/dist/cjs/justifi-additional-questions_4.cjs.entry.js +6 -6
  16. package/dist/cjs/justifi-billing-form_4.cjs.entry.js +2 -2
  17. package/dist/cjs/justifi-business-details.cjs.entry.js +8 -7
  18. package/dist/cjs/justifi-business-form.cjs.entry.js +6 -5
  19. package/dist/cjs/justifi-business-list.cjs.entry.js +2 -2
  20. package/dist/cjs/justifi-business-owners.cjs.entry.js +1 -1
  21. package/dist/cjs/justifi-checkout-core.cjs.entry.js +30 -11
  22. package/dist/cjs/justifi-checkout.cjs.entry.js +36 -9
  23. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +7 -6
  24. package/dist/cjs/justifi-new-payment-method_4.cjs.entry.js +12 -12
  25. package/dist/cjs/justifi-owner-form.cjs.entry.js +6 -5
  26. package/dist/cjs/justifi-payment-balance-transactions.cjs.entry.js +1 -1
  27. package/dist/cjs/justifi-payment-details.cjs.entry.js +8 -7
  28. package/dist/cjs/justifi-payment-form.cjs.entry.js +6 -5
  29. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +1 -3
  30. package/dist/cjs/justifi-payments-list.cjs.entry.js +8 -7
  31. package/dist/cjs/justifi-payout-details.cjs.entry.js +8 -7
  32. package/dist/cjs/justifi-payouts-list.cjs.entry.js +7 -6
  33. package/dist/cjs/justifi-proceeds-list.cjs.entry.js +1 -1
  34. package/dist/cjs/justifi-refund-form.cjs.entry.js +3 -2
  35. package/dist/cjs/justifi-subaccount-details.cjs.entry.js +1 -1
  36. package/dist/cjs/justifi-subaccounts-list.cjs.entry.js +1 -1
  37. package/dist/cjs/loader.cjs.js +1 -1
  38. package/dist/cjs/{payload-parsers-74693a97.js → payload-parsers-6c4b5323.js} +61 -6
  39. package/dist/cjs/{payment.service-9db24ab9.js → payment.service-336189d3.js} +1 -1
  40. package/dist/cjs/{payout.service-a0efb71a.js → payout.service-6012d576.js} +1 -1
  41. package/dist/cjs/utils-491248ca.js +28 -0
  42. package/dist/cjs/webcomponents.cjs.js +1 -1
  43. package/dist/collection/api/Api.js +4 -1
  44. package/dist/collection/api/Business.js +8 -3
  45. package/dist/collection/collection-manifest.json +1 -0
  46. package/dist/collection/components/business-details/additional-questions-details/additional-questions-details.js +2 -2
  47. package/dist/collection/components/business-forms/business-form/additional-questions/additional-questions.js +4 -2
  48. package/dist/collection/components/business-forms/business-form/business-core-info/business-core-info.js +2 -2
  49. package/dist/collection/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step.js +4 -2
  50. package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.js +3 -2
  51. package/dist/collection/components/business-forms/schemas/business-additional-questions-schema.js +16 -9
  52. package/dist/collection/components/business-forms/schemas/business-core-info-schema.js +3 -1
  53. package/dist/collection/components/business-forms/schemas/schema-helpers.js +3 -0
  54. package/dist/collection/components/business-forms/schemas/schema-validations.js +51 -7
  55. package/dist/collection/components/business-forms/utils/business-form-options.js +119 -0
  56. package/dist/collection/components/business-forms/utils/business-form-types.js +0 -81
  57. package/dist/collection/components/checkout/checkout-actions.js +29 -7
  58. package/dist/collection/components/checkout/checkout-core.js +51 -14
  59. package/dist/collection/components/checkout/checkout.js +30 -2
  60. package/dist/collection/components/checkout/new-payment-method.js +11 -11
  61. package/dist/collection/components/checkout/payment-method-options.js +2 -18
  62. package/dist/collection/components/checkout/test/checkout-actions.spec.js +124 -0
  63. package/dist/collection/components/checkout/test/checkout-core.spec.js +127 -0
  64. package/dist/collection/components/checkout/test/checkout.spec.js +0 -153
  65. package/dist/collection/components/form/form-control-file.css +1806 -0
  66. package/dist/collection/components/form/form-control-file.js +169 -0
  67. package/dist/collection/components/form/form-control-monetary.css +1812 -0
  68. package/dist/collection/components/form/form-control-monetary.js +24 -11
  69. package/dist/collection/components/form/test/form-control-file.spec.js +84 -0
  70. package/dist/collection/components/form/test/form-control-monetary.spec.js +5 -3
  71. package/dist/collection/components/refund-form/refund-form.js +2 -1
  72. package/dist/collection/utils/form-input-masks.js +15 -0
  73. package/dist/docs.json +275 -33
  74. package/dist/esm/{Api-0e88671c.js → Api-e9d568c7.js} +4 -1
  75. package/dist/esm/{Business-0e8a9a3a.js → Business-d83fbdb4.js} +8 -3
  76. package/dist/esm/{utils-4609f32c.js → ComponentError-2a58dbbc.js} +1 -23
  77. package/dist/esm/additional-questions-details_5.entry.js +2 -2
  78. package/dist/esm/{business-additional-questions-schema-a84dd641.js → business-additional-questions-schema-e96b0509.js} +18 -10
  79. package/dist/esm/{business-form-types-7420dc96.js → business-form-options-de11bc46.js} +46 -32
  80. package/dist/esm/business-form-types-0d76133c.js +26 -0
  81. package/dist/esm/form-control-date_3.entry.js +1 -1
  82. package/dist/esm/form-control-datepart_2.entry.js +1 -1
  83. package/dist/esm/form-control-file.entry.js +40 -0
  84. package/dist/esm/form-control-monetary.entry.js +7 -12
  85. package/dist/esm/form-input-masks-0e18300f.js +22 -0
  86. package/dist/esm/{index-5eb05747.js → index-dc1350b1.js} +352 -198
  87. package/dist/esm/justifi-additional-questions-form-step_5.entry.js +10 -9
  88. package/dist/esm/justifi-additional-questions_4.entry.js +6 -6
  89. package/dist/esm/justifi-billing-form_4.entry.js +2 -2
  90. package/dist/esm/justifi-business-details.entry.js +4 -3
  91. package/dist/esm/justifi-business-form.entry.js +6 -5
  92. package/dist/esm/justifi-business-list.entry.js +2 -2
  93. package/dist/esm/justifi-business-owners.entry.js +1 -1
  94. package/dist/esm/justifi-checkout-core.entry.js +30 -11
  95. package/dist/esm/justifi-checkout.entry.js +37 -10
  96. package/dist/esm/justifi-gross-payment-chart.entry.js +3 -2
  97. package/dist/esm/justifi-new-payment-method_4.entry.js +12 -12
  98. package/dist/esm/justifi-owner-form.entry.js +6 -5
  99. package/dist/esm/justifi-payment-balance-transactions.entry.js +1 -1
  100. package/dist/esm/justifi-payment-details.entry.js +4 -3
  101. package/dist/esm/justifi-payment-form.entry.js +2 -1
  102. package/dist/esm/justifi-payment-provisioning.entry.js +1 -3
  103. package/dist/esm/justifi-payments-list.entry.js +4 -3
  104. package/dist/esm/justifi-payout-details.entry.js +4 -3
  105. package/dist/esm/justifi-payouts-list.entry.js +4 -3
  106. package/dist/esm/justifi-proceeds-list.entry.js +1 -1
  107. package/dist/esm/justifi-refund-form.entry.js +3 -2
  108. package/dist/esm/justifi-subaccount-details.entry.js +1 -1
  109. package/dist/esm/justifi-subaccounts-list.entry.js +1 -1
  110. package/dist/esm/loader.js +1 -1
  111. package/dist/esm/{payload-parsers-0c4fc2b1.js → payload-parsers-32028700.js} +54 -7
  112. package/dist/esm/{payment.service-ec28a959.js → payment.service-2fdc5018.js} +1 -1
  113. package/dist/esm/{payout.service-5fd5986c.js → payout.service-15064bcc.js} +1 -1
  114. package/dist/esm/utils-f580d6b7.js +25 -0
  115. package/dist/esm/webcomponents.js +1 -1
  116. package/dist/module/Api.js +4 -1
  117. package/dist/module/Business.js +8 -3
  118. package/dist/module/ComponentError.js +16 -0
  119. package/dist/module/additional-questions-details2.js +2 -2
  120. package/dist/module/additional-questions.js +18 -4
  121. package/dist/module/business-additional-questions-form-step.js +18 -4
  122. package/dist/module/business-additional-questions-schema.js +16 -9
  123. package/dist/module/business-address-schema.js +1 -1
  124. package/dist/module/business-core-info-form-step.js +10 -3
  125. package/dist/module/business-core-info-schema.js +3 -1
  126. package/dist/module/business-core-info.js +9 -3
  127. package/dist/module/business-form-options.js +122 -0
  128. package/dist/module/business-form-types.js +153 -82
  129. package/dist/module/business-identity-schema.js +1 -1
  130. package/dist/module/business-representative-form-step.js +1 -1
  131. package/dist/module/checkout-core.js +30 -13
  132. package/dist/module/form-control-file.d.ts +11 -0
  133. package/dist/module/form-control-file.js +67 -0
  134. package/dist/module/form-control-monetary2.js +8 -12
  135. package/dist/module/form-input-masks.js +16 -1
  136. package/dist/module/index2.js +352 -198
  137. package/dist/module/justifi-business-details.js +2 -1
  138. package/dist/module/justifi-business-form.js +2 -2
  139. package/dist/module/justifi-checkout.js +37 -11
  140. package/dist/module/justifi-gross-payment-chart.js +2 -1
  141. package/dist/module/justifi-payment-details.js +2 -1
  142. package/dist/module/justifi-payment-form.js +2 -1
  143. package/dist/module/justifi-payment-provisioning.js +1 -1
  144. package/dist/module/justifi-payments-list.js +2 -1
  145. package/dist/module/justifi-payout-details.js +2 -1
  146. package/dist/module/justifi-payouts-list.js +2 -1
  147. package/dist/module/justifi-refund-form.js +2 -1
  148. package/dist/module/legal-address-form-step.js +1 -1
  149. package/dist/module/new-payment-method.js +11 -11
  150. package/dist/module/owner-form.js +2 -2
  151. package/dist/module/payload-parsers.js +1 -107
  152. package/dist/module/payment-method-form.js +2 -2
  153. package/dist/module/payment-method-options.js +2 -2
  154. package/dist/module/utils3.js +2 -15
  155. package/dist/types/api/Api.d.ts +1 -0
  156. package/dist/types/api/Business.d.ts +15 -5
  157. package/dist/types/api/services/checkout.service.d.ts +3 -3
  158. package/dist/types/components/business-forms/schemas/business-additional-questions-schema.d.ts +10 -4
  159. package/dist/types/components/business-forms/schemas/business-core-info-schema.d.ts +2 -0
  160. package/dist/types/components/business-forms/schemas/business-form-schema.d.ts +12 -4
  161. package/dist/types/components/business-forms/schemas/schema-helpers.d.ts +3 -0
  162. package/dist/types/components/business-forms/schemas/schema-validations.d.ts +8 -0
  163. package/dist/types/components/business-forms/utils/business-form-options.d.ts +21 -0
  164. package/dist/types/components/business-forms/utils/business-form-types.d.ts +0 -9
  165. package/dist/types/components/checkout/checkout-core.d.ts +8 -3
  166. package/dist/types/components/checkout/checkout.d.ts +3 -0
  167. package/dist/types/components/checkout/payment-method-options.d.ts +1 -1
  168. package/dist/types/components/checkout/payment-method-payload.d.ts +5 -0
  169. package/dist/types/components/form/form-control-file.d.ts +17 -0
  170. package/dist/types/components/form/form-control-monetary.d.ts +1 -0
  171. package/dist/types/components/payment-method-form/payment-method-responses.d.ts +1 -0
  172. package/dist/types/components.d.ts +61 -2
  173. package/dist/types/utils/form-input-masks.d.ts +15 -0
  174. package/dist/webcomponents/p-00ca94d1.js +1 -0
  175. package/dist/webcomponents/p-02b18979.entry.js +1 -0
  176. package/dist/webcomponents/p-0d80748f.js +1 -0
  177. package/dist/webcomponents/p-101b2648.entry.js +1 -0
  178. package/dist/webcomponents/p-132ba228.js +1 -0
  179. package/dist/webcomponents/p-13e2f667.js +1 -0
  180. package/dist/webcomponents/{p-18cf5a16.entry.js → p-1885c478.entry.js} +1 -1
  181. package/dist/webcomponents/{p-8abba4c2.entry.js → p-23099f1f.entry.js} +1 -1
  182. package/dist/webcomponents/p-230b96df.entry.js +1 -0
  183. package/dist/webcomponents/{p-2fbe8823.entry.js → p-3367225e.entry.js} +1 -1
  184. package/dist/webcomponents/p-3917edbf.entry.js +1 -0
  185. package/dist/webcomponents/p-3da23f21.js +1 -0
  186. package/dist/webcomponents/p-41bdee27.entry.js +1 -0
  187. package/dist/webcomponents/{p-5ff7826e.entry.js → p-4c84952f.entry.js} +1 -1
  188. package/dist/webcomponents/p-4ff52695.entry.js +1 -0
  189. package/dist/webcomponents/p-525db3e8.js +1 -0
  190. package/dist/webcomponents/p-61fd33c7.js +1 -0
  191. package/dist/webcomponents/p-64710363.entry.js +1 -0
  192. package/dist/webcomponents/{p-9245777b.js → p-731085e3.js} +1 -1
  193. package/dist/webcomponents/p-78b32fb9.entry.js +1 -0
  194. package/dist/webcomponents/p-7e334dce.entry.js +1 -0
  195. package/dist/webcomponents/p-7faacb1e.entry.js +1 -0
  196. package/dist/webcomponents/{p-5f5e730c.entry.js → p-834cba99.entry.js} +1 -1
  197. package/dist/webcomponents/p-87d646c0.js +1 -0
  198. package/dist/webcomponents/p-935d6f55.js +1 -0
  199. package/dist/webcomponents/{p-e3946c2b.js → p-9ada56da.js} +1 -1
  200. package/dist/webcomponents/p-9ba31a6a.entry.js +1 -0
  201. package/dist/webcomponents/p-a9af8f40.entry.js +1 -0
  202. package/dist/webcomponents/p-b81afd51.entry.js +1 -0
  203. package/dist/webcomponents/{p-c556deda.entry.js → p-bb58e656.entry.js} +1 -1
  204. package/dist/webcomponents/p-bc12b8b9.js +1 -0
  205. package/dist/webcomponents/p-bfe7c55c.entry.js +1 -0
  206. package/dist/webcomponents/p-c1be3378.entry.js +1 -0
  207. package/dist/webcomponents/p-cb31488b.entry.js +1 -0
  208. package/dist/webcomponents/p-cf3151a3.entry.js +1 -0
  209. package/dist/webcomponents/p-d0a8c631.entry.js +1 -0
  210. package/dist/webcomponents/p-e6ab1f0d.entry.js +1 -0
  211. package/dist/webcomponents/p-ee68566f.entry.js +1 -0
  212. package/dist/webcomponents/{p-3adc0688.entry.js → p-efbc8ffc.entry.js} +1 -1
  213. package/dist/webcomponents/{p-b9f04fb0.entry.js → p-f152d6b8.entry.js} +1 -1
  214. package/dist/webcomponents/webcomponents.esm.js +1 -1
  215. package/package.json +2 -2
  216. package/dist/cjs/form-input-masks-efd44b8e.js +0 -11
  217. package/dist/esm/form-input-masks-84875967.js +0 -7
  218. package/dist/webcomponents/p-01913426.js +0 -1
  219. package/dist/webcomponents/p-04c7f8f8.js +0 -1
  220. package/dist/webcomponents/p-0c269feb.entry.js +0 -1
  221. package/dist/webcomponents/p-0eb77101.entry.js +0 -1
  222. package/dist/webcomponents/p-19001cc5.entry.js +0 -1
  223. package/dist/webcomponents/p-2319abaf.entry.js +0 -1
  224. package/dist/webcomponents/p-2bee72bd.entry.js +0 -1
  225. package/dist/webcomponents/p-51ee396f.entry.js +0 -1
  226. package/dist/webcomponents/p-52e4cc27.js +0 -1
  227. package/dist/webcomponents/p-602a1588.entry.js +0 -1
  228. package/dist/webcomponents/p-6ec77980.entry.js +0 -1
  229. package/dist/webcomponents/p-6f294d5d.js +0 -1
  230. package/dist/webcomponents/p-81c43ba5.entry.js +0 -1
  231. package/dist/webcomponents/p-927150b4.entry.js +0 -1
  232. package/dist/webcomponents/p-93579716.js +0 -1
  233. package/dist/webcomponents/p-9e35b0f6.entry.js +0 -1
  234. package/dist/webcomponents/p-9e3f9e05.entry.js +0 -1
  235. package/dist/webcomponents/p-9ec89299.entry.js +0 -1
  236. package/dist/webcomponents/p-a8caec98.entry.js +0 -1
  237. package/dist/webcomponents/p-a90f7ca0.js +0 -1
  238. package/dist/webcomponents/p-abc03d5a.entry.js +0 -1
  239. package/dist/webcomponents/p-b38baa84.entry.js +0 -1
  240. package/dist/webcomponents/p-bfc634c6.entry.js +0 -1
  241. package/dist/webcomponents/p-c1b92cec.entry.js +0 -1
  242. package/dist/webcomponents/p-cb86b2fd.js +0 -1
  243. package/dist/webcomponents/p-d2b7beac.js +0 -1
  244. package/dist/webcomponents/p-d69a485a.entry.js +0 -1
@@ -0,0 +1 @@
1
+ function t(t){return"string"==typeof t||t instanceof String}function s(t){var s;return"object"==typeof t&&null!=t&&"Object"===(null==t||null==(s=t.constructor)?void 0:s.name)}function i(t,s){return Array.isArray(s)?i(t,((t,i)=>s.includes(i))):Object.entries(t).reduce(((t,i)=>{let[u,e]=i;return s(e,u)&&(t[u]=e),t}),{})}const u="NONE",e="LEFT",h="FORCE_LEFT",r="RIGHT",n="FORCE_RIGHT";function o(t){return t.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function a(t,s){if(s===t)return!0;const i=Array.isArray(s),u=Array.isArray(t);let e;if(i&&u){if(s.length!=t.length)return!1;for(e=0;e<s.length;e++)if(!a(s[e],t[e]))return!1;return!0}if(i!=u)return!1;if(s&&t&&"object"==typeof s&&"object"==typeof t){const i=s instanceof Date,u=t instanceof Date;if(i&&u)return s.getTime()==t.getTime();if(i!=u)return!1;const h=s instanceof RegExp,r=t instanceof RegExp;if(h&&r)return s.toString()==t.toString();if(h!=r)return!1;const n=Object.keys(s);for(e=0;e<n.length;e++)if(!Object.prototype.hasOwnProperty.call(t,n[e]))return!1;for(e=0;e<n.length;e++)if(!a(t[n[e]],s[n[e]]))return!1;return!0}return!(!s||!t||"function"!=typeof s||"function"!=typeof t)&&s.toString()===t.toString()}class l{constructor(t){for(Object.assign(this,t);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?u:this.oldSelection.end!==this.cursorPos&&this.oldSelection.start!==this.cursorPos||this.oldSelection.end!==this.oldSelection.start?e:r}}function d(t,s){return new d.InputMask(t,s)}function c(s){if(null==s)throw new Error("mask property should be defined");return s instanceof RegExp?d.MaskedRegExp:t(s)?d.MaskedPattern:s===Date?d.MaskedDate:s===Number?d.MaskedNumber:Array.isArray(s)||s===Array?d.MaskedDynamic:d.Masked&&s.prototype instanceof d.Masked?s:d.Masked&&s instanceof d.Masked?s.constructor:s instanceof Function?d.MaskedFunction:(console.warn("Mask not found for mask",s),d.Masked)}function p(t){if(!t)throw new Error("Options in not defined");if(d.Masked){if(t.prototype instanceof d.Masked)return{mask:t};const{mask:u,...e}=t instanceof d.Masked?{mask:t}:s(t)&&t.mask instanceof d.Masked?t:{};if(u){const t=u.mask;return{...i(u,((t,s)=>!s.startsWith("_"))),mask:u.constructor,_mask:t,...e}}}return s(t)?{...t}:{mask:t}}function A(t){if(d.Masked&&t instanceof d.Masked)return t;const s=p(t),i=c(s.mask);if(!i)throw new Error("Masked class is not found for provided mask "+s.mask+", appropriate module needs to be imported manually before creating mask.");return s.mask===i&&delete s.mask,s._mask&&(s.mask=s._mask,delete s._mask),new i(s)}d.createMask=A;class f{get selectionStart(){let t;try{t=this._unsafeSelectionStart}catch{}return null!=t?t:this.value.length}get selectionEnd(){let t;try{t=this._unsafeSelectionEnd}catch{}return null!=t?t:this.value.length}select(t,s){if(null!=t&&null!=s&&(t!==this.selectionStart||s!==this.selectionEnd))try{this._unsafeSelect(t,s)}catch{}}get isActive(){return!1}}d.MaskElement=f;class F extends f{constructor(t){super(),this.input=t,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var t,s,i;return null!=(t=null==(s=(i=this.input).getRootNode)?void 0:s.call(i))?t:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(t){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",t.drop),this.input.addEventListener("click",t.click),this.input.addEventListener("focus",t.focus),this.input.addEventListener("blur",t.commit),this._handlers=t}_onKeydown(t){return this._handlers.redo&&(90===t.keyCode&&t.shiftKey&&(t.metaKey||t.ctrlKey)||89===t.keyCode&&t.ctrlKey)?(t.preventDefault(),this._handlers.redo(t)):this._handlers.undo&&90===t.keyCode&&(t.metaKey||t.ctrlKey)?(t.preventDefault(),this._handlers.undo(t)):void(t.isComposing||this._handlers.selectionChange(t))}_onBeforeinput(t){return"historyUndo"===t.inputType&&this._handlers.undo?(t.preventDefault(),this._handlers.undo(t)):"historyRedo"===t.inputType&&this._handlers.redo?(t.preventDefault(),this._handlers.redo(t)):void 0}_onCompositionEnd(t){this._handlers.input(t)}_onInput(t){t.isComposing||this._handlers.input(t)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}d.HTMLMaskElement=F;class v extends F{constructor(t){super(t),this.input=t}get _unsafeSelectionStart(){return null!=this.input.selectionStart?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(t,s){this.input.setSelectionRange(t,s)}get value(){return this.input.value}set value(t){this.input.value=t}}d.HTMLMaskElement=F;class C extends F{get _unsafeSelectionStart(){const t=this.rootElement,s=t.getSelection&&t.getSelection(),i=s&&s.anchorOffset,u=s&&s.focusOffset;return null==u||null==i||i<u?i:u}get _unsafeSelectionEnd(){const t=this.rootElement,s=t.getSelection&&t.getSelection(),i=s&&s.anchorOffset,u=s&&s.focusOffset;return null==u||null==i||i>u?i:u}_unsafeSelect(t,s){if(!this.rootElement.createRange)return;const i=this.rootElement.createRange();i.setStart(this.input.firstChild||this.input,t),i.setEnd(this.input.lastChild||this.input,s);const u=this.rootElement,e=u.getSelection&&u.getSelection();e&&(e.removeAllRanges(),e.addRange(i))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}}d.HTMLContenteditableMaskElement=C;class B{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return 0===this.states.length}push(t){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(t),this.states.length>B.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(t){return this.currentIndex=Math.min(Math.max(this.currentIndex+t,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}B.MAX_LENGTH=100,d.InputMask=class{constructor(t,s){this.el=t instanceof f?t:t.isContentEditable&&"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName?new C(t):new v(t),this.masked=A(s),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new B,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this._onChange()}maskEquals(t){var s;return null==t||(null==(s=this.masked)?void 0:s.maskEquals(t))}get mask(){return this.masked.mask}set mask(t){if(this.maskEquals(t))return;if(!(t instanceof d.Masked)&&this.masked.constructor===c(t))return void this.masked.updateOptions({mask:t});const s=t instanceof d.Masked?t:A({mask:t});s.unmaskedValue=this.masked.unmaskedValue,this.masked=s}get value(){return this._value}set value(t){this.value!==t&&(this.masked.value=t,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(t){this.unmaskedValue!==t&&(this.masked.unmaskedValue=t,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(t){this.rawInputValue!==t&&(this.masked.rawInputValue=t,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(t){this.masked.typedValueEquals(t)||(this.masked.typedValue=t,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(t,s){const i=this._listeners[t];i&&i.forEach((t=>t(s)))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(t){this.el&&this.el.isActive&&(this.el.select(t,t),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(t){const s=this.masked.unmaskedValue,i=this.masked.value,u=this.masked.rawInputValue,e=this.displayValue,h=this.unmaskedValue!==s||this.value!==i||this._rawInputValue!==u;this._unmaskedValue=s,this._value=i,this._rawInputValue=u,this.el.value!==e&&(this.el.value=e),"auto"===t?this.alignCursor():null!=t&&(this.cursorPos=t),h&&this._fireChangeEvents(),this._historyChanging||!h&&!this.history.isEmpty||this.history.push({unmaskedValue:s,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(t){const{mask:s,...i}=t,u=!this.maskEquals(s),e=this.masked.optionsIsChanged(i);u&&(this.mask=s),e&&this.masked.updateOptions(i),(u||e)&&this.updateControl()}updateCursor(t){null!=t&&(this.cursorPos=t,this._delayUpdateCursor(t))}_delayUpdateCursor(t){this._abortUpdateCursor(),this._changingCursorPos=t,this._cursorChanging=setTimeout((()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())}),10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,e))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(t,s){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(s),this}off(t,s){if(!this._listeners[t])return this;if(!s)return delete this._listeners[t],this;const i=this._listeners[t].indexOf(s);return i>=0&&this._listeners[t].splice(i,1),this}_onInput(t){this._inputEvent=t,this._abortUpdateCursor();const s=new l({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),i=this.masked.rawInputValue,e=this.masked.splice(s.startChangePos,s.removed.length,s.inserted,s.removeDirection,{input:!0,raw:!0}).offset,h=i===this.masked.rawInputValue?s.removeDirection:u;let r=this.masked.nearestInputPos(s.startChangePos+e,h);h!==u&&(r=this.masked.nearestInputPos(r,u)),this.updateControl(r),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(t){t.preventDefault(),t.stopPropagation()}_onFocus(t){this.alignCursorFriendly()}_onClick(t){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(t){t&&(this._historyChanging=!0,this.unmaskedValue=t.unmaskedValue,this.el.select(t.selection.start,t.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}};class g{static normalize(t){return Array.isArray(t)?t:[t,new g]}constructor(t){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},t)}aggregate(t){return this.inserted+=t.inserted,this.rawInserted+=t.rawInserted,this.tailShift+=t.tailShift,this.skip=this.skip||t.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return Boolean(this.rawInserted)||this.skip}equals(t){return this.inserted===t.inserted&&this.tailShift===t.tailShift&&this.rawInserted===t.rawInserted&&this.skip===t.skip}}d.ChangeDetails=g;class D{constructor(t,s,i){void 0===t&&(t=""),void 0===s&&(s=0),this.value=t,this.from=s,this.stop=i}toString(){return this.value}extend(t){this.value+=String(t)}appendTo(t){return t.append(this.toString(),{tail:!0}).aggregate(t._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(t){Object.assign(this,t)}unshift(t){if(!this.value.length||null!=t&&this.from>=t)return"";const s=this.value[0];return this.value=this.value.slice(1),s}shift(){if(!this.value.length)return"";const t=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),t}}class E{constructor(t){this._value="",this._update({...E.DEFAULTS,...t}),this._initialized=!0}updateOptions(t){this.optionsIsChanged(t)&&this.withValueRefresh(this._update.bind(this,t))}_update(t){Object.assign(this,t)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value}reset(){this._value=""}get value(){return this._value}set value(t){this.resolve(t,{input:!0})}resolve(t,s){void 0===s&&(s={input:!0}),this.reset(),this.append(t,s,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(t){this.resolve(t,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(t){this.format?this.value=this.format(t,this):this.unmaskedValue=String(t)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(t){this.resolve(t,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(t,s){return t}totalInputPositions(t,s){return void 0===t&&(t=0),void 0===s&&(s=this.displayValue.length),Math.min(this.displayValue.length,s-t)}extractInput(t,s,i){return void 0===t&&(t=0),void 0===s&&(s=this.displayValue.length),this.displayValue.slice(t,s)}extractTail(t,s){return void 0===t&&(t=0),void 0===s&&(s=this.displayValue.length),new D(this.extractInput(t,s),t)}appendTail(s){return t(s)&&(s=new D(String(s))),s.appendTo(this)}_appendCharRaw(t,s){return t?(this._value+=t,new g({inserted:t,rawInserted:t})):new g}_appendChar(t,s,i){void 0===s&&(s={});const u=this.state;let e;if([t,e]=this.doPrepareChar(t,s),t&&(e=e.aggregate(this._appendCharRaw(t,s)),!e.rawInserted&&"pad"===this.autofix)){const i=this.state;this.state=u;let h=this.pad(s);const r=this._appendCharRaw(t,s);h=h.aggregate(r),r.rawInserted||h.equals(e)?e=h:this.state=i}if(e.inserted){let t,h=!1!==this.doValidate(s);if(h&&null!=i){const s=this.state;if(!0===this.overwrite){t=i.state;for(let t=0;t<e.rawInserted.length;++t)i.unshift(this.displayValue.length-e.tailShift)}let u=this.appendTail(i);if(h=u.rawInserted.length===i.toString().length,!(h&&u.inserted||"shift"!==this.overwrite)){this.state=s,t=i.state;for(let t=0;t<e.rawInserted.length;++t)i.shift();u=this.appendTail(i),h=u.rawInserted.length===i.toString().length}h&&u.inserted&&(this.state=s)}h||(e=new g,this.state=u,i&&t&&(i.state=t))}return e}_appendPlaceholder(){return new g}_appendEager(){return new g}append(s,i,u){if(!t(s))throw new Error("value should be string");const e=t(u)?new D(String(u)):u;let h;null!=i&&i.tail&&(i._beforeTailState=this.state),[s,h]=this.doPrepare(s,i);for(let t=0;t<s.length;++t){const u=this._appendChar(s[t],i,e);if(!u.rawInserted&&!this.doSkipInvalid(s[t],i,e))break;h.aggregate(u)}return(!0===this.eager||"append"===this.eager)&&null!=i&&i.input&&s&&h.aggregate(this._appendEager()),null!=e&&(h.tailShift+=this.appendTail(e).tailShift),h}remove(t,s){return void 0===t&&(t=0),void 0===s&&(s=this.displayValue.length),this._value=this.displayValue.slice(0,t)+this.displayValue.slice(s),new g}withValueRefresh(t){if(this._refreshing||!this._initialized)return t();this._refreshing=!0;const s=this.rawInputValue,i=this.value,u=t();return this.rawInputValue=s,this.value&&this.value!==i&&0===i.indexOf(this.value)&&(this.append(i.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,u}runIsolated(t){if(this._isolated||!this._initialized)return t(this);this._isolated=!0;const s=this.state,i=t(this);return this.state=s,delete this._isolated,i}doSkipInvalid(t,s,i){return Boolean(this.skipInvalid)}doPrepare(t,s){return void 0===s&&(s={}),g.normalize(this.prepare?this.prepare(t,this,s):t)}doPrepareChar(t,s){return void 0===s&&(s={}),g.normalize(this.prepareChar?this.prepareChar(t,this,s):t)}doValidate(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))}doCommit(){this.commit&&this.commit(this.value,this)}splice(t,s,i,o,a){void 0===i&&(i=""),void 0===o&&(o=u),void 0===a&&(a={input:!0});const l=t+s,d=this.extractTail(l),c=!0===this.eager||"remove"===this.eager;let p;c&&(o=function(t){switch(t){case e:return h;case r:return n;default:return t}}(o),p=this.extractInput(0,l,{raw:!0}));let A=t;const f=new g;if(o!==u&&(A=this.nearestInputPos(t,s>1&&0!==t&&!c?u:o),f.tailShift=A-t),f.aggregate(this.remove(A)),c&&o!==u&&p===this.rawInputValue)if(o===h){let t;for(;p===this.rawInputValue&&(t=this.displayValue.length);)f.aggregate(new g({tailShift:-1})).aggregate(this.remove(t-1))}else o===n&&d.unshift();return f.aggregate(this.append(i,a,d))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!a(this,t)}typedValueEquals(t){const s=this.typedValue;return t===s||E.EMPTY_VALUES.includes(t)&&E.EMPTY_VALUES.includes(s)||!!this.format&&this.format(t,this)===this.format(this.typedValue,this)}pad(t){return new g}}E.DEFAULTS={skipInvalid:!0},E.EMPTY_VALUES=[void 0,null,""],d.Masked=E;class m{constructor(t,s){void 0===t&&(t=[]),void 0===s&&(s=0),this.chunks=t,this.from=s}toString(){return this.chunks.map(String).join("")}extend(s){if(!String(s))return;s=t(s)?new D(String(s)):s;const i=this.chunks[this.chunks.length-1],u=i&&(i.stop===s.stop||null==s.stop)&&s.from===i.from+i.toString().length;if(s instanceof D)u?i.extend(s.toString()):this.chunks.push(s);else if(s instanceof m){if(null==s.stop){let t;for(;s.chunks.length&&null==s.chunks[0].stop;)t=s.chunks.shift(),t.from+=s.from,this.extend(t)}s.toString()&&(s.stop=s.blockIndex,this.chunks.push(s))}}appendTo(t){if(!(t instanceof d.MaskedPattern))return new D(this.toString()).appendTo(t);const s=new g;for(let i=0;i<this.chunks.length;++i){const u=this.chunks[i],e=t._mapPosToBlock(t.displayValue.length),h=u.stop;let r;if(null!=h&&(!e||e.index<=h)&&((u instanceof m||t._stops.indexOf(h)>=0)&&s.aggregate(t._appendPlaceholder(h)),r=u instanceof m&&t._blocks[h]),r){const i=r.appendTail(u);s.aggregate(i);const e=u.toString().slice(i.rawInserted.length);e&&s.aggregate(t.append(e,{tail:!0}))}else s.aggregate(t.append(u.toString(),{tail:!0}))}return s}get state(){return{chunks:this.chunks.map((t=>t.state)),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(t){const{chunks:s,...i}=t;Object.assign(this,i),this.chunks=s.map((t=>{const s="chunks"in t?new m:new D;return s.state=t,s}))}unshift(t){if(!this.chunks.length||null!=t&&this.from>=t)return"";const s=null!=t?t-this.from:t;let i=0;for(;i<this.chunks.length;){const t=this.chunks[i],u=t.unshift(s);if(t.toString()){if(!u)break;++i}else this.chunks.splice(i,1);if(u)return u}return""}shift(){if(!this.chunks.length)return"";let t=this.chunks.length-1;for(;0<=t;){const s=this.chunks[t],i=s.shift();if(s.toString()){if(!i)break;--t}else this.chunks.splice(t,1);if(i)return i}return""}}class w{constructor(t,s){this.masked=t,this._log=[];const{offset:i,index:u}=t._mapPosToBlock(s)||(s<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=i,this.index=u,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(t){Object.assign(this,t)}pushState(){this._log.push(this.state)}popState(){const t=this._log.pop();return t&&(this.state=t),t}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(t){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=(null==(s=this.block)?void 0:s.displayValue.length)||0){var s;if(t())return this.ok=!0}return this.ok=!1}_pushRight(t){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(t())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft((()=>{if(!this.block.isFixed&&this.block.value)return this.offset=this.block.nearestInputPos(this.offset,h),0!==this.offset||void 0}))}pushLeftBeforeInput(){return this._pushLeft((()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,e),!0}))}pushLeftBeforeRequired(){return this._pushLeft((()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,e),!0}))}pushRightBeforeFilled(){return this._pushRight((()=>{if(!this.block.isFixed&&this.block.value)return this.offset=this.block.nearestInputPos(this.offset,n),this.offset!==this.block.value.length||void 0}))}pushRightBeforeInput(){return this._pushRight((()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,u),!0}))}pushRightBeforeRequired(){return this._pushRight((()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,u),!0}))}}class k{constructor(t){Object.assign(this,t),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(t,s){return void 0===t&&(t=0),void 0===s&&(s=this._value.length),this._value=this._value.slice(0,t)+this._value.slice(s),this._value||(this._isRawInput=!1),new g}nearestInputPos(t,s){void 0===s&&(s=u);const i=this._value.length;switch(s){case e:case h:return 0;default:return i}}totalInputPositions(t,s){return void 0===t&&(t=0),void 0===s&&(s=this._value.length),this._isRawInput?s-t:0}extractInput(t,s,i){return void 0===t&&(t=0),void 0===s&&(s=this._value.length),void 0===i&&(i={}),i.raw&&this._isRawInput&&this._value.slice(t,s)||""}get isComplete(){return!0}get isFilled(){return Boolean(this._value)}_appendChar(t,s){if(void 0===s&&(s={}),this.isFilled)return new g;const i=this.char===t&&(this.isUnmasking||s.input||s.raw)&&(!s.raw||!(!0===this.eager||"append"===this.eager))&&!s.tail,u=new g({inserted:this.char,rawInserted:i?this.char:""});return this._value=this.char,this._isRawInput=i&&(s.raw||s.input),u}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const t=new g;return this.isFilled||(this._value=t.inserted=this.char),t}extractTail(){return new D("")}appendTail(s){return t(s)&&(s=new D(String(s))),s.appendTo(this)}append(t,s,i){const u=this._appendChar(t[0],s);return null!=i&&(u.tailShift+=this.appendTail(i).tailShift),u}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value,this._isRawInput=Boolean(t._rawInputValue)}pad(t){return this._appendPlaceholder()}}class _{constructor(t){const{parent:s,isOptional:i,placeholderChar:u,displayChar:e,lazy:h,eager:r,...n}=t;this.masked=A(n),Object.assign(this,{parent:s,isOptional:i,placeholderChar:u,displayChar:e,lazy:h,eager:r})}reset(){this.isFilled=!1,this.masked.reset()}remove(t,s){return void 0===t&&(t=0),void 0===s&&(s=this.value.length),0===t&&s>=1?(this.isFilled=!1,this.masked.remove(t,s)):new g}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return Boolean(this.masked.value)||this.isOptional}_appendChar(t,s){if(void 0===s&&(s={}),this.isFilled)return new g;const i=this.masked.state;let u=this.masked._appendChar(t,this.currentMaskFlags(s));return u.inserted&&!1===this.doValidate(s)&&(u=new g,this.masked.state=i),u.inserted||this.isOptional||this.lazy||s.input||(u.inserted=this.placeholderChar),u.skip=!u.inserted&&!this.isOptional,this.isFilled=Boolean(u.inserted),u}append(t,s,i){return this.masked.append(t,this.currentMaskFlags(s),i)}_appendPlaceholder(){return this.isFilled||this.isOptional?new g:(this.isFilled=!0,new g({inserted:this.placeholderChar}))}_appendEager(){return new g}extractTail(t,s){return this.masked.extractTail(t,s)}appendTail(t){return this.masked.appendTail(t)}extractInput(t,s,i){return void 0===t&&(t=0),void 0===s&&(s=this.value.length),this.masked.extractInput(t,s,i)}nearestInputPos(t,s){void 0===s&&(s=u);const i=this.value.length,o=Math.min(Math.max(t,0),i);switch(s){case e:case h:return this.isComplete?o:0;case r:case n:return this.isComplete?o:i;default:return o}}totalInputPositions(t,s){return void 0===t&&(t=0),void 0===s&&(s=this.value.length),this.value.slice(t,s).length}doValidate(t){return this.masked.doValidate(this.currentMaskFlags(t))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(t)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(t){this.masked.state=t.masked,this.isFilled=t.isFilled}currentMaskFlags(t){var s;return{...t,_beforeTailState:(null==t||null==(s=t._beforeTailState)?void 0:s.masked)||(null==t?void 0:t._beforeTailState)}}pad(t){return new g}}_.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./},d.MaskedRegExp=class extends E{updateOptions(t){super.updateOptions(t)}_update(t){const s=t.mask;s&&(t.validate=t=>t.search(s)>=0),super._update(t)}};class b extends E{constructor(t){super({...b.DEFAULTS,...t,definitions:Object.assign({},_.DEFAULT_DEFINITIONS,null==t?void 0:t.definitions)})}updateOptions(t){super.updateOptions(t)}_update(t){t.definitions=Object.assign({},this.definitions,t.definitions),super._update(t),this._rebuildMask()}_rebuildMask(){const t=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const s=this.mask;if(!s||!t)return;let i=!1,u=!1;for(let e=0;e<s.length;++e){if(this.blocks){const t=s.slice(e),i=Object.keys(this.blocks).filter((s=>0===t.indexOf(s)));i.sort(((t,s)=>s.length-t.length));const u=i[0];if(u){const{expose:t,repeat:s,...i}=p(this.blocks[u]),h={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...i,repeat:s,parent:this},r=null!=s?new d.RepeatBlock(h):A(h);r&&(this._blocks.push(r),t&&(this.exposeBlock=r),this._maskedBlocks[u]||(this._maskedBlocks[u]=[]),this._maskedBlocks[u].push(this._blocks.length-1)),e+=u.length-1;continue}}let h=s[e],r=h in t;if(h===b.STOP_CHAR){this._stops.push(this._blocks.length);continue}if("{"===h||"}"===h){i=!i;continue}if("["===h||"]"===h){u=!u;continue}if(h===b.ESCAPE_CHAR){if(++e,h=s[e],!h)break;r=!1}const n=r?new _({isOptional:u,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...p(t[h]),parent:this}):new k({char:h,eager:this.eager,isUnmasking:i});this._blocks.push(n)}}get state(){return{...super.state,_blocks:this._blocks.map((t=>t.state))}}set state(t){if(!t)return void this.reset();const{_blocks:s,...i}=t;this._blocks.forEach(((t,i)=>t.state=s[i])),super.state=i}reset(){super.reset(),this._blocks.forEach((t=>t.reset()))}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every((t=>t.isComplete))}get isFilled(){return this._blocks.every((t=>t.isFilled))}get isFixed(){return this._blocks.every((t=>t.isFixed))}get isOptional(){return this._blocks.every((t=>t.isOptional))}doCommit(){this._blocks.forEach((t=>t.doCommit())),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce(((t,s)=>t+s.unmaskedValue),"")}set unmaskedValue(t){if(this.exposeBlock){const s=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=t,this.appendTail(s),this.doCommit()}else super.unmaskedValue=t}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce(((t,s)=>t+s.value),"")}set value(t){if(this.exposeBlock){const s=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=t,this.appendTail(s),this.doCommit()}else super.value=t}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(t){if(this.exposeBlock){const s=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=t,this.appendTail(s),this.doCommit()}else super.typedValue=t}get displayValue(){return this._blocks.reduce(((t,s)=>t+s.displayValue),"")}appendTail(t){return super.appendTail(t).aggregate(this._appendPlaceholder())}_appendEager(){var t;const s=new g;let i=null==(t=this._mapPosToBlock(this.displayValue.length))?void 0:t.index;if(null==i)return s;this._blocks[i].isFilled&&++i;for(let t=i;t<this._blocks.length;++t){const i=this._blocks[t]._appendEager();if(!i.inserted)break;s.aggregate(i)}return s}_appendCharRaw(t,s){void 0===s&&(s={});const i=this._mapPosToBlock(this.displayValue.length),u=new g;if(!i)return u;for(let h,r=i.index;h=this._blocks[r];++r){var e;const i=h._appendChar(t,{...s,_beforeTailState:null==(e=s._beforeTailState)||null==(e=e._blocks)?void 0:e[r]});if(u.aggregate(i),i.consumed)break}return u}extractTail(t,s){void 0===t&&(t=0),void 0===s&&(s=this.displayValue.length);const i=new m;return t===s||this._forEachBlocksInRange(t,s,((t,s,u,e)=>{const h=t.extractTail(u,e);h.stop=this._findStopBefore(s),h.from=this._blockStartPos(s),h instanceof m&&(h.blockIndex=s),i.extend(h)})),i}extractInput(t,s,i){if(void 0===t&&(t=0),void 0===s&&(s=this.displayValue.length),void 0===i&&(i={}),t===s)return"";let u="";return this._forEachBlocksInRange(t,s,((t,s,e,h)=>{u+=t.extractInput(e,h,i)})),u}_findStopBefore(t){let s;for(let i=0;i<this._stops.length;++i){const u=this._stops[i];if(!(u<=t))break;s=u}return s}_appendPlaceholder(t){const s=new g;if(this.lazy&&null==t)return s;const i=this._mapPosToBlock(this.displayValue.length);return i?(this._blocks.slice(i.index,null!=t?t:this._blocks.length).forEach((i=>{var u;i.lazy&&null==t||s.aggregate(i._appendPlaceholder(null==(u=i._blocks)?void 0:u.length))})),s):s}_mapPosToBlock(t){let s="";for(let i=0;i<this._blocks.length;++i){const u=s.length;if(s+=this._blocks[i].displayValue,t<=s.length)return{index:i,offset:t-u}}}_blockStartPos(t){return this._blocks.slice(0,t).reduce(((t,s)=>t+s.displayValue.length),0)}_forEachBlocksInRange(t,s,i){void 0===s&&(s=this.displayValue.length);const u=this._mapPosToBlock(t);if(u){const t=this._mapPosToBlock(s),e=t&&u.index===t.index;if(i(this._blocks[u.index],u.index,u.offset,t&&e?t.offset:this._blocks[u.index].displayValue.length),t&&!e){for(let s=u.index+1;s<t.index;++s)i(this._blocks[s],s,0,this._blocks[s].displayValue.length);i(this._blocks[t.index],t.index,0,t.offset)}}}remove(t,s){void 0===t&&(t=0),void 0===s&&(s=this.displayValue.length);const i=super.remove(t,s);return this._forEachBlocksInRange(t,s,((t,s,u,e)=>{i.aggregate(t.remove(u,e))})),i}nearestInputPos(t,s){if(void 0===s&&(s=u),!this._blocks.length)return 0;const i=new w(this,t);if(s===u)return i.pushRightBeforeInput()?i.pos:(i.popState(),i.pushLeftBeforeInput()?i.pos:this.displayValue.length);if(s===e||s===h){if(s===e){if(i.pushRightBeforeFilled(),i.ok&&i.pos===t)return t;i.popState()}if(i.pushLeftBeforeInput(),i.pushLeftBeforeRequired(),i.pushLeftBeforeFilled(),s===e){if(i.pushRightBeforeInput(),i.pushRightBeforeRequired(),i.ok&&i.pos<=t)return i.pos;if(i.popState(),i.ok&&i.pos<=t)return i.pos;i.popState()}return i.ok?i.pos:s===h?0:(i.popState(),i.ok?i.pos:(i.popState(),i.ok?i.pos:0))}return s===r||s===n?(i.pushRightBeforeInput(),i.pushRightBeforeRequired(),i.pushRightBeforeFilled()?i.pos:s===n?this.displayValue.length:(i.popState(),i.ok?i.pos:(i.popState(),i.ok?i.pos:this.nearestInputPos(t,e)))):t}totalInputPositions(t,s){void 0===t&&(t=0),void 0===s&&(s=this.displayValue.length);let i=0;return this._forEachBlocksInRange(t,s,((t,s,u,e)=>{i+=t.totalInputPositions(u,e)})),i}maskedBlock(t){return this.maskedBlocks(t)[0]}maskedBlocks(t){const s=this._maskedBlocks[t];return s?s.map((t=>this._blocks[t])):[]}pad(t){const s=new g;return this._forEachBlocksInRange(0,this.displayValue.length,(i=>s.aggregate(i.pad(t)))),s}}b.DEFAULTS={...E.DEFAULTS,lazy:!0,placeholderChar:"_"},b.STOP_CHAR="`",b.ESCAPE_CHAR="\\",b.InputDefinition=_,b.FixedDefinition=k,d.MaskedPattern=b;class y extends b{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){const{to:s=this.to||0,from:i=this.from||0,maxLength:u=this.maxLength||0,autofix:e=this.autofix,...h}=t;this.to=s,this.from=i,this.maxLength=Math.max(String(s).length,u),this.autofix=e;const r=String(this.from).padStart(this.maxLength,"0"),n=String(this.to).padStart(this.maxLength,"0");let o=0;for(;o<n.length&&n[o]===r[o];)++o;h.mask=n.slice(0,o).replace(/0/g,"\\0")+"0".repeat(this.maxLength-o),super._update(h)}get isComplete(){return super.isComplete&&Boolean(this.value)}boundaries(t){let s="",i="";const[,u,e]=t.match(/^(\D*)(\d*)(\D*)/)||[];return e&&(s="0".repeat(u.length)+e,i="9".repeat(u.length)+e),s=s.padEnd(this.maxLength,"0"),i=i.padEnd(this.maxLength,"9"),[s,i]}doPrepareChar(t,s){let i;return void 0===s&&(s={}),[t,i]=super.doPrepareChar(t.replace(/\D/g,""),s),t||(i.skip=!this.isComplete),[t,i]}_appendCharRaw(t,s){if(void 0===s&&(s={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(t,s);const i=String(this.from).padStart(this.maxLength,"0"),u=String(this.to).padStart(this.maxLength,"0"),[e,h]=this.boundaries(this.value+t);return Number(h)<this.from?super._appendCharRaw(i[this.value.length],s):Number(e)>this.to?!s.tail&&"pad"===this.autofix&&this.value.length+1<this.maxLength?super._appendCharRaw(i[this.value.length],s).aggregate(this._appendCharRaw(t,s)):super._appendCharRaw(u[this.value.length],s):super._appendCharRaw(t,s)}doValidate(t){const s=this.value;if(-1===s.search(/[^0]/)&&s.length<=this._matchFrom)return!0;const[i,u]=this.boundaries(s);return this.from<=Number(u)&&Number(i)<=this.to&&super.doValidate(t)}pad(t){const s=new g;if(this.value.length===this.maxLength)return s;const i=this.value,u=this.maxLength-this.value.length;if(u){this.reset();for(let i=0;i<u;++i)s.aggregate(super._appendCharRaw("0",t));i.split("").forEach((t=>this._appendCharRaw(t)))}return s}}d.MaskedRange=y;class x extends b{static extractPatternOptions(s){const{mask:i,pattern:u,...e}=s;return{...e,mask:t(i)?i:u}}constructor(t){super(x.extractPatternOptions({...x.DEFAULTS,...t}))}updateOptions(t){super.updateOptions(t)}_update(s){const{mask:i,pattern:u,blocks:e,...h}={...x.DEFAULTS,...s},r=Object.assign({},x.GET_DEFAULT_BLOCKS());s.min&&(r.Y.from=s.min.getFullYear()),s.max&&(r.Y.to=s.max.getFullYear()),s.min&&s.max&&r.Y.from===r.Y.to&&(r.m.from=s.min.getMonth()+1,r.m.to=s.max.getMonth()+1,r.m.from===r.m.to&&(r.d.from=s.min.getDate(),r.d.to=s.max.getDate())),Object.assign(r,this.blocks,e),super._update({...h,mask:t(i)?i:u,blocks:r})}doValidate(t){const s=this.date;return super.doValidate(t)&&(!this.isComplete||this.isDateExist(this.value)&&null!=s&&(null==this.min||this.min<=s)&&(null==this.max||s<=this.max))}isDateExist(t){return this.format(this.parse(t,this),this).indexOf(t)>=0}get date(){return this.typedValue}set date(t){this.typedValue=t}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(t){super.typedValue=t}maskEquals(t){return t===Date||super.maskEquals(t)}optionsIsChanged(t){return super.optionsIsChanged(x.extractPatternOptions(t))}}x.GET_DEFAULT_BLOCKS=()=>({d:{mask:y,from:1,to:31,maxLength:2},m:{mask:y,from:1,to:12,maxLength:2},Y:{mask:y,from:1900,to:9999}}),x.DEFAULTS={...b.DEFAULTS,mask:Date,pattern:"d{.}`m{.}`Y",format:t=>t?[String(t.getDate()).padStart(2,"0"),String(t.getMonth()+1).padStart(2,"0"),t.getFullYear()].join("."):"",parse:t=>{const[s,i,u]=t.split(".").map(Number);return new Date(u,i-1,s)}},d.MaskedDate=x;class S extends E{constructor(t){super({...S.DEFAULTS,...t}),this.currentMask=void 0}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),"mask"in t&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(t.mask)?t.mask.map((t=>{const{expose:s,...i}=p(t),u=A({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...i});return s&&(this.exposeMask=u),u})):[])}_appendCharRaw(t,s){void 0===s&&(s={});const i=this._applyDispatch(t,s);return this.currentMask&&i.aggregate(this.currentMask._appendChar(t,this.currentMaskFlags(s))),i}_applyDispatch(t,s,i){void 0===t&&(t=""),void 0===s&&(s={}),void 0===i&&(i="");const u=s.tail&&null!=s._beforeTailState?s._beforeTailState._value:this.value,e=this.rawInputValue,h=s.tail&&null!=s._beforeTailState?s._beforeTailState._rawInputValue:e,r=e.slice(h.length),n=this.currentMask,o=new g,a=null==n?void 0:n.state;return this.currentMask=this.doDispatch(t,{...s},i),this.currentMask&&(this.currentMask!==n?(this.currentMask.reset(),h&&(this.currentMask.append(h,{raw:!0}),o.tailShift=this.currentMask.value.length-u.length),r&&(o.tailShift+=this.currentMask.append(r,{raw:!0,tail:!0}).tailShift)):a&&(this.currentMask.state=a)),o}_appendPlaceholder(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}_appendEager(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendEager()),t}appendTail(t){const s=new g;return t&&s.aggregate(this._applyDispatch("",{},t)),s.aggregate(this.currentMask?this.currentMask.appendTail(t):super.appendTail(t))}currentMaskFlags(t){var s,i;return{...t,_beforeTailState:(null==(s=t._beforeTailState)?void 0:s.currentMaskRef)===this.currentMask&&(null==(i=t._beforeTailState)?void 0:i.currentMask)||t._beforeTailState}}doDispatch(t,s,i){return void 0===s&&(s={}),void 0===i&&(i=""),this.dispatch(t,this,s,i)}doValidate(t){return super.doValidate(t)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(t)))}doPrepare(t,s){void 0===s&&(s={});let[i,u]=super.doPrepare(t,s);if(this.currentMask){let t;[i,t]=super.doPrepare(i,this.currentMaskFlags(s)),u=u.aggregate(t)}return[i,u]}doPrepareChar(t,s){void 0===s&&(s={});let[i,u]=super.doPrepareChar(t,s);if(this.currentMask){let t;[i,t]=super.doPrepareChar(i,this.currentMaskFlags(s)),u=u.aggregate(t)}return[i,u]}reset(){var t;null==(t=this.currentMask)||t.reset(),this.compiledMasks.forEach((t=>t.reset()))}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(t){this.exposeMask?(this.exposeMask.value=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=t}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(t){this.exposeMask?(this.exposeMask.unmaskedValue=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=t}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(t){if(this.exposeMask)return this.exposeMask.typedValue=t,this.currentMask=this.exposeMask,void this._applyDispatch();let s=String(t);this.currentMask&&(this.currentMask.typedValue=t,s=this.currentMask.unmaskedValue),this.unmaskedValue=s}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var t;return Boolean(null==(t=this.currentMask)?void 0:t.isComplete)}get isFilled(){var t;return Boolean(null==(t=this.currentMask)?void 0:t.isFilled)}remove(t,s){const i=new g;return this.currentMask&&i.aggregate(this.currentMask.remove(t,s)).aggregate(this._applyDispatch()),i}get state(){var t;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map((t=>t.state)),currentMaskRef:this.currentMask,currentMask:null==(t=this.currentMask)?void 0:t.state}}set state(t){const{compiledMasks:s,currentMaskRef:i,currentMask:u,...e}=t;s&&this.compiledMasks.forEach(((t,i)=>t.state=s[i])),null!=i&&(this.currentMask=i,this.currentMask.state=u),super.state=e}extractInput(t,s,i){return this.currentMask?this.currentMask.extractInput(t,s,i):""}extractTail(t,s){return this.currentMask?this.currentMask.extractTail(t,s):super.extractTail(t,s)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(t,s){return this.currentMask?this.currentMask.nearestInputPos(t,s):super.nearestInputPos(t,s)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(t){this._overwrite=t}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(t){this._eager=t}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(t){this._skipInvalid=t}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(t){this._autofix=t}maskEquals(t){return Array.isArray(t)?this.compiledMasks.every(((s,i)=>{if(!t[i])return;const{mask:u,...e}=t[i];return a(s,e)&&s.maskEquals(u)})):super.maskEquals(t)}typedValueEquals(t){var s;return Boolean(null==(s=this.currentMask)?void 0:s.typedValueEquals(t))}}S.DEFAULTS={...E.DEFAULTS,dispatch:(t,s,i,u)=>{if(!s.compiledMasks.length)return;const e=s.rawInputValue,r=s.compiledMasks.map(((r,n)=>{const o=s.currentMask===r,a=o?r.displayValue.length:r.nearestInputPos(r.displayValue.length,h);return r.rawInputValue!==e?(r.reset(),r.append(e,{raw:!0})):o||r.remove(a),r.append(t,s.currentMaskFlags(i)),r.appendTail(u),{index:n,weight:r.rawInputValue.length,totalInputPositions:r.totalInputPositions(0,Math.max(a,r.nearestInputPos(r.displayValue.length,h)))}}));return r.sort(((t,s)=>s.weight-t.weight||s.totalInputPositions-t.totalInputPositions)),s.compiledMasks[r[0].index]}},d.MaskedDynamic=S;class V extends b{constructor(t){super({...V.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){const{enum:s,...i}=t;if(s){const t=s.map((t=>t.length)),u=Math.min(...t),e=Math.max(...t)-u;i.mask="*".repeat(u),e&&(i.mask+="["+"*".repeat(e)+"]"),this.enum=s}super._update(i)}_appendCharRaw(t,s){void 0===s&&(s={});const i=Math.min(this.nearestInputPos(0,n),this.value.length),u=this.enum.filter((s=>this.matchValue(s,this.unmaskedValue+t,i)));if(u.length){1===u.length&&this._forEachBlocksInRange(0,this.value.length,((t,i)=>{const e=u[0][i];i>=this.value.length||e===t.value||(t.reset(),t._appendChar(e,s))}));const t=super._appendCharRaw(u[0][this.value.length],s);return 1===u.length&&u[0].slice(this.unmaskedValue.length).split("").forEach((s=>t.aggregate(super._appendCharRaw(s)))),t}return new g({skip:!this.isComplete})}extractTail(t,s){return void 0===t&&(t=0),new D("",t)}remove(t,s){if(void 0===t&&(t=0),void 0===s&&(s=this.displayValue.length),t===s)return new g;const i=Math.min(super.nearestInputPos(0,n),this.value.length);let u;for(u=t;u>=0&&!(this.enum.filter((t=>this.matchValue(t,this.value.slice(i,u),i))).length>1);--u);const e=super.remove(u,s);return e.tailShift+=u-t,e}get isComplete(){return this.enum.indexOf(this.value)>=0}}var I;V.DEFAULTS={...b.DEFAULTS,matchValue:(t,s,i)=>t.indexOf(s,i)===i},d.MaskedEnum=V,d.MaskedFunction=class extends E{updateOptions(t){super.updateOptions(t)}_update(t){super._update({...t,validate:t.mask})}};class O extends E{constructor(t){super({...O.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),this._updateRegExps()}_updateRegExps(){const t="^"+(this.allowNegative?"[+|\\-]?":""),s=(this.scale?"("+o(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+"\\d*"+s),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(o).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(o(this.thousandsSeparator),"g")}_removeThousandsSeparators(t){return t.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(t){const s=t.split(this.radix);return s[0]=s[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),s.join(this.radix)}doPrepareChar(t,s){void 0===s&&(s={});const[i,u]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(s.input&&s.raw||!s.input&&!s.raw)?t.replace(this._mapToRadixRegExp,this.radix):t),s);return t&&!i&&(u.skip=!0),!i||this.allowPositive||this.value||"-"===i||u.aggregate(this._appendChar("-")),[i,u]}_separatorsCount(t,s){void 0===s&&(s=!1);let i=0;for(let u=0;u<t;++u)this._value.indexOf(this.thousandsSeparator,u)===u&&(++i,s&&(t+=this.thousandsSeparator.length));return i}_separatorsCountFromSlice(t){return void 0===t&&(t=this._value),this._separatorsCount(this._removeThousandsSeparators(t).length,!0)}extractInput(t,s,i){return void 0===t&&(t=0),void 0===s&&(s=this.displayValue.length),[t,s]=this._adjustRangeWithSeparators(t,s),this._removeThousandsSeparators(super.extractInput(t,s,i))}_appendCharRaw(t,s){void 0===s&&(s={});const i=this._separatorsCountFromSlice(s.tail&&s._beforeTailState?s._beforeTailState._value:this._value);this._value=this._removeThousandsSeparators(this.value);const u=this._value;this._value+=t;let e,h=!isNaN(this.number),r=!1;if(h){let t;null!=this.min&&this.min<0&&this.number<this.min&&(t=this.min),null!=this.max&&this.max>0&&this.number>this.max&&(t=this.max),null!=t&&(this.autofix?(this._value=this.format(t,this).replace(O.UNMASKED_RADIX,this.radix),r||(r=u===this._value&&!s.tail)):h=!1),h&&(h=Boolean(this._value.match(this._numberRegExp)))}h?e=new g({inserted:this._value.slice(u.length),rawInserted:r?"":t,skip:r}):(this._value=u,e=new g),this._value=this._insertThousandsSeparators(this._value);const n=this._separatorsCountFromSlice(s.tail&&s._beforeTailState?s._beforeTailState._value:this._value);return e.tailShift+=(n-i)*this.thousandsSeparator.length,e}_findSeparatorAround(t){if(this.thousandsSeparator){const s=this.value.indexOf(this.thousandsSeparator,t-this.thousandsSeparator.length+1);if(s<=t)return s}return-1}_adjustRangeWithSeparators(t,s){const i=this._findSeparatorAround(t);i>=0&&(t=i);const u=this._findSeparatorAround(s);return u>=0&&(s=u+this.thousandsSeparator.length),[t,s]}remove(t,s){void 0===t&&(t=0),void 0===s&&(s=this.displayValue.length),[t,s]=this._adjustRangeWithSeparators(t,s);const i=this.value.slice(0,t),u=this.value.slice(s),e=this._separatorsCount(i.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(i+u));const h=this._separatorsCountFromSlice(i);return new g({tailShift:(h-e)*this.thousandsSeparator.length})}nearestInputPos(t,s){if(!this.thousandsSeparator)return t;switch(s){case u:case e:case h:{const i=this._findSeparatorAround(t-1);if(i>=0){const u=i+this.thousandsSeparator.length;if(t<u||this.value.length<=u||s===h)return i}break}case r:case n:{const s=this._findSeparatorAround(t);if(s>=0)return s+this.thousandsSeparator.length}}return t}doCommit(){if(this.value){const t=this.number;let s=t;null!=this.min&&(s=Math.max(s,this.min)),null!=this.max&&(s=Math.min(s,this.max)),s!==t&&(this.unmaskedValue=this.format(s,this));let i=this.value;this.normalizeZeros&&(i=this._normalizeZeros(i)),this.padFractionalZeros&&this.scale>0&&(i=this._padFractionalZeros(i)),this._value=i}super.doCommit()}_normalizeZeros(t){const s=this._removeThousandsSeparators(t).split(this.radix);return s[0]=s[0].replace(/^(\D*)(0*)(\d*)/,((t,s,i,u)=>s+u)),t.length&&!/\d$/.test(s[0])&&(s[0]=s[0]+"0"),s.length>1&&(s[1]=s[1].replace(/0*$/,""),s[1].length||(s.length=1)),this._insertThousandsSeparators(s.join(this.radix))}_padFractionalZeros(t){if(!t)return t;const s=t.split(this.radix);return s.length<2&&s.push(""),s[1]=s[1].padEnd(this.scale,"0"),s.join(this.radix)}doSkipInvalid(t,s,i){void 0===s&&(s={});const u=0===this.scale&&t!==this.thousandsSeparator&&(t===this.radix||t===O.UNMASKED_RADIX||this.mapToRadix.includes(t));return super.doSkipInvalid(t,s,i)&&!u}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,O.UNMASKED_RADIX)}set unmaskedValue(t){super.unmaskedValue=t}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(t){this.rawInputValue=this.format(t,this).replace(O.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(t){this.typedValue=t}get allowNegative(){return null!=this.min&&this.min<0||null!=this.max&&this.max<0}get allowPositive(){return null!=this.min&&this.min>0||null!=this.max&&this.max>0}typedValueEquals(t){return(super.typedValueEquals(t)||O.EMPTY_VALUES.includes(t)&&O.EMPTY_VALUES.includes(this.typedValue))&&!(0===t&&""===this.value)}}I=O,O.UNMASKED_RADIX=".",O.EMPTY_VALUES=[...E.EMPTY_VALUES,0],O.DEFAULTS={...E.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[I.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:t=>t.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},d.MaskedNumber=O;const T={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function P(t,s,i){void 0===s&&(s=T.MASKED),void 0===i&&(i=T.MASKED);const u=A(t);return t=>u.runIsolated((u=>(u[s]=t,u[i])))}d.PIPE_TYPE=T,d.createPipe=P,d.pipe=function(t,s,i,u){return P(s,i,u)(t)},d.RepeatBlock=class extends b{get repeatFrom(){var t;return null!=(t=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)?t:0}get repeatTo(){var t;return null!=(t=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)?t:1/0}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){var s,i,u;const{repeat:e,...h}=p(t);this._blockOpts=Object.assign({},this._blockOpts,h);const r=A(this._blockOpts);this.repeat=null!=(s=null!=(i=null!=e?e:r.repeat)?i:this.repeat)?s:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&(null==(u=this._blocks)?void 0:u.length)||0,this.repeatFrom)),blocks:{m:r},eager:r.eager,overwrite:r.overwrite,skipInvalid:r.skipInvalid,lazy:r.lazy,placeholderChar:r.placeholderChar,displayChar:r.displayChar})}_allocateBlock(t){return t<this._blocks.length?this._blocks[t]:this.repeatTo===1/0||this._blocks.length<this.repeatTo?(this._blocks.push(A(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]):void 0}_appendCharRaw(t,s){void 0===s&&(s={});const i=new g;for(let n,o,a=null!=(u=null==(e=this._mapPosToBlock(this.displayValue.length))?void 0:e.index)?u:Math.max(this._blocks.length-1,0);n=null!=(h=this._blocks[a])?h:o=!o&&this._allocateBlock(a);++a){var u,e,h,r;const l=n._appendChar(t,{...s,_beforeTailState:null==(r=s._beforeTailState)||null==(r=r._blocks)?void 0:r[a]});if(l.skip&&o){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(i.aggregate(l),l.consumed)break}return i}_trimEmptyTail(t,s){var i,u;void 0===t&&(t=0);const e=Math.max((null==(i=this._mapPosToBlock(t))?void 0:i.index)||0,this.repeatFrom,0);let h;null!=s&&(h=null==(u=this._mapPosToBlock(s))?void 0:u.index),null==h&&(h=this._blocks.length-1);let r=0;for(let t=h;e<=t&&!this._blocks[t].unmaskedValue;--t,++r);r&&(this._blocks.splice(h-r+1,r),this.mask=this.mask.slice(r))}reset(){super.reset(),this._trimEmptyTail()}remove(t,s){void 0===t&&(t=0),void 0===s&&(s=this.displayValue.length);const i=super.remove(t,s);return this._trimEmptyTail(t,s),i}totalInputPositions(t,s){return void 0===t&&(t=0),null==s&&this.repeatTo===1/0?1/0:super.totalInputPositions(t,s)}get state(){return super.state}set state(t){this._blocks.length=t._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=t}};try{globalThis.IMask=d}catch{}export{d as I}
@@ -0,0 +1 @@
1
+ var r,n,a,e;!function(r){r.fetchData="Error retrieving business data",r.patchData="Error updating business data"}(r||(r={})),function(r){r.nextStep="nextStep",r.previousStep="previousStep",r.submit="submit"}(n||(n={})),function(r){r.fetchData="Error retrieving owner data",r.patchData="Error updating owner data",r.postData="Error adding owner data"}(a||(a={})),function(r){r.removeOwner="removeOwner",r.addOwner="addOwner",r.addOwnerForm="addOwnerForm",r.updateOwner="updateOwner"}(e||(e={}));export{r as B,e as O,n as a,a as b}
@@ -1 +1 @@
1
- import{S as t}from"./p-6078a370.js";function s(t){return/^\d$/.test(t)?"0"+t:t}function i(t,i,h){if(t&&i&&h)return`${t}-${s(i)}-${s(h)}`}function h(t){const[s,i,h]=t.split("-");return{dob_year:s,dob_month:i,dob_day:h}}class n{constructor(t){this.address=Object.assign({},new e(t.address||{})),this.created_at=t.created_at,this.dob_day=s(t.dob_day),this.dob_month=s(t.dob_month),this.dob_year=t.dob_year,this.dob_full=i(this.dob_year,this.dob_month,this.dob_day)||"",this.documents=t.documents,this.email=t.email,this.id=t.id,this.business_id=t.business_id,this.is_owner=t.is_owner,this.metadata=t.metadata,this.name=t.name,this.phone=t.phone,this.platform_account_id=t.platform_account_id,this.identification_number=t.identification_number,this.ssn_last4=t.ssn_last4,this.title=t.title,this.updated_at=t.updated_at}}class r{constructor(t){this.address=Object.assign({},new e(t.address||{})),this.created_at=t.created_at,this.dob_day=s(t.dob_day),this.dob_month=s(t.dob_month),this.dob_year=t.dob_year,this.dob_full=i(this.dob_year,this.dob_month,this.dob_day)||"",this.documents=t.documents,this.email=t.email,this.id=t.id,this.business_id=t.business_id,this.is_owner=t.is_owner,this.metadata=t.metadata,this.name=t.name,this.phone=t.phone,this.platform_account_id=t.platform_account_id,this.identification_number=t.identification_number,this.ssn_last4=t.ssn_last4,this.title=t.title,this.updated_at=t.updated_at}}var o,c;!function(t){t.individual="individual",t.for_profit="for_profit",t.non_profit="non_profit",t.government_entity="government_entity"}(o||(o={})),function(t){t.sole_proprietorship="sole_proprietorship",t.single_llc="single_llc",t.multi_llc="multi_llc",t.private_partnership="private_partnership",t.private_corporation="private_corporation",t.unincorporated_association="unincorporated_association",t.public_partnership="public_partnership",t.public_corporation="public_corporation",t.incorporated="incorporated",t.unincorporated="unincorporated",t.government_unit="government_unit",t.government_instrumentality="government_instrumentality",t.tax_exempt_government_instrumentality="tax_exempt_government_instrumentality"}(c||(c={}));class e{constructor(s){this.id=s.id,this.platform_account_id=s.platform_account_id,this.line1=s.line1,this.line2=s.line2,this.postal_code=s.postal_code,this.city=s.city,this.state=function(s){const i=t.find((t=>t.label===s));return i?i.value:s}(s.state),this.country=s.country||"USA",this.created_at=s.created_at,this.updated_at=s.updated_at}}class a{constructor(t){this.business_revenue=t.business_revenue,this.business_payment_volume=t.business_payment_volume,this.business_dispute_volume=t.business_dispute_volume,this.business_receivable_volume=t.business_receivable_volume}}class u{constructor(t){this.business_type=t.business_type,this.business_structure=t.business_structure,this.legal_name=t.legal_name,this.doing_business_as=t.doing_business_as,this.industry=t.industry,this.tax_id=t.tax_id,this.website_url=t.website_url,this.email=t.email,this.phone=t.phone}}class p{constructor(t){this.additional_questions=t.additional_questions||{},this.bank_accounts=t.bank_accounts,this.business_type=t.business_type,this.business_structure=t.business_structure,this.created_at=t.created_at,this.documents=t.documents,this.doing_business_as=t.doing_business_as,this.email=t.email,this.id=t.id,this.industry=t.industry,this.legal_address=Object.assign({},new e(t.legal_address||{})),this.legal_name=t.legal_name,this.metadata=t.metadata,this.owners=t.owners,this.phone=t.phone,this.platform_account_id=t.platform_account_id,this.product_categories=t.product_categories,this.representative=Object.assign({},new r(t.representative||{})),this.tax_id=t.tax_id,this.updated_at=t.updated_at,this.website_url=t.website_url}}export{a as A,p as B,u as C,n as O,r as R,o as a,c as b,e as c,h as d}
1
+ import{S as t}from"./p-6078a370.js";function s(t){return/^\d$/.test(t)?"0"+t:t}function i(t,i,h){if(t&&i&&h)return`${t}-${s(i)}-${s(h)}`}function h(t){const[s,i,h]=t.split("-");return{dob_year:s,dob_month:i,dob_day:h}}class n{constructor(t){this.address=Object.assign({},new e(t.address||{})),this.created_at=t.created_at,this.dob_day=s(t.dob_day),this.dob_month=s(t.dob_month),this.dob_year=t.dob_year,this.dob_full=i(this.dob_year,this.dob_month,this.dob_day)||"",this.documents=t.documents,this.email=t.email,this.id=t.id,this.business_id=t.business_id,this.is_owner=t.is_owner,this.metadata=t.metadata,this.name=t.name,this.phone=t.phone,this.platform_account_id=t.platform_account_id,this.identification_number=t.identification_number,this.ssn_last4=t.ssn_last4,this.title=t.title,this.updated_at=t.updated_at}}class r{constructor(t){this.address=Object.assign({},new e(t.address||{})),this.created_at=t.created_at,this.dob_day=s(t.dob_day),this.dob_month=s(t.dob_month),this.dob_year=t.dob_year,this.dob_full=i(this.dob_year,this.dob_month,this.dob_day)||"",this.documents=t.documents,this.email=t.email,this.id=t.id,this.business_id=t.business_id,this.is_owner=t.is_owner,this.metadata=t.metadata,this.name=t.name,this.phone=t.phone,this.platform_account_id=t.platform_account_id,this.identification_number=t.identification_number,this.ssn_last4=t.ssn_last4,this.title=t.title,this.updated_at=t.updated_at}}var o,c;!function(t){t.individual="individual",t.for_profit="for_profit",t.non_profit="non_profit",t.government_entity="government_entity"}(o||(o={})),function(t){t.sole_proprietorship="sole_proprietorship",t.single_llc="single_llc",t.multi_llc="multi_llc",t.private_partnership="private_partnership",t.private_corporation="private_corporation",t.unincorporated_association="unincorporated_association",t.public_partnership="public_partnership",t.public_corporation="public_corporation",t.incorporated="incorporated",t.unincorporated="unincorporated",t.government_unit="government_unit",t.government_instrumentality="government_instrumentality",t.tax_exempt_government_instrumentality="tax_exempt_government_instrumentality"}(c||(c={}));class e{constructor(s){this.id=s.id,this.platform_account_id=s.platform_account_id,this.line1=s.line1,this.line2=s.line2,this.postal_code=s.postal_code,this.city=s.city,this.state=function(s){const i=t.find((t=>t.label===s));return i?i.value:s}(s.state),this.country=s.country||"USA",this.created_at=s.created_at,this.updated_at=s.updated_at}}class a{constructor(t){this.business_revenue=t.business_revenue,this.business_payment_volume=t.business_payment_volume,this.business_when_service_received=t.business_when_service_received,this.business_recurring_payments=t.business_recurring_payments,this.business_recurring_payments_percentage=t.business_recurring_payments_percentage,this.business_seasonal=t.business_seasonal,this.business_other_payment_details=t.business_other_payment_details}}class u{constructor(t){this.business_type=t.business_type,this.business_structure=t.business_structure,this.legal_name=t.legal_name,this.doing_business_as=t.doing_business_as,this.industry=t.industry,this.tax_id=t.tax_id,this.website_url=t.website_url,this.email=t.email,this.phone=t.phone,this.date_of_incorporation=t.date_of_incorporation}}class p{constructor(t){this.additional_questions=Object.assign({},new a(t.additional_questions||{})),this.bank_accounts=t.bank_accounts,this.business_type=t.business_type,this.business_structure=t.business_structure,this.created_at=t.created_at,this.documents=t.documents,this.doing_business_as=t.doing_business_as,this.email=t.email,this.id=t.id,this.industry=t.industry,this.legal_address=Object.assign({},new e(t.legal_address||{})),this.legal_name=t.legal_name,this.metadata=t.metadata,this.owners=t.owners,this.phone=t.phone,this.platform_account_id=t.platform_account_id,this.product_categories=t.product_categories,this.representative=Object.assign({},new r(t.representative||{})),this.tax_id=t.tax_id,this.updated_at=t.updated_at,this.website_url=t.website_url,this.date_of_incorporation=t.date_of_incorporation}}export{a as A,p as B,u as C,n as O,r as R,o as a,c as b,e as c,h as d}
@@ -0,0 +1 @@
1
+ import{r as t,c as s,h as i}from"./p-9ee8ad4d.js";import{P as o}from"./p-731085e3.js";import"./p-56f6ce4c.js";import"./p-02fa533c.js";import{P as e}from"./p-e3fab0e2.js";import{C as r,a}from"./p-0d80748f.js";import{g as p,a as h}from"./p-00ca94d1.js";import{E as d}from"./p-3302bc76.js";import"./p-13e2f667.js";import"./p-ae263544.js";const n=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event",7),this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.payoutId=void 0,this.authToken=void 0,this.getPayout=void 0,this.errorMessage=null}componentWillLoad(){this.initializeGetPayout()}propChanged(){this.initializeGetPayout()}initializeGetPayout(){this.payoutId&&this.authToken?this.getPayout=(({id:t,authToken:s,service:i})=>async({onSuccess:o,onError:a})=>{var d;try{const n=await i.fetchPayout(t,s);n.error?a({error:p(n.error),code:h(null===(d=n.error)||void 0===d?void 0:d.code),severity:r.ERROR}):o(new e(n.data))}catch(t){a({error:p(t),code:h(null==t?void 0:t.code),severity:r.ERROR})}})({id:this.payoutId,authToken:this.authToken,service:new o}):(this.errorMessage="Failed to load payout details. payoutId or authToken is not provided.",this.errorEvent.emit({message:this.errorMessage,errorCode:a.MISSING_PROPS,severity:r.ERROR}))}render(){return this.errorMessage?d(this.errorMessage):i("payout-details-core",{getPayout:this.getPayout,"onError-event":this.handleErrorEvent})}static get watchers(){return{payoutId:["propChanged"],authToken:["propChanged"]}}};export{n as justifi_payout_details}