@incodetech/web 2.2.0 → 2.3.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.
- package/THIRD_PARTY_NOTICES.txt +398 -0
- package/dist/ae-signature/ae-signature.es.js +4 -4
- package/dist/af-ZA-CiGNWICE.js +3043 -0
- package/dist/am-C5YehVGG.js +3043 -0
- package/dist/antifraud/antifraud.es.js +4 -4
- package/dist/ar-AE-BMJuIKTB.js +3059 -0
- package/dist/ar-CUw7KMHb.js +3059 -0
- package/dist/ar-EG-ojf2Ene5.js +3059 -0
- package/dist/assets/dm-sans-latin-400-normal.woff2 +0 -0
- package/dist/assets/dm-sans-latin-500-normal.woff2 +0 -0
- package/dist/assets/dm-sans-latin-600-normal.woff2 +0 -0
- package/dist/assets/dm-sans-latin-700-normal.woff2 +0 -0
- package/dist/assets/rethink-sans-latin-800-normal.woff2 +0 -0
- package/dist/authentication/authentication.es.js +15 -11
- package/dist/{autoFocusTitle-DB-23sv_.js → autoFocusTitle-CVjuQOGZ.js} +2 -2
- package/dist/az-DsqjgKhY.js +3043 -0
- package/dist/{back-horizontal-hint-CjdigFZj.js → back-horizontal-hint-UQ7Nof6k.js} +1 -1
- package/dist/{back-vertical-hint-OhaKsINF.js → back-vertical-hint-Crc8ybfk.js} +1 -1
- package/dist/base.css +917 -283
- package/dist/baseTutorial-BM2Ho3QZ.js +172 -0
- package/dist/bn-Bbn6O_i2.js +3043 -0
- package/dist/bottomSheet-Cixb81_b.js +101 -0
- package/dist/bs-CYW5eATI.js +3047 -0
- package/dist/ca-D5u2Z71o.js +3043 -0
- package/dist/cameraOverlay-MpL3OBQu.js +2 -0
- package/dist/cameraOverlayHeader-BarDrIC9.js +43 -0
- package/dist/cameraView-BNqv7JUh.js +49 -0
- package/dist/captureFooter-De74TCQi.js +67 -0
- package/dist/ceb-tXsl4nyX.js +3043 -0
- package/dist/certificate-issuance/certificate-issuance.es.js +19 -14
- package/dist/certificate-issuance/styles.css.js +1 -0
- package/dist/{checkbox-FGA-Ij-D.js → checkbox-BR-RTI4R.js} +9 -8
- package/dist/{connectionError-BurQq_4R.js → connectionError-Haw33Di8.js} +4 -4
- package/dist/consent/consent.es.js +26 -33
- package/dist/consent/styles.css +4 -4
- package/dist/consent/styles.css.js +1 -0
- package/dist/countries-5e8kwG_m.js +8560 -0
- package/dist/{countrySelector-COZ7XQHp.js → countrySelector-Zbe2eGzy.js} +8 -10
- package/dist/cross-document-data-match/cross-document-data-match.es.js +4 -4
- package/dist/cs-CZ-BUx_DNTa.js +3051 -0
- package/dist/cs-D_6Vg3XS.js +3051 -0
- package/dist/curp-validation/curp-validation.es.js +15 -22
- package/dist/curp-validation/styles.css.js +1 -0
- package/dist/custom-fields/styles.css.js +1 -0
- package/dist/{customFields-rVMTo1Yu.js → customFields-CEFWn2wC.js} +44 -19
- package/dist/{customWatchlist-DgpXtVRf.js → customWatchlist-Xn3d-zbf.js} +14 -11
- package/dist/da-DK-CsmjiCBo.js +3043 -0
- package/dist/{dashboardTheme-BUDq5UYs.js → dashboardTheme-B_YjGFDU.js} +31 -7
- package/dist/dateInputComposed-0tUVTT0_.js +1 -0
- package/dist/{dateInputComposed-DSgV0wnb.js → dateInputComposed-ByhgHDX8.js} +5 -5
- package/dist/de-BsJlhx6J.js +3043 -0
- package/dist/{manualCaptureButton-D58WsS-x.js → denied-CB1v3PyY.js} +270 -233
- package/dist/document-capture/document-capture.es.js +1 -1
- package/dist/document-capture/styles.css +4 -4
- package/dist/document-capture/styles.css.js +1 -0
- package/dist/{documentCapture-sZj09g0I.js → documentCapture-Cj8G5Wgb.js} +16 -17
- package/dist/documentCapture-D0o4Xh1J.js +2 -0
- package/dist/dropdownComposed-BsEtJjhn.js +1 -0
- package/dist/{dropdownComposed-CEegNzG4.js → dropdownComposed-DptsxuHA.js} +9 -9
- package/dist/{dynamicForms-t3vepXqJ.js → dynamic-forms/dynamic-forms.es.js} +24 -19
- package/dist/dynamic-forms/styles.css +5 -0
- package/dist/dynamic-forms/styles.css.js +1 -0
- package/dist/ekyb/ekyb.es.js +1 -1
- package/dist/ekyb/styles.css +15 -13
- package/dist/ekyb/styles.css.js +1 -0
- package/dist/ekybModule-B-gioC08.js +2 -0
- package/dist/{ekybModule-Dvkf5WAr.js → ekybModule-DqA0hfNQ.js} +17 -30
- package/dist/ekyc/ekyc.es.js +1 -1
- package/dist/ekyc/styles.css +17 -16
- package/dist/ekyc/styles.css.js +1 -0
- package/dist/ekycModule-CjkpPQ3f.js +2 -0
- package/dist/{ekycModule-C5QXVGP7.js → ekycModule-bRC6FW2H.js} +14 -29
- package/dist/el-Dq-L-4X5.js +3043 -0
- package/dist/el-GR-c9roJIs_.js +3043 -0
- package/dist/electronic-signature/electronic-signature.es.js +1 -1
- package/dist/electronic-signature/styles.css +62 -2
- package/dist/electronic-signature/styles.css.js +1 -0
- package/dist/{electronic-signature-CyE8F7LZ.js → electronic-signature-DRMdCzdF.js} +65 -18
- package/dist/email/email.es.js +9 -8
- package/dist/email/styles.css.js +1 -0
- package/dist/{emailInput-CsT8_C01.js → emailInput-Dz8ukhAE.js} +4 -4
- package/dist/en-CmZT05w8.js +3043 -0
- package/dist/en-DG-BQHfwiXE.js +3043 -0
- package/dist/errorContent-aJuo21I4.js +58 -0
- package/dist/es-419-CoqfXTDl.js +3043 -0
- package/dist/es-DXFWBB40.js +3043 -0
- package/dist/es-ES-TOSb7vSR.js +3043 -0
- package/dist/es-MX-CpubyuFB.js +3043 -0
- package/dist/et-dg12JfIX.js +3043 -0
- package/dist/{expiredId-BQ1uPh7b.js → expiredId-BPgVum6e.js} +22 -27
- package/dist/extensibility.es.js +701 -24
- package/dist/fa-IR-TKcZgrd1.js +3043 -0
- package/dist/face-match/face-match.es.js +1 -1
- package/dist/face-match/styles.css +76 -40
- package/dist/face-match/styles.css.js +1 -0
- package/dist/{faceMatch-Rf-MMdto.js → faceMatch-BcScQR2O.js} +7 -8
- package/dist/faceMatch-BvaN_Ggn.js +2 -0
- package/dist/fi-FI-BP9vgY5F.js +3043 -0
- package/dist/field-comparison/field-comparison.es.js +1 -1
- package/dist/field-comparison/styles.css +12 -0
- package/dist/field-comparison/styles.css.js +1 -0
- package/dist/fieldComparison-D4YoXJKX.js +2 -0
- package/dist/{fieldComparison-BnGj3nNp.js → fieldComparison-UKZsi875.js} +27 -11
- package/dist/fieldLabelHint-CxjArYkQ.js +16 -0
- package/dist/{finalSuccessScreen-B9uB3bST.js → finalSuccessScreen-7OX0TdIz.js} +13 -14
- package/dist/fiscal-qr/fiscal-qr.es.js +28 -9
- package/dist/fiscal-qr/styles.css +13 -1
- package/dist/fiscal-qr/styles.css.js +1 -0
- package/dist/{extensibility-C5XqL_A3.js → flipAnimation-BwI4pEJc.js} +608 -1005
- package/dist/flow/flow.es.js +308 -62
- package/dist/flow/shell/styles.css +402 -0
- package/dist/flow/shell/styles.css.js +1 -0
- package/dist/flow/styles.css +582 -312
- package/dist/formField-DWExlgnz.js +60 -0
- package/dist/fr-B4LoNDGy.js +3047 -0
- package/dist/fr-CA-CjN8CDsE.js +3047 -0
- package/dist/{front-horizontal-hint-Bhz1rq-w.js → front-horizontal-hint-mgovnJf3.js} +1 -1
- package/dist/{front-vertical-hint-C4FC1ksx.js → front-vertical-hint-qXMVdLri.js} +1 -1
- package/dist/geolocation/geolocation.es.js +9 -9
- package/dist/geolocation/styles.css +4 -4
- package/dist/geolocation/styles.css.js +1 -0
- package/dist/government-validation/government-validation.es.js +38 -86
- package/dist/government-validation/styles.css +2 -38
- package/dist/government-validation/styles.css.js +1 -0
- package/dist/he-CJNS0xku.js +3051 -0
- package/dist/hi-CoHu7PnX.js +3043 -0
- package/dist/hmn-qubMIB6T.js +3043 -0
- package/dist/{homeScreen-Bv9mUUOF.js → homeScreen-CqLbJbhW.js} +8 -7
- package/dist/hr-N3Dy9ndd.js +3047 -0
- package/dist/ht-iHGiGZhO.js +3043 -0
- package/dist/hu-hlQUlAJs.js +3043 -0
- package/dist/{icons-ChHV5iHi.js → icons-DNXYxUPA.js} +99 -11
- package/dist/id/id.es.js +576 -62
- package/dist/id/styles.css +114 -45
- package/dist/id/styles.css.js +1 -0
- package/dist/id-Dhk7ywrq.js +3037 -0
- package/dist/{id-back-of-card-C4XViC7W.js → id-back-of-card-B6EcmiCs.js} +1 -1
- package/dist/{id-back-of-card-vertical-DCz0rj8m.js → id-back-of-card-vertical-B3FXhPpj.js} +1 -1
- package/dist/{id-front-of-card-CUA1ocVF.js → id-front-of-card-V_BlLaZr.js} +1 -1
- package/dist/{id-front-of-card-vertical-Ddm_BwD3.js → id-front-of-card-vertical-CuZjL8kc.js} +1 -1
- package/dist/id-ocr/styles.css.js +1 -0
- package/dist/id-selfie-flow/id-selfie-flow.es.js +10 -9
- package/dist/id-selfie-flow/styles.css +40 -8
- package/dist/id-verification/id-verification.es.js +5 -5
- package/dist/{idOcr-Da1-2sWY.js → idOcr-Bt0V72id.js} +13 -16
- package/dist/identity-reuse/identity-reuse.es.js +8 -113
- package/dist/identity-reuse/styles.css +1 -1
- package/dist/{incode-logo-DeIDDejm.js → incode-logo-BzJOZr3f.js} +1 -64
- package/dist/{incodeComponent-BtFz-bx2.js → incodeComponent-DeVV0gEn.js} +192 -22
- package/dist/{incodeModule-9K8KUs61.js → incodeModule-Do8qpZk7.js} +3 -3
- package/dist/index.es.js +4 -3
- package/dist/{inputComposed-C2zTEXsp.js → inputComposed-9aPipTS_.js} +9 -9
- package/dist/inputComposed-DZokKK4c.js +1 -0
- package/dist/it-CXYuJ5BQ.js +3043 -0
- package/dist/ja-B5OkMrWD.js +3037 -0
- package/dist/ja-JP-SlPp7xE2.js +3037 -0
- package/dist/jv-DduD6MhM.js +3037 -0
- package/dist/ka-CG2wabuB.js +3043 -0
- package/dist/kk-D984nBRQ.js +3043 -0
- package/dist/km-B-DaaNxL.js +3037 -0
- package/dist/ko-B8I6YPOu.js +3037 -0
- package/dist/ko-KP-BTQZdVex.js +3037 -0
- package/dist/ky-p_wAYlXq.js +3043 -0
- package/dist/lo-CS-RhXrt.js +3037 -0
- package/dist/lt-C1yAMYTU.js +3051 -0
- package/dist/lv-CiHCsaN9.js +3047 -0
- package/dist/{mandatoryConsent-CxShVycM.js → mandatoryConsent-BJcDf3s-.js} +10 -7
- package/dist/manualCaptureButton-2RTC1vZC.js +63 -0
- package/dist/{manualCaptureButton-DzJFIEfu.js → manualCaptureButton-CqwPCE8h.js} +10 -55
- package/dist/mk-VumecXcv.js +3043 -0
- package/dist/mn-DGMJpCs6.js +3043 -0
- package/dist/{modal-BH2wi8Q0.js → modal-H_YHBjxJ.js} +7 -6
- package/dist/{modal.hooks-DcakflQ4.js → modal.hooks-B0Wrc9s2.js} +7 -1
- package/dist/ms-CBk2NkZ1.js +3037 -0
- package/dist/my-BWcPvvs5.js +3037 -0
- package/dist/nb-NO-D7azau2s.js +3043 -0
- package/dist/ne-D9CU-qx6.js +3043 -0
- package/dist/nl-BVhLZVXm.js +3043 -0
- package/dist/{numberedStep-DqtXyT11.js → numberedStep-C8e_uPaz.js} +1 -1
- package/dist/{optionAccessibleLabel-C5iZCrlq.js → optionAccessibleLabel-C0BRq4LF.js} +6 -6
- package/dist/{otpInput-CvPR3ZpP.js → otpInput-C8mlw_Cm.js} +8 -83
- package/dist/{passport-horizontal-hint-DzkhjC8Q.js → passport-horizontal-hint-6Ghn2EEN.js} +1 -1
- package/dist/{passport-vertical-hint-Bd0BQn2Y.js → passport-vertical-hint-UPFFpdf4.js} +1 -1
- package/dist/passwordInputComposed-CDbxJKHR.js +74 -0
- package/dist/{pdf-BUoY_2gv.js → pdf-CFubyG0B.js} +1 -1
- package/dist/pdfViewer-CCu7pBQv.js +2 -0
- package/dist/{pdfViewer-TTZmPABh.js → pdfViewer-DTwxqwSD.js} +4 -4
- package/dist/permissions-B0ctl0V9.js +212 -0
- package/dist/phone/phone.es.js +10 -9
- package/dist/phone/styles.css +1 -1
- package/dist/phone/styles.css.js +1 -0
- package/dist/{phoneInputComposed-byyszNoS.js → phoneInputComposed-Bz37hY_u.js} +20 -8412
- package/dist/pl-DWKpY783.js +3051 -0
- package/dist/{processing-B2eaSGLu.js → processing-CrNgzN1u.js} +2 -2
- package/dist/pt-B2_-n4Z3.js +3043 -0
- package/dist/pt-BR-CC8MxgMX.js +3043 -0
- package/dist/pt-PT-vo9--bzz.js +3043 -0
- package/dist/qe-signature/qe-signature.es.js +4 -4
- package/dist/radioGroupComposed-BFzxJVpZ.js +1 -0
- package/dist/{radioGroupComposed-DQzTWutW.js → radioGroupComposed-BrawV4FU.js} +15 -71
- package/dist/redirect-to-mobile/redirect-to-mobile.es.js +34 -178
- package/dist/redirect-to-mobile/styles.css +2 -27
- package/dist/redirect-to-mobile/styles.css.js +1 -0
- package/dist/{registerIncodeElement-DW2PE_DX.js → registerIncodeElement-CbZczi4S.js} +1 -1
- package/dist/resendTimer-C0HqF9VE.js +79 -0
- package/dist/{useModuleLoader-DxOEZ0vn.js → resolveApiKey-DU0APKTv.js} +70 -222
- package/dist/{richText-CEwM8jib.js → richText-BEuqr0as.js} +9 -9
- package/dist/ro-DOhwcTr3.js +3047 -0
- package/dist/ru-CD71PeIH.js +3051 -0
- package/dist/ru-RU-DLHiNY0O.js +3051 -0
- package/dist/selfie/selfie.es.js +184 -8
- package/dist/selfie/styles.css +225 -36
- package/dist/selfie/styles.css.js +1 -0
- package/dist/signature/signature.es.js +8 -9
- package/dist/signature/styles.css.js +1 -0
- package/dist/sk-DaVWjX4k.js +3051 -0
- package/dist/sl-YiCpfUol.js +3051 -0
- package/dist/smsTabContent-C1C1g4GT.js +172 -0
- package/dist/so-B2bRmOT5.js +3043 -0
- package/dist/{spacer-DLEDuWEx.js → spacer-DZ-t7RMQ.js} +10 -10
- package/dist/spinner-hjbTcmA1.js +88 -0
- package/dist/sr-BbjKCO-a.js +3047 -0
- package/dist/sr-Latn-D-xKaOqV.js +3047 -0
- package/dist/sr-YU-1ULH6b8i.js +3047 -0
- package/dist/{statusPage-BF4qGjF3.js → statusPage-DeP-KBHD.js} +4 -4
- package/dist/sv-SE-5wAQ-CsE.js +3043 -0
- package/dist/sw-DVj-0--U.js +3043 -0
- package/dist/{tabs-BGL1oRLb.js → tabs-C8WsKO4V.js} +2 -2
- package/dist/th-TH-DAqLZmwn.js +3037 -0
- package/dist/th-ubpxty9O.js +3037 -0
- package/dist/themes/dark.css +125 -0
- package/dist/themes/light.css +124 -0
- package/dist/tl-DCL6tS5T.js +3043 -0
- package/dist/tl-PH-Wftt86RZ.js +3043 -0
- package/dist/tr-B58sWy89.js +3043 -0
- package/dist/{tutorial-LQuJ4dse.js → tutorial-BP1F722m.js} +40 -226
- package/dist/types/certificate-issuance.d.ts +4 -4
- package/dist/types/dynamic-forms.d.ts +177 -0
- package/dist/types/extensibility.d.ts +75 -23
- package/dist/types/flow.d.ts +37 -0
- package/dist/types/government-validation.d.ts +2 -1
- package/dist/types/index.d.ts +28 -4
- package/dist/types/video-selfie.d.ts +6 -161
- package/dist/typography-CYO7ELEl.js +53 -0
- package/dist/{uiConfig-Dqnjankd.js → uiConfig-BcjOx3PY.js} +184 -8
- package/dist/uk-BaklGIxd.js +3051 -0
- package/dist/uk-UA-BoawOp_y.js +3051 -0
- package/dist/ur-MYw3j3wD.js +3043 -0
- package/dist/useModuleLoader-DpcbSKBH.js +176 -0
- package/dist/uz-DWfToWrZ.js +3043 -0
- package/dist/{vendor-preact-BPXMFRom.js → vendor-preact-C0jX1Cbq.js} +68 -181
- package/dist/{verificationResult-q_zD_Pxh.js → verificationResult-Bre5Fb7M.js} +32 -25
- package/dist/vi-IY_487Pk.js +3037 -0
- package/dist/video-selfie/styles.css +51 -17
- package/dist/video-selfie/styles.css.js +1 -0
- package/dist/video-selfie/video-selfie.es.js +35 -23
- package/dist/watchlist/watchlist.es.js +7 -7
- package/dist/watchlist-for-business/styles.css.js +1 -0
- package/dist/{watchlistForBusiness-C_zqdY4P.js → watchlistForBusiness-BIrl-mYj.js} +28 -16
- package/dist/workflow/styles.css +1073 -356
- package/dist/workflow/workflow.es.js +17 -15
- package/dist/zh-B1yRDjHf.js +3037 -0
- package/dist/zh-CN-B2Yvvabk.js +3037 -0
- package/dist/zh-HANT-CdNxQtKM.js +3037 -0
- package/dist/zh-TW-BgqFmnMA.js +3037 -0
- package/package.json +32 -22
- package/dist/bottomSheet-BWEUBq8m.js +0 -38
- package/dist/dateInputComposed-BGC37jC7.js +0 -1
- package/dist/documentCapture-CO9kIxru.js +0 -2
- package/dist/dropdownComposed-Bf4EcKFw.js +0 -1
- package/dist/ekybModule-uN0ComAn.js +0 -2
- package/dist/ekycModule-B7KRJ7l3.js +0 -2
- package/dist/faceMatch-DjD2hgBp.js +0 -2
- package/dist/fieldComparison-DFH4hUM_.js +0 -2
- package/dist/inputComposed-kKtrvJU5.js +0 -1
- package/dist/pdfViewer-C1B-07Wu.js +0 -2
- package/dist/requiredLabelHint-Dx0WS2cR.js +0 -17
- package/dist/snackbar-eBOj46AK.js +0 -16
- package/dist/spinner-CJCOHUKx.js +0 -95
- package/dist/successIcon-DS8BLsgy.js +0 -30
- package/dist/types/dynamic-forms/styles.d.ts +0 -1
- /package/dist/{aligndevicelottie-CfoZ5Uus.js → aligndevicelottie-B12hbVhG.js} +0 -0
- /package/dist/{back-tutorial-BHyRHyET.js → back-tutorial-XdmQ0Wml.js} +0 -0
- /package/dist/{backdevicelottie-yKkczgFy.js → backdevicelottie-m_DOD8xE.js} +0 -0
- /package/dist/{blurdevicelottie-8BbophdM.js → blurdevicelottie-DQo_hTMD.js} +0 -0
- /package/dist/{browser-ponyfill-CBjGwwPW.js → browser-ponyfill-ZkeBm4ji.js} +0 -0
- /package/dist/{defineProperty-BbpBna-2.js → defineProperty-BojnCa44.js} +0 -0
- /package/dist/{flip-animation-CvN8FLNc.js → flip-animation-VicedlT5.js} +0 -0
- /package/dist/{frontdevicelottie-CFcahVLk.js → frontdevicelottie-CyIerlMv.js} +0 -0
- /package/dist/{glaredevicelottie-Cnvah0kz.js → glaredevicelottie-QM2C6Ivp.js} +0 -0
- /package/dist/{id-laser-h-BaUHzX-d.js → id-laser-h-B0-iXcvl.js} +0 -0
- /package/dist/{id-laser-v-Dv9yEYJE.js → id-laser-v-Bqh6vimi.js} +0 -0
- /package/dist/{id-tutorial-BOOsXlAJ.js → id-tutorial-IhmAzrIF.js} +0 -0
- /package/dist/{lottie_light-Bv56F2Ae.js → lottie_light-CzZ3CHBk.js} +0 -0
- /package/dist/{passport-tutorial-CeSup6m9.js → passport-tutorial-61vlloJS.js} +0 -0
- /package/dist/{selfieTutorial-CYa8bq6B.js → selfieTutorial-BRQ2QNxQ.js} +0 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { u as T, v as u } from "./vendor-preact-C0jX1Cbq.js";
|
|
2
|
+
import { c as Page } from "./incodeComponent-DeVV0gEn.js";
|
|
3
|
+
import { d as cn, o as Lottie } from "./spacer-DZ-t7RMQ.js";
|
|
4
|
+
import { x as Button } from "./icons-DNXYxUPA.js";
|
|
5
|
+
//#region src/shared/baseTutorial/replaceBaseTutorial.ts
|
|
6
|
+
/**
|
|
7
|
+
* The brand blues baked into the tutorial animations. The selfie oval/shoulders
|
|
8
|
+
* use `#007aff`; the ID/passport tutorials additionally use `#006aff` (the
|
|
9
|
+
* default brand blue) for their accent. Both are re-tinted to the active
|
|
10
|
+
* branding color.
|
|
11
|
+
*
|
|
12
|
+
* Authored as hex and converted to Lottie's normalized `[r, g, b]` (0–1) form.
|
|
13
|
+
* The two greens are ~0.06 apart, comfortably outside `COLOR_MATCH_TOLERANCE`,
|
|
14
|
+
* so they neither cross-match nor catch the (grayscale/white) document and
|
|
15
|
+
* face artwork.
|
|
16
|
+
*/
|
|
17
|
+
var SOURCE_BRAND_COLORS = ["#007aff", "#006aff"].map(hexToRgbUnit).filter((color) => color !== null);
|
|
18
|
+
/**
|
|
19
|
+
* Per-channel tolerance when matching a source color. The baked values are
|
|
20
|
+
* authored as rounded decimals (e.g. `0.48`), so an exact comparison is too
|
|
21
|
+
* brittle; a small tolerance keeps the match robust without catching
|
|
22
|
+
* unrelated colors.
|
|
23
|
+
*/
|
|
24
|
+
var COLOR_MATCH_TOLERANCE = .02;
|
|
25
|
+
/**
|
|
26
|
+
* Reads a CSS custom property off the document root and returns its value.
|
|
27
|
+
* Returns `fallback` (empty by default) when the property is unset or
|
|
28
|
+
* unavailable (e.g. during SSR / tests). With the default empty fallback the
|
|
29
|
+
* recolor no-ops, leaving the animation's authored colors in place — which are
|
|
30
|
+
* the default brand blue, so no theme-specific literal is needed here.
|
|
31
|
+
*/
|
|
32
|
+
function getCssVariableAsHex(variableName, fallback = "") {
|
|
33
|
+
if (typeof document === "undefined") return fallback;
|
|
34
|
+
return getComputedStyle(document.documentElement).getPropertyValue(variableName).trim() || fallback;
|
|
35
|
+
}
|
|
36
|
+
function hexToRgbUnit(hex) {
|
|
37
|
+
let normalized = hex.replace("#", "").trim();
|
|
38
|
+
if (normalized.length === 3) normalized = normalized.split("").map((char) => char + char).join("");
|
|
39
|
+
const result = /^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(normalized);
|
|
40
|
+
if (!result) return null;
|
|
41
|
+
return [
|
|
42
|
+
Number.parseInt(result[1], 16) / 255,
|
|
43
|
+
Number.parseInt(result[2], 16) / 255,
|
|
44
|
+
Number.parseInt(result[3], 16) / 255
|
|
45
|
+
];
|
|
46
|
+
}
|
|
47
|
+
function channelMatches(a, b) {
|
|
48
|
+
return Math.abs(a - b) <= COLOR_MATCH_TOLERANCE;
|
|
49
|
+
}
|
|
50
|
+
function isSourceColor(r, g, b) {
|
|
51
|
+
return SOURCE_BRAND_COLORS.some(([sr, sg, sb]) => channelMatches(r, sr) && channelMatches(g, sg) && channelMatches(b, sb));
|
|
52
|
+
}
|
|
53
|
+
function isStaticColorArray(value) {
|
|
54
|
+
return Array.isArray(value) && value.length >= 3 && value.every((entry) => typeof entry === "number");
|
|
55
|
+
}
|
|
56
|
+
function recolorSolid(node, target) {
|
|
57
|
+
const colorHolder = node.c;
|
|
58
|
+
if (!colorHolder || typeof colorHolder !== "object") return;
|
|
59
|
+
const k = colorHolder.k;
|
|
60
|
+
if (isStaticColorArray(k) && isSourceColor(k[0], k[1], k[2])) {
|
|
61
|
+
k[0] = target[0];
|
|
62
|
+
k[1] = target[1];
|
|
63
|
+
k[2] = target[2];
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function recolorGradient(node, target) {
|
|
67
|
+
const gradient = node.g;
|
|
68
|
+
if (!gradient || typeof gradient !== "object") return;
|
|
69
|
+
const { p, k } = gradient;
|
|
70
|
+
const stopCount = typeof p === "number" ? p : 0;
|
|
71
|
+
const stops = k?.k;
|
|
72
|
+
if (stopCount <= 0 || !Array.isArray(stops)) return;
|
|
73
|
+
for (let stop = 0; stop < stopCount; stop++) {
|
|
74
|
+
const base = stop * 4;
|
|
75
|
+
const r = stops[base + 1];
|
|
76
|
+
const g = stops[base + 2];
|
|
77
|
+
const b = stops[base + 3];
|
|
78
|
+
if (typeof r === "number" && typeof g === "number" && typeof b === "number" && isSourceColor(r, g, b)) {
|
|
79
|
+
stops[base + 1] = target[0];
|
|
80
|
+
stops[base + 2] = target[1];
|
|
81
|
+
stops[base + 3] = target[2];
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function recolorNode(node, target) {
|
|
86
|
+
if (Array.isArray(node)) {
|
|
87
|
+
for (const child of node) recolorNode(child, target);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (!node || typeof node !== "object") return;
|
|
91
|
+
const obj = node;
|
|
92
|
+
if (obj.ty === "fl" || obj.ty === "st") recolorSolid(obj, target);
|
|
93
|
+
else if (obj.ty === "gf" || obj.ty === "gs") recolorGradient(obj, target);
|
|
94
|
+
for (const key of Object.keys(obj)) recolorNode(obj[key], target);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Returns a deep copy of `animationData` with the baked-in brand blue swapped
|
|
98
|
+
* for `hexColor`. The input is never mutated. Unparseable colors leave the
|
|
99
|
+
* animation untouched.
|
|
100
|
+
*/
|
|
101
|
+
function replaceLottieColor(animationData, hexColor) {
|
|
102
|
+
const target = hexToRgbUnit(hexColor);
|
|
103
|
+
if (!target) return animationData;
|
|
104
|
+
const clone = JSON.parse(JSON.stringify(animationData));
|
|
105
|
+
recolorNode(clone, target);
|
|
106
|
+
return clone;
|
|
107
|
+
}
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region src/shared/baseTutorial/baseTutorial.tsx
|
|
110
|
+
var BaseTutorial = ({ className = "", animationData, title, titleId, subtitle, onContinue, buttonText, disclaimerText, isLoading, secondaryAction, actionsSlot, stopFramePosition = "middle", recolor = true, shouldScaleAnimationContainer }) => {
|
|
111
|
+
const themedAnimationData = T(() => {
|
|
112
|
+
if (!animationData) return null;
|
|
113
|
+
if (!recolor) return animationData;
|
|
114
|
+
return replaceLottieColor(animationData, getCssVariableAsHex("--primitive-color-brand-500"));
|
|
115
|
+
}, [animationData, recolor]);
|
|
116
|
+
let scaledClasses = {
|
|
117
|
+
page: "",
|
|
118
|
+
container: "",
|
|
119
|
+
animationContainer: ""
|
|
120
|
+
};
|
|
121
|
+
if (shouldScaleAnimationContainer) scaledClasses = {
|
|
122
|
+
page: "IncodeTutorialPageScaled",
|
|
123
|
+
container: "IncodeBaseTutorialContainerScaled",
|
|
124
|
+
animationContainer: "IncodeBaseTutorialAnimationContainerScaled"
|
|
125
|
+
};
|
|
126
|
+
return /* @__PURE__ */ u(Page, {
|
|
127
|
+
className: cn("IncodeTutorialPage", scaledClasses.page, className),
|
|
128
|
+
title,
|
|
129
|
+
titleId,
|
|
130
|
+
subtitle,
|
|
131
|
+
children: [/* @__PURE__ */ u("div", {
|
|
132
|
+
class: cn("IncodeBaseTutorialContainer", scaledClasses.container),
|
|
133
|
+
children: /* @__PURE__ */ u("div", {
|
|
134
|
+
class: cn("IncodeBaseTutorialAnimationContainer", scaledClasses.animationContainer),
|
|
135
|
+
"aria-hidden": "true",
|
|
136
|
+
children: themedAnimationData ? /* @__PURE__ */ u(Lottie, {
|
|
137
|
+
animationData: themedAnimationData,
|
|
138
|
+
className: "IncodeBaseTutorialAnimation",
|
|
139
|
+
autoStop: true,
|
|
140
|
+
stopFramePosition
|
|
141
|
+
}) : null
|
|
142
|
+
})
|
|
143
|
+
}), /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ u("p", {
|
|
144
|
+
class: "IncodeBaseTutorialDisclaimer",
|
|
145
|
+
children: disclaimerText
|
|
146
|
+
}), /* @__PURE__ */ u("div", {
|
|
147
|
+
class: "IncodeBaseTutorialButtonContainer",
|
|
148
|
+
children: [
|
|
149
|
+
/* @__PURE__ */ u(Button, {
|
|
150
|
+
onClick: onContinue,
|
|
151
|
+
class: "IncodeBaseTutorialButton",
|
|
152
|
+
isLoading,
|
|
153
|
+
children: buttonText
|
|
154
|
+
}),
|
|
155
|
+
secondaryAction ? /* @__PURE__ */ u(Button, {
|
|
156
|
+
variant: "link",
|
|
157
|
+
onClick: secondaryAction.onClick,
|
|
158
|
+
class: "IncodeBaseTutorialSecondaryAction",
|
|
159
|
+
disabled: isLoading,
|
|
160
|
+
"data-testid": secondaryAction.testId,
|
|
161
|
+
children: secondaryAction.label
|
|
162
|
+
}) : null,
|
|
163
|
+
actionsSlot && /* @__PURE__ */ u("div", {
|
|
164
|
+
class: "IncodeBaseTutorialActionsSlot",
|
|
165
|
+
children: actionsSlot
|
|
166
|
+
})
|
|
167
|
+
]
|
|
168
|
+
})] })]
|
|
169
|
+
});
|
|
170
|
+
};
|
|
171
|
+
//#endregion
|
|
172
|
+
export { BaseTutorial as t };
|