@rpcbase/ui 0.183.0 → 0.185.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/index10.js +25 -24
- package/dist/index10.js.map +1 -1
- package/dist/index100.js +107 -5
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +262 -4
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +9 -4
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +42 -6
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +4 -145
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +45 -38
- package/dist/index105.js.map +1 -1
- package/dist/index106.js +52 -5
- package/dist/index106.js.map +1 -1
- package/dist/index107.js +4 -7
- package/dist/index107.js.map +1 -1
- package/dist/index108.js +3 -12
- package/dist/index108.js.map +1 -1
- package/dist/index109.js +15 -13
- package/dist/index109.js.map +1 -1
- package/dist/index11.js +34 -66
- package/dist/index11.js.map +1 -1
- package/dist/index110.js +5 -7
- package/dist/index110.js.map +1 -1
- package/dist/index111.js +7 -31
- package/dist/index111.js.map +1 -1
- package/dist/index112.js +16 -10
- package/dist/index112.js.map +1 -1
- package/dist/index113.js +4 -10
- package/dist/index113.js.map +1 -1
- package/dist/index114.js +4 -8
- package/dist/index114.js.map +1 -1
- package/dist/index115.js +5 -13
- package/dist/index115.js.map +1 -1
- package/dist/index116.js +5 -101
- package/dist/index116.js.map +1 -1
- package/dist/index117.js +5 -20
- package/dist/index117.js.map +1 -1
- package/dist/index118.js +4 -53
- package/dist/index118.js.map +1 -1
- package/dist/index119.js +6 -72
- package/dist/index119.js.map +1 -1
- package/dist/index12.js +556 -525
- package/dist/index12.js.map +1 -1
- package/dist/index120.js +24 -9
- package/dist/index120.js.map +1 -1
- package/dist/index121.js +6 -20
- package/dist/index121.js.map +1 -1
- package/dist/index122.js +4 -16
- package/dist/index122.js.map +1 -1
- package/dist/index123.js +6 -23
- package/dist/index123.js.map +1 -1
- package/dist/index124.js +5 -6
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +4 -5
- package/dist/index125.js.map +1 -1
- package/dist/index126.js +5 -23
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +5 -35
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +9 -16
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +5 -6
- package/dist/index129.js.map +1 -1
- package/dist/index13.js +128 -118
- package/dist/index13.js.map +1 -1
- package/dist/index130.js +4 -4
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +4 -4
- package/dist/index131.js.map +1 -1
- package/dist/index132.js +6 -4
- package/dist/index132.js.map +1 -1
- package/dist/index133.js +145 -4
- package/dist/index133.js.map +1 -1
- package/dist/index134.js +39 -3
- package/dist/index134.js.map +1 -1
- package/dist/index135.js +4 -6
- package/dist/index135.js.map +1 -1
- package/dist/index136.js +8 -24
- package/dist/index136.js.map +1 -1
- package/dist/index137.js +13 -7
- package/dist/index137.js.map +1 -1
- package/dist/index138.js +13 -6
- package/dist/index138.js.map +1 -1
- package/dist/index139.js +7 -5
- package/dist/index139.js.map +1 -1
- package/dist/index14.js +74 -74
- package/dist/index14.js.map +1 -1
- package/dist/index140.js +31 -3
- package/dist/index140.js.map +1 -1
- package/dist/index141.js +10 -3
- package/dist/index141.js.map +1 -1
- package/dist/index142.js +10 -4
- package/dist/index142.js.map +1 -1
- package/dist/index143.js +8 -3
- package/dist/index143.js.map +1 -1
- package/dist/index144.js +13 -4
- package/dist/index144.js.map +1 -1
- package/dist/index145.js +101 -3
- package/dist/index145.js.map +1 -1
- package/dist/index146.js +20 -4
- package/dist/index146.js.map +1 -1
- package/dist/index147.js +53 -3
- package/dist/index147.js.map +1 -1
- package/dist/index148.js +71 -45
- package/dist/index148.js.map +1 -1
- package/dist/index149.js +9 -205
- package/dist/index149.js.map +1 -1
- package/dist/index15.js +763 -624
- package/dist/index15.js.map +1 -1
- package/dist/index150.js +20 -21
- package/dist/index150.js.map +1 -1
- package/dist/index151.js +16 -24
- package/dist/index151.js.map +1 -1
- package/dist/index152.js +23 -399
- package/dist/index152.js.map +1 -1
- package/dist/index153.js +6 -46
- package/dist/index153.js.map +1 -1
- package/dist/index154.js +5 -605
- package/dist/index154.js.map +1 -1
- package/dist/index155.js +23 -5
- package/dist/index155.js.map +1 -1
- package/dist/index156.js +34 -68
- package/dist/index156.js.map +1 -1
- package/dist/index157.js +16 -2
- package/dist/index157.js.map +1 -1
- package/dist/index158.js +6 -363
- package/dist/index158.js.map +1 -1
- package/dist/index159.js +4 -261
- package/dist/index159.js.map +1 -1
- package/dist/index16.js +20 -22
- package/dist/index16.js.map +1 -1
- package/dist/index160.js +4 -60
- package/dist/index160.js.map +1 -1
- package/dist/index161.js +4 -46
- package/dist/index161.js.map +1 -1
- package/dist/index162.js +4 -169
- package/dist/index162.js.map +1 -1
- package/dist/index163.js +3 -109
- package/dist/index163.js.map +1 -1
- package/dist/index164.js +6 -24
- package/dist/index164.js.map +1 -1
- package/dist/index165.js +24 -8
- package/dist/index165.js.map +1 -1
- package/dist/index166.js +7 -4
- package/dist/index166.js.map +1 -1
- package/dist/index167.js +6 -5
- package/dist/index167.js.map +1 -1
- package/dist/index168.js +5 -4
- package/dist/index168.js.map +1 -1
- package/dist/index169.js +3 -466
- package/dist/index169.js.map +1 -1
- package/dist/index17.js +17 -17
- package/dist/index17.js.map +1 -1
- package/dist/index170.js +3 -185
- package/dist/index170.js.map +1 -1
- package/dist/index171.js +4 -107
- package/dist/index171.js.map +1 -1
- package/dist/index172.js +3 -262
- package/dist/index172.js.map +1 -1
- package/dist/index173.js +4 -9
- package/dist/index173.js.map +1 -1
- package/dist/index174.js +3 -42
- package/dist/index174.js.map +1 -1
- package/dist/index175.js +3 -4
- package/dist/index175.js.map +1 -1
- package/dist/index176.js +3 -58
- package/dist/index176.js.map +1 -1
- package/dist/index177.js +46 -8
- package/dist/index177.js.map +1 -1
- package/dist/index178.js +201 -62
- package/dist/index178.js.map +1 -1
- package/dist/index179.js +22 -20
- package/dist/index179.js.map +1 -1
- package/dist/index18.js +411 -341
- package/dist/index18.js.map +1 -1
- package/dist/index180.js +24 -16
- package/dist/index180.js.map +1 -1
- package/dist/index181.js +398 -4
- package/dist/index181.js.map +1 -1
- package/dist/index182.js +604 -4
- package/dist/index182.js.map +1 -1
- package/dist/index183.js +13 -6
- package/dist/index183.js.map +1 -1
- package/dist/index184.js +154 -4
- package/dist/index184.js.map +1 -1
- package/dist/index185.js +30 -7
- package/dist/index185.js.map +1 -1
- package/dist/index186.js +9 -17
- package/dist/index186.js.map +1 -1
- package/dist/index187.js +47 -5
- package/dist/index187.js.map +1 -1
- package/dist/index188.js +11 -5
- package/dist/index188.js.map +1 -1
- package/dist/index189.js +44 -13
- package/dist/index189.js.map +1 -1
- package/dist/index19.js +626 -660
- package/dist/index19.js.map +1 -1
- package/dist/index190.js +95 -10
- package/dist/index190.js.map +1 -1
- package/dist/index191.js +86 -14
- package/dist/index191.js.map +1 -1
- package/dist/index192.js +105 -14
- package/dist/index192.js.map +1 -1
- package/dist/index193.js +52 -5
- package/dist/index193.js.map +1 -1
- package/dist/index194.js +11 -6
- package/dist/index194.js.map +1 -1
- package/dist/index195.js +37 -7
- package/dist/index195.js.map +1 -1
- package/dist/index196.js +8 -6
- package/dist/index196.js.map +1 -1
- package/dist/index197.js +116 -9
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +17 -5
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +15 -5
- package/dist/index199.js.map +1 -1
- package/dist/index20.js +442 -634
- package/dist/index20.js.map +1 -1
- package/dist/index200.js +3 -9
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +36 -5
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +20 -5
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +9 -4
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +8 -11
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +19 -10
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +28 -10
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +16 -11
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +58 -11
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +8 -10
- package/dist/index209.js.map +1 -1
- package/dist/index21.js +254 -200
- package/dist/index21.js.map +1 -1
- package/dist/index210.js +66 -7
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +19 -6
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +16 -5
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +5 -6
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +5 -7
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +6 -6
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +4 -55
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +7 -16
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +17 -7
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +5 -10
- package/dist/index219.js.map +1 -1
- package/dist/index22.js +1 -1
- package/dist/index22.js.map +1 -1
- package/dist/index220.js +5 -10
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +13 -21
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +10 -10
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +14 -9
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +14 -9
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +5 -4
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +6 -5
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +7 -16
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +6 -9
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +9 -18
- package/dist/index229.js.map +1 -1
- package/dist/index23.js +27 -34
- package/dist/index23.js.map +1 -1
- package/dist/index230.js +5 -15
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +5 -12
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +9 -29
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +5 -12
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +5 -25
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +4 -5
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +11 -24
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +10 -28
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +11 -5
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +11 -67
- package/dist/index239.js.map +1 -1
- package/dist/index24.js +219 -222
- package/dist/index24.js.map +1 -1
- package/dist/index240.js +11 -180
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +10 -46
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +7 -13
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +6 -154
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +5 -30
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +6 -9
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +7 -47
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +6 -11
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +54 -43
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +13 -92
- package/dist/index249.js.map +1 -1
- package/dist/index25.js +46 -50
- package/dist/index25.js.map +1 -1
- package/dist/index250.js +7 -86
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +8 -103
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +9 -51
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +21 -11
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +10 -37
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +8 -7
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +9 -116
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +4 -17
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +5 -15
- package/dist/index258.js.map +1 -1
- package/dist/index259.js +16 -3
- package/dist/index259.js.map +1 -1
- package/dist/index260.js +9 -36
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +18 -20
- package/dist/index261.js.map +1 -1
- package/dist/index262.js +15 -9
- package/dist/index262.js.map +1 -1
- package/dist/index263.js +12 -8
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +28 -18
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +11 -27
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +23 -14
- package/dist/index266.js.map +1 -1
- package/dist/index267.js +5 -4
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +24 -18
- package/dist/index268.js.map +1 -1
- package/dist/index269.js +29 -13
- package/dist/index269.js.map +1 -1
- package/dist/index270.js +5 -5
- package/dist/index270.js.map +1 -1
- package/dist/index271.js +68 -3
- package/dist/index271.js.map +1 -1
- package/dist/index272.js +179 -22
- package/dist/index272.js.map +1 -1
- package/dist/index273.js +43 -109
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +20 -15
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +4 -524
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +18 -127
- package/dist/index276.js.map +1 -1
- package/dist/index277.js +12 -133
- package/dist/index277.js.map +1 -1
- package/dist/index278.js +5 -21
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +3 -6
- package/dist/index279.js.map +1 -1
- package/dist/index28.js +3 -37
- package/dist/index28.js.map +1 -1
- package/dist/index280.js +23 -5
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +113 -4
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +15 -15
- package/dist/index282.js.map +1 -1
- package/dist/index283.js +524 -8
- package/dist/index283.js.map +1 -1
- package/dist/index284.js +127 -5
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +133 -4
- package/dist/index285.js.map +1 -1
- package/dist/index286.js +5 -545
- package/dist/index286.js.map +1 -1
- package/dist/index287.js +6 -47
- package/dist/index287.js.map +1 -1
- package/dist/index288.js +4 -18
- package/dist/index288.js.map +1 -1
- package/dist/index289.js +15 -6
- package/dist/index289.js.map +1 -1
- package/dist/index29.js +37 -3
- package/dist/index29.js.map +1 -1
- package/dist/index290.js +8 -8
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +5 -7
- package/dist/index291.js.map +1 -1
- package/dist/index292.js +4 -8
- package/dist/index292.js.map +1 -1
- package/dist/index293.js +545 -12
- package/dist/index293.js.map +1 -1
- package/dist/index294.js +47 -10
- package/dist/index294.js.map +1 -1
- package/dist/index295.js +17 -13
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +7 -69
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +9 -9
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +8 -14
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +9 -66
- package/dist/index299.js.map +1 -1
- package/dist/index3.js.map +1 -1
- package/dist/index30.js +3 -125
- package/dist/index30.js.map +1 -1
- package/dist/index300.js +12 -64
- package/dist/index300.js.map +1 -1
- package/dist/index301.js +9 -4
- package/dist/index301.js.map +1 -1
- package/dist/index302.js +14 -56
- package/dist/index302.js.map +1 -1
- package/dist/index303.js +65 -68
- package/dist/index303.js.map +1 -1
- package/dist/index304.js +68 -30
- package/dist/index304.js.map +1 -1
- package/dist/index305.js +9 -9
- package/dist/index305.js.map +1 -1
- package/dist/index306.js +13 -152
- package/dist/index306.js.map +1 -1
- package/dist/index307.js +65 -107
- package/dist/index307.js.map +1 -1
- package/dist/index308.js +4 -3
- package/dist/index308.js.map +1 -1
- package/dist/index309.js +56 -23
- package/dist/index309.js.map +1 -1
- package/dist/index31.js +120 -227
- package/dist/index31.js.map +1 -1
- package/dist/index310.js +68 -16
- package/dist/index310.js.map +1 -1
- package/dist/index311.js +31 -29
- package/dist/index311.js.map +1 -1
- package/dist/index312.js +9 -13
- package/dist/index312.js.map +1 -1
- package/dist/index313.js +153 -7
- package/dist/index313.js.map +1 -1
- package/dist/index314.js +107 -22
- package/dist/index314.js.map +1 -1
- package/dist/index315.js +4 -13
- package/dist/index315.js.map +1 -1
- package/dist/index316.js +22 -27
- package/dist/index316.js.map +1 -1
- package/dist/index317.js +16 -5
- package/dist/index317.js.map +1 -1
- package/dist/index318.js +32 -0
- package/dist/index318.js.map +1 -0
- package/dist/index319.js +16 -0
- package/dist/index319.js.map +1 -0
- package/dist/index32.js +229 -21
- package/dist/index32.js.map +1 -1
- package/dist/index320.js +10 -0
- package/dist/index320.js.map +1 -0
- package/dist/index321.js +26 -0
- package/dist/index321.js.map +1 -0
- package/dist/index322.js +16 -0
- package/dist/index322.js.map +1 -0
- package/dist/index323.js +31 -0
- package/dist/index323.js.map +1 -0
- package/dist/index324.js +8 -0
- package/dist/index324.js.map +1 -0
- package/dist/index33.js +23 -50
- package/dist/index33.js.map +1 -1
- package/dist/index34.js +50 -2640
- package/dist/index34.js.map +1 -1
- package/dist/index35.js +2598 -351
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +375 -214
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +230 -19
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +18 -138
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +113 -170
- package/dist/index39.js.map +1 -1
- package/dist/index4.js +17 -15
- package/dist/index4.js.map +1 -1
- package/dist/index40.js +209 -64
- package/dist/index40.js.map +1 -1
- package/dist/index41.js +86 -94
- package/dist/index41.js.map +1 -1
- package/dist/index42.js +118 -5
- package/dist/index42.js.map +1 -1
- package/dist/index43.js +5 -843
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +832 -54
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +57 -8
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +8 -2
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +2 -24
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +11 -233
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +19 -205
- package/dist/index49.js.map +1 -1
- package/dist/index5.js +34 -34
- package/dist/index5.js.map +1 -1
- package/dist/index50.js +7 -3
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +2 -7
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +22 -46
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +232 -25
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +50 -47
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +2 -8
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +2 -15
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +5 -133
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +7 -10
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +5 -216
- package/dist/index59.js.map +1 -1
- package/dist/index6.js +154 -120
- package/dist/index6.js.map +1 -1
- package/dist/index60.js +2 -13
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +2 -34
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +6 -46
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +33 -7
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +24 -47
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +8 -4
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +11 -5
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +202 -25
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +4 -50
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +48 -9
- package/dist/index69.js.map +1 -1
- package/dist/index7.js +29 -24
- package/dist/index7.js.map +1 -1
- package/dist/index70.js +49 -10
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +7 -53
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +14 -5
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +133 -7
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +10 -5
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +217 -2
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +13 -2
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +47 -52
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +49 -4
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +4 -5
- package/dist/index79.js.map +1 -1
- package/dist/index8.js +21 -24
- package/dist/index8.js.map +1 -1
- package/dist/index80.js +5 -15
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +28 -6
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +50 -8
- package/dist/index82.js.map +1 -1
- package/dist/index83.js +9 -17
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +5 -4
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +68 -4
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +2 -6
- package/dist/index86.js.map +1 -1
- package/dist/index87.js +363 -5
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +261 -4
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +60 -4
- package/dist/index89.js.map +1 -1
- package/dist/index9.js +138 -187
- package/dist/index9.js.map +1 -1
- package/dist/index90.js +46 -6
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +169 -24
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +109 -6
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +24 -4
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +8 -7
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +4 -5
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +5 -4
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +4 -5
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +466 -4
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +185 -8
- package/dist/index99.js.map +1 -1
- package/package.json +1 -1
package/dist/index40.js
CHANGED
|
@@ -1,80 +1,225 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { MAX_DIAL_CODE_LENGTH as W, COMMON_IDD_PREFIXES as $, DEFAULT_COUNTRY as x, COUNTRY_DIAL_CODES as C } from "./index39.js";
|
|
2
|
+
import { getCountryCallingCode as p } from "./index43.js";
|
|
3
|
+
import { AsYouType as I } from "./index58.js";
|
|
4
|
+
import { validatePhoneNumberLength as D } from "./index59.js";
|
|
5
|
+
function g(t) {
|
|
6
|
+
return t.replace(/\D/g, "");
|
|
6
7
|
}
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
const r = Math.min(e, t.length);
|
|
10
|
-
for (let i = 0; i < r; i += 1)
|
|
11
|
-
c(t[i] ?? "") && (n += 1);
|
|
12
|
-
return n;
|
|
8
|
+
function P(t) {
|
|
9
|
+
return t ? t.length > W ? !1 : C.some((e) => e.startsWith(t)) : !0;
|
|
13
10
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
let n = 0;
|
|
18
|
-
for (let r = 0; r < t.length; r += 1)
|
|
19
|
-
if (c(t[r] ?? "") && (n += 1, n === e))
|
|
20
|
-
return r + 1;
|
|
21
|
-
return t.length;
|
|
11
|
+
const N = /[\u061C\u200B-\u200F\u202A-\u202E\u2066-\u2069\uFEFF]/g;
|
|
12
|
+
function T(t) {
|
|
13
|
+
return t.replace(N, "");
|
|
22
14
|
}
|
|
23
|
-
function
|
|
24
|
-
|
|
15
|
+
function q(t, e, s = {}) {
|
|
16
|
+
const {
|
|
17
|
+
force: u = !1
|
|
18
|
+
} = s, o = `+${e}`;
|
|
19
|
+
if (!t.startsWith(o) || !u)
|
|
20
|
+
return t;
|
|
21
|
+
const i = t.slice(o.length).trimStart();
|
|
22
|
+
if (i.startsWith("0"))
|
|
23
|
+
return t;
|
|
24
|
+
if (!i)
|
|
25
|
+
return `${o} 0`;
|
|
26
|
+
const [n, ...r] = i.split(" "), f = `0${n ?? ""}`, l = r.length > 0 ? ` ${r.join(" ")}` : "";
|
|
27
|
+
return `${o} ${f}${l}`.replace(/\s\s+/g, " ").trimEnd();
|
|
28
|
+
}
|
|
29
|
+
const O = {
|
|
30
|
+
GG: "GB",
|
|
31
|
+
JE: "GB",
|
|
32
|
+
IM: "GB"
|
|
33
|
+
};
|
|
34
|
+
function y(t) {
|
|
35
|
+
if (t)
|
|
36
|
+
return O[t] ?? t;
|
|
25
37
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
38
|
+
function _(t, e, s) {
|
|
39
|
+
if (!t || !s || (t.nationalNumber ?? "").length < 4)
|
|
40
|
+
return;
|
|
41
|
+
const o = t.countryCallingCode;
|
|
42
|
+
if (!o)
|
|
43
|
+
return;
|
|
44
|
+
const i = t.getMetadata, n = (typeof i == "function" ? i() : null)?.country_calling_codes?.[o];
|
|
45
|
+
if (!n || n.length === 0)
|
|
46
|
+
return;
|
|
47
|
+
const r = [];
|
|
48
|
+
for (const f of n) {
|
|
49
|
+
const l = y(f);
|
|
50
|
+
l && !r.includes(l) && r.push(l);
|
|
33
51
|
}
|
|
34
|
-
|
|
52
|
+
if (r.length !== 0)
|
|
53
|
+
return e && r.includes(e) ? e : r.includes(x) ? x : r[0];
|
|
54
|
+
}
|
|
55
|
+
function B(t, e, s, u) {
|
|
56
|
+
if (!t)
|
|
57
|
+
return !1;
|
|
58
|
+
if (!u)
|
|
59
|
+
return t.startsWith("0");
|
|
60
|
+
if (!s || !t.startsWith(s) || !t.slice(s.length).startsWith("0"))
|
|
61
|
+
return !1;
|
|
62
|
+
const o = t.slice(s.length + 1), i = e.startsWith(s) ? e.slice(s.length) : e;
|
|
63
|
+
return o === i;
|
|
64
|
+
}
|
|
65
|
+
function S(t) {
|
|
66
|
+
for (const e of $)
|
|
67
|
+
if (t.startsWith(e))
|
|
68
|
+
return t.slice(e.length);
|
|
69
|
+
return t;
|
|
35
70
|
}
|
|
36
|
-
function
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
71
|
+
function M(t, e, s = {}) {
|
|
72
|
+
const {
|
|
73
|
+
allowJustPlus: u = !1,
|
|
74
|
+
removeNationalPrefix: o = !0,
|
|
75
|
+
previousValue: i
|
|
76
|
+
} = s, n = T(t).trim();
|
|
77
|
+
if (!n)
|
|
78
|
+
return "";
|
|
79
|
+
if (n === "+")
|
|
80
|
+
return u ? "+" : "";
|
|
81
|
+
if (n.startsWith("+")) {
|
|
82
|
+
const a = g(n);
|
|
83
|
+
if (!a)
|
|
84
|
+
return u ? "+" : "";
|
|
85
|
+
const d = S(a);
|
|
86
|
+
if (d !== a)
|
|
87
|
+
return d ? `+${d}` : u ? "+" : "";
|
|
88
|
+
if (o && e) {
|
|
89
|
+
const h = p(e);
|
|
90
|
+
if (a.startsWith(h) && a.slice(h.length).startsWith("0")) {
|
|
91
|
+
const E = a.slice(h.length + 1);
|
|
92
|
+
return E ? `+${h}${E}` : `+${h}`;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return `+${a}`;
|
|
96
|
+
}
|
|
97
|
+
const r = g(n);
|
|
98
|
+
if (!r)
|
|
99
|
+
return "";
|
|
100
|
+
const f = S(r);
|
|
101
|
+
if (f !== r)
|
|
102
|
+
return f ? `+${f}` : u ? "+" : "";
|
|
103
|
+
const l = typeof i == "string" ? i : "", m = l && l.startsWith("+") ? g(l) : "";
|
|
104
|
+
if (m && m.length > r.length && m.endsWith(r) && m.length - r.length <= W)
|
|
105
|
+
return `+${r}`;
|
|
106
|
+
if (r === "0")
|
|
107
|
+
return "0";
|
|
108
|
+
if (o && e && r.length > 1 && r.startsWith("0") && !r.startsWith("00")) {
|
|
109
|
+
const a = p(e), d = r.slice(1);
|
|
110
|
+
return d ? `+${a}${d}` : `+${a}`;
|
|
43
111
|
}
|
|
44
|
-
return
|
|
112
|
+
return e ? r.length <= 4 ? `+${r}` : `+${p(e)}${r}` : r;
|
|
45
113
|
}
|
|
46
|
-
function
|
|
47
|
-
|
|
114
|
+
function Y(t, e) {
|
|
115
|
+
if (t === "+")
|
|
116
|
+
return {
|
|
117
|
+
international: "+",
|
|
118
|
+
national: "",
|
|
119
|
+
formatted: "+",
|
|
120
|
+
phoneNumber: null,
|
|
121
|
+
detectedCountry: void 0,
|
|
122
|
+
inferredCountry: void 0,
|
|
123
|
+
hasExplicitInternationalPrefix: !0
|
|
124
|
+
};
|
|
125
|
+
const s = /^\s*\+/.test(t), u = e ? new I(e) : new I(), o = u.input(t), i = u.getNumber(), c = g(t), n = y(i?.country ?? u.country ?? void 0), r = n ?? !i ? void 0 : y(_(i, e, c)), f = i?.formatInternational() ?? o, l = i?.formatNational() ?? g(f);
|
|
48
126
|
return {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
wasAtEnd: r === e.length
|
|
127
|
+
international: f,
|
|
128
|
+
national: l,
|
|
129
|
+
formatted: o,
|
|
130
|
+
phoneNumber: i,
|
|
131
|
+
detectedCountry: n,
|
|
132
|
+
inferredCountry: r,
|
|
133
|
+
hasExplicitInternationalPrefix: s
|
|
57
134
|
};
|
|
58
135
|
}
|
|
59
|
-
function
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
136
|
+
function v(t, e) {
|
|
137
|
+
return t.startsWith(e) ? t.slice(e.length) : t;
|
|
138
|
+
}
|
|
139
|
+
function H(t, e) {
|
|
140
|
+
if (!e || !t)
|
|
141
|
+
return null;
|
|
142
|
+
try {
|
|
143
|
+
return D(t, e) === "TOO_LONG" ? "TOO_LONG" : null;
|
|
144
|
+
} catch {
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
function U(t, e, s, u = {}) {
|
|
149
|
+
const {
|
|
150
|
+
hasRemovedNationalPrefix: o = !1,
|
|
151
|
+
detectedCountry: i,
|
|
152
|
+
hasExplicitInternationalPrefix: c = !1
|
|
153
|
+
} = u;
|
|
154
|
+
if (!t)
|
|
155
|
+
return {
|
|
156
|
+
shouldSuggest: !1,
|
|
157
|
+
query: ""
|
|
158
|
+
};
|
|
159
|
+
if (t === "+")
|
|
160
|
+
return {
|
|
161
|
+
shouldSuggest: !0,
|
|
162
|
+
query: ""
|
|
163
|
+
};
|
|
164
|
+
const n = g(t);
|
|
165
|
+
if (!n)
|
|
166
|
+
return {
|
|
167
|
+
shouldSuggest: !0,
|
|
168
|
+
query: ""
|
|
169
|
+
};
|
|
170
|
+
if (o)
|
|
171
|
+
return {
|
|
172
|
+
shouldSuggest: !1,
|
|
173
|
+
query: ""
|
|
174
|
+
};
|
|
175
|
+
if (c && !i)
|
|
176
|
+
return P(n) ? {
|
|
177
|
+
shouldSuggest: !0,
|
|
178
|
+
query: n
|
|
179
|
+
} : {
|
|
180
|
+
shouldSuggest: !1,
|
|
181
|
+
query: ""
|
|
182
|
+
};
|
|
183
|
+
let r = s?.countryCallingCode ?? null;
|
|
184
|
+
if (!r) {
|
|
185
|
+
if (e) {
|
|
186
|
+
const l = p(e);
|
|
187
|
+
n.startsWith(l) && (r = l);
|
|
188
|
+
} else if (!c)
|
|
189
|
+
return {
|
|
190
|
+
shouldSuggest: !1,
|
|
191
|
+
query: ""
|
|
192
|
+
};
|
|
67
193
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
194
|
+
return r ? v(n, r).length === 0 ? {
|
|
195
|
+
shouldSuggest: !0,
|
|
196
|
+
query: n
|
|
197
|
+
} : {
|
|
198
|
+
shouldSuggest: !1,
|
|
199
|
+
query: ""
|
|
200
|
+
} : {
|
|
201
|
+
shouldSuggest: !0,
|
|
202
|
+
query: n
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
function V(t, e) {
|
|
206
|
+
if (t.shouldSuggest)
|
|
207
|
+
return !1;
|
|
208
|
+
const {
|
|
209
|
+
hasExplicitInternationalPrefix: s = !1,
|
|
210
|
+
detectedCountry: u
|
|
211
|
+
} = e;
|
|
212
|
+
return s ? !!u : !0;
|
|
73
213
|
}
|
|
74
214
|
export {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
215
|
+
B as detectNationalPrefixForDisplay,
|
|
216
|
+
Y as formatWithAsYouType,
|
|
217
|
+
H as getLengthIssue,
|
|
218
|
+
U as getSuggestionState,
|
|
219
|
+
q as injectNationalPrefixDisplay,
|
|
220
|
+
M as normalizeInputValue,
|
|
221
|
+
g as sanitizeDigits,
|
|
222
|
+
V as shouldDisplayExplicitCountrySelection,
|
|
223
|
+
v as stripPrefix
|
|
79
224
|
};
|
|
80
225
|
//# sourceMappingURL=index40.js.map
|
package/dist/index40.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index40.js","sources":["../src/components/PhoneNumberInput/selection.ts"],"sourcesContent":["function isDigitCharacter(char: string) {\n if (!char) {\n return false\n }\n const code = char.charCodeAt(0)\n return code >= 48 && code <= 57\n}\n\nfunction countDigitsBefore(value: string, index: number) {\n let count = 0\n const limit = Math.min(index, value.length)\n for (let position = 0; position < limit; position += 1) {\n if (isDigitCharacter(value[position] ?? \"\")) {\n count += 1\n }\n }\n return count\n}\n\nfunction findIndexForDigitCount(value: string, digitCount: number) {\n if (digitCount <= 0) {\n return value.startsWith(\"+\") ? Math.min(1, value.length) : 0\n }\n\n let seen = 0\n for (let index = 0; index < value.length; index += 1) {\n if (isDigitCharacter(value[index] ?? \"\")) {\n seen += 1\n if (seen === digitCount) {\n return index + 1\n }\n }\n }\n\n return value.length\n}\n\nfunction isFormattingCharacter(char: string) {\n if (!char) {\n return false\n }\n if (isDigitCharacter(char)) {\n return false\n }\n return char !== \"+\"\n}\n\nexport function skipFormattingCharactersLeft(value: string, index: number) {\n let position = index\n while (position > 0) {\n const next = value[position - 1] ?? \"\"\n if (!isFormattingCharacter(next)) {\n break\n }\n position -= 1\n }\n return position\n}\n\nexport function skipFormattingCharactersRight(value: string, index: number) {\n let position = index\n while (position < value.length) {\n const next = value[position] ?? \"\"\n if (!isFormattingCharacter(next)) {\n break\n }\n position += 1\n }\n return position\n}\n\ntype SelectionSnapshot = {\n selectionStart: number\n selectionEnd: number\n startDigits: number\n endDigits: number\n preserveStartIndex: boolean\n preserveEndIndex: boolean\n wasAtStart: boolean\n wasAtEnd: boolean\n}\n\nexport function captureSelectionSnapshot(input: HTMLInputElement): SelectionSnapshot {\n const { value } = input\n const selectionStart = input.selectionStart ?? value.length\n const selectionEnd = input.selectionEnd ?? selectionStart\n const preserveStartIndex = selectionStart <= 1 && value.startsWith(\"+\")\n const preserveEndIndex = selectionEnd <= 1 && value.startsWith(\"+\")\n\n return {\n selectionStart,\n selectionEnd,\n startDigits: countDigitsBefore(value, selectionStart),\n endDigits: countDigitsBefore(value, selectionEnd),\n preserveStartIndex,\n preserveEndIndex,\n wasAtStart: selectionStart === 0,\n wasAtEnd: selectionEnd === value.length,\n }\n}\n\nexport function resolveSelection(snapshot: SelectionSnapshot, value: string) {\n if (snapshot.selectionStart === snapshot.selectionEnd) {\n if (snapshot.wasAtEnd) {\n const end = value.length\n return { start: end, end }\n }\n if (snapshot.wasAtStart) {\n return { start: 0, end: 0 }\n }\n }\n\n const start = snapshot.preserveStartIndex\n ? Math.min(snapshot.selectionStart, value.length)\n : findIndexForDigitCount(value, snapshot.startDigits)\n const end = snapshot.preserveEndIndex\n ? Math.min(snapshot.selectionEnd, value.length)\n : findIndexForDigitCount(value, snapshot.endDigits)\n\n let resolvedStart = start\n let resolvedEnd = end\n\n if (snapshot.wasAtStart) {\n resolvedStart = 0\n }\n\n if (snapshot.wasAtEnd) {\n resolvedEnd = value.length\n }\n\n if (snapshot.selectionStart === snapshot.selectionEnd) {\n resolvedStart = resolvedEnd\n }\n\n const clampedStart = Math.min(Math.max(resolvedStart, 0), value.length)\n const clampedEnd = Math.min(Math.max(resolvedEnd, 0), value.length)\n\n if (clampedStart > clampedEnd) {\n return { start: clampedEnd, end: clampedEnd }\n }\n\n return { start: clampedStart, end: clampedEnd }\n}\n\n"],"names":["isDigitCharacter","char","code","countDigitsBefore","value","index","count","limit","position","findIndexForDigitCount","digitCount","seen","isFormattingCharacter","skipFormattingCharactersLeft","next","skipFormattingCharactersRight","captureSelectionSnapshot","input","selectionStart","selectionEnd","preserveStartIndex","pre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GAChEyB,IAAa,KAAK,IAAI,KAAK,IAAIF,GAAa,CAAC,GAAGvB,EAAM,MAAM;AAElE,SAAIwB,IAAeC,IACV,EAAE,OAAOA,GAAY,KAAKA,EAAA,IAG5B,EAAE,OAAOD,GAAc,KAAKC,EAAA;AACrC;"}
|
|
1
|
+
{"version":3,"file":"index40.js","sources":["../src/components/PhoneNumberInput/normalization.ts"],"sourcesContent":["import type { CountryCode } from \"libphonenumber-js\"\nimport { AsYouType, getCountryCallingCode, validatePhoneNumberLength } from \"libphonenumber-js\"\n\nimport {\n COMMON_IDD_PREFIXES,\n COUNTRY_DIAL_CODES,\n DEFAULT_COUNTRY,\n MAX_DIAL_CODE_LENGTH,\n} from \"./country-options\"\n\n\nexport type LengthIssue = \"TOO_LONG\"\n\nexport function sanitizeDigits(value: string) {\n return value.replace(/\\D/g, \"\")\n}\n\nfunction isDialCodeProgress(digits: string) {\n if (!digits) {\n return true\n }\n\n if (digits.length > MAX_DIAL_CODE_LENGTH) {\n return false\n }\n\n return COUNTRY_DIAL_CODES.some((dial) => dial.startsWith(digits))\n}\n\nconst INVISIBLE_FORMATTING_CHARACTERS =\n /[\\u061C\\u200B-\\u200F\\u202A-\\u202E\\u2066-\\u2069\\uFEFF]/g\n\nfunction stripInvisibleFormatting(value: string) {\n return value.replace(INVISIBLE_FORMATTING_CHARACTERS, \"\")\n}\n\nexport function injectNationalPrefixDisplay(\n international: string,\n dialCode: string,\n options: { force?: boolean } = {}\n) {\n // Preserve a user-typed national trunk (e.g. the French \"0\") purely for display\n // so validation can continue to use the canonical E.164 representation internally.\n const { force = false } = options\n const prefix = `+${dialCode}`\n\n if (!international.startsWith(prefix)) {\n return international\n }\n\n if (!force) {\n return international\n }\n\n const remainder = international.slice(prefix.length).trimStart()\n const alreadyHasTrunk = remainder.startsWith(\"0\")\n\n if (alreadyHasTrunk) {\n return international\n }\n\n if (!remainder) {\n return `${prefix} 0`\n }\n\n const [firstGroup, ...restGroups] = remainder.split(\" \")\n const rebuiltFirstGroup = `0${firstGroup ?? \"\"}`\n const rebuiltRemainder = restGroups.length > 0 ? ` ${restGroups.join(\" \")}` : \"\"\n\n return `${prefix} ${rebuiltFirstGroup}${rebuiltRemainder}`.replace(/\\s\\s+/g, \" \").trimEnd()\n}\n\nconst DETECTED_COUNTRY_OVERRIDES: Partial<Record<CountryCode, CountryCode>> = {\n GG: \"GB\",\n JE: \"GB\",\n IM: \"GB\",\n}\n\nfunction canonicalizeDetectedCountry(candidate: CountryCode | undefined): CountryCode | undefined {\n if (!candidate) {\n return undefined\n }\n return DETECTED_COUNTRY_OVERRIDES[candidate] ?? candidate\n}\n\ntype AsYouTypeNumber = ReturnType<AsYouType[\"getNumber\"]>\n\nfunction inferCountryFromDialCode(\n phoneNumber: AsYouTypeNumber,\n baseCountry: CountryCode | undefined,\n normalizedDigits: string\n): CountryCode | undefined {\n if (!phoneNumber) {\n return undefined\n }\n\n if (!normalizedDigits) {\n return undefined\n }\n\n const nationalDigits = phoneNumber.nationalNumber ?? \"\"\n if (nationalDigits.length < 4) {\n return undefined\n }\n\n const dial = phoneNumber.countryCallingCode\n if (!dial) {\n return undefined\n }\n\n const metadataGetter = (phoneNumber as unknown as { getMetadata?: () => unknown }).getMetadata\n const metadata =\n typeof metadataGetter === \"function\"\n ? (metadataGetter() as {\n country_calling_codes?: Record<string, string[]>\n } | null)\n : null\n\n const candidates = metadata?.country_calling_codes?.[dial]\n if (!candidates || candidates.length === 0) {\n return undefined\n }\n\n const canonicalCandidates: CountryCode[] = []\n for (const candidate of candidates) {\n const canonical = canonicalizeDetectedCountry(candidate as CountryCode)\n if (canonical && !canonicalCandidates.includes(canonical)) {\n canonicalCandidates.push(canonical)\n }\n }\n\n if (canonicalCandidates.length === 0) {\n return undefined\n }\n\n if (baseCountry && canonicalCandidates.includes(baseCountry)) {\n return baseCountry\n }\n\n if (canonicalCandidates.includes(DEFAULT_COUNTRY)) {\n return DEFAULT_COUNTRY\n }\n\n return canonicalCandidates[0]\n}\n\nexport function detectNationalPrefixForDisplay(\n rawDigits: string,\n internationalDigits: string,\n dialCode: string,\n hasExplicitInternationalPrefix: boolean\n) {\n if (!rawDigits) {\n return false\n }\n\n if (!hasExplicitInternationalPrefix) {\n return rawDigits.startsWith(\"0\")\n }\n\n if (!dialCode) {\n return false\n }\n\n if (!rawDigits.startsWith(dialCode)) {\n return false\n }\n\n if (!rawDigits.slice(dialCode.length).startsWith(\"0\")) {\n return false\n }\n\n const rawAfterTrunk = rawDigits.slice(dialCode.length + 1)\n const internationalAfterDial = internationalDigits.startsWith(dialCode)\n ? internationalDigits.slice(dialCode.length)\n : internationalDigits\n\n return rawAfterTrunk === internationalAfterDial\n}\n\nfunction stripIddPrefix(digits: string) {\n for (const prefix of COMMON_IDD_PREFIXES) {\n if (digits.startsWith(prefix)) {\n return digits.slice(prefix.length)\n }\n }\n return digits\n}\n\nexport function normalizeInputValue(\n rawValue: string,\n country: CountryCode | undefined,\n options: {\n allowJustPlus?: boolean\n removeNationalPrefix?: boolean\n previousValue?: string\n } = {}\n) {\n const { allowJustPlus = false, removeNationalPrefix = true, previousValue } = options\n const cleaned = stripInvisibleFormatting(rawValue)\n const trimmed = cleaned.trim()\n\n if (!trimmed) {\n return \"\"\n }\n\n if (trimmed === \"+\") {\n return allowJustPlus ? \"+\" : \"\"\n }\n\n if (trimmed.startsWith(\"+\")) {\n const digits = sanitizeDigits(trimmed)\n if (!digits) {\n return allowJustPlus ? \"+\" : \"\"\n }\n const digitsWithoutIdd = stripIddPrefix(digits)\n if (digitsWithoutIdd !== digits) {\n return digitsWithoutIdd ? `+${digitsWithoutIdd}` : allowJustPlus ? \"+\" : \"\"\n }\n if (removeNationalPrefix && country) {\n const dial = getCountryCallingCode(country)\n if (digits.startsWith(dial) && digits.slice(dial.length).startsWith(\"0\")) {\n const withoutPrefix = digits.slice(dial.length + 1)\n return withoutPrefix ? `+${dial}${withoutPrefix}` : `+${dial}`\n }\n }\n return `+${digits}`\n }\n\n const digitsOnly = sanitizeDigits(trimmed)\n if (!digitsOnly) {\n return \"\"\n }\n\n const digitsWithoutIdd = stripIddPrefix(digitsOnly)\n if (digitsWithoutIdd !== digitsOnly) {\n return digitsWithoutIdd ? `+${digitsWithoutIdd}` : allowJustPlus ? \"+\" : \"\"\n }\n\n const previousNormalized = typeof previousValue === \"string\" ? previousValue : \"\"\n const previousDigits =\n previousNormalized && previousNormalized.startsWith(\"+\")\n ? sanitizeDigits(previousNormalized)\n : \"\"\n\n if (previousDigits && previousDigits.length > digitsOnly.length) {\n if (previousDigits.endsWith(digitsOnly)) {\n const removedPrefixLength = previousDigits.length - digitsOnly.length\n if (removedPrefixLength <= MAX_DIAL_CODE_LENGTH) {\n return `+${digitsOnly}`\n }\n }\n }\n\n if (digitsOnly === \"0\") {\n return \"0\"\n }\n\n if (\n removeNationalPrefix &&\n country &&\n digitsOnly.length > 1 &&\n digitsOnly.startsWith(\"0\") &&\n !digitsOnly.startsWith(\"00\")\n ) {\n const dial = getCountryCallingCode(country)\n const withoutPrefix = digitsOnly.slice(1)\n return withoutPrefix ? `+${dial}${withoutPrefix}` : `+${dial}`\n }\n\n if (!country) {\n return digitsOnly\n }\n\n if (digitsOnly.length <= 4) {\n return `+${digitsOnly}`\n }\n\n const dial = getCountryCallingCode(country)\n return `+${dial}${digitsOnly}`\n}\n\nexport function formatWithAsYouType(value: string, baseCountry?: CountryCode) {\n if (value === \"+\") {\n return {\n international: \"+\",\n national: \"\",\n formatted: \"+\",\n phoneNumber: null,\n detectedCountry: undefined,\n inferredCountry: undefined,\n hasExplicitInternationalPrefix: true,\n }\n }\n\n const hasExplicitInternationalPrefix = /^\\s*\\+/.test(value)\n const formatter = baseCountry ? new AsYouType(baseCountry) : new AsYouType()\n const formatted = formatter.input(value)\n const phoneNumber = formatter.getNumber()\n const digits = sanitizeDigits(value)\n const detectedCountry = canonicalizeDetectedCountry(\n (phoneNumber?.country ?? formatter.country ?? undefined) as CountryCode | undefined\n )\n const inferredCountry =\n detectedCountry ?? !phoneNumber\n ? undefined\n : canonicalizeDetectedCountry(\n inferCountryFromDialCode(phoneNumber, baseCountry, digits)\n )\n\n const international = phoneNumber?.formatInternational() ?? formatted\n const national = phoneNumber?.formatNational() ?? sanitizeDigits(international)\n\n return {\n international,\n national,\n formatted,\n phoneNumber,\n detectedCountry,\n inferredCountry,\n hasExplicitInternationalPrefix,\n }\n}\n\nexport function stripPrefix(value: string, prefix: string) {\n return value.startsWith(prefix) ? value.slice(prefix.length) : value\n}\n\nexport function getLengthIssue(value: string, country: CountryCode | undefined): LengthIssue | null {\n if (!country || !value) {\n return null\n }\n\n try {\n const result = validatePhoneNumberLength(value, country)\n return result === \"TOO_LONG\" ? \"TOO_LONG\" : null\n } catch {\n return null\n }\n}\n\ntype SuggestionState = {\n shouldSuggest: boolean\n query: string\n}\n\nexport function getSuggestionState(\n normalized: string,\n baseCountry: CountryCode | undefined,\n phoneNumber: ReturnType<AsYouType[\"getNumber\"]>,\n options: {\n hasRemovedNationalPrefix?: boolean\n detectedCountry?: CountryCode\n hasExplicitInternationalPrefix?: boolean\n } = {}\n): SuggestionState {\n const {\n hasRemovedNationalPrefix = false,\n detectedCountry,\n hasExplicitInternationalPrefix = false,\n } = options\n\n if (!normalized) {\n return { shouldSuggest: false, query: \"\" }\n }\n\n if (normalized === \"+\") {\n return { shouldSuggest: true, query: \"\" }\n }\n\n const digits = sanitizeDigits(normalized)\n if (!digits) {\n return { shouldSuggest: true, query: \"\" }\n }\n\n if (hasRemovedNationalPrefix) {\n return { shouldSuggest: false, query: \"\" }\n }\n\n if (hasExplicitInternationalPrefix && !detectedCountry) {\n if (!isDialCodeProgress(digits)) {\n return { shouldSuggest: false, query: \"\" }\n }\n return { shouldSuggest: true, query: digits }\n }\n\n let dial = phoneNumber?.countryCallingCode ?? null\n if (!dial) {\n if (baseCountry) {\n const baseDial = getCountryCallingCode(baseCountry)\n if (digits.startsWith(baseDial)) {\n dial = baseDial\n }\n } else if (!hasExplicitInternationalPrefix) {\n return { shouldSuggest: false, query: \"\" }\n }\n }\n\n if (!dial) {\n return { shouldSuggest: true, query: digits }\n }\n\n const nationalDigits = stripPrefix(digits, dial)\n if (nationalDigits.length === 0) {\n return { shouldSuggest: true, query: digits }\n }\n\n return { shouldSuggest: false, query: \"\" }\n}\n\nexport function shouldDisplayExplicitCountrySelection(\n suggestion: SuggestionState,\n options: { detectedCountry?: CountryCode; hasExplicitInternationalPrefix?: boolean }\n) {\n if (suggestion.shouldSuggest) {\n return false\n }\n\n const { hasExplicitInternationalPrefix = false, detectedCountry } = options\n\n if (!hasExplicitInternationalPrefix) {\n return true\n }\n\n return Boolean(detectedCountry)\n}\n"],"names":["sanitizeDigits","value","replace","isDialCodeProgress","digits","length","MAX_DIAL_CODE_LENGTH","COUNTRY_DIAL_CODES","some","dial","startsWith","INVISIBLE_FORMATTING_CHARACTERS","stripInvisibleFormatting","injectNationalPrefixDisplay","international","dialCode","options","force","prefix","remainder","slice","trimStart","firstGroup","restGroups","split","rebuiltFirstGroup","rebuiltRemainder","join","trimEnd","DETECTED_COUNTRY_OVERRIDES","GG","JE","IM","canonicalizeDetectedCountry","candidate","inferCountryFromDialCode","phoneNumber","baseCountry","normalizedDigits","nationalNumber","countryCallingCode","metadataGetter","getMetadata","candidates","country_calling_codes","canonicalCandidates","canonical","includes","push","DEFAULT_COUNTRY","detectNationalPrefixForDisplay","rawDigits","internationalDigits","hasExplicitInternationalPrefix","rawAfterTrunk","internationalAfterDial","stripIddPrefix","COMMON_IDD_PREFIXES","normalizeInputValue","rawValue","country","allowJustPlus","removeNationalPrefix","previousValue","trimmed","trim","digitsWithoutIdd","getCountryCallingCode","withoutPrefix","digitsOnly","previousNormalized","previousDigits","endsWith","formatWithAsYouType","national","formatted","detectedCountry","undefined","inferredCountry","test","formatter","AsYouType","input","getNumber","formatInternational","formatNational","stripPrefix","getLengthIssue","validatePhoneNumberLength","getSuggestionState","normalized","hasRemovedNationalPrefix","shouldSuggest","query","baseDial","shouldDisplayExplicitCountrySelection","suggestion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AAO;AAAA,QAAEuC,eAAe;AAAA,QAAOC,OAAO;AAAA,MAAA;AAAA;AAI1C,SAAKpF,IAIkB6E,EAAYlF,GAAQK,CAAI,EAC5BJ,WAAW,IACrB;AAAA,IAAEuF,eAAe;AAAA,IAAMC,OAAOzF;AAAAA,EAAAA,IAGhC;AAAA,IAAEwF,eAAe;AAAA,IAAOC,OAAO;AAAA,EAAA,IAR7B;AAAA,IAAED,eAAe;AAAA,IAAMC,OAAOzF;AAAAA,EAAAA;AASzC;AAEO,SAAS2F,EACdC,GACAhF,GACA;AACA,MAAIgF,EAAWJ;AACb,WAAO;AAGT,QAAM;AAAA,IAAEvC,gCAAAA,IAAiC;AAAA,IAAOuB,iBAAAA;AAAAA,EAAAA,IAAoB5D;AAEpE,SAAKqC,IAIE4C,EAAQrB,IAHN;AAIX;"}
|
package/dist/index41.js
CHANGED
|
@@ -1,102 +1,94 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
function c(t) {
|
|
2
|
+
if (!t)
|
|
3
|
+
return !1;
|
|
4
|
+
const e = t.charCodeAt(0);
|
|
5
|
+
return e >= 48 && e <= 57;
|
|
6
|
+
}
|
|
7
|
+
function l(t, e) {
|
|
8
|
+
let n = 0;
|
|
9
|
+
const r = Math.min(e, t.length);
|
|
10
|
+
for (let i = 0; i < r; i += 1)
|
|
11
|
+
c(t[i] ?? "") && (n += 1);
|
|
12
|
+
return n;
|
|
13
|
+
}
|
|
14
|
+
function a(t, e) {
|
|
15
|
+
if (e <= 0)
|
|
16
|
+
return t.startsWith("+") ? Math.min(1, t.length) : 0;
|
|
17
|
+
let n = 0;
|
|
18
|
+
for (let r = 0; r < t.length; r += 1)
|
|
19
|
+
if (c(t[r] ?? "") && (n += 1, n === e))
|
|
20
|
+
return r + 1;
|
|
21
|
+
return t.length;
|
|
22
|
+
}
|
|
23
|
+
function g(t) {
|
|
24
|
+
return !t || c(t) ? !1 : t !== "+";
|
|
25
|
+
}
|
|
26
|
+
function h(t, e) {
|
|
27
|
+
let n = e;
|
|
28
|
+
for (; n > 0; ) {
|
|
29
|
+
const r = t[n - 1] ?? "";
|
|
30
|
+
if (!g(r))
|
|
31
|
+
break;
|
|
32
|
+
n -= 1;
|
|
9
33
|
}
|
|
10
|
-
|
|
34
|
+
return n;
|
|
11
35
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
m?.(n), t?.setHighlightedOption(e.data);
|
|
36
|
+
function S(t, e) {
|
|
37
|
+
let n = e;
|
|
38
|
+
for (; n < t.length; ) {
|
|
39
|
+
const r = t[n] ?? "";
|
|
40
|
+
if (!g(r))
|
|
41
|
+
break;
|
|
42
|
+
n += 1;
|
|
43
|
+
}
|
|
44
|
+
return n;
|
|
45
|
+
}
|
|
46
|
+
function m(t) {
|
|
47
|
+
const {
|
|
48
|
+
value: e
|
|
49
|
+
} = t, n = t.selectionStart ?? e.length, r = t.selectionEnd ?? n, i = n <= 1 && e.startsWith("+"), o = r <= 1 && e.startsWith("+");
|
|
50
|
+
return {
|
|
51
|
+
selectionStart: n,
|
|
52
|
+
selectionEnd: r,
|
|
53
|
+
startDigits: l(e, n),
|
|
54
|
+
endDigits: l(e, r),
|
|
55
|
+
preserveStartIndex: i,
|
|
56
|
+
preserveEndIndex: o,
|
|
57
|
+
wasAtStart: n === 0,
|
|
58
|
+
wasAtEnd: r === e.length
|
|
36
59
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
a ? "bg-muted text-foreground" : "text-foreground hover:bg-muted"
|
|
47
|
-
),
|
|
48
|
-
children: p(e.data)
|
|
60
|
+
}
|
|
61
|
+
function u(t, e) {
|
|
62
|
+
if (t.selectionStart === t.selectionEnd) {
|
|
63
|
+
if (t.wasAtEnd) {
|
|
64
|
+
const f = e.length;
|
|
65
|
+
return {
|
|
66
|
+
start: f,
|
|
67
|
+
end: f
|
|
68
|
+
};
|
|
49
69
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
padding: 0
|
|
68
|
-
}),
|
|
69
|
-
option: (e, t) => ({
|
|
70
|
-
...e,
|
|
71
|
-
fontSize: "0.875rem",
|
|
72
|
-
backgroundColor: t.isFocused ? "hsl(var(--muted))" : t.isSelected ? "hsl(var(--accent))" : "transparent",
|
|
73
|
-
color: t.isSelected ? "hsl(var(--accent-foreground))" : "hsl(var(--foreground))",
|
|
74
|
-
cursor: "pointer"
|
|
75
|
-
}),
|
|
76
|
-
noOptionsMessage: (e) => ({
|
|
77
|
-
...e,
|
|
78
|
-
fontSize: "0.875rem",
|
|
79
|
-
color: "hsl(var(--muted-foreground))"
|
|
80
|
-
})
|
|
81
|
-
}, H = (e) => /* @__PURE__ */ o.jsx("div", { style: { display: "none" }, children: e.children }), k = () => null;
|
|
82
|
-
function R(e) {
|
|
83
|
-
return /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
84
|
-
/* @__PURE__ */ o.jsxs("span", { className: "flex min-w-0 items-center gap-2", children: [
|
|
85
|
-
e.flag ? /* @__PURE__ */ o.jsx("span", { "aria-hidden": "true", className: "text-lg leading-none", children: e.flag }) : null,
|
|
86
|
-
/* @__PURE__ */ o.jsx("span", { className: "truncate", children: e.name })
|
|
87
|
-
] }),
|
|
88
|
-
/* @__PURE__ */ o.jsxs("span", { className: "text-xs text-muted-foreground", children: [
|
|
89
|
-
"+",
|
|
90
|
-
e.dialCode
|
|
91
|
-
] })
|
|
92
|
-
] });
|
|
70
|
+
if (t.wasAtStart)
|
|
71
|
+
return {
|
|
72
|
+
start: 0,
|
|
73
|
+
end: 0
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
const n = t.preserveStartIndex ? Math.min(t.selectionStart, e.length) : a(e, t.startDigits), r = t.preserveEndIndex ? Math.min(t.selectionEnd, e.length) : a(e, t.endDigits);
|
|
77
|
+
let i = n, o = r;
|
|
78
|
+
t.wasAtStart && (i = 0), t.wasAtEnd && (o = e.length), t.selectionStart === t.selectionEnd && (i = o);
|
|
79
|
+
const d = Math.min(Math.max(i, 0), e.length), s = Math.min(Math.max(o, 0), e.length);
|
|
80
|
+
return d > s ? {
|
|
81
|
+
start: s,
|
|
82
|
+
end: s
|
|
83
|
+
} : {
|
|
84
|
+
start: d,
|
|
85
|
+
end: s
|
|
86
|
+
};
|
|
93
87
|
}
|
|
94
88
|
export {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
R as formatCountryOption,
|
|
100
|
-
O as suggestionSelectStyles
|
|
89
|
+
m as captureSelectionSnapshot,
|
|
90
|
+
u as resolveSelection,
|
|
91
|
+
h as skipFormattingCharactersLeft,
|
|
92
|
+
S as skipFormattingCharactersRight
|
|
101
93
|
};
|
|
102
94
|
//# sourceMappingURL=index41.js.map
|
package/dist/index41.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index41.js","sources":["../src/components/PhoneNumberInput/
|
|
1
|
+
{"version":3,"file":"index41.js","sources":["../src/components/PhoneNumberInput/selection.ts"],"sourcesContent":["function isDigitCharacter(char: string) {\n if (!char) {\n return false\n }\n const code = char.charCodeAt(0)\n return code >= 48 && code <= 57\n}\n\nfunction countDigitsBefore(value: string, index: number) {\n let count = 0\n const limit = Math.min(index, value.length)\n for (let position = 0; position < limit; position += 1) {\n if (isDigitCharacter(value[position] ?? \"\")) {\n count += 1\n }\n }\n return count\n}\n\nfunction findIndexForDigitCount(value: string, digitCount: number) {\n if (digitCount <= 0) {\n return value.startsWith(\"+\") ? Math.min(1, value.length) : 0\n }\n\n let seen = 0\n for (let index = 0; index < value.length; index += 1) {\n if (isDigitCharacter(value[index] ?? \"\")) {\n seen += 1\n if (seen === digitCount) {\n return index + 1\n }\n }\n }\n\n return value.length\n}\n\nfunction isFormattingCharacter(char: string) {\n if (!char) {\n return false\n }\n if (isDigitCharacter(char)) {\n return false\n }\n return char !== \"+\"\n}\n\nexport function skipFormattingCharactersLeft(value: string, index: number) {\n let position = index\n while (position > 0) {\n const next = value[position - 1] ?? \"\"\n if (!isFormattingCharacter(next)) {\n break\n }\n position -= 1\n }\n return position\n}\n\nexport function skipFormattingCharactersRight(value: string, index: number) {\n let position = index\n while (position < value.length) {\n const next = value[position] ?? \"\"\n if (!isFormattingCharacter(next)) {\n break\n }\n position += 1\n }\n return position\n}\n\ntype SelectionSnapshot = {\n selectionStart: number\n selectionEnd: number\n startDigits: number\n endDigits: number\n preserveStartIndex: boolean\n preserveEndIndex: boolean\n wasAtStart: boolean\n wasAtEnd: boolean\n}\n\nexport function captureSelectionSnapshot(input: HTMLInputElement): SelectionSnapshot {\n const { value } = input\n const selectionStart = input.selectionStart ?? value.length\n const selectionEnd = input.selectionEnd ?? selectionStart\n const preserveStartIndex = selectionStart <= 1 && value.startsWith(\"+\")\n const preserveEndIndex = selectionEnd <= 1 && value.startsWith(\"+\")\n\n return {\n selectionStart,\n selectionEnd,\n startDigits: countDigitsBefore(value, selectionStart),\n endDigits: countDigitsBefore(value, selectionEnd),\n preserveStartIndex,\n preserveEndIndex,\n wasAtStart: selectionStart === 0,\n wasAtEnd: selectionEnd === value.length,\n }\n}\n\nexport function resolveSelection(snapshot: SelectionSnapshot, value: string) {\n if (snapshot.selectionStart === snapshot.selectionEnd) {\n if (snapshot.wasAtEnd) {\n const end = value.length\n return { start: end, end }\n }\n if (snapshot.wasAtStart) {\n return { start: 0, end: 0 }\n }\n }\n\n const start = snapshot.preserveStartIndex\n ? Math.min(snapshot.selectionStart, value.length)\n : findIndexForDigitCount(value, snapshot.startDigits)\n const end = snapshot.preserveEndIndex\n ? Math.min(snapshot.selectionEnd, value.length)\n : findIndexForDigitCount(value, snapshot.endDigits)\n\n let resolvedStart = start\n let resolvedEnd = end\n\n if (snapshot.wasAtStart) {\n resolvedStart = 0\n }\n\n if (snapshot.wasAtEnd) {\n resolvedEnd = value.length\n }\n\n if (snapshot.selectionStart === snapshot.selectionEnd) {\n resolvedStart = resolvedEnd\n }\n\n const clampedStart = Math.min(Math.max(resolvedStart, 0), value.length)\n const clampedEnd = Math.min(Math.max(resolvedEnd, 0), value.length)\n\n if (clampedStart > clampedEnd) {\n return { start: clampedEnd, end: clampedEnd }\n }\n\n return { start: clampedStart, end: clampedEnd }\n}\n\n"],"names":["isDigitCharacter","char","code","charCodeAt","countDigitsBefore","value","index","count","limit","Math","min","length","position","findIndexForDigitCount","digitCount","startsWith","seen","isFormattingCharacter","skipFormattingCharactersLeft","next","skipFormattingCharactersRight","captureSelectionSnapshot","input","selectionStart","selectionEnd","preserveStartIndex","preserveEndIndex","startDigits","endDigits","wasAtStart","wasAtEnd","resolveSelection","snapshot","end","start","resolvedStart","resolvedEnd","clampedStart","max","clampedEnd"],"mappings":"AAAA,SAASA,EAAiBC,GAAc;AACtC,MAAI,CAACA;AACH,WAAO;AAET,QAAMC,IAAOD,EAAKE,WAAW,CAAC;AAC9B,SAAOD,KAAQ,MAAMA,KAAQ;AAC/B;AAEA,SAASE,EAAkBC,GAAeC,GAAe;AACvD,MAAIC,IAAQ;AACZ,QAAMC,IAAQC,KAAKC,IAAIJ,GAAOD,EAAMM,MAAM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