@rpcbase/ui 0.182.0 → 0.184.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/helpers/index.d.ts +1 -0
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/useScrollPagination.d.ts +23 -0
- package/dist/helpers/useScrollPagination.d.ts.map +1 -0
- package/dist/helpers/useScrollPagination.test.d.ts +2 -0
- package/dist/helpers/useScrollPagination.test.d.ts.map +1 -0
- package/dist/index.js +62 -60
- package/dist/index.js.map +1 -1
- package/dist/index10.js +24 -69
- package/dist/index10.js.map +1 -1
- package/dist/index100.js +4 -3
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +5 -4
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +4 -6
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +4 -145
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +6 -39
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +24 -4
- package/dist/index105.js.map +1 -1
- package/dist/index106.js +6 -7
- package/dist/index106.js.map +1 -1
- package/dist/index107.js +4 -13
- package/dist/index107.js.map +1 -1
- package/dist/index108.js +6 -13
- package/dist/index108.js.map +1 -1
- package/dist/index109.js +5 -7
- package/dist/index109.js.map +1 -1
- package/dist/index11.js +38 -552
- package/dist/index11.js.map +1 -1
- package/dist/index110.js +4 -31
- package/dist/index110.js.map +1 -1
- package/dist/index111.js +5 -10
- package/dist/index111.js.map +1 -1
- package/dist/index112.js +4 -10
- package/dist/index112.js.map +1 -1
- package/dist/index113.js +8 -8
- package/dist/index113.js.map +1 -1
- package/dist/index114.js +5 -13
- package/dist/index114.js.map +1 -1
- package/dist/index115.js +4 -101
- package/dist/index115.js.map +1 -1
- package/dist/index116.js +5 -20
- package/dist/index116.js.map +1 -1
- package/dist/index117.js +6 -53
- package/dist/index117.js.map +1 -1
- package/dist/index118.js +145 -72
- package/dist/index118.js.map +1 -1
- package/dist/index119.js +39 -9
- package/dist/index119.js.map +1 -1
- package/dist/index12.js +571 -115
- package/dist/index12.js.map +1 -1
- package/dist/index120.js +4 -20
- package/dist/index120.js.map +1 -1
- package/dist/index121.js +7 -16
- package/dist/index121.js.map +1 -1
- package/dist/index122.js +13 -23
- package/dist/index122.js.map +1 -1
- package/dist/index123.js +13 -6
- package/dist/index123.js.map +1 -1
- package/dist/index124.js +7 -5
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +31 -23
- package/dist/index125.js.map +1 -1
- package/dist/index126.js +11 -35
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +11 -16
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +8 -6
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +13 -4
- package/dist/index129.js.map +1 -1
- package/dist/index13.js +137 -76
- package/dist/index13.js.map +1 -1
- package/dist/index130.js +101 -4
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +20 -5
- package/dist/index131.js.map +1 -1
- package/dist/index132.js +53 -4
- package/dist/index132.js.map +1 -1
- package/dist/index133.js +72 -3
- package/dist/index133.js.map +1 -1
- package/dist/index134.js +9 -6
- package/dist/index134.js.map +1 -1
- package/dist/index135.js +21 -24
- package/dist/index135.js.map +1 -1
- package/dist/index136.js +16 -7
- package/dist/index136.js.map +1 -1
- package/dist/index137.js +23 -6
- package/dist/index137.js.map +1 -1
- package/dist/index138.js +6 -5
- package/dist/index138.js.map +1 -1
- package/dist/index139.js +5 -3
- package/dist/index139.js.map +1 -1
- package/dist/index14.js +74 -730
- package/dist/index14.js.map +1 -1
- package/dist/index140.js +23 -3
- package/dist/index140.js.map +1 -1
- package/dist/index141.js +35 -5
- package/dist/index141.js.map +1 -1
- package/dist/index142.js +16 -4
- package/dist/index142.js.map +1 -1
- package/dist/index143.js +6 -4
- package/dist/index143.js.map +1 -1
- package/dist/index144.js +4 -3
- package/dist/index144.js.map +1 -1
- package/dist/index145.js +4 -3
- package/dist/index145.js.map +1 -1
- package/dist/index146.js +4 -3
- package/dist/index146.js.map +1 -1
- package/dist/index147.js +4 -46
- package/dist/index147.js.map +1 -1
- package/dist/index148.js +3 -46
- package/dist/index148.js.map +1 -1
- package/dist/index149.js +6 -205
- package/dist/index149.js.map +1 -1
- package/dist/index15.js +870 -22
- package/dist/index15.js.map +1 -1
- package/dist/index150.js +24 -22
- package/dist/index150.js.map +1 -1
- package/dist/index151.js +7 -24
- package/dist/index151.js.map +1 -1
- package/dist/index152.js +6 -399
- package/dist/index152.js.map +1 -1
- package/dist/index153.js +5 -5
- package/dist/index153.js.map +1 -1
- package/dist/index154.js +3 -68
- package/dist/index154.js.map +1 -1
- package/dist/index155.js +4 -2
- package/dist/index155.js.map +1 -1
- package/dist/index156.js +4 -363
- package/dist/index156.js.map +1 -1
- package/dist/index157.js +3 -261
- package/dist/index157.js.map +1 -1
- package/dist/index158.js +4 -60
- package/dist/index158.js.map +1 -1
- package/dist/index159.js +3 -46
- package/dist/index159.js.map +1 -1
- package/dist/index16.js +20 -17
- package/dist/index16.js.map +1 -1
- package/dist/index160.js +3 -169
- package/dist/index160.js.map +1 -1
- package/dist/index161.js +3 -109
- package/dist/index161.js.map +1 -1
- package/dist/index162.js +5 -24
- package/dist/index162.js.map +1 -1
- package/dist/index163.js +69 -8
- package/dist/index163.js.map +1 -1
- package/dist/index164.js +2 -5
- package/dist/index164.js.map +1 -1
- package/dist/index165.js +363 -5
- package/dist/index165.js.map +1 -1
- package/dist/index166.js +261 -4
- package/dist/index166.js.map +1 -1
- package/dist/index167.js +52 -458
- package/dist/index167.js.map +1 -1
- package/dist/index168.js +42 -181
- package/dist/index168.js.map +1 -1
- package/dist/index169.js +156 -94
- package/dist/index169.js.map +1 -1
- package/dist/index17.js +18 -387
- package/dist/index17.js.map +1 -1
- package/dist/index170.js +102 -255
- package/dist/index170.js.map +1 -1
- package/dist/index171.js +24 -9
- package/dist/index171.js.map +1 -1
- package/dist/index172.js +8 -43
- package/dist/index172.js.map +1 -1
- package/dist/index173.js +4 -4
- package/dist/index173.js.map +1 -1
- package/dist/index174.js +5 -605
- package/dist/index174.js.map +1 -1
- package/dist/index175.js +4 -58
- package/dist/index175.js.map +1 -1
- package/dist/index176.js +466 -8
- package/dist/index176.js.map +1 -1
- package/dist/index177.js +178 -59
- package/dist/index177.js.map +1 -1
- package/dist/index178.js +105 -17
- package/dist/index178.js.map +1 -1
- package/dist/index179.js +260 -14
- package/dist/index179.js.map +1 -1
- package/dist/index18.js +431 -693
- package/dist/index18.js.map +1 -1
- package/dist/index180.js +9 -5
- package/dist/index180.js.map +1 -1
- package/dist/index181.js +41 -4
- package/dist/index181.js.map +1 -1
- package/dist/index182.js +4 -6
- package/dist/index182.js.map +1 -1
- package/dist/index183.js +24 -4
- package/dist/index183.js.map +1 -1
- package/dist/index184.js +29 -8
- package/dist/index184.js.map +1 -1
- package/dist/index185.js +5 -18
- package/dist/index185.js.map +1 -1
- package/dist/index186.js +67 -5
- package/dist/index186.js.map +1 -1
- package/dist/index187.js +180 -5
- package/dist/index187.js.map +1 -1
- package/dist/index188.js +46 -13
- package/dist/index188.js.map +1 -1
- package/dist/index189.js +58 -10
- package/dist/index189.js.map +1 -1
- package/dist/index19.js +661 -634
- package/dist/index19.js.map +1 -1
- package/dist/index190.js +8 -14
- package/dist/index190.js.map +1 -1
- package/dist/index191.js +66 -14
- package/dist/index191.js.map +1 -1
- package/dist/index192.js +19 -5
- package/dist/index192.js.map +1 -1
- package/dist/index193.js +16 -6
- package/dist/index193.js.map +1 -1
- package/dist/index194.js +5 -7
- package/dist/index194.js.map +1 -1
- package/dist/index195.js +5 -6
- package/dist/index195.js.map +1 -1
- package/dist/index196.js +6 -9
- package/dist/index196.js.map +1 -1
- package/dist/index197.js +4 -5
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +7 -5
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +17 -9
- package/dist/index199.js.map +1 -1
- package/dist/index2.js +2 -2
- package/dist/index20.js +455 -198
- package/dist/index20.js.map +1 -1
- package/dist/index200.js +5 -5
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +5 -5
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +13 -4
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +9 -10
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +14 -10
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +14 -10
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +5 -11
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +6 -11
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +6 -9
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +6 -7
- package/dist/index209.js.map +1 -1
- package/dist/index21.js +263 -5
- package/dist/index21.js.map +1 -1
- package/dist/index210.js +9 -6
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +5 -5
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +5 -6
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +9 -7
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +5 -6
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +5 -55
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +4 -16
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +11 -7
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +10 -10
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +10 -10
- package/dist/index219.js.map +1 -1
- package/dist/index22.js +5 -35
- package/dist/index22.js.map +1 -1
- package/dist/index220.js +11 -21
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +11 -10
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +10 -9
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +7 -9
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +6 -4
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +5 -5
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +6 -16
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +7 -9
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +6 -18
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +54 -14
- package/dist/index229.js.map +1 -1
- package/dist/index23.js +27 -268
- package/dist/index23.js.map +1 -1
- package/dist/index230.js +16 -12
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +7 -29
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +9 -11
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +9 -24
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +21 -5
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +10 -24
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +10 -29
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +10 -5
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +4 -13
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +5 -154
- package/dist/index239.js.map +1 -1
- package/dist/index24.js +251 -166
- package/dist/index24.js.map +1 -1
- package/dist/index240.js +15 -29
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +9 -9
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +18 -47
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +15 -11
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +12 -44
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +28 -94
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +11 -85
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +23 -103
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +5 -52
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +13 -11
- package/dist/index249.js.map +1 -1
- package/dist/index25.js +176 -14
- package/dist/index25.js.map +1 -1
- package/dist/index250.js +149 -32
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +30 -8
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +9 -116
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +46 -16
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +11 -15
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +44 -3
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +91 -32
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +85 -19
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +105 -9
- package/dist/index258.js.map +1 -1
- package/dist/index259.js +52 -8
- package/dist/index259.js.map +1 -1
- package/dist/index26.js +15 -2763
- package/dist/index26.js.map +1 -1
- package/dist/index260.js +10 -18
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +36 -27
- package/dist/index261.js.map +1 -1
- package/dist/index262.js +8 -16
- package/dist/index262.js.map +1 -1
- package/dist/index263.js +3 -67
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +9 -180
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +110 -40
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +17 -4
- package/dist/index266.js.map +1 -1
- package/dist/index267.js +15 -18
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +36 -12
- package/dist/index268.js.map +1 -1
- package/dist/index269.js +21 -5
- package/dist/index269.js.map +1 -1
- package/dist/index27.js +2761 -35
- package/dist/index27.js.map +1 -1
- package/dist/index270.js +9 -3
- package/dist/index270.js.map +1 -1
- package/dist/index271.js +19 -23
- package/dist/index271.js.map +1 -1
- package/dist/index272.js +26 -110
- package/dist/index272.js.map +1 -1
- package/dist/index273.js +16 -15
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +5 -525
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +3 -128
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +22 -132
- package/dist/index276.js.map +1 -1
- package/dist/index277.js +111 -19
- package/dist/index277.js.map +1 -1
- package/dist/index278.js +15 -5
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +524 -5
- package/dist/index279.js.map +1 -1
- package/dist/index28.js +2 -2
- package/dist/index280.js +128 -4
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +132 -14
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +4 -8
- package/dist/index282.js.map +1 -1
- package/dist/index283.js +19 -6
- package/dist/index283.js.map +1 -1
- package/dist/index284.js +12 -4
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +19 -544
- package/dist/index285.js.map +1 -1
- package/dist/index286.js +65 -43
- package/dist/index286.js.map +1 -1
- package/dist/index287.js +9 -18
- package/dist/index287.js.map +1 -1
- package/dist/index288.js +14 -7
- package/dist/index288.js.map +1 -1
- package/dist/index289.js +66 -9
- package/dist/index289.js.map +1 -1
- package/dist/index29.js +33 -121
- package/dist/index29.js.map +1 -1
- package/dist/index290.js +64 -7
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +5 -8
- package/dist/index291.js.map +1 -1
- package/dist/index292.js +5 -12
- package/dist/index292.js.map +1 -1
- package/dist/index293.js +4 -10
- package/dist/index293.js.map +1 -1
- package/dist/index294.js +15 -13
- package/dist/index294.js.map +1 -1
- package/dist/index295.js +8 -64
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +6 -69
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +5 -9
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +545 -13
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +45 -64
- package/dist/index299.js.map +1 -1
- package/dist/index3.js.map +1 -1
- package/dist/index30.js +3 -232
- package/dist/index30.js.map +1 -1
- package/dist/index300.js +17 -4
- package/dist/index300.js.map +1 -1
- package/dist/index301.js +7 -56
- package/dist/index301.js.map +1 -1
- package/dist/index302.js +9 -68
- package/dist/index302.js.map +1 -1
- package/dist/index303.js +8 -31
- package/dist/index303.js.map +1 -1
- package/dist/index304.js +9 -9
- package/dist/index304.js.map +1 -1
- package/dist/index305.js +13 -153
- package/dist/index305.js.map +1 -1
- package/dist/index306.js +10 -108
- package/dist/index306.js.map +1 -1
- package/dist/index307.js +13 -3
- package/dist/index307.js.map +1 -1
- package/dist/index308.js +3 -22
- package/dist/index308.js.map +1 -1
- package/dist/index309.js +22 -15
- package/dist/index309.js.map +1 -1
- package/dist/index31.js +123 -22
- package/dist/index31.js.map +1 -1
- package/dist/index310.js +4 -28
- package/dist/index310.js.map +1 -1
- package/dist/index311.js +56 -13
- package/dist/index311.js.map +1 -1
- package/dist/index312.js +68 -7
- package/dist/index312.js.map +1 -1
- package/dist/index313.js +30 -22
- package/dist/index313.js.map +1 -1
- package/dist/index314.js +9 -13
- package/dist/index314.js.map +1 -1
- package/dist/index315.js +151 -26
- package/dist/index315.js.map +1 -1
- package/dist/index316.js +107 -4
- package/dist/index316.js.map +1 -1
- package/dist/index317.js +26 -0
- package/dist/index317.js.map +1 -0
- package/dist/index318.js +16 -0
- package/dist/index318.js.map +1 -0
- package/dist/index319.js +31 -0
- package/dist/index319.js.map +1 -0
- package/dist/index32.js +230 -49
- package/dist/index32.js.map +1 -1
- package/dist/index320.js +8 -0
- package/dist/index320.js.map +1 -0
- package/dist/index321.js +19 -0
- package/dist/index321.js.map +1 -0
- package/dist/index322.js +32 -0
- package/dist/index322.js.map +1 -0
- package/dist/index323.js +16 -0
- package/dist/index323.js.map +1 -0
- package/dist/index324.js +10 -0
- package/dist/index324.js.map +1 -0
- package/dist/index33.js +20 -2637
- package/dist/index33.js.map +1 -1
- package/dist/index34.js +47 -390
- package/dist/index34.js.map +1 -1
- package/dist/index35.js +2604 -196
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +390 -18
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +222 -131
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +18 -183
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +118 -65
- package/dist/index39.js.map +1 -1
- package/dist/index4.js +17 -15
- package/dist/index4.js.map +1 -1
- package/dist/index40.js +216 -93
- package/dist/index40.js.map +1 -1
- package/dist/index41.js +90 -5
- package/dist/index41.js.map +1 -1
- package/dist/index42.js +115 -840
- package/dist/index42.js.map +1 -1
- package/dist/index43.js +6 -66
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +843 -7
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +57 -2
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +7 -23
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +2 -234
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +11 -6
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +18 -33
- 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 -26
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +2 -8
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +22 -10
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +233 -3
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +201 -44
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +3 -50
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +6 -7
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +47 -14
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +22 -129
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +50 -10
- package/dist/index59.js.map +1 -1
- package/dist/index6.js +172 -25
- package/dist/index6.js.map +1 -1
- package/dist/index60.js +7 -216
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +15 -13
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +128 -41
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +9 -48
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +216 -3
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +13 -6
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +34 -28
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +46 -49
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +8 -9
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +50 -2
- package/dist/index69.js.map +1 -1
- package/dist/index7.js +31 -29
- package/dist/index7.js.map +1 -1
- package/dist/index70.js +4 -2
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +6 -205
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +28 -54
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +50 -6
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +9 -8
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +2 -6
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +2 -52
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +11 -4
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +5 -4
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +7 -15
- package/dist/index79.js.map +1 -1
- package/dist/index8.js +25 -222
- package/dist/index8.js.map +1 -1
- package/dist/index80.js +5 -5
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +2 -8
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +2 -17
- package/dist/index82.js.map +1 -1
- package/dist/index83.js +53 -4
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +46 -4
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +205 -5
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +22 -6
- package/dist/index86.js.map +1 -1
- package/dist/index87.js +24 -4
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +399 -4
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +46 -6
- package/dist/index89.js.map +1 -1
- package/dist/index9.js +177 -23
- package/dist/index9.js.map +1 -1
- package/dist/index90.js +604 -23
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +52 -7
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +3 -3
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +4 -6
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +15 -5
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +5 -4
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +7 -5
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +16 -4
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +4 -8
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +4 -5
- package/dist/index99.js.map +1 -1
- package/package.json +1 -1
package/dist/index25.js
CHANGED
|
@@ -1,18 +1,180 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { j as e } from "./index30.js";
|
|
2
|
+
import { useState as g, useMemo as A, useEffect as k } from "react";
|
|
3
|
+
import { Loader2 as S } from "lucide-react";
|
|
4
|
+
import { cn as w } from "./index2.js";
|
|
5
|
+
const D = [{
|
|
6
|
+
value: "off",
|
|
7
|
+
label: "Off"
|
|
8
|
+
}, {
|
|
9
|
+
value: "daily",
|
|
10
|
+
label: "Daily"
|
|
11
|
+
}, {
|
|
12
|
+
value: "weekly",
|
|
13
|
+
label: "Weekly"
|
|
14
|
+
}], f = (r) => {
|
|
15
|
+
const o = r?.digestFrequency, s = o === "off" || o === "daily" || o === "weekly" ? o : "weekly", p = Array.isArray(r?.topicPreferences) ? r.topicPreferences.map((i) => ({
|
|
16
|
+
topic: typeof i.topic == "string" ? i.topic.trim() : "",
|
|
17
|
+
inApp: i.inApp === !0,
|
|
18
|
+
emailDigest: i.emailDigest === !0,
|
|
19
|
+
push: i.push === !0
|
|
20
|
+
})).filter((i) => i.topic.length > 0) : [];
|
|
21
|
+
return {
|
|
22
|
+
digestFrequency: s,
|
|
23
|
+
topicPreferences: p,
|
|
24
|
+
...typeof r?.lastDigestSentAt == "string" ? {
|
|
25
|
+
lastDigestSentAt: r.lastDigestSentAt
|
|
26
|
+
} : {}
|
|
27
|
+
};
|
|
28
|
+
}, T = (r) => {
|
|
29
|
+
if (!Array.isArray(r)) return [];
|
|
30
|
+
const o = /* @__PURE__ */ new Set();
|
|
31
|
+
return r.map((s) => ({
|
|
32
|
+
topic: typeof s.topic == "string" ? s.topic.trim() : "",
|
|
33
|
+
title: typeof s.title == "string" ? s.title.trim() : "",
|
|
34
|
+
description: typeof s.description == "string" ? s.description.trim() : void 0
|
|
35
|
+
})).filter((s) => s.topic.length > 0).filter((s) => o.has(s.topic) ? !1 : (o.add(s.topic), !0));
|
|
36
|
+
}, y = (r, o) => {
|
|
37
|
+
const s = {
|
|
38
|
+
topic: "",
|
|
39
|
+
inApp: !0,
|
|
40
|
+
emailDigest: !0,
|
|
41
|
+
push: !1
|
|
42
|
+
}, p = new Map(r.topicPreferences.map((i) => [i.topic, i]));
|
|
43
|
+
return {
|
|
44
|
+
...r,
|
|
45
|
+
topicPreferences: o.map((i) => {
|
|
46
|
+
const d = p.get(i.topic);
|
|
47
|
+
return d ? {
|
|
48
|
+
topic: i.topic,
|
|
49
|
+
inApp: d.inApp === !0,
|
|
50
|
+
emailDigest: d.emailDigest === !0,
|
|
51
|
+
push: d.push === !0
|
|
52
|
+
} : {
|
|
53
|
+
...s,
|
|
54
|
+
topic: i.topic
|
|
55
|
+
};
|
|
56
|
+
})
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
function z({
|
|
60
|
+
className: r,
|
|
61
|
+
topics: o
|
|
62
|
+
}) {
|
|
63
|
+
const [s, p] = g(!0), [i, d] = g(!1), [j, u] = g(null), [m, h] = g(() => f({
|
|
64
|
+
digestFrequency: "weekly",
|
|
65
|
+
topicPreferences: []
|
|
66
|
+
})), a = A(() => T(o), [o]), P = async () => {
|
|
67
|
+
p(!0), u(null);
|
|
68
|
+
try {
|
|
69
|
+
const t = await fetch("/api/rb/notifications/settings", {
|
|
70
|
+
method: "GET",
|
|
71
|
+
credentials: "include"
|
|
72
|
+
}), c = await t.json().catch(() => null);
|
|
73
|
+
if (!t.ok || !c?.ok) {
|
|
74
|
+
u(c?.error || "Unable to load notification settings.");
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const n = f(c.settings);
|
|
78
|
+
h(a.length > 0 ? y(n, a) : n);
|
|
79
|
+
} catch {
|
|
80
|
+
u("Unable to load notification settings.");
|
|
81
|
+
} finally {
|
|
82
|
+
p(!1);
|
|
83
|
+
}
|
|
84
|
+
}, v = async (t) => {
|
|
85
|
+
d(!0), u(null);
|
|
86
|
+
try {
|
|
87
|
+
const c = await fetch("/api/rb/notifications/settings", {
|
|
88
|
+
method: "PUT",
|
|
89
|
+
headers: {
|
|
90
|
+
"Content-Type": "application/json"
|
|
91
|
+
},
|
|
92
|
+
credentials: "include",
|
|
93
|
+
body: JSON.stringify({
|
|
94
|
+
digestFrequency: t.digestFrequency,
|
|
95
|
+
topicPreferences: t.topicPreferences
|
|
96
|
+
})
|
|
97
|
+
}), n = await c.json().catch(() => null);
|
|
98
|
+
if (!c.ok || !n?.ok) {
|
|
99
|
+
u(n?.error || "Unable to save notification settings.");
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
const l = f(n.settings);
|
|
103
|
+
h(a.length > 0 ? y(l, a) : l);
|
|
104
|
+
} catch {
|
|
105
|
+
u("Unable to save notification settings.");
|
|
106
|
+
} finally {
|
|
107
|
+
d(!1);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
k(() => {
|
|
111
|
+
P();
|
|
112
|
+
}, []), k(() => {
|
|
113
|
+
a.length !== 0 && h((t) => y(t, a));
|
|
114
|
+
}, [a]);
|
|
115
|
+
const N = (t, c) => {
|
|
116
|
+
const l = m.topicPreferences.some((x) => x.topic === t) ? m.topicPreferences.map((x) => x.topic === t ? c(x) : x) : [...m.topicPreferences, c({
|
|
117
|
+
topic: t,
|
|
118
|
+
inApp: !0,
|
|
119
|
+
emailDigest: !0,
|
|
120
|
+
push: !1
|
|
121
|
+
})], b = f({
|
|
122
|
+
...m,
|
|
123
|
+
topicPreferences: l
|
|
124
|
+
});
|
|
125
|
+
h(b), v(b);
|
|
126
|
+
};
|
|
127
|
+
return s ? /* @__PURE__ */ e.jsx("div", { className: w("flex items-center justify-center py-10 text-muted-foreground", r), children: /* @__PURE__ */ e.jsx(S, { className: "h-4 w-4 animate-spin" }) }) : /* @__PURE__ */ e.jsxs("div", { className: w("space-y-4", r), children: [
|
|
128
|
+
/* @__PURE__ */ e.jsx("div", { className: "rounded-md border bg-background p-4", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-start justify-between gap-3", children: [
|
|
129
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
130
|
+
/* @__PURE__ */ e.jsx("div", { className: "text-sm font-semibold", children: "Email digest" }),
|
|
131
|
+
/* @__PURE__ */ e.jsx("div", { className: "mt-1 text-xs text-muted-foreground", children: "Choose how often we email you a summary." })
|
|
132
|
+
] }),
|
|
133
|
+
/* @__PURE__ */ e.jsx("select", { value: m.digestFrequency, onChange: (t) => {
|
|
134
|
+
const c = t.target.value, n = f({
|
|
135
|
+
...m,
|
|
136
|
+
digestFrequency: c
|
|
137
|
+
});
|
|
138
|
+
h(n), v(n);
|
|
139
|
+
}, className: "h-9 rounded-md border bg-background px-2 text-sm", children: D.map((t) => /* @__PURE__ */ e.jsx("option", { value: t.value, children: t.label }, t.value)) })
|
|
140
|
+
] }) }),
|
|
141
|
+
/* @__PURE__ */ e.jsxs("div", { className: "rounded-md border bg-background p-4", children: [
|
|
142
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-start justify-between gap-3", children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
143
|
+
/* @__PURE__ */ e.jsx("div", { className: "text-sm font-semibold", children: "Topics" }),
|
|
144
|
+
/* @__PURE__ */ e.jsx("div", { className: "mt-1 text-xs text-muted-foreground", children: "Choose where you receive each topic." })
|
|
145
|
+
] }) }),
|
|
146
|
+
a.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "mt-4 text-sm text-muted-foreground", children: "No topics configured." }) : /* @__PURE__ */ e.jsx("div", { className: "mt-4 overflow-x-auto", children: /* @__PURE__ */ e.jsxs("table", { className: "w-full text-sm", children: [
|
|
147
|
+
/* @__PURE__ */ e.jsx("thead", { children: /* @__PURE__ */ e.jsxs("tr", { className: "text-left text-xs text-muted-foreground", children: [
|
|
148
|
+
/* @__PURE__ */ e.jsx("th", { className: "py-2 pr-4 font-medium", children: "Topic" }),
|
|
149
|
+
/* @__PURE__ */ e.jsx("th", { className: "py-2 pr-4 font-medium", children: "In-app" }),
|
|
150
|
+
/* @__PURE__ */ e.jsx("th", { className: "py-2 pr-4 font-medium", children: "Email digest" }),
|
|
151
|
+
/* @__PURE__ */ e.jsx("th", { className: "py-2 pr-4 font-medium", children: "Push" })
|
|
152
|
+
] }) }),
|
|
153
|
+
/* @__PURE__ */ e.jsx("tbody", { children: m.topicPreferences.map((t) => {
|
|
154
|
+
const c = a.find((n) => n.topic === t.topic);
|
|
155
|
+
return /* @__PURE__ */ e.jsxs("tr", { className: "border-t align-top", children: [
|
|
156
|
+
/* @__PURE__ */ e.jsx("td", { className: "py-3 pr-4", children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
157
|
+
/* @__PURE__ */ e.jsx("span", { className: "font-medium", children: c?.title || t.topic }),
|
|
158
|
+
c?.description ? /* @__PURE__ */ e.jsx("span", { className: "text-xs text-muted-foreground", children: c.description }) : null,
|
|
159
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-[11px] text-muted-foreground", children: t.topic })
|
|
160
|
+
] }) }),
|
|
161
|
+
/* @__PURE__ */ e.jsx("td", { className: "py-3 pr-4", children: /* @__PURE__ */ e.jsx("input", { type: "checkbox", checked: t.inApp, onChange: (n) => N(t.topic, (l) => ({
|
|
162
|
+
...l,
|
|
163
|
+
inApp: n.target.checked
|
|
164
|
+
})) }) }),
|
|
165
|
+
/* @__PURE__ */ e.jsx("td", { className: "py-3 pr-4", children: /* @__PURE__ */ e.jsx("input", { type: "checkbox", checked: t.emailDigest, onChange: (n) => N(t.topic, (l) => ({
|
|
166
|
+
...l,
|
|
167
|
+
emailDigest: n.target.checked
|
|
168
|
+
})) }) }),
|
|
169
|
+
/* @__PURE__ */ e.jsx("td", { className: "py-3 pr-4", children: /* @__PURE__ */ e.jsx("input", { type: "checkbox", checked: t.push, disabled: !0, className: "opacity-50", "aria-label": "Push notifications (coming soon)" }) })
|
|
170
|
+
] }, t.topic);
|
|
171
|
+
}) })
|
|
172
|
+
] }) }),
|
|
173
|
+
j ? /* @__PURE__ */ e.jsx("div", { className: "mt-3 text-sm text-destructive", children: j }) : i ? /* @__PURE__ */ e.jsx("div", { className: "mt-3 text-xs text-muted-foreground", children: "Saving…" }) : null
|
|
174
|
+
] })
|
|
175
|
+
] });
|
|
13
176
|
}
|
|
14
177
|
export {
|
|
15
|
-
|
|
16
|
-
i as default
|
|
178
|
+
z as NotificationsSettings
|
|
17
179
|
};
|
|
18
180
|
//# sourceMappingURL=index25.js.map
|
package/dist/index25.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index25.js","sources":["../../../node_modules/clsx/dist/clsx.mjs"],"sourcesContent":["function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;"],"names":["r","e","t","n","clsx"],"mappings":"AAAA,SAASA,EAAEC,GAAE;AAAC,MAAIC,GAAE,GAAEC,IAAE;AAAG,MAAa,OAAOF,KAAjB,YAA8B,OAAOA,KAAjB,SAAmB,CAAAE,KAAGF;AAAA,WAAoB,OAAOA,KAAjB,SAAmB,KAAG,MAAM,QAAQA,CAAC,GAAE;AAAC,QAAI,IAAEA,EAAE;AAAO,SAAIC,IAAE,GAAEA,IAAE,GAAEA,IAAI,CAAAD,EAAEC,CAAC,MAAI,IAAEF,EAAEC,EAAEC,CAAC,CAAC,OAAKC,MAAIA,KAAG,MAAKA,KAAG;AAAA,EAAE,MAAM,MAAI,KAAKF,EAAE,CAAAA,EAAE,CAAC,MAAIE,MAAIA,KAAG,MAAKA,KAAG;AAAG,SAAOA;AAAC;AAAQ,SAASC,IAAM;AAAC,WAAQH,GAAEC,GAAE,IAAE,GAAEC,IAAE,IAAG,IAAE,UAAU,QAAO,IAAE,GAAE,IAAI,EAACF,IAAE,UAAU,CAAC,OAAKC,IAAEF,EAAEC,CAAC,OAAKE,MAAIA,KAAG,MAAKA,KAAGD;AAAG,SAAOC;AAAC;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index25.js","sources":["../src/components/Notifications/NotificationsSettings.tsx"],"sourcesContent":["import { useEffect, useMemo, useState } from \"react\"\nimport { Loader2 } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport type { NotificationDigestFrequency, NotificationSettings, NotificationTopicCatalogItem, NotificationTopicPreference } from \"./types\"\n\n\ntype SettingsResponse = {\n ok?: boolean\n error?: string\n settings?: NotificationSettings\n}\n\nconst digestValues: Array<{ value: NotificationDigestFrequency; label: string }> = [\n { value: \"off\", label: \"Off\" },\n { value: \"daily\", label: \"Daily\" },\n { value: \"weekly\", label: \"Weekly\" },\n]\n\nconst normalizeSettings = (settings: NotificationSettings | undefined): NotificationSettings => {\n const digestFrequency = settings?.digestFrequency\n const frequency: NotificationDigestFrequency =\n digestFrequency === \"off\" || digestFrequency === \"daily\" || digestFrequency === \"weekly\"\n ? digestFrequency\n : \"weekly\"\n\n const topicPreferences = Array.isArray(settings?.topicPreferences)\n ? settings!.topicPreferences\n .map((pref) => ({\n topic: typeof pref.topic === \"string\" ? pref.topic.trim() : \"\",\n inApp: pref.inApp === true,\n emailDigest: pref.emailDigest === true,\n push: pref.push === true,\n }))\n .filter((pref) => pref.topic.length > 0)\n : []\n\n return {\n digestFrequency: frequency,\n topicPreferences,\n ...(typeof settings?.lastDigestSentAt === \"string\" ? { lastDigestSentAt: settings.lastDigestSentAt } : {}),\n }\n}\n\nconst normalizeTopics = (topics: NotificationTopicCatalogItem[] | undefined): NotificationTopicCatalogItem[] => {\n if (!Array.isArray(topics)) return []\n\n const seen = new Set<string>()\n return topics\n .map((topic) => ({\n topic: typeof topic.topic === \"string\" ? topic.topic.trim() : \"\",\n title: typeof topic.title === \"string\" ? topic.title.trim() : \"\",\n description: typeof topic.description === \"string\" ? topic.description.trim() : undefined,\n }))\n .filter((topic) => topic.topic.length > 0)\n .filter((topic) => {\n if (seen.has(topic.topic)) return false\n seen.add(topic.topic)\n return true\n })\n}\n\nconst applyTopicsToSettings = (\n settings: NotificationSettings,\n topics: NotificationTopicCatalogItem[],\n): NotificationSettings => {\n const defaults: NotificationTopicPreference = {\n topic: \"\",\n inApp: true,\n emailDigest: true,\n push: false,\n }\n\n const byTopic = new Map(settings.topicPreferences.map((pref) => [pref.topic, pref]))\n return {\n ...settings,\n topicPreferences: topics.map((topic) => {\n const existing = byTopic.get(topic.topic)\n return existing\n ? {\n topic: topic.topic,\n inApp: existing.inApp === true,\n emailDigest: existing.emailDigest === true,\n push: existing.push === true,\n }\n : {\n ...defaults,\n topic: topic.topic,\n }\n }),\n }\n}\n\nexport function NotificationsSettings({\n className,\n topics,\n}: {\n className?: string\n topics?: NotificationTopicCatalogItem[]\n}) {\n const [loading, setLoading] = useState(true)\n const [saving, setSaving] = useState(false)\n const [error, setError] = useState<string | null>(null)\n const [settings, setSettings] = useState<NotificationSettings>(() =>\n normalizeSettings({ digestFrequency: \"weekly\", topicPreferences: [] }),\n )\n\n const normalizedTopics = useMemo(() => normalizeTopics(topics), [topics])\n\n const loadSettings = async () => {\n setLoading(true)\n setError(null)\n try {\n const res = await fetch(\"/api/rb/notifications/settings\", {\n method: \"GET\",\n credentials: \"include\",\n })\n const json = (await res.json().catch(() => null)) as SettingsResponse | null\n if (!res.ok || !json?.ok) {\n setError(json?.error || \"Unable to load notification settings.\")\n return\n }\n const normalized = normalizeSettings(json.settings)\n setSettings(normalizedTopics.length > 0 ? applyTopicsToSettings(normalized, normalizedTopics) : normalized)\n } catch {\n setError(\"Unable to load notification settings.\")\n } finally {\n setLoading(false)\n }\n }\n\n const saveSettings = async (next: NotificationSettings) => {\n setSaving(true)\n setError(null)\n try {\n const res = await fetch(\"/api/rb/notifications/settings\", {\n method: \"PUT\",\n headers: { \"Content-Type\": \"application/json\" },\n credentials: \"include\",\n body: JSON.stringify({\n digestFrequency: next.digestFrequency,\n topicPreferences: next.topicPreferences,\n }),\n })\n const json = (await res.json().catch(() => null)) as SettingsResponse | null\n if (!res.ok || !json?.ok) {\n setError(json?.error || \"Unable to save notification settings.\")\n return\n }\n const normalized = normalizeSettings(json.settings)\n setSettings(normalizedTopics.length > 0 ? applyTopicsToSettings(normalized, normalizedTopics) : normalized)\n } catch {\n setError(\"Unable to save notification settings.\")\n } finally {\n setSaving(false)\n }\n }\n\n useEffect(() => {\n void loadSettings()\n }, [])\n\n useEffect(() => {\n if (normalizedTopics.length === 0) return\n setSettings((current) => applyTopicsToSettings(current, normalizedTopics))\n }, [normalizedTopics])\n\n const updatePreference = (topic: string, update: (p: NotificationTopicPreference) => NotificationTopicPreference) => {\n const hasExisting = settings.topicPreferences.some((p) => p.topic === topic)\n const nextPrefs = hasExisting\n ? settings.topicPreferences.map((p) => (p.topic === topic ? update(p) : p))\n : [...settings.topicPreferences, update({ topic, inApp: true, emailDigest: true, push: false })]\n const next = normalizeSettings({ ...settings, topicPreferences: nextPrefs })\n setSettings(next)\n void saveSettings(next)\n }\n\n if (loading) {\n return (\n <div className={cn(\"flex items-center justify-center py-10 text-muted-foreground\", className)}>\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n </div>\n )\n }\n\n return (\n <div className={cn(\"space-y-4\", className)}>\n <div className=\"rounded-md border bg-background p-4\">\n <div className=\"flex items-start justify-between gap-3\">\n <div>\n <div className=\"text-sm font-semibold\">Email digest</div>\n <div className=\"mt-1 text-xs text-muted-foreground\">Choose how often we email you a summary.</div>\n </div>\n <select\n value={settings.digestFrequency}\n onChange={(e) => {\n const value = e.target.value as NotificationDigestFrequency\n const next = normalizeSettings({ ...settings, digestFrequency: value })\n setSettings(next)\n void saveSettings(next)\n }}\n className=\"h-9 rounded-md border bg-background px-2 text-sm\"\n >\n {digestValues.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {opt.label}\n </option>\n ))}\n </select>\n </div>\n </div>\n\n <div className=\"rounded-md border bg-background p-4\">\n <div className=\"flex items-start justify-between gap-3\">\n <div>\n <div className=\"text-sm font-semibold\">Topics</div>\n <div className=\"mt-1 text-xs text-muted-foreground\">Choose where you receive each topic.</div>\n </div>\n </div>\n\n {normalizedTopics.length === 0 ? (\n <div className=\"mt-4 text-sm text-muted-foreground\">No topics configured.</div>\n ) : (\n <div className=\"mt-4 overflow-x-auto\">\n <table className=\"w-full text-sm\">\n <thead>\n <tr className=\"text-left text-xs text-muted-foreground\">\n <th className=\"py-2 pr-4 font-medium\">Topic</th>\n <th className=\"py-2 pr-4 font-medium\">In-app</th>\n <th className=\"py-2 pr-4 font-medium\">Email digest</th>\n <th className=\"py-2 pr-4 font-medium\">Push</th>\n </tr>\n </thead>\n <tbody>\n {settings.topicPreferences.map((pref) => {\n const meta = normalizedTopics.find((topic) => topic.topic === pref.topic)\n return (\n <tr key={pref.topic} className=\"border-t align-top\">\n <td className=\"py-3 pr-4\">\n <div className=\"flex flex-col gap-1\">\n <span className=\"font-medium\">{meta?.title || pref.topic}</span>\n {meta?.description ? (\n <span className=\"text-xs text-muted-foreground\">{meta.description}</span>\n ) : null}\n <span className=\"text-[11px] text-muted-foreground\">{pref.topic}</span>\n </div>\n </td>\n <td className=\"py-3 pr-4\">\n <input\n type=\"checkbox\"\n checked={pref.inApp}\n onChange={(e) =>\n updatePreference(pref.topic, (p) => ({ ...p, inApp: e.target.checked }))\n }\n />\n </td>\n <td className=\"py-3 pr-4\">\n <input\n type=\"checkbox\"\n checked={pref.emailDigest}\n onChange={(e) =>\n updatePreference(pref.topic, (p) => ({ ...p, emailDigest: e.target.checked }))\n }\n />\n </td>\n <td className=\"py-3 pr-4\">\n <input\n type=\"checkbox\"\n checked={pref.push}\n disabled\n className=\"opacity-50\"\n aria-label=\"Push notifications (coming soon)\"\n />\n </td>\n </tr>\n )\n })}\n </tbody>\n </table>\n </div>\n )}\n\n {error ? (\n <div className=\"mt-3 text-sm text-destructive\">{error}</div>\n ) : saving ? (\n <div className=\"mt-3 text-xs text-muted-foreground\">Saving…</div>\n ) : null}\n </div>\n </div>\n )\n}\n"],"names":["digestValues","value","label","normalizeSettings","settings","digestFrequency","frequency","topicPreferences","Array","isArray","map","pref","topic","trim","inApp","emailDigest","push","filter","length","lastDigestSentAt","normalizeTopics","topics","seen","Set","title","description","undefined","has","add","applyTopicsToSettings","defaults","byTopic","Map","existing","get","NotificationsSettings","className","loading","setLoading","useState","saving","setSaving","error","setError","setSettings","normalizedTopics","useMemo","loadSettings","res","fetch","method","credentials","json","catch","ok","normalized","saveSettings","next","headers","body","JSON","stringify","useEffect","current","updatePreference","update","nextPrefs","some","p","jsx","cn","Loader2","jsxs","e","target","opt","meta","find","checked"],"mappings":";;;;AAcA,MAAMA,IAA6E,CACjF;AAAA,EAAEC,OAAO;AAAA,EAAOC,OAAO;AAAM,GAC7B;AAAA,EAAED,OAAO;AAAA,EAASC,OAAO;AAAQ,GACjC;AAAA,EAAED,OAAO;AAAA,EAAUC,OAAO;AAAS,CAAC,GAGhCC,IAAoBA,CAACC,MAAqE;AAC9F,QAAMC,IAAkBD,GAAUC,iBAC5BC,IACJD,MAAoB,SAASA,MAAoB,WAAWA,MAAoB,WAC5EA,IACA,UAEAE,IAAmBC,MAAMC,QAAQL,GAAUG,gBAAgB,IAC7DH,EAAUG,iBACTG,IAAKC,CAAAA,OAAU;AAAA,IACdC,OAAO,OAAOD,EAAKC,SAAU,WAAWD,EAAKC,MAAMC,SAAS;AAAA,IAC5DC,OAAOH,EAAKG,UAAU;AAAA,IACtBC,aAAaJ,EAAKI,gBAAgB;AAAA,IAClCC,MAAML,EAAKK,SAAS;AAAA,EAAA,EACpB,EACDC,OAAQN,CAAAA,MAASA,EAAKC,MAAMM,SAAS,CAAC,IACvC,CAAA;AAEJ,S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AAAA,EAAAA,IAAC,OAAA,EAAI,WAAU,sCAAqC,qBAAO,IACzD;AAAA,IAAA,EAAA,CACN;AAAA,EAAA,GACF;AAEJ;"}
|
package/dist/index250.js
CHANGED
|
@@ -1,41 +1,158 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if (e) {
|
|
17
|
-
if (typeof e == "string") return o(e, t);
|
|
18
|
-
var r = {}.toString.call(e).slice(8, -1);
|
|
19
|
-
return r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set" ? Array.from(e) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? o(e, t) : void 0;
|
|
1
|
+
function s(t) {
|
|
2
|
+
"@babel/helpers - typeof";
|
|
3
|
+
return s = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
4
|
+
return typeof e;
|
|
5
|
+
} : function(e) {
|
|
6
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
7
|
+
}, s(t);
|
|
8
|
+
}
|
|
9
|
+
function f(t, e) {
|
|
10
|
+
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
11
|
+
}
|
|
12
|
+
function l(t, e) {
|
|
13
|
+
for (var r = 0; r < e.length; r++) {
|
|
14
|
+
var n = e[r];
|
|
15
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(t, g(n.key), n);
|
|
20
16
|
}
|
|
21
17
|
}
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
function p(t, e, r) {
|
|
19
|
+
return e && l(t.prototype, e), Object.defineProperty(t, "prototype", { writable: !1 }), t;
|
|
20
|
+
}
|
|
21
|
+
function g(t) {
|
|
22
|
+
var e = x(t, "string");
|
|
23
|
+
return s(e) == "symbol" ? e : e + "";
|
|
26
24
|
}
|
|
27
|
-
function
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
function x(t, e) {
|
|
26
|
+
if (s(t) != "object" || !t) return t;
|
|
27
|
+
var r = t[Symbol.toPrimitive];
|
|
28
|
+
if (r !== void 0) {
|
|
29
|
+
var n = r.call(t, e);
|
|
30
|
+
if (s(n) != "object") return n;
|
|
31
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
32
|
+
}
|
|
33
|
+
return String(t);
|
|
34
|
+
}
|
|
35
|
+
var y = /* @__PURE__ */ (function() {
|
|
36
|
+
function t() {
|
|
37
|
+
f(this, t);
|
|
38
|
+
}
|
|
39
|
+
return p(t, [{
|
|
40
|
+
key: "parse",
|
|
41
|
+
value: function(r) {
|
|
42
|
+
if (this.context = [{
|
|
43
|
+
or: !0,
|
|
44
|
+
instructions: []
|
|
45
|
+
}], this.parsePattern(r), this.context.length !== 1)
|
|
46
|
+
throw new Error("Non-finalized contexts left when pattern parse ended");
|
|
47
|
+
var n = this.context[0], i = n.branches, o = n.instructions;
|
|
48
|
+
if (i)
|
|
49
|
+
return {
|
|
50
|
+
op: "|",
|
|
51
|
+
args: i.concat([a(o)])
|
|
52
|
+
};
|
|
53
|
+
if (o.length === 0)
|
|
54
|
+
throw new Error("Pattern is required");
|
|
55
|
+
return o.length === 1 ? o[0] : o;
|
|
56
|
+
}
|
|
57
|
+
}, {
|
|
58
|
+
key: "startContext",
|
|
59
|
+
value: function(r) {
|
|
60
|
+
this.context.push(r);
|
|
61
|
+
}
|
|
62
|
+
}, {
|
|
63
|
+
key: "endContext",
|
|
64
|
+
value: function() {
|
|
65
|
+
this.context.pop();
|
|
66
|
+
}
|
|
67
|
+
}, {
|
|
68
|
+
key: "getContext",
|
|
69
|
+
value: function() {
|
|
70
|
+
return this.context[this.context.length - 1];
|
|
71
|
+
}
|
|
72
|
+
}, {
|
|
73
|
+
key: "parsePattern",
|
|
74
|
+
value: function(r) {
|
|
75
|
+
if (!r)
|
|
76
|
+
throw new Error("Pattern is required");
|
|
77
|
+
var n = r.match(w);
|
|
78
|
+
if (!n) {
|
|
79
|
+
if (C.test(r))
|
|
80
|
+
throw new Error("Illegal characters found in a pattern: ".concat(r));
|
|
81
|
+
this.getContext().instructions = this.getContext().instructions.concat(r.split(""));
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
var i = n[1], o = r.slice(0, n.index), c = r.slice(n.index + i.length);
|
|
85
|
+
switch (i) {
|
|
86
|
+
case "(?:":
|
|
87
|
+
o && this.parsePattern(o), this.startContext({
|
|
88
|
+
or: !0,
|
|
89
|
+
instructions: [],
|
|
90
|
+
branches: []
|
|
91
|
+
});
|
|
92
|
+
break;
|
|
93
|
+
case ")":
|
|
94
|
+
if (!this.getContext().or)
|
|
95
|
+
throw new Error('")" operator must be preceded by "(?:" operator');
|
|
96
|
+
if (o && this.parsePattern(o), this.getContext().instructions.length === 0)
|
|
97
|
+
throw new Error('No instructions found after "|" operator in an "or" group');
|
|
98
|
+
var h = this.getContext(), u = h.branches;
|
|
99
|
+
u.push(a(this.getContext().instructions)), this.endContext(), this.getContext().instructions.push({
|
|
100
|
+
op: "|",
|
|
101
|
+
args: u
|
|
102
|
+
});
|
|
103
|
+
break;
|
|
104
|
+
case "|":
|
|
105
|
+
if (!this.getContext().or)
|
|
106
|
+
throw new Error('"|" operator can only be used inside "or" groups');
|
|
107
|
+
if (o && this.parsePattern(o), !this.getContext().branches)
|
|
108
|
+
if (this.context.length === 1)
|
|
109
|
+
this.getContext().branches = [];
|
|
110
|
+
else
|
|
111
|
+
throw new Error('"branches" not found in an "or" group context');
|
|
112
|
+
this.getContext().branches.push(a(this.getContext().instructions)), this.getContext().instructions = [];
|
|
113
|
+
break;
|
|
114
|
+
case "[":
|
|
115
|
+
o && this.parsePattern(o), this.startContext({
|
|
116
|
+
oneOfSet: !0
|
|
117
|
+
});
|
|
118
|
+
break;
|
|
119
|
+
case "]":
|
|
120
|
+
if (!this.getContext().oneOfSet)
|
|
121
|
+
throw new Error('"]" operator must be preceded by "[" operator');
|
|
122
|
+
this.endContext(), this.getContext().instructions.push({
|
|
123
|
+
op: "[]",
|
|
124
|
+
args: b(o)
|
|
125
|
+
});
|
|
126
|
+
break;
|
|
127
|
+
/* istanbul ignore next */
|
|
128
|
+
default:
|
|
129
|
+
throw new Error("Unknown operator: ".concat(i));
|
|
130
|
+
}
|
|
131
|
+
c && this.parsePattern(c);
|
|
132
|
+
}
|
|
133
|
+
}]);
|
|
134
|
+
})();
|
|
135
|
+
function b(t) {
|
|
136
|
+
for (var e = [], r = 0; r < t.length; ) {
|
|
137
|
+
if (t[r] === "-") {
|
|
138
|
+
if (r === 0 || r === t.length - 1)
|
|
139
|
+
throw new Error("Couldn't parse a one-of set pattern: ".concat(t));
|
|
140
|
+
for (var n = t[r - 1].charCodeAt(0) + 1, i = t[r + 1].charCodeAt(0) - 1, o = n; o <= i; )
|
|
141
|
+
e.push(String.fromCharCode(o)), o++;
|
|
142
|
+
} else
|
|
143
|
+
e.push(t[r]);
|
|
144
|
+
r++;
|
|
31
145
|
}
|
|
32
|
-
return
|
|
146
|
+
return e;
|
|
33
147
|
}
|
|
34
|
-
|
|
35
|
-
|
|
148
|
+
var C = /[\(\)\[\]\?\:\|]/, w = new RegExp(
|
|
149
|
+
// any of:
|
|
150
|
+
"(\\||\\(\\?\\:|\\)|\\[|\\])"
|
|
151
|
+
);
|
|
152
|
+
function a(t) {
|
|
153
|
+
return t.length === 1 ? t[0] : t;
|
|
36
154
|
}
|
|
37
155
|
export {
|
|
38
|
-
|
|
39
|
-
f as parsePhoneNumberCharacter
|
|
156
|
+
y as default
|
|
40
157
|
};
|
|
41
158
|
//# sourceMappingURL=index250.js.map
|
package/dist/index250.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index250.js","sources":["../../../node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.js"],"sourcesContent":["function _createForOfIteratorHelperLoose(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (t) return (t = t.call(r)).next.bind(t); if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nimport { parseDigit } from './helpers/parseDigits.js';\n\n/**\r\n * Parses phone number characters from a string.\r\n * Drops all punctuation leaving only digits and the leading `+` sign (if any).\r\n * Also converts wide-ascii and arabic-indic numerals to conventional numerals.\r\n * E.g. in Iraq they don't write `+442323234` but rather `+٤٤٢٣٢٣٢٣٤`.\r\n * @param {string} string\r\n * @return {string}\r\n * @example\r\n * ```js\r\n * // Outputs '8800555'.\r\n * parseIncompletePhoneNumber('8 (800) 555')\r\n * // Outputs '+7800555'.\r\n * parseIncompletePhoneNumber('+7 800 555')\r\n * ```\r\n */\nexport default function parseIncompletePhoneNumber(string) {\n var result = '';\n // Using `.split('')` here instead of normal `for ... of`\n // because the importing application doesn't neccessarily include an ES6 polyfill.\n // The `.split('')` approach discards \"exotic\" UTF-8 characters\n // (the ones consisting of four bytes) but digits\n // (including non-European ones) don't fall into that range\n // so such \"exotic\" characters would be discarded anyway.\n for (var _iterator = _createForOfIteratorHelperLoose(string.split('')), _step; !(_step = _iterator()).done;) {\n var character = _step.value;\n result += parsePhoneNumberCharacter(character, result) || '';\n }\n return result;\n}\n\n/**\r\n * Parses next character while parsing phone number digits (including a `+`)\r\n * from text: discards everything except `+` and digits, and `+` is only allowed\r\n * at the start of a phone number.\r\n * For example, is used in `react-phone-number-input` where it uses\r\n * [`input-format`](https://gitlab.com/catamphetamine/input-format).\r\n * @param {string} character - Yet another character from raw input string.\r\n * @param {string?} prevParsedCharacters - Previous parsed characters.\r\n * @param {function?} eventListener - An optional \"on event\" function.\r\n * @return {string?} The parsed character.\r\n */\nexport function parsePhoneNumberCharacter(character, prevParsedCharacters, eventListener) {\n // Only allow a leading `+`.\n if (character === '+') {\n // If this `+` is not the first parsed character\n // then discard it.\n if (prevParsedCharacters) {\n // `eventListener` argument was added to this `export`ed function on Dec 26th, 2023.\n // Any 3rd-party code that used to `import` and call this function before that\n // won't be passing any `eventListener` argument.\n //\n // The addition of the `eventListener` argument was to fix the slightly-weird behavior\n // of parsing an input string when the user inputs something like `\"2+7\"\n // https://github.com/catamphetamine/react-phone-number-input/issues/437\n //\n // If the parser encounters an unexpected `+` in a string being parsed\n // then it simply discards that out-of-place `+` and any following characters.\n //\n if (typeof eventListener === 'function') {\n eventListener('end');\n }\n return;\n }\n return '+';\n }\n // Allow digits.\n return parseDigit(character);\n}\n//# sourceMappingURL=parseIncompletePhoneNumber.js.map"],"names":["_createForOfIteratorHelperLoose","r","e","t","_unsupportedIterableToArray","o","a","_arrayLikeToArray","parseIncompletePhoneNumber","string","result","_iterator","_step","character","parsePhoneNumberCharacter","prevParsedCharacters","eventListener","parseDigit"],"mappings":";AAAA,SAASA,EAAgCC,GAAGC,GAAG;AAAE,MAAIC,IAAmB,OAAO,SAAtB,OAAgCF,EAAE,OAAO,QAAQ,KAAKA,EAAE,YAAY;AAAG,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5D;AACA,SAAOA;AACT;AAaO,SAASI,EAA0BD,GAAWE,GAAsBC,GAAe;AAExF,SAAIH,MAAc,MAGZE,IAeF,SAEK,MAGFE,EAAWJ,CAAS;AAC7B;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index250.js","sources":["../../../node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternParser.js"],"sourcesContent":["function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar PatternParser = /*#__PURE__*/function () {\n function PatternParser() {\n _classCallCheck(this, PatternParser);\n }\n return _createClass(PatternParser, [{\n key: \"parse\",\n value: function parse(pattern) {\n this.context = [{\n or: true,\n instructions: []\n }];\n this.parsePattern(pattern);\n if (this.context.length !== 1) {\n throw new Error('Non-finalized contexts left when pattern parse ended');\n }\n var _this$context$ = this.context[0],\n branches = _this$context$.branches,\n instructions = _this$context$.instructions;\n if (branches) {\n return {\n op: '|',\n args: branches.concat([expandSingleElementArray(instructions)])\n };\n }\n\n /* istanbul ignore if */\n if (instructions.length === 0) {\n throw new Error('Pattern is required');\n }\n if (instructions.length === 1) {\n return instructions[0];\n }\n return instructions;\n }\n }, {\n key: \"startContext\",\n value: function startContext(context) {\n this.context.push(context);\n }\n }, {\n key: \"endContext\",\n value: function endContext() {\n this.context.pop();\n }\n }, {\n key: \"getContext\",\n value: function getContext() {\n return this.context[this.context.length - 1];\n }\n }, {\n key: \"parsePattern\",\n value: function parsePattern(pattern) {\n if (!pattern) {\n throw new Error('Pattern is required');\n }\n var match = pattern.match(OPERATOR);\n if (!match) {\n if (ILLEGAL_CHARACTER_REGEXP.test(pattern)) {\n throw new Error(\"Illegal characters found in a pattern: \".concat(pattern));\n }\n this.getContext().instructions = this.getContext().instructions.concat(pattern.split(''));\n return;\n }\n var operator = match[1];\n var before = pattern.slice(0, match.index);\n var rightPart = pattern.slice(match.index + operator.length);\n switch (operator) {\n case '(?:':\n if (before) {\n this.parsePattern(before);\n }\n this.startContext({\n or: true,\n instructions: [],\n branches: []\n });\n break;\n case ')':\n if (!this.getContext().or) {\n throw new Error('\")\" operator must be preceded by \"(?:\" operator');\n }\n if (before) {\n this.parsePattern(before);\n }\n if (this.getContext().instructions.length === 0) {\n throw new Error('No instructions found after \"|\" operator in an \"or\" group');\n }\n var _this$getContext = this.getContext(),\n branches = _this$getContext.branches;\n branches.push(expandSingleElementArray(this.getContext().instructions));\n this.endContext();\n this.getContext().instructions.push({\n op: '|',\n args: branches\n });\n break;\n case '|':\n if (!this.getContext().or) {\n throw new Error('\"|\" operator can only be used inside \"or\" groups');\n }\n if (before) {\n this.parsePattern(before);\n }\n // The top-level is an implicit \"or\" group, if required.\n if (!this.getContext().branches) {\n // `branches` are not defined only for the root implicit \"or\" operator.\n /* istanbul ignore else */\n if (this.context.length === 1) {\n this.getContext().branches = [];\n } else {\n throw new Error('\"branches\" not found in an \"or\" group context');\n }\n }\n this.getContext().branches.push(expandSingleElementArray(this.getContext().instructions));\n this.getContext().instructions = [];\n break;\n case '[':\n if (before) {\n this.parsePattern(before);\n }\n this.startContext({\n oneOfSet: true\n });\n break;\n case ']':\n if (!this.getContext().oneOfSet) {\n throw new Error('\"]\" operator must be preceded by \"[\" operator');\n }\n this.endContext();\n this.getContext().instructions.push({\n op: '[]',\n args: parseOneOfSet(before)\n });\n break;\n\n /* istanbul ignore next */\n default:\n throw new Error(\"Unknown operator: \".concat(operator));\n }\n if (rightPart) {\n this.parsePattern(rightPart);\n }\n }\n }]);\n}();\nexport { PatternParser as default };\nfunction parseOneOfSet(pattern) {\n var values = [];\n var i = 0;\n while (i < pattern.length) {\n if (pattern[i] === '-') {\n if (i === 0 || i === pattern.length - 1) {\n throw new Error(\"Couldn't parse a one-of set pattern: \".concat(pattern));\n }\n var prevValue = pattern[i - 1].charCodeAt(0) + 1;\n var nextValue = pattern[i + 1].charCodeAt(0) - 1;\n var value = prevValue;\n while (value <= nextValue) {\n values.push(String.fromCharCode(value));\n value++;\n }\n } else {\n values.push(pattern[i]);\n }\n i++;\n }\n return values;\n}\nvar ILLEGAL_CHARACTER_REGEXP = /[\\(\\)\\[\\]\\?\\:\\|]/;\nvar OPERATOR = new RegExp(\n// any of:\n'(' +\n// or operator\n'\\\\|' +\n// or\n'|' +\n// or group start\n'\\\\(\\\\?\\\\:' +\n// or\n'|' +\n// or group end\n'\\\\)' +\n// or\n'|' +\n// one-of set start\n'\\\\[' +\n// or\n'|' +\n// one-of set end\n'\\\\]' + ')');\nfunction expandSingleElementArray(array) {\n if (array.length === 1) {\n return array[0];\n }\n return array;\n}\n//# sourceMappingURL=AsYouTypeFormatter.PatternParser.js.map"],"names":["_typeof","o","_classCallCheck","a","n","_defineProperties","e","r","t","_toPropertyKey","_createClass","i","_toPrimitive","PatternParser","pattern","_this$context$","branches","instructions","expandSingleElementArray","context","match","OPERATOR","ILLEGAL_CHARACTER_REGEXP","operator","before","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,SAASH,EAAyBc,GAAO;AACvC,SAAIA,EAAM,WAAW,IACZA,EAAM,CAAC,IAETA;AACT;","x_google_ignoreList":[0]}
|
package/dist/index251.js
CHANGED
|
@@ -1,12 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import o from "./index176.js";
|
|
2
|
+
import l from "./index249.js";
|
|
3
|
+
function u(e, n, r) {
|
|
4
|
+
if (n === void 0 && (n = {}), r = new o(r), n.v2) {
|
|
5
|
+
if (!e.countryCallingCode)
|
|
6
|
+
throw new Error("Invalid phone number object passed");
|
|
7
|
+
r.selectNumberingPlan(e.countryCallingCode);
|
|
8
|
+
} else {
|
|
9
|
+
if (!e.phone)
|
|
10
|
+
return !1;
|
|
11
|
+
if (e.country) {
|
|
12
|
+
if (!r.hasCountry(e.country))
|
|
13
|
+
throw new Error("Unknown country: ".concat(e.country));
|
|
14
|
+
r.selectNumberingPlan(e.country);
|
|
15
|
+
} else {
|
|
16
|
+
if (!e.countryCallingCode)
|
|
17
|
+
throw new Error("Invalid phone number object passed");
|
|
18
|
+
r.selectNumberingPlan(e.countryCallingCode);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
if (r.possibleLengths())
|
|
22
|
+
return s(e.phone || e.nationalNumber, e.country, r);
|
|
23
|
+
if (e.countryCallingCode && r.isNonGeographicCallingCode(e.countryCallingCode))
|
|
24
|
+
return !0;
|
|
25
|
+
throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.');
|
|
26
|
+
}
|
|
27
|
+
function s(e, n, r) {
|
|
28
|
+
return l(e, n, r) === "IS_POSSIBLE";
|
|
8
29
|
}
|
|
9
30
|
export {
|
|
10
|
-
|
|
31
|
+
u as default,
|
|
32
|
+
s as isPossibleNumber
|
|
11
33
|
};
|
|
12
34
|
//# sourceMappingURL=index251.js.map
|
package/dist/index251.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index251.js","sources":["../../../node_modules/libphonenumber-js/es6/
|
|
1
|
+
{"version":3,"file":"index251.js","sources":["../../../node_modules/libphonenumber-js/es6/isPossible.js"],"sourcesContent":["import Metadata from './metadata.js';\nimport checkNumberLength from './helpers/checkNumberLength.js';\n\n/**\r\n * Checks if a phone number is \"possible\" (basically just checks its length).\r\n *\r\n * isPossible(phoneNumberInstance, { ..., v2: true }, metadata)\r\n *\r\n * isPossible({ phone: '8005553535', country: 'RU' }, { ... }, metadata)\r\n * isPossible({ phone: '8005553535', country: 'RU' }, undefined, metadata)\r\n *\r\n * @param {object|PhoneNumber} input — If `options.v2: true` flag is passed, the `input` should be a `PhoneNumber` instance. Otherwise, it should be an object of shape `{ phone: '...', country: '...' }`.\r\n * @param {object} [options]\r\n * @param {object} metadata\r\n * @return {string}\r\n */\nexport default function isPossiblePhoneNumber(input, options, metadata) {\n /* istanbul ignore if */\n if (options === undefined) {\n options = {};\n }\n metadata = new Metadata(metadata);\n if (options.v2) {\n if (!input.countryCallingCode) {\n throw new Error('Invalid phone number object passed');\n }\n metadata.selectNumberingPlan(input.countryCallingCode);\n } else {\n if (!input.phone) {\n return false;\n }\n if (input.country) {\n if (!metadata.hasCountry(input.country)) {\n throw new Error(\"Unknown country: \".concat(input.country));\n }\n metadata.selectNumberingPlan(input.country);\n } else {\n if (!input.countryCallingCode) {\n throw new Error('Invalid phone number object passed');\n }\n metadata.selectNumberingPlan(input.countryCallingCode);\n }\n }\n\n // Old metadata (< 1.0.18) had no \"possible length\" data.\n if (metadata.possibleLengths()) {\n return isPossibleNumber(input.phone || input.nationalNumber, input.country, metadata);\n } else {\n // There was a bug between `1.7.35` and `1.7.37` where \"possible_lengths\"\n // were missing for \"non-geographical\" numbering plans.\n // Just assume the number is possible in such cases:\n // it's unlikely that anyone generated their custom metadata\n // in that short period of time (one day).\n // This code can be removed in some future major version update.\n if (input.countryCallingCode && metadata.isNonGeographicCallingCode(input.countryCallingCode)) {\n // \"Non-geographic entities\" did't have `possibleLengths`\n // due to a bug in metadata generation process.\n return true;\n } else {\n throw new Error('Missing \"possibleLengths\" in metadata. Perhaps the metadata has been generated before v1.0.18.');\n }\n }\n}\nexport function isPossibleNumber(nationalNumber, country, metadata) {\n //, isInternational) {\n switch (checkNumberLength(nationalNumber, country, metadata)) {\n case 'IS_POSSIBLE':\n return true;\n // This library ignores \"local-only\" phone numbers (for simplicity).\n // See the readme for more info on what are \"local-only\" phone numbers.\n // case 'IS_POSSIBLE_LOCAL_ONLY':\n // \treturn !isInternational\n default:\n return false;\n }\n}\n//# sourceMappingURL=isPossible.js.map"],"names":["isPossiblePhoneNumber","input","options","metadata","Metadata","isPossibleNumber","nationalNumber","country","checkNumberLength"],"mappings":";;AAgBe,SAASA,EAAsBC,GAAOC,GAASC,GAAU;AAMtE,MAJID,MAAY,WACdA,IAAU,CAAA,IAEZC,IAAW,IAAIC,EAASD,CAAQ,GAC5BD,EAAQ,IAAI;AACd,QAAI,CAACD,EAAM;AACT,YAAM,IAAI,MAAM,oCAAoC;AAEtD,IAAAE,EAAS,oBAAoBF,EAAM,kBAAkB;AAAA,EACvD,OAAO;AACL,QAAI,CAACA,EAAM;AACT,aAAO;AAET,QAAIA,EAAM,SAAS;AACjB,UAAI,CAACE,EAAS,WAAWF,EAAM,OAAO;AACpC,cAAM,IAAI,MAAM,oBAAoB,OAAOA,EAAM,OAAO,CAAC;AAE3D,MAAAE,EAAS,oBAAoBF,EAAM,OAAO;AAAA,IAC5C,OAAO;AACL,UAAI,CAACA,EAAM;AACT,cAAM,IAAI,MAAM,oCAAoC;AAEtD,MAAAE,EAAS,oBAAoBF,EAAM,kBAAkB;AAAA,IACvD;AAAA,EACF;AAGA,MAAIE,EAAS;AACX,WAAOE,EAAiBJ,EAAM,SAASA,EAAM,gBAAgBA,EAAM,SAASE,CAAQ;AAQpF,MAAIF,EAAM,sBAAsBE,EAAS,2BAA2BF,EAAM,kBAAkB;AAG1F,WAAO;AAEP,QAAM,IAAI,MAAM,gGAAgG;AAGtH;AACO,SAASI,EAAiBC,GAAgBC,GAASJ,GAAU;AAElE,SAAQK,EAAkBF,GAAgBC,GAASJ,CAAQ,MACpD;AAST;","x_google_ignoreList":[0]}
|