@incodetech/web 2.5.0-rc.7 → 2.5.0-rc.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{GeolocationPermissionDenied-BR9l25e1.js → GeolocationPermissionDenied-0B33i_00.js} +3 -3
- package/dist/{Password-B73tO_0m.js → Password--d-xAEbm.js} +1 -1
- package/dist/{RadioGroup-C9GXroAz.js → RadioGroup-m1HQ9AD6.js} +1 -1
- package/dist/{ekycModule-jJmV2I_l.js → Stepper-C2mCtkSd.js} +3 -377
- package/dist/{TextField-RDQtWpyg.js → TextField-B5TOHuK-.js} +1 -1
- package/dist/ae-signature/ae-signature.es.js +3 -3
- package/dist/{af-ZA-DupE1aGM.js → af-ZA-CS0Zb4Qv.js} +24 -0
- package/dist/{ageVerification-CR92-Fuu.js → ageVerification-CJoxrUhR.js} +3 -3
- package/dist/{am-Cg4VmUon.js → am-D-kHjues.js} +24 -0
- package/dist/antifraud/antifraud.es.js +4 -4
- package/dist/{applyStudioConfig-UcjnCmtU.js → applyStudioConfig-z5E6aHvI.js} +1 -1
- package/dist/{ar-AE-JL9ul6zH.js → ar-AE-C7KTyA4-.js} +24 -0
- package/dist/{ar-AwS7bGhI.js → ar-DVNz1O5K.js} +24 -0
- package/dist/{ar-EG-bzdb06vP.js → ar-EG-lRASRFi1.js} +24 -0
- package/dist/assets/great-vibes-latin-400-normal.woff2 +0 -0
- package/dist/assets/great-vibes-latin-ext-400-normal.woff2 +0 -0
- package/dist/authentication/authentication.es.js +6 -6
- package/dist/{autoFocusTitle-D2jJIich.js → autoFocusTitle-n8wjEbiD.js} +1 -1
- package/dist/{az-AOaj2_CW.js → az-B4x-MAvN.js} +24 -0
- package/dist/{baseTutorial-uC1WwI5Q.js → baseTutorial-1rNtbN_W.js} +2 -2
- package/dist/{bn-BDaegzZY.js → bn-b7xChbLV.js} +24 -0
- package/dist/{bottomSheet-CUuHqiiw.js → bottomSheet-CpT03Ad0.js} +2 -2
- package/dist/{bs-Dj30t0JP.js → bs-DKCj1AKk.js} +24 -0
- package/dist/{ca-Cb1jkIer.js → ca-CngftxPi.js} +24 -0
- package/dist/cameraOverlay-Cbqv0zu8.js +2 -0
- package/dist/{cameraOverlayHeader-CLNKydJt.js → cameraOverlayHeader-BWil1uaf.js} +3 -3
- package/dist/{cameraView-qm_SI6CN.js → cameraView-Ci4vNmhR.js} +1 -1
- package/dist/{capture-DYwT0bcM.js → capture-7Q4HCfly.js} +19 -19
- package/dist/capture-BFq1DvnX.js +2 -0
- package/dist/{capture-DIvXYAHs.js → capture-CztXxcpZ.js} +8 -8
- package/dist/capture-IoV35tKv.js +3 -0
- package/dist/{captureFocusContext-Bo52JTWE.js → captureFocusContext-DrNf5C3a.js} +8 -8
- package/dist/{captureFooter-B-uIO01g.js → captureFooter-C9nDhlAl.js} +3 -3
- package/dist/{ceb-CO2DSlNK.js → ceb-CmBMQbQ7.js} +24 -0
- package/dist/certificate-issuance/certificate-issuance.es.js +9 -9
- package/dist/{checkbox-lnZNKnWO.js → checkbox-MV1niIg8.js} +1 -1
- package/dist/{chooser-BLBnFUEY.js → chooser-2Ho7jvM3.js} +7 -7
- package/dist/{connectionError-CAmQYZ59.js → connectionError-C3Im29Lf.js} +3 -3
- package/dist/consent/consent.es.js +8 -8
- package/dist/{countrySelector-CinKyZha.js → countrySelector-BPam1aCa.js} +2 -2
- package/dist/cross-document-data-match/cross-document-data-match.es.js +4 -4
- package/dist/{cs-iIw6mjtE.js → cs-BH68Q-C4.js} +24 -0
- package/dist/{cs-CZ-DG11Ji4H.js → cs-CZ-DPHCQf3g.js} +24 -0
- package/dist/curp-validation/curp-validation.es.js +13 -13
- package/dist/{customFields-DDfmSX_M.js → customFields-BB57PsXB.js} +10 -10
- package/dist/{customWatchlist-DaHTF-TB.js → customWatchlist-D8W87ICM.js} +5 -5
- package/dist/{da-DK-BoyBuy2Z.js → da-DK-DVRf10dC.js} +24 -0
- package/dist/{dashboardTheme-BY-C2h8X.js → dashboardTheme-CK5LxON_.js} +1 -1
- package/dist/dateInputComposed-DLGKTsq6.js +1 -0
- package/dist/{dateInputComposed-c892J-FV.js → dateInputComposed-nPFeRZL7.js} +2 -2
- package/dist/{de-kckDkigo.js → de-CA4BDw6j.js} +24 -0
- package/dist/{denied-uUGJn0Eq.js → denied-OO72DOVK.js} +5 -5
- package/dist/{devWarn-B9c1I9Zm.js → devWarn-B_ZWD1Ma.js} +83 -83
- package/dist/{deviceWallet-DrUZ4Ndm.js → deviceWallet-Byz9FZYs.js} +3 -3
- package/dist/{digitalIdRedirect-BeEgCG7E.js → digitalIdRedirect-9hGFBiRp.js} +3 -3
- package/dist/{digitalIdUpload-Cxny-RVx.js → digitalIdUpload-BguY09ZU.js} +5 -5
- package/dist/document-capture/document-capture.es.js +1 -1
- package/dist/document-signature/document-signature.es.js +379 -0
- package/dist/document-signature/styles.css +2 -0
- package/dist/document-signature/styles.css.js +1 -0
- package/dist/documentCapture-C6HQKm3D.js +2 -0
- package/dist/{documentCapture-D8qfqp75.js → documentCapture-CTKnnysp.js} +19 -19
- package/dist/dropdownComposed-BFGEdY4f.js +1 -0
- package/dist/{dropdownComposed-BwyWBg1k.js → dropdownComposed-ZTDeSLHH.js} +1 -1
- package/dist/dynamic-forms/dynamic-forms.es.js +12 -12
- package/dist/ekyb/ekyb.es.js +1 -1
- package/dist/ekybModule-AdDNz24H.js +2 -0
- package/dist/{ekybModule-DAt9UvXw.js → ekybModule-g08S4MuW.js} +14 -14
- package/dist/ekyc/ekyc.es.js +1 -1
- package/dist/ekyc-prefill/ekyc-prefill.es.js +1 -1
- package/dist/ekycModule-Cij-OySe.js +377 -0
- package/dist/ekycModule-GilMv1ly.js +2 -0
- package/dist/{ekycPrefillModule-BHmCffr0.js → ekycPrefillModule-B50IPYzp.js} +13 -13
- package/dist/ekycPrefillModule-D2frVzI_.js +2 -0
- package/dist/{el-CkJr7Obh.js → el-111JzbMt.js} +24 -0
- package/dist/{el-GR-Dzs9fZSN.js → el-GR-pT9GxEa1.js} +24 -0
- package/dist/electronic-signature/electronic-signature.es.js +1 -1
- package/dist/{electronic-signature-DQkB1NtD.js → electronic-signature-CEf-Emo4.js} +9 -9
- package/dist/email/email.es.js +8 -8
- package/dist/{emailInput-a3OyvD5W.js → emailInput-Dev6Jzea.js} +2 -2
- package/dist/{en-DqcdFaz8.js → en-Cy2zS5na.js} +24 -0
- package/dist/{en-DG-CiRitH1A.js → en-DG-BHF6fSEW.js} +24 -0
- package/dist/{errorContent-Csk_9Pff.js → errorContent-BMLVzZSN.js} +4 -4
- package/dist/{errorParams-BbDif_k_.js → errorParams-naQThyJF.js} +1 -1
- package/dist/{es-419-BuYQCis7.js → es-419-CraZYl8o.js} +1 -1
- package/dist/{es-dIdngRez.js → es-CHpulHKM.js} +24 -0
- package/dist/{es-ES-gpMaqe2p.js → es-ES-CXmNgF5x.js} +24 -0
- package/dist/{es-MX-BrAACxHj.js → es-MX-CEqve3tw.js} +24 -0
- package/dist/{et-ByuThIf4.js → et-7qcTjUbL.js} +24 -0
- package/dist/{expiredId-CMYSAzlq.js → expiredId-paVBuz70.js} +4 -4
- package/dist/extensibility.es.js +37 -37
- package/dist/{fa-IR-BJVvKcix.js → fa-IR-CfyoYnJ9.js} +24 -0
- package/dist/face-match/face-match.es.js +1 -1
- package/dist/{faceMatch-v84fcaLY.js → faceMatch-ApsFPC0x.js} +8 -8
- package/dist/faceMatch-CheOW9qu.js +2 -0
- package/dist/{fi-FI-FtyRHSI6.js → fi-FI-DtX0jexB.js} +24 -0
- package/dist/field-comparison/field-comparison.es.js +1 -1
- package/dist/{fieldComparison-FogIuD5r.js → fieldComparison-But3-xNi.js} +8 -8
- package/dist/fieldComparison-Dasafjh4.js +2 -0
- package/dist/{finalSuccessScreen-DV9PDmT5.js → finalSuccessScreen-DaZYsyoX.js} +10 -10
- package/dist/fiscal-qr/fiscal-qr.es.js +13 -13
- package/dist/{flipAnimation-DVirQhbq.js → flipAnimation-FItprthY.js} +4 -4
- package/dist/{flipCapturedCardEligibility-BaGqTFjl.js → flipCapturedCardEligibility-CYqCU_WD.js} +2 -2
- package/dist/flow/flow.es.js +17 -9
- package/dist/{formField-B7DD5pmm.js → formField-4Pv6yV_q.js} +3 -3
- package/dist/{fr-CA-DT0vQlrH.js → fr-CA-C-Z0qxfu.js} +24 -0
- package/dist/{fr-Bo-VnkiD.js → fr-DTPtjk0I.js} +24 -0
- package/dist/geolocation/geolocation.es.js +8 -8
- package/dist/government-validation/government-validation.es.js +6 -6
- package/dist/{he-TvDZLsyc.js → he-DiG3j9Ob.js} +24 -0
- package/dist/{hi-QZGikpiL.js → hi-Dy95_PJb.js} +24 -0
- package/dist/{hmn-PdVyVT0f.js → hmn-C6UKmSTc.js} +24 -0
- package/dist/{homeScreen-ByipnVnx.js → homeScreen-BilaT9aI.js} +5 -5
- package/dist/{hooks-CyPq-s9e.js → hooks-DlfCJbTr.js} +7 -7
- package/dist/{hr-BurgtWoq.js → hr-B3OnWPfN.js} +24 -0
- package/dist/{ht-VO9Q2fix.js → ht-CMHZsZzN.js} +24 -0
- package/dist/{hu-DKS-af7K.js → hu-DryyPd4v.js} +24 -0
- package/dist/id/id.es.js +34 -34
- package/dist/{id-CGQEt1-a.js → id-bJn3eqUy.js} +24 -0
- package/dist/id-selfie-flow/id-selfie-flow.es.js +12 -12
- package/dist/id-verification/id-verification.es.js +6 -6
- package/dist/{idFlipTransition-Dlkn48Nb.js → idFlipTransition-7lHtNXVy.js} +11 -11
- package/dist/{idOcr-fwZ40HJF.js → idOcr-CAgo6ApN.js} +10 -10
- package/dist/identity-reuse/identity-reuse.es.js +8 -8
- package/dist/{incodeComponent-YnByg9cm.js → incodeComponent-DSAIOlbW.js} +8 -8
- package/dist/{incodeModule-BSzjiLkM.js → incodeModule-BWaY51qG.js} +3 -3
- package/dist/index.es.js +3 -3
- package/dist/{inputComposed-RvM4KW_a.js → inputComposed-DWJ30g-2.js} +1 -1
- package/dist/{it-D_OVibOT.js → it-C6ItwxQt.js} +24 -0
- package/dist/{ja-JP-CJCJqW1o.js → ja-JP-DthJvk-L.js} +24 -0
- package/dist/{ja-DDw9RITP.js → ja-XvwHWZkM.js} +24 -0
- package/dist/{jv-YuDBxsLr.js → jv-D4n3BhDn.js} +24 -0
- package/dist/{ka-Bj2c9Sgl.js → ka-Cu5x-4dx.js} +24 -0
- package/dist/{kk-BoQwwK_V.js → kk-Bxn4Z_4p.js} +24 -0
- package/dist/{km-DzF7hAZK.js → km-QITgMcRW.js} +24 -0
- package/dist/{ko-KP-CR5tUUO4.js → ko-KP-abLpviTn.js} +24 -0
- package/dist/{ko-BHHfWaci.js → ko-iy9Ngf62.js} +24 -0
- package/dist/{ky-DZd_tqQc.js → ky-BHociaSA.js} +24 -0
- package/dist/kyb-checks/kyb-checks.es.js +1 -1
- package/dist/kybChecksModule-ByDfaHVo.js +2 -0
- package/dist/{kybChecksModule-B5BhywXA.js → kybChecksModule-KQDcGQ8T.js} +11 -11
- package/dist/{lo-CtKOFRC2.js → lo-BxygikZI.js} +24 -0
- package/dist/{lt-B-CyiKZP.js → lt-BtALddH6.js} +24 -0
- package/dist/{lv-C1AItIYb.js → lv-N9JcOAS7.js} +24 -0
- package/dist/{mandatoryConsent-Dg0E1xso.js → mandatoryConsent-DFskgvGi.js} +8 -8
- package/dist/{manualCaptureButton-Cu_idsp0.js → manualCaptureButton-BIpoP7Pc.js} +7 -7
- package/dist/{manualCaptureButton-fdTaewzg.js → manualCaptureButton-CPD79EuM.js} +2 -2
- package/dist/{mk-BemSEVRu.js → mk-axqEPbS7.js} +24 -0
- package/dist/{mn-uXyyeUdd.js → mn-CdQ93vMD.js} +24 -0
- package/dist/{ms-BJTdbpsn.js → ms-BJkudjku.js} +24 -0
- package/dist/{my-CzYNpA6m.js → my-AJydYOQk.js} +24 -0
- package/dist/{nb-NO-DfJiYiqE.js → nb-NO-91w8VGUC.js} +24 -0
- package/dist/{ne-ExqznoeT.js → ne-23ADmqx_.js} +24 -0
- package/dist/{nl-eSFKanvW.js → nl-FkXiVT4m.js} +24 -0
- package/dist/{optionAccessibleLabel-BRZCxlud.js → optionAccessibleLabel-vmiX9wqO.js} +5 -5
- package/dist/{otpInput-Bf5kyVX7.js → otpInput-D_bPyxY2.js} +3 -3
- package/dist/{page-DD0xdMgJ.js → page-DeOufwmM.js} +4 -4
- package/dist/{pageUiConfig-Fj_rR1FV.js → pageUiConfig-NTnoPniP.js} +2 -2
- package/dist/pdfViewer-D1yjvnM7.js +2 -0
- package/dist/{pdfViewer-DeZO-53D.js → pdfViewer-DBFxz2dx.js} +10 -5
- package/dist/{permissionInstructionList-DFAaBDmy.js → permissionInstructionList-BcuVjfek.js} +2 -2
- package/dist/{permissions-nm0JJvg1.js → permissions-CKVNMc66.js} +11 -11
- package/dist/phone/phone.es.js +9 -9
- package/dist/{phoneInputComposed-BcM7ni2T.js → phoneInputComposed-B-PsDEla.js} +2 -2
- package/dist/{pl-CcgG8Zrz.js → pl-tywnFeBV.js} +24 -0
- package/dist/{processing-B6w2AjSt.js → processing-DmUp12i5.js} +1 -1
- package/dist/{progressBar-B9UgkVU9.js → progressBar-X1jFGaPB.js} +1 -1
- package/dist/{pt-BR-xidRFt0O.js → pt-BR-CGxXhWH_.js} +24 -0
- package/dist/{pt-CaJL-8Wm.js → pt-CGyPI34z.js} +24 -0
- package/dist/{pt-PT-BemfAxYZ.js → pt-PT-DARZiN6M.js} +24 -0
- package/dist/qe-signature/qe-signature.es.js +3 -3
- package/dist/redirect-to-mobile/redirect-to-mobile.es.js +12 -112
- package/dist/{resendTimer-BqAZX50z.js → resendTimer-MSn2YJbl.js} +1 -1
- package/dist/{ro-Cr3LiAFO.js → ro-DtCalmHV.js} +24 -0
- package/dist/{ru-BEU13oLx.js → ru-CF91STw1.js} +24 -0
- package/dist/{ru-RU-Cin3exPK.js → ru-RU-CKTgDGKe.js} +24 -0
- package/dist/selfie/selfie.es.js +10 -10
- package/dist/signature/signature.es.js +9 -796
- package/dist/signatureCanvas-DuTVoQGO.js +795 -0
- package/dist/{sk-Dl0ibSAG.js → sk-B-e5UV3q.js} +24 -0
- package/dist/{sl-C96CpnZb.js → sl-BNy-sE8j.js} +24 -0
- package/dist/{smsTabContent-JZ7LYXU3.js → smsTabContent-CpA3UYBu.js} +5 -5
- package/dist/{so-j2TBuRQD.js → so-Wto3POqd.js} +24 -0
- package/dist/{spacer-BEXZYoty.js → spacer-WwMLXxnI.js} +10 -10
- package/dist/{spinner-Xk8AR7YA.js → spinner-IWELgrEX.js} +2 -2
- package/dist/{sr-B3OUCOCo.js → sr-C5oUbY7s.js} +24 -0
- package/dist/{sr-Latn-e5NF-Van.js → sr-Latn-XXmlsawS.js} +24 -0
- package/dist/{sr-YU-w5Gor-7m.js → sr-YU-C7FY55q8.js} +1 -1
- package/dist/{sv-SE-CU6-Qw8J.js → sv-SE-BLHM2veu.js} +24 -0
- package/dist/{sw-Dhszzd3n.js → sw-C39tMZhw.js} +24 -0
- package/dist/tabs-B8HU0IkA.js +104 -0
- package/dist/{th-yLHzdsZd.js → th-DiJ-dPT9.js} +24 -0
- package/dist/{th-TH-CP5CCahm.js → th-TH-DZSul0cd.js} +24 -0
- package/dist/themes/dark.css +1 -1
- package/dist/themes/light.css +1 -1
- package/dist/{tl-TdHnXVoM.js → tl-CTp6fdxV.js} +24 -0
- package/dist/{tl-PH-B5T_D6oa.js → tl-PH-RttCsl1j.js} +24 -0
- package/dist/{tr-CFW1Mpi2.js → tr-B1I1C8xn.js} +24 -0
- package/dist/{transitionSpinner-DfTz8dcL.js → transitionSpinner-raxlgp6d.js} +3 -3
- package/dist/{tutorial-Sqb1pNuP.js → tutorial-BGiAF5ID.js} +3 -3
- package/dist/types/document-signature.d.ts +208 -0
- package/dist/types/extensibility.d.ts +2 -0
- package/dist/{typography-Bc4jn0tt.js → typography-BE4Zx-5N.js} +1 -1
- package/dist/{uk-UA-BupzVL5p.js → uk-UA-BVb70zbt.js} +24 -0
- package/dist/{uk-BLIa8JGG.js → uk-fPpYpKFA.js} +24 -0
- package/dist/{ur-A2rfBmGe.js → ur-BkNxPXbQ.js} +24 -0
- package/dist/{useCaptureHelpButton-DS-lwBJ1.js → useCaptureHelpButton-BeuxBAH7.js} +2 -2
- package/dist/{uz-BOsoKrKz.js → uz-12t82qTm.js} +24 -0
- package/dist/{verificationResult-B27O0BSD.js → verificationResult-DmtPphWu.js} +6 -6
- package/dist/{vi-CBkbsUs-.js → vi-CeahlFh-.js} +24 -0
- package/dist/video-selfie/video-selfie.es.js +13 -13
- package/dist/watchlist/watchlist.es.js +5 -5
- package/dist/{watchlistForBusiness-Cd5_Qzha.js → watchlistForBusiness-gh-6WzU-.js} +9 -9
- package/dist/{withEndScreenTexts-DdmMlcfU.js → withEndScreenTexts-CS-Uylyh.js} +24 -18
- package/dist/workflow/workflow.es.js +11 -11
- package/dist/{zh-CCSd1OOu.js → zh-BFJOW_5h.js} +24 -0
- package/dist/{zh-CN-k2hU3_So.js → zh-CN-DGhEZgOq.js} +24 -0
- package/dist/{zh-HANT-BFHPubkp.js → zh-HANT-CrZLPKCa.js} +24 -0
- package/dist/{zh-TW-BqLwlUJp.js → zh-TW-C7hOiwoz.js} +24 -0
- package/package.json +12 -2
- package/dist/cameraOverlay-AO5fA2qP.js +0 -2
- package/dist/capture-CNfK8cak.js +0 -3
- package/dist/capture-DHv5ZrXl.js +0 -2
- package/dist/dateInputComposed-DNd6YcC6.js +0 -1
- package/dist/documentCapture-NV_ts9tv.js +0 -2
- package/dist/dropdownComposed-KwFvkqwA.js +0 -1
- package/dist/ekybModule-De0VnW4B.js +0 -2
- package/dist/ekycModule-DoWmZF0-.js +0 -2
- package/dist/ekycPrefillModule-BCfFhdy0.js +0 -2
- package/dist/faceMatch-wwRfSYXj.js +0 -2
- package/dist/fieldComparison-DBholcy9.js +0 -2
- package/dist/kybChecksModule-DLqCh8NZ.js +0 -2
- package/dist/pdfViewer-BkctTJG1.js +0 -2
- /package/dist/{aligndevicelottie-BEKzL4SB.js → aligndevicelottie-CQ7jczFR.js} +0 -0
- /package/dist/{back-horizontal-hint-Bci98ivl.js → back-horizontal-hint-sTbEroZE.js} +0 -0
- /package/dist/{back-tutorial-B9W63fa-.js → back-tutorial-klX9mKON.js} +0 -0
- /package/dist/{back-vertical-hint-DyPCItxn.js → back-vertical-hint-CNxFKi6x.js} +0 -0
- /package/dist/{backdevicelottie-DsN8QBV3.js → backdevicelottie-jTCNDpTU.js} +0 -0
- /package/dist/{blurdevicelottie-DkV7Kwo4.js → blurdevicelottie-pqGiMagI.js} +0 -0
- /package/dist/{flip-animation-DJVnWWL5.js → flip-animation-DCohSeJJ.js} +0 -0
- /package/dist/{front-horizontal-hint-LxyNVfjy.js → front-horizontal-hint-oczk0B6v.js} +0 -0
- /package/dist/{front-vertical-hint-BKEg_DRs.js → front-vertical-hint-CcM_F5Wd.js} +0 -0
- /package/dist/{frontdevicelottie-DiW1Wmya.js → frontdevicelottie-SI0idj7B.js} +0 -0
- /package/dist/{glaredevicelottie-CK-fnX_s.js → glaredevicelottie-cY1ha5U2.js} +0 -0
- /package/dist/{id-back-of-card-BhF5T4fC.js → id-back-of-card-B2DMU4Nz.js} +0 -0
- /package/dist/{id-back-of-card-vertical-BudLiGPR.js → id-back-of-card-vertical-BMw6DqdE.js} +0 -0
- /package/dist/{id-front-of-card-CiGcJhVW.js → id-front-of-card-BsQK8yYD.js} +0 -0
- /package/dist/{id-front-of-card-vertical-C_GyecLf.js → id-front-of-card-vertical-CEUjhlxr.js} +0 -0
- /package/dist/{id-laser-h-6Am_cjM8.js → id-laser-h-GvNl18UF.js} +0 -0
- /package/dist/{id-laser-v-DXoF3flH.js → id-laser-v-BDzt9JV6.js} +0 -0
- /package/dist/{id-tutorial-DkKH3eTE.js → id-tutorial-CbBP4tC3.js} +0 -0
- /package/dist/{lottie_light-Bam05Bc9.js → lottie_light-pO5qdkhZ.js} +0 -0
- /package/dist/{passport-horizontal-hint-Bn18pckF.js → passport-horizontal-hint-DqEhjOSq.js} +0 -0
- /package/dist/{passport-tutorial-D3Fpk-Tj.js → passport-tutorial-Dox3YU6v.js} +0 -0
- /package/dist/{passport-vertical-hint-D_bvTNZY.js → passport-vertical-hint-DRTZvYwh.js} +0 -0
- /package/dist/{pdf-DO_HvE8T.js → pdf-ImBucwwV.js} +0 -0
- /package/dist/{pdf.worker.min-D0hm-8jN.js → pdf.worker.min-3yVqy4Ya.js} +0 -0
- /package/dist/{preloadableLazy-KWGuHoqn.js → preloadableLazy-CVPMpVvd.js} +0 -0
- /package/dist/{sanitizeSvg-IfqLuP1N.js → sanitizeSvg-A_Z9ciep.js} +0 -0
- /package/dist/{selfieTutorial-DnsRD1Z9.js → selfieTutorial-C5EJxWzc.js} +0 -0
- /package/dist/{useModuleLoader-BCYS1xLP.js → useModuleLoader-BK8YwQig.js} +0 -0
|
@@ -1,801 +1,14 @@
|
|
|
1
|
-
import { u as useTranslation } from "../devWarn-
|
|
2
|
-
import { b as y,
|
|
1
|
+
import { u as useTranslation } from "../devWarn-B_ZWD1Ma.js";
|
|
2
|
+
import { b as y, h as d, u as A, v as q, x as u } from "../vendor-preact-CjnloSla.js";
|
|
3
3
|
import { b as PrizmaButton } from "../icons-DLZTxOV2.js";
|
|
4
|
-
import { h as cn, t as Spacer } from "../spacer-
|
|
5
|
-
import { t as Page } from "../page-
|
|
6
|
-
import { _ as useModuleTerminalCallbacks, t as withStandaloneModuleBootstrap, y as useManager } from "../hooks-
|
|
7
|
-
import { t as IncodeComponent } from "../incodeComponent-
|
|
8
|
-
import { t as VerificationResult } from "../verificationResult-
|
|
9
|
-
import { t as registerIncodeModuleElement } from "../incodeModule-
|
|
10
|
-
import { t as
|
|
4
|
+
import { h as cn, t as Spacer } from "../spacer-WwMLXxnI.js";
|
|
5
|
+
import { t as Page } from "../page-DeOufwmM.js";
|
|
6
|
+
import { _ as useModuleTerminalCallbacks, t as withStandaloneModuleBootstrap, y as useManager } from "../hooks-DlfCJbTr.js";
|
|
7
|
+
import { t as IncodeComponent } from "../incodeComponent-DSAIOlbW.js";
|
|
8
|
+
import { t as VerificationResult } from "../verificationResult-DmtPphWu.js";
|
|
9
|
+
import { t as registerIncodeModuleElement } from "../incodeModule-BWaY51qG.js";
|
|
10
|
+
import { t as SignatureCanvas } from "../signatureCanvas-DuTVoQGO.js";
|
|
11
11
|
import { createSignatureManager } from "@incodetech/core/signature";
|
|
12
|
-
//#region ../../node_modules/.pnpm/signature_pad@5.1.3/node_modules/signature_pad/dist/signature_pad.js
|
|
13
|
-
/*!
|
|
14
|
-
* Signature Pad v5.1.3 | https://github.com/szimek/signature_pad
|
|
15
|
-
* (c) 2025 Szymon Nowak | Released under the MIT license
|
|
16
|
-
*/
|
|
17
|
-
var Point = class {
|
|
18
|
-
constructor(x, y, pressure, time) {
|
|
19
|
-
_defineProperty(this, "x", void 0);
|
|
20
|
-
_defineProperty(this, "y", void 0);
|
|
21
|
-
_defineProperty(this, "pressure", void 0);
|
|
22
|
-
_defineProperty(this, "time", void 0);
|
|
23
|
-
if (isNaN(x) || isNaN(y)) throw new Error(`Point is invalid: (${x}, ${y})`);
|
|
24
|
-
this.x = +x;
|
|
25
|
-
this.y = +y;
|
|
26
|
-
this.pressure = pressure || 0;
|
|
27
|
-
this.time = time || Date.now();
|
|
28
|
-
}
|
|
29
|
-
distanceTo(start) {
|
|
30
|
-
return Math.sqrt(Math.pow(this.x - start.x, 2) + Math.pow(this.y - start.y, 2));
|
|
31
|
-
}
|
|
32
|
-
equals(other) {
|
|
33
|
-
return this.x === other.x && this.y === other.y && this.pressure === other.pressure && this.time === other.time;
|
|
34
|
-
}
|
|
35
|
-
velocityFrom(start) {
|
|
36
|
-
return this.time !== start.time ? this.distanceTo(start) / (this.time - start.time) : 0;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
var Bezier = class _Bezier {
|
|
40
|
-
constructor(startPoint, control2, control1, endPoint, startWidth, endWidth) {
|
|
41
|
-
this.startPoint = startPoint;
|
|
42
|
-
this.control2 = control2;
|
|
43
|
-
this.control1 = control1;
|
|
44
|
-
this.endPoint = endPoint;
|
|
45
|
-
this.startWidth = startWidth;
|
|
46
|
-
this.endWidth = endWidth;
|
|
47
|
-
}
|
|
48
|
-
static fromPoints(points, widths) {
|
|
49
|
-
const c2 = this.calculateControlPoints(points[0], points[1], points[2]).c2;
|
|
50
|
-
const c3 = this.calculateControlPoints(points[1], points[2], points[3]).c1;
|
|
51
|
-
return new _Bezier(points[1], c2, c3, points[2], widths.start, widths.end);
|
|
52
|
-
}
|
|
53
|
-
static calculateControlPoints(s1, s2, s3) {
|
|
54
|
-
const dx1 = s1.x - s2.x;
|
|
55
|
-
const dy1 = s1.y - s2.y;
|
|
56
|
-
const dx2 = s2.x - s3.x;
|
|
57
|
-
const dy2 = s2.y - s3.y;
|
|
58
|
-
const m1 = {
|
|
59
|
-
x: (s1.x + s2.x) / 2,
|
|
60
|
-
y: (s1.y + s2.y) / 2
|
|
61
|
-
};
|
|
62
|
-
const m2 = {
|
|
63
|
-
x: (s2.x + s3.x) / 2,
|
|
64
|
-
y: (s2.y + s3.y) / 2
|
|
65
|
-
};
|
|
66
|
-
const l1 = Math.sqrt(dx1 * dx1 + dy1 * dy1);
|
|
67
|
-
const l2 = Math.sqrt(dx2 * dx2 + dy2 * dy2);
|
|
68
|
-
const dxm = m1.x - m2.x;
|
|
69
|
-
const dym = m1.y - m2.y;
|
|
70
|
-
const k = l1 + l2 == 0 ? 0 : l2 / (l1 + l2);
|
|
71
|
-
const cm = {
|
|
72
|
-
x: m2.x + dxm * k,
|
|
73
|
-
y: m2.y + dym * k
|
|
74
|
-
};
|
|
75
|
-
const tx = s2.x - cm.x;
|
|
76
|
-
const ty = s2.y - cm.y;
|
|
77
|
-
return {
|
|
78
|
-
c1: new Point(m1.x + tx, m1.y + ty),
|
|
79
|
-
c2: new Point(m2.x + tx, m2.y + ty)
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
length() {
|
|
83
|
-
const steps = 10;
|
|
84
|
-
let length = 0;
|
|
85
|
-
let px;
|
|
86
|
-
let py;
|
|
87
|
-
for (let i = 0; i <= steps; i += 1) {
|
|
88
|
-
const t = i / steps;
|
|
89
|
-
const cx = this.point(t, this.startPoint.x, this.control1.x, this.control2.x, this.endPoint.x);
|
|
90
|
-
const cy = this.point(t, this.startPoint.y, this.control1.y, this.control2.y, this.endPoint.y);
|
|
91
|
-
if (i > 0) {
|
|
92
|
-
const xdiff = cx - px;
|
|
93
|
-
const ydiff = cy - py;
|
|
94
|
-
length += Math.sqrt(xdiff * xdiff + ydiff * ydiff);
|
|
95
|
-
}
|
|
96
|
-
px = cx;
|
|
97
|
-
py = cy;
|
|
98
|
-
}
|
|
99
|
-
return length;
|
|
100
|
-
}
|
|
101
|
-
point(t, start, c1, c2, end) {
|
|
102
|
-
return start * (1 - t) * (1 - t) * (1 - t) + 3 * c1 * (1 - t) * (1 - t) * t + 3 * c2 * (1 - t) * t * t + end * t * t * t;
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
var SignatureEventTarget = class {
|
|
106
|
-
constructor() {
|
|
107
|
-
_defineProperty(this, "_et", void 0);
|
|
108
|
-
try {
|
|
109
|
-
this._et = new EventTarget();
|
|
110
|
-
} catch {
|
|
111
|
-
this._et = document;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
addEventListener(type, listener, options) {
|
|
115
|
-
this._et.addEventListener(type, listener, options);
|
|
116
|
-
}
|
|
117
|
-
dispatchEvent(event) {
|
|
118
|
-
return this._et.dispatchEvent(event);
|
|
119
|
-
}
|
|
120
|
-
removeEventListener(type, callback, options) {
|
|
121
|
-
this._et.removeEventListener(type, callback, options);
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
function throttle(fn, wait = 250) {
|
|
125
|
-
let previous = 0;
|
|
126
|
-
let timeout = null;
|
|
127
|
-
let result;
|
|
128
|
-
let storedContext;
|
|
129
|
-
let storedArgs;
|
|
130
|
-
const later = () => {
|
|
131
|
-
previous = Date.now();
|
|
132
|
-
timeout = null;
|
|
133
|
-
result = fn.apply(storedContext, storedArgs);
|
|
134
|
-
if (!timeout) {
|
|
135
|
-
storedContext = null;
|
|
136
|
-
storedArgs = [];
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
return function wrapper(...args) {
|
|
140
|
-
const now = Date.now();
|
|
141
|
-
const remaining = wait - (now - previous);
|
|
142
|
-
storedContext = this;
|
|
143
|
-
storedArgs = args;
|
|
144
|
-
if (remaining <= 0 || remaining > wait) {
|
|
145
|
-
if (timeout) {
|
|
146
|
-
clearTimeout(timeout);
|
|
147
|
-
timeout = null;
|
|
148
|
-
}
|
|
149
|
-
previous = now;
|
|
150
|
-
result = fn.apply(storedContext, storedArgs);
|
|
151
|
-
if (!timeout) {
|
|
152
|
-
storedContext = null;
|
|
153
|
-
storedArgs = [];
|
|
154
|
-
}
|
|
155
|
-
} else if (!timeout) timeout = window.setTimeout(later, remaining);
|
|
156
|
-
return result;
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
var SignaturePad = class _SignaturePad extends SignatureEventTarget {
|
|
160
|
-
constructor(canvas, options = {}) {
|
|
161
|
-
super();
|
|
162
|
-
_defineProperty(this, "dotSize", void 0);
|
|
163
|
-
_defineProperty(this, "minWidth", void 0);
|
|
164
|
-
_defineProperty(this, "maxWidth", void 0);
|
|
165
|
-
_defineProperty(this, "penColor", void 0);
|
|
166
|
-
_defineProperty(this, "minDistance", void 0);
|
|
167
|
-
_defineProperty(this, "velocityFilterWeight", void 0);
|
|
168
|
-
_defineProperty(this, "compositeOperation", void 0);
|
|
169
|
-
_defineProperty(this, "backgroundColor", void 0);
|
|
170
|
-
_defineProperty(this, "throttle", void 0);
|
|
171
|
-
_defineProperty(this, "canvasContextOptions", void 0);
|
|
172
|
-
_defineProperty(this, "_ctx", void 0);
|
|
173
|
-
_defineProperty(this, "_drawingStroke", false);
|
|
174
|
-
_defineProperty(this, "_isEmpty", true);
|
|
175
|
-
_defineProperty(this, "_dataUrl", void 0);
|
|
176
|
-
_defineProperty(this, "_dataUrlOptions", void 0);
|
|
177
|
-
_defineProperty(this, "_lastPoints", []);
|
|
178
|
-
_defineProperty(this, "_data", []);
|
|
179
|
-
_defineProperty(this, "_lastVelocity", 0);
|
|
180
|
-
_defineProperty(this, "_lastWidth", 0);
|
|
181
|
-
_defineProperty(this, "_strokeMoveUpdate", void 0);
|
|
182
|
-
_defineProperty(this, "_strokePointerId", void 0);
|
|
183
|
-
this.canvas = canvas;
|
|
184
|
-
this.velocityFilterWeight = options.velocityFilterWeight || .7;
|
|
185
|
-
this.minWidth = options.minWidth || .5;
|
|
186
|
-
this.maxWidth = options.maxWidth || 2.5;
|
|
187
|
-
this.throttle = options.throttle ?? 16;
|
|
188
|
-
this.minDistance = options.minDistance ?? 5;
|
|
189
|
-
this.dotSize = options.dotSize || 0;
|
|
190
|
-
this.penColor = options.penColor || "black";
|
|
191
|
-
this.backgroundColor = options.backgroundColor || "rgba(0,0,0,0)";
|
|
192
|
-
this.compositeOperation = options.compositeOperation || "source-over";
|
|
193
|
-
this.canvasContextOptions = options.canvasContextOptions ?? {};
|
|
194
|
-
this._strokeMoveUpdate = this.throttle ? throttle(_SignaturePad.prototype._strokeUpdate, this.throttle) : _SignaturePad.prototype._strokeUpdate;
|
|
195
|
-
this._handleMouseDown = this._handleMouseDown.bind(this);
|
|
196
|
-
this._handleMouseMove = this._handleMouseMove.bind(this);
|
|
197
|
-
this._handleMouseUp = this._handleMouseUp.bind(this);
|
|
198
|
-
this._handleTouchStart = this._handleTouchStart.bind(this);
|
|
199
|
-
this._handleTouchMove = this._handleTouchMove.bind(this);
|
|
200
|
-
this._handleTouchEnd = this._handleTouchEnd.bind(this);
|
|
201
|
-
this._handlePointerDown = this._handlePointerDown.bind(this);
|
|
202
|
-
this._handlePointerMove = this._handlePointerMove.bind(this);
|
|
203
|
-
this._handlePointerUp = this._handlePointerUp.bind(this);
|
|
204
|
-
this._handlePointerCancel = this._handlePointerCancel.bind(this);
|
|
205
|
-
this._handleTouchCancel = this._handleTouchCancel.bind(this);
|
|
206
|
-
this._ctx = canvas.getContext("2d", this.canvasContextOptions);
|
|
207
|
-
this.clear();
|
|
208
|
-
this.on();
|
|
209
|
-
}
|
|
210
|
-
clear() {
|
|
211
|
-
const { _ctx: ctx, canvas } = this;
|
|
212
|
-
ctx.fillStyle = this.backgroundColor;
|
|
213
|
-
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
214
|
-
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
215
|
-
this._data = [];
|
|
216
|
-
this._reset(this._getPointGroupOptions());
|
|
217
|
-
this._isEmpty = true;
|
|
218
|
-
this._dataUrl = void 0;
|
|
219
|
-
this._dataUrlOptions = void 0;
|
|
220
|
-
this._strokePointerId = void 0;
|
|
221
|
-
}
|
|
222
|
-
redraw() {
|
|
223
|
-
const data = this._data;
|
|
224
|
-
const dataUrl = this._dataUrl;
|
|
225
|
-
const dataUrlOptions = this._dataUrlOptions;
|
|
226
|
-
this.clear();
|
|
227
|
-
if (dataUrl) this.fromDataURL(dataUrl, dataUrlOptions);
|
|
228
|
-
this.fromData(data, { clear: false });
|
|
229
|
-
}
|
|
230
|
-
fromDataURL(dataUrl, options = {}) {
|
|
231
|
-
return new Promise((resolve, reject) => {
|
|
232
|
-
const image = new Image();
|
|
233
|
-
const ratio = options.ratio || window.devicePixelRatio || 1;
|
|
234
|
-
const width = options.width || this.canvas.width / ratio;
|
|
235
|
-
const height = options.height || this.canvas.height / ratio;
|
|
236
|
-
const xOffset = options.xOffset || 0;
|
|
237
|
-
const yOffset = options.yOffset || 0;
|
|
238
|
-
this._reset(this._getPointGroupOptions());
|
|
239
|
-
image.onload = () => {
|
|
240
|
-
this._ctx.drawImage(image, xOffset, yOffset, width, height);
|
|
241
|
-
resolve();
|
|
242
|
-
};
|
|
243
|
-
image.onerror = (error) => {
|
|
244
|
-
reject(error);
|
|
245
|
-
};
|
|
246
|
-
image.crossOrigin = "anonymous";
|
|
247
|
-
image.src = dataUrl;
|
|
248
|
-
this._isEmpty = false;
|
|
249
|
-
this._dataUrl = dataUrl;
|
|
250
|
-
this._dataUrlOptions = { ...options };
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
toDataURL(type = "image/png", encoderOptions) {
|
|
254
|
-
switch (type) {
|
|
255
|
-
case "image/svg+xml":
|
|
256
|
-
if (typeof encoderOptions !== "object") encoderOptions = void 0;
|
|
257
|
-
return `data:image/svg+xml;base64,${btoa(this.toSVG(encoderOptions))}`;
|
|
258
|
-
default:
|
|
259
|
-
if (typeof encoderOptions !== "number") encoderOptions = void 0;
|
|
260
|
-
return this.canvas.toDataURL(type, encoderOptions);
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
on() {
|
|
264
|
-
this.canvas.style.touchAction = "none";
|
|
265
|
-
this.canvas.style.msTouchAction = "none";
|
|
266
|
-
this.canvas.style.userSelect = "none";
|
|
267
|
-
this.canvas.style.webkitUserSelect = "none";
|
|
268
|
-
const isIOS = /Macintosh/.test(navigator.userAgent) && "ontouchstart" in document;
|
|
269
|
-
if (window.PointerEvent && !isIOS) this._handlePointerEvents();
|
|
270
|
-
else {
|
|
271
|
-
this._handleMouseEvents();
|
|
272
|
-
if ("ontouchstart" in window) this._handleTouchEvents();
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
off() {
|
|
276
|
-
this.canvas.style.touchAction = "auto";
|
|
277
|
-
this.canvas.style.msTouchAction = "auto";
|
|
278
|
-
this.canvas.style.userSelect = "auto";
|
|
279
|
-
this.canvas.style.webkitUserSelect = "auto";
|
|
280
|
-
this.canvas.removeEventListener("pointerdown", this._handlePointerDown);
|
|
281
|
-
this.canvas.removeEventListener("mousedown", this._handleMouseDown);
|
|
282
|
-
this.canvas.removeEventListener("touchstart", this._handleTouchStart);
|
|
283
|
-
this._removeMoveUpEventListeners();
|
|
284
|
-
}
|
|
285
|
-
_getListenerFunctions() {
|
|
286
|
-
const canvasWindow = window.document === this.canvas.ownerDocument ? window : this.canvas.ownerDocument.defaultView ?? this.canvas.ownerDocument;
|
|
287
|
-
return {
|
|
288
|
-
addEventListener: canvasWindow.addEventListener.bind(canvasWindow),
|
|
289
|
-
removeEventListener: canvasWindow.removeEventListener.bind(canvasWindow)
|
|
290
|
-
};
|
|
291
|
-
}
|
|
292
|
-
_removeMoveUpEventListeners() {
|
|
293
|
-
const { removeEventListener } = this._getListenerFunctions();
|
|
294
|
-
removeEventListener("pointermove", this._handlePointerMove);
|
|
295
|
-
removeEventListener("pointerup", this._handlePointerUp);
|
|
296
|
-
removeEventListener("pointercancel", this._handlePointerCancel);
|
|
297
|
-
removeEventListener("mousemove", this._handleMouseMove);
|
|
298
|
-
removeEventListener("mouseup", this._handleMouseUp);
|
|
299
|
-
removeEventListener("touchmove", this._handleTouchMove);
|
|
300
|
-
removeEventListener("touchend", this._handleTouchEnd);
|
|
301
|
-
removeEventListener("touchcancel", this._handleTouchCancel);
|
|
302
|
-
}
|
|
303
|
-
isEmpty() {
|
|
304
|
-
return this._isEmpty;
|
|
305
|
-
}
|
|
306
|
-
fromData(pointGroups, { clear = true } = {}) {
|
|
307
|
-
if (clear) this.clear();
|
|
308
|
-
this._fromData(pointGroups, this._drawCurve.bind(this), this._drawDot.bind(this));
|
|
309
|
-
this._data = this._data.concat(pointGroups);
|
|
310
|
-
}
|
|
311
|
-
toData() {
|
|
312
|
-
return this._data;
|
|
313
|
-
}
|
|
314
|
-
_isLeftButtonPressed(event, only) {
|
|
315
|
-
if (only) return event.buttons === 1;
|
|
316
|
-
return (event.buttons & 1) === 1;
|
|
317
|
-
}
|
|
318
|
-
_pointerEventToSignatureEvent(event) {
|
|
319
|
-
return {
|
|
320
|
-
event,
|
|
321
|
-
type: event.type,
|
|
322
|
-
x: event.clientX,
|
|
323
|
-
y: event.clientY,
|
|
324
|
-
pressure: "pressure" in event ? event.pressure : 0
|
|
325
|
-
};
|
|
326
|
-
}
|
|
327
|
-
_touchEventToSignatureEvent(event) {
|
|
328
|
-
const touch = event.changedTouches[0];
|
|
329
|
-
return {
|
|
330
|
-
event,
|
|
331
|
-
type: event.type,
|
|
332
|
-
x: touch.clientX,
|
|
333
|
-
y: touch.clientY,
|
|
334
|
-
pressure: touch.force
|
|
335
|
-
};
|
|
336
|
-
}
|
|
337
|
-
_handleMouseDown(event) {
|
|
338
|
-
if (!this._isLeftButtonPressed(event, true) || this._drawingStroke) return;
|
|
339
|
-
this._strokeBegin(this._pointerEventToSignatureEvent(event));
|
|
340
|
-
}
|
|
341
|
-
_handleMouseMove(event) {
|
|
342
|
-
if (!this._isLeftButtonPressed(event, true) || !this._drawingStroke) {
|
|
343
|
-
this._strokeEnd(this._pointerEventToSignatureEvent(event), false);
|
|
344
|
-
return;
|
|
345
|
-
}
|
|
346
|
-
this._strokeMoveUpdate(this._pointerEventToSignatureEvent(event));
|
|
347
|
-
}
|
|
348
|
-
_handleMouseUp(event) {
|
|
349
|
-
if (this._isLeftButtonPressed(event)) return;
|
|
350
|
-
this._strokeEnd(this._pointerEventToSignatureEvent(event));
|
|
351
|
-
}
|
|
352
|
-
_handleTouchStart(event) {
|
|
353
|
-
if (event.targetTouches.length !== 1 || this._drawingStroke) return;
|
|
354
|
-
if (event.cancelable) event.preventDefault();
|
|
355
|
-
this._strokeBegin(this._touchEventToSignatureEvent(event));
|
|
356
|
-
}
|
|
357
|
-
_handleTouchMove(event) {
|
|
358
|
-
if (event.targetTouches.length !== 1) return;
|
|
359
|
-
if (event.cancelable) event.preventDefault();
|
|
360
|
-
if (!this._drawingStroke) {
|
|
361
|
-
this._strokeEnd(this._touchEventToSignatureEvent(event), false);
|
|
362
|
-
return;
|
|
363
|
-
}
|
|
364
|
-
this._strokeMoveUpdate(this._touchEventToSignatureEvent(event));
|
|
365
|
-
}
|
|
366
|
-
_handleTouchEnd(event) {
|
|
367
|
-
if (event.targetTouches.length !== 0) return;
|
|
368
|
-
if (event.cancelable) event.preventDefault();
|
|
369
|
-
this._strokeEnd(this._touchEventToSignatureEvent(event));
|
|
370
|
-
}
|
|
371
|
-
_handlePointerCancel(event) {
|
|
372
|
-
if (!this._allowPointerId(event)) return;
|
|
373
|
-
event.preventDefault();
|
|
374
|
-
this._strokeEnd(this._pointerEventToSignatureEvent(event), false);
|
|
375
|
-
}
|
|
376
|
-
_handleTouchCancel(event) {
|
|
377
|
-
if (event.cancelable) event.preventDefault();
|
|
378
|
-
this._strokeEnd(this._touchEventToSignatureEvent(event), false);
|
|
379
|
-
}
|
|
380
|
-
_getPointerId(event) {
|
|
381
|
-
return event.persistentDeviceId || event.pointerId;
|
|
382
|
-
}
|
|
383
|
-
_allowPointerId(event, allowUndefined = false) {
|
|
384
|
-
if (typeof this._strokePointerId === "undefined") return allowUndefined;
|
|
385
|
-
return this._getPointerId(event) === this._strokePointerId;
|
|
386
|
-
}
|
|
387
|
-
_handlePointerDown(event) {
|
|
388
|
-
if (this._drawingStroke || !this._isLeftButtonPressed(event) || !this._allowPointerId(event, true)) return;
|
|
389
|
-
this._strokePointerId = this._getPointerId(event);
|
|
390
|
-
event.preventDefault();
|
|
391
|
-
this._strokeBegin(this._pointerEventToSignatureEvent(event));
|
|
392
|
-
}
|
|
393
|
-
_handlePointerMove(event) {
|
|
394
|
-
if (!this._allowPointerId(event)) return;
|
|
395
|
-
if (!this._isLeftButtonPressed(event, true) || !this._drawingStroke) {
|
|
396
|
-
this._strokeEnd(this._pointerEventToSignatureEvent(event), false);
|
|
397
|
-
return;
|
|
398
|
-
}
|
|
399
|
-
event.preventDefault();
|
|
400
|
-
this._strokeMoveUpdate(this._pointerEventToSignatureEvent(event));
|
|
401
|
-
}
|
|
402
|
-
_handlePointerUp(event) {
|
|
403
|
-
if (this._isLeftButtonPressed(event) || !this._allowPointerId(event)) return;
|
|
404
|
-
event.preventDefault();
|
|
405
|
-
this._strokeEnd(this._pointerEventToSignatureEvent(event));
|
|
406
|
-
}
|
|
407
|
-
_getPointGroupOptions(group) {
|
|
408
|
-
return {
|
|
409
|
-
penColor: group && "penColor" in group ? group.penColor : this.penColor,
|
|
410
|
-
dotSize: group && "dotSize" in group ? group.dotSize : this.dotSize,
|
|
411
|
-
minWidth: group && "minWidth" in group ? group.minWidth : this.minWidth,
|
|
412
|
-
maxWidth: group && "maxWidth" in group ? group.maxWidth : this.maxWidth,
|
|
413
|
-
velocityFilterWeight: group && "velocityFilterWeight" in group ? group.velocityFilterWeight : this.velocityFilterWeight,
|
|
414
|
-
compositeOperation: group && "compositeOperation" in group ? group.compositeOperation : this.compositeOperation
|
|
415
|
-
};
|
|
416
|
-
}
|
|
417
|
-
_strokeBegin(event) {
|
|
418
|
-
if (!this.dispatchEvent(new CustomEvent("beginStroke", {
|
|
419
|
-
detail: event,
|
|
420
|
-
cancelable: true
|
|
421
|
-
}))) return;
|
|
422
|
-
const { addEventListener } = this._getListenerFunctions();
|
|
423
|
-
switch (event.event.type) {
|
|
424
|
-
case "mousedown":
|
|
425
|
-
addEventListener("mousemove", this._handleMouseMove, { passive: false });
|
|
426
|
-
addEventListener("mouseup", this._handleMouseUp, { passive: false });
|
|
427
|
-
break;
|
|
428
|
-
case "touchstart":
|
|
429
|
-
addEventListener("touchmove", this._handleTouchMove, { passive: false });
|
|
430
|
-
addEventListener("touchend", this._handleTouchEnd, { passive: false });
|
|
431
|
-
addEventListener("touchcancel", this._handleTouchCancel, { passive: false });
|
|
432
|
-
break;
|
|
433
|
-
case "pointerdown":
|
|
434
|
-
addEventListener("pointermove", this._handlePointerMove, { passive: false });
|
|
435
|
-
addEventListener("pointerup", this._handlePointerUp, { passive: false });
|
|
436
|
-
addEventListener("pointercancel", this._handlePointerCancel, { passive: false });
|
|
437
|
-
break;
|
|
438
|
-
default:
|
|
439
|
-
}
|
|
440
|
-
this._drawingStroke = true;
|
|
441
|
-
const pointGroupOptions = this._getPointGroupOptions();
|
|
442
|
-
const newPointGroup = {
|
|
443
|
-
...pointGroupOptions,
|
|
444
|
-
points: []
|
|
445
|
-
};
|
|
446
|
-
this._data.push(newPointGroup);
|
|
447
|
-
this._reset(pointGroupOptions);
|
|
448
|
-
this._strokeUpdate(event);
|
|
449
|
-
}
|
|
450
|
-
_strokeUpdate(event) {
|
|
451
|
-
if (!this._drawingStroke) return;
|
|
452
|
-
if (this._data.length === 0) {
|
|
453
|
-
this._strokeBegin(event);
|
|
454
|
-
return;
|
|
455
|
-
}
|
|
456
|
-
this.dispatchEvent(new CustomEvent("beforeUpdateStroke", { detail: event }));
|
|
457
|
-
const point = this._createPoint(event.x, event.y, event.pressure);
|
|
458
|
-
const lastPointGroup = this._data[this._data.length - 1];
|
|
459
|
-
const lastPoints = lastPointGroup.points;
|
|
460
|
-
const lastPoint = lastPoints.length > 0 && lastPoints[lastPoints.length - 1];
|
|
461
|
-
const isLastPointTooClose = lastPoint ? point.distanceTo(lastPoint) <= this.minDistance : false;
|
|
462
|
-
const pointGroupOptions = this._getPointGroupOptions(lastPointGroup);
|
|
463
|
-
if (!lastPoint || !(lastPoint && isLastPointTooClose)) {
|
|
464
|
-
const curve = this._addPoint(point, pointGroupOptions);
|
|
465
|
-
if (!lastPoint) this._drawDot(point, pointGroupOptions);
|
|
466
|
-
else if (curve) this._drawCurve(curve, pointGroupOptions);
|
|
467
|
-
lastPoints.push({
|
|
468
|
-
time: point.time,
|
|
469
|
-
x: point.x,
|
|
470
|
-
y: point.y,
|
|
471
|
-
pressure: point.pressure
|
|
472
|
-
});
|
|
473
|
-
}
|
|
474
|
-
this.dispatchEvent(new CustomEvent("afterUpdateStroke", { detail: event }));
|
|
475
|
-
}
|
|
476
|
-
_strokeEnd(event, shouldUpdate = true) {
|
|
477
|
-
this._removeMoveUpEventListeners();
|
|
478
|
-
if (!this._drawingStroke) return;
|
|
479
|
-
if (shouldUpdate) this._strokeUpdate(event);
|
|
480
|
-
this._drawingStroke = false;
|
|
481
|
-
this._strokePointerId = void 0;
|
|
482
|
-
this.dispatchEvent(new CustomEvent("endStroke", { detail: event }));
|
|
483
|
-
}
|
|
484
|
-
_handlePointerEvents() {
|
|
485
|
-
this._drawingStroke = false;
|
|
486
|
-
this.canvas.addEventListener("pointerdown", this._handlePointerDown, { passive: false });
|
|
487
|
-
}
|
|
488
|
-
_handleMouseEvents() {
|
|
489
|
-
this._drawingStroke = false;
|
|
490
|
-
this.canvas.addEventListener("mousedown", this._handleMouseDown, { passive: false });
|
|
491
|
-
}
|
|
492
|
-
_handleTouchEvents() {
|
|
493
|
-
this.canvas.addEventListener("touchstart", this._handleTouchStart, { passive: false });
|
|
494
|
-
}
|
|
495
|
-
_reset(options) {
|
|
496
|
-
this._lastPoints = [];
|
|
497
|
-
this._lastVelocity = 0;
|
|
498
|
-
this._lastWidth = (options.minWidth + options.maxWidth) / 2;
|
|
499
|
-
this._ctx.fillStyle = options.penColor;
|
|
500
|
-
this._ctx.globalCompositeOperation = options.compositeOperation;
|
|
501
|
-
}
|
|
502
|
-
_createPoint(x, y, pressure) {
|
|
503
|
-
const rect = this.canvas.getBoundingClientRect();
|
|
504
|
-
return new Point(x - rect.left, y - rect.top, pressure, (/* @__PURE__ */ new Date()).getTime());
|
|
505
|
-
}
|
|
506
|
-
_addPoint(point, options) {
|
|
507
|
-
const { _lastPoints } = this;
|
|
508
|
-
_lastPoints.push(point);
|
|
509
|
-
if (_lastPoints.length > 2) {
|
|
510
|
-
if (_lastPoints.length === 3) _lastPoints.unshift(_lastPoints[0]);
|
|
511
|
-
const widths = this._calculateCurveWidths(_lastPoints[1], _lastPoints[2], options);
|
|
512
|
-
const curve = Bezier.fromPoints(_lastPoints, widths);
|
|
513
|
-
_lastPoints.shift();
|
|
514
|
-
return curve;
|
|
515
|
-
}
|
|
516
|
-
return null;
|
|
517
|
-
}
|
|
518
|
-
_calculateCurveWidths(startPoint, endPoint, options) {
|
|
519
|
-
const velocity = options.velocityFilterWeight * endPoint.velocityFrom(startPoint) + (1 - options.velocityFilterWeight) * this._lastVelocity;
|
|
520
|
-
const newWidth = this._strokeWidth(velocity, options);
|
|
521
|
-
const widths = {
|
|
522
|
-
end: newWidth,
|
|
523
|
-
start: this._lastWidth
|
|
524
|
-
};
|
|
525
|
-
this._lastVelocity = velocity;
|
|
526
|
-
this._lastWidth = newWidth;
|
|
527
|
-
return widths;
|
|
528
|
-
}
|
|
529
|
-
_strokeWidth(velocity, options) {
|
|
530
|
-
return Math.max(options.maxWidth / (velocity + 1), options.minWidth);
|
|
531
|
-
}
|
|
532
|
-
_drawCurveSegment(x, y, width) {
|
|
533
|
-
const ctx = this._ctx;
|
|
534
|
-
ctx.moveTo(x, y);
|
|
535
|
-
ctx.arc(x, y, width, 0, 2 * Math.PI, false);
|
|
536
|
-
this._isEmpty = false;
|
|
537
|
-
}
|
|
538
|
-
_drawCurve(curve, options) {
|
|
539
|
-
const ctx = this._ctx;
|
|
540
|
-
const widthDelta = curve.endWidth - curve.startWidth;
|
|
541
|
-
const drawSteps = Math.ceil(curve.length()) * 2;
|
|
542
|
-
ctx.beginPath();
|
|
543
|
-
ctx.fillStyle = options.penColor;
|
|
544
|
-
for (let i = 0; i < drawSteps; i += 1) {
|
|
545
|
-
const t = i / drawSteps;
|
|
546
|
-
const tt = t * t;
|
|
547
|
-
const ttt = tt * t;
|
|
548
|
-
const u = 1 - t;
|
|
549
|
-
const uu = u * u;
|
|
550
|
-
const uuu = uu * u;
|
|
551
|
-
let x = uuu * curve.startPoint.x;
|
|
552
|
-
x += 3 * uu * t * curve.control1.x;
|
|
553
|
-
x += 3 * u * tt * curve.control2.x;
|
|
554
|
-
x += ttt * curve.endPoint.x;
|
|
555
|
-
let y = uuu * curve.startPoint.y;
|
|
556
|
-
y += 3 * uu * t * curve.control1.y;
|
|
557
|
-
y += 3 * u * tt * curve.control2.y;
|
|
558
|
-
y += ttt * curve.endPoint.y;
|
|
559
|
-
const width = Math.min(curve.startWidth + ttt * widthDelta, options.maxWidth);
|
|
560
|
-
this._drawCurveSegment(x, y, width);
|
|
561
|
-
}
|
|
562
|
-
ctx.closePath();
|
|
563
|
-
ctx.fill();
|
|
564
|
-
}
|
|
565
|
-
_drawDot(point, options) {
|
|
566
|
-
const ctx = this._ctx;
|
|
567
|
-
const width = options.dotSize > 0 ? options.dotSize : (options.minWidth + options.maxWidth) / 2;
|
|
568
|
-
ctx.beginPath();
|
|
569
|
-
this._drawCurveSegment(point.x, point.y, width);
|
|
570
|
-
ctx.closePath();
|
|
571
|
-
ctx.fillStyle = options.penColor;
|
|
572
|
-
ctx.fill();
|
|
573
|
-
}
|
|
574
|
-
_fromData(pointGroups, drawCurve, drawDot) {
|
|
575
|
-
for (const group of pointGroups) {
|
|
576
|
-
const { points } = group;
|
|
577
|
-
const pointGroupOptions = this._getPointGroupOptions(group);
|
|
578
|
-
if (points.length > 1) for (let j = 0; j < points.length; j += 1) {
|
|
579
|
-
const basicPoint = points[j];
|
|
580
|
-
const point = new Point(basicPoint.x, basicPoint.y, basicPoint.pressure, basicPoint.time);
|
|
581
|
-
if (j === 0) this._reset(pointGroupOptions);
|
|
582
|
-
const curve = this._addPoint(point, pointGroupOptions);
|
|
583
|
-
if (curve) drawCurve(curve, pointGroupOptions);
|
|
584
|
-
}
|
|
585
|
-
else {
|
|
586
|
-
this._reset(pointGroupOptions);
|
|
587
|
-
drawDot(points[0], pointGroupOptions);
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
toSVG({ includeBackgroundColor = false, includeDataUrl = false } = {}) {
|
|
592
|
-
const pointGroups = this._data;
|
|
593
|
-
const ratio = Math.max(window.devicePixelRatio || 1, 1);
|
|
594
|
-
const minX = 0;
|
|
595
|
-
const minY = 0;
|
|
596
|
-
const maxX = this.canvas.width / ratio;
|
|
597
|
-
const maxY = this.canvas.height / ratio;
|
|
598
|
-
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
599
|
-
svg.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
600
|
-
svg.setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink");
|
|
601
|
-
svg.setAttribute("viewBox", `${minX} ${minY} ${maxX} ${maxY}`);
|
|
602
|
-
svg.setAttribute("width", maxX.toString());
|
|
603
|
-
svg.setAttribute("height", maxY.toString());
|
|
604
|
-
if (includeBackgroundColor && this.backgroundColor) {
|
|
605
|
-
const rect = document.createElement("rect");
|
|
606
|
-
rect.setAttribute("width", "100%");
|
|
607
|
-
rect.setAttribute("height", "100%");
|
|
608
|
-
rect.setAttribute("fill", this.backgroundColor);
|
|
609
|
-
svg.appendChild(rect);
|
|
610
|
-
}
|
|
611
|
-
if (includeDataUrl && this._dataUrl) {
|
|
612
|
-
const ratio2 = this._dataUrlOptions?.ratio || window.devicePixelRatio || 1;
|
|
613
|
-
const width = this._dataUrlOptions?.width || this.canvas.width / ratio2;
|
|
614
|
-
const height = this._dataUrlOptions?.height || this.canvas.height / ratio2;
|
|
615
|
-
const xOffset = this._dataUrlOptions?.xOffset || 0;
|
|
616
|
-
const yOffset = this._dataUrlOptions?.yOffset || 0;
|
|
617
|
-
const image = document.createElement("image");
|
|
618
|
-
image.setAttribute("x", xOffset.toString());
|
|
619
|
-
image.setAttribute("y", yOffset.toString());
|
|
620
|
-
image.setAttribute("width", width.toString());
|
|
621
|
-
image.setAttribute("height", height.toString());
|
|
622
|
-
image.setAttribute("preserveAspectRatio", "none");
|
|
623
|
-
image.setAttribute("href", this._dataUrl);
|
|
624
|
-
svg.appendChild(image);
|
|
625
|
-
}
|
|
626
|
-
this._fromData(pointGroups, (curve, { penColor }) => {
|
|
627
|
-
const path = document.createElement("path");
|
|
628
|
-
if (!isNaN(curve.control1.x) && !isNaN(curve.control1.y) && !isNaN(curve.control2.x) && !isNaN(curve.control2.y)) {
|
|
629
|
-
const attr = `M ${curve.startPoint.x.toFixed(3)},${curve.startPoint.y.toFixed(3)} C ${curve.control1.x.toFixed(3)},${curve.control1.y.toFixed(3)} ${curve.control2.x.toFixed(3)},${curve.control2.y.toFixed(3)} ${curve.endPoint.x.toFixed(3)},${curve.endPoint.y.toFixed(3)}`;
|
|
630
|
-
path.setAttribute("d", attr);
|
|
631
|
-
path.setAttribute("stroke-width", (curve.endWidth * 2.25).toFixed(3));
|
|
632
|
-
path.setAttribute("stroke", penColor);
|
|
633
|
-
path.setAttribute("fill", "none");
|
|
634
|
-
path.setAttribute("stroke-linecap", "round");
|
|
635
|
-
svg.appendChild(path);
|
|
636
|
-
}
|
|
637
|
-
}, (point, { penColor, dotSize, minWidth, maxWidth }) => {
|
|
638
|
-
const circle = document.createElement("circle");
|
|
639
|
-
const size = dotSize > 0 ? dotSize : (minWidth + maxWidth) / 2;
|
|
640
|
-
circle.setAttribute("r", size.toString());
|
|
641
|
-
circle.setAttribute("cx", point.x.toString());
|
|
642
|
-
circle.setAttribute("cy", point.y.toString());
|
|
643
|
-
circle.setAttribute("fill", penColor);
|
|
644
|
-
svg.appendChild(circle);
|
|
645
|
-
});
|
|
646
|
-
return svg.outerHTML;
|
|
647
|
-
}
|
|
648
|
-
};
|
|
649
|
-
//#endregion
|
|
650
|
-
//#region src/styles/resolveCssVariableToHex.ts
|
|
651
|
-
var resolveCssVariableToHex = (cssVar) => {
|
|
652
|
-
if (typeof document === "undefined") return null;
|
|
653
|
-
const tempEl = document.createElement("div");
|
|
654
|
-
tempEl.style.color = cssVar;
|
|
655
|
-
tempEl.style.position = "absolute";
|
|
656
|
-
tempEl.style.visibility = "hidden";
|
|
657
|
-
document.body.appendChild(tempEl);
|
|
658
|
-
const computedColor = getComputedStyle(tempEl).color;
|
|
659
|
-
document.body.removeChild(tempEl);
|
|
660
|
-
if (!computedColor || computedColor === "transparent") return null;
|
|
661
|
-
const rgbMatch = computedColor.match(/\d+/g);
|
|
662
|
-
if (rgbMatch && rgbMatch.length >= 3) {
|
|
663
|
-
const r = Number.parseInt(rgbMatch[0], 10);
|
|
664
|
-
const g = Number.parseInt(rgbMatch[1], 10);
|
|
665
|
-
const b = Number.parseInt(rgbMatch[2], 10);
|
|
666
|
-
const toHex = (n) => {
|
|
667
|
-
const hex = n.toString(16);
|
|
668
|
-
return hex.length === 1 ? `0${hex}` : hex;
|
|
669
|
-
};
|
|
670
|
-
return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
|
|
671
|
-
}
|
|
672
|
-
return null;
|
|
673
|
-
};
|
|
674
|
-
//#endregion
|
|
675
|
-
//#region src/modules/signature/signatureCanvas.tsx
|
|
676
|
-
var SIGNATURE_PEN_COLOR = "var(--icon-neutral-800)";
|
|
677
|
-
/** Fixed white background for export (avoid transparency and theme dependency) */
|
|
678
|
-
var EXPORT_BACKGROUND_COLOR = "#ffffff";
|
|
679
|
-
var copyCanvasWithWhiteBackground = (source) => {
|
|
680
|
-
const target = document.createElement("canvas");
|
|
681
|
-
target.width = source.width;
|
|
682
|
-
target.height = source.height;
|
|
683
|
-
const ctx = target.getContext("2d");
|
|
684
|
-
if (!ctx) throw new Error("Canvas 2D context is not available");
|
|
685
|
-
ctx.fillStyle = EXPORT_BACKGROUND_COLOR;
|
|
686
|
-
ctx.fillRect(0, 0, target.width, target.height);
|
|
687
|
-
ctx.drawImage(source, 0, 0);
|
|
688
|
-
return target;
|
|
689
|
-
};
|
|
690
|
-
var canvasToBlob = (canvas, mimeType, quality) => {
|
|
691
|
-
return new Promise((resolve, reject) => {
|
|
692
|
-
canvas.toBlob((blob) => {
|
|
693
|
-
if (blob) resolve(blob);
|
|
694
|
-
else reject(/* @__PURE__ */ new Error("Canvas toBlob() returned null"));
|
|
695
|
-
}, mimeType, mimeType === "image/jpeg" || mimeType === "image/webp" ? quality : void 0);
|
|
696
|
-
});
|
|
697
|
-
};
|
|
698
|
-
var SignatureCanvas = D(({ onBeginStroke, hasDrawing, placeholder, ariaLabel, customPenColor, customPenStrokeWidth, customBackgroundColor, customBorderColor }, ref) => {
|
|
699
|
-
const containerRef = A(null);
|
|
700
|
-
const canvasRef = A(null);
|
|
701
|
-
const signaturePadRef = A(null);
|
|
702
|
-
const onBeginStrokeRef = A(onBeginStroke);
|
|
703
|
-
onBeginStrokeRef.current = onBeginStroke;
|
|
704
|
-
const resizeSignaturePad = q(() => {
|
|
705
|
-
const container = containerRef.current;
|
|
706
|
-
const canvas = canvasRef.current;
|
|
707
|
-
const pad = signaturePadRef.current;
|
|
708
|
-
if (!container || !canvas || !pad) return;
|
|
709
|
-
const ratio = Math.max(window.devicePixelRatio || 1, 1);
|
|
710
|
-
const context = canvas.getContext("2d");
|
|
711
|
-
const { width, height } = container.getBoundingClientRect();
|
|
712
|
-
if (width === 0 || height === 0 || !context) return;
|
|
713
|
-
const data = pad.isEmpty() ? null : pad.toData();
|
|
714
|
-
canvas.width = Math.floor(width * ratio);
|
|
715
|
-
canvas.height = Math.floor(height * ratio);
|
|
716
|
-
context.setTransform(ratio, 0, 0, ratio, 0, 0);
|
|
717
|
-
if (data) pad.fromData(data, { clear: true });
|
|
718
|
-
else pad.clear();
|
|
719
|
-
}, []);
|
|
720
|
-
F(ref, () => ({
|
|
721
|
-
clear: () => {
|
|
722
|
-
signaturePadRef.current?.clear();
|
|
723
|
-
},
|
|
724
|
-
isEmpty: () => signaturePadRef.current?.isEmpty() ?? true,
|
|
725
|
-
toDataURL: (type = "image/png", encoderOptions) => signaturePadRef.current?.toDataURL(type, encoderOptions) ?? "",
|
|
726
|
-
getCanvas: () => canvasRef.current,
|
|
727
|
-
getSignaturePad: () => signaturePadRef.current,
|
|
728
|
-
on: () => signaturePadRef.current?.on(),
|
|
729
|
-
off: () => signaturePadRef.current?.off(),
|
|
730
|
-
getSignatureWithWhiteBackground: () => {
|
|
731
|
-
const canvas = canvasRef.current;
|
|
732
|
-
if (!canvas) return null;
|
|
733
|
-
return copyCanvasWithWhiteBackground(canvas);
|
|
734
|
-
},
|
|
735
|
-
getBlob: (canvas = canvasRef.current ?? void 0, mimeType = "image/jpeg", quality = .92) => {
|
|
736
|
-
if (!canvas) return Promise.reject(/* @__PURE__ */ new Error("No canvas available for getBlob"));
|
|
737
|
-
return canvasToBlob(canvas, mimeType, quality);
|
|
738
|
-
}
|
|
739
|
-
}), []);
|
|
740
|
-
y(() => {
|
|
741
|
-
const container = containerRef.current;
|
|
742
|
-
const canvas = canvasRef.current;
|
|
743
|
-
if (!container || !canvas) return;
|
|
744
|
-
let resizeRafId = null;
|
|
745
|
-
const scheduleResizeSignaturePad = () => {
|
|
746
|
-
if (resizeRafId !== null) return;
|
|
747
|
-
resizeRafId = requestAnimationFrame(() => {
|
|
748
|
-
resizeRafId = null;
|
|
749
|
-
resizeSignaturePad();
|
|
750
|
-
});
|
|
751
|
-
};
|
|
752
|
-
const penColor = customPenColor ?? resolveCssVariableToHex(SIGNATURE_PEN_COLOR);
|
|
753
|
-
const signaturePad = new SignaturePad(canvas, {
|
|
754
|
-
...penColor ? { penColor } : {},
|
|
755
|
-
...customPenStrokeWidth ? { maxWidth: customPenStrokeWidth } : {}
|
|
756
|
-
});
|
|
757
|
-
signaturePadRef.current = signaturePad;
|
|
758
|
-
const onBegin = () => onBeginStrokeRef.current?.();
|
|
759
|
-
signaturePad.addEventListener("beginStroke", onBegin);
|
|
760
|
-
resizeSignaturePad();
|
|
761
|
-
const resizeObserver = new ResizeObserver(() => {
|
|
762
|
-
scheduleResizeSignaturePad();
|
|
763
|
-
});
|
|
764
|
-
resizeObserver.observe(container);
|
|
765
|
-
return () => {
|
|
766
|
-
if (resizeRafId !== null) cancelAnimationFrame(resizeRafId);
|
|
767
|
-
resizeObserver.disconnect();
|
|
768
|
-
signaturePad.removeEventListener("beginStroke", onBegin);
|
|
769
|
-
signaturePad.off();
|
|
770
|
-
signaturePadRef.current = null;
|
|
771
|
-
};
|
|
772
|
-
}, [
|
|
773
|
-
resizeSignaturePad,
|
|
774
|
-
customPenColor,
|
|
775
|
-
customPenStrokeWidth
|
|
776
|
-
]);
|
|
777
|
-
return /* @__PURE__ */ u("div", {
|
|
778
|
-
class: "IncodeSignatureCanvasContainer",
|
|
779
|
-
style: customBackgroundColor || customBorderColor ? {
|
|
780
|
-
...customBackgroundColor ? { backgroundColor: customBackgroundColor } : {},
|
|
781
|
-
...customBorderColor ? { borderColor: customBorderColor } : {}
|
|
782
|
-
} : void 0,
|
|
783
|
-
ref: containerRef,
|
|
784
|
-
children: [/* @__PURE__ */ u("canvas", {
|
|
785
|
-
class: "IncodeSignatureCanvas",
|
|
786
|
-
ref: canvasRef,
|
|
787
|
-
role: "img",
|
|
788
|
-
"aria-label": ariaLabel ?? placeholder,
|
|
789
|
-
"data-testid": "signature-canvas"
|
|
790
|
-
}), !hasDrawing && /* @__PURE__ */ u("p", {
|
|
791
|
-
class: "IncodeSignatureCanvasPlaceholder",
|
|
792
|
-
"aria-hidden": "true",
|
|
793
|
-
children: placeholder
|
|
794
|
-
})]
|
|
795
|
-
});
|
|
796
|
-
});
|
|
797
|
-
SignatureCanvas.displayName = "SignatureCanvas";
|
|
798
|
-
//#endregion
|
|
799
12
|
//#region src/modules/signature/signature.tsx
|
|
800
13
|
var SignatureContent = ({ config, manager: externalManager, onFinish, onError }) => {
|
|
801
14
|
const { t } = useTranslation();
|