UNPKG

@adyen/adyen-platform-experience-web

Version:

![Platform Experience header](https://github.com/Adyen/adyen-platform-experience-web/assets/7926613/18094965-9e01-450e-8dc9-ea84e6b22c2b)

3 lines (2 loc) 3.87 kB
"use strict";const i=require("./emitEvent-CzZf80Am-DK60rvHR.cjs"),w=require("classnames");try{let e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="73c7917c-5618-4937-9265-5998f2d50ce6",e._sentryDebugIdIdentifier="sentry-dbid-73c7917c-5618-4937-9265-5998f2d50ce6")}catch{}const p=i.y$1({});try{let e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="80171e8f-300c-4f9d-9068-4933244c160a",e._sentryDebugIdIdentifier="sentry-dbid-80171e8f-300c-4f9d-9068-4933244c160a")}catch{}const h={AcceptedCountries:"acceptedCountries",AllowBankAccountFormatSelection:"allowBankAccountFormatSelection",AllowDebugUi:"allowDebugUi",AllowIntraRegionCrossBorderPayout:"allowIntraRegionCrossBorderPayout",AllowLegalEntityTypeChange:"changeLegalEntityType",AllowPrefilledCountryEdit:"editPrefilledCountry",RequirePciSignEcommerce:"requirePciSignEcommerce",RequirePciSignPos:"requirePciSignPos",RequirePciSignEcomMoto:"requirePciSignEcomMoto",RequirePciSignPosMoto:"requirePciSignPosMoto",HideOnboardingIntroductionIndividual:"hideOnboardingIntroductionIndividual",HideOnboardingIntroductionOrganization:"hideOnboardingIntroductionOrganization",HideOnboardingIntroductionTrust:"hideOnboardingIntroductionTrust",HideOnboardingIntroductionSoleProprietor:"hideOnboardingIntroductionSoleProprietor",TransferInstrumentLimit:"transferInstrumentLimit",ViewOnboardingGuidance:"viewOnboardingGuidance",InstantBankVerification:"instantBankVerification",ShowServiceAgreementsFirst:"showServiceAgreementsFirst",ShowBusinessFinancingFirst:"showBusinessFinancingFirst",EnforceLegalAge:"enforceLegalAge",MerchantType:"merchantType",AllowBusinessLines:"allowBusinessLines"};try{let e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4f20d737-2dea-42ed-9fe4-584121c2c863",e._sentryDebugIdIdentifier="sentry-dbid-4f20d737-2dea-42ed-9fe4-584121c2c863")}catch{}const I=i.D((e,n)=>{const o=i.useAnalyticsContext(),{enableTracking:d=!1,...l}=e,{isInvalid:y,isValid:a,type:g="text",disabled:s,name:u}=e,b=t=>{d&&i.debouncedInputEvent(o,{actionType:"input",field:u}),e.onInput?.(t)},r=t=>{d&&o.addFieldEvent("Interacted with form field",{actionType:"blur",field:u}),e.onBlurHandler?.(t),e.trimOnBlur&&(t.currentTarget.value=t.currentTarget.value.trim()),e.onBlur?.(t)},c=t=>{d&&o.addFieldEvent("Interacted with form field",{actionType:"focus",field:u}),e.onFocusHandler?.(t)},f=w("adyen-kyc-input",[`adyen-kyc-input--${g}`],e.className,{"adyen-kyc-input--invalid":y,"adyen-kyc-field--valid":a,"adyen-kyc-input--disabled":s});return i.u("input",{...l,name:u,"aria-disabled":s,"aria-invalid":!a,"aria-required":l.required||l["aria-required"],className:f,onBlur:r,onFocus:c,onInput:b,ref:n,type:g})});I.displayName="InputBase";const T=e=>{const n=i.A();return e??n},m=i.D(({onInput:e,onBlur:n,transformInput:o,transformMode:d,...l},y)=>{const[a,g]=i.d(null),s=T(y),u=i.q(r=>{const c=r.currentTarget;if(o&&(!d||d==="input")){g(c.selectionStart);const f=o(c.value),t={...r,target:{...r.target,value:f}};e(t)}else e(r)},[o,d,e]),b=i.q(r=>{const c=r.currentTarget;if(o&&d==="blur"){g(c.selectionStart);const f=o(c.value),t={...r,target:{...r.target,value:f}};n?.(t)}else n?.(r)},[o,d,n]);return i._(()=>{a&&s.current?.selectionStart!==a&&s?.current?.setSelectionRange(a,a,"none")},[a,s]),i.u(I,{...l,onInput:u,onBlur:b,ref:s,type:"text"})});exports.InputBase=I;exports.InputText=m;exports.SettingNames=h;exports.formDebugInfo=p; //# sourceMappingURL=InputText-C55stM8O-CKH_l31R.cjs.map