@xiping/react-components 1.0.20 → 1.0.22

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.
Files changed (108) hide show
  1. package/dist/cjs/components/confetti-button/index.d.ts +24 -0
  2. package/dist/cjs/components/confetti-button/index.js +1 -0
  3. package/dist/cjs/components/txt-editor/TxtEditor.js +1 -1
  4. package/dist/cjs/hooks/useStayTimeReport.d.ts +6 -0
  5. package/dist/cjs/hooks/useStayTimeReport.js +1 -0
  6. package/dist/cjs/index.d.ts +2 -0
  7. package/dist/cjs/index.js +1 -1
  8. package/dist/cjs/node_modules/.pnpm/3d-force-graph@1.78.2/node_modules/3d-force-graph/dist/3d-force-graph.js +28 -0
  9. package/dist/cjs/node_modules/.pnpm/@tweenjs_tween.js@25.0.0/node_modules/@tweenjs/tween.js/dist/tween.esm.js +1 -0
  10. package/dist/cjs/node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/src/bowser.js +6 -0
  11. package/dist/cjs/node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/src/constants.js +1 -0
  12. package/dist/cjs/node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/src/parser-browsers.js +1 -0
  13. package/dist/cjs/node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/src/parser-engines.js +1 -0
  14. package/dist/cjs/node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/src/parser-os.js +1 -0
  15. package/dist/cjs/node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/src/parser-platforms.js +1 -0
  16. package/dist/cjs/node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/src/parser.js +1 -0
  17. package/dist/cjs/node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/src/utils.js +1 -0
  18. package/dist/cjs/node_modules/.pnpm/canvas-confetti@1.9.3/node_modules/canvas-confetti/dist/confetti.module.js +2 -0
  19. package/dist/cjs/node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/max.js +1 -0
  20. package/dist/cjs/node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/min.js +1 -0
  21. package/dist/cjs/node_modules/.pnpm/react-force-graph-3d@1.28.0_react@19.1.0/node_modules/react-force-graph-3d/dist/react-force-graph-3d.js +1 -0
  22. package/dist/cjs/node_modules/.pnpm/three-forcegraph@1.43.0_three@0.178.0/node_modules/three-forcegraph/dist/three-forcegraph.js +3 -0
  23. package/dist/cjs/node_modules/.pnpm/three-render-objects@1.40.4_three@0.178.0/node_modules/three-render-objects/dist/three-render-objects.js +18 -0
  24. package/dist/cjs/node_modules/.pnpm/three@0.178.0/node_modules/three/build/three.core.js +44 -0
  25. package/dist/cjs/node_modules/.pnpm/three@0.178.0/node_modules/three/build/three.module.js +3784 -0
  26. package/dist/cjs/node_modules/.pnpm/three@0.178.0/node_modules/three/build/three.webgpu.js +392 -0
  27. package/dist/cjs/node_modules/.pnpm/three@0.178.0/node_modules/three/examples/jsm/controls/DragControls.js +1 -0
  28. package/dist/cjs/node_modules/.pnpm/three@0.178.0/node_modules/three/examples/jsm/controls/FlyControls.js +1 -0
  29. package/dist/cjs/node_modules/.pnpm/three@0.178.0/node_modules/three/examples/jsm/controls/OrbitControls.js +1 -0
  30. package/dist/cjs/node_modules/.pnpm/three@0.178.0/node_modules/three/examples/jsm/controls/TrackballControls.js +1 -0
  31. package/dist/cjs/node_modules/.pnpm/three@0.178.0/node_modules/three/examples/jsm/postprocessing/ShaderPass.js +1 -0
  32. package/dist/cjs/react-components.css +1 -1
  33. package/dist/es/components/confetti-button/index.d.ts +24 -0
  34. package/dist/es/components/confetti-button/index.js +77 -0
  35. package/dist/es/components/txt-editor/TxtEditor.js +1 -1
  36. package/dist/es/hooks/useStayTimeReport.d.ts +6 -0
  37. package/dist/es/hooks/useStayTimeReport.js +31 -0
  38. package/dist/es/index.d.ts +2 -0
  39. package/dist/es/index.js +31 -26
  40. package/dist/es/node_modules/.pnpm/{3d-force-graph@1.77.0 → 3d-force-graph@1.78.2}/node_modules/3d-force-graph/dist/3d-force-graph.js +10 -10
  41. package/dist/es/node_modules/.pnpm/@tweenjs_tween.js@25.0.0/node_modules/@tweenjs/tween.js/dist/tween.esm.js +396 -0
  42. package/dist/es/node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/src/bowser.js +55 -0
  43. package/dist/es/node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/src/constants.js +113 -0
  44. package/dist/es/node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/src/parser-browsers.js +404 -0
  45. package/dist/es/node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/src/parser-engines.js +78 -0
  46. package/dist/es/node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/src/parser-os.js +159 -0
  47. package/dist/es/node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/src/parser-platforms.js +238 -0
  48. package/dist/es/node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/src/parser.js +303 -0
  49. package/dist/es/node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/src/utils.js +280 -0
  50. package/dist/es/node_modules/.pnpm/canvas-confetti@1.9.3/node_modules/canvas-confetti/dist/confetti.module.js +409 -0
  51. package/dist/es/node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/max.js +15 -0
  52. package/dist/es/node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/min.js +15 -0
  53. package/dist/es/node_modules/.pnpm/{react-force-graph-3d@1.27.0_react@18.3.1 → react-force-graph-3d@1.28.0_react@19.1.0}/node_modules/react-force-graph-3d/dist/react-force-graph-3d.js +5 -2
  54. package/dist/es/node_modules/.pnpm/three-forcegraph@1.43.0_three@0.178.0/node_modules/three-forcegraph/dist/three-forcegraph.js +1037 -0
  55. package/dist/es/node_modules/.pnpm/{three-render-objects@1.40.2_three@0.171.0 → three-render-objects@1.40.4_three@0.178.0}/node_modules/three-render-objects/dist/three-render-objects.js +30 -30
  56. package/dist/es/node_modules/.pnpm/three@0.178.0/node_modules/three/build/three.core.js +13236 -0
  57. package/dist/es/node_modules/.pnpm/{three@0.171.0 → three@0.178.0}/node_modules/three/build/three.module.js +3379 -3325
  58. package/dist/es/node_modules/.pnpm/three@0.178.0/node_modules/three/build/three.webgpu.js +24475 -0
  59. package/dist/es/node_modules/.pnpm/{three@0.171.0 → three@0.178.0}/node_modules/three/examples/jsm/controls/DragControls.js +15 -8
  60. package/dist/es/node_modules/.pnpm/{three@0.171.0 → three@0.178.0}/node_modules/three/examples/jsm/controls/FlyControls.js +26 -20
  61. package/dist/es/node_modules/.pnpm/{three@0.171.0 → three@0.178.0}/node_modules/three/examples/jsm/controls/OrbitControls.js +47 -10
  62. package/dist/es/node_modules/.pnpm/{three@0.171.0 → three@0.178.0}/node_modules/three/examples/jsm/controls/TrackballControls.js +16 -4
  63. package/dist/es/node_modules/.pnpm/{three@0.171.0 → three@0.178.0}/node_modules/three/examples/jsm/postprocessing/EffectComposer.js +62 -0
  64. package/dist/es/node_modules/.pnpm/{three@0.171.0 → three@0.178.0}/node_modules/three/examples/jsm/postprocessing/MaskPass.js +31 -0
  65. package/dist/es/node_modules/.pnpm/three@0.178.0/node_modules/three/examples/jsm/postprocessing/Pass.js +89 -0
  66. package/dist/es/node_modules/.pnpm/{three@0.171.0 → three@0.178.0}/node_modules/three/examples/jsm/postprocessing/RenderPass.js +21 -0
  67. package/dist/es/node_modules/.pnpm/three@0.178.0/node_modules/three/examples/jsm/postprocessing/ShaderPass.js +46 -0
  68. package/dist/es/react-components.css +1 -1
  69. package/package.json +32 -30
  70. package/dist/cjs/node_modules/.pnpm/3d-force-graph@1.77.0/node_modules/3d-force-graph/dist/3d-force-graph.js +0 -28
  71. package/dist/cjs/node_modules/.pnpm/@tweenjs_tween.js@23.1.3/node_modules/@tweenjs/tween.js/dist/tween.esm.js +0 -1
  72. package/dist/cjs/node_modules/.pnpm/d3-array@1.2.4/node_modules/d3-array/src/ascending.js +0 -1
  73. package/dist/cjs/node_modules/.pnpm/d3-array@1.2.4/node_modules/d3-array/src/bisect.js +0 -1
  74. package/dist/cjs/node_modules/.pnpm/d3-array@1.2.4/node_modules/d3-array/src/bisector.js +0 -1
  75. package/dist/cjs/node_modules/.pnpm/d3-array@1.2.4/node_modules/d3-array/src/max.js +0 -1
  76. package/dist/cjs/node_modules/.pnpm/d3-array@1.2.4/node_modules/d3-array/src/min.js +0 -1
  77. package/dist/cjs/node_modules/.pnpm/react-force-graph-3d@1.27.0_react@18.3.1/node_modules/react-force-graph-3d/dist/react-force-graph-3d.js +0 -1
  78. package/dist/cjs/node_modules/.pnpm/three-forcegraph@1.42.13_three@0.171.0/node_modules/three-forcegraph/dist/three-forcegraph.js +0 -3
  79. package/dist/cjs/node_modules/.pnpm/three-render-objects@1.40.2_three@0.171.0/node_modules/three-render-objects/dist/three-render-objects.js +0 -18
  80. package/dist/cjs/node_modules/.pnpm/three@0.171.0/node_modules/three/build/three.core.js +0 -44
  81. package/dist/cjs/node_modules/.pnpm/three@0.171.0/node_modules/three/build/three.module.js +0 -3789
  82. package/dist/cjs/node_modules/.pnpm/three@0.171.0/node_modules/three/build/three.webgpu.js +0 -373
  83. package/dist/cjs/node_modules/.pnpm/three@0.171.0/node_modules/three/examples/jsm/controls/DragControls.js +0 -1
  84. package/dist/cjs/node_modules/.pnpm/three@0.171.0/node_modules/three/examples/jsm/controls/FlyControls.js +0 -1
  85. package/dist/cjs/node_modules/.pnpm/three@0.171.0/node_modules/three/examples/jsm/controls/OrbitControls.js +0 -1
  86. package/dist/cjs/node_modules/.pnpm/three@0.171.0/node_modules/three/examples/jsm/controls/TrackballControls.js +0 -1
  87. package/dist/cjs/node_modules/.pnpm/three@0.171.0/node_modules/three/examples/jsm/postprocessing/ShaderPass.js +0 -1
  88. package/dist/es/node_modules/.pnpm/@tweenjs_tween.js@23.1.3/node_modules/@tweenjs/tween.js/dist/tween.esm.js +0 -379
  89. package/dist/es/node_modules/.pnpm/d3-array@1.2.4/node_modules/d3-array/src/ascending.js +0 -6
  90. package/dist/es/node_modules/.pnpm/d3-array@1.2.4/node_modules/d3-array/src/bisect.js +0 -3
  91. package/dist/es/node_modules/.pnpm/d3-array@1.2.4/node_modules/d3-array/src/bisector.js +0 -27
  92. package/dist/es/node_modules/.pnpm/d3-array@1.2.4/node_modules/d3-array/src/max.js +0 -17
  93. package/dist/es/node_modules/.pnpm/d3-array@1.2.4/node_modules/d3-array/src/min.js +0 -17
  94. package/dist/es/node_modules/.pnpm/three-forcegraph@1.42.13_three@0.171.0/node_modules/three-forcegraph/dist/three-forcegraph.js +0 -1020
  95. package/dist/es/node_modules/.pnpm/three@0.171.0/node_modules/three/build/three.core.js +0 -6662
  96. package/dist/es/node_modules/.pnpm/three@0.171.0/node_modules/three/build/three.webgpu.js +0 -13421
  97. package/dist/es/node_modules/.pnpm/three@0.171.0/node_modules/three/examples/jsm/postprocessing/Pass.js +0 -42
  98. package/dist/es/node_modules/.pnpm/three@0.171.0/node_modules/three/examples/jsm/postprocessing/ShaderPass.js +0 -23
  99. /package/dist/cjs/node_modules/.pnpm/{@monaco-editor_react@4.7.0_monaco-editor@0.52.2_react-dom@18.3.1_react@18.3.1__react@18.3.1 → @monaco-editor_react@4.7.0_monaco-editor@0.52.2_react-dom@19.1.0_react@19.1.0__react@19.1.0}/node_modules/@monaco-editor/react/dist/index.js +0 -0
  100. /package/dist/cjs/node_modules/.pnpm/{react-kapsule@2.5.7_react@18.3.1 → react-kapsule@2.5.7_react@19.1.0}/node_modules/react-kapsule/dist/react-kapsule.js +0 -0
  101. /package/dist/cjs/node_modules/.pnpm/{three@0.171.0 → three@0.178.0}/node_modules/three/examples/jsm/postprocessing/EffectComposer.js +0 -0
  102. /package/dist/cjs/node_modules/.pnpm/{three@0.171.0 → three@0.178.0}/node_modules/three/examples/jsm/postprocessing/MaskPass.js +0 -0
  103. /package/dist/cjs/node_modules/.pnpm/{three@0.171.0 → three@0.178.0}/node_modules/three/examples/jsm/postprocessing/Pass.js +0 -0
  104. /package/dist/cjs/node_modules/.pnpm/{three@0.171.0 → three@0.178.0}/node_modules/three/examples/jsm/postprocessing/RenderPass.js +0 -0
  105. /package/dist/cjs/node_modules/.pnpm/{three@0.171.0 → three@0.178.0}/node_modules/three/examples/jsm/shaders/CopyShader.js +0 -0
  106. /package/dist/es/node_modules/.pnpm/{@monaco-editor_react@4.7.0_monaco-editor@0.52.2_react-dom@18.3.1_react@18.3.1__react@18.3.1 → @monaco-editor_react@4.7.0_monaco-editor@0.52.2_react-dom@19.1.0_react@19.1.0__react@19.1.0}/node_modules/@monaco-editor/react/dist/index.js +0 -0
  107. /package/dist/es/node_modules/.pnpm/{react-kapsule@2.5.7_react@18.3.1 → react-kapsule@2.5.7_react@19.1.0}/node_modules/react-kapsule/dist/react-kapsule.js +0 -0
  108. /package/dist/es/node_modules/.pnpm/{three@0.171.0 → three@0.178.0}/node_modules/three/examples/jsm/shaders/CopyShader.js +0 -0
