@koine/next 1.0.4 → 1.0.9

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 (209) hide show
  1. package/Analytics/AnalyticsGoogle.d.ts +5 -6
  2. package/Analytics/AnalyticsGoogle.js +37 -0
  3. package/Analytics/index.d.ts +1 -1
  4. package/Analytics/index.js +1 -0
  5. package/Analytics/package.json +6 -0
  6. package/Auth/helpers.d.ts +17 -17
  7. package/Auth/helpers.js +21 -0
  8. package/Auth/index.d.ts +4 -4
  9. package/Auth/index.js +4 -0
  10. package/Auth/package.json +6 -0
  11. package/Auth/useLogin.d.ts +7 -7
  12. package/Auth/useLogin.js +50 -0
  13. package/Auth/useLoginUrl.d.ts +1 -1
  14. package/Auth/useLoginUrl.js +11 -0
  15. package/Auth/useLogout.d.ts +6 -6
  16. package/Auth/useLogout.js +52 -0
  17. package/Favicon/Favicon.d.ts +3 -4
  18. package/Favicon/Favicon.js +4 -0
  19. package/Favicon/index.d.ts +1 -1
  20. package/Favicon/index.js +1 -0
  21. package/Favicon/package.json +6 -0
  22. package/Forms/index.d.ts +2 -2
  23. package/Forms/index.js +2 -0
  24. package/Forms/package.json +6 -0
  25. package/Forms/useForm.d.ts +32 -32
  26. package/Forms/useForm.js +37 -0
  27. package/Forms/useSubmit.d.ts +24 -24
  28. package/Forms/useSubmit.js +23 -0
  29. package/Head/Head.d.ts +1 -1
  30. package/Head/Head.js +1 -0
  31. package/Head/index.d.ts +1 -1
  32. package/Head/index.js +1 -0
  33. package/Head/package.json +6 -0
  34. package/I18n/I18n.d.ts +44 -48
  35. package/I18n/I18n.js +74 -0
  36. package/I18n/index.d.ts +1 -1
  37. package/I18n/index.js +1 -0
  38. package/I18n/package.json +6 -0
  39. package/Img/Img.d.ts +21 -21
  40. package/Img/Img.js +28 -0
  41. package/Img/index.d.ts +1 -1
  42. package/Img/index.js +1 -0
  43. package/Img/package.json +6 -0
  44. package/Link/Link.d.ts +9 -8
  45. package/Link/Link.js +9 -0
  46. package/Link/index.d.ts +1 -1
  47. package/Link/index.js +1 -0
  48. package/Link/package.json +6 -0
  49. package/NextProgress/NextProgress.d.ts +24 -14
  50. package/NextProgress/NextProgress.js +37 -0
  51. package/NextProgress/index.d.ts +2 -1
  52. package/NextProgress/index.js +1 -0
  53. package/NextProgress/package.json +6 -0
  54. package/README.md +0 -0
  55. package/Seo/Seo.d.ts +3 -3
  56. package/Seo/Seo.js +8 -0
  57. package/Seo/SeoDefaults.d.ts +3 -3
  58. package/Seo/SeoDefaults.js +12 -0
  59. package/Seo/helpers.d.ts +48 -48
  60. package/Seo/helpers.js +111 -0
  61. package/Seo/index.d.ts +12 -12
  62. package/Seo/index.js +12 -0
  63. package/Seo/package.json +6 -0
  64. package/Theme/Theme.d.ts +46 -46
  65. package/Theme/Theme.js +235 -0
  66. package/Theme/index.d.ts +1 -1
  67. package/Theme/index.js +1 -0
  68. package/Theme/package.json +6 -0
  69. package/app/AppHead.d.ts +2 -3
  70. package/app/AppHead.js +5 -0
  71. package/app/AppMain.d.ts +35 -34
  72. package/app/AppMain.js +1 -0
  73. package/app/css/AppMain.d.ts +8 -0
  74. package/app/css/AppMain.js +11 -0
  75. package/app/css/AppTheme.d.ts +10 -0
  76. package/app/css/AppTheme.js +12 -0
  77. package/app/css/auth/index.d.ts +9 -0
  78. package/app/css/auth/index.js +13 -0
  79. package/app/css/auth/package.json +6 -0
  80. package/app/css/index.d.ts +54 -0
  81. package/app/css/index.js +57 -0
  82. package/app/css/package.json +6 -0
  83. package/app/em/AppMain.d.ts +10 -0
  84. package/app/em/AppMain.js +22 -0
  85. package/app/{AppTheme--emotion.d.ts → em/AppTheme.d.ts} +15 -15
  86. package/app/em/AppTheme.js +17 -0
  87. package/app/em/auth/index.d.ts +9 -0
  88. package/app/em/auth/index.js +13 -0
  89. package/app/em/auth/package.json +6 -0
  90. package/app/em/index.d.ts +9 -0
  91. package/app/em/index.js +12 -0
  92. package/app/em/package.json +6 -0
  93. package/app/index.d.ts +2 -11
  94. package/app/index.js +2 -0
  95. package/app/package.json +6 -0
  96. package/app/sc/AppMain.d.ts +10 -0
  97. package/app/sc/AppMain.js +22 -0
  98. package/app/sc/AppTheme.d.ts +13 -0
  99. package/app/sc/AppTheme.js +9 -0
  100. package/app/sc/auth/index.d.ts +9 -0
  101. package/app/sc/auth/index.js +13 -0
  102. package/app/sc/auth/package.json +6 -0
  103. package/app/sc/index.d.ts +56 -0
  104. package/app/sc/index.js +59 -0
  105. package/app/sc/package.json +6 -0
  106. package/config/index.d.ts +71 -58
  107. package/config/index.js +174 -0
  108. package/config/package.json +6 -0
  109. package/document/Document.d.ts +15 -10
  110. package/document/Document.js +19 -0
  111. package/document/css/index.d.ts +22 -0
  112. package/document/css/index.js +30 -0
  113. package/document/css/package.json +6 -0
  114. package/document/em/index.d.ts +16 -0
  115. package/document/em/index.js +68 -0
  116. package/document/em/package.json +6 -0
  117. package/document/index.d.ts +2 -4
  118. package/document/index.js +2 -0
  119. package/document/package.json +6 -0
  120. package/document/{Document--sc.d.ts → sc/index.d.ts} +20 -11
  121. package/document/sc/index.js +44 -0
  122. package/document/sc/package.json +6 -0
  123. package/index.d.ts +12 -12
  124. package/index.js +12 -743
  125. package/node/Analytics/AnalyticsGoogle.js +42 -0
  126. package/node/Analytics/index.js +4 -0
  127. package/node/Auth/helpers.js +26 -0
  128. package/node/Auth/index.js +7 -0
  129. package/node/Auth/useLogin.js +54 -0
  130. package/node/Auth/useLoginUrl.js +15 -0
  131. package/node/Auth/useLogout.js +56 -0
  132. package/node/Favicon/Favicon.js +9 -0
  133. package/node/Favicon/index.js +4 -0
  134. package/node/Forms/index.js +5 -0
  135. package/node/Forms/useForm.js +41 -0
  136. package/node/Forms/useSubmit.js +27 -0
  137. package/node/Head/Head.js +8 -0
  138. package/node/Head/index.js +4 -0
  139. package/node/I18n/I18n.js +82 -0
  140. package/node/I18n/index.js +4 -0
  141. package/node/Img/Img.js +34 -0
  142. package/node/Img/index.js +4 -0
  143. package/node/Link/Link.js +13 -0
  144. package/node/Link/index.js +4 -0
  145. package/node/NextProgress/NextProgress.js +41 -0
  146. package/node/NextProgress/index.js +5 -0
  147. package/node/Seo/Seo.js +12 -0
  148. package/node/Seo/SeoDefaults.js +16 -0
  149. package/node/Seo/helpers.js +115 -0
  150. package/node/Seo/index.js +15 -0
  151. package/node/Theme/Theme.js +241 -0
  152. package/node/Theme/index.js +4 -0
  153. package/node/app/AppHead.js +10 -0
  154. package/node/app/AppMain.js +2 -0
  155. package/node/app/css/AppMain.js +16 -0
  156. package/node/app/css/AppTheme.js +16 -0
  157. package/node/app/css/auth/index.js +18 -0
  158. package/node/app/css/index.js +62 -0
  159. package/node/app/em/AppMain.js +26 -0
  160. package/node/app/em/AppTheme.js +22 -0
  161. package/node/app/em/auth/index.js +18 -0
  162. package/node/app/em/index.js +17 -0
  163. package/node/app/index.js +5 -0
  164. package/node/app/sc/AppMain.js +26 -0
  165. package/node/app/sc/AppTheme.js +13 -0
  166. package/node/app/sc/auth/index.js +18 -0
  167. package/node/app/sc/index.js +64 -0
  168. package/node/config/index.js +184 -0
  169. package/node/document/Document.js +24 -0
  170. package/node/document/css/index.js +35 -0
  171. package/node/document/em/index.js +73 -0
  172. package/node/document/index.js +7 -0
  173. package/node/document/sc/index.js +49 -0
  174. package/node/index.js +15 -0
  175. package/node/utils/api.js +38 -0
  176. package/node/utils/emotion-cache.js +13 -0
  177. package/node/utils/index.js +32 -0
  178. package/package.json +3 -30
  179. package/{types.d.ts → typings.d.ts} +10 -7
  180. package/utils/api.d.ts +55 -55
  181. package/utils/api.js +35 -0
  182. package/{document/emotion.d.ts → utils/emotion-cache.d.ts} +5 -5
  183. package/utils/emotion-cache.js +8 -0
  184. package/utils/index.d.ts +19 -19
  185. package/utils/index.js +26 -0
  186. package/utils/package.json +6 -0
  187. package/Theme.js +0 -1905
  188. package/_tslib.js +0 -41
  189. package/app/App--emotion.d.ts +0 -10
  190. package/app/App--sc.d.ts +0 -10
  191. package/app/App--vanilla.d.ts +0 -10
  192. package/app/AppAuth--emotion.d.ts +0 -10
  193. package/app/AppAuth--sc.d.ts +0 -10
  194. package/app/AppMain--vanilla.d.ts +0 -27
  195. package/app/AppTheme--sc.d.ts +0 -13
  196. package/app/AppTheme--vanilla.d.ts +0 -10
  197. package/app/motion-features.d.ts +0 -2
  198. package/app.js +0 -250
  199. package/config.js +0 -183
  200. package/document/Document--emotion.d.ts +0 -5
  201. package/document/Document--vanilla.d.ts +0 -11
  202. package/document.js +0 -207
  203. package/emotion.js +0 -1329
  204. package/es.object.assign.js +0 -1074
  205. package/es.string.replace.js +0 -785
  206. package/es.string.split.js +0 -201
  207. package/index.esm.js +0 -4600
  208. package/index.umd.js +0 -4638
  209. package/motion-features.js +0 -10
package/index.umd.js DELETED
@@ -1,4638 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react/jsx-runtime'), require('react'), require('next/router'), require('next/script'), require('@koine/utils'), require('next-auth/react'), require('date-fns/format'), require('next-translate/useTranslation'), require('@koine/react'), require('next-translate/Trans'), require('next/head'), require('react-hook-form'), require('@hookform/resolvers/yup'), require('react-use'), require('next/image'), require('next/link')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'react/jsx-runtime', 'react', 'next/router', 'next/script', '@koine/utils', 'next-auth/react', 'date-fns/format', 'next-translate/useTranslation', '@koine/react', 'next-translate/Trans', 'next/head', 'react-hook-form', '@hookform/resolvers/yup', 'react-use', 'next/image', 'next/link'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Next = {}, global.jsxRuntime, global.React, global.router, global.Script, global.utils, global.react$2, global.format, global.useTranslation, global.react$1, global.Trans, global.Head, global.reactHookForm, global.yup, global.reactUse, global.NextImage, global.NextLink));
5
- })(this, (function (exports, jsxRuntime, react, router, Script, utils, react$2, format, useTranslation, react$1, Trans, Head, reactHookForm, yup, reactUse, NextImage, NextLink) { 'use strict';
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- var Script__default = /*#__PURE__*/_interopDefaultLegacy(Script);
10
- var format__default = /*#__PURE__*/_interopDefaultLegacy(format);
11
- var useTranslation__default = /*#__PURE__*/_interopDefaultLegacy(useTranslation);
12
- var Trans__default = /*#__PURE__*/_interopDefaultLegacy(Trans);
13
- var Head__default = /*#__PURE__*/_interopDefaultLegacy(Head);
14
- var NextImage__default = /*#__PURE__*/_interopDefaultLegacy(NextImage);
15
- var NextLink__default = /*#__PURE__*/_interopDefaultLegacy(NextLink);
16
-
17
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
18
-
19
- var check = function (it) {
20
- return it && it.Math == Math && it;
21
- };
22
-
23
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
24
- var global$J =
25
- // eslint-disable-next-line es/no-global-this -- safe
26
- check(typeof globalThis == 'object' && globalThis) ||
27
- check(typeof window == 'object' && window) ||
28
- // eslint-disable-next-line no-restricted-globals -- safe
29
- check(typeof self == 'object' && self) ||
30
- check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
31
- // eslint-disable-next-line no-new-func -- fallback
32
- (function () { return this; })() || Function('return this')();
33
-
34
- var fails$k = function (exec) {
35
- try {
36
- return !!exec();
37
- } catch (error) {
38
- return true;
39
- }
40
- };
41
-
42
- var fails$j = fails$k;
43
-
44
- var functionBindNative = !fails$j(function () {
45
- var test = (function () { /* empty */ }).bind();
46
- // eslint-disable-next-line no-prototype-builtins -- safe
47
- return typeof test != 'function' || test.hasOwnProperty('prototype');
48
- });
49
-
50
- var NATIVE_BIND$3 = functionBindNative;
51
-
52
- var FunctionPrototype$2 = Function.prototype;
53
- var bind$5 = FunctionPrototype$2.bind;
54
- var call$h = FunctionPrototype$2.call;
55
- var uncurryThis$m = NATIVE_BIND$3 && bind$5.bind(call$h, call$h);
56
-
57
- var functionUncurryThis = NATIVE_BIND$3 ? function (fn) {
58
- return fn && uncurryThis$m(fn);
59
- } : function (fn) {
60
- return fn && function () {
61
- return call$h.apply(fn, arguments);
62
- };
63
- };
64
-
65
- var uncurryThis$l = functionUncurryThis;
66
-
67
- var toString$9 = uncurryThis$l({}.toString);
68
- var stringSlice$6 = uncurryThis$l(''.slice);
69
-
70
- var classofRaw$1 = function (it) {
71
- return stringSlice$6(toString$9(it), 8, -1);
72
- };
73
-
74
- var global$I = global$J;
75
- var uncurryThis$k = functionUncurryThis;
76
- var fails$i = fails$k;
77
- var classof$7 = classofRaw$1;
78
-
79
- var Object$5 = global$I.Object;
80
- var split = uncurryThis$k(''.split);
81
-
82
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
83
- var indexedObject = fails$i(function () {
84
- // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
85
- // eslint-disable-next-line no-prototype-builtins -- safe
86
- return !Object$5('z').propertyIsEnumerable(0);
87
- }) ? function (it) {
88
- return classof$7(it) == 'String' ? split(it, '') : Object$5(it);
89
- } : Object$5;
90
-
91
- var global$H = global$J;
92
-
93
- var TypeError$g = global$H.TypeError;
94
-
95
- // `RequireObjectCoercible` abstract operation
96
- // https://tc39.es/ecma262/#sec-requireobjectcoercible
97
- var requireObjectCoercible$7 = function (it) {
98
- if (it == undefined) throw TypeError$g("Can't call method on " + it);
99
- return it;
100
- };
101
-
102
- // toObject with fallback for non-array-like ES3 strings
103
- var IndexedObject$2 = indexedObject;
104
- var requireObjectCoercible$6 = requireObjectCoercible$7;
105
-
106
- var toIndexedObject$5 = function (it) {
107
- return IndexedObject$2(requireObjectCoercible$6(it));
108
- };
109
-
110
- var shared$4 = {exports: {}};
111
-
112
- var global$G = global$J;
113
-
114
- // eslint-disable-next-line es/no-object-defineproperty -- safe
115
- var defineProperty$4 = Object.defineProperty;
116
-
117
- var setGlobal$3 = function (key, value) {
118
- try {
119
- defineProperty$4(global$G, key, { value: value, configurable: true, writable: true });
120
- } catch (error) {
121
- global$G[key] = value;
122
- } return value;
123
- };
124
-
125
- var global$F = global$J;
126
- var setGlobal$2 = setGlobal$3;
127
-
128
- var SHARED = '__core-js_shared__';
129
- var store$3 = global$F[SHARED] || setGlobal$2(SHARED, {});
130
-
131
- var sharedStore = store$3;
132
-
133
- var store$2 = sharedStore;
134
-
135
- (shared$4.exports = function (key, value) {
136
- return store$2[key] || (store$2[key] = value !== undefined ? value : {});
137
- })('versions', []).push({
138
- version: '3.21.1',
139
- mode: 'global',
140
- copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
141
- license: 'https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE',
142
- source: 'https://github.com/zloirock/core-js'
143
- });
144
-
145
- var global$E = global$J;
146
- var requireObjectCoercible$5 = requireObjectCoercible$7;
147
-
148
- var Object$4 = global$E.Object;
149
-
150
- // `ToObject` abstract operation
151
- // https://tc39.es/ecma262/#sec-toobject
152
- var toObject$5 = function (argument) {
153
- return Object$4(requireObjectCoercible$5(argument));
154
- };
155
-
156
- var uncurryThis$j = functionUncurryThis;
157
- var toObject$4 = toObject$5;
158
-
159
- var hasOwnProperty = uncurryThis$j({}.hasOwnProperty);
160
-
161
- // `HasOwnProperty` abstract operation
162
- // https://tc39.es/ecma262/#sec-hasownproperty
163
- var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
164
- return hasOwnProperty(toObject$4(it), key);
165
- };
166
-
167
- var uncurryThis$i = functionUncurryThis;
168
-
169
- var id = 0;
170
- var postfix = Math.random();
171
- var toString$8 = uncurryThis$i(1.0.toString);
172
-
173
- var uid$2 = function (key) {
174
- return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$8(++id + postfix, 36);
175
- };
176
-
177
- // `IsCallable` abstract operation
178
- // https://tc39.es/ecma262/#sec-iscallable
179
- var isCallable$k = function (argument) {
180
- return typeof argument == 'function';
181
- };
182
-
183
- var global$D = global$J;
184
- var isCallable$j = isCallable$k;
185
-
186
- var aFunction = function (argument) {
187
- return isCallable$j(argument) ? argument : undefined;
188
- };
189
-
190
- var getBuiltIn$7 = function (namespace, method) {
191
- return arguments.length < 2 ? aFunction(global$D[namespace]) : global$D[namespace] && global$D[namespace][method];
192
- };
193
-
194
- var getBuiltIn$6 = getBuiltIn$7;
195
-
196
- var engineUserAgent = getBuiltIn$6('navigator', 'userAgent') || '';
197
-
198
- var global$C = global$J;
199
- var userAgent$3 = engineUserAgent;
200
-
201
- var process$4 = global$C.process;
202
- var Deno = global$C.Deno;
203
- var versions = process$4 && process$4.versions || Deno && Deno.version;
204
- var v8 = versions && versions.v8;
205
- var match, version;
206
-
207
- if (v8) {
208
- match = v8.split('.');
209
- // in old Chrome, versions of V8 isn't V8 = Chrome / 10
210
- // but their correct versions are not interesting for us
211
- version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
212
- }
213
-
214
- // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
215
- // so check `userAgent` even if `.v8` exists, but 0
216
- if (!version && userAgent$3) {
217
- match = userAgent$3.match(/Edge\/(\d+)/);
218
- if (!match || match[1] >= 74) {
219
- match = userAgent$3.match(/Chrome\/(\d+)/);
220
- if (match) version = +match[1];
221
- }
222
- }
223
-
224
- var engineV8Version = version;
225
-
226
- /* eslint-disable es/no-symbol -- required for testing */
227
-
228
- var V8_VERSION$1 = engineV8Version;
229
- var fails$h = fails$k;
230
-
231
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
232
- var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$h(function () {
233
- var symbol = Symbol();
234
- // Chrome 38 Symbol has incorrect toString conversion
235
- // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
236
- return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
237
- // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
238
- !Symbol.sham && V8_VERSION$1 && V8_VERSION$1 < 41;
239
- });
240
-
241
- /* eslint-disable es/no-symbol -- required for testing */
242
-
243
- var NATIVE_SYMBOL$2 = nativeSymbol;
244
-
245
- var useSymbolAsUid = NATIVE_SYMBOL$2
246
- && !Symbol.sham
247
- && typeof Symbol.iterator == 'symbol';
248
-
249
- var global$B = global$J;
250
- var shared$3 = shared$4.exports;
251
- var hasOwn$a = hasOwnProperty_1;
252
- var uid$1 = uid$2;
253
- var NATIVE_SYMBOL$1 = nativeSymbol;
254
- var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
255
-
256
- var WellKnownSymbolsStore = shared$3('wks');
257
- var Symbol$1 = global$B.Symbol;
258
- var symbolFor = Symbol$1 && Symbol$1['for'];
259
- var createWellKnownSymbol = USE_SYMBOL_AS_UID$1 ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
260
-
261
- var wellKnownSymbol$h = function (name) {
262
- if (!hasOwn$a(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL$1 || typeof WellKnownSymbolsStore[name] == 'string')) {
263
- var description = 'Symbol.' + name;
264
- if (NATIVE_SYMBOL$1 && hasOwn$a(Symbol$1, name)) {
265
- WellKnownSymbolsStore[name] = Symbol$1[name];
266
- } else if (USE_SYMBOL_AS_UID$1 && symbolFor) {
267
- WellKnownSymbolsStore[name] = symbolFor(description);
268
- } else {
269
- WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
270
- }
271
- } return WellKnownSymbolsStore[name];
272
- };
273
-
274
- var isCallable$i = isCallable$k;
275
-
276
- var isObject$8 = function (it) {
277
- return typeof it == 'object' ? it !== null : isCallable$i(it);
278
- };
279
-
280
- var global$A = global$J;
281
- var isObject$7 = isObject$8;
282
-
283
- var String$5 = global$A.String;
284
- var TypeError$f = global$A.TypeError;
285
-
286
- // `Assert: Type(argument) is Object`
287
- var anObject$h = function (argument) {
288
- if (isObject$7(argument)) return argument;
289
- throw TypeError$f(String$5(argument) + ' is not an object');
290
- };
291
-
292
- var objectDefineProperties = {};
293
-
294
- var fails$g = fails$k;
295
-
296
- // Detect IE8's incomplete defineProperty implementation
297
- var descriptors = !fails$g(function () {
298
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
299
- return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
300
- });
301
-
302
- var DESCRIPTORS$a = descriptors;
303
- var fails$f = fails$k;
304
-
305
- // V8 ~ Chrome 36-
306
- // https://bugs.chromium.org/p/v8/issues/detail?id=3334
307
- var v8PrototypeDefineBug = DESCRIPTORS$a && fails$f(function () {
308
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
309
- return Object.defineProperty(function () { /* empty */ }, 'prototype', {
310
- value: 42,
311
- writable: false
312
- }).prototype != 42;
313
- });
314
-
315
- var objectDefineProperty = {};
316
-
317
- var global$z = global$J;
318
- var isObject$6 = isObject$8;
319
-
320
- var document$3 = global$z.document;
321
- // typeof document.createElement is 'object' in old IE
322
- var EXISTS$1 = isObject$6(document$3) && isObject$6(document$3.createElement);
323
-
324
- var documentCreateElement$2 = function (it) {
325
- return EXISTS$1 ? document$3.createElement(it) : {};
326
- };
327
-
328
- var DESCRIPTORS$9 = descriptors;
329
- var fails$e = fails$k;
330
- var createElement$1 = documentCreateElement$2;
331
-
332
- // Thanks to IE8 for its funny defineProperty
333
- var ie8DomDefine = !DESCRIPTORS$9 && !fails$e(function () {
334
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
335
- return Object.defineProperty(createElement$1('div'), 'a', {
336
- get: function () { return 7; }
337
- }).a != 7;
338
- });
339
-
340
- var NATIVE_BIND$2 = functionBindNative;
341
-
342
- var call$g = Function.prototype.call;
343
-
344
- var functionCall = NATIVE_BIND$2 ? call$g.bind(call$g) : function () {
345
- return call$g.apply(call$g, arguments);
346
- };
347
-
348
- var uncurryThis$h = functionUncurryThis;
349
-
350
- var objectIsPrototypeOf = uncurryThis$h({}.isPrototypeOf);
351
-
352
- var global$y = global$J;
353
- var getBuiltIn$5 = getBuiltIn$7;
354
- var isCallable$h = isCallable$k;
355
- var isPrototypeOf$4 = objectIsPrototypeOf;
356
- var USE_SYMBOL_AS_UID = useSymbolAsUid;
357
-
358
- var Object$3 = global$y.Object;
359
-
360
- var isSymbol$2 = USE_SYMBOL_AS_UID ? function (it) {
361
- return typeof it == 'symbol';
362
- } : function (it) {
363
- var $Symbol = getBuiltIn$5('Symbol');
364
- return isCallable$h($Symbol) && isPrototypeOf$4($Symbol.prototype, Object$3(it));
365
- };
366
-
367
- var global$x = global$J;
368
-
369
- var String$4 = global$x.String;
370
-
371
- var tryToString$4 = function (argument) {
372
- try {
373
- return String$4(argument);
374
- } catch (error) {
375
- return 'Object';
376
- }
377
- };
378
-
379
- var global$w = global$J;
380
- var isCallable$g = isCallable$k;
381
- var tryToString$3 = tryToString$4;
382
-
383
- var TypeError$e = global$w.TypeError;
384
-
385
- // `Assert: IsCallable(argument) is true`
386
- var aCallable$6 = function (argument) {
387
- if (isCallable$g(argument)) return argument;
388
- throw TypeError$e(tryToString$3(argument) + ' is not a function');
389
- };
390
-
391
- var aCallable$5 = aCallable$6;
392
-
393
- // `GetMethod` abstract operation
394
- // https://tc39.es/ecma262/#sec-getmethod
395
- var getMethod$7 = function (V, P) {
396
- var func = V[P];
397
- return func == null ? undefined : aCallable$5(func);
398
- };
399
-
400
- var global$v = global$J;
401
- var call$f = functionCall;
402
- var isCallable$f = isCallable$k;
403
- var isObject$5 = isObject$8;
404
-
405
- var TypeError$d = global$v.TypeError;
406
-
407
- // `OrdinaryToPrimitive` abstract operation
408
- // https://tc39.es/ecma262/#sec-ordinarytoprimitive
409
- var ordinaryToPrimitive$1 = function (input, pref) {
410
- var fn, val;
411
- if (pref === 'string' && isCallable$f(fn = input.toString) && !isObject$5(val = call$f(fn, input))) return val;
412
- if (isCallable$f(fn = input.valueOf) && !isObject$5(val = call$f(fn, input))) return val;
413
- if (pref !== 'string' && isCallable$f(fn = input.toString) && !isObject$5(val = call$f(fn, input))) return val;
414
- throw TypeError$d("Can't convert object to primitive value");
415
- };
416
-
417
- var global$u = global$J;
418
- var call$e = functionCall;
419
- var isObject$4 = isObject$8;
420
- var isSymbol$1 = isSymbol$2;
421
- var getMethod$6 = getMethod$7;
422
- var ordinaryToPrimitive = ordinaryToPrimitive$1;
423
- var wellKnownSymbol$g = wellKnownSymbol$h;
424
-
425
- var TypeError$c = global$u.TypeError;
426
- var TO_PRIMITIVE = wellKnownSymbol$g('toPrimitive');
427
-
428
- // `ToPrimitive` abstract operation
429
- // https://tc39.es/ecma262/#sec-toprimitive
430
- var toPrimitive$1 = function (input, pref) {
431
- if (!isObject$4(input) || isSymbol$1(input)) return input;
432
- var exoticToPrim = getMethod$6(input, TO_PRIMITIVE);
433
- var result;
434
- if (exoticToPrim) {
435
- if (pref === undefined) pref = 'default';
436
- result = call$e(exoticToPrim, input, pref);
437
- if (!isObject$4(result) || isSymbol$1(result)) return result;
438
- throw TypeError$c("Can't convert object to primitive value");
439
- }
440
- if (pref === undefined) pref = 'number';
441
- return ordinaryToPrimitive(input, pref);
442
- };
443
-
444
- var toPrimitive = toPrimitive$1;
445
- var isSymbol = isSymbol$2;
446
-
447
- // `ToPropertyKey` abstract operation
448
- // https://tc39.es/ecma262/#sec-topropertykey
449
- var toPropertyKey$3 = function (argument) {
450
- var key = toPrimitive(argument, 'string');
451
- return isSymbol(key) ? key : key + '';
452
- };
453
-
454
- var global$t = global$J;
455
- var DESCRIPTORS$8 = descriptors;
456
- var IE8_DOM_DEFINE$1 = ie8DomDefine;
457
- var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
458
- var anObject$g = anObject$h;
459
- var toPropertyKey$2 = toPropertyKey$3;
460
-
461
- var TypeError$b = global$t.TypeError;
462
- // eslint-disable-next-line es/no-object-defineproperty -- safe
463
- var $defineProperty = Object.defineProperty;
464
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
465
- var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
466
- var ENUMERABLE = 'enumerable';
467
- var CONFIGURABLE$1 = 'configurable';
468
- var WRITABLE = 'writable';
469
-
470
- // `Object.defineProperty` method
471
- // https://tc39.es/ecma262/#sec-object.defineproperty
472
- objectDefineProperty.f = DESCRIPTORS$8 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
473
- anObject$g(O);
474
- P = toPropertyKey$2(P);
475
- anObject$g(Attributes);
476
- if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
477
- var current = $getOwnPropertyDescriptor$1(O, P);
478
- if (current && current[WRITABLE]) {
479
- O[P] = Attributes.value;
480
- Attributes = {
481
- configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
482
- enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
483
- writable: false
484
- };
485
- }
486
- } return $defineProperty(O, P, Attributes);
487
- } : $defineProperty : function defineProperty(O, P, Attributes) {
488
- anObject$g(O);
489
- P = toPropertyKey$2(P);
490
- anObject$g(Attributes);
491
- if (IE8_DOM_DEFINE$1) try {
492
- return $defineProperty(O, P, Attributes);
493
- } catch (error) { /* empty */ }
494
- if ('get' in Attributes || 'set' in Attributes) throw TypeError$b('Accessors not supported');
495
- if ('value' in Attributes) O[P] = Attributes.value;
496
- return O;
497
- };
498
-
499
- var ceil = Math.ceil;
500
- var floor$1 = Math.floor;
501
-
502
- // `ToIntegerOrInfinity` abstract operation
503
- // https://tc39.es/ecma262/#sec-tointegerorinfinity
504
- var toIntegerOrInfinity$4 = function (argument) {
505
- var number = +argument;
506
- // eslint-disable-next-line no-self-compare -- safe
507
- return number !== number || number === 0 ? 0 : (number > 0 ? floor$1 : ceil)(number);
508
- };
509
-
510
- var toIntegerOrInfinity$3 = toIntegerOrInfinity$4;
511
-
512
- var max$2 = Math.max;
513
- var min$3 = Math.min;
514
-
515
- // Helper for a popular repeating case of the spec:
516
- // Let integer be ? ToInteger(index).
517
- // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
518
- var toAbsoluteIndex$2 = function (index, length) {
519
- var integer = toIntegerOrInfinity$3(index);
520
- return integer < 0 ? max$2(integer + length, 0) : min$3(integer, length);
521
- };
522
-
523
- var toIntegerOrInfinity$2 = toIntegerOrInfinity$4;
524
-
525
- var min$2 = Math.min;
526
-
527
- // `ToLength` abstract operation
528
- // https://tc39.es/ecma262/#sec-tolength
529
- var toLength$4 = function (argument) {
530
- return argument > 0 ? min$2(toIntegerOrInfinity$2(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
531
- };
532
-
533
- var toLength$3 = toLength$4;
534
-
535
- // `LengthOfArrayLike` abstract operation
536
- // https://tc39.es/ecma262/#sec-lengthofarraylike
537
- var lengthOfArrayLike$4 = function (obj) {
538
- return toLength$3(obj.length);
539
- };
540
-
541
- var toIndexedObject$4 = toIndexedObject$5;
542
- var toAbsoluteIndex$1 = toAbsoluteIndex$2;
543
- var lengthOfArrayLike$3 = lengthOfArrayLike$4;
544
-
545
- // `Array.prototype.{ indexOf, includes }` methods implementation
546
- var createMethod$2 = function (IS_INCLUDES) {
547
- return function ($this, el, fromIndex) {
548
- var O = toIndexedObject$4($this);
549
- var length = lengthOfArrayLike$3(O);
550
- var index = toAbsoluteIndex$1(fromIndex, length);
551
- var value;
552
- // Array#includes uses SameValueZero equality algorithm
553
- // eslint-disable-next-line no-self-compare -- NaN check
554
- if (IS_INCLUDES && el != el) while (length > index) {
555
- value = O[index++];
556
- // eslint-disable-next-line no-self-compare -- NaN check
557
- if (value != value) return true;
558
- // Array#indexOf ignores holes, Array#includes - not
559
- } else for (;length > index; index++) {
560
- if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
561
- } return !IS_INCLUDES && -1;
562
- };
563
- };
564
-
565
- var arrayIncludes = {
566
- // `Array.prototype.includes` method
567
- // https://tc39.es/ecma262/#sec-array.prototype.includes
568
- includes: createMethod$2(true),
569
- // `Array.prototype.indexOf` method
570
- // https://tc39.es/ecma262/#sec-array.prototype.indexof
571
- indexOf: createMethod$2(false)
572
- };
573
-
574
- var hiddenKeys$4 = {};
575
-
576
- var uncurryThis$g = functionUncurryThis;
577
- var hasOwn$9 = hasOwnProperty_1;
578
- var toIndexedObject$3 = toIndexedObject$5;
579
- var indexOf$1 = arrayIncludes.indexOf;
580
- var hiddenKeys$3 = hiddenKeys$4;
581
-
582
- var push$2 = uncurryThis$g([].push);
583
-
584
- var objectKeysInternal = function (object, names) {
585
- var O = toIndexedObject$3(object);
586
- var i = 0;
587
- var result = [];
588
- var key;
589
- for (key in O) !hasOwn$9(hiddenKeys$3, key) && hasOwn$9(O, key) && push$2(result, key);
590
- // Don't enum bug & hidden keys
591
- while (names.length > i) if (hasOwn$9(O, key = names[i++])) {
592
- ~indexOf$1(result, key) || push$2(result, key);
593
- }
594
- return result;
595
- };
596
-
597
- // IE8- don't enum bug keys
598
- var enumBugKeys$3 = [
599
- 'constructor',
600
- 'hasOwnProperty',
601
- 'isPrototypeOf',
602
- 'propertyIsEnumerable',
603
- 'toLocaleString',
604
- 'toString',
605
- 'valueOf'
606
- ];
607
-
608
- var internalObjectKeys$1 = objectKeysInternal;
609
- var enumBugKeys$2 = enumBugKeys$3;
610
-
611
- // `Object.keys` method
612
- // https://tc39.es/ecma262/#sec-object.keys
613
- // eslint-disable-next-line es/no-object-keys -- safe
614
- var objectKeys$2 = Object.keys || function keys(O) {
615
- return internalObjectKeys$1(O, enumBugKeys$2);
616
- };
617
-
618
- var DESCRIPTORS$7 = descriptors;
619
- var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
620
- var definePropertyModule$5 = objectDefineProperty;
621
- var anObject$f = anObject$h;
622
- var toIndexedObject$2 = toIndexedObject$5;
623
- var objectKeys$1 = objectKeys$2;
624
-
625
- // `Object.defineProperties` method
626
- // https://tc39.es/ecma262/#sec-object.defineproperties
627
- // eslint-disable-next-line es/no-object-defineproperties -- safe
628
- objectDefineProperties.f = DESCRIPTORS$7 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
629
- anObject$f(O);
630
- var props = toIndexedObject$2(Properties);
631
- var keys = objectKeys$1(Properties);
632
- var length = keys.length;
633
- var index = 0;
634
- var key;
635
- while (length > index) definePropertyModule$5.f(O, key = keys[index++], props[key]);
636
- return O;
637
- };
638
-
639
- var getBuiltIn$4 = getBuiltIn$7;
640
-
641
- var html$2 = getBuiltIn$4('document', 'documentElement');
642
-
643
- var shared$2 = shared$4.exports;
644
- var uid = uid$2;
645
-
646
- var keys = shared$2('keys');
647
-
648
- var sharedKey$3 = function (key) {
649
- return keys[key] || (keys[key] = uid(key));
650
- };
651
-
652
- /* global ActiveXObject -- old IE, WSH */
653
-
654
- var anObject$e = anObject$h;
655
- var definePropertiesModule = objectDefineProperties;
656
- var enumBugKeys$1 = enumBugKeys$3;
657
- var hiddenKeys$2 = hiddenKeys$4;
658
- var html$1 = html$2;
659
- var documentCreateElement$1 = documentCreateElement$2;
660
- var sharedKey$2 = sharedKey$3;
661
-
662
- var GT = '>';
663
- var LT = '<';
664
- var PROTOTYPE = 'prototype';
665
- var SCRIPT = 'script';
666
- var IE_PROTO$1 = sharedKey$2('IE_PROTO');
667
-
668
- var EmptyConstructor = function () { /* empty */ };
669
-
670
- var scriptTag = function (content) {
671
- return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
672
- };
673
-
674
- // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
675
- var NullProtoObjectViaActiveX = function (activeXDocument) {
676
- activeXDocument.write(scriptTag(''));
677
- activeXDocument.close();
678
- var temp = activeXDocument.parentWindow.Object;
679
- activeXDocument = null; // avoid memory leak
680
- return temp;
681
- };
682
-
683
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
684
- var NullProtoObjectViaIFrame = function () {
685
- // Thrash, waste and sodomy: IE GC bug
686
- var iframe = documentCreateElement$1('iframe');
687
- var JS = 'java' + SCRIPT + ':';
688
- var iframeDocument;
689
- iframe.style.display = 'none';
690
- html$1.appendChild(iframe);
691
- // https://github.com/zloirock/core-js/issues/475
692
- iframe.src = String(JS);
693
- iframeDocument = iframe.contentWindow.document;
694
- iframeDocument.open();
695
- iframeDocument.write(scriptTag('document.F=Object'));
696
- iframeDocument.close();
697
- return iframeDocument.F;
698
- };
699
-
700
- // Check for document.domain and active x support
701
- // No need to use active x approach when document.domain is not set
702
- // see https://github.com/es-shims/es5-shim/issues/150
703
- // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
704
- // avoid IE GC bug
705
- var activeXDocument;
706
- var NullProtoObject = function () {
707
- try {
708
- activeXDocument = new ActiveXObject('htmlfile');
709
- } catch (error) { /* ignore */ }
710
- NullProtoObject = typeof document != 'undefined'
711
- ? document.domain && activeXDocument
712
- ? NullProtoObjectViaActiveX(activeXDocument) // old IE
713
- : NullProtoObjectViaIFrame()
714
- : NullProtoObjectViaActiveX(activeXDocument); // WSH
715
- var length = enumBugKeys$1.length;
716
- while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys$1[length]];
717
- return NullProtoObject();
718
- };
719
-
720
- hiddenKeys$2[IE_PROTO$1] = true;
721
-
722
- // `Object.create` method
723
- // https://tc39.es/ecma262/#sec-object.create
724
- var objectCreate = Object.create || function create(O, Properties) {
725
- var result;
726
- if (O !== null) {
727
- EmptyConstructor[PROTOTYPE] = anObject$e(O);
728
- result = new EmptyConstructor();
729
- EmptyConstructor[PROTOTYPE] = null;
730
- // add "__proto__" for Object.getPrototypeOf polyfill
731
- result[IE_PROTO$1] = O;
732
- } else result = NullProtoObject();
733
- return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
734
- };
735
-
736
- var wellKnownSymbol$f = wellKnownSymbol$h;
737
- var create$2 = objectCreate;
738
- var definePropertyModule$4 = objectDefineProperty;
739
-
740
- var UNSCOPABLES = wellKnownSymbol$f('unscopables');
741
- var ArrayPrototype$1 = Array.prototype;
742
-
743
- // Array.prototype[@@unscopables]
744
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
745
- if (ArrayPrototype$1[UNSCOPABLES] == undefined) {
746
- definePropertyModule$4.f(ArrayPrototype$1, UNSCOPABLES, {
747
- configurable: true,
748
- value: create$2(null)
749
- });
750
- }
751
-
752
- // add a key to Array.prototype[@@unscopables]
753
- var addToUnscopables$1 = function (key) {
754
- ArrayPrototype$1[UNSCOPABLES][key] = true;
755
- };
756
-
757
- var iterators = {};
758
-
759
- var uncurryThis$f = functionUncurryThis;
760
- var isCallable$e = isCallable$k;
761
- var store$1 = sharedStore;
762
-
763
- var functionToString = uncurryThis$f(Function.toString);
764
-
765
- // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
766
- if (!isCallable$e(store$1.inspectSource)) {
767
- store$1.inspectSource = function (it) {
768
- return functionToString(it);
769
- };
770
- }
771
-
772
- var inspectSource$4 = store$1.inspectSource;
773
-
774
- var global$s = global$J;
775
- var isCallable$d = isCallable$k;
776
- var inspectSource$3 = inspectSource$4;
777
-
778
- var WeakMap$1 = global$s.WeakMap;
779
-
780
- var nativeWeakMap = isCallable$d(WeakMap$1) && /native code/.test(inspectSource$3(WeakMap$1));
781
-
782
- var createPropertyDescriptor$4 = function (bitmap, value) {
783
- return {
784
- enumerable: !(bitmap & 1),
785
- configurable: !(bitmap & 2),
786
- writable: !(bitmap & 4),
787
- value: value
788
- };
789
- };
790
-
791
- var DESCRIPTORS$6 = descriptors;
792
- var definePropertyModule$3 = objectDefineProperty;
793
- var createPropertyDescriptor$3 = createPropertyDescriptor$4;
794
-
795
- var createNonEnumerableProperty$6 = DESCRIPTORS$6 ? function (object, key, value) {
796
- return definePropertyModule$3.f(object, key, createPropertyDescriptor$3(1, value));
797
- } : function (object, key, value) {
798
- object[key] = value;
799
- return object;
800
- };
801
-
802
- var NATIVE_WEAK_MAP = nativeWeakMap;
803
- var global$r = global$J;
804
- var uncurryThis$e = functionUncurryThis;
805
- var isObject$3 = isObject$8;
806
- var createNonEnumerableProperty$5 = createNonEnumerableProperty$6;
807
- var hasOwn$8 = hasOwnProperty_1;
808
- var shared$1 = sharedStore;
809
- var sharedKey$1 = sharedKey$3;
810
- var hiddenKeys$1 = hiddenKeys$4;
811
-
812
- var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
813
- var TypeError$a = global$r.TypeError;
814
- var WeakMap = global$r.WeakMap;
815
- var set$1, get, has;
816
-
817
- var enforce = function (it) {
818
- return has(it) ? get(it) : set$1(it, {});
819
- };
820
-
821
- var getterFor = function (TYPE) {
822
- return function (it) {
823
- var state;
824
- if (!isObject$3(it) || (state = get(it)).type !== TYPE) {
825
- throw TypeError$a('Incompatible receiver, ' + TYPE + ' required');
826
- } return state;
827
- };
828
- };
829
-
830
- if (NATIVE_WEAK_MAP || shared$1.state) {
831
- var store = shared$1.state || (shared$1.state = new WeakMap());
832
- var wmget = uncurryThis$e(store.get);
833
- var wmhas = uncurryThis$e(store.has);
834
- var wmset = uncurryThis$e(store.set);
835
- set$1 = function (it, metadata) {
836
- if (wmhas(store, it)) throw new TypeError$a(OBJECT_ALREADY_INITIALIZED);
837
- metadata.facade = it;
838
- wmset(store, it, metadata);
839
- return metadata;
840
- };
841
- get = function (it) {
842
- return wmget(store, it) || {};
843
- };
844
- has = function (it) {
845
- return wmhas(store, it);
846
- };
847
- } else {
848
- var STATE = sharedKey$1('state');
849
- hiddenKeys$1[STATE] = true;
850
- set$1 = function (it, metadata) {
851
- if (hasOwn$8(it, STATE)) throw new TypeError$a(OBJECT_ALREADY_INITIALIZED);
852
- metadata.facade = it;
853
- createNonEnumerableProperty$5(it, STATE, metadata);
854
- return metadata;
855
- };
856
- get = function (it) {
857
- return hasOwn$8(it, STATE) ? it[STATE] : {};
858
- };
859
- has = function (it) {
860
- return hasOwn$8(it, STATE);
861
- };
862
- }
863
-
864
- var internalState = {
865
- set: set$1,
866
- get: get,
867
- has: has,
868
- enforce: enforce,
869
- getterFor: getterFor
870
- };
871
-
872
- var objectGetOwnPropertyDescriptor = {};
873
-
874
- var objectPropertyIsEnumerable = {};
875
-
876
- var $propertyIsEnumerable = {}.propertyIsEnumerable;
877
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
878
- var getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
879
-
880
- // Nashorn ~ JDK8 bug
881
- var NASHORN_BUG = getOwnPropertyDescriptor$2 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
882
-
883
- // `Object.prototype.propertyIsEnumerable` method implementation
884
- // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
885
- objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
886
- var descriptor = getOwnPropertyDescriptor$2(this, V);
887
- return !!descriptor && descriptor.enumerable;
888
- } : $propertyIsEnumerable;
889
-
890
- var DESCRIPTORS$5 = descriptors;
891
- var call$d = functionCall;
892
- var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
893
- var createPropertyDescriptor$2 = createPropertyDescriptor$4;
894
- var toIndexedObject$1 = toIndexedObject$5;
895
- var toPropertyKey$1 = toPropertyKey$3;
896
- var hasOwn$7 = hasOwnProperty_1;
897
- var IE8_DOM_DEFINE = ie8DomDefine;
898
-
899
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
900
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
901
-
902
- // `Object.getOwnPropertyDescriptor` method
903
- // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
904
- objectGetOwnPropertyDescriptor.f = DESCRIPTORS$5 ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
905
- O = toIndexedObject$1(O);
906
- P = toPropertyKey$1(P);
907
- if (IE8_DOM_DEFINE) try {
908
- return $getOwnPropertyDescriptor(O, P);
909
- } catch (error) { /* empty */ }
910
- if (hasOwn$7(O, P)) return createPropertyDescriptor$2(!call$d(propertyIsEnumerableModule$1.f, O, P), O[P]);
911
- };
912
-
913
- var redefine$7 = {exports: {}};
914
-
915
- var DESCRIPTORS$4 = descriptors;
916
- var hasOwn$6 = hasOwnProperty_1;
917
-
918
- var FunctionPrototype$1 = Function.prototype;
919
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
920
- var getDescriptor = DESCRIPTORS$4 && Object.getOwnPropertyDescriptor;
921
-
922
- var EXISTS = hasOwn$6(FunctionPrototype$1, 'name');
923
- // additional protection from minified / mangled / dropped function names
924
- var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
925
- var CONFIGURABLE = EXISTS && (!DESCRIPTORS$4 || (DESCRIPTORS$4 && getDescriptor(FunctionPrototype$1, 'name').configurable));
926
-
927
- var functionName = {
928
- EXISTS: EXISTS,
929
- PROPER: PROPER,
930
- CONFIGURABLE: CONFIGURABLE
931
- };
932
-
933
- var global$q = global$J;
934
- var isCallable$c = isCallable$k;
935
- var hasOwn$5 = hasOwnProperty_1;
936
- var createNonEnumerableProperty$4 = createNonEnumerableProperty$6;
937
- var setGlobal$1 = setGlobal$3;
938
- var inspectSource$2 = inspectSource$4;
939
- var InternalStateModule$2 = internalState;
940
- var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
941
-
942
- var getInternalState$3 = InternalStateModule$2.get;
943
- var enforceInternalState = InternalStateModule$2.enforce;
944
- var TEMPLATE = String(String).split('String');
945
-
946
- (redefine$7.exports = function (O, key, value, options) {
947
- var unsafe = options ? !!options.unsafe : false;
948
- var simple = options ? !!options.enumerable : false;
949
- var noTargetGet = options ? !!options.noTargetGet : false;
950
- var name = options && options.name !== undefined ? options.name : key;
951
- var state;
952
- if (isCallable$c(value)) {
953
- if (String(name).slice(0, 7) === 'Symbol(') {
954
- name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
955
- }
956
- if (!hasOwn$5(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
957
- createNonEnumerableProperty$4(value, 'name', name);
958
- }
959
- state = enforceInternalState(value);
960
- if (!state.source) {
961
- state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
962
- }
963
- }
964
- if (O === global$q) {
965
- if (simple) O[key] = value;
966
- else setGlobal$1(key, value);
967
- return;
968
- } else if (!unsafe) {
969
- delete O[key];
970
- } else if (!noTargetGet && O[key]) {
971
- simple = true;
972
- }
973
- if (simple) O[key] = value;
974
- else createNonEnumerableProperty$4(O, key, value);
975
- // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
976
- })(Function.prototype, 'toString', function toString() {
977
- return isCallable$c(this) && getInternalState$3(this).source || inspectSource$2(this);
978
- });
979
-
980
- var objectGetOwnPropertyNames = {};
981
-
982
- var internalObjectKeys = objectKeysInternal;
983
- var enumBugKeys = enumBugKeys$3;
984
-
985
- var hiddenKeys = enumBugKeys.concat('length', 'prototype');
986
-
987
- // `Object.getOwnPropertyNames` method
988
- // https://tc39.es/ecma262/#sec-object.getownpropertynames
989
- // eslint-disable-next-line es/no-object-getownpropertynames -- safe
990
- objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
991
- return internalObjectKeys(O, hiddenKeys);
992
- };
993
-
994
- var objectGetOwnPropertySymbols = {};
995
-
996
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
997
- objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
998
-
999
- var getBuiltIn$3 = getBuiltIn$7;
1000
- var uncurryThis$d = functionUncurryThis;
1001
- var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
1002
- var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
1003
- var anObject$d = anObject$h;
1004
-
1005
- var concat$2 = uncurryThis$d([].concat);
1006
-
1007
- // all object keys, includes non-enumerable and symbols
1008
- var ownKeys$1 = getBuiltIn$3('Reflect', 'ownKeys') || function ownKeys(it) {
1009
- var keys = getOwnPropertyNamesModule.f(anObject$d(it));
1010
- var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
1011
- return getOwnPropertySymbols ? concat$2(keys, getOwnPropertySymbols(it)) : keys;
1012
- };
1013
-
1014
- var hasOwn$4 = hasOwnProperty_1;
1015
- var ownKeys = ownKeys$1;
1016
- var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
1017
- var definePropertyModule$2 = objectDefineProperty;
1018
-
1019
- var copyConstructorProperties$2 = function (target, source, exceptions) {
1020
- var keys = ownKeys(source);
1021
- var defineProperty = definePropertyModule$2.f;
1022
- var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
1023
- for (var i = 0; i < keys.length; i++) {
1024
- var key = keys[i];
1025
- if (!hasOwn$4(target, key) && !(exceptions && hasOwn$4(exceptions, key))) {
1026
- defineProperty(target, key, getOwnPropertyDescriptor(source, key));
1027
- }
1028
- }
1029
- };
1030
-
1031
- var fails$d = fails$k;
1032
- var isCallable$b = isCallable$k;
1033
-
1034
- var replacement = /#|\.prototype\./;
1035
-
1036
- var isForced$2 = function (feature, detection) {
1037
- var value = data[normalize(feature)];
1038
- return value == POLYFILL ? true
1039
- : value == NATIVE ? false
1040
- : isCallable$b(detection) ? fails$d(detection)
1041
- : !!detection;
1042
- };
1043
-
1044
- var normalize = isForced$2.normalize = function (string) {
1045
- return String(string).replace(replacement, '.').toLowerCase();
1046
- };
1047
-
1048
- var data = isForced$2.data = {};
1049
- var NATIVE = isForced$2.NATIVE = 'N';
1050
- var POLYFILL = isForced$2.POLYFILL = 'P';
1051
-
1052
- var isForced_1 = isForced$2;
1053
-
1054
- var global$p = global$J;
1055
- var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
1056
- var createNonEnumerableProperty$3 = createNonEnumerableProperty$6;
1057
- var redefine$6 = redefine$7.exports;
1058
- var setGlobal = setGlobal$3;
1059
- var copyConstructorProperties$1 = copyConstructorProperties$2;
1060
- var isForced$1 = isForced_1;
1061
-
1062
- /*
1063
- options.target - name of the target object
1064
- options.global - target is the global object
1065
- options.stat - export as static methods of target
1066
- options.proto - export as prototype methods of target
1067
- options.real - real prototype method for the `pure` version
1068
- options.forced - export even if the native feature is available
1069
- options.bind - bind methods to the target, required for the `pure` version
1070
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
1071
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
1072
- options.sham - add a flag to not completely full polyfills
1073
- options.enumerable - export as enumerable property
1074
- options.noTargetGet - prevent calling a getter on target
1075
- options.name - the .name of the function if it does not match the key
1076
- */
1077
- var _export = function (options, source) {
1078
- var TARGET = options.target;
1079
- var GLOBAL = options.global;
1080
- var STATIC = options.stat;
1081
- var FORCED, target, key, targetProperty, sourceProperty, descriptor;
1082
- if (GLOBAL) {
1083
- target = global$p;
1084
- } else if (STATIC) {
1085
- target = global$p[TARGET] || setGlobal(TARGET, {});
1086
- } else {
1087
- target = (global$p[TARGET] || {}).prototype;
1088
- }
1089
- if (target) for (key in source) {
1090
- sourceProperty = source[key];
1091
- if (options.noTargetGet) {
1092
- descriptor = getOwnPropertyDescriptor$1(target, key);
1093
- targetProperty = descriptor && descriptor.value;
1094
- } else targetProperty = target[key];
1095
- FORCED = isForced$1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
1096
- // contained in target
1097
- if (!FORCED && targetProperty !== undefined) {
1098
- if (typeof sourceProperty == typeof targetProperty) continue;
1099
- copyConstructorProperties$1(sourceProperty, targetProperty);
1100
- }
1101
- // add a flag to not completely full polyfills
1102
- if (options.sham || (targetProperty && targetProperty.sham)) {
1103
- createNonEnumerableProperty$3(sourceProperty, 'sham', true);
1104
- }
1105
- // extend global
1106
- redefine$6(target, key, sourceProperty, options);
1107
- }
1108
- };
1109
-
1110
- var fails$c = fails$k;
1111
-
1112
- var correctPrototypeGetter = !fails$c(function () {
1113
- function F() { /* empty */ }
1114
- F.prototype.constructor = null;
1115
- // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
1116
- return Object.getPrototypeOf(new F()) !== F.prototype;
1117
- });
1118
-
1119
- var global$o = global$J;
1120
- var hasOwn$3 = hasOwnProperty_1;
1121
- var isCallable$a = isCallable$k;
1122
- var toObject$3 = toObject$5;
1123
- var sharedKey = sharedKey$3;
1124
- var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
1125
-
1126
- var IE_PROTO = sharedKey('IE_PROTO');
1127
- var Object$2 = global$o.Object;
1128
- var ObjectPrototype = Object$2.prototype;
1129
-
1130
- // `Object.getPrototypeOf` method
1131
- // https://tc39.es/ecma262/#sec-object.getprototypeof
1132
- var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? Object$2.getPrototypeOf : function (O) {
1133
- var object = toObject$3(O);
1134
- if (hasOwn$3(object, IE_PROTO)) return object[IE_PROTO];
1135
- var constructor = object.constructor;
1136
- if (isCallable$a(constructor) && object instanceof constructor) {
1137
- return constructor.prototype;
1138
- } return object instanceof Object$2 ? ObjectPrototype : null;
1139
- };
1140
-
1141
- var fails$b = fails$k;
1142
- var isCallable$9 = isCallable$k;
1143
- var getPrototypeOf$1 = objectGetPrototypeOf;
1144
- var redefine$5 = redefine$7.exports;
1145
- var wellKnownSymbol$e = wellKnownSymbol$h;
1146
-
1147
- var ITERATOR$5 = wellKnownSymbol$e('iterator');
1148
- var BUGGY_SAFARI_ITERATORS$1 = false;
1149
-
1150
- // `%IteratorPrototype%` object
1151
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
1152
- var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
1153
-
1154
- /* eslint-disable es/no-array-prototype-keys -- safe */
1155
- if ([].keys) {
1156
- arrayIterator = [].keys();
1157
- // Safari 8 has buggy iterators w/o `next`
1158
- if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
1159
- else {
1160
- PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
1161
- if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
1162
- }
1163
- }
1164
-
1165
- var NEW_ITERATOR_PROTOTYPE = IteratorPrototype$2 == undefined || fails$b(function () {
1166
- var test = {};
1167
- // FF44- legacy iterators case
1168
- return IteratorPrototype$2[ITERATOR$5].call(test) !== test;
1169
- });
1170
-
1171
- if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
1172
-
1173
- // `%IteratorPrototype%[@@iterator]()` method
1174
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1175
- if (!isCallable$9(IteratorPrototype$2[ITERATOR$5])) {
1176
- redefine$5(IteratorPrototype$2, ITERATOR$5, function () {
1177
- return this;
1178
- });
1179
- }
1180
-
1181
- var iteratorsCore = {
1182
- IteratorPrototype: IteratorPrototype$2,
1183
- BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
1184
- };
1185
-
1186
- var defineProperty$3 = objectDefineProperty.f;
1187
- var hasOwn$2 = hasOwnProperty_1;
1188
- var wellKnownSymbol$d = wellKnownSymbol$h;
1189
-
1190
- var TO_STRING_TAG$3 = wellKnownSymbol$d('toStringTag');
1191
-
1192
- var setToStringTag$3 = function (target, TAG, STATIC) {
1193
- if (target && !STATIC) target = target.prototype;
1194
- if (target && !hasOwn$2(target, TO_STRING_TAG$3)) {
1195
- defineProperty$3(target, TO_STRING_TAG$3, { configurable: true, value: TAG });
1196
- }
1197
- };
1198
-
1199
- var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
1200
- var create$1 = objectCreate;
1201
- var createPropertyDescriptor$1 = createPropertyDescriptor$4;
1202
- var setToStringTag$2 = setToStringTag$3;
1203
- var Iterators$4 = iterators;
1204
-
1205
- var returnThis$1 = function () { return this; };
1206
-
1207
- var createIteratorConstructor$1 = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
1208
- var TO_STRING_TAG = NAME + ' Iterator';
1209
- IteratorConstructor.prototype = create$1(IteratorPrototype$1, { next: createPropertyDescriptor$1(+!ENUMERABLE_NEXT, next) });
1210
- setToStringTag$2(IteratorConstructor, TO_STRING_TAG, false);
1211
- Iterators$4[TO_STRING_TAG] = returnThis$1;
1212
- return IteratorConstructor;
1213
- };
1214
-
1215
- var global$n = global$J;
1216
- var isCallable$8 = isCallable$k;
1217
-
1218
- var String$3 = global$n.String;
1219
- var TypeError$9 = global$n.TypeError;
1220
-
1221
- var aPossiblePrototype$1 = function (argument) {
1222
- if (typeof argument == 'object' || isCallable$8(argument)) return argument;
1223
- throw TypeError$9("Can't set " + String$3(argument) + ' as a prototype');
1224
- };
1225
-
1226
- /* eslint-disable no-proto -- safe */
1227
-
1228
- var uncurryThis$c = functionUncurryThis;
1229
- var anObject$c = anObject$h;
1230
- var aPossiblePrototype = aPossiblePrototype$1;
1231
-
1232
- // `Object.setPrototypeOf` method
1233
- // https://tc39.es/ecma262/#sec-object.setprototypeof
1234
- // Works with __proto__ only. Old v8 can't work with null proto objects.
1235
- // eslint-disable-next-line es/no-object-setprototypeof -- safe
1236
- var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
1237
- var CORRECT_SETTER = false;
1238
- var test = {};
1239
- var setter;
1240
- try {
1241
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1242
- setter = uncurryThis$c(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1243
- setter(test, []);
1244
- CORRECT_SETTER = test instanceof Array;
1245
- } catch (error) { /* empty */ }
1246
- return function setPrototypeOf(O, proto) {
1247
- anObject$c(O);
1248
- aPossiblePrototype(proto);
1249
- if (CORRECT_SETTER) setter(O, proto);
1250
- else O.__proto__ = proto;
1251
- return O;
1252
- };
1253
- }() : undefined);
1254
-
1255
- var $$5 = _export;
1256
- var call$c = functionCall;
1257
- var FunctionName = functionName;
1258
- var isCallable$7 = isCallable$k;
1259
- var createIteratorConstructor = createIteratorConstructor$1;
1260
- var getPrototypeOf = objectGetPrototypeOf;
1261
- var setPrototypeOf$1 = objectSetPrototypeOf;
1262
- var setToStringTag$1 = setToStringTag$3;
1263
- var createNonEnumerableProperty$2 = createNonEnumerableProperty$6;
1264
- var redefine$4 = redefine$7.exports;
1265
- var wellKnownSymbol$c = wellKnownSymbol$h;
1266
- var Iterators$3 = iterators;
1267
- var IteratorsCore = iteratorsCore;
1268
-
1269
- var PROPER_FUNCTION_NAME$1 = FunctionName.PROPER;
1270
- var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
1271
- var IteratorPrototype = IteratorsCore.IteratorPrototype;
1272
- var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
1273
- var ITERATOR$4 = wellKnownSymbol$c('iterator');
1274
- var KEYS = 'keys';
1275
- var VALUES = 'values';
1276
- var ENTRIES = 'entries';
1277
-
1278
- var returnThis = function () { return this; };
1279
-
1280
- var defineIterator$1 = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
1281
- createIteratorConstructor(IteratorConstructor, NAME, next);
1282
-
1283
- var getIterationMethod = function (KIND) {
1284
- if (KIND === DEFAULT && defaultIterator) return defaultIterator;
1285
- if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
1286
- switch (KIND) {
1287
- case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
1288
- case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
1289
- case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
1290
- } return function () { return new IteratorConstructor(this); };
1291
- };
1292
-
1293
- var TO_STRING_TAG = NAME + ' Iterator';
1294
- var INCORRECT_VALUES_NAME = false;
1295
- var IterablePrototype = Iterable.prototype;
1296
- var nativeIterator = IterablePrototype[ITERATOR$4]
1297
- || IterablePrototype['@@iterator']
1298
- || DEFAULT && IterablePrototype[DEFAULT];
1299
- var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
1300
- var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
1301
- var CurrentIteratorPrototype, methods, KEY;
1302
-
1303
- // fix native
1304
- if (anyNativeIterator) {
1305
- CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
1306
- if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
1307
- if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
1308
- if (setPrototypeOf$1) {
1309
- setPrototypeOf$1(CurrentIteratorPrototype, IteratorPrototype);
1310
- } else if (!isCallable$7(CurrentIteratorPrototype[ITERATOR$4])) {
1311
- redefine$4(CurrentIteratorPrototype, ITERATOR$4, returnThis);
1312
- }
1313
- }
1314
- // Set @@toStringTag to native iterators
1315
- setToStringTag$1(CurrentIteratorPrototype, TO_STRING_TAG, true);
1316
- }
1317
- }
1318
-
1319
- // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
1320
- if (PROPER_FUNCTION_NAME$1 && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
1321
- if (CONFIGURABLE_FUNCTION_NAME) {
1322
- createNonEnumerableProperty$2(IterablePrototype, 'name', VALUES);
1323
- } else {
1324
- INCORRECT_VALUES_NAME = true;
1325
- defaultIterator = function values() { return call$c(nativeIterator, this); };
1326
- }
1327
- }
1328
-
1329
- // export additional methods
1330
- if (DEFAULT) {
1331
- methods = {
1332
- values: getIterationMethod(VALUES),
1333
- keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
1334
- entries: getIterationMethod(ENTRIES)
1335
- };
1336
- if (FORCED) for (KEY in methods) {
1337
- if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1338
- redefine$4(IterablePrototype, KEY, methods[KEY]);
1339
- }
1340
- } else $$5({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1341
- }
1342
-
1343
- // define iterator
1344
- if (IterablePrototype[ITERATOR$4] !== defaultIterator) {
1345
- redefine$4(IterablePrototype, ITERATOR$4, defaultIterator, { name: DEFAULT });
1346
- }
1347
- Iterators$3[NAME] = defaultIterator;
1348
-
1349
- return methods;
1350
- };
1351
-
1352
- var toIndexedObject = toIndexedObject$5;
1353
- var addToUnscopables = addToUnscopables$1;
1354
- var Iterators$2 = iterators;
1355
- var InternalStateModule$1 = internalState;
1356
- var defineProperty$2 = objectDefineProperty.f;
1357
- var defineIterator = defineIterator$1;
1358
- var DESCRIPTORS$3 = descriptors;
1359
-
1360
- var ARRAY_ITERATOR = 'Array Iterator';
1361
- var setInternalState$1 = InternalStateModule$1.set;
1362
- var getInternalState$2 = InternalStateModule$1.getterFor(ARRAY_ITERATOR);
1363
-
1364
- // `Array.prototype.entries` method
1365
- // https://tc39.es/ecma262/#sec-array.prototype.entries
1366
- // `Array.prototype.keys` method
1367
- // https://tc39.es/ecma262/#sec-array.prototype.keys
1368
- // `Array.prototype.values` method
1369
- // https://tc39.es/ecma262/#sec-array.prototype.values
1370
- // `Array.prototype[@@iterator]` method
1371
- // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
1372
- // `CreateArrayIterator` internal method
1373
- // https://tc39.es/ecma262/#sec-createarrayiterator
1374
- var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
1375
- setInternalState$1(this, {
1376
- type: ARRAY_ITERATOR,
1377
- target: toIndexedObject(iterated), // target
1378
- index: 0, // next index
1379
- kind: kind // kind
1380
- });
1381
- // `%ArrayIteratorPrototype%.next` method
1382
- // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
1383
- }, function () {
1384
- var state = getInternalState$2(this);
1385
- var target = state.target;
1386
- var kind = state.kind;
1387
- var index = state.index++;
1388
- if (!target || index >= target.length) {
1389
- state.target = undefined;
1390
- return { value: undefined, done: true };
1391
- }
1392
- if (kind == 'keys') return { value: index, done: false };
1393
- if (kind == 'values') return { value: target[index], done: false };
1394
- return { value: [index, target[index]], done: false };
1395
- }, 'values');
1396
-
1397
- // argumentsList[@@iterator] is %ArrayProto_values%
1398
- // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
1399
- // https://tc39.es/ecma262/#sec-createmappedargumentsobject
1400
- var values = Iterators$2.Arguments = Iterators$2.Array;
1401
-
1402
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1403
- addToUnscopables('keys');
1404
- addToUnscopables('values');
1405
- addToUnscopables('entries');
1406
-
1407
- // V8 ~ Chrome 45- bug
1408
- if (DESCRIPTORS$3 && values.name !== 'values') try {
1409
- defineProperty$2(values, 'name', { value: 'values' });
1410
- } catch (error) { /* empty */ }
1411
-
1412
- // iterable DOM collections
1413
- // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
1414
- var domIterables = {
1415
- CSSRuleList: 0,
1416
- CSSStyleDeclaration: 0,
1417
- CSSValueList: 0,
1418
- ClientRectList: 0,
1419
- DOMRectList: 0,
1420
- DOMStringList: 0,
1421
- DOMTokenList: 1,
1422
- DataTransferItemList: 0,
1423
- FileList: 0,
1424
- HTMLAllCollection: 0,
1425
- HTMLCollection: 0,
1426
- HTMLFormElement: 0,
1427
- HTMLSelectElement: 0,
1428
- MediaList: 0,
1429
- MimeTypeArray: 0,
1430
- NamedNodeMap: 0,
1431
- NodeList: 1,
1432
- PaintRequestList: 0,
1433
- Plugin: 0,
1434
- PluginArray: 0,
1435
- SVGLengthList: 0,
1436
- SVGNumberList: 0,
1437
- SVGPathSegList: 0,
1438
- SVGPointList: 0,
1439
- SVGStringList: 0,
1440
- SVGTransformList: 0,
1441
- SourceBufferList: 0,
1442
- StyleSheetList: 0,
1443
- TextTrackCueList: 0,
1444
- TextTrackList: 0,
1445
- TouchList: 0
1446
- };
1447
-
1448
- // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
1449
- var documentCreateElement = documentCreateElement$2;
1450
-
1451
- var classList = documentCreateElement('span').classList;
1452
- var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
1453
-
1454
- var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
1455
-
1456
- var global$m = global$J;
1457
- var DOMIterables = domIterables;
1458
- var DOMTokenListPrototype = domTokenListPrototype;
1459
- var ArrayIteratorMethods = es_array_iterator;
1460
- var createNonEnumerableProperty$1 = createNonEnumerableProperty$6;
1461
- var wellKnownSymbol$b = wellKnownSymbol$h;
1462
-
1463
- var ITERATOR$3 = wellKnownSymbol$b('iterator');
1464
- var TO_STRING_TAG$2 = wellKnownSymbol$b('toStringTag');
1465
- var ArrayValues = ArrayIteratorMethods.values;
1466
-
1467
- var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
1468
- if (CollectionPrototype) {
1469
- // some Chrome versions have non-configurable methods on DOMTokenList
1470
- if (CollectionPrototype[ITERATOR$3] !== ArrayValues) try {
1471
- createNonEnumerableProperty$1(CollectionPrototype, ITERATOR$3, ArrayValues);
1472
- } catch (error) {
1473
- CollectionPrototype[ITERATOR$3] = ArrayValues;
1474
- }
1475
- if (!CollectionPrototype[TO_STRING_TAG$2]) {
1476
- createNonEnumerableProperty$1(CollectionPrototype, TO_STRING_TAG$2, COLLECTION_NAME);
1477
- }
1478
- if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
1479
- // some Chrome versions have non-configurable methods on DOMTokenList
1480
- if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
1481
- createNonEnumerableProperty$1(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
1482
- } catch (error) {
1483
- CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
1484
- }
1485
- }
1486
- }
1487
- };
1488
-
1489
- for (var COLLECTION_NAME in DOMIterables) {
1490
- handlePrototype(global$m[COLLECTION_NAME] && global$m[COLLECTION_NAME].prototype, COLLECTION_NAME);
1491
- }
1492
-
1493
- handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
1494
-
1495
- var DESCRIPTORS$2 = descriptors;
1496
- var uncurryThis$b = functionUncurryThis;
1497
- var call$b = functionCall;
1498
- var fails$a = fails$k;
1499
- var objectKeys = objectKeys$2;
1500
- var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1501
- var propertyIsEnumerableModule = objectPropertyIsEnumerable;
1502
- var toObject$2 = toObject$5;
1503
- var IndexedObject$1 = indexedObject;
1504
-
1505
- // eslint-disable-next-line es/no-object-assign -- safe
1506
- var $assign = Object.assign;
1507
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1508
- var defineProperty$1 = Object.defineProperty;
1509
- var concat$1 = uncurryThis$b([].concat);
1510
-
1511
- // `Object.assign` method
1512
- // https://tc39.es/ecma262/#sec-object.assign
1513
- var objectAssign = !$assign || fails$a(function () {
1514
- // should have correct order of operations (Edge bug)
1515
- if (DESCRIPTORS$2 && $assign({ b: 1 }, $assign(defineProperty$1({}, 'a', {
1516
- enumerable: true,
1517
- get: function () {
1518
- defineProperty$1(this, 'b', {
1519
- value: 3,
1520
- enumerable: false
1521
- });
1522
- }
1523
- }), { b: 2 })).b !== 1) return true;
1524
- // should work with symbols and should have deterministic property order (V8 bug)
1525
- var A = {};
1526
- var B = {};
1527
- // eslint-disable-next-line es/no-symbol -- safe
1528
- var symbol = Symbol();
1529
- var alphabet = 'abcdefghijklmnopqrst';
1530
- A[symbol] = 7;
1531
- alphabet.split('').forEach(function (chr) { B[chr] = chr; });
1532
- return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
1533
- }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
1534
- var T = toObject$2(target);
1535
- var argumentsLength = arguments.length;
1536
- var index = 1;
1537
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1538
- var propertyIsEnumerable = propertyIsEnumerableModule.f;
1539
- while (argumentsLength > index) {
1540
- var S = IndexedObject$1(arguments[index++]);
1541
- var keys = getOwnPropertySymbols ? concat$1(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
1542
- var length = keys.length;
1543
- var j = 0;
1544
- var key;
1545
- while (length > j) {
1546
- key = keys[j++];
1547
- if (!DESCRIPTORS$2 || call$b(propertyIsEnumerable, S, key)) T[key] = S[key];
1548
- }
1549
- } return T;
1550
- } : $assign;
1551
-
1552
- var $$4 = _export;
1553
- var assign = objectAssign;
1554
-
1555
- // `Object.assign` method
1556
- // https://tc39.es/ecma262/#sec-object.assign
1557
- // eslint-disable-next-line es/no-object-assign -- required for testing
1558
- $$4({ target: 'Object', stat: true, forced: Object.assign !== assign }, {
1559
- assign: assign
1560
- });
1561
-
1562
- const AnalyticsGoogle = ({
1563
- id
1564
- }) => {
1565
- const uid = id || process.env["NEXT_PUBLIC_GTM_ID"];
1566
- const {
1567
- events,
1568
- asPath,
1569
- query
1570
- } = router.useRouter();
1571
- const [ready, setReady] = react.useState(false);
1572
- const [routed, setRouted] = react.useState(false); // const [url, setUrl] = useState("");
1573
-
1574
- react.useEffect(() => {
1575
- const handleRouteChange = () => {
1576
- setRouted(true);
1577
- };
1578
-
1579
- events.on("routeChangeComplete", handleRouteChange);
1580
- return () => {
1581
- events.off("routeChangeComplete", handleRouteChange);
1582
- };
1583
- }, [events]);
1584
- react.useEffect(() => {
1585
- if (routed && ready && asPath) {
1586
- // const search = query;
1587
- utils.pageview(asPath);
1588
- }
1589
- }, [asPath, query, routed, ready]);
1590
-
1591
- if (!uid) {
1592
- return null;
1593
- }
1594
-
1595
- return jsxRuntime.jsxs(jsxRuntime.Fragment, {
1596
- children: [jsxRuntime.jsx(Script__default["default"], {
1597
- id: "google-tagmanager",
1598
- src: `https://www.googletagmanager.com/gtag/js?id=${id}`,
1599
- strategy: "afterInteractive",
1600
- onLoad: () => setReady(true)
1601
- }), jsxRuntime.jsx(Script__default["default"], Object.assign({
1602
- id: "google-analytics",
1603
- strategy: "afterInteractive"
1604
- }, {
1605
- children: `
1606
- window.dataLayer = window.dataLayer || [];
1607
- function gtag(){window.dataLayer.push(arguments);}
1608
- gtag('js', new Date());
1609
-
1610
- gtag('config', '${id}', { 'send_page_view': false });
1611
- `
1612
- }))]
1613
- });
1614
- };
1615
-
1616
- var global$l = global$J;
1617
- var aCallable$4 = aCallable$6;
1618
- var toObject$1 = toObject$5;
1619
- var IndexedObject = indexedObject;
1620
- var lengthOfArrayLike$2 = lengthOfArrayLike$4;
1621
-
1622
- var TypeError$8 = global$l.TypeError;
1623
-
1624
- // `Array.prototype.{ reduce, reduceRight }` methods implementation
1625
- var createMethod$1 = function (IS_RIGHT) {
1626
- return function (that, callbackfn, argumentsLength, memo) {
1627
- aCallable$4(callbackfn);
1628
- var O = toObject$1(that);
1629
- var self = IndexedObject(O);
1630
- var length = lengthOfArrayLike$2(O);
1631
- var index = IS_RIGHT ? length - 1 : 0;
1632
- var i = IS_RIGHT ? -1 : 1;
1633
- if (argumentsLength < 2) while (true) {
1634
- if (index in self) {
1635
- memo = self[index];
1636
- index += i;
1637
- break;
1638
- }
1639
- index += i;
1640
- if (IS_RIGHT ? index < 0 : length <= index) {
1641
- throw TypeError$8('Reduce of empty array with no initial value');
1642
- }
1643
- }
1644
- for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
1645
- memo = callbackfn(memo, self[index], index, O);
1646
- }
1647
- return memo;
1648
- };
1649
- };
1650
-
1651
- var arrayReduce = {
1652
- // `Array.prototype.reduce` method
1653
- // https://tc39.es/ecma262/#sec-array.prototype.reduce
1654
- left: createMethod$1(false),
1655
- // `Array.prototype.reduceRight` method
1656
- // https://tc39.es/ecma262/#sec-array.prototype.reduceright
1657
- right: createMethod$1(true)
1658
- };
1659
-
1660
- var fails$9 = fails$k;
1661
-
1662
- var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) {
1663
- var method = [][METHOD_NAME];
1664
- return !!method && fails$9(function () {
1665
- // eslint-disable-next-line no-useless-call -- required for testing
1666
- method.call(null, argument || function () { return 1; }, 1);
1667
- });
1668
- };
1669
-
1670
- var classof$6 = classofRaw$1;
1671
- var global$k = global$J;
1672
-
1673
- var engineIsNode = classof$6(global$k.process) == 'process';
1674
-
1675
- var $$3 = _export;
1676
- var $reduce = arrayReduce.left;
1677
- var arrayMethodIsStrict = arrayMethodIsStrict$1;
1678
- var CHROME_VERSION = engineV8Version;
1679
- var IS_NODE$3 = engineIsNode;
1680
-
1681
- var STRICT_METHOD = arrayMethodIsStrict('reduce');
1682
- // Chrome 80-82 has a critical bug
1683
- // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
1684
- var CHROME_BUG = !IS_NODE$3 && CHROME_VERSION > 79 && CHROME_VERSION < 83;
1685
-
1686
- // `Array.prototype.reduce` method
1687
- // https://tc39.es/ecma262/#sec-array.prototype.reduce
1688
- $$3({ target: 'Array', proto: true, forced: !STRICT_METHOD || CHROME_BUG }, {
1689
- reduce: function reduce(callbackfn /* , initialValue */) {
1690
- var length = arguments.length;
1691
- return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
1692
- }
1693
- });
1694
-
1695
- var wellKnownSymbol$a = wellKnownSymbol$h;
1696
-
1697
- var TO_STRING_TAG$1 = wellKnownSymbol$a('toStringTag');
1698
- var test = {};
1699
-
1700
- test[TO_STRING_TAG$1] = 'z';
1701
-
1702
- var toStringTagSupport = String(test) === '[object z]';
1703
-
1704
- var global$j = global$J;
1705
- var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1706
- var isCallable$6 = isCallable$k;
1707
- var classofRaw = classofRaw$1;
1708
- var wellKnownSymbol$9 = wellKnownSymbol$h;
1709
-
1710
- var TO_STRING_TAG = wellKnownSymbol$9('toStringTag');
1711
- var Object$1 = global$j.Object;
1712
-
1713
- // ES3 wrong here
1714
- var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
1715
-
1716
- // fallback for IE11 Script Access Denied error
1717
- var tryGet = function (it, key) {
1718
- try {
1719
- return it[key];
1720
- } catch (error) { /* empty */ }
1721
- };
1722
-
1723
- // getting tag from ES6+ `Object.prototype.toString`
1724
- var classof$5 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
1725
- var O, tag, result;
1726
- return it === undefined ? 'Undefined' : it === null ? 'Null'
1727
- // @@toStringTag case
1728
- : typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG)) == 'string' ? tag
1729
- // builtinTag case
1730
- : CORRECT_ARGUMENTS ? classofRaw(O)
1731
- // ES3 arguments fallback
1732
- : (result = classofRaw(O)) == 'Object' && isCallable$6(O.callee) ? 'Arguments' : result;
1733
- };
1734
-
1735
- var global$i = global$J;
1736
- var classof$4 = classof$5;
1737
-
1738
- var String$2 = global$i.String;
1739
-
1740
- var toString$7 = function (argument) {
1741
- if (classof$4(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
1742
- return String$2(argument);
1743
- };
1744
-
1745
- var anObject$b = anObject$h;
1746
-
1747
- // `RegExp.prototype.flags` getter implementation
1748
- // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
1749
- var regexpFlags$1 = function () {
1750
- var that = anObject$b(this);
1751
- var result = '';
1752
- if (that.global) result += 'g';
1753
- if (that.ignoreCase) result += 'i';
1754
- if (that.multiline) result += 'm';
1755
- if (that.dotAll) result += 's';
1756
- if (that.unicode) result += 'u';
1757
- if (that.sticky) result += 'y';
1758
- return result;
1759
- };
1760
-
1761
- var fails$8 = fails$k;
1762
- var global$h = global$J;
1763
-
1764
- // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
1765
- var $RegExp$2 = global$h.RegExp;
1766
-
1767
- var UNSUPPORTED_Y$2 = fails$8(function () {
1768
- var re = $RegExp$2('a', 'y');
1769
- re.lastIndex = 2;
1770
- return re.exec('abcd') != null;
1771
- });
1772
-
1773
- // UC Browser bug
1774
- // https://github.com/zloirock/core-js/issues/1008
1775
- var MISSED_STICKY = UNSUPPORTED_Y$2 || fails$8(function () {
1776
- return !$RegExp$2('a', 'y').sticky;
1777
- });
1778
-
1779
- var BROKEN_CARET = UNSUPPORTED_Y$2 || fails$8(function () {
1780
- // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
1781
- var re = $RegExp$2('^r', 'gy');
1782
- re.lastIndex = 2;
1783
- return re.exec('str') != null;
1784
- });
1785
-
1786
- var regexpStickyHelpers = {
1787
- BROKEN_CARET: BROKEN_CARET,
1788
- MISSED_STICKY: MISSED_STICKY,
1789
- UNSUPPORTED_Y: UNSUPPORTED_Y$2
1790
- };
1791
-
1792
- var fails$7 = fails$k;
1793
- var global$g = global$J;
1794
-
1795
- // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
1796
- var $RegExp$1 = global$g.RegExp;
1797
-
1798
- var regexpUnsupportedDotAll = fails$7(function () {
1799
- var re = $RegExp$1('.', 's');
1800
- return !(re.dotAll && re.exec('\n') && re.flags === 's');
1801
- });
1802
-
1803
- var fails$6 = fails$k;
1804
- var global$f = global$J;
1805
-
1806
- // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
1807
- var $RegExp = global$f.RegExp;
1808
-
1809
- var regexpUnsupportedNcg = fails$6(function () {
1810
- var re = $RegExp('(?<a>b)', 'g');
1811
- return re.exec('b').groups.a !== 'b' ||
1812
- 'b'.replace(re, '$<a>c') !== 'bc';
1813
- });
1814
-
1815
- /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
1816
- /* eslint-disable regexp/no-useless-quantifier -- testing */
1817
- var call$a = functionCall;
1818
- var uncurryThis$a = functionUncurryThis;
1819
- var toString$6 = toString$7;
1820
- var regexpFlags = regexpFlags$1;
1821
- var stickyHelpers$1 = regexpStickyHelpers;
1822
- var shared = shared$4.exports;
1823
- var create = objectCreate;
1824
- var getInternalState$1 = internalState.get;
1825
- var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll;
1826
- var UNSUPPORTED_NCG = regexpUnsupportedNcg;
1827
-
1828
- var nativeReplace = shared('native-string-replace', String.prototype.replace);
1829
- var nativeExec = RegExp.prototype.exec;
1830
- var patchedExec = nativeExec;
1831
- var charAt$3 = uncurryThis$a(''.charAt);
1832
- var indexOf = uncurryThis$a(''.indexOf);
1833
- var replace$2 = uncurryThis$a(''.replace);
1834
- var stringSlice$5 = uncurryThis$a(''.slice);
1835
-
1836
- var UPDATES_LAST_INDEX_WRONG = (function () {
1837
- var re1 = /a/;
1838
- var re2 = /b*/g;
1839
- call$a(nativeExec, re1, 'a');
1840
- call$a(nativeExec, re2, 'a');
1841
- return re1.lastIndex !== 0 || re2.lastIndex !== 0;
1842
- })();
1843
-
1844
- var UNSUPPORTED_Y$1 = stickyHelpers$1.BROKEN_CARET;
1845
-
1846
- // nonparticipating capturing group, copied from es5-shim's String#split patch.
1847
- var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
1848
-
1849
- var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1 || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
1850
-
1851
- if (PATCH) {
1852
- patchedExec = function exec(string) {
1853
- var re = this;
1854
- var state = getInternalState$1(re);
1855
- var str = toString$6(string);
1856
- var raw = state.raw;
1857
- var result, reCopy, lastIndex, match, i, object, group;
1858
-
1859
- if (raw) {
1860
- raw.lastIndex = re.lastIndex;
1861
- result = call$a(patchedExec, raw, str);
1862
- re.lastIndex = raw.lastIndex;
1863
- return result;
1864
- }
1865
-
1866
- var groups = state.groups;
1867
- var sticky = UNSUPPORTED_Y$1 && re.sticky;
1868
- var flags = call$a(regexpFlags, re);
1869
- var source = re.source;
1870
- var charsAdded = 0;
1871
- var strCopy = str;
1872
-
1873
- if (sticky) {
1874
- flags = replace$2(flags, 'y', '');
1875
- if (indexOf(flags, 'g') === -1) {
1876
- flags += 'g';
1877
- }
1878
-
1879
- strCopy = stringSlice$5(str, re.lastIndex);
1880
- // Support anchored sticky behavior.
1881
- if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$3(str, re.lastIndex - 1) !== '\n')) {
1882
- source = '(?: ' + source + ')';
1883
- strCopy = ' ' + strCopy;
1884
- charsAdded++;
1885
- }
1886
- // ^(? + rx + ) is needed, in combination with some str slicing, to
1887
- // simulate the 'y' flag.
1888
- reCopy = new RegExp('^(?:' + source + ')', flags);
1889
- }
1890
-
1891
- if (NPCG_INCLUDED) {
1892
- reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
1893
- }
1894
- if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
1895
-
1896
- match = call$a(nativeExec, sticky ? reCopy : re, strCopy);
1897
-
1898
- if (sticky) {
1899
- if (match) {
1900
- match.input = stringSlice$5(match.input, charsAdded);
1901
- match[0] = stringSlice$5(match[0], charsAdded);
1902
- match.index = re.lastIndex;
1903
- re.lastIndex += match[0].length;
1904
- } else re.lastIndex = 0;
1905
- } else if (UPDATES_LAST_INDEX_WRONG && match) {
1906
- re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
1907
- }
1908
- if (NPCG_INCLUDED && match && match.length > 1) {
1909
- // Fix browsers whose `exec` methods don't consistently return `undefined`
1910
- // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
1911
- call$a(nativeReplace, match[0], reCopy, function () {
1912
- for (i = 1; i < arguments.length - 2; i++) {
1913
- if (arguments[i] === undefined) match[i] = undefined;
1914
- }
1915
- });
1916
- }
1917
-
1918
- if (match && groups) {
1919
- match.groups = object = create(null);
1920
- for (i = 0; i < groups.length; i++) {
1921
- group = groups[i];
1922
- object[group[0]] = match[group[1]];
1923
- }
1924
- }
1925
-
1926
- return match;
1927
- };
1928
- }
1929
-
1930
- var regexpExec$3 = patchedExec;
1931
-
1932
- var $$2 = _export;
1933
- var exec$2 = regexpExec$3;
1934
-
1935
- // `RegExp.prototype.exec` method
1936
- // https://tc39.es/ecma262/#sec-regexp.prototype.exec
1937
- $$2({ target: 'RegExp', proto: true, forced: /./.exec !== exec$2 }, {
1938
- exec: exec$2
1939
- });
1940
-
1941
- var NATIVE_BIND$1 = functionBindNative;
1942
-
1943
- var FunctionPrototype = Function.prototype;
1944
- var apply$3 = FunctionPrototype.apply;
1945
- var call$9 = FunctionPrototype.call;
1946
-
1947
- // eslint-disable-next-line es/no-reflect -- safe
1948
- var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$9.bind(apply$3) : function () {
1949
- return call$9.apply(apply$3, arguments);
1950
- });
1951
-
1952
- // TODO: Remove from `core-js@4` since it's moved to entry points
1953
-
1954
- var uncurryThis$9 = functionUncurryThis;
1955
- var redefine$3 = redefine$7.exports;
1956
- var regexpExec$2 = regexpExec$3;
1957
- var fails$5 = fails$k;
1958
- var wellKnownSymbol$8 = wellKnownSymbol$h;
1959
- var createNonEnumerableProperty = createNonEnumerableProperty$6;
1960
-
1961
- var SPECIES$3 = wellKnownSymbol$8('species');
1962
- var RegExpPrototype$1 = RegExp.prototype;
1963
-
1964
- var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
1965
- var SYMBOL = wellKnownSymbol$8(KEY);
1966
-
1967
- var DELEGATES_TO_SYMBOL = !fails$5(function () {
1968
- // String methods call symbol-named RegEp methods
1969
- var O = {};
1970
- O[SYMBOL] = function () { return 7; };
1971
- return ''[KEY](O) != 7;
1972
- });
1973
-
1974
- var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$5(function () {
1975
- // Symbol-named RegExp methods call .exec
1976
- var execCalled = false;
1977
- var re = /a/;
1978
-
1979
- if (KEY === 'split') {
1980
- // We can't use real regex here since it causes deoptimization
1981
- // and serious performance degradation in V8
1982
- // https://github.com/zloirock/core-js/issues/306
1983
- re = {};
1984
- // RegExp[@@split] doesn't call the regex's exec method, but first creates
1985
- // a new one. We need to return the patched regex when creating the new one.
1986
- re.constructor = {};
1987
- re.constructor[SPECIES$3] = function () { return re; };
1988
- re.flags = '';
1989
- re[SYMBOL] = /./[SYMBOL];
1990
- }
1991
-
1992
- re.exec = function () { execCalled = true; return null; };
1993
-
1994
- re[SYMBOL]('');
1995
- return !execCalled;
1996
- });
1997
-
1998
- if (
1999
- !DELEGATES_TO_SYMBOL ||
2000
- !DELEGATES_TO_EXEC ||
2001
- FORCED
2002
- ) {
2003
- var uncurriedNativeRegExpMethod = uncurryThis$9(/./[SYMBOL]);
2004
- var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
2005
- var uncurriedNativeMethod = uncurryThis$9(nativeMethod);
2006
- var $exec = regexp.exec;
2007
- if ($exec === regexpExec$2 || $exec === RegExpPrototype$1.exec) {
2008
- if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
2009
- // The native String method already delegates to @@method (this
2010
- // polyfilled function), leasing to infinite recursion.
2011
- // We avoid it by directly calling the native @@method method.
2012
- return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
2013
- }
2014
- return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
2015
- }
2016
- return { done: false };
2017
- });
2018
-
2019
- redefine$3(String.prototype, KEY, methods[0]);
2020
- redefine$3(RegExpPrototype$1, SYMBOL, methods[1]);
2021
- }
2022
-
2023
- if (SHAM) createNonEnumerableProperty(RegExpPrototype$1[SYMBOL], 'sham', true);
2024
- };
2025
-
2026
- var isObject$2 = isObject$8;
2027
- var classof$3 = classofRaw$1;
2028
- var wellKnownSymbol$7 = wellKnownSymbol$h;
2029
-
2030
- var MATCH = wellKnownSymbol$7('match');
2031
-
2032
- // `IsRegExp` abstract operation
2033
- // https://tc39.es/ecma262/#sec-isregexp
2034
- var isRegexp = function (it) {
2035
- var isRegExp;
2036
- return isObject$2(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof$3(it) == 'RegExp');
2037
- };
2038
-
2039
- var uncurryThis$8 = functionUncurryThis;
2040
- var fails$4 = fails$k;
2041
- var isCallable$5 = isCallable$k;
2042
- var classof$2 = classof$5;
2043
- var getBuiltIn$2 = getBuiltIn$7;
2044
- var inspectSource$1 = inspectSource$4;
2045
-
2046
- var noop = function () { /* empty */ };
2047
- var empty = [];
2048
- var construct = getBuiltIn$2('Reflect', 'construct');
2049
- var constructorRegExp = /^\s*(?:class|function)\b/;
2050
- var exec$1 = uncurryThis$8(constructorRegExp.exec);
2051
- var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
2052
-
2053
- var isConstructorModern = function isConstructor(argument) {
2054
- if (!isCallable$5(argument)) return false;
2055
- try {
2056
- construct(noop, empty, argument);
2057
- return true;
2058
- } catch (error) {
2059
- return false;
2060
- }
2061
- };
2062
-
2063
- var isConstructorLegacy = function isConstructor(argument) {
2064
- if (!isCallable$5(argument)) return false;
2065
- switch (classof$2(argument)) {
2066
- case 'AsyncFunction':
2067
- case 'GeneratorFunction':
2068
- case 'AsyncGeneratorFunction': return false;
2069
- }
2070
- try {
2071
- // we can't check .prototype since constructors produced by .bind haven't it
2072
- // `Function#toString` throws on some built-it function in some legacy engines
2073
- // (for example, `DOMQuad` and similar in FF41-)
2074
- return INCORRECT_TO_STRING || !!exec$1(constructorRegExp, inspectSource$1(argument));
2075
- } catch (error) {
2076
- return true;
2077
- }
2078
- };
2079
-
2080
- isConstructorLegacy.sham = true;
2081
-
2082
- // `IsConstructor` abstract operation
2083
- // https://tc39.es/ecma262/#sec-isconstructor
2084
- var isConstructor$1 = !construct || fails$4(function () {
2085
- var called;
2086
- return isConstructorModern(isConstructorModern.call)
2087
- || !isConstructorModern(Object)
2088
- || !isConstructorModern(function () { called = true; })
2089
- || called;
2090
- }) ? isConstructorLegacy : isConstructorModern;
2091
-
2092
- var global$e = global$J;
2093
- var isConstructor = isConstructor$1;
2094
- var tryToString$2 = tryToString$4;
2095
-
2096
- var TypeError$7 = global$e.TypeError;
2097
-
2098
- // `Assert: IsConstructor(argument) is true`
2099
- var aConstructor$1 = function (argument) {
2100
- if (isConstructor(argument)) return argument;
2101
- throw TypeError$7(tryToString$2(argument) + ' is not a constructor');
2102
- };
2103
-
2104
- var anObject$a = anObject$h;
2105
- var aConstructor = aConstructor$1;
2106
- var wellKnownSymbol$6 = wellKnownSymbol$h;
2107
-
2108
- var SPECIES$2 = wellKnownSymbol$6('species');
2109
-
2110
- // `SpeciesConstructor` abstract operation
2111
- // https://tc39.es/ecma262/#sec-speciesconstructor
2112
- var speciesConstructor$2 = function (O, defaultConstructor) {
2113
- var C = anObject$a(O).constructor;
2114
- var S;
2115
- return C === undefined || (S = anObject$a(C)[SPECIES$2]) == undefined ? defaultConstructor : aConstructor(S);
2116
- };
2117
-
2118
- var uncurryThis$7 = functionUncurryThis;
2119
- var toIntegerOrInfinity$1 = toIntegerOrInfinity$4;
2120
- var toString$5 = toString$7;
2121
- var requireObjectCoercible$4 = requireObjectCoercible$7;
2122
-
2123
- var charAt$2 = uncurryThis$7(''.charAt);
2124
- var charCodeAt = uncurryThis$7(''.charCodeAt);
2125
- var stringSlice$4 = uncurryThis$7(''.slice);
2126
-
2127
- var createMethod = function (CONVERT_TO_STRING) {
2128
- return function ($this, pos) {
2129
- var S = toString$5(requireObjectCoercible$4($this));
2130
- var position = toIntegerOrInfinity$1(pos);
2131
- var size = S.length;
2132
- var first, second;
2133
- if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
2134
- first = charCodeAt(S, position);
2135
- return first < 0xD800 || first > 0xDBFF || position + 1 === size
2136
- || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
2137
- ? CONVERT_TO_STRING
2138
- ? charAt$2(S, position)
2139
- : first
2140
- : CONVERT_TO_STRING
2141
- ? stringSlice$4(S, position, position + 2)
2142
- : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
2143
- };
2144
- };
2145
-
2146
- var stringMultibyte = {
2147
- // `String.prototype.codePointAt` method
2148
- // https://tc39.es/ecma262/#sec-string.prototype.codepointat
2149
- codeAt: createMethod(false),
2150
- // `String.prototype.at` method
2151
- // https://github.com/mathiasbynens/String.prototype.at
2152
- charAt: createMethod(true)
2153
- };
2154
-
2155
- var charAt$1 = stringMultibyte.charAt;
2156
-
2157
- // `AdvanceStringIndex` abstract operation
2158
- // https://tc39.es/ecma262/#sec-advancestringindex
2159
- var advanceStringIndex$3 = function (S, index, unicode) {
2160
- return index + (unicode ? charAt$1(S, index).length : 1);
2161
- };
2162
-
2163
- var toPropertyKey = toPropertyKey$3;
2164
- var definePropertyModule$1 = objectDefineProperty;
2165
- var createPropertyDescriptor = createPropertyDescriptor$4;
2166
-
2167
- var createProperty$1 = function (object, key, value) {
2168
- var propertyKey = toPropertyKey(key);
2169
- if (propertyKey in object) definePropertyModule$1.f(object, propertyKey, createPropertyDescriptor(0, value));
2170
- else object[propertyKey] = value;
2171
- };
2172
-
2173
- var global$d = global$J;
2174
- var toAbsoluteIndex = toAbsoluteIndex$2;
2175
- var lengthOfArrayLike$1 = lengthOfArrayLike$4;
2176
- var createProperty = createProperty$1;
2177
-
2178
- var Array$1 = global$d.Array;
2179
- var max$1 = Math.max;
2180
-
2181
- var arraySliceSimple = function (O, start, end) {
2182
- var length = lengthOfArrayLike$1(O);
2183
- var k = toAbsoluteIndex(start, length);
2184
- var fin = toAbsoluteIndex(end === undefined ? length : end, length);
2185
- var result = Array$1(max$1(fin - k, 0));
2186
- for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
2187
- result.length = n;
2188
- return result;
2189
- };
2190
-
2191
- var global$c = global$J;
2192
- var call$8 = functionCall;
2193
- var anObject$9 = anObject$h;
2194
- var isCallable$4 = isCallable$k;
2195
- var classof$1 = classofRaw$1;
2196
- var regexpExec$1 = regexpExec$3;
2197
-
2198
- var TypeError$6 = global$c.TypeError;
2199
-
2200
- // `RegExpExec` abstract operation
2201
- // https://tc39.es/ecma262/#sec-regexpexec
2202
- var regexpExecAbstract = function (R, S) {
2203
- var exec = R.exec;
2204
- if (isCallable$4(exec)) {
2205
- var result = call$8(exec, R, S);
2206
- if (result !== null) anObject$9(result);
2207
- return result;
2208
- }
2209
- if (classof$1(R) === 'RegExp') return call$8(regexpExec$1, R, S);
2210
- throw TypeError$6('RegExp#exec called on incompatible receiver');
2211
- };
2212
-
2213
- var apply$2 = functionApply;
2214
- var call$7 = functionCall;
2215
- var uncurryThis$6 = functionUncurryThis;
2216
- var fixRegExpWellKnownSymbolLogic$3 = fixRegexpWellKnownSymbolLogic;
2217
- var isRegExp = isRegexp;
2218
- var anObject$8 = anObject$h;
2219
- var requireObjectCoercible$3 = requireObjectCoercible$7;
2220
- var speciesConstructor$1 = speciesConstructor$2;
2221
- var advanceStringIndex$2 = advanceStringIndex$3;
2222
- var toLength$2 = toLength$4;
2223
- var toString$4 = toString$7;
2224
- var getMethod$5 = getMethod$7;
2225
- var arraySlice$2 = arraySliceSimple;
2226
- var callRegExpExec = regexpExecAbstract;
2227
- var regexpExec = regexpExec$3;
2228
- var stickyHelpers = regexpStickyHelpers;
2229
- var fails$3 = fails$k;
2230
-
2231
- var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
2232
- var MAX_UINT32 = 0xFFFFFFFF;
2233
- var min$1 = Math.min;
2234
- var $push = [].push;
2235
- var exec = uncurryThis$6(/./.exec);
2236
- var push$1 = uncurryThis$6($push);
2237
- var stringSlice$3 = uncurryThis$6(''.slice);
2238
-
2239
- // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
2240
- // Weex JS has frozen built-in prototypes, so use try / catch wrapper
2241
- var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails$3(function () {
2242
- // eslint-disable-next-line regexp/no-empty-group -- required for testing
2243
- var re = /(?:)/;
2244
- var originalExec = re.exec;
2245
- re.exec = function () { return originalExec.apply(this, arguments); };
2246
- var result = 'ab'.split(re);
2247
- return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
2248
- });
2249
-
2250
- // @@split logic
2251
- fixRegExpWellKnownSymbolLogic$3('split', function (SPLIT, nativeSplit, maybeCallNative) {
2252
- var internalSplit;
2253
- if (
2254
- 'abbc'.split(/(b)*/)[1] == 'c' ||
2255
- // eslint-disable-next-line regexp/no-empty-group -- required for testing
2256
- 'test'.split(/(?:)/, -1).length != 4 ||
2257
- 'ab'.split(/(?:ab)*/).length != 2 ||
2258
- '.'.split(/(.?)(.?)/).length != 4 ||
2259
- // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
2260
- '.'.split(/()()/).length > 1 ||
2261
- ''.split(/.?/).length
2262
- ) {
2263
- // based on es5-shim implementation, need to rework it
2264
- internalSplit = function (separator, limit) {
2265
- var string = toString$4(requireObjectCoercible$3(this));
2266
- var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
2267
- if (lim === 0) return [];
2268
- if (separator === undefined) return [string];
2269
- // If `separator` is not a regex, use native split
2270
- if (!isRegExp(separator)) {
2271
- return call$7(nativeSplit, string, separator, lim);
2272
- }
2273
- var output = [];
2274
- var flags = (separator.ignoreCase ? 'i' : '') +
2275
- (separator.multiline ? 'm' : '') +
2276
- (separator.unicode ? 'u' : '') +
2277
- (separator.sticky ? 'y' : '');
2278
- var lastLastIndex = 0;
2279
- // Make `global` and avoid `lastIndex` issues by working with a copy
2280
- var separatorCopy = new RegExp(separator.source, flags + 'g');
2281
- var match, lastIndex, lastLength;
2282
- while (match = call$7(regexpExec, separatorCopy, string)) {
2283
- lastIndex = separatorCopy.lastIndex;
2284
- if (lastIndex > lastLastIndex) {
2285
- push$1(output, stringSlice$3(string, lastLastIndex, match.index));
2286
- if (match.length > 1 && match.index < string.length) apply$2($push, output, arraySlice$2(match, 1));
2287
- lastLength = match[0].length;
2288
- lastLastIndex = lastIndex;
2289
- if (output.length >= lim) break;
2290
- }
2291
- if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
2292
- }
2293
- if (lastLastIndex === string.length) {
2294
- if (lastLength || !exec(separatorCopy, '')) push$1(output, '');
2295
- } else push$1(output, stringSlice$3(string, lastLastIndex));
2296
- return output.length > lim ? arraySlice$2(output, 0, lim) : output;
2297
- };
2298
- // Chakra, V8
2299
- } else if ('0'.split(undefined, 0).length) {
2300
- internalSplit = function (separator, limit) {
2301
- return separator === undefined && limit === 0 ? [] : call$7(nativeSplit, this, separator, limit);
2302
- };
2303
- } else internalSplit = nativeSplit;
2304
-
2305
- return [
2306
- // `String.prototype.split` method
2307
- // https://tc39.es/ecma262/#sec-string.prototype.split
2308
- function split(separator, limit) {
2309
- var O = requireObjectCoercible$3(this);
2310
- var splitter = separator == undefined ? undefined : getMethod$5(separator, SPLIT);
2311
- return splitter
2312
- ? call$7(splitter, separator, O, limit)
2313
- : call$7(internalSplit, toString$4(O), separator, limit);
2314
- },
2315
- // `RegExp.prototype[@@split]` method
2316
- // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
2317
- //
2318
- // NOTE: This cannot be properly polyfilled in engines that don't support
2319
- // the 'y' flag.
2320
- function (string, limit) {
2321
- var rx = anObject$8(this);
2322
- var S = toString$4(string);
2323
- var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
2324
-
2325
- if (res.done) return res.value;
2326
-
2327
- var C = speciesConstructor$1(rx, RegExp);
2328
-
2329
- var unicodeMatching = rx.unicode;
2330
- var flags = (rx.ignoreCase ? 'i' : '') +
2331
- (rx.multiline ? 'm' : '') +
2332
- (rx.unicode ? 'u' : '') +
2333
- (UNSUPPORTED_Y ? 'g' : 'y');
2334
-
2335
- // ^(? + rx + ) is needed, in combination with some S slicing, to
2336
- // simulate the 'y' flag.
2337
- var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);
2338
- var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
2339
- if (lim === 0) return [];
2340
- if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];
2341
- var p = 0;
2342
- var q = 0;
2343
- var A = [];
2344
- while (q < S.length) {
2345
- splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;
2346
- var z = callRegExpExec(splitter, UNSUPPORTED_Y ? stringSlice$3(S, q) : S);
2347
- var e;
2348
- if (
2349
- z === null ||
2350
- (e = min$1(toLength$2(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p
2351
- ) {
2352
- q = advanceStringIndex$2(S, q, unicodeMatching);
2353
- } else {
2354
- push$1(A, stringSlice$3(S, p, q));
2355
- if (A.length === lim) return A;
2356
- for (var i = 1; i <= z.length - 1; i++) {
2357
- push$1(A, z[i]);
2358
- if (A.length === lim) return A;
2359
- }
2360
- q = p = e;
2361
- }
2362
- }
2363
- push$1(A, stringSlice$3(S, p));
2364
- return A;
2365
- }
2366
- ];
2367
- }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
2368
-
2369
- const AUTH_ROUTES = {
2370
- login: process.env["AUTH_ROUTE_LOGIN"],
2371
- profile: process.env["AUTH_ROUTE_PROFILE"],
2372
- register: process.env["AUTH_ROUTE_REGISTER"],
2373
- secured: JSON.parse(process.env["AUTH_ROUTES_SECURED"] || "[]")
2374
- };
2375
- function getAuthRoutes(t) {
2376
- return Object.keys(AUTH_ROUTES).reduce((map, name) => {
2377
- const routePage = AUTH_ROUTES[name]; // @ts-expect-error cannot remember
2378
-
2379
- map[name] = utils.isString(routePage) ? t(`~:${AUTH_ROUTES[name]}`) : routePage;
2380
- return map;
2381
- }, {});
2382
- }
2383
- /**
2384
- * @param url e.g. "http://localhost:3000/signin?callbackUrl=http://localhost:3000/profile"
2385
- */
2386
-
2387
- function getCallbackUrl(url = window.location.href) {
2388
- return url.split("callbackUrl=")[1] || "";
2389
- }
2390
-
2391
- // `SameValue` abstract operation
2392
- // https://tc39.es/ecma262/#sec-samevalue
2393
- // eslint-disable-next-line es/no-object-is -- safe
2394
- var sameValue$1 = Object.is || function is(x, y) {
2395
- // eslint-disable-next-line no-self-compare -- NaN check
2396
- return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
2397
- };
2398
-
2399
- var call$6 = functionCall;
2400
- var fixRegExpWellKnownSymbolLogic$2 = fixRegexpWellKnownSymbolLogic;
2401
- var anObject$7 = anObject$h;
2402
- var requireObjectCoercible$2 = requireObjectCoercible$7;
2403
- var sameValue = sameValue$1;
2404
- var toString$3 = toString$7;
2405
- var getMethod$4 = getMethod$7;
2406
- var regExpExec$2 = regexpExecAbstract;
2407
-
2408
- // @@search logic
2409
- fixRegExpWellKnownSymbolLogic$2('search', function (SEARCH, nativeSearch, maybeCallNative) {
2410
- return [
2411
- // `String.prototype.search` method
2412
- // https://tc39.es/ecma262/#sec-string.prototype.search
2413
- function search(regexp) {
2414
- var O = requireObjectCoercible$2(this);
2415
- var searcher = regexp == undefined ? undefined : getMethod$4(regexp, SEARCH);
2416
- return searcher ? call$6(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString$3(O));
2417
- },
2418
- // `RegExp.prototype[@@search]` method
2419
- // https://tc39.es/ecma262/#sec-regexp.prototype-@@search
2420
- function (string) {
2421
- var rx = anObject$7(this);
2422
- var S = toString$3(string);
2423
- var res = maybeCallNative(nativeSearch, rx, S);
2424
-
2425
- if (res.done) return res.value;
2426
-
2427
- var previousLastIndex = rx.lastIndex;
2428
- if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
2429
- var result = regExpExec$2(rx, S);
2430
- if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
2431
- return result === null ? -1 : result.index;
2432
- }
2433
- ];
2434
- });
2435
-
2436
- /**
2437
- * FIXME: the use of `useMemo` is a hopefully-temporary solution to fix the FOUC
2438
- * problem of untranslated text during page transitions
2439
- *
2440
- * @see https://github.com/vinissimus/next-translate/issues/513#issuecomment-779826418
2441
- */
2442
-
2443
- function useT(namespace) {
2444
- const t = useTranslation__default["default"]().t; // const typedT = <
2445
- // // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-constraint
2446
- // R extends unknown = string,
2447
- // // Q extends TranslationQuery = TranslationQuery
2448
- // // O extends TranslationOptions = TranslationOptions
2449
- // >(
2450
- // s: N extends TranslateNamespace
2451
- // ? Paths<Koine.NextTranslations[N]> | AllPaths
2452
- // : AllPaths,
2453
- // q?: TranslationQuery,
2454
- // o?: TranslationOptions
2455
- // ) =>
2456
- // // eslint-disable-next-line
2457
- // t.call(
2458
- // null,
2459
- // namespace ? `${namespace}:${s}` : s,
2460
- // q === "obj" ? null : q,
2461
- // q === "obj" || o === "obj" ? { returnObjects: true } : o
2462
- // // ) as R extends (undefined | never | unknown) ? TranslateReturn<TranslationQuery, TranslationOptions> : R;
2463
- // ) as R;
2464
- // return typedT;
2465
-
2466
- const tMemoized = react.useMemo(() => (s, q, o) => t(namespace ? `${namespace}:${s}` : s, q === "obj" ? null : q, q === "obj" || o === "obj" ? {
2467
- returnObjects: true
2468
- } : o // ) as R extends (undefined | never | unknown) ? TranslateReturn<TranslationQuery, TranslationOptions> : R;
2469
- ), [t, namespace]); // return tMemoized as Translate<N>;
2470
-
2471
- return tMemoized;
2472
- }
2473
- /**
2474
- * @deprecated Not sure whether this will ever be useful
2475
- */
2476
-
2477
- function useLooseT(namespace) {
2478
- const {
2479
- t
2480
- } = useTranslation__default["default"](namespace); // return t;
2481
-
2482
- const tMemoized = react.useMemo(() => t, [t]);
2483
- return tMemoized;
2484
- }
2485
- function translationAsOptions(t, i18nKey) {
2486
- const dictionary = t(i18nKey, undefined, {
2487
- returnObjects: true
2488
- });
2489
- return Object.keys(dictionary).map(key => ({
2490
- value: key,
2491
- label: dictionary[key]
2492
- }));
2493
- }
2494
- /**
2495
- * Automatically returns the `date-fns/format` function with the right locale
2496
- * passed as option (grabbed from next router value).
2497
- */
2498
-
2499
- const useDateFormat = () => {
2500
- const [formatter, setFormatter] = react.useState(() => (...args) => format__default["default"](...args));
2501
- const router$1 = router.useRouter();
2502
- const locale = react$1.useDateLocale(router$1.locale);
2503
- react.useEffect(() => {
2504
- if (locale) {
2505
- const newFormatter = (date, _format, options) => format__default["default"](date, _format, Object.assign(Object.assign({}, options || {}), {
2506
- locale
2507
- }));
2508
-
2509
- setFormatter(() => (...args) => newFormatter(...args));
2510
- }
2511
- }, [locale]);
2512
- return formatter;
2513
- };
2514
-
2515
- function useLogin() {
2516
- const t = useT();
2517
- const {
2518
- push
2519
- } = router.useRouter();
2520
- const [loading, setLoading] = react.useState(false);
2521
- const [ok, setOk] = react.useState(false);
2522
- const [fail, setFail] = react.useState(false);
2523
- const submit = react.useCallback(data => {
2524
- setLoading(true);
2525
- react$2.signIn("credentials", Object.assign(Object.assign({}, data), {
2526
- redirect: false
2527
- })) // @ts-expect-error FIXME: at some point...
2528
- .then(({
2529
- ok
2530
- }) => {
2531
- setLoading(false);
2532
- setOk(ok);
2533
- setFail(!ok);
2534
-
2535
- if (ok) {
2536
- const redirectUrl = utils.parseURL(getCallbackUrl());
2537
- const {
2538
- login,
2539
- register,
2540
- profile
2541
- } = getAuthRoutes(t);
2542
-
2543
- if (redirectUrl) {
2544
- const redirectPath = redirectUrl.pathname;
2545
-
2546
- if (profile && (redirectPath === login || redirectPath === register)) {
2547
- push(profile);
2548
- } else {
2549
- push(redirectPath + redirectUrl.search);
2550
- }
2551
- } else if (profile) {
2552
- push(profile);
2553
- }
2554
- }
2555
- });
2556
- }, [t, push]); // TODO: useMemo ?
2557
-
2558
- return {
2559
- submit,
2560
- loading,
2561
- ok,
2562
- fail
2563
- };
2564
- }
2565
-
2566
- function useLoginUrl() {
2567
- const [currentUrl, setCurrentUrl] = react.useState("");
2568
- const t = useT();
2569
- react.useEffect(() => {
2570
- setCurrentUrl(`?callbackUrl=${window.location.href}`);
2571
- }, []);
2572
- return `${getAuthRoutes(t).login}${currentUrl}`;
2573
- }
2574
-
2575
- var call$5 = functionCall;
2576
- var fixRegExpWellKnownSymbolLogic$1 = fixRegexpWellKnownSymbolLogic;
2577
- var anObject$6 = anObject$h;
2578
- var toLength$1 = toLength$4;
2579
- var toString$2 = toString$7;
2580
- var requireObjectCoercible$1 = requireObjectCoercible$7;
2581
- var getMethod$3 = getMethod$7;
2582
- var advanceStringIndex$1 = advanceStringIndex$3;
2583
- var regExpExec$1 = regexpExecAbstract;
2584
-
2585
- // @@match logic
2586
- fixRegExpWellKnownSymbolLogic$1('match', function (MATCH, nativeMatch, maybeCallNative) {
2587
- return [
2588
- // `String.prototype.match` method
2589
- // https://tc39.es/ecma262/#sec-string.prototype.match
2590
- function match(regexp) {
2591
- var O = requireObjectCoercible$1(this);
2592
- var matcher = regexp == undefined ? undefined : getMethod$3(regexp, MATCH);
2593
- return matcher ? call$5(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString$2(O));
2594
- },
2595
- // `RegExp.prototype[@@match]` method
2596
- // https://tc39.es/ecma262/#sec-regexp.prototype-@@match
2597
- function (string) {
2598
- var rx = anObject$6(this);
2599
- var S = toString$2(string);
2600
- var res = maybeCallNative(nativeMatch, rx, S);
2601
-
2602
- if (res.done) return res.value;
2603
-
2604
- if (!rx.global) return regExpExec$1(rx, S);
2605
-
2606
- var fullUnicode = rx.unicode;
2607
- rx.lastIndex = 0;
2608
- var A = [];
2609
- var n = 0;
2610
- var result;
2611
- while ((result = regExpExec$1(rx, S)) !== null) {
2612
- var matchStr = toString$2(result[0]);
2613
- A[n] = matchStr;
2614
- if (matchStr === '') rx.lastIndex = advanceStringIndex$1(S, toLength$1(rx.lastIndex), fullUnicode);
2615
- n++;
2616
- }
2617
- return n === 0 ? null : A;
2618
- }
2619
- ];
2620
- });
2621
-
2622
- function useLogout() {
2623
- const t = useT();
2624
- const {
2625
- push
2626
- } = router.useRouter();
2627
- const [loading, setLoading] = react.useState(false);
2628
- const [ok, setOk] = react.useState(false);
2629
- const [fail] = react.useState(false);
2630
- const submit = react.useCallback(event => {
2631
- event.preventDefault();
2632
- event.stopPropagation();
2633
- setLoading(true);
2634
- react$2.signOut({
2635
- redirect: false
2636
- }).then(() => {
2637
- setLoading(false);
2638
- setOk(true);
2639
- const redirectUrl = utils.parseURL(getCallbackUrl());
2640
- const currentUrl = utils.parseURL(window.location.href);
2641
- const {
2642
- secured
2643
- } = getAuthRoutes(t);
2644
- const signin = t("~:/signin");
2645
- const profile = t("~:/profile");
2646
- const targetUrl = redirectUrl || currentUrl;
2647
- let redirect = "";
2648
-
2649
- if (targetUrl) {
2650
- if (targetUrl.pathname === profile) {
2651
- redirect = signin;
2652
- } else if (secured) {
2653
- for (let i = 0; i < secured.length; i++) {
2654
- if (targetUrl.pathname.match(secured[i])) {
2655
- redirect = signin;
2656
- break;
2657
- }
2658
- }
2659
- }
2660
- }
2661
-
2662
- if (redirect) {
2663
- push(redirect);
2664
- }
2665
- });
2666
- }, [t, push]); // TODO: useMemo ?
2667
-
2668
- return {
2669
- submit,
2670
- loading,
2671
- ok,
2672
- fail
2673
- };
2674
- }
2675
-
2676
- const Favicon = props => jsxRuntime.jsx(Head__default["default"], {
2677
- children: jsxRuntime.jsx(react$1.FaviconTags, Object.assign({}, props))
2678
- });
2679
-
2680
- function useForm( // eslint-disable-next-line @typescript-eslint/no-explicit-any
2681
- schema, i18nNamespace, formProps = {}, debug) {
2682
- const t = useT(i18nNamespace); // const form = _useForm<InferType<ObjectSchema<T, object>>>({
2683
-
2684
- const form = reactHookForm.useForm(Object.assign({
2685
- // @ts-expect-error FIXME:
2686
- resolver: yup.yupResolver(schema)
2687
- }, formProps)); // const { control, register, setValue } = form;
2688
- // const field = { control, register, setValue, t };
2689
- // if ("production" !== process.env["NODE_ENV"]) {
2690
- // if (debug) {
2691
- // console.log(
2692
- // `Form ${i18nNamespace} data`,
2693
- // form.watch(),
2694
- // `errors: `,
2695
- // form.formState.errors
2696
- // );
2697
- // }
2698
- // }
2699
- // if (formProps.mode === "onChange") {
2700
- // return { field, ...form };
2701
- // }
2702
-
2703
-
2704
- return react.useMemo(() => {
2705
- const {
2706
- control,
2707
- register,
2708
- setValue
2709
- } = form;
2710
- const field = {
2711
- control,
2712
- register,
2713
- setValue,
2714
- t
2715
- };
2716
- return Object.assign({
2717
- field
2718
- }, form);
2719
- }, [t, form]);
2720
- }
2721
-
2722
- /*! *****************************************************************************
2723
- Copyright (c) Microsoft Corporation.
2724
-
2725
- Permission to use, copy, modify, and/or distribute this software for any
2726
- purpose with or without fee is hereby granted.
2727
-
2728
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
2729
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
2730
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
2731
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
2732
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
2733
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
2734
- PERFORMANCE OF THIS SOFTWARE.
2735
- ***************************************************************************** */
2736
-
2737
- function __rest(s, e) {
2738
- var t = {};
2739
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
2740
- t[p] = s[p];
2741
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
2742
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
2743
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
2744
- t[p[i]] = s[p[i]];
2745
- }
2746
- return t;
2747
- }
2748
-
2749
- function __awaiter(thisArg, _arguments, P, generator) {
2750
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
2751
- return new (P || (P = Promise))(function (resolve, reject) {
2752
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
2753
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
2754
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
2755
- step((generator = generator.apply(thisArg, _arguments || [])).next());
2756
- });
2757
- }
2758
-
2759
- var uncurryThis$5 = functionUncurryThis;
2760
- var toObject = toObject$5;
2761
-
2762
- var floor = Math.floor;
2763
- var charAt = uncurryThis$5(''.charAt);
2764
- var replace$1 = uncurryThis$5(''.replace);
2765
- var stringSlice$2 = uncurryThis$5(''.slice);
2766
- var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
2767
- var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
2768
-
2769
- // `GetSubstitution` abstract operation
2770
- // https://tc39.es/ecma262/#sec-getsubstitution
2771
- var getSubstitution$1 = function (matched, str, position, captures, namedCaptures, replacement) {
2772
- var tailPos = position + matched.length;
2773
- var m = captures.length;
2774
- var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
2775
- if (namedCaptures !== undefined) {
2776
- namedCaptures = toObject(namedCaptures);
2777
- symbols = SUBSTITUTION_SYMBOLS;
2778
- }
2779
- return replace$1(replacement, symbols, function (match, ch) {
2780
- var capture;
2781
- switch (charAt(ch, 0)) {
2782
- case '$': return '$';
2783
- case '&': return matched;
2784
- case '`': return stringSlice$2(str, 0, position);
2785
- case "'": return stringSlice$2(str, tailPos);
2786
- case '<':
2787
- capture = namedCaptures[stringSlice$2(ch, 1, -1)];
2788
- break;
2789
- default: // \d\d?
2790
- var n = +ch;
2791
- if (n === 0) return match;
2792
- if (n > m) {
2793
- var f = floor(n / 10);
2794
- if (f === 0) return match;
2795
- if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1);
2796
- return match;
2797
- }
2798
- capture = captures[n - 1];
2799
- }
2800
- return capture === undefined ? '' : capture;
2801
- });
2802
- };
2803
-
2804
- var apply$1 = functionApply;
2805
- var call$4 = functionCall;
2806
- var uncurryThis$4 = functionUncurryThis;
2807
- var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
2808
- var fails$2 = fails$k;
2809
- var anObject$5 = anObject$h;
2810
- var isCallable$3 = isCallable$k;
2811
- var toIntegerOrInfinity = toIntegerOrInfinity$4;
2812
- var toLength = toLength$4;
2813
- var toString$1 = toString$7;
2814
- var requireObjectCoercible = requireObjectCoercible$7;
2815
- var advanceStringIndex = advanceStringIndex$3;
2816
- var getMethod$2 = getMethod$7;
2817
- var getSubstitution = getSubstitution$1;
2818
- var regExpExec = regexpExecAbstract;
2819
- var wellKnownSymbol$5 = wellKnownSymbol$h;
2820
-
2821
- var REPLACE = wellKnownSymbol$5('replace');
2822
- var max = Math.max;
2823
- var min = Math.min;
2824
- var concat = uncurryThis$4([].concat);
2825
- var push = uncurryThis$4([].push);
2826
- var stringIndexOf = uncurryThis$4(''.indexOf);
2827
- var stringSlice$1 = uncurryThis$4(''.slice);
2828
-
2829
- var maybeToString = function (it) {
2830
- return it === undefined ? it : String(it);
2831
- };
2832
-
2833
- // IE <= 11 replaces $0 with the whole match, as if it was $&
2834
- // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
2835
- var REPLACE_KEEPS_$0 = (function () {
2836
- // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
2837
- return 'a'.replace(/./, '$0') === '$0';
2838
- })();
2839
-
2840
- // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
2841
- var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
2842
- if (/./[REPLACE]) {
2843
- return /./[REPLACE]('a', '$0') === '';
2844
- }
2845
- return false;
2846
- })();
2847
-
2848
- var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$2(function () {
2849
- var re = /./;
2850
- re.exec = function () {
2851
- var result = [];
2852
- result.groups = { a: '7' };
2853
- return result;
2854
- };
2855
- // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
2856
- return ''.replace(re, '$<a>') !== '7';
2857
- });
2858
-
2859
- // @@replace logic
2860
- fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {
2861
- var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
2862
-
2863
- return [
2864
- // `String.prototype.replace` method
2865
- // https://tc39.es/ecma262/#sec-string.prototype.replace
2866
- function replace(searchValue, replaceValue) {
2867
- var O = requireObjectCoercible(this);
2868
- var replacer = searchValue == undefined ? undefined : getMethod$2(searchValue, REPLACE);
2869
- return replacer
2870
- ? call$4(replacer, searchValue, O, replaceValue)
2871
- : call$4(nativeReplace, toString$1(O), searchValue, replaceValue);
2872
- },
2873
- // `RegExp.prototype[@@replace]` method
2874
- // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
2875
- function (string, replaceValue) {
2876
- var rx = anObject$5(this);
2877
- var S = toString$1(string);
2878
-
2879
- if (
2880
- typeof replaceValue == 'string' &&
2881
- stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
2882
- stringIndexOf(replaceValue, '$<') === -1
2883
- ) {
2884
- var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
2885
- if (res.done) return res.value;
2886
- }
2887
-
2888
- var functionalReplace = isCallable$3(replaceValue);
2889
- if (!functionalReplace) replaceValue = toString$1(replaceValue);
2890
-
2891
- var global = rx.global;
2892
- if (global) {
2893
- var fullUnicode = rx.unicode;
2894
- rx.lastIndex = 0;
2895
- }
2896
- var results = [];
2897
- while (true) {
2898
- var result = regExpExec(rx, S);
2899
- if (result === null) break;
2900
-
2901
- push(results, result);
2902
- if (!global) break;
2903
-
2904
- var matchStr = toString$1(result[0]);
2905
- if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
2906
- }
2907
-
2908
- var accumulatedResult = '';
2909
- var nextSourcePosition = 0;
2910
- for (var i = 0; i < results.length; i++) {
2911
- result = results[i];
2912
-
2913
- var matched = toString$1(result[0]);
2914
- var position = max(min(toIntegerOrInfinity(result.index), S.length), 0);
2915
- var captures = [];
2916
- // NOTE: This is equivalent to
2917
- // captures = result.slice(1).map(maybeToString)
2918
- // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
2919
- // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
2920
- // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
2921
- for (var j = 1; j < result.length; j++) push(captures, maybeToString(result[j]));
2922
- var namedCaptures = result.groups;
2923
- if (functionalReplace) {
2924
- var replacerArgs = concat([matched], captures, position, S);
2925
- if (namedCaptures !== undefined) push(replacerArgs, namedCaptures);
2926
- var replacement = toString$1(apply$1(replaceValue, undefined, replacerArgs));
2927
- } else {
2928
- replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
2929
- }
2930
- if (position >= nextSourcePosition) {
2931
- accumulatedResult += stringSlice$1(S, nextSourcePosition, position) + replacement;
2932
- nextSourcePosition = position + matched.length;
2933
- }
2934
- }
2935
- return accumulatedResult + stringSlice$1(S, nextSourcePosition);
2936
- }
2937
- ];
2938
- }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
2939
-
2940
- var global$b = global$J;
2941
-
2942
- var nativePromiseConstructor = global$b.Promise;
2943
-
2944
- var redefine$2 = redefine$7.exports;
2945
-
2946
- var redefineAll$1 = function (target, src, options) {
2947
- for (var key in src) redefine$2(target, key, src[key], options);
2948
- return target;
2949
- };
2950
-
2951
- var getBuiltIn$1 = getBuiltIn$7;
2952
- var definePropertyModule = objectDefineProperty;
2953
- var wellKnownSymbol$4 = wellKnownSymbol$h;
2954
- var DESCRIPTORS$1 = descriptors;
2955
-
2956
- var SPECIES$1 = wellKnownSymbol$4('species');
2957
-
2958
- var setSpecies$1 = function (CONSTRUCTOR_NAME) {
2959
- var Constructor = getBuiltIn$1(CONSTRUCTOR_NAME);
2960
- var defineProperty = definePropertyModule.f;
2961
-
2962
- if (DESCRIPTORS$1 && Constructor && !Constructor[SPECIES$1]) {
2963
- defineProperty(Constructor, SPECIES$1, {
2964
- configurable: true,
2965
- get: function () { return this; }
2966
- });
2967
- }
2968
- };
2969
-
2970
- var global$a = global$J;
2971
- var isPrototypeOf$3 = objectIsPrototypeOf;
2972
-
2973
- var TypeError$5 = global$a.TypeError;
2974
-
2975
- var anInstance$1 = function (it, Prototype) {
2976
- if (isPrototypeOf$3(Prototype, it)) return it;
2977
- throw TypeError$5('Incorrect invocation');
2978
- };
2979
-
2980
- var uncurryThis$3 = functionUncurryThis;
2981
- var aCallable$3 = aCallable$6;
2982
- var NATIVE_BIND = functionBindNative;
2983
-
2984
- var bind$4 = uncurryThis$3(uncurryThis$3.bind);
2985
-
2986
- // optional / simple context binding
2987
- var functionBindContext = function (fn, that) {
2988
- aCallable$3(fn);
2989
- return that === undefined ? fn : NATIVE_BIND ? bind$4(fn, that) : function (/* ...args */) {
2990
- return fn.apply(that, arguments);
2991
- };
2992
- };
2993
-
2994
- var wellKnownSymbol$3 = wellKnownSymbol$h;
2995
- var Iterators$1 = iterators;
2996
-
2997
- var ITERATOR$2 = wellKnownSymbol$3('iterator');
2998
- var ArrayPrototype = Array.prototype;
2999
-
3000
- // check on default Array iterator
3001
- var isArrayIteratorMethod$1 = function (it) {
3002
- return it !== undefined && (Iterators$1.Array === it || ArrayPrototype[ITERATOR$2] === it);
3003
- };
3004
-
3005
- var classof = classof$5;
3006
- var getMethod$1 = getMethod$7;
3007
- var Iterators = iterators;
3008
- var wellKnownSymbol$2 = wellKnownSymbol$h;
3009
-
3010
- var ITERATOR$1 = wellKnownSymbol$2('iterator');
3011
-
3012
- var getIteratorMethod$2 = function (it) {
3013
- if (it != undefined) return getMethod$1(it, ITERATOR$1)
3014
- || getMethod$1(it, '@@iterator')
3015
- || Iterators[classof(it)];
3016
- };
3017
-
3018
- var global$9 = global$J;
3019
- var call$3 = functionCall;
3020
- var aCallable$2 = aCallable$6;
3021
- var anObject$4 = anObject$h;
3022
- var tryToString$1 = tryToString$4;
3023
- var getIteratorMethod$1 = getIteratorMethod$2;
3024
-
3025
- var TypeError$4 = global$9.TypeError;
3026
-
3027
- var getIterator$1 = function (argument, usingIterator) {
3028
- var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
3029
- if (aCallable$2(iteratorMethod)) return anObject$4(call$3(iteratorMethod, argument));
3030
- throw TypeError$4(tryToString$1(argument) + ' is not iterable');
3031
- };
3032
-
3033
- var call$2 = functionCall;
3034
- var anObject$3 = anObject$h;
3035
- var getMethod = getMethod$7;
3036
-
3037
- var iteratorClose$1 = function (iterator, kind, value) {
3038
- var innerResult, innerError;
3039
- anObject$3(iterator);
3040
- try {
3041
- innerResult = getMethod(iterator, 'return');
3042
- if (!innerResult) {
3043
- if (kind === 'throw') throw value;
3044
- return value;
3045
- }
3046
- innerResult = call$2(innerResult, iterator);
3047
- } catch (error) {
3048
- innerError = true;
3049
- innerResult = error;
3050
- }
3051
- if (kind === 'throw') throw value;
3052
- if (innerError) throw innerResult;
3053
- anObject$3(innerResult);
3054
- return value;
3055
- };
3056
-
3057
- var global$8 = global$J;
3058
- var bind$3 = functionBindContext;
3059
- var call$1 = functionCall;
3060
- var anObject$2 = anObject$h;
3061
- var tryToString = tryToString$4;
3062
- var isArrayIteratorMethod = isArrayIteratorMethod$1;
3063
- var lengthOfArrayLike = lengthOfArrayLike$4;
3064
- var isPrototypeOf$2 = objectIsPrototypeOf;
3065
- var getIterator = getIterator$1;
3066
- var getIteratorMethod = getIteratorMethod$2;
3067
- var iteratorClose = iteratorClose$1;
3068
-
3069
- var TypeError$3 = global$8.TypeError;
3070
-
3071
- var Result = function (stopped, result) {
3072
- this.stopped = stopped;
3073
- this.result = result;
3074
- };
3075
-
3076
- var ResultPrototype = Result.prototype;
3077
-
3078
- var iterate$1 = function (iterable, unboundFunction, options) {
3079
- var that = options && options.that;
3080
- var AS_ENTRIES = !!(options && options.AS_ENTRIES);
3081
- var IS_ITERATOR = !!(options && options.IS_ITERATOR);
3082
- var INTERRUPTED = !!(options && options.INTERRUPTED);
3083
- var fn = bind$3(unboundFunction, that);
3084
- var iterator, iterFn, index, length, result, next, step;
3085
-
3086
- var stop = function (condition) {
3087
- if (iterator) iteratorClose(iterator, 'normal', condition);
3088
- return new Result(true, condition);
3089
- };
3090
-
3091
- var callFn = function (value) {
3092
- if (AS_ENTRIES) {
3093
- anObject$2(value);
3094
- return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
3095
- } return INTERRUPTED ? fn(value, stop) : fn(value);
3096
- };
3097
-
3098
- if (IS_ITERATOR) {
3099
- iterator = iterable;
3100
- } else {
3101
- iterFn = getIteratorMethod(iterable);
3102
- if (!iterFn) throw TypeError$3(tryToString(iterable) + ' is not iterable');
3103
- // optimisation for array iterators
3104
- if (isArrayIteratorMethod(iterFn)) {
3105
- for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
3106
- result = callFn(iterable[index]);
3107
- if (result && isPrototypeOf$2(ResultPrototype, result)) return result;
3108
- } return new Result(false);
3109
- }
3110
- iterator = getIterator(iterable, iterFn);
3111
- }
3112
-
3113
- next = iterator.next;
3114
- while (!(step = call$1(next, iterator)).done) {
3115
- try {
3116
- result = callFn(step.value);
3117
- } catch (error) {
3118
- iteratorClose(iterator, 'throw', error);
3119
- }
3120
- if (typeof result == 'object' && result && isPrototypeOf$2(ResultPrototype, result)) return result;
3121
- } return new Result(false);
3122
- };
3123
-
3124
- var wellKnownSymbol$1 = wellKnownSymbol$h;
3125
-
3126
- var ITERATOR = wellKnownSymbol$1('iterator');
3127
- var SAFE_CLOSING = false;
3128
-
3129
- try {
3130
- var called = 0;
3131
- var iteratorWithReturn = {
3132
- next: function () {
3133
- return { done: !!called++ };
3134
- },
3135
- 'return': function () {
3136
- SAFE_CLOSING = true;
3137
- }
3138
- };
3139
- iteratorWithReturn[ITERATOR] = function () {
3140
- return this;
3141
- };
3142
- // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
3143
- Array.from(iteratorWithReturn, function () { throw 2; });
3144
- } catch (error) { /* empty */ }
3145
-
3146
- var checkCorrectnessOfIteration$1 = function (exec, SKIP_CLOSING) {
3147
- if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
3148
- var ITERATION_SUPPORT = false;
3149
- try {
3150
- var object = {};
3151
- object[ITERATOR] = function () {
3152
- return {
3153
- next: function () {
3154
- return { done: ITERATION_SUPPORT = true };
3155
- }
3156
- };
3157
- };
3158
- exec(object);
3159
- } catch (error) { /* empty */ }
3160
- return ITERATION_SUPPORT;
3161
- };
3162
-
3163
- var uncurryThis$2 = functionUncurryThis;
3164
-
3165
- var arraySlice$1 = uncurryThis$2([].slice);
3166
-
3167
- var global$7 = global$J;
3168
-
3169
- var TypeError$2 = global$7.TypeError;
3170
-
3171
- var validateArgumentsLength$1 = function (passed, required) {
3172
- if (passed < required) throw TypeError$2('Not enough arguments');
3173
- return passed;
3174
- };
3175
-
3176
- var userAgent$2 = engineUserAgent;
3177
-
3178
- var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$2);
3179
-
3180
- var global$6 = global$J;
3181
- var apply = functionApply;
3182
- var bind$2 = functionBindContext;
3183
- var isCallable$2 = isCallable$k;
3184
- var hasOwn$1 = hasOwnProperty_1;
3185
- var fails$1 = fails$k;
3186
- var html = html$2;
3187
- var arraySlice = arraySlice$1;
3188
- var createElement = documentCreateElement$2;
3189
- var validateArgumentsLength = validateArgumentsLength$1;
3190
- var IS_IOS$1 = engineIsIos;
3191
- var IS_NODE$2 = engineIsNode;
3192
-
3193
- var set = global$6.setImmediate;
3194
- var clear = global$6.clearImmediate;
3195
- var process$3 = global$6.process;
3196
- var Dispatch = global$6.Dispatch;
3197
- var Function$1 = global$6.Function;
3198
- var MessageChannel = global$6.MessageChannel;
3199
- var String$1 = global$6.String;
3200
- var counter = 0;
3201
- var queue$1 = {};
3202
- var ONREADYSTATECHANGE = 'onreadystatechange';
3203
- var location, defer, channel, port;
3204
-
3205
- try {
3206
- // Deno throws a ReferenceError on `location` access without `--location` flag
3207
- location = global$6.location;
3208
- } catch (error) { /* empty */ }
3209
-
3210
- var run = function (id) {
3211
- if (hasOwn$1(queue$1, id)) {
3212
- var fn = queue$1[id];
3213
- delete queue$1[id];
3214
- fn();
3215
- }
3216
- };
3217
-
3218
- var runner = function (id) {
3219
- return function () {
3220
- run(id);
3221
- };
3222
- };
3223
-
3224
- var listener = function (event) {
3225
- run(event.data);
3226
- };
3227
-
3228
- var post = function (id) {
3229
- // old engines have not location.origin
3230
- global$6.postMessage(String$1(id), location.protocol + '//' + location.host);
3231
- };
3232
-
3233
- // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
3234
- if (!set || !clear) {
3235
- set = function setImmediate(handler) {
3236
- validateArgumentsLength(arguments.length, 1);
3237
- var fn = isCallable$2(handler) ? handler : Function$1(handler);
3238
- var args = arraySlice(arguments, 1);
3239
- queue$1[++counter] = function () {
3240
- apply(fn, undefined, args);
3241
- };
3242
- defer(counter);
3243
- return counter;
3244
- };
3245
- clear = function clearImmediate(id) {
3246
- delete queue$1[id];
3247
- };
3248
- // Node.js 0.8-
3249
- if (IS_NODE$2) {
3250
- defer = function (id) {
3251
- process$3.nextTick(runner(id));
3252
- };
3253
- // Sphere (JS game engine) Dispatch API
3254
- } else if (Dispatch && Dispatch.now) {
3255
- defer = function (id) {
3256
- Dispatch.now(runner(id));
3257
- };
3258
- // Browsers with MessageChannel, includes WebWorkers
3259
- // except iOS - https://github.com/zloirock/core-js/issues/624
3260
- } else if (MessageChannel && !IS_IOS$1) {
3261
- channel = new MessageChannel();
3262
- port = channel.port2;
3263
- channel.port1.onmessage = listener;
3264
- defer = bind$2(port.postMessage, port);
3265
- // Browsers with postMessage, skip WebWorkers
3266
- // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
3267
- } else if (
3268
- global$6.addEventListener &&
3269
- isCallable$2(global$6.postMessage) &&
3270
- !global$6.importScripts &&
3271
- location && location.protocol !== 'file:' &&
3272
- !fails$1(post)
3273
- ) {
3274
- defer = post;
3275
- global$6.addEventListener('message', listener, false);
3276
- // IE8-
3277
- } else if (ONREADYSTATECHANGE in createElement('script')) {
3278
- defer = function (id) {
3279
- html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
3280
- html.removeChild(this);
3281
- run(id);
3282
- };
3283
- };
3284
- // Rest old browsers
3285
- } else {
3286
- defer = function (id) {
3287
- setTimeout(runner(id), 0);
3288
- };
3289
- }
3290
- }
3291
-
3292
- var task$1 = {
3293
- set: set,
3294
- clear: clear
3295
- };
3296
-
3297
- var userAgent$1 = engineUserAgent;
3298
- var global$5 = global$J;
3299
-
3300
- var engineIsIosPebble = /ipad|iphone|ipod/i.test(userAgent$1) && global$5.Pebble !== undefined;
3301
-
3302
- var userAgent = engineUserAgent;
3303
-
3304
- var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(userAgent);
3305
-
3306
- var global$4 = global$J;
3307
- var bind$1 = functionBindContext;
3308
- var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
3309
- var macrotask = task$1.set;
3310
- var IS_IOS = engineIsIos;
3311
- var IS_IOS_PEBBLE = engineIsIosPebble;
3312
- var IS_WEBOS_WEBKIT = engineIsWebosWebkit;
3313
- var IS_NODE$1 = engineIsNode;
3314
-
3315
- var MutationObserver = global$4.MutationObserver || global$4.WebKitMutationObserver;
3316
- var document$2 = global$4.document;
3317
- var process$2 = global$4.process;
3318
- var Promise$1 = global$4.Promise;
3319
- // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
3320
- var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global$4, 'queueMicrotask');
3321
- var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
3322
-
3323
- var flush, head, last, notify$1, toggle, node, promise, then;
3324
-
3325
- // modern engines have queueMicrotask method
3326
- if (!queueMicrotask) {
3327
- flush = function () {
3328
- var parent, fn;
3329
- if (IS_NODE$1 && (parent = process$2.domain)) parent.exit();
3330
- while (head) {
3331
- fn = head.fn;
3332
- head = head.next;
3333
- try {
3334
- fn();
3335
- } catch (error) {
3336
- if (head) notify$1();
3337
- else last = undefined;
3338
- throw error;
3339
- }
3340
- } last = undefined;
3341
- if (parent) parent.enter();
3342
- };
3343
-
3344
- // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
3345
- // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
3346
- if (!IS_IOS && !IS_NODE$1 && !IS_WEBOS_WEBKIT && MutationObserver && document$2) {
3347
- toggle = true;
3348
- node = document$2.createTextNode('');
3349
- new MutationObserver(flush).observe(node, { characterData: true });
3350
- notify$1 = function () {
3351
- node.data = toggle = !toggle;
3352
- };
3353
- // environments with maybe non-completely correct, but existent Promise
3354
- } else if (!IS_IOS_PEBBLE && Promise$1 && Promise$1.resolve) {
3355
- // Promise.resolve without an argument throws an error in LG WebOS 2
3356
- promise = Promise$1.resolve(undefined);
3357
- // workaround of WebKit ~ iOS Safari 10.1 bug
3358
- promise.constructor = Promise$1;
3359
- then = bind$1(promise.then, promise);
3360
- notify$1 = function () {
3361
- then(flush);
3362
- };
3363
- // Node.js without promises
3364
- } else if (IS_NODE$1) {
3365
- notify$1 = function () {
3366
- process$2.nextTick(flush);
3367
- };
3368
- // for other environments - macrotask based on:
3369
- // - setImmediate
3370
- // - MessageChannel
3371
- // - window.postMessag
3372
- // - onreadystatechange
3373
- // - setTimeout
3374
- } else {
3375
- // strange IE + webpack dev server bug - use .bind(global)
3376
- macrotask = bind$1(macrotask, global$4);
3377
- notify$1 = function () {
3378
- macrotask(flush);
3379
- };
3380
- }
3381
- }
3382
-
3383
- var microtask$1 = queueMicrotask || function (fn) {
3384
- var task = { fn: fn, next: undefined };
3385
- if (last) last.next = task;
3386
- if (!head) {
3387
- head = task;
3388
- notify$1();
3389
- } last = task;
3390
- };
3391
-
3392
- var newPromiseCapability$2 = {};
3393
-
3394
- var aCallable$1 = aCallable$6;
3395
-
3396
- var PromiseCapability = function (C) {
3397
- var resolve, reject;
3398
- this.promise = new C(function ($$resolve, $$reject) {
3399
- if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
3400
- resolve = $$resolve;
3401
- reject = $$reject;
3402
- });
3403
- this.resolve = aCallable$1(resolve);
3404
- this.reject = aCallable$1(reject);
3405
- };
3406
-
3407
- // `NewPromiseCapability` abstract operation
3408
- // https://tc39.es/ecma262/#sec-newpromisecapability
3409
- newPromiseCapability$2.f = function (C) {
3410
- return new PromiseCapability(C);
3411
- };
3412
-
3413
- var anObject$1 = anObject$h;
3414
- var isObject$1 = isObject$8;
3415
- var newPromiseCapability$1 = newPromiseCapability$2;
3416
-
3417
- var promiseResolve$1 = function (C, x) {
3418
- anObject$1(C);
3419
- if (isObject$1(x) && x.constructor === C) return x;
3420
- var promiseCapability = newPromiseCapability$1.f(C);
3421
- var resolve = promiseCapability.resolve;
3422
- resolve(x);
3423
- return promiseCapability.promise;
3424
- };
3425
-
3426
- var global$3 = global$J;
3427
-
3428
- var hostReportErrors$1 = function (a, b) {
3429
- var console = global$3.console;
3430
- if (console && console.error) {
3431
- arguments.length == 1 ? console.error(a) : console.error(a, b);
3432
- }
3433
- };
3434
-
3435
- var perform$1 = function (exec) {
3436
- try {
3437
- return { error: false, value: exec() };
3438
- } catch (error) {
3439
- return { error: true, value: error };
3440
- }
3441
- };
3442
-
3443
- var Queue$1 = function () {
3444
- this.head = null;
3445
- this.tail = null;
3446
- };
3447
-
3448
- Queue$1.prototype = {
3449
- add: function (item) {
3450
- var entry = { item: item, next: null };
3451
- if (this.head) this.tail.next = entry;
3452
- else this.head = entry;
3453
- this.tail = entry;
3454
- },
3455
- get: function () {
3456
- var entry = this.head;
3457
- if (entry) {
3458
- this.head = entry.next;
3459
- if (this.tail === entry) this.tail = null;
3460
- return entry.item;
3461
- }
3462
- }
3463
- };
3464
-
3465
- var queue = Queue$1;
3466
-
3467
- var engineIsBrowser = typeof window == 'object';
3468
-
3469
- var $$1 = _export;
3470
- var global$2 = global$J;
3471
- var getBuiltIn = getBuiltIn$7;
3472
- var call = functionCall;
3473
- var NativePromise = nativePromiseConstructor;
3474
- var redefine$1 = redefine$7.exports;
3475
- var redefineAll = redefineAll$1;
3476
- var setPrototypeOf = objectSetPrototypeOf;
3477
- var setToStringTag = setToStringTag$3;
3478
- var setSpecies = setSpecies$1;
3479
- var aCallable = aCallable$6;
3480
- var isCallable$1 = isCallable$k;
3481
- var isObject = isObject$8;
3482
- var anInstance = anInstance$1;
3483
- var inspectSource = inspectSource$4;
3484
- var iterate = iterate$1;
3485
- var checkCorrectnessOfIteration = checkCorrectnessOfIteration$1;
3486
- var speciesConstructor = speciesConstructor$2;
3487
- var task = task$1.set;
3488
- var microtask = microtask$1;
3489
- var promiseResolve = promiseResolve$1;
3490
- var hostReportErrors = hostReportErrors$1;
3491
- var newPromiseCapabilityModule = newPromiseCapability$2;
3492
- var perform = perform$1;
3493
- var Queue = queue;
3494
- var InternalStateModule = internalState;
3495
- var isForced = isForced_1;
3496
- var wellKnownSymbol = wellKnownSymbol$h;
3497
- var IS_BROWSER = engineIsBrowser;
3498
- var IS_NODE = engineIsNode;
3499
- var V8_VERSION = engineV8Version;
3500
-
3501
- var SPECIES = wellKnownSymbol('species');
3502
- var PROMISE = 'Promise';
3503
-
3504
- var getInternalState = InternalStateModule.getterFor(PROMISE);
3505
- var setInternalState = InternalStateModule.set;
3506
- var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
3507
- var NativePromisePrototype = NativePromise && NativePromise.prototype;
3508
- var PromiseConstructor = NativePromise;
3509
- var PromisePrototype = NativePromisePrototype;
3510
- var TypeError$1 = global$2.TypeError;
3511
- var document$1 = global$2.document;
3512
- var process$1 = global$2.process;
3513
- var newPromiseCapability = newPromiseCapabilityModule.f;
3514
- var newGenericPromiseCapability = newPromiseCapability;
3515
-
3516
- var DISPATCH_EVENT = !!(document$1 && document$1.createEvent && global$2.dispatchEvent);
3517
- var NATIVE_REJECTION_EVENT = isCallable$1(global$2.PromiseRejectionEvent);
3518
- var UNHANDLED_REJECTION = 'unhandledrejection';
3519
- var REJECTION_HANDLED = 'rejectionhandled';
3520
- var PENDING = 0;
3521
- var FULFILLED = 1;
3522
- var REJECTED = 2;
3523
- var HANDLED = 1;
3524
- var UNHANDLED = 2;
3525
- var SUBCLASSING = false;
3526
-
3527
- var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
3528
-
3529
- var FORCED = isForced(PROMISE, function () {
3530
- var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(PromiseConstructor);
3531
- var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(PromiseConstructor);
3532
- // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
3533
- // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
3534
- // We can't detect it synchronously, so just check versions
3535
- if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
3536
- // We can't use @@species feature detection in V8 since it causes
3537
- // deoptimization and performance degradation
3538
- // https://github.com/zloirock/core-js/issues/679
3539
- if (V8_VERSION >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) return false;
3540
- // Detect correctness of subclassing with @@species support
3541
- var promise = new PromiseConstructor(function (resolve) { resolve(1); });
3542
- var FakePromise = function (exec) {
3543
- exec(function () { /* empty */ }, function () { /* empty */ });
3544
- };
3545
- var constructor = promise.constructor = {};
3546
- constructor[SPECIES] = FakePromise;
3547
- SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
3548
- if (!SUBCLASSING) return true;
3549
- // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
3550
- return !GLOBAL_CORE_JS_PROMISE && IS_BROWSER && !NATIVE_REJECTION_EVENT;
3551
- });
3552
-
3553
- var INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) {
3554
- PromiseConstructor.all(iterable)['catch'](function () { /* empty */ });
3555
- });
3556
-
3557
- // helpers
3558
- var isThenable = function (it) {
3559
- var then;
3560
- return isObject(it) && isCallable$1(then = it.then) ? then : false;
3561
- };
3562
-
3563
- var callReaction = function (reaction, state) {
3564
- var value = state.value;
3565
- var ok = state.state == FULFILLED;
3566
- var handler = ok ? reaction.ok : reaction.fail;
3567
- var resolve = reaction.resolve;
3568
- var reject = reaction.reject;
3569
- var domain = reaction.domain;
3570
- var result, then, exited;
3571
- try {
3572
- if (handler) {
3573
- if (!ok) {
3574
- if (state.rejection === UNHANDLED) onHandleUnhandled(state);
3575
- state.rejection = HANDLED;
3576
- }
3577
- if (handler === true) result = value;
3578
- else {
3579
- if (domain) domain.enter();
3580
- result = handler(value); // can throw
3581
- if (domain) {
3582
- domain.exit();
3583
- exited = true;
3584
- }
3585
- }
3586
- if (result === reaction.promise) {
3587
- reject(TypeError$1('Promise-chain cycle'));
3588
- } else if (then = isThenable(result)) {
3589
- call(then, result, resolve, reject);
3590
- } else resolve(result);
3591
- } else reject(value);
3592
- } catch (error) {
3593
- if (domain && !exited) domain.exit();
3594
- reject(error);
3595
- }
3596
- };
3597
-
3598
- var notify = function (state, isReject) {
3599
- if (state.notified) return;
3600
- state.notified = true;
3601
- microtask(function () {
3602
- var reactions = state.reactions;
3603
- var reaction;
3604
- while (reaction = reactions.get()) {
3605
- callReaction(reaction, state);
3606
- }
3607
- state.notified = false;
3608
- if (isReject && !state.rejection) onUnhandled(state);
3609
- });
3610
- };
3611
-
3612
- var dispatchEvent = function (name, promise, reason) {
3613
- var event, handler;
3614
- if (DISPATCH_EVENT) {
3615
- event = document$1.createEvent('Event');
3616
- event.promise = promise;
3617
- event.reason = reason;
3618
- event.initEvent(name, false, true);
3619
- global$2.dispatchEvent(event);
3620
- } else event = { promise: promise, reason: reason };
3621
- if (!NATIVE_REJECTION_EVENT && (handler = global$2['on' + name])) handler(event);
3622
- else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
3623
- };
3624
-
3625
- var onUnhandled = function (state) {
3626
- call(task, global$2, function () {
3627
- var promise = state.facade;
3628
- var value = state.value;
3629
- var IS_UNHANDLED = isUnhandled(state);
3630
- var result;
3631
- if (IS_UNHANDLED) {
3632
- result = perform(function () {
3633
- if (IS_NODE) {
3634
- process$1.emit('unhandledRejection', value, promise);
3635
- } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
3636
- });
3637
- // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
3638
- state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
3639
- if (result.error) throw result.value;
3640
- }
3641
- });
3642
- };
3643
-
3644
- var isUnhandled = function (state) {
3645
- return state.rejection !== HANDLED && !state.parent;
3646
- };
3647
-
3648
- var onHandleUnhandled = function (state) {
3649
- call(task, global$2, function () {
3650
- var promise = state.facade;
3651
- if (IS_NODE) {
3652
- process$1.emit('rejectionHandled', promise);
3653
- } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
3654
- });
3655
- };
3656
-
3657
- var bind = function (fn, state, unwrap) {
3658
- return function (value) {
3659
- fn(state, value, unwrap);
3660
- };
3661
- };
3662
-
3663
- var internalReject = function (state, value, unwrap) {
3664
- if (state.done) return;
3665
- state.done = true;
3666
- if (unwrap) state = unwrap;
3667
- state.value = value;
3668
- state.state = REJECTED;
3669
- notify(state, true);
3670
- };
3671
-
3672
- var internalResolve = function (state, value, unwrap) {
3673
- if (state.done) return;
3674
- state.done = true;
3675
- if (unwrap) state = unwrap;
3676
- try {
3677
- if (state.facade === value) throw TypeError$1("Promise can't be resolved itself");
3678
- var then = isThenable(value);
3679
- if (then) {
3680
- microtask(function () {
3681
- var wrapper = { done: false };
3682
- try {
3683
- call(then, value,
3684
- bind(internalResolve, wrapper, state),
3685
- bind(internalReject, wrapper, state)
3686
- );
3687
- } catch (error) {
3688
- internalReject(wrapper, error, state);
3689
- }
3690
- });
3691
- } else {
3692
- state.value = value;
3693
- state.state = FULFILLED;
3694
- notify(state, false);
3695
- }
3696
- } catch (error) {
3697
- internalReject({ done: false }, error, state);
3698
- }
3699
- };
3700
-
3701
- // constructor polyfill
3702
- if (FORCED) {
3703
- // 25.4.3.1 Promise(executor)
3704
- PromiseConstructor = function Promise(executor) {
3705
- anInstance(this, PromisePrototype);
3706
- aCallable(executor);
3707
- call(Internal, this);
3708
- var state = getInternalState(this);
3709
- try {
3710
- executor(bind(internalResolve, state), bind(internalReject, state));
3711
- } catch (error) {
3712
- internalReject(state, error);
3713
- }
3714
- };
3715
- PromisePrototype = PromiseConstructor.prototype;
3716
- // eslint-disable-next-line no-unused-vars -- required for `.length`
3717
- Internal = function Promise(executor) {
3718
- setInternalState(this, {
3719
- type: PROMISE,
3720
- done: false,
3721
- notified: false,
3722
- parent: false,
3723
- reactions: new Queue(),
3724
- rejection: false,
3725
- state: PENDING,
3726
- value: undefined
3727
- });
3728
- };
3729
- Internal.prototype = redefineAll(PromisePrototype, {
3730
- // `Promise.prototype.then` method
3731
- // https://tc39.es/ecma262/#sec-promise.prototype.then
3732
- // eslint-disable-next-line unicorn/no-thenable -- safe
3733
- then: function then(onFulfilled, onRejected) {
3734
- var state = getInternalPromiseState(this);
3735
- var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
3736
- state.parent = true;
3737
- reaction.ok = isCallable$1(onFulfilled) ? onFulfilled : true;
3738
- reaction.fail = isCallable$1(onRejected) && onRejected;
3739
- reaction.domain = IS_NODE ? process$1.domain : undefined;
3740
- if (state.state == PENDING) state.reactions.add(reaction);
3741
- else microtask(function () {
3742
- callReaction(reaction, state);
3743
- });
3744
- return reaction.promise;
3745
- },
3746
- // `Promise.prototype.catch` method
3747
- // https://tc39.es/ecma262/#sec-promise.prototype.catch
3748
- 'catch': function (onRejected) {
3749
- return this.then(undefined, onRejected);
3750
- }
3751
- });
3752
- OwnPromiseCapability = function () {
3753
- var promise = new Internal();
3754
- var state = getInternalState(promise);
3755
- this.promise = promise;
3756
- this.resolve = bind(internalResolve, state);
3757
- this.reject = bind(internalReject, state);
3758
- };
3759
- newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
3760
- return C === PromiseConstructor || C === PromiseWrapper
3761
- ? new OwnPromiseCapability(C)
3762
- : newGenericPromiseCapability(C);
3763
- };
3764
-
3765
- if (isCallable$1(NativePromise) && NativePromisePrototype !== Object.prototype) {
3766
- nativeThen = NativePromisePrototype.then;
3767
-
3768
- if (!SUBCLASSING) {
3769
- // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
3770
- redefine$1(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {
3771
- var that = this;
3772
- return new PromiseConstructor(function (resolve, reject) {
3773
- call(nativeThen, that, resolve, reject);
3774
- }).then(onFulfilled, onRejected);
3775
- // https://github.com/zloirock/core-js/issues/640
3776
- }, { unsafe: true });
3777
-
3778
- // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
3779
- redefine$1(NativePromisePrototype, 'catch', PromisePrototype['catch'], { unsafe: true });
3780
- }
3781
-
3782
- // make `.constructor === Promise` work for native promise-based APIs
3783
- try {
3784
- delete NativePromisePrototype.constructor;
3785
- } catch (error) { /* empty */ }
3786
-
3787
- // make `instanceof Promise` work for native promise-based APIs
3788
- if (setPrototypeOf) {
3789
- setPrototypeOf(NativePromisePrototype, PromisePrototype);
3790
- }
3791
- }
3792
- }
3793
-
3794
- $$1({ global: true, wrap: true, forced: FORCED }, {
3795
- Promise: PromiseConstructor
3796
- });
3797
-
3798
- setToStringTag(PromiseConstructor, PROMISE, false);
3799
- setSpecies(PROMISE);
3800
-
3801
- PromiseWrapper = getBuiltIn(PROMISE);
3802
-
3803
- // statics
3804
- $$1({ target: PROMISE, stat: true, forced: FORCED }, {
3805
- // `Promise.reject` method
3806
- // https://tc39.es/ecma262/#sec-promise.reject
3807
- reject: function reject(r) {
3808
- var capability = newPromiseCapability(this);
3809
- call(capability.reject, undefined, r);
3810
- return capability.promise;
3811
- }
3812
- });
3813
-
3814
- $$1({ target: PROMISE, stat: true, forced: FORCED }, {
3815
- // `Promise.resolve` method
3816
- // https://tc39.es/ecma262/#sec-promise.resolve
3817
- resolve: function resolve(x) {
3818
- return promiseResolve(this, x);
3819
- }
3820
- });
3821
-
3822
- $$1({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, {
3823
- // `Promise.all` method
3824
- // https://tc39.es/ecma262/#sec-promise.all
3825
- all: function all(iterable) {
3826
- var C = this;
3827
- var capability = newPromiseCapability(C);
3828
- var resolve = capability.resolve;
3829
- var reject = capability.reject;
3830
- var result = perform(function () {
3831
- var $promiseResolve = aCallable(C.resolve);
3832
- var values = [];
3833
- var counter = 0;
3834
- var remaining = 1;
3835
- iterate(iterable, function (promise) {
3836
- var index = counter++;
3837
- var alreadyCalled = false;
3838
- remaining++;
3839
- call($promiseResolve, C, promise).then(function (value) {
3840
- if (alreadyCalled) return;
3841
- alreadyCalled = true;
3842
- values[index] = value;
3843
- --remaining || resolve(values);
3844
- }, reject);
3845
- });
3846
- --remaining || resolve(values);
3847
- });
3848
- if (result.error) reject(result.value);
3849
- return capability.promise;
3850
- },
3851
- // `Promise.race` method
3852
- // https://tc39.es/ecma262/#sec-promise.race
3853
- race: function race(iterable) {
3854
- var C = this;
3855
- var capability = newPromiseCapability(C);
3856
- var reject = capability.reject;
3857
- var result = perform(function () {
3858
- var $promiseResolve = aCallable(C.resolve);
3859
- iterate(iterable, function (promise) {
3860
- call($promiseResolve, C, promise).then(capability.resolve, reject);
3861
- });
3862
- });
3863
- if (result.error) reject(result.value);
3864
- return capability.promise;
3865
- }
3866
- });
3867
-
3868
- const api = ["get", "post", "put", "patch", "delete"].reduce((api, method) => {
3869
- api[method] = (endpoint, options = {}) => __awaiter(void 0, void 0, void 0, function* () {
3870
- const {
3871
- json = {},
3872
- params,
3873
- headers = {},
3874
- timeout = 10000
3875
- } = options;
3876
- const requestInit = {
3877
- method: method.toUpperCase(),
3878
- headers: Object.assign({
3879
- "content-type": "application/json"
3880
- }, headers)
3881
- };
3882
- const timeoutNumber = Number(timeout);
3883
- let controller;
3884
- let timeoutId;
3885
- let url = `/api/${endpoint.replace(/^\/*/, "")}`;
3886
-
3887
- if (method !== "get") {
3888
- requestInit.body = JSON.stringify(json);
3889
- }
3890
-
3891
- if (timeoutNumber > 0) {
3892
- controller = new AbortController();
3893
- timeoutId = setTimeout(() => controller.abort(), timeoutNumber);
3894
- requestInit.signal = controller.signal;
3895
- }
3896
-
3897
- if (params) {
3898
- url += utils.buildUrlQueryString(params);
3899
- }
3900
-
3901
- const response = yield fetch(url, requestInit);
3902
-
3903
- if (timeoutId) {
3904
- clearTimeout(timeoutId);
3905
- }
3906
-
3907
- const result = yield response.json();
3908
- return result;
3909
- });
3910
-
3911
- return api;
3912
- }, {});
3913
-
3914
- function useSubmit(url, transformData) {
3915
- const [state, submit] = reactUse.useAsyncFn(json => __awaiter(this, void 0, void 0, function* () {
3916
- if (transformData) json = transformData(json);
3917
- const response = yield api.post(url, {
3918
- json
3919
- });
3920
-
3921
- if ("production" !== process.env["NODE_ENV"]) {
3922
- console.log("[@koine/next] useSubmit response", response);
3923
- }
3924
-
3925
- return response;
3926
- }), [url, transformData]);
3927
- const {
3928
- loading,
3929
- error,
3930
- value
3931
- } = state;
3932
- const fail = !loading && (!!error || (value === null || value === void 0 ? void 0 : value.fail));
3933
- return Object.assign(Object.assign({
3934
- submit,
3935
- loading
3936
- }, value || {}), {
3937
- fail
3938
- });
3939
- }
3940
-
3941
- const NextImg = NextImage__default["default"];
3942
- const NextImgSmart = props => {
3943
- const [$loaded, setLoaded] = react.useState(false);
3944
- const [$error, setError] = react.useState(false);
3945
- const {
3946
- nextImgProps,
3947
- restProps
3948
- } = getNextImgProps(props);
3949
- const {
3950
- Wrap
3951
- } = restProps;
3952
- return nextImgProps.priority ? jsxRuntime.jsx(NextImage__default["default"], Object.assign({}, nextImgProps)) : jsxRuntime.jsx(Wrap, Object.assign({}, restProps, {
3953
- "$loaded": $loaded,
3954
- "$error": $error
3955
- }, {
3956
- children: jsxRuntime.jsx(NextImage__default["default"], Object.assign({}, nextImgProps, {
3957
- onLoadingComplete: () => setLoaded(true),
3958
- onError: () => setError(true)
3959
- }))
3960
- }));
3961
- };
3962
- function getNextImgProps(_a) {
3963
- var {
3964
- src,
3965
- alt,
3966
- layout,
3967
- blurDataURL,
3968
- width,
3969
- height,
3970
- priority,
3971
- objectFit,
3972
- objectPosition
3973
- } = _a,
3974
- restProps = __rest(_a, ["src", "alt", "layout", "blurDataURL", "width", "height", "priority", "objectFit", "objectPosition"]);
3975
-
3976
- const nextImgProps = {
3977
- src,
3978
- alt,
3979
- layout,
3980
- blurDataURL,
3981
- width,
3982
- height,
3983
- priority,
3984
- objectFit,
3985
- objectPosition
3986
- };
3987
- return {
3988
- nextImgProps,
3989
- restProps
3990
- };
3991
- }
3992
-
3993
- /**
3994
- * @see https://next.js.org/docs/api-reference/next/link
3995
- */
3996
-
3997
- const Link = /*#__PURE__*/react.forwardRef(function Link(_a, ref) {
3998
- var {
3999
- href,
4000
- prefetch,
4001
- replace,
4002
- scroll,
4003
- shallow,
4004
- locale
4005
- } = _a,
4006
- props = __rest(_a, ["href", "prefetch", "replace", "scroll", "shallow", "locale"]);
4007
-
4008
- return jsxRuntime.jsx(NextLink__default["default"], Object.assign({
4009
- href: href,
4010
- replace: replace,
4011
- scroll: scroll,
4012
- shallow: shallow,
4013
- locale: locale,
4014
- passHref: true
4015
- }, {
4016
- children: jsxRuntime.jsx(react$1.KoineLink, Object.assign({
4017
- ref: ref
4018
- }, props))
4019
- }));
4020
- });
4021
-
4022
- const NextProgress = ({
4023
- startAt: _startAt = 0.3,
4024
- showOnShallow: _showOnShallow = true,
4025
- stopDelayMs: _stopDelayMs = 200
4026
- }) => {
4027
- const {
4028
- events
4029
- } = router.useRouter(); // const [progress, setProgress] = useState(0);
4030
-
4031
- const [running, setRunning] = react.useState(false);
4032
- const timer = react.useRef(null);
4033
- const routeChangeStart = react.useCallback((_, {
4034
- shallow
4035
- }) => {
4036
- if (!shallow || _showOnShallow) {
4037
- // setProgress(startAt);
4038
- setRunning(true);
4039
- }
4040
- }, [_showOnShallow]);
4041
- const routeChangeEnd = react.useCallback((_, {
4042
- shallow
4043
- }) => {
4044
- if (!shallow || _showOnShallow) {
4045
- if (timer.current) {
4046
- clearTimeout(timer.current);
4047
- }
4048
-
4049
- timer.current = setTimeout(() => {
4050
- // setProgress(100);
4051
- setRunning(false);
4052
- }, _stopDelayMs);
4053
- }
4054
- }, [_showOnShallow, _stopDelayMs, timer]);
4055
- react.useEffect(() => {
4056
- events.on("routeChangeStart", routeChangeStart);
4057
- events.on("routeChangeComplete", routeChangeEnd);
4058
- events.on("routeChangeError", routeChangeEnd);
4059
- return () => {
4060
- events.off("routeChangeStart", routeChangeStart);
4061
- events.off("routeChangeComplete", routeChangeEnd);
4062
- events.off("routeChangeError", routeChangeEnd);
4063
- };
4064
- }, [events, routeChangeStart, routeChangeEnd]);
4065
- return jsxRuntime.jsx(react$1.ProgressOverlay, {
4066
- running: running
4067
- });
4068
- };
4069
-
4070
- var $ = _export;
4071
- var DESCRIPTORS = descriptors;
4072
- var global$1 = global$J;
4073
- var uncurryThis$1 = functionUncurryThis;
4074
- var hasOwn = hasOwnProperty_1;
4075
- var isCallable = isCallable$k;
4076
- var isPrototypeOf$1 = objectIsPrototypeOf;
4077
- var toString = toString$7;
4078
- var defineProperty = objectDefineProperty.f;
4079
- var copyConstructorProperties = copyConstructorProperties$2;
4080
-
4081
- var NativeSymbol = global$1.Symbol;
4082
- var SymbolPrototype = NativeSymbol && NativeSymbol.prototype;
4083
-
4084
- if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) ||
4085
- // Safari 12 bug
4086
- NativeSymbol().description !== undefined
4087
- )) {
4088
- var EmptyStringDescriptionStore = {};
4089
- // wrap Symbol constructor for correct work with undefined description
4090
- var SymbolWrapper = function Symbol() {
4091
- var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString(arguments[0]);
4092
- var result = isPrototypeOf$1(SymbolPrototype, this)
4093
- ? new NativeSymbol(description)
4094
- // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
4095
- : description === undefined ? NativeSymbol() : NativeSymbol(description);
4096
- if (description === '') EmptyStringDescriptionStore[result] = true;
4097
- return result;
4098
- };
4099
-
4100
- copyConstructorProperties(SymbolWrapper, NativeSymbol);
4101
- SymbolWrapper.prototype = SymbolPrototype;
4102
- SymbolPrototype.constructor = SymbolWrapper;
4103
-
4104
- var NATIVE_SYMBOL = String(NativeSymbol('test')) == 'Symbol(test)';
4105
- var symbolToString = uncurryThis$1(SymbolPrototype.toString);
4106
- var symbolValueOf = uncurryThis$1(SymbolPrototype.valueOf);
4107
- var regexp = /^Symbol\((.*)\)[^)]+$/;
4108
- var replace = uncurryThis$1(''.replace);
4109
- var stringSlice = uncurryThis$1(''.slice);
4110
-
4111
- defineProperty(SymbolPrototype, 'description', {
4112
- configurable: true,
4113
- get: function description() {
4114
- var symbol = symbolValueOf(this);
4115
- var string = symbolToString(symbol);
4116
- if (hasOwn(EmptyStringDescriptionStore, symbol)) return '';
4117
- var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, '$1');
4118
- return desc === '' ? undefined : desc;
4119
- }
4120
- });
4121
-
4122
- $({ global: true, forced: true }, {
4123
- Symbol: SymbolWrapper
4124
- });
4125
- }
4126
-
4127
- const defaults = {
4128
- tplTitle: ""
4129
- };
4130
- /**
4131
- * We do a couple of things in addition while many other are removed.
4132
- *
4133
- * - Add `seo` meta object coming from a CMS probably
4134
- * - Add `ogimage` and `openGraph.image` as single image source
4135
- * - Add `og` alias to define `openGraph`
4136
- * - Add check for `title` equale to `templateTitle` to avoid meta titles like
4137
- * "My site | My site" often happening in homepages
4138
- * - Remove the open graph videos and images
4139
- *
4140
- * - Shorter code
4141
- *
4142
- * @returns
4143
- */
4144
-
4145
- const buildTags = ({
4146
- seo,
4147
- hidden,
4148
- keywords,
4149
- title: _title = "",
4150
- titleTemplate,
4151
- defaultTitle,
4152
- noindex,
4153
- nofollow,
4154
- description,
4155
- languageAlternates: _languageAlternates = [],
4156
- twitter,
4157
- facebook,
4158
- openGraph,
4159
- og: ogAlias,
4160
- canonical,
4161
- metaTags,
4162
- linkTags
4163
- } = {}) => {
4164
- const render = [];
4165
- const $names = {};
4166
- const $properties = {};
4167
-
4168
- if (titleTemplate) {
4169
- defaults.tplTitle = titleTemplate;
4170
- }
4171
-
4172
- _title = _title || (seo === null || seo === void 0 ? void 0 : seo.title) || "";
4173
-
4174
- if (_title) {
4175
- if (defaults.tplTitle && defaults.tplTitle !== _title) {
4176
- _title = defaults.tplTitle.replace(/%s/g, _title);
4177
- }
4178
- } else if (defaultTitle) {
4179
- _title = defaultTitle;
4180
- }
4181
-
4182
- if (_title) {
4183
- render.push(jsxRuntime.jsx("title", {
4184
- children: _title
4185
- }, "title"));
4186
- $properties["og:title"] = _title; // overridden later...
4187
- }
4188
-
4189
- $names["robots"] = `${noindex || hidden ? "noindex" : "index"},${nofollow || hidden ? "nofollow" : "follow"}`;
4190
- description = description || (seo === null || seo === void 0 ? void 0 : seo.description);
4191
-
4192
- if (description) {
4193
- $names["description"] = description;
4194
- $properties["og:description"] = description; // overridden later...
4195
- }
4196
-
4197
- keywords = keywords || (seo === null || seo === void 0 ? void 0 : seo.keywords);
4198
-
4199
- if (keywords) {
4200
- $names["keywords"] = utils.isArray(keywords) ? keywords.join(", ") : keywords;
4201
- }
4202
-
4203
- if ((_languageAlternates === null || _languageAlternates === void 0 ? void 0 : _languageAlternates.length) > 0) {
4204
- _languageAlternates.forEach(languageAlternate => {
4205
- render.push(jsxRuntime.jsx("link", {
4206
- rel: "alternate",
4207
- hrefLang: languageAlternate.hrefLang,
4208
- href: languageAlternate.href
4209
- }, `languageAlternate-${languageAlternate.hrefLang}`));
4210
- });
4211
- }
4212
-
4213
- if (canonical) {
4214
- render.push(jsxRuntime.jsx("link", {
4215
- rel: "canonical",
4216
- href: canonical
4217
- }, "canonical"));
4218
- $properties["og:url"] = canonical;
4219
- }
4220
-
4221
- if (facebook === null || facebook === void 0 ? void 0 : facebook.appId) $properties["fb:app_id"] = facebook.appId;
4222
-
4223
- if (twitter) {
4224
- if (twitter.cardType) $names["twitter:card"] = twitter.cardType;
4225
- if (twitter.site) $names["twitter:site"] = twitter.site;
4226
- if (twitter.handle) $names["twitter:creator"] = twitter.handle;
4227
- }
4228
-
4229
- const og = ogAlias || openGraph;
4230
- if (og === null || og === void 0 ? void 0 : og.title) $properties["og:title"] = og === null || og === void 0 ? void 0 : og.title;
4231
- if (og === null || og === void 0 ? void 0 : og.description) $properties["og:description"] = og === null || og === void 0 ? void 0 : og.description;
4232
- if (og === null || og === void 0 ? void 0 : og.url) $properties["og:url"] = og.url;
4233
- if (og === null || og === void 0 ? void 0 : og.type) $properties["og:type"] = og.type.toLowerCase();
4234
- if (og === null || og === void 0 ? void 0 : og.locale) $properties["og:locale"] = og.locale;
4235
- if (og === null || og === void 0 ? void 0 : og.site_name) $properties["og:site_name"] = og.site_name;
4236
- const ogimage = (og === null || og === void 0 ? void 0 : og.image) || (seo === null || seo === void 0 ? void 0 : seo.ogimage);
4237
- if (ogimage) $properties["og:image"] = ogimage;
4238
- Object.keys($names).forEach(key => {
4239
- render.push(jsxRuntime.jsx("meta", {
4240
- name: key,
4241
- content: $names[key]
4242
- }, key));
4243
- });
4244
- Object.keys($properties).forEach(key => {
4245
- render.push(jsxRuntime.jsx("meta", {
4246
- property: key,
4247
- content: $properties[key]
4248
- }, key));
4249
- });
4250
-
4251
- if (metaTags && metaTags.length > 0) {
4252
- metaTags.forEach(tag => {
4253
- var _a, _b, _c;
4254
-
4255
- render.push(jsxRuntime.jsx("meta", Object.assign({}, tag), `meta:${(_c = (_b = (_a = tag.keyOverride) !== null && _a !== void 0 ? _a : tag.name) !== null && _b !== void 0 ? _b : tag.property) !== null && _c !== void 0 ? _c : tag.httpEquiv}`));
4256
- });
4257
- }
4258
-
4259
- if (linkTags === null || linkTags === void 0 ? void 0 : linkTags.length) {
4260
- linkTags.forEach(tag => {
4261
- var _a;
4262
-
4263
- render.push(jsxRuntime.jsx("link", Object.assign({}, tag), `link${(_a = tag.keyOverride) !== null && _a !== void 0 ? _a : tag.href}${tag.rel}`));
4264
- });
4265
- } // TODO: alternates and canonical
4266
- // canonical = 'https://www.domain.com/';
4267
- // languageAlternates={[{
4268
- // hrefLang: 'en',
4269
- // href: 'https://www.domain.com/en',
4270
- // }]}
4271
- // <link rel="alternate" hreflang="x-default" href="https://www.domain.com/nl/">
4272
- // <link rel="alternate" hreflang="nl" href="https://www.domain.com/nl/">
4273
- // <link rel="alternate" hreflang="en" href="https://www.domain.com/en/">
4274
-
4275
-
4276
- return render;
4277
- };
4278
-
4279
- const _Seo = props => {
4280
- return jsxRuntime.jsx(Head__default["default"], {
4281
- children: buildTags(props)
4282
- });
4283
- };
4284
-
4285
- const Seo = /*#__PURE__*/react.memo(_Seo);
4286
-
4287
- const _SeoDefaults = props => {
4288
- // const router = useRouter();
4289
- // props.openGraph.url = getSiteUrl(router.asPath);
4290
- return jsxRuntime.jsx(Head__default["default"], {
4291
- children: buildTags(props)
4292
- });
4293
- };
4294
-
4295
- const SeoDefaults = /*#__PURE__*/react.memo(_SeoDefaults);
4296
-
4297
- var uncurryThis = functionUncurryThis;
4298
- var PROPER_FUNCTION_NAME = functionName.PROPER;
4299
- var redefine = redefine$7.exports;
4300
- var anObject = anObject$h;
4301
- var isPrototypeOf = objectIsPrototypeOf;
4302
- var $toString = toString$7;
4303
- var fails = fails$k;
4304
- var regExpFlags = regexpFlags$1;
4305
-
4306
- var TO_STRING = 'toString';
4307
- var RegExpPrototype = RegExp.prototype;
4308
- var n$ToString = RegExpPrototype[TO_STRING];
4309
- var getFlags = uncurryThis(regExpFlags);
4310
-
4311
- var NOT_GENERIC = fails(function () { return n$ToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
4312
- // FF44- RegExp#toString has a wrong name
4313
- var INCORRECT_NAME = PROPER_FUNCTION_NAME && n$ToString.name != TO_STRING;
4314
-
4315
- // `RegExp.prototype.toString` method
4316
- // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
4317
- if (NOT_GENERIC || INCORRECT_NAME) {
4318
- redefine(RegExp.prototype, TO_STRING, function toString() {
4319
- var R = anObject(this);
4320
- var p = $toString(R.source);
4321
- var rf = R.flags;
4322
- var f = $toString(rf === undefined && isPrototypeOf(RegExpPrototype, R) && !('flags' in RegExpPrototype) ? getFlags(R) : rf);
4323
- return '/' + p + '/' + f;
4324
- }, { unsafe: true });
4325
- }
4326
-
4327
- const THEME_STORAGE_KEY = "theme";
4328
- const colorSchemes = ["light", "dark"];
4329
- const MEDIA = "(prefers-color-scheme: dark)";
4330
- const ThemeContext = /*#__PURE__*/react.createContext({
4331
- // eslint-disable-next-line @typescript-eslint/no-empty-function
4332
- setTheme: _ => {},
4333
- themes: []
4334
- });
4335
- const useTheme = () => react.useContext(ThemeContext);
4336
- const ThemeProvider = ({
4337
- forcedTheme,
4338
- disableTransitionOnChange: _disableTransitionOnChange = false,
4339
- enableSystem: _enableSystem = true,
4340
- enableColorScheme: _enableColorScheme = true,
4341
- themes: _themes = ["light", "dark"],
4342
- defaultTheme: _defaultTheme = _enableSystem ? "system" : "light",
4343
- attribute: _attribute = "data-theme",
4344
- value,
4345
- children,
4346
- nonce
4347
- }) => {
4348
- const [theme, setThemeState] = react.useState(() => getTheme(THEME_STORAGE_KEY, _defaultTheme));
4349
- const [resolvedTheme, setResolvedTheme] = react.useState(() => getTheme(THEME_STORAGE_KEY));
4350
- const attrs = !value ? _themes : Object.values(value);
4351
- const applyTheme = react.useCallback(theme => {
4352
- let resolved = theme;
4353
- if (utils.isServer) return; // If theme is system, resolve it before setting theme
4354
-
4355
- if (theme === "system" && _enableSystem) {
4356
- resolved = getSystemTheme();
4357
- }
4358
-
4359
- const name = value ? value[resolved] : resolved;
4360
- const enable = _disableTransitionOnChange ? disableAnimation() : null;
4361
- const d = document.documentElement;
4362
-
4363
- if (_attribute === "class") {
4364
- d.classList.remove(...attrs);
4365
- if (name) d.classList.add(name);
4366
- } else {
4367
- if (name) {
4368
- d.setAttribute(_attribute, name);
4369
- } else {
4370
- d.removeAttribute(_attribute);
4371
- }
4372
- }
4373
-
4374
- if (_enableColorScheme) {
4375
- const fallback = colorSchemes.includes(_defaultTheme) ? _defaultTheme : null;
4376
- const colorScheme = colorSchemes.includes(resolved) ? resolved : fallback;
4377
- d.style.colorScheme = colorScheme;
4378
- }
4379
-
4380
- enable === null || enable === void 0 ? void 0 : enable();
4381
- }, [_attribute, attrs, _defaultTheme, _disableTransitionOnChange, _enableColorScheme, _enableSystem, value]);
4382
- const setTheme = react.useCallback(theme => {
4383
- setThemeState(theme); // Save to storage
4384
-
4385
- try {
4386
- localStorage.setItem(THEME_STORAGE_KEY, theme);
4387
- } catch (e) {// Unsupported
4388
- }
4389
- }, []);
4390
- const handleMediaQuery = react.useCallback(e => {
4391
- const resolved = getSystemTheme(e);
4392
- setResolvedTheme(resolved);
4393
-
4394
- if (theme === "system" && _enableSystem && !forcedTheme) {
4395
- applyTheme("system");
4396
- }
4397
- }, [theme, _enableSystem, forcedTheme, applyTheme]); // Always listen to System preference
4398
-
4399
- react.useEffect(() => {
4400
- const media = window.matchMedia(MEDIA); // Intentionally use deprecated listener methods to support iOS & old browsers
4401
-
4402
- media.addListener(handleMediaQuery);
4403
- handleMediaQuery(media);
4404
- return () => media.removeListener(handleMediaQuery);
4405
- }, [handleMediaQuery]); // localStorage event handling
4406
-
4407
- react.useEffect(() => {
4408
- const handleStorage = e => {
4409
- if (e.key !== THEME_STORAGE_KEY) {
4410
- return;
4411
- } // If default theme set, use it if localstorage === null (happens on local storage manual deletion)
4412
-
4413
-
4414
- const theme = e.newValue || _defaultTheme;
4415
- setTheme(theme);
4416
- };
4417
-
4418
- window.addEventListener("storage", handleStorage);
4419
- return () => window.removeEventListener("storage", handleStorage);
4420
- }, [_defaultTheme, setTheme]); // Whenever theme or forcedTheme changes, apply it
4421
-
4422
- react.useEffect(() => {
4423
- applyTheme(forcedTheme !== null && forcedTheme !== void 0 ? forcedTheme : theme);
4424
- }, [applyTheme, forcedTheme, theme]);
4425
- return jsxRuntime.jsxs(ThemeContext.Provider, Object.assign({
4426
- value: {
4427
- theme,
4428
- setTheme,
4429
- forcedTheme,
4430
- resolvedTheme: theme === "system" ? resolvedTheme : theme,
4431
- themes: _enableSystem ? [..._themes, "system"] : _themes,
4432
- systemTheme: _enableSystem ? resolvedTheme : undefined
4433
- }
4434
- }, {
4435
- children: [jsxRuntime.jsx(ThemeScript, Object.assign({}, {
4436
- forcedTheme,
4437
- disableTransitionOnChange: _disableTransitionOnChange,
4438
- enableSystem: _enableSystem,
4439
- enableColorScheme: _enableColorScheme,
4440
- themes: _themes,
4441
- defaultTheme: _defaultTheme,
4442
- attribute: _attribute,
4443
- value,
4444
- children,
4445
- attrs,
4446
- nonce
4447
- })), children]
4448
- }));
4449
- };
4450
- const ThemeScript = /*#__PURE__*/react.memo(({
4451
- forcedTheme,
4452
- attribute,
4453
- enableSystem,
4454
- enableColorScheme,
4455
- defaultTheme,
4456
- value,
4457
- attrs,
4458
- nonce
4459
- }) => {
4460
- const defaultSystem = defaultTheme === "system"; // Code-golfing the amount of characters in the script
4461
-
4462
- const optimization = (() => {
4463
- const removeClasses = `d.remove(${attrs.map(t => `'${t}'`).join(",")})`;
4464
- return `var d=document.documentElement.classList;${removeClasses};`;
4465
- })();
4466
-
4467
- const fallbackColorScheme = (() => {
4468
- if (!enableColorScheme) {
4469
- return "";
4470
- }
4471
-
4472
- const fallback = colorSchemes.includes(defaultTheme) ? defaultTheme : null;
4473
-
4474
- if (fallback) {
4475
- return `if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${defaultTheme}'`;
4476
- } else {
4477
- return `if(e==='light'||e==='dark')d.style.colorScheme=e`;
4478
- }
4479
- })();
4480
-
4481
- const updateDOM = (name, literal = false, setColorScheme = true) => {
4482
- const resolvedName = value ? value[name] : name;
4483
- const val = literal ? name + `|| ''` : `'${resolvedName}'`;
4484
- let text = ""; // MUCH faster to set colorScheme alongside HTML attribute/class
4485
- // as it only incurs 1 style recalculation rather than 2
4486
- // This can save over 250ms of work for pages with big DOM
4487
-
4488
- if (enableColorScheme && setColorScheme && !literal && colorSchemes.includes(name)) {
4489
- text += `d.style.colorScheme = '${name}';`;
4490
- }
4491
-
4492
- if (attribute === "class") {
4493
- if (literal || resolvedName) {
4494
- text += `d.add(${val})`;
4495
- } else {
4496
- text += `null`;
4497
- }
4498
- } else {
4499
- if (resolvedName) {
4500
- text += `d[s](n, ${val})`;
4501
- }
4502
- }
4503
-
4504
- return text;
4505
- };
4506
-
4507
- const scriptSrc = (() => {
4508
- if (forcedTheme) {
4509
- return `!function(){${optimization}${updateDOM(forcedTheme)}}()`;
4510
- }
4511
-
4512
- if (enableSystem) {
4513
- return `!function(){try {${optimization}var e=localStorage.getItem('${THEME_STORAGE_KEY}');if("system"===e||(!e&&${defaultSystem})){var t="${MEDIA}",m=window.matchMedia(t);if(m.media!==t||m.matches){${updateDOM("dark")}}else{${updateDOM("light")}}}else if(e){${value ? `var x=${JSON.stringify(value)};` : ""}${updateDOM(value ? `x[e]` : "e", true)}}${!defaultSystem ? `else{` + updateDOM(defaultTheme, false, false) + "}" : ""}${fallbackColorScheme}}catch(e){}}()`;
4514
- }
4515
-
4516
- return `!function(){try{${optimization}var e=localStorage.getItem("${THEME_STORAGE_KEY}");if(e){${value ? `var x=${JSON.stringify(value)};` : ""}${updateDOM(value ? `x[e]` : "e", true)}}else{${updateDOM(defaultTheme, false, false)};}${fallbackColorScheme}}catch(t){}}();`;
4517
- })(); // We MUST use next/script's `beforeInteractive` strategy to avoid flashing on load.
4518
- // However, it only accepts the `src` prop, not `dangerouslySetInnerHTML` or `children`
4519
- // But our script cannot be external because it changes at runtime based on React props
4520
- // so we trick next/script by passing `src` as a base64 JS script
4521
-
4522
-
4523
- const encodedScript = `data:text/javascript;base64,${encodeBase64(scriptSrc)}`;
4524
- return jsxRuntime.jsx(Script__default["default"], {
4525
- id: "next-theme-script",
4526
- strategy: "beforeInteractive",
4527
- src: encodedScript,
4528
- nonce: nonce
4529
- });
4530
- }, // Never re-render this component
4531
- () => true); // Helpers
4532
-
4533
- const getTheme = (key, fallback) => {
4534
- if (utils.isServer) return undefined;
4535
- let theme;
4536
-
4537
- try {
4538
- theme = localStorage.getItem(key) || undefined;
4539
- } catch (e) {// Unsupported
4540
- }
4541
-
4542
- return theme || fallback;
4543
- };
4544
-
4545
- const disableAnimation = () => {
4546
- const css = document.createElement("style");
4547
- css.appendChild(document.createTextNode(`*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`));
4548
- document.head.appendChild(css);
4549
- return () => {
4550
- // Force restyle
4551
- (() => window.getComputedStyle(document.body))(); // Wait for next tick before removing
4552
-
4553
-
4554
- setTimeout(() => {
4555
- document.head.removeChild(css);
4556
- }, 1);
4557
- };
4558
- };
4559
-
4560
- const getSystemTheme = e => {
4561
- if (!e) e = window.matchMedia(MEDIA);
4562
- const isDark = e.matches;
4563
- const systemTheme = isDark ? "dark" : "light";
4564
- return systemTheme;
4565
- };
4566
-
4567
- const encodeBase64 = str => {
4568
- return utils.isServer ? Buffer.from(str).toString("base64") : btoa(str);
4569
- };
4570
-
4571
- const ONE_HOUR = 3600;
4572
- const ONE_DAY = 84000;
4573
- /**
4574
- * Get site absolute url with the given path
4575
- *
4576
- * - It uses the `NEXT_PUBLIC_APP_URL` env variable
4577
- * - It removes the trailing slashes
4578
- */
4579
-
4580
- function getSiteUrl(path = "") {
4581
- return utils.normaliseUrl(`${process.env["NEXT_PUBLIC_APP_URL"]}/${path}`);
4582
- }
4583
- /**
4584
- * Utility to load a component with an optional pre-determined delay.
4585
- *
4586
- * This was designed to improve anti spam wit async form loading.
4587
- *
4588
- * @see https://github.com/vercel/next.js/blob/main/packages/next/next-server/lib/dynamic.tsx
4589
- * @see https://github.com/vercel/next.js/blob/canary/examples/with-dynamic-import/pages/index.js
4590
- */
4591
-
4592
- function load(component, milliseconds) {
4593
- return new Promise(resolve => {
4594
- setTimeout(() => resolve(component), milliseconds);
4595
- });
4596
- }
4597
-
4598
- Object.defineProperty(exports, 'T', {
4599
- enumerable: true,
4600
- get: function () { return Trans__default["default"]; }
4601
- });
4602
- Object.defineProperty(exports, 'Head', {
4603
- enumerable: true,
4604
- get: function () { return Head__default["default"]; }
4605
- });
4606
- exports.AUTH_ROUTES = AUTH_ROUTES;
4607
- exports.AnalyticsGoogle = AnalyticsGoogle;
4608
- exports.Favicon = Favicon;
4609
- exports.Link = Link;
4610
- exports.NextImg = NextImg;
4611
- exports.NextImgSmart = NextImgSmart;
4612
- exports.NextProgress = NextProgress;
4613
- exports.ONE_DAY = ONE_DAY;
4614
- exports.ONE_HOUR = ONE_HOUR;
4615
- exports.Seo = Seo;
4616
- exports.SeoDefaults = SeoDefaults;
4617
- exports.ThemeProvider = ThemeProvider;
4618
- exports.api = api;
4619
- exports.buildTags = buildTags;
4620
- exports.getAuthRoutes = getAuthRoutes;
4621
- exports.getCallbackUrl = getCallbackUrl;
4622
- exports.getNextImgProps = getNextImgProps;
4623
- exports.getSiteUrl = getSiteUrl;
4624
- exports.load = load;
4625
- exports.translationAsOptions = translationAsOptions;
4626
- exports.useDateFormat = useDateFormat;
4627
- exports.useForm = useForm;
4628
- exports.useLogin = useLogin;
4629
- exports.useLoginUrl = useLoginUrl;
4630
- exports.useLogout = useLogout;
4631
- exports.useLooseT = useLooseT;
4632
- exports.useSubmit = useSubmit;
4633
- exports.useT = useT;
4634
- exports.useTheme = useTheme;
4635
-
4636
- Object.defineProperty(exports, '__esModule', { value: true });
4637
-
4638
- }));