@@ -34,7 +34,7 @@ export default class ChannelCaptureContainer {
3434 public smsInputFieldIsValid = true ;
3535 public emailInputFieldIsValid = true ;
3636 private promptOptions : SlidedownPromptOptions ;
37- private itiOneSignal : any ; // iti library initialization return obj
37+ private itiOneSignal : ReturnType < typeof window . intlTelInput > | undefined ;
3838
3939 constructor ( promptOptions : SlidedownPromptOptions ) {
4040 this . promptOptions = promptOptions ;
@@ -207,7 +207,7 @@ export default class ChannelCaptureContainer {
207207
208208 smsInput . addEventListener ( 'keyup' , ( event ) => {
209209 this . smsInputFieldIsValid =
210- this . itiOneSignal . isValidNumber ( ) ||
210+ this . itiOneSignal ? .isValidNumber ( ) ||
211211 ( smsInput as HTMLInputElement ) ?. value === '' ;
212212
213213 // @ts -expect-error - TODO: improve type
@@ -222,7 +222,7 @@ export default class ChannelCaptureContainer {
222222 // handles case where number is typed, then country is changed after
223223 smsInput . addEventListener ( 'blur' , ( ) => {
224224 this . smsInputFieldIsValid =
225- this . itiOneSignal . isValidNumber ( ) ||
225+ this . itiOneSignal ? .isValidNumber ( ) ||
226226 ( smsInput as HTMLInputElement ) ?. value === '' ;
227227
228228 this . updateValidationOnSmsInputChange ( ) ;
@@ -369,8 +369,8 @@ export default class ChannelCaptureContainer {
369369
370370 getValueFromSmsInput ( ) : string {
371371 return (
372- this . itiOneSignal . getNumber (
373- window . intlTelInput . utils . numberFormat . E164 ,
372+ this . itiOneSignal ? .getNumber (
373+ window . intlTelInputUtils . numberFormat . E164 ,
374374 ) || ''
375375 ) ;
376376 }
0 commit comments