@@ -0,0 +1,280 @@
1
+ import { BROWSER_ALIASES_MAP as d, BROWSER_MAP as h } from "./constants.js";
2
+ class c {
3
+ /**
4
+ * Get first matched item for a string
5
+ * @param {RegExp} regexp
6
+ * @param {String} ua
7
+ * @return {Array|{index: number, input: string}|*|boolean|string}
8
+ */
9
+ static getFirstMatch(r, e) {
10
+ const t = e.match(r);
11
+ return t && t.length > 0 && t[1] || "";
12
+ }
13
+ /**
14
+ * Get second matched item for a string
15
+ * @param regexp
16
+ * @param {String} ua
17
+ * @return {Array|{index: number, input: string}|*|boolean|string}
18
+ */
19
+ static getSecondMatch(r, e) {
20
+ const t = e.match(r);
21
+ return t && t.length > 1 && t[2] || "";
22
+ }
23
+ /**
24
+ * Match a regexp and return a constant or undefined
25
+ * @param {RegExp} regexp
26
+ * @param {String} ua
27
+ * @param {*} _const Any const that will be returned if regexp matches the string
28
+ * @return {*}
29
+ */
30
+ static matchAndReturnConst(r, e, t) {
31
+ if (r.test(e))
32
+ return t;
33
+ }
34
+ static getWindowsVersionName(r) {
35
+ switch (r) {
36
+ case "NT":
37
+ return "NT";
38
+ case "XP":
39
+ return "XP";
40
+ case "NT 5.0":
41
+ return "2000";
42
+ case "NT 5.1":
43
+ return "XP";
44
+ case "NT 5.2":
45
+ return "2003";
46
+ case "NT 6.0":
47
+ return "Vista";
48
+ case "NT 6.1":
49
+ return "7";
50
+ case "NT 6.2":
51
+ return "8";
52
+ case "NT 6.3":
53
+ return "8.1";
54
+ case "NT 10.0":
55
+ return "10";
56
+ default:
57
+ return;
58
+ }
59
+ }
60
+ /**
61
+ * Get macOS version name
62
+ * 10.5 - Leopard
63
+ * 10.6 - Snow Leopard
64
+ * 10.7 - Lion
65
+ * 10.8 - Mountain Lion
66
+ * 10.9 - Mavericks
67
+ * 10.10 - Yosemite
68
+ * 10.11 - El Capitan
69
+ * 10.12 - Sierra
70
+ * 10.13 - High Sierra
71
+ * 10.14 - Mojave
72
+ * 10.15 - Catalina
73
+ *
74
+ * @example
75
+ * getMacOSVersionName("10.14") // 'Mojave'
76
+ *
77
+ * @param {string} version
78
+ * @return {string} versionName
79
+ */
80
+ static getMacOSVersionName(r) {
81
+ const e = r.split(".").splice(0, 2).map((t) => parseInt(t, 10) || 0);
82
+ if (e.push(0), e[0] === 10)
83
+ switch (e[1]) {
84
+ case 5:
85
+ return "Leopard";
86
+ case 6:
87
+ return "Snow Leopard";
88
+ case 7:
89
+ return "Lion";
90
+ case 8:
91
+ return "Mountain Lion";
92
+ case 9:
93
+ return "Mavericks";
94
+ case 10:
95
+ return "Yosemite";
96
+ case 11:
97
+ return "El Capitan";
98
+ case 12:
99
+ return "Sierra";
100
+ case 13:
101
+ return "High Sierra";
102
+ case 14:
103
+ return "Mojave";
104
+ case 15:
105
+ return "Catalina";
106
+ default:
107
+ return;
108
+ }
109
+ }
110
+ /**
111
+ * Get Android version name
112
+ * 1.5 - Cupcake
113
+ * 1.6 - Donut
114
+ * 2.0 - Eclair
115
+ * 2.1 - Eclair
116
+ * 2.2 - Froyo
117
+ * 2.x - Gingerbread
118
+ * 3.x - Honeycomb
119
+ * 4.0 - Ice Cream Sandwich
120
+ * 4.1 - Jelly Bean
121
+ * 4.4 - KitKat
122
+ * 5.x - Lollipop
123
+ * 6.x - Marshmallow
124
+ * 7.x - Nougat
125
+ * 8.x - Oreo
126
+ * 9.x - Pie
127
+ *
128
+ * @example
129
+ * getAndroidVersionName("7.0") // 'Nougat'
130
+ *
131
+ * @param {string} version
132
+ * @return {string} versionName
133
+ */
134
+ static getAndroidVersionName(r) {
135
+ const e = r.split(".").splice(0, 2).map((t) => parseInt(t, 10) || 0);
136
+ if (e.push(0), !(e[0] === 1 && e[1] < 5)) {
137
+ if (e[0] === 1 && e[1] < 6) return "Cupcake";
138
+ if (e[0] === 1 && e[1] >= 6) return "Donut";
139
+ if (e[0] === 2 && e[1] < 2) return "Eclair";
140
+ if (e[0] === 2 && e[1] === 2) return "Froyo";
141
+ if (e[0] === 2 && e[1] > 2) return "Gingerbread";
142
+ if (e[0] === 3) return "Honeycomb";
143
+ if (e[0] === 4 && e[1] < 1) return "Ice Cream Sandwich";
144
+ if (e[0] === 4 && e[1] < 4) return "Jelly Bean";
145
+ if (e[0] === 4 && e[1] >= 4) return "KitKat";
146
+ if (e[0] === 5) return "Lollipop";
147
+ if (e[0] === 6) return "Marshmallow";
148
+ if (e[0] === 7) return "Nougat";
149
+ if (e[0] === 8) return "Oreo";
150
+ if (e[0] === 9) return "Pie";
151
+ }
152
+ }
153
+ /**
154
+ * Get version precisions count
155
+ *
156
+ * @example
157
+ * getVersionPrecision("1.10.3") // 3
158
+ *
159
+ * @param {string} version
160
+ * @return {number}
161
+ */
162
+ static getVersionPrecision(r) {
163
+ return r.split(".").length;
164
+ }
165
+ /**
166
+ * Calculate browser version weight
167
+ *
168
+ * @example
169
+ * compareVersions('1.10.2.1', '1.8.2.1.90') // 1
170
+ * compareVersions('1.010.2.1', '1.09.2.1.90'); // 1
171
+ * compareVersions('1.10.2.1', '1.10.2.1'); // 0
172
+ * compareVersions('1.10.2.1', '1.0800.2'); // -1
173
+ * compareVersions('1.10.2.1', '1.10', true); // 0
174
+ *
175
+ * @param {String} versionA versions versions to compare
176
+ * @param {String} versionB versions versions to compare
177
+ * @param {boolean} [isLoose] enable loose comparison
178
+ * @return {Number} comparison result: -1 when versionA is lower,
179
+ * 1 when versionA is bigger, 0 when both equal
180
+ */
181
+ /* eslint consistent-return: 1 */
182
+ static compareVersions(r, e, t = !1) {
183
+ const i = c.getVersionPrecision(r), a = c.getVersionPrecision(e);
184
+ let n = Math.max(i, a), u = 0;
185
+ const s = c.map([r, e], (o) => {
186
+ const l = n - c.getVersionPrecision(o), p = o + new Array(l + 1).join(".0");
187
+ return c.map(p.split("."), (f) => new Array(20 - f.length).join("0") + f).reverse();
188
+ });
189
+ for (t && (u = n - Math.min(i, a)), n -= 1; n >= u; ) {
190
+ if (s[0][n] > s[1][n])
191
+ return 1;
192
+ if (s[0][n] === s[1][n]) {
193
+ if (n === u)
194
+ return 0;
195
+ n -= 1;
196
+ } else if (s[0][n] < s[1][n])
197
+ return -1;
198
+ }
199
+ }
200
+ /**
201
+ * Array::map polyfill
202
+ *
203
+ * @param {Array} arr
204
+ * @param {Function} iterator
205
+ * @return {Array}
206
+ */
207
+ static map(r, e) {
208
+ const t = [];
209
+ let i;
210
+ if (Array.prototype.map)
211
+ return Array.prototype.map.call(r, e);
212
+ for (i = 0; i < r.length; i += 1)
213
+ t.push(e(r[i]));
214
+ return t;
215
+ }
216
+ /**
217
+ * Array::find polyfill
218
+ *
219
+ * @param {Array} arr
220
+ * @param {Function} predicate
221
+ * @return {Array}
222
+ */
223
+ static find(r, e) {
224
+ let t, i;
225
+ if (Array.prototype.find)
226
+ return Array.prototype.find.call(r, e);
227
+ for (t = 0, i = r.length; t < i; t += 1) {
228
+ const a = r[t];
229
+ if (e(a, t))
230
+ return a;
231
+ }
232
+ }
233
+ /**
234
+ * Object::assign polyfill
235
+ *
236
+ * @param {Object} obj
237
+ * @param {Object} ...objs
238
+ * @return {Object}
239
+ */
240
+ static assign(r, ...e) {
241
+ const t = r;
242
+ let i, a;
243
+ if (Object.assign)
244
+ return Object.assign(r, ...e);
245
+ for (i = 0, a = e.length; i < a; i += 1) {
246
+ const n = e[i];
247
+ typeof n == "object" && n !== null && Object.keys(n).forEach((s) => {
248
+ t[s] = n[s];
249
+ });
250
+ }
251
+ return r;
252
+ }
253
+ /**
254
+ * Get short version/alias for a browser name
255
+ *
256
+ * @example
257
+ * getBrowserAlias('Microsoft Edge') // edge
258
+ *
259
+ * @param {string} browserName
260
+ * @return {string}
261
+ */
262
+ static getBrowserAlias(r) {
263
+ return d[r];
264
+ }
265
+ /**
266
+ * Get short version/alias for a browser name
267
+ *
268
+ * @example
269
+ * getBrowserAlias('edge') // Microsoft Edge
270
+ *
271
+ * @param {string} browserAlias
272
+ * @return {string}
273
+ */
274
+ static getBrowserTypeByAlias(r) {
275
+ return h[r] || "";
276
+ }
277
+ }
278
+ export {
279
+ c as default
280
+ };
@@ -0,0 +1,409 @@
1
+ var R = {};
2
+ (function V(M, T, B, I) {
3
+ var k = !!(M.Worker && M.Blob && M.Promise && M.OffscreenCanvas && M.OffscreenCanvasRenderingContext2D && M.HTMLCanvasElement && M.HTMLCanvasElement.prototype.transferControlToOffscreen && M.URL && M.URL.createObjectURL), A = typeof Path2D == "function" && typeof DOMMatrix == "function", Z = function() {
4
+ if (!M.OffscreenCanvas)
5
+ return !1;
6
+ var e = new OffscreenCanvas(1, 1), r = e.getContext("2d");
7
+ r.fillRect(0, 0, 1, 1);
8
+ var a = e.transferToImageBitmap();
9
+ try {
10
+ r.createPattern(a, "no-repeat");
11
+ } catch {
12
+ return !1;
13
+ }
14
+ return !0;
15
+ }();
16
+ function L() {
17
+ }
18
+ function P(e) {
19
+ var r = T.exports.Promise, a = r !== void 0 ? r : M.Promise;
20
+ return typeof a == "function" ? new a(e) : (e(L, L), null);
21
+ }
22
+ var x = /* @__PURE__ */ function(e, r) {
23
+ return {
24
+ transform: function(a) {
25
+ if (e)
26
+ return a;
27
+ if (r.has(a))
28
+ return r.get(a);
29
+ var t = new OffscreenCanvas(a.width, a.height), o = t.getContext("2d");
30
+ return o.drawImage(a, 0, 0), r.set(a, t), t;
31
+ },
32
+ clear: function() {
33
+ r.clear();
34
+ }
35
+ };
36
+ }(Z, /* @__PURE__ */ new Map()), F = function() {
37
+ var e = Math.floor(16.666666666666668), r, a, t = {}, o = 0;
38
+ return typeof requestAnimationFrame == "function" && typeof cancelAnimationFrame == "function" ? (r = function(i) {
39
+ var l = Math.random();
40
+ return t[l] = requestAnimationFrame(function n(s) {
41
+ o === s || o + e - 1 < s ? (o = s, delete t[l], i()) : t[l] = requestAnimationFrame(n);
42
+ }), l;
43
+ }, a = function(i) {
44
+ t[i] && cancelAnimationFrame(t[i]);
45
+ }) : (r = function(i) {
46
+ return setTimeout(i, e);
47
+ }, a = function(i) {
48
+ return clearTimeout(i);
49
+ }), { frame: r, cancel: a };
50
+ }(), _ = /* @__PURE__ */ function() {
51
+ var e, r, a = {};
52
+ function t(o) {
53
+ function i(l, n) {
54
+ o.postMessage({ options: l || {}, callback: n });
55
+ }
56
+ o.init = function(n) {
57
+ var s = n.transferControlToOffscreen();
58
+ o.postMessage({ canvas: s }, [s]);
59
+ }, o.fire = function(n, s, h) {
60
+ if (r)
61
+ return i(n, null), r;
62
+ var d = Math.random().toString(36).slice(2);
63
+ return r = P(function(u) {
64
+ function f(m) {
65
+ m.data.callback === d && (delete a[d], o.removeEventListener("message", f), r = null, x.clear(), h(), u());
66
+ }
67
+ o.addEventListener("message", f), i(n, d), a[d] = f.bind(null, { data: { callback: d } });
68
+ }), r;
69
+ }, o.reset = function() {
70
+ o.postMessage({ reset: !0 });
71
+ for (var n in a)
72
+ a[n](), delete a[n];
73
+ };
74
+ }
75
+ return function() {
76
+ if (e)
77
+ return e;
78
+ if (!B && k) {
79
+ var o = [
80
+ "var CONFETTI, SIZE = {}, module = {};",
81
+ "(" + V.toString() + ")(this, module, true, SIZE);",
82
+ "onmessage = function(msg) {",
83
+ " if (msg.data.options) {",
84
+ " CONFETTI(msg.data.options).then(function () {",
85
+ " if (msg.data.callback) {",
86
+ " postMessage({ callback: msg.data.callback });",
87
+ " }",
88
+ " });",
89
+ " } else if (msg.data.reset) {",
90
+ " CONFETTI && CONFETTI.reset();",
91
+ " } else if (msg.data.resize) {",
92
+ " SIZE.width = msg.data.resize.width;",
93
+ " SIZE.height = msg.data.resize.height;",
94
+ " } else if (msg.data.canvas) {",
95
+ " SIZE.width = msg.data.canvas.width;",
96
+ " SIZE.height = msg.data.canvas.height;",
97
+ " CONFETTI = module.exports.create(msg.data.canvas);",
98
+ " }",
99
+ "}"
100
+ ].join(`
101
+ `);
102
+ try {
103
+ e = new Worker(URL.createObjectURL(new Blob([o])));
104
+ } catch (i) {
105
+ return typeof console !== void 0 && typeof console.warn == "function" && console.warn("🎊 Could not load worker", i), null;
106
+ }
107
+ t(e);
108
+ }
109
+ return e;
110
+ };
111
+ }(), q = {
112
+ particleCount: 50,
113
+ angle: 90,
114
+ spread: 45,
115
+ startVelocity: 45,
116
+ decay: 0.9,
117
+ gravity: 1,
118
+ drift: 0,
119
+ ticks: 200,
120
+ x: 0.5,
121
+ y: 0.5,
122
+ shapes: ["square", "circle"],
123
+ zIndex: 100,
124
+ colors: [
125
+ "#26ccff",
126
+ "#a25afd",
127
+ "#ff5e7e",
128
+ "#88ff5a",
129
+ "#fcff42",
130
+ "#ffa62d",
131
+ "#ff36ff"
132
+ ],
133
+ // probably should be true, but back-compat
134
+ disableForReducedMotion: !1,
135
+ scalar: 1
136
+ };
137
+ function H(e, r) {
138
+ return r ? r(e) : e;
139
+ }
140
+ function G(e) {
141
+ return e != null;
142
+ }
143
+ function v(e, r, a) {
144
+ return H(
145
+ e && G(e[r]) ? e[r] : q[r],
146
+ a
147
+ );
148
+ }
149
+ function J(e) {
150
+ return e < 0 ? 0 : Math.floor(e);
151
+ }
152
+ function K(e, r) {
153
+ return Math.floor(Math.random() * (r - e)) + e;
154
+ }
155
+ function E(e) {
156
+ return parseInt(e, 16);
157
+ }
158
+ function Q(e) {
159
+ return e.map($);
160
+ }
161
+ function $(e) {
162
+ var r = String(e).replace(/[^0-9a-f]/gi, "");
163
+ return r.length < 6 && (r = r[0] + r[0] + r[1] + r[1] + r[2] + r[2]), {
164
+ r: E(r.substring(0, 2)),
165
+ g: E(r.substring(2, 4)),
166
+ b: E(r.substring(4, 6))
167
+ };
168
+ }
169
+ function X(e) {
170
+ var r = v(e, "origin", Object);
171
+ return r.x = v(r, "x", Number), r.y = v(r, "y", Number), r;
172
+ }
173
+ function Y(e) {
174
+ e.width = document.documentElement.clientWidth, e.height = document.documentElement.clientHeight;
175
+ }
176
+ function rr(e) {
177
+ var r = e.getBoundingClientRect();
178
+ e.width = r.width, e.height = r.height;
179
+ }
180
+ function er(e) {
181
+ var r = document.createElement("canvas");
182
+ return r.style.position = "fixed", r.style.top = "0px", r.style.left = "0px", r.style.pointerEvents = "none", r.style.zIndex = e, r;
183
+ }
184
+ function ar(e, r, a, t, o, i, l, n, s) {
185
+ e.save(), e.translate(r, a), e.rotate(i), e.scale(t, o), e.arc(0, 0, 1, l, n, s), e.restore();
186
+ }
187
+ function nr(e) {
188
+ var r = e.angle * (Math.PI / 180), a = e.spread * (Math.PI / 180);
189
+ return {
190
+ x: e.x,
191
+ y: e.y,
192
+ wobble: Math.random() * 10,
193
+ wobbleSpeed: Math.min(0.11, Math.random() * 0.1 + 0.05),
194
+ velocity: e.startVelocity * 0.5 + Math.random() * e.startVelocity,
195
+ angle2D: -r + (0.5 * a - Math.random() * a),
196
+ tiltAngle: (Math.random() * (0.75 - 0.25) + 0.25) * Math.PI,
197
+ color: e.color,
198
+ shape: e.shape,
199
+ tick: 0,
200
+ totalTicks: e.ticks,
201
+ decay: e.decay,
202
+ drift: e.drift,
203
+ random: Math.random() + 2,
204
+ tiltSin: 0,
205
+ tiltCos: 0,
206
+ wobbleX: 0,
207
+ wobbleY: 0,
208
+ gravity: e.gravity * 3,
209
+ ovalScalar: 0.6,
210
+ scalar: e.scalar,
211
+ flat: e.flat
212
+ };
213
+ }
214
+ function tr(e, r) {
215
+ r.x += Math.cos(r.angle2D) * r.velocity + r.drift, r.y += Math.sin(r.angle2D) * r.velocity + r.gravity, r.velocity *= r.decay, r.flat ? (r.wobble = 0, r.wobbleX = r.x + 10 * r.scalar, r.wobbleY = r.y + 10 * r.scalar, r.tiltSin = 0, r.tiltCos = 0, r.random = 1) : (r.wobble += r.wobbleSpeed, r.wobbleX = r.x + 10 * r.scalar * Math.cos(r.wobble), r.wobbleY = r.y + 10 * r.scalar * Math.sin(r.wobble), r.tiltAngle += 0.1, r.tiltSin = Math.sin(r.tiltAngle), r.tiltCos = Math.cos(r.tiltAngle), r.random = Math.random() + 2);
216
+ var a = r.tick++ / r.totalTicks, t = r.x + r.random * r.tiltCos, o = r.y + r.random * r.tiltSin, i = r.wobbleX + r.random * r.tiltCos, l = r.wobbleY + r.random * r.tiltSin;
217
+ if (e.fillStyle = "rgba(" + r.color.r + ", " + r.color.g + ", " + r.color.b + ", " + (1 - a) + ")", e.beginPath(), A && r.shape.type === "path" && typeof r.shape.path == "string" && Array.isArray(r.shape.matrix))
218
+ e.fill(ir(
219
+ r.shape.path,
220
+ r.shape.matrix,
221
+ r.x,
222
+ r.y,
223
+ Math.abs(i - t) * 0.1,
224
+ Math.abs(l - o) * 0.1,
225
+ Math.PI / 10 * r.wobble
226
+ ));
227
+ else if (r.shape.type === "bitmap") {
228
+ var n = Math.PI / 10 * r.wobble, s = Math.abs(i - t) * 0.1, h = Math.abs(l - o) * 0.1, d = r.shape.bitmap.width * r.scalar, u = r.shape.bitmap.height * r.scalar, f = new DOMMatrix([
229
+ Math.cos(n) * s,
230
+ Math.sin(n) * s,
231
+ -Math.sin(n) * h,
232
+ Math.cos(n) * h,
233
+ r.x,
234
+ r.y
235
+ ]);
236
+ f.multiplySelf(new DOMMatrix(r.shape.matrix));
237
+ var m = e.createPattern(x.transform(r.shape.bitmap), "no-repeat");
238
+ m.setTransform(f), e.globalAlpha = 1 - a, e.fillStyle = m, e.fillRect(
239
+ r.x - d / 2,
240
+ r.y - u / 2,
241
+ d,
242
+ u
243
+ ), e.globalAlpha = 1;
244
+ } else if (r.shape === "circle")
245
+ e.ellipse ? e.ellipse(r.x, r.y, Math.abs(i - t) * r.ovalScalar, Math.abs(l - o) * r.ovalScalar, Math.PI / 10 * r.wobble, 0, 2 * Math.PI) : ar(e, r.x, r.y, Math.abs(i - t) * r.ovalScalar, Math.abs(l - o) * r.ovalScalar, Math.PI / 10 * r.wobble, 0, 2 * Math.PI);
246
+ else if (r.shape === "star")
247
+ for (var c = Math.PI / 2 * 3, g = 4 * r.scalar, p = 8 * r.scalar, y = r.x, w = r.y, C = 5, b = Math.PI / C; C--; )
248
+ y = r.x + Math.cos(c) * p, w = r.y + Math.sin(c) * p, e.lineTo(y, w), c += b, y = r.x + Math.cos(c) * g, w = r.y + Math.sin(c) * g, e.lineTo(y, w), c += b;
249
+ else
250
+ e.moveTo(Math.floor(r.x), Math.floor(r.y)), e.lineTo(Math.floor(r.wobbleX), Math.floor(o)), e.lineTo(Math.floor(i), Math.floor(l)), e.lineTo(Math.floor(t), Math.floor(r.wobbleY));
251
+ return e.closePath(), e.fill(), r.tick < r.totalTicks;
252
+ }
253
+ function or(e, r, a, t, o) {
254
+ var i = r.slice(), l = e.getContext("2d"), n, s, h = P(function(d) {
255
+ function u() {
256
+ n = s = null, l.clearRect(0, 0, t.width, t.height), x.clear(), o(), d();
257
+ }
258
+ function f() {
259
+ B && !(t.width === I.width && t.height === I.height) && (t.width = e.width = I.width, t.height = e.height = I.height), !t.width && !t.height && (a(e), t.width = e.width, t.height = e.height), l.clearRect(0, 0, t.width, t.height), i = i.filter(function(m) {
260
+ return tr(l, m);
261
+ }), i.length ? n = F.frame(f) : u();
262
+ }
263
+ n = F.frame(f), s = u;
264
+ });
265
+ return {
266
+ addFettis: function(d) {
267
+ return i = i.concat(d), h;
268
+ },
269
+ canvas: e,
270
+ promise: h,
271
+ reset: function() {
272
+ n && F.cancel(n), s && s();
273
+ }
274
+ };
275
+ }
276
+ function N(e, r) {
277
+ var a = !e, t = !!v(r || {}, "resize"), o = !1, i = v(r, "disableForReducedMotion", Boolean), l = k && !!v(r || {}, "useWorker"), n = l ? _() : null, s = a ? Y : rr, h = e && n ? !!e.__confetti_initialized : !1, d = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion)").matches, u;
278
+ function f(c, g, p) {
279
+ for (var y = v(c, "particleCount", J), w = v(c, "angle", Number), C = v(c, "spread", Number), b = v(c, "startVelocity", Number), cr = v(c, "decay", Number), hr = v(c, "gravity", Number), ur = v(c, "drift", Number), j = v(c, "colors", Q), dr = v(c, "ticks", Number), D = v(c, "shapes"), fr = v(c, "scalar"), vr = !!v(c, "flat"), U = X(c), z = y, O = [], mr = e.width * U.x, gr = e.height * U.y; z--; )
280
+ O.push(
281
+ nr({
282
+ x: mr,
283
+ y: gr,
284
+ angle: w,
285
+ spread: C,
286
+ startVelocity: b,
287
+ color: j[z % j.length],
288
+ shape: D[K(0, D.length)],
289
+ ticks: dr,
290
+ decay: cr,
291
+ gravity: hr,
292
+ drift: ur,
293
+ scalar: fr,
294
+ flat: vr
295
+ })
296
+ );
297
+ return u ? u.addFettis(O) : (u = or(e, O, s, g, p), u.promise);
298
+ }
299
+ function m(c) {
300
+ var g = i || v(c, "disableForReducedMotion", Boolean), p = v(c, "zIndex", Number);
301
+ if (g && d)
302
+ return P(function(b) {
303
+ b();
304
+ });
305
+ a && u ? e = u.canvas : a && !e && (e = er(p), document.body.appendChild(e)), t && !h && s(e);
306
+ var y = {
307
+ width: e.width,
308
+ height: e.height
309
+ };
310
+ n && !h && n.init(e), h = !0, n && (e.__confetti_initialized = !0);
311
+ function w() {
312
+ if (n) {
313
+ var b = {
314
+ getBoundingClientRect: function() {
315
+ if (!a)
316
+ return e.getBoundingClientRect();
317
+ }
318
+ };
319
+ s(b), n.postMessage({
320
+ resize: {
321
+ width: b.width,
322
+ height: b.height
323
+ }
324
+ });
325
+ return;
326
+ }
327
+ y.width = y.height = null;
328
+ }
329
+ function C() {
330
+ u = null, t && (o = !1, M.removeEventListener("resize", w)), a && e && (document.body.contains(e) && document.body.removeChild(e), e = null, h = !1);
331
+ }
332
+ return t && !o && (o = !0, M.addEventListener("resize", w, !1)), n ? n.fire(c, y, C) : f(c, y, C);
333
+ }
334
+ return m.reset = function() {
335
+ n && n.reset(), u && u.reset();
336
+ }, m;
337
+ }
338
+ var S;
339
+ function W() {
340
+ return S || (S = N(null, { useWorker: !0, resize: !0 })), S;
341
+ }
342
+ function ir(e, r, a, t, o, i, l) {
343
+ var n = new Path2D(e), s = new Path2D();
344
+ s.addPath(n, new DOMMatrix(r));
345
+ var h = new Path2D();
346
+ return h.addPath(s, new DOMMatrix([
347
+ Math.cos(l) * o,
348
+ Math.sin(l) * o,
349
+ -Math.sin(l) * i,
350
+ Math.cos(l) * i,
351
+ a,
352
+ t
353
+ ])), h;
354
+ }
355
+ function lr(e) {
356
+ if (!A)
357
+ throw new Error("path confetti are not supported in this browser");
358
+ var r, a;
359
+ typeof e == "string" ? r = e : (r = e.path, a = e.matrix);
360
+ var t = new Path2D(r), o = document.createElement("canvas"), i = o.getContext("2d");
361
+ if (!a) {
362
+ for (var l = 1e3, n = l, s = l, h = 0, d = 0, u, f, m = 0; m < l; m += 2)
363
+ for (var c = 0; c < l; c += 2)
364
+ i.isPointInPath(t, m, c, "nonzero") && (n = Math.min(n, m), s = Math.min(s, c), h = Math.max(h, m), d = Math.max(d, c));
365
+ u = h - n, f = d - s;
366
+ var g = 10, p = Math.min(g / u, g / f);
367
+ a = [
368
+ p,
369
+ 0,
370
+ 0,
371
+ p,
372
+ -Math.round(u / 2 + n) * p,
373
+ -Math.round(f / 2 + s) * p
374
+ ];
375
+ }
376
+ return {
377
+ type: "path",
378
+ path: r,
379
+ matrix: a
380
+ };
381
+ }
382
+ function sr(e) {
383
+ var r, a = 1, t = "#000000", o = '"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';
384
+ typeof e == "string" ? r = e : (r = e.text, a = "scalar" in e ? e.scalar : a, o = "fontFamily" in e ? e.fontFamily : o, t = "color" in e ? e.color : t);
385
+ var i = 10 * a, l = "" + i + "px " + o, n = new OffscreenCanvas(i, i), s = n.getContext("2d");
386
+ s.font = l;
387
+ var h = s.measureText(r), d = Math.ceil(h.actualBoundingBoxRight + h.actualBoundingBoxLeft), u = Math.ceil(h.actualBoundingBoxAscent + h.actualBoundingBoxDescent), f = 2, m = h.actualBoundingBoxLeft + f, c = h.actualBoundingBoxAscent + f;
388
+ d += f + f, u += f + f, n = new OffscreenCanvas(d, u), s = n.getContext("2d"), s.font = l, s.fillStyle = t, s.fillText(r, m, c);
389
+ var g = 1 / a;
390
+ return {
391
+ type: "bitmap",
392
+ // TODO these probably need to be transfered for workers
393
+ bitmap: n.transferToImageBitmap(),
394
+ matrix: [g, 0, 0, g, -d * g / 2, -u * g / 2]
395
+ };
396
+ }
397
+ T.exports = function() {
398
+ return W().apply(this, arguments);
399
+ }, T.exports.reset = function() {
400
+ W().reset();
401
+ }, T.exports.create = N, T.exports.shapeFromPath = lr, T.exports.shapeFromText = sr;
402
+ })(/* @__PURE__ */ function() {
403
+ return typeof window < "u" ? window : typeof self < "u" ? self : this || {};
404
+ }(), R, !1);
405
+ const Mr = R.exports;
406
+ R.exports.create;
407
+ export {
408
+ Mr as default
409
+ };
@@ -0,0 +1,15 @@
1
+ function l(d, i) {
2
+ let e;
3
+ if (i === void 0)
4
+ for (const n of d)
5
+ n != null && (e < n || e === void 0 && n >= n) && (e = n);
6
+ else {
7
+ let n = -1;
8
+ for (let f of d)
9
+ (f = i(f, ++n, d)) != null && (e < f || e === void 0 && f >= f) && (e = f);
10
+ }
11
+ return e;
12
+ }
13
+ export {
14
+ l as default
15
+ };