Fix File
•
/
home
/
sportsfe...
/
httpdocs
/
wp-conte...
/
plugins
/
embedpre...
/
assets
/
pdf
/
build
•
File:
script.js
•
Content:
/** * @licstart The following is the entire license notice for the * JavaScript code in this page * * Copyright 2023 Mozilla Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @licend The above is the entire license notice for the * JavaScript code in this page */ /******/ var __webpack_modules__ = ({ /***/ 9306: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isCallable = __webpack_require__(4901); var tryToString = __webpack_require__(6823); var $TypeError = TypeError; // `Assert: IsCallable(argument) is true` module.exports = function (argument) { if (isCallable(argument)) return argument; throw new $TypeError(tryToString(argument) + ' is not a function'); }; /***/ }), /***/ 3506: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isPossiblePrototype = __webpack_require__(3925); var $String = String; var $TypeError = TypeError; module.exports = function (argument) { if (isPossiblePrototype(argument)) return argument; throw new $TypeError("Can't set " + $String(argument) + ' as a prototype'); }; /***/ }), /***/ 7080: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var has = (__webpack_require__(4402).has); // Perform ? RequireInternalSlot(M, [[SetData]]) module.exports = function (it) { has(it); return it; }; /***/ }), /***/ 679: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isPrototypeOf = __webpack_require__(1625); var $TypeError = TypeError; module.exports = function (it, Prototype) { if (isPrototypeOf(Prototype, it)) return it; throw new $TypeError('Incorrect invocation'); }; /***/ }), /***/ 8551: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isObject = __webpack_require__(34); var $String = String; var $TypeError = TypeError; // `Assert: Type(argument) is Object` module.exports = function (argument) { if (isObject(argument)) return argument; throw new $TypeError($String(argument) + ' is not an object'); }; /***/ }), /***/ 7811: /***/ ((module) => { // eslint-disable-next-line es/no-typed-arrays -- safe module.exports = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined'; /***/ }), /***/ 7394: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var uncurryThisAccessor = __webpack_require__(6706); var classof = __webpack_require__(4576); var $TypeError = TypeError; // Includes // - Perform ? RequireInternalSlot(O, [[ArrayBufferData]]). // - If IsSharedArrayBuffer(O) is true, throw a TypeError exception. module.exports = uncurryThisAccessor(ArrayBuffer.prototype, 'byteLength', 'get') || function (O) { if (classof(O) !== 'ArrayBuffer') throw new $TypeError('ArrayBuffer expected'); return O.byteLength; }; /***/ }), /***/ 3238: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var uncurryThis = __webpack_require__(9504); var arrayBufferByteLength = __webpack_require__(7394); var slice = uncurryThis(ArrayBuffer.prototype.slice); module.exports = function (O) { if (arrayBufferByteLength(O) !== 0) return false; try { slice(O, 0, 0); return false; } catch (error) { return true; } }; /***/ }), /***/ 5636: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var global = __webpack_require__(4475); var uncurryThis = __webpack_require__(9504); var uncurryThisAccessor = __webpack_require__(6706); var toIndex = __webpack_require__(7696); var isDetached = __webpack_require__(3238); var arrayBufferByteLength = __webpack_require__(7394); var detachTransferable = __webpack_require__(4483); var PROPER_STRUCTURED_CLONE_TRANSFER = __webpack_require__(1548); var structuredClone = global.structuredClone; var ArrayBuffer = global.ArrayBuffer; var DataView = global.DataView; var TypeError = global.TypeError; var min = Math.min; var ArrayBufferPrototype = ArrayBuffer.prototype; var DataViewPrototype = DataView.prototype; var slice = uncurryThis(ArrayBufferPrototype.slice); var isResizable = uncurryThisAccessor(ArrayBufferPrototype, 'resizable', 'get'); var maxByteLength = uncurryThisAccessor(ArrayBufferPrototype, 'maxByteLength', 'get'); var getInt8 = uncurryThis(DataViewPrototype.getInt8); var setInt8 = uncurryThis(DataViewPrototype.setInt8); module.exports = (PROPER_STRUCTURED_CLONE_TRANSFER || detachTransferable) && function (arrayBuffer, newLength, preserveResizability) { var byteLength = arrayBufferByteLength(arrayBuffer); var newByteLength = newLength === undefined ? byteLength : toIndex(newLength); var fixedLength = !isResizable || !isResizable(arrayBuffer); var newBuffer; if (isDetached(arrayBuffer)) throw new TypeError('ArrayBuffer is detached'); if (PROPER_STRUCTURED_CLONE_TRANSFER) { arrayBuffer = structuredClone(arrayBuffer, { transfer: [arrayBuffer] }); if (byteLength === newByteLength && (preserveResizability || fixedLength)) return arrayBuffer; } if (byteLength >= newByteLength && (!preserveResizability || fixedLength)) { newBuffer = slice(arrayBuffer, 0, newByteLength); } else { var options = preserveResizability && !fixedLength && maxByteLength ? { maxByteLength: maxByteLength(arrayBuffer) } : undefined; newBuffer = new ArrayBuffer(newByteLength, options); var a = new DataView(arrayBuffer); var b = new DataView(newBuffer); var copyLength = min(newByteLength, byteLength); for (var i = 0; i < copyLength; i++) setInt8(b, i, getInt8(a, i)); } if (!PROPER_STRUCTURED_CLONE_TRANSFER) detachTransferable(arrayBuffer); return newBuffer; }; /***/ }), /***/ 4644: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var NATIVE_ARRAY_BUFFER = __webpack_require__(7811); var DESCRIPTORS = __webpack_require__(3724); var global = __webpack_require__(4475); var isCallable = __webpack_require__(4901); var isObject = __webpack_require__(34); var hasOwn = __webpack_require__(9297); var classof = __webpack_require__(6955); var tryToString = __webpack_require__(6823); var createNonEnumerableProperty = __webpack_require__(6699); var defineBuiltIn = __webpack_require__(6840); var defineBuiltInAccessor = __webpack_require__(2106); var isPrototypeOf = __webpack_require__(1625); var getPrototypeOf = __webpack_require__(2787); var setPrototypeOf = __webpack_require__(2967); var wellKnownSymbol = __webpack_require__(8227); var uid = __webpack_require__(3392); var InternalStateModule = __webpack_require__(1181); var enforceInternalState = InternalStateModule.enforce; var getInternalState = InternalStateModule.get; var Int8Array = global.Int8Array; var Int8ArrayPrototype = Int8Array && Int8Array.prototype; var Uint8ClampedArray = global.Uint8ClampedArray; var Uint8ClampedArrayPrototype = Uint8ClampedArray && Uint8ClampedArray.prototype; var TypedArray = Int8Array && getPrototypeOf(Int8Array); var TypedArrayPrototype = Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype); var ObjectPrototype = Object.prototype; var TypeError = global.TypeError; var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG'); var TYPED_ARRAY_CONSTRUCTOR = 'TypedArrayConstructor'; // Fixing native typed arrays in Opera Presto crashes the browser, see #595 var NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(global.opera) !== 'Opera'; var TYPED_ARRAY_TAG_REQUIRED = false; var NAME, Constructor, Prototype; var TypedArrayConstructorsList = { Int8Array: 1, Uint8Array: 1, Uint8ClampedArray: 1, Int16Array: 2, Uint16Array: 2, Int32Array: 4, Uint32Array: 4, Float32Array: 4, Float64Array: 8 }; var BigIntArrayConstructorsList = { BigInt64Array: 8, BigUint64Array: 8 }; var isView = function isView(it) { if (!isObject(it)) return false; var klass = classof(it); return klass === 'DataView' || hasOwn(TypedArrayConstructorsList, klass) || hasOwn(BigIntArrayConstructorsList, klass); }; var getTypedArrayConstructor = function (it) { var proto = getPrototypeOf(it); if (!isObject(proto)) return; var state = getInternalState(proto); return (state && hasOwn(state, TYPED_ARRAY_CONSTRUCTOR)) ? state[TYPED_ARRAY_CONSTRUCTOR] : getTypedArrayConstructor(proto); }; var isTypedArray = function (it) { if (!isObject(it)) return false; var klass = classof(it); return hasOwn(TypedArrayConstructorsList, klass) || hasOwn(BigIntArrayConstructorsList, klass); }; var aTypedArray = function (it) { if (isTypedArray(it)) return it; throw new TypeError('Target is not a typed array'); }; var aTypedArrayConstructor = function (C) { if (isCallable(C) && (!setPrototypeOf || isPrototypeOf(TypedArray, C))) return C; throw new TypeError(tryToString(C) + ' is not a typed array constructor'); }; var exportTypedArrayMethod = function (KEY, property, forced, options) { if (!DESCRIPTORS) return; if (forced) for (var ARRAY in TypedArrayConstructorsList) { var TypedArrayConstructor = global[ARRAY]; if (TypedArrayConstructor && hasOwn(TypedArrayConstructor.prototype, KEY)) try { delete TypedArrayConstructor.prototype[KEY]; } catch (error) { // old WebKit bug - some methods are non-configurable try { TypedArrayConstructor.prototype[KEY] = property; } catch (error2) { /* empty */ } } } if (!TypedArrayPrototype[KEY] || forced) { defineBuiltIn(TypedArrayPrototype, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property, options); } }; var exportTypedArrayStaticMethod = function (KEY, property, forced) { var ARRAY, TypedArrayConstructor; if (!DESCRIPTORS) return; if (setPrototypeOf) { if (forced) for (ARRAY in TypedArrayConstructorsList) { TypedArrayConstructor = global[ARRAY]; if (TypedArrayConstructor && hasOwn(TypedArrayConstructor, KEY)) try { delete TypedArrayConstructor[KEY]; } catch (error) { /* empty */ } } if (!TypedArray[KEY] || forced) { // V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable try { return defineBuiltIn(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && TypedArray[KEY] || property); } catch (error) { /* empty */ } } else return; } for (ARRAY in TypedArrayConstructorsList) { TypedArrayConstructor = global[ARRAY]; if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) { defineBuiltIn(TypedArrayConstructor, KEY, property); } } }; for (NAME in TypedArrayConstructorsList) { Constructor = global[NAME]; Prototype = Constructor && Constructor.prototype; if (Prototype) enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor; else NATIVE_ARRAY_BUFFER_VIEWS = false; } for (NAME in BigIntArrayConstructorsList) { Constructor = global[NAME]; Prototype = Constructor && Constructor.prototype; if (Prototype) enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor; } // WebKit bug - typed arrays constructors prototype is Object.prototype if (!NATIVE_ARRAY_BUFFER_VIEWS || !isCallable(TypedArray) || TypedArray === Function.prototype) { // eslint-disable-next-line no-shadow -- safe TypedArray = function TypedArray() { throw new TypeError('Incorrect invocation'); }; if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) { if (global[NAME]) setPrototypeOf(global[NAME], TypedArray); } } if (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) { TypedArrayPrototype = TypedArray.prototype; if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) { if (global[NAME]) setPrototypeOf(global[NAME].prototype, TypedArrayPrototype); } } // WebKit bug - one more object in Uint8ClampedArray prototype chain if (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) { setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype); } if (DESCRIPTORS && !hasOwn(TypedArrayPrototype, TO_STRING_TAG)) { TYPED_ARRAY_TAG_REQUIRED = true; defineBuiltInAccessor(TypedArrayPrototype, TO_STRING_TAG, { configurable: true, get: function () { return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined; } }); for (NAME in TypedArrayConstructorsList) if (global[NAME]) { createNonEnumerableProperty(global[NAME], TYPED_ARRAY_TAG, NAME); } } module.exports = { NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS, TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQUIRED && TYPED_ARRAY_TAG, aTypedArray: aTypedArray, aTypedArrayConstructor: aTypedArrayConstructor, exportTypedArrayMethod: exportTypedArrayMethod, exportTypedArrayStaticMethod: exportTypedArrayStaticMethod, getTypedArrayConstructor: getTypedArrayConstructor, isView: isView, isTypedArray: isTypedArray, TypedArray: TypedArray, TypedArrayPrototype: TypedArrayPrototype }; /***/ }), /***/ 5370: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var lengthOfArrayLike = __webpack_require__(6198); module.exports = function (Constructor, list, $length) { var index = 0; var length = arguments.length > 2 ? $length : lengthOfArrayLike(list); var result = new Constructor(length); while (length > index) result[index] = list[index++]; return result; }; /***/ }), /***/ 9617: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var toIndexedObject = __webpack_require__(5397); var toAbsoluteIndex = __webpack_require__(5610); var lengthOfArrayLike = __webpack_require__(6198); // `Array.prototype.{ indexOf, includes }` methods implementation var createMethod = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIndexedObject($this); var length = lengthOfArrayLike(O); if (length === 0) return !IS_INCLUDES && -1; var index = toAbsoluteIndex(fromIndex, length); var value; // Array#includes uses SameValueZero equality algorithm // eslint-disable-next-line no-self-compare -- NaN check if (IS_INCLUDES && el !== el) while (length > index) { value = O[index++]; // eslint-disable-next-line no-self-compare -- NaN check if (value !== value) return true; // Array#indexOf ignores holes, Array#includes - not } else for (;length > index; index++) { if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0; } return !IS_INCLUDES && -1; }; }; module.exports = { // `Array.prototype.includes` method // https://tc39.es/ecma262/#sec-array.prototype.includes includes: createMethod(true), // `Array.prototype.indexOf` method // https://tc39.es/ecma262/#sec-array.prototype.indexof indexOf: createMethod(false) }; /***/ }), /***/ 4527: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var DESCRIPTORS = __webpack_require__(3724); var isArray = __webpack_require__(4376); var $TypeError = TypeError; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // Safari < 13 does not throw an error in this case var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS && !function () { // makes no sense without proper strict mode support if (this !== undefined) return true; try { // eslint-disable-next-line es/no-object-defineproperty -- safe Object.defineProperty([], 'length', { writable: false }).length = 1; } catch (error) { return error instanceof TypeError; } }(); module.exports = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) { if (isArray(O) && !getOwnPropertyDescriptor(O, 'length').writable) { throw new $TypeError('Cannot set read only .length'); } return O.length = length; } : function (O, length) { return O.length = length; }; /***/ }), /***/ 7628: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var lengthOfArrayLike = __webpack_require__(6198); // https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.toReversed // https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.toReversed module.exports = function (O, C) { var len = lengthOfArrayLike(O); var A = new C(len); var k = 0; for (; k < len; k++) A[k] = O[len - k - 1]; return A; }; /***/ }), /***/ 9928: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var lengthOfArrayLike = __webpack_require__(6198); var toIntegerOrInfinity = __webpack_require__(1291); var $RangeError = RangeError; // https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.with // https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.with module.exports = function (O, C, index, value) { var len = lengthOfArrayLike(O); var relativeIndex = toIntegerOrInfinity(index); var actualIndex = relativeIndex < 0 ? len + relativeIndex : relativeIndex; if (actualIndex >= len || actualIndex < 0) throw new $RangeError('Incorrect index'); var A = new C(len); var k = 0; for (; k < len; k++) A[k] = k === actualIndex ? value : O[k]; return A; }; /***/ }), /***/ 6319: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var anObject = __webpack_require__(8551); var iteratorClose = __webpack_require__(9539); // call something on iterator step with safe closing on error module.exports = function (iterator, fn, value, ENTRIES) { try { return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value); } catch (error) { iteratorClose(iterator, 'throw', error); } }; /***/ }), /***/ 4576: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var uncurryThis = __webpack_require__(9504); var toString = uncurryThis({}.toString); var stringSlice = uncurryThis(''.slice); module.exports = function (it) { return stringSlice(toString(it), 8, -1); }; /***/ }), /***/ 6955: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var TO_STRING_TAG_SUPPORT = __webpack_require__(2140); var isCallable = __webpack_require__(4901); var classofRaw = __webpack_require__(4576); var wellKnownSymbol = __webpack_require__(8227); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var $Object = Object; // ES3 wrong here var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments'; // fallback for IE11 Script Access Denied error var tryGet = function (it, key) { try { return it[key]; } catch (error) { /* empty */ } }; // getting tag from ES6+ `Object.prototype.toString` module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) { var O, tag, result; return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag // builtinTag case : CORRECT_ARGUMENTS ? classofRaw(O) // ES3 arguments fallback : (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result; }; /***/ }), /***/ 7740: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var hasOwn = __webpack_require__(9297); var ownKeys = __webpack_require__(5031); var getOwnPropertyDescriptorModule = __webpack_require__(7347); var definePropertyModule = __webpack_require__(4913); module.exports = function (target, source, exceptions) { var keys = ownKeys(source); var defineProperty = definePropertyModule.f; var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; for (var i = 0; i < keys.length; i++) { var key = keys[i]; if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) { defineProperty(target, key, getOwnPropertyDescriptor(source, key)); } } }; /***/ }), /***/ 2211: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var fails = __webpack_require__(9039); module.exports = !fails(function () { function F() { /* empty */ } F.prototype.constructor = null; // eslint-disable-next-line es/no-object-getprototypeof -- required for testing return Object.getPrototypeOf(new F()) !== F.prototype; }); /***/ }), /***/ 2529: /***/ ((module) => { // `CreateIterResultObject` abstract operation // https://tc39.es/ecma262/#sec-createiterresultobject module.exports = function (value, done) { return { value: value, done: done }; }; /***/ }), /***/ 6699: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var DESCRIPTORS = __webpack_require__(3724); var definePropertyModule = __webpack_require__(4913); var createPropertyDescriptor = __webpack_require__(6980); module.exports = DESCRIPTORS ? function (object, key, value) { return definePropertyModule.f(object, key, createPropertyDescriptor(1, value)); } : function (object, key, value) { object[key] = value; return object; }; /***/ }), /***/ 6980: /***/ ((module) => { module.exports = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; /***/ }), /***/ 4659: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var DESCRIPTORS = __webpack_require__(3724); var definePropertyModule = __webpack_require__(4913); var createPropertyDescriptor = __webpack_require__(6980); module.exports = function (object, key, value) { if (DESCRIPTORS) definePropertyModule.f(object, key, createPropertyDescriptor(0, value)); else object[key] = value; }; /***/ }), /***/ 2106: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var makeBuiltIn = __webpack_require__(283); var defineProperty = __webpack_require__(4913); module.exports = function (target, name, descriptor) { if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true }); if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true }); return defineProperty.f(target, name, descriptor); }; /***/ }), /***/ 6840: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isCallable = __webpack_require__(4901); var definePropertyModule = __webpack_require__(4913); var makeBuiltIn = __webpack_require__(283); var defineGlobalProperty = __webpack_require__(9433); module.exports = function (O, key, value, options) { if (!options) options = {}; var simple = options.enumerable; var name = options.name !== undefined ? options.name : key; if (isCallable(value)) makeBuiltIn(value, name, options); if (options.global) { if (simple) O[key] = value; else defineGlobalProperty(key, value); } else { try { if (!options.unsafe) delete O[key]; else if (O[key]) simple = true; } catch (error) { /* empty */ } if (simple) O[key] = value; else definePropertyModule.f(O, key, { value: value, enumerable: false, configurable: !options.nonConfigurable, writable: !options.nonWritable }); } return O; }; /***/ }), /***/ 6279: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var defineBuiltIn = __webpack_require__(6840); module.exports = function (target, src, options) { for (var key in src) defineBuiltIn(target, key, src[key], options); return target; }; /***/ }), /***/ 9433: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var global = __webpack_require__(4475); // eslint-disable-next-line es/no-object-defineproperty -- safe var defineProperty = Object.defineProperty; module.exports = function (key, value) { try { defineProperty(global, key, { value: value, configurable: true, writable: true }); } catch (error) { global[key] = value; } return value; }; /***/ }), /***/ 3724: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var fails = __webpack_require__(9039); // Detect IE8's incomplete defineProperty implementation module.exports = !fails(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7; }); /***/ }), /***/ 4483: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var global = __webpack_require__(4475); var tryNodeRequire = __webpack_require__(9714); var PROPER_STRUCTURED_CLONE_TRANSFER = __webpack_require__(1548); var structuredClone = global.structuredClone; var $ArrayBuffer = global.ArrayBuffer; var $MessageChannel = global.MessageChannel; var detach = false; var WorkerThreads, channel, buffer, $detach; if (PROPER_STRUCTURED_CLONE_TRANSFER) { detach = function (transferable) { structuredClone(transferable, { transfer: [transferable] }); }; } else if ($ArrayBuffer) try { if (!$MessageChannel) { WorkerThreads = tryNodeRequire('worker_threads'); if (WorkerThreads) $MessageChannel = WorkerThreads.MessageChannel; } if ($MessageChannel) { channel = new $MessageChannel(); buffer = new $ArrayBuffer(2); $detach = function (transferable) { channel.port1.postMessage(null, [transferable]); }; if (buffer.byteLength === 2) { $detach(buffer); if (buffer.byteLength === 0) detach = $detach; } } } catch (error) { /* empty */ } module.exports = detach; /***/ }), /***/ 4055: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var global = __webpack_require__(4475); var isObject = __webpack_require__(34); var document = global.document; // typeof document.createElement is 'object' in old IE var EXISTS = isObject(document) && isObject(document.createElement); module.exports = function (it) { return EXISTS ? document.createElement(it) : {}; }; /***/ }), /***/ 6837: /***/ ((module) => { var $TypeError = TypeError; var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991 module.exports = function (it) { if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded'); return it; }; /***/ }), /***/ 5002: /***/ ((module) => { module.exports = { IndexSizeError: { s: 'INDEX_SIZE_ERR', c: 1, m: 1 }, DOMStringSizeError: { s: 'DOMSTRING_SIZE_ERR', c: 2, m: 0 }, HierarchyRequestError: { s: 'HIERARCHY_REQUEST_ERR', c: 3, m: 1 }, WrongDocumentError: { s: 'WRONG_DOCUMENT_ERR', c: 4, m: 1 }, InvalidCharacterError: { s: 'INVALID_CHARACTER_ERR', c: 5, m: 1 }, NoDataAllowedError: { s: 'NO_DATA_ALLOWED_ERR', c: 6, m: 0 }, NoModificationAllowedError: { s: 'NO_MODIFICATION_ALLOWED_ERR', c: 7, m: 1 }, NotFoundError: { s: 'NOT_FOUND_ERR', c: 8, m: 1 }, NotSupportedError: { s: 'NOT_SUPPORTED_ERR', c: 9, m: 1 }, InUseAttributeError: { s: 'INUSE_ATTRIBUTE_ERR', c: 10, m: 1 }, InvalidStateError: { s: 'INVALID_STATE_ERR', c: 11, m: 1 }, SyntaxError: { s: 'SYNTAX_ERR', c: 12, m: 1 }, InvalidModificationError: { s: 'INVALID_MODIFICATION_ERR', c: 13, m: 1 }, NamespaceError: { s: 'NAMESPACE_ERR', c: 14, m: 1 }, InvalidAccessError: { s: 'INVALID_ACCESS_ERR', c: 15, m: 1 }, ValidationError: { s: 'VALIDATION_ERR', c: 16, m: 0 }, TypeMismatchError: { s: 'TYPE_MISMATCH_ERR', c: 17, m: 1 }, SecurityError: { s: 'SECURITY_ERR', c: 18, m: 1 }, NetworkError: { s: 'NETWORK_ERR', c: 19, m: 1 }, AbortError: { s: 'ABORT_ERR', c: 20, m: 1 }, URLMismatchError: { s: 'URL_MISMATCH_ERR', c: 21, m: 1 }, QuotaExceededError: { s: 'QUOTA_EXCEEDED_ERR', c: 22, m: 1 }, TimeoutError: { s: 'TIMEOUT_ERR', c: 23, m: 1 }, InvalidNodeTypeError: { s: 'INVALID_NODE_TYPE_ERR', c: 24, m: 1 }, DataCloneError: { s: 'DATA_CLONE_ERR', c: 25, m: 1 } }; /***/ }), /***/ 7290: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var IS_DENO = __webpack_require__(516); var IS_NODE = __webpack_require__(9088); module.exports = !IS_DENO && !IS_NODE && typeof window == 'object' && typeof document == 'object'; /***/ }), /***/ 516: /***/ ((module) => { /* global Deno -- Deno case */ module.exports = typeof Deno == 'object' && Deno && typeof Deno.version == 'object'; /***/ }), /***/ 9088: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var global = __webpack_require__(4475); var classof = __webpack_require__(4576); module.exports = classof(global.process) === 'process'; /***/ }), /***/ 9392: /***/ ((module) => { module.exports = typeof navigator != 'undefined' && String(navigator.userAgent) || ''; /***/ }), /***/ 7388: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var global = __webpack_require__(4475); var userAgent = __webpack_require__(9392); var process = global.process; var Deno = global.Deno; var versions = process && process.versions || Deno && Deno.version; var v8 = versions && versions.v8; var match, version; if (v8) { match = v8.split('.'); // in old Chrome, versions of V8 isn't V8 = Chrome / 10 // but their correct versions are not interesting for us version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]); } // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0` // so check `userAgent` even if `.v8` exists, but 0 if (!version && userAgent) { match = userAgent.match(/Edge\/(\d+)/); if (!match || match[1] >= 74) { match = userAgent.match(/Chrome\/(\d+)/); if (match) version = +match[1]; } } module.exports = version; /***/ }), /***/ 8727: /***/ ((module) => { // IE8- don't enum bug keys module.exports = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ]; /***/ }), /***/ 6193: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var uncurryThis = __webpack_require__(9504); var $Error = Error; var replace = uncurryThis(''.replace); var TEST = (function (arg) { return String(new $Error(arg).stack); })('zxcasd'); // eslint-disable-next-line redos/no-vulnerable -- safe var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/; var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST); module.exports = function (stack, dropEntries) { if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) { while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, ''); } return stack; }; /***/ }), /***/ 6518: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var global = __webpack_require__(4475); var getOwnPropertyDescriptor = (__webpack_require__(7347).f); var createNonEnumerableProperty = __webpack_require__(6699); var defineBuiltIn = __webpack_require__(6840); var defineGlobalProperty = __webpack_require__(9433); var copyConstructorProperties = __webpack_require__(7740); var isForced = __webpack_require__(2796); /* options.target - name of the target object options.global - target is the global object options.stat - export as static methods of target options.proto - export as prototype methods of target options.real - real prototype method for the `pure` version options.forced - export even if the native feature is available options.bind - bind methods to the target, required for the `pure` version options.wrap - wrap constructors to preventing global pollution, required for the `pure` version options.unsafe - use the simple assignment of property instead of delete + defineProperty options.sham - add a flag to not completely full polyfills options.enumerable - export as enumerable property options.dontCallGetSet - prevent calling a getter on target options.name - the .name of the function if it does not match the key */ module.exports = function (options, source) { var TARGET = options.target; var GLOBAL = options.global; var STATIC = options.stat; var FORCED, target, key, targetProperty, sourceProperty, descriptor; if (GLOBAL) { target = global; } else if (STATIC) { target = global[TARGET] || defineGlobalProperty(TARGET, {}); } else { target = global[TARGET] && global[TARGET].prototype; } if (target) for (key in source) { sourceProperty = source[key]; if (options.dontCallGetSet) { descriptor = getOwnPropertyDescriptor(target, key); targetProperty = descriptor && descriptor.value; } else targetProperty = target[key]; FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); // contained in target if (!FORCED && targetProperty !== undefined) { if (typeof sourceProperty == typeof targetProperty) continue; copyConstructorProperties(sourceProperty, targetProperty); } // add a flag to not completely full polyfills if (options.sham || (targetProperty && targetProperty.sham)) { createNonEnumerableProperty(sourceProperty, 'sham', true); } defineBuiltIn(target, key, sourceProperty, options); } }; /***/ }), /***/ 9039: /***/ ((module) => { module.exports = function (exec) { try { return !!exec(); } catch (error) { return true; } }; /***/ }), /***/ 6080: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var uncurryThis = __webpack_require__(7476); var aCallable = __webpack_require__(9306); var NATIVE_BIND = __webpack_require__(616); var bind = uncurryThis(uncurryThis.bind); // optional / simple context binding module.exports = function (fn, that) { aCallable(fn); return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) { return fn.apply(that, arguments); }; }; /***/ }), /***/ 616: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var fails = __webpack_require__(9039); module.exports = !fails(function () { // eslint-disable-next-line es/no-function-prototype-bind -- safe var test = (function () { /* empty */ }).bind(); // eslint-disable-next-line no-prototype-builtins -- safe return typeof test != 'function' || test.hasOwnProperty('prototype'); }); /***/ }), /***/ 9565: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var NATIVE_BIND = __webpack_require__(616); var call = Function.prototype.call; module.exports = NATIVE_BIND ? call.bind(call) : function () { return call.apply(call, arguments); }; /***/ }), /***/ 350: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var DESCRIPTORS = __webpack_require__(3724); var hasOwn = __webpack_require__(9297); var FunctionPrototype = Function.prototype; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor; var EXISTS = hasOwn(FunctionPrototype, 'name'); // additional protection from minified / mangled / dropped function names var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something'; var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable)); module.exports = { EXISTS: EXISTS, PROPER: PROPER, CONFIGURABLE: CONFIGURABLE }; /***/ }), /***/ 6706: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var uncurryThis = __webpack_require__(9504); var aCallable = __webpack_require__(9306); module.exports = function (object, key, method) { try { // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method])); } catch (error) { /* empty */ } }; /***/ }), /***/ 7476: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var classofRaw = __webpack_require__(4576); var uncurryThis = __webpack_require__(9504); module.exports = function (fn) { // Nashorn bug: // https://github.com/zloirock/core-js/issues/1128 // https://github.com/zloirock/core-js/issues/1130 if (classofRaw(fn) === 'Function') return uncurryThis(fn); }; /***/ }), /***/ 9504: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var NATIVE_BIND = __webpack_require__(616); var FunctionPrototype = Function.prototype; var call = FunctionPrototype.call; var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call); module.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) { return function () { return call.apply(fn, arguments); }; }; /***/ }), /***/ 7751: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var global = __webpack_require__(4475); var isCallable = __webpack_require__(4901); var aFunction = function (argument) { return isCallable(argument) ? argument : undefined; }; module.exports = function (namespace, method) { return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method]; }; /***/ }), /***/ 1767: /***/ ((module) => { // `GetIteratorDirect(obj)` abstract operation // https://tc39.es/proposal-iterator-helpers/#sec-getiteratordirect module.exports = function (obj) { return { iterator: obj, next: obj.next, done: false }; }; /***/ }), /***/ 8646: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var call = __webpack_require__(9565); var anObject = __webpack_require__(8551); var getIteratorDirect = __webpack_require__(1767); var getIteratorMethod = __webpack_require__(851); module.exports = function (obj, stringHandling) { if (!stringHandling || typeof obj !== 'string') anObject(obj); var method = getIteratorMethod(obj); return getIteratorDirect(anObject(method !== undefined ? call(method, obj) : obj)); }; /***/ }), /***/ 851: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var classof = __webpack_require__(6955); var getMethod = __webpack_require__(5966); var isNullOrUndefined = __webpack_require__(4117); var Iterators = __webpack_require__(6269); var wellKnownSymbol = __webpack_require__(8227); var ITERATOR = wellKnownSymbol('iterator'); module.exports = function (it) { if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR) || getMethod(it, '@@iterator') || Iterators[classof(it)]; }; /***/ }), /***/ 81: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var call = __webpack_require__(9565); var aCallable = __webpack_require__(9306); var anObject = __webpack_require__(8551); var tryToString = __webpack_require__(6823); var getIteratorMethod = __webpack_require__(851); var $TypeError = TypeError; module.exports = function (argument, usingIterator) { var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator; if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument)); throw new $TypeError(tryToString(argument) + ' is not iterable'); }; /***/ }), /***/ 5966: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var aCallable = __webpack_require__(9306); var isNullOrUndefined = __webpack_require__(4117); // `GetMethod` abstract operation // https://tc39.es/ecma262/#sec-getmethod module.exports = function (V, P) { var func = V[P]; return isNullOrUndefined(func) ? undefined : aCallable(func); }; /***/ }), /***/ 3789: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var aCallable = __webpack_require__(9306); var anObject = __webpack_require__(8551); var call = __webpack_require__(9565); var toIntegerOrInfinity = __webpack_require__(1291); var getIteratorDirect = __webpack_require__(1767); var INVALID_SIZE = 'Invalid size'; var $RangeError = RangeError; var $TypeError = TypeError; var max = Math.max; var SetRecord = function (set, intSize) { this.set = set; this.size = max(intSize, 0); this.has = aCallable(set.has); this.keys = aCallable(set.keys); }; SetRecord.prototype = { getIterator: function () { return getIteratorDirect(anObject(call(this.keys, this.set))); }, includes: function (it) { return call(this.has, this.set, it); } }; // `GetSetRecord` abstract operation // https://tc39.es/proposal-set-methods/#sec-getsetrecord module.exports = function (obj) { anObject(obj); var numSize = +obj.size; // NOTE: If size is undefined, then numSize will be NaN // eslint-disable-next-line no-self-compare -- NaN check if (numSize !== numSize) throw new $TypeError(INVALID_SIZE); var intSize = toIntegerOrInfinity(numSize); if (intSize < 0) throw new $RangeError(INVALID_SIZE); return new SetRecord(obj, intSize); }; /***/ }), /***/ 4475: /***/ (function(module) { var check = function (it) { return it && it.Math === Math && it; }; // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 module.exports = // eslint-disable-next-line es/no-global-this -- safe check(typeof globalThis == 'object' && globalThis) || check(typeof window == 'object' && window) || // eslint-disable-next-line no-restricted-globals -- safe check(typeof self == 'object' && self) || check(typeof global == 'object' && global) || check(typeof this == 'object' && this) || // eslint-disable-next-line no-new-func -- fallback (function () { return this; })() || Function('return this')(); /***/ }), /***/ 9297: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var uncurryThis = __webpack_require__(9504); var toObject = __webpack_require__(8981); var hasOwnProperty = uncurryThis({}.hasOwnProperty); // `HasOwnProperty` abstract operation // https://tc39.es/ecma262/#sec-hasownproperty // eslint-disable-next-line es/no-object-hasown -- safe module.exports = Object.hasOwn || function hasOwn(it, key) { return hasOwnProperty(toObject(it), key); }; /***/ }), /***/ 421: /***/ ((module) => { module.exports = {}; /***/ }), /***/ 397: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var getBuiltIn = __webpack_require__(7751); module.exports = getBuiltIn('document', 'documentElement'); /***/ }), /***/ 5917: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var DESCRIPTORS = __webpack_require__(3724); var fails = __webpack_require__(9039); var createElement = __webpack_require__(4055); // Thanks to IE8 for its funny defineProperty module.exports = !DESCRIPTORS && !fails(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty(createElement('div'), 'a', { get: function () { return 7; } }).a !== 7; }); /***/ }), /***/ 7055: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var uncurryThis = __webpack_require__(9504); var fails = __webpack_require__(9039); var classof = __webpack_require__(4576); var $Object = Object; var split = uncurryThis(''.split); // fallback for non-array-like ES3 and non-enumerable old V8 strings module.exports = fails(function () { // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 // eslint-disable-next-line no-prototype-builtins -- safe return !$Object('z').propertyIsEnumerable(0); }) ? function (it) { return classof(it) === 'String' ? split(it, '') : $Object(it); } : $Object; /***/ }), /***/ 3167: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isCallable = __webpack_require__(4901); var isObject = __webpack_require__(34); var setPrototypeOf = __webpack_require__(2967); // makes subclassing work correct for wrapped built-ins module.exports = function ($this, dummy, Wrapper) { var NewTarget, NewTargetPrototype; if ( // it can work only with native `setPrototypeOf` setPrototypeOf && // we haven't completely correct pre-ES6 way for getting `new.target`, so use this isCallable(NewTarget = dummy.constructor) && NewTarget !== Wrapper && isObject(NewTargetPrototype = NewTarget.prototype) && NewTargetPrototype !== Wrapper.prototype ) setPrototypeOf($this, NewTargetPrototype); return $this; }; /***/ }), /***/ 3706: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var uncurryThis = __webpack_require__(9504); var isCallable = __webpack_require__(4901); var store = __webpack_require__(7629); var functionToString = uncurryThis(Function.toString); // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper if (!isCallable(store.inspectSource)) { store.inspectSource = function (it) { return functionToString(it); }; } module.exports = store.inspectSource; /***/ }), /***/ 1181: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var NATIVE_WEAK_MAP = __webpack_require__(8622); var global = __webpack_require__(4475); var isObject = __webpack_require__(34); var createNonEnumerableProperty = __webpack_require__(6699); var hasOwn = __webpack_require__(9297); var shared = __webpack_require__(7629); var sharedKey = __webpack_require__(6119); var hiddenKeys = __webpack_require__(421); var OBJECT_ALREADY_INITIALIZED = 'Object already initialized'; var TypeError = global.TypeError; var WeakMap = global.WeakMap; var set, get, has; var enforce = function (it) { return has(it) ? get(it) : set(it, {}); }; var getterFor = function (TYPE) { return function (it) { var state; if (!isObject(it) || (state = get(it)).type !== TYPE) { throw new TypeError('Incompatible receiver, ' + TYPE + ' required'); } return state; }; }; if (NATIVE_WEAK_MAP || shared.state) { var store = shared.state || (shared.state = new WeakMap()); /* eslint-disable no-self-assign -- prototype methods protection */ store.get = store.get; store.has = store.has; store.set = store.set; /* eslint-enable no-self-assign -- prototype methods protection */ set = function (it, metadata) { if (store.has(it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; store.set(it, metadata); return metadata; }; get = function (it) { return store.get(it) || {}; }; has = function (it) { return store.has(it); }; } else { var STATE = sharedKey('state'); hiddenKeys[STATE] = true; set = function (it, metadata) { if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; createNonEnumerableProperty(it, STATE, metadata); return metadata; }; get = function (it) { return hasOwn(it, STATE) ? it[STATE] : {}; }; has = function (it) { return hasOwn(it, STATE); }; } module.exports = { set: set, get: get, has: has, enforce: enforce, getterFor: getterFor }; /***/ }), /***/ 4209: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var wellKnownSymbol = __webpack_require__(8227); var Iterators = __webpack_require__(6269); var ITERATOR = wellKnownSymbol('iterator'); var ArrayPrototype = Array.prototype; // check on default Array iterator module.exports = function (it) { return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it); }; /***/ }), /***/ 4376: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var classof = __webpack_require__(4576); // `IsArray` abstract operation // https://tc39.es/ecma262/#sec-isarray // eslint-disable-next-line es/no-array-isarray -- safe module.exports = Array.isArray || function isArray(argument) { return classof(argument) === 'Array'; }; /***/ }), /***/ 1108: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var classof = __webpack_require__(6955); module.exports = function (it) { var klass = classof(it); return klass === 'BigInt64Array' || klass === 'BigUint64Array'; }; /***/ }), /***/ 4901: /***/ ((module) => { // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot var documentAll = typeof document == 'object' && document.all; // `IsCallable` abstract operation // https://tc39.es/ecma262/#sec-iscallable // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing module.exports = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) { return typeof argument == 'function' || argument === documentAll; } : function (argument) { return typeof argument == 'function'; }; /***/ }), /***/ 2796: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var fails = __webpack_require__(9039); var isCallable = __webpack_require__(4901); var replacement = /#|\.prototype\./; var isForced = function (feature, detection) { var value = data[normalize(feature)]; return value === POLYFILL ? true : value === NATIVE ? false : isCallable(detection) ? fails(detection) : !!detection; }; var normalize = isForced.normalize = function (string) { return String(string).replace(replacement, '.').toLowerCase(); }; var data = isForced.data = {}; var NATIVE = isForced.NATIVE = 'N'; var POLYFILL = isForced.POLYFILL = 'P'; module.exports = isForced; /***/ }), /***/ 4117: /***/ ((module) => { // we can't use just `it == null` since of `document.all` special case // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec module.exports = function (it) { return it === null || it === undefined; }; /***/ }), /***/ 34: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isCallable = __webpack_require__(4901); module.exports = function (it) { return typeof it == 'object' ? it !== null : isCallable(it); }; /***/ }), /***/ 3925: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isObject = __webpack_require__(34); module.exports = function (argument) { return isObject(argument) || argument === null; }; /***/ }), /***/ 6395: /***/ ((module) => { module.exports = false; /***/ }), /***/ 757: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var getBuiltIn = __webpack_require__(7751); var isCallable = __webpack_require__(4901); var isPrototypeOf = __webpack_require__(1625); var USE_SYMBOL_AS_UID = __webpack_require__(7040); var $Object = Object; module.exports = USE_SYMBOL_AS_UID ? function (it) { return typeof it == 'symbol'; } : function (it) { var $Symbol = getBuiltIn('Symbol'); return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it)); }; /***/ }), /***/ 507: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var call = __webpack_require__(9565); module.exports = function (record, fn, ITERATOR_INSTEAD_OF_RECORD) { var iterator = ITERATOR_INSTEAD_OF_RECORD ? record : record.iterator; var next = record.next; var step, result; while (!(step = call(next, iterator)).done) { result = fn(step.value); if (result !== undefined) return result; } }; /***/ }), /***/ 2652: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var bind = __webpack_require__(6080); var call = __webpack_require__(9565); var anObject = __webpack_require__(8551); var tryToString = __webpack_require__(6823); var isArrayIteratorMethod = __webpack_require__(4209); var lengthOfArrayLike = __webpack_require__(6198); var isPrototypeOf = __webpack_require__(1625); var getIterator = __webpack_require__(81); var getIteratorMethod = __webpack_require__(851); var iteratorClose = __webpack_require__(9539); var $TypeError = TypeError; var Result = function (stopped, result) { this.stopped = stopped; this.result = result; }; var ResultPrototype = Result.prototype; module.exports = function (iterable, unboundFunction, options) { var that = options && options.that; var AS_ENTRIES = !!(options && options.AS_ENTRIES); var IS_RECORD = !!(options && options.IS_RECORD); var IS_ITERATOR = !!(options && options.IS_ITERATOR); var INTERRUPTED = !!(options && options.INTERRUPTED); var fn = bind(unboundFunction, that); var iterator, iterFn, index, length, result, next, step; var stop = function (condition) { if (iterator) iteratorClose(iterator, 'normal', condition); return new Result(true, condition); }; var callFn = function (value) { if (AS_ENTRIES) { anObject(value); return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]); } return INTERRUPTED ? fn(value, stop) : fn(value); }; if (IS_RECORD) { iterator = iterable.iterator; } else if (IS_ITERATOR) { iterator = iterable; } else { iterFn = getIteratorMethod(iterable); if (!iterFn) throw new $TypeError(tryToString(iterable) + ' is not iterable'); // optimisation for array iterators if (isArrayIteratorMethod(iterFn)) { for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) { result = callFn(iterable[index]); if (result && isPrototypeOf(ResultPrototype, result)) return result; } return new Result(false); } iterator = getIterator(iterable, iterFn); } next = IS_RECORD ? iterable.next : iterator.next; while (!(step = call(next, iterator)).done) { try { result = callFn(step.value); } catch (error) { iteratorClose(iterator, 'throw', error); } if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result; } return new Result(false); }; /***/ }), /***/ 9539: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var call = __webpack_require__(9565); var anObject = __webpack_require__(8551); var getMethod = __webpack_require__(5966); module.exports = function (iterator, kind, value) { var innerResult, innerError; anObject(iterator); try { innerResult = getMethod(iterator, 'return'); if (!innerResult) { if (kind === 'throw') throw value; return value; } innerResult = call(innerResult, iterator); } catch (error) { innerError = true; innerResult = error; } if (kind === 'throw') throw value; if (innerError) throw innerResult; anObject(innerResult); return value; }; /***/ }), /***/ 9462: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var call = __webpack_require__(9565); var create = __webpack_require__(2360); var createNonEnumerableProperty = __webpack_require__(6699); var defineBuiltIns = __webpack_require__(6279); var wellKnownSymbol = __webpack_require__(8227); var InternalStateModule = __webpack_require__(1181); var getMethod = __webpack_require__(5966); var IteratorPrototype = (__webpack_require__(7657).IteratorPrototype); var createIterResultObject = __webpack_require__(2529); var iteratorClose = __webpack_require__(9539); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var ITERATOR_HELPER = 'IteratorHelper'; var WRAP_FOR_VALID_ITERATOR = 'WrapForValidIterator'; var setInternalState = InternalStateModule.set; var createIteratorProxyPrototype = function (IS_ITERATOR) { var getInternalState = InternalStateModule.getterFor(IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER); return defineBuiltIns(create(IteratorPrototype), { next: function next() { var state = getInternalState(this); // for simplification: // for `%WrapForValidIteratorPrototype%.next` our `nextHandler` returns `IterResultObject` // for `%IteratorHelperPrototype%.next` - just a value if (IS_ITERATOR) return state.nextHandler(); try { var result = state.done ? undefined : state.nextHandler(); return createIterResultObject(result, state.done); } catch (error) { state.done = true; throw error; } }, 'return': function () { var state = getInternalState(this); var iterator = state.iterator; state.done = true; if (IS_ITERATOR) { var returnMethod = getMethod(iterator, 'return'); return returnMethod ? call(returnMethod, iterator) : createIterResultObject(undefined, true); } if (state.inner) try { iteratorClose(state.inner.iterator, 'normal'); } catch (error) { return iteratorClose(iterator, 'throw', error); } iteratorClose(iterator, 'normal'); return createIterResultObject(undefined, true); } }); }; var WrapForValidIteratorPrototype = createIteratorProxyPrototype(true); var IteratorHelperPrototype = createIteratorProxyPrototype(false); createNonEnumerableProperty(IteratorHelperPrototype, TO_STRING_TAG, 'Iterator Helper'); module.exports = function (nextHandler, IS_ITERATOR) { var IteratorProxy = function Iterator(record, state) { if (state) { state.iterator = record.iterator; state.next = record.next; } else state = record; state.type = IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER; state.nextHandler = nextHandler; state.counter = 0; state.done = false; setInternalState(this, state); }; IteratorProxy.prototype = IS_ITERATOR ? WrapForValidIteratorPrototype : IteratorHelperPrototype; return IteratorProxy; }; /***/ }), /***/ 713: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var call = __webpack_require__(9565); var aCallable = __webpack_require__(9306); var anObject = __webpack_require__(8551); var getIteratorDirect = __webpack_require__(1767); var createIteratorProxy = __webpack_require__(9462); var callWithSafeIterationClosing = __webpack_require__(6319); var IteratorProxy = createIteratorProxy(function () { var iterator = this.iterator; var result = anObject(call(this.next, iterator)); var done = this.done = !!result.done; if (!done) return callWithSafeIterationClosing(iterator, this.mapper, [result.value, this.counter++], true); }); // `Iterator.prototype.map` method // https://github.com/tc39/proposal-iterator-helpers module.exports = function map(mapper) { anObject(this); aCallable(mapper); return new IteratorProxy(getIteratorDirect(this), { mapper: mapper }); }; /***/ }), /***/ 7657: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var fails = __webpack_require__(9039); var isCallable = __webpack_require__(4901); var isObject = __webpack_require__(34); var create = __webpack_require__(2360); var getPrototypeOf = __webpack_require__(2787); var defineBuiltIn = __webpack_require__(6840); var wellKnownSymbol = __webpack_require__(8227); var IS_PURE = __webpack_require__(6395); var ITERATOR = wellKnownSymbol('iterator'); var BUGGY_SAFARI_ITERATORS = false; // `%IteratorPrototype%` object // https://tc39.es/ecma262/#sec-%iteratorprototype%-object var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator; /* eslint-disable es/no-array-prototype-keys -- safe */ if ([].keys) { arrayIterator = [].keys(); // Safari 8 has buggy iterators w/o `next` if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true; else { PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator)); if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype; } } var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype) || fails(function () { var test = {}; // FF44- legacy iterators case return IteratorPrototype[ITERATOR].call(test) !== test; }); if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {}; else if (IS_PURE) IteratorPrototype = create(IteratorPrototype); // `%IteratorPrototype%[@@iterator]()` method // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator if (!isCallable(IteratorPrototype[ITERATOR])) { defineBuiltIn(IteratorPrototype, ITERATOR, function () { return this; }); } module.exports = { IteratorPrototype: IteratorPrototype, BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS }; /***/ }), /***/ 6269: /***/ ((module) => { module.exports = {}; /***/ }), /***/ 6198: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var toLength = __webpack_require__(8014); // `LengthOfArrayLike` abstract operation // https://tc39.es/ecma262/#sec-lengthofarraylike module.exports = function (obj) { return toLength(obj.length); }; /***/ }), /***/ 283: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var uncurryThis = __webpack_require__(9504); var fails = __webpack_require__(9039); var isCallable = __webpack_require__(4901); var hasOwn = __webpack_require__(9297); var DESCRIPTORS = __webpack_require__(3724); var CONFIGURABLE_FUNCTION_NAME = (__webpack_require__(350).CONFIGURABLE); var inspectSource = __webpack_require__(3706); var InternalStateModule = __webpack_require__(1181); var enforceInternalState = InternalStateModule.enforce; var getInternalState = InternalStateModule.get; var $String = String; // eslint-disable-next-line es/no-object-defineproperty -- safe var defineProperty = Object.defineProperty; var stringSlice = uncurryThis(''.slice); var replace = uncurryThis(''.replace); var join = uncurryThis([].join); var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () { return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8; }); var TEMPLATE = String(String).split('String'); var makeBuiltIn = module.exports = function (value, name, options) { if (stringSlice($String(name), 0, 7) === 'Symbol(') { name = '[' + replace($String(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']'; } if (options && options.getter) name = 'get ' + name; if (options && options.setter) name = 'set ' + name; if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) { if (DESCRIPTORS) defineProperty(value, 'name', { value: name, configurable: true }); else value.name = name; } if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) { defineProperty(value, 'length', { value: options.arity }); } try { if (options && hasOwn(options, 'constructor') && options.constructor) { if (DESCRIPTORS) defineProperty(value, 'prototype', { writable: false }); // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable } else if (value.prototype) value.prototype = undefined; } catch (error) { /* empty */ } var state = enforceInternalState(value); if (!hasOwn(state, 'source')) { state.source = join(TEMPLATE, typeof name == 'string' ? name : ''); } return value; }; // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative // eslint-disable-next-line no-extend-native -- required Function.prototype.toString = makeBuiltIn(function toString() { return isCallable(this) && getInternalState(this).source || inspectSource(this); }, 'toString'); /***/ }), /***/ 741: /***/ ((module) => { var ceil = Math.ceil; var floor = Math.floor; // `Math.trunc` method // https://tc39.es/ecma262/#sec-math.trunc // eslint-disable-next-line es/no-math-trunc -- safe module.exports = Math.trunc || function trunc(x) { var n = +x; return (n > 0 ? floor : ceil)(n); }; /***/ }), /***/ 6043: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var aCallable = __webpack_require__(9306); var $TypeError = TypeError; var PromiseCapability = function (C) { var resolve, reject; this.promise = new C(function ($$resolve, $$reject) { if (resolve !== undefined || reject !== undefined) throw new $TypeError('Bad Promise constructor'); resolve = $$resolve; reject = $$reject; }); this.resolve = aCallable(resolve); this.reject = aCallable(reject); }; // `NewPromiseCapability` abstract operation // https://tc39.es/ecma262/#sec-newpromisecapability module.exports.f = function (C) { return new PromiseCapability(C); }; /***/ }), /***/ 2603: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var toString = __webpack_require__(655); module.exports = function (argument, $default) { return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument); }; /***/ }), /***/ 2360: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* global ActiveXObject -- old IE, WSH */ var anObject = __webpack_require__(8551); var definePropertiesModule = __webpack_require__(6801); var enumBugKeys = __webpack_require__(8727); var hiddenKeys = __webpack_require__(421); var html = __webpack_require__(397); var documentCreateElement = __webpack_require__(4055); var sharedKey = __webpack_require__(6119); var GT = '>'; var LT = '<'; var PROTOTYPE = 'prototype'; var SCRIPT = 'script'; var IE_PROTO = sharedKey('IE_PROTO'); var EmptyConstructor = function () { /* empty */ }; var scriptTag = function (content) { return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT; }; // Create object with fake `null` prototype: use ActiveX Object with cleared prototype var NullProtoObjectViaActiveX = function (activeXDocument) { activeXDocument.write(scriptTag('')); activeXDocument.close(); var temp = activeXDocument.parentWindow.Object; activeXDocument = null; // avoid memory leak return temp; }; // Create object with fake `null` prototype: use iframe Object with cleared prototype var NullProtoObjectViaIFrame = function () { // Thrash, waste and sodomy: IE GC bug var iframe = documentCreateElement('iframe'); var JS = 'java' + SCRIPT + ':'; var iframeDocument; iframe.style.display = 'none'; html.appendChild(iframe); // https://github.com/zloirock/core-js/issues/475 iframe.src = String(JS); iframeDocument = iframe.contentWindow.document; iframeDocument.open(); iframeDocument.write(scriptTag('document.F=Object')); iframeDocument.close(); return iframeDocument.F; }; // Check for document.domain and active x support // No need to use active x approach when document.domain is not set // see https://github.com/es-shims/es5-shim/issues/150 // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 // avoid IE GC bug var activeXDocument; var NullProtoObject = function () { try { activeXDocument = new ActiveXObject('htmlfile'); } catch (error) { /* ignore */ } NullProtoObject = typeof document != 'undefined' ? document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) // old IE : NullProtoObjectViaIFrame() : NullProtoObjectViaActiveX(activeXDocument); // WSH var length = enumBugKeys.length; while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]]; return NullProtoObject(); }; hiddenKeys[IE_PROTO] = true; // `Object.create` method // https://tc39.es/ecma262/#sec-object.create // eslint-disable-next-line es/no-object-create -- safe module.exports = Object.create || function create(O, Properties) { var result; if (O !== null) { EmptyConstructor[PROTOTYPE] = anObject(O); result = new EmptyConstructor(); EmptyConstructor[PROTOTYPE] = null; // add "__proto__" for Object.getPrototypeOf polyfill result[IE_PROTO] = O; } else result = NullProtoObject(); return Properties === undefined ? result : definePropertiesModule.f(result, Properties); }; /***/ }), /***/ 6801: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var DESCRIPTORS = __webpack_require__(3724); var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(8686); var definePropertyModule = __webpack_require__(4913); var anObject = __webpack_require__(8551); var toIndexedObject = __webpack_require__(5397); var objectKeys = __webpack_require__(1072); // `Object.defineProperties` method // https://tc39.es/ecma262/#sec-object.defineproperties // eslint-disable-next-line es/no-object-defineproperties -- safe exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) { anObject(O); var props = toIndexedObject(Properties); var keys = objectKeys(Properties); var length = keys.length; var index = 0; var key; while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]); return O; }; /***/ }), /***/ 4913: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var DESCRIPTORS = __webpack_require__(3724); var IE8_DOM_DEFINE = __webpack_require__(5917); var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(8686); var anObject = __webpack_require__(8551); var toPropertyKey = __webpack_require__(6969); var $TypeError = TypeError; // eslint-disable-next-line es/no-object-defineproperty -- safe var $defineProperty = Object.defineProperty; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; var ENUMERABLE = 'enumerable'; var CONFIGURABLE = 'configurable'; var WRITABLE = 'writable'; // `Object.defineProperty` method // https://tc39.es/ecma262/#sec-object.defineproperty exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) { anObject(O); P = toPropertyKey(P); anObject(Attributes); if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) { var current = $getOwnPropertyDescriptor(O, P); if (current && current[WRITABLE]) { O[P] = Attributes.value; Attributes = { configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE], enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE], writable: false }; } } return $defineProperty(O, P, Attributes); } : $defineProperty : function defineProperty(O, P, Attributes) { anObject(O); P = toPropertyKey(P); anObject(Attributes); if (IE8_DOM_DEFINE) try { return $defineProperty(O, P, Attributes); } catch (error) { /* empty */ } if ('get' in Attributes || 'set' in Attributes) throw new $TypeError('Accessors not supported'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; /***/ }), /***/ 7347: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var DESCRIPTORS = __webpack_require__(3724); var call = __webpack_require__(9565); var propertyIsEnumerableModule = __webpack_require__(8773); var createPropertyDescriptor = __webpack_require__(6980); var toIndexedObject = __webpack_require__(5397); var toPropertyKey = __webpack_require__(6969); var hasOwn = __webpack_require__(9297); var IE8_DOM_DEFINE = __webpack_require__(5917); // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { O = toIndexedObject(O); P = toPropertyKey(P); if (IE8_DOM_DEFINE) try { return $getOwnPropertyDescriptor(O, P); } catch (error) { /* empty */ } if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]); }; /***/ }), /***/ 8480: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var internalObjectKeys = __webpack_require__(1828); var enumBugKeys = __webpack_require__(8727); var hiddenKeys = enumBugKeys.concat('length', 'prototype'); // `Object.getOwnPropertyNames` method // https://tc39.es/ecma262/#sec-object.getownpropertynames // eslint-disable-next-line es/no-object-getownpropertynames -- safe exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { return internalObjectKeys(O, hiddenKeys); }; /***/ }), /***/ 3717: /***/ ((__unused_webpack_module, exports) => { // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe exports.f = Object.getOwnPropertySymbols; /***/ }), /***/ 2787: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var hasOwn = __webpack_require__(9297); var isCallable = __webpack_require__(4901); var toObject = __webpack_require__(8981); var sharedKey = __webpack_require__(6119); var CORRECT_PROTOTYPE_GETTER = __webpack_require__(2211); var IE_PROTO = sharedKey('IE_PROTO'); var $Object = Object; var ObjectPrototype = $Object.prototype; // `Object.getPrototypeOf` method // https://tc39.es/ecma262/#sec-object.getprototypeof // eslint-disable-next-line es/no-object-getprototypeof -- safe module.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) { var object = toObject(O); if (hasOwn(object, IE_PROTO)) return object[IE_PROTO]; var constructor = object.constructor; if (isCallable(constructor) && object instanceof constructor) { return constructor.prototype; } return object instanceof $Object ? ObjectPrototype : null; }; /***/ }), /***/ 1625: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var uncurryThis = __webpack_require__(9504); module.exports = uncurryThis({}.isPrototypeOf); /***/ }), /***/ 1828: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var uncurryThis = __webpack_require__(9504); var hasOwn = __webpack_require__(9297); var toIndexedObject = __webpack_require__(5397); var indexOf = (__webpack_require__(9617).indexOf); var hiddenKeys = __webpack_require__(421); var push = uncurryThis([].push); module.exports = function (object, names) { var O = toIndexedObject(object); var i = 0; var result = []; var key; for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key); // Don't enum bug & hidden keys while (names.length > i) if (hasOwn(O, key = names[i++])) { ~indexOf(result, key) || push(result, key); } return result; }; /***/ }), /***/ 1072: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var internalObjectKeys = __webpack_require__(1828); var enumBugKeys = __webpack_require__(8727); // `Object.keys` method // https://tc39.es/ecma262/#sec-object.keys // eslint-disable-next-line es/no-object-keys -- safe module.exports = Object.keys || function keys(O) { return internalObjectKeys(O, enumBugKeys); }; /***/ }), /***/ 8773: /***/ ((__unused_webpack_module, exports) => { var $propertyIsEnumerable = {}.propertyIsEnumerable; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // Nashorn ~ JDK8 bug var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1); // `Object.prototype.propertyIsEnumerable` method implementation // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) { var descriptor = getOwnPropertyDescriptor(this, V); return !!descriptor && descriptor.enumerable; } : $propertyIsEnumerable; /***/ }), /***/ 2967: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* eslint-disable no-proto -- safe */ var uncurryThisAccessor = __webpack_require__(6706); var isObject = __webpack_require__(34); var requireObjectCoercible = __webpack_require__(7750); var aPossiblePrototype = __webpack_require__(3506); // `Object.setPrototypeOf` method // https://tc39.es/ecma262/#sec-object.setprototypeof // Works with __proto__ only. Old v8 can't work with null proto objects. // eslint-disable-next-line es/no-object-setprototypeof -- safe module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () { var CORRECT_SETTER = false; var test = {}; var setter; try { setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set'); setter(test, []); CORRECT_SETTER = test instanceof Array; } catch (error) { /* empty */ } return function setPrototypeOf(O, proto) { requireObjectCoercible(O); aPossiblePrototype(proto); if (!isObject(O)) return O; if (CORRECT_SETTER) setter(O, proto); else O.__proto__ = proto; return O; }; }() : undefined); /***/ }), /***/ 4270: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var call = __webpack_require__(9565); var isCallable = __webpack_require__(4901); var isObject = __webpack_require__(34); var $TypeError = TypeError; // `OrdinaryToPrimitive` abstract operation // https://tc39.es/ecma262/#sec-ordinarytoprimitive module.exports = function (input, pref) { var fn, val; if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val; if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val; if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val; throw new $TypeError("Can't convert object to primitive value"); }; /***/ }), /***/ 5031: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var getBuiltIn = __webpack_require__(7751); var uncurryThis = __webpack_require__(9504); var getOwnPropertyNamesModule = __webpack_require__(8480); var getOwnPropertySymbolsModule = __webpack_require__(3717); var anObject = __webpack_require__(8551); var concat = uncurryThis([].concat); // all object keys, includes non-enumerable and symbols module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { var keys = getOwnPropertyNamesModule.f(anObject(it)); var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys; }; /***/ }), /***/ 8235: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var uncurryThis = __webpack_require__(9504); var hasOwn = __webpack_require__(9297); var $SyntaxError = SyntaxError; var $parseInt = parseInt; var fromCharCode = String.fromCharCode; var at = uncurryThis(''.charAt); var slice = uncurryThis(''.slice); var exec = uncurryThis(/./.exec); var codePoints = { '\\"': '"', '\\\\': '\\', '\\/': '/', '\\b': '\b', '\\f': '\f', '\\n': '\n', '\\r': '\r', '\\t': '\t' }; var IS_4_HEX_DIGITS = /^[\da-f]{4}$/i; // eslint-disable-next-line regexp/no-control-character -- safe var IS_C0_CONTROL_CODE = /^[\u0000-\u001F]$/; module.exports = function (source, i) { var unterminated = true; var value = ''; while (i < source.length) { var chr = at(source, i); if (chr === '\\') { var twoChars = slice(source, i, i + 2); if (hasOwn(codePoints, twoChars)) { value += codePoints[twoChars]; i += 2; } else if (twoChars === '\\u') { i += 2; var fourHexDigits = slice(source, i, i + 4); if (!exec(IS_4_HEX_DIGITS, fourHexDigits)) throw new $SyntaxError('Bad Unicode escape at: ' + i); value += fromCharCode($parseInt(fourHexDigits, 16)); i += 4; } else throw new $SyntaxError('Unknown escape sequence: "' + twoChars + '"'); } else if (chr === '"') { unterminated = false; i++; break; } else { if (exec(IS_C0_CONTROL_CODE, chr)) throw new $SyntaxError('Bad control character in string literal at: ' + i); value += chr; i++; } } if (unterminated) throw new $SyntaxError('Unterminated string at: ' + i); return { value: value, end: i }; }; /***/ }), /***/ 7750: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isNullOrUndefined = __webpack_require__(4117); var $TypeError = TypeError; // `RequireObjectCoercible` abstract operation // https://tc39.es/ecma262/#sec-requireobjectcoercible module.exports = function (it) { if (isNullOrUndefined(it)) throw new $TypeError("Can't call method on " + it); return it; }; /***/ }), /***/ 9286: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var SetHelpers = __webpack_require__(4402); var iterate = __webpack_require__(8469); var Set = SetHelpers.Set; var add = SetHelpers.add; module.exports = function (set) { var result = new Set(); iterate(set, function (it) { add(result, it); }); return result; }; /***/ }), /***/ 3440: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var aSet = __webpack_require__(7080); var SetHelpers = __webpack_require__(4402); var clone = __webpack_require__(9286); var size = __webpack_require__(5170); var getSetRecord = __webpack_require__(3789); var iterateSet = __webpack_require__(8469); var iterateSimple = __webpack_require__(507); var has = SetHelpers.has; var remove = SetHelpers.remove; // `Set.prototype.difference` method // https://github.com/tc39/proposal-set-methods module.exports = function difference(other) { var O = aSet(this); var otherRec = getSetRecord(other); var result = clone(O); if (size(O) <= otherRec.size) iterateSet(O, function (e) { if (otherRec.includes(e)) remove(result, e); }); else iterateSimple(otherRec.getIterator(), function (e) { if (has(O, e)) remove(result, e); }); return result; }; /***/ }), /***/ 4402: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var uncurryThis = __webpack_require__(9504); // eslint-disable-next-line es/no-set -- safe var SetPrototype = Set.prototype; module.exports = { // eslint-disable-next-line es/no-set -- safe Set: Set, add: uncurryThis(SetPrototype.add), has: uncurryThis(SetPrototype.has), remove: uncurryThis(SetPrototype['delete']), proto: SetPrototype }; /***/ }), /***/ 8750: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var aSet = __webpack_require__(7080); var SetHelpers = __webpack_require__(4402); var size = __webpack_require__(5170); var getSetRecord = __webpack_require__(3789); var iterateSet = __webpack_require__(8469); var iterateSimple = __webpack_require__(507); var Set = SetHelpers.Set; var add = SetHelpers.add; var has = SetHelpers.has; // `Set.prototype.intersection` method // https://github.com/tc39/proposal-set-methods module.exports = function intersection(other) { var O = aSet(this); var otherRec = getSetRecord(other); var result = new Set(); if (size(O) > otherRec.size) { iterateSimple(otherRec.getIterator(), function (e) { if (has(O, e)) add(result, e); }); } else { iterateSet(O, function (e) { if (otherRec.includes(e)) add(result, e); }); } return result; }; /***/ }), /***/ 4449: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var aSet = __webpack_require__(7080); var has = (__webpack_require__(4402).has); var size = __webpack_require__(5170); var getSetRecord = __webpack_require__(3789); var iterateSet = __webpack_require__(8469); var iterateSimple = __webpack_require__(507); var iteratorClose = __webpack_require__(9539); // `Set.prototype.isDisjointFrom` method // https://tc39.github.io/proposal-set-methods/#Set.prototype.isDisjointFrom module.exports = function isDisjointFrom(other) { var O = aSet(this); var otherRec = getSetRecord(other); if (size(O) <= otherRec.size) return iterateSet(O, function (e) { if (otherRec.includes(e)) return false; }, true) !== false; var iterator = otherRec.getIterator(); return iterateSimple(iterator, function (e) { if (has(O, e)) return iteratorClose(iterator, 'normal', false); }) !== false; }; /***/ }), /***/ 3838: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var aSet = __webpack_require__(7080); var size = __webpack_require__(5170); var iterate = __webpack_require__(8469); var getSetRecord = __webpack_require__(3789); // `Set.prototype.isSubsetOf` method // https://tc39.github.io/proposal-set-methods/#Set.prototype.isSubsetOf module.exports = function isSubsetOf(other) { var O = aSet(this); var otherRec = getSetRecord(other); if (size(O) > otherRec.size) return false; return iterate(O, function (e) { if (!otherRec.includes(e)) return false; }, true) !== false; }; /***/ }), /***/ 8527: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var aSet = __webpack_require__(7080); var has = (__webpack_require__(4402).has); var size = __webpack_require__(5170); var getSetRecord = __webpack_require__(3789); var iterateSimple = __webpack_require__(507); var iteratorClose = __webpack_require__(9539); // `Set.prototype.isSupersetOf` method // https://tc39.github.io/proposal-set-methods/#Set.prototype.isSupersetOf module.exports = function isSupersetOf(other) { var O = aSet(this); var otherRec = getSetRecord(other); if (size(O) < otherRec.size) return false; var iterator = otherRec.getIterator(); return iterateSimple(iterator, function (e) { if (!has(O, e)) return iteratorClose(iterator, 'normal', false); }) !== false; }; /***/ }), /***/ 8469: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var uncurryThis = __webpack_require__(9504); var iterateSimple = __webpack_require__(507); var SetHelpers = __webpack_require__(4402); var Set = SetHelpers.Set; var SetPrototype = SetHelpers.proto; var forEach = uncurryThis(SetPrototype.forEach); var keys = uncurryThis(SetPrototype.keys); var next = keys(new Set()).next; module.exports = function (set, fn, interruptible) { return interruptible ? iterateSimple({ iterator: keys(set), next: next }, fn) : forEach(set, fn); }; /***/ }), /***/ 4916: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var getBuiltIn = __webpack_require__(7751); var createSetLike = function (size) { return { size: size, has: function () { return false; }, keys: function () { return { next: function () { return { done: true }; } }; } }; }; module.exports = function (name) { var Set = getBuiltIn('Set'); try { new Set()[name](createSetLike(0)); try { // late spec change, early WebKit ~ Safari 17.0 beta implementation does not pass it // https://github.com/tc39/proposal-set-methods/pull/88 new Set()[name](createSetLike(-1)); return false; } catch (error2) { return true; } } catch (error) { return false; } }; /***/ }), /***/ 5170: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var uncurryThisAccessor = __webpack_require__(6706); var SetHelpers = __webpack_require__(4402); module.exports = uncurryThisAccessor(SetHelpers.proto, 'size', 'get') || function (set) { return set.size; }; /***/ }), /***/ 3650: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var aSet = __webpack_require__(7080); var SetHelpers = __webpack_require__(4402); var clone = __webpack_require__(9286); var getSetRecord = __webpack_require__(3789); var iterateSimple = __webpack_require__(507); var add = SetHelpers.add; var has = SetHelpers.has; var remove = SetHelpers.remove; // `Set.prototype.symmetricDifference` method // https://github.com/tc39/proposal-set-methods module.exports = function symmetricDifference(other) { var O = aSet(this); var keysIter = getSetRecord(other).getIterator(); var result = clone(O); iterateSimple(keysIter, function (e) { if (has(O, e)) remove(result, e); else add(result, e); }); return result; }; /***/ }), /***/ 4204: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var aSet = __webpack_require__(7080); var add = (__webpack_require__(4402).add); var clone = __webpack_require__(9286); var getSetRecord = __webpack_require__(3789); var iterateSimple = __webpack_require__(507); // `Set.prototype.union` method // https://github.com/tc39/proposal-set-methods module.exports = function union(other) { var O = aSet(this); var keysIter = getSetRecord(other).getIterator(); var result = clone(O); iterateSimple(keysIter, function (it) { add(result, it); }); return result; }; /***/ }), /***/ 6119: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var shared = __webpack_require__(5745); var uid = __webpack_require__(3392); var keys = shared('keys'); module.exports = function (key) { return keys[key] || (keys[key] = uid(key)); }; /***/ }), /***/ 7629: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var IS_PURE = __webpack_require__(6395); var globalThis = __webpack_require__(4475); var defineGlobalProperty = __webpack_require__(9433); var SHARED = '__core-js_shared__'; var store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {}); (store.versions || (store.versions = [])).push({ version: '3.37.1', mode: IS_PURE ? 'pure' : 'global', copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)', license: 'https://github.com/zloirock/core-js/blob/v3.37.1/LICENSE', source: 'https://github.com/zloirock/core-js' }); /***/ }), /***/ 5745: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var store = __webpack_require__(7629); module.exports = function (key, value) { return store[key] || (store[key] = value || {}); }; /***/ }), /***/ 1548: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var global = __webpack_require__(4475); var fails = __webpack_require__(9039); var V8 = __webpack_require__(7388); var IS_BROWSER = __webpack_require__(7290); var IS_DENO = __webpack_require__(516); var IS_NODE = __webpack_require__(9088); var structuredClone = global.structuredClone; module.exports = !!structuredClone && !fails(function () { // prevent V8 ArrayBufferDetaching protector cell invalidation and performance degradation // https://github.com/zloirock/core-js/issues/679 if ((IS_DENO && V8 > 92) || (IS_NODE && V8 > 94) || (IS_BROWSER && V8 > 97)) return false; var buffer = new ArrayBuffer(8); var clone = structuredClone(buffer, { transfer: [buffer] }); return buffer.byteLength !== 0 || clone.byteLength !== 8; }); /***/ }), /***/ 4495: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* eslint-disable es/no-symbol -- required for testing */ var V8_VERSION = __webpack_require__(7388); var fails = __webpack_require__(9039); var global = __webpack_require__(4475); var $String = global.String; // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing module.exports = !!Object.getOwnPropertySymbols && !fails(function () { var symbol = Symbol('symbol detection'); // Chrome 38 Symbol has incorrect toString conversion // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will, // of course, fail. return !$String(symbol) || !(Object(symbol) instanceof Symbol) || // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances !Symbol.sham && V8_VERSION && V8_VERSION < 41; }); /***/ }), /***/ 5610: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var toIntegerOrInfinity = __webpack_require__(1291); var max = Math.max; var min = Math.min; // Helper for a popular repeating case of the spec: // Let integer be ? ToInteger(index). // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length). module.exports = function (index, length) { var integer = toIntegerOrInfinity(index); return integer < 0 ? max(integer + length, 0) : min(integer, length); }; /***/ }), /***/ 5854: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var toPrimitive = __webpack_require__(2777); var $TypeError = TypeError; // `ToBigInt` abstract operation // https://tc39.es/ecma262/#sec-tobigint module.exports = function (argument) { var prim = toPrimitive(argument, 'number'); if (typeof prim == 'number') throw new $TypeError("Can't convert number to bigint"); // eslint-disable-next-line es/no-bigint -- safe return BigInt(prim); }; /***/ }), /***/ 7696: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var toIntegerOrInfinity = __webpack_require__(1291); var toLength = __webpack_require__(8014); var $RangeError = RangeError; // `ToIndex` abstract operation // https://tc39.es/ecma262/#sec-toindex module.exports = function (it) { if (it === undefined) return 0; var number = toIntegerOrInfinity(it); var length = toLength(number); if (number !== length) throw new $RangeError('Wrong length or index'); return length; }; /***/ }), /***/ 5397: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // toObject with fallback for non-array-like ES3 strings var IndexedObject = __webpack_require__(7055); var requireObjectCoercible = __webpack_require__(7750); module.exports = function (it) { return IndexedObject(requireObjectCoercible(it)); }; /***/ }), /***/ 1291: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var trunc = __webpack_require__(741); // `ToIntegerOrInfinity` abstract operation // https://tc39.es/ecma262/#sec-tointegerorinfinity module.exports = function (argument) { var number = +argument; // eslint-disable-next-line no-self-compare -- NaN check return number !== number || number === 0 ? 0 : trunc(number); }; /***/ }), /***/ 8014: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var toIntegerOrInfinity = __webpack_require__(1291); var min = Math.min; // `ToLength` abstract operation // https://tc39.es/ecma262/#sec-tolength module.exports = function (argument) { var len = toIntegerOrInfinity(argument); return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 }; /***/ }), /***/ 8981: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var requireObjectCoercible = __webpack_require__(7750); var $Object = Object; // `ToObject` abstract operation // https://tc39.es/ecma262/#sec-toobject module.exports = function (argument) { return $Object(requireObjectCoercible(argument)); }; /***/ }), /***/ 2777: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var call = __webpack_require__(9565); var isObject = __webpack_require__(34); var isSymbol = __webpack_require__(757); var getMethod = __webpack_require__(5966); var ordinaryToPrimitive = __webpack_require__(4270); var wellKnownSymbol = __webpack_require__(8227); var $TypeError = TypeError; var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); // `ToPrimitive` abstract operation // https://tc39.es/ecma262/#sec-toprimitive module.exports = function (input, pref) { if (!isObject(input) || isSymbol(input)) return input; var exoticToPrim = getMethod(input, TO_PRIMITIVE); var result; if (exoticToPrim) { if (pref === undefined) pref = 'default'; result = call(exoticToPrim, input, pref); if (!isObject(result) || isSymbol(result)) return result; throw new $TypeError("Can't convert object to primitive value"); } if (pref === undefined) pref = 'number'; return ordinaryToPrimitive(input, pref); }; /***/ }), /***/ 6969: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var toPrimitive = __webpack_require__(2777); var isSymbol = __webpack_require__(757); // `ToPropertyKey` abstract operation // https://tc39.es/ecma262/#sec-topropertykey module.exports = function (argument) { var key = toPrimitive(argument, 'string'); return isSymbol(key) ? key : key + ''; }; /***/ }), /***/ 2140: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var wellKnownSymbol = __webpack_require__(8227); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var test = {}; test[TO_STRING_TAG] = 'z'; module.exports = String(test) === '[object z]'; /***/ }), /***/ 655: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var classof = __webpack_require__(6955); var $String = String; module.exports = function (argument) { if (classof(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string'); return $String(argument); }; /***/ }), /***/ 9714: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var IS_NODE = __webpack_require__(9088); module.exports = function (name) { try { // eslint-disable-next-line no-new-func -- safe if (IS_NODE) return Function('return require("' + name + '")')(); } catch (error) { /* empty */ } }; /***/ }), /***/ 6823: /***/ ((module) => { var $String = String; module.exports = function (argument) { try { return $String(argument); } catch (error) { return 'Object'; } }; /***/ }), /***/ 3392: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var uncurryThis = __webpack_require__(9504); var id = 0; var postfix = Math.random(); var toString = uncurryThis(1.0.toString); module.exports = function (key) { return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36); }; /***/ }), /***/ 7040: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* eslint-disable es/no-symbol -- required for testing */ var NATIVE_SYMBOL = __webpack_require__(4495); module.exports = NATIVE_SYMBOL && !Symbol.sham && typeof Symbol.iterator == 'symbol'; /***/ }), /***/ 8686: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var DESCRIPTORS = __webpack_require__(3724); var fails = __webpack_require__(9039); // V8 ~ Chrome 36- // https://bugs.chromium.org/p/v8/issues/detail?id=3334 module.exports = DESCRIPTORS && fails(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty(function () { /* empty */ }, 'prototype', { value: 42, writable: false }).prototype !== 42; }); /***/ }), /***/ 2812: /***/ ((module) => { var $TypeError = TypeError; module.exports = function (passed, required) { if (passed < required) throw new $TypeError('Not enough arguments'); return passed; }; /***/ }), /***/ 8622: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var global = __webpack_require__(4475); var isCallable = __webpack_require__(4901); var WeakMap = global.WeakMap; module.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap)); /***/ }), /***/ 8227: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var global = __webpack_require__(4475); var shared = __webpack_require__(5745); var hasOwn = __webpack_require__(9297); var uid = __webpack_require__(3392); var NATIVE_SYMBOL = __webpack_require__(4495); var USE_SYMBOL_AS_UID = __webpack_require__(7040); var Symbol = global.Symbol; var WellKnownSymbolsStore = shared('wks'); var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid; module.exports = function (name) { if (!hasOwn(WellKnownSymbolsStore, name)) { WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name) ? Symbol[name] : createWellKnownSymbol('Symbol.' + name); } return WellKnownSymbolsStore[name]; }; /***/ }), /***/ 6573: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var DESCRIPTORS = __webpack_require__(3724); var defineBuiltInAccessor = __webpack_require__(2106); var isDetached = __webpack_require__(3238); var ArrayBufferPrototype = ArrayBuffer.prototype; if (DESCRIPTORS && !('detached' in ArrayBufferPrototype)) { defineBuiltInAccessor(ArrayBufferPrototype, 'detached', { configurable: true, get: function detached() { return isDetached(this); } }); } /***/ }), /***/ 7936: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(6518); var $transfer = __webpack_require__(5636); // `ArrayBuffer.prototype.transferToFixedLength` method // https://tc39.es/proposal-arraybuffer-transfer/#sec-arraybuffer.prototype.transfertofixedlength if ($transfer) $({ target: 'ArrayBuffer', proto: true }, { transferToFixedLength: function transferToFixedLength() { return $transfer(this, arguments.length ? arguments[0] : undefined, false); } }); /***/ }), /***/ 8100: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(6518); var $transfer = __webpack_require__(5636); // `ArrayBuffer.prototype.transfer` method // https://tc39.es/proposal-arraybuffer-transfer/#sec-arraybuffer.prototype.transfer if ($transfer) $({ target: 'ArrayBuffer', proto: true }, { transfer: function transfer() { return $transfer(this, arguments.length ? arguments[0] : undefined, true); } }); /***/ }), /***/ 4114: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(6518); var toObject = __webpack_require__(8981); var lengthOfArrayLike = __webpack_require__(6198); var setArrayLength = __webpack_require__(4527); var doesNotExceedSafeInteger = __webpack_require__(6837); var fails = __webpack_require__(9039); var INCORRECT_TO_LENGTH = fails(function () { return [].push.call({ length: 0x100000000 }, 1) !== 4294967297; }); // V8 <= 121 and Safari <= 15.4; FF < 23 throws InternalError // https://bugs.chromium.org/p/v8/issues/detail?id=12681 var properErrorOnNonWritableLength = function () { try { // eslint-disable-next-line es/no-object-defineproperty -- safe Object.defineProperty([], 'length', { writable: false }).push(); } catch (error) { return error instanceof TypeError; } }; var FORCED = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength(); // `Array.prototype.push` method // https://tc39.es/ecma262/#sec-array.prototype.push $({ target: 'Array', proto: true, arity: 1, forced: FORCED }, { // eslint-disable-next-line no-unused-vars -- required for `.length` push: function push(item) { var O = toObject(this); var len = lengthOfArrayLike(O); var argCount = arguments.length; doesNotExceedSafeInteger(len + argCount); for (var i = 0; i < argCount; i++) { O[len] = arguments[i]; len++; } setArrayLength(O, len); return len; } }); /***/ }), /***/ 4628: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(6518); var newPromiseCapabilityModule = __webpack_require__(6043); // `Promise.withResolvers` method // https://github.com/tc39/proposal-promise-with-resolvers $({ target: 'Promise', stat: true }, { withResolvers: function withResolvers() { var promiseCapability = newPromiseCapabilityModule.f(this); return { promise: promiseCapability.promise, resolve: promiseCapability.resolve, reject: promiseCapability.reject }; } }); /***/ }), /***/ 7642: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(6518); var difference = __webpack_require__(3440); var setMethodAcceptSetLike = __webpack_require__(4916); // `Set.prototype.difference` method // https://github.com/tc39/proposal-set-methods $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('difference') }, { difference: difference }); /***/ }), /***/ 8004: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(6518); var fails = __webpack_require__(9039); var intersection = __webpack_require__(8750); var setMethodAcceptSetLike = __webpack_require__(4916); var INCORRECT = !setMethodAcceptSetLike('intersection') || fails(function () { // eslint-disable-next-line es/no-array-from, es/no-set -- testing return String(Array.from(new Set([1, 2, 3]).intersection(new Set([3, 2])))) !== '3,2'; }); // `Set.prototype.intersection` method // https://github.com/tc39/proposal-set-methods $({ target: 'Set', proto: true, real: true, forced: INCORRECT }, { intersection: intersection }); /***/ }), /***/ 3853: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(6518); var isDisjointFrom = __webpack_require__(4449); var setMethodAcceptSetLike = __webpack_require__(4916); // `Set.prototype.isDisjointFrom` method // https://github.com/tc39/proposal-set-methods $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('isDisjointFrom') }, { isDisjointFrom: isDisjointFrom }); /***/ }), /***/ 5876: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(6518); var isSubsetOf = __webpack_require__(3838); var setMethodAcceptSetLike = __webpack_require__(4916); // `Set.prototype.isSubsetOf` method // https://github.com/tc39/proposal-set-methods $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('isSubsetOf') }, { isSubsetOf: isSubsetOf }); /***/ }), /***/ 2475: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(6518); var isSupersetOf = __webpack_require__(8527); var setMethodAcceptSetLike = __webpack_require__(4916); // `Set.prototype.isSupersetOf` method // https://github.com/tc39/proposal-set-methods $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('isSupersetOf') }, { isSupersetOf: isSupersetOf }); /***/ }), /***/ 5024: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(6518); var symmetricDifference = __webpack_require__(3650); var setMethodAcceptSetLike = __webpack_require__(4916); // `Set.prototype.symmetricDifference` method // https://github.com/tc39/proposal-set-methods $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('symmetricDifference') }, { symmetricDifference: symmetricDifference }); /***/ }), /***/ 1698: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(6518); var union = __webpack_require__(4204); var setMethodAcceptSetLike = __webpack_require__(4916); // `Set.prototype.union` method // https://github.com/tc39/proposal-set-methods $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('union') }, { union: union }); /***/ }), /***/ 7467: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var arrayToReversed = __webpack_require__(7628); var ArrayBufferViewCore = __webpack_require__(4644); var aTypedArray = ArrayBufferViewCore.aTypedArray; var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor; // `%TypedArray%.prototype.toReversed` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.toreversed exportTypedArrayMethod('toReversed', function toReversed() { return arrayToReversed(aTypedArray(this), getTypedArrayConstructor(this)); }); /***/ }), /***/ 4732: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var ArrayBufferViewCore = __webpack_require__(4644); var uncurryThis = __webpack_require__(9504); var aCallable = __webpack_require__(9306); var arrayFromConstructorAndList = __webpack_require__(5370); var aTypedArray = ArrayBufferViewCore.aTypedArray; var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor; var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; var sort = uncurryThis(ArrayBufferViewCore.TypedArrayPrototype.sort); // `%TypedArray%.prototype.toSorted` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.tosorted exportTypedArrayMethod('toSorted', function toSorted(compareFn) { if (compareFn !== undefined) aCallable(compareFn); var O = aTypedArray(this); var A = arrayFromConstructorAndList(getTypedArrayConstructor(O), O); return sort(A, compareFn); }); /***/ }), /***/ 9577: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var arrayWith = __webpack_require__(9928); var ArrayBufferViewCore = __webpack_require__(4644); var isBigIntArray = __webpack_require__(1108); var toIntegerOrInfinity = __webpack_require__(1291); var toBigInt = __webpack_require__(5854); var aTypedArray = ArrayBufferViewCore.aTypedArray; var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor; var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; var PROPER_ORDER = !!function () { try { // eslint-disable-next-line no-throw-literal, es/no-typed-arrays, es/no-array-prototype-with -- required for testing new Int8Array(1)['with'](2, { valueOf: function () { throw 8; } }); } catch (error) { // some early implementations, like WebKit, does not follow the final semantic // https://github.com/tc39/proposal-change-array-by-copy/pull/86 return error === 8; } }(); // `%TypedArray%.prototype.with` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.with exportTypedArrayMethod('with', { 'with': function (index, value) { var O = aTypedArray(this); var relativeIndex = toIntegerOrInfinity(index); var actualValue = isBigIntArray(O) ? toBigInt(value) : +value; return arrayWith(O, getTypedArrayConstructor(O), relativeIndex, actualValue); } }['with'], !PROPER_ORDER); /***/ }), /***/ 8992: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(6518); var global = __webpack_require__(4475); var anInstance = __webpack_require__(679); var anObject = __webpack_require__(8551); var isCallable = __webpack_require__(4901); var getPrototypeOf = __webpack_require__(2787); var defineBuiltInAccessor = __webpack_require__(2106); var createProperty = __webpack_require__(4659); var fails = __webpack_require__(9039); var hasOwn = __webpack_require__(9297); var wellKnownSymbol = __webpack_require__(8227); var IteratorPrototype = (__webpack_require__(7657).IteratorPrototype); var DESCRIPTORS = __webpack_require__(3724); var IS_PURE = __webpack_require__(6395); var CONSTRUCTOR = 'constructor'; var ITERATOR = 'Iterator'; var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var $TypeError = TypeError; var NativeIterator = global[ITERATOR]; // FF56- have non-standard global helper `Iterator` var FORCED = IS_PURE || !isCallable(NativeIterator) || NativeIterator.prototype !== IteratorPrototype // FF44- non-standard `Iterator` passes previous tests || !fails(function () { NativeIterator({}); }); var IteratorConstructor = function Iterator() { anInstance(this, IteratorPrototype); if (getPrototypeOf(this) === IteratorPrototype) throw new $TypeError('Abstract class Iterator not directly constructable'); }; var defineIteratorPrototypeAccessor = function (key, value) { if (DESCRIPTORS) { defineBuiltInAccessor(IteratorPrototype, key, { configurable: true, get: function () { return value; }, set: function (replacement) { anObject(this); if (this === IteratorPrototype) throw new $TypeError("You can't redefine this property"); if (hasOwn(this, key)) this[key] = replacement; else createProperty(this, key, replacement); } }); } else IteratorPrototype[key] = value; }; if (!hasOwn(IteratorPrototype, TO_STRING_TAG)) defineIteratorPrototypeAccessor(TO_STRING_TAG, ITERATOR); if (FORCED || !hasOwn(IteratorPrototype, CONSTRUCTOR) || IteratorPrototype[CONSTRUCTOR] === Object) { defineIteratorPrototypeAccessor(CONSTRUCTOR, IteratorConstructor); } IteratorConstructor.prototype = IteratorPrototype; // `Iterator` constructor // https://github.com/tc39/proposal-iterator-helpers $({ global: true, constructor: true, forced: FORCED }, { Iterator: IteratorConstructor }); /***/ }), /***/ 3215: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(6518); var iterate = __webpack_require__(2652); var aCallable = __webpack_require__(9306); var anObject = __webpack_require__(8551); var getIteratorDirect = __webpack_require__(1767); // `Iterator.prototype.every` method // https://github.com/tc39/proposal-iterator-helpers $({ target: 'Iterator', proto: true, real: true }, { every: function every(predicate) { anObject(this); aCallable(predicate); var record = getIteratorDirect(this); var counter = 0; return !iterate(record, function (value, stop) { if (!predicate(value, counter++)) return stop(); }, { IS_RECORD: true, INTERRUPTED: true }).stopped; } }); /***/ }), /***/ 4520: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(6518); var call = __webpack_require__(9565); var aCallable = __webpack_require__(9306); var anObject = __webpack_require__(8551); var getIteratorDirect = __webpack_require__(1767); var createIteratorProxy = __webpack_require__(9462); var callWithSafeIterationClosing = __webpack_require__(6319); var IS_PURE = __webpack_require__(6395); var IteratorProxy = createIteratorProxy(function () { var iterator = this.iterator; var predicate = this.predicate; var next = this.next; var result, done, value; while (true) { result = anObject(call(next, iterator)); done = this.done = !!result.done; if (done) return; value = result.value; if (callWithSafeIterationClosing(iterator, predicate, [value, this.counter++], true)) return value; } }); // `Iterator.prototype.filter` method // https://github.com/tc39/proposal-iterator-helpers $({ target: 'Iterator', proto: true, real: true, forced: IS_PURE }, { filter: function filter(predicate) { anObject(this); aCallable(predicate); return new IteratorProxy(getIteratorDirect(this), { predicate: predicate }); } }); /***/ }), /***/ 670: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(6518); var call = __webpack_require__(9565); var aCallable = __webpack_require__(9306); var anObject = __webpack_require__(8551); var getIteratorDirect = __webpack_require__(1767); var getIteratorFlattenable = __webpack_require__(8646); var createIteratorProxy = __webpack_require__(9462); var iteratorClose = __webpack_require__(9539); var IS_PURE = __webpack_require__(6395); var IteratorProxy = createIteratorProxy(function () { var iterator = this.iterator; var mapper = this.mapper; var result, inner; while (true) { if (inner = this.inner) try { result = anObject(call(inner.next, inner.iterator)); if (!result.done) return result.value; this.inner = null; } catch (error) { iteratorClose(iterator, 'throw', error); } result = anObject(call(this.next, iterator)); if (this.done = !!result.done) return; try { this.inner = getIteratorFlattenable(mapper(result.value, this.counter++), false); } catch (error) { iteratorClose(iterator, 'throw', error); } } }); // `Iterator.prototype.flatMap` method // https://github.com/tc39/proposal-iterator-helpers $({ target: 'Iterator', proto: true, real: true, forced: IS_PURE }, { flatMap: function flatMap(mapper) { anObject(this); aCallable(mapper); return new IteratorProxy(getIteratorDirect(this), { mapper: mapper, inner: null }); } }); /***/ }), /***/ 1454: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(6518); var map = __webpack_require__(713); var IS_PURE = __webpack_require__(6395); // `Iterator.prototype.map` method // https://github.com/tc39/proposal-iterator-helpers $({ target: 'Iterator', proto: true, real: true, forced: IS_PURE }, { map: map }); /***/ }), /***/ 7550: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(6518); var iterate = __webpack_require__(2652); var aCallable = __webpack_require__(9306); var anObject = __webpack_require__(8551); var getIteratorDirect = __webpack_require__(1767); // `Iterator.prototype.some` method // https://github.com/tc39/proposal-iterator-helpers $({ target: 'Iterator', proto: true, real: true }, { some: function some(predicate) { anObject(this); aCallable(predicate); var record = getIteratorDirect(this); var counter = 0; return iterate(record, function (value, stop) { if (predicate(value, counter++)) return stop(); }, { IS_RECORD: true, INTERRUPTED: true }).stopped; } }); /***/ }), /***/ 8335: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(6518); var DESCRIPTORS = __webpack_require__(3724); var global = __webpack_require__(4475); var getBuiltIn = __webpack_require__(7751); var uncurryThis = __webpack_require__(9504); var call = __webpack_require__(9565); var isCallable = __webpack_require__(4901); var isObject = __webpack_require__(34); var isArray = __webpack_require__(4376); var hasOwn = __webpack_require__(9297); var toString = __webpack_require__(655); var lengthOfArrayLike = __webpack_require__(6198); var createProperty = __webpack_require__(4659); var fails = __webpack_require__(9039); var parseJSONString = __webpack_require__(8235); var NATIVE_SYMBOL = __webpack_require__(4495); var JSON = global.JSON; var Number = global.Number; var SyntaxError = global.SyntaxError; var nativeParse = JSON && JSON.parse; var enumerableOwnProperties = getBuiltIn('Object', 'keys'); // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; var at = uncurryThis(''.charAt); var slice = uncurryThis(''.slice); var exec = uncurryThis(/./.exec); var push = uncurryThis([].push); var IS_DIGIT = /^\d$/; var IS_NON_ZERO_DIGIT = /^[1-9]$/; var IS_NUMBER_START = /^(?:-|\d)$/; var IS_WHITESPACE = /^[\t\n\r ]$/; var PRIMITIVE = 0; var OBJECT = 1; var $parse = function (source, reviver) { source = toString(source); var context = new Context(source, 0, ''); var root = context.parse(); var value = root.value; var endIndex = context.skip(IS_WHITESPACE, root.end); if (endIndex < source.length) { throw new SyntaxError('Unexpected extra character: "' + at(source, endIndex) + '" after the parsed data at: ' + endIndex); } return isCallable(reviver) ? internalize({ '': value }, '', reviver, root) : value; }; var internalize = function (holder, name, reviver, node) { var val = holder[name]; var unmodified = node && val === node.value; var context = unmodified && typeof node.source == 'string' ? { source: node.source } : {}; var elementRecordsLen, keys, len, i, P; if (isObject(val)) { var nodeIsArray = isArray(val); var nodes = unmodified ? node.nodes : nodeIsArray ? [] : {}; if (nodeIsArray) { elementRecordsLen = nodes.length; len = lengthOfArrayLike(val); for (i = 0; i < len; i++) { internalizeProperty(val, i, internalize(val, '' + i, reviver, i < elementRecordsLen ? nodes[i] : undefined)); } } else { keys = enumerableOwnProperties(val); len = lengthOfArrayLike(keys); for (i = 0; i < len; i++) { P = keys[i]; internalizeProperty(val, P, internalize(val, P, reviver, hasOwn(nodes, P) ? nodes[P] : undefined)); } } } return call(reviver, holder, name, val, context); }; var internalizeProperty = function (object, key, value) { if (DESCRIPTORS) { var descriptor = getOwnPropertyDescriptor(object, key); if (descriptor && !descriptor.configurable) return; } if (value === undefined) delete object[key]; else createProperty(object, key, value); }; var Node = function (value, end, source, nodes) { this.value = value; this.end = end; this.source = source; this.nodes = nodes; }; var Context = function (source, index) { this.source = source; this.index = index; }; // https://www.json.org/json-en.html Context.prototype = { fork: function (nextIndex) { return new Context(this.source, nextIndex); }, parse: function () { var source = this.source; var i = this.skip(IS_WHITESPACE, this.index); var fork = this.fork(i); var chr = at(source, i); if (exec(IS_NUMBER_START, chr)) return fork.number(); switch (chr) { case '{': return fork.object(); case '[': return fork.array(); case '"': return fork.string(); case 't': return fork.keyword(true); case 'f': return fork.keyword(false); case 'n': return fork.keyword(null); } throw new SyntaxError('Unexpected character: "' + chr + '" at: ' + i); }, node: function (type, value, start, end, nodes) { return new Node(value, end, type ? null : slice(this.source, start, end), nodes); }, object: function () { var source = this.source; var i = this.index + 1; var expectKeypair = false; var object = {}; var nodes = {}; while (i < source.length) { i = this.until(['"', '}'], i); if (at(source, i) === '}' && !expectKeypair) { i++; break; } // Parsing the key var result = this.fork(i).string(); var key = result.value; i = result.end; i = this.until([':'], i) + 1; // Parsing value i = this.skip(IS_WHITESPACE, i); result = this.fork(i).parse(); createProperty(nodes, key, result); createProperty(object, key, result.value); i = this.until([',', '}'], result.end); var chr = at(source, i); if (chr === ',') { expectKeypair = true; i++; } else if (chr === '}') { i++; break; } } return this.node(OBJECT, object, this.index, i, nodes); }, array: function () { var source = this.source; var i = this.index + 1; var expectElement = false; var array = []; var nodes = []; while (i < source.length) { i = this.skip(IS_WHITESPACE, i); if (at(source, i) === ']' && !expectElement) { i++; break; } var result = this.fork(i).parse(); push(nodes, result); push(array, result.value); i = this.until([',', ']'], result.end); if (at(source, i) === ',') { expectElement = true; i++; } else if (at(source, i) === ']') { i++; break; } } return this.node(OBJECT, array, this.index, i, nodes); }, string: function () { var index = this.index; var parsed = parseJSONString(this.source, this.index + 1); return this.node(PRIMITIVE, parsed.value, index, parsed.end); }, number: function () { var source = this.source; var startIndex = this.index; var i = startIndex; if (at(source, i) === '-') i++; if (at(source, i) === '0') i++; else if (exec(IS_NON_ZERO_DIGIT, at(source, i))) i = this.skip(IS_DIGIT, ++i); else throw new SyntaxError('Failed to parse number at: ' + i); if (at(source, i) === '.') i = this.skip(IS_DIGIT, ++i); if (at(source, i) === 'e' || at(source, i) === 'E') { i++; if (at(source, i) === '+' || at(source, i) === '-') i++; var exponentStartIndex = i; i = this.skip(IS_DIGIT, i); if (exponentStartIndex === i) throw new SyntaxError("Failed to parse number's exponent value at: " + i); } return this.node(PRIMITIVE, Number(slice(source, startIndex, i)), startIndex, i); }, keyword: function (value) { var keyword = '' + value; var index = this.index; var endIndex = index + keyword.length; if (slice(this.source, index, endIndex) !== keyword) throw new SyntaxError('Failed to parse value at: ' + index); return this.node(PRIMITIVE, value, index, endIndex); }, skip: function (regex, i) { var source = this.source; for (; i < source.length; i++) if (!exec(regex, at(source, i))) break; return i; }, until: function (array, i) { i = this.skip(IS_WHITESPACE, i); var chr = at(this.source, i); for (var j = 0; j < array.length; j++) if (array[j] === chr) return i; throw new SyntaxError('Unexpected character: "' + chr + '" at: ' + i); } }; var NO_SOURCE_SUPPORT = fails(function () { var unsafeInt = '9007199254740993'; var source; nativeParse(unsafeInt, function (key, value, context) { source = context.source; }); return source !== unsafeInt; }); var PROPER_BASE_PARSE = NATIVE_SYMBOL && !fails(function () { // Safari 9 bug return 1 / nativeParse('-0 \t') !== -Infinity; }); // `JSON.parse` method // https://tc39.es/ecma262/#sec-json.parse // https://github.com/tc39/proposal-json-parse-with-source $({ target: 'JSON', stat: true, forced: NO_SOURCE_SUPPORT }, { parse: function parse(text, reviver) { return PROPER_BASE_PARSE && !isCallable(reviver) ? nativeParse(text) : $parse(text, reviver); } }); /***/ }), /***/ 3375: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { // TODO: Remove from `core-js@4` __webpack_require__(7642); /***/ }), /***/ 9225: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { // TODO: Remove from `core-js@4` __webpack_require__(8004); /***/ }), /***/ 3972: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { // TODO: Remove from `core-js@4` __webpack_require__(3853); /***/ }), /***/ 9209: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { // TODO: Remove from `core-js@4` __webpack_require__(5876); /***/ }), /***/ 5714: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { // TODO: Remove from `core-js@4` __webpack_require__(2475); /***/ }), /***/ 7561: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { // TODO: Remove from `core-js@4` __webpack_require__(5024); /***/ }), /***/ 6197: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { // TODO: Remove from `core-js@4` __webpack_require__(1698); /***/ }), /***/ 4979: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(6518); var global = __webpack_require__(4475); var getBuiltIn = __webpack_require__(7751); var createPropertyDescriptor = __webpack_require__(6980); var defineProperty = (__webpack_require__(4913).f); var hasOwn = __webpack_require__(9297); var anInstance = __webpack_require__(679); var inheritIfRequired = __webpack_require__(3167); var normalizeStringArgument = __webpack_require__(2603); var DOMExceptionConstants = __webpack_require__(5002); var clearErrorStack = __webpack_require__(6193); var DESCRIPTORS = __webpack_require__(3724); var IS_PURE = __webpack_require__(6395); var DOM_EXCEPTION = 'DOMException'; var Error = getBuiltIn('Error'); var NativeDOMException = getBuiltIn(DOM_EXCEPTION); var $DOMException = function DOMException() { anInstance(this, DOMExceptionPrototype); var argumentsLength = arguments.length; var message = normalizeStringArgument(argumentsLength < 1 ? undefined : arguments[0]); var name = normalizeStringArgument(argumentsLength < 2 ? undefined : arguments[1], 'Error'); var that = new NativeDOMException(message, name); var error = new Error(message); error.name = DOM_EXCEPTION; defineProperty(that, 'stack', createPropertyDescriptor(1, clearErrorStack(error.stack, 1))); inheritIfRequired(that, this, $DOMException); return that; }; var DOMExceptionPrototype = $DOMException.prototype = NativeDOMException.prototype; var ERROR_HAS_STACK = 'stack' in new Error(DOM_EXCEPTION); var DOM_EXCEPTION_HAS_STACK = 'stack' in new NativeDOMException(1, 2); // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var descriptor = NativeDOMException && DESCRIPTORS && Object.getOwnPropertyDescriptor(global, DOM_EXCEPTION); // Bun ~ 0.1.1 DOMException have incorrect descriptor and we can't redefine it // https://github.com/Jarred-Sumner/bun/issues/399 var BUGGY_DESCRIPTOR = !!descriptor && !(descriptor.writable && descriptor.configurable); var FORCED_CONSTRUCTOR = ERROR_HAS_STACK && !BUGGY_DESCRIPTOR && !DOM_EXCEPTION_HAS_STACK; // `DOMException` constructor patch for `.stack` where it's required // https://webidl.spec.whatwg.org/#es-DOMException-specialness $({ global: true, constructor: true, forced: IS_PURE || FORCED_CONSTRUCTOR }, { // TODO: fix export logic DOMException: FORCED_CONSTRUCTOR ? $DOMException : NativeDOMException }); var PolyfilledDOMException = getBuiltIn(DOM_EXCEPTION); var PolyfilledDOMExceptionPrototype = PolyfilledDOMException.prototype; if (PolyfilledDOMExceptionPrototype.constructor !== PolyfilledDOMException) { if (!IS_PURE) { defineProperty(PolyfilledDOMExceptionPrototype, 'constructor', createPropertyDescriptor(1, PolyfilledDOMException)); } for (var key in DOMExceptionConstants) if (hasOwn(DOMExceptionConstants, key)) { var constant = DOMExceptionConstants[key]; var constantName = constant.s; if (!hasOwn(PolyfilledDOMException, constantName)) { defineProperty(PolyfilledDOMException, constantName, createPropertyDescriptor(6, constant.c)); } } } /***/ }), /***/ 4603: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var defineBuiltIn = __webpack_require__(6840); var uncurryThis = __webpack_require__(9504); var toString = __webpack_require__(655); var validateArgumentsLength = __webpack_require__(2812); var $URLSearchParams = URLSearchParams; var URLSearchParamsPrototype = $URLSearchParams.prototype; var append = uncurryThis(URLSearchParamsPrototype.append); var $delete = uncurryThis(URLSearchParamsPrototype['delete']); var forEach = uncurryThis(URLSearchParamsPrototype.forEach); var push = uncurryThis([].push); var params = new $URLSearchParams('a=1&a=2&b=3'); params['delete']('a', 1); // `undefined` case is a Chromium 117 bug // https://bugs.chromium.org/p/v8/issues/detail?id=14222 params['delete']('b', undefined); if (params + '' !== 'a=2') { defineBuiltIn(URLSearchParamsPrototype, 'delete', function (name /* , value */) { var length = arguments.length; var $value = length < 2 ? undefined : arguments[1]; if (length && $value === undefined) return $delete(this, name); var entries = []; forEach(this, function (v, k) { // also validates `this` push(entries, { key: k, value: v }); }); validateArgumentsLength(length, 1); var key = toString(name); var value = toString($value); var index = 0; var dindex = 0; var found = false; var entriesLength = entries.length; var entry; while (index < entriesLength) { entry = entries[index++]; if (found || entry.key === key) { found = true; $delete(this, entry.key); } else dindex++; } while (dindex < entriesLength) { entry = entries[dindex++]; if (!(entry.key === key && entry.value === value)) append(this, entry.key, entry.value); } }, { enumerable: true, unsafe: true }); } /***/ }), /***/ 7566: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var defineBuiltIn = __webpack_require__(6840); var uncurryThis = __webpack_require__(9504); var toString = __webpack_require__(655); var validateArgumentsLength = __webpack_require__(2812); var $URLSearchParams = URLSearchParams; var URLSearchParamsPrototype = $URLSearchParams.prototype; var getAll = uncurryThis(URLSearchParamsPrototype.getAll); var $has = uncurryThis(URLSearchParamsPrototype.has); var params = new $URLSearchParams('a=1'); // `undefined` case is a Chromium 117 bug // https://bugs.chromium.org/p/v8/issues/detail?id=14222 if (params.has('a', 2) || !params.has('a', undefined)) { defineBuiltIn(URLSearchParamsPrototype, 'has', function has(name /* , value */) { var length = arguments.length; var $value = length < 2 ? undefined : arguments[1]; if (length && $value === undefined) return $has(this, name); var values = getAll(this, name); // also validates `this` validateArgumentsLength(length, 1); var value = toString($value); var index = 0; while (index < values.length) { if (values[index++] === value) return true; } return false; }, { enumerable: true, unsafe: true }); } /***/ }), /***/ 8721: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var DESCRIPTORS = __webpack_require__(3724); var uncurryThis = __webpack_require__(9504); var defineBuiltInAccessor = __webpack_require__(2106); var URLSearchParamsPrototype = URLSearchParams.prototype; var forEach = uncurryThis(URLSearchParamsPrototype.forEach); // `URLSearchParams.prototype.size` getter // https://github.com/whatwg/url/pull/734 if (DESCRIPTORS && !('size' in URLSearchParamsPrototype)) { defineBuiltInAccessor(URLSearchParamsPrototype, 'size', { get: function size() { var count = 0; forEach(this, function () { count++; }); return count; }, configurable: true, enumerable: true }); } /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = globalThis.pdfjsLib = {}; // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. (() => { // EXPORTS __webpack_require__.d(__webpack_exports__, { AbortException: () => (/* reexport */ AbortException), AnnotationEditorLayer: () => (/* reexport */ AnnotationEditorLayer), AnnotationEditorParamsType: () => (/* reexport */ AnnotationEditorParamsType), AnnotationEditorType: () => (/* reexport */ AnnotationEditorType), AnnotationEditorUIManager: () => (/* reexport */ AnnotationEditorUIManager), AnnotationLayer: () => (/* reexport */ AnnotationLayer), AnnotationMode: () => (/* reexport */ AnnotationMode), CMapCompressionType: () => (/* reexport */ CMapCompressionType), ColorPicker: () => (/* reexport */ ColorPicker), DOMSVGFactory: () => (/* reexport */ DOMSVGFactory), DrawLayer: () => (/* reexport */ DrawLayer), FeatureTest: () => (/* reexport */ util_FeatureTest), GlobalWorkerOptions: () => (/* reexport */ GlobalWorkerOptions), ImageKind: () => (/* reexport */ util_ImageKind), InvalidPDFException: () => (/* reexport */ InvalidPDFException), MissingPDFException: () => (/* reexport */ MissingPDFException), OPS: () => (/* reexport */ OPS), Outliner: () => (/* reexport */ Outliner), PDFDataRangeTransport: () => (/* reexport */ PDFDataRangeTransport), PDFDateString: () => (/* reexport */ PDFDateString), PDFWorker: () => (/* reexport */ PDFWorker), PasswordResponses: () => (/* reexport */ PasswordResponses), PermissionFlag: () => (/* reexport */ PermissionFlag), PixelsPerInch: () => (/* reexport */ PixelsPerInch), RenderingCancelledException: () => (/* reexport */ RenderingCancelledException), TextLayer: () => (/* reexport */ TextLayer), UnexpectedResponseException: () => (/* reexport */ UnexpectedResponseException), Util: () => (/* reexport */ Util), VerbosityLevel: () => (/* reexport */ VerbosityLevel), XfaLayer: () => (/* reexport */ XfaLayer), build: () => (/* reexport */ build), createValidAbsoluteUrl: () => (/* reexport */ createValidAbsoluteUrl), fetchData: () => (/* reexport */ fetchData), getDocument: () => (/* reexport */ getDocument), getFilenameFromUrl: () => (/* reexport */ getFilenameFromUrl), getPdfFilenameFromUrl: () => (/* reexport */ getPdfFilenameFromUrl), getXfaPageViewport: () => (/* reexport */ getXfaPageViewport), isDataScheme: () => (/* reexport */ isDataScheme), isPdfFile: () => (/* reexport */ isPdfFile), noContextMenu: () => (/* reexport */ noContextMenu), normalizeUnicode: () => (/* reexport */ normalizeUnicode), renderTextLayer: () => (/* reexport */ renderTextLayer), setLayerDimensions: () => (/* reexport */ setLayerDimensions), shadow: () => (/* reexport */ shadow), updateTextLayer: () => (/* reexport */ updateTextLayer), version: () => (/* reexport */ version) }); // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js var es_array_push = __webpack_require__(4114); // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array-buffer.detached.js var es_array_buffer_detached = __webpack_require__(6573); // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array-buffer.transfer.js var es_array_buffer_transfer = __webpack_require__(8100); // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array-buffer.transfer-to-fixed-length.js var es_array_buffer_transfer_to_fixed_length = __webpack_require__(7936); // EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.to-reversed.js var es_typed_array_to_reversed = __webpack_require__(7467); // EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.to-sorted.js var es_typed_array_to_sorted = __webpack_require__(4732); // EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.with.js var es_typed_array_with = __webpack_require__(9577); // EXTERNAL MODULE: ./node_modules/core-js/modules/web.url-search-params.delete.js var web_url_search_params_delete = __webpack_require__(4603); // EXTERNAL MODULE: ./node_modules/core-js/modules/web.url-search-params.has.js var web_url_search_params_has = __webpack_require__(7566); // EXTERNAL MODULE: ./node_modules/core-js/modules/web.url-search-params.size.js var web_url_search_params_size = __webpack_require__(8721); ;// CONCATENATED MODULE: ./src/shared/util.js const isNodeJS = typeof process === "object" && process + "" === "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser"); const IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0]; const FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0]; const MAX_IMAGE_SIZE_TO_CACHE = 10e6; const LINE_FACTOR = 1.35; const LINE_DESCENT_FACTOR = 0.35; const BASELINE_FACTOR = LINE_DESCENT_FACTOR / LINE_FACTOR; const RenderingIntentFlag = { ANY: 0x01, DISPLAY: 0x02, PRINT: 0x04, SAVE: 0x08, ANNOTATIONS_FORMS: 0x10, ANNOTATIONS_STORAGE: 0x20, ANNOTATIONS_DISABLE: 0x40, OPLIST: 0x100 }; const AnnotationMode = { DISABLE: 0, ENABLE: 1, ENABLE_FORMS: 2, ENABLE_STORAGE: 3 }; const AnnotationEditorPrefix = "pdfjs_internal_editor_"; const AnnotationEditorType = { DISABLE: -1, NONE: 0, FREETEXT: 3, HIGHLIGHT: 9, STAMP: 13, INK: 15 }; const AnnotationEditorParamsType = { RESIZE: 1, CREATE: 2, FREETEXT_SIZE: 11, FREETEXT_COLOR: 12, FREETEXT_OPACITY: 13, INK_COLOR: 21, INK_THICKNESS: 22, INK_OPACITY: 23, HIGHLIGHT_COLOR: 31, HIGHLIGHT_DEFAULT_COLOR: 32, HIGHLIGHT_THICKNESS: 33, HIGHLIGHT_FREE: 34, HIGHLIGHT_SHOW_ALL: 35 }; const PermissionFlag = { PRINT: 0x04, MODIFY_CONTENTS: 0x08, COPY: 0x10, MODIFY_ANNOTATIONS: 0x20, FILL_INTERACTIVE_FORMS: 0x100, COPY_FOR_ACCESSIBILITY: 0x200, ASSEMBLE: 0x400, PRINT_HIGH_QUALITY: 0x800 }; const TextRenderingMode = { FILL: 0, STROKE: 1, FILL_STROKE: 2, INVISIBLE: 3, FILL_ADD_TO_PATH: 4, STROKE_ADD_TO_PATH: 5, FILL_STROKE_ADD_TO_PATH: 6, ADD_TO_PATH: 7, FILL_STROKE_MASK: 3, ADD_TO_PATH_FLAG: 4 }; const util_ImageKind = { GRAYSCALE_1BPP: 1, RGB_24BPP: 2, RGBA_32BPP: 3 }; const AnnotationType = { TEXT: 1, LINK: 2, FREETEXT: 3, LINE: 4, SQUARE: 5, CIRCLE: 6, POLYGON: 7, POLYLINE: 8, HIGHLIGHT: 9, UNDERLINE: 10, SQUIGGLY: 11, STRIKEOUT: 12, STAMP: 13, CARET: 14, INK: 15, POPUP: 16, FILEATTACHMENT: 17, SOUND: 18, MOVIE: 19, WIDGET: 20, SCREEN: 21, PRINTERMARK: 22, TRAPNET: 23, WATERMARK: 24, THREED: 25, REDACT: 26 }; const AnnotationReplyType = { GROUP: "Group", REPLY: "R" }; const AnnotationFlag = { INVISIBLE: 0x01, HIDDEN: 0x02, PRINT: 0x04, NOZOOM: 0x08, NOROTATE: 0x10, NOVIEW: 0x20, READONLY: 0x40, LOCKED: 0x80, TOGGLENOVIEW: 0x100, LOCKEDCONTENTS: 0x200 }; const AnnotationFieldFlag = { READONLY: 0x0000001, REQUIRED: 0x0000002, NOEXPORT: 0x0000004, MULTILINE: 0x0001000, PASSWORD: 0x0002000, NOTOGGLETOOFF: 0x0004000, RADIO: 0x0008000, PUSHBUTTON: 0x0010000, COMBO: 0x0020000, EDIT: 0x0040000, SORT: 0x0080000, FILESELECT: 0x0100000, MULTISELECT: 0x0200000, DONOTSPELLCHECK: 0x0400000, DONOTSCROLL: 0x0800000, COMB: 0x1000000, RICHTEXT: 0x2000000, RADIOSINUNISON: 0x2000000, COMMITONSELCHANGE: 0x4000000 }; const AnnotationBorderStyleType = { SOLID: 1, DASHED: 2, BEVELED: 3, INSET: 4, UNDERLINE: 5 }; const AnnotationActionEventType = { E: "Mouse Enter", X: "Mouse Exit", D: "Mouse Down", U: "Mouse Up", Fo: "Focus", Bl: "Blur", PO: "PageOpen", PC: "PageClose", PV: "PageVisible", PI: "PageInvisible", K: "Keystroke", F: "Format", V: "Validate", C: "Calculate" }; const DocumentActionEventType = { WC: "WillClose", WS: "WillSave", DS: "DidSave", WP: "WillPrint", DP: "DidPrint" }; const PageActionEventType = { O: "PageOpen", C: "PageClose" }; const VerbosityLevel = { ERRORS: 0, WARNINGS: 1, INFOS: 5 }; const CMapCompressionType = { NONE: 0, BINARY: 1 }; const OPS = { dependency: 1, setLineWidth: 2, setLineCap: 3, setLineJoin: 4, setMiterLimit: 5, setDash: 6, setRenderingIntent: 7, setFlatness: 8, setGState: 9, save: 10, restore: 11, transform: 12, moveTo: 13, lineTo: 14, curveTo: 15, curveTo2: 16, curveTo3: 17, closePath: 18, rectangle: 19, stroke: 20, closeStroke: 21, fill: 22, eoFill: 23, fillStroke: 24, eoFillStroke: 25, closeFillStroke: 26, closeEOFillStroke: 27, endPath: 28, clip: 29, eoClip: 30, beginText: 31, endText: 32, setCharSpacing: 33, setWordSpacing: 34, setHScale: 35, setLeading: 36, setFont: 37, setTextRenderingMode: 38, setTextRise: 39, moveText: 40, setLeadingMoveText: 41, setTextMatrix: 42, nextLine: 43, showText: 44, showSpacedText: 45, nextLineShowText: 46, nextLineSetSpacingShowText: 47, setCharWidth: 48, setCharWidthAndBounds: 49, setStrokeColorSpace: 50, setFillColorSpace: 51, setStrokeColor: 52, setStrokeColorN: 53, setFillColor: 54, setFillColorN: 55, setStrokeGray: 56, setFillGray: 57, setStrokeRGBColor: 58, setFillRGBColor: 59, setStrokeCMYKColor: 60, setFillCMYKColor: 61, shadingFill: 62, beginInlineImage: 63, beginImageData: 64, endInlineImage: 65, paintXObject: 66, markPoint: 67, markPointProps: 68, beginMarkedContent: 69, beginMarkedContentProps: 70, endMarkedContent: 71, beginCompat: 72, endCompat: 73, paintFormXObjectBegin: 74, paintFormXObjectEnd: 75, beginGroup: 76, endGroup: 77, beginAnnotation: 80, endAnnotation: 81, paintImageMaskXObject: 83, paintImageMaskXObjectGroup: 84, paintImageXObject: 85, paintInlineImageXObject: 86, paintInlineImageXObjectGroup: 87, paintImageXObjectRepeat: 88, paintImageMaskXObjectRepeat: 89, paintSolidColorImageMask: 90, constructPath: 91 }; const PasswordResponses = { NEED_PASSWORD: 1, INCORRECT_PASSWORD: 2 }; let verbosity = VerbosityLevel.WARNINGS; function setVerbosityLevel(level) { if (Number.isInteger(level)) { verbosity = level; } } function getVerbosityLevel() { return verbosity; } function info(msg) { if (verbosity >= VerbosityLevel.INFOS) { console.log(`Info: ${msg}`); } } function warn(msg) { if (verbosity >= VerbosityLevel.WARNINGS) { console.log(`Warning: ${msg}`); } } function unreachable(msg) { throw new Error(msg); } function assert(cond, msg) { if (!cond) { unreachable(msg); } } function _isValidProtocol(url) { switch (url?.protocol) { case "http:": case "https:": case "ftp:": case "mailto:": case "tel:": return true; default: return false; } } function createValidAbsoluteUrl(url, baseUrl = null, options = null) { if (!url) { return null; } try { if (options && typeof url === "string") { if (options.addDefaultProtocol && url.startsWith("www.")) { const dots = url.match(/\./g); if (dots?.length >= 2) { url = `http://${url}`; } } if (options.tryConvertEncoding) { try { url = stringToUTF8String(url); } catch {} } } const absoluteUrl = baseUrl ? new URL(url, baseUrl) : new URL(url); if (_isValidProtocol(absoluteUrl)) { return absoluteUrl; } } catch {} return null; } function shadow(obj, prop, value, nonSerializable = false) { Object.defineProperty(obj, prop, { value, enumerable: !nonSerializable, configurable: true, writable: false }); return value; } const BaseException = function BaseExceptionClosure() { function BaseException(message, name) { if (this.constructor === BaseException) { unreachable("Cannot initialize BaseException."); } this.message = message; this.name = name; } BaseException.prototype = new Error(); BaseException.constructor = BaseException; return BaseException; }(); class PasswordException extends BaseException { constructor(msg, code) { super(msg, "PasswordException"); this.code = code; } } class UnknownErrorException extends BaseException { constructor(msg, details) { super(msg, "UnknownErrorException"); this.details = details; } } class InvalidPDFException extends BaseException { constructor(msg) { super(msg, "InvalidPDFException"); } } class MissingPDFException extends BaseException { constructor(msg) { super(msg, "MissingPDFException"); } } class UnexpectedResponseException extends BaseException { constructor(msg, status) { super(msg, "UnexpectedResponseException"); this.status = status; } } class FormatError extends BaseException { constructor(msg) { super(msg, "FormatError"); } } class AbortException extends BaseException { constructor(msg) { super(msg, "AbortException"); } } function bytesToString(bytes) { if (typeof bytes !== "object" || bytes?.length === undefined) { unreachable("Invalid argument for bytesToString"); } const length = bytes.length; const MAX_ARGUMENT_COUNT = 8192; if (length < MAX_ARGUMENT_COUNT) { return String.fromCharCode.apply(null, bytes); } const strBuf = []; for (let i = 0; i < length; i += MAX_ARGUMENT_COUNT) { const chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length); const chunk = bytes.subarray(i, chunkEnd); strBuf.push(String.fromCharCode.apply(null, chunk)); } return strBuf.join(""); } function stringToBytes(str) { if (typeof str !== "string") { unreachable("Invalid argument for stringToBytes"); } const length = str.length; const bytes = new Uint8Array(length); for (let i = 0; i < length; ++i) { bytes[i] = str.charCodeAt(i) & 0xff; } return bytes; } function string32(value) { return String.fromCharCode(value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff); } function objectSize(obj) { return Object.keys(obj).length; } function objectFromMap(map) { const obj = Object.create(null); for (const [key, value] of map) { obj[key] = value; } return obj; } function isLittleEndian() { const buffer8 = new Uint8Array(4); buffer8[0] = 1; const view32 = new Uint32Array(buffer8.buffer, 0, 1); return view32[0] === 1; } function isEvalSupported() { try { new Function(""); return true; } catch { return false; } } class util_FeatureTest { static get isLittleEndian() { return shadow(this, "isLittleEndian", isLittleEndian()); } static get isEvalSupported() { return shadow(this, "isEvalSupported", isEvalSupported()); } static get isOffscreenCanvasSupported() { return shadow(this, "isOffscreenCanvasSupported", typeof OffscreenCanvas !== "undefined"); } static get platform() { if (typeof navigator !== "undefined" && typeof navigator?.platform === "string") { return shadow(this, "platform", { isMac: navigator.platform.includes("Mac") }); } return shadow(this, "platform", { isMac: false }); } static get isCSSRoundSupported() { return shadow(this, "isCSSRoundSupported", globalThis.CSS?.supports?.("width: round(1.5px, 1px)")); } } const hexNumbers = Array.from(Array(256).keys(), n => n.toString(16).padStart(2, "0")); class Util { static makeHexColor(r, g, b) { return `#${hexNumbers[r]}${hexNumbers[g]}${hexNumbers[b]}`; } static scaleMinMax(transform, minMax) { let temp; if (transform[0]) { if (transform[0] < 0) { temp = minMax[0]; minMax[0] = minMax[2]; minMax[2] = temp; } minMax[0] *= transform[0]; minMax[2] *= transform[0]; if (transform[3] < 0) { temp = minMax[1]; minMax[1] = minMax[3]; minMax[3] = temp; } minMax[1] *= transform[3]; minMax[3] *= transform[3]; } else { temp = minMax[0]; minMax[0] = minMax[1]; minMax[1] = temp; temp = minMax[2]; minMax[2] = minMax[3]; minMax[3] = temp; if (transform[1] < 0) { temp = minMax[1]; minMax[1] = minMax[3]; minMax[3] = temp; } minMax[1] *= transform[1]; minMax[3] *= transform[1]; if (transform[2] < 0) { temp = minMax[0]; minMax[0] = minMax[2]; minMax[2] = temp; } minMax[0] *= transform[2]; minMax[2] *= transform[2]; } minMax[0] += transform[4]; minMax[1] += transform[5]; minMax[2] += transform[4]; minMax[3] += transform[5]; } static transform(m1, m2) { return [m1[0] * m2[0] + m1[2] * m2[1], m1[1] * m2[0] + m1[3] * m2[1], m1[0] * m2[2] + m1[2] * m2[3], m1[1] * m2[2] + m1[3] * m2[3], m1[0] * m2[4] + m1[2] * m2[5] + m1[4], m1[1] * m2[4] + m1[3] * m2[5] + m1[5]]; } static applyTransform(p, m) { const xt = p[0] * m[0] + p[1] * m[2] + m[4]; const yt = p[0] * m[1] + p[1] * m[3] + m[5]; return [xt, yt]; } static applyInverseTransform(p, m) { const d = m[0] * m[3] - m[1] * m[2]; const xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d; const yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d; return [xt, yt]; } static getAxialAlignedBoundingBox(r, m) { const p1 = this.applyTransform(r, m); const p2 = this.applyTransform(r.slice(2, 4), m); const p3 = this.applyTransform([r[0], r[3]], m); const p4 = this.applyTransform([r[2], r[1]], m); return [Math.min(p1[0], p2[0], p3[0], p4[0]), Math.min(p1[1], p2[1], p3[1], p4[1]), Math.max(p1[0], p2[0], p3[0], p4[0]), Math.max(p1[1], p2[1], p3[1], p4[1])]; } static inverseTransform(m) { const d = m[0] * m[3] - m[1] * m[2]; return [m[3] / d, -m[1] / d, -m[2] / d, m[0] / d, (m[2] * m[5] - m[4] * m[3]) / d, (m[4] * m[1] - m[5] * m[0]) / d]; } static singularValueDecompose2dScale(m) { const transpose = [m[0], m[2], m[1], m[3]]; const a = m[0] * transpose[0] + m[1] * transpose[2]; const b = m[0] * transpose[1] + m[1] * transpose[3]; const c = m[2] * transpose[0] + m[3] * transpose[2]; const d = m[2] * transpose[1] + m[3] * transpose[3]; const first = (a + d) / 2; const second = Math.sqrt((a + d) ** 2 - 4 * (a * d - c * b)) / 2; const sx = first + second || 1; const sy = first - second || 1; return [Math.sqrt(sx), Math.sqrt(sy)]; } static normalizeRect(rect) { const r = rect.slice(0); if (rect[0] > rect[2]) { r[0] = rect[2]; r[2] = rect[0]; } if (rect[1] > rect[3]) { r[1] = rect[3]; r[3] = rect[1]; } return r; } static intersect(rect1, rect2) { const xLow = Math.max(Math.min(rect1[0], rect1[2]), Math.min(rect2[0], rect2[2])); const xHigh = Math.min(Math.max(rect1[0], rect1[2]), Math.max(rect2[0], rect2[2])); if (xLow > xHigh) { return null; } const yLow = Math.max(Math.min(rect1[1], rect1[3]), Math.min(rect2[1], rect2[3])); const yHigh = Math.min(Math.max(rect1[1], rect1[3]), Math.max(rect2[1], rect2[3])); if (yLow > yHigh) { return null; } return [xLow, yLow, xHigh, yHigh]; } static #getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, t, minMax) { if (t <= 0 || t >= 1) { return; } const mt = 1 - t; const tt = t * t; const ttt = tt * t; const x = mt * (mt * (mt * x0 + 3 * t * x1) + 3 * tt * x2) + ttt * x3; const y = mt * (mt * (mt * y0 + 3 * t * y1) + 3 * tt * y2) + ttt * y3; minMax[0] = Math.min(minMax[0], x); minMax[1] = Math.min(minMax[1], y); minMax[2] = Math.max(minMax[2], x); minMax[3] = Math.max(minMax[3], y); } static #getExtremum(x0, x1, x2, x3, y0, y1, y2, y3, a, b, c, minMax) { if (Math.abs(a) < 1e-12) { if (Math.abs(b) >= 1e-12) { this.#getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, -c / b, minMax); } return; } const delta = b ** 2 - 4 * c * a; if (delta < 0) { return; } const sqrtDelta = Math.sqrt(delta); const a2 = 2 * a; this.#getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, (-b + sqrtDelta) / a2, minMax); this.#getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, (-b - sqrtDelta) / a2, minMax); } static bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3, minMax) { if (minMax) { minMax[0] = Math.min(minMax[0], x0, x3); minMax[1] = Math.min(minMax[1], y0, y3); minMax[2] = Math.max(minMax[2], x0, x3); minMax[3] = Math.max(minMax[3], y0, y3); } else { minMax = [Math.min(x0, x3), Math.min(y0, y3), Math.max(x0, x3), Math.max(y0, y3)]; } this.#getExtremum(x0, x1, x2, x3, y0, y1, y2, y3, 3 * (-x0 + 3 * (x1 - x2) + x3), 6 * (x0 - 2 * x1 + x2), 3 * (x1 - x0), minMax); this.#getExtremum(x0, x1, x2, x3, y0, y1, y2, y3, 3 * (-y0 + 3 * (y1 - y2) + y3), 6 * (y0 - 2 * y1 + y2), 3 * (y1 - y0), minMax); return minMax; } } const PDFStringTranslateTable = (/* unused pure expression or super */ null && ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2d8, 0x2c7, 0x2c6, 0x2d9, 0x2dd, 0x2db, 0x2da, 0x2dc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, 0x2013, 0x192, 0x2044, 0x2039, 0x203a, 0x2212, 0x2030, 0x201e, 0x201c, 0x201d, 0x2018, 0x2019, 0x201a, 0x2122, 0xfb01, 0xfb02, 0x141, 0x152, 0x160, 0x178, 0x17d, 0x131, 0x142, 0x153, 0x161, 0x17e, 0, 0x20ac])); function stringToPDFString(str) { if (str[0] >= "\xEF") { let encoding; if (str[0] === "\xFE" && str[1] === "\xFF") { encoding = "utf-16be"; if (str.length % 2 === 1) { str = str.slice(0, -1); } } else if (str[0] === "\xFF" && str[1] === "\xFE") { encoding = "utf-16le"; if (str.length % 2 === 1) { str = str.slice(0, -1); } } else if (str[0] === "\xEF" && str[1] === "\xBB" && str[2] === "\xBF") { encoding = "utf-8"; } if (encoding) { try { const decoder = new TextDecoder(encoding, { fatal: true }); const buffer = stringToBytes(str); const decoded = decoder.decode(buffer); if (!decoded.includes("\x1b")) { return decoded; } return decoded.replaceAll(/\x1b[^\x1b]*(?:\x1b|$)/g, ""); } catch (ex) { warn(`stringToPDFString: "${ex}".`); } } } const strBuf = []; for (let i = 0, ii = str.length; i < ii; i++) { const charCode = str.charCodeAt(i); if (charCode === 0x1b) { while (++i < ii && str.charCodeAt(i) !== 0x1b) {} continue; } const code = PDFStringTranslateTable[charCode]; strBuf.push(code ? String.fromCharCode(code) : str.charAt(i)); } return strBuf.join(""); } function stringToUTF8String(str) { return decodeURIComponent(escape(str)); } function utf8StringToString(str) { return unescape(encodeURIComponent(str)); } function isArrayEqual(arr1, arr2) { if (arr1.length !== arr2.length) { return false; } for (let i = 0, ii = arr1.length; i < ii; i++) { if (arr1[i] !== arr2[i]) { return false; } } return true; } function getModificationDate(date = new Date()) { const buffer = [date.getUTCFullYear().toString(), (date.getUTCMonth() + 1).toString().padStart(2, "0"), date.getUTCDate().toString().padStart(2, "0"), date.getUTCHours().toString().padStart(2, "0"), date.getUTCMinutes().toString().padStart(2, "0"), date.getUTCSeconds().toString().padStart(2, "0")]; return buffer.join(""); } let NormalizeRegex = null; let NormalizationMap = null; function normalizeUnicode(str) { if (!NormalizeRegex) { NormalizeRegex = /([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu; NormalizationMap = new Map([["ſt", "ſt"]]); } return str.replaceAll(NormalizeRegex, (_, p1, p2) => p1 ? p1.normalize("NFKC") : NormalizationMap.get(p2)); } function getUuid() { if (typeof crypto !== "undefined" && typeof crypto?.randomUUID === "function") { return crypto.randomUUID(); } const buf = new Uint8Array(32); if (typeof crypto !== "undefined" && typeof crypto?.getRandomValues === "function") { crypto.getRandomValues(buf); } else { for (let i = 0; i < 32; i++) { buf[i] = Math.floor(Math.random() * 255); } } return bytesToString(buf); } const AnnotationPrefix = "pdfjs_internal_id_"; const FontRenderOps = { BEZIER_CURVE_TO: 0, MOVE_TO: 1, LINE_TO: 2, QUADRATIC_CURVE_TO: 3, RESTORE: 4, SAVE: 5, SCALE: 6, TRANSFORM: 7, TRANSLATE: 8 }; // EXTERNAL MODULE: ./node_modules/core-js/modules/es.promise.with-resolvers.js var es_promise_with_resolvers = __webpack_require__(4628); // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.map.js var esnext_iterator_map = __webpack_require__(1454); // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.set.difference.v2.js var esnext_set_difference_v2 = __webpack_require__(3375); // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.set.intersection.v2.js var esnext_set_intersection_v2 = __webpack_require__(9225); // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.set.is-disjoint-from.v2.js var esnext_set_is_disjoint_from_v2 = __webpack_require__(3972); // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.set.is-subset-of.v2.js var esnext_set_is_subset_of_v2 = __webpack_require__(9209); // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.set.is-superset-of.v2.js var esnext_set_is_superset_of_v2 = __webpack_require__(5714); // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.set.symmetric-difference.v2.js var esnext_set_symmetric_difference_v2 = __webpack_require__(7561); // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.set.union.v2.js var esnext_set_union_v2 = __webpack_require__(6197); // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-exception.stack.js var web_dom_exception_stack = __webpack_require__(4979); // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.constructor.js var esnext_iterator_constructor = __webpack_require__(8992); // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.every.js var esnext_iterator_every = __webpack_require__(3215); // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.some.js var esnext_iterator_some = __webpack_require__(7550); // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.json.parse.js var esnext_json_parse = __webpack_require__(8335); // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.filter.js var esnext_iterator_filter = __webpack_require__(4520); ;// CONCATENATED MODULE: ./src/display/base_factory.js class BaseFilterFactory { constructor() { if (this.constructor === BaseFilterFactory) { unreachable("Cannot initialize BaseFilterFactory."); } } addFilter(maps) { return "none"; } addHCMFilter(fgColor, bgColor) { return "none"; } addAlphaFilter(map) { return "none"; } addLuminosityFilter(map) { return "none"; } addHighlightHCMFilter(filterName, fgColor, bgColor, newFgColor, newBgColor) { return "none"; } destroy(keepHCM = false) {} } class BaseCanvasFactory { constructor() { if (this.constructor === BaseCanvasFactory) { unreachable("Cannot initialize BaseCanvasFactory."); } } create(width, height) { if (width <= 0 || height <= 0) { throw new Error("Invalid canvas size"); } const canvas = this._createCanvas(width, height); return { canvas, context: canvas.getContext("2d") }; } reset(canvasAndContext, width, height) { if (!canvasAndContext.canvas) { throw new Error("Canvas is not specified"); } if (width <= 0 || height <= 0) { throw new Error("Invalid canvas size"); } canvasAndContext.canvas.width = width; canvasAndContext.canvas.height = height; } destroy(canvasAndContext) { if (!canvasAndContext.canvas) { throw new Error("Canvas is not specified"); } canvasAndContext.canvas.width = 0; canvasAndContext.canvas.height = 0; canvasAndContext.canvas = null; canvasAndContext.context = null; } _createCanvas(width, height) { unreachable("Abstract method `_createCanvas` called."); } } class BaseCMapReaderFactory { constructor({ baseUrl = null, isCompressed = true }) { if (this.constructor === BaseCMapReaderFactory) { unreachable("Cannot initialize BaseCMapReaderFactory."); } this.baseUrl = baseUrl; this.isCompressed = isCompressed; } async fetch({ name }) { if (!this.baseUrl) { throw new Error('The CMap "baseUrl" parameter must be specified, ensure that ' + 'the "cMapUrl" and "cMapPacked" API parameters are provided.'); } if (!name) { throw new Error("CMap name must be specified."); } const url = this.baseUrl + name + (this.isCompressed ? ".bcmap" : ""); const compressionType = this.isCompressed ? CMapCompressionType.BINARY : CMapCompressionType.NONE; return this._fetchData(url, compressionType).catch(reason => { throw new Error(`Unable to load ${this.isCompressed ? "binary " : ""}CMap at: ${url}`); }); } _fetchData(url, compressionType) { unreachable("Abstract method `_fetchData` called."); } } class BaseStandardFontDataFactory { constructor({ baseUrl = null }) { if (this.constructor === BaseStandardFontDataFactory) { unreachable("Cannot initialize BaseStandardFontDataFactory."); } this.baseUrl = baseUrl; } async fetch({ filename }) { if (!this.baseUrl) { throw new Error('The standard font "baseUrl" parameter must be specified, ensure that ' + 'the "standardFontDataUrl" API parameter is provided.'); } if (!filename) { throw new Error("Font filename must be specified."); } const url = `${this.baseUrl}${filename}`; return this._fetchData(url).catch(reason => { throw new Error(`Unable to load font data at: ${url}`); }); } _fetchData(url) { unreachable("Abstract method `_fetchData` called."); } } class BaseSVGFactory { constructor() { if (this.constructor === BaseSVGFactory) { unreachable("Cannot initialize BaseSVGFactory."); } } create(width, height, skipDimensions = false) { if (width <= 0 || height <= 0) { throw new Error("Invalid SVG dimensions"); } const svg = this._createSVG("svg:svg"); svg.setAttribute("version", "1.1"); if (!skipDimensions) { svg.setAttribute("width", `${width}px`); svg.setAttribute("height", `${height}px`); } svg.setAttribute("preserveAspectRatio", "none"); svg.setAttribute("viewBox", `0 0 ${width} ${height}`); return svg; } createElement(type) { if (typeof type !== "string") { throw new Error("Invalid SVG element type"); } return this._createSVG(type); } _createSVG(type) { unreachable("Abstract method `_createSVG` called."); } } ;// CONCATENATED MODULE: ./src/display/display_utils.js const SVG_NS = "http://www.w3.org/2000/svg"; class PixelsPerInch { static CSS = 96.0; static PDF = 72.0; static PDF_TO_CSS_UNITS = this.CSS / this.PDF; } class DOMFilterFactory extends BaseFilterFactory { #_cache; #_defs; #docId; #document; #_hcmCache; #id = 0; constructor({ docId, ownerDocument = globalThis.document } = {}) { super(); this.#docId = docId; this.#document = ownerDocument; } get #cache() { return this.#_cache ||= new Map(); } get #hcmCache() { return this.#_hcmCache ||= new Map(); } get #defs() { if (!this.#_defs) { const div = this.#document.createElement("div"); const { style } = div; style.visibility = "hidden"; style.contain = "strict"; style.width = style.height = 0; style.position = "absolute"; style.top = style.left = 0; style.zIndex = -1; const svg = this.#document.createElementNS(SVG_NS, "svg"); svg.setAttribute("width", 0); svg.setAttribute("height", 0); this.#_defs = this.#document.createElementNS(SVG_NS, "defs"); div.append(svg); svg.append(this.#_defs); this.#document.body.append(div); } return this.#_defs; } #createTables(maps) { if (maps.length === 1) { const mapR = maps[0]; const buffer = new Array(256); for (let i = 0; i < 256; i++) { buffer[i] = mapR[i] / 255; } const table = buffer.join(","); return [table, table, table]; } const [mapR, mapG, mapB] = maps; const bufferR = new Array(256); const bufferG = new Array(256); const bufferB = new Array(256); for (let i = 0; i < 256; i++) { bufferR[i] = mapR[i] / 255; bufferG[i] = mapG[i] / 255; bufferB[i] = mapB[i] / 255; } return [bufferR.join(","), bufferG.join(","), bufferB.join(",")]; } addFilter(maps) { if (!maps) { return "none"; } let value = this.#cache.get(maps); if (value) { return value; } const [tableR, tableG, tableB] = this.#createTables(maps); const key = maps.length === 1 ? tableR : `${tableR}${tableG}${tableB}`; value = this.#cache.get(key); if (value) { this.#cache.set(maps, value); return value; } const id = `g_${this.#docId}_transfer_map_${this.#id++}`; const url = `url(#${id})`; this.#cache.set(maps, url); this.#cache.set(key, url); const filter = this.#createFilter(id); this.#addTransferMapConversion(tableR, tableG, tableB, filter); return url; } addHCMFilter(fgColor, bgColor) { const key = `${fgColor}-${bgColor}`; const filterName = "base"; let info = this.#hcmCache.get(filterName); if (info?.key === key) { return info.url; } if (info) { info.filter?.remove(); info.key = key; info.url = "none"; info.filter = null; } else { info = { key, url: "none", filter: null }; this.#hcmCache.set(filterName, info); } if (!fgColor || !bgColor) { return info.url; } const fgRGB = this.#getRGB(fgColor); fgColor = Util.makeHexColor(...fgRGB); const bgRGB = this.#getRGB(bgColor); bgColor = Util.makeHexColor(...bgRGB); this.#defs.style.color = ""; if (fgColor === "#000000" && bgColor === "#ffffff" || fgColor === bgColor) { return info.url; } const map = new Array(256); for (let i = 0; i <= 255; i++) { const x = i / 255; map[i] = x <= 0.03928 ? x / 12.92 : ((x + 0.055) / 1.055) ** 2.4; } const table = map.join(","); const id = `g_${this.#docId}_hcm_filter`; const filter = info.filter = this.#createFilter(id); this.#addTransferMapConversion(table, table, table, filter); this.#addGrayConversion(filter); const getSteps = (c, n) => { const start = fgRGB[c] / 255; const end = bgRGB[c] / 255; const arr = new Array(n + 1); for (let i = 0; i <= n; i++) { arr[i] = start + i / n * (end - start); } return arr.join(","); }; this.#addTransferMapConversion(getSteps(0, 5), getSteps(1, 5), getSteps(2, 5), filter); info.url = `url(#${id})`; return info.url; } addAlphaFilter(map) { let value = this.#cache.get(map); if (value) { return value; } const [tableA] = this.#createTables([map]); const key = `alpha_${tableA}`; value = this.#cache.get(key); if (value) { this.#cache.set(map, value); return value; } const id = `g_${this.#docId}_alpha_map_${this.#id++}`; const url = `url(#${id})`; this.#cache.set(map, url); this.#cache.set(key, url); const filter = this.#createFilter(id); this.#addTransferMapAlphaConversion(tableA, filter); return url; } addLuminosityFilter(map) { let value = this.#cache.get(map || "luminosity"); if (value) { return value; } let tableA, key; if (map) { [tableA] = this.#createTables([map]); key = `luminosity_${tableA}`; } else { key = "luminosity"; } value = this.#cache.get(key); if (value) { this.#cache.set(map, value); return value; } const id = `g_${this.#docId}_luminosity_map_${this.#id++}`; const url = `url(#${id})`; this.#cache.set(map, url); this.#cache.set(key, url); const filter = this.#createFilter(id); this.#addLuminosityConversion(filter); if (map) { this.#addTransferMapAlphaConversion(tableA, filter); } return url; } addHighlightHCMFilter(filterName, fgColor, bgColor, newFgColor, newBgColor) { const key = `${fgColor}-${bgColor}-${newFgColor}-${newBgColor}`; let info = this.#hcmCache.get(filterName); if (info?.key === key) { return info.url; } if (info) { info.filter?.remove(); info.key = key; info.url = "none"; info.filter = null; } else { info = { key, url: "none", filter: null }; this.#hcmCache.set(filterName, info); } if (!fgColor || !bgColor) { return info.url; } const [fgRGB, bgRGB] = [fgColor, bgColor].map(this.#getRGB.bind(this)); let fgGray = Math.round(0.2126 * fgRGB[0] + 0.7152 * fgRGB[1] + 0.0722 * fgRGB[2]); let bgGray = Math.round(0.2126 * bgRGB[0] + 0.7152 * bgRGB[1] + 0.0722 * bgRGB[2]); let [newFgRGB, newBgRGB] = [newFgColor, newBgColor].map(this.#getRGB.bind(this)); if (bgGray < fgGray) { [fgGray, bgGray, newFgRGB, newBgRGB] = [bgGray, fgGray, newBgRGB, newFgRGB]; } this.#defs.style.color = ""; const getSteps = (fg, bg, n) => { const arr = new Array(256); const step = (bgGray - fgGray) / n; const newStart = fg / 255; const newStep = (bg - fg) / (255 * n); let prev = 0; for (let i = 0; i <= n; i++) { const k = Math.round(fgGray + i * step); const value = newStart + i * newStep; for (let j = prev; j <= k; j++) { arr[j] = value; } prev = k + 1; } for (let i = prev; i < 256; i++) { arr[i] = arr[prev - 1]; } return arr.join(","); }; const id = `g_${this.#docId}_hcm_${filterName}_filter`; const filter = info.filter = this.#createFilter(id); this.#addGrayConversion(filter); this.#addTransferMapConversion(getSteps(newFgRGB[0], newBgRGB[0], 5), getSteps(newFgRGB[1], newBgRGB[1], 5), getSteps(newFgRGB[2], newBgRGB[2], 5), filter); info.url = `url(#${id})`; return info.url; } destroy(keepHCM = false) { if (keepHCM && this.#hcmCache.size !== 0) { return; } if (this.#_defs) { this.#_defs.parentNode.parentNode.remove(); this.#_defs = null; } if (this.#_cache) { this.#_cache.clear(); this.#_cache = null; } this.#id = 0; } #addLuminosityConversion(filter) { const feColorMatrix = this.#document.createElementNS(SVG_NS, "feColorMatrix"); feColorMatrix.setAttribute("type", "matrix"); feColorMatrix.setAttribute("values", "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"); filter.append(feColorMatrix); } #addGrayConversion(filter) { const feColorMatrix = this.#document.createElementNS(SVG_NS, "feColorMatrix"); feColorMatrix.setAttribute("type", "matrix"); feColorMatrix.setAttribute("values", "0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"); filter.append(feColorMatrix); } #createFilter(id) { const filter = this.#document.createElementNS(SVG_NS, "filter"); filter.setAttribute("color-interpolation-filters", "sRGB"); filter.setAttribute("id", id); this.#defs.append(filter); return filter; } #appendFeFunc(feComponentTransfer, func, table) { const feFunc = this.#document.createElementNS(SVG_NS, func); feFunc.setAttribute("type", "discrete"); feFunc.setAttribute("tableValues", table); feComponentTransfer.append(feFunc); } #addTransferMapConversion(rTable, gTable, bTable, filter) { const feComponentTransfer = this.#document.createElementNS(SVG_NS, "feComponentTransfer"); filter.append(feComponentTransfer); this.#appendFeFunc(feComponentTransfer, "feFuncR", rTable); this.#appendFeFunc(feComponentTransfer, "feFuncG", gTable); this.#appendFeFunc(feComponentTransfer, "feFuncB", bTable); } #addTransferMapAlphaConversion(aTable, filter) { const feComponentTransfer = this.#document.createElementNS(SVG_NS, "feComponentTransfer"); filter.append(feComponentTransfer); this.#appendFeFunc(feComponentTransfer, "feFuncA", aTable); } #getRGB(color) { this.#defs.style.color = color; return getRGB(getComputedStyle(this.#defs).getPropertyValue("color")); } } class DOMCanvasFactory extends BaseCanvasFactory { constructor({ ownerDocument = globalThis.document } = {}) { super(); this._document = ownerDocument; } _createCanvas(width, height) { const canvas = this._document.createElement("canvas"); canvas.width = width; canvas.height = height; return canvas; } } async function fetchData(url, type = "text") { if (isValidFetchUrl(url, document.baseURI)) { const response = await fetch(url); if (!response.ok) { throw new Error(response.statusText); } switch (type) { case "arraybuffer": return response.arrayBuffer(); case "blob": return response.blob(); case "json": return response.json(); } return response.text(); } return new Promise((resolve, reject) => { const request = new XMLHttpRequest(); request.open("GET", url, true); request.responseType = type; request.onreadystatechange = () => { if (request.readyState !== XMLHttpRequest.DONE) { return; } if (request.status === 200 || request.status === 0) { switch (type) { case "arraybuffer": case "blob": case "json": resolve(request.response); return; } resolve(request.responseText); return; } reject(new Error(request.statusText)); }; request.send(null); }); } class DOMCMapReaderFactory extends BaseCMapReaderFactory { _fetchData(url, compressionType) { return fetchData(url, this.isCompressed ? "arraybuffer" : "text").then(data => ({ cMapData: data instanceof ArrayBuffer ? new Uint8Array(data) : stringToBytes(data), compressionType })); } } class DOMStandardFontDataFactory extends BaseStandardFontDataFactory { _fetchData(url) { return fetchData(url, "arraybuffer").then(data => new Uint8Array(data)); } } class DOMSVGFactory extends BaseSVGFactory { _createSVG(type) { return document.createElementNS(SVG_NS, type); } } class PageViewport { constructor({ viewBox, scale, rotation, offsetX = 0, offsetY = 0, dontFlip = false }) { this.viewBox = viewBox; this.scale = scale; this.rotation = rotation; this.offsetX = offsetX; this.offsetY = offsetY; const centerX = (viewBox[2] + viewBox[0]) / 2; const centerY = (viewBox[3] + viewBox[1]) / 2; let rotateA, rotateB, rotateC, rotateD; rotation %= 360; if (rotation < 0) { rotation += 360; } switch (rotation) { case 180: rotateA = -1; rotateB = 0; rotateC = 0; rotateD = 1; break; case 90: rotateA = 0; rotateB = 1; rotateC = 1; rotateD = 0; break; case 270: rotateA = 0; rotateB = -1; rotateC = -1; rotateD = 0; break; case 0: rotateA = 1; rotateB = 0; rotateC = 0; rotateD = -1; break; default: throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees."); } if (dontFlip) { rotateC = -rotateC; rotateD = -rotateD; } let offsetCanvasX, offsetCanvasY; let width, height; if (rotateA === 0) { offsetCanvasX = Math.abs(centerY - viewBox[1]) * scale + offsetX; offsetCanvasY = Math.abs(centerX - viewBox[0]) * scale + offsetY; width = (viewBox[3] - viewBox[1]) * scale; height = (viewBox[2] - viewBox[0]) * scale; } else { offsetCanvasX = Math.abs(centerX - viewBox[0]) * scale + offsetX; offsetCanvasY = Math.abs(centerY - viewBox[1]) * scale + offsetY; width = (viewBox[2] - viewBox[0]) * scale; height = (viewBox[3] - viewBox[1]) * scale; } this.transform = [rotateA * scale, rotateB * scale, rotateC * scale, rotateD * scale, offsetCanvasX - rotateA * scale * centerX - rotateC * scale * centerY, offsetCanvasY - rotateB * scale * centerX - rotateD * scale * centerY]; this.width = width; this.height = height; } get rawDims() { const { viewBox } = this; return shadow(this, "rawDims", { pageWidth: viewBox[2] - viewBox[0], pageHeight: viewBox[3] - viewBox[1], pageX: viewBox[0], pageY: viewBox[1] }); } clone({ scale = this.scale, rotation = this.rotation, offsetX = this.offsetX, offsetY = this.offsetY, dontFlip = false } = {}) { return new PageViewport({ viewBox: this.viewBox.slice(), scale, rotation, offsetX, offsetY, dontFlip }); } convertToViewportPoint(x, y) { return Util.applyTransform([x, y], this.transform); } convertToViewportRectangle(rect) { const topLeft = Util.applyTransform([rect[0], rect[1]], this.transform); const bottomRight = Util.applyTransform([rect[2], rect[3]], this.transform); return [topLeft[0], topLeft[1], bottomRight[0], bottomRight[1]]; } convertToPdfPoint(x, y) { return Util.applyInverseTransform([x, y], this.transform); } } class RenderingCancelledException extends BaseException { constructor(msg, extraDelay = 0) { super(msg, "RenderingCancelledException"); this.extraDelay = extraDelay; } } function isDataScheme(url) { const ii = url.length; let i = 0; while (i < ii && url[i].trim() === "") { i++; } return url.substring(i, i + 5).toLowerCase() === "data:"; } function isPdfFile(filename) { return typeof filename === "string" && /\.pdf$/i.test(filename); } function getFilenameFromUrl(url) { [url] = url.split(/[#?]/, 1); return url.substring(url.lastIndexOf("/") + 1); } function getPdfFilenameFromUrl(url, defaultFilename = "document.pdf") { if (typeof url !== "string") { return defaultFilename; } if (isDataScheme(url)) { warn('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'); return defaultFilename; } const reURI = /^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/; const reFilename = /[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i; const splitURI = reURI.exec(url); let suggestedFilename = reFilename.exec(splitURI[1]) || reFilename.exec(splitURI[2]) || reFilename.exec(splitURI[3]); if (suggestedFilename) { suggestedFilename = suggestedFilename[0]; if (suggestedFilename.includes("%")) { try { suggestedFilename = reFilename.exec(decodeURIComponent(suggestedFilename))[0]; } catch {} } } return suggestedFilename || defaultFilename; } class StatTimer { started = Object.create(null); times = []; time(name) { if (name in this.started) { warn(`Timer is already running for ${name}`); } this.started[name] = Date.now(); } timeEnd(name) { if (!(name in this.started)) { warn(`Timer has not been started for ${name}`); } this.times.push({ name, start: this.started[name], end: Date.now() }); delete this.started[name]; } toString() { const outBuf = []; let longest = 0; for (const { name } of this.times) { longest = Math.max(name.length, longest); } for (const { name, start, end } of this.times) { outBuf.push(`${name.padEnd(longest)} ${end - start}ms\n`); } return outBuf.join(""); } } function isValidFetchUrl(url, baseUrl) { try { const { protocol } = baseUrl ? new URL(url, baseUrl) : new URL(url); return protocol === "http:" || protocol === "https:"; } catch { return false; } } function noContextMenu(e) { e.preventDefault(); } function deprecated(details) { console.log("Deprecated API usage: " + details); } let pdfDateStringRegex; class PDFDateString { static toDateObject(input) { if (!input || typeof input !== "string") { return null; } pdfDateStringRegex ||= new RegExp("^D:" + "(\\d{4})" + "(\\d{2})?" + "(\\d{2})?" + "(\\d{2})?" + "(\\d{2})?" + "(\\d{2})?" + "([Z|+|-])?" + "(\\d{2})?" + "'?" + "(\\d{2})?" + "'?"); const matches = pdfDateStringRegex.exec(input); if (!matches) { return null; } const year = parseInt(matches[1], 10); let month = parseInt(matches[2], 10); month = month >= 1 && month <= 12 ? month - 1 : 0; let day = parseInt(matches[3], 10); day = day >= 1 && day <= 31 ? day : 1; let hour = parseInt(matches[4], 10); hour = hour >= 0 && hour <= 23 ? hour : 0; let minute = parseInt(matches[5], 10); minute = minute >= 0 && minute <= 59 ? minute : 0; let second = parseInt(matches[6], 10); second = second >= 0 && second <= 59 ? second : 0; const universalTimeRelation = matches[7] || "Z"; let offsetHour = parseInt(matches[8], 10); offsetHour = offsetHour >= 0 && offsetHour <= 23 ? offsetHour : 0; let offsetMinute = parseInt(matches[9], 10) || 0; offsetMinute = offsetMinute >= 0 && offsetMinute <= 59 ? offsetMinute : 0; if (universalTimeRelation === "-") { hour += offsetHour; minute += offsetMinute; } else if (universalTimeRelation === "+") { hour -= offsetHour; minute -= offsetMinute; } return new Date(Date.UTC(year, month, day, hour, minute, second)); } } function getXfaPageViewport(xfaPage, { scale = 1, rotation = 0 }) { const { width, height } = xfaPage.attributes.style; const viewBox = [0, 0, parseInt(width), parseInt(height)]; return new PageViewport({ viewBox, scale, rotation }); } function getRGB(color) { if (color.startsWith("#")) { const colorRGB = parseInt(color.slice(1), 16); return [(colorRGB & 0xff0000) >> 16, (colorRGB & 0x00ff00) >> 8, colorRGB & 0x0000ff]; } if (color.startsWith("rgb(")) { return color.slice(4, -1).split(",").map(x => parseInt(x)); } if (color.startsWith("rgba(")) { return color.slice(5, -1).split(",").map(x => parseInt(x)).slice(0, 3); } warn(`Not a valid color format: "${color}"`); return [0, 0, 0]; } function getColorValues(colors) { const span = document.createElement("span"); span.style.visibility = "hidden"; document.body.append(span); for (const name of colors.keys()) { span.style.color = name; const computedColor = window.getComputedStyle(span).color; colors.set(name, getRGB(computedColor)); } span.remove(); } function getCurrentTransform(ctx) { const { a, b, c, d, e, f } = ctx.getTransform(); return [a, b, c, d, e, f]; } function getCurrentTransformInverse(ctx) { const { a, b, c, d, e, f } = ctx.getTransform().invertSelf(); return [a, b, c, d, e, f]; } function setLayerDimensions(div, viewport, mustFlip = false, mustRotate = true) { if (viewport instanceof PageViewport) { const { pageWidth, pageHeight } = viewport.rawDims; const { style } = div; const useRound = util_FeatureTest.isCSSRoundSupported; const w = `var(--scale-factor) * ${pageWidth}px`, h = `var(--scale-factor) * ${pageHeight}px`; const widthStr = useRound ? `round(${w}, 1px)` : `calc(${w})`, heightStr = useRound ? `round(${h}, 1px)` : `calc(${h})`; if (!mustFlip || viewport.rotation % 180 === 0) { style.width = widthStr; style.height = heightStr; } else { style.width = heightStr; style.height = widthStr; } } if (mustRotate) { div.setAttribute("data-main-rotation", viewport.rotation); } } ;// CONCATENATED MODULE: ./src/display/editor/toolbar.js class EditorToolbar { #toolbar = null; #colorPicker = null; #editor; #buttons = null; constructor(editor) { this.#editor = editor; } render() { const editToolbar = this.#toolbar = document.createElement("div"); editToolbar.className = "editToolbar"; editToolbar.setAttribute("role", "toolbar"); editToolbar.addEventListener("contextmenu", noContextMenu); editToolbar.addEventListener("pointerdown", EditorToolbar.#pointerDown); const buttons = this.#buttons = document.createElement("div"); buttons.className = "buttons"; editToolbar.append(buttons); const position = this.#editor.toolbarPosition; if (position) { const { style } = editToolbar; const x = this.#editor._uiManager.direction === "ltr" ? 1 - position[0] : position[0]; style.insetInlineEnd = `${100 * x}%`; style.top = `calc(${100 * position[1]}% + var(--editor-toolbar-vert-offset))`; } this.#addDeleteButton(); return editToolbar; } static #pointerDown(e) { e.stopPropagation(); } #focusIn(e) { this.#editor._focusEventsAllowed = false; e.preventDefault(); e.stopPropagation(); } #focusOut(e) { this.#editor._focusEventsAllowed = true; e.preventDefault(); e.stopPropagation(); } #addListenersToElement(element) { element.addEventListener("focusin", this.#focusIn.bind(this), { capture: true }); element.addEventListener("focusout", this.#focusOut.bind(this), { capture: true }); element.addEventListener("contextmenu", noContextMenu); } hide() { this.#toolbar.classList.add("hidden"); this.#colorPicker?.hideDropdown(); } show() { this.#toolbar.classList.remove("hidden"); } #addDeleteButton() { const button = document.createElement("button"); button.className = "delete"; button.tabIndex = 0; button.setAttribute("data-l10n-id", `pdfjs-editor-remove-${this.#editor.editorType}-button`); this.#addListenersToElement(button); button.addEventListener("click", e => { this.#editor._uiManager.delete(); }); this.#buttons.append(button); } get #divider() { const divider = document.createElement("div"); divider.className = "divider"; return divider; } addAltTextButton(button) { this.#addListenersToElement(button); this.#buttons.prepend(button, this.#divider); } addColorPicker(colorPicker) { this.#colorPicker = colorPicker; const button = colorPicker.renderButton(); this.#addListenersToElement(button); this.#buttons.prepend(button, this.#divider); } remove() { this.#toolbar.remove(); this.#colorPicker?.destroy(); this.#colorPicker = null; } } class HighlightToolbar { #buttons = null; #toolbar = null; #uiManager; constructor(uiManager) { this.#uiManager = uiManager; } #render() { const editToolbar = this.#toolbar = document.createElement("div"); editToolbar.className = "editToolbar"; editToolbar.setAttribute("role", "toolbar"); editToolbar.addEventListener("contextmenu", noContextMenu); const buttons = this.#buttons = document.createElement("div"); buttons.className = "buttons"; editToolbar.append(buttons); this.#addHighlightButton(); return editToolbar; } #getLastPoint(boxes, isLTR) { let lastY = 0; let lastX = 0; for (const box of boxes) { const y = box.y + box.height; if (y < lastY) { continue; } const x = box.x + (isLTR ? box.width : 0); if (y > lastY) { lastX = x; lastY = y; continue; } if (isLTR) { if (x > lastX) { lastX = x; } } else if (x < lastX) { lastX = x; } } return [isLTR ? 1 - lastX : lastX, lastY]; } show(parent, boxes, isLTR) { const [x, y] = this.#getLastPoint(boxes, isLTR); const { style } = this.#toolbar ||= this.#render(); parent.append(this.#toolbar); style.insetInlineEnd = `${100 * x}%`; style.top = `calc(${100 * y}% + var(--editor-toolbar-vert-offset))`; } hide() { this.#toolbar.remove(); } #addHighlightButton() { const button = document.createElement("button"); button.className = "highlightButton"; button.tabIndex = 0; button.setAttribute("data-l10n-id", `pdfjs-highlight-floating-button1`); const span = document.createElement("span"); button.append(span); span.className = "visuallyHidden"; span.setAttribute("data-l10n-id", "pdfjs-highlight-floating-button-label"); button.addEventListener("contextmenu", noContextMenu); button.addEventListener("click", () => { this.#uiManager.highlightSelection("floating_button"); }); this.#buttons.append(button); } } ;// CONCATENATED MODULE: ./src/display/editor/tools.js function bindEvents(obj, element, names) { for (const name of names) { element.addEventListener(name, obj[name].bind(obj)); } } function opacityToHex(opacity) { return Math.round(Math.min(255, Math.max(1, 255 * opacity))).toString(16).padStart(2, "0"); } class IdManager { #id = 0; get id() { return `${AnnotationEditorPrefix}${this.#id++}`; } } class ImageManager { #baseId = getUuid(); #id = 0; #cache = null; static get _isSVGFittingCanvas() { const svg = `data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>`; const canvas = new OffscreenCanvas(1, 3); const ctx = canvas.getContext("2d"); const image = new Image(); image.src = svg; const promise = image.decode().then(() => { ctx.drawImage(image, 0, 0, 1, 1, 0, 0, 1, 3); return new Uint32Array(ctx.getImageData(0, 0, 1, 1).data.buffer)[0] === 0; }); return shadow(this, "_isSVGFittingCanvas", promise); } async #get(key, rawData) { this.#cache ||= new Map(); let data = this.#cache.get(key); if (data === null) { return null; } if (data?.bitmap) { data.refCounter += 1; return data; } try { data ||= { bitmap: null, id: `image_${this.#baseId}_${this.#id++}`, refCounter: 0, isSvg: false }; let image; if (typeof rawData === "string") { data.url = rawData; image = await fetchData(rawData, "blob"); } else { image = data.file = rawData; } if (image.type === "image/svg+xml") { const mustRemoveAspectRatioPromise = ImageManager._isSVGFittingCanvas; const fileReader = new FileReader(); const imageElement = new Image(); const imagePromise = new Promise((resolve, reject) => { imageElement.onload = () => { data.bitmap = imageElement; data.isSvg = true; resolve(); }; fileReader.onload = async () => { const url = data.svgUrl = fileReader.result; imageElement.src = (await mustRemoveAspectRatioPromise) ? `${url}#svgView(preserveAspectRatio(none))` : url; }; imageElement.onerror = fileReader.onerror = reject; }); fileReader.readAsDataURL(image); await imagePromise; } else { data.bitmap = await createImageBitmap(image); } data.refCounter = 1; } catch (e) { console.error(e); data = null; } this.#cache.set(key, data); if (data) { this.#cache.set(data.id, data); } return data; } async getFromFile(file) { const { lastModified, name, size, type } = file; return this.#get(`${lastModified}_${name}_${size}_${type}`, file); } async getFromUrl(url) { return this.#get(url, url); } async getFromId(id) { this.#cache ||= new Map(); const data = this.#cache.get(id); if (!data) { return null; } if (data.bitmap) { data.refCounter += 1; return data; } if (data.file) { return this.getFromFile(data.file); } return this.getFromUrl(data.url); } getSvgUrl(id) { const data = this.#cache.get(id); if (!data?.isSvg) { return null; } return data.svgUrl; } deleteId(id) { this.#cache ||= new Map(); const data = this.#cache.get(id); if (!data) { return; } data.refCounter -= 1; if (data.refCounter !== 0) { return; } data.bitmap = null; } isValidId(id) { return id.startsWith(`image_${this.#baseId}_`); } } class CommandManager { #commands = []; #locked = false; #maxSize; #position = -1; constructor(maxSize = 128) { this.#maxSize = maxSize; } add({ cmd, undo, post, mustExec, type = NaN, overwriteIfSameType = false, keepUndo = false }) { if (mustExec) { cmd(); } if (this.#locked) { return; } const save = { cmd, undo, post, type }; if (this.#position === -1) { if (this.#commands.length > 0) { this.#commands.length = 0; } this.#position = 0; this.#commands.push(save); return; } if (overwriteIfSameType && this.#commands[this.#position].type === type) { if (keepUndo) { save.undo = this.#commands[this.#position].undo; } this.#commands[this.#position] = save; return; } const next = this.#position + 1; if (next === this.#maxSize) { this.#commands.splice(0, 1); } else { this.#position = next; if (next < this.#commands.length) { this.#commands.splice(next); } } this.#commands.push(save); } undo() { if (this.#position === -1) { return; } this.#locked = true; const { undo, post } = this.#commands[this.#position]; undo(); post?.(); this.#locked = false; this.#position -= 1; } redo() { if (this.#position < this.#commands.length - 1) { this.#position += 1; this.#locked = true; const { cmd, post } = this.#commands[this.#position]; cmd(); post?.(); this.#locked = false; } } hasSomethingToUndo() { return this.#position !== -1; } hasSomethingToRedo() { return this.#position < this.#commands.length - 1; } destroy() { this.#commands = null; } } class KeyboardManager { constructor(callbacks) { this.buffer = []; this.callbacks = new Map(); this.allKeys = new Set(); const { isMac } = util_FeatureTest.platform; for (const [keys, callback, options = {}] of callbacks) { for (const key of keys) { const isMacKey = key.startsWith("mac+"); if (isMac && isMacKey) { this.callbacks.set(key.slice(4), { callback, options }); this.allKeys.add(key.split("+").at(-1)); } else if (!isMac && !isMacKey) { this.callbacks.set(key, { callback, options }); this.allKeys.add(key.split("+").at(-1)); } } } } #serialize(event) { if (event.altKey) { this.buffer.push("alt"); } if (event.ctrlKey) { this.buffer.push("ctrl"); } if (event.metaKey) { this.buffer.push("meta"); } if (event.shiftKey) { this.buffer.push("shift"); } this.buffer.push(event.key); const str = this.buffer.join("+"); this.buffer.length = 0; return str; } exec(self, event) { if (!this.allKeys.has(event.key)) { return; } const info = this.callbacks.get(this.#serialize(event)); if (!info) { return; } const { callback, options: { bubbles = false, args = [], checker = null } } = info; if (checker && !checker(self, event)) { return; } callback.bind(self, ...args, event)(); if (!bubbles) { event.stopPropagation(); event.preventDefault(); } } } class ColorManager { static _colorsMapping = new Map([["CanvasText", [0, 0, 0]], ["Canvas", [255, 255, 255]]]); get _colors() { const colors = new Map([["CanvasText", null], ["Canvas", null]]); getColorValues(colors); return shadow(this, "_colors", colors); } convert(color) { const rgb = getRGB(color); if (!window.matchMedia("(forced-colors: active)").matches) { return rgb; } for (const [name, RGB] of this._colors) { if (RGB.every((x, i) => x === rgb[i])) { return ColorManager._colorsMapping.get(name); } } return rgb; } getHexCode(name) { const rgb = this._colors.get(name); if (!rgb) { return name; } return Util.makeHexColor(...rgb); } } class AnnotationEditorUIManager { #activeEditor = null; #allEditors = new Map(); #allLayers = new Map(); #altTextManager = null; #annotationStorage = null; #changedExistingAnnotations = null; #commandManager = new CommandManager(); #currentPageIndex = 0; #deletedAnnotationsElementIds = new Set(); #draggingEditors = null; #editorTypes = null; #editorsToRescale = new Set(); #enableHighlightFloatingButton = false; #filterFactory = null; #focusMainContainerTimeoutId = null; #highlightColors = null; #highlightWhenShiftUp = false; #highlightToolbar = null; #idManager = new IdManager(); #isEnabled = false; #isWaiting = false; #lastActiveElement = null; #mainHighlightColorPicker = null; #mlManager = null; #mode = AnnotationEditorType.NONE; #selectedEditors = new Set(); #selectedTextNode = null; #pageColors = null; #showAllStates = null; #boundBlur = this.blur.bind(this); #boundFocus = this.focus.bind(this); #boundCopy = this.copy.bind(this); #boundCut = this.cut.bind(this); #boundPaste = this.paste.bind(this); #boundKeydown = this.keydown.bind(this); #boundKeyup = this.keyup.bind(this); #boundOnEditingAction = this.onEditingAction.bind(this); #boundOnPageChanging = this.onPageChanging.bind(this); #boundOnScaleChanging = this.onScaleChanging.bind(this); #boundSelectionChange = this.#selectionChange.bind(this); #boundOnRotationChanging = this.onRotationChanging.bind(this); #previousStates = { isEditing: false, isEmpty: true, hasSomethingToUndo: false, hasSomethingToRedo: false, hasSelectedEditor: false, hasSelectedText: false }; #translation = [0, 0]; #translationTimeoutId = null; #container = null; #viewer = null; static TRANSLATE_SMALL = 1; static TRANSLATE_BIG = 10; static get _keyboardManager() { const proto = AnnotationEditorUIManager.prototype; const arrowChecker = self => self.#container.contains(document.activeElement) && document.activeElement.tagName !== "BUTTON" && self.hasSomethingToControl(); const textInputChecker = (_self, { target: el }) => { if (el instanceof HTMLInputElement) { const { type } = el; return type !== "text" && type !== "number"; } return true; }; const small = this.TRANSLATE_SMALL; const big = this.TRANSLATE_BIG; return shadow(this, "_keyboardManager", new KeyboardManager([[["ctrl+a", "mac+meta+a"], proto.selectAll, { checker: textInputChecker }], [["ctrl+z", "mac+meta+z"], proto.undo, { checker: textInputChecker }], [["ctrl+y", "ctrl+shift+z", "mac+meta+shift+z", "ctrl+shift+Z", "mac+meta+shift+Z"], proto.redo, { checker: textInputChecker }], [["Backspace", "alt+Backspace", "ctrl+Backspace", "shift+Backspace", "mac+Backspace", "mac+alt+Backspace", "mac+ctrl+Backspace", "Delete", "ctrl+Delete", "shift+Delete", "mac+Delete"], proto.delete, { checker: textInputChecker }], [["Enter", "mac+Enter"], proto.addNewEditorFromKeyboard, { checker: (self, { target: el }) => !(el instanceof HTMLButtonElement) && self.#container.contains(el) && !self.isEnterHandled }], [[" ", "mac+ "], proto.addNewEditorFromKeyboard, { checker: (self, { target: el }) => !(el instanceof HTMLButtonElement) && self.#container.contains(document.activeElement) }], [["Escape", "mac+Escape"], proto.unselectAll], [["ArrowLeft", "mac+ArrowLeft"], proto.translateSelectedEditors, { args: [-small, 0], checker: arrowChecker }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], proto.translateSelectedEditors, { args: [-big, 0], checker: arrowChecker }], [["ArrowRight", "mac+ArrowRight"], proto.translateSelectedEditors, { args: [small, 0], checker: arrowChecker }], [["ctrl+ArrowRight", "mac+shift+ArrowRight"], proto.translateSelectedEditors, { args: [big, 0], checker: arrowChecker }], [["ArrowUp", "mac+ArrowUp"], proto.translateSelectedEditors, { args: [0, -small], checker: arrowChecker }], [["ctrl+ArrowUp", "mac+shift+ArrowUp"], proto.translateSelectedEditors, { args: [0, -big], checker: arrowChecker }], [["ArrowDown", "mac+ArrowDown"], proto.translateSelectedEditors, { args: [0, small], checker: arrowChecker }], [["ctrl+ArrowDown", "mac+shift+ArrowDown"], proto.translateSelectedEditors, { args: [0, big], checker: arrowChecker }]])); } constructor(container, viewer, altTextManager, eventBus, pdfDocument, pageColors, highlightColors, enableHighlightFloatingButton, mlManager) { this.#container = container; this.#viewer = viewer; this.#altTextManager = altTextManager; this._eventBus = eventBus; this._eventBus._on("editingaction", this.#boundOnEditingAction); this._eventBus._on("pagechanging", this.#boundOnPageChanging); this._eventBus._on("scalechanging", this.#boundOnScaleChanging); this._eventBus._on("rotationchanging", this.#boundOnRotationChanging); this.#addSelectionListener(); this.#addKeyboardManager(); this.#annotationStorage = pdfDocument.annotationStorage; this.#filterFactory = pdfDocument.filterFactory; this.#pageColors = pageColors; this.#highlightColors = highlightColors || null; this.#enableHighlightFloatingButton = enableHighlightFloatingButton; this.#mlManager = mlManager || null; this.viewParameters = { realScale: PixelsPerInch.PDF_TO_CSS_UNITS, rotation: 0 }; this.isShiftKeyDown = false; } destroy() { this.#removeKeyboardManager(); this.#removeFocusManager(); this._eventBus._off("editingaction", this.#boundOnEditingAction); this._eventBus._off("pagechanging", this.#boundOnPageChanging); this._eventBus._off("scalechanging", this.#boundOnScaleChanging); this._eventBus._off("rotationchanging", this.#boundOnRotationChanging); for (const layer of this.#allLayers.values()) { layer.destroy(); } this.#allLayers.clear(); this.#allEditors.clear(); this.#editorsToRescale.clear(); this.#activeEditor = null; this.#selectedEditors.clear(); this.#commandManager.destroy(); this.#altTextManager?.destroy(); this.#highlightToolbar?.hide(); this.#highlightToolbar = null; if (this.#focusMainContainerTimeoutId) { clearTimeout(this.#focusMainContainerTimeoutId); this.#focusMainContainerTimeoutId = null; } if (this.#translationTimeoutId) { clearTimeout(this.#translationTimeoutId); this.#translationTimeoutId = null; } this.#removeSelectionListener(); } async mlGuess(data) { return this.#mlManager?.guess(data) || null; } get hasMLManager() { return !!this.#mlManager; } get hcmFilter() { return shadow(this, "hcmFilter", this.#pageColors ? this.#filterFactory.addHCMFilter(this.#pageColors.foreground, this.#pageColors.background) : "none"); } get direction() { return shadow(this, "direction", getComputedStyle(this.#container).direction); } get highlightColors() { return shadow(this, "highlightColors", this.#highlightColors ? new Map(this.#highlightColors.split(",").map(pair => pair.split("=").map(x => x.trim()))) : null); } get highlightColorNames() { return shadow(this, "highlightColorNames", this.highlightColors ? new Map(Array.from(this.highlightColors, e => e.reverse())) : null); } setMainHighlightColorPicker(colorPicker) { this.#mainHighlightColorPicker = colorPicker; } editAltText(editor) { this.#altTextManager?.editAltText(this, editor); } onPageChanging({ pageNumber }) { this.#currentPageIndex = pageNumber - 1; } focusMainContainer() { this.#container.focus(); } findParent(x, y) { for (const layer of this.#allLayers.values()) { const { x: layerX, y: layerY, width, height } = layer.div.getBoundingClientRect(); if (x >= layerX && x <= layerX + width && y >= layerY && y <= layerY + height) { return layer; } } return null; } disableUserSelect(value = false) { this.#viewer.classList.toggle("noUserSelect", value); } addShouldRescale(editor) { this.#editorsToRescale.add(editor); } removeShouldRescale(editor) { this.#editorsToRescale.delete(editor); } onScaleChanging({ scale }) { this.commitOrRemove(); this.viewParameters.realScale = scale * PixelsPerInch.PDF_TO_CSS_UNITS; for (const editor of this.#editorsToRescale) { editor.onScaleChanging(); } } onRotationChanging({ pagesRotation }) { this.commitOrRemove(); this.viewParameters.rotation = pagesRotation; } #getAnchorElementForSelection({ anchorNode }) { return anchorNode.nodeType === Node.TEXT_NODE ? anchorNode.parentElement : anchorNode; } highlightSelection(methodOfCreation = "") { const selection = document.getSelection(); if (!selection || selection.isCollapsed) { return; } const { anchorNode, anchorOffset, focusNode, focusOffset } = selection; const text = selection.toString(); const anchorElement = this.#getAnchorElementForSelection(selection); const textLayer = anchorElement.closest(".textLayer"); const boxes = this.getSelectionBoxes(textLayer); if (!boxes) { return; } selection.empty(); if (this.#mode === AnnotationEditorType.NONE) { this._eventBus.dispatch("showannotationeditorui", { source: this, mode: AnnotationEditorType.HIGHLIGHT }); this.showAllEditors("highlight", true, true); } for (const layer of this.#allLayers.values()) { if (layer.hasTextLayer(textLayer)) { layer.createAndAddNewEditor({ x: 0, y: 0 }, false, { methodOfCreation, boxes, anchorNode, anchorOffset, focusNode, focusOffset, text }); break; } } } #displayHighlightToolbar() { const selection = document.getSelection(); if (!selection || selection.isCollapsed) { return; } const anchorElement = this.#getAnchorElementForSelection(selection); const textLayer = anchorElement.closest(".textLayer"); const boxes = this.getSelectionBoxes(textLayer); if (!boxes) { return; } this.#highlightToolbar ||= new HighlightToolbar(this); this.#highlightToolbar.show(textLayer, boxes, this.direction === "ltr"); } addToAnnotationStorage(editor) { if (!editor.isEmpty() && this.#annotationStorage && !this.#annotationStorage.has(editor.id)) { this.#annotationStorage.setValue(editor.id, editor); } } #selectionChange() { const selection = document.getSelection(); if (!selection || selection.isCollapsed) { if (this.#selectedTextNode) { this.#highlightToolbar?.hide(); this.#selectedTextNode = null; this.#dispatchUpdateStates({ hasSelectedText: false }); } return; } const { anchorNode } = selection; if (anchorNode === this.#selectedTextNode) { return; } const anchorElement = this.#getAnchorElementForSelection(selection); const textLayer = anchorElement.closest(".textLayer"); if (!textLayer) { if (this.#selectedTextNode) { this.#highlightToolbar?.hide(); this.#selectedTextNode = null; this.#dispatchUpdateStates({ hasSelectedText: false }); } return; } this.#highlightToolbar?.hide(); this.#selectedTextNode = anchorNode; this.#dispatchUpdateStates({ hasSelectedText: true }); if (this.#mode !== AnnotationEditorType.HIGHLIGHT && this.#mode !== AnnotationEditorType.NONE) { return; } if (this.#mode === AnnotationEditorType.HIGHLIGHT) { this.showAllEditors("highlight", true, true); } this.#highlightWhenShiftUp = this.isShiftKeyDown; if (!this.isShiftKeyDown) { const pointerup = e => { if (e.type === "pointerup" && e.button !== 0) { return; } window.removeEventListener("pointerup", pointerup); window.removeEventListener("blur", pointerup); if (e.type === "pointerup") { this.#onSelectEnd("main_toolbar"); } }; window.addEventListener("pointerup", pointerup); window.addEventListener("blur", pointerup); } } #onSelectEnd(methodOfCreation = "") { if (this.#mode === AnnotationEditorType.HIGHLIGHT) { this.highlightSelection(methodOfCreation); } else if (this.#enableHighlightFloatingButton) { this.#displayHighlightToolbar(); } } #addSelectionListener() { document.addEventListener("selectionchange", this.#boundSelectionChange); } #removeSelectionListener() { document.removeEventListener("selectionchange", this.#boundSelectionChange); } #addFocusManager() { window.addEventListener("focus", this.#boundFocus); window.addEventListener("blur", this.#boundBlur); } #removeFocusManager() { window.removeEventListener("focus", this.#boundFocus); window.removeEventListener("blur", this.#boundBlur); } blur() { this.isShiftKeyDown = false; if (this.#highlightWhenShiftUp) { this.#highlightWhenShiftUp = false; this.#onSelectEnd("main_toolbar"); } if (!this.hasSelection) { return; } const { activeElement } = document; for (const editor of this.#selectedEditors) { if (editor.div.contains(activeElement)) { this.#lastActiveElement = [editor, activeElement]; editor._focusEventsAllowed = false; break; } } } focus() { if (!this.#lastActiveElement) { return; } const [lastEditor, lastActiveElement] = this.#lastActiveElement; this.#lastActiveElement = null; lastActiveElement.addEventListener("focusin", () => { lastEditor._focusEventsAllowed = true; }, { once: true }); lastActiveElement.focus(); } #addKeyboardManager() { window.addEventListener("keydown", this.#boundKeydown); window.addEventListener("keyup", this.#boundKeyup); } #removeKeyboardManager() { window.removeEventListener("keydown", this.#boundKeydown); window.removeEventListener("keyup", this.#boundKeyup); } #addCopyPasteListeners() { document.addEventListener("copy", this.#boundCopy); document.addEventListener("cut", this.#boundCut); document.addEventListener("paste", this.#boundPaste); } #removeCopyPasteListeners() { document.removeEventListener("copy", this.#boundCopy); document.removeEventListener("cut", this.#boundCut); document.removeEventListener("paste", this.#boundPaste); } addEditListeners() { this.#addKeyboardManager(); this.#addCopyPasteListeners(); } removeEditListeners() { this.#removeKeyboardManager(); this.#removeCopyPasteListeners(); } copy(event) { event.preventDefault(); this.#activeEditor?.commitOrRemove(); if (!this.hasSelection) { return; } const editors = []; for (const editor of this.#selectedEditors) { const serialized = editor.serialize(true); if (serialized) { editors.push(serialized); } } if (editors.length === 0) { return; } event.clipboardData.setData("application/pdfjs", JSON.stringify(editors)); } cut(event) { this.copy(event); this.delete(); } paste(event) { event.preventDefault(); const { clipboardData } = event; for (const item of clipboardData.items) { for (const editorType of this.#editorTypes) { if (editorType.isHandlingMimeForPasting(item.type)) { editorType.paste(item, this.currentLayer); return; } } } let data = clipboardData.getData("application/pdfjs"); if (!data) { return; } try { data = JSON.parse(data); } catch (ex) { warn(`paste: "${ex.message}".`); return; } if (!Array.isArray(data)) { return; } this.unselectAll(); const layer = this.currentLayer; try { const newEditors = []; for (const editor of data) { const deserializedEditor = layer.deserialize(editor); if (!deserializedEditor) { return; } newEditors.push(deserializedEditor); } const cmd = () => { for (const editor of newEditors) { this.#addEditorToLayer(editor); } this.#selectEditors(newEditors); }; const undo = () => { for (const editor of newEditors) { editor.remove(); } }; this.addCommands({ cmd, undo, mustExec: true }); } catch (ex) { warn(`paste: "${ex.message}".`); } } keydown(event) { if (!this.isShiftKeyDown && event.key === "Shift") { this.isShiftKeyDown = true; } if (this.#mode !== AnnotationEditorType.NONE && !this.isEditorHandlingKeyboard) { AnnotationEditorUIManager._keyboardManager.exec(this, event); } } keyup(event) { if (this.isShiftKeyDown && event.key === "Shift") { this.isShiftKeyDown = false; if (this.#highlightWhenShiftUp) { this.#highlightWhenShiftUp = false; this.#onSelectEnd("main_toolbar"); } } } onEditingAction({ name }) { switch (name) { case "undo": case "redo": case "delete": case "selectAll": this[name](); break; case "highlightSelection": this.highlightSelection("context_menu"); break; } } #dispatchUpdateStates(details) { const hasChanged = Object.entries(details).some(([key, value]) => this.#previousStates[key] !== value); if (hasChanged) { this._eventBus.dispatch("annotationeditorstateschanged", { source: this, details: Object.assign(this.#previousStates, details) }); if (this.#mode === AnnotationEditorType.HIGHLIGHT && details.hasSelectedEditor === false) { this.#dispatchUpdateUI([[AnnotationEditorParamsType.HIGHLIGHT_FREE, true]]); } } } #dispatchUpdateUI(details) { this._eventBus.dispatch("annotationeditorparamschanged", { source: this, details }); } setEditingState(isEditing) { if (isEditing) { this.#addFocusManager(); this.#addCopyPasteListeners(); this.#dispatchUpdateStates({ isEditing: this.#mode !== AnnotationEditorType.NONE, isEmpty: this.#isEmpty(), hasSomethingToUndo: this.#commandManager.hasSomethingToUndo(), hasSomethingToRedo: this.#commandManager.hasSomethingToRedo(), hasSelectedEditor: false }); } else { this.#removeFocusManager(); this.#removeCopyPasteListeners(); this.#dispatchUpdateStates({ isEditing: false }); this.disableUserSelect(false); } } registerEditorTypes(types) { if (this.#editorTypes) { return; } this.#editorTypes = types; for (const editorType of this.#editorTypes) { this.#dispatchUpdateUI(editorType.defaultPropertiesToUpdate); } } getId() { return this.#idManager.id; } get currentLayer() { return this.#allLayers.get(this.#currentPageIndex); } getLayer(pageIndex) { return this.#allLayers.get(pageIndex); } get currentPageIndex() { return this.#currentPageIndex; } addLayer(layer) { this.#allLayers.set(layer.pageIndex, layer); if (this.#isEnabled) { layer.enable(); } else { layer.disable(); } } removeLayer(layer) { this.#allLayers.delete(layer.pageIndex); } updateMode(mode, editId = null, isFromKeyboard = false) { if (this.#mode === mode) { return; } this.#mode = mode; if (mode === AnnotationEditorType.NONE) { this.setEditingState(false); this.#disableAll(); return; } this.setEditingState(true); this.#enableAll(); this.unselectAll(); for (const layer of this.#allLayers.values()) { layer.updateMode(mode); } if (!editId && isFromKeyboard) { this.addNewEditorFromKeyboard(); return; } if (!editId) { return; } for (const editor of this.#allEditors.values()) { if (editor.annotationElementId === editId) { this.setSelected(editor); editor.enterInEditMode(); break; } } } addNewEditorFromKeyboard() { if (this.currentLayer.canCreateNewEmptyEditor()) { this.currentLayer.addNewEditor(); } } updateToolbar(mode) { if (mode === this.#mode) { return; } this._eventBus.dispatch("switchannotationeditormode", { source: this, mode }); } updateParams(type, value) { if (!this.#editorTypes) { return; } switch (type) { case AnnotationEditorParamsType.CREATE: this.currentLayer.addNewEditor(); return; case AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR: this.#mainHighlightColorPicker?.updateColor(value); break; case AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL: this._eventBus.dispatch("reporttelemetry", { source: this, details: { type: "editing", data: { type: "highlight", action: "toggle_visibility" } } }); (this.#showAllStates ||= new Map()).set(type, value); this.showAllEditors("highlight", value); break; } for (const editor of this.#selectedEditors) { editor.updateParams(type, value); } for (const editorType of this.#editorTypes) { editorType.updateDefaultParams(type, value); } } showAllEditors(type, visible, updateButton = false) { for (const editor of this.#allEditors.values()) { if (editor.editorType === type) { editor.show(visible); } } const state = this.#showAllStates?.get(AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL) ?? true; if (state !== visible) { this.#dispatchUpdateUI([[AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL, visible]]); } } enableWaiting(mustWait = false) { if (this.#isWaiting === mustWait) { return; } this.#isWaiting = mustWait; for (const layer of this.#allLayers.values()) { if (mustWait) { layer.disableClick(); } else { layer.enableClick(); } layer.div.classList.toggle("waiting", mustWait); } } #enableAll() { if (!this.#isEnabled) { this.#isEnabled = true; for (const layer of this.#allLayers.values()) { layer.enable(); } for (const editor of this.#allEditors.values()) { editor.enable(); } } } #disableAll() { this.unselectAll(); if (this.#isEnabled) { this.#isEnabled = false; for (const layer of this.#allLayers.values()) { layer.disable(); } for (const editor of this.#allEditors.values()) { editor.disable(); } } } getEditors(pageIndex) { const editors = []; for (const editor of this.#allEditors.values()) { if (editor.pageIndex === pageIndex) { editors.push(editor); } } return editors; } getEditor(id) { return this.#allEditors.get(id); } addEditor(editor) { this.#allEditors.set(editor.id, editor); } removeEditor(editor) { if (editor.div.contains(document.activeElement)) { if (this.#focusMainContainerTimeoutId) { clearTimeout(this.#focusMainContainerTimeoutId); } this.#focusMainContainerTimeoutId = setTimeout(() => { this.focusMainContainer(); this.#focusMainContainerTimeoutId = null; }, 0); } this.#allEditors.delete(editor.id); this.unselect(editor); if (!editor.annotationElementId || !this.#deletedAnnotationsElementIds.has(editor.annotationElementId)) { this.#annotationStorage?.remove(editor.id); } } addDeletedAnnotationElement(editor) { this.#deletedAnnotationsElementIds.add(editor.annotationElementId); this.addChangedExistingAnnotation(editor); editor.deleted = true; } isDeletedAnnotationElement(annotationElementId) { return this.#deletedAnnotationsElementIds.has(annotationElementId); } removeDeletedAnnotationElement(editor) { this.#deletedAnnotationsElementIds.delete(editor.annotationElementId); this.removeChangedExistingAnnotation(editor); editor.deleted = false; } #addEditorToLayer(editor) { const layer = this.#allLayers.get(editor.pageIndex); if (layer) { layer.addOrRebuild(editor); } else { this.addEditor(editor); this.addToAnnotationStorage(editor); } } setActiveEditor(editor) { if (this.#activeEditor === editor) { return; } this.#activeEditor = editor; if (editor) { this.#dispatchUpdateUI(editor.propertiesToUpdate); } } get #lastSelectedEditor() { let ed = null; for (ed of this.#selectedEditors) {} return ed; } updateUI(editor) { if (this.#lastSelectedEditor === editor) { this.#dispatchUpdateUI(editor.propertiesToUpdate); } } toggleSelected(editor) { if (this.#selectedEditors.has(editor)) { this.#selectedEditors.delete(editor); editor.unselect(); this.#dispatchUpdateStates({ hasSelectedEditor: this.hasSelection }); return; } this.#selectedEditors.add(editor); editor.select(); this.#dispatchUpdateUI(editor.propertiesToUpdate); this.#dispatchUpdateStates({ hasSelectedEditor: true }); } setSelected(editor) { for (const ed of this.#selectedEditors) { if (ed !== editor) { ed.unselect(); } } this.#selectedEditors.clear(); this.#selectedEditors.add(editor); editor.select(); this.#dispatchUpdateUI(editor.propertiesToUpdate); this.#dispatchUpdateStates({ hasSelectedEditor: true }); } isSelected(editor) { return this.#selectedEditors.has(editor); } get firstSelectedEditor() { return this.#selectedEditors.values().next().value; } unselect(editor) { editor.unselect(); this.#selectedEditors.delete(editor); this.#dispatchUpdateStates({ hasSelectedEditor: this.hasSelection }); } get hasSelection() { return this.#selectedEditors.size !== 0; } get isEnterHandled() { return this.#selectedEditors.size === 1 && this.firstSelectedEditor.isEnterHandled; } undo() { this.#commandManager.undo(); this.#dispatchUpdateStates({ hasSomethingToUndo: this.#commandManager.hasSomethingToUndo(), hasSomethingToRedo: true, isEmpty: this.#isEmpty() }); } redo() { this.#commandManager.redo(); this.#dispatchUpdateStates({ hasSomethingToUndo: true, hasSomethingToRedo: this.#commandManager.hasSomethingToRedo(), isEmpty: this.#isEmpty() }); } addCommands(params) { this.#commandManager.add(params); this.#dispatchUpdateStates({ hasSomethingToUndo: true, hasSomethingToRedo: false, isEmpty: this.#isEmpty() }); } #isEmpty() { if (this.#allEditors.size === 0) { return true; } if (this.#allEditors.size === 1) { for (const editor of this.#allEditors.values()) { return editor.isEmpty(); } } return false; } delete() { this.commitOrRemove(); if (!this.hasSelection) { return; } const editors = [...this.#selectedEditors]; const cmd = () => { for (const editor of editors) { editor.remove(); } }; const undo = () => { for (const editor of editors) { this.#addEditorToLayer(editor); } }; this.addCommands({ cmd, undo, mustExec: true }); } commitOrRemove() { this.#activeEditor?.commitOrRemove(); } hasSomethingToControl() { return this.#activeEditor || this.hasSelection; } #selectEditors(editors) { for (const editor of this.#selectedEditors) { editor.unselect(); } this.#selectedEditors.clear(); for (const editor of editors) { if (editor.isEmpty()) { continue; } this.#selectedEditors.add(editor); editor.select(); } this.#dispatchUpdateStates({ hasSelectedEditor: this.hasSelection }); } selectAll() { for (const editor of this.#selectedEditors) { editor.commit(); } this.#selectEditors(this.#allEditors.values()); } unselectAll() { if (this.#activeEditor) { this.#activeEditor.commitOrRemove(); if (this.#mode !== AnnotationEditorType.NONE) { return; } } if (!this.hasSelection) { return; } for (const editor of this.#selectedEditors) { editor.unselect(); } this.#selectedEditors.clear(); this.#dispatchUpdateStates({ hasSelectedEditor: false }); } translateSelectedEditors(x, y, noCommit = false) { if (!noCommit) { this.commitOrRemove(); } if (!this.hasSelection) { return; } this.#translation[0] += x; this.#translation[1] += y; const [totalX, totalY] = this.#translation; const editors = [...this.#selectedEditors]; const TIME_TO_WAIT = 1000; if (this.#translationTimeoutId) { clearTimeout(this.#translationTimeoutId); } this.#translationTimeoutId = setTimeout(() => { this.#translationTimeoutId = null; this.#translation[0] = this.#translation[1] = 0; this.addCommands({ cmd: () => { for (const editor of editors) { if (this.#allEditors.has(editor.id)) { editor.translateInPage(totalX, totalY); } } }, undo: () => { for (const editor of editors) { if (this.#allEditors.has(editor.id)) { editor.translateInPage(-totalX, -totalY); } } }, mustExec: false }); }, TIME_TO_WAIT); for (const editor of editors) { editor.translateInPage(x, y); } } setUpDragSession() { if (!this.hasSelection) { return; } this.disableUserSelect(true); this.#draggingEditors = new Map(); for (const editor of this.#selectedEditors) { this.#draggingEditors.set(editor, { savedX: editor.x, savedY: editor.y, savedPageIndex: editor.pageIndex, newX: 0, newY: 0, newPageIndex: -1 }); } } endDragSession() { if (!this.#draggingEditors) { return false; } this.disableUserSelect(false); const map = this.#draggingEditors; this.#draggingEditors = null; let mustBeAddedInUndoStack = false; for (const [{ x, y, pageIndex }, value] of map) { value.newX = x; value.newY = y; value.newPageIndex = pageIndex; mustBeAddedInUndoStack ||= x !== value.savedX || y !== value.savedY || pageIndex !== value.savedPageIndex; } if (!mustBeAddedInUndoStack) { return false; } const move = (editor, x, y, pageIndex) => { if (this.#allEditors.has(editor.id)) { const parent = this.#allLayers.get(pageIndex); if (parent) { editor._setParentAndPosition(parent, x, y); } else { editor.pageIndex = pageIndex; editor.x = x; editor.y = y; } } }; this.addCommands({ cmd: () => { for (const [editor, { newX, newY, newPageIndex }] of map) { move(editor, newX, newY, newPageIndex); } }, undo: () => { for (const [editor, { savedX, savedY, savedPageIndex }] of map) { move(editor, savedX, savedY, savedPageIndex); } }, mustExec: true }); return true; } dragSelectedEditors(tx, ty) { if (!this.#draggingEditors) { return; } for (const editor of this.#draggingEditors.keys()) { editor.drag(tx, ty); } } rebuild(editor) { if (editor.parent === null) { const parent = this.getLayer(editor.pageIndex); if (parent) { parent.changeParent(editor); parent.addOrRebuild(editor); } else { this.addEditor(editor); this.addToAnnotationStorage(editor); editor.rebuild(); } } else { editor.parent.addOrRebuild(editor); } } get isEditorHandlingKeyboard() { return this.getActive()?.shouldGetKeyboardEvents() || this.#selectedEditors.size === 1 && this.firstSelectedEditor.shouldGetKeyboardEvents(); } isActive(editor) { return this.#activeEditor === editor; } getActive() { return this.#activeEditor; } getMode() { return this.#mode; } get imageManager() { return shadow(this, "imageManager", new ImageManager()); } getSelectionBoxes(textLayer) { if (!textLayer) { return null; } const selection = document.getSelection(); for (let i = 0, ii = selection.rangeCount; i < ii; i++) { if (!textLayer.contains(selection.getRangeAt(i).commonAncestorContainer)) { return null; } } const { x: layerX, y: layerY, width: parentWidth, height: parentHeight } = textLayer.getBoundingClientRect(); let rotator; switch (textLayer.getAttribute("data-main-rotation")) { case "90": rotator = (x, y, w, h) => ({ x: (y - layerY) / parentHeight, y: 1 - (x + w - layerX) / parentWidth, width: h / parentHeight, height: w / parentWidth }); break; case "180": rotator = (x, y, w, h) => ({ x: 1 - (x + w - layerX) / parentWidth, y: 1 - (y + h - layerY) / parentHeight, width: w / parentWidth, height: h / parentHeight }); break; case "270": rotator = (x, y, w, h) => ({ x: 1 - (y + h - layerY) / parentHeight, y: (x - layerX) / parentWidth, width: h / parentHeight, height: w / parentWidth }); break; default: rotator = (x, y, w, h) => ({ x: (x - layerX) / parentWidth, y: (y - layerY) / parentHeight, width: w / parentWidth, height: h / parentHeight }); break; } const boxes = []; for (let i = 0, ii = selection.rangeCount; i < ii; i++) { const range = selection.getRangeAt(i); if (range.collapsed) { continue; } for (const { x, y, width, height } of range.getClientRects()) { if (width === 0 || height === 0) { continue; } boxes.push(rotator(x, y, width, height)); } } return boxes.length === 0 ? null : boxes; } addChangedExistingAnnotation({ annotationElementId, id }) { (this.#changedExistingAnnotations ||= new Map()).set(annotationElementId, id); } removeChangedExistingAnnotation({ annotationElementId }) { this.#changedExistingAnnotations?.delete(annotationElementId); } renderAnnotationElement(annotation) { const editorId = this.#changedExistingAnnotations?.get(annotation.data.id); if (!editorId) { return; } const editor = this.#annotationStorage.getRawValue(editorId); if (!editor) { return; } if (this.#mode === AnnotationEditorType.NONE && !editor.hasBeenModified) { return; } editor.renderAnnotationElement(annotation); } } ;// CONCATENATED MODULE: ./src/display/editor/alt_text.js class AltText { #altText = ""; #altTextDecorative = false; #altTextButton = null; #altTextTooltip = null; #altTextTooltipTimeout = null; #altTextWasFromKeyBoard = false; #editor = null; static _l10nPromise = null; constructor(editor) { this.#editor = editor; } static initialize(l10nPromise) { AltText._l10nPromise ||= l10nPromise; } async render() { const altText = this.#altTextButton = document.createElement("button"); altText.className = "altText"; const msg = await AltText._l10nPromise.get("pdfjs-editor-alt-text-button-label"); altText.textContent = msg; altText.setAttribute("aria-label", msg); altText.tabIndex = "0"; altText.addEventListener("contextmenu", noContextMenu); altText.addEventListener("pointerdown", event => event.stopPropagation()); const onClick = event => { event.preventDefault(); this.#editor._uiManager.editAltText(this.#editor); }; altText.addEventListener("click", onClick, { capture: true }); altText.addEventListener("keydown", event => { if (event.target === altText && event.key === "Enter") { this.#altTextWasFromKeyBoard = true; onClick(event); } }); await this.#setState(); return altText; } finish() { if (!this.#altTextButton) { return; } this.#altTextButton.focus({ focusVisible: this.#altTextWasFromKeyBoard }); this.#altTextWasFromKeyBoard = false; } isEmpty() { return !this.#altText && !this.#altTextDecorative; } get data() { return { altText: this.#altText, decorative: this.#altTextDecorative }; } set data({ altText, decorative }) { if (this.#altText === altText && this.#altTextDecorative === decorative) { return; } this.#altText = altText; this.#altTextDecorative = decorative; this.#setState(); } toggle(enabled = false) { if (!this.#altTextButton) { return; } if (!enabled && this.#altTextTooltipTimeout) { clearTimeout(this.#altTextTooltipTimeout); this.#altTextTooltipTimeout = null; } this.#altTextButton.disabled = !enabled; } destroy() { this.#altTextButton?.remove(); this.#altTextButton = null; this.#altTextTooltip = null; } async #setState() { const button = this.#altTextButton; if (!button) { return; } if (!this.#altText && !this.#altTextDecorative) { button.classList.remove("done"); this.#altTextTooltip?.remove(); return; } button.classList.add("done"); AltText._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then(msg => { button.setAttribute("aria-label", msg); }); let tooltip = this.#altTextTooltip; if (!tooltip) { this.#altTextTooltip = tooltip = document.createElement("span"); tooltip.className = "tooltip"; tooltip.setAttribute("role", "tooltip"); const id = tooltip.id = `alt-text-tooltip-${this.#editor.id}`; button.setAttribute("aria-describedby", id); const DELAY_TO_SHOW_TOOLTIP = 100; button.addEventListener("mouseenter", () => { this.#altTextTooltipTimeout = setTimeout(() => { this.#altTextTooltipTimeout = null; this.#altTextTooltip.classList.add("show"); this.#editor._reportTelemetry({ action: "alt_text_tooltip" }); }, DELAY_TO_SHOW_TOOLTIP); }); button.addEventListener("mouseleave", () => { if (this.#altTextTooltipTimeout) { clearTimeout(this.#altTextTooltipTimeout); this.#altTextTooltipTimeout = null; } this.#altTextTooltip?.classList.remove("show"); }); } tooltip.innerText = this.#altTextDecorative ? await AltText._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip") : this.#altText; if (!tooltip.parentNode) { button.append(tooltip); } const element = this.#editor.getImageForAltText(); element?.setAttribute("aria-describedby", tooltip.id); } } ;// CONCATENATED MODULE: ./src/display/editor/editor.js class AnnotationEditor { #allResizerDivs = null; #altText = null; #disabled = false; #keepAspectRatio = false; #resizersDiv = null; #savedDimensions = null; #boundFocusin = this.focusin.bind(this); #boundFocusout = this.focusout.bind(this); #editToolbar = null; #focusedResizerName = ""; #hasBeenClicked = false; #initialPosition = null; #isEditing = false; #isInEditMode = false; #isResizerEnabledForKeyboard = false; #moveInDOMTimeout = null; #prevDragX = 0; #prevDragY = 0; #telemetryTimeouts = null; _initialOptions = Object.create(null); _isVisible = true; _uiManager = null; _focusEventsAllowed = true; _l10nPromise = null; #isDraggable = false; #zIndex = AnnotationEditor._zIndex++; static _borderLineWidth = -1; static _colorManager = new ColorManager(); static _zIndex = 1; static _telemetryTimeout = 1000; static get _resizerKeyboardManager() { const resize = AnnotationEditor.prototype._resizeWithKeyboard; const small = AnnotationEditorUIManager.TRANSLATE_SMALL; const big = AnnotationEditorUIManager.TRANSLATE_BIG; return shadow(this, "_resizerKeyboardManager", new KeyboardManager([[["ArrowLeft", "mac+ArrowLeft"], resize, { args: [-small, 0] }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], resize, { args: [-big, 0] }], [["ArrowRight", "mac+ArrowRight"], resize, { args: [small, 0] }], [["ctrl+ArrowRight", "mac+shift+ArrowRight"], resize, { args: [big, 0] }], [["ArrowUp", "mac+ArrowUp"], resize, { args: [0, -small] }], [["ctrl+ArrowUp", "mac+shift+ArrowUp"], resize, { args: [0, -big] }], [["ArrowDown", "mac+ArrowDown"], resize, { args: [0, small] }], [["ctrl+ArrowDown", "mac+shift+ArrowDown"], resize, { args: [0, big] }], [["Escape", "mac+Escape"], AnnotationEditor.prototype._stopResizingWithKeyboard]])); } constructor(parameters) { if (this.constructor === AnnotationEditor) { unreachable("Cannot initialize AnnotationEditor."); } this.parent = parameters.parent; this.id = parameters.id; this.width = this.height = null; this.pageIndex = parameters.parent.pageIndex; this.name = parameters.name; this.div = null; this._uiManager = parameters.uiManager; this.annotationElementId = null; this._willKeepAspectRatio = false; this._initialOptions.isCentered = parameters.isCentered; this._structTreeParentId = null; const { rotation, rawDims: { pageWidth, pageHeight, pageX, pageY } } = this.parent.viewport; this.rotation = rotation; this.pageRotation = (360 + rotation - this._uiManager.viewParameters.rotation) % 360; this.pageDimensions = [pageWidth, pageHeight]; this.pageTranslation = [pageX, pageY]; const [width, height] = this.parentDimensions; this.x = parameters.x / width; this.y = parameters.y / height; this.isAttachedToDOM = false; this.deleted = false; } get editorType() { return Object.getPrototypeOf(this).constructor._type; } static get _defaultLineColor() { return shadow(this, "_defaultLineColor", this._colorManager.getHexCode("CanvasText")); } static deleteAnnotationElement(editor) { const fakeEditor = new FakeEditor({ id: editor.parent.getNextId(), parent: editor.parent, uiManager: editor._uiManager }); fakeEditor.annotationElementId = editor.annotationElementId; fakeEditor.deleted = true; fakeEditor._uiManager.addToAnnotationStorage(fakeEditor); } static initialize(l10n, _uiManager, options) { AnnotationEditor._l10nPromise ||= new Map(["pdfjs-editor-alt-text-button-label", "pdfjs-editor-alt-text-edit-button-label", "pdfjs-editor-alt-text-decorative-tooltip", "pdfjs-editor-resizer-label-topLeft", "pdfjs-editor-resizer-label-topMiddle", "pdfjs-editor-resizer-label-topRight", "pdfjs-editor-resizer-label-middleRight", "pdfjs-editor-resizer-label-bottomRight", "pdfjs-editor-resizer-label-bottomMiddle", "pdfjs-editor-resizer-label-bottomLeft", "pdfjs-editor-resizer-label-middleLeft"].map(str => [str, l10n.get(str.replaceAll(/([A-Z])/g, c => `-${c.toLowerCase()}`))])); if (options?.strings) { for (const str of options.strings) { AnnotationEditor._l10nPromise.set(str, l10n.get(str)); } } if (AnnotationEditor._borderLineWidth !== -1) { return; } const style = getComputedStyle(document.documentElement); AnnotationEditor._borderLineWidth = parseFloat(style.getPropertyValue("--outline-width")) || 0; } static updateDefaultParams(_type, _value) {} static get defaultPropertiesToUpdate() { return []; } static isHandlingMimeForPasting(mime) { return false; } static paste(item, parent) { unreachable("Not implemented"); } get propertiesToUpdate() { return []; } get _isDraggable() { return this.#isDraggable; } set _isDraggable(value) { this.#isDraggable = value; this.div?.classList.toggle("draggable", value); } get isEnterHandled() { return true; } center() { const [pageWidth, pageHeight] = this.pageDimensions; switch (this.parentRotation) { case 90: this.x -= this.height * pageHeight / (pageWidth * 2); this.y += this.width * pageWidth / (pageHeight * 2); break; case 180: this.x += this.width / 2; this.y += this.height / 2; break; case 270: this.x += this.height * pageHeight / (pageWidth * 2); this.y -= this.width * pageWidth / (pageHeight * 2); break; default: this.x -= this.width / 2; this.y -= this.height / 2; break; } this.fixAndSetPosition(); } addCommands(params) { this._uiManager.addCommands(params); } get currentLayer() { return this._uiManager.currentLayer; } setInBackground() { this.div.style.zIndex = 0; } setInForeground() { this.div.style.zIndex = this.#zIndex; } setParent(parent) { if (parent !== null) { this.pageIndex = parent.pageIndex; this.pageDimensions = parent.pageDimensions; } else { this.#stopResizing(); } this.parent = parent; } focusin(event) { if (!this._focusEventsAllowed) { return; } if (!this.#hasBeenClicked) { this.parent.setSelected(this); } else { this.#hasBeenClicked = false; } } focusout(event) { if (!this._focusEventsAllowed) { return; } if (!this.isAttachedToDOM) { return; } const target = event.relatedTarget; if (target?.closest(`#${this.id}`)) { return; } event.preventDefault(); if (!this.parent?.isMultipleSelection) { this.commitOrRemove(); } } commitOrRemove() { if (this.isEmpty()) { this.remove(); } else { this.commit(); } } commit() { this.addToAnnotationStorage(); } addToAnnotationStorage() { this._uiManager.addToAnnotationStorage(this); } setAt(x, y, tx, ty) { const [width, height] = this.parentDimensions; [tx, ty] = this.screenToPageTranslation(tx, ty); this.x = (x + tx) / width; this.y = (y + ty) / height; this.fixAndSetPosition(); } #translate([width, height], x, y) { [x, y] = this.screenToPageTranslation(x, y); this.x += x / width; this.y += y / height; this.fixAndSetPosition(); } translate(x, y) { this.#translate(this.parentDimensions, x, y); } translateInPage(x, y) { this.#initialPosition ||= [this.x, this.y]; this.#translate(this.pageDimensions, x, y); this.div.scrollIntoView({ block: "nearest" }); } drag(tx, ty) { this.#initialPosition ||= [this.x, this.y]; const [parentWidth, parentHeight] = this.parentDimensions; this.x += tx / parentWidth; this.y += ty / parentHeight; if (this.parent && (this.x < 0 || this.x > 1 || this.y < 0 || this.y > 1)) { const { x, y } = this.div.getBoundingClientRect(); if (this.parent.findNewParent(this, x, y)) { this.x -= Math.floor(this.x); this.y -= Math.floor(this.y); } } let { x, y } = this; const [bx, by] = this.getBaseTranslation(); x += bx; y += by; this.div.style.left = `${(100 * x).toFixed(2)}%`; this.div.style.top = `${(100 * y).toFixed(2)}%`; this.div.scrollIntoView({ block: "nearest" }); } get _hasBeenMoved() { return !!this.#initialPosition && (this.#initialPosition[0] !== this.x || this.#initialPosition[1] !== this.y); } getBaseTranslation() { const [parentWidth, parentHeight] = this.parentDimensions; const { _borderLineWidth } = AnnotationEditor; const x = _borderLineWidth / parentWidth; const y = _borderLineWidth / parentHeight; switch (this.rotation) { case 90: return [-x, y]; case 180: return [x, y]; case 270: return [x, -y]; default: return [-x, -y]; } } get _mustFixPosition() { return true; } fixAndSetPosition(rotation = this.rotation) { const [pageWidth, pageHeight] = this.pageDimensions; let { x, y, width, height } = this; width *= pageWidth; height *= pageHeight; x *= pageWidth; y *= pageHeight; if (this._mustFixPosition) { switch (rotation) { case 0: x = Math.max(0, Math.min(pageWidth - width, x)); y = Math.max(0, Math.min(pageHeight - height, y)); break; case 90: x = Math.max(0, Math.min(pageWidth - height, x)); y = Math.min(pageHeight, Math.max(width, y)); break; case 180: x = Math.min(pageWidth, Math.max(width, x)); y = Math.min(pageHeight, Math.max(height, y)); break; case 270: x = Math.min(pageWidth, Math.max(height, x)); y = Math.max(0, Math.min(pageHeight - width, y)); break; } } this.x = x /= pageWidth; this.y = y /= pageHeight; const [bx, by] = this.getBaseTranslation(); x += bx; y += by; const { style } = this.div; style.left = `${(100 * x).toFixed(2)}%`; style.top = `${(100 * y).toFixed(2)}%`; this.moveInDOM(); } static #rotatePoint(x, y, angle) { switch (angle) { case 90: return [y, -x]; case 180: return [-x, -y]; case 270: return [-y, x]; default: return [x, y]; } } screenToPageTranslation(x, y) { return AnnotationEditor.#rotatePoint(x, y, this.parentRotation); } pageTranslationToScreen(x, y) { return AnnotationEditor.#rotatePoint(x, y, 360 - this.parentRotation); } #getRotationMatrix(rotation) { switch (rotation) { case 90: { const [pageWidth, pageHeight] = this.pageDimensions; return [0, -pageWidth / pageHeight, pageHeight / pageWidth, 0]; } case 180: return [-1, 0, 0, -1]; case 270: { const [pageWidth, pageHeight] = this.pageDimensions; return [0, pageWidth / pageHeight, -pageHeight / pageWidth, 0]; } default: return [1, 0, 0, 1]; } } get parentScale() { return this._uiManager.viewParameters.realScale; } get parentRotation() { return (this._uiManager.viewParameters.rotation + this.pageRotation) % 360; } get parentDimensions() { const { parentScale, pageDimensions: [pageWidth, pageHeight] } = this; const scaledWidth = pageWidth * parentScale; const scaledHeight = pageHeight * parentScale; return util_FeatureTest.isCSSRoundSupported ? [Math.round(scaledWidth), Math.round(scaledHeight)] : [scaledWidth, scaledHeight]; } setDims(width, height) { const [parentWidth, parentHeight] = this.parentDimensions; this.div.style.width = `${(100 * width / parentWidth).toFixed(2)}%`; if (!this.#keepAspectRatio) { this.div.style.height = `${(100 * height / parentHeight).toFixed(2)}%`; } } fixDims() { const { style } = this.div; const { height, width } = style; const widthPercent = width.endsWith("%"); const heightPercent = !this.#keepAspectRatio && height.endsWith("%"); if (widthPercent && heightPercent) { return; } const [parentWidth, parentHeight] = this.parentDimensions; if (!widthPercent) { style.width = `${(100 * parseFloat(width) / parentWidth).toFixed(2)}%`; } if (!this.#keepAspectRatio && !heightPercent) { style.height = `${(100 * parseFloat(height) / parentHeight).toFixed(2)}%`; } } getInitialTranslation() { return [0, 0]; } #createResizers() { if (this.#resizersDiv) { return; } this.#resizersDiv = document.createElement("div"); this.#resizersDiv.classList.add("resizers"); const classes = this._willKeepAspectRatio ? ["topLeft", "topRight", "bottomRight", "bottomLeft"] : ["topLeft", "topMiddle", "topRight", "middleRight", "bottomRight", "bottomMiddle", "bottomLeft", "middleLeft"]; for (const name of classes) { const div = document.createElement("div"); this.#resizersDiv.append(div); div.classList.add("resizer", name); div.setAttribute("data-resizer-name", name); div.addEventListener("pointerdown", this.#resizerPointerdown.bind(this, name)); div.addEventListener("contextmenu", noContextMenu); div.tabIndex = -1; } this.div.prepend(this.#resizersDiv); } #resizerPointerdown(name, event) { event.preventDefault(); const { isMac } = util_FeatureTest.platform; if (event.button !== 0 || event.ctrlKey && isMac) { return; } this.#altText?.toggle(false); const boundResizerPointermove = this.#resizerPointermove.bind(this, name); const savedDraggable = this._isDraggable; this._isDraggable = false; const pointerMoveOptions = { passive: true, capture: true }; this.parent.togglePointerEvents(false); window.addEventListener("pointermove", boundResizerPointermove, pointerMoveOptions); window.addEventListener("contextmenu", noContextMenu); const savedX = this.x; const savedY = this.y; const savedWidth = this.width; const savedHeight = this.height; const savedParentCursor = this.parent.div.style.cursor; const savedCursor = this.div.style.cursor; this.div.style.cursor = this.parent.div.style.cursor = window.getComputedStyle(event.target).cursor; const pointerUpCallback = () => { this.parent.togglePointerEvents(true); this.#altText?.toggle(true); this._isDraggable = savedDraggable; window.removeEventListener("pointerup", pointerUpCallback); window.removeEventListener("blur", pointerUpCallback); window.removeEventListener("pointermove", boundResizerPointermove, pointerMoveOptions); window.removeEventListener("contextmenu", noContextMenu); this.parent.div.style.cursor = savedParentCursor; this.div.style.cursor = savedCursor; this.#addResizeToUndoStack(savedX, savedY, savedWidth, savedHeight); }; window.addEventListener("pointerup", pointerUpCallback); window.addEventListener("blur", pointerUpCallback); } #addResizeToUndoStack(savedX, savedY, savedWidth, savedHeight) { const newX = this.x; const newY = this.y; const newWidth = this.width; const newHeight = this.height; if (newX === savedX && newY === savedY && newWidth === savedWidth && newHeight === savedHeight) { return; } this.addCommands({ cmd: () => { this.width = newWidth; this.height = newHeight; this.x = newX; this.y = newY; const [parentWidth, parentHeight] = this.parentDimensions; this.setDims(parentWidth * newWidth, parentHeight * newHeight); this.fixAndSetPosition(); }, undo: () => { this.width = savedWidth; this.height = savedHeight; this.x = savedX; this.y = savedY; const [parentWidth, parentHeight] = this.parentDimensions; this.setDims(parentWidth * savedWidth, parentHeight * savedHeight); this.fixAndSetPosition(); }, mustExec: true }); } #resizerPointermove(name, event) { const [parentWidth, parentHeight] = this.parentDimensions; const savedX = this.x; const savedY = this.y; const savedWidth = this.width; const savedHeight = this.height; const minWidth = AnnotationEditor.MIN_SIZE / parentWidth; const minHeight = AnnotationEditor.MIN_SIZE / parentHeight; const round = x => Math.round(x * 10000) / 10000; const rotationMatrix = this.#getRotationMatrix(this.rotation); const transf = (x, y) => [rotationMatrix[0] * x + rotationMatrix[2] * y, rotationMatrix[1] * x + rotationMatrix[3] * y]; const invRotationMatrix = this.#getRotationMatrix(360 - this.rotation); const invTransf = (x, y) => [invRotationMatrix[0] * x + invRotationMatrix[2] * y, invRotationMatrix[1] * x + invRotationMatrix[3] * y]; let getPoint; let getOpposite; let isDiagonal = false; let isHorizontal = false; switch (name) { case "topLeft": isDiagonal = true; getPoint = (w, h) => [0, 0]; getOpposite = (w, h) => [w, h]; break; case "topMiddle": getPoint = (w, h) => [w / 2, 0]; getOpposite = (w, h) => [w / 2, h]; break; case "topRight": isDiagonal = true; getPoint = (w, h) => [w, 0]; getOpposite = (w, h) => [0, h]; break; case "middleRight": isHorizontal = true; getPoint = (w, h) => [w, h / 2]; getOpposite = (w, h) => [0, h / 2]; break; case "bottomRight": isDiagonal = true; getPoint = (w, h) => [w, h]; getOpposite = (w, h) => [0, 0]; break; case "bottomMiddle": getPoint = (w, h) => [w / 2, h]; getOpposite = (w, h) => [w / 2, 0]; break; case "bottomLeft": isDiagonal = true; getPoint = (w, h) => [0, h]; getOpposite = (w, h) => [w, 0]; break; case "middleLeft": isHorizontal = true; getPoint = (w, h) => [0, h / 2]; getOpposite = (w, h) => [w, h / 2]; break; } const point = getPoint(savedWidth, savedHeight); const oppositePoint = getOpposite(savedWidth, savedHeight); let transfOppositePoint = transf(...oppositePoint); const oppositeX = round(savedX + transfOppositePoint[0]); const oppositeY = round(savedY + transfOppositePoint[1]); let ratioX = 1; let ratioY = 1; let [deltaX, deltaY] = this.screenToPageTranslation(event.movementX, event.movementY); [deltaX, deltaY] = invTransf(deltaX / parentWidth, deltaY / parentHeight); if (isDiagonal) { const oldDiag = Math.hypot(savedWidth, savedHeight); ratioX = ratioY = Math.max(Math.min(Math.hypot(oppositePoint[0] - point[0] - deltaX, oppositePoint[1] - point[1] - deltaY) / oldDiag, 1 / savedWidth, 1 / savedHeight), minWidth / savedWidth, minHeight / savedHeight); } else if (isHorizontal) { ratioX = Math.max(minWidth, Math.min(1, Math.abs(oppositePoint[0] - point[0] - deltaX))) / savedWidth; } else { ratioY = Math.max(minHeight, Math.min(1, Math.abs(oppositePoint[1] - point[1] - deltaY))) / savedHeight; } const newWidth = round(savedWidth * ratioX); const newHeight = round(savedHeight * ratioY); transfOppositePoint = transf(...getOpposite(newWidth, newHeight)); const newX = oppositeX - transfOppositePoint[0]; const newY = oppositeY - transfOppositePoint[1]; this.width = newWidth; this.height = newHeight; this.x = newX; this.y = newY; this.setDims(parentWidth * newWidth, parentHeight * newHeight); this.fixAndSetPosition(); } altTextFinish() { this.#altText?.finish(); } async addEditToolbar() { if (this.#editToolbar || this.#isInEditMode) { return this.#editToolbar; } this.#editToolbar = new EditorToolbar(this); this.div.append(this.#editToolbar.render()); if (this.#altText) { this.#editToolbar.addAltTextButton(await this.#altText.render()); } return this.#editToolbar; } removeEditToolbar() { if (!this.#editToolbar) { return; } this.#editToolbar.remove(); this.#editToolbar = null; this.#altText?.destroy(); } getClientDimensions() { return this.div.getBoundingClientRect(); } async addAltTextButton() { if (this.#altText) { return; } AltText.initialize(AnnotationEditor._l10nPromise); this.#altText = new AltText(this); await this.addEditToolbar(); } get altTextData() { return this.#altText?.data; } set altTextData(data) { if (!this.#altText) { return; } this.#altText.data = data; } hasAltText() { return !this.#altText?.isEmpty(); } render() { this.div = document.createElement("div"); this.div.setAttribute("data-editor-rotation", (360 - this.rotation) % 360); this.div.className = this.name; this.div.setAttribute("id", this.id); this.div.tabIndex = this.#disabled ? -1 : 0; if (!this._isVisible) { this.div.classList.add("hidden"); } this.setInForeground(); this.div.addEventListener("focusin", this.#boundFocusin); this.div.addEventListener("focusout", this.#boundFocusout); const [parentWidth, parentHeight] = this.parentDimensions; if (this.parentRotation % 180 !== 0) { this.div.style.maxWidth = `${(100 * parentHeight / parentWidth).toFixed(2)}%`; this.div.style.maxHeight = `${(100 * parentWidth / parentHeight).toFixed(2)}%`; } const [tx, ty] = this.getInitialTranslation(); this.translate(tx, ty); bindEvents(this, this.div, ["pointerdown"]); return this.div; } pointerdown(event) { const { isMac } = util_FeatureTest.platform; if (event.button !== 0 || event.ctrlKey && isMac) { event.preventDefault(); return; } this.#hasBeenClicked = true; if (this._isDraggable) { this.#setUpDragSession(event); return; } this.#selectOnPointerEvent(event); } #selectOnPointerEvent(event) { const { isMac } = util_FeatureTest.platform; if (event.ctrlKey && !isMac || event.shiftKey || event.metaKey && isMac) { this.parent.toggleSelected(this); } else { this.parent.setSelected(this); } } #setUpDragSession(event) { const isSelected = this._uiManager.isSelected(this); this._uiManager.setUpDragSession(); let pointerMoveOptions, pointerMoveCallback; if (isSelected) { this.div.classList.add("moving"); pointerMoveOptions = { passive: true, capture: true }; this.#prevDragX = event.clientX; this.#prevDragY = event.clientY; pointerMoveCallback = e => { const { clientX: x, clientY: y } = e; const [tx, ty] = this.screenToPageTranslation(x - this.#prevDragX, y - this.#prevDragY); this.#prevDragX = x; this.#prevDragY = y; this._uiManager.dragSelectedEditors(tx, ty); }; window.addEventListener("pointermove", pointerMoveCallback, pointerMoveOptions); } const pointerUpCallback = () => { window.removeEventListener("pointerup", pointerUpCallback); window.removeEventListener("blur", pointerUpCallback); if (isSelected) { this.div.classList.remove("moving"); window.removeEventListener("pointermove", pointerMoveCallback, pointerMoveOptions); } this.#hasBeenClicked = false; if (!this._uiManager.endDragSession()) { this.#selectOnPointerEvent(event); } }; window.addEventListener("pointerup", pointerUpCallback); window.addEventListener("blur", pointerUpCallback); } moveInDOM() { if (this.#moveInDOMTimeout) { clearTimeout(this.#moveInDOMTimeout); } this.#moveInDOMTimeout = setTimeout(() => { this.#moveInDOMTimeout = null; this.parent?.moveEditorInDOM(this); }, 0); } _setParentAndPosition(parent, x, y) { parent.changeParent(this); this.x = x; this.y = y; this.fixAndSetPosition(); } getRect(tx, ty, rotation = this.rotation) { const scale = this.parentScale; const [pageWidth, pageHeight] = this.pageDimensions; const [pageX, pageY] = this.pageTranslation; const shiftX = tx / scale; const shiftY = ty / scale; const x = this.x * pageWidth; const y = this.y * pageHeight; const width = this.width * pageWidth; const height = this.height * pageHeight; switch (rotation) { case 0: return [x + shiftX + pageX, pageHeight - y - shiftY - height + pageY, x + shiftX + width + pageX, pageHeight - y - shiftY + pageY]; case 90: return [x + shiftY + pageX, pageHeight - y + shiftX + pageY, x + shiftY + height + pageX, pageHeight - y + shiftX + width + pageY]; case 180: return [x - shiftX - width + pageX, pageHeight - y + shiftY + pageY, x - shiftX + pageX, pageHeight - y + shiftY + height + pageY]; case 270: return [x - shiftY - height + pageX, pageHeight - y - shiftX - width + pageY, x - shiftY + pageX, pageHeight - y - shiftX + pageY]; default: throw new Error("Invalid rotation"); } } getRectInCurrentCoords(rect, pageHeight) { const [x1, y1, x2, y2] = rect; const width = x2 - x1; const height = y2 - y1; switch (this.rotation) { case 0: return [x1, pageHeight - y2, width, height]; case 90: return [x1, pageHeight - y1, height, width]; case 180: return [x2, pageHeight - y1, width, height]; case 270: return [x2, pageHeight - y2, height, width]; default: throw new Error("Invalid rotation"); } } onceAdded() {} isEmpty() { return false; } enableEditMode() { this.#isInEditMode = true; } disableEditMode() { this.#isInEditMode = false; } isInEditMode() { return this.#isInEditMode; } shouldGetKeyboardEvents() { return this.#isResizerEnabledForKeyboard; } needsToBeRebuilt() { return this.div && !this.isAttachedToDOM; } rebuild() { this.div?.addEventListener("focusin", this.#boundFocusin); this.div?.addEventListener("focusout", this.#boundFocusout); } rotate(_angle) {} serialize(isForCopying = false, context = null) { unreachable("An editor must be serializable"); } static deserialize(data, parent, uiManager) { const editor = new this.prototype.constructor({ parent, id: parent.getNextId(), uiManager }); editor.rotation = data.rotation; const [pageWidth, pageHeight] = editor.pageDimensions; const [x, y, width, height] = editor.getRectInCurrentCoords(data.rect, pageHeight); editor.x = x / pageWidth; editor.y = y / pageHeight; editor.width = width / pageWidth; editor.height = height / pageHeight; return editor; } get hasBeenModified() { return !!this.annotationElementId && (this.deleted || this.serialize() !== null); } remove() { this.div.removeEventListener("focusin", this.#boundFocusin); this.div.removeEventListener("focusout", this.#boundFocusout); if (!this.isEmpty()) { this.commit(); } if (this.parent) { this.parent.remove(this); } else { this._uiManager.removeEditor(this); } if (this.#moveInDOMTimeout) { clearTimeout(this.#moveInDOMTimeout); this.#moveInDOMTimeout = null; } this.#stopResizing(); this.removeEditToolbar(); if (this.#telemetryTimeouts) { for (const timeout of this.#telemetryTimeouts.values()) { clearTimeout(timeout); } this.#telemetryTimeouts = null; } this.parent = null; } get isResizable() { return false; } makeResizable() { if (this.isResizable) { this.#createResizers(); this.#resizersDiv.classList.remove("hidden"); bindEvents(this, this.div, ["keydown"]); } } get toolbarPosition() { return null; } keydown(event) { if (!this.isResizable || event.target !== this.div || event.key !== "Enter") { return; } this._uiManager.setSelected(this); this.#savedDimensions = { savedX: this.x, savedY: this.y, savedWidth: this.width, savedHeight: this.height }; const children = this.#resizersDiv.children; if (!this.#allResizerDivs) { this.#allResizerDivs = Array.from(children); const boundResizerKeydown = this.#resizerKeydown.bind(this); const boundResizerBlur = this.#resizerBlur.bind(this); for (const div of this.#allResizerDivs) { const name = div.getAttribute("data-resizer-name"); div.setAttribute("role", "spinbutton"); div.addEventListener("keydown", boundResizerKeydown); div.addEventListener("blur", boundResizerBlur); div.addEventListener("focus", this.#resizerFocus.bind(this, name)); AnnotationEditor._l10nPromise.get(`pdfjs-editor-resizer-label-${name}`).then(msg => div.setAttribute("aria-label", msg)); } } const first = this.#allResizerDivs[0]; let firstPosition = 0; for (const div of children) { if (div === first) { break; } firstPosition++; } const nextFirstPosition = (360 - this.rotation + this.parentRotation) % 360 / 90 * (this.#allResizerDivs.length / 4); if (nextFirstPosition !== firstPosition) { if (nextFirstPosition < firstPosition) { for (let i = 0; i < firstPosition - nextFirstPosition; i++) { this.#resizersDiv.append(this.#resizersDiv.firstChild); } } else if (nextFirstPosition > firstPosition) { for (let i = 0; i < nextFirstPosition - firstPosition; i++) { this.#resizersDiv.firstChild.before(this.#resizersDiv.lastChild); } } let i = 0; for (const child of children) { const div = this.#allResizerDivs[i++]; const name = div.getAttribute("data-resizer-name"); AnnotationEditor._l10nPromise.get(`pdfjs-editor-resizer-label-${name}`).then(msg => child.setAttribute("aria-label", msg)); } } this.#setResizerTabIndex(0); this.#isResizerEnabledForKeyboard = true; this.#resizersDiv.firstChild.focus({ focusVisible: true }); event.preventDefault(); event.stopImmediatePropagation(); } #resizerKeydown(event) { AnnotationEditor._resizerKeyboardManager.exec(this, event); } #resizerBlur(event) { if (this.#isResizerEnabledForKeyboard && event.relatedTarget?.parentNode !== this.#resizersDiv) { this.#stopResizing(); } } #resizerFocus(name) { this.#focusedResizerName = this.#isResizerEnabledForKeyboard ? name : ""; } #setResizerTabIndex(value) { if (!this.#allResizerDivs) { return; } for (const div of this.#allResizerDivs) { div.tabIndex = value; } } _resizeWithKeyboard(x, y) { if (!this.#isResizerEnabledForKeyboard) { return; } this.#resizerPointermove(this.#focusedResizerName, { movementX: x, movementY: y }); } #stopResizing() { this.#isResizerEnabledForKeyboard = false; this.#setResizerTabIndex(-1); if (this.#savedDimensions) { const { savedX, savedY, savedWidth, savedHeight } = this.#savedDimensions; this.#addResizeToUndoStack(savedX, savedY, savedWidth, savedHeight); this.#savedDimensions = null; } } _stopResizingWithKeyboard() { this.#stopResizing(); this.div.focus(); } select() { this.makeResizable(); this.div?.classList.add("selectedEditor"); if (!this.#editToolbar) { this.addEditToolbar().then(() => { if (this.div?.classList.contains("selectedEditor")) { this.#editToolbar?.show(); } }); return; } this.#editToolbar?.show(); } unselect() { this.#resizersDiv?.classList.add("hidden"); this.div?.classList.remove("selectedEditor"); if (this.div?.contains(document.activeElement)) { this._uiManager.currentLayer.div.focus({ preventScroll: true }); } this.#editToolbar?.hide(); } updateParams(type, value) {} disableEditing() {} enableEditing() {} enterInEditMode() {} getImageForAltText() { return null; } get contentDiv() { return this.div; } get isEditing() { return this.#isEditing; } set isEditing(value) { this.#isEditing = value; if (!this.parent) { return; } if (value) { this.parent.setSelected(this); this.parent.setActiveEditor(this); } else { this.parent.setActiveEditor(null); } } setAspectRatio(width, height) { this.#keepAspectRatio = true; const aspectRatio = width / height; const { style } = this.div; style.aspectRatio = aspectRatio; style.height = "auto"; } static get MIN_SIZE() { return 16; } static canCreateNewEmptyEditor() { return true; } get telemetryInitialData() { return { action: "added" }; } get telemetryFinalData() { return null; } _reportTelemetry(data, mustWait = false) { if (mustWait) { this.#telemetryTimeouts ||= new Map(); const { action } = data; let timeout = this.#telemetryTimeouts.get(action); if (timeout) { clearTimeout(timeout); } timeout = setTimeout(() => { this._reportTelemetry(data); this.#telemetryTimeouts.delete(action); if (this.#telemetryTimeouts.size === 0) { this.#telemetryTimeouts = null; } }, AnnotationEditor._telemetryTimeout); this.#telemetryTimeouts.set(action, timeout); return; } data.type ||= this.editorType; this._uiManager._eventBus.dispatch("reporttelemetry", { source: this, details: { type: "editing", data } }); } show(visible = this._isVisible) { this.div.classList.toggle("hidden", !visible); this._isVisible = visible; } enable() { if (this.div) { this.div.tabIndex = 0; } this.#disabled = false; } disable() { if (this.div) { this.div.tabIndex = -1; } this.#disabled = true; } renderAnnotationElement(annotation) { let content = annotation.container.querySelector(".annotationContent"); if (!content) { content = document.createElement("div"); content.classList.add("annotationContent", this.editorType); annotation.container.prepend(content); } else if (content.nodeName === "CANVAS") { const canvas = content; content = document.createElement("div"); content.classList.add("annotationContent", this.editorType); canvas.before(content); } return content; } resetAnnotationElement(annotation) { const { firstChild } = annotation.container; if (firstChild.nodeName === "DIV" && firstChild.classList.contains("annotationContent")) { firstChild.remove(); } } } class FakeEditor extends AnnotationEditor { constructor(params) { super(params); this.annotationElementId = params.annotationElementId; this.deleted = true; } serialize() { return { id: this.annotationElementId, deleted: true, pageIndex: this.pageIndex }; } } ;// CONCATENATED MODULE: ./src/shared/murmurhash3.js const SEED = 0xc3d2e1f0; const MASK_HIGH = 0xffff0000; const MASK_LOW = 0xffff; class MurmurHash3_64 { constructor(seed) { this.h1 = seed ? seed & 0xffffffff : SEED; this.h2 = seed ? seed & 0xffffffff : SEED; } update(input) { let data, length; if (typeof input === "string") { data = new Uint8Array(input.length * 2); length = 0; for (let i = 0, ii = input.length; i < ii; i++) { const code = input.charCodeAt(i); if (code <= 0xff) { data[length++] = code; } else { data[length++] = code >>> 8; data[length++] = code & 0xff; } } } else if (ArrayBuffer.isView(input)) { data = input.slice(); length = data.byteLength; } else { throw new Error("Invalid data format, must be a string or TypedArray."); } const blockCounts = length >> 2; const tailLength = length - blockCounts * 4; const dataUint32 = new Uint32Array(data.buffer, 0, blockCounts); let k1 = 0, k2 = 0; let h1 = this.h1, h2 = this.h2; const C1 = 0xcc9e2d51, C2 = 0x1b873593; const C1_LOW = C1 & MASK_LOW, C2_LOW = C2 & MASK_LOW; for (let i = 0; i < blockCounts; i++) { if (i & 1) { k1 = dataUint32[i]; k1 = k1 * C1 & MASK_HIGH | k1 * C1_LOW & MASK_LOW; k1 = k1 << 15 | k1 >>> 17; k1 = k1 * C2 & MASK_HIGH | k1 * C2_LOW & MASK_LOW; h1 ^= k1; h1 = h1 << 13 | h1 >>> 19; h1 = h1 * 5 + 0xe6546b64; } else { k2 = dataUint32[i]; k2 = k2 * C1 & MASK_HIGH | k2 * C1_LOW & MASK_LOW; k2 = k2 << 15 | k2 >>> 17; k2 = k2 * C2 & MASK_HIGH | k2 * C2_LOW & MASK_LOW; h2 ^= k2; h2 = h2 << 13 | h2 >>> 19; h2 = h2 * 5 + 0xe6546b64; } } k1 = 0; switch (tailLength) { case 3: k1 ^= data[blockCounts * 4 + 2] << 16; case 2: k1 ^= data[blockCounts * 4 + 1] << 8; case 1: k1 ^= data[blockCounts * 4]; k1 = k1 * C1 & MASK_HIGH | k1 * C1_LOW & MASK_LOW; k1 = k1 << 15 | k1 >>> 17; k1 = k1 * C2 & MASK_HIGH | k1 * C2_LOW & MASK_LOW; if (blockCounts & 1) { h1 ^= k1; } else { h2 ^= k1; } } this.h1 = h1; this.h2 = h2; } hexdigest() { let h1 = this.h1, h2 = this.h2; h1 ^= h2 >>> 1; h1 = h1 * 0xed558ccd & MASK_HIGH | h1 * 0x8ccd & MASK_LOW; h2 = h2 * 0xff51afd7 & MASK_HIGH | ((h2 << 16 | h1 >>> 16) * 0xafd7ed55 & MASK_HIGH) >>> 16; h1 ^= h2 >>> 1; h1 = h1 * 0x1a85ec53 & MASK_HIGH | h1 * 0xec53 & MASK_LOW; h2 = h2 * 0xc4ceb9fe & MASK_HIGH | ((h2 << 16 | h1 >>> 16) * 0xb9fe1a85 & MASK_HIGH) >>> 16; h1 ^= h2 >>> 1; return (h1 >>> 0).toString(16).padStart(8, "0") + (h2 >>> 0).toString(16).padStart(8, "0"); } } ;// CONCATENATED MODULE: ./src/display/annotation_storage.js const SerializableEmpty = Object.freeze({ map: null, hash: "", transfer: undefined }); class AnnotationStorage { #modified = false; #storage = new Map(); constructor() { this.onSetModified = null; this.onResetModified = null; this.onAnnotationEditor = null; } getValue(key, defaultValue) { const value = this.#storage.get(key); if (value === undefined) { return defaultValue; } return Object.assign(defaultValue, value); } getRawValue(key) { return this.#storage.get(key); } remove(key) { this.#storage.delete(key); if (this.#storage.size === 0) { this.resetModified(); } if (typeof this.onAnnotationEditor === "function") { for (const value of this.#storage.values()) { if (value instanceof AnnotationEditor) { return; } } this.onAnnotationEditor(null); } } setValue(key, value) { const obj = this.#storage.get(key); let modified = false; if (obj !== undefined) { for (const [entry, val] of Object.entries(value)) { if (obj[entry] !== val) { modified = true; obj[entry] = val; } } } else { modified = true; this.#storage.set(key, value); } if (modified) { this.#setModified(); } if (value instanceof AnnotationEditor && typeof this.onAnnotationEditor === "function") { this.onAnnotationEditor(value.constructor._type); } } has(key) { return this.#storage.has(key); } getAll() { return this.#storage.size > 0 ? objectFromMap(this.#storage) : null; } setAll(obj) { for (const [key, val] of Object.entries(obj)) { this.setValue(key, val); } } get size() { return this.#storage.size; } #setModified() { if (!this.#modified) { this.#modified = true; if (typeof this.onSetModified === "function") { this.onSetModified(); } } } resetModified() { if (this.#modified) { this.#modified = false; if (typeof this.onResetModified === "function") { this.onResetModified(); } } } get print() { return new PrintAnnotationStorage(this); } get serializable() { if (this.#storage.size === 0) { return SerializableEmpty; } const map = new Map(), hash = new MurmurHash3_64(), transfer = []; const context = Object.create(null); let hasBitmap = false; for (const [key, val] of this.#storage) { const serialized = val instanceof AnnotationEditor ? val.serialize(false, context) : val; if (serialized) { map.set(key, serialized); hash.update(`${key}:${JSON.stringify(serialized)}`); hasBitmap ||= !!serialized.bitmap; } } if (hasBitmap) { for (const value of map.values()) { if (value.bitmap) { transfer.push(value.bitmap); } } } return map.size > 0 ? { map, hash: hash.hexdigest(), transfer } : SerializableEmpty; } get editorStats() { let stats = null; const typeToEditor = new Map(); for (const value of this.#storage.values()) { if (!(value instanceof AnnotationEditor)) { continue; } const editorStats = value.telemetryFinalData; if (!editorStats) { continue; } const { type } = editorStats; if (!typeToEditor.has(type)) { typeToEditor.set(type, Object.getPrototypeOf(value).constructor); } stats ||= Object.create(null); const map = stats[type] ||= new Map(); for (const [key, val] of Object.entries(editorStats)) { if (key === "type") { continue; } let counters = map.get(key); if (!counters) { counters = new Map(); map.set(key, counters); } const count = counters.get(val) ?? 0; counters.set(val, count + 1); } } for (const [type, editor] of typeToEditor) { stats[type] = editor.computeTelemetryFinalData(stats[type]); } return stats; } } class PrintAnnotationStorage extends AnnotationStorage { #serializable; constructor(parent) { super(); const { map, hash, transfer } = parent.serializable; const clone = structuredClone(map, transfer ? { transfer } : null); this.#serializable = { map: clone, hash, transfer }; } get print() { unreachable("Should not call PrintAnnotationStorage.print"); } get serializable() { return this.#serializable; } } ;// CONCATENATED MODULE: ./src/display/font_loader.js class FontLoader { #systemFonts = new Set(); constructor({ ownerDocument = globalThis.document, styleElement = null }) { this._document = ownerDocument; this.nativeFontFaces = new Set(); this.styleElement = null; this.loadingRequests = []; this.loadTestFontId = 0; } addNativeFontFace(nativeFontFace) { this.nativeFontFaces.add(nativeFontFace); this._document.fonts.add(nativeFontFace); } removeNativeFontFace(nativeFontFace) { this.nativeFontFaces.delete(nativeFontFace); this._document.fonts.delete(nativeFontFace); } insertRule(rule) { if (!this.styleElement) { this.styleElement = this._document.createElement("style"); this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement); } const styleSheet = this.styleElement.sheet; styleSheet.insertRule(rule, styleSheet.cssRules.length); } clear() { for (const nativeFontFace of this.nativeFontFaces) { this._document.fonts.delete(nativeFontFace); } this.nativeFontFaces.clear(); this.#systemFonts.clear(); if (this.styleElement) { this.styleElement.remove(); this.styleElement = null; } } async loadSystemFont({ systemFontInfo: info, _inspectFont }) { if (!info || this.#systemFonts.has(info.loadedName)) { return; } assert(!this.disableFontFace, "loadSystemFont shouldn't be called when `disableFontFace` is set."); if (this.isFontLoadingAPISupported) { const { loadedName, src, style } = info; const fontFace = new FontFace(loadedName, src, style); this.addNativeFontFace(fontFace); try { await fontFace.load(); this.#systemFonts.add(loadedName); _inspectFont?.(info); } catch { warn(`Cannot load system font: ${info.baseFontName}, installing it could help to improve PDF rendering.`); this.removeNativeFontFace(fontFace); } return; } unreachable("Not implemented: loadSystemFont without the Font Loading API."); } async bind(font) { if (font.attached || font.missingFile && !font.systemFontInfo) { return; } font.attached = true; if (font.systemFontInfo) { await this.loadSystemFont(font); return; } if (this.isFontLoadingAPISupported) { const nativeFontFace = font.createNativeFontFace(); if (nativeFontFace) { this.addNativeFontFace(nativeFontFace); try { await nativeFontFace.loaded; } catch (ex) { warn(`Failed to load font '${nativeFontFace.family}': '${ex}'.`); font.disableFontFace = true; throw ex; } } return; } const rule = font.createFontFaceRule(); if (rule) { this.insertRule(rule); if (this.isSyncFontLoadingSupported) { return; } await new Promise(resolve => { const request = this._queueLoadingCallback(resolve); this._prepareFontLoadEvent(font, request); }); } } get isFontLoadingAPISupported() { const hasFonts = !!this._document?.fonts; return shadow(this, "isFontLoadingAPISupported", hasFonts); } get isSyncFontLoadingSupported() { let supported = false; if (isNodeJS) { supported = true; } else if (typeof navigator !== "undefined" && typeof navigator?.userAgent === "string" && /Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent)) { supported = true; } return shadow(this, "isSyncFontLoadingSupported", supported); } _queueLoadingCallback(callback) { function completeRequest() { assert(!request.done, "completeRequest() cannot be called twice."); request.done = true; while (loadingRequests.length > 0 && loadingRequests[0].done) { const otherRequest = loadingRequests.shift(); setTimeout(otherRequest.callback, 0); } } const { loadingRequests } = this; const request = { done: false, complete: completeRequest, callback }; loadingRequests.push(request); return request; } get _loadTestFont() { const testFont = atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQA" + "FQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAA" + "ALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgA" + "AAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1" + "AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD" + "6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACM" + "AooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4D" + "IP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAA" + "AAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUA" + "AQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgAB" + "AAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABY" + "AAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAA" + "AC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "AAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAA" + "AAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQAC" + "AQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3" + "Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTj" + "FQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="); return shadow(this, "_loadTestFont", testFont); } _prepareFontLoadEvent(font, request) { function int32(data, offset) { return data.charCodeAt(offset) << 24 | data.charCodeAt(offset + 1) << 16 | data.charCodeAt(offset + 2) << 8 | data.charCodeAt(offset + 3) & 0xff; } function spliceString(s, offset, remove, insert) { const chunk1 = s.substring(0, offset); const chunk2 = s.substring(offset + remove); return chunk1 + insert + chunk2; } let i, ii; const canvas = this._document.createElement("canvas"); canvas.width = 1; canvas.height = 1; const ctx = canvas.getContext("2d"); let called = 0; function isFontReady(name, callback) { if (++called > 30) { warn("Load test font never loaded."); callback(); return; } ctx.font = "30px " + name; ctx.fillText(".", 0, 20); const imageData = ctx.getImageData(0, 0, 1, 1); if (imageData.data[3] > 0) { callback(); return; } setTimeout(isFontReady.bind(null, name, callback)); } const loadTestFontId = `lt${Date.now()}${this.loadTestFontId++}`; let data = this._loadTestFont; const COMMENT_OFFSET = 976; data = spliceString(data, COMMENT_OFFSET, loadTestFontId.length, loadTestFontId); const CFF_CHECKSUM_OFFSET = 16; const XXXX_VALUE = 0x58585858; let checksum = int32(data, CFF_CHECKSUM_OFFSET); for (i = 0, ii = loadTestFontId.length - 3; i < ii; i += 4) { checksum = checksum - XXXX_VALUE + int32(loadTestFontId, i) | 0; } if (i < loadTestFontId.length) { checksum = checksum - XXXX_VALUE + int32(loadTestFontId + "XXX", i) | 0; } data = spliceString(data, CFF_CHECKSUM_OFFSET, 4, string32(checksum)); const url = `url(data:font/opentype;base64,${btoa(data)});`; const rule = `@font-face {font-family:"${loadTestFontId}";src:${url}}`; this.insertRule(rule); const div = this._document.createElement("div"); div.style.visibility = "hidden"; div.style.width = div.style.height = "10px"; div.style.position = "absolute"; div.style.top = div.style.left = "0px"; for (const name of [font.loadedName, loadTestFontId]) { const span = this._document.createElement("span"); span.textContent = "Hi"; span.style.fontFamily = name; div.append(span); } this._document.body.append(div); isFontReady(loadTestFontId, () => { div.remove(); request.complete(); }); } } class FontFaceObject { constructor(translatedData, { disableFontFace = false, inspectFont = null }) { this.compiledGlyphs = Object.create(null); for (const i in translatedData) { this[i] = translatedData[i]; } this.disableFontFace = disableFontFace === true; this._inspectFont = inspectFont; } createNativeFontFace() { if (!this.data || this.disableFontFace) { return null; } let nativeFontFace; if (!this.cssFontInfo) { nativeFontFace = new FontFace(this.loadedName, this.data, {}); } else { const css = { weight: this.cssFontInfo.fontWeight }; if (this.cssFontInfo.italicAngle) { css.style = `oblique ${this.cssFontInfo.italicAngle}deg`; } nativeFontFace = new FontFace(this.cssFontInfo.fontFamily, this.data, css); } this._inspectFont?.(this); return nativeFontFace; } createFontFaceRule() { if (!this.data || this.disableFontFace) { return null; } const data = bytesToString(this.data); const url = `url(data:${this.mimetype};base64,${btoa(data)});`; let rule; if (!this.cssFontInfo) { rule = `@font-face {font-family:"${this.loadedName}";src:${url}}`; } else { let css = `font-weight: ${this.cssFontInfo.fontWeight};`; if (this.cssFontInfo.italicAngle) { css += `font-style: oblique ${this.cssFontInfo.italicAngle}deg;`; } rule = `@font-face {font-family:"${this.cssFontInfo.fontFamily}";${css}src:${url}}`; } this._inspectFont?.(this, url); return rule; } getPathGenerator(objs, character) { if (this.compiledGlyphs[character] !== undefined) { return this.compiledGlyphs[character]; } let cmds; try { cmds = objs.get(this.loadedName + "_path_" + character); } catch (ex) { warn(`getPathGenerator - ignoring character: "${ex}".`); } if (!Array.isArray(cmds) || cmds.length === 0) { return this.compiledGlyphs[character] = function (c, size) {}; } const commands = []; for (let i = 0, ii = cmds.length; i < ii;) { switch (cmds[i++]) { case FontRenderOps.BEZIER_CURVE_TO: { const [a, b, c, d, e, f] = cmds.slice(i, i + 6); commands.push(ctx => ctx.bezierCurveTo(a, b, c, d, e, f)); i += 6; } break; case FontRenderOps.MOVE_TO: { const [a, b] = cmds.slice(i, i + 2); commands.push(ctx => ctx.moveTo(a, b)); i += 2; } break; case FontRenderOps.LINE_TO: { const [a, b] = cmds.slice(i, i + 2); commands.push(ctx => ctx.lineTo(a, b)); i += 2; } break; case FontRenderOps.QUADRATIC_CURVE_TO: { const [a, b, c, d] = cmds.slice(i, i + 4); commands.push(ctx => ctx.quadraticCurveTo(a, b, c, d)); i += 4; } break;
•
Search:
•
Replace:
1
2
3
Function
Edit by line
Download
Information
Rename
Copy
Move
Delete
Chmod
List