intl-tel-input 27.1.3 → 27.2.0
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/CHANGELOG.md +1 -1
- package/README.md +2 -2
- package/angular/README.md +8 -0
- package/angular/dist/IntlTelInput.d.ts +12 -1
- package/angular/dist/IntlTelInput.js +23 -3
- package/angular/dist/IntlTelInputWithUtils.js +23 -3
- package/dist/js/data.js +1 -1
- package/dist/js/data.min.js +1 -1
- package/dist/js/intlTelInput.js +2 -2
- package/dist/js/intlTelInput.min.js +2 -2
- package/dist/js/intlTelInput.mjs +1 -1
- package/dist/js/intlTelInputWithUtils.js +2 -2
- package/dist/js/intlTelInputWithUtils.min.js +2 -2
- package/dist/js/intlTelInputWithUtils.mjs +1 -1
- package/package.json +1 -1
- package/react/README.md +8 -0
- package/react/dist/IntlTelInput.d.ts +5 -0
- package/react/dist/IntlTelInput.js +27 -4
- package/react/dist/IntlTelInputWithUtils.js +27 -4
- package/svelte/README.md +9 -0
- package/svelte/src/IntlTelInput.svelte +25 -0
- package/svelte/src/IntlTelInput.svelte.d.ts +6 -0
- package/vue/README.md +9 -0
- package/vue/dist/{IntlTelInput-SQtNzOVr.js → IntlTelInput-DTtMkd4-.js} +11 -3
- package/vue/dist/IntlTelInput.js +1 -1
- package/vue/dist/IntlTelInput.vue.d.ts +19 -11
- package/vue/dist/IntlTelInputWithUtils.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
See the Github Releases page for changelog: https://github.com/jackocnr/intl-tel-input/releases
|
|
2
2
|
|
|
3
|
-
Or to view a specific version, e.g. v27.
|
|
3
|
+
Or to view a specific version, e.g. v27.2.0, update the URL accordingly, e.g. https://github.com/jackocnr/intl-tel-input/releases/tag/v27.2.0
|
|
4
4
|
|
|
5
5
|
## Breaking changes
|
|
6
6
|
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
A JavaScript plugin for entering, formatting and validating international telephone numbers. Includes React, Vue, Angular and Svelte components, plus TypeScript definitions.
|
|
5
5
|
|
|
6
|
-
[Explore docs »](https://intl-tel-input.com/docs/
|
|
6
|
+
[Explore docs »](https://intl-tel-input.com/docs/integrations)
|
|
7
7
|
|
|
8
8
|
<picture>
|
|
9
9
|
<source media="(prefers-color-scheme: dark)" srcset="https://raw.github.com/jackocnr/intl-tel-input/master/screenshots/iti-github-dark.png">
|
|
@@ -20,7 +20,7 @@ Use [Twilio's API to build phone verification, SMS 2FA, appointment reminders, m
|
|
|
20
20
|
We provide React, Vue, Angular and Svelte (beta) components alongside the regular JavaScript plugin. This readme is for the JavaScript plugin. View the [React Component](https://intl-tel-input.com/docs/react-component), the [Vue Component](https://intl-tel-input.com/docs/vue-component) the [Angular Component](https://intl-tel-input.com/docs/angular-component), or the [Svelte component](https://intl-tel-input.com/docs/svelte-component).
|
|
21
21
|
|
|
22
22
|
## Docs and Examples
|
|
23
|
-
We have a newly updated website, where you can find [a full set of docs](https://intl-tel-input.com/docs/
|
|
23
|
+
We have a newly updated website, where you can find [a full set of docs](https://intl-tel-input.com/docs/integrations), a [live playground](https://intl-tel-input.com/playground/) where you can try out all of the options, as well as plenty of [examples](https://intl-tel-input.com/examples/validation-practical.html) of different setups.
|
|
24
24
|
|
|
25
25
|
## Features
|
|
26
26
|
* Automatically select the user's current country using an IP lookup
|
package/angular/README.md
CHANGED
|
@@ -3,3 +3,11 @@
|
|
|
3
3
|
An Angular component for the [intl-tel-input](https://github.com/jackocnr/intl-tel-input) JavaScript plugin. View the [source code](https://github.com/jackocnr/intl-tel-input/blob/master/angular/src/IntlTelInput.ts).
|
|
4
4
|
|
|
5
5
|
[Explore docs »](https://intl-tel-input.com/docs/angular-component)
|
|
6
|
+
|
|
7
|
+
## Running the demos locally
|
|
8
|
+
|
|
9
|
+
1. Initialise the submodules: `git submodule update --init --recursive`
|
|
10
|
+
2. Install dependencies: `npm install`
|
|
11
|
+
3. Build: `npm run build`
|
|
12
|
+
|
|
13
|
+
You can then open `angular/demo/validation/index.html` in your browser to try the validation demo. View the full list of [available demos](https://github.com/jackocnr/intl-tel-input/tree/master/angular/demo).
|
|
@@ -4,6 +4,11 @@ import { OnDestroy, ElementRef, EventEmitter, AfterViewInit, OnChanges, SimpleCh
|
|
|
4
4
|
import { ControlValueAccessor, Validator, AbstractControl, ValidationErrors } from "@angular/forms";
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
export { intlTelInput };
|
|
7
|
+
export type StrictRejectDetail = {
|
|
8
|
+
source: "key" | "paste";
|
|
9
|
+
rejectedInput: string;
|
|
10
|
+
reason: "invalid" | "max-length";
|
|
11
|
+
};
|
|
7
12
|
declare class IntlTelInput implements AfterViewInit, OnDestroy, OnChanges, ControlValueAccessor, Validator {
|
|
8
13
|
inputRef: ElementRef<HTMLInputElement>;
|
|
9
14
|
/** initialValue is only used during initialization — changes after init are ignored. */
|
|
@@ -45,6 +50,9 @@ declare class IntlTelInput implements AfterViewInit, OnDestroy, OnChanges, Contr
|
|
|
45
50
|
countryChange: EventEmitter<string>;
|
|
46
51
|
validityChange: EventEmitter<boolean>;
|
|
47
52
|
errorCodeChange: EventEmitter<number | null>;
|
|
53
|
+
openCountryDropdown: EventEmitter<void>;
|
|
54
|
+
closeCountryDropdown: EventEmitter<void>;
|
|
55
|
+
strictReject: EventEmitter<StrictRejectDetail>;
|
|
48
56
|
blur: EventEmitter<FocusEvent>;
|
|
49
57
|
focus: EventEmitter<FocusEvent>;
|
|
50
58
|
keydown: EventEmitter<KeyboardEvent>;
|
|
@@ -62,6 +70,9 @@ declare class IntlTelInput implements AfterViewInit, OnDestroy, OnChanges, Contr
|
|
|
62
70
|
private onChange;
|
|
63
71
|
private onTouched;
|
|
64
72
|
private onValidatorChange;
|
|
73
|
+
private handleOpenDropdown;
|
|
74
|
+
private handleCloseDropdown;
|
|
75
|
+
private handleStrictReject;
|
|
65
76
|
ngAfterViewInit(): void;
|
|
66
77
|
private buildInitOptions;
|
|
67
78
|
ngOnChanges(changes: SimpleChanges): void;
|
|
@@ -92,6 +103,6 @@ declare class IntlTelInput implements AfterViewInit, OnDestroy, OnChanges, Contr
|
|
|
92
103
|
validate(_control: AbstractControl): ValidationErrors | null;
|
|
93
104
|
registerOnValidatorChange(fn: () => void): void;
|
|
94
105
|
static ɵfac: i0.ɵɵFactoryDeclaration<IntlTelInput, never>;
|
|
95
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<IntlTelInput, "intl-tel-input", never, { "initialValue": { "alias": "initialValue"; "required": false; }; "usePreciseValidation": { "alias": "usePreciseValidation"; "required": false; }; "inputAttributes": { "alias": "inputAttributes"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "allowDropdown": { "alias": "allowDropdown"; "required": false; }; "allowedNumberTypes": { "alias": "allowedNumberTypes"; "required": false; }; "allowNumberExtensions": { "alias": "allowNumberExtensions"; "required": false; }; "allowPhonewords": { "alias": "allowPhonewords"; "required": false; }; "autoPlaceholder": { "alias": "autoPlaceholder"; "required": false; }; "containerClass": { "alias": "containerClass"; "required": false; }; "countryNameLocale": { "alias": "countryNameLocale"; "required": false; }; "countryOrder": { "alias": "countryOrder"; "required": false; }; "countrySearch": { "alias": "countrySearch"; "required": false; }; "customPlaceholder": { "alias": "customPlaceholder"; "required": false; }; "dropdownAlwaysOpen": { "alias": "dropdownAlwaysOpen"; "required": false; }; "dropdownContainer": { "alias": "dropdownContainer"; "required": false; }; "excludeCountries": { "alias": "excludeCountries"; "required": false; }; "fixDropdownWidth": { "alias": "fixDropdownWidth"; "required": false; }; "formatAsYouType": { "alias": "formatAsYouType"; "required": false; }; "formatOnDisplay": { "alias": "formatOnDisplay"; "required": false; }; "geoIpLookup": { "alias": "geoIpLookup"; "required": false; }; "hiddenInput": { "alias": "hiddenInput"; "required": false; }; "i18n": { "alias": "i18n"; "required": false; }; "initialCountry": { "alias": "initialCountry"; "required": false; }; "loadUtils": { "alias": "loadUtils"; "required": false; }; "nationalMode": { "alias": "nationalMode"; "required": false; }; "onlyCountries": { "alias": "onlyCountries"; "required": false; }; "placeholderNumberType": { "alias": "placeholderNumberType"; "required": false; }; "searchInputClass": { "alias": "searchInputClass"; "required": false; }; "separateDialCode": { "alias": "separateDialCode"; "required": false; }; "showFlags": { "alias": "showFlags"; "required": false; }; "strictMode": { "alias": "strictMode"; "required": false; }; "useFullscreenPopup": { "alias": "useFullscreenPopup"; "required": false; }; }, { "numberChange": "numberChange"; "countryChange": "countryChange"; "validityChange": "validityChange"; "errorCodeChange": "errorCodeChange"; "blur": "blur"; "focus": "focus"; "keydown": "keydown"; "keyup": "keyup"; "paste": "paste"; "click": "click"; }, never, never, true, never>;
|
|
106
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<IntlTelInput, "intl-tel-input", never, { "initialValue": { "alias": "initialValue"; "required": false; }; "usePreciseValidation": { "alias": "usePreciseValidation"; "required": false; }; "inputAttributes": { "alias": "inputAttributes"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "allowDropdown": { "alias": "allowDropdown"; "required": false; }; "allowedNumberTypes": { "alias": "allowedNumberTypes"; "required": false; }; "allowNumberExtensions": { "alias": "allowNumberExtensions"; "required": false; }; "allowPhonewords": { "alias": "allowPhonewords"; "required": false; }; "autoPlaceholder": { "alias": "autoPlaceholder"; "required": false; }; "containerClass": { "alias": "containerClass"; "required": false; }; "countryNameLocale": { "alias": "countryNameLocale"; "required": false; }; "countryOrder": { "alias": "countryOrder"; "required": false; }; "countrySearch": { "alias": "countrySearch"; "required": false; }; "customPlaceholder": { "alias": "customPlaceholder"; "required": false; }; "dropdownAlwaysOpen": { "alias": "dropdownAlwaysOpen"; "required": false; }; "dropdownContainer": { "alias": "dropdownContainer"; "required": false; }; "excludeCountries": { "alias": "excludeCountries"; "required": false; }; "fixDropdownWidth": { "alias": "fixDropdownWidth"; "required": false; }; "formatAsYouType": { "alias": "formatAsYouType"; "required": false; }; "formatOnDisplay": { "alias": "formatOnDisplay"; "required": false; }; "geoIpLookup": { "alias": "geoIpLookup"; "required": false; }; "hiddenInput": { "alias": "hiddenInput"; "required": false; }; "i18n": { "alias": "i18n"; "required": false; }; "initialCountry": { "alias": "initialCountry"; "required": false; }; "loadUtils": { "alias": "loadUtils"; "required": false; }; "nationalMode": { "alias": "nationalMode"; "required": false; }; "onlyCountries": { "alias": "onlyCountries"; "required": false; }; "placeholderNumberType": { "alias": "placeholderNumberType"; "required": false; }; "searchInputClass": { "alias": "searchInputClass"; "required": false; }; "separateDialCode": { "alias": "separateDialCode"; "required": false; }; "showFlags": { "alias": "showFlags"; "required": false; }; "strictMode": { "alias": "strictMode"; "required": false; }; "useFullscreenPopup": { "alias": "useFullscreenPopup"; "required": false; }; }, { "numberChange": "numberChange"; "countryChange": "countryChange"; "validityChange": "validityChange"; "errorCodeChange": "errorCodeChange"; "openCountryDropdown": "openCountryDropdown"; "closeCountryDropdown": "closeCountryDropdown"; "strictReject": "strictReject"; "blur": "blur"; "focus": "focus"; "keydown": "keydown"; "keyup": "keyup"; "paste": "paste"; "click": "click"; }, never, never, true, never>;
|
|
96
107
|
}
|
|
97
108
|
export default IntlTelInput;
|
|
@@ -4541,7 +4541,7 @@ var intlTelInput = Object.assign(
|
|
|
4541
4541
|
attachUtils,
|
|
4542
4542
|
startedLoadingUtils: false,
|
|
4543
4543
|
startedLoadingAutoCountry: false,
|
|
4544
|
-
version: "27.
|
|
4544
|
+
version: "27.2.0"
|
|
4545
4545
|
}
|
|
4546
4546
|
);
|
|
4547
4547
|
var intlTelInput_default = intlTelInput;
|
|
@@ -4596,6 +4596,9 @@ var IntlTelInput = class _IntlTelInput {
|
|
|
4596
4596
|
countryChange = new EventEmitter();
|
|
4597
4597
|
validityChange = new EventEmitter();
|
|
4598
4598
|
errorCodeChange = new EventEmitter();
|
|
4599
|
+
openCountryDropdown = new EventEmitter();
|
|
4600
|
+
closeCountryDropdown = new EventEmitter();
|
|
4601
|
+
strictReject = new EventEmitter();
|
|
4599
4602
|
blur = new EventEmitter();
|
|
4600
4603
|
focus = new EventEmitter();
|
|
4601
4604
|
keydown = new EventEmitter();
|
|
@@ -4621,8 +4624,16 @@ var IntlTelInput = class _IntlTelInput {
|
|
|
4621
4624
|
// eslint-disable-next-line class-methods-use-this
|
|
4622
4625
|
onValidatorChange = () => {
|
|
4623
4626
|
};
|
|
4627
|
+
handleOpenDropdown = () => this.openCountryDropdown.emit();
|
|
4628
|
+
handleCloseDropdown = () => this.closeCountryDropdown.emit();
|
|
4629
|
+
handleStrictReject = (e) => {
|
|
4630
|
+
this.strictReject.emit(e.detail);
|
|
4631
|
+
};
|
|
4624
4632
|
ngAfterViewInit() {
|
|
4625
4633
|
this.iti = intlTelInput_default(this.inputRef.nativeElement, this.buildInitOptions());
|
|
4634
|
+
this.inputRef.nativeElement.addEventListener("open:countrydropdown", this.handleOpenDropdown);
|
|
4635
|
+
this.inputRef.nativeElement.addEventListener("close:countrydropdown", this.handleCloseDropdown);
|
|
4636
|
+
this.inputRef.nativeElement.addEventListener("strict:reject", this.handleStrictReject);
|
|
4626
4637
|
this.applyInputAttrs();
|
|
4627
4638
|
if (this.disabled) {
|
|
4628
4639
|
this.iti.setDisabled(this.disabled);
|
|
@@ -4765,6 +4776,9 @@ var IntlTelInput = class _IntlTelInput {
|
|
|
4765
4776
|
return this.inputRef.nativeElement;
|
|
4766
4777
|
}
|
|
4767
4778
|
ngOnDestroy() {
|
|
4779
|
+
this.inputRef.nativeElement.removeEventListener("open:countrydropdown", this.handleOpenDropdown);
|
|
4780
|
+
this.inputRef.nativeElement.removeEventListener("close:countrydropdown", this.handleCloseDropdown);
|
|
4781
|
+
this.inputRef.nativeElement.removeEventListener("strict:reject", this.handleStrictReject);
|
|
4768
4782
|
this.iti?.destroy();
|
|
4769
4783
|
}
|
|
4770
4784
|
ignoredInputAttrs = /* @__PURE__ */ new Set([
|
|
@@ -4841,7 +4855,7 @@ var IntlTelInput = class _IntlTelInput {
|
|
|
4841
4855
|
let _t;
|
|
4842
4856
|
i0.\u0275\u0275queryRefresh(_t = i0.\u0275\u0275loadQuery()) && (ctx.inputRef = _t.first);
|
|
4843
4857
|
}
|
|
4844
|
-
}, inputs: { initialValue: "initialValue", usePreciseValidation: "usePreciseValidation", inputAttributes: "inputAttributes", disabled: "disabled", readonly: "readonly", allowDropdown: "allowDropdown", allowedNumberTypes: "allowedNumberTypes", allowNumberExtensions: "allowNumberExtensions", allowPhonewords: "allowPhonewords", autoPlaceholder: "autoPlaceholder", containerClass: "containerClass", countryNameLocale: "countryNameLocale", countryOrder: "countryOrder", countrySearch: "countrySearch", customPlaceholder: "customPlaceholder", dropdownAlwaysOpen: "dropdownAlwaysOpen", dropdownContainer: "dropdownContainer", excludeCountries: "excludeCountries", fixDropdownWidth: "fixDropdownWidth", formatAsYouType: "formatAsYouType", formatOnDisplay: "formatOnDisplay", geoIpLookup: "geoIpLookup", hiddenInput: "hiddenInput", i18n: "i18n", initialCountry: "initialCountry", loadUtils: "loadUtils", nationalMode: "nationalMode", onlyCountries: "onlyCountries", placeholderNumberType: "placeholderNumberType", searchInputClass: "searchInputClass", separateDialCode: "separateDialCode", showFlags: "showFlags", strictMode: "strictMode", useFullscreenPopup: "useFullscreenPopup" }, outputs: { numberChange: "numberChange", countryChange: "countryChange", validityChange: "validityChange", errorCodeChange: "errorCodeChange", blur: "blur", focus: "focus", keydown: "keydown", keyup: "keyup", paste: "paste", click: "click" }, features: [i0.\u0275\u0275ProvidersFeature([
|
|
4858
|
+
}, inputs: { initialValue: "initialValue", usePreciseValidation: "usePreciseValidation", inputAttributes: "inputAttributes", disabled: "disabled", readonly: "readonly", allowDropdown: "allowDropdown", allowedNumberTypes: "allowedNumberTypes", allowNumberExtensions: "allowNumberExtensions", allowPhonewords: "allowPhonewords", autoPlaceholder: "autoPlaceholder", containerClass: "containerClass", countryNameLocale: "countryNameLocale", countryOrder: "countryOrder", countrySearch: "countrySearch", customPlaceholder: "customPlaceholder", dropdownAlwaysOpen: "dropdownAlwaysOpen", dropdownContainer: "dropdownContainer", excludeCountries: "excludeCountries", fixDropdownWidth: "fixDropdownWidth", formatAsYouType: "formatAsYouType", formatOnDisplay: "formatOnDisplay", geoIpLookup: "geoIpLookup", hiddenInput: "hiddenInput", i18n: "i18n", initialCountry: "initialCountry", loadUtils: "loadUtils", nationalMode: "nationalMode", onlyCountries: "onlyCountries", placeholderNumberType: "placeholderNumberType", searchInputClass: "searchInputClass", separateDialCode: "separateDialCode", showFlags: "showFlags", strictMode: "strictMode", useFullscreenPopup: "useFullscreenPopup" }, outputs: { numberChange: "numberChange", countryChange: "countryChange", validityChange: "validityChange", errorCodeChange: "errorCodeChange", openCountryDropdown: "openCountryDropdown", closeCountryDropdown: "closeCountryDropdown", strictReject: "strictReject", blur: "blur", focus: "focus", keydown: "keydown", keyup: "keyup", paste: "paste", click: "click" }, features: [i0.\u0275\u0275ProvidersFeature([
|
|
4845
4859
|
{
|
|
4846
4860
|
provide: NG_VALUE_ACCESSOR,
|
|
4847
4861
|
useExisting: forwardRef(() => _IntlTelInput),
|
|
@@ -4985,6 +4999,12 @@ var IntlTelInput = class _IntlTelInput {
|
|
|
4985
4999
|
type: Output
|
|
4986
5000
|
}], errorCodeChange: [{
|
|
4987
5001
|
type: Output
|
|
5002
|
+
}], openCountryDropdown: [{
|
|
5003
|
+
type: Output
|
|
5004
|
+
}], closeCountryDropdown: [{
|
|
5005
|
+
type: Output
|
|
5006
|
+
}], strictReject: [{
|
|
5007
|
+
type: Output
|
|
4988
5008
|
}], blur: [{
|
|
4989
5009
|
type: Output
|
|
4990
5010
|
}], focus: [{
|
|
@@ -5000,7 +5020,7 @@ var IntlTelInput = class _IntlTelInput {
|
|
|
5000
5020
|
}] });
|
|
5001
5021
|
})();
|
|
5002
5022
|
(() => {
|
|
5003
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0.\u0275setClassDebugInfo(IntlTelInput, { className: "IntlTelInput", filePath: "IntlTelInput.ts", lineNumber:
|
|
5023
|
+
(typeof ngDevMode === "undefined" || ngDevMode) && i0.\u0275setClassDebugInfo(IntlTelInput, { className: "IntlTelInput", filePath: "IntlTelInput.ts", lineNumber: 68 });
|
|
5004
5024
|
})();
|
|
5005
5025
|
var IntlTelInput_default = IntlTelInput;
|
|
5006
5026
|
export {
|
|
@@ -4541,7 +4541,7 @@ var intlTelInput = Object.assign(
|
|
|
4541
4541
|
attachUtils,
|
|
4542
4542
|
startedLoadingUtils: false,
|
|
4543
4543
|
startedLoadingAutoCountry: false,
|
|
4544
|
-
version: "27.
|
|
4544
|
+
version: "27.2.0"
|
|
4545
4545
|
}
|
|
4546
4546
|
);
|
|
4547
4547
|
var intlTelInput_default = intlTelInput;
|
|
@@ -10909,6 +10909,9 @@ var IntlTelInput = class _IntlTelInput {
|
|
|
10909
10909
|
countryChange = new EventEmitter();
|
|
10910
10910
|
validityChange = new EventEmitter();
|
|
10911
10911
|
errorCodeChange = new EventEmitter();
|
|
10912
|
+
openCountryDropdown = new EventEmitter();
|
|
10913
|
+
closeCountryDropdown = new EventEmitter();
|
|
10914
|
+
strictReject = new EventEmitter();
|
|
10912
10915
|
blur = new EventEmitter();
|
|
10913
10916
|
focus = new EventEmitter();
|
|
10914
10917
|
keydown = new EventEmitter();
|
|
@@ -10934,8 +10937,16 @@ var IntlTelInput = class _IntlTelInput {
|
|
|
10934
10937
|
// eslint-disable-next-line class-methods-use-this
|
|
10935
10938
|
onValidatorChange = () => {
|
|
10936
10939
|
};
|
|
10940
|
+
handleOpenDropdown = () => this.openCountryDropdown.emit();
|
|
10941
|
+
handleCloseDropdown = () => this.closeCountryDropdown.emit();
|
|
10942
|
+
handleStrictReject = (e) => {
|
|
10943
|
+
this.strictReject.emit(e.detail);
|
|
10944
|
+
};
|
|
10937
10945
|
ngAfterViewInit() {
|
|
10938
10946
|
this.iti = intlTelInput_default(this.inputRef.nativeElement, this.buildInitOptions());
|
|
10947
|
+
this.inputRef.nativeElement.addEventListener("open:countrydropdown", this.handleOpenDropdown);
|
|
10948
|
+
this.inputRef.nativeElement.addEventListener("close:countrydropdown", this.handleCloseDropdown);
|
|
10949
|
+
this.inputRef.nativeElement.addEventListener("strict:reject", this.handleStrictReject);
|
|
10939
10950
|
this.applyInputAttrs();
|
|
10940
10951
|
if (this.disabled) {
|
|
10941
10952
|
this.iti.setDisabled(this.disabled);
|
|
@@ -11078,6 +11089,9 @@ var IntlTelInput = class _IntlTelInput {
|
|
|
11078
11089
|
return this.inputRef.nativeElement;
|
|
11079
11090
|
}
|
|
11080
11091
|
ngOnDestroy() {
|
|
11092
|
+
this.inputRef.nativeElement.removeEventListener("open:countrydropdown", this.handleOpenDropdown);
|
|
11093
|
+
this.inputRef.nativeElement.removeEventListener("close:countrydropdown", this.handleCloseDropdown);
|
|
11094
|
+
this.inputRef.nativeElement.removeEventListener("strict:reject", this.handleStrictReject);
|
|
11081
11095
|
this.iti?.destroy();
|
|
11082
11096
|
}
|
|
11083
11097
|
ignoredInputAttrs = /* @__PURE__ */ new Set([
|
|
@@ -11154,7 +11168,7 @@ var IntlTelInput = class _IntlTelInput {
|
|
|
11154
11168
|
let _t;
|
|
11155
11169
|
i0.\u0275\u0275queryRefresh(_t = i0.\u0275\u0275loadQuery()) && (ctx.inputRef = _t.first);
|
|
11156
11170
|
}
|
|
11157
|
-
}, inputs: { initialValue: "initialValue", usePreciseValidation: "usePreciseValidation", inputAttributes: "inputAttributes", disabled: "disabled", readonly: "readonly", allowDropdown: "allowDropdown", allowedNumberTypes: "allowedNumberTypes", allowNumberExtensions: "allowNumberExtensions", allowPhonewords: "allowPhonewords", autoPlaceholder: "autoPlaceholder", containerClass: "containerClass", countryNameLocale: "countryNameLocale", countryOrder: "countryOrder", countrySearch: "countrySearch", customPlaceholder: "customPlaceholder", dropdownAlwaysOpen: "dropdownAlwaysOpen", dropdownContainer: "dropdownContainer", excludeCountries: "excludeCountries", fixDropdownWidth: "fixDropdownWidth", formatAsYouType: "formatAsYouType", formatOnDisplay: "formatOnDisplay", geoIpLookup: "geoIpLookup", hiddenInput: "hiddenInput", i18n: "i18n", initialCountry: "initialCountry", loadUtils: "loadUtils", nationalMode: "nationalMode", onlyCountries: "onlyCountries", placeholderNumberType: "placeholderNumberType", searchInputClass: "searchInputClass", separateDialCode: "separateDialCode", showFlags: "showFlags", strictMode: "strictMode", useFullscreenPopup: "useFullscreenPopup" }, outputs: { numberChange: "numberChange", countryChange: "countryChange", validityChange: "validityChange", errorCodeChange: "errorCodeChange", blur: "blur", focus: "focus", keydown: "keydown", keyup: "keyup", paste: "paste", click: "click" }, features: [i0.\u0275\u0275ProvidersFeature([
|
|
11171
|
+
}, inputs: { initialValue: "initialValue", usePreciseValidation: "usePreciseValidation", inputAttributes: "inputAttributes", disabled: "disabled", readonly: "readonly", allowDropdown: "allowDropdown", allowedNumberTypes: "allowedNumberTypes", allowNumberExtensions: "allowNumberExtensions", allowPhonewords: "allowPhonewords", autoPlaceholder: "autoPlaceholder", containerClass: "containerClass", countryNameLocale: "countryNameLocale", countryOrder: "countryOrder", countrySearch: "countrySearch", customPlaceholder: "customPlaceholder", dropdownAlwaysOpen: "dropdownAlwaysOpen", dropdownContainer: "dropdownContainer", excludeCountries: "excludeCountries", fixDropdownWidth: "fixDropdownWidth", formatAsYouType: "formatAsYouType", formatOnDisplay: "formatOnDisplay", geoIpLookup: "geoIpLookup", hiddenInput: "hiddenInput", i18n: "i18n", initialCountry: "initialCountry", loadUtils: "loadUtils", nationalMode: "nationalMode", onlyCountries: "onlyCountries", placeholderNumberType: "placeholderNumberType", searchInputClass: "searchInputClass", separateDialCode: "separateDialCode", showFlags: "showFlags", strictMode: "strictMode", useFullscreenPopup: "useFullscreenPopup" }, outputs: { numberChange: "numberChange", countryChange: "countryChange", validityChange: "validityChange", errorCodeChange: "errorCodeChange", openCountryDropdown: "openCountryDropdown", closeCountryDropdown: "closeCountryDropdown", strictReject: "strictReject", blur: "blur", focus: "focus", keydown: "keydown", keyup: "keyup", paste: "paste", click: "click" }, features: [i0.\u0275\u0275ProvidersFeature([
|
|
11158
11172
|
{
|
|
11159
11173
|
provide: NG_VALUE_ACCESSOR,
|
|
11160
11174
|
useExisting: forwardRef(() => _IntlTelInput),
|
|
@@ -11298,6 +11312,12 @@ var IntlTelInput = class _IntlTelInput {
|
|
|
11298
11312
|
type: Output
|
|
11299
11313
|
}], errorCodeChange: [{
|
|
11300
11314
|
type: Output
|
|
11315
|
+
}], openCountryDropdown: [{
|
|
11316
|
+
type: Output
|
|
11317
|
+
}], closeCountryDropdown: [{
|
|
11318
|
+
type: Output
|
|
11319
|
+
}], strictReject: [{
|
|
11320
|
+
type: Output
|
|
11301
11321
|
}], blur: [{
|
|
11302
11322
|
type: Output
|
|
11303
11323
|
}], focus: [{
|
|
@@ -11313,7 +11333,7 @@ var IntlTelInput = class _IntlTelInput {
|
|
|
11313
11333
|
}] });
|
|
11314
11334
|
})();
|
|
11315
11335
|
(() => {
|
|
11316
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0.\u0275setClassDebugInfo(IntlTelInput, { className: "IntlTelInput", filePath: "IntlTelInput.ts", lineNumber:
|
|
11336
|
+
(typeof ngDevMode === "undefined" || ngDevMode) && i0.\u0275setClassDebugInfo(IntlTelInput, { className: "IntlTelInput", filePath: "IntlTelInput.ts", lineNumber: 68 });
|
|
11317
11337
|
})();
|
|
11318
11338
|
var IntlTelInput_default = IntlTelInput;
|
|
11319
11339
|
|
package/dist/js/data.js
CHANGED
package/dist/js/data.min.js
CHANGED
package/dist/js/intlTelInput.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* International Telephone Input v27.
|
|
2
|
+
* International Telephone Input v27.2.0
|
|
3
3
|
* git+https://github.com/jackocnr/intl-tel-input.git
|
|
4
4
|
* Licensed under the MIT license
|
|
5
5
|
*/
|
|
@@ -4603,7 +4603,7 @@ var _factory = (() => {
|
|
|
4603
4603
|
attachUtils,
|
|
4604
4604
|
startedLoadingUtils: false,
|
|
4605
4605
|
startedLoadingAutoCountry: false,
|
|
4606
|
-
version: "27.
|
|
4606
|
+
version: "27.2.0"
|
|
4607
4607
|
}
|
|
4608
4608
|
);
|
|
4609
4609
|
var intlTelInput_default = intlTelInput;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* International Telephone Input v27.
|
|
2
|
+
* International Telephone Input v27.2.0
|
|
3
3
|
* git+https://github.com/jackocnr/intl-tel-input.git
|
|
4
4
|
* Licensed under the MIT license
|
|
5
5
|
*/
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
<svg width="256" height="256" viewBox="0 0 512 512" class="iti__globe-svg">
|
|
22
22
|
<path d="M508 213a240 240 0 0 0-449-87l-2 5-2 5c-8 14-13 30-17 46a65 65 0 0 1 56 4c16-10 35-19 56-27l9-3c-6 23-10 48-10 74h-16l4 6c3 4 5 8 6 13h6c0 22 3 44 8 65l2 10-25-10-4 5 12 18 9 3 6 2 8 3 9 26 1 2 16-7h1l-5-13-1-2c24 6 49 9 75 10v26l11 10 7 7v-30l1-13c22 0 44-3 65-8l10-2-21 48-1 1a317 317 0 0 1-14 23l-21 5h-2c6 16 7 33 1 50a240 240 0 0 0 211-265m-401-56-11 6c19-44 54-79 98-98-11 20-21 44-29 69-21 6-40 15-58 23m154 182v4c-29-1-57-6-81-13-7-25-12-52-13-81h94zm0-109h-94c1-29 6-56 13-81 24-7 52-12 81-13zm0-112c-22 1-44 4-65 8l-10 2 12-30 9-17 1-2a332 332 0 0 1 13-23c13-4 26-6 40-7zm187 69 6 4c4 12 6 25 6 38v1h-68c-1-26-4-51-10-74l48 20 1 1 14 8zm-14-44 10 20c-20-11-43-21-68-29-8-25-18-49-29-69 37 16 67 44 87 78M279 49h1c13 1 27 3 39 7l14 23 1 2a343 343 0 0 1 12 26l2 5 6 16c-23-6-48-9-74-10h-1zm0 87h1c29 1 56 6 81 13 7 24 12 51 12 80v1h-94zm2 207h-2v-94h95c-1 29-6 56-13 81-24 7-51 12-80 13m86 60-20 10c11-20 21-43 29-68 25-8 48-18 68-29-16 37-43 67-77 87m87-115-7 5-16 9-2 1a337 337 0 0 1-47 21c6-24 9-49 10-75h68c0 13-2 27-6 39"/>
|
|
23
23
|
<path d="m261 428-2-2-22-21a40 40 0 0 0-32-11h-1a37 37 0 0 0-18 8l-1 1-4 2-2 2-5 4c-9-3-36-31-47-44s-32-45-34-55l3-2a151 151 0 0 0 11-9v-1a39 39 0 0 0 5-48l-3-3-11-19-3-4-5-7h-1l-3-3-4-3-5-2a35 35 0 0 0-16-3h-5c-4 1-14 5-24 11l-4 2-4 3-4 2c-9 8-17 17-18 27a380 380 0 0 0 212 259h3c12 0 25-10 36-21l10-12 6-11a39 39 0 0 0-8-40"/>
|
|
24
|
-
</svg>`;var yt=(n,t)=>{let e=W(t),i=[],s=[],o=[],l=[],r=[],a=[];for(let c of n)c.iso2===e?i.push(c):c.normalisedName.startsWith(e)?s.push(c):c.normalisedName.includes(e)?o.push(c):e===c.dialCode||e===c.dialCodePlus?l.push(c):c.dialCodePlus.includes(e)?r.push(c):c.initials.includes(e)&&a.push(c);let p=(c,m)=>c.priority-m.priority;return[...i,...s,...o,...l.sort(p),...r.sort(p),...a]},Et=(n,t)=>{let e=W(t);for(let i of n)if(i.normalisedName.startsWith(e))return i;return null};var P=class n{#t;#i;#v;#E="";#I;#A=null;#_;#m;#e;#c;#g;#o;#s;#f;#r;#u;#n;#a;#d;#T;#H;#l;#C=null;#h=null;#O=new Map;#N=null;telInputEl;hadInitialPlaceholder;constructor(t,e,i){t.dataset[A.INSTANCE_ID]=i.toString(),this.telInputEl=t,this.#t=e,this.#i=i,this.hadInitialPlaceholder=!!t.getAttribute("placeholder"),this.#v=!!this.telInputEl.closest("[dir=rtl]"),this.#E=this.telInputEl.style.paddingLeft}static validateInput(t){let e=t?.tagName;if(!(!!t&&typeof t=="object"&&e==="INPUT"&&typeof t.setAttribute=="function")){let s=Object.prototype.toString.call(t);throw new TypeError(`The first argument must be an HTMLInputElement, not ${s}`)}}buildMarkup(t){this.#I=t,this.telInputEl.classList.add("iti__tel-input"),this.telInputEl.hasAttribute("type")||this.telInputEl.setAttribute("type","tel"),this.telInputEl.hasAttribute("autocomplete")||this.telInputEl.setAttribute("autocomplete","tel"),this.telInputEl.hasAttribute("inputmode")||this.telInputEl.setAttribute("inputmode","tel");let e=this.#k();this.#U(e),e.appendChild(this.telInputEl),this.#q(),this.#J(e),this.ensureDropdownWidthSet()}#k(){let{allowDropdown:t,showFlags:e,containerClass:i,useFullscreenPopup:s}=this.#t,o=G({iti:!0,"iti--allow-dropdown":t,"iti--show-flags":e,"iti--inline-dropdown":!s,[i]:!!i}),l=f("div",{class:o});return this.#v&&l.setAttribute("dir","ltr"),this.telInputEl.before(l),l}#U(t){let{allowDropdown:e,separateDialCode:i,showFlags:s}=this.#t;if(!e&&!s&&!i)return;this.#m=f("div",{class:`iti__country-container ${d.V_HIDE}`},t),e?(this.#e=f("button",{type:"button",class:"iti__selected-country",[h.EXPANDED]:"false",[h.LABEL]:this.#t.i18n.noCountrySelected,[h.HASPOPUP]:"dialog",[h.CONTROLS]:`iti-${this.#i}__dropdown-content`},this.#m),this.telInputEl.disabled&&this.#e.setAttribute("disabled","true")):this.#e=f("div",{class:"iti__selected-country"},this.#m);let o=f("div",{class:"iti__selected-country-primary"},this.#e);this.#c=f("div",{class:d.FLAG},o),e&&(this.#o=f("div",{class:"iti__arrow",[h.HIDDEN]:"true"},o)),i&&(this.#g=f("div",{class:"iti__selected-dial-code"},this.#e)),e&&this.#z()}ensureDropdownWidthSet(){let{fixDropdownWidth:t,allowDropdown:e}=this.#t;if(!e||!t||this.#s.style.width)return;let i=this.telInputEl.offsetWidth;i>0&&(this.#s.style.width=`${i}px`)}#z(){let{fixDropdownWidth:t,useFullscreenPopup:e,countrySearch:i,i18n:s,dropdownContainer:o,containerClass:l}=this.#t,r=t?"":"iti--flexible-dropdown-width";if(this.#s=f("div",{id:`iti-${this.#i}__dropdown-content`,class:`iti__dropdown-content ${d.HIDE} ${r}`,role:"dialog",[h.MODAL]:"true"}),this.#v&&this.#s.setAttribute("dir","rtl"),i&&this.#X(),this.#n=f("ul",{class:"iti__country-list",id:`iti-${this.#i}__country-listbox`,role:"listbox",[h.LABEL]:s.countryListAriaLabel},this.#s),this.#Q(),i&&this.#B(),e||(this.#_=this.#tt(),i&&(this.#s.style.height=`${this.#_}px`)),o){let a=G({iti:!0,"iti--container":!0,"iti--fullscreen-popup":e,"iti--inline-dropdown":!e,[l]:!!l});this.#l=f("div",{class:a}),this.#l.appendChild(this.#s)}else this.#m.appendChild(this.#s)}#X(){let{i18n:t,searchInputClass:e}=this.#t,i=f("div",{class:"iti__search-input-wrapper"},this.#s);this.#f=f("span",{class:"iti__search-icon",[h.HIDDEN]:"true"},i),this.#f.innerHTML=ft(),this.#r=f("input",{id:`iti-${this.#i}__search-input`,type:"search",class:`iti__search-input ${e}`,placeholder:t.searchPlaceholder,role:"combobox",[h.EXPANDED]:"true",[h.LABEL]:t.searchPlaceholder,[h.CONTROLS]:`iti-${this.#i}__country-listbox`,[h.AUTOCOMPLETE]:"list",autocomplete:"off"},i),this.#u=f("button",{type:"button",class:`iti__search-clear ${d.HIDE}`,[h.LABEL]:t.clearSearchAriaLabel,tabindex:"-1"},i),this.#u.innerHTML=mt(this.#i),this.#H=f("span",{class:"iti__a11y-text"},this.#s),this.#T=f("div",{class:`iti__no-results ${d.HIDE}`,[h.HIDDEN]:"true"},this.#s),this.#T.textContent=t.searchEmptyState??null}#q(){this.#m&&(this.#W(),this.#m.classList.remove(d.V_HIDE))}#J(t){let{hiddenInput:e}=this.#t;if(!e)return;let i=this.telInputEl.getAttribute("name")||"",s=e(i);if(s.phone){let o=this.telInputEl.form?.querySelector(`input[name="${s.phone}"]`);o?this.#a=o:(this.#a=f("input",{type:"hidden",name:s.phone}),t.appendChild(this.#a))}if(s.country){let o=this.telInputEl.form?.querySelector(`input[name="${s.country}"]`);o?this.#d=o:(this.#d=f("input",{type:"hidden",name:s.country}),t.appendChild(this.#d))}}#Q(){let t=document.createDocumentFragment();for(let e=0;e<this.#I.length;e++){let i=this.#I[e],s=G({[d.COUNTRY_ITEM]:!0}),o=f("li",{id:`iti-${this.#i}__item-${i.iso2}`,class:s,tabindex:"-1",role:"option",[h.SELECTED]:"false"});o.dataset[A.DIAL_CODE]=i.dialCode,o.dataset[A.ISO2]=i.iso2,this.#O.set(i.iso2,o),this.#t.showFlags&&f("div",{class:`${d.FLAG} iti__${i.iso2}`},o);let l=f("span",{class:"iti__country-name"},o);l.textContent=`${i.name} `;let r=f("span",{class:"iti__dial-code"},l);this.#v&&r.setAttribute("dir","ltr"),r.textContent=`(+${i.dialCode})`,t.appendChild(o)}this.#n.appendChild(t)}#W(){if(this.#e){let t=this.#t.separateDialCode?L.FALLBACK_SELECTED_WITH_DIAL_WIDTH:L.FALLBACK_SELECTED_NO_DIAL_WIDTH,i=(this.#e.offsetWidth||this.#Z()||t)+L.INPUT_PADDING_EXTRA_LEFT;this.telInputEl.style.paddingLeft=`${i}px`}}static#$(){let t;try{t=window.top.document.body}catch{t=document.body}return t}#Z(){if(!this.telInputEl.parentNode)return 0;let t=n.#$(),e=this.telInputEl.parentNode.cloneNode(!1);e.style.visibility="hidden",t.appendChild(e);let i=this.#m.cloneNode();e.appendChild(i);let s=this.#e.cloneNode(!0);i.appendChild(s);let o=s.offsetWidth;return t.removeChild(e),o}#tt(){let t=n.#$();this.#s.classList.remove(d.HIDE);let e=f("div",{class:"iti iti--inline-dropdown"});e.appendChild(this.#s),e.style.visibility="hidden",t.appendChild(e);let i=this.#s.offsetHeight;return t.removeChild(e),e.style.visibility="",this.#s.classList.add(d.HIDE),i>0?i:L.FALLBACK_DROPDOWN_HEIGHT}#B(){let{i18n:t}=this.#t,e=this.#n.childElementCount;this.#H.textContent=t.searchSummaryAria(e)}#F(t){let e;t===""?e=this.#I:e=yt(this.#I,t),this.#D(e)}prefillSearchWithPlus(){this.#r.value="+",this.#r.focus(),this.#F("")}#P(){let t=this.#r.value.trim();this.#F(t),this.#r.value?this.#u.classList.remove(d.HIDE):this.#u.classList.add(d.HIDE)}#p(){this.#A&&clearTimeout(this.#A),this.#A=setTimeout(()=>{this.#P(),this.#A=null},J.SEARCH_DEBOUNCE_MS)}#R(){this.#r.value="",this.#r.focus(),this.#P()}#w(t){let e=this.#n,i=e.getBoundingClientRect(),s=t.getBoundingClientRect(),o=s.top-i.top+e.scrollTop;s.top<i.top?e.scrollTop=o:s.bottom>i.bottom&&(e.scrollTop=o-i.height+s.height)}#y(t,e=!0){if(this.#h?.classList.remove(d.HIGHLIGHT),t){if(t.classList.add(d.HIGHLIGHT),this.#t.countrySearch){let i=t.getAttribute("id")||"";this.#r.setAttribute(h.ACTIVE_DESCENDANT,i)}e&&this.#w(t),this.#h=t}else this.#h=null}bindHiddenInputSubmitListener(t,e,i){let s=this.telInputEl.form;!s||!this.#a&&!this.#d||s.addEventListener("submit",()=>{this.#a&&(this.#a.value=e()),this.#d&&(this.#d.value=i())},{signal:t})}bindAllInitialDropdownListeners(t,e,i){let s=this.telInputEl.closest("label");s&&s.addEventListener("click",o=>{this.isDropdownOpen()?o.preventDefault():this.telInputEl.focus()},{signal:t}),this.#e.addEventListener("click",()=>{!this.isDropdownOpen()&&!this.telInputEl.disabled&&!this.telInputEl.readOnly&&e()},{signal:t}),this.#m.addEventListener("keydown",o=>{let l=[C.ARROW_UP,C.ARROW_DOWN,C.SPACE,C.ENTER];!this.isDropdownOpen()&&l.includes(o.key)&&(o.preventDefault(),o.stopPropagation(),e()),o.key===C.TAB&&i()},{signal:t})}openDropdown(t,e){let{countrySearch:i,dropdownAlwaysOpen:s,dropdownContainer:o}=this.#t;if(this.#N=new AbortController,this.ensureDropdownWidthSet(),o)this.#L();else{let r=this.#x(),a=this.telInputEl.offsetHeight+L.DROPDOWN_MARGIN;r?this.#s.style.top=`${a}px`:this.#s.style.bottom=`${a}px`}this.#s.classList.remove(d.HIDE),this.#e.setAttribute(h.EXPANDED,"true");let l=this.#C??this.#n.firstElementChild;l&&this.#y(l),i&&!s&&this.#r.focus(),this.#t.useFullscreenPopup&&this.#l&&window.visualViewport&&window.visualViewport.addEventListener("resize",()=>{this.#K(),this.#h&&this.#w(this.#h)},{signal:this.#N.signal}),this.#o.classList.add(d.ARROW_UP),this.#et(t,e)}#et(t,e){let i=this.#N.signal;this.#j(i),this.#it(i,t),this.#t.dropdownAlwaysOpen||this.#b(i,e),this.#V(i,t,e),this.#t.countrySearch&&this.#M(i),!this.#t.useFullscreenPopup&&this.#t.dropdownContainer&&window.addEventListener("scroll",e,{signal:i})}#j(t){this.#n.addEventListener("mouseover",e=>{let i=e.target?.closest(`.${d.COUNTRY_ITEM}`);i&&this.#y(i,!1)},{signal:t})}#it(t,e){this.#n.addEventListener("click",i=>{let s=i.target?.closest(`.${d.COUNTRY_ITEM}`);s&&e(s)},{signal:t})}#b(t,e){setTimeout(()=>{document.documentElement.addEventListener("click",i=>{this.#s.contains(i.target)||e()},{signal:t})},0)}#V(t,e,i){let s="",o=null,l=r=>{[C.ARROW_UP,C.ARROW_DOWN,C.ENTER,C.ESC].includes(r.key)&&(r.preventDefault(),r.stopPropagation(),r.key===C.ARROW_UP||r.key===C.ARROW_DOWN?this.#S(r.key):r.key===C.ENTER&&!r.isComposing?e(this.#h):r.key===C.ESC&&(i(),this.#e.focus())),!this.#t.countrySearch&&r.target!==this.telInputEl&&v.HIDDEN_SEARCH_CHAR.test(r.key)&&(r.stopPropagation(),o&&clearTimeout(o),s+=r.key.toLowerCase(),this.#st(s),o=setTimeout(()=>{s=""},J.HIDDEN_SEARCH_RESET_MS))};document.addEventListener("keydown",l,{signal:t})}#M(t){this.#r.addEventListener("input",()=>this.#p(),{signal:t}),this.#u.addEventListener("click",()=>this.#R(),{signal:t})}#st(t){let e=Et(this.#I,t);if(e){let i=this.#O.get(e.iso2);this.#y(i)}}#S(t){let e=t===C.ARROW_UP?this.#h?.previousElementSibling:this.#h?.nextElementSibling;!e&&this.#n.childElementCount>1&&(e=t===C.ARROW_UP?this.#n.lastElementChild:this.#n.firstElementChild),e&&this.#y(e)}#G(t){if(this.#C&&this.#C.dataset[A.ISO2]!==t&&(this.#C.setAttribute(h.SELECTED,"false"),this.#C.querySelector(".iti__country-check")?.remove(),this.#C=null),t&&!this.#C){let e=this.#n.querySelector(`[data-country-code="${t}"]`);if(e){e.setAttribute(h.SELECTED,"true");let i=f("span",{class:"iti__country-check",[h.HIDDEN]:"true"},e);i.innerHTML=Ct(),this.#C=e,this.#t.dropdownAlwaysOpen&&this.#y(e)}}}#D(t){this.#n.replaceChildren();let e=!0;for(let i of t){let s=this.#O.get(i.iso2);s&&(this.#n.appendChild(s),e&&(this.#y(s,!1),e=!1))}e?(this.#y(null),this.#T&&this.#T.classList.remove(d.HIDE)):this.#T&&this.#T.classList.add(d.HIDE),this.#n.scrollTop=0,this.#B()}closeDropdown(){let{countrySearch:t,dropdownContainer:e}=this.#t;this.#N.abort(),this.#N=null,this.#s.classList.add(d.HIDE),this.#e.setAttribute(h.EXPANDED,"false"),t&&(this.#r.removeAttribute(h.ACTIVE_DESCENDANT),this.#r.value="",this.#P(),this.#h&&(this.#h.classList.remove(d.HIGHLIGHT),this.#h=null)),this.#o.classList.remove(d.ARROW_UP),e?(this.#l.remove(),this.#l.style.top="",this.#l.style.bottom="",this.#l.style.paddingLeft="",this.#l.style.paddingRight=""):(this.#s.style.top="",this.#s.style.bottom="")}#x(){if(this.#t.dropdownAlwaysOpen)return!0;let t=this.telInputEl.getBoundingClientRect(),e=t.top,i=window.innerHeight-t.bottom;return i>=this.#_||i>=e}#L(){let{dropdownContainer:t,useFullscreenPopup:e}=this.#t;if(e){if(window.innerWidth>=L.NARROW_VIEWPORT_WIDTH){let i=this.telInputEl.getBoundingClientRect();this.#l.style.paddingLeft=`${i.left}px`,this.#l.style.paddingRight=`${window.innerWidth-i.right}px`}}else{let i=this.telInputEl.getBoundingClientRect();this.#l.style.left=`${i.left}px`,this.#x()?this.#l.style.top=`${i.bottom+L.DROPDOWN_MARGIN}px`:(this.#l.style.top="unset",this.#l.style.bottom=`${window.innerHeight-i.top+L.DROPDOWN_MARGIN}px`)}t.appendChild(this.#l)}#K(){let t=window.visualViewport;if(!t||!this.#l)return;let e=window.innerHeight-t.height;this.#l.style.bottom=`${e}px`}isDropdownOpen(){return!this.#s.classList.contains(d.HIDE)}setLoading(t){this.#c.classList.toggle(d.LOADING,t)}isLoading(){return this.#c.classList.contains(d.LOADING)}setDisabled(t){this.telInputEl.disabled=t,this.#e&&(t?this.#e.setAttribute("disabled","true"):this.#e.removeAttribute("disabled"))}setReadonly(t){this.telInputEl.readOnly=t,this.#e&&(t?this.#e.setAttribute("disabled","true"):this.#e.removeAttribute("disabled"))}setCountry(t){let{allowDropdown:e,showFlags:i,separateDialCode:s,i18n:o}=this.#t,l=t?.name,r=t?.dialCode,a=t?.iso2??"";if(e&&this.#G(a),this.#e){let p=a&&i?`${d.FLAG} iti__${a}`:`${d.FLAG} ${d.GLOBE}`,c,m,y;a?(m=l,c=o.selectedCountryAriaLabel.replace("${countryName}",l).replace("${dialCode}",`+${r}`),y=i?"":tt()):(m=o.noCountrySelected,c=o.noCountrySelected,y=tt()),this.#c.className=p,this.#e.setAttribute("title",m),this.#e.setAttribute(h.LABEL,c),this.#c.innerHTML=y}if(s){let p=r?`+${r}`:"";this.#g.textContent=p,this.#W()}}destroy(){this.telInputEl.iti=void 0,delete this.telInputEl.dataset[A.INSTANCE_ID],this.telInputEl.style.paddingLeft=this.#E;let t=this.telInputEl.parentNode;t&&(t.before(this.telInputEl),t.remove()),this.#O.clear()}};var gt=n=>{let{onlyCountries:t,excludeCountries:e}=n;return t?.length?O.filter(i=>t.includes(i.iso2)):e?.length?O.filter(i=>!e.includes(i.iso2)):[...O]},bt=(n,t)=>{let{countryNameLocale:e,i18n:i}=t,s;try{typeof Intl<"u"&&typeof Intl.DisplayNames=="function"?s=new Intl.DisplayNames(e,{type:"region"}):s=null}catch(o){console.error(o),s=null}for(let o of n)o.name=i[o.iso2]||s?.of(o.iso2.toUpperCase())||""},It=n=>{let t=new Set,e=0,i={},s=(l,r)=>{if(!l||!r)return;r.length>e&&(e=r.length),Object.hasOwn(i,r)||(i[r]=[]);let a=i[r];a.includes(l)||a.push(l)},o=[...n].sort((l,r)=>l.priority-r.priority);for(let l of o){t.has(l.dialCode)||t.add(l.dialCode);for(let r=1;r<l.dialCode.length;r++){let a=l.dialCode.substring(0,r);s(l.iso2,a)}if(s(l.iso2,l.dialCode),l.areaCodes){let r=i[l.dialCode][0];for(let a of l.areaCodes){for(let p=1;p<a.length;p++){let c=a.substring(0,p),m=l.dialCode+c;s(r,m),s(l.iso2,m)}s(l.iso2,l.dialCode+a)}}}return{dialCodes:t,dialCodeMaxLength:e,dialCodeToIso2Map:i}},Lt=(n,t)=>{let{countryOrder:e}=t;n.sort((i,s)=>{if(e){let o=e.indexOf(i.iso2),l=e.indexOf(s.iso2),r=o>-1,a=l>-1;if(r||a)return r&&a?o-l:r?-1:1}return i.name.localeCompare(s.name)})},vt=n=>{for(let t of n)t.normalisedName=W(t.name),t.initials=t.normalisedName.split(/[^a-z]/).map(e=>e[0]).join(""),t.dialCodePlus=`+${t.dialCode}`};var $t=new Set(["800","808","870","881","882","883","888","979"]),et=n=>{let t=w(n).slice(0,3);return n.startsWith("+")&&$t.has(t)};var it=(n,t,e,i)=>{if(!e||!t)return n;let s=`+${i.dialCode}`,o=n[s.length]===" "||n[s.length]==="-"?s.length+1:s.length;return n.substring(o)},At=(n,t,e,i,s)=>{let o=e?e.formatNumberAsYouType(n,i?.iso2):n,l=i?.dialCode;return s&&t.charAt(0)!=="+"&&o.includes(`+${l}`)?(o.split(`+${l}`)[1]||"").trim():o};var Tt=(n,t,e,i)=>{if(e===0&&!i)return 0;let s=0;for(let o=0;o<t.length;o++){if(/[+0-9]/.test(t[o])&&s++,s===n&&!i)return o+1;if(i&&s===n+1)return o}return t.length};var Bt=new Set(["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"]),st=n=>{let t=w(n);if(t.startsWith(B.NANP)&&t.length>=4){let e=t.substring(1,4);return Bt.has(e)}return!1};var K=class{#t;constructor(t){t&&this.#i(t)}#i(t){/[\u0660-\u0669]/.test(t)?this.#t="arabic-indic":/[\u06F0-\u06F9]/.test(t)?this.#t="persian":this.#t="ascii"}denormalise(t){if(!this.#t||this.#t==="ascii")return t;let e=this.#t==="arabic-indic"?1632:1776;return t.replace(/[0-9]/g,i=>String.fromCharCode(e+Number(i)))}normalise(t){if(!t)return"";if(this.#i(t),this.#t==="ascii")return t;let e=this.#t==="arabic-indic"?1632:1776,i=this.#t==="arabic-indic"?/[\u0660-\u0669]/g:/[\u06F0-\u06F9]/g;return t.replace(i,s=>String.fromCharCode(48+(s.charCodeAt(0)-e)))}isAscii(){return!this.#t||this.#t==="ascii"}};var Ft=0,R=n=>{if(!u.utils)throw new Error(`intlTelInput.utils is required for ${n}(). See: https://intl-tel-input.com/docs/utils`)},wt=()=>{let n,t;return{promise:new Promise((i,s)=>{n=i,t=s}),resolve:n,reject:t}},M=class n{id;promise;#t;#i;#v;#E;#I;#A;#_;#m;#e=null;#c=null;#g;#o=!0;#s;#f;#r=!1;#u;#n;constructor(t,e={}){this.id=Ft++,P.validateInput(t);let i=dt(e);this.#i={...V,...i},ht(this.#i),pt(this.#i),this.#t=new P(t,this.#i,this.id),this.#v=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),this.#f=new K(t.value),this.promise=this.#T(this.#i),this.#E=gt(this.#i);let{dialCodes:s,dialCodeMaxLength:o,dialCodeToIso2Map:l}=It(this.#E);this.#_=s,this.#I=o,this.#A=l,this.#m=new Map(this.#E.map(r=>[r.iso2,r])),this.#H()}#a(){let t=this.#t.telInputEl.value.trim();return this.#f.normalise(t)}#d(t){this.#t.telInputEl.value=this.#f.denormalise(t)}#T(t){let{initialCountry:e,geoIpLookup:i,loadUtils:s}=t,o=e===k.AUTO&&!!i,l=!!s&&!u.utils;return o&&(this.#u=wt()),l&&(this.#n=wt()),Promise.all([this.#u?.promise,this.#n?.promise]).then(()=>{})}#H(){this.#s=new AbortController,this.#l(),this.#t.buildMarkup(this.#E),this.#C(),this.#h(),this.#O(),this.#i.dropdownAlwaysOpen&&this.#R()}#l(){bt(this.#E,this.#i),Lt(this.#E,this.#i),vt(this.#E)}#C(t=!1){let e=this.#t.telInputEl.getAttribute("value"),i=this.#f.normalise(e??""),s=this.#a(),l=i&&i.startsWith("+")&&(!s||!s.startsWith("+"))?i:s,r=this.#D(l),a=st(l),{initialCountry:p,geoIpLookup:c}=this.#i,m=p===k.AUTO&&c,y=m&&u.autoCountry?u.autoCountry:p,T=m&&!t&&!u.autoCountry,I=N(y);r?a?I?this.#b(y):T||this.#b(nt.ISO2):(I&&this.#b(y),this.#y(l)):I?this.#b(y):T||this.#b(""),l&&this.#w(l)}#h(){this.#z(),this.#i.allowDropdown&&this.#t.bindAllInitialDropdownListeners(this.#s.signal,()=>this.#R(),()=>this.#S()),this.#t.bindHiddenInputSubmitListener(this.#s.signal,()=>this.getNumber(),()=>this.#e?.iso2||"")}#O(){if(this.#n){let{loadUtils:t}=this.#i,e=()=>{u.attachUtils(t)?.catch(()=>{})};u.documentReady()?e():window.addEventListener("load",e,{signal:this.#s.signal})}this.#u&&(this.#e?this.#u.resolve():this.#N())}#N(){if(u.autoCountry){this.#ot();return}if(this.#t.setLoading(!0),!u.startedLoadingAutoCountry&&(u.startedLoadingAutoCountry=!0,typeof this.#i.geoIpLookup=="function")){let t=(i="")=>{let s=i.toLowerCase();N(s)?(u.autoCountry=s,setTimeout(()=>n.forEachInstance("handleAutoCountryLoaded"))):n.forEachInstance("handleAutoCountryFailure")},e=()=>{n.forEachInstance("handleAutoCountryFailure")};this.#i.geoIpLookup(t,e)}}#k(){this.#R(),this.#t.prefillSearchWithPlus()}#U(t){let e=this.#t.telInputEl.selectionStart||0,i=t.substring(0,e-1),s=t.substring(e);return this.#d(i+s),e-1}#z(){this.#W(),this.#Z(),this.#B()}#X(t){this.#U(t),this.#k()}#q(t,e){let i=this.#U(t);this.#t.telInputEl.setSelectionRange(i,i),this.#p(b.STRICT_REJECT,{source:"key",rejectedInput:e,reason:"invalid"})}#J(t,e){let i=this.#t.telInputEl.selectionStart||0,o=t.substring(0,i).replace(v.NON_PLUS_NUMERIC_GLOBAL,"").length,l=this.#L(),r=At(l,t,u.utils,this.#e,this.#i.separateDialCode),a=Tt(o,r,i,e);this.#d(r),this.#t.telInputEl.setSelectionRange(a,a)}#Q(t){if(t.startsWith("+")&&this.#e&&this.#D(t)){let e=it(t,!0,!0,this.#e);this.#d(e)}}#W(){this.#r=v.ALPHA_UNICODE.test(this.#a()),this.#t.telInputEl.addEventListener("input",this.#$,{signal:this.#s.signal})}#$=t=>{let{strictMode:e,formatAsYouType:i,separateDialCode:s,allowDropdown:o,countrySearch:l}=this.#i,r=t?.detail;if(r?.isCountryChange)return;let a=this.#a();if(this.#v&&t?.data==="+"&&s&&o&&l){this.#X(a);return}if(this.#v&&e&&(t?.data===" "||t?.data==="-"||t?.data===".")){this.#q(a,t.data);return}this.#y(a)&&this.#Y();let p=t?.data&&v.NON_PLUS_NUMERIC.test(t.data),c=t?.inputType===q.PASTE&&a;p||c&&!e?this.#r=!0:v.NON_PLUS_NUMERIC.test(a)||(this.#r=!1),i&&!this.#r&&!r?.isSetNumber&&this.#f.isAscii()&&this.#J(a,t?.inputType===q.DELETE_FORWARD),s&&this.#Q(a)};#Z(){let{strictMode:t,separateDialCode:e}=this.#i;!t&&!e||this.#t.telInputEl.addEventListener("keydown",this.#tt,{signal:this.#s.signal})}#tt=t=>{let{strictMode:e,separateDialCode:i,allowDropdown:s,countrySearch:o}=this.#i;if(!t.key||t.key.length!==1||t.altKey||t.ctrlKey||t.metaKey)return;if(i&&s&&o&&t.key==="+"){t.preventDefault(),this.#k();return}if(!e)return;let l=this.#a(),a=!l.startsWith("+")&&this.#t.telInputEl.selectionStart===0&&t.key==="+",p=this.#f.normalise(t.key),c=/^[0-9]$/.test(p),m=i?c:a||c,y=this.#t.telInputEl,T=y.selectionStart,I=y.selectionEnd,$=l.slice(0,T??void 0),x=l.slice(I??void 0),g=$+p+x,D=this.#x(g),H=!1;u.utils&&this.#c&&(H=u.utils.getCoreNumber(D,this.#e?.iso2).length>this.#c);let Y=this.#j(D)!==null;(!m||H&&!Y&&!a)&&(this.#p(b.STRICT_REJECT,{source:"key",rejectedInput:t.key,reason:m?"max-length":"invalid"}),t.preventDefault())};#B(){this.#i.strictMode&&this.#t.telInputEl.addEventListener("paste",this.#F,{signal:this.#s.signal})}#F=t=>{t.preventDefault();let e=this.#t.telInputEl,i=e.selectionStart,s=e.selectionEnd,o=this.#a(),l=o.slice(0,i??void 0),r=o.slice(s??void 0),a=this.#e?.iso2,p=t.clipboardData.getData("text"),c=this.#f.normalise(p),m=i===0&&s>0,y=!o.startsWith("+")||m,T=c.replace(v.NON_PLUS_NUMERIC_GLOBAL,""),I=T.startsWith("+"),$=T.replace(/\+/g,""),x=I&&y?`+${$}`:$,g=l+x+r,D=x!==c?"invalid":null;if(g.length>5&&u.utils){let _=u.utils.getCoreNumber(g,a);for(;_.length===0&&g.length>0;)g=g.slice(0,-1),_=u.utils.getCoreNumber(g,a);if(!_){this.#p(b.STRICT_REJECT,{source:"paste",rejectedInput:p,reason:"max-length"});return}if(this.#c&&_.length>this.#c)if(e.selectionEnd===o.length){let Y=_.length-this.#c;g=g.slice(0,g.length-Y),D="max-length"}else{this.#p(b.STRICT_REJECT,{source:"paste",rejectedInput:p,reason:"max-length"});return}}this.#d(g);let H=i+x.length;e.setSelectionRange(H,H),e.dispatchEvent(new InputEvent("input",{bubbles:!0})),D&&this.#p(b.STRICT_REJECT,{source:"paste",rejectedInput:p,reason:D})};#P(t){let e=Number(this.#t.telInputEl.getAttribute("maxlength"));return e&&t.length>e?t.substring(0,e):t}#p(t,e={}){let i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:e});this.#t.telInputEl.dispatchEvent(i)}#R(){this.#t.openDropdown(t=>this.#st(t),()=>this.#S()),this.#p(b.OPEN_COUNTRY_DROPDOWN)}#w(t){let{formatOnDisplay:e,nationalMode:i,separateDialCode:s}=this.#i,o=t;if(e&&u.utils&&this.#e){let l=et(t),r=i&&!l||!o.startsWith("+")&&!s,{NATIONAL:a,INTERNATIONAL:p}=u.utils.numberFormat,c=r?a:p;o=u.utils.formatNumber(o,this.#e?.iso2,c)}o=this.#K(o),this.#d(o)}#y(t){let e=this.#j(t);return e!==null?this.#b(e):!1}#et(t){let e=this.#e?.dialCode,i=this.#e?.nationalPrefix;if(t.startsWith("+")||!e)return t;let l=i&&t.startsWith(i)&&!this.#i.separateDialCode?t.substring(1):t;return`+${e}${l}`}#j(t){let e=t.indexOf("+"),i=e>0?t.substring(e):t,s=this.#e?.iso2;i=this.#et(i);let o=this.#D(i,!0),l=w(i);if(o){let r=w(o),a=this.#A[r];return a.length===1?a[0]===s?null:a[0]:this.#it(a,r,l)}else if(i.startsWith("+")&&l.length){let r=this.#e?.dialCode||"";return r&&r.startsWith(l)?null:""}else if((!i||i==="+")&&!s&&this.#g)return this.#g;return null}#it(t,e,i){let s=this.#e?.iso2,o=this.#e?.dialCode;if(!s&&this.#g&&t.includes(this.#g))return this.#g;if(o===B.NANP&&st(i))return null;let r=this.#e?.areaCodes,a=this.#e?.priority;if(r){let T=r.map(I=>`${o}${I}`);for(let I of T)if(i.startsWith(I))return null}let c=r&&!(a===0)&&i.length>e.length,m=s&&t.includes(s)&&!c,y=s===t[0];return!m&&!y?t[0]:null}#b(t){let e=this.#e?.iso2||"";return this.#e=t?this.#m.get(t):null,this.#e&&(this.#g=this.#e.iso2),this.#t.setCountry(this.#e),this.#M(),this.#V(),e!==t}#V(){let{strictMode:t,placeholderNumberType:e,allowedNumberTypes:i}=this.#i;if(!t||!u.utils)return;let s=this.#e?.iso2;if(!s){this.#c=null;return}let o=u.utils.numberType[e],l=u.utils.getExampleNumber(s,!1,o,!0),r=l;for(;u.utils.isPossibleNumber(l,s,i);)r=l,l+="0";let a=u.utils.getCoreNumber(r,s);this.#c=a.length,s==="by"&&(this.#c=a.length+1)}#M(){let{autoPlaceholder:t,placeholderNumberType:e,nationalMode:i,customPlaceholder:s}=this.#i,o=t===S.AGGRESSIVE||!this.#t.hadInitialPlaceholder&&t===S.POLITE;if(!u.utils||!o)return;let l=u.utils.numberType[e],r=this.#e?u.utils.getExampleNumber(this.#e.iso2,i,l):"";r=this.#K(r),typeof s=="function"&&(r=s(r,this.#e)),this.#t.telInputEl.setAttribute("placeholder",r)}#st(t){if(!t)return;let e=t.dataset[A.ISO2],i=this.#b(e);this.#S();let s=t.dataset[A.DIAL_CODE];if(this.#G(s),this.#i.formatOnDisplay){let o=this.#a();this.#w(o)}this.#t.telInputEl.focus(),i&&(this.#Y(),this.#p(b.INPUT,{isCountryChange:!0}))}#S(t){!this.#t.isDropdownOpen()||this.#i.dropdownAlwaysOpen&&!t||(this.#t.closeDropdown(),this.#p(b.CLOSE_COUNTRY_DROPDOWN))}#G(t){let e=this.#a();if(!e.startsWith("+"))return;let i=`+${t}`,s=this.#D(e),o;s?o=e.replace(s,i):o=i,this.#d(o)}#D(t,e){if(!t.startsWith("+"))return"";let i="",s="",o=!1;for(let l=0;l<t.length;l++){let r=t.charAt(l);if(!/[0-9]/.test(r))continue;if(s+=r,!!!this.#A[s])break;if(this.#_.has(s)){if(i=t.substring(0,l+1),o=!0,!e)break}else e&&o&&(i=t.substring(0,l+1));if(s.length===this.#I)break}return i}#x(t){let e=this.#e?.dialCode,i=w(t);return(this.#i.separateDialCode&&!t.startsWith("+")&&e&&i?`+${e}`:"")+t}#L(){let t=this.#a();return this.#x(t)}#K(t){let e=!!this.#D(t),i=it(t,e,this.#i.separateDialCode,this.#e);return this.#P(i)}#nt(){let t=this.#e;if(!t)return null;let{iso2:e,dialCode:i,name:s}=t;return{iso2:e,dialCode:i,name:s}}#Y(){let t=this.#nt();this.#p(b.COUNTRY_CHANGE,t)}#ot(){if(!(!this.#u||!u.autoCountry)){if(!this.#o){this.#u.resolve();return}this.#t.isLoading()?this.setCountry(u.autoCountry):this.#g=u.autoCountry,this.#t.setLoading(!1),this.#u.resolve()}}#rt(){if(!this.#o){this.#u?.reject();return}this.#C(!0),this.#t.setLoading(!1),this.#u?.reject()}#at(){if(!this.#o){this.#n?.resolve();return}if(!u.utils){this.#n?.resolve();return}let t=this.#a();t&&this.#w(t),this.#e&&(this.#M(),this.#V()),this.#n?.resolve()}#ut(t){if(!this.#o){this.#n?.reject(t);return}this.#n?.reject(t)}destroy(){this.#o&&(this.#o=!1,this.#i.allowDropdown&&this.#S(!0),this.#s.abort(),this.#t.destroy(),u.instances.delete(String(this.id)))}isActive(){return this.#o}getExtension(){return this.#o?(R("getExtension"),u.utils.getExtension(this.#L(),this.#e?.iso2)):""}getNumber(t){if(!this.#o)return"";R("getNumber");let e=this.#e?.iso2,i=this.#L(),s=u.utils.formatNumber(i,e,t);return this.#f.denormalise(s)}getNumberType(){return this.#o?(R("getNumberType"),u.utils.getNumberType(this.#L(),this.#e?.iso2)):Q.UNKNOWN_NUMBER_TYPE}getSelectedCountryData(){return this.#nt()}getValidationError(){if(!this.#o)return Q.UNKNOWN_VALIDATION_ERROR;R("getValidationError");let t=this.#e?.iso2;return u.utils.getValidationError(this.#L(),t)}isValidNumber(){if(!this.#o)return null;R("isValidNumber");let t=this.#e?.dialCode,e=this.#e?.iso2,i=this.#L(),s=u.utils.getCoreNumber(i,e);if(s){if(t===F.DIAL_CODE&&s[0]===F.MOBILE_PREFIX&&s.length!==F.MOBILE_CORE_LENGTH)return!1;if(!v.ALPHA_UNICODE.test(i)&&t){let l=i.startsWith("+")?i.slice(1+t.length):i,r=w(l).length;if(s.length>r)return!1}}return this.#lt("possible")}isValidNumberPrecise(){return this.#o?(R("isValidNumberPrecise"),this.#lt("precise")):null}#lt(t){let{allowNumberExtensions:e,allowPhonewords:i,allowedNumberTypes:s}=this.#i,o=this.#e?.iso2,l=this.#L();return!this.#e&&!et(l)||!(t==="precise"?u.utils.isValidNumber:u.utils.isPossibleNumber)(l,o,s)?!1:v.ALPHA_UNICODE.test(l)?!!u.utils.getExtension(l,o)?e:i:!0}setCountry(t){if(!this.#o)return;let e=t?.toLowerCase();if(!N(e))throw new Error(`Invalid iso2 code: '${e}'`);let i=this.#e?.iso2;if(t&&e!==i||!t&&i){if(this.#b(e),this.#G(this.#e?.dialCode||""),this.#i.formatOnDisplay){let o=this.#a();this.#w(o)}this.#Y(),this.#p(b.INPUT,{isCountryChange:!0})}}setNumber(t){if(!this.#o)return;let e=this.#f.normalise(t),i=this.#y(e);this.#w(e),i&&this.#Y(),this.#p(b.INPUT,{isSetNumber:!0})}setPlaceholderNumberType(t){this.#o&&(this.#i.placeholderNumberType=t,this.#M())}setDisabled(t){this.#o&&this.#t.setDisabled(t)}setReadonly(t){this.#o&&this.#t.setReadonly(t)}static forEachInstance(t,...e){let i=[...u.instances.values()],s=e[0];i.forEach(o=>{if(o instanceof n)switch(t){case"handleUtilsLoaded":o.#at();break;case"handleUtilsFailure":o.#ut(s);break;case"handleAutoCountryLoaded":o.#ot();break;case"handleAutoCountryFailure":o.#rt();break}})}},jt=n=>{if(!u.utils&&!u.startedLoadingUtils){let t;if(typeof n=="function")try{t=Promise.resolve(n())}catch(e){return Promise.reject(e)}else return Promise.reject(new TypeError(`The argument passed to attachUtils must be a function that returns a promise for the utils module, not ${typeof n}`));return u.startedLoadingUtils=!0,t.then(e=>{let i=e?.default;if(!i||typeof i!="object")throw new TypeError("The loader function passed to attachUtils did not resolve to a module object with utils as its default export.");return u.utils=i,M.forEachInstance("handleUtilsLoaded"),!0}).catch(e=>{throw M.forEachInstance("handleUtilsFailure",e),e})}return null},u=Object.assign((n,t)=>{let e=new M(n,t);return u.instances.set(String(e.id),e),n.iti=e,e},{defaults:V,documentReady:()=>document.readyState==="complete",getCountryData:()=>O,getInstance:n=>{let t=n.dataset[A.INSTANCE_ID];return t?u.instances.get(t)??null:null},instances:new Map,attachUtils:jt,startedLoadingUtils:!1,startedLoadingAutoCountry:!1,version:"27.1.3"}),Vt=u;return Pt(Gt);})();
|
|
24
|
+
</svg>`;var yt=(n,t)=>{let e=W(t),i=[],s=[],o=[],l=[],r=[],a=[];for(let c of n)c.iso2===e?i.push(c):c.normalisedName.startsWith(e)?s.push(c):c.normalisedName.includes(e)?o.push(c):e===c.dialCode||e===c.dialCodePlus?l.push(c):c.dialCodePlus.includes(e)?r.push(c):c.initials.includes(e)&&a.push(c);let p=(c,m)=>c.priority-m.priority;return[...i,...s,...o,...l.sort(p),...r.sort(p),...a]},Et=(n,t)=>{let e=W(t);for(let i of n)if(i.normalisedName.startsWith(e))return i;return null};var P=class n{#t;#i;#v;#E="";#I;#A=null;#_;#m;#e;#c;#g;#o;#s;#f;#r;#u;#n;#a;#d;#T;#H;#l;#C=null;#h=null;#O=new Map;#N=null;telInputEl;hadInitialPlaceholder;constructor(t,e,i){t.dataset[A.INSTANCE_ID]=i.toString(),this.telInputEl=t,this.#t=e,this.#i=i,this.hadInitialPlaceholder=!!t.getAttribute("placeholder"),this.#v=!!this.telInputEl.closest("[dir=rtl]"),this.#E=this.telInputEl.style.paddingLeft}static validateInput(t){let e=t?.tagName;if(!(!!t&&typeof t=="object"&&e==="INPUT"&&typeof t.setAttribute=="function")){let s=Object.prototype.toString.call(t);throw new TypeError(`The first argument must be an HTMLInputElement, not ${s}`)}}buildMarkup(t){this.#I=t,this.telInputEl.classList.add("iti__tel-input"),this.telInputEl.hasAttribute("type")||this.telInputEl.setAttribute("type","tel"),this.telInputEl.hasAttribute("autocomplete")||this.telInputEl.setAttribute("autocomplete","tel"),this.telInputEl.hasAttribute("inputmode")||this.telInputEl.setAttribute("inputmode","tel");let e=this.#k();this.#U(e),e.appendChild(this.telInputEl),this.#q(),this.#J(e),this.ensureDropdownWidthSet()}#k(){let{allowDropdown:t,showFlags:e,containerClass:i,useFullscreenPopup:s}=this.#t,o=G({iti:!0,"iti--allow-dropdown":t,"iti--show-flags":e,"iti--inline-dropdown":!s,[i]:!!i}),l=f("div",{class:o});return this.#v&&l.setAttribute("dir","ltr"),this.telInputEl.before(l),l}#U(t){let{allowDropdown:e,separateDialCode:i,showFlags:s}=this.#t;if(!e&&!s&&!i)return;this.#m=f("div",{class:`iti__country-container ${d.V_HIDE}`},t),e?(this.#e=f("button",{type:"button",class:"iti__selected-country",[h.EXPANDED]:"false",[h.LABEL]:this.#t.i18n.noCountrySelected,[h.HASPOPUP]:"dialog",[h.CONTROLS]:`iti-${this.#i}__dropdown-content`},this.#m),this.telInputEl.disabled&&this.#e.setAttribute("disabled","true")):this.#e=f("div",{class:"iti__selected-country"},this.#m);let o=f("div",{class:"iti__selected-country-primary"},this.#e);this.#c=f("div",{class:d.FLAG},o),e&&(this.#o=f("div",{class:"iti__arrow",[h.HIDDEN]:"true"},o)),i&&(this.#g=f("div",{class:"iti__selected-dial-code"},this.#e)),e&&this.#z()}ensureDropdownWidthSet(){let{fixDropdownWidth:t,allowDropdown:e}=this.#t;if(!e||!t||this.#s.style.width)return;let i=this.telInputEl.offsetWidth;i>0&&(this.#s.style.width=`${i}px`)}#z(){let{fixDropdownWidth:t,useFullscreenPopup:e,countrySearch:i,i18n:s,dropdownContainer:o,containerClass:l}=this.#t,r=t?"":"iti--flexible-dropdown-width";if(this.#s=f("div",{id:`iti-${this.#i}__dropdown-content`,class:`iti__dropdown-content ${d.HIDE} ${r}`,role:"dialog",[h.MODAL]:"true"}),this.#v&&this.#s.setAttribute("dir","rtl"),i&&this.#X(),this.#n=f("ul",{class:"iti__country-list",id:`iti-${this.#i}__country-listbox`,role:"listbox",[h.LABEL]:s.countryListAriaLabel},this.#s),this.#Q(),i&&this.#B(),e||(this.#_=this.#tt(),i&&(this.#s.style.height=`${this.#_}px`)),o){let a=G({iti:!0,"iti--container":!0,"iti--fullscreen-popup":e,"iti--inline-dropdown":!e,[l]:!!l});this.#l=f("div",{class:a}),this.#l.appendChild(this.#s)}else this.#m.appendChild(this.#s)}#X(){let{i18n:t,searchInputClass:e}=this.#t,i=f("div",{class:"iti__search-input-wrapper"},this.#s);this.#f=f("span",{class:"iti__search-icon",[h.HIDDEN]:"true"},i),this.#f.innerHTML=ft(),this.#r=f("input",{id:`iti-${this.#i}__search-input`,type:"search",class:`iti__search-input ${e}`,placeholder:t.searchPlaceholder,role:"combobox",[h.EXPANDED]:"true",[h.LABEL]:t.searchPlaceholder,[h.CONTROLS]:`iti-${this.#i}__country-listbox`,[h.AUTOCOMPLETE]:"list",autocomplete:"off"},i),this.#u=f("button",{type:"button",class:`iti__search-clear ${d.HIDE}`,[h.LABEL]:t.clearSearchAriaLabel,tabindex:"-1"},i),this.#u.innerHTML=mt(this.#i),this.#H=f("span",{class:"iti__a11y-text"},this.#s),this.#T=f("div",{class:`iti__no-results ${d.HIDE}`,[h.HIDDEN]:"true"},this.#s),this.#T.textContent=t.searchEmptyState??null}#q(){this.#m&&(this.#W(),this.#m.classList.remove(d.V_HIDE))}#J(t){let{hiddenInput:e}=this.#t;if(!e)return;let i=this.telInputEl.getAttribute("name")||"",s=e(i);if(s.phone){let o=this.telInputEl.form?.querySelector(`input[name="${s.phone}"]`);o?this.#a=o:(this.#a=f("input",{type:"hidden",name:s.phone}),t.appendChild(this.#a))}if(s.country){let o=this.telInputEl.form?.querySelector(`input[name="${s.country}"]`);o?this.#d=o:(this.#d=f("input",{type:"hidden",name:s.country}),t.appendChild(this.#d))}}#Q(){let t=document.createDocumentFragment();for(let e=0;e<this.#I.length;e++){let i=this.#I[e],s=G({[d.COUNTRY_ITEM]:!0}),o=f("li",{id:`iti-${this.#i}__item-${i.iso2}`,class:s,tabindex:"-1",role:"option",[h.SELECTED]:"false"});o.dataset[A.DIAL_CODE]=i.dialCode,o.dataset[A.ISO2]=i.iso2,this.#O.set(i.iso2,o),this.#t.showFlags&&f("div",{class:`${d.FLAG} iti__${i.iso2}`},o);let l=f("span",{class:"iti__country-name"},o);l.textContent=`${i.name} `;let r=f("span",{class:"iti__dial-code"},l);this.#v&&r.setAttribute("dir","ltr"),r.textContent=`(+${i.dialCode})`,t.appendChild(o)}this.#n.appendChild(t)}#W(){if(this.#e){let t=this.#t.separateDialCode?L.FALLBACK_SELECTED_WITH_DIAL_WIDTH:L.FALLBACK_SELECTED_NO_DIAL_WIDTH,i=(this.#e.offsetWidth||this.#Z()||t)+L.INPUT_PADDING_EXTRA_LEFT;this.telInputEl.style.paddingLeft=`${i}px`}}static#$(){let t;try{t=window.top.document.body}catch{t=document.body}return t}#Z(){if(!this.telInputEl.parentNode)return 0;let t=n.#$(),e=this.telInputEl.parentNode.cloneNode(!1);e.style.visibility="hidden",t.appendChild(e);let i=this.#m.cloneNode();e.appendChild(i);let s=this.#e.cloneNode(!0);i.appendChild(s);let o=s.offsetWidth;return t.removeChild(e),o}#tt(){let t=n.#$();this.#s.classList.remove(d.HIDE);let e=f("div",{class:"iti iti--inline-dropdown"});e.appendChild(this.#s),e.style.visibility="hidden",t.appendChild(e);let i=this.#s.offsetHeight;return t.removeChild(e),e.style.visibility="",this.#s.classList.add(d.HIDE),i>0?i:L.FALLBACK_DROPDOWN_HEIGHT}#B(){let{i18n:t}=this.#t,e=this.#n.childElementCount;this.#H.textContent=t.searchSummaryAria(e)}#F(t){let e;t===""?e=this.#I:e=yt(this.#I,t),this.#D(e)}prefillSearchWithPlus(){this.#r.value="+",this.#r.focus(),this.#F("")}#P(){let t=this.#r.value.trim();this.#F(t),this.#r.value?this.#u.classList.remove(d.HIDE):this.#u.classList.add(d.HIDE)}#p(){this.#A&&clearTimeout(this.#A),this.#A=setTimeout(()=>{this.#P(),this.#A=null},J.SEARCH_DEBOUNCE_MS)}#R(){this.#r.value="",this.#r.focus(),this.#P()}#w(t){let e=this.#n,i=e.getBoundingClientRect(),s=t.getBoundingClientRect(),o=s.top-i.top+e.scrollTop;s.top<i.top?e.scrollTop=o:s.bottom>i.bottom&&(e.scrollTop=o-i.height+s.height)}#y(t,e=!0){if(this.#h?.classList.remove(d.HIGHLIGHT),t){if(t.classList.add(d.HIGHLIGHT),this.#t.countrySearch){let i=t.getAttribute("id")||"";this.#r.setAttribute(h.ACTIVE_DESCENDANT,i)}e&&this.#w(t),this.#h=t}else this.#h=null}bindHiddenInputSubmitListener(t,e,i){let s=this.telInputEl.form;!s||!this.#a&&!this.#d||s.addEventListener("submit",()=>{this.#a&&(this.#a.value=e()),this.#d&&(this.#d.value=i())},{signal:t})}bindAllInitialDropdownListeners(t,e,i){let s=this.telInputEl.closest("label");s&&s.addEventListener("click",o=>{this.isDropdownOpen()?o.preventDefault():this.telInputEl.focus()},{signal:t}),this.#e.addEventListener("click",()=>{!this.isDropdownOpen()&&!this.telInputEl.disabled&&!this.telInputEl.readOnly&&e()},{signal:t}),this.#m.addEventListener("keydown",o=>{let l=[C.ARROW_UP,C.ARROW_DOWN,C.SPACE,C.ENTER];!this.isDropdownOpen()&&l.includes(o.key)&&(o.preventDefault(),o.stopPropagation(),e()),o.key===C.TAB&&i()},{signal:t})}openDropdown(t,e){let{countrySearch:i,dropdownAlwaysOpen:s,dropdownContainer:o}=this.#t;if(this.#N=new AbortController,this.ensureDropdownWidthSet(),o)this.#L();else{let r=this.#x(),a=this.telInputEl.offsetHeight+L.DROPDOWN_MARGIN;r?this.#s.style.top=`${a}px`:this.#s.style.bottom=`${a}px`}this.#s.classList.remove(d.HIDE),this.#e.setAttribute(h.EXPANDED,"true");let l=this.#C??this.#n.firstElementChild;l&&this.#y(l),i&&!s&&this.#r.focus(),this.#t.useFullscreenPopup&&this.#l&&window.visualViewport&&window.visualViewport.addEventListener("resize",()=>{this.#K(),this.#h&&this.#w(this.#h)},{signal:this.#N.signal}),this.#o.classList.add(d.ARROW_UP),this.#et(t,e)}#et(t,e){let i=this.#N.signal;this.#j(i),this.#it(i,t),this.#t.dropdownAlwaysOpen||this.#b(i,e),this.#V(i,t,e),this.#t.countrySearch&&this.#M(i),!this.#t.useFullscreenPopup&&this.#t.dropdownContainer&&window.addEventListener("scroll",e,{signal:i})}#j(t){this.#n.addEventListener("mouseover",e=>{let i=e.target?.closest(`.${d.COUNTRY_ITEM}`);i&&this.#y(i,!1)},{signal:t})}#it(t,e){this.#n.addEventListener("click",i=>{let s=i.target?.closest(`.${d.COUNTRY_ITEM}`);s&&e(s)},{signal:t})}#b(t,e){setTimeout(()=>{document.documentElement.addEventListener("click",i=>{this.#s.contains(i.target)||e()},{signal:t})},0)}#V(t,e,i){let s="",o=null,l=r=>{[C.ARROW_UP,C.ARROW_DOWN,C.ENTER,C.ESC].includes(r.key)&&(r.preventDefault(),r.stopPropagation(),r.key===C.ARROW_UP||r.key===C.ARROW_DOWN?this.#S(r.key):r.key===C.ENTER&&!r.isComposing?e(this.#h):r.key===C.ESC&&(i(),this.#e.focus())),!this.#t.countrySearch&&r.target!==this.telInputEl&&v.HIDDEN_SEARCH_CHAR.test(r.key)&&(r.stopPropagation(),o&&clearTimeout(o),s+=r.key.toLowerCase(),this.#st(s),o=setTimeout(()=>{s=""},J.HIDDEN_SEARCH_RESET_MS))};document.addEventListener("keydown",l,{signal:t})}#M(t){this.#r.addEventListener("input",()=>this.#p(),{signal:t}),this.#u.addEventListener("click",()=>this.#R(),{signal:t})}#st(t){let e=Et(this.#I,t);if(e){let i=this.#O.get(e.iso2);this.#y(i)}}#S(t){let e=t===C.ARROW_UP?this.#h?.previousElementSibling:this.#h?.nextElementSibling;!e&&this.#n.childElementCount>1&&(e=t===C.ARROW_UP?this.#n.lastElementChild:this.#n.firstElementChild),e&&this.#y(e)}#G(t){if(this.#C&&this.#C.dataset[A.ISO2]!==t&&(this.#C.setAttribute(h.SELECTED,"false"),this.#C.querySelector(".iti__country-check")?.remove(),this.#C=null),t&&!this.#C){let e=this.#n.querySelector(`[data-country-code="${t}"]`);if(e){e.setAttribute(h.SELECTED,"true");let i=f("span",{class:"iti__country-check",[h.HIDDEN]:"true"},e);i.innerHTML=Ct(),this.#C=e,this.#t.dropdownAlwaysOpen&&this.#y(e)}}}#D(t){this.#n.replaceChildren();let e=!0;for(let i of t){let s=this.#O.get(i.iso2);s&&(this.#n.appendChild(s),e&&(this.#y(s,!1),e=!1))}e?(this.#y(null),this.#T&&this.#T.classList.remove(d.HIDE)):this.#T&&this.#T.classList.add(d.HIDE),this.#n.scrollTop=0,this.#B()}closeDropdown(){let{countrySearch:t,dropdownContainer:e}=this.#t;this.#N.abort(),this.#N=null,this.#s.classList.add(d.HIDE),this.#e.setAttribute(h.EXPANDED,"false"),t&&(this.#r.removeAttribute(h.ACTIVE_DESCENDANT),this.#r.value="",this.#P(),this.#h&&(this.#h.classList.remove(d.HIGHLIGHT),this.#h=null)),this.#o.classList.remove(d.ARROW_UP),e?(this.#l.remove(),this.#l.style.top="",this.#l.style.bottom="",this.#l.style.paddingLeft="",this.#l.style.paddingRight=""):(this.#s.style.top="",this.#s.style.bottom="")}#x(){if(this.#t.dropdownAlwaysOpen)return!0;let t=this.telInputEl.getBoundingClientRect(),e=t.top,i=window.innerHeight-t.bottom;return i>=this.#_||i>=e}#L(){let{dropdownContainer:t,useFullscreenPopup:e}=this.#t;if(e){if(window.innerWidth>=L.NARROW_VIEWPORT_WIDTH){let i=this.telInputEl.getBoundingClientRect();this.#l.style.paddingLeft=`${i.left}px`,this.#l.style.paddingRight=`${window.innerWidth-i.right}px`}}else{let i=this.telInputEl.getBoundingClientRect();this.#l.style.left=`${i.left}px`,this.#x()?this.#l.style.top=`${i.bottom+L.DROPDOWN_MARGIN}px`:(this.#l.style.top="unset",this.#l.style.bottom=`${window.innerHeight-i.top+L.DROPDOWN_MARGIN}px`)}t.appendChild(this.#l)}#K(){let t=window.visualViewport;if(!t||!this.#l)return;let e=window.innerHeight-t.height;this.#l.style.bottom=`${e}px`}isDropdownOpen(){return!this.#s.classList.contains(d.HIDE)}setLoading(t){this.#c.classList.toggle(d.LOADING,t)}isLoading(){return this.#c.classList.contains(d.LOADING)}setDisabled(t){this.telInputEl.disabled=t,this.#e&&(t?this.#e.setAttribute("disabled","true"):this.#e.removeAttribute("disabled"))}setReadonly(t){this.telInputEl.readOnly=t,this.#e&&(t?this.#e.setAttribute("disabled","true"):this.#e.removeAttribute("disabled"))}setCountry(t){let{allowDropdown:e,showFlags:i,separateDialCode:s,i18n:o}=this.#t,l=t?.name,r=t?.dialCode,a=t?.iso2??"";if(e&&this.#G(a),this.#e){let p=a&&i?`${d.FLAG} iti__${a}`:`${d.FLAG} ${d.GLOBE}`,c,m,y;a?(m=l,c=o.selectedCountryAriaLabel.replace("${countryName}",l).replace("${dialCode}",`+${r}`),y=i?"":tt()):(m=o.noCountrySelected,c=o.noCountrySelected,y=tt()),this.#c.className=p,this.#e.setAttribute("title",m),this.#e.setAttribute(h.LABEL,c),this.#c.innerHTML=y}if(s){let p=r?`+${r}`:"";this.#g.textContent=p,this.#W()}}destroy(){this.telInputEl.iti=void 0,delete this.telInputEl.dataset[A.INSTANCE_ID],this.telInputEl.style.paddingLeft=this.#E;let t=this.telInputEl.parentNode;t&&(t.before(this.telInputEl),t.remove()),this.#O.clear()}};var gt=n=>{let{onlyCountries:t,excludeCountries:e}=n;return t?.length?O.filter(i=>t.includes(i.iso2)):e?.length?O.filter(i=>!e.includes(i.iso2)):[...O]},bt=(n,t)=>{let{countryNameLocale:e,i18n:i}=t,s;try{typeof Intl<"u"&&typeof Intl.DisplayNames=="function"?s=new Intl.DisplayNames(e,{type:"region"}):s=null}catch(o){console.error(o),s=null}for(let o of n)o.name=i[o.iso2]||s?.of(o.iso2.toUpperCase())||""},It=n=>{let t=new Set,e=0,i={},s=(l,r)=>{if(!l||!r)return;r.length>e&&(e=r.length),Object.hasOwn(i,r)||(i[r]=[]);let a=i[r];a.includes(l)||a.push(l)},o=[...n].sort((l,r)=>l.priority-r.priority);for(let l of o){t.has(l.dialCode)||t.add(l.dialCode);for(let r=1;r<l.dialCode.length;r++){let a=l.dialCode.substring(0,r);s(l.iso2,a)}if(s(l.iso2,l.dialCode),l.areaCodes){let r=i[l.dialCode][0];for(let a of l.areaCodes){for(let p=1;p<a.length;p++){let c=a.substring(0,p),m=l.dialCode+c;s(r,m),s(l.iso2,m)}s(l.iso2,l.dialCode+a)}}}return{dialCodes:t,dialCodeMaxLength:e,dialCodeToIso2Map:i}},Lt=(n,t)=>{let{countryOrder:e}=t;n.sort((i,s)=>{if(e){let o=e.indexOf(i.iso2),l=e.indexOf(s.iso2),r=o>-1,a=l>-1;if(r||a)return r&&a?o-l:r?-1:1}return i.name.localeCompare(s.name)})},vt=n=>{for(let t of n)t.normalisedName=W(t.name),t.initials=t.normalisedName.split(/[^a-z]/).map(e=>e[0]).join(""),t.dialCodePlus=`+${t.dialCode}`};var $t=new Set(["800","808","870","881","882","883","888","979"]),et=n=>{let t=w(n).slice(0,3);return n.startsWith("+")&&$t.has(t)};var it=(n,t,e,i)=>{if(!e||!t)return n;let s=`+${i.dialCode}`,o=n[s.length]===" "||n[s.length]==="-"?s.length+1:s.length;return n.substring(o)},At=(n,t,e,i,s)=>{let o=e?e.formatNumberAsYouType(n,i?.iso2):n,l=i?.dialCode;return s&&t.charAt(0)!=="+"&&o.includes(`+${l}`)?(o.split(`+${l}`)[1]||"").trim():o};var Tt=(n,t,e,i)=>{if(e===0&&!i)return 0;let s=0;for(let o=0;o<t.length;o++){if(/[+0-9]/.test(t[o])&&s++,s===n&&!i)return o+1;if(i&&s===n+1)return o}return t.length};var Bt=new Set(["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"]),st=n=>{let t=w(n);if(t.startsWith(B.NANP)&&t.length>=4){let e=t.substring(1,4);return Bt.has(e)}return!1};var K=class{#t;constructor(t){t&&this.#i(t)}#i(t){/[\u0660-\u0669]/.test(t)?this.#t="arabic-indic":/[\u06F0-\u06F9]/.test(t)?this.#t="persian":this.#t="ascii"}denormalise(t){if(!this.#t||this.#t==="ascii")return t;let e=this.#t==="arabic-indic"?1632:1776;return t.replace(/[0-9]/g,i=>String.fromCharCode(e+Number(i)))}normalise(t){if(!t)return"";if(this.#i(t),this.#t==="ascii")return t;let e=this.#t==="arabic-indic"?1632:1776,i=this.#t==="arabic-indic"?/[\u0660-\u0669]/g:/[\u06F0-\u06F9]/g;return t.replace(i,s=>String.fromCharCode(48+(s.charCodeAt(0)-e)))}isAscii(){return!this.#t||this.#t==="ascii"}};var Ft=0,R=n=>{if(!u.utils)throw new Error(`intlTelInput.utils is required for ${n}(). See: https://intl-tel-input.com/docs/utils`)},wt=()=>{let n,t;return{promise:new Promise((i,s)=>{n=i,t=s}),resolve:n,reject:t}},M=class n{id;promise;#t;#i;#v;#E;#I;#A;#_;#m;#e=null;#c=null;#g;#o=!0;#s;#f;#r=!1;#u;#n;constructor(t,e={}){this.id=Ft++,P.validateInput(t);let i=dt(e);this.#i={...V,...i},ht(this.#i),pt(this.#i),this.#t=new P(t,this.#i,this.id),this.#v=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),this.#f=new K(t.value),this.promise=this.#T(this.#i),this.#E=gt(this.#i);let{dialCodes:s,dialCodeMaxLength:o,dialCodeToIso2Map:l}=It(this.#E);this.#_=s,this.#I=o,this.#A=l,this.#m=new Map(this.#E.map(r=>[r.iso2,r])),this.#H()}#a(){let t=this.#t.telInputEl.value.trim();return this.#f.normalise(t)}#d(t){this.#t.telInputEl.value=this.#f.denormalise(t)}#T(t){let{initialCountry:e,geoIpLookup:i,loadUtils:s}=t,o=e===k.AUTO&&!!i,l=!!s&&!u.utils;return o&&(this.#u=wt()),l&&(this.#n=wt()),Promise.all([this.#u?.promise,this.#n?.promise]).then(()=>{})}#H(){this.#s=new AbortController,this.#l(),this.#t.buildMarkup(this.#E),this.#C(),this.#h(),this.#O(),this.#i.dropdownAlwaysOpen&&this.#R()}#l(){bt(this.#E,this.#i),Lt(this.#E,this.#i),vt(this.#E)}#C(t=!1){let e=this.#t.telInputEl.getAttribute("value"),i=this.#f.normalise(e??""),s=this.#a(),l=i&&i.startsWith("+")&&(!s||!s.startsWith("+"))?i:s,r=this.#D(l),a=st(l),{initialCountry:p,geoIpLookup:c}=this.#i,m=p===k.AUTO&&c,y=m&&u.autoCountry?u.autoCountry:p,T=m&&!t&&!u.autoCountry,I=N(y);r?a?I?this.#b(y):T||this.#b(nt.ISO2):(I&&this.#b(y),this.#y(l)):I?this.#b(y):T||this.#b(""),l&&this.#w(l)}#h(){this.#z(),this.#i.allowDropdown&&this.#t.bindAllInitialDropdownListeners(this.#s.signal,()=>this.#R(),()=>this.#S()),this.#t.bindHiddenInputSubmitListener(this.#s.signal,()=>this.getNumber(),()=>this.#e?.iso2||"")}#O(){if(this.#n){let{loadUtils:t}=this.#i,e=()=>{u.attachUtils(t)?.catch(()=>{})};u.documentReady()?e():window.addEventListener("load",e,{signal:this.#s.signal})}this.#u&&(this.#e?this.#u.resolve():this.#N())}#N(){if(u.autoCountry){this.#ot();return}if(this.#t.setLoading(!0),!u.startedLoadingAutoCountry&&(u.startedLoadingAutoCountry=!0,typeof this.#i.geoIpLookup=="function")){let t=(i="")=>{let s=i.toLowerCase();N(s)?(u.autoCountry=s,setTimeout(()=>n.forEachInstance("handleAutoCountryLoaded"))):n.forEachInstance("handleAutoCountryFailure")},e=()=>{n.forEachInstance("handleAutoCountryFailure")};this.#i.geoIpLookup(t,e)}}#k(){this.#R(),this.#t.prefillSearchWithPlus()}#U(t){let e=this.#t.telInputEl.selectionStart||0,i=t.substring(0,e-1),s=t.substring(e);return this.#d(i+s),e-1}#z(){this.#W(),this.#Z(),this.#B()}#X(t){this.#U(t),this.#k()}#q(t,e){let i=this.#U(t);this.#t.telInputEl.setSelectionRange(i,i),this.#p(b.STRICT_REJECT,{source:"key",rejectedInput:e,reason:"invalid"})}#J(t,e){let i=this.#t.telInputEl.selectionStart||0,o=t.substring(0,i).replace(v.NON_PLUS_NUMERIC_GLOBAL,"").length,l=this.#L(),r=At(l,t,u.utils,this.#e,this.#i.separateDialCode),a=Tt(o,r,i,e);this.#d(r),this.#t.telInputEl.setSelectionRange(a,a)}#Q(t){if(t.startsWith("+")&&this.#e&&this.#D(t)){let e=it(t,!0,!0,this.#e);this.#d(e)}}#W(){this.#r=v.ALPHA_UNICODE.test(this.#a()),this.#t.telInputEl.addEventListener("input",this.#$,{signal:this.#s.signal})}#$=t=>{let{strictMode:e,formatAsYouType:i,separateDialCode:s,allowDropdown:o,countrySearch:l}=this.#i,r=t?.detail;if(r?.isCountryChange)return;let a=this.#a();if(this.#v&&t?.data==="+"&&s&&o&&l){this.#X(a);return}if(this.#v&&e&&(t?.data===" "||t?.data==="-"||t?.data===".")){this.#q(a,t.data);return}this.#y(a)&&this.#Y();let p=t?.data&&v.NON_PLUS_NUMERIC.test(t.data),c=t?.inputType===q.PASTE&&a;p||c&&!e?this.#r=!0:v.NON_PLUS_NUMERIC.test(a)||(this.#r=!1),i&&!this.#r&&!r?.isSetNumber&&this.#f.isAscii()&&this.#J(a,t?.inputType===q.DELETE_FORWARD),s&&this.#Q(a)};#Z(){let{strictMode:t,separateDialCode:e}=this.#i;!t&&!e||this.#t.telInputEl.addEventListener("keydown",this.#tt,{signal:this.#s.signal})}#tt=t=>{let{strictMode:e,separateDialCode:i,allowDropdown:s,countrySearch:o}=this.#i;if(!t.key||t.key.length!==1||t.altKey||t.ctrlKey||t.metaKey)return;if(i&&s&&o&&t.key==="+"){t.preventDefault(),this.#k();return}if(!e)return;let l=this.#a(),a=!l.startsWith("+")&&this.#t.telInputEl.selectionStart===0&&t.key==="+",p=this.#f.normalise(t.key),c=/^[0-9]$/.test(p),m=i?c:a||c,y=this.#t.telInputEl,T=y.selectionStart,I=y.selectionEnd,$=l.slice(0,T??void 0),x=l.slice(I??void 0),g=$+p+x,D=this.#x(g),H=!1;u.utils&&this.#c&&(H=u.utils.getCoreNumber(D,this.#e?.iso2).length>this.#c);let Y=this.#j(D)!==null;(!m||H&&!Y&&!a)&&(this.#p(b.STRICT_REJECT,{source:"key",rejectedInput:t.key,reason:m?"max-length":"invalid"}),t.preventDefault())};#B(){this.#i.strictMode&&this.#t.telInputEl.addEventListener("paste",this.#F,{signal:this.#s.signal})}#F=t=>{t.preventDefault();let e=this.#t.telInputEl,i=e.selectionStart,s=e.selectionEnd,o=this.#a(),l=o.slice(0,i??void 0),r=o.slice(s??void 0),a=this.#e?.iso2,p=t.clipboardData.getData("text"),c=this.#f.normalise(p),m=i===0&&s>0,y=!o.startsWith("+")||m,T=c.replace(v.NON_PLUS_NUMERIC_GLOBAL,""),I=T.startsWith("+"),$=T.replace(/\+/g,""),x=I&&y?`+${$}`:$,g=l+x+r,D=x!==c?"invalid":null;if(g.length>5&&u.utils){let _=u.utils.getCoreNumber(g,a);for(;_.length===0&&g.length>0;)g=g.slice(0,-1),_=u.utils.getCoreNumber(g,a);if(!_){this.#p(b.STRICT_REJECT,{source:"paste",rejectedInput:p,reason:"max-length"});return}if(this.#c&&_.length>this.#c)if(e.selectionEnd===o.length){let Y=_.length-this.#c;g=g.slice(0,g.length-Y),D="max-length"}else{this.#p(b.STRICT_REJECT,{source:"paste",rejectedInput:p,reason:"max-length"});return}}this.#d(g);let H=i+x.length;e.setSelectionRange(H,H),e.dispatchEvent(new InputEvent("input",{bubbles:!0})),D&&this.#p(b.STRICT_REJECT,{source:"paste",rejectedInput:p,reason:D})};#P(t){let e=Number(this.#t.telInputEl.getAttribute("maxlength"));return e&&t.length>e?t.substring(0,e):t}#p(t,e={}){let i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:e});this.#t.telInputEl.dispatchEvent(i)}#R(){this.#t.openDropdown(t=>this.#st(t),()=>this.#S()),this.#p(b.OPEN_COUNTRY_DROPDOWN)}#w(t){let{formatOnDisplay:e,nationalMode:i,separateDialCode:s}=this.#i,o=t;if(e&&u.utils&&this.#e){let l=et(t),r=i&&!l||!o.startsWith("+")&&!s,{NATIONAL:a,INTERNATIONAL:p}=u.utils.numberFormat,c=r?a:p;o=u.utils.formatNumber(o,this.#e?.iso2,c)}o=this.#K(o),this.#d(o)}#y(t){let e=this.#j(t);return e!==null?this.#b(e):!1}#et(t){let e=this.#e?.dialCode,i=this.#e?.nationalPrefix;if(t.startsWith("+")||!e)return t;let l=i&&t.startsWith(i)&&!this.#i.separateDialCode?t.substring(1):t;return`+${e}${l}`}#j(t){let e=t.indexOf("+"),i=e>0?t.substring(e):t,s=this.#e?.iso2;i=this.#et(i);let o=this.#D(i,!0),l=w(i);if(o){let r=w(o),a=this.#A[r];return a.length===1?a[0]===s?null:a[0]:this.#it(a,r,l)}else if(i.startsWith("+")&&l.length){let r=this.#e?.dialCode||"";return r&&r.startsWith(l)?null:""}else if((!i||i==="+")&&!s&&this.#g)return this.#g;return null}#it(t,e,i){let s=this.#e?.iso2,o=this.#e?.dialCode;if(!s&&this.#g&&t.includes(this.#g))return this.#g;if(o===B.NANP&&st(i))return null;let r=this.#e?.areaCodes,a=this.#e?.priority;if(r){let T=r.map(I=>`${o}${I}`);for(let I of T)if(i.startsWith(I))return null}let c=r&&!(a===0)&&i.length>e.length,m=s&&t.includes(s)&&!c,y=s===t[0];return!m&&!y?t[0]:null}#b(t){let e=this.#e?.iso2||"";return this.#e=t?this.#m.get(t):null,this.#e&&(this.#g=this.#e.iso2),this.#t.setCountry(this.#e),this.#M(),this.#V(),e!==t}#V(){let{strictMode:t,placeholderNumberType:e,allowedNumberTypes:i}=this.#i;if(!t||!u.utils)return;let s=this.#e?.iso2;if(!s){this.#c=null;return}let o=u.utils.numberType[e],l=u.utils.getExampleNumber(s,!1,o,!0),r=l;for(;u.utils.isPossibleNumber(l,s,i);)r=l,l+="0";let a=u.utils.getCoreNumber(r,s);this.#c=a.length,s==="by"&&(this.#c=a.length+1)}#M(){let{autoPlaceholder:t,placeholderNumberType:e,nationalMode:i,customPlaceholder:s}=this.#i,o=t===S.AGGRESSIVE||!this.#t.hadInitialPlaceholder&&t===S.POLITE;if(!u.utils||!o)return;let l=u.utils.numberType[e],r=this.#e?u.utils.getExampleNumber(this.#e.iso2,i,l):"";r=this.#K(r),typeof s=="function"&&(r=s(r,this.#e)),this.#t.telInputEl.setAttribute("placeholder",r)}#st(t){if(!t)return;let e=t.dataset[A.ISO2],i=this.#b(e);this.#S();let s=t.dataset[A.DIAL_CODE];if(this.#G(s),this.#i.formatOnDisplay){let o=this.#a();this.#w(o)}this.#t.telInputEl.focus(),i&&(this.#Y(),this.#p(b.INPUT,{isCountryChange:!0}))}#S(t){!this.#t.isDropdownOpen()||this.#i.dropdownAlwaysOpen&&!t||(this.#t.closeDropdown(),this.#p(b.CLOSE_COUNTRY_DROPDOWN))}#G(t){let e=this.#a();if(!e.startsWith("+"))return;let i=`+${t}`,s=this.#D(e),o;s?o=e.replace(s,i):o=i,this.#d(o)}#D(t,e){if(!t.startsWith("+"))return"";let i="",s="",o=!1;for(let l=0;l<t.length;l++){let r=t.charAt(l);if(!/[0-9]/.test(r))continue;if(s+=r,!!!this.#A[s])break;if(this.#_.has(s)){if(i=t.substring(0,l+1),o=!0,!e)break}else e&&o&&(i=t.substring(0,l+1));if(s.length===this.#I)break}return i}#x(t){let e=this.#e?.dialCode,i=w(t);return(this.#i.separateDialCode&&!t.startsWith("+")&&e&&i?`+${e}`:"")+t}#L(){let t=this.#a();return this.#x(t)}#K(t){let e=!!this.#D(t),i=it(t,e,this.#i.separateDialCode,this.#e);return this.#P(i)}#nt(){let t=this.#e;if(!t)return null;let{iso2:e,dialCode:i,name:s}=t;return{iso2:e,dialCode:i,name:s}}#Y(){let t=this.#nt();this.#p(b.COUNTRY_CHANGE,t)}#ot(){if(!(!this.#u||!u.autoCountry)){if(!this.#o){this.#u.resolve();return}this.#t.isLoading()?this.setCountry(u.autoCountry):this.#g=u.autoCountry,this.#t.setLoading(!1),this.#u.resolve()}}#rt(){if(!this.#o){this.#u?.reject();return}this.#C(!0),this.#t.setLoading(!1),this.#u?.reject()}#at(){if(!this.#o){this.#n?.resolve();return}if(!u.utils){this.#n?.resolve();return}let t=this.#a();t&&this.#w(t),this.#e&&(this.#M(),this.#V()),this.#n?.resolve()}#ut(t){if(!this.#o){this.#n?.reject(t);return}this.#n?.reject(t)}destroy(){this.#o&&(this.#o=!1,this.#i.allowDropdown&&this.#S(!0),this.#s.abort(),this.#t.destroy(),u.instances.delete(String(this.id)))}isActive(){return this.#o}getExtension(){return this.#o?(R("getExtension"),u.utils.getExtension(this.#L(),this.#e?.iso2)):""}getNumber(t){if(!this.#o)return"";R("getNumber");let e=this.#e?.iso2,i=this.#L(),s=u.utils.formatNumber(i,e,t);return this.#f.denormalise(s)}getNumberType(){return this.#o?(R("getNumberType"),u.utils.getNumberType(this.#L(),this.#e?.iso2)):Q.UNKNOWN_NUMBER_TYPE}getSelectedCountryData(){return this.#nt()}getValidationError(){if(!this.#o)return Q.UNKNOWN_VALIDATION_ERROR;R("getValidationError");let t=this.#e?.iso2;return u.utils.getValidationError(this.#L(),t)}isValidNumber(){if(!this.#o)return null;R("isValidNumber");let t=this.#e?.dialCode,e=this.#e?.iso2,i=this.#L(),s=u.utils.getCoreNumber(i,e);if(s){if(t===F.DIAL_CODE&&s[0]===F.MOBILE_PREFIX&&s.length!==F.MOBILE_CORE_LENGTH)return!1;if(!v.ALPHA_UNICODE.test(i)&&t){let l=i.startsWith("+")?i.slice(1+t.length):i,r=w(l).length;if(s.length>r)return!1}}return this.#lt("possible")}isValidNumberPrecise(){return this.#o?(R("isValidNumberPrecise"),this.#lt("precise")):null}#lt(t){let{allowNumberExtensions:e,allowPhonewords:i,allowedNumberTypes:s}=this.#i,o=this.#e?.iso2,l=this.#L();return!this.#e&&!et(l)||!(t==="precise"?u.utils.isValidNumber:u.utils.isPossibleNumber)(l,o,s)?!1:v.ALPHA_UNICODE.test(l)?!!u.utils.getExtension(l,o)?e:i:!0}setCountry(t){if(!this.#o)return;let e=t?.toLowerCase();if(!N(e))throw new Error(`Invalid iso2 code: '${e}'`);let i=this.#e?.iso2;if(t&&e!==i||!t&&i){if(this.#b(e),this.#G(this.#e?.dialCode||""),this.#i.formatOnDisplay){let o=this.#a();this.#w(o)}this.#Y(),this.#p(b.INPUT,{isCountryChange:!0})}}setNumber(t){if(!this.#o)return;let e=this.#f.normalise(t),i=this.#y(e);this.#w(e),i&&this.#Y(),this.#p(b.INPUT,{isSetNumber:!0})}setPlaceholderNumberType(t){this.#o&&(this.#i.placeholderNumberType=t,this.#M())}setDisabled(t){this.#o&&this.#t.setDisabled(t)}setReadonly(t){this.#o&&this.#t.setReadonly(t)}static forEachInstance(t,...e){let i=[...u.instances.values()],s=e[0];i.forEach(o=>{if(o instanceof n)switch(t){case"handleUtilsLoaded":o.#at();break;case"handleUtilsFailure":o.#ut(s);break;case"handleAutoCountryLoaded":o.#ot();break;case"handleAutoCountryFailure":o.#rt();break}})}},jt=n=>{if(!u.utils&&!u.startedLoadingUtils){let t;if(typeof n=="function")try{t=Promise.resolve(n())}catch(e){return Promise.reject(e)}else return Promise.reject(new TypeError(`The argument passed to attachUtils must be a function that returns a promise for the utils module, not ${typeof n}`));return u.startedLoadingUtils=!0,t.then(e=>{let i=e?.default;if(!i||typeof i!="object")throw new TypeError("The loader function passed to attachUtils did not resolve to a module object with utils as its default export.");return u.utils=i,M.forEachInstance("handleUtilsLoaded"),!0}).catch(e=>{throw M.forEachInstance("handleUtilsFailure",e),e})}return null},u=Object.assign((n,t)=>{let e=new M(n,t);return u.instances.set(String(e.id),e),n.iti=e,e},{defaults:V,documentReady:()=>document.readyState==="complete",getCountryData:()=>O,getInstance:n=>{let t=n.dataset[A.INSTANCE_ID];return t?u.instances.get(t)??null:null},instances:new Map,attachUtils:jt,startedLoadingUtils:!1,startedLoadingAutoCountry:!1,version:"27.2.0"}),Vt=u;return Pt(Gt);})();
|
|
25
25
|
var intlTelInput = _factory.default;
|
package/dist/js/intlTelInput.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* International Telephone Input v27.
|
|
2
|
+
* International Telephone Input v27.2.0
|
|
3
3
|
* git+https://github.com/jackocnr/intl-tel-input.git
|
|
4
4
|
* Licensed under the MIT license
|
|
5
5
|
*/
|
|
@@ -4602,7 +4602,7 @@ var _factory = (() => {
|
|
|
4602
4602
|
attachUtils,
|
|
4603
4603
|
startedLoadingUtils: false,
|
|
4604
4604
|
startedLoadingAutoCountry: false,
|
|
4605
|
-
version: "27.
|
|
4605
|
+
version: "27.2.0"
|
|
4606
4606
|
}
|
|
4607
4607
|
);
|
|
4608
4608
|
var intlTelInput_default = intlTelInput;
|