@dotcms/react 0.0.1-alpha.0 → 0.0.1-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js DELETED
@@ -1,2413 +0,0 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
2
- import { useRef, useEffect, createContext, useContext, forwardRef } from 'react';
3
- import { postMessageToEditor, CUSTOMER_ACTIONS } from '@dotcms/client';
4
-
5
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
6
-
7
- var check = function (it) {
8
- return it && it.Math === Math && it;
9
- };
10
-
11
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
12
- var global$f =
13
- // eslint-disable-next-line es/no-global-this -- safe
14
- check(typeof globalThis == 'object' && globalThis) ||
15
- check(typeof window == 'object' && window) ||
16
- // eslint-disable-next-line no-restricted-globals -- safe
17
- check(typeof self == 'object' && self) ||
18
- check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
19
- check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
20
- // eslint-disable-next-line no-new-func -- fallback
21
- (function () { return this; })() || Function('return this')();
22
-
23
- var objectGetOwnPropertyDescriptor = {};
24
-
25
- var fails$g = function (exec) {
26
- try {
27
- return !!exec();
28
- } catch (error) {
29
- return true;
30
- }
31
- };
32
-
33
- var fails$f = fails$g;
34
-
35
- // Detect IE8's incomplete defineProperty implementation
36
- var descriptors = !fails$f(function () {
37
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
38
- return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
39
- });
40
-
41
- var fails$e = fails$g;
42
-
43
- var functionBindNative = !fails$e(function () {
44
- // eslint-disable-next-line es/no-function-prototype-bind -- safe
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$2 = functionBindNative;
51
-
52
- var call$9 = Function.prototype.call;
53
-
54
- var functionCall = NATIVE_BIND$2 ? call$9.bind(call$9) : function () {
55
- return call$9.apply(call$9, arguments);
56
- };
57
-
58
- var objectPropertyIsEnumerable = {};
59
-
60
- var $propertyIsEnumerable = {}.propertyIsEnumerable;
61
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
62
- var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
63
-
64
- // Nashorn ~ JDK8 bug
65
- var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
66
-
67
- // `Object.prototype.propertyIsEnumerable` method implementation
68
- // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
69
- objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
70
- var descriptor = getOwnPropertyDescriptor$1(this, V);
71
- return !!descriptor && descriptor.enumerable;
72
- } : $propertyIsEnumerable;
73
-
74
- var createPropertyDescriptor$2 = function (bitmap, value) {
75
- return {
76
- enumerable: !(bitmap & 1),
77
- configurable: !(bitmap & 2),
78
- writable: !(bitmap & 4),
79
- value: value
80
- };
81
- };
82
-
83
- var NATIVE_BIND$1 = functionBindNative;
84
-
85
- var FunctionPrototype$2 = Function.prototype;
86
- var call$8 = FunctionPrototype$2.call;
87
- var uncurryThisWithBind = NATIVE_BIND$1 && FunctionPrototype$2.bind.bind(call$8, call$8);
88
-
89
- var functionUncurryThis = NATIVE_BIND$1 ? uncurryThisWithBind : function (fn) {
90
- return function () {
91
- return call$8.apply(fn, arguments);
92
- };
93
- };
94
-
95
- var uncurryThis$g = functionUncurryThis;
96
-
97
- var toString$6 = uncurryThis$g({}.toString);
98
- var stringSlice$5 = uncurryThis$g(''.slice);
99
-
100
- var classofRaw$2 = function (it) {
101
- return stringSlice$5(toString$6(it), 8, -1);
102
- };
103
-
104
- var uncurryThis$f = functionUncurryThis;
105
- var fails$d = fails$g;
106
- var classof$5 = classofRaw$2;
107
-
108
- var $Object$3 = Object;
109
- var split = uncurryThis$f(''.split);
110
-
111
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
112
- var indexedObject = fails$d(function () {
113
- // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
114
- // eslint-disable-next-line no-prototype-builtins -- safe
115
- return !$Object$3('z').propertyIsEnumerable(0);
116
- }) ? function (it) {
117
- return classof$5(it) === 'String' ? split(it, '') : $Object$3(it);
118
- } : $Object$3;
119
-
120
- // we can't use just `it == null` since of `document.all` special case
121
- // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
122
- var isNullOrUndefined$3 = function (it) {
123
- return it === null || it === undefined;
124
- };
125
-
126
- var isNullOrUndefined$2 = isNullOrUndefined$3;
127
-
128
- var $TypeError$8 = TypeError;
129
-
130
- // `RequireObjectCoercible` abstract operation
131
- // https://tc39.es/ecma262/#sec-requireobjectcoercible
132
- var requireObjectCoercible$5 = function (it) {
133
- if (isNullOrUndefined$2(it)) throw new $TypeError$8("Can't call method on " + it);
134
- return it;
135
- };
136
-
137
- // toObject with fallback for non-array-like ES3 strings
138
- var IndexedObject$2 = indexedObject;
139
- var requireObjectCoercible$4 = requireObjectCoercible$5;
140
-
141
- var toIndexedObject$4 = function (it) {
142
- return IndexedObject$2(requireObjectCoercible$4(it));
143
- };
144
-
145
- var documentAll$2 = typeof document == 'object' && document.all;
146
-
147
- // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
148
- // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
149
- var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
150
-
151
- var documentAll_1 = {
152
- all: documentAll$2,
153
- IS_HTMLDDA: IS_HTMLDDA
154
- };
155
-
156
- var $documentAll$1 = documentAll_1;
157
-
158
- var documentAll$1 = $documentAll$1.all;
159
-
160
- // `IsCallable` abstract operation
161
- // https://tc39.es/ecma262/#sec-iscallable
162
- var isCallable$d = $documentAll$1.IS_HTMLDDA ? function (argument) {
163
- return typeof argument == 'function' || argument === documentAll$1;
164
- } : function (argument) {
165
- return typeof argument == 'function';
166
- };
167
-
168
- var isCallable$c = isCallable$d;
169
- var $documentAll = documentAll_1;
170
-
171
- var documentAll = $documentAll.all;
172
-
173
- var isObject$6 = $documentAll.IS_HTMLDDA ? function (it) {
174
- return typeof it == 'object' ? it !== null : isCallable$c(it) || it === documentAll;
175
- } : function (it) {
176
- return typeof it == 'object' ? it !== null : isCallable$c(it);
177
- };
178
-
179
- var global$e = global$f;
180
- var isCallable$b = isCallable$d;
181
-
182
- var aFunction = function (argument) {
183
- return isCallable$b(argument) ? argument : undefined;
184
- };
185
-
186
- var getBuiltIn$3 = function (namespace, method) {
187
- return arguments.length < 2 ? aFunction(global$e[namespace]) : global$e[namespace] && global$e[namespace][method];
188
- };
189
-
190
- var uncurryThis$e = functionUncurryThis;
191
-
192
- var objectIsPrototypeOf = uncurryThis$e({}.isPrototypeOf);
193
-
194
- var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
195
-
196
- var global$d = global$f;
197
- var userAgent = engineUserAgent;
198
-
199
- var process = global$d.process;
200
- var Deno = global$d.Deno;
201
- var versions = process && process.versions || Deno && Deno.version;
202
- var v8 = versions && versions.v8;
203
- var match, version;
204
-
205
- if (v8) {
206
- match = v8.split('.');
207
- // in old Chrome, versions of V8 isn't V8 = Chrome / 10
208
- // but their correct versions are not interesting for us
209
- version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
210
- }
211
-
212
- // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
213
- // so check `userAgent` even if `.v8` exists, but 0
214
- if (!version && userAgent) {
215
- match = userAgent.match(/Edge\/(\d+)/);
216
- if (!match || match[1] >= 74) {
217
- match = userAgent.match(/Chrome\/(\d+)/);
218
- if (match) version = +match[1];
219
- }
220
- }
221
-
222
- var engineV8Version = version;
223
-
224
- /* eslint-disable es/no-symbol -- required for testing */
225
- var V8_VERSION = engineV8Version;
226
- var fails$c = fails$g;
227
- var global$c = global$f;
228
-
229
- var $String$4 = global$c.String;
230
-
231
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
232
- var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$c(function () {
233
- var symbol = Symbol('symbol detection');
234
- // Chrome 38 Symbol has incorrect toString conversion
235
- // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
236
- // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
237
- // of course, fail.
238
- return !$String$4(symbol) || !(Object(symbol) instanceof Symbol) ||
239
- // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
240
- !Symbol.sham && V8_VERSION && V8_VERSION < 41;
241
- });
242
-
243
- /* eslint-disable es/no-symbol -- required for testing */
244
- var NATIVE_SYMBOL$1 = symbolConstructorDetection;
245
-
246
- var useSymbolAsUid = NATIVE_SYMBOL$1
247
- && !Symbol.sham
248
- && typeof Symbol.iterator == 'symbol';
249
-
250
- var getBuiltIn$2 = getBuiltIn$3;
251
- var isCallable$a = isCallable$d;
252
- var isPrototypeOf = objectIsPrototypeOf;
253
- var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
254
-
255
- var $Object$2 = Object;
256
-
257
- var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
258
- return typeof it == 'symbol';
259
- } : function (it) {
260
- var $Symbol = getBuiltIn$2('Symbol');
261
- return isCallable$a($Symbol) && isPrototypeOf($Symbol.prototype, $Object$2(it));
262
- };
263
-
264
- var $String$3 = String;
265
-
266
- var tryToString$1 = function (argument) {
267
- try {
268
- return $String$3(argument);
269
- } catch (error) {
270
- return 'Object';
271
- }
272
- };
273
-
274
- var isCallable$9 = isCallable$d;
275
- var tryToString = tryToString$1;
276
-
277
- var $TypeError$7 = TypeError;
278
-
279
- // `Assert: IsCallable(argument) is true`
280
- var aCallable$2 = function (argument) {
281
- if (isCallable$9(argument)) return argument;
282
- throw new $TypeError$7(tryToString(argument) + ' is not a function');
283
- };
284
-
285
- var aCallable$1 = aCallable$2;
286
- var isNullOrUndefined$1 = isNullOrUndefined$3;
287
-
288
- // `GetMethod` abstract operation
289
- // https://tc39.es/ecma262/#sec-getmethod
290
- var getMethod$2 = function (V, P) {
291
- var func = V[P];
292
- return isNullOrUndefined$1(func) ? undefined : aCallable$1(func);
293
- };
294
-
295
- var call$7 = functionCall;
296
- var isCallable$8 = isCallable$d;
297
- var isObject$5 = isObject$6;
298
-
299
- var $TypeError$6 = TypeError;
300
-
301
- // `OrdinaryToPrimitive` abstract operation
302
- // https://tc39.es/ecma262/#sec-ordinarytoprimitive
303
- var ordinaryToPrimitive$1 = function (input, pref) {
304
- var fn, val;
305
- if (pref === 'string' && isCallable$8(fn = input.toString) && !isObject$5(val = call$7(fn, input))) return val;
306
- if (isCallable$8(fn = input.valueOf) && !isObject$5(val = call$7(fn, input))) return val;
307
- if (pref !== 'string' && isCallable$8(fn = input.toString) && !isObject$5(val = call$7(fn, input))) return val;
308
- throw new $TypeError$6("Can't convert object to primitive value");
309
- };
310
-
311
- var shared$4 = {exports: {}};
312
-
313
- var global$b = global$f;
314
-
315
- // eslint-disable-next-line es/no-object-defineproperty -- safe
316
- var defineProperty$3 = Object.defineProperty;
317
-
318
- var defineGlobalProperty$3 = function (key, value) {
319
- try {
320
- defineProperty$3(global$b, key, { value: value, configurable: true, writable: true });
321
- } catch (error) {
322
- global$b[key] = value;
323
- } return value;
324
- };
325
-
326
- var global$a = global$f;
327
- var defineGlobalProperty$2 = defineGlobalProperty$3;
328
-
329
- var SHARED = '__core-js_shared__';
330
- var store$3 = global$a[SHARED] || defineGlobalProperty$2(SHARED, {});
331
-
332
- var sharedStore = store$3;
333
-
334
- var store$2 = sharedStore;
335
-
336
- (shared$4.exports = function (key, value) {
337
- return store$2[key] || (store$2[key] = value !== undefined ? value : {});
338
- })('versions', []).push({
339
- version: '3.34.0',
340
- mode: 'global',
341
- copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
342
- license: 'https://github.com/zloirock/core-js/blob/v3.34.0/LICENSE',
343
- source: 'https://github.com/zloirock/core-js'
344
- });
345
-
346
- var requireObjectCoercible$3 = requireObjectCoercible$5;
347
-
348
- var $Object$1 = Object;
349
-
350
- // `ToObject` abstract operation
351
- // https://tc39.es/ecma262/#sec-toobject
352
- var toObject$4 = function (argument) {
353
- return $Object$1(requireObjectCoercible$3(argument));
354
- };
355
-
356
- var uncurryThis$d = functionUncurryThis;
357
- var toObject$3 = toObject$4;
358
-
359
- var hasOwnProperty = uncurryThis$d({}.hasOwnProperty);
360
-
361
- // `HasOwnProperty` abstract operation
362
- // https://tc39.es/ecma262/#sec-hasownproperty
363
- // eslint-disable-next-line es/no-object-hasown -- safe
364
- var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
365
- return hasOwnProperty(toObject$3(it), key);
366
- };
367
-
368
- var uncurryThis$c = functionUncurryThis;
369
-
370
- var id = 0;
371
- var postfix = Math.random();
372
- var toString$5 = uncurryThis$c(1.0.toString);
373
-
374
- var uid$2 = function (key) {
375
- return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$5(++id + postfix, 36);
376
- };
377
-
378
- var global$9 = global$f;
379
- var shared$3 = shared$4.exports;
380
- var hasOwn$6 = hasOwnProperty_1;
381
- var uid$1 = uid$2;
382
- var NATIVE_SYMBOL = symbolConstructorDetection;
383
- var USE_SYMBOL_AS_UID = useSymbolAsUid;
384
-
385
- var Symbol$1 = global$9.Symbol;
386
- var WellKnownSymbolsStore = shared$3('wks');
387
- var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1['for'] || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
388
-
389
- var wellKnownSymbol$8 = function (name) {
390
- if (!hasOwn$6(WellKnownSymbolsStore, name)) {
391
- WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn$6(Symbol$1, name)
392
- ? Symbol$1[name]
393
- : createWellKnownSymbol('Symbol.' + name);
394
- } return WellKnownSymbolsStore[name];
395
- };
396
-
397
- var call$6 = functionCall;
398
- var isObject$4 = isObject$6;
399
- var isSymbol$1 = isSymbol$2;
400
- var getMethod$1 = getMethod$2;
401
- var ordinaryToPrimitive = ordinaryToPrimitive$1;
402
- var wellKnownSymbol$7 = wellKnownSymbol$8;
403
-
404
- var $TypeError$5 = TypeError;
405
- var TO_PRIMITIVE = wellKnownSymbol$7('toPrimitive');
406
-
407
- // `ToPrimitive` abstract operation
408
- // https://tc39.es/ecma262/#sec-toprimitive
409
- var toPrimitive$1 = function (input, pref) {
410
- if (!isObject$4(input) || isSymbol$1(input)) return input;
411
- var exoticToPrim = getMethod$1(input, TO_PRIMITIVE);
412
- var result;
413
- if (exoticToPrim) {
414
- if (pref === undefined) pref = 'default';
415
- result = call$6(exoticToPrim, input, pref);
416
- if (!isObject$4(result) || isSymbol$1(result)) return result;
417
- throw new $TypeError$5("Can't convert object to primitive value");
418
- }
419
- if (pref === undefined) pref = 'number';
420
- return ordinaryToPrimitive(input, pref);
421
- };
422
-
423
- var toPrimitive = toPrimitive$1;
424
- var isSymbol = isSymbol$2;
425
-
426
- // `ToPropertyKey` abstract operation
427
- // https://tc39.es/ecma262/#sec-topropertykey
428
- var toPropertyKey$2 = function (argument) {
429
- var key = toPrimitive(argument, 'string');
430
- return isSymbol(key) ? key : key + '';
431
- };
432
-
433
- var global$8 = global$f;
434
- var isObject$3 = isObject$6;
435
-
436
- var document$1 = global$8.document;
437
- // typeof document.createElement is 'object' in old IE
438
- var EXISTS$1 = isObject$3(document$1) && isObject$3(document$1.createElement);
439
-
440
- var documentCreateElement$1 = function (it) {
441
- return EXISTS$1 ? document$1.createElement(it) : {};
442
- };
443
-
444
- var DESCRIPTORS$8 = descriptors;
445
- var fails$b = fails$g;
446
- var createElement = documentCreateElement$1;
447
-
448
- // Thanks to IE8 for its funny defineProperty
449
- var ie8DomDefine = !DESCRIPTORS$8 && !fails$b(function () {
450
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
451
- return Object.defineProperty(createElement('div'), 'a', {
452
- get: function () { return 7; }
453
- }).a !== 7;
454
- });
455
-
456
- var DESCRIPTORS$7 = descriptors;
457
- var call$5 = functionCall;
458
- var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
459
- var createPropertyDescriptor$1 = createPropertyDescriptor$2;
460
- var toIndexedObject$3 = toIndexedObject$4;
461
- var toPropertyKey$1 = toPropertyKey$2;
462
- var hasOwn$5 = hasOwnProperty_1;
463
- var IE8_DOM_DEFINE$1 = ie8DomDefine;
464
-
465
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
466
- var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
467
-
468
- // `Object.getOwnPropertyDescriptor` method
469
- // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
470
- objectGetOwnPropertyDescriptor.f = DESCRIPTORS$7 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
471
- O = toIndexedObject$3(O);
472
- P = toPropertyKey$1(P);
473
- if (IE8_DOM_DEFINE$1) try {
474
- return $getOwnPropertyDescriptor$1(O, P);
475
- } catch (error) { /* empty */ }
476
- if (hasOwn$5(O, P)) return createPropertyDescriptor$1(!call$5(propertyIsEnumerableModule$1.f, O, P), O[P]);
477
- };
478
-
479
- var objectDefineProperty = {};
480
-
481
- var DESCRIPTORS$6 = descriptors;
482
- var fails$a = fails$g;
483
-
484
- // V8 ~ Chrome 36-
485
- // https://bugs.chromium.org/p/v8/issues/detail?id=3334
486
- var v8PrototypeDefineBug = DESCRIPTORS$6 && fails$a(function () {
487
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
488
- return Object.defineProperty(function () { /* empty */ }, 'prototype', {
489
- value: 42,
490
- writable: false
491
- }).prototype !== 42;
492
- });
493
-
494
- var isObject$2 = isObject$6;
495
-
496
- var $String$2 = String;
497
- var $TypeError$4 = TypeError;
498
-
499
- // `Assert: Type(argument) is Object`
500
- var anObject$7 = function (argument) {
501
- if (isObject$2(argument)) return argument;
502
- throw new $TypeError$4($String$2(argument) + ' is not an object');
503
- };
504
-
505
- var DESCRIPTORS$5 = descriptors;
506
- var IE8_DOM_DEFINE = ie8DomDefine;
507
- var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
508
- var anObject$6 = anObject$7;
509
- var toPropertyKey = toPropertyKey$2;
510
-
511
- var $TypeError$3 = TypeError;
512
- // eslint-disable-next-line es/no-object-defineproperty -- safe
513
- var $defineProperty = Object.defineProperty;
514
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
515
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
516
- var ENUMERABLE = 'enumerable';
517
- var CONFIGURABLE$1 = 'configurable';
518
- var WRITABLE = 'writable';
519
-
520
- // `Object.defineProperty` method
521
- // https://tc39.es/ecma262/#sec-object.defineproperty
522
- objectDefineProperty.f = DESCRIPTORS$5 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
523
- anObject$6(O);
524
- P = toPropertyKey(P);
525
- anObject$6(Attributes);
526
- if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
527
- var current = $getOwnPropertyDescriptor(O, P);
528
- if (current && current[WRITABLE]) {
529
- O[P] = Attributes.value;
530
- Attributes = {
531
- configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
532
- enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
533
- writable: false
534
- };
535
- }
536
- } return $defineProperty(O, P, Attributes);
537
- } : $defineProperty : function defineProperty(O, P, Attributes) {
538
- anObject$6(O);
539
- P = toPropertyKey(P);
540
- anObject$6(Attributes);
541
- if (IE8_DOM_DEFINE) try {
542
- return $defineProperty(O, P, Attributes);
543
- } catch (error) { /* empty */ }
544
- if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$3('Accessors not supported');
545
- if ('value' in Attributes) O[P] = Attributes.value;
546
- return O;
547
- };
548
-
549
- var DESCRIPTORS$4 = descriptors;
550
- var definePropertyModule$3 = objectDefineProperty;
551
- var createPropertyDescriptor = createPropertyDescriptor$2;
552
-
553
- var createNonEnumerableProperty$3 = DESCRIPTORS$4 ? function (object, key, value) {
554
- return definePropertyModule$3.f(object, key, createPropertyDescriptor(1, value));
555
- } : function (object, key, value) {
556
- object[key] = value;
557
- return object;
558
- };
559
-
560
- var makeBuiltIn$2 = {exports: {}};
561
-
562
- var DESCRIPTORS$3 = descriptors;
563
- var hasOwn$4 = hasOwnProperty_1;
564
-
565
- var FunctionPrototype$1 = Function.prototype;
566
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
567
- var getDescriptor = DESCRIPTORS$3 && Object.getOwnPropertyDescriptor;
568
-
569
- var EXISTS = hasOwn$4(FunctionPrototype$1, 'name');
570
- // additional protection from minified / mangled / dropped function names
571
- var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
572
- var CONFIGURABLE = EXISTS && (!DESCRIPTORS$3 || (DESCRIPTORS$3 && getDescriptor(FunctionPrototype$1, 'name').configurable));
573
-
574
- var functionName = {
575
- EXISTS: EXISTS,
576
- PROPER: PROPER,
577
- CONFIGURABLE: CONFIGURABLE
578
- };
579
-
580
- var uncurryThis$b = functionUncurryThis;
581
- var isCallable$7 = isCallable$d;
582
- var store$1 = sharedStore;
583
-
584
- var functionToString = uncurryThis$b(Function.toString);
585
-
586
- // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
587
- if (!isCallable$7(store$1.inspectSource)) {
588
- store$1.inspectSource = function (it) {
589
- return functionToString(it);
590
- };
591
- }
592
-
593
- var inspectSource$1 = store$1.inspectSource;
594
-
595
- var global$7 = global$f;
596
- var isCallable$6 = isCallable$d;
597
-
598
- var WeakMap$1 = global$7.WeakMap;
599
-
600
- var weakMapBasicDetection = isCallable$6(WeakMap$1) && /native code/.test(String(WeakMap$1));
601
-
602
- var shared$2 = shared$4.exports;
603
- var uid = uid$2;
604
-
605
- var keys = shared$2('keys');
606
-
607
- var sharedKey$2 = function (key) {
608
- return keys[key] || (keys[key] = uid(key));
609
- };
610
-
611
- var hiddenKeys$4 = {};
612
-
613
- var NATIVE_WEAK_MAP = weakMapBasicDetection;
614
- var global$6 = global$f;
615
- var isObject$1 = isObject$6;
616
- var createNonEnumerableProperty$2 = createNonEnumerableProperty$3;
617
- var hasOwn$3 = hasOwnProperty_1;
618
- var shared$1 = sharedStore;
619
- var sharedKey$1 = sharedKey$2;
620
- var hiddenKeys$3 = hiddenKeys$4;
621
-
622
- var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
623
- var TypeError$1 = global$6.TypeError;
624
- var WeakMap = global$6.WeakMap;
625
- var set, get, has;
626
-
627
- var enforce = function (it) {
628
- return has(it) ? get(it) : set(it, {});
629
- };
630
-
631
- var getterFor = function (TYPE) {
632
- return function (it) {
633
- var state;
634
- if (!isObject$1(it) || (state = get(it)).type !== TYPE) {
635
- throw new TypeError$1('Incompatible receiver, ' + TYPE + ' required');
636
- } return state;
637
- };
638
- };
639
-
640
- if (NATIVE_WEAK_MAP || shared$1.state) {
641
- var store = shared$1.state || (shared$1.state = new WeakMap());
642
- /* eslint-disable no-self-assign -- prototype methods protection */
643
- store.get = store.get;
644
- store.has = store.has;
645
- store.set = store.set;
646
- /* eslint-enable no-self-assign -- prototype methods protection */
647
- set = function (it, metadata) {
648
- if (store.has(it)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
649
- metadata.facade = it;
650
- store.set(it, metadata);
651
- return metadata;
652
- };
653
- get = function (it) {
654
- return store.get(it) || {};
655
- };
656
- has = function (it) {
657
- return store.has(it);
658
- };
659
- } else {
660
- var STATE = sharedKey$1('state');
661
- hiddenKeys$3[STATE] = true;
662
- set = function (it, metadata) {
663
- if (hasOwn$3(it, STATE)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
664
- metadata.facade = it;
665
- createNonEnumerableProperty$2(it, STATE, metadata);
666
- return metadata;
667
- };
668
- get = function (it) {
669
- return hasOwn$3(it, STATE) ? it[STATE] : {};
670
- };
671
- has = function (it) {
672
- return hasOwn$3(it, STATE);
673
- };
674
- }
675
-
676
- var internalState = {
677
- set: set,
678
- get: get,
679
- has: has,
680
- enforce: enforce,
681
- getterFor: getterFor
682
- };
683
-
684
- var uncurryThis$a = functionUncurryThis;
685
- var fails$9 = fails$g;
686
- var isCallable$5 = isCallable$d;
687
- var hasOwn$2 = hasOwnProperty_1;
688
- var DESCRIPTORS$2 = descriptors;
689
- var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
690
- var inspectSource = inspectSource$1;
691
- var InternalStateModule = internalState;
692
-
693
- var enforceInternalState = InternalStateModule.enforce;
694
- var getInternalState$1 = InternalStateModule.get;
695
- var $String$1 = String;
696
- // eslint-disable-next-line es/no-object-defineproperty -- safe
697
- var defineProperty$2 = Object.defineProperty;
698
- var stringSlice$4 = uncurryThis$a(''.slice);
699
- var replace$2 = uncurryThis$a(''.replace);
700
- var join = uncurryThis$a([].join);
701
-
702
- var CONFIGURABLE_LENGTH = DESCRIPTORS$2 && !fails$9(function () {
703
- return defineProperty$2(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
704
- });
705
-
706
- var TEMPLATE = String(String).split('String');
707
-
708
- var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
709
- if (stringSlice$4($String$1(name), 0, 7) === 'Symbol(') {
710
- name = '[' + replace$2($String$1(name), /^Symbol\(([^)]*)\)/, '$1') + ']';
711
- }
712
- if (options && options.getter) name = 'get ' + name;
713
- if (options && options.setter) name = 'set ' + name;
714
- if (!hasOwn$2(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
715
- if (DESCRIPTORS$2) defineProperty$2(value, 'name', { value: name, configurable: true });
716
- else value.name = name;
717
- }
718
- if (CONFIGURABLE_LENGTH && options && hasOwn$2(options, 'arity') && value.length !== options.arity) {
719
- defineProperty$2(value, 'length', { value: options.arity });
720
- }
721
- try {
722
- if (options && hasOwn$2(options, 'constructor') && options.constructor) {
723
- if (DESCRIPTORS$2) defineProperty$2(value, 'prototype', { writable: false });
724
- // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
725
- } else if (value.prototype) value.prototype = undefined;
726
- } catch (error) { /* empty */ }
727
- var state = enforceInternalState(value);
728
- if (!hasOwn$2(state, 'source')) {
729
- state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
730
- } return value;
731
- };
732
-
733
- // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
734
- // eslint-disable-next-line no-extend-native -- required
735
- Function.prototype.toString = makeBuiltIn$1(function toString() {
736
- return isCallable$5(this) && getInternalState$1(this).source || inspectSource(this);
737
- }, 'toString');
738
-
739
- var isCallable$4 = isCallable$d;
740
- var definePropertyModule$2 = objectDefineProperty;
741
- var makeBuiltIn = makeBuiltIn$2.exports;
742
- var defineGlobalProperty$1 = defineGlobalProperty$3;
743
-
744
- var defineBuiltIn$2 = function (O, key, value, options) {
745
- if (!options) options = {};
746
- var simple = options.enumerable;
747
- var name = options.name !== undefined ? options.name : key;
748
- if (isCallable$4(value)) makeBuiltIn(value, name, options);
749
- if (options.global) {
750
- if (simple) O[key] = value;
751
- else defineGlobalProperty$1(key, value);
752
- } else {
753
- try {
754
- if (!options.unsafe) delete O[key];
755
- else if (O[key]) simple = true;
756
- } catch (error) { /* empty */ }
757
- if (simple) O[key] = value;
758
- else definePropertyModule$2.f(O, key, {
759
- value: value,
760
- enumerable: false,
761
- configurable: !options.nonConfigurable,
762
- writable: !options.nonWritable
763
- });
764
- } return O;
765
- };
766
-
767
- var objectGetOwnPropertyNames = {};
768
-
769
- var ceil = Math.ceil;
770
- var floor$1 = Math.floor;
771
-
772
- // `Math.trunc` method
773
- // https://tc39.es/ecma262/#sec-math.trunc
774
- // eslint-disable-next-line es/no-math-trunc -- safe
775
- var mathTrunc = Math.trunc || function trunc(x) {
776
- var n = +x;
777
- return (n > 0 ? floor$1 : ceil)(n);
778
- };
779
-
780
- var trunc = mathTrunc;
781
-
782
- // `ToIntegerOrInfinity` abstract operation
783
- // https://tc39.es/ecma262/#sec-tointegerorinfinity
784
- var toIntegerOrInfinity$4 = function (argument) {
785
- var number = +argument;
786
- // eslint-disable-next-line no-self-compare -- NaN check
787
- return number !== number || number === 0 ? 0 : trunc(number);
788
- };
789
-
790
- var toIntegerOrInfinity$3 = toIntegerOrInfinity$4;
791
-
792
- var max$1 = Math.max;
793
- var min$2 = Math.min;
794
-
795
- // Helper for a popular repeating case of the spec:
796
- // Let integer be ? ToInteger(index).
797
- // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
798
- var toAbsoluteIndex$1 = function (index, length) {
799
- var integer = toIntegerOrInfinity$3(index);
800
- return integer < 0 ? max$1(integer + length, 0) : min$2(integer, length);
801
- };
802
-
803
- var toIntegerOrInfinity$2 = toIntegerOrInfinity$4;
804
-
805
- var min$1 = Math.min;
806
-
807
- // `ToLength` abstract operation
808
- // https://tc39.es/ecma262/#sec-tolength
809
- var toLength$2 = function (argument) {
810
- return argument > 0 ? min$1(toIntegerOrInfinity$2(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
811
- };
812
-
813
- var toLength$1 = toLength$2;
814
-
815
- // `LengthOfArrayLike` abstract operation
816
- // https://tc39.es/ecma262/#sec-lengthofarraylike
817
- var lengthOfArrayLike$2 = function (obj) {
818
- return toLength$1(obj.length);
819
- };
820
-
821
- var toIndexedObject$2 = toIndexedObject$4;
822
- var toAbsoluteIndex = toAbsoluteIndex$1;
823
- var lengthOfArrayLike$1 = lengthOfArrayLike$2;
824
-
825
- // `Array.prototype.{ indexOf, includes }` methods implementation
826
- var createMethod$2 = function (IS_INCLUDES) {
827
- return function ($this, el, fromIndex) {
828
- var O = toIndexedObject$2($this);
829
- var length = lengthOfArrayLike$1(O);
830
- var index = toAbsoluteIndex(fromIndex, length);
831
- var value;
832
- // Array#includes uses SameValueZero equality algorithm
833
- // eslint-disable-next-line no-self-compare -- NaN check
834
- if (IS_INCLUDES && el !== el) while (length > index) {
835
- value = O[index++];
836
- // eslint-disable-next-line no-self-compare -- NaN check
837
- if (value !== value) return true;
838
- // Array#indexOf ignores holes, Array#includes - not
839
- } else for (;length > index; index++) {
840
- if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
841
- } return !IS_INCLUDES && -1;
842
- };
843
- };
844
-
845
- var arrayIncludes = {
846
- // `Array.prototype.includes` method
847
- // https://tc39.es/ecma262/#sec-array.prototype.includes
848
- includes: createMethod$2(true),
849
- // `Array.prototype.indexOf` method
850
- // https://tc39.es/ecma262/#sec-array.prototype.indexof
851
- indexOf: createMethod$2(false)
852
- };
853
-
854
- var uncurryThis$9 = functionUncurryThis;
855
- var hasOwn$1 = hasOwnProperty_1;
856
- var toIndexedObject$1 = toIndexedObject$4;
857
- var indexOf$1 = arrayIncludes.indexOf;
858
- var hiddenKeys$2 = hiddenKeys$4;
859
-
860
- var push$1 = uncurryThis$9([].push);
861
-
862
- var objectKeysInternal = function (object, names) {
863
- var O = toIndexedObject$1(object);
864
- var i = 0;
865
- var result = [];
866
- var key;
867
- for (key in O) !hasOwn$1(hiddenKeys$2, key) && hasOwn$1(O, key) && push$1(result, key);
868
- // Don't enum bug & hidden keys
869
- while (names.length > i) if (hasOwn$1(O, key = names[i++])) {
870
- ~indexOf$1(result, key) || push$1(result, key);
871
- }
872
- return result;
873
- };
874
-
875
- // IE8- don't enum bug keys
876
- var enumBugKeys$3 = [
877
- 'constructor',
878
- 'hasOwnProperty',
879
- 'isPrototypeOf',
880
- 'propertyIsEnumerable',
881
- 'toLocaleString',
882
- 'toString',
883
- 'valueOf'
884
- ];
885
-
886
- var internalObjectKeys$1 = objectKeysInternal;
887
- var enumBugKeys$2 = enumBugKeys$3;
888
-
889
- var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
890
-
891
- // `Object.getOwnPropertyNames` method
892
- // https://tc39.es/ecma262/#sec-object.getownpropertynames
893
- // eslint-disable-next-line es/no-object-getownpropertynames -- safe
894
- objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
895
- return internalObjectKeys$1(O, hiddenKeys$1);
896
- };
897
-
898
- var objectGetOwnPropertySymbols = {};
899
-
900
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
901
- objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
902
-
903
- var getBuiltIn$1 = getBuiltIn$3;
904
- var uncurryThis$8 = functionUncurryThis;
905
- var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
906
- var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
907
- var anObject$5 = anObject$7;
908
-
909
- var concat$2 = uncurryThis$8([].concat);
910
-
911
- // all object keys, includes non-enumerable and symbols
912
- var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
913
- var keys = getOwnPropertyNamesModule.f(anObject$5(it));
914
- var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
915
- return getOwnPropertySymbols ? concat$2(keys, getOwnPropertySymbols(it)) : keys;
916
- };
917
-
918
- var hasOwn = hasOwnProperty_1;
919
- var ownKeys = ownKeys$1;
920
- var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
921
- var definePropertyModule$1 = objectDefineProperty;
922
-
923
- var copyConstructorProperties$1 = function (target, source, exceptions) {
924
- var keys = ownKeys(source);
925
- var defineProperty = definePropertyModule$1.f;
926
- var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
927
- for (var i = 0; i < keys.length; i++) {
928
- var key = keys[i];
929
- if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
930
- defineProperty(target, key, getOwnPropertyDescriptor(source, key));
931
- }
932
- }
933
- };
934
-
935
- var fails$8 = fails$g;
936
- var isCallable$3 = isCallable$d;
937
-
938
- var replacement = /#|\.prototype\./;
939
-
940
- var isForced$1 = function (feature, detection) {
941
- var value = data[normalize(feature)];
942
- return value === POLYFILL ? true
943
- : value === NATIVE ? false
944
- : isCallable$3(detection) ? fails$8(detection)
945
- : !!detection;
946
- };
947
-
948
- var normalize = isForced$1.normalize = function (string) {
949
- return String(string).replace(replacement, '.').toLowerCase();
950
- };
951
-
952
- var data = isForced$1.data = {};
953
- var NATIVE = isForced$1.NATIVE = 'N';
954
- var POLYFILL = isForced$1.POLYFILL = 'P';
955
-
956
- var isForced_1 = isForced$1;
957
-
958
- var global$5 = global$f;
959
- var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
960
- var createNonEnumerableProperty$1 = createNonEnumerableProperty$3;
961
- var defineBuiltIn$1 = defineBuiltIn$2;
962
- var defineGlobalProperty = defineGlobalProperty$3;
963
- var copyConstructorProperties = copyConstructorProperties$1;
964
- var isForced = isForced_1;
965
-
966
- /*
967
- options.target - name of the target object
968
- options.global - target is the global object
969
- options.stat - export as static methods of target
970
- options.proto - export as prototype methods of target
971
- options.real - real prototype method for the `pure` version
972
- options.forced - export even if the native feature is available
973
- options.bind - bind methods to the target, required for the `pure` version
974
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
975
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
976
- options.sham - add a flag to not completely full polyfills
977
- options.enumerable - export as enumerable property
978
- options.dontCallGetSet - prevent calling a getter on target
979
- options.name - the .name of the function if it does not match the key
980
- */
981
- var _export = function (options, source) {
982
- var TARGET = options.target;
983
- var GLOBAL = options.global;
984
- var STATIC = options.stat;
985
- var FORCED, target, key, targetProperty, sourceProperty, descriptor;
986
- if (GLOBAL) {
987
- target = global$5;
988
- } else if (STATIC) {
989
- target = global$5[TARGET] || defineGlobalProperty(TARGET, {});
990
- } else {
991
- target = (global$5[TARGET] || {}).prototype;
992
- }
993
- if (target) for (key in source) {
994
- sourceProperty = source[key];
995
- if (options.dontCallGetSet) {
996
- descriptor = getOwnPropertyDescriptor(target, key);
997
- targetProperty = descriptor && descriptor.value;
998
- } else targetProperty = target[key];
999
- FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
1000
- // contained in target
1001
- if (!FORCED && targetProperty !== undefined) {
1002
- if (typeof sourceProperty == typeof targetProperty) continue;
1003
- copyConstructorProperties(sourceProperty, targetProperty);
1004
- }
1005
- // add a flag to not completely full polyfills
1006
- if (options.sham || (targetProperty && targetProperty.sham)) {
1007
- createNonEnumerableProperty$1(sourceProperty, 'sham', true);
1008
- }
1009
- defineBuiltIn$1(target, key, sourceProperty, options);
1010
- }
1011
- };
1012
-
1013
- var objectDefineProperties = {};
1014
-
1015
- var internalObjectKeys = objectKeysInternal;
1016
- var enumBugKeys$1 = enumBugKeys$3;
1017
-
1018
- // `Object.keys` method
1019
- // https://tc39.es/ecma262/#sec-object.keys
1020
- // eslint-disable-next-line es/no-object-keys -- safe
1021
- var objectKeys$2 = Object.keys || function keys(O) {
1022
- return internalObjectKeys(O, enumBugKeys$1);
1023
- };
1024
-
1025
- var DESCRIPTORS$1 = descriptors;
1026
- var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1027
- var definePropertyModule = objectDefineProperty;
1028
- var anObject$4 = anObject$7;
1029
- var toIndexedObject = toIndexedObject$4;
1030
- var objectKeys$1 = objectKeys$2;
1031
-
1032
- // `Object.defineProperties` method
1033
- // https://tc39.es/ecma262/#sec-object.defineproperties
1034
- // eslint-disable-next-line es/no-object-defineproperties -- safe
1035
- objectDefineProperties.f = DESCRIPTORS$1 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1036
- anObject$4(O);
1037
- var props = toIndexedObject(Properties);
1038
- var keys = objectKeys$1(Properties);
1039
- var length = keys.length;
1040
- var index = 0;
1041
- var key;
1042
- while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
1043
- return O;
1044
- };
1045
-
1046
- var getBuiltIn = getBuiltIn$3;
1047
-
1048
- var html$1 = getBuiltIn('document', 'documentElement');
1049
-
1050
- /* global ActiveXObject -- old IE, WSH */
1051
- var anObject$3 = anObject$7;
1052
- var definePropertiesModule = objectDefineProperties;
1053
- var enumBugKeys = enumBugKeys$3;
1054
- var hiddenKeys = hiddenKeys$4;
1055
- var html = html$1;
1056
- var documentCreateElement = documentCreateElement$1;
1057
- var sharedKey = sharedKey$2;
1058
-
1059
- var GT = '>';
1060
- var LT = '<';
1061
- var PROTOTYPE = 'prototype';
1062
- var SCRIPT = 'script';
1063
- var IE_PROTO = sharedKey('IE_PROTO');
1064
-
1065
- var EmptyConstructor = function () { /* empty */ };
1066
-
1067
- var scriptTag = function (content) {
1068
- return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
1069
- };
1070
-
1071
- // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
1072
- var NullProtoObjectViaActiveX = function (activeXDocument) {
1073
- activeXDocument.write(scriptTag(''));
1074
- activeXDocument.close();
1075
- var temp = activeXDocument.parentWindow.Object;
1076
- activeXDocument = null; // avoid memory leak
1077
- return temp;
1078
- };
1079
-
1080
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
1081
- var NullProtoObjectViaIFrame = function () {
1082
- // Thrash, waste and sodomy: IE GC bug
1083
- var iframe = documentCreateElement('iframe');
1084
- var JS = 'java' + SCRIPT + ':';
1085
- var iframeDocument;
1086
- iframe.style.display = 'none';
1087
- html.appendChild(iframe);
1088
- // https://github.com/zloirock/core-js/issues/475
1089
- iframe.src = String(JS);
1090
- iframeDocument = iframe.contentWindow.document;
1091
- iframeDocument.open();
1092
- iframeDocument.write(scriptTag('document.F=Object'));
1093
- iframeDocument.close();
1094
- return iframeDocument.F;
1095
- };
1096
-
1097
- // Check for document.domain and active x support
1098
- // No need to use active x approach when document.domain is not set
1099
- // see https://github.com/es-shims/es5-shim/issues/150
1100
- // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
1101
- // avoid IE GC bug
1102
- var activeXDocument;
1103
- var NullProtoObject = function () {
1104
- try {
1105
- activeXDocument = new ActiveXObject('htmlfile');
1106
- } catch (error) { /* ignore */ }
1107
- NullProtoObject = typeof document != 'undefined'
1108
- ? document.domain && activeXDocument
1109
- ? NullProtoObjectViaActiveX(activeXDocument) // old IE
1110
- : NullProtoObjectViaIFrame()
1111
- : NullProtoObjectViaActiveX(activeXDocument); // WSH
1112
- var length = enumBugKeys.length;
1113
- while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
1114
- return NullProtoObject();
1115
- };
1116
-
1117
- hiddenKeys[IE_PROTO] = true;
1118
-
1119
- // `Object.create` method
1120
- // https://tc39.es/ecma262/#sec-object.create
1121
- // eslint-disable-next-line es/no-object-create -- safe
1122
- var objectCreate = Object.create || function create(O, Properties) {
1123
- var result;
1124
- if (O !== null) {
1125
- EmptyConstructor[PROTOTYPE] = anObject$3(O);
1126
- result = new EmptyConstructor();
1127
- EmptyConstructor[PROTOTYPE] = null;
1128
- // add "__proto__" for Object.getPrototypeOf polyfill
1129
- result[IE_PROTO] = O;
1130
- } else result = NullProtoObject();
1131
- return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1132
- };
1133
-
1134
- var wellKnownSymbol$6 = wellKnownSymbol$8;
1135
- var create$1 = objectCreate;
1136
- var defineProperty$1 = objectDefineProperty.f;
1137
-
1138
- var UNSCOPABLES = wellKnownSymbol$6('unscopables');
1139
- var ArrayPrototype = Array.prototype;
1140
-
1141
- // Array.prototype[@@unscopables]
1142
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1143
- if (ArrayPrototype[UNSCOPABLES] === undefined) {
1144
- defineProperty$1(ArrayPrototype, UNSCOPABLES, {
1145
- configurable: true,
1146
- value: create$1(null)
1147
- });
1148
- }
1149
-
1150
- // add a key to Array.prototype[@@unscopables]
1151
- var addToUnscopables$1 = function (key) {
1152
- ArrayPrototype[UNSCOPABLES][key] = true;
1153
- };
1154
-
1155
- var $$4 = _export;
1156
- var $includes = arrayIncludes.includes;
1157
- var fails$7 = fails$g;
1158
- var addToUnscopables = addToUnscopables$1;
1159
-
1160
- // FF99+ bug
1161
- var BROKEN_ON_SPARSE = fails$7(function () {
1162
- // eslint-disable-next-line es/no-array-prototype-includes -- detection
1163
- return !Array(1).includes();
1164
- });
1165
-
1166
- // `Array.prototype.includes` method
1167
- // https://tc39.es/ecma262/#sec-array.prototype.includes
1168
- $$4({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
1169
- includes: function includes(el /* , fromIndex = 0 */) {
1170
- return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
1171
- }
1172
- });
1173
-
1174
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1175
- addToUnscopables('includes');
1176
-
1177
- var isObject = isObject$6;
1178
- var classof$4 = classofRaw$2;
1179
- var wellKnownSymbol$5 = wellKnownSymbol$8;
1180
-
1181
- var MATCH$1 = wellKnownSymbol$5('match');
1182
-
1183
- // `IsRegExp` abstract operation
1184
- // https://tc39.es/ecma262/#sec-isregexp
1185
- var isRegexp = function (it) {
1186
- var isRegExp;
1187
- return isObject(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classof$4(it) === 'RegExp');
1188
- };
1189
-
1190
- var isRegExp = isRegexp;
1191
-
1192
- var $TypeError$2 = TypeError;
1193
-
1194
- var notARegexp = function (it) {
1195
- if (isRegExp(it)) {
1196
- throw new $TypeError$2("The method doesn't accept regular expressions");
1197
- } return it;
1198
- };
1199
-
1200
- var wellKnownSymbol$4 = wellKnownSymbol$8;
1201
-
1202
- var TO_STRING_TAG$1 = wellKnownSymbol$4('toStringTag');
1203
- var test = {};
1204
-
1205
- test[TO_STRING_TAG$1] = 'z';
1206
-
1207
- var toStringTagSupport = String(test) === '[object z]';
1208
-
1209
- var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1210
- var isCallable$2 = isCallable$d;
1211
- var classofRaw$1 = classofRaw$2;
1212
- var wellKnownSymbol$3 = wellKnownSymbol$8;
1213
-
1214
- var TO_STRING_TAG = wellKnownSymbol$3('toStringTag');
1215
- var $Object = Object;
1216
-
1217
- // ES3 wrong here
1218
- var CORRECT_ARGUMENTS = classofRaw$1(function () { return arguments; }()) === 'Arguments';
1219
-
1220
- // fallback for IE11 Script Access Denied error
1221
- var tryGet = function (it, key) {
1222
- try {
1223
- return it[key];
1224
- } catch (error) { /* empty */ }
1225
- };
1226
-
1227
- // getting tag from ES6+ `Object.prototype.toString`
1228
- var classof$3 = TO_STRING_TAG_SUPPORT ? classofRaw$1 : function (it) {
1229
- var O, tag, result;
1230
- return it === undefined ? 'Undefined' : it === null ? 'Null'
1231
- // @@toStringTag case
1232
- : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
1233
- // builtinTag case
1234
- : CORRECT_ARGUMENTS ? classofRaw$1(O)
1235
- // ES3 arguments fallback
1236
- : (result = classofRaw$1(O)) === 'Object' && isCallable$2(O.callee) ? 'Arguments' : result;
1237
- };
1238
-
1239
- var classof$2 = classof$3;
1240
-
1241
- var $String = String;
1242
-
1243
- var toString$4 = function (argument) {
1244
- if (classof$2(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
1245
- return $String(argument);
1246
- };
1247
-
1248
- var wellKnownSymbol$2 = wellKnownSymbol$8;
1249
-
1250
- var MATCH = wellKnownSymbol$2('match');
1251
-
1252
- var correctIsRegexpLogic = function (METHOD_NAME) {
1253
- var regexp = /./;
1254
- try {
1255
- '/./'[METHOD_NAME](regexp);
1256
- } catch (error1) {
1257
- try {
1258
- regexp[MATCH] = false;
1259
- return '/./'[METHOD_NAME](regexp);
1260
- } catch (error2) { /* empty */ }
1261
- } return false;
1262
- };
1263
-
1264
- var $$3 = _export;
1265
- var uncurryThis$7 = functionUncurryThis;
1266
- var notARegExp = notARegexp;
1267
- var requireObjectCoercible$2 = requireObjectCoercible$5;
1268
- var toString$3 = toString$4;
1269
- var correctIsRegExpLogic = correctIsRegexpLogic;
1270
-
1271
- var stringIndexOf$1 = uncurryThis$7(''.indexOf);
1272
-
1273
- // `String.prototype.includes` method
1274
- // https://tc39.es/ecma262/#sec-string.prototype.includes
1275
- $$3({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
1276
- includes: function includes(searchString /* , position = 0 */) {
1277
- return !!~stringIndexOf$1(
1278
- toString$3(requireObjectCoercible$2(this)),
1279
- toString$3(notARegExp(searchString)),
1280
- arguments.length > 1 ? arguments[1] : undefined
1281
- );
1282
- }
1283
- });
1284
-
1285
- var DESCRIPTORS = descriptors;
1286
- var uncurryThis$6 = functionUncurryThis;
1287
- var call$4 = functionCall;
1288
- var fails$6 = fails$g;
1289
- var objectKeys = objectKeys$2;
1290
- var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1291
- var propertyIsEnumerableModule = objectPropertyIsEnumerable;
1292
- var toObject$2 = toObject$4;
1293
- var IndexedObject$1 = indexedObject;
1294
-
1295
- // eslint-disable-next-line es/no-object-assign -- safe
1296
- var $assign = Object.assign;
1297
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1298
- var defineProperty = Object.defineProperty;
1299
- var concat$1 = uncurryThis$6([].concat);
1300
-
1301
- // `Object.assign` method
1302
- // https://tc39.es/ecma262/#sec-object.assign
1303
- var objectAssign = !$assign || fails$6(function () {
1304
- // should have correct order of operations (Edge bug)
1305
- if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
1306
- enumerable: true,
1307
- get: function () {
1308
- defineProperty(this, 'b', {
1309
- value: 3,
1310
- enumerable: false
1311
- });
1312
- }
1313
- }), { b: 2 })).b !== 1) return true;
1314
- // should work with symbols and should have deterministic property order (V8 bug)
1315
- var A = {};
1316
- var B = {};
1317
- // eslint-disable-next-line es/no-symbol -- safe
1318
- var symbol = Symbol('assign detection');
1319
- var alphabet = 'abcdefghijklmnopqrst';
1320
- A[symbol] = 7;
1321
- alphabet.split('').forEach(function (chr) { B[chr] = chr; });
1322
- return $assign({}, A)[symbol] !== 7 || objectKeys($assign({}, B)).join('') !== alphabet;
1323
- }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
1324
- var T = toObject$2(target);
1325
- var argumentsLength = arguments.length;
1326
- var index = 1;
1327
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1328
- var propertyIsEnumerable = propertyIsEnumerableModule.f;
1329
- while (argumentsLength > index) {
1330
- var S = IndexedObject$1(arguments[index++]);
1331
- var keys = getOwnPropertySymbols ? concat$1(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
1332
- var length = keys.length;
1333
- var j = 0;
1334
- var key;
1335
- while (length > j) {
1336
- key = keys[j++];
1337
- if (!DESCRIPTORS || call$4(propertyIsEnumerable, S, key)) T[key] = S[key];
1338
- }
1339
- } return T;
1340
- } : $assign;
1341
-
1342
- var $$2 = _export;
1343
- var assign = objectAssign;
1344
-
1345
- // `Object.assign` method
1346
- // https://tc39.es/ecma262/#sec-object.assign
1347
- // eslint-disable-next-line es/no-object-assign -- required for testing
1348
- $$2({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1349
- assign: assign
1350
- });
1351
-
1352
- var anObject$2 = anObject$7;
1353
-
1354
- // `RegExp.prototype.flags` getter implementation
1355
- // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
1356
- var regexpFlags$1 = function () {
1357
- var that = anObject$2(this);
1358
- var result = '';
1359
- if (that.hasIndices) result += 'd';
1360
- if (that.global) result += 'g';
1361
- if (that.ignoreCase) result += 'i';
1362
- if (that.multiline) result += 'm';
1363
- if (that.dotAll) result += 's';
1364
- if (that.unicode) result += 'u';
1365
- if (that.unicodeSets) result += 'v';
1366
- if (that.sticky) result += 'y';
1367
- return result;
1368
- };
1369
-
1370
- var fails$5 = fails$g;
1371
- var global$4 = global$f;
1372
-
1373
- // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
1374
- var $RegExp$2 = global$4.RegExp;
1375
-
1376
- var UNSUPPORTED_Y$1 = fails$5(function () {
1377
- var re = $RegExp$2('a', 'y');
1378
- re.lastIndex = 2;
1379
- return re.exec('abcd') !== null;
1380
- });
1381
-
1382
- // UC Browser bug
1383
- // https://github.com/zloirock/core-js/issues/1008
1384
- var MISSED_STICKY = UNSUPPORTED_Y$1 || fails$5(function () {
1385
- return !$RegExp$2('a', 'y').sticky;
1386
- });
1387
-
1388
- var BROKEN_CARET = UNSUPPORTED_Y$1 || fails$5(function () {
1389
- // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
1390
- var re = $RegExp$2('^r', 'gy');
1391
- re.lastIndex = 2;
1392
- return re.exec('str') !== null;
1393
- });
1394
-
1395
- var regexpStickyHelpers = {
1396
- BROKEN_CARET: BROKEN_CARET,
1397
- MISSED_STICKY: MISSED_STICKY,
1398
- UNSUPPORTED_Y: UNSUPPORTED_Y$1
1399
- };
1400
-
1401
- var fails$4 = fails$g;
1402
- var global$3 = global$f;
1403
-
1404
- // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
1405
- var $RegExp$1 = global$3.RegExp;
1406
-
1407
- var regexpUnsupportedDotAll = fails$4(function () {
1408
- var re = $RegExp$1('.', 's');
1409
- return !(re.dotAll && re.test('\n') && re.flags === 's');
1410
- });
1411
-
1412
- var fails$3 = fails$g;
1413
- var global$2 = global$f;
1414
-
1415
- // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
1416
- var $RegExp = global$2.RegExp;
1417
-
1418
- var regexpUnsupportedNcg = fails$3(function () {
1419
- var re = $RegExp('(?<a>b)', 'g');
1420
- return re.exec('b').groups.a !== 'b' ||
1421
- 'b'.replace(re, '$<a>c') !== 'bc';
1422
- });
1423
-
1424
- /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
1425
- /* eslint-disable regexp/no-useless-quantifier -- testing */
1426
- var call$3 = functionCall;
1427
- var uncurryThis$5 = functionUncurryThis;
1428
- var toString$2 = toString$4;
1429
- var regexpFlags = regexpFlags$1;
1430
- var stickyHelpers = regexpStickyHelpers;
1431
- var shared = shared$4.exports;
1432
- var create = objectCreate;
1433
- var getInternalState = internalState.get;
1434
- var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll;
1435
- var UNSUPPORTED_NCG = regexpUnsupportedNcg;
1436
-
1437
- var nativeReplace = shared('native-string-replace', String.prototype.replace);
1438
- var nativeExec = RegExp.prototype.exec;
1439
- var patchedExec = nativeExec;
1440
- var charAt$3 = uncurryThis$5(''.charAt);
1441
- var indexOf = uncurryThis$5(''.indexOf);
1442
- var replace$1 = uncurryThis$5(''.replace);
1443
- var stringSlice$3 = uncurryThis$5(''.slice);
1444
-
1445
- var UPDATES_LAST_INDEX_WRONG = (function () {
1446
- var re1 = /a/;
1447
- var re2 = /b*/g;
1448
- call$3(nativeExec, re1, 'a');
1449
- call$3(nativeExec, re2, 'a');
1450
- return re1.lastIndex !== 0 || re2.lastIndex !== 0;
1451
- })();
1452
-
1453
- var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;
1454
-
1455
- // nonparticipating capturing group, copied from es5-shim's String#split patch.
1456
- var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
1457
-
1458
- var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
1459
-
1460
- if (PATCH) {
1461
- patchedExec = function exec(string) {
1462
- var re = this;
1463
- var state = getInternalState(re);
1464
- var str = toString$2(string);
1465
- var raw = state.raw;
1466
- var result, reCopy, lastIndex, match, i, object, group;
1467
-
1468
- if (raw) {
1469
- raw.lastIndex = re.lastIndex;
1470
- result = call$3(patchedExec, raw, str);
1471
- re.lastIndex = raw.lastIndex;
1472
- return result;
1473
- }
1474
-
1475
- var groups = state.groups;
1476
- var sticky = UNSUPPORTED_Y && re.sticky;
1477
- var flags = call$3(regexpFlags, re);
1478
- var source = re.source;
1479
- var charsAdded = 0;
1480
- var strCopy = str;
1481
-
1482
- if (sticky) {
1483
- flags = replace$1(flags, 'y', '');
1484
- if (indexOf(flags, 'g') === -1) {
1485
- flags += 'g';
1486
- }
1487
-
1488
- strCopy = stringSlice$3(str, re.lastIndex);
1489
- // Support anchored sticky behavior.
1490
- if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$3(str, re.lastIndex - 1) !== '\n')) {
1491
- source = '(?: ' + source + ')';
1492
- strCopy = ' ' + strCopy;
1493
- charsAdded++;
1494
- }
1495
- // ^(? + rx + ) is needed, in combination with some str slicing, to
1496
- // simulate the 'y' flag.
1497
- reCopy = new RegExp('^(?:' + source + ')', flags);
1498
- }
1499
-
1500
- if (NPCG_INCLUDED) {
1501
- reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
1502
- }
1503
- if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
1504
-
1505
- match = call$3(nativeExec, sticky ? reCopy : re, strCopy);
1506
-
1507
- if (sticky) {
1508
- if (match) {
1509
- match.input = stringSlice$3(match.input, charsAdded);
1510
- match[0] = stringSlice$3(match[0], charsAdded);
1511
- match.index = re.lastIndex;
1512
- re.lastIndex += match[0].length;
1513
- } else re.lastIndex = 0;
1514
- } else if (UPDATES_LAST_INDEX_WRONG && match) {
1515
- re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
1516
- }
1517
- if (NPCG_INCLUDED && match && match.length > 1) {
1518
- // Fix browsers whose `exec` methods don't consistently return `undefined`
1519
- // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
1520
- call$3(nativeReplace, match[0], reCopy, function () {
1521
- for (i = 1; i < arguments.length - 2; i++) {
1522
- if (arguments[i] === undefined) match[i] = undefined;
1523
- }
1524
- });
1525
- }
1526
-
1527
- if (match && groups) {
1528
- match.groups = object = create(null);
1529
- for (i = 0; i < groups.length; i++) {
1530
- group = groups[i];
1531
- object[group[0]] = match[group[1]];
1532
- }
1533
- }
1534
-
1535
- return match;
1536
- };
1537
- }
1538
-
1539
- var regexpExec$2 = patchedExec;
1540
-
1541
- var $$1 = _export;
1542
- var exec = regexpExec$2;
1543
-
1544
- // `RegExp.prototype.exec` method
1545
- // https://tc39.es/ecma262/#sec-regexp.prototype.exec
1546
- $$1({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
1547
- exec: exec
1548
- });
1549
-
1550
- var NATIVE_BIND = functionBindNative;
1551
-
1552
- var FunctionPrototype = Function.prototype;
1553
- var apply$1 = FunctionPrototype.apply;
1554
- var call$2 = FunctionPrototype.call;
1555
-
1556
- // eslint-disable-next-line es/no-reflect -- safe
1557
- var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call$2.bind(apply$1) : function () {
1558
- return call$2.apply(apply$1, arguments);
1559
- });
1560
-
1561
- var classofRaw = classofRaw$2;
1562
- var uncurryThis$4 = functionUncurryThis;
1563
-
1564
- var functionUncurryThisClause = function (fn) {
1565
- // Nashorn bug:
1566
- // https://github.com/zloirock/core-js/issues/1128
1567
- // https://github.com/zloirock/core-js/issues/1130
1568
- if (classofRaw(fn) === 'Function') return uncurryThis$4(fn);
1569
- };
1570
-
1571
- // TODO: Remove from `core-js@4` since it's moved to entry points
1572
-
1573
- var uncurryThis$3 = functionUncurryThisClause;
1574
- var defineBuiltIn = defineBuiltIn$2;
1575
- var regexpExec$1 = regexpExec$2;
1576
- var fails$2 = fails$g;
1577
- var wellKnownSymbol$1 = wellKnownSymbol$8;
1578
- var createNonEnumerableProperty = createNonEnumerableProperty$3;
1579
-
1580
- var SPECIES = wellKnownSymbol$1('species');
1581
- var RegExpPrototype = RegExp.prototype;
1582
-
1583
- var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
1584
- var SYMBOL = wellKnownSymbol$1(KEY);
1585
-
1586
- var DELEGATES_TO_SYMBOL = !fails$2(function () {
1587
- // String methods call symbol-named RegEp methods
1588
- var O = {};
1589
- O[SYMBOL] = function () { return 7; };
1590
- return ''[KEY](O) !== 7;
1591
- });
1592
-
1593
- var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$2(function () {
1594
- // Symbol-named RegExp methods call .exec
1595
- var execCalled = false;
1596
- var re = /a/;
1597
-
1598
- if (KEY === 'split') {
1599
- // We can't use real regex here since it causes deoptimization
1600
- // and serious performance degradation in V8
1601
- // https://github.com/zloirock/core-js/issues/306
1602
- re = {};
1603
- // RegExp[@@split] doesn't call the regex's exec method, but first creates
1604
- // a new one. We need to return the patched regex when creating the new one.
1605
- re.constructor = {};
1606
- re.constructor[SPECIES] = function () { return re; };
1607
- re.flags = '';
1608
- re[SYMBOL] = /./[SYMBOL];
1609
- }
1610
-
1611
- re.exec = function () {
1612
- execCalled = true;
1613
- return null;
1614
- };
1615
-
1616
- re[SYMBOL]('');
1617
- return !execCalled;
1618
- });
1619
-
1620
- if (
1621
- !DELEGATES_TO_SYMBOL ||
1622
- !DELEGATES_TO_EXEC ||
1623
- FORCED
1624
- ) {
1625
- var uncurriedNativeRegExpMethod = uncurryThis$3(/./[SYMBOL]);
1626
- var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
1627
- var uncurriedNativeMethod = uncurryThis$3(nativeMethod);
1628
- var $exec = regexp.exec;
1629
- if ($exec === regexpExec$1 || $exec === RegExpPrototype.exec) {
1630
- if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
1631
- // The native String method already delegates to @@method (this
1632
- // polyfilled function), leasing to infinite recursion.
1633
- // We avoid it by directly calling the native @@method method.
1634
- return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
1635
- }
1636
- return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
1637
- }
1638
- return { done: false };
1639
- });
1640
-
1641
- defineBuiltIn(String.prototype, KEY, methods[0]);
1642
- defineBuiltIn(RegExpPrototype, SYMBOL, methods[1]);
1643
- }
1644
-
1645
- if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);
1646
- };
1647
-
1648
- var uncurryThis$2 = functionUncurryThis;
1649
- var toIntegerOrInfinity$1 = toIntegerOrInfinity$4;
1650
- var toString$1 = toString$4;
1651
- var requireObjectCoercible$1 = requireObjectCoercible$5;
1652
-
1653
- var charAt$2 = uncurryThis$2(''.charAt);
1654
- var charCodeAt = uncurryThis$2(''.charCodeAt);
1655
- var stringSlice$2 = uncurryThis$2(''.slice);
1656
-
1657
- var createMethod$1 = function (CONVERT_TO_STRING) {
1658
- return function ($this, pos) {
1659
- var S = toString$1(requireObjectCoercible$1($this));
1660
- var position = toIntegerOrInfinity$1(pos);
1661
- var size = S.length;
1662
- var first, second;
1663
- if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
1664
- first = charCodeAt(S, position);
1665
- return first < 0xD800 || first > 0xDBFF || position + 1 === size
1666
- || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
1667
- ? CONVERT_TO_STRING
1668
- ? charAt$2(S, position)
1669
- : first
1670
- : CONVERT_TO_STRING
1671
- ? stringSlice$2(S, position, position + 2)
1672
- : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
1673
- };
1674
- };
1675
-
1676
- var stringMultibyte = {
1677
- // `String.prototype.codePointAt` method
1678
- // https://tc39.es/ecma262/#sec-string.prototype.codepointat
1679
- codeAt: createMethod$1(false),
1680
- // `String.prototype.at` method
1681
- // https://github.com/mathiasbynens/String.prototype.at
1682
- charAt: createMethod$1(true)
1683
- };
1684
-
1685
- var charAt$1 = stringMultibyte.charAt;
1686
-
1687
- // `AdvanceStringIndex` abstract operation
1688
- // https://tc39.es/ecma262/#sec-advancestringindex
1689
- var advanceStringIndex$1 = function (S, index, unicode) {
1690
- return index + (unicode ? charAt$1(S, index).length : 1);
1691
- };
1692
-
1693
- var uncurryThis$1 = functionUncurryThis;
1694
- var toObject$1 = toObject$4;
1695
-
1696
- var floor = Math.floor;
1697
- var charAt = uncurryThis$1(''.charAt);
1698
- var replace = uncurryThis$1(''.replace);
1699
- var stringSlice$1 = uncurryThis$1(''.slice);
1700
- // eslint-disable-next-line redos/no-vulnerable -- safe
1701
- var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
1702
- var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
1703
-
1704
- // `GetSubstitution` abstract operation
1705
- // https://tc39.es/ecma262/#sec-getsubstitution
1706
- var getSubstitution$1 = function (matched, str, position, captures, namedCaptures, replacement) {
1707
- var tailPos = position + matched.length;
1708
- var m = captures.length;
1709
- var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
1710
- if (namedCaptures !== undefined) {
1711
- namedCaptures = toObject$1(namedCaptures);
1712
- symbols = SUBSTITUTION_SYMBOLS;
1713
- }
1714
- return replace(replacement, symbols, function (match, ch) {
1715
- var capture;
1716
- switch (charAt(ch, 0)) {
1717
- case '$': return '$';
1718
- case '&': return matched;
1719
- case '`': return stringSlice$1(str, 0, position);
1720
- case "'": return stringSlice$1(str, tailPos);
1721
- case '<':
1722
- capture = namedCaptures[stringSlice$1(ch, 1, -1)];
1723
- break;
1724
- default: // \d\d?
1725
- var n = +ch;
1726
- if (n === 0) return match;
1727
- if (n > m) {
1728
- var f = floor(n / 10);
1729
- if (f === 0) return match;
1730
- if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1);
1731
- return match;
1732
- }
1733
- capture = captures[n - 1];
1734
- }
1735
- return capture === undefined ? '' : capture;
1736
- });
1737
- };
1738
-
1739
- var call$1 = functionCall;
1740
- var anObject$1 = anObject$7;
1741
- var isCallable$1 = isCallable$d;
1742
- var classof$1 = classofRaw$2;
1743
- var regexpExec = regexpExec$2;
1744
-
1745
- var $TypeError$1 = TypeError;
1746
-
1747
- // `RegExpExec` abstract operation
1748
- // https://tc39.es/ecma262/#sec-regexpexec
1749
- var regexpExecAbstract = function (R, S) {
1750
- var exec = R.exec;
1751
- if (isCallable$1(exec)) {
1752
- var result = call$1(exec, R, S);
1753
- if (result !== null) anObject$1(result);
1754
- return result;
1755
- }
1756
- if (classof$1(R) === 'RegExp') return call$1(regexpExec, R, S);
1757
- throw new $TypeError$1('RegExp#exec called on incompatible receiver');
1758
- };
1759
-
1760
- var apply = functionApply;
1761
- var call = functionCall;
1762
- var uncurryThis = functionUncurryThis;
1763
- var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
1764
- var fails$1 = fails$g;
1765
- var anObject = anObject$7;
1766
- var isCallable = isCallable$d;
1767
- var isNullOrUndefined = isNullOrUndefined$3;
1768
- var toIntegerOrInfinity = toIntegerOrInfinity$4;
1769
- var toLength = toLength$2;
1770
- var toString = toString$4;
1771
- var requireObjectCoercible = requireObjectCoercible$5;
1772
- var advanceStringIndex = advanceStringIndex$1;
1773
- var getMethod = getMethod$2;
1774
- var getSubstitution = getSubstitution$1;
1775
- var regExpExec = regexpExecAbstract;
1776
- var wellKnownSymbol = wellKnownSymbol$8;
1777
-
1778
- var REPLACE = wellKnownSymbol('replace');
1779
- var max = Math.max;
1780
- var min = Math.min;
1781
- var concat = uncurryThis([].concat);
1782
- var push = uncurryThis([].push);
1783
- var stringIndexOf = uncurryThis(''.indexOf);
1784
- var stringSlice = uncurryThis(''.slice);
1785
-
1786
- var maybeToString = function (it) {
1787
- return it === undefined ? it : String(it);
1788
- };
1789
-
1790
- // IE <= 11 replaces $0 with the whole match, as if it was $&
1791
- // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
1792
- var REPLACE_KEEPS_$0 = (function () {
1793
- // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
1794
- return 'a'.replace(/./, '$0') === '$0';
1795
- })();
1796
-
1797
- // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
1798
- var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
1799
- if (/./[REPLACE]) {
1800
- return /./[REPLACE]('a', '$0') === '';
1801
- }
1802
- return false;
1803
- })();
1804
-
1805
- var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$1(function () {
1806
- var re = /./;
1807
- re.exec = function () {
1808
- var result = [];
1809
- result.groups = { a: '7' };
1810
- return result;
1811
- };
1812
- // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
1813
- return ''.replace(re, '$<a>') !== '7';
1814
- });
1815
-
1816
- // @@replace logic
1817
- fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {
1818
- var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
1819
-
1820
- return [
1821
- // `String.prototype.replace` method
1822
- // https://tc39.es/ecma262/#sec-string.prototype.replace
1823
- function replace(searchValue, replaceValue) {
1824
- var O = requireObjectCoercible(this);
1825
- var replacer = isNullOrUndefined(searchValue) ? undefined : getMethod(searchValue, REPLACE);
1826
- return replacer
1827
- ? call(replacer, searchValue, O, replaceValue)
1828
- : call(nativeReplace, toString(O), searchValue, replaceValue);
1829
- },
1830
- // `RegExp.prototype[@@replace]` method
1831
- // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
1832
- function (string, replaceValue) {
1833
- var rx = anObject(this);
1834
- var S = toString(string);
1835
-
1836
- if (
1837
- typeof replaceValue == 'string' &&
1838
- stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
1839
- stringIndexOf(replaceValue, '$<') === -1
1840
- ) {
1841
- var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
1842
- if (res.done) return res.value;
1843
- }
1844
-
1845
- var functionalReplace = isCallable(replaceValue);
1846
- if (!functionalReplace) replaceValue = toString(replaceValue);
1847
-
1848
- var global = rx.global;
1849
- var fullUnicode;
1850
- if (global) {
1851
- fullUnicode = rx.unicode;
1852
- rx.lastIndex = 0;
1853
- }
1854
-
1855
- var results = [];
1856
- var result;
1857
- while (true) {
1858
- result = regExpExec(rx, S);
1859
- if (result === null) break;
1860
-
1861
- push(results, result);
1862
- if (!global) break;
1863
-
1864
- var matchStr = toString(result[0]);
1865
- if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
1866
- }
1867
-
1868
- var accumulatedResult = '';
1869
- var nextSourcePosition = 0;
1870
- for (var i = 0; i < results.length; i++) {
1871
- result = results[i];
1872
-
1873
- var matched = toString(result[0]);
1874
- var position = max(min(toIntegerOrInfinity(result.index), S.length), 0);
1875
- var captures = [];
1876
- var replacement;
1877
- // NOTE: This is equivalent to
1878
- // captures = result.slice(1).map(maybeToString)
1879
- // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
1880
- // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
1881
- // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
1882
- for (var j = 1; j < result.length; j++) push(captures, maybeToString(result[j]));
1883
- var namedCaptures = result.groups;
1884
- if (functionalReplace) {
1885
- var replacerArgs = concat([matched], captures, position, S);
1886
- if (namedCaptures !== undefined) push(replacerArgs, namedCaptures);
1887
- replacement = toString(apply(replaceValue, undefined, replacerArgs));
1888
- } else {
1889
- replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
1890
- }
1891
- if (position >= nextSourcePosition) {
1892
- accumulatedResult += stringSlice(S, nextSourcePosition, position) + replacement;
1893
- nextSourcePosition = position + matched.length;
1894
- }
1895
- }
1896
-
1897
- return accumulatedResult + stringSlice(S, nextSourcePosition);
1898
- }
1899
- ];
1900
- }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
1901
-
1902
- var aCallable = aCallable$2;
1903
- var toObject = toObject$4;
1904
- var IndexedObject = indexedObject;
1905
- var lengthOfArrayLike = lengthOfArrayLike$2;
1906
-
1907
- var $TypeError = TypeError;
1908
-
1909
- // `Array.prototype.{ reduce, reduceRight }` methods implementation
1910
- var createMethod = function (IS_RIGHT) {
1911
- return function (that, callbackfn, argumentsLength, memo) {
1912
- var O = toObject(that);
1913
- var self = IndexedObject(O);
1914
- var length = lengthOfArrayLike(O);
1915
- aCallable(callbackfn);
1916
- var index = IS_RIGHT ? length - 1 : 0;
1917
- var i = IS_RIGHT ? -1 : 1;
1918
- if (argumentsLength < 2) while (true) {
1919
- if (index in self) {
1920
- memo = self[index];
1921
- index += i;
1922
- break;
1923
- }
1924
- index += i;
1925
- if (IS_RIGHT ? index < 0 : length <= index) {
1926
- throw new $TypeError('Reduce of empty array with no initial value');
1927
- }
1928
- }
1929
- for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
1930
- memo = callbackfn(memo, self[index], index, O);
1931
- }
1932
- return memo;
1933
- };
1934
- };
1935
-
1936
- var arrayReduce = {
1937
- // `Array.prototype.reduce` method
1938
- // https://tc39.es/ecma262/#sec-array.prototype.reduce
1939
- left: createMethod(false),
1940
- // `Array.prototype.reduceRight` method
1941
- // https://tc39.es/ecma262/#sec-array.prototype.reduceright
1942
- right: createMethod(true)
1943
- };
1944
-
1945
- var fails = fails$g;
1946
-
1947
- var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) {
1948
- var method = [][METHOD_NAME];
1949
- return !!method && fails(function () {
1950
- // eslint-disable-next-line no-useless-call -- required for testing
1951
- method.call(null, argument || function () { return 1; }, 1);
1952
- });
1953
- };
1954
-
1955
- var global$1 = global$f;
1956
- var classof = classofRaw$2;
1957
-
1958
- var engineIsNode = classof(global$1.process) === 'process';
1959
-
1960
- var $ = _export;
1961
- var $reduce = arrayReduce.left;
1962
- var arrayMethodIsStrict = arrayMethodIsStrict$1;
1963
- var CHROME_VERSION = engineV8Version;
1964
- var IS_NODE = engineIsNode;
1965
-
1966
- // Chrome 80-82 has a critical bug
1967
- // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
1968
- var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
1969
- var FORCED = CHROME_BUG || !arrayMethodIsStrict('reduce');
1970
-
1971
- // `Array.prototype.reduce` method
1972
- // https://tc39.es/ecma262/#sec-array.prototype.reduce
1973
- $({ target: 'Array', proto: true, forced: FORCED }, {
1974
- reduce: function reduce(callbackfn /* , initialValue */) {
1975
- var length = arguments.length;
1976
- return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
1977
- }
1978
- });
1979
-
1980
- function getPageElementBound(rowsNodes) {
1981
- if (!rowsNodes) {
1982
- return [];
1983
- }
1984
- return rowsNodes.map(row => {
1985
- const rowRect = row.getBoundingClientRect();
1986
- const columns = row.children;
1987
- return {
1988
- x: rowRect.x,
1989
- y: rowRect.y,
1990
- width: rowRect.width,
1991
- height: rowRect.height,
1992
- columns: Array.from(columns).map(column => {
1993
- const columnRect = column.getBoundingClientRect();
1994
- const containers = Array.from(column.querySelectorAll('[data-dot="container"]'));
1995
- const columnX = columnRect.left - rowRect.left;
1996
- const columnY = columnRect.top - rowRect.top;
1997
- return {
1998
- x: columnX,
1999
- y: columnY,
2000
- width: columnRect.width,
2001
- height: columnRect.height,
2002
- containers: containers.map(container => {
2003
- const containerRect = container.getBoundingClientRect();
2004
- const contentlets = Array.from(container.querySelectorAll('[data-dot="contentlet"]'));
2005
- return {
2006
- x: 0,
2007
- y: containerRect.y - rowRect.top,
2008
- width: containerRect.width,
2009
- height: containerRect.height,
2010
- payload: container.dataset.content,
2011
- contentlets: contentlets.map(contentlet => {
2012
- const contentletRect = contentlet.getBoundingClientRect();
2013
- return {
2014
- x: 0,
2015
- y: contentletRect.y - containerRect.y,
2016
- width: contentletRect.width,
2017
- height: contentletRect.height,
2018
- payload: contentlet.dataset.content
2019
- };
2020
- })
2021
- };
2022
- })
2023
- };
2024
- })
2025
- };
2026
- });
2027
- }
2028
- const getPageContainers = containers => {
2029
- return Object.keys(containers).reduce((acc, container) => {
2030
- const contentlets = containers[container].contentlets;
2031
- const contentletsKeys = Object.keys(contentlets);
2032
- contentletsKeys.forEach(key => {
2033
- var _a;
2034
- acc.push({
2035
- identifier: (_a = containers[container].container.path) !== null && _a !== void 0 ? _a : containers[container].container.identifier,
2036
- uuid: key.replace('uuid-', ''),
2037
- contentletsId: contentlets[key].map(contentlet => contentlet.identifier)
2038
- });
2039
- });
2040
- return acc;
2041
- }, []);
2042
- };
2043
- const getContainersData = (containers, containerRef) => {
2044
- const {
2045
- identifier,
2046
- uuid
2047
- } = containerRef;
2048
- const {
2049
- containerStructures
2050
- } = containers[identifier];
2051
- // Get accepts types of content types for this container
2052
- const acceptTypes = containerStructures.map(structure => structure.contentTypeVar).join(',');
2053
- // Get the contentlets for "this" container
2054
- const contentlets = containers[identifier].contentlets[`uuid-${uuid}`];
2055
- const pageContainers = getPageContainers(containers);
2056
- return Object.assign(Object.assign({}, containers[identifier].container), {
2057
- acceptTypes,
2058
- contentlets,
2059
- pageContainers
2060
- });
2061
- };
2062
-
2063
- /**
2064
- * `usePageEditor` is a custom React hook that sets up the page editor for a DotCMS page.
2065
- * It takes a `PageEditorOptions` object as a parameter and returns a reference to the rows of the page.
2066
- *
2067
- * This hook is the main brigde between your webapp and the dotcms page editor.
2068
- *
2069
- *
2070
- * @category Hooks
2071
- * @param {PageEditorOptions} props - The options for the page editor. Includes a `reloadFunction` and a `pathname`.
2072
- * @returns {React.RefObject<HTMLDivElement>[]} - A reference to the rows of the page.
2073
- * @throws {Error} - Throws an error if the `pathname` is not provided.
2074
- */
2075
- const usePageEditor = props => {
2076
- const {
2077
- reloadFunction = window.location.reload,
2078
- pathname = null
2079
- } = props;
2080
- if (!pathname) {
2081
- throw new Error('Dotcms page editor required the pathname of your webapp');
2082
- }
2083
- usePostUrlToEditor(pathname);
2084
- useScrollEvent();
2085
- useReloadPage(reloadFunction);
2086
- const rowsRef = useRequestBounds();
2087
- return rowsRef;
2088
- };
2089
- function useRequestBounds() {
2090
- const rows = useRef([]);
2091
- useEffect(() => {
2092
- function eventMessageHandler(event) {
2093
- if (event.data === 'ema-request-bounds') {
2094
- const positionData = getPageElementBound(rows.current);
2095
- postMessageToEditor({
2096
- action: CUSTOMER_ACTIONS.SET_BOUNDS,
2097
- payload: positionData
2098
- });
2099
- }
2100
- }
2101
- window.addEventListener('message', eventMessageHandler);
2102
- return () => {
2103
- window.removeEventListener('message', eventMessageHandler);
2104
- };
2105
- }, [rows]);
2106
- return rows;
2107
- }
2108
- function useScrollEvent() {
2109
- useEffect(() => {
2110
- function eventScrollHandler() {
2111
- postMessageToEditor({
2112
- action: CUSTOMER_ACTIONS.IFRAME_SCROLL
2113
- });
2114
- }
2115
- window.addEventListener('scroll', eventScrollHandler);
2116
- return () => {
2117
- window.removeEventListener('scroll', eventScrollHandler);
2118
- };
2119
- }, []);
2120
- }
2121
- function useReloadPage(reload = window.location.reload) {
2122
- useEffect(() => {
2123
- function eventMessageHandler(event) {
2124
- if (event.data === 'ema-reload-page') {
2125
- reload();
2126
- }
2127
- }
2128
- window.addEventListener('message', eventMessageHandler);
2129
- return () => {
2130
- window.removeEventListener('message', eventMessageHandler);
2131
- };
2132
- }, [reload]);
2133
- }
2134
- function usePostUrlToEditor(pathname) {
2135
- useEffect(() => {
2136
- postMessageToEditor({
2137
- action: CUSTOMER_ACTIONS.SET_URL,
2138
- payload: {
2139
- url: pathname === '/' ? 'index' : pathname === null || pathname === void 0 ? void 0 : pathname.replace('/', '')
2140
- }
2141
- });
2142
- }, [pathname]);
2143
- }
2144
-
2145
- const PageContext = /*#__PURE__*/createContext(null);
2146
-
2147
- /**
2148
- * `PageProvider` is a functional component that provides a context for a DotCMS page.
2149
- * It takes a `PageProviderProps` object as a parameter and returns a JSX element.
2150
- *
2151
- * @category Components
2152
- * @param {PageProviderProps} props - The properties for the PageProvider. Includes an `entity` and `children`.
2153
- * @returns {JSX.Element} - A JSX element that provides a context for a DotCMS page.
2154
- */
2155
- function PageProvider(props) {
2156
- const {
2157
- entity,
2158
- children
2159
- } = props;
2160
- return jsx(PageContext.Provider, Object.assign({
2161
- value: entity
2162
- }, {
2163
- children: children
2164
- }));
2165
- }
2166
-
2167
- function styleInject(css, ref) {
2168
- if ( ref === void 0 ) ref = {};
2169
- var insertAt = ref.insertAt;
2170
-
2171
- if (!css || typeof document === 'undefined') { return; }
2172
-
2173
- var head = document.head || document.getElementsByTagName('head')[0];
2174
- var style = document.createElement('style');
2175
- style.type = 'text/css';
2176
-
2177
- if (insertAt === 'top') {
2178
- if (head.firstChild) {
2179
- head.insertBefore(style, head.firstChild);
2180
- } else {
2181
- head.appendChild(style);
2182
- }
2183
- } else {
2184
- head.appendChild(style);
2185
- }
2186
-
2187
- if (style.styleSheet) {
2188
- style.styleSheet.cssText = css;
2189
- } else {
2190
- style.appendChild(document.createTextNode(css));
2191
- }
2192
- }
2193
-
2194
- var css_248z$1 = ".row-module_row__8V7Eh {\n display: grid;\n grid-template-columns: repeat(12, 1fr);\n gap: 1rem;\n}\n";
2195
- var styles$1 = {"row":"row-module_row__8V7Eh"};
2196
- styleInject(css_248z$1);
2197
-
2198
- var css_248z = ".column-module_col-start-1__GK-q- {\n grid-column-start: 1;\n}\n\n.column-module_col-start-2__1DmkY {\n grid-column-start: 2;\n}\n\n.column-module_col-start-3__HNEPh {\n grid-column-start: 3;\n}\n\n.column-module_col-start-4__oCAwh {\n grid-column-start: 4;\n}\n\n.column-module_col-start-5__re1rB {\n grid-column-start: 5;\n}\n\n.column-module_col-start-6__dkB4w {\n grid-column-start: 6;\n}\n\n.column-module_col-start-7__kEfJb {\n grid-column-start: 7;\n}\n\n.column-module_col-start-8__Yx31z {\n grid-column-start: 8;\n}\n\n.column-module_col-start-9__9YiVY {\n grid-column-start: 9;\n}\n\n.column-module_col-start-10__6AFbk {\n grid-column-start: 10;\n}\n\n.column-module_col-start-11__LP24D {\n grid-column-start: 11;\n}\n\n.column-module_col-start-12__8p0QS {\n grid-column-start: 12;\n}\n\n.column-module_col-span-1__vOPKg {\n grid-column: span 1 / span 1;\n}\n\n.column-module_col-span-2__qVdyn {\n grid-column: span 2 / span 2;\n}\n\n.column-module_col-span-3__brcdA {\n grid-column: span 3 / span 3;\n}\n\n.column-module_col-span-4__1-c-f {\n grid-column: span 4 / span 4;\n}\n\n.column-module_col-span-5__nAGLD {\n grid-column: span 5 / span 5;\n}\n\n.column-module_col-span-6__emtw7 {\n grid-column: span 6 / span 6;\n}\n\n.column-module_col-span-7__Ad5-V {\n grid-column: span 7 / span 7;\n}\n\n.column-module_col-span-8__gEnsA {\n grid-column: span 8 / span 8;\n}\n\n.column-module_col-span-9__jWemC {\n grid-column: span 9 / span 9;\n}\n\n.column-module_col-span-10__Dzuph {\n grid-column: span 10 / span 10;\n}\n\n.column-module_col-span-11__Xgct2 {\n grid-column: span 11 / span 11;\n}\n\n.column-module_col-span-12__LvJrY {\n grid-column: span 12 / span 12;\n}\n";
2199
- var styles = {"col-start-1":"column-module_col-start-1__GK-q-","col-start-2":"column-module_col-start-2__1DmkY","col-start-3":"column-module_col-start-3__HNEPh","col-start-4":"column-module_col-start-4__oCAwh","col-start-5":"column-module_col-start-5__re1rB","col-start-6":"column-module_col-start-6__dkB4w","col-start-7":"column-module_col-start-7__kEfJb","col-start-8":"column-module_col-start-8__Yx31z","col-start-9":"column-module_col-start-9__9YiVY","col-start-10":"column-module_col-start-10__6AFbk","col-start-11":"column-module_col-start-11__LP24D","col-start-12":"column-module_col-start-12__8p0QS","col-span-1":"column-module_col-span-1__vOPKg","col-span-2":"column-module_col-span-2__qVdyn","col-span-3":"column-module_col-span-3__brcdA","col-span-4":"column-module_col-span-4__1-c-f","col-span-5":"column-module_col-span-5__nAGLD","col-span-6":"column-module_col-span-6__emtw7","col-span-7":"column-module_col-span-7__Ad5-V","col-span-8":"column-module_col-span-8__gEnsA","col-span-9":"column-module_col-span-9__jWemC","col-span-10":"column-module_col-span-10__Dzuph","col-span-11":"column-module_col-span-11__Xgct2","col-span-12":"column-module_col-span-12__LvJrY"};
2200
- styleInject(css_248z);
2201
-
2202
- function NoContent({
2203
- contentType
2204
- }) {
2205
- return jsxs("div", Object.assign({
2206
- "data-testid": "no-component"
2207
- }, {
2208
- children: ["No Component for ", contentType]
2209
- }));
2210
- }
2211
- function Container({
2212
- containerRef
2213
- }) {
2214
- var _a;
2215
- const {
2216
- identifier,
2217
- uuid
2218
- } = containerRef;
2219
- // Get the containers from the global context
2220
- const {
2221
- containers,
2222
- page,
2223
- viewAs,
2224
- components
2225
- } = useContext(PageContext);
2226
- const {
2227
- acceptTypes,
2228
- contentlets,
2229
- maxContentlets,
2230
- pageContainers,
2231
- path
2232
- } = getContainersData(containers, containerRef);
2233
- const contentletsId = contentlets.map(contentlet => contentlet.identifier);
2234
- const container = {
2235
- acceptTypes,
2236
- contentletsId,
2237
- identifier: path !== null && path !== void 0 ? path : identifier,
2238
- maxContentlets,
2239
- uuid
2240
- };
2241
- const containerPayload = {
2242
- container,
2243
- language_id: viewAs.language.id,
2244
- pageContainers,
2245
- pageId: page.identifier,
2246
- personaTag: (_a = viewAs.persona) === null || _a === void 0 ? void 0 : _a.keyTag
2247
- };
2248
- function onPointerEnterHandler(e) {
2249
- var _a;
2250
- let target = e.target;
2251
- if (target.dataset.dot !== 'contentlet') {
2252
- target = target.closest('[data-dot="contentlet"]');
2253
- }
2254
- if (!target) {
2255
- return;
2256
- }
2257
- const {
2258
- x,
2259
- y,
2260
- width,
2261
- height
2262
- } = target.getBoundingClientRect();
2263
- const contentletPayload = JSON.parse((_a = target.dataset.content) !== null && _a !== void 0 ? _a : '{}');
2264
- postMessageToEditor({
2265
- action: CUSTOMER_ACTIONS.SET_CONTENTLET,
2266
- payload: {
2267
- x,
2268
- y,
2269
- width,
2270
- height,
2271
- payload: contentletPayload
2272
- }
2273
- });
2274
- }
2275
- return jsx("div", Object.assign({
2276
- "data-dot": "container",
2277
- "data-content": JSON.stringify(containerPayload)
2278
- }, {
2279
- children: contentlets.map(contentlet => {
2280
- var _a;
2281
- const Component = components[contentlet.contentType] || NoContent;
2282
- const contentletPayload = {
2283
- container,
2284
- contentlet: {
2285
- identifier: contentlet.identifier,
2286
- title: contentlet.widgetTitle || contentlet.title,
2287
- inode: contentlet.inode
2288
- },
2289
- language_id: viewAs.language.id,
2290
- pageContainers,
2291
- pageId: page.identifier,
2292
- personaTag: (_a = viewAs.persona) === null || _a === void 0 ? void 0 : _a.keyTag
2293
- };
2294
- return jsx("div", Object.assign({
2295
- onPointerEnter: onPointerEnterHandler,
2296
- "data-dot": "contentlet",
2297
- "data-content": JSON.stringify(contentletPayload)
2298
- }, {
2299
- children: jsx(Component, Object.assign({}, contentlet))
2300
- }), contentlet.identifier);
2301
- })
2302
- }));
2303
- }
2304
-
2305
- function Column({
2306
- column
2307
- }) {
2308
- const widthClassMap = {
2309
- 1: 'col-span-1',
2310
- 2: 'col-span-2',
2311
- 3: 'col-span-3',
2312
- 4: 'col-span-4',
2313
- 5: 'col-span-5',
2314
- 6: 'col-span-6',
2315
- 7: 'col-span-7',
2316
- 8: 'col-span-8',
2317
- 9: 'col-span-9',
2318
- 10: 'col-span-10',
2319
- 11: 'col-span-11',
2320
- 12: 'col-span-12'
2321
- };
2322
- const statrClassMap = {
2323
- 1: 'col-start-1',
2324
- 2: 'col-start-2',
2325
- 3: 'col-start-3',
2326
- 4: 'col-start-4',
2327
- 5: 'col-start-5',
2328
- 6: 'col-start-6',
2329
- 7: 'col-start-7',
2330
- 8: 'col-start-8',
2331
- 9: 'col-start-9',
2332
- 10: 'col-start-10',
2333
- 11: 'col-start-11',
2334
- 12: 'col-start-12'
2335
- };
2336
- const widthClass = widthClassMap[column.width];
2337
- const startClass = statrClassMap[column.leftOffset];
2338
- const combinedClasses = [styles[widthClass], styles[startClass], column.styleClass].filter(Boolean).join(' ');
2339
- return jsx("div", Object.assign({
2340
- "data-dot": "column",
2341
- "data-testid": "column",
2342
- className: combinedClasses
2343
- }, {
2344
- children: column.containers.map(container => jsx(Container, {
2345
- containerRef: container
2346
- }, `${container.identifier}-${container.uuid}`))
2347
- }));
2348
- }
2349
-
2350
- /**
2351
- * Renders a row
2352
- *
2353
- * @category Components
2354
- * @param {React.ForwardedRef<HTMLDivElement, RowProps>} ref
2355
- * @return {*}
2356
- */
2357
- const Row = /*#__PURE__*/forwardRef((props, ref) => {
2358
- const {
2359
- row
2360
- } = props;
2361
- const combinedClasses = [styles$1.row, row.styleClass].filter(Boolean).join(' ');
2362
- return jsx("div", Object.assign({
2363
- "data-testid": "row",
2364
- "data-dot": "row",
2365
- ref: ref,
2366
- className: combinedClasses
2367
- }, {
2368
- children: row.columns.map((column, index) => jsx(Column, {
2369
- column: column
2370
- }, index))
2371
- }));
2372
- });
2373
-
2374
- /**
2375
- * `DotcmsLayout` is a functional component that renders a layout for a DotCMS page.
2376
- * It takes a `DotcmsPageProps` object as a parameter and returns a JSX element.
2377
- *
2378
- * @category Components
2379
- * @param {DotcmsPageProps} props - The properties for the DotCMS page.
2380
- * @returns {JSX.Element} - A JSX element that represents the layout for a DotCMS page.
2381
- */
2382
- function DotcmsLayout(props) {
2383
- const {
2384
- entity
2385
- } = props;
2386
- const rowsRef = usePageEditor({});
2387
- const addRowRef = el => {
2388
- if (el && !rowsRef.current.includes(el)) {
2389
- rowsRef.current.push(el);
2390
- }
2391
- };
2392
- return jsx(PageProvider, Object.assign({
2393
- entity: entity
2394
- }, {
2395
- children: entity.layout.body.rows.map((row, index) => jsx(Row, {
2396
- ref: addRowRef,
2397
- row: row
2398
- }, index))
2399
- }));
2400
- }
2401
-
2402
- /**
2403
- * `useDotcmsPageContext` is a custom React hook that provides access to the `PageProviderContext`.
2404
- * It takes no parameters and returns the context value or `null` if it's not available.
2405
- *
2406
- * @category Hooks
2407
- * @returns {PageProviderContext | null} - The context value or `null` if it's not available.
2408
- */
2409
- function useDotcmsPageContext() {
2410
- return useContext(PageContext);
2411
- }
2412
-
2413
- export { DotcmsLayout, PageProvider, Row, useDotcmsPageContext, usePageEditor };