@rpcbase/ui 0.245.0 → 0.246.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/dist/index149.js +5 -14
- package/dist/index149.js.map +1 -1
- package/dist/index150.js +63 -63
- package/dist/index150.js.map +1 -1
- package/dist/index151.js +2 -38
- package/dist/index151.js.map +1 -1
- package/dist/index152.js +385 -13
- package/dist/index152.js.map +1 -1
- package/dist/index153.js +261 -23
- package/dist/index153.js.map +1 -1
- package/dist/index154.js +58 -109
- package/dist/index154.js.map +1 -1
- package/dist/index155.js +47 -13
- package/dist/index155.js.map +1 -1
- package/dist/index156.js +169 -4
- package/dist/index156.js.map +1 -1
- package/dist/index157.js +110 -4
- package/dist/index157.js.map +1 -1
- package/dist/index158.js +25 -5
- package/dist/index158.js.map +1 -1
- package/dist/index159.js +8 -12
- package/dist/index159.js.map +1 -1
- package/dist/index160.js +4 -19
- package/dist/index160.js.map +1 -1
- package/dist/index161.js +6 -11
- package/dist/index161.js.map +1 -1
- package/dist/index162.js +4 -176
- package/dist/index162.js.map +1 -1
- package/dist/index163.js +476 -268
- package/dist/index163.js.map +1 -1
- package/dist/index164.js +189 -4
- package/dist/index164.js.map +1 -1
- package/dist/index165.js +14 -28
- package/dist/index165.js.map +1 -1
- package/dist/index166.js +105 -124
- package/dist/index166.js.map +1 -1
- package/dist/index167.js +262 -63
- package/dist/index167.js.map +1 -1
- package/dist/index168.js +6 -8
- package/dist/index168.js.map +1 -1
- package/dist/index169.js +40 -15
- package/dist/index169.js.map +1 -1
- package/dist/index170.js +4 -30
- package/dist/index170.js.map +1 -1
- package/dist/index171.js +14 -69
- package/dist/index171.js.map +1 -1
- package/dist/index172.js +68 -5
- package/dist/index172.js.map +1 -1
- package/dist/index173.js +35 -66
- package/dist/index173.js.map +1 -1
- package/dist/index174.js +14 -2
- package/dist/index174.js.map +1 -1
- package/dist/index175.js +22 -384
- package/dist/index175.js.map +1 -1
- package/dist/index176.js +108 -258
- package/dist/index176.js.map +1 -1
- package/dist/index177.js +13 -61
- package/dist/index177.js.map +1 -1
- package/dist/index178.js +4 -46
- package/dist/index178.js.map +1 -1
- package/dist/index179.js +4 -170
- package/dist/index179.js.map +1 -1
- package/dist/index180.js +5 -110
- package/dist/index180.js.map +1 -1
- package/dist/index181.js +11 -24
- package/dist/index181.js.map +1 -1
- package/dist/index182.js +20 -8
- package/dist/index182.js.map +1 -1
- package/dist/index183.js +11 -5
- package/dist/index183.js.map +1 -1
- package/dist/index184.js +176 -5
- package/dist/index184.js.map +1 -1
- package/dist/index185.js +279 -4
- package/dist/index185.js.map +1 -1
- package/dist/index186.js +4 -487
- package/dist/index186.js.map +1 -1
- package/dist/index187.js +27 -189
- package/dist/index187.js.map +1 -1
- package/dist/index188.js +126 -13
- package/dist/index188.js.map +1 -1
- package/dist/index189.js +63 -107
- package/dist/index189.js.map +1 -1
- package/dist/index190.js +8 -262
- package/dist/index190.js.map +1 -1
- package/dist/index191.js +16 -7
- package/dist/index191.js.map +1 -1
- package/dist/index192.js +29 -39
- package/dist/index192.js.map +1 -1
- package/dist/index193.js +69 -4
- package/dist/index193.js.map +1 -1
- package/dist/index254.js +20 -67
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +66 -8
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +6 -11
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +5 -8
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +11 -5
- package/dist/index258.js.map +1 -1
- package/dist/index259.js +3 -13
- package/dist/index259.js.map +1 -1
- package/dist/index260.js +50 -3
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +4 -4
- package/dist/index261.js.map +1 -1
- package/dist/index262.js +27 -97
- package/dist/index262.js.map +1 -1
- package/dist/index263.js +15 -16
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +5 -29
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +21 -51
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +53 -5
- package/dist/index266.js.map +1 -1
- package/dist/index267.js +20 -5
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +39 -59
- package/dist/index268.js.map +1 -1
- package/dist/index269.js +36 -63
- package/dist/index269.js.map +1 -1
- package/dist/index270.js +46 -134
- package/dist/index270.js.map +1 -1
- package/dist/index271.js +19 -7
- package/dist/index271.js.map +1 -1
- package/dist/index272.js +71 -5
- package/dist/index272.js.map +1 -1
- package/dist/index273.js +18 -4
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +3 -11
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +11 -21
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +13 -16
- package/dist/index276.js.map +1 -1
- package/dist/index277.js +17 -10
- package/dist/index277.js.map +1 -1
- package/dist/index278.js +37 -8
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +237 -142
- package/dist/index279.js.map +1 -1
- package/dist/index28.js +1 -1
- package/dist/index280.js +249 -76
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +68 -61
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +100 -15
- package/dist/index282.js.map +1 -1
- package/dist/index283.js +84 -20
- package/dist/index283.js.map +1 -1
- package/dist/index284.js +3 -6
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +29 -11
- package/dist/index285.js.map +1 -1
- package/dist/index286.js +16 -3
- package/dist/index286.js.map +1 -1
- package/dist/index287.js +34 -50
- package/dist/index287.js.map +1 -1
- package/dist/index288.js +16 -15
- package/dist/index288.js.map +1 -1
- package/dist/index289.js +3 -21
- package/dist/index289.js.map +1 -1
- package/dist/index29.js +1 -1
- package/dist/index290.js +26 -53
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +28 -20
- package/dist/index291.js.map +1 -1
- package/dist/index292.js +4 -42
- package/dist/index292.js.map +1 -1
- package/dist/index293.js +73 -34
- package/dist/index293.js.map +1 -1
- package/dist/index294.js +273 -46
- package/dist/index294.js.map +1 -1
- package/dist/index295.js +11 -20
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +11 -71
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +25 -17
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +16 -3
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +124 -12
- package/dist/index299.js.map +1 -1
- package/dist/index300.js +5 -18
- package/dist/index300.js.map +1 -1
- package/dist/index301.js +64 -35
- package/dist/index301.js.map +1 -1
- package/dist/index302.js +14 -240
- package/dist/index302.js.map +1 -1
- package/dist/index303.js +7 -252
- package/dist/index303.js.map +1 -1
- package/dist/index304.js +5 -68
- package/dist/index304.js.map +1 -1
- package/dist/index305.js +3 -83
- package/dist/index305.js.map +1 -1
- package/dist/index306.js +10 -3
- package/dist/index306.js.map +1 -1
- package/dist/index307.js +7 -29
- package/dist/index307.js.map +1 -1
- package/dist/index308.js +133 -16
- package/dist/index308.js.map +1 -1
- package/dist/index309.js +397 -32
- package/dist/index309.js.map +1 -1
- package/dist/index310.js +5 -18
- package/dist/index310.js.map +1 -1
- package/dist/index311.js +52 -3
- package/dist/index311.js.map +1 -1
- package/dist/index312.js +11 -26
- package/dist/index312.js.map +1 -1
- package/dist/index313.js +25 -26
- package/dist/index313.js.map +1 -1
- package/dist/index314.js +12 -4
- package/dist/index314.js.map +1 -1
- package/dist/index315.js +151 -75
- package/dist/index315.js.map +1 -1
- package/dist/index316.js +30 -270
- package/dist/index316.js.map +1 -1
- package/dist/index317.js +11 -11
- package/dist/index317.js.map +1 -1
- package/dist/index318.js +50 -11
- package/dist/index318.js.map +1 -1
- package/dist/index319.js +8 -24
- package/dist/index319.js.map +1 -1
- package/dist/index320.js +11 -16
- package/dist/index320.js.map +1 -1
- package/dist/index321.js +42 -124
- package/dist/index321.js.map +1 -1
- package/dist/index322.js +97 -5
- package/dist/index322.js.map +1 -1
- package/dist/index323.js +82 -61
- package/dist/index323.js.map +1 -1
- package/dist/index324.js +104 -12
- package/dist/index324.js.map +1 -1
- package/dist/index325.js +52 -7
- package/dist/index325.js.map +1 -1
- package/dist/index326.js +11 -5
- package/dist/index326.js.map +1 -1
- package/dist/index327.js +4 -3
- package/dist/index327.js.map +1 -1
- package/dist/index328.js +37 -10
- package/dist/index328.js.map +1 -1
- package/dist/index329.js +8 -7
- package/dist/index329.js.map +1 -1
- package/dist/index33.js +2 -2
- package/dist/index330.js +121 -385
- package/dist/index330.js.map +1 -1
- package/dist/index331.js +18 -5
- package/dist/index331.js.map +1 -1
- package/dist/index332.js +14 -51
- package/dist/index332.js.map +1 -1
- package/dist/index333.js +3 -11
- package/dist/index333.js.map +1 -1
- package/dist/index334.js +34 -25
- package/dist/index334.js.map +1 -1
- package/dist/index335.js +20 -11
- package/dist/index335.js.map +1 -1
- package/dist/index336.js +9 -154
- package/dist/index336.js.map +1 -1
- package/dist/index337.js +8 -32
- package/dist/index337.js.map +1 -1
- package/dist/index338.js +24 -11
- package/dist/index338.js.map +1 -1
- package/dist/index339.js +25 -46
- package/dist/index339.js.map +1 -1
- package/dist/index34.js +5 -5
- package/dist/index340.js +16 -9
- package/dist/index340.js.map +1 -1
- package/dist/index341.js +8 -11
- package/dist/index341.js.map +1 -1
- package/dist/index342.js +11 -43
- package/dist/index342.js.map +1 -1
- package/dist/index343.js +7 -96
- package/dist/index343.js.map +1 -1
- package/dist/index344.js +11 -84
- package/dist/index344.js.map +1 -1
- package/dist/index345.js +3 -105
- package/dist/index345.js.map +1 -1
- package/dist/index346.js +3 -52
- package/dist/index346.js.map +1 -1
- package/dist/index347.js +16 -10
- package/dist/index347.js.map +1 -1
- package/dist/index348.js +51 -4
- package/dist/index348.js.map +1 -1
- package/dist/index349.js +5 -37
- package/dist/index349.js.map +1 -1
- package/dist/index35.js +11 -11
- package/dist/index350.js +61 -8
- package/dist/index350.js.map +1 -1
- package/dist/index351.js +61 -130
- package/dist/index351.js.map +1 -1
- package/dist/index352.js +8 -17
- package/dist/index352.js.map +1 -1
- package/dist/index353.js +5 -16
- package/dist/index353.js.map +1 -1
- package/dist/index354.js +11 -3
- package/dist/index354.js.map +1 -1
- package/dist/index355.js +19 -34
- package/dist/index355.js.map +1 -1
- package/dist/index356.js +16 -20
- package/dist/index356.js.map +1 -1
- package/dist/index357.js +8 -10
- package/dist/index357.js.map +1 -1
- package/dist/index358.js +144 -8
- package/dist/index358.js.map +1 -1
- package/dist/index359.js +77 -22
- package/dist/index359.js.map +1 -1
- package/dist/index36.js +3 -3
- package/dist/index360.js +61 -28
- package/dist/index360.js.map +1 -1
- package/dist/index361.js +15 -17
- package/dist/index361.js.map +1 -1
- package/dist/index365.js +11 -8
- package/dist/index365.js.map +1 -1
- package/dist/index366.js +4 -27
- package/dist/index366.js.map +1 -1
- package/dist/index367.js +5 -137
- package/dist/index367.js.map +1 -1
- package/dist/index368.js +3 -13
- package/dist/index368.js.map +1 -1
- package/dist/index369.js +20 -46
- package/dist/index369.js.map +1 -1
- package/dist/index37.js +4 -4
- package/dist/index370.js +45 -4
- package/dist/index370.js.map +1 -1
- package/dist/index371.js +17 -21
- package/dist/index371.js.map +1 -1
- package/dist/index372.js +4 -75
- package/dist/index372.js.map +1 -1
- package/dist/index373.js +200 -11
- package/dist/index373.js.map +1 -1
- package/dist/index374.js +73 -3
- package/dist/index374.js.map +1 -1
- package/dist/index375.js +122 -72
- package/dist/index375.js.map +1 -1
- package/dist/index376.js +4 -200
- package/dist/index376.js.map +1 -1
- package/dist/index377.js +20 -71
- package/dist/index377.js.map +1 -1
- package/dist/index378.js +8 -35
- package/dist/index378.js.map +1 -1
- package/dist/index379.js +27 -7
- package/dist/index379.js.map +1 -1
- package/dist/index38.js +5 -5
- package/dist/index380.js +136 -14
- package/dist/index380.js.map +1 -1
- package/dist/index381.js +10 -121
- package/dist/index381.js.map +1 -1
- package/dist/index382.js +47 -4
- package/dist/index382.js.map +1 -1
- package/dist/index383.js +3 -11
- package/dist/index383.js.map +1 -1
- package/dist/index384.js +21 -5
- package/dist/index384.js.map +1 -1
- package/dist/index385.js +76 -3
- package/dist/index385.js.map +1 -1
- package/dist/index386.js +12 -21
- package/dist/index386.js.map +1 -1
- package/dist/index387.js +4 -45
- package/dist/index387.js.map +1 -1
- package/dist/index388.js +70 -16
- package/dist/index388.js.map +1 -1
- package/dist/index389.js +36 -5
- package/dist/index389.js.map +1 -1
- package/dist/index39.js +3 -3
- package/dist/index390.js +7 -5
- package/dist/index390.js.map +1 -1
- package/dist/index391.js +15 -20
- package/dist/index391.js.map +1 -1
- package/dist/index40.js +10 -10
- package/dist/index409.js +3 -3
- package/dist/index409.js.map +1 -1
- package/dist/index410.js +3 -15
- package/dist/index410.js.map +1 -1
- package/dist/index411.js +3 -492
- package/dist/index411.js.map +1 -1
- package/dist/index412.js +15 -3
- package/dist/index412.js.map +1 -1
- package/dist/index413.js +492 -3
- package/dist/index413.js.map +1 -1
- package/dist/index417.js +1 -1
- package/dist/index419.js +1 -1
- package/dist/index420.js +2 -2
- package/dist/index421.js +7 -32
- package/dist/index421.js.map +1 -1
- package/dist/index422.js +2 -8
- package/dist/index422.js.map +1 -1
- package/dist/index423.js +44 -2
- package/dist/index423.js.map +1 -1
- package/dist/index424.js +52 -40
- package/dist/index424.js.map +1 -1
- package/dist/index425.js +7 -55
- package/dist/index425.js.map +1 -1
- package/dist/index426.js +2 -8
- package/dist/index426.js.map +1 -1
- package/dist/index427.js +55 -2
- package/dist/index427.js.map +1 -1
- package/dist/index428.js +53 -52
- package/dist/index428.js.map +1 -1
- package/dist/index429.js +32 -55
- package/dist/index429.js.map +1 -1
- package/dist/index430.js +2 -16
- package/dist/index430.js.map +1 -1
- package/dist/index431.js +2 -29
- package/dist/index431.js.map +1 -1
- package/dist/index432.js +2 -13
- package/dist/index432.js.map +1 -1
- package/dist/index433.js +2 -7
- package/dist/index433.js.map +1 -1
- package/dist/index434.js +16 -2
- package/dist/index434.js.map +1 -1
- package/dist/index435.js +29 -2
- package/dist/index435.js.map +1 -1
- package/dist/index436.js +13 -2
- package/dist/index436.js.map +1 -1
- package/dist/index437.js +7 -2
- package/dist/index437.js.map +1 -1
- package/dist/index47.js +2 -2
- package/dist/index48.js +36 -36
- package/dist/index49.js +29 -29
- package/dist/index50.js +2 -2
- package/dist/index51.js +12 -12
- package/dist/index52.js +4 -4
- package/dist/index53.js +1 -1
- package/dist/index54.js +21 -21
- package/dist/index55.js +5 -5
- package/dist/index56.js +5 -5
- package/dist/index57.js +8 -8
- package/dist/index58.js +5 -5
- package/dist/index59.js +17 -17
- package/dist/index60.js +5 -5
- package/dist/index61.js +3 -3
- package/dist/index64.js +5 -5
- package/dist/index64.js.map +1 -1
- package/dist/index66.js +10 -22
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +17 -232
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +5 -5
- package/dist/index68.js.map +1 -1
- package/dist/index70.js +22 -10
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +232 -17
- package/dist/index71.js.map +1 -1
- package/dist/index76.js +1 -1
- package/dist/index77.js +2 -2
- package/dist/index78.js +2 -2
- package/package.json +1 -1
package/dist/index163.js
CHANGED
|
@@ -1,283 +1,491 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import { ownerDocument as O } from "./index306.js";
|
|
12
|
-
import { FocusGuard as Te } from "./index366.js";
|
|
13
|
-
import { isTypeableCombobox as xe, getFloatingFocusElement as ye, isTypeableElement as $e } from "./index312.js";
|
|
14
|
-
import { isVirtualClick as ze, isVirtualPointerEvent as Je, stopEvent as Qe } from "./index334.js";
|
|
15
|
-
import { isOutsideEvent as Ie, getNextTabbable as Xe, getPreviousTabbable as Ye, tabbable as De, isTabbable as ie, focusable as Ze } from "./index367.js";
|
|
16
|
-
import { getNodeAncestors as ve, getNodeChildren as he } from "./index368.js";
|
|
17
|
-
import { isElementVisible as et } from "./index369.js";
|
|
18
|
-
import { createChangeEventDetails as tt } from "./index153.js";
|
|
19
|
-
import { createAttribute as Ae } from "./index370.js";
|
|
20
|
-
import { enqueueFocus as se } from "./index371.js";
|
|
21
|
-
import { markOthers as Ce } from "./index372.js";
|
|
22
|
-
import { usePortalContext as nt } from "./index166.js";
|
|
23
|
-
import { useFloatingTree as rt } from "./index373.js";
|
|
24
|
-
import { CLICK_TRIGGER_IDENTIFIER as ot } from "./index169.js";
|
|
25
|
-
import { resolveRef as w } from "./index374.js";
|
|
26
|
-
import { j as ue } from "./index28.js";
|
|
27
|
-
import { activeElement as N, contains as c, getTarget as z } from "./index313.js";
|
|
28
|
-
import { triggerHover as st, outsidePress as ut, focusOut as it } from "./index155.js";
|
|
29
|
-
import { webkit as ct } from "./index331.js";
|
|
30
|
-
function ft(n, D) {
|
|
31
|
-
const M = Be(z(n));
|
|
32
|
-
return n instanceof M.KeyboardEvent ? "keyboard" : n instanceof M.FocusEvent ? D || "keyboard" : "pointerType" in n ? n.pointerType || "keyboard" : "touches" in n ? "touch" : n instanceof M.MouseEvent ? D || (n.detail === 0 ? "keyboard" : "mouse") : "";
|
|
1
|
+
import h from "./index326.js";
|
|
2
|
+
import l from "./index170.js";
|
|
3
|
+
import v from "./index327.js";
|
|
4
|
+
function o(n) {
|
|
5
|
+
"@babel/helpers - typeof";
|
|
6
|
+
return o = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
7
|
+
return typeof t;
|
|
8
|
+
} : function(t) {
|
|
9
|
+
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
10
|
+
}, o(n);
|
|
33
11
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
function ce() {
|
|
37
|
-
S = S.filter((n) => n.deref()?.isConnected);
|
|
12
|
+
function u(n, t) {
|
|
13
|
+
if (!(n instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
38
14
|
}
|
|
39
|
-
function
|
|
40
|
-
|
|
15
|
+
function d(n, t) {
|
|
16
|
+
for (var e = 0; e < t.length; e++) {
|
|
17
|
+
var a = t[e];
|
|
18
|
+
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(n, P(a.key), a);
|
|
19
|
+
}
|
|
41
20
|
}
|
|
42
|
-
function
|
|
43
|
-
return
|
|
21
|
+
function s(n, t, e) {
|
|
22
|
+
return t && d(n.prototype, t), Object.defineProperty(n, "prototype", { writable: !1 }), n;
|
|
44
23
|
}
|
|
45
|
-
function
|
|
46
|
-
|
|
24
|
+
function P(n) {
|
|
25
|
+
var t = C(n, "string");
|
|
26
|
+
return o(t) == "symbol" ? t : t + "";
|
|
47
27
|
}
|
|
48
|
-
function
|
|
49
|
-
if (n
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
28
|
+
function C(n, t) {
|
|
29
|
+
if (o(n) != "object" || !n) return n;
|
|
30
|
+
var e = n[Symbol.toPrimitive];
|
|
31
|
+
if (e !== void 0) {
|
|
32
|
+
var a = e.call(n, t);
|
|
33
|
+
if (o(a) != "object") return a;
|
|
34
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
35
|
+
}
|
|
36
|
+
return String(n);
|
|
56
37
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
closeOnFocusOut: L = !0,
|
|
67
|
-
openInteractionType: Me = "",
|
|
68
|
-
nextFocusableElement: j,
|
|
69
|
-
previousFocusableElement: H,
|
|
70
|
-
beforeContentFocusGuardRef: Pe,
|
|
71
|
-
externalTree: Ge,
|
|
72
|
-
getInsideElements: Ve
|
|
73
|
-
} = n, v = "rootStore" in D ? D.rootStore : D, T = v.useState("open"), d = v.useState("domReferenceElement"), i = v.useState("floatingElement"), {
|
|
74
|
-
events: X,
|
|
75
|
-
dataRef: G
|
|
76
|
-
} = v.context, V = oe(() => G.current.floatingContext?.nodeId), qe = P === !1, h = xe(d) && qe, fe = $(P), Y = $(J), _ = $(Me), ae = $(T), x = rt(Ge), s = nt(), y = E.useRef(!1), K = E.useRef(!1), Z = E.useRef(!1), le = E.useRef(null), de = E.useRef(""), ee = E.useRef(""), te = E.useRef(null), ne = E.useRef(null), Le = Ee(te, Pe, s?.beforeInsideRef), je = Ee(ne, s?.afterInsideRef), me = Fe(), B = Fe(), be = Ue(), He = s != null, o = ye(i), C = oe((r = o) => r ? De(r) : []), k = oe(() => Ve?.().filter((r) => r != null) ?? []);
|
|
77
|
-
E.useEffect(() => {
|
|
78
|
-
if (f || !g)
|
|
79
|
-
return;
|
|
80
|
-
function r(b) {
|
|
81
|
-
b.key === "Tab" && c(o, N(O(o))) && C().length === 0 && !h && Qe(b);
|
|
82
|
-
}
|
|
83
|
-
const a = O(o);
|
|
84
|
-
return I(a, "keydown", r);
|
|
85
|
-
}, [f, o, g, h, C]), E.useEffect(() => {
|
|
86
|
-
if (f || !T)
|
|
87
|
-
return;
|
|
88
|
-
const r = O(o);
|
|
89
|
-
function a() {
|
|
90
|
-
Z.current = !1;
|
|
91
|
-
}
|
|
92
|
-
function b(A) {
|
|
93
|
-
const e = z(A), u = k(), t = c(i, e) || c(d, e) || c(s?.portalNode, e) || u.some((l) => l === e || c(l, e));
|
|
94
|
-
Z.current = !t, ee.current = A.pointerType || "keyboard", e?.closest(`[${ot}]`) && (K.current = !0, B.start(0, () => {
|
|
95
|
-
K.current = !1;
|
|
96
|
-
}));
|
|
97
|
-
}
|
|
98
|
-
function p() {
|
|
99
|
-
ee.current = "keyboard";
|
|
100
|
-
}
|
|
101
|
-
return ge(
|
|
102
|
-
I(r, "pointerdown", b, !0),
|
|
103
|
-
I(r, "pointerup", a, !0),
|
|
104
|
-
I(r, "pointercancel", a, !0),
|
|
105
|
-
I(r, "keydown", p, !0),
|
|
106
|
-
// Avoid a stale `true` leaking into the next open (e.g. keep-mounted popups)
|
|
107
|
-
// if the popup dismissed between pointerdown and pointerup.
|
|
108
|
-
a
|
|
109
|
-
);
|
|
110
|
-
}, [f, i, d, o, T, s, B, k]), E.useEffect(() => {
|
|
111
|
-
if (f || !L)
|
|
112
|
-
return;
|
|
113
|
-
const r = O(o);
|
|
114
|
-
function a() {
|
|
115
|
-
K.current = !0, B.start(0, () => {
|
|
116
|
-
K.current = !1;
|
|
38
|
+
var p = "1.2.0", b = "1.7.35", g = " ext. ", F = /* @__PURE__ */ (function() {
|
|
39
|
+
function n(t) {
|
|
40
|
+
u(this, n), N(t), this.metadata = t, m.call(this, t);
|
|
41
|
+
}
|
|
42
|
+
return s(n, [{
|
|
43
|
+
key: "getCountries",
|
|
44
|
+
value: function() {
|
|
45
|
+
return Object.keys(this.metadata.countries).filter(function(e) {
|
|
46
|
+
return e !== "001";
|
|
117
47
|
});
|
|
118
48
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
function p(u) {
|
|
124
|
-
const t = u.relatedTarget, l = u.currentTarget, R = z(u);
|
|
125
|
-
g && t == null && R != null && c(i, R) && Oe(R), queueMicrotask(() => {
|
|
126
|
-
const F = V(), U = v.context.triggerElements, Ke = k(), We = t?.hasAttribute(Ae("focus-guard")) && [te.current, ne.current, s?.beforeInsideRef.current, s?.afterInsideRef.current, s?.beforeOutsideRef.current, s?.afterOutsideRef.current, w(H), w(j)].includes(t), _e = !(c(d, t) || c(i, t) || c(t, i) || c(s?.portalNode, t) || Ke.some((m) => m === t || c(m, t)) || t != null && U.hasElement(t) || U.hasMatchingElement((m) => c(m, t)) || We || x && (he(x.nodesRef.current, F).find((m) => c(m.context?.elements.floating, t) || c(m.context?.elements.domReference, t)) || ve(x.nodesRef.current, F).find((m) => [m.context?.elements.floating, ye(m.context?.elements.floating)].includes(t) || m.context?.elements.domReference === t)));
|
|
127
|
-
if (l === d && o && Ne(o), Q && l !== d && !et(R) && N(r) === r.body) {
|
|
128
|
-
if (q(o) && (o.focus(), Q === "popup")) {
|
|
129
|
-
be.request(() => {
|
|
130
|
-
o.focus();
|
|
131
|
-
});
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
const m = C(), re = le.current, Re = (re && m.includes(re) ? re : null) || m[m.length - 1] || o;
|
|
135
|
-
q(Re) && Re.focus();
|
|
136
|
-
}
|
|
137
|
-
if (G.current.insideReactTree) {
|
|
138
|
-
G.current.insideReactTree = !1;
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
(h || !g) && t && _e && !K.current && // Fix React 18 Strict Mode returnFocus due to double rendering.
|
|
142
|
-
// For an "untrapped" typeable combobox (input role=combobox with
|
|
143
|
-
// initialFocus=false), re-opening the popup and tabbing out should still close it even
|
|
144
|
-
// when the previously focused element (e.g. the next tabbable outside the popup) is
|
|
145
|
-
// focused again. Otherwise, the popup remains open on the second Tab sequence:
|
|
146
|
-
// click input -> Tab (closes) -> click input -> Tab.
|
|
147
|
-
// Allow closing when `isUntrappedTypeableCombobox` regardless of the previously focused element.
|
|
148
|
-
(h || t !== we()) && (y.current = !0, v.setOpen(!1, tt(it, u)));
|
|
149
|
-
});
|
|
49
|
+
}, {
|
|
50
|
+
key: "getCountryMetadata",
|
|
51
|
+
value: function(e) {
|
|
52
|
+
return this.metadata.countries[e];
|
|
150
53
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
const b = fe.current, p = typeof b == "function" ? b(_.current || "") : b;
|
|
175
|
-
if (p === void 0 || p === !1 || c(o, a))
|
|
176
|
-
return;
|
|
177
|
-
let e = null;
|
|
178
|
-
const u = () => (e == null && (e = C(o)), e[0] || o);
|
|
179
|
-
let t;
|
|
180
|
-
p === !0 || p === null ? t = u() : t = w(p), t = t || u();
|
|
181
|
-
const l = c(o, N(r));
|
|
182
|
-
se(t, {
|
|
183
|
-
preventScroll: t === o,
|
|
184
|
-
shouldFocus() {
|
|
185
|
-
if (!ae.current)
|
|
186
|
-
return !1;
|
|
187
|
-
if (l)
|
|
188
|
-
return !0;
|
|
189
|
-
const R = N(r);
|
|
190
|
-
return !(R !== t && c(o, R));
|
|
191
|
-
}
|
|
192
|
-
});
|
|
193
|
-
});
|
|
194
|
-
}, [f, T, o, C, fe, _, ae]), W(() => {
|
|
195
|
-
if (f || !o)
|
|
196
|
-
return;
|
|
197
|
-
const r = O(o), a = N(r), b = _.current == null;
|
|
198
|
-
Oe(a);
|
|
199
|
-
function p(e) {
|
|
200
|
-
if (e.open || (de.current = ft(e.nativeEvent, ee.current)), e.reason === st && e.nativeEvent.type === "mouseleave" && (y.current = !0), e.reason === ut)
|
|
201
|
-
if (e.nested)
|
|
202
|
-
y.current = !1;
|
|
203
|
-
else if (ze(e.nativeEvent) || Je(e.nativeEvent))
|
|
204
|
-
y.current = !1;
|
|
205
|
-
else {
|
|
206
|
-
let u = !1;
|
|
207
|
-
O(o).createElement("div").focus({
|
|
208
|
-
get preventScroll() {
|
|
209
|
-
return u = !0, !1;
|
|
210
|
-
}
|
|
211
|
-
}), u ? y.current = !1 : y.current = !0;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
X.on("openchange", p);
|
|
215
|
-
function A() {
|
|
216
|
-
const e = Y.current;
|
|
217
|
-
let u = typeof e == "function" ? e(de.current) : e;
|
|
218
|
-
if (u === void 0 || u === !1)
|
|
219
|
-
return null;
|
|
220
|
-
u === null && (u = !0);
|
|
221
|
-
const t = d?.isConnected ? d : null, l = a?.isConnected && Se(a) !== "body" ? a : null;
|
|
222
|
-
let R = b ? l || t : t || l;
|
|
223
|
-
return R || (R = we() || null), typeof u == "boolean" ? R : w(u) || R || null;
|
|
224
|
-
}
|
|
225
|
-
return () => {
|
|
226
|
-
X.off("openchange", p);
|
|
227
|
-
const e = N(r), u = k(), t = c(i, e) || u.some((F) => F === e || c(F, e)) || x && he(x.nodesRef.current, V(), !1).some((F) => c(F.context?.elements.floating, e)), l = Y.current, R = A();
|
|
228
|
-
queueMicrotask(() => {
|
|
229
|
-
const F = at(R), U = typeof l != "boolean";
|
|
230
|
-
l && !y.current && q(F) && // If the focus moved somewhere else after mount, avoid returning focus
|
|
231
|
-
// since it likely entered a different element which should be
|
|
232
|
-
// respected: https://github.com/floating-ui/floating-ui/issues/2607
|
|
233
|
-
(!(!U && F !== e && e !== r.body) || t) && F.focus({
|
|
234
|
-
preventScroll: !0
|
|
235
|
-
}), y.current = !1;
|
|
236
|
-
});
|
|
237
|
-
};
|
|
238
|
-
}, [f, i, o, Y, _, X, x, d, V, k]), W(() => {
|
|
239
|
-
if (!ct || T || !i)
|
|
240
|
-
return;
|
|
241
|
-
const r = N(O(i));
|
|
242
|
-
!q(r) || !$e(r) || c(i, r) && r.blur();
|
|
243
|
-
}, [T, i]), W(() => {
|
|
244
|
-
if (!(f || !s))
|
|
245
|
-
return s.setFocusManagerState({
|
|
246
|
-
modal: g,
|
|
247
|
-
closeOnFocusOut: L,
|
|
248
|
-
open: T,
|
|
249
|
-
onOpenChange: v.setOpen,
|
|
250
|
-
domReference: d
|
|
251
|
-
}), () => {
|
|
252
|
-
s.setFocusManagerState(null);
|
|
253
|
-
};
|
|
254
|
-
}, [f, s, g, T, v, L, d]), W(() => {
|
|
255
|
-
if (!(f || !o))
|
|
256
|
-
return Ne(o), () => {
|
|
257
|
-
queueMicrotask(ce);
|
|
258
|
-
};
|
|
259
|
-
}, [f, o]);
|
|
260
|
-
const pe = !f && (g ? !h : !0) && (He || g);
|
|
261
|
-
return /* @__PURE__ */ ue.jsxs(E.Fragment, {
|
|
262
|
-
children: [pe && /* @__PURE__ */ ue.jsx(Te, {
|
|
263
|
-
"data-type": "inside",
|
|
264
|
-
ref: Le,
|
|
265
|
-
onFocus: (r) => {
|
|
266
|
-
if (g) {
|
|
267
|
-
const a = C();
|
|
268
|
-
se(a[a.length - 1]);
|
|
269
|
-
} else s?.portalNode && (y.current = !1, Ie(r, s.portalNode) ? Xe(d)?.focus() : w(H ?? s.beforeOutsideRef)?.focus());
|
|
54
|
+
}, {
|
|
55
|
+
key: "nonGeographic",
|
|
56
|
+
value: function() {
|
|
57
|
+
if (!(this.v1 || this.v2 || this.v3))
|
|
58
|
+
return this.metadata.nonGeographic || this.metadata.nonGeographical;
|
|
59
|
+
}
|
|
60
|
+
}, {
|
|
61
|
+
key: "hasCountry",
|
|
62
|
+
value: function(e) {
|
|
63
|
+
return this.getCountryMetadata(e) !== void 0;
|
|
64
|
+
}
|
|
65
|
+
}, {
|
|
66
|
+
key: "hasCallingCode",
|
|
67
|
+
value: function(e) {
|
|
68
|
+
if (this.getCountryCodesForCallingCode(e))
|
|
69
|
+
return !0;
|
|
70
|
+
if (this.nonGeographic()) {
|
|
71
|
+
if (this.nonGeographic()[e])
|
|
72
|
+
return !0;
|
|
73
|
+
} else {
|
|
74
|
+
var a = this.countryCallingCodes()[e];
|
|
75
|
+
if (a && a.length === 1 && a[0] === "001")
|
|
76
|
+
return !0;
|
|
270
77
|
}
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
78
|
+
}
|
|
79
|
+
}, {
|
|
80
|
+
key: "isNonGeographicCallingCode",
|
|
81
|
+
value: function(e) {
|
|
82
|
+
return this.nonGeographic() ? !!this.nonGeographic()[e] : !this.getCountryCodesForCallingCode(e);
|
|
83
|
+
}
|
|
84
|
+
// Deprecated.
|
|
85
|
+
}, {
|
|
86
|
+
key: "country",
|
|
87
|
+
value: function(e) {
|
|
88
|
+
return this.selectNumberingPlan(e);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Selects a telephone numbering plan based on either a country code or a calling code.
|
|
92
|
+
* @param {string} argument — Country code or calling code.
|
|
93
|
+
* @param {string} legacyArgumentCallingCode — Legacy argument: calling code, if the first argument is not passed.
|
|
94
|
+
*/
|
|
95
|
+
}, {
|
|
96
|
+
key: "selectNumberingPlan",
|
|
97
|
+
value: function(e, a) {
|
|
98
|
+
var i, r;
|
|
99
|
+
if (e && (v(e) ? r = e : i = e), a && (r = a), i && i !== "001") {
|
|
100
|
+
var f = this.getCountryMetadata(i);
|
|
101
|
+
if (!f)
|
|
102
|
+
throw new Error("Unknown country: ".concat(i));
|
|
103
|
+
this.numberingPlan = new c(f, this);
|
|
104
|
+
} else if (r) {
|
|
105
|
+
if (!this.hasCallingCode(r))
|
|
106
|
+
throw new Error("Unknown calling code: ".concat(r));
|
|
107
|
+
this.numberingPlan = new c(this.getNumberingPlanMetadata(r), this);
|
|
108
|
+
} else
|
|
109
|
+
this.numberingPlan = void 0;
|
|
110
|
+
return this;
|
|
111
|
+
}
|
|
112
|
+
}, {
|
|
113
|
+
key: "getCountryCodesForCallingCode",
|
|
114
|
+
value: function(e) {
|
|
115
|
+
var a = this.countryCallingCodes()[e];
|
|
116
|
+
if (a)
|
|
117
|
+
return a.length === 1 && a[0].length === 3 ? void 0 : a;
|
|
118
|
+
}
|
|
119
|
+
}, {
|
|
120
|
+
key: "getCountryCodeForCallingCode",
|
|
121
|
+
value: function(e) {
|
|
122
|
+
var a = this.getCountryCodesForCallingCode(e);
|
|
123
|
+
if (a)
|
|
124
|
+
return a[0];
|
|
125
|
+
}
|
|
126
|
+
}, {
|
|
127
|
+
key: "getNumberingPlanMetadata",
|
|
128
|
+
value: function(e) {
|
|
129
|
+
var a = this.getCountryCodeForCallingCode(e);
|
|
130
|
+
if (a)
|
|
131
|
+
return this.getCountryMetadata(a);
|
|
132
|
+
if (this.nonGeographic()) {
|
|
133
|
+
var i = this.nonGeographic()[e];
|
|
134
|
+
if (i)
|
|
135
|
+
return i;
|
|
136
|
+
} else {
|
|
137
|
+
var r = this.countryCallingCodes()[e];
|
|
138
|
+
if (r && r.length === 1 && r[0] === "001")
|
|
139
|
+
return this.metadata.countries["001"];
|
|
276
140
|
}
|
|
277
|
-
}
|
|
278
|
-
|
|
141
|
+
}
|
|
142
|
+
// Deprecated.
|
|
143
|
+
}, {
|
|
144
|
+
key: "countryCallingCode",
|
|
145
|
+
value: function() {
|
|
146
|
+
return this.numberingPlan.callingCode();
|
|
147
|
+
}
|
|
148
|
+
// Deprecated.
|
|
149
|
+
}, {
|
|
150
|
+
key: "IDDPrefix",
|
|
151
|
+
value: function() {
|
|
152
|
+
return this.numberingPlan.IDDPrefix();
|
|
153
|
+
}
|
|
154
|
+
// Deprecated.
|
|
155
|
+
}, {
|
|
156
|
+
key: "defaultIDDPrefix",
|
|
157
|
+
value: function() {
|
|
158
|
+
return this.numberingPlan.defaultIDDPrefix();
|
|
159
|
+
}
|
|
160
|
+
// Deprecated.
|
|
161
|
+
}, {
|
|
162
|
+
key: "nationalNumberPattern",
|
|
163
|
+
value: function() {
|
|
164
|
+
return this.numberingPlan.nationalNumberPattern();
|
|
165
|
+
}
|
|
166
|
+
// Deprecated.
|
|
167
|
+
}, {
|
|
168
|
+
key: "possibleLengths",
|
|
169
|
+
value: function() {
|
|
170
|
+
return this.numberingPlan.possibleLengths();
|
|
171
|
+
}
|
|
172
|
+
// Deprecated.
|
|
173
|
+
}, {
|
|
174
|
+
key: "formats",
|
|
175
|
+
value: function() {
|
|
176
|
+
return this.numberingPlan.formats();
|
|
177
|
+
}
|
|
178
|
+
// Deprecated.
|
|
179
|
+
}, {
|
|
180
|
+
key: "nationalPrefixForParsing",
|
|
181
|
+
value: function() {
|
|
182
|
+
return this.numberingPlan.nationalPrefixForParsing();
|
|
183
|
+
}
|
|
184
|
+
// Deprecated.
|
|
185
|
+
}, {
|
|
186
|
+
key: "nationalPrefixTransformRule",
|
|
187
|
+
value: function() {
|
|
188
|
+
return this.numberingPlan.nationalPrefixTransformRule();
|
|
189
|
+
}
|
|
190
|
+
// Deprecated.
|
|
191
|
+
}, {
|
|
192
|
+
key: "leadingDigits",
|
|
193
|
+
value: function() {
|
|
194
|
+
return this.numberingPlan.leadingDigits();
|
|
195
|
+
}
|
|
196
|
+
// Deprecated.
|
|
197
|
+
}, {
|
|
198
|
+
key: "hasTypes",
|
|
199
|
+
value: function() {
|
|
200
|
+
return this.numberingPlan.hasTypes();
|
|
201
|
+
}
|
|
202
|
+
// Deprecated.
|
|
203
|
+
}, {
|
|
204
|
+
key: "type",
|
|
205
|
+
value: function(e) {
|
|
206
|
+
return this.numberingPlan.type(e);
|
|
207
|
+
}
|
|
208
|
+
// Deprecated.
|
|
209
|
+
}, {
|
|
210
|
+
key: "ext",
|
|
211
|
+
value: function() {
|
|
212
|
+
return this.numberingPlan.ext();
|
|
213
|
+
}
|
|
214
|
+
}, {
|
|
215
|
+
key: "countryCallingCodes",
|
|
216
|
+
value: function() {
|
|
217
|
+
return this.v1 ? this.metadata.country_phone_code_to_countries : this.metadata.country_calling_codes;
|
|
218
|
+
}
|
|
219
|
+
// Deprecated.
|
|
220
|
+
}, {
|
|
221
|
+
key: "chooseCountryByCountryCallingCode",
|
|
222
|
+
value: function(e) {
|
|
223
|
+
return this.selectNumberingPlan(e);
|
|
224
|
+
}
|
|
225
|
+
}, {
|
|
226
|
+
key: "hasSelectedNumberingPlan",
|
|
227
|
+
value: function() {
|
|
228
|
+
return this.numberingPlan !== void 0;
|
|
229
|
+
}
|
|
230
|
+
}]);
|
|
231
|
+
})(), c = /* @__PURE__ */ (function() {
|
|
232
|
+
function n(t, e) {
|
|
233
|
+
u(this, n), this.globalMetadataObject = e, this.metadata = t, m.call(this, e.metadata);
|
|
234
|
+
}
|
|
235
|
+
return s(n, [{
|
|
236
|
+
key: "callingCode",
|
|
237
|
+
value: function() {
|
|
238
|
+
return this.metadata[0];
|
|
239
|
+
}
|
|
240
|
+
// When multiple countries share the same calling code,
|
|
241
|
+
// all phone number formatting rules are included in the metadata
|
|
242
|
+
// of the "default" country for that calling code.
|
|
243
|
+
// Any other countries' metdata doesn't include any formatting rules.
|
|
244
|
+
// Google developers said that such storage architecture was chosen for performance reasons.
|
|
245
|
+
//
|
|
246
|
+
// For example, for NANPA region ("North American Numbering Plan Administration",
|
|
247
|
+
// which includes USA, Canada, Cayman Islands, Bahamas, etc) all formatting rules
|
|
248
|
+
// are contained in the metadata of `US` country.
|
|
249
|
+
//
|
|
250
|
+
// This is not public API.
|
|
251
|
+
//
|
|
252
|
+
}, {
|
|
253
|
+
key: "_getDefaultCountryMetadataForThisCallingCode",
|
|
254
|
+
value: function() {
|
|
255
|
+
return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode());
|
|
256
|
+
}
|
|
257
|
+
// Deprecated.
|
|
258
|
+
}, {
|
|
259
|
+
key: "getDefaultCountryMetadataForRegion",
|
|
260
|
+
value: function() {
|
|
261
|
+
return this._getDefaultCountryMetadataForThisCallingCode();
|
|
262
|
+
}
|
|
263
|
+
// Is always present.
|
|
264
|
+
}, {
|
|
265
|
+
key: "IDDPrefix",
|
|
266
|
+
value: function() {
|
|
267
|
+
if (!(this.v1 || this.v2))
|
|
268
|
+
return this.metadata[1];
|
|
269
|
+
}
|
|
270
|
+
// Is only present when a country supports multiple IDD prefixes.
|
|
271
|
+
}, {
|
|
272
|
+
key: "defaultIDDPrefix",
|
|
273
|
+
value: function() {
|
|
274
|
+
if (!(this.v1 || this.v2))
|
|
275
|
+
return this.metadata[12];
|
|
276
|
+
}
|
|
277
|
+
}, {
|
|
278
|
+
key: "nationalNumberPattern",
|
|
279
|
+
value: function() {
|
|
280
|
+
return this.v1 || this.v2 ? this.metadata[1] : this.metadata[2];
|
|
281
|
+
}
|
|
282
|
+
// "possible length" data is always present in Google's metadata.
|
|
283
|
+
}, {
|
|
284
|
+
key: "possibleLengths",
|
|
285
|
+
value: function() {
|
|
286
|
+
if (!this.v1)
|
|
287
|
+
return this.metadata[this.v2 ? 2 : 3];
|
|
288
|
+
}
|
|
289
|
+
}, {
|
|
290
|
+
key: "_getFormats",
|
|
291
|
+
value: function(e) {
|
|
292
|
+
return e[this.v1 ? 2 : this.v2 ? 3 : 4];
|
|
293
|
+
}
|
|
294
|
+
// For countries of the same region (e.g. NANPA)
|
|
295
|
+
// formats are all stored in the "main" country for that region.
|
|
296
|
+
// E.g. "RU" and "KZ", "US" and "CA".
|
|
297
|
+
}, {
|
|
298
|
+
key: "formats",
|
|
299
|
+
value: function() {
|
|
300
|
+
var e = this, a = this._getFormats(this.metadata) || this._getFormats(this._getDefaultCountryMetadataForThisCallingCode()) || [];
|
|
301
|
+
return a.map(function(i) {
|
|
302
|
+
return new k(i, e);
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
}, {
|
|
306
|
+
key: "nationalPrefix",
|
|
307
|
+
value: function() {
|
|
308
|
+
return this.metadata[this.v1 ? 3 : this.v2 ? 4 : 5];
|
|
309
|
+
}
|
|
310
|
+
}, {
|
|
311
|
+
key: "_getNationalPrefixFormattingRule",
|
|
312
|
+
value: function(e) {
|
|
313
|
+
return e[this.v1 ? 4 : this.v2 ? 5 : 6];
|
|
314
|
+
}
|
|
315
|
+
// For countries of the same region (e.g. NANPA)
|
|
316
|
+
// national prefix formatting rule is stored in the "main" country for that region.
|
|
317
|
+
// E.g. "RU" and "KZ", "US" and "CA".
|
|
318
|
+
}, {
|
|
319
|
+
key: "nationalPrefixFormattingRule",
|
|
320
|
+
value: function() {
|
|
321
|
+
return this._getNationalPrefixFormattingRule(this.metadata) || this._getNationalPrefixFormattingRule(this._getDefaultCountryMetadataForThisCallingCode());
|
|
322
|
+
}
|
|
323
|
+
}, {
|
|
324
|
+
key: "_nationalPrefixForParsing",
|
|
325
|
+
value: function() {
|
|
326
|
+
return this.metadata[this.v1 ? 5 : this.v2 ? 6 : 7];
|
|
327
|
+
}
|
|
328
|
+
}, {
|
|
329
|
+
key: "nationalPrefixForParsing",
|
|
330
|
+
value: function() {
|
|
331
|
+
return this._nationalPrefixForParsing() || this.nationalPrefix();
|
|
332
|
+
}
|
|
333
|
+
}, {
|
|
334
|
+
key: "nationalPrefixTransformRule",
|
|
335
|
+
value: function() {
|
|
336
|
+
return this.metadata[this.v1 ? 6 : this.v2 ? 7 : 8];
|
|
337
|
+
}
|
|
338
|
+
}, {
|
|
339
|
+
key: "_getNationalPrefixIsOptionalWhenFormatting",
|
|
340
|
+
value: function() {
|
|
341
|
+
return !!this.metadata[this.v1 ? 7 : this.v2 ? 8 : 9];
|
|
342
|
+
}
|
|
343
|
+
// For countries of the same region (e.g. NANPA)
|
|
344
|
+
// "national prefix is optional when formatting" flag is
|
|
345
|
+
// stored in the "main" country for that region.
|
|
346
|
+
// E.g. "RU" and "KZ", "US" and "CA".
|
|
347
|
+
}, {
|
|
348
|
+
key: "nationalPrefixIsOptionalWhenFormattingInNationalFormat",
|
|
349
|
+
value: function() {
|
|
350
|
+
return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata) || this._getNationalPrefixIsOptionalWhenFormatting(this._getDefaultCountryMetadataForThisCallingCode());
|
|
351
|
+
}
|
|
352
|
+
}, {
|
|
353
|
+
key: "leadingDigits",
|
|
354
|
+
value: function() {
|
|
355
|
+
return this.metadata[this.v1 ? 8 : this.v2 ? 9 : 10];
|
|
356
|
+
}
|
|
357
|
+
}, {
|
|
358
|
+
key: "types",
|
|
359
|
+
value: function() {
|
|
360
|
+
return this.metadata[this.v1 ? 9 : this.v2 ? 10 : 11];
|
|
361
|
+
}
|
|
362
|
+
}, {
|
|
363
|
+
key: "hasTypes",
|
|
364
|
+
value: function() {
|
|
365
|
+
return this.types() && this.types().length === 0 ? !1 : !!this.types();
|
|
366
|
+
}
|
|
367
|
+
}, {
|
|
368
|
+
key: "type",
|
|
369
|
+
value: function(e) {
|
|
370
|
+
if (this.hasTypes() && y(this.types(), e))
|
|
371
|
+
return new _(y(this.types(), e), this);
|
|
372
|
+
}
|
|
373
|
+
}, {
|
|
374
|
+
key: "ext",
|
|
375
|
+
value: function() {
|
|
376
|
+
return this.v1 || this.v2 ? g : this.metadata[13] || g;
|
|
377
|
+
}
|
|
378
|
+
}]);
|
|
379
|
+
})(), k = /* @__PURE__ */ (function() {
|
|
380
|
+
function n(t, e) {
|
|
381
|
+
u(this, n), this._format = t, this.metadata = e;
|
|
382
|
+
}
|
|
383
|
+
return s(n, [{
|
|
384
|
+
key: "pattern",
|
|
385
|
+
value: function() {
|
|
386
|
+
return this._format[0];
|
|
387
|
+
}
|
|
388
|
+
}, {
|
|
389
|
+
key: "format",
|
|
390
|
+
value: function() {
|
|
391
|
+
return this._format[1];
|
|
392
|
+
}
|
|
393
|
+
}, {
|
|
394
|
+
key: "leadingDigitsPatterns",
|
|
395
|
+
value: function() {
|
|
396
|
+
return this._format[2] || [];
|
|
397
|
+
}
|
|
398
|
+
}, {
|
|
399
|
+
key: "nationalPrefixFormattingRule",
|
|
400
|
+
value: function() {
|
|
401
|
+
return this._format[3] || this.metadata.nationalPrefixFormattingRule();
|
|
402
|
+
}
|
|
403
|
+
}, {
|
|
404
|
+
key: "nationalPrefixIsOptionalWhenFormattingInNationalFormat",
|
|
405
|
+
value: function() {
|
|
406
|
+
return !!this._format[4] || this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat();
|
|
407
|
+
}
|
|
408
|
+
}, {
|
|
409
|
+
key: "nationalPrefixIsMandatoryWhenFormattingInNationalFormat",
|
|
410
|
+
value: function() {
|
|
411
|
+
return this.usesNationalPrefix() && !this.nationalPrefixIsOptionalWhenFormattingInNationalFormat();
|
|
412
|
+
}
|
|
413
|
+
// Checks whether national prefix formatting rule contains national prefix.
|
|
414
|
+
}, {
|
|
415
|
+
key: "usesNationalPrefix",
|
|
416
|
+
value: function() {
|
|
417
|
+
return !!(this.nationalPrefixFormattingRule() && // Check that national prefix formatting rule is not a "dummy" one.
|
|
418
|
+
!x.test(this.nationalPrefixFormattingRule()));
|
|
419
|
+
}
|
|
420
|
+
}, {
|
|
421
|
+
key: "internationalFormat",
|
|
422
|
+
value: function() {
|
|
423
|
+
return this._format[5] || this.format();
|
|
424
|
+
}
|
|
425
|
+
}]);
|
|
426
|
+
})(), x = /^\(?\$1\)?$/, _ = /* @__PURE__ */ (function() {
|
|
427
|
+
function n(t, e) {
|
|
428
|
+
u(this, n), this.type = t, this.metadata = e;
|
|
429
|
+
}
|
|
430
|
+
return s(n, [{
|
|
431
|
+
key: "pattern",
|
|
432
|
+
value: function() {
|
|
433
|
+
return this.metadata.v1 ? this.type : this.type[0];
|
|
434
|
+
}
|
|
435
|
+
}, {
|
|
436
|
+
key: "possibleLengths",
|
|
437
|
+
value: function() {
|
|
438
|
+
if (!this.metadata.v1)
|
|
439
|
+
return this.type[1] || this.metadata.possibleLengths();
|
|
440
|
+
}
|
|
441
|
+
}]);
|
|
442
|
+
})();
|
|
443
|
+
function y(n, t) {
|
|
444
|
+
switch (t) {
|
|
445
|
+
case "FIXED_LINE":
|
|
446
|
+
return n[0];
|
|
447
|
+
case "MOBILE":
|
|
448
|
+
return n[1];
|
|
449
|
+
case "TOLL_FREE":
|
|
450
|
+
return n[2];
|
|
451
|
+
case "PREMIUM_RATE":
|
|
452
|
+
return n[3];
|
|
453
|
+
case "PERSONAL_NUMBER":
|
|
454
|
+
return n[4];
|
|
455
|
+
case "VOICEMAIL":
|
|
456
|
+
return n[5];
|
|
457
|
+
case "UAN":
|
|
458
|
+
return n[6];
|
|
459
|
+
case "PAGER":
|
|
460
|
+
return n[7];
|
|
461
|
+
case "VOIP":
|
|
462
|
+
return n[8];
|
|
463
|
+
case "SHARED_COST":
|
|
464
|
+
return n[9];
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
function N(n) {
|
|
468
|
+
if (!n)
|
|
469
|
+
throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");
|
|
470
|
+
if (!l(n) || !l(n.countries))
|
|
471
|
+
throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(l(n) ? "an object of shape: { " + Object.keys(n).join(", ") + " }" : "a " + I(n) + ": " + n, "."));
|
|
472
|
+
}
|
|
473
|
+
var I = function(t) {
|
|
474
|
+
return o(t);
|
|
475
|
+
};
|
|
476
|
+
function M(n, t) {
|
|
477
|
+
var e = new F(t);
|
|
478
|
+
if (e.hasCountry(n))
|
|
479
|
+
return e.selectNumberingPlan(n).countryCallingCode();
|
|
480
|
+
throw new Error("Unknown country: ".concat(n));
|
|
481
|
+
}
|
|
482
|
+
function m(n) {
|
|
483
|
+
var t = n.version;
|
|
484
|
+
typeof t == "number" ? (this.v1 = t === 1, this.v2 = t === 2, this.v3 = t === 3, this.v4 = t === 4) : t ? h(t, p) === -1 ? this.v2 = !0 : h(t, b) === -1 ? this.v3 = !0 : this.v4 = !0 : this.v1 = !0;
|
|
279
485
|
}
|
|
280
486
|
export {
|
|
281
|
-
|
|
487
|
+
F as default,
|
|
488
|
+
M as getCountryCallingCode,
|
|
489
|
+
N as validateMetadata
|
|
282
490
|
};
|
|
283
491
|
//# sourceMappingURL=index163.js.map
|