@d1g1tal/transportr 2.0.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../node_modules/.pnpm/@d1g1tal+media-type@6.0.4/node_modules/@d1g1tal/media-type/src/utils.ts", "../node_modules/.pnpm/@d1g1tal+media-type@6.0.4/node_modules/@d1g1tal/media-type/src/media-type-parameters.ts", "../node_modules/.pnpm/@d1g1tal+media-type@6.0.4/node_modules/@d1g1tal/media-type/src/media-type-parser.ts", "../node_modules/.pnpm/@d1g1tal+media-type@6.0.4/node_modules/@d1g1tal/media-type/src/media-type.ts", "../node_modules/.pnpm/@d1g1tal+subscribr@4.1.8_typescript@5.9.3/node_modules/@d1g1tal/subscribr/node_modules/.pnpm/@d1g1tal+collections@2.1.1_typescript@5.9.3/node_modules/@d1g1tal/collections/src/set-multi-map.ts", "../node_modules/.pnpm/@d1g1tal+subscribr@4.1.8_typescript@5.9.3/node_modules/@d1g1tal/subscribr/src/context-event-handler.ts", "../node_modules/.pnpm/@d1g1tal+subscribr@4.1.8_typescript@5.9.3/node_modules/@d1g1tal/subscribr/src/subscription.ts", "../node_modules/.pnpm/@d1g1tal+subscribr@4.1.8_typescript@5.9.3/node_modules/@d1g1tal/subscribr/src/subscribr.ts", "../src/http-error.ts", "../src/http-media-type.ts", "../src/http-request-headers.ts", "../src/http-request-methods.ts", "../src/http-response-headers.ts", "../src/response-status.ts", "../src/constants.ts", "../src/signal-controller.ts", "../node_modules/.pnpm/dompurify@3.3.3/node_modules/dompurify/src/utils.ts", "../node_modules/.pnpm/dompurify@3.3.3/node_modules/dompurify/src/tags.ts", "../node_modules/.pnpm/dompurify@3.3.3/node_modules/dompurify/src/attrs.ts", "../node_modules/.pnpm/dompurify@3.3.3/node_modules/dompurify/src/regexp.ts", "../node_modules/.pnpm/dompurify@3.3.3/node_modules/dompurify/src/purify.ts", "../src/response-handlers.ts", "../src/utils.ts", "../src/transportr.ts"],
4
- "sourcesContent": ["export const httpTokenCodePoints: RegExp = /^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/u;", "import { httpTokenCodePoints } from './utils.js';\n\nconst matcher: RegExp = /([\"\\\\])/ug;\nconst httpQuotedStringTokenCodePoints: RegExp = /^[\\t\\u0020-\\u007E\\u0080-\\u00FF]*$/u;\n\n/**\n * Class representing the parameters for a media type record.\n * This class extends a JavaScript Map<string, string>.\n *\n * However, MediaTypeParameters methods will always interpret their arguments\n * as appropriate for media types, so parameter names will be lowercased,\n * and attempting to set invalid characters will throw an Error.\n *\n * @see https://mimesniff.spec.whatwg.org\n * @author D1g1talEntr0py <jason.dimeo@gmail.com>\n */\nexport class MediaTypeParameters extends Map<string, string> {\n\t/**\n\t * Create a new MediaTypeParameters instance.\n\t *\n\t * @param entries An array of [ name, value ] tuples.\n\t */\n\tconstructor(entries: Iterable<[string, string]> = []) {\n\t\tsuper(entries);\n\t}\n\n\t/**\n\t * Indicates whether the supplied name and value are valid media type parameters.\n\t *\n\t * @param name The name of the media type parameter to validate.\n\t * @param value The media type parameter value to validate.\n\t * @returns true if the media type parameter is valid, false otherwise.\n\t */\n\tstatic isValid(name: string, value: string): boolean {\n\t\treturn httpTokenCodePoints.test(name) && httpQuotedStringTokenCodePoints.test(value);\n\t}\n\n\t/**\n\t * Gets the media type parameter value for the supplied name.\n\t *\n\t * @param name The name of the media type parameter to retrieve.\n\t * @returns The media type parameter value.\n\t */\n\toverride get(name: string): string | undefined {\n\t\treturn super.get(name.toLowerCase());\n\t}\n\n\t/**\n\t * Indicates whether the media type parameter with the specified name exists or not.\n\t *\n\t * @param name The name of the media type parameter to check.\n\t * @returns true if the media type parameter exists, false otherwise.\n\t */\n\toverride has(name: string): boolean {\n\t\treturn super.has(name.toLowerCase());\n\t}\n\n\t/**\n\t * Adds a new media type parameter using the specified name and value to the MediaTypeParameters.\n\t * If an parameter with the same name already exists, the parameter will be updated.\n\t *\n\t * @param name The name of the media type parameter to set.\n\t * @param value The media type parameter value.\n\t * @returns This instance.\n\t */\n\toverride set(name: string, value: string): this {\n\t\tif (!MediaTypeParameters.isValid(name, value)) {\n\t\t\tthrow new Error(`Invalid media type parameter name/value: ${name}/${value}`);\n\t\t}\n\n\t\tsuper.set(name.toLowerCase(), value);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Removes the media type parameter using the specified name.\n\t *\n\t * @param name The name of the media type parameter to delete.\n\t * @returns true if the parameter existed and has been removed, or false if the parameter does not exist.\n\t */\n\toverride delete(name: string): boolean {\n\t\treturn super.delete(name.toLowerCase());\n\t}\n\n\t/**\n\t * Returns a string representation of the media type parameters.\n\t *\n\t * @returns The string representation of the media type parameters.\n\t */\n\toverride toString(): string {\n\t\treturn Array.from(this).map(([ name, value ]) => `;${name}=${!value || !httpTokenCodePoints.test(value) ? `\"${value.replace(matcher, '\\\\$1')}\"` : value}`).join('');\n\t}\n\n\t/**\n\t * Returns the name of this class.\n\t *\n\t * @returns The name of this class.\n\t */\n\toverride get [Symbol.toStringTag](): string {\n\t\treturn 'MediaTypeParameters';\n\t}\n}", "import { MediaTypeParameters } from './media-type-parameters.js';\nimport { httpTokenCodePoints } from './utils.js';\n\nconst whitespaceChars = new Set([' ', '\\t', '\\n', '\\r']);\nconst trailingWhitespace: RegExp = /[ \\t\\n\\r]+$/u;\nconst leadingAndTrailingWhitespace: RegExp = /^[ \\t\\n\\r]+|[ \\t\\n\\r]+$/ug;\n\nexport interface MediaTypeComponent {\n\tposition?: number;\n\tinput: string;\n\tlowerCase?: boolean;\n\ttrim?: boolean;\n}\n\nexport interface ParsedMediaType {\n\ttype: string;\n\tsubtype: string;\n\tparameters: MediaTypeParameters;\n}\n\n/**\n * Parser for media types.\n * @see https://mimesniff.spec.whatwg.org/#parsing-a-mime-type\n * @author D1g1talEntr0py <jason.dimeo@gmail.com>\n */\nexport class MediaTypeParser {\n\t/**\n\t * Function to parse a media type.\n\t * @param input The media type to parse\n\t * @returns An object populated with the parsed media type properties and any parameters.\n\t */\n\tstatic parse(input: string): ParsedMediaType {\n\t\tinput = input.replace(leadingAndTrailingWhitespace, '');\n\n\t\tlet position = 0;\n\t\tconst [ type, typeEnd ] = MediaTypeParser.collect(input, position, ['/']);\n\t\tposition = typeEnd;\n\n\t\tif (!type.length || position >= input.length || !httpTokenCodePoints.test(type)) {\n\t\t\tthrow new TypeError(MediaTypeParser.generateErrorMessage('type', type));\n\t\t}\n\n\t\t++position; // Skip \"/\"\n\t\tconst [ subtype, subtypeEnd ] = MediaTypeParser.collect(input, position, [';'], true, true);\n\t\tposition = subtypeEnd;\n\n\t\tif (!subtype.length || !httpTokenCodePoints.test(subtype)) {\n\t\t\tthrow new TypeError(MediaTypeParser.generateErrorMessage('subtype', subtype));\n\t\t}\n\n\t\tconst parameters = new MediaTypeParameters();\n\n\t\twhile (position < input.length) {\n\t\t\t++position; // Skip \";\"\n\t\t\twhile (whitespaceChars.has(input[position]!)) { ++position }\n\n\t\t\tlet name: string;\n\t\t\t[name, position] = MediaTypeParser.collect(input, position, [';', '='], false);\n\n\t\t\tif (position >= input.length || input[position] === ';') { continue }\n\n\t\t\t++position; // Skip \"=\"\n\n\t\t\tlet value: string;\n\t\t\tif (input[position] === '\"') {\n\t\t\t\t[ value, position ] = MediaTypeParser.collectHttpQuotedString(input, position);\n\t\t\t\twhile (position < input.length && input[position] !== ';') { ++position }\n\t\t\t} else {\n\t\t\t\t[ value, position ] = MediaTypeParser.collect(input, position, [';'], false, true);\n\t\t\t\tif (!value) { continue }\n\t\t\t}\n\n\t\t\tif (name && MediaTypeParameters.isValid(name, value) && !parameters.has(name)) {\n\t\t\t\tparameters.set(name, value);\n\t\t\t}\n\t\t}\n\n\t\treturn { type, subtype, parameters };\n\t}\n\n\t/**\n\t * Gets the name of this class.\n\t * @returns The string tag of this class.\n\t */\n\tget [Symbol.toStringTag](): string {\n\t\treturn 'MediaTypeParser';\n\t}\n\n\t/**\n\t * Collects characters from `input` starting at `pos` until a stop character is found.\n\t * @param input The input string.\n\t * @param pos The starting position.\n\t * @param stopChars Characters that end collection.\n\t * @param lowerCase Whether to ASCII-lowercase the result.\n\t * @param trim Whether to strip trailing HTTP whitespace.\n\t * @returns A tuple of the collected string and the updated position.\n\t */\n\tprivate static collect(input: string, pos: number, stopChars: string[], lowerCase = true, trim = false): [string, number] {\n\t\tlet result = '';\n\t\tfor (const { length } = input; pos < length && !stopChars.includes(input[pos]!); pos++) {\n\t\t\tresult += input[pos];\n\t\t}\n\n\t\tif (lowerCase) { result = result.toLowerCase() }\n\t\tif (trim) { result = result.replace(trailingWhitespace, '') }\n\n\t\treturn [result, pos];\n\t}\n\n\t/**\n\t * Collects all the HTTP quoted strings.\n\t * This variant only implements it with the extract-value flag set.\n\t * @param input The string to process.\n\t * @param position The starting position.\n\t * @returns An array that includes the resulting string and updated position.\n\t */\n\tprivate static collectHttpQuotedString(input: string, position: number): [string, number] {\n\t\tlet value = '';\n\n\t\tfor (let length = input.length, char; ++position < length;) {\n\t\t\tif ((char = input[position]) === '\"') { break }\n\n\t\t\tvalue += char == '\\\\' && ++position < length ? input[position] : char;\n\t\t}\n\n\t\treturn [ value, position ];\n\t}\n\n\t/**\n\t * Generates an error message.\n\t * @param component The component name.\n\t * @param value The component value.\n\t * @returns The error message.\n\t */\n\tprivate static generateErrorMessage(component: string, value: string): string {\n\t\treturn `Invalid ${component} \"${value}\": only HTTP token code points are valid.`;\n\t}\n}", "import { MediaTypeParser } from './media-type-parser.js';\nimport { MediaTypeParameters } from './media-type-parameters.js';\n\n/**\n * Class used to parse media types.\n * @see https://mimesniff.spec.whatwg.org/#understanding-mime-types\n */\nexport class MediaType {\n\tprivate readonly _type: string;\n\tprivate readonly _subtype: string;\n\tprivate readonly _parameters: MediaTypeParameters;\n\n\t/**\n\t * Create a new MediaType instance from a string representation.\n\t * @param mediaType The media type to parse.\n\t * @param parameters Optional parameters.\n\t */\n\tconstructor(mediaType: string, parameters: Record<string, string> = {}) {\n\t\tif (parameters === null || typeof parameters !== 'object' || Array.isArray(parameters)) {\n\t\t\tthrow new TypeError('The parameters argument must be an object');\n\t\t}\n\n\t\t({ type: this._type, subtype: this._subtype, parameters: this._parameters } = MediaTypeParser.parse(mediaType));\n\n\t\tfor (const [ name, value ] of Object.entries(parameters)) { this._parameters.set(name, value) }\n\t}\n\n\t/**\n\t * Parses a media type string.\n\t * @param mediaType The media type to parse.\n\t * @returns The parsed media type or null if the mediaType cannot be parsed.\n\t */\n\tstatic parse(mediaType: string): MediaType | null {\n\t\ttry {\n\t\t\treturn new MediaType(mediaType);\n\t\t} catch {\n\t\t\t// ignore\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Gets the type.\n\t * @returns The type.\n\t */\n\tget type(): string {\n\t\treturn this._type;\n\t}\n\n\t/**\n\t * Gets the subtype.\n\t * @returns The subtype.\n\t */\n\tget subtype(): string {\n\t\treturn this._subtype;\n\t}\n\n\t/**\n\t * Gets the media type essence (type/subtype).\n\t * @returns The media type without any parameters\n\t */\n\tget essence(): string {\n\t\treturn `${this._type}/${this._subtype}`;\n\t}\n\n\t/**\n\t * Gets the parameters.\n\t * @returns The media type parameters.\n\t */\n\tget parameters(): MediaTypeParameters {\n\t\treturn this._parameters;\n\t}\n\n\t/**\n\t * Checks if the media type matches the specified type.\n\t *\n\t * @param mediaType The media type to check.\n\t * @returns true if the media type matches the specified type, false otherwise.\n\t */\n\tmatches(mediaType: MediaType | string): boolean {\n\t\treturn typeof mediaType === 'string' ? this.essence.includes(mediaType) : this._type === mediaType._type && this._subtype === mediaType._subtype;\n\t}\n\n\t/**\n\t * Gets the serialized version of the media type.\n\t *\n\t * @returns The serialized media type.\n\t */\n\ttoString(): string {\n\t\treturn `${this.essence}${this._parameters.toString()}`;\n\t}\n\n\t/**\n\t * Gets the name of the class.\n\t * @returns The class name\n\t */\n\tget [Symbol.toStringTag](): string {\n\t\treturn 'MediaType';\n\t}\n}", "/** A {@link Map} that can contain multiple, unique, values for the same key. */\nexport class SetMultiMap<K, V> extends Map<K, Set<V>>{\n\t/**\n\t * Adds a new element with a specified key and value to the SetMultiMap.\n\t * If an element with the same key already exists, the value will be added to the underlying {@link Set}.\n\t * If the value already exists in the {@link Set}, it will not be added again.\n\t *\n\t * @param key - The key to set.\n\t * @param value - The value to add to the SetMultiMap.\n\t * @returns The SetMultiMap with the updated key and value.\n\t */\n\toverride set(key: K, value: V): this;\n\t/**\n\t * Adds a new Set with a specified key and value to the SetMultiMap.\n\t * If an element with the same key already exists, the value will be added to the underlying {@link Set}.\n\t * If the value already exists in the {@link Set}, it will not be added again.\n\t *\n\t * @param key - The key to set.\n\t * @param value - The set of values to add to the SetMultiMap.\n\t * @returns The SetMultiMap with the updated key and value.\n\t */\n\toverride set(key: K, value: Set<V>): this;\n\t/**\n\t * Adds a new element with a specified key and value to the SetMultiMap.\n\t * If an element with the same key already exists, the value will be added to the underlying {@link Set}.\n\t * If the value already exists in the {@link Set}, it will not be added again.\n\t *\n\t * @param key The key to set.\n\t * @param value The value to add to the SetMultiMap\n\t * @returns The SetMultiMap with the updated key and value.\n\t */\n\toverride set(key: K, value: V | Set<V>): SetMultiMap<K, V> {\n\t\tsuper.set(key, value instanceof Set ? value : (super.get(key) ?? new Set<V>()).add(value));\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Finds a specific value for a specific key using an iterator function.\n\t * @param key The key to find the value for.\n\t * @param iterator The iterator function to use to find the value.\n\t * @returns The value for the specified key\n\t */\n\tfind(key: K, iterator: (value: V) => boolean): V | undefined {\n\t\tconst values = this.get(key);\n\n\t\tif (values !== undefined) {\n\t\t\treturn Array.from(values).find(iterator);\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * Checks if a specific key has a specific value.\n\t *\n\t * @param key The key to check.\n\t * @param value The value to check.\n\t * @returns True if the key has the value, false otherwise.\n\t */\n\thasValue(key: K, value: V): boolean {\n\t\tconst values = super.get(key);\n\n\t\treturn values ? values.has(value) : false;\n\t}\n\n\t/**\n\t * Removes a specific value from a specific key.\n\t * @param key The key to remove the value from.\n\t * @param value The value to remove.\n\t * @returns True if the value was removed, false otherwise.\n\t */\n\tdeleteValue(key: K, value: V | undefined): boolean {\n\t\tif (value === undefined) { return this.delete(key) }\n\n\t\tconst values = super.get(key);\n\t\tif (values) {\n\t\t\tconst deleted = values.delete(value);\n\n\t\t\tif (values.size === 0) {\n\t\t\t\tsuper.delete(key);\n\t\t\t}\n\n\t\t\treturn deleted;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * The string tag of the SetMultiMap.\n\t * @returns The string tag of the SetMultiMap.\n\t */\n\toverride get [Symbol.toStringTag](): string {\n\t\treturn 'SetMultiMap';\n\t}\n}", "import type { EventHandler } from './@types';\n\n/** A wrapper for an event handler that binds a context to the event handler. */\nexport class ContextEventHandler {\n\tprivate readonly context: unknown;\n\tprivate readonly eventHandler: EventHandler;\n\n\t/**\n\t * @param context The context to bind to the event handler.\n\t * @param eventHandler The event handler to call when the event is published.\n\t */\n\tconstructor(context: unknown, eventHandler: EventHandler) {\n\t\tthis.context = context;\n\t\tthis.eventHandler = eventHandler;\n\t}\n\n\t/**\n\t * Call the event handler for the provided event.\n\t *\n\t * @param event The event to handle\n\t * @param data The value to be passed to the event handler as a parameter.\n\t */\n\thandle(event: Event, data?: unknown): void {\n\t\tthis.eventHandler.call(this.context, event, data);\n\t}\n\n\t/**\n\t * A String value that is used in the creation of the default string\n\t * description of an object. Called by the built-in method {@link Object.prototype.toString}.\n\t *\n\t * @returns The default string description of this object.\n\t */\n\tget [Symbol.toStringTag](): string {\n\t\treturn 'ContextEventHandler';\n\t}\n}", "import type { ContextEventHandler } from './context-event-handler';\n\n/** Represents a subscription to an event. */\nexport class Subscription {\n\tprivate readonly _eventName: string;\n\tprivate readonly _contextEventHandler: ContextEventHandler;\n\n\t/**\n\t * @param eventName The event name.\n\t * @param contextEventHandler The context event handler.\n\t */\n\tconstructor(eventName: string, contextEventHandler: ContextEventHandler) {\n\t\tthis._eventName = eventName;\n\t\tthis._contextEventHandler = contextEventHandler;\n\t}\n\n\t/**\n\t * Gets the event name for the subscription.\n\t *\n\t * @returns The event name.\n\t */\n\tget eventName(): string {\n\t\treturn this._eventName;\n\t}\n\n\t/**\n\t * Gets the context event handler.\n\t *\n\t * @returns The context event handler\n\t */\n\tget contextEventHandler(): ContextEventHandler {\n\t\treturn this._contextEventHandler;\n\t}\n\n\t/**\n\t * A String value that is used in the creation of the default string\n\t * description of an object. Called by the built-in method {@link Object.prototype.toString}.\n\t *\n\t * @returns The default string description of this object.\n\t */\n\tget [Symbol.toStringTag](): string {\n\t\treturn 'Subscription';\n\t}\n}", "import { SetMultiMap } from '@d1g1tal/collections/src';\nimport { ContextEventHandler } from './context-event-handler';\nimport { Subscription } from './subscription';\nimport type { EventHandler, ErrorHandler, SubscriptionOptions } from './@types';\n\n/** A class that allows objects to subscribe to events and be notified when the event is published. */\nexport class Subscribr {\n\tprivate readonly subscribers: SetMultiMap<string, ContextEventHandler> = new SetMultiMap();\n\tprivate errorHandler?: ErrorHandler;\n\n\t/**\n\t * Set a custom error handler for handling errors that occur in event listeners.\n\t * If not set, errors will be logged to the console.\n\t *\n\t * @param errorHandler The error handler function to call when an error occurs in an event listener.\n\t */\n\tsetErrorHandler(errorHandler: ErrorHandler): void {\n\t\tthis.errorHandler = errorHandler;\n\t}\n\n\t/**\n\t * Subscribe to an event\n\t *\n\t * @param eventName The event name to subscribe to.\n\t * @param eventHandler The event handler to call when the event is published.\n\t * @param context The context to bind to the event handler.\n\t * @param options Subscription options.\n\t * @returns An object used to check if the subscription still exists and to unsubscribe from the event.\n\t */\n\tsubscribe(eventName: string, eventHandler: EventHandler, context: unknown = eventHandler, options?: SubscriptionOptions): Subscription {\n\t\tthis.validateEventName(eventName);\n\n\t\t// If once option is set, wrap the handler to auto-unsubscribe\n\t\tif (options?.once) {\n\t\t\tconst originalHandler = eventHandler;\n\t\t\teventHandler = (event: Event, data?: unknown) => {\n\t\t\t\toriginalHandler.call(context, event, data);\n\t\t\t\tthis.unsubscribe(subscription);\n\t\t\t};\n\t\t}\n\n\t\tconst contextEventHandler = new ContextEventHandler(context, eventHandler);\n\t\tthis.subscribers.set(eventName, contextEventHandler);\n\n\t\tconst subscription = new Subscription(eventName, contextEventHandler);\n\n\t\treturn subscription;\n\t}\n\n\t/**\n\t * Unsubscribe from the event\n\t *\n\t * @param subscription The subscription to unsubscribe.\n\t * @returns true if eventListener has been removed successfully. false if the value is not found or if the value is not an object.\n\t */\n\tunsubscribe({ eventName, contextEventHandler }: Subscription): boolean {\n\t\tconst contextEventHandlers = this.subscribers.get(eventName) ?? new Set();\n\t\tconst removed = contextEventHandlers.delete(contextEventHandler);\n\n\t\tif (removed && contextEventHandlers.size === 0) {\tthis.subscribers.delete(eventName) }\n\n\t\treturn removed;\n\t}\n\n\t/**\n\t * Publish an event\n\t *\n\t * @template T\n\t * @param eventName The name of the event.\n\t * @param event The event to be handled.\n\t * @param data The value to be passed to the event handler as a parameter.\n\t */\n\tpublish<T>(eventName: string, event: Event = new CustomEvent(eventName), data?: T): void {\n\t\tthis.validateEventName(eventName);\n\t\tthis.subscribers.get(eventName)?.forEach((contextEventHandler: ContextEventHandler) => {\n\t\t\ttry {\n\t\t\t\tcontextEventHandler.handle(event, data);\n\t\t\t} catch (error) {\n\t\t\t\tif (this.errorHandler) {\n\t\t\t\t\tthis.errorHandler(error as Error, eventName, event, data);\n\t\t\t\t} else {\n\t\t\t\t\tconsole.error(`Error in event handler for '${eventName}':`, error);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Check if the event and handler are subscribed.\n\t *\n\t * @param subscription The subscription object.\n\t * @returns true if the event name and handler are subscribed, false otherwise.\n\t */\n\tisSubscribed({ eventName, contextEventHandler }: Subscription): boolean {\n\t\treturn this.subscribers.get(eventName)?.has(contextEventHandler) ?? false;\n\t}\n\n\t/**\n\t * Validate the event name\n\t *\n\t * @param eventName The event name to validate.\n\t * @throws {TypeError} If the event name is not a non-empty string.\n\t * @throws {Error} If the event name has leading or trailing whitespace.\n\t */\n\tprivate validateEventName(eventName: string): void {\n\t\tif (!eventName || typeof eventName !== 'string') {\n\t\t\tthrow new TypeError('Event name must be a non-empty string');\n\t\t}\n\n\t\tif (eventName.trim() !== eventName) {\n\t\t\tthrow new Error('Event name cannot have leading or trailing whitespace');\n\t\t}\n\t}\n\n\t/**\n\t * Clears all subscriptions. The instance should not be used after calling this method.\n\t */\n\tdestroy(): void {\n\t\tthis.subscribers.clear();\n\t}\n\n\t/**\n\t * A String value that is used in the creation of the default string\n\t * description of an object. Called by the built-in method {@link Object.prototype.toString}.\n\t *\n\t * @returns The default string description of this object.\n\t */\n\tget [Symbol.toStringTag](): string {\n\t\treturn 'Subscribr';\n\t}\n}", "import type { ResponseStatus } from '@src/response-status';\nimport type { ResponseBody, RequestTiming, HttpErrorOptions } from '@src/@types/core';\n\n/**\n * An error that represents an HTTP error response.\n * @author D1g1talEntr0py <jason.dimeo@gmail.com>\n */\nclass HttpError extends Error {\n\tprivate readonly _entity: ResponseBody;\n\tprivate readonly responseStatus: ResponseStatus;\n\tprivate readonly _url: URL | undefined;\n\tprivate readonly _method: string | undefined;\n\tprivate readonly _timing: RequestTiming | undefined;\n\n\t/**\n\t * Creates an instance of HttpError.\n\t * @param status The status code and status text of the {@link Response}.\n\t * @param httpErrorOptions The http error options.\n\t */\n\tconstructor(status: ResponseStatus, { message, cause, entity, url, method, timing }: HttpErrorOptions = {}) {\n\t\tsuper(message, { cause });\n\t\tthis._entity = entity;\n\t\tthis.responseStatus = status;\n\t\tthis._url = url;\n\t\tthis._method = method;\n\t\tthis._timing = timing;\n\t}\n\n\t/**\n\t * It returns the value of the private variable #entity.\n\t * @returns The entity property of the class.\n\t */\n\tget entity(): ResponseBody {\n\t\treturn this._entity;\n\t}\n\n\t/**\n\t * It returns the status code of the {@link Response}.\n\t * @returns The status code of the {@link Response}.\n\t */\n\tget statusCode(): number {\n\t\treturn this.responseStatus.code;\n\t}\n\n\t/**\n\t * It returns the status text of the {@link Response}.\n\t * @returns The status code and status text of the {@link Response}.\n\t */\n\tget statusText(): string {\n\t\treturn this.responseStatus?.text;\n\t}\n\n\t/**\n\t * The request URL that caused the error.\n\t * @returns The URL or undefined.\n\t */\n\tget url(): URL | undefined {\n\t\treturn this._url;\n\t}\n\n\t/**\n\t * The HTTP method that was used for the failed request.\n\t * @returns The method string or undefined.\n\t */\n\tget method(): string | undefined {\n\t\treturn this._method;\n\t}\n\n\t/**\n\t * Timing information for the failed request.\n\t * @returns The timing object or undefined.\n\t */\n\tget timing(): RequestTiming | undefined {\n\t\treturn this._timing;\n\t}\n\n\t/**\n\t * A String value representing the name of the error.\n\t * @returns The name of the error.\n\t */\n\toverride get name(): string {\n\t\treturn 'HttpError';\n\t}\n\n\t/**\n\t * A String value that is used in the creation of the default string\n\t * description of an object. Called by the built-in method {@link Object.prototype.toString}.\n\t * @returns The default string description of this object.\n\t */\n\tget [Symbol.toStringTag](): string {\n\t\treturn this.name;\n\t}\n}\n\nexport { HttpError };\nexport type { ResponseBody, RequestTiming, HttpErrorOptions };", "/**\n * A collection of some of the available HTTP media types.\n * @see {@link https://www.iana.org/assignments/media-types/media-types.xhtml | IANA Media Types}\n */\nconst HttpMediaType = {\n\t/** Advanced Audio Coding (AAC) */\n\tAAC: 'audio/aac',\n\t/** AbiWord */\n\tABW: 'application/x-abiword',\n\t/** Archive document (multiple files embedded) */\n\tARC: 'application/x-freearc',\n\t/** AVIF image */\n\tAVIF: 'image/avif',\n\t/** Audio Video Interleave (AVI) */\n\tAVI: 'video/x-msvideo',\n\t/** Amazon Kindle eBook format */\n\tAZW: 'application/vnd.amazon.ebook',\n\t/** Binary Data */\n\tBIN: 'application/octet-stream',\n\t/** Windows OS/2 Bitmap Graphics */\n\tBMP: 'image/bmp',\n\t/** Bzip Archive */\n\tBZIP: 'application/x-bzip',\n\t/** Bzip2 Archive */\n\tBZIP2: 'application/x-bzip2',\n\t/** CD audio */\n\tCDA: 'application/x-cdf',\n\t/** C Shell Script */\n\tCSH: 'application/x-csh',\n\t/** Cascading Style Sheets (CSS) */\n\tCSS: 'text/css',\n\t/** Comma-Separated Values */\n\tCSV: 'text/csv',\n\t/** Microsoft Office Word Document */\n\tDOC: 'application/msword',\n\t/** Microsoft Office Word Document (OpenXML) */\n\tDOCX: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n\t/** Microsoft Embedded OpenType */\n\tEOT: 'application/vnd.ms-fontobject',\n\t/** Electronic Publication (EPUB) */\n\tEPUB: 'application/epub+zip',\n\t/** GZip Compressed Archive */\n\tGZIP: 'application/gzip',\n\t/** Graphics Interchange Format */\n\tGIF: 'image/gif',\n\t/** HyperText Markup Language (HTML) */\n\tHTML: 'text/html',\n\t/** Icon Format */\n\tICO: 'image/vnd.microsoft.icon',\n\t/** iCalendar Format */\n\tICS: 'text/calendar',\n\t/** Java Archive (JAR) */\n\tJAR: 'application/java-archive',\n\t/** JPEG Image */\n\tJPEG: 'image/jpeg',\n\t/** JavaScript */\n\tJAVA_SCRIPT: 'text/javascript',\n\t/** JavaScript Object Notation Format (JSON) */\n\tJSON: 'application/json',\n\t/** JavaScript Object Notation LD Format */\n\tJSON_LD: 'application/ld+json',\n\t/** JavaScript Object Notation (JSON) Merge Patch */\n\tJSON_MERGE_PATCH: 'application/merge-patch+json',\n\t/** Musical Instrument Digital Interface (MIDI) */\n\tMID: 'audio/midi',\n\t/** Musical Instrument Digital Interface (MIDI) */\n\tX_MID: 'audio/x-midi',\n\t/** MP3 Audio */\n\tMP3: 'audio/mpeg',\n\t/** MPEG-4 Audio */\n\tMP4A: 'audio/mp4',\n\t/** MPEG-4 Video */\n\tMP4: 'video/mp4',\n\t/** MPEG Video */\n\tMPEG: 'video/mpeg',\n\t/** Apple Installer Package */\n\tMPKG: 'application/vnd.apple.installer+xml',\n\t/** OpenDocument Presentation Document */\n\tODP: 'application/vnd.oasis.opendocument.presentation',\n\t/** OpenDocument Spreadsheet Document */\n\tODS: 'application/vnd.oasis.opendocument.spreadsheet',\n\t/** OpenDocument Text Document */\n\tODT: 'application/vnd.oasis.opendocument.text',\n\t/** Ogg Audio */\n\tOGA: 'audio/ogg',\n\t/** Ogg Video */\n\tOGV: 'video/ogg',\n\t/** Ogg */\n\tOGX: 'application/ogg',\n\t/** Opus audio */\n\tOPUS: 'audio/opus',\n\t/** OpenType Font File */\n\tOTF: 'font/otf',\n\t/** Portable Network Graphics (PNG) */\n\tPNG: 'image/png',\n\t/** Adobe Portable Document Format */\n\tPDF: 'application/pdf',\n\t/** Hypertext Preprocessor (Personal Home Page) */\n\tPHP: 'application/x-httpd-php',\n\t/** Microsoft PowerPoint */\n\tPPT: 'application/vnd.ms-powerpoint',\n\t/** Microsoft Office Presentation (OpenXML) */\n\tPPTX: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n\t/** RAR Archive */\n\tRAR: 'application/vnd.rar',\n\t/** Rich Text Format */\n\tRTF: 'application/rtf',\n\t/** Bourne Shell Script */\n\tSH: 'application/x-sh',\n\t/** Scalable Vector Graphics (SVG) */\n\tSVG: 'image/svg+xml',\n\t/** Tape Archive (TAR) */\n\tTAR: 'application/x-tar',\n\t/** Tagged Image File Format (TIFF) */\n\tTIFF: 'image/tiff',\n\t/** MPEG transport stream */\n\tTRANSPORT_STREAM: 'video/mp2t',\n\t/** TrueType Font */\n\tTTF: 'font/ttf',\n\t/** Text, (generally ASCII or ISO 8859-n) */\n\tTEXT: 'text/plain',\n\t/** Microsoft Visio */\n\tVSD: 'application/vnd.visio',\n\t/** Waveform Audio Format (WAV) */\n\tWAV: 'audio/wav',\n\t/** Open Web Media Project - Audio */\n\tWEBA: 'audio/webm',\n\t/** Open Web Media Project - Video */\n\tWEBM: 'video/webm',\n\t/** WebP Image */\n\tWEBP: 'image/webp',\n\t/** Web Open Font Format */\n\tWOFF: 'font/woff',\n\t/** Web Open Font Format */\n\tWOFF2: 'font/woff2',\n\t/** Form - Encoded */\n\tFORM: 'application/x-www-form-urlencoded',\n\t/** Multipart FormData */\n\tMULTIPART_FORM_DATA: 'multipart/form-data',\n\t/** XHTML - The Extensible HyperText Markup Language */\n\tXHTML: 'application/xhtml+xml',\n\t/** Microsoft Excel Document */\n\tXLS: 'application/vnd.ms-excel',\n\t/** Microsoft Office Spreadsheet Document (OpenXML) */\n\tXLSX: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n\t/** Extensible Markup Language (XML) */\n\tXML: 'application/xml',\n\t/** XML User Interface Language (XUL) */\n\tXUL: 'application/vnd.mozilla.xul+xml',\n\t/** Zip Archive */\n\tZIP: 'application/zip',\n\t/** 3GPP audio/video container */\n\t'3GP': 'video/3gpp',\n\t/** 3GPP2 audio/video container */\n\t'3G2': 'video/3gpp2',\n\t/** 7-Zip Archive */\n\t'7Z': 'application/x-7z-compressed'\n} as const;\n\nexport { HttpMediaType };", "/**\n * Defining a constant object with all the HTTP request headers.\n */\nconst HttpRequestHeader = {\n\t/**\n\t * Content-Types that are acceptable for the response. See Content negotiation. Permanent.\n\t *\n\t * @example\n\t * <code>Accept: text/plain</code>\n\t */\n\tACCEPT: 'accept',\n\t/**\n\t * Character sets that are acceptable. Permanent.\n\t *\n\t * @example\n\t * <code>Accept-Charset: utf-8</code>\n\t */\n\tACCEPT_CHARSET: 'accept-charset',\n\t/**\n\t * List of acceptable encodings. See HTTP compression. Permanent.\n\t *\n\t * @example\n\t * <code>Accept-Encoding: gzip, deflate</code>\n\t */\n\tACCEPT_ENCODING: 'accept-encoding',\n\t/**\n\t * List of acceptable human languages for response. See Content negotiation. Permanent.\n\t *\n\t * @example\n\t * <code>Accept-Language: en-US</code>\n\t */\n\tACCEPT_LANGUAGE: 'accept-language',\n\t/**\n\t * Authentication credentials for HTTP authentication. Permanent.\n\t *\n\t * @example\n\t * <code>Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==</code>\n\t */\n\tAUTHORIZATION: 'authorization',\n\t/**\n\t * Used to specify directives that must be obeyed by all caching mechanisms along the request-response chain.\n\t * Permanent.\n\t *\n\t * @example\n\t * <code>Cache-Control: no-cache</code>\n\t */\n\tCACHE_CONTROL: 'cache-control',\n\t/**\n\t * Control options for the current connection and list of hop-by-hop request fields. Permanent.\n\t *\n\t * @example\n\t * <code>Connection: keep-alive</code>\n\t * <code>Connection: Upgrade</code>\n\t */\n\tCONNECTION: 'connection',\n\t/**\n\t * An HTTP cookie previously sent by the server with Set-Cookie (below). Permanent: standard.\n\t *\n\t * @example\n\t * <code>Cookie: $Version=1, Skin=new,</code>\n\t */\n\tCOOKIE: 'cookie',\n\t/**\n\t * The length of the request body in octets (8-bit bytes). Permanent.\n\t *\n\t * @example\n\t * <code>Content-Length: 348</code>\n\t */\n\tCONTENT_LENGTH: 'content-length',\n\t/**\n\t * A Base64-encoded binary MD5 sum of the content of the request body. Obsolete.\n\t *\n\t * @example\n\t * <code>Content-MD5: Q2hlY2sgSW50ZWdyaXR5IQ==</code>\n\t */\n\tCONTENT_MD5: 'content-md5',\n\t/**\n\t * The MIME type of the body of the request (used with POST and PUT requests). Permanent.\n\t * <code>Content-Type: application/x-www-form-urlencoded</code>\n\t */\n\tCONTENT_TYPE: 'content-type',\n\t/**\n\t * The date and time that the message was sent (in \"HTTP-date\" format as defined by RFC 7231 Date/Time Formats).\n\t * Permanent.\n\t *\n\t * @example\n\t * <code>Date: Tue, 15 Nov 1994 08:12:31 GMT</code>\n\t */\n\tDATE: 'date',\n\t/**\n\t * The domain name of the server (for virtual hosting), and the TCP port number on which the server is listening. The\n\t * port number may be omitted if the port is the standard port for the service requested. Permanent. Mandatory since\n\t * HTTP/1.1.\n\t *\n\t * @example\n\t * <code>Host: en.wikipedia.org:80</code>\n\t * <code>Host: en.wikipedia.org</code>\n\t */\n\tHOST: 'host',\n\t/**\n\t * Only perform the action if the client supplied entity matches the same entity on the server. This is mainly for\n\t * methods like PUT to only update a resource if it has not been modified since the user last updated it. Permanent.\n\t *\n\t * @example\n\t * <code>If-Match: \"737060cd8c284d8af7ad3082f209582d\"</code>\n\t */\n\tIF_MATCH: 'if-match',\n\t/**\n\t * Allows a 304 Not Modified to be returned if content is unchanged. Permanent.\n\t *\n\t * @example\n\t * <code>If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT</code>\n\t */\n\tIF_MODIFIED_SINCE: 'if-modified-since',\n\t/**\n\t * Allows a 304 Not Modified to be returned if content is unchanged, see HTTP ETag. Permanent.\n\t *\n\t * @example\n\t * <code>If-None-Match: \"737060cd8c284d8af7ad3082f209582d\"</code>\n\t */\n\tIF_NONE_MATCH: 'if-none-match',\n\t/**\n\t * If the entity is unchanged, send me the part(s) that I am missing, otherwise, send me the entire new entity.\n\t * Permanent.\n\t *\n\t * @example\n\t * <code>If-Range: \"737060cd8c284d8af7ad3082f209582d\"</code>\n\t */\n\tIF_RANGE: 'if-range',\n\t/**\n\t * Only send the response if the entity has not been modified since a specific time. Permanent.\n\t *\n\t * @example\n\t * <code>If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT</code>\n\t */\n\tIF_UNMODIFIED_SINCE: 'if-unmodified-since',\n\t/**\n\t * Limit the number of times the message can be forwarded through proxies or gateways. Permanent.\n\t *\n\t * @example\n\t * <code>Max-Forwards: 10</code>\n\t */\n\tMAX_FORWARDS: 'max-forwards',\n\t/**\n\t * Initiates a request for cross-origin resource sharing (asks server for an 'Access-Control-Allow-Origin' response\n\t * field). Permanent: standard.\n\t *\n\t * @example\n\t * <code>Origin: http://www.example-social-network.com</code>\n\t */\n\tORIGIN: 'origin',\n\t/**\n\t * Implementation-specific fields that may have various effects anywhere along the request-response chain. Permanent.\n\t *\n\t * @example\n\t * <code>Pragma: no-cache</code>\n\t */\n\tPRAGMA: 'pragma',\n\t/**\n\t * Authorization credentials for connecting to a proxy. Permanent.\n\t *\n\t * @example\n\t * <code>Proxy-Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==</code>\n\t */\n\tPROXY_AUTHORIZATION: 'proxy-authorization',\n\t/**\n\t * Request only part of an entity. Bytes are numbered from 0. See Byte serving. Permanent.\n\t *\n\t * @example\n\t * <code>Range: bytes=500-999</code>\n\t */\n\tRANGE: 'range',\n\t/**\n\t * This is the address of the previous web page from which a link to the currently requested page was followed. (The\n\t * word \"referrer\" has been misspelled in the RFC as well as in most implementations to the point that it has become\n\t * standard usage and is considered correct terminology). Permanent.\n\t *\n\t * @example\n\t * <code>Referer: http://en.wikipedia.org/wiki/Main_Page</code>\n\t */\n\tREFERER: 'referer',\n\t/**\n\t * The transfer encodings the user agent is willing to accept: the same values as for the response header field\n\t * Transfer-Encoding can be used, plus the \"trailers\" value (related to the \"chunked\" transfer method) to notify the\n\t * server it expects to receive additional fields in the trailer after the last, zero-sized, chunk. Permanent.\n\t *\n\t * @example\n\t * <code>TE: trailers, deflate</code>\n\t */\n\tTE: 'te',\n\t/**\n\t * The user agent string of the user agent. Permanent.\n\t *\n\t * @example\n\t * <code>User-Agent: Mozilla/5.0 (X11, Linux x86_64, rv:12.0) Gecko/20100101 Firefox/21.0</code>\n\t */\n\tUSER_AGENT: 'user-agent',\n\t/**\n\t * Ask the server to upgrade to another protocol. Permanent.\n\t *\n\t * @example\n\t * <code>Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11</code>\n\t */\n\tUPGRADE: 'upgrade',\n\t/**\n\t * A general warning about possible problems with the entity body. Permanent.\n\t *\n\t * @example\n\t * <code>Warning: 199 Miscellaneous warning</code>\n\t */\n\tWARNING: 'warning',\n\t/**\n\t * mainly used to identify Ajax requests. Most JavaScript frameworks send this field with value of XMLHttpRequest.\n\t *\n\t * @example\n\t * <code>X-Requested-With: XMLHttpRequest</code>\n\t */\n\tX_REQUESTED_WITH: 'x-requested-with',\n\t/**\n\t * A de facto standard for identifying the originating IP address of a client connecting to a web server through an\n\t * HTTP proxy or load balancer.\n\t *\n\t * @example\n\t * <code>X-Forwarded-For: client1, proxy1, proxy2</code>\n\t * <code>X-Forwarded-For: 129.78.138.66, 129.78.64.103</code>\n\t */\n\tX_FORWARDED_FOR: 'x-forwarded-for',\n\t/**\n\t * A de facto standard for identifying the original host requested by the client in the Host HTTP request header, since\n\t * the host name and/or port of the reverse proxy (load balancer) may differ from the origin server handling the\n\t * request.\n\t *\n\t * @example\n\t * <code>X-Forwarded-Host: en.wikipedia.org:80</code>\n\t * <code>X-Forwarded-Host: en.wikipedia.org</code>\n\t */\n\tX_FORWARDED_HOST: 'x-forwarded-host',\n\t/**\n\t * A de facto standard for identifying the originating protocol of an HTTP request, since a reverse proxy (load\n\t * balancer) may communicate with a web server using HTTP even if the request to the reverse proxy is HTTPS. An\n\t * alternative form of the header (X-ProxyUser-Ip) is used by Google clients talking to Google servers.\n\t *\n\t * @example\n\t * <code>X-Forwarded-Proto: https</code>\n\t */\n\tX_FORWARDED_PROTO: 'x-forwarded-proto'\n} as const;\n\nexport { HttpRequestHeader };\n// export type HttpRequestHeader = (typeof HttpRequestHeader)[keyof typeof HttpRequestHeader];", "/**\n * Defining a constant object with the name HttpRequestMethod.\n */\nconst HttpRequestMethod = {\n\t/**\n\t * The OPTIONS method represents a request for information about the communication options available on the\n\t * request/response chain identified by the Request-URI. This method allows the client to determine the options and/or\n\t * requirements associated with a resource, or the capabilities of a server, without implying a resource action or\n\t * initiating a resource retrieval.\n\t *\n\t * Responses to this method are not cacheable.\n\t *\n\t * If the OPTIONS request includes an entity-body (as indicated by the presence of Content-Length or\n\t * Transfer-Encoding), then the media type MUST be indicated by a Content-Type field. Although this specification does\n\t * not define any use for such a body, future extensions to HTTP might use the OPTIONS body to make more detailed\n\t * queries on the server. A server that does not support such an extension MAY discard the request body.\n\t *\n\t * If the Request-URI is an asterisk (\"*\"), the OPTIONS request is intended to apply to the server in general rather\n\t * than to a specific resource. Since a server's communication options typically depend on the resource, the \"*\"\n\t * request is only useful as a \"ping\" or \"no-op\" type of method, it does nothing beyond allowing the client to test the\n\t * capabilities of the server. For example, this can be used to test a proxy for HTTP/1.1 compliance (or lack thereof).\n\t *\n\t * If the Request-URI is not an asterisk, the OPTIONS request applies only to the options that are available when\n\t * communicating with that resource.\n\t *\n\t * A 200 response SHOULD include any header fields that indicate optional features implemented by the server and\n\t * applicable to that resource (e.g., Allow), possibly including extensions not defined by this specification. The\n\t * response body, if any, SHOULD also include information about the communication options. The format for such a body\n\t * is not defined by this specification, but might be defined by future extensions to HTTP. Content negotiation MAY be\n\t * used to select the appropriate response format. If no response body is included, the response MUST include a\n\t * Content-Length field with a field-value of \"0\".\n\t *\n\t * The Max-Forwards request-header field MAY be used to target a specific proxy in the request chain. When a proxy\n\t * receives an OPTIONS request on an absoluteURI for which request forwarding is permitted, the proxy MUST check for a\n\t * Max-Forwards field. If the Max-Forwards field-value is zero (\"0\"), the proxy MUST NOT forward the message, instead,\n\t * the proxy SHOULD respond with its own communication options. If the Max-Forwards field-value is an integer greater\n\t * than zero, the proxy MUST decrement the field-value when it forwards the request. If no Max-Forwards field is\n\t * present in the request, then the forwarded request MUST NOT include a Max-Forwards field.\n\t */\n\tOPTIONS: 'OPTIONS',\n\t/**\n\t * The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. If\n\t * the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the entity in\n\t * the response and not the source text of the process, unless that text happens to be the output of the process.\n\t *\n\t * The semantics of the GET method change to a \"conditional GET\" if the request message includes an If-Modified-Since;\n\t * If-Unmodified-Since, If-Match, If-None-Match, or If-Range header field. A conditional GET method requests that the\n\t * entity be transferred only under the circumstances described by the conditional header field(s). The conditional GET\n\t * method is intended to reduce unnecessary network usage by allowing cached entities to be refreshed without requiring\n\t * multiple requests or transferring data already held by the client.\n\t *\n\t * The semantics of the GET method change to a \"partial GET\" if the request message includes a Range header field. A\n\t * partial GET requests that only part of the entity be transferred, as described in section 14.35. The partial GET\n\t * method is intended to reduce unnecessary network usage by allowing partially-retrieved entities to be completed\n\t * without transferring data already held by the client.\n\t *\n\t * The response to a GET request is cacheable if and only if it meets the requirements for HTTP caching described in\n\t * section 13.\n\t *\n\t * See section 15.1.3 for security considerations when used for forms.\n\t */\n\tGET: 'GET',\n\t/**\n\t * The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. The\n\t * meta information contained in the HTTP headers in response to a HEAD request SHOULD be identical to the information\n\t * sent in response to a GET request. This method can be used for obtaining meta information about the entity implied by\n\t * the request without transferring the entity-body itself. This method is often used for testing hypertext links for\n\t * validity, accessibility, and recent modification.\n\t *\n\t * The response to a HEAD request MAY be cacheable in the sense that the information contained in the response MAY be\n\t * used to update a previously cached entity from that resource. If the new field values indicate that the cached\n\t * entity differs from the current entity (as would be indicated by a change in Content-Length, Content-MD5, ETag or\n\t * Last-Modified), then the cache MUST treat the cache entry as stale.\n\t */\n\tHEAD: 'HEAD',\n\t/**\n\t * The POST method is used to request that the origin server accept the entity enclosed in the request as a new\n\t * subordinate of the resource identified by the Request-URI in the Request-Line. POST is designed to allow a uniform\n\t * method to cover the following functions:\n\t * <ul>\n\t * <li>Annotation of existing resources,</li>\n\t * <li>Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles,</li>\n\t * <li>Providing a block of data, such as the result of submitting a form, to a data-handling process,</li>\n\t * <li>Extending a database through an append operation.</li>\n\t * </ul>\n\t *\n\t * The actual function performed by the POST method is determined by the server and is usually dependent on the\n\t * Request-URI. The posted entity is subordinate to that URI in the same way that a file is subordinate to a directory\n\t * containing it, a news article is subordinate to a newsgroup to which it is posted, or a record is subordinate to a\n\t * database.\n\t *\n\t * The action performed by the POST method might not result in a resource that can be identified by a URI. In this\n\t * case, either 200 (OK) or 204 (No Content) is the appropriate response status, depending on whether or not the\n\t * response includes an entity that describes the result.\n\t *\n\t * If a resource has been created on the origin server, the response SHOULD be 201 (Created) and contain an entity\n\t * which describes the status of the request and refers to the new resource, and a Location header (see section 14.30).\n\t *\n\t * Responses to this method are not cacheable, unless the response includes appropriate Cache-Control or Expires header\n\t * fields. However, the 303 (See Other) response can be used to direct the user agent to retrieve a cacheable resource.\n\t *\n\t * POST requests MUST obey the message transmission requirements set out in section 8.2.\n\t *\n\t * See section 15.1.3 for security considerations.\n\t */\n\tPOST: 'POST',\n\t/**\n\t * The PUT method requests that the enclosed entity be stored under the supplied Request-URI. If the Request-URI refers\n\t * to an already existing resource, the enclosed entity SHOULD be considered as a modified version of the one residing\n\t * on the origin server. If the Request-URI does not point to an existing resource, and that URI is capable of being\n\t * defined as a new resource by the requesting user agent, the origin server can create the resource with that URI. If\n\t * a new resource is created, the origin server MUST inform the user agent via the 201 (Created) response. If an\n\t * existing resource is modified, either the 200 (OK) or 204 (No Content) response codes SHOULD be sent to indicate\n\t * successful completion of the request. If the resource could not be created or modified with the Request-URI, an\n\t * appropriate error response SHOULD be given that reflects the nature of the problem. The recipient of the entity MUST\n\t * \\NOT ignore any Content-* (e.g. Content-Range) headers that it does not understand or implement and MUST return a\n\t * 501 (Not Implemented) response in such cases.\n\t *\n\t * If the request passes through a cache and the Request-URI identifies one or more currently cached entities, those\n\t * entries SHOULD be treated as stale. Responses to this method are not cacheable.\n\t *\n\t * The fundamental difference between the POST and PUT requests is reflected in the different meaning of the\n\t * Request-URI. The URI in a POST request identifies the resource that will handle the enclosed entity. That resource\n\t * might be a data-accepting process, a gateway to some other protocol, or a separate entity that accepts annotations.\n\t * In contrast, the URI in a PUT request identifies the entity enclosed with the request -- the user agent knows what\n\t * URI is intended and the server MUST NOT attempt to apply the request to some other resource. If the server desires\n\t * that the request be applied to a different URI, it MUST send a 301 (Moved Permanently) response, the user agent MAY\n\t * then make its own decision regarding whether or not to redirect the request.\n\t *\n\t * A single resource MAY be identified by many different URIs. For example, an article might have a URI for identifying\n\t * \"the current version\" which is separate from the URI identifying each particular version. In this case, a PUT\n\t * request on a general URI might result in several other URIs being defined by the origin server.\n\t *\n\t * HTTP/1.1 does not define how a PUT method affects the state of an origin server.\n\t *\n\t * PUT requests MUST obey the message transmission requirements set out in section 8.2.\n\t *\n\t * Unless otherwise specified for a particular entity-header, the entity-headers in the PUT request SHOULD be applied\n\t * to the resource created or modified by the PUT.\n\t */\n\tPUT: 'PUT',\n\t/**\n\t * The DELETE method requests that the origin server delete the resource identified by the Request-URI. This method MAY\n\t * be overridden by human intervention (or other means) on the origin server. The client cannot be guaranteed that the\n\t * operation has been carried out, even if the status code returned from the origin server indicates that the action\n\t * has been completed successfully. However, the server SHOULD NOT indicate success unless, at the time the response\n\t * is given, it intends to delete the resource or move it to an inaccessible location.\n\t *\n\t * A successful response SHOULD be 200 (OK) if the response includes an entity describing the status, 202 (Accepted) if\n\t * the action has not yet been enacted, or 204 (No Content) if the action has been enacted but the response does not\n\t * include an entity.\n\t *\n\t * If the request passes through a cache and the Request-URI identifies one or more currently cached entities, those\n\t * entries SHOULD be treated as stale. Responses to this method are not cacheable.\n\t */\n\tDELETE: 'DELETE',\n\t/**\n\t * The TRACE method is used to invoke a remote, application-layer loop- back of the request message. The final\n\t * recipient of the request SHOULD reflect the message received back to the client as the entity-body of a 200 (OK)\n\t * response. The final recipient is either the origin server or the first proxy or gateway to receive a Max-Forwards\n\t * value of zero (0) in the request (see section 14.31). A TRACE request MUST NOT include an entity.\n\t *\n\t * TRACE allows the client to see what is being received at the other end of the request chain and use that data for\n\t * testing or diagnostic information. The value of the Via header field (section 14.45) is of particular interest,\n\t * since it acts as a trace of the request chain. Use of the Max-Forwards header field allows the client to limit the\n\t * length of the request chain, which is useful for testing a chain of proxies forwarding messages in an infinite loop.\n\t *\n\t * If the request is valid, the response SHOULD contain the entire request message in the entity-body, with a\n\t * Content-Type of \"message/http\". Responses to this method MUST NOT be cached.\n\t */\n\tTRACE: 'TRACE',\n\t/**\n\t * This specification reserves the method name CONNECT for use with a proxy that can dynamically switch to being a\n\t * tunnel (e.g. SSL tunneling [44]).\n\t */\n\tCONNECT: 'CONNECT',\n\t/**\n\t * The PATCH method requests that a set of changes described in the\n\t * request entity be applied to the resource identified by the Request-\n\t * URI. The set of changes is represented in a format called a \"patch\n\t * document\" identified by a media type. If the Request-URI does not\n\t * point to an existing resource, the server MAY create a new resource,\n\t * depending on the patch document type (whether it can logically modify\n\t * a null resource) and permissions, etc.\n\t *\n\t * The difference between the PUT and PATCH requests is reflected in the\n\t * way the server processes the enclosed entity to modify the resource\n\t * identified by the Request-URI. In a PUT request, the enclosed entity\n\t * is considered to be a modified version of the resource stored on the\n\t * origin server, and the client is requesting that the stored version\n\t * be replaced. With PATCH, however, the enclosed entity contains a set\n\t * of instructions describing how a resource currently residing on the\n\t * origin server should be modified to produce a new version. The PATCH\n\t * method affects the resource identified by the Request-URI, and it\n\t * also MAY have side effects on other resources; i.e., new resources\n\t * may be created, or existing ones modified, by the application of a\n\t * PATCH.\n\t *\n\t * PATCH is neither safe nor idempotent as defined by [RFC2616], Section\n\t * 9.1.\n\t *\n\t * A PATCH request can be issued in such a way as to be idempotent,\n\t * which also helps prevent bad outcomes from collisions between two\n\t * PATCH requests on the same resource in a similar time frame.\n\t * Collisions from multiple PATCH requests may be more dangerous than\n\t * PUT collisions because some patch formats need to operate from a\n\t * known base-point or else they will corrupt the resource. Clients\n\t * using this kind of patch application SHOULD use a conditional request\n\t * such that the request will fail if the resource has been updated\n\t * since the client last accessed the resource. For example, the client\n\t * can use a strong ETag [RFC2616] in an If-Match header on the PATCH\n\t * request.\n\t *\n\t * There are also cases where patch formats do not need to operate from\n\t * a known base-point (e.g., appending text lines to log files, or non-\n\t * colliding rows to database tables), in which case the same care in\n\t * client requests is not needed.\n\t *\n\t * The server MUST apply the entire set of changes atomically and never\n\t * provide (e.g., in response to a GET during this operation) a\n\t * partially modified representation. If the entire patch document\n\t * cannot be successfully applied, then the server MUST NOT apply any of\n\t * the changes. The determination of what constitutes a successful\n\t * PATCH can vary depending on the patch document and the type of\n\t * resource(s) being modified. For example, the common 'diff' utility\n\t * can generate a patch document that applies to multiple files in a\n\t * directory hierarchy. The atomicity requirement holds for all\n\t * directly affected files. See \"Error Handling\", Section 2.2, for\n\t * details on status codes and possible error conditions.\n\t *\n\t * If the request passes through a cache and the Request-URI identifies\n\t * one or more currently cached entities, those entries SHOULD be\n\t * treated as stale. A response to this method is only cacheable if it\n\t * contains explicit freshness information (such as an Expires header or\n\t * \"Cache-Control: max-age\" directive) as well as the Content-Location\n\t * header matching the Request-URI, indicating that the PATCH response\n\t * body is a resource representation. A cached PATCH response can only\n\t * be used to respond to subsequent GET and HEAD requests; it MUST NOT\n\t * be used to respond to other methods (in particular, PATCH).\n\t *\n\t * Note that entity-headers contained in the request apply only to the\n\t * contained patch document and MUST NOT be applied to the resource\n\t * being modified. Thus, a Content-Language header could be present on\n\t * the request, but it would only mean (for whatever that's worth) that\n\t * the patch document had a language. Servers SHOULD NOT store such\n\t * headers except as trace information, and SHOULD NOT use such header\n\t * values the same way they might be used on PUT requests. Therefore,\n\t * this document does not specify a way to modify a document's Content-\n\t * Type or Content-Language value through headers, though a mechanism\n\t * could well be designed to achieve this goal through a patch document.\n\t *\n\t * There is no guarantee that a resource can be modified with PATCH.\n\t * Further, it is expected that different patch document formats will be\n\t * appropriate for different types of resources and that no single\n\t * format will be appropriate for all types of resources. Therefore,\n\t * there is no single default patch document format that implementations\n\t * are required to support. Servers MUST ensure that a received patch\n\t * document is appropriate for the type of resource identified by the\n\t * Request-URI.\n\t *\n\t * Clients need to choose when to use PATCH rather than PUT. For\n\t * example, if the patch document size is larger than the size of the\n\t * new resource data that would be used in a PUT, then it might make\n\t * sense to use PUT instead of PATCH. A comparison to POST is even more\n\t * difficult, because POST is used in widely varying ways and can\n\t * encompass PUT and PATCH-like operations if the server chooses. If\n\t * the operation does not modify the resource identified by the Request-\n\t * URI in a predictable way, POST should be considered instead of PATCH\n\t * or PUT.\n\t */\n\tPATCH: 'PATCH'\n} as const;\n\nexport { HttpRequestMethod };", "/** Defining a constant object HTTP response headers */\nconst HttpResponseHeader = {\n\t/**\n\t * Implemented as a misunderstanding of the HTTP specifications. Common because of mistakes in implementations of early HTTP versions. Has exactly the same functionality as standard Connection field.\n\t *\n\t * @example\n\t * proxy-connection: keep-alive\n\t */\n\tPROXY_CONNECTION: 'proxy-connection',\n\t/**\n\t * Server-side deep packet insertion of a unique ID identifying customers of Verizon Wireless, also known as \"perma-cookie\" or \"supercookie\"\n\t *\n\t * @example\n\t * x-uidh: ...\n\t */\n\tX_UIDH: 'x-uidh',\n\t/**\n\t * Used to prevent cross-site request forgery. Alternative header names are: X-CSRFToken and X-XSRF-TOKEN\n\t *\n\t * @example\n\t * x-csrf-token: i8XNjC4b8KVok4uw5RftR38Wgp2BFwql\n\t */\n\tX_CSRF_TOKEN: 'x-csrf-token',\n\t/**\n\t * Specifying which web sites can participate in cross-origin resource sharing\n\t *\n\t * @example\n\t * access-control-allow-origin: *\n\t * Provisional\n\t */\n\tACCESS_CONTROL_ALLOW_ORIGIN: 'access-control-allow-origin',\n\t/**\n\t * Specifies which patch document formats this server supports\n\t *\n\t * @example\n\t * accept-patch: text/example,charset=utf-8\n\t * Permanent\n\t */\n\tACCEPT_PATCH: 'accept-patch',\n\t/**\n\t * What partial content range types this server supports via byte serving\n\t *\n\t * @example\n\t * accept-ranges: bytes\n\t * Permanent\n\t */\n\tACCEPT_RANGES: 'accept-ranges',\n\t/**\n\t * The age the object has been in a proxy cache in seconds\n\t *\n\t * @example\n\t * age: 12\n\t * Permanent\n\t */\n\tAGE: 'age',\n\t/**\n\t * Valid actions for a specified resource. To be used for a 405 Method not allowed\n\t *\n\t * @example\n\t * allow: GET, HEAD\n\t * Permanent\n\t */\n\tALLOW: 'allow',\n\t/**\n\t * Tells all caching mechanisms from server to client whether they may cache this object. It is measured in seconds\n\t *\n\t * @example\n\t * cache-control: max-age=3600\n\t * Permanent\n\t */\n\tCACHE_CONTROL: 'cache-control',\n\t/**\n\t * Control options for the current connection and list of hop-by-hop response fields\n\t *\n\t * @example\n\t * connection: close\n\t * Permanent\n\t */\n\tCONNECTION: 'connection',\n\t/**\n\t * An opportunity to raise a \"File Download\" dialogue box for a known MIME type with binary format or suggest a filename for dynamic content. Quotes are necessary with special characters.\n\t *\n\t * @example\n\t * content-disposition: attachment, filename=\"fname.ext\"\n\t * Permanent\n\t */\n\tCONTENT_DISPOSITION: 'content-disposition',\n\t/**\n\t * The type of encoding used on the data. See HTTP compression.\n\t *\n\t * @example\n\t * content-encoding: gzip\n\t * Permanent\n\t */\n\tCONTENT_ENCODING: 'content-encoding',\n\t/**\n\t * The natural language or languages of the intended audience for the enclosed content\n\t *\n\t * @example\n\t * content-language: da\n\t * Permanent\n\t */\n\tCONTENT_LANGUAGE: 'content-language',\n\t/**\n\t * The length of the response body in octets (8-bit bytes)\n\t *\n\t * @example\n\t * content-length: 348\n\t * Permanent\n\t */\n\tCONTENT_LENGTH: 'content-length',\n\t/**\n\t * An alternate location for the returned data\n\t *\n\t * @example\n\t * content-location: /index.htm\n\t * Permanent\n\t */\n\tCONTENT_LOCATION: 'content-location',\n\t/**\n\t * Where in a full body message this partial message belongs\n\t *\n\t * @example\n\t * content-range: bytes 21010-47021/47022\n\t * Permanent\n\t */\n\tCONTENT_RANGE: 'content-range',\n\t/**\n\t * The MIME type of this content\n\t *\n\t * @example\n\t * content-type: text/html, charset=utf-8\n\t * Permanent\n\t */\n\tCONTENT_TYPE: 'content-type',\n\t/**\n\t * The date and time that the message was sent (in \"HTTP-date\" format as defined by RFC 7231)\n\t *\n\t * @example\n\t * date: Tue, 15 Nov 1994 08:12:31 GMT\n\t * Permanent\n\t */\n\tDATE: 'date',\n\t/**\n\t * An identifier for a specific version of a resource, often a message digest\n\t *\n\t * @example\n\t * etag: \"737060cd8c284d8af7ad3082f209582d\"\n\t * Permanent\n\t */\n\tETAG: 'etag',\n\t/**\n\t * Gives the date/time after which the response is considered stale (in \"HTTP-date\" format as defined by RFC 7231)\n\t *\n\t * @example\n\t * expires: Thu, 01 Dec 1994 16:00:00 GMT\n\t * Permanent\n\t */\n\tEXPIRES: 'expires',\n\t/**\n\t * The last modified date for the requested object (in \"HTTP-date\" format as defined by RFC 7231)\n\t *\n\t * @example\n\t * last-modified: Tue, 15 Nov 1994 12:45:26 GMT\n\t * Permanent\n\t */\n\tLAST_MODIFIED: 'last-modified',\n\t/**\n\t * Used to express a typed relationship with another resource, where the relation type is defined by RFC 5988\n\t *\n\t * @example\n\t * link: </feed>, rel=\"alternate\"\n\t * Permanent\n\t */\n\tLINK: 'link',\n\t/**\n\t * Used in redirection, or when a new resource has been created.\n\t *\n\t * @example\n\t * location: http://www.w3.org/pub/WWW/People.html\n\t * Permanent\n\t */\n\tLOCATION: 'location',\n\t/**\n\t * This field is supposed to set P3P policy, in the form of P3P:CP=\"your_compact_policy\". However, P3P did not take off, most browsers have never fully\n\t * implemented it, a lot of websites set this field with fake policy text, that was enough to fool browsers the existence of P3P policy and grant permissions for third party cookies.\n\t *\n\t * @example\n\t * p3p: CP=\"This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info.\"\n\t * Permanent\n\t */\n\tP3P: 'p3p',\n\t/**\n\t * Implementation-specific fields that may have various effects anywhere along the request-response chain.\n\t *\n\t * @example\n\t * pragma: no-cache\n\t * Permanent\n\t */\n\tPRAGMA: 'pragma',\n\t/**\n\t * Request authentication to access the proxy.\n\t *\n\t * @example\n\t * proxy-authenticate: Basic\n\t * Permanent\n\t */\n\tPROXY_AUTHENTICATION: 'proxy-authenticate',\n\t/**\n\t * HTTP Public Key Pinning, announces hash of website's authentic TLS certificate\n\t *\n\t * @example\n\t * public-key-pins: max-age=2592000, pin-sha256=\"E9CZ9INDbd+2eRQozYqqbQ2yXLVKB9+xcprMF+44U1g=\",\n\t * Permanent\n\t */\n\tPUBLIC_KEY_PINS: 'public-key-pins',\n\t/**\n\t * If an entity is temporarily unavailable, this instructs the client to try again later. Value could be a specified period of time (in seconds) or a HTTP-date.\n\t *\n\t * @example\n\t * retry-after: 120\n\t * retry-after: Fri, 07 Nov 2014 23:59:59 GMT\n\t * Permanent\n\t */\n\tRETRY_AFTER: 'retry-after',\n\t/**\n\t * A name for the server\n\t *\n\t * @example\n\t * server: Apache/2.4.1 (Unix)\n\t * Permanent\n\t */\n\tSERVER: 'server',\n\t/**\n\t * An HTTP cookie\n\t *\n\t * @example\n\t * set-cookie: UserID=JohnDoe, Max-Age=3600, Version=1\n\t * Permanent\n\t */\n\tSET_COOKIE: 'set-cookie',\n\t/**\n\t * CGI header field specifying the status of the HTTP response. Normal HTTP responses use a separate \"Status-Line\" instead, defined by RFC 7230.\n\t *\n\t * @example\n\t * status: 200 OK\n\t */\n\tSTATUS: 'status',\n\t/**\n\t * A HSTS Policy informing the HTTP client how long to cache the HTTPS only policy and whether this applies to subdomains.\n\t *\n\t * @example\n\t * strict-transport-security: max-age=16070400, includeSubDomains\n\t * Permanent\n\t */\n\tSTRICT_TRANSPORT_SECURITY: 'strict-transport-security',\n\t/**\n\t * The Trailer general field value indicates that the given set of header fields is present in the trailer of a message encoded with chunked transfer coding.\n\t *\n\t * @example\n\t * trailer: Max-Forwards\n\t * Permanent\n\t */\n\tTRAILER: 'trailer',\n\t/**\n\t * The form of encoding used to safely transfer the entity to the user. Currently defined methods are: chunked, compress, deflate, gzip, identity.\n\t *\n\t * @example\n\t * transfer-encoding: chunked\n\t * Permanent\n\t */\n\tTRANSFER_ENCODING: 'transfer-encoding',\n\t/**\n\t * Ask the client to upgrade to another protocol.\n\t *\n\t * @example\n\t * upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11\n\t * Permanent\n\t */\n\tUPGRADE: 'upgrade',\n\t/**\n\t * Tells downstream proxies how to match future request headers to decide whether the cached response can be used rather than requesting a fresh one from the origin server.\n\t *\n\t * @example\n\t * vary: *\n\t * Permanent\n\t */\n\tVARY: 'vary',\n\t/**\n\t * Informs the client of proxies through which the response was sent.\n\t *\n\t * @example\n\t * via: 1.0 fred, 1.1 example.com (Apache/1.1)\n\t * Permanent\n\t */\n\tVIA: 'via',\n\t/**\n\t * A general warning about possible problems with the entity body.\n\t *\n\t * @example\n\t * warning: 199 Miscellaneous warning\n\t * Permanent\n\t */\n\tWARNING: 'warning',\n\t/**\n\t * Indicates the authentication scheme that should be used to access the requested entity.\n\t *\n\t * @example\n\t * www-authenticate: Basic\n\t * Permanent\n\t */\n\tWWW_AUTHENTICATE: 'www-authenticate',\n\t/**\n\t * Cross-site scripting (XSS) filter\n\t *\n\t * @example\n\t * x-xss-protection: 1, mode=block\n\t */\n\tX_XSS_PROTECTION: 'x-xss-protection',\n\t/**\n\t * The HTTP Content-Security-Policy response header allows web site administrators to control resources the user agent is allowed\n\t * to load for a given page. With a few exceptions, policies mostly involve specifying server origins and script endpoints.\n\t * This helps guard against cross-site scripting attacks (Cross-site_scripting).\n\t *\n\t * @example\n\t * content-security-policy: default-src\n\t */\n\tCONTENT_SECURITY_POLICY: 'content-security-policy',\n\t/**\n\t * The only defined value, \"nosniff\", prevents Internet Explorer from MIME-sniffing a response away from the declared content-type. This also applies to Google Chrome, when downloading extensions.\n\t *\n\t * @example\n\t * x-content-type-options: nosniff\n\t */\n\tX_CONTENT_TYPE_OPTIONS: 'x-content-type-options',\n\t/**\n\t * specifies the technology (e.g. ASP.NET, PHP, JBoss) supporting the web application (version details are often in X-Runtime, X-Version, or X-AspNet-Version)\n\t *\n\t * @example\n\t * x-powered-by: PHP/5.4.0\n\t */\n\tX_POWERED_BY: 'x-powered-by'\n} as const;\n\nexport { HttpResponseHeader };", "/**\n * A class that holds a status code and a status text, typically from a {@link Response}\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Response/status|Response.status\n * @author D1g1talEntr0py <jason.dimeo@gmail.com>\n */\nexport class ResponseStatus {\n\tprivate readonly _code: number;\n\tprivate readonly _text: string;\n\n\t/**\n\t *\n\t * @param code The status code from the {@link Response}\n\t * @param text The status text from the {@link Response}\n\t */\n\tconstructor(code: number, text: string) {\n\t\tthis._code = code;\n\t\tthis._text = text;\n\t}\n\n\t/**\n\t * Returns the status code from the {@link Response}\n\t *\n\t * @returns The status code.\n\t */\n\tget code(): number {\n\t\treturn this._code;\n\t}\n\n\t/**\n\t * Returns the status text from the {@link Response}.\n\t *\n\t * @returns The status text.\n\t */\n\tget text(): string {\n\t\treturn this._text;\n\t}\n\n\t/**\n\t * A String value that is used in the creation of the default string\n\t * description of an object. Called by the built-in method {@link Object.prototype.toString}.\n\t *\n\t * @returns The default string description of this object.\n\t */\n\tget [Symbol.toStringTag](): string {\n\t\treturn 'ResponseStatus';\n\t}\n\n\t/**\n\t * tostring method for the class.\n\t *\n\t * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toString|Object.prototype.toString}\n\t * @returns The status code and status text.\n\t */\n\ttoString(): string {\n\t\treturn `${this._code} ${this._text}`;\n\t}\n}", "import { MediaType } from '@d1g1tal/media-type';\nimport { HttpMediaType } from './http-media-type';\nimport { HttpRequestMethod } from './http-request-methods';\nimport { ResponseStatus } from './response-status';\nimport type { AbortEvent, TimeoutEvent, RequestMethod } from '@types';\n\nconst charset = { charset: 'utf-8' };\nconst endsWithSlashRegEx: RegExp = /\\/$/;\n/** Default XSRF cookie name */\nconst XSRF_COOKIE_NAME = 'XSRF-TOKEN';\n/** Default XSRF header name */\nconst XSRF_HEADER_NAME = 'X-XSRF-TOKEN';\n\ntype MediaTypeKey = 'PNG' | 'TEXT' | 'JSON' | 'HTML' | 'JAVA_SCRIPT' | 'CSS' | 'XML' | 'BIN';\n\nconst mediaTypes: { [key in MediaTypeKey]: MediaType } = {\n\tPNG: new MediaType(HttpMediaType.PNG),\n\tTEXT: new MediaType(HttpMediaType.TEXT, charset),\n\tJSON: new MediaType(HttpMediaType.JSON, charset),\n\tHTML: new MediaType(HttpMediaType.HTML, charset),\n\tJAVA_SCRIPT: new MediaType(HttpMediaType.JAVA_SCRIPT, charset),\n\tCSS: new MediaType(HttpMediaType.CSS, charset),\n\tXML: new MediaType(HttpMediaType.XML, charset),\n\tBIN: new MediaType(HttpMediaType.BIN)\n} as const;\n\nconst defaultMediaType: string = mediaTypes.JSON.toString();\n\n/** Constant object for caching policies */\nconst RequestCachingPolicy = {\n\tDEFAULT: 'default',\n\tFORCE_CACHE: 'force-cache',\n\tNO_CACHE: 'no-cache',\n\tNO_STORE: 'no-store',\n\tONLY_IF_CACHED: 'only-if-cached',\n\tRELOAD: 'reload'\n} as const;\n\n/** Constant object for request events */\nexport const RequestEvent = {\n\tCONFIGURED: 'configured',\n\tSUCCESS: 'success',\n\tERROR: 'error',\n\tABORTED: 'aborted',\n\tTIMEOUT: 'timeout',\n\tRETRY: 'retry',\n\tCOMPLETE: 'complete',\n\tALL_COMPLETE: 'all-complete'\n} as const;\n\n/** Constant object for signal events */\nconst SignalEvents = {\n\tABORT: 'abort',\n\tTIMEOUT: 'timeout'\n} as const;\n\n/** Constant object for signal errors */\nconst SignalErrors = {\n\tABORT: 'AbortError',\n\tTIMEOUT: 'TimeoutError'\n} as const;\n\n/** Options for adding event listeners */\nconst eventListenerOptions: AddEventListenerOptions = { once: true, passive: true };\n\n/**\n * Creates a new custom abort event.\n * @returns A new AbortEvent instance.\n */\nconst abortEvent = (): AbortEvent => new CustomEvent(SignalEvents.ABORT, { detail: { cause: SignalErrors.ABORT } });\n\n/**\n * Creates a new custom timeout event.\n * @returns A new TimeoutEvent instance.\n */\nconst timeoutEvent = (): TimeoutEvent => new CustomEvent(SignalEvents.TIMEOUT, { detail: { cause: SignalErrors.TIMEOUT } });\n\n/** Array of request body methods */\nconst requestBodyMethods: ReadonlyArray<RequestMethod> = [ HttpRequestMethod.POST, HttpRequestMethod.PUT, HttpRequestMethod.PATCH, HttpRequestMethod.DELETE ];\n\n/** Response status for internal server error */\nconst internalServerError: ResponseStatus = new ResponseStatus(500, 'Internal Server Error');\n\n/** Response status for aborted request */\nconst aborted: ResponseStatus = new ResponseStatus(499, 'Aborted');\n\n/** Response status for timed out request */\nconst timedOut: ResponseStatus = new ResponseStatus(504, 'Request Timeout');\n\n/** Default HTTP status codes that trigger a retry */\nconst retryStatusCodes: ReadonlyArray<number> = [ 408, 413, 429, 500, 502, 503, 504 ];\n\n/** Default HTTP methods allowed to retry (idempotent methods only) */\nconst retryMethods: ReadonlyArray<RequestMethod> = [ HttpRequestMethod.GET, HttpRequestMethod.PUT, HttpRequestMethod.HEAD, HttpRequestMethod.DELETE, HttpRequestMethod.OPTIONS ];\n\n/** Default delay in ms before the first retry */\nconst retryDelay: number = 300;\n\n/** Default backoff factor applied after each retry attempt */\nconst retryBackoffFactor: number = 2;\n\nexport { aborted, abortEvent, endsWithSlashRegEx, eventListenerOptions, internalServerError, mediaTypes, defaultMediaType, requestBodyMethods, RequestCachingPolicy, retryBackoffFactor, retryDelay, retryMethods, retryStatusCodes, SignalErrors, SignalEvents, timedOut, timeoutEvent, XSRF_COOKIE_NAME, XSRF_HEADER_NAME };\nexport type RequestEvent = (typeof RequestEvent)[keyof typeof RequestEvent];", "import { SignalErrors, SignalEvents, abortEvent, eventListenerOptions, timeoutEvent } from './constants.js';\nimport type { AbortConfiguration, AbortEvent, AbortSignalEvent } from '@types';\n\n/** Class representing a controller for abort signals, allowing for aborting requests and handling timeout events */\nexport class SignalController {\n\tprivate readonly abortSignal: AbortSignal;\n\tprivate readonly abortController = new AbortController();\n\tprivate readonly events = new Map<EventListener, string>();\n\n\t/**\n\t * Creates a new SignalController instance.\n\t * @param options - The options for the SignalController.\n\t * @param options.signal - The signal to listen for abort events. Defaults to the internal abort signal.\n\t * @param options.timeout - The timeout value in milliseconds. Defaults to Infinity.\n\t * @throws {RangeError} If the timeout value is negative.\n\t */\n\tconstructor({ signal, timeout = Infinity }: AbortConfiguration = {}) {\n\t\tif (timeout < 0) { throw new RangeError('The timeout cannot be negative') }\n\n\t\tconst signals = [ this.abortController.signal ];\n\t\tif (signal != null) { signals.push(signal) }\n\t\tif (timeout !== Infinity) { signals.push(AbortSignal.timeout(timeout)) }\n\n\t\t(this.abortSignal = AbortSignal.any(signals)).addEventListener(SignalEvents.ABORT, this, eventListenerOptions);\n\t}\n\n\t/**\n\t * Handles the 'abort' event. If the event is caused by a timeout, the 'timeout' event is dispatched.\n\t * Guards against a timeout firing after a manual abort to prevent spurious timeout events.\n\t * @param event The event to abort with\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#specifying_this_using_bind\n\t */\n\thandleEvent({ target: { reason } }: AbortSignalEvent): void {\n\t\tif (this.abortController.signal.aborted) { return }\n\t\tif (reason instanceof DOMException && reason.name === SignalErrors.TIMEOUT) { this.abortSignal.dispatchEvent(timeoutEvent()) }\n\t}\n\n\t/**\n\t * Gets the signal. This signal will be able to abort the request, but will not be notified if the request is aborted by the timeout.\n\t * @returns The signal\n\t */\n\tget signal(): AbortSignal {\n\t\treturn this.abortSignal;\n\t}\n\n\t/**\n\t * Adds an event listener for the 'abort' event.\n\t *\n\t * @param eventListener The listener to add\n\t * @returns The SignalController\n\t */\n\tonAbort(eventListener: EventListener): SignalController {\n\t\treturn this.addEventListener(SignalEvents.ABORT, eventListener);\n\t}\n\n\t/**\n\t * Adds an event listener for the 'timeout' event.\n\t *\n\t * @param eventListener The listener to add\n\t * @returns The SignalController\n\t */\n\tonTimeout(eventListener: EventListener): SignalController {\n\t\treturn this.addEventListener(SignalEvents.TIMEOUT, eventListener);\n\t}\n\n\t/**\n\t * Aborts the signal.\n\t *\n\t * @param event The event to abort with\n\t */\n\tabort(event: AbortEvent = abortEvent()): void {\n\t\tthis.abortController.abort(event.detail?.cause);\n\t}\n\n\t/**\n\t * Removes all event listeners from the signal.\n\t *\n\t * @returns The SignalController\n\t */\n\tdestroy(): SignalController {\n\t\tthis.abortSignal.removeEventListener(SignalEvents.ABORT, this, eventListenerOptions);\n\n\t\tfor (const [ eventListener, type ] of this.events) {\n\t\t\tthis.abortSignal.removeEventListener(type, eventListener, eventListenerOptions);\n\t\t}\n\n\t\tthis.events.clear();\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds an event listener for the specified event type.\n\t *\n\t * @param type The event type to listen for\n\t * @param eventListener The listener to add\n\t * @returns The SignalController\n\t */\n\tprivate addEventListener(type: string, eventListener: EventListener): SignalController {\n\t\tthis.abortSignal.addEventListener(type, eventListener, eventListenerOptions);\n\t\tthis.events.set(eventListener, type);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * A String value that is used in the creation of the default string\n\t * description of an object. Called by the built-in method {@link Object.prototype.toString}.\n\t *\n\t * @returns The default string description of this object.\n\t */\n\tget [Symbol.toStringTag](): string {\n\t\treturn 'SignalController';\n\t}\n}", "const {\n entries,\n setPrototypeOf,\n isFrozen,\n getPrototypeOf,\n getOwnPropertyDescriptor,\n} = Object;\n\nlet { freeze, seal, create } = Object; // eslint-disable-line import/no-mutable-exports\nlet { apply, construct } = typeof Reflect !== 'undefined' && Reflect;\n\nif (!freeze) {\n freeze = function <T>(x: T): T {\n return x;\n };\n}\n\nif (!seal) {\n seal = function <T>(x: T): T {\n return x;\n };\n}\n\nif (!apply) {\n apply = function <T>(\n func: (thisArg: any, ...args: any[]) => T,\n thisArg: any,\n ...args: any[]\n ): T {\n return func.apply(thisArg, args);\n };\n}\n\nif (!construct) {\n construct = function <T>(Func: new (...args: any[]) => T, ...args: any[]): T {\n return new Func(...args);\n };\n}\n\nconst arrayForEach = unapply(Array.prototype.forEach);\nconst arrayIndexOf = unapply(Array.prototype.indexOf);\nconst arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);\nconst arrayPop = unapply(Array.prototype.pop);\nconst arrayPush = unapply(Array.prototype.push);\nconst arraySlice = unapply(Array.prototype.slice);\nconst arraySplice = unapply(Array.prototype.splice);\n\nconst stringToLowerCase = unapply(String.prototype.toLowerCase);\nconst stringToString = unapply(String.prototype.toString);\nconst stringMatch = unapply(String.prototype.match);\nconst stringReplace = unapply(String.prototype.replace);\nconst stringIndexOf = unapply(String.prototype.indexOf);\nconst stringTrim = unapply(String.prototype.trim);\n\nconst objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);\n\nconst regExpTest = unapply(RegExp.prototype.test);\n\nconst typeErrorCreate = unconstruct(TypeError);\n\n/**\n * Creates a new function that calls the given function with a specified thisArg and arguments.\n *\n * @param func - The function to be wrapped and called.\n * @returns A new function that calls the given function with a specified thisArg and arguments.\n */\nfunction unapply<T>(\n func: (thisArg: any, ...args: any[]) => T\n): (thisArg: any, ...args: any[]) => T {\n return (thisArg: any, ...args: any[]): T => {\n if (thisArg instanceof RegExp) {\n thisArg.lastIndex = 0;\n }\n\n return apply(func, thisArg, args);\n };\n}\n\n/**\n * Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n *\n * @param func - The constructor function to be wrapped and called.\n * @returns A new function that constructs an instance of the given constructor function with the provided arguments.\n */\nfunction unconstruct<T>(\n Func: new (...args: any[]) => T\n): (...args: any[]) => T {\n return (...args: any[]): T => construct(Func, args);\n}\n\n/**\n * Add properties to a lookup table\n *\n * @param set - The set to which elements will be added.\n * @param array - The array containing elements to be added to the set.\n * @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n * @returns The modified set with added elements.\n */\nfunction addToSet(\n set: Record<string, any>,\n array: readonly any[],\n transformCaseFunc: ReturnType<typeof unapply<string>> = stringToLowerCase\n): Record<string, any> {\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n\n let l = array.length;\n while (l--) {\n let element = array[l];\n if (typeof element === 'string') {\n const lcElement = transformCaseFunc(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n (array as any[])[l] = lcElement;\n }\n\n element = lcElement;\n }\n }\n\n set[element] = true;\n }\n\n return set;\n}\n\n/**\n * Clean up an array to harden against CSPP\n *\n * @param array - The array to be cleaned.\n * @returns The cleaned version of the array\n */\nfunction cleanArray<T>(array: T[]): Array<T | null> {\n for (let index = 0; index < array.length; index++) {\n const isPropertyExist = objectHasOwnProperty(array, index);\n\n if (!isPropertyExist) {\n array[index] = null;\n }\n }\n\n return array;\n}\n\n/**\n * Shallow clone an object\n *\n * @param object - The object to be cloned.\n * @returns A new object that copies the original.\n */\nfunction clone<T extends Record<string, any>>(object: T): T {\n const newObject = create(null);\n\n for (const [property, value] of entries(object)) {\n const isPropertyExist = objectHasOwnProperty(object, property);\n\n if (isPropertyExist) {\n if (Array.isArray(value)) {\n newObject[property] = cleanArray(value);\n } else if (\n value &&\n typeof value === 'object' &&\n value.constructor === Object\n ) {\n newObject[property] = clone(value);\n } else {\n newObject[property] = value;\n }\n }\n }\n\n return newObject;\n}\n\n/**\n * This method automatically checks if the prop is function or getter and behaves accordingly.\n *\n * @param object - The object to look up the getter function in its prototype chain.\n * @param prop - The property name for which to find the getter function.\n * @returns The getter function found in the prototype chain or a fallback function.\n */\nfunction lookupGetter<T extends Record<string, any>>(\n object: T,\n prop: string\n): ReturnType<typeof unapply<any>> | (() => null) {\n while (object !== null) {\n const desc = getOwnPropertyDescriptor(object, prop);\n\n if (desc) {\n if (desc.get) {\n return unapply(desc.get);\n }\n\n if (typeof desc.value === 'function') {\n return unapply(desc.value);\n }\n }\n\n object = getPrototypeOf(object);\n }\n\n function fallbackValue(): null {\n return null;\n }\n\n return fallbackValue;\n}\n\nexport {\n // Array\n arrayForEach,\n arrayIndexOf,\n arrayLastIndexOf,\n arrayPop,\n arrayPush,\n arraySlice,\n arraySplice,\n // Object\n entries,\n freeze,\n getPrototypeOf,\n getOwnPropertyDescriptor,\n isFrozen,\n setPrototypeOf,\n seal,\n clone,\n create,\n objectHasOwnProperty,\n // RegExp\n regExpTest,\n // String\n stringIndexOf,\n stringMatch,\n stringReplace,\n stringToLowerCase,\n stringToString,\n stringTrim,\n // Errors\n typeErrorCreate,\n // Other\n lookupGetter,\n addToSet,\n // Reflect\n unapply,\n unconstruct,\n};\n", "import { freeze } from './utils.js';\n\nexport const html = freeze([\n 'a',\n 'abbr',\n 'acronym',\n 'address',\n 'area',\n 'article',\n 'aside',\n 'audio',\n 'b',\n 'bdi',\n 'bdo',\n 'big',\n 'blink',\n 'blockquote',\n 'body',\n 'br',\n 'button',\n 'canvas',\n 'caption',\n 'center',\n 'cite',\n 'code',\n 'col',\n 'colgroup',\n 'content',\n 'data',\n 'datalist',\n 'dd',\n 'decorator',\n 'del',\n 'details',\n 'dfn',\n 'dialog',\n 'dir',\n 'div',\n 'dl',\n 'dt',\n 'element',\n 'em',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'font',\n 'footer',\n 'form',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hgroup',\n 'hr',\n 'html',\n 'i',\n 'img',\n 'input',\n 'ins',\n 'kbd',\n 'label',\n 'legend',\n 'li',\n 'main',\n 'map',\n 'mark',\n 'marquee',\n 'menu',\n 'menuitem',\n 'meter',\n 'nav',\n 'nobr',\n 'ol',\n 'optgroup',\n 'option',\n 'output',\n 'p',\n 'picture',\n 'pre',\n 'progress',\n 'q',\n 'rp',\n 'rt',\n 'ruby',\n 's',\n 'samp',\n 'search',\n 'section',\n 'select',\n 'shadow',\n 'slot',\n 'small',\n 'source',\n 'spacer',\n 'span',\n 'strike',\n 'strong',\n 'style',\n 'sub',\n 'summary',\n 'sup',\n 'table',\n 'tbody',\n 'td',\n 'template',\n 'textarea',\n 'tfoot',\n 'th',\n 'thead',\n 'time',\n 'tr',\n 'track',\n 'tt',\n 'u',\n 'ul',\n 'var',\n 'video',\n 'wbr',\n] as const);\n\nexport const svg = freeze([\n 'svg',\n 'a',\n 'altglyph',\n 'altglyphdef',\n 'altglyphitem',\n 'animatecolor',\n 'animatemotion',\n 'animatetransform',\n 'circle',\n 'clippath',\n 'defs',\n 'desc',\n 'ellipse',\n 'enterkeyhint',\n 'exportparts',\n 'filter',\n 'font',\n 'g',\n 'glyph',\n 'glyphref',\n 'hkern',\n 'image',\n 'inputmode',\n 'line',\n 'lineargradient',\n 'marker',\n 'mask',\n 'metadata',\n 'mpath',\n 'part',\n 'path',\n 'pattern',\n 'polygon',\n 'polyline',\n 'radialgradient',\n 'rect',\n 'stop',\n 'style',\n 'switch',\n 'symbol',\n 'text',\n 'textpath',\n 'title',\n 'tref',\n 'tspan',\n 'view',\n 'vkern',\n] as const);\n\nexport const svgFilters = freeze([\n 'feBlend',\n 'feColorMatrix',\n 'feComponentTransfer',\n 'feComposite',\n 'feConvolveMatrix',\n 'feDiffuseLighting',\n 'feDisplacementMap',\n 'feDistantLight',\n 'feDropShadow',\n 'feFlood',\n 'feFuncA',\n 'feFuncB',\n 'feFuncG',\n 'feFuncR',\n 'feGaussianBlur',\n 'feImage',\n 'feMerge',\n 'feMergeNode',\n 'feMorphology',\n 'feOffset',\n 'fePointLight',\n 'feSpecularLighting',\n 'feSpotLight',\n 'feTile',\n 'feTurbulence',\n] as const);\n\n// List of SVG elements that are disallowed by default.\n// We still need to know them so that we can do namespace\n// checks properly in case one wants to add them to\n// allow-list.\nexport const svgDisallowed = freeze([\n 'animate',\n 'color-profile',\n 'cursor',\n 'discard',\n 'font-face',\n 'font-face-format',\n 'font-face-name',\n 'font-face-src',\n 'font-face-uri',\n 'foreignobject',\n 'hatch',\n 'hatchpath',\n 'mesh',\n 'meshgradient',\n 'meshpatch',\n 'meshrow',\n 'missing-glyph',\n 'script',\n 'set',\n 'solidcolor',\n 'unknown',\n 'use',\n] as const);\n\nexport const mathMl = freeze([\n 'math',\n 'menclose',\n 'merror',\n 'mfenced',\n 'mfrac',\n 'mglyph',\n 'mi',\n 'mlabeledtr',\n 'mmultiscripts',\n 'mn',\n 'mo',\n 'mover',\n 'mpadded',\n 'mphantom',\n 'mroot',\n 'mrow',\n 'ms',\n 'mspace',\n 'msqrt',\n 'mstyle',\n 'msub',\n 'msup',\n 'msubsup',\n 'mtable',\n 'mtd',\n 'mtext',\n 'mtr',\n 'munder',\n 'munderover',\n 'mprescripts',\n] as const);\n\n// Similarly to SVG, we want to know all MathML elements,\n// even those that we disallow by default.\nexport const mathMlDisallowed = freeze([\n 'maction',\n 'maligngroup',\n 'malignmark',\n 'mlongdiv',\n 'mscarries',\n 'mscarry',\n 'msgroup',\n 'mstack',\n 'msline',\n 'msrow',\n 'semantics',\n 'annotation',\n 'annotation-xml',\n 'mprescripts',\n 'none',\n] as const);\n\nexport const text = freeze(['#text'] as const);\n", "import { freeze } from './utils.js';\n\nexport const html = freeze([\n 'accept',\n 'action',\n 'align',\n 'alt',\n 'autocapitalize',\n 'autocomplete',\n 'autopictureinpicture',\n 'autoplay',\n 'background',\n 'bgcolor',\n 'border',\n 'capture',\n 'cellpadding',\n 'cellspacing',\n 'checked',\n 'cite',\n 'class',\n 'clear',\n 'color',\n 'cols',\n 'colspan',\n 'controls',\n 'controlslist',\n 'coords',\n 'crossorigin',\n 'datetime',\n 'decoding',\n 'default',\n 'dir',\n 'disabled',\n 'disablepictureinpicture',\n 'disableremoteplayback',\n 'download',\n 'draggable',\n 'enctype',\n 'enterkeyhint',\n 'exportparts',\n 'face',\n 'for',\n 'headers',\n 'height',\n 'hidden',\n 'high',\n 'href',\n 'hreflang',\n 'id',\n 'inert',\n 'inputmode',\n 'integrity',\n 'ismap',\n 'kind',\n 'label',\n 'lang',\n 'list',\n 'loading',\n 'loop',\n 'low',\n 'max',\n 'maxlength',\n 'media',\n 'method',\n 'min',\n 'minlength',\n 'multiple',\n 'muted',\n 'name',\n 'nonce',\n 'noshade',\n 'novalidate',\n 'nowrap',\n 'open',\n 'optimum',\n 'part',\n 'pattern',\n 'placeholder',\n 'playsinline',\n 'popover',\n 'popovertarget',\n 'popovertargetaction',\n 'poster',\n 'preload',\n 'pubdate',\n 'radiogroup',\n 'readonly',\n 'rel',\n 'required',\n 'rev',\n 'reversed',\n 'role',\n 'rows',\n 'rowspan',\n 'spellcheck',\n 'scope',\n 'selected',\n 'shape',\n 'size',\n 'sizes',\n 'slot',\n 'span',\n 'srclang',\n 'start',\n 'src',\n 'srcset',\n 'step',\n 'style',\n 'summary',\n 'tabindex',\n 'title',\n 'translate',\n 'type',\n 'usemap',\n 'valign',\n 'value',\n 'width',\n 'wrap',\n 'xmlns',\n 'slot',\n] as const);\n\nexport const svg = freeze([\n 'accent-height',\n 'accumulate',\n 'additive',\n 'alignment-baseline',\n 'amplitude',\n 'ascent',\n 'attributename',\n 'attributetype',\n 'azimuth',\n 'basefrequency',\n 'baseline-shift',\n 'begin',\n 'bias',\n 'by',\n 'class',\n 'clip',\n 'clippathunits',\n 'clip-path',\n 'clip-rule',\n 'color',\n 'color-interpolation',\n 'color-interpolation-filters',\n 'color-profile',\n 'color-rendering',\n 'cx',\n 'cy',\n 'd',\n 'dx',\n 'dy',\n 'diffuseconstant',\n 'direction',\n 'display',\n 'divisor',\n 'dur',\n 'edgemode',\n 'elevation',\n 'end',\n 'exponent',\n 'fill',\n 'fill-opacity',\n 'fill-rule',\n 'filter',\n 'filterunits',\n 'flood-color',\n 'flood-opacity',\n 'font-family',\n 'font-size',\n 'font-size-adjust',\n 'font-stretch',\n 'font-style',\n 'font-variant',\n 'font-weight',\n 'fx',\n 'fy',\n 'g1',\n 'g2',\n 'glyph-name',\n 'glyphref',\n 'gradientunits',\n 'gradienttransform',\n 'height',\n 'href',\n 'id',\n 'image-rendering',\n 'in',\n 'in2',\n 'intercept',\n 'k',\n 'k1',\n 'k2',\n 'k3',\n 'k4',\n 'kerning',\n 'keypoints',\n 'keysplines',\n 'keytimes',\n 'lang',\n 'lengthadjust',\n 'letter-spacing',\n 'kernelmatrix',\n 'kernelunitlength',\n 'lighting-color',\n 'local',\n 'marker-end',\n 'marker-mid',\n 'marker-start',\n 'markerheight',\n 'markerunits',\n 'markerwidth',\n 'maskcontentunits',\n 'maskunits',\n 'max',\n 'mask',\n 'mask-type',\n 'media',\n 'method',\n 'mode',\n 'min',\n 'name',\n 'numoctaves',\n 'offset',\n 'operator',\n 'opacity',\n 'order',\n 'orient',\n 'orientation',\n 'origin',\n 'overflow',\n 'paint-order',\n 'path',\n 'pathlength',\n 'patterncontentunits',\n 'patterntransform',\n 'patternunits',\n 'points',\n 'preservealpha',\n 'preserveaspectratio',\n 'primitiveunits',\n 'r',\n 'rx',\n 'ry',\n 'radius',\n 'refx',\n 'refy',\n 'repeatcount',\n 'repeatdur',\n 'restart',\n 'result',\n 'rotate',\n 'scale',\n 'seed',\n 'shape-rendering',\n 'slope',\n 'specularconstant',\n 'specularexponent',\n 'spreadmethod',\n 'startoffset',\n 'stddeviation',\n 'stitchtiles',\n 'stop-color',\n 'stop-opacity',\n 'stroke-dasharray',\n 'stroke-dashoffset',\n 'stroke-linecap',\n 'stroke-linejoin',\n 'stroke-miterlimit',\n 'stroke-opacity',\n 'stroke',\n 'stroke-width',\n 'style',\n 'surfacescale',\n 'systemlanguage',\n 'tabindex',\n 'tablevalues',\n 'targetx',\n 'targety',\n 'transform',\n 'transform-origin',\n 'text-anchor',\n 'text-decoration',\n 'text-rendering',\n 'textlength',\n 'type',\n 'u1',\n 'u2',\n 'unicode',\n 'values',\n 'viewbox',\n 'visibility',\n 'version',\n 'vert-adv-y',\n 'vert-origin-x',\n 'vert-origin-y',\n 'width',\n 'word-spacing',\n 'wrap',\n 'writing-mode',\n 'xchannelselector',\n 'ychannelselector',\n 'x',\n 'x1',\n 'x2',\n 'xmlns',\n 'y',\n 'y1',\n 'y2',\n 'z',\n 'zoomandpan',\n] as const);\n\nexport const mathMl = freeze([\n 'accent',\n 'accentunder',\n 'align',\n 'bevelled',\n 'close',\n 'columnsalign',\n 'columnlines',\n 'columnspan',\n 'denomalign',\n 'depth',\n 'dir',\n 'display',\n 'displaystyle',\n 'encoding',\n 'fence',\n 'frame',\n 'height',\n 'href',\n 'id',\n 'largeop',\n 'length',\n 'linethickness',\n 'lspace',\n 'lquote',\n 'mathbackground',\n 'mathcolor',\n 'mathsize',\n 'mathvariant',\n 'maxsize',\n 'minsize',\n 'movablelimits',\n 'notation',\n 'numalign',\n 'open',\n 'rowalign',\n 'rowlines',\n 'rowspacing',\n 'rowspan',\n 'rspace',\n 'rquote',\n 'scriptlevel',\n 'scriptminsize',\n 'scriptsizemultiplier',\n 'selection',\n 'separator',\n 'separators',\n 'stretchy',\n 'subscriptshift',\n 'supscriptshift',\n 'symmetric',\n 'voffset',\n 'width',\n 'xmlns',\n]);\n\nexport const xml = freeze([\n 'xlink:href',\n 'xml:id',\n 'xlink:title',\n 'xml:space',\n 'xmlns:xlink',\n] as const);\n", "import { seal } from './utils.js';\n\n// eslint-disable-next-line unicorn/better-regex\nexport const MUSTACHE_EXPR = seal(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\nexport const ERB_EXPR = seal(/<%[\\w\\W]*|[\\w\\W]*%>/gm);\nexport const TMPLIT_EXPR = seal(/\\$\\{[\\w\\W]*/gm); // eslint-disable-line unicorn/better-regex\nexport const DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]+$/); // eslint-disable-line no-useless-escape\nexport const ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\nexport const IS_ALLOWED_URI = seal(\n /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n);\nexport const IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\nexport const ATTR_WHITESPACE = seal(\n /[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n);\nexport const DOCTYPE_NAME = seal(/^html$/i);\nexport const CUSTOM_ELEMENT = seal(/^[a-z][.\\w]*(-[.\\w]+)+$/i);\n", "/* eslint-disable @typescript-eslint/indent */\n\nimport type {\n TrustedHTML,\n TrustedTypesWindow,\n} from 'trusted-types/lib/index.js';\nimport type { Config, UseProfilesConfig } from './config';\nimport * as TAGS from './tags.js';\nimport * as ATTRS from './attrs.js';\nimport * as EXPRESSIONS from './regexp.js';\nimport {\n addToSet,\n clone,\n entries,\n freeze,\n arrayForEach,\n arrayLastIndexOf,\n arrayPop,\n arrayPush,\n arraySplice,\n stringMatch,\n stringReplace,\n stringToLowerCase,\n stringToString,\n stringIndexOf,\n stringTrim,\n regExpTest,\n typeErrorCreate,\n lookupGetter,\n create,\n objectHasOwnProperty,\n} from './utils.js';\n\nexport type { Config } from './config';\n\ndeclare const VERSION: string;\n\n// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType\nconst NODE_TYPE = {\n element: 1,\n attribute: 2,\n text: 3,\n cdataSection: 4,\n entityReference: 5, // Deprecated\n entityNode: 6, // Deprecated\n progressingInstruction: 7,\n comment: 8,\n document: 9,\n documentType: 10,\n documentFragment: 11,\n notation: 12, // Deprecated\n};\n\nconst getGlobal = function (): WindowLike {\n return typeof window === 'undefined' ? null : window;\n};\n\n/**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param trustedTypes The policy factory.\n * @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n * @return The policy created (or null, if Trusted Types\n * are not supported or creating the policy failed).\n */\nconst _createTrustedTypesPolicy = function (\n trustedTypes: TrustedTypePolicyFactory,\n purifyHostElement: HTMLScriptElement\n) {\n if (\n typeof trustedTypes !== 'object' ||\n typeof trustedTypes.createPolicy !== 'function'\n ) {\n return null;\n }\n\n // Allow the callers to control the unique policy name\n // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n // Policy creation with duplicate names throws in Trusted Types.\n let suffix = null;\n const ATTR_NAME = 'data-tt-policy-suffix';\n if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {\n suffix = purifyHostElement.getAttribute(ATTR_NAME);\n }\n\n const policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n\n try {\n return trustedTypes.createPolicy(policyName, {\n createHTML(html) {\n return html;\n },\n createScriptURL(scriptUrl) {\n return scriptUrl;\n },\n });\n } catch (_) {\n // Policy creation failed (most likely another DOMPurify script has\n // already run). Skip creating the policy, as this will only cause errors\n // if TT are enforced.\n console.warn(\n 'TrustedTypes policy ' + policyName + ' could not be created.'\n );\n return null;\n }\n};\n\nconst _createHooksMap = function (): HooksMap {\n return {\n afterSanitizeAttributes: [],\n afterSanitizeElements: [],\n afterSanitizeShadowDOM: [],\n beforeSanitizeAttributes: [],\n beforeSanitizeElements: [],\n beforeSanitizeShadowDOM: [],\n uponSanitizeAttribute: [],\n uponSanitizeElement: [],\n uponSanitizeShadowNode: [],\n };\n};\n\nfunction createDOMPurify(window: WindowLike = getGlobal()): DOMPurify {\n const DOMPurify: DOMPurify = (root: WindowLike) => createDOMPurify(root);\n\n DOMPurify.version = VERSION;\n\n DOMPurify.removed = [];\n\n if (\n !window ||\n !window.document ||\n window.document.nodeType !== NODE_TYPE.document ||\n !window.Element\n ) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n\n return DOMPurify;\n }\n\n let { document } = window;\n\n const originalDocument = document;\n const currentScript: HTMLScriptElement =\n originalDocument.currentScript as HTMLScriptElement;\n const {\n DocumentFragment,\n HTMLTemplateElement,\n Node,\n Element,\n NodeFilter,\n NamedNodeMap = window.NamedNodeMap || (window as any).MozNamedAttrMap,\n HTMLFormElement,\n DOMParser,\n trustedTypes,\n } = window;\n\n const ElementPrototype = Element.prototype;\n\n const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n const remove = lookupGetter(ElementPrototype, 'remove');\n const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n const getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n\n // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n if (typeof HTMLTemplateElement === 'function') {\n const template = document.createElement('template');\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n\n let trustedTypesPolicy;\n let emptyHTML = '';\n\n const {\n implementation,\n createNodeIterator,\n createDocumentFragment,\n getElementsByTagName,\n } = document;\n const { importNode } = originalDocument;\n\n let hooks = _createHooksMap();\n\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n DOMPurify.isSupported =\n typeof entries === 'function' &&\n typeof getParentNode === 'function' &&\n implementation &&\n implementation.createHTMLDocument !== undefined;\n\n const {\n MUSTACHE_EXPR,\n ERB_EXPR,\n TMPLIT_EXPR,\n DATA_ATTR,\n ARIA_ATTR,\n IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE,\n CUSTOM_ELEMENT,\n } = EXPRESSIONS;\n\n let { IS_ALLOWED_URI } = EXPRESSIONS;\n\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n\n /* allowed element names */\n let ALLOWED_TAGS = null;\n const DEFAULT_ALLOWED_TAGS = addToSet({}, [\n ...TAGS.html,\n ...TAGS.svg,\n ...TAGS.svgFilters,\n ...TAGS.mathMl,\n ...TAGS.text,\n ]);\n\n /* Allowed attribute names */\n let ALLOWED_ATTR = null;\n const DEFAULT_ALLOWED_ATTR = addToSet({}, [\n ...ATTRS.html,\n ...ATTRS.svg,\n ...ATTRS.mathMl,\n ...ATTRS.xml,\n ]);\n\n /*\n * Configure how DOMPurify should handle custom elements and their attributes as well as customized built-in elements.\n * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n */\n let CUSTOM_ELEMENT_HANDLING = Object.seal(\n create(null, {\n tagNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null,\n },\n attributeNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null,\n },\n allowCustomizedBuiltInElements: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: false,\n },\n })\n );\n\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n let FORBID_TAGS = null;\n\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n let FORBID_ATTR = null;\n\n /* Config object to store ADD_TAGS/ADD_ATTR functions (when used as functions) */\n const EXTRA_ELEMENT_HANDLING = Object.seal(\n create(null, {\n tagCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null,\n },\n attributeCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null,\n },\n })\n );\n\n /* Decide if ARIA attributes are okay */\n let ALLOW_ARIA_ATTR = true;\n\n /* Decide if custom data attributes are okay */\n let ALLOW_DATA_ATTR = true;\n\n /* Decide if unknown protocols are okay */\n let ALLOW_UNKNOWN_PROTOCOLS = false;\n\n /* Decide if self-closing tags in attributes are allowed.\n * Usually removed due to a mXSS issue in jQuery 3.0 */\n let ALLOW_SELF_CLOSE_IN_ATTR = true;\n\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n let SAFE_FOR_TEMPLATES = false;\n\n /* Output should be safe even for XML used within HTML and alike.\n * This means, DOMPurify removes comments when containing risky content.\n */\n let SAFE_FOR_XML = true;\n\n /* Decide if document with <html>... should be returned */\n let WHOLE_DOCUMENT = false;\n\n /* Track whether config is already set on this instance of DOMPurify. */\n let SET_CONFIG = false;\n\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n let FORCE_BODY = false;\n\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported).\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n let RETURN_DOM = false;\n\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported) */\n let RETURN_DOM_FRAGMENT = false;\n\n /* Try to return a Trusted Type object instead of a string, return a string in\n * case Trusted Types are not supported */\n let RETURN_TRUSTED_TYPE = false;\n\n /* Output should be free from DOM clobbering attacks?\n * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n */\n let SANITIZE_DOM = true;\n\n /* Achieve full DOM Clobbering protection by isolating the namespace of named\n * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n *\n * HTML/DOM spec rules that enable DOM Clobbering:\n * - Named Access on Window (§7.3.3)\n * - DOM Tree Accessors (§3.1.5)\n * - Form Element Parent-Child Relations (§4.10.3)\n * - Iframe srcdoc / Nested WindowProxies (§4.8.5)\n * - HTMLCollection (§4.2.10.2)\n *\n * Namespace isolation is implemented by prefixing `id` and `name` attributes\n * with a constant string, i.e., `user-content-`\n */\n let SANITIZE_NAMED_PROPS = false;\n const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n\n /* Keep element content when removing element? */\n let KEEP_CONTENT = true;\n\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n let IN_PLACE = false;\n\n /* Allow usage of profiles like html, svg and mathMl */\n let USE_PROFILES: UseProfilesConfig | false = {};\n\n /* Tags to ignore content of when KEEP_CONTENT is true */\n let FORBID_CONTENTS = null;\n const DEFAULT_FORBID_CONTENTS = addToSet({}, [\n 'annotation-xml',\n 'audio',\n 'colgroup',\n 'desc',\n 'foreignobject',\n 'head',\n 'iframe',\n 'math',\n 'mi',\n 'mn',\n 'mo',\n 'ms',\n 'mtext',\n 'noembed',\n 'noframes',\n 'noscript',\n 'plaintext',\n 'script',\n 'style',\n 'svg',\n 'template',\n 'thead',\n 'title',\n 'video',\n 'xmp',\n ]);\n\n /* Tags that are safe for data: URIs */\n let DATA_URI_TAGS = null;\n const DEFAULT_DATA_URI_TAGS = addToSet({}, [\n 'audio',\n 'video',\n 'img',\n 'source',\n 'image',\n 'track',\n ]);\n\n /* Attributes safe for values like \"javascript:\" */\n let URI_SAFE_ATTRIBUTES = null;\n const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, [\n 'alt',\n 'class',\n 'for',\n 'id',\n 'label',\n 'name',\n 'pattern',\n 'placeholder',\n 'role',\n 'summary',\n 'title',\n 'value',\n 'style',\n 'xmlns',\n ]);\n\n const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n /* Document namespace */\n let NAMESPACE = HTML_NAMESPACE;\n let IS_EMPTY_INPUT = false;\n\n /* Allowed XHTML+XML namespaces */\n let ALLOWED_NAMESPACES = null;\n const DEFAULT_ALLOWED_NAMESPACES = addToSet(\n {},\n [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE],\n stringToString\n );\n\n let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, [\n 'mi',\n 'mo',\n 'mn',\n 'ms',\n 'mtext',\n ]);\n\n let HTML_INTEGRATION_POINTS = addToSet({}, ['annotation-xml']);\n\n // Certain elements are allowed in both SVG and HTML\n // namespace. We need to specify them explicitly\n // so that they don't get erroneously deleted from\n // HTML namespace.\n const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, [\n 'title',\n 'style',\n 'font',\n 'a',\n 'script',\n ]);\n\n /* Parsing of strict XHTML documents */\n let PARSER_MEDIA_TYPE: null | DOMParserSupportedType = null;\n const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n let transformCaseFunc: null | Parameters<typeof addToSet>[2] = null;\n\n /* Keep a reference to config to pass to hooks */\n let CONFIG: Config | null = null;\n\n /* Ideally, do not touch anything below this line */\n /* ______________________________________________ */\n\n const formElement = document.createElement('form');\n\n const isRegexOrFunction = function (\n testValue: unknown\n ): testValue is Function | RegExp {\n return testValue instanceof RegExp || testValue instanceof Function;\n };\n\n /**\n * _parseConfig\n *\n * @param cfg optional config literal\n */\n // eslint-disable-next-line complexity\n const _parseConfig = function (cfg: Config = {}): void {\n if (CONFIG && CONFIG === cfg) {\n return;\n }\n\n /* Shield configuration object from tampering */\n if (!cfg || typeof cfg !== 'object') {\n cfg = {};\n }\n\n /* Shield configuration object from prototype pollution */\n cfg = clone(cfg);\n\n PARSER_MEDIA_TYPE =\n // eslint-disable-next-line unicorn/prefer-includes\n SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1\n ? DEFAULT_PARSER_MEDIA_TYPE\n : cfg.PARSER_MEDIA_TYPE;\n\n // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n transformCaseFunc =\n PARSER_MEDIA_TYPE === 'application/xhtml+xml'\n ? stringToString\n : stringToLowerCase;\n\n /* Set configuration parameters */\n ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS')\n ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc)\n : DEFAULT_ALLOWED_TAGS;\n ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR')\n ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc)\n : DEFAULT_ALLOWED_ATTR;\n ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES')\n ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString)\n : DEFAULT_ALLOWED_NAMESPACES;\n URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR')\n ? addToSet(\n clone(DEFAULT_URI_SAFE_ATTRIBUTES),\n cfg.ADD_URI_SAFE_ATTR,\n transformCaseFunc\n )\n : DEFAULT_URI_SAFE_ATTRIBUTES;\n DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS')\n ? addToSet(\n clone(DEFAULT_DATA_URI_TAGS),\n cfg.ADD_DATA_URI_TAGS,\n transformCaseFunc\n )\n : DEFAULT_DATA_URI_TAGS;\n FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS')\n ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc)\n : DEFAULT_FORBID_CONTENTS;\n FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS')\n ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc)\n : clone({});\n FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR')\n ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc)\n : clone({});\n USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES')\n ? cfg.USE_PROFILES\n : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n IS_ALLOWED_URI = cfg.ALLOWED_URI_REGEXP || EXPRESSIONS.IS_ALLOWED_URI;\n NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;\n MATHML_TEXT_INTEGRATION_POINTS =\n cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS;\n HTML_INTEGRATION_POINTS =\n cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS;\n\n CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};\n if (\n cfg.CUSTOM_ELEMENT_HANDLING &&\n isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)\n ) {\n CUSTOM_ELEMENT_HANDLING.tagNameCheck =\n cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;\n }\n\n if (\n cfg.CUSTOM_ELEMENT_HANDLING &&\n isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)\n ) {\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck =\n cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;\n }\n\n if (\n cfg.CUSTOM_ELEMENT_HANDLING &&\n typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements ===\n 'boolean'\n ) {\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements =\n cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;\n }\n\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n\n /* Parse profile info */\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, TAGS.text);\n ALLOWED_ATTR = create(null);\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, TAGS.html);\n addToSet(ALLOWED_ATTR, ATTRS.html);\n }\n\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, TAGS.svg);\n addToSet(ALLOWED_ATTR, ATTRS.svg);\n addToSet(ALLOWED_ATTR, ATTRS.xml);\n }\n\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, TAGS.svgFilters);\n addToSet(ALLOWED_ATTR, ATTRS.svg);\n addToSet(ALLOWED_ATTR, ATTRS.xml);\n }\n\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, TAGS.mathMl);\n addToSet(ALLOWED_ATTR, ATTRS.mathMl);\n addToSet(ALLOWED_ATTR, ATTRS.xml);\n }\n }\n\n /* Prevent function-based ADD_ATTR / ADD_TAGS from leaking across calls */\n if (!objectHasOwnProperty(cfg, 'ADD_TAGS')) {\n EXTRA_ELEMENT_HANDLING.tagCheck = null;\n }\n\n if (!objectHasOwnProperty(cfg, 'ADD_ATTR')) {\n EXTRA_ELEMENT_HANDLING.attributeCheck = null;\n }\n\n /* Merge configuration parameters */\n if (cfg.ADD_TAGS) {\n if (typeof cfg.ADD_TAGS === 'function') {\n EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;\n } else {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n }\n }\n\n if (cfg.ADD_ATTR) {\n if (typeof cfg.ADD_ATTR === 'function') {\n EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;\n } else {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n }\n }\n\n if (cfg.ADD_URI_SAFE_ATTR) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);\n }\n\n if (cfg.FORBID_CONTENTS) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n\n addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);\n }\n\n if (cfg.ADD_FORBID_CONTENTS) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n\n addToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);\n }\n\n /* Add #text in case KEEP_CONTENT is set to true */\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n delete FORBID_TAGS.tbody;\n }\n\n if (cfg.TRUSTED_TYPES_POLICY) {\n if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {\n throw typeErrorCreate(\n 'TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.'\n );\n }\n\n if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {\n throw typeErrorCreate(\n 'TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.'\n );\n }\n\n // Overwrite existing TrustedTypes policy.\n trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n\n // Sign local variables required by `sanitize`.\n emptyHTML = trustedTypesPolicy.createHTML('');\n } else {\n // Uninitialized policy, attempt to initialize the internal dompurify policy.\n if (trustedTypesPolicy === undefined) {\n trustedTypesPolicy = _createTrustedTypesPolicy(\n trustedTypes,\n currentScript\n );\n }\n\n // If creating the internal policy succeeded sign internal variables.\n if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {\n emptyHTML = trustedTypesPolicy.createHTML('');\n }\n }\n\n // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n if (freeze) {\n freeze(cfg);\n }\n\n CONFIG = cfg;\n };\n\n /* Keep track of all possible SVG and MathML tags\n * so that we can perform the namespace checks\n * correctly. */\n const ALL_SVG_TAGS = addToSet({}, [\n ...TAGS.svg,\n ...TAGS.svgFilters,\n ...TAGS.svgDisallowed,\n ]);\n const ALL_MATHML_TAGS = addToSet({}, [\n ...TAGS.mathMl,\n ...TAGS.mathMlDisallowed,\n ]);\n\n /**\n * @param element a DOM element whose namespace is being checked\n * @returns Return false if the element has a\n * namespace that a spec-compliant parser would never\n * return. Return true otherwise.\n */\n const _checkValidNamespace = function (element: Element): boolean {\n let parent = getParentNode(element);\n\n // In JSDOM, if we're inside shadow DOM, then parentNode\n // can be null. We just simulate parent in this case.\n if (!parent || !parent.tagName) {\n parent = {\n namespaceURI: NAMESPACE,\n tagName: 'template',\n };\n }\n\n const tagName = stringToLowerCase(element.tagName);\n const parentTagName = stringToLowerCase(parent.tagName);\n\n if (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n return false;\n }\n\n if (element.namespaceURI === SVG_NAMESPACE) {\n // The only way to switch from HTML namespace to SVG\n // is via <svg>. If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'svg';\n }\n\n // The only way to switch from MathML to SVG is via`\n // svg if parent is either <annotation-xml> or MathML\n // text integration points.\n if (parent.namespaceURI === MATHML_NAMESPACE) {\n return (\n tagName === 'svg' &&\n (parentTagName === 'annotation-xml' ||\n MATHML_TEXT_INTEGRATION_POINTS[parentTagName])\n );\n }\n\n // We only allow elements that are defined in SVG\n // spec. All others are disallowed in SVG namespace.\n return Boolean(ALL_SVG_TAGS[tagName]);\n }\n\n if (element.namespaceURI === MATHML_NAMESPACE) {\n // The only way to switch from HTML namespace to MathML\n // is via <math>. If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'math';\n }\n\n // The only way to switch from SVG to MathML is via\n // <math> and HTML integration points\n if (parent.namespaceURI === SVG_NAMESPACE) {\n return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n }\n\n // We only allow elements that are defined in MathML\n // spec. All others are disallowed in MathML namespace.\n return Boolean(ALL_MATHML_TAGS[tagName]);\n }\n\n if (element.namespaceURI === HTML_NAMESPACE) {\n // The only way to switch from SVG to HTML is via\n // HTML integration points, and from MathML to HTML\n // is via MathML text integration points\n if (\n parent.namespaceURI === SVG_NAMESPACE &&\n !HTML_INTEGRATION_POINTS[parentTagName]\n ) {\n return false;\n }\n\n if (\n parent.namespaceURI === MATHML_NAMESPACE &&\n !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]\n ) {\n return false;\n }\n\n // We disallow tags that are specific for MathML\n // or SVG and should never appear in HTML namespace\n return (\n !ALL_MATHML_TAGS[tagName] &&\n (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName])\n );\n }\n\n // For XHTML and XML documents that support custom namespaces\n if (\n PARSER_MEDIA_TYPE === 'application/xhtml+xml' &&\n ALLOWED_NAMESPACES[element.namespaceURI]\n ) {\n return true;\n }\n\n // The code should never reach this place (this means\n // that the element somehow got namespace that is not\n // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).\n // Return false just in case.\n return false;\n };\n\n /**\n * _forceRemove\n *\n * @param node a DOM node\n */\n const _forceRemove = function (node: Node): void {\n arrayPush(DOMPurify.removed, { element: node });\n\n try {\n // eslint-disable-next-line unicorn/prefer-dom-node-remove\n getParentNode(node).removeChild(node);\n } catch (_) {\n remove(node);\n }\n };\n\n /**\n * _removeAttribute\n *\n * @param name an Attribute name\n * @param element a DOM node\n */\n const _removeAttribute = function (name: string, element: Element): void {\n try {\n arrayPush(DOMPurify.removed, {\n attribute: element.getAttributeNode(name),\n from: element,\n });\n } catch (_) {\n arrayPush(DOMPurify.removed, {\n attribute: null,\n from: element,\n });\n }\n\n element.removeAttribute(name);\n\n // We void attribute values for unremovable \"is\" attributes\n if (name === 'is') {\n if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n try {\n _forceRemove(element);\n } catch (_) {}\n } else {\n try {\n element.setAttribute(name, '');\n } catch (_) {}\n }\n }\n };\n\n /**\n * _initDocument\n *\n * @param dirty - a string of dirty markup\n * @return a DOM, filled with the dirty markup\n */\n const _initDocument = function (dirty: string): Document {\n /* Create a HTML document */\n let doc = null;\n let leadingWhitespace = null;\n\n if (FORCE_BODY) {\n dirty = '<remove></remove>' + dirty;\n } else {\n /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n const matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n leadingWhitespace = matches && matches[0];\n }\n\n if (\n PARSER_MEDIA_TYPE === 'application/xhtml+xml' &&\n NAMESPACE === HTML_NAMESPACE\n ) {\n // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)\n dirty =\n '<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>' +\n dirty +\n '</body></html>';\n }\n\n const dirtyPayload = trustedTypesPolicy\n ? trustedTypesPolicy.createHTML(dirty)\n : dirty;\n /*\n * Use the DOMParser API by default, fallback later if needs be\n * DOMParser not work for svg when has multiple root element.\n */\n if (NAMESPACE === HTML_NAMESPACE) {\n try {\n doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n } catch (_) {}\n }\n\n /* Use createHTMLDocument in case DOMParser is not available */\n if (!doc || !doc.documentElement) {\n doc = implementation.createDocument(NAMESPACE, 'template', null);\n try {\n doc.documentElement.innerHTML = IS_EMPTY_INPUT\n ? emptyHTML\n : dirtyPayload;\n } catch (_) {\n // Syntax error if dirtyPayload is invalid xml\n }\n }\n\n const body = doc.body || doc.documentElement;\n\n if (dirty && leadingWhitespace) {\n body.insertBefore(\n document.createTextNode(leadingWhitespace),\n body.childNodes[0] || null\n );\n }\n\n /* Work on whole document or just its body */\n if (NAMESPACE === HTML_NAMESPACE) {\n return getElementsByTagName.call(\n doc,\n WHOLE_DOCUMENT ? 'html' : 'body'\n )[0];\n }\n\n return WHOLE_DOCUMENT ? doc.documentElement : body;\n };\n\n /**\n * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n *\n * @param root The root element or node to start traversing on.\n * @return The created NodeIterator\n */\n const _createNodeIterator = function (root: Node): NodeIterator {\n return createNodeIterator.call(\n root.ownerDocument || root,\n root,\n // eslint-disable-next-line no-bitwise\n NodeFilter.SHOW_ELEMENT |\n NodeFilter.SHOW_COMMENT |\n NodeFilter.SHOW_TEXT |\n NodeFilter.SHOW_PROCESSING_INSTRUCTION |\n NodeFilter.SHOW_CDATA_SECTION,\n null\n );\n };\n\n /**\n * _isClobbered\n *\n * @param element element to check for clobbering attacks\n * @return true if clobbered, false if safe\n */\n const _isClobbered = function (element: Element): boolean {\n return (\n element instanceof HTMLFormElement &&\n (typeof element.nodeName !== 'string' ||\n typeof element.textContent !== 'string' ||\n typeof element.removeChild !== 'function' ||\n !(element.attributes instanceof NamedNodeMap) ||\n typeof element.removeAttribute !== 'function' ||\n typeof element.setAttribute !== 'function' ||\n typeof element.namespaceURI !== 'string' ||\n typeof element.insertBefore !== 'function' ||\n typeof element.hasChildNodes !== 'function')\n );\n };\n\n /**\n * Checks whether the given object is a DOM node.\n *\n * @param value object to check whether it's a DOM node\n * @return true is object is a DOM node\n */\n const _isNode = function (value: unknown): value is Node {\n return typeof Node === 'function' && value instanceof Node;\n };\n\n function _executeHooks<T extends HookFunction>(\n hooks: HookFunction[],\n currentNode: Parameters<T>[0],\n data: Parameters<T>[1]\n ): void {\n arrayForEach(hooks, (hook: T) => {\n hook.call(DOMPurify, currentNode, data, CONFIG);\n });\n }\n\n /**\n * _sanitizeElements\n *\n * @protect nodeName\n * @protect textContent\n * @protect removeChild\n * @param currentNode to check for permission to exist\n * @return true if node was killed, false if left alive\n */\n const _sanitizeElements = function (currentNode: any): boolean {\n let content = null;\n\n /* Execute a hook if present */\n _executeHooks(hooks.beforeSanitizeElements, currentNode, null);\n\n /* Check if element is clobbered or can clobber */\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Now let's check the element's type and name */\n const tagName = transformCaseFunc(currentNode.nodeName);\n\n /* Execute a hook if present */\n _executeHooks(hooks.uponSanitizeElement, currentNode, {\n tagName,\n allowedTags: ALLOWED_TAGS,\n });\n\n /* Detect mXSS attempts abusing namespace confusion */\n if (\n SAFE_FOR_XML &&\n currentNode.hasChildNodes() &&\n !_isNode(currentNode.firstElementChild) &&\n regExpTest(/<[/\\w!]/g, currentNode.innerHTML) &&\n regExpTest(/<[/\\w!]/g, currentNode.textContent)\n ) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove any occurrence of processing instructions */\n if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove any kind of possibly harmful comments */\n if (\n SAFE_FOR_XML &&\n currentNode.nodeType === NODE_TYPE.comment &&\n regExpTest(/<[/\\w]/g, currentNode.data)\n ) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove element if anything forbids its presence */\n if (\n !(\n EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function &&\n EXTRA_ELEMENT_HANDLING.tagCheck(tagName)\n ) &&\n (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName])\n ) {\n /* Check if we have a custom element to handle */\n if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {\n if (\n CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp &&\n regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)\n ) {\n return false;\n }\n\n if (\n CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function &&\n CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)\n ) {\n return false;\n }\n }\n\n /* Keep content except for bad-listed elements */\n if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n const parentNode = getParentNode(currentNode) || currentNode.parentNode;\n const childNodes = getChildNodes(currentNode) || currentNode.childNodes;\n\n if (childNodes && parentNode) {\n const childCount = childNodes.length;\n\n for (let i = childCount - 1; i >= 0; --i) {\n const childClone = cloneNode(childNodes[i], true);\n childClone.__removalCount = (currentNode.__removalCount || 0) + 1;\n parentNode.insertBefore(childClone, getNextSibling(currentNode));\n }\n }\n }\n\n _forceRemove(currentNode);\n return true;\n }\n\n /* Check whether element has a valid namespace */\n if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Make sure that older browsers don't get fallback-tag mXSS */\n if (\n (tagName === 'noscript' ||\n tagName === 'noembed' ||\n tagName === 'noframes') &&\n regExpTest(/<\\/no(script|embed|frames)/i, currentNode.innerHTML)\n ) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Sanitize element content to be template-safe */\n if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {\n /* Get the element's text content */\n content = currentNode.textContent;\n\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], (expr: RegExp) => {\n content = stringReplace(content, expr, ' ');\n });\n\n if (currentNode.textContent !== content) {\n arrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });\n currentNode.textContent = content;\n }\n }\n\n /* Execute a hook if present */\n _executeHooks(hooks.afterSanitizeElements, currentNode, null);\n\n return false;\n };\n\n /**\n * _isValidAttribute\n *\n * @param lcTag Lowercase tag name of containing element.\n * @param lcName Lowercase attribute name.\n * @param value Attribute value.\n * @return Returns true if `value` is valid, otherwise false.\n */\n // eslint-disable-next-line complexity\n const _isValidAttribute = function (\n lcTag: string,\n lcName: string,\n value: string\n ): boolean {\n /* FORBID_ATTR must always win, even if ADD_ATTR predicate would allow it */\n if (FORBID_ATTR[lcName]) {\n return false;\n }\n\n /* Make sure attribute cannot clobber */\n if (\n SANITIZE_DOM &&\n (lcName === 'id' || lcName === 'name') &&\n (value in document || value in formElement)\n ) {\n return false;\n }\n\n /* Allow valid data-* attributes: At least one character after \"-\"\n (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n We don't need to check the value; it's always URI safe. */\n if (\n ALLOW_DATA_ATTR &&\n !FORBID_ATTR[lcName] &&\n regExpTest(DATA_ATTR, lcName)\n ) {\n // This attribute is safe\n } else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) {\n // This attribute is safe\n /* Check if ADD_ATTR function allows this attribute */\n } else if (\n EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function &&\n EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag)\n ) {\n // This attribute is safe\n /* Otherwise, check the name is permitted */\n } else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n if (\n // First condition does a very basic check if a) it's basically a valid custom element tagname AND\n // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck\n (_isBasicCustomElement(lcTag) &&\n ((CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp &&\n regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag)) ||\n (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function &&\n CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag))) &&\n ((CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp &&\n regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName)) ||\n (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function &&\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName, lcTag)))) ||\n // Alternative, second condition checks if it's an `is`-attribute, AND\n // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n (lcName === 'is' &&\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements &&\n ((CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp &&\n regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value)) ||\n (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function &&\n CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))))\n ) {\n // If user has supplied a regexp or function in CUSTOM_ELEMENT_HANDLING.tagNameCheck, we need to also allow derived custom elements using the same tagName test.\n // Additionally, we need to allow attributes passing the CUSTOM_ELEMENT_HANDLING.attributeNameCheck user has configured, as custom elements can define these at their own discretion.\n } else {\n return false;\n }\n /* Check value is safe. First, is attr inert? If so, is safe */\n } else if (URI_SAFE_ATTRIBUTES[lcName]) {\n // This attribute is safe\n /* Check no script, data or unknown possibly unsafe URI\n unless we know URI values are safe for that attribute */\n } else if (\n regExpTest(IS_ALLOWED_URI, stringReplace(value, ATTR_WHITESPACE, ''))\n ) {\n // This attribute is safe\n /* Keep image data URIs alive if src/xlink:href is allowed */\n /* Further prevent gadget XSS for dynamically built script tags */\n } else if (\n (lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') &&\n lcTag !== 'script' &&\n stringIndexOf(value, 'data:') === 0 &&\n DATA_URI_TAGS[lcTag]\n ) {\n // This attribute is safe\n /* Allow unknown protocols: This provides support for links that\n are handled by protocol handlers which may be unknown ahead of\n time, e.g. fb:, spotify: */\n } else if (\n ALLOW_UNKNOWN_PROTOCOLS &&\n !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))\n ) {\n // This attribute is safe\n /* Check for binary attributes */\n } else if (value) {\n return false;\n } else {\n // Binary attributes are safe at this point\n /* Anything else, presume unsafe, do not add it back */\n }\n\n return true;\n };\n\n /**\n * _isBasicCustomElement\n * checks if at least one dash is included in tagName, and it's not the first char\n * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n *\n * @param tagName name of the tag of the node to sanitize\n * @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n */\n const _isBasicCustomElement = function (tagName: string): RegExpMatchArray {\n return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);\n };\n\n /**\n * _sanitizeAttributes\n *\n * @protect attributes\n * @protect nodeName\n * @protect removeAttribute\n * @protect setAttribute\n *\n * @param currentNode to sanitize\n */\n const _sanitizeAttributes = function (currentNode: Element): void {\n /* Execute a hook if present */\n _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);\n\n const { attributes } = currentNode;\n\n /* Check if we have attributes; if not we might have a text node */\n if (!attributes || _isClobbered(currentNode)) {\n return;\n }\n\n const hookEvent = {\n attrName: '',\n attrValue: '',\n keepAttr: true,\n allowedAttributes: ALLOWED_ATTR,\n forceKeepAttr: undefined,\n };\n let l = attributes.length;\n\n /* Go backwards over all attributes; safely remove bad ones */\n while (l--) {\n const attr = attributes[l];\n const { name, namespaceURI, value: attrValue } = attr;\n const lcName = transformCaseFunc(name);\n\n const initValue = attrValue;\n let value = name === 'value' ? initValue : stringTrim(initValue);\n\n /* Execute a hook if present */\n hookEvent.attrName = lcName;\n hookEvent.attrValue = value;\n hookEvent.keepAttr = true;\n hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);\n value = hookEvent.attrValue;\n\n /* Full DOM Clobbering protection via namespace isolation,\n * Prefix id and name attributes with `user-content-`\n */\n if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {\n // Remove the attribute with this value\n _removeAttribute(name, currentNode);\n\n // Prefix the value and later re-create the attribute with the sanitized value\n value = SANITIZE_NAMED_PROPS_PREFIX + value;\n }\n\n /* Work around a security issue with comments inside attributes */\n if (\n SAFE_FOR_XML &&\n regExpTest(\n /((--!?|])>)|<\\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,\n value\n )\n ) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Make sure we cannot easily use animated hrefs, even if animations are allowed */\n if (lcName === 'attributename' && stringMatch(value, 'href')) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Did the hooks approve of the attribute? */\n if (hookEvent.forceKeepAttr) {\n continue;\n }\n\n /* Did the hooks approve of the attribute? */\n if (!hookEvent.keepAttr) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Work around a security issue in jQuery 3.0 */\n if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\\/>/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Sanitize attribute content to be template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], (expr: RegExp) => {\n value = stringReplace(value, expr, ' ');\n });\n }\n\n /* Is `value` valid for this attribute? */\n const lcTag = transformCaseFunc(currentNode.nodeName);\n if (!_isValidAttribute(lcTag, lcName, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Handle attributes that require Trusted Types */\n if (\n trustedTypesPolicy &&\n typeof trustedTypes === 'object' &&\n typeof trustedTypes.getAttributeType === 'function'\n ) {\n if (namespaceURI) {\n /* Namespaces are not yet supported, see https://bugs.chromium.org/p/chromium/issues/detail?id=1305293 */\n } else {\n switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n case 'TrustedHTML': {\n value = trustedTypesPolicy.createHTML(value);\n break;\n }\n\n case 'TrustedScriptURL': {\n value = trustedTypesPolicy.createScriptURL(value);\n break;\n }\n\n default: {\n break;\n }\n }\n }\n }\n\n /* Handle invalid data-* attribute set by try-catching it */\n if (value !== initValue) {\n try {\n if (namespaceURI) {\n currentNode.setAttributeNS(namespaceURI, name, value);\n } else {\n /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n currentNode.setAttribute(name, value);\n }\n\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n } else {\n arrayPop(DOMPurify.removed);\n }\n } catch (_) {\n _removeAttribute(name, currentNode);\n }\n }\n }\n\n /* Execute a hook if present */\n _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);\n };\n\n /**\n * _sanitizeShadowDOM\n *\n * @param fragment to iterate over recursively\n */\n const _sanitizeShadowDOM = function (fragment: DocumentFragment): void {\n let shadowNode = null;\n const shadowIterator = _createNodeIterator(fragment);\n\n /* Execute a hook if present */\n _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);\n\n while ((shadowNode = shadowIterator.nextNode())) {\n /* Execute a hook if present */\n _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);\n\n /* Sanitize tags and elements */\n _sanitizeElements(shadowNode);\n\n /* Check attributes next */\n _sanitizeAttributes(shadowNode);\n\n /* Deep shadow DOM detected */\n if (shadowNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(shadowNode.content);\n }\n }\n\n /* Execute a hook if present */\n _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);\n };\n\n // eslint-disable-next-line complexity\n DOMPurify.sanitize = function (dirty, cfg = {}) {\n let body = null;\n let importedNode = null;\n let currentNode = null;\n let returnNode = null;\n /* Make sure we have a string to sanitize.\n DO NOT return early, as this will return the wrong type if\n the user has requested a DOM object rather than a string */\n IS_EMPTY_INPUT = !dirty;\n if (IS_EMPTY_INPUT) {\n dirty = '<!-->';\n }\n\n /* Stringify, in case dirty is an object */\n if (typeof dirty !== 'string' && !_isNode(dirty)) {\n if (typeof dirty.toString === 'function') {\n dirty = dirty.toString();\n if (typeof dirty !== 'string') {\n throw typeErrorCreate('dirty is not a string, aborting');\n }\n } else {\n throw typeErrorCreate('toString is not a function');\n }\n }\n\n /* Return dirty HTML if DOMPurify cannot run */\n if (!DOMPurify.isSupported) {\n return dirty;\n }\n\n /* Assign config vars */\n if (!SET_CONFIG) {\n _parseConfig(cfg);\n }\n\n /* Clean up removed elements */\n DOMPurify.removed = [];\n\n /* Check if dirty is correctly typed for IN_PLACE */\n if (typeof dirty === 'string') {\n IN_PLACE = false;\n }\n\n if (IN_PLACE) {\n /* Do some early pre-sanitization to avoid unsafe root nodes */\n if ((dirty as Node).nodeName) {\n const tagName = transformCaseFunc((dirty as Node).nodeName);\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n throw typeErrorCreate(\n 'root node is forbidden and cannot be sanitized in-place'\n );\n }\n }\n } else if (dirty instanceof Node) {\n /* If dirty is a DOM element, append to an empty document to avoid\n elements being stripped by the parser */\n body = _initDocument('<!---->');\n importedNode = body.ownerDocument.importNode(dirty, true);\n if (\n importedNode.nodeType === NODE_TYPE.element &&\n importedNode.nodeName === 'BODY'\n ) {\n /* Node is already a body, use as is */\n body = importedNode;\n } else if (importedNode.nodeName === 'HTML') {\n body = importedNode;\n } else {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n body.appendChild(importedNode);\n }\n } else {\n /* Exit directly if we have nothing to do */\n if (\n !RETURN_DOM &&\n !SAFE_FOR_TEMPLATES &&\n !WHOLE_DOCUMENT &&\n // eslint-disable-next-line unicorn/prefer-includes\n dirty.indexOf('<') === -1\n ) {\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE\n ? trustedTypesPolicy.createHTML(dirty)\n : dirty;\n }\n\n /* Initialize the document to work on */\n body = _initDocument(dirty);\n\n /* Check we have a DOM node from the data */\n if (!body) {\n return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';\n }\n }\n\n /* Remove first element node (ours) if FORCE_BODY is set */\n if (body && FORCE_BODY) {\n _forceRemove(body.firstChild);\n }\n\n /* Get node iterator */\n const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);\n\n /* Now start iterating over the created document */\n while ((currentNode = nodeIterator.nextNode())) {\n /* Sanitize tags and elements */\n _sanitizeElements(currentNode);\n\n /* Check attributes next */\n _sanitizeAttributes(currentNode);\n\n /* Shadow DOM detected, sanitize it */\n if (currentNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(currentNode.content);\n }\n }\n\n /* If we sanitized `dirty` in-place, return it. */\n if (IN_PLACE) {\n return dirty;\n }\n\n /* Return sanitized string or DOM */\n if (RETURN_DOM) {\n if (RETURN_DOM_FRAGMENT) {\n returnNode = createDocumentFragment.call(body.ownerDocument);\n\n while (body.firstChild) {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n returnNode.appendChild(body.firstChild);\n }\n } else {\n returnNode = body;\n }\n\n if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {\n /*\n AdoptNode() is not used because internal state is not reset\n (e.g. the past names map of a HTMLFormElement), this is safe\n in theory but we would rather not risk another attack vector.\n The state that is cloned by importNode() is explicitly defined\n by the specs.\n */\n returnNode = importNode.call(originalDocument, returnNode, true);\n }\n\n return returnNode;\n }\n\n let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n\n /* Serialize doctype if allowed */\n if (\n WHOLE_DOCUMENT &&\n ALLOWED_TAGS['!doctype'] &&\n body.ownerDocument &&\n body.ownerDocument.doctype &&\n body.ownerDocument.doctype.name &&\n regExpTest(EXPRESSIONS.DOCTYPE_NAME, body.ownerDocument.doctype.name)\n ) {\n serializedHTML =\n '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\\n' + serializedHTML;\n }\n\n /* Sanitize final string template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], (expr: RegExp) => {\n serializedHTML = stringReplace(serializedHTML, expr, ' ');\n });\n }\n\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE\n ? trustedTypesPolicy.createHTML(serializedHTML)\n : serializedHTML;\n };\n\n DOMPurify.setConfig = function (cfg = {}) {\n _parseConfig(cfg);\n SET_CONFIG = true;\n };\n\n DOMPurify.clearConfig = function () {\n CONFIG = null;\n SET_CONFIG = false;\n };\n\n DOMPurify.isValidAttribute = function (tag, attr, value) {\n /* Initialize shared config vars if necessary. */\n if (!CONFIG) {\n _parseConfig({});\n }\n\n const lcTag = transformCaseFunc(tag);\n const lcName = transformCaseFunc(attr);\n return _isValidAttribute(lcTag, lcName, value);\n };\n\n DOMPurify.addHook = function (\n entryPoint: keyof HooksMap,\n hookFunction: HookFunction\n ) {\n if (typeof hookFunction !== 'function') {\n return;\n }\n\n arrayPush(hooks[entryPoint], hookFunction);\n };\n\n DOMPurify.removeHook = function (\n entryPoint: keyof HooksMap,\n hookFunction: HookFunction\n ) {\n if (hookFunction !== undefined) {\n const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);\n\n return index === -1\n ? undefined\n : arraySplice(hooks[entryPoint], index, 1)[0];\n }\n\n return arrayPop(hooks[entryPoint]);\n };\n\n DOMPurify.removeHooks = function (entryPoint: keyof HooksMap) {\n hooks[entryPoint] = [];\n };\n\n DOMPurify.removeAllHooks = function () {\n hooks = _createHooksMap();\n };\n\n return DOMPurify;\n}\n\nexport default createDOMPurify();\n\nexport interface DOMPurify {\n /**\n * Creates a DOMPurify instance using the given window-like object. Defaults to `window`.\n */\n (root?: WindowLike): DOMPurify;\n\n /**\n * Version label, exposed for easier checks\n * if DOMPurify is up to date or not\n */\n version: string;\n\n /**\n * Array of elements that DOMPurify removed during sanitation.\n * Empty if nothing was removed.\n */\n removed: Array<RemovedElement | RemovedAttribute>;\n\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n isSupported: boolean;\n\n /**\n * Set the configuration once.\n *\n * @param cfg configuration object\n */\n setConfig(cfg?: Config): void;\n\n /**\n * Removes the configuration.\n */\n clearConfig(): void;\n\n /**\n * Provides core sanitation functionality.\n *\n * @param dirty string or DOM node\n * @param cfg object\n * @returns Sanitized TrustedHTML.\n */\n sanitize(\n dirty: string | Node,\n cfg: Config & { RETURN_TRUSTED_TYPE: true }\n ): TrustedHTML;\n\n /**\n * Provides core sanitation functionality.\n *\n * @param dirty DOM node\n * @param cfg object\n * @returns Sanitized DOM node.\n */\n sanitize(dirty: Node, cfg: Config & { IN_PLACE: true }): Node;\n\n /**\n * Provides core sanitation functionality.\n *\n * @param dirty string or DOM node\n * @param cfg object\n * @returns Sanitized DOM node.\n */\n sanitize(dirty: string | Node, cfg: Config & { RETURN_DOM: true }): Node;\n\n /**\n * Provides core sanitation functionality.\n *\n * @param dirty string or DOM node\n * @param cfg object\n * @returns Sanitized document fragment.\n */\n sanitize(\n dirty: string | Node,\n cfg: Config & { RETURN_DOM_FRAGMENT: true }\n ): DocumentFragment;\n\n /**\n * Provides core sanitation functionality.\n *\n * @param dirty string or DOM node\n * @param cfg object\n * @returns Sanitized string.\n */\n sanitize(dirty: string | Node, cfg?: Config): string;\n\n /**\n * Checks if an attribute value is valid.\n * Uses last set config, if any. Otherwise, uses config defaults.\n *\n * @param tag Tag name of containing element.\n * @param attr Attribute name.\n * @param value Attribute value.\n * @returns Returns true if `value` is valid. Otherwise, returns false.\n */\n isValidAttribute(tag: string, attr: string, value: string): boolean;\n\n /**\n * Adds a DOMPurify hook.\n *\n * @param entryPoint entry point for the hook to add\n * @param hookFunction function to execute\n */\n addHook(entryPoint: BasicHookName, hookFunction: NodeHook): void;\n\n /**\n * Adds a DOMPurify hook.\n *\n * @param entryPoint entry point for the hook to add\n * @param hookFunction function to execute\n */\n addHook(entryPoint: ElementHookName, hookFunction: ElementHook): void;\n\n /**\n * Adds a DOMPurify hook.\n *\n * @param entryPoint entry point for the hook to add\n * @param hookFunction function to execute\n */\n addHook(\n entryPoint: DocumentFragmentHookName,\n hookFunction: DocumentFragmentHook\n ): void;\n\n /**\n * Adds a DOMPurify hook.\n *\n * @param entryPoint entry point for the hook to add\n * @param hookFunction function to execute\n */\n addHook(\n entryPoint: 'uponSanitizeElement',\n hookFunction: UponSanitizeElementHook\n ): void;\n\n /**\n * Adds a DOMPurify hook.\n *\n * @param entryPoint entry point for the hook to add\n * @param hookFunction function to execute\n */\n addHook(\n entryPoint: 'uponSanitizeAttribute',\n hookFunction: UponSanitizeAttributeHook\n ): void;\n\n /**\n * Remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if hook not specified)\n *\n * @param entryPoint entry point for the hook to remove\n * @param hookFunction optional specific hook to remove\n * @returns removed hook\n */\n removeHook(\n entryPoint: BasicHookName,\n hookFunction?: NodeHook\n ): NodeHook | undefined;\n\n /**\n * Remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if hook not specified)\n *\n * @param entryPoint entry point for the hook to remove\n * @param hookFunction optional specific hook to remove\n * @returns removed hook\n */\n removeHook(\n entryPoint: ElementHookName,\n hookFunction?: ElementHook\n ): ElementHook | undefined;\n\n /**\n * Remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if hook not specified)\n *\n * @param entryPoint entry point for the hook to remove\n * @param hookFunction optional specific hook to remove\n * @returns removed hook\n */\n removeHook(\n entryPoint: DocumentFragmentHookName,\n hookFunction?: DocumentFragmentHook\n ): DocumentFragmentHook | undefined;\n\n /**\n * Remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if hook not specified)\n *\n * @param entryPoint entry point for the hook to remove\n * @param hookFunction optional specific hook to remove\n * @returns removed hook\n */\n removeHook(\n entryPoint: 'uponSanitizeElement',\n hookFunction?: UponSanitizeElementHook\n ): UponSanitizeElementHook | undefined;\n\n /**\n * Remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if hook not specified)\n *\n * @param entryPoint entry point for the hook to remove\n * @param hookFunction optional specific hook to remove\n * @returns removed hook\n */\n removeHook(\n entryPoint: 'uponSanitizeAttribute',\n hookFunction?: UponSanitizeAttributeHook\n ): UponSanitizeAttributeHook | undefined;\n\n /**\n * Removes all DOMPurify hooks at a given entryPoint\n *\n * @param entryPoint entry point for the hooks to remove\n */\n removeHooks(entryPoint: HookName): void;\n\n /**\n * Removes all DOMPurify hooks.\n */\n removeAllHooks(): void;\n}\n\n/**\n * An element removed by DOMPurify.\n */\nexport interface RemovedElement {\n /**\n * The element that was removed.\n */\n element: Node;\n}\n\n/**\n * An element removed by DOMPurify.\n */\nexport interface RemovedAttribute {\n /**\n * The attribute that was removed.\n */\n attribute: Attr | null;\n\n /**\n * The element that the attribute was removed.\n */\n from: Node;\n}\n\ntype BasicHookName =\n | 'beforeSanitizeElements'\n | 'afterSanitizeElements'\n | 'uponSanitizeShadowNode';\ntype ElementHookName = 'beforeSanitizeAttributes' | 'afterSanitizeAttributes';\ntype DocumentFragmentHookName =\n | 'beforeSanitizeShadowDOM'\n | 'afterSanitizeShadowDOM';\ntype UponSanitizeElementHookName = 'uponSanitizeElement';\ntype UponSanitizeAttributeHookName = 'uponSanitizeAttribute';\n\ninterface HooksMap {\n beforeSanitizeElements: NodeHook[];\n afterSanitizeElements: NodeHook[];\n beforeSanitizeShadowDOM: DocumentFragmentHook[];\n uponSanitizeShadowNode: NodeHook[];\n afterSanitizeShadowDOM: DocumentFragmentHook[];\n beforeSanitizeAttributes: ElementHook[];\n afterSanitizeAttributes: ElementHook[];\n uponSanitizeElement: UponSanitizeElementHook[];\n uponSanitizeAttribute: UponSanitizeAttributeHook[];\n}\n\ntype ArrayElement<T> = T extends Array<infer U> ? U : never;\n\ntype HookFunction = ArrayElement<HooksMap[keyof HooksMap]>;\n\nexport type HookName =\n | BasicHookName\n | ElementHookName\n | DocumentFragmentHookName\n | UponSanitizeElementHookName\n | UponSanitizeAttributeHookName;\n\nexport type NodeHook = (\n this: DOMPurify,\n currentNode: Node,\n hookEvent: null,\n config: Config\n) => void;\n\nexport type ElementHook = (\n this: DOMPurify,\n currentNode: Element,\n hookEvent: null,\n config: Config\n) => void;\n\nexport type DocumentFragmentHook = (\n this: DOMPurify,\n currentNode: DocumentFragment,\n hookEvent: null,\n config: Config\n) => void;\n\nexport type UponSanitizeElementHook = (\n this: DOMPurify,\n currentNode: Node,\n hookEvent: UponSanitizeElementHookEvent,\n config: Config\n) => void;\n\nexport type UponSanitizeAttributeHook = (\n this: DOMPurify,\n currentNode: Element,\n hookEvent: UponSanitizeAttributeHookEvent,\n config: Config\n) => void;\n\nexport interface UponSanitizeElementHookEvent {\n tagName: string;\n allowedTags: Record<string, boolean>;\n}\n\nexport interface UponSanitizeAttributeHookEvent {\n attrName: string;\n attrValue: string;\n keepAttr: boolean;\n allowedAttributes: Record<string, boolean>;\n forceKeepAttr: boolean | undefined;\n}\n\n/**\n * A `Window`-like object containing the properties and types that DOMPurify requires.\n */\nexport type WindowLike = Pick<\n typeof globalThis,\n | 'DocumentFragment'\n | 'HTMLTemplateElement'\n | 'Node'\n | 'Element'\n | 'NodeFilter'\n | 'NamedNodeMap'\n | 'HTMLFormElement'\n | 'DOMParser'\n> & {\n document?: Document;\n MozNamedAttrMap?: typeof window.NamedNodeMap;\n} & Pick<TrustedTypesWindow, 'trustedTypes'>;\n", "import DOMPurify from 'dompurify';\nimport { HttpMediaType } from './http-media-type';\nimport type { Json, ResponseHandler } from '@types';\n\n/** Cached promise for lazy jsdom initialization \u2014 resolved once, reused thereafter */\nlet domReady: Promise<void> | undefined;\n\n/**\n * Ensures a DOM environment is available (document, DOMParser, DocumentFragment).\n * In browser environments this is a no-op. In Node.js it lazily imports jsdom on first call.\n * @returns A Promise that resolves when the DOM environment is ready.\n */\nconst ensureDom = async (): Promise<void> => {\n\tif (typeof document !== 'undefined' && typeof DOMParser !== 'undefined' && typeof DocumentFragment !== 'undefined') { return Promise.resolve() }\n\n\treturn domReady ??= import('jsdom').then(({ JSDOM }) => {\n\t\tconst { window } = new JSDOM('<!DOCTYPE html><html><head></head><body></body></html>');\n\t\tglobalThis.window = window as unknown as Window & typeof globalThis;\n\t\tObject.assign(globalThis, { document: window.document, DOMParser: window.DOMParser, DocumentFragment: window.DocumentFragment });\n\t});\n};\n\n/**\n * Handles a text response.\n * @param response The response object from the fetch request.\n * @returns A Promise that resolves to a string\n */\nconst handleText: ResponseHandler<string> = async (response) => await response.text();\n\n/**\n * Handles a script response by appending it to the Document HTMLHeadElement\n * Only available in browser environments with DOM support.\n *\n * **Security Warning:** This handler executes arbitrary JavaScript from the server response.\n * Only use with fully trusted content sources. No sanitization is applied to script content.\n * Consider using a Content Security Policy (CSP) nonce for additional protection.\n * @param response The response object from the fetch request.\n * @returns A Promise that resolves to void\n */\nconst handleScript: ResponseHandler<void> = async (response) => {\n\tawait ensureDom();\n\tconst objectURL = URL.createObjectURL(await response.blob());\n\n\treturn new Promise((resolve, reject) => {\n\t\tconst script = document.createElement('script');\n\t\tObject.assign(script, { src: objectURL, type: HttpMediaType.JAVA_SCRIPT, async: true });\n\n\t\t/**\n\t\t * Revoke the object URL and resolve the promise once the script has loaded.\n\t\t */\n\t\tscript.onload = () => {\n\t\t\tURL.revokeObjectURL(objectURL);\n\t\t\tdocument.head.removeChild(script);\n\t\t\tresolve();\n\t\t};\n\n\t\t/**\n\t\t * Revoke the object URL and reject the promise if the script fails to load.\n\t\t */\n\t\tscript.onerror = () => {\n\t\t\tURL.revokeObjectURL(objectURL);\n\t\t\tdocument.head.removeChild(script);\n\t\t\treject(new Error('Script failed to load'));\n\t\t};\n\n\t\tdocument.head.appendChild(script);\n\t});\n};\n\n/**\n * Handles a CSS response by appending it to the Document HTMLHeadElement.\n * Only available in browser environments with DOM support.\n * @param response The response object from the fetch request.\n * @returns A Promise that resolves to void\n */\nconst handleCss: ResponseHandler<void> = async (response) => {\n\tawait ensureDom();\n\tconst objectURL = URL.createObjectURL(await response.blob());\n\n\treturn new Promise((resolve, reject) => {\n\t\tconst link = document.createElement('link');\n\t\tObject.assign(link, { href: objectURL, type: HttpMediaType.CSS, rel: 'stylesheet' });\n\n\t\t/**\n\t\t * Revoke the object URL and resolve the promise once the stylesheet has loaded.\n\t\t * @returns A Promise that resolves to void\n\t\t */\n\t\tlink.onload = () => resolve(URL.revokeObjectURL(objectURL));\n\n\t\t/**\n\t\t * Revoke the object URL, remove the link element, and reject the promise if the stylesheet fails to load.\n\t\t */\n\t\tlink.onerror = () => {\n\t\t\tURL.revokeObjectURL(objectURL);\n\t\t\tdocument.head.removeChild(link);\n\t\t\treject(new Error('Stylesheet load failed'));\n\t\t};\n\n\t\tdocument.head.appendChild(link);\n\t});\n};\n\n/**\n * Handles a JSON response.\n * @param response The response object from the fetch request.\n * @returns A Promise that resolves to a JsonObject\n */\nconst handleJson: ResponseHandler<Json> = async (response) => await response.json() as Json;\n\n/**\n * Handles a Blob response.\n * @param response The response object from the fetch request.\n * @returns A Promise that resolves to a Blob\n */\nconst handleBlob: ResponseHandler<Blob> = async (response) => await response.blob();\n\n/**\n * Handles an image response by creating an object URL and returning an HTMLImageElement.\n * The object URL is revoked once the image is loaded to prevent memory leaks.\n * Works in both browser and Node.js (via JSDOM) environments.\n * @param response The response object from the fetch request.\n * @returns A Promise that resolves to an HTMLImageElement\n */\nconst handleImage: ResponseHandler<HTMLImageElement> = async (response) => {\n\tawait ensureDom();\n\tconst objectURL = URL.createObjectURL(await response.blob());\n\n\treturn new Promise((resolve, reject) => {\n\t\tconst img = new Image();\n\n\t\t/**\n\t\t * Revoke the object URL once the image has loaded to free up memory and resolve with the image.\n\t\t */\n\t\timg.onload = () => {\n\t\t\tURL.revokeObjectURL(objectURL);\n\t\t\tresolve(img);\n\t\t};\n\n\t\t/**\n\t\t * Revoke the object URL and reject the promise if the image fails to load.\n\t\t */\n\t\timg.onerror = () => {\n\t\t\tURL.revokeObjectURL(objectURL);\n\t\t\treject(new Error('Image failed to load'));\n\t\t};\n\n\t\timg.src = objectURL;\n\t});\n};\n\n/**\n * Handles a buffer response.\n * @param response The response object from the fetch request.\n * @returns A Promise that resolves to an ArrayBuffer\n */\nconst handleBuffer: ResponseHandler<ArrayBuffer> = async (response) => await response.arrayBuffer();\n\n/**\n * Handles a ReadableStream response.\n * @param response The response object from the fetch request.\n * @returns A Promise that resolves to a ReadableStream\n */\nconst handleReadableStream: ResponseHandler<ReadableStream<Uint8Array> | null> = async (response) => Promise.resolve(response.body);\n\n/**\n * Handles an XML response.\n * Only available in environments with DOM support.\n * @param response The response object from the fetch request.\n * @returns A Promise that resolves to a Document\n */\nconst handleXml: ResponseHandler<Document> = async (response) => {\n\tawait ensureDom();\n\treturn new DOMParser().parseFromString(DOMPurify.sanitize(await response.text()), HttpMediaType.XML);\n};\n\n/**\n * Handles an HTML response.\n * Only available in environments with DOM support.\n * @param response The response object from the fetch request.\n * @returns A Promise that resolves to a Document\n */\nconst handleHtml: ResponseHandler<Document> = async (response) => {\n\tawait ensureDom();\n\treturn new DOMParser().parseFromString(DOMPurify.sanitize(await response.text()), HttpMediaType.HTML);\n};\n\n/**\n * Handles an HTML fragment response.\n * Only available in environments with DOM support.\n * @param response The response object from the fetch request.\n * @returns A Promise that resolves to a DocumentFragment\n */\nconst handleHtmlFragment: ResponseHandler<DocumentFragment> = async (response) => {\n\tawait ensureDom();\n\treturn document.createRange().createContextualFragment(DOMPurify.sanitize(await response.text()));\n};\n\nexport { handleText, handleScript, handleCss, handleJson, handleBlob, handleImage, handleBuffer, handleReadableStream, handleXml, handleHtml, handleHtmlFragment };\n", "import { requestBodyMethods } from './constants';\nimport type { JsonString, JsonValue, RequestBodyMethod, RequestMethod } from '@types';\n\n/**\n * Type guard to check if a request method accepts a body.\n * @param method The request method to check.\n * @returns True if the method accepts a body, false otherwise.\n */\nexport const isRequestBodyMethod = (method: RequestMethod | undefined): method is RequestBodyMethod =>\n\tmethod !== undefined && requestBodyMethods.includes(method);\n\n/**\n * Checks whether a body value is a raw BodyInit type that should be sent as-is\n * (no JSON serialization) and should have its Content-Type deleted so the runtime\n * can set it automatically (e.g. multipart/form-data boundary for FormData).\n * @param body The request body to check.\n * @returns True if the body is a FormData, Blob, ArrayBuffer, TypedArray, DataView, ReadableStream, or URLSearchParams.\n */\nexport const isRawBody = (body: unknown): boolean =>\n\tbody instanceof FormData || body instanceof Blob || body instanceof ArrayBuffer || body instanceof ReadableStream || body instanceof URLSearchParams || ArrayBuffer.isView(body);\n\n/**\n * Reads a cookie value by name from document.cookie.\n * Returns undefined in non-browser environments or when the cookie is not found.\n * @param name The cookie name to look up.\n * @returns The cookie value or undefined.\n */\nexport const getCookieValue = (name: string): string | undefined => {\n\tif (typeof document === 'undefined' || !document.cookie) { return }\n\n\tconst prefix = `${name}=`;\n\tconst cookies = document.cookie.split(';');\n\tfor (let i = 0, length = cookies.length; i < length; i++) {\n\t\tconst cookie = cookies[i]!.trim();\n\t\tif (cookie.startsWith(prefix)) { return decodeURIComponent(cookie.slice(prefix.length)) }\n\t}\n\n\treturn undefined;\n};\n\n/**\n * Serialize an object of type T into a JSON string.\n * The type system ensures only JSON-serializable values can be passed.\n * @template T The type of data to serialize (will be validated for JSON compatibility)\n * @param data The object to serialize - must be JSON-serializable.\n * @returns The serialized JSON string.\n */\nexport const serialize = <const T>(data: JsonValue<T>): JsonString<T> => JSON.stringify(data) as JsonString<T>;\n\n/**\n * Type predicate to check if a value is a string\n * @param value The value to check\n * @returns True if value is a string, with type narrowing\n */\nexport const isString = (value: unknown): value is string => value !== null && typeof value === 'string';\n\n/**\n * Type predicate to check if a value is an object (not array or null)\n * @param value The value to check\n * @returns True if value is an object, with type narrowing\n */\nexport const isObject = <T = object>(value: unknown): value is T extends object ? T : never => value !== null && typeof value === 'object' && !Array.isArray(value) && Object.getPrototypeOf(value) === Object.prototype;\n\n/**\n * Performs a deep merge of multiple objects\n * @param objects The objects to merge\n * @returns The merged object\n */\nexport const objectMerge = (...objects: Record<PropertyKey, unknown>[]): Record<PropertyKey, unknown> | undefined => {\n\t// Early return for empty input\n\tconst length = objects.length;\n\tif (length === 0) { return undefined }\n\n\t// Early return for single object - just clone it\n\tif (length === 1) {\n\t\tconst [ obj ] = objects;\n\t\tif (!isObject(obj)) { return obj }\n\t\treturn deepClone(obj);\n\t}\n\n\tconst target = {} as Record<PropertyKey, unknown>;\n\n\tfor (const source of objects) {\n\t\tif (!isObject(source)) { return undefined }\n\n\t\tfor (const [property, sourceValue] of Object.entries(source)) {\n\t\t\tconst targetValue = target[property];\n\t\t\tif (Array.isArray(sourceValue)) {\n\t\t\t\t// Handle arrays - source values come first, then unique target values\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\ttarget[property] = [ ...sourceValue, ...(Array.isArray(targetValue) ? targetValue.filter((item) => !sourceValue.includes(item)) : []) ];\n\t\t\t} else if (isObject<Record<string, unknown>>(sourceValue)) {\n\t\t\t\t// Handle plain objects using the isObject function | I am already testing that the targetValue is an object\n\t\t\t\ttarget[property] = isObject<Record<string, unknown>>(targetValue) ? objectMerge(targetValue, sourceValue)! : deepClone(sourceValue);\n\t\t\t} else {\n\t\t\t\t// Primitive values and null/undefined\n\t\t\t\ttarget[property] = sourceValue;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn target;\n};\n\n/**\n * Creates a deep clone of an object for better performance than spread operator in merge scenarios\n * @param object The object to clone\n * @returns The cloned object\n */\nfunction deepClone<T = Record<PropertyKey, unknown>>(object: T): T {\n\tif (isObject<Record<PropertyKey, unknown>>(object)) {\n\t\tconst cloned: Record<PropertyKey, unknown> = {};\n\t\tconst keys = Object.keys(object);\n\t\tfor (let i = 0, length = keys.length, key; i < length; i++) {\n\t\t\tkey = keys[i]!;\n\t\t\tcloned[key] = deepClone(object[key]);\n\t\t}\n\n\t\treturn cloned as T;\n\t}\n\n\t// For other object types (Date, RegExp, etc.), return as-is\n\treturn object;\n}", "import { MediaType } from '@d1g1tal/media-type';\nimport { Subscribr } from '@d1g1tal/subscribr';\nimport { HttpError } from './http-error';\nimport { HttpMediaType } from './http-media-type';\nimport { HttpRequestHeader } from './http-request-headers';\nimport { HttpRequestMethod } from './http-request-methods';\nimport { HttpResponseHeader } from './http-response-headers';\nimport { ResponseStatus } from './response-status';\nimport { SignalController } from './signal-controller.js';\nimport { handleText, handleScript, handleCss, handleJson, handleBlob, handleImage, handleBuffer, handleReadableStream, handleXml, handleHtml, handleHtmlFragment } from './response-handlers';\nimport { isRequestBodyMethod, isRawBody, getCookieValue, isString, isObject, objectMerge, serialize } from './utils';\nimport { RequestCachingPolicy, RequestEvent, SignalErrors, XSRF_COOKIE_NAME, XSRF_HEADER_NAME, abortEvent, aborted, defaultMediaType, endsWithSlashRegEx, internalServerError, mediaTypes, retryBackoffFactor, retryDelay, retryMethods, retryStatusCodes, timedOut } from './constants';\nimport type {\tRequestOptions, ResponseBody, RequestEventHandler, SearchParameters, EventRegistration, ResponseHandler, RequestHeaders, TypedResponse, Json, Entries, HookOptions, HttpErrorOptions, NormalizedRetryOptions, PublishOptions, RetryOptions, RequestTiming, XsrfOptions } from '@types';\n\ndeclare function fetch<R = unknown>(input: RequestInfo | URL, requestOptions?: RequestOptions): Promise<TypedResponse<R>>;\n\ntype RequestConfiguration = {\n\tsignalController: NonNullable<SignalController>,\n\trequestOptions: RequestOptions,\n\tglobal: boolean\n};\n\n/**\n * A wrapper around the fetch API that makes it easier to make HTTP requests.\n * @author D1g1talEntr0py <jason.dimeo@gmail.com>\n */\nexport class Transportr {\n\tprivate readonly _baseUrl: URL;\n\tprivate readonly _options: RequestOptions;\n\tprivate readonly subscribr: Subscribr;\n\tprivate readonly hooks: Required<HookOptions> = { beforeRequest: [], afterResponse: [], beforeError: [] };\n\tprivate static globalSubscribr = new Subscribr();\n\tprivate static globalHooks: Required<HookOptions> = { beforeRequest: [], afterResponse: [], beforeError: [] };\n\tprivate static signalControllers = new Set<SignalController>();\n\t/** Map of in-flight deduplicated requests keyed by URL + method */\n\tprivate static inflightRequests = new Map<string, Promise<Response>>();\n\t/** Cache for parsed MediaType instances to avoid re-parsing the same content-type strings */\n\tprivate static mediaTypeCache = new Map(Object.values(mediaTypes).map((mediaType) => [ mediaType.toString(), mediaType ]));\n\tprivate static contentTypeHandlers: Entries<string, ResponseHandler<ResponseBody>> = [\n\t\t[ mediaTypes.TEXT.type, handleText ],\n\t\t[ mediaTypes.JSON.subtype, handleJson ],\n\t\t[ mediaTypes.BIN.subtype, handleReadableStream ],\n\t\t[ mediaTypes.HTML.subtype, handleHtml ],\n\t\t[ mediaTypes.XML.subtype, handleXml ],\n\t\t[ mediaTypes.PNG.type, handleImage as ResponseHandler<ResponseBody> ],\n\t\t[ mediaTypes.JAVA_SCRIPT.subtype, handleScript as ResponseHandler<ResponseBody> ],\n\t\t[ mediaTypes.CSS.subtype, handleCss as ResponseHandler<ResponseBody> ]\n\t];\n\n\t/**\n\t * Create a new Transportr instance with the provided location or origin and context path.\n\t *\n\t * @param url The URL for {@link fetch} requests.\n\t * @param options The default {@link RequestOptions} for this instance.\n\t */\n\tconstructor(url: URL | string | RequestOptions = globalThis.location?.origin ?? 'http://localhost', options: RequestOptions = {}) {\n\t\tif (isObject(url)) { [ url, options ] = [ globalThis.location?.origin ?? 'http://localhost', url ] }\n\n\t\tthis._baseUrl = Transportr.getBaseUrl(url);\n\t\tthis._options = Transportr.createOptions(options, Transportr.defaultRequestOptions);\n\t\tthis.subscribr = new Subscribr();\n\t}\n\n\t/** HTTP Media Types */\n\tstatic readonly MediaType: typeof HttpMediaType = HttpMediaType;\n\n\t/** HTTP Request Methods */\n\tstatic readonly RequestMethod: typeof HttpRequestMethod = HttpRequestMethod;\n\n\t/** HTTP Request Headers */\n\tstatic readonly RequestHeader: typeof HttpRequestHeader = HttpRequestHeader;\n\n\t/** HTTP Response Headers */\n\tstatic readonly ResponseHeader: typeof HttpResponseHeader = HttpResponseHeader;\n\n\t/** Request Caching Policy */\n\tstatic readonly CachingPolicy: typeof RequestCachingPolicy = RequestCachingPolicy;\n\n\t/** Credentials Policy */\n\tstatic readonly CredentialsPolicy = {\n\t\tINCLUDE: 'include',\n\t\tOMIT: 'omit',\n\t\tSAME_ORIGIN: 'same-origin'\n\t} as const;\n\n\t/** Request Modes */\n\tstatic readonly RequestModes = {\n\t\tCORS: 'cors',\n\t\tNAVIGATE: 'navigate',\n\t\tNO_CORS: 'no-cors',\n\t\tSAME_ORIGIN: 'same-origin'\n\t} as const;\n\n\t/** Request Priorities */\n\tstatic readonly RequestPriorities = {\n\t\tHIGH: 'high',\n\t\tLOW: 'low',\n\t\tAUTO: 'auto'\n\t} as const;\n\n\t/** Redirect Policies */\n\tstatic readonly RedirectPolicies = {\n\t\tERROR: 'error',\n\t\tFOLLOW: 'follow',\n\t\tMANUAL: 'manual'\n\t} as const;\n\n\t/** Referrer Policies */\n\tstatic readonly ReferrerPolicy = {\n\t\tNO_REFERRER: 'no-referrer',\n\t\tNO_REFERRER_WHEN_DOWNGRADE: 'no-referrer-when-downgrade',\n\t\tORIGIN: 'origin',\n\t\tORIGIN_WHEN_CROSS_ORIGIN: 'origin-when-cross-origin',\n\t\tSAME_ORIGIN: 'same-origin',\n\t\tSTRICT_ORIGIN: 'strict-origin',\n\t\tSTRICT_ORIGIN_WHEN_CROSS_ORIGIN: 'strict-origin-when-cross-origin',\n\t\tUNSAFE_URL: 'unsafe-url'\n\t} as const;\n\n\t/** Request Events\t*/\n\tstatic readonly RequestEvents: typeof RequestEvent = RequestEvent;\n\n\t/** Default Request Options */\n\tprivate static readonly defaultRequestOptions: RequestOptions = {\n\t\tbody: undefined,\n\t\tcache: RequestCachingPolicy.NO_STORE,\n\t\tcredentials: Transportr.CredentialsPolicy.SAME_ORIGIN,\n\t\theaders: new Headers({ [HttpRequestHeader.CONTENT_TYPE]: defaultMediaType, [HttpRequestHeader.ACCEPT]: defaultMediaType }),\n\t\tsearchParams: undefined,\n\t\tintegrity: undefined,\n\t\tkeepalive: undefined,\n\t\tmethod: HttpRequestMethod.GET,\n\t\tmode: Transportr.RequestModes.CORS,\n\t\tpriority: Transportr.RequestPriorities.AUTO,\n\t\tredirect: Transportr.RedirectPolicies.FOLLOW,\n\t\treferrer: 'about:client',\n\t\treferrerPolicy: Transportr.ReferrerPolicy.STRICT_ORIGIN_WHEN_CROSS_ORIGIN,\n\t\tsignal: undefined,\n\t\ttimeout: 30000,\n\t\tglobal: true\n\t};\n\n\t/**\n\t * Returns a {@link EventRegistration} used for subscribing to global events.\n\t *\n\t * @param event The event to subscribe to.\n\t * @param handler The event handler.\n\t * @param context The context to bind the handler to.\n\t * @returns A new {@link EventRegistration} instance.\n\t */\n\tstatic register(event: RequestEvent, handler: RequestEventHandler, context?: unknown): EventRegistration {\n\t\treturn Transportr.globalSubscribr.subscribe(event, handler, context);\n\t}\n\n\t/**\n\t * Removes a {@link EventRegistration} from the global event handler.\n\t *\n\t * @param eventRegistration The {@link EventRegistration} to remove.\n\t * @returns True if the {@link EventRegistration} was removed, false otherwise.\n\t */\n\tstatic unregister(eventRegistration: EventRegistration): boolean {\n\t\treturn Transportr.globalSubscribr.unsubscribe(eventRegistration);\n\t}\n\n\t/**\n\t * Aborts all active requests.\n\t * This is useful for when the user navigates away from the current page.\n\t * This will also clear the {@link Transportr#signalControllers} set.\n\t */\n\tstatic abortAll(): void {\n\t\tfor (const signalController of this.signalControllers) {\n\t\t\tsignalController.abort(abortEvent());\n\t\t}\n\n\t\t// Clear the set after aborting all requests\n\t\tthis.signalControllers.clear();\n\t}\n\n\t/**\n\t * Registers a custom content-type response handler.\n\t * The handler will be matched against response content-type headers using MediaType matching.\n\t * New handlers are prepended so they take priority over built-in handlers.\n\t *\n\t * @param contentType The content-type string to match (e.g. 'application/pdf', 'text', 'csv').\n\t * @param handler The response handler function.\n\t */\n\tstatic registerContentTypeHandler(contentType: string, handler: ResponseHandler): void {\n\t\t// Prepend so custom handlers take priority over built-in ones\n\t\tTransportr.contentTypeHandlers.unshift([ contentType, handler ]);\n\t}\n\n\t/**\n\t * Removes a previously registered content-type response handler.\n\t *\n\t * @param contentType The content-type string to remove.\n\t * @returns True if the handler was found and removed, false otherwise.\n\t */\n\tstatic unregisterContentTypeHandler(contentType: string): boolean {\n\t\tconst index = Transportr.contentTypeHandlers.findIndex(([ type ]) => type === contentType);\n\t\tif (index === -1) { return false }\n\n\t\tTransportr.contentTypeHandlers.splice(index, 1);\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Registers global lifecycle hooks that run on all requests from all instances.\n\t * Global hooks execute before instance and per-request hooks.\n\t *\n\t * @param hooks The hooks to register globally.\n\t */\n\tstatic addHooks(hooks: HookOptions): void {\n\t\tif (hooks.beforeRequest) { Transportr.globalHooks.beforeRequest.push(...hooks.beforeRequest) }\n\t\tif (hooks.afterResponse) { Transportr.globalHooks.afterResponse.push(...hooks.afterResponse) }\n\t\tif (hooks.beforeError) { Transportr.globalHooks.beforeError.push(...hooks.beforeError) }\n\t}\n\n\t/**\n\t * Removes all global lifecycle hooks.\n\t */\n\tstatic clearHooks(): void {\n\t\tTransportr.globalHooks = { beforeRequest: [], afterResponse: [], beforeError: [] };\n\t}\n\n\t/**\n\t * Tears down all global state: aborts in-flight requests, clears global event subscriptions,\n\t * hooks, in-flight deduplication map, and media type cache (retaining built-in entries).\n\t */\n\tstatic unregisterAll(): void {\n\t\tTransportr.abortAll();\n\t\tTransportr.globalSubscribr = new Subscribr();\n\t\tTransportr.clearHooks();\n\t\tTransportr.inflightRequests.clear();\n\t}\n\n\t/**\n\t * It returns the base {@link URL} for the API.\n\t *\n\t * @returns The baseUrl property.\n\t */\n\tget baseUrl(): URL {\n\t\treturn this._baseUrl;\n\t}\n\n\t/**\n\t * Registers an event handler with a {@link Transportr} instance.\n\t *\n\t * @param event The name of the event to listen for.\n\t * @param handler The function to call when the event is triggered.\n\t * @param context The context to bind to the handler.\n\t * @returns An object that can be used to remove the event handler.\n\t */\n\tregister(event: RequestEvent, handler: RequestEventHandler, context?: unknown): EventRegistration {\n\t\treturn this.subscribr.subscribe(event, handler, context);\n\t}\n\n\t/**\n\t * Unregisters an event handler from a {@link Transportr} instance.\n\t *\n\t * @param eventRegistration The event registration to remove.\n\t * @returns True if the {@link EventRegistration} was removed, false otherwise.\n\t */\n\tunregister(eventRegistration: EventRegistration): boolean {\n\t\treturn this.subscribr.unsubscribe(eventRegistration);\n\t}\n\n\t/**\n\t * Registers instance-level lifecycle hooks that run on all requests from this instance.\n\t * Instance hooks execute after global hooks but before per-request hooks.\n\t *\n\t * @param hooks The hooks to register on this instance.\n\t * @returns This instance for method chaining.\n\t */\n\taddHooks(hooks: HookOptions): this {\n\t\tif (hooks.beforeRequest) { this.hooks.beforeRequest.push(...hooks.beforeRequest) }\n\t\tif (hooks.afterResponse) { this.hooks.afterResponse.push(...hooks.afterResponse) }\n\t\tif (hooks.beforeError) { this.hooks.beforeError.push(...hooks.beforeError) }\n\t\treturn this;\n\t}\n\n\t/**\n\t * Removes all instance-level lifecycle hooks.\n\t * @returns This instance for method chaining.\n\t */\n\tclearHooks(): this {\n\t\tthis.hooks.beforeRequest.length = 0;\n\t\tthis.hooks.afterResponse.length = 0;\n\t\tthis.hooks.beforeError.length = 0;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Tears down this instance: clears all instance subscriptions and hooks.\n\t * The instance should not be used after calling this method.\n\t */\n\tdestroy(): void {\n\t\tthis.clearHooks();\n\t\tthis.subscribr.destroy();\n\t}\n\n\t/**\n\t * This function returns a promise that resolves to the result of a request to the specified path with\n\t * the specified options, where the method is GET.\n\t *\n\t * @async\n\t * @param path The path to the resource you want to get.\n\t * @param options The options for the request.\n\t * @returns A promise that resolves to the response of the request.\n\t */\n\tasync get<T extends ResponseBody = ResponseBody>(path?: string | RequestOptions, options?: RequestOptions): Promise<T | undefined> {\n\t\treturn this._get<T>(path, options);\n\t}\n\n\t/**\n\t * This function makes a POST request to the given path with the given body and options.\n\t *\n\t * @async\n\t * @template T The expected response type (defaults to ResponseBody)\n\t * @param path The path to the endpoint you want to call.\n\t * @param options The options for the request.\n\t * @returns A promise that resolves to the response body.\n\t */\n\tasync post<T extends ResponseBody = ResponseBody>(path?: string | RequestOptions, options?: RequestOptions): Promise<T | undefined> {\n\t\tif (typeof(path) !== 'string') { [ path, options ] = [ undefined, path as RequestOptions ] }\n\n\t\treturn this.execute<T>(path, options, { method: HttpRequestMethod.POST });\n\t}\n\n\t/**\n\t * This function returns a promise that resolves to the result of a request to the specified path with\n\t * the specified options, where the method is PUT.\n\t *\n\t * @async\n\t * @template T The expected response type (defaults to ResponseBody)\n\t * @param path The path to the endpoint you want to call.\n\t * @param options The options for the request.\n\t * @returns The return value of the #request method.\n\t */\n\tasync put<T extends ResponseBody = ResponseBody>(path?: string | RequestOptions, options?: RequestOptions): Promise<T | undefined> {\n\t\treturn this.execute<T>(path, options, { method: HttpRequestMethod.PUT });\n\t}\n\n\t/**\n\t * It takes a path and options, and returns a request with the method set to PATCH.\n\t *\n\t * @async\n\t * @template T The expected response type (defaults to ResponseBody)\n\t * @param path The path to the endpoint you want to hit.\n\t * @param options The options for the request.\n\t * @returns A promise that resolves to the response of the request.\n\t */\n\tasync patch<T extends ResponseBody = ResponseBody>(path?: string | RequestOptions, options?: RequestOptions): Promise<T | undefined> {\n\t\treturn this.execute<T>(path, options, { method: HttpRequestMethod.PATCH });\n\t}\n\n\t/**\n\t * It takes a path and options, and returns a request with the method set to DELETE.\n\t *\n\t * @async\n\t * @param path The path to the resource you want to access.\n\t * @param options The options for the request.\n\t * @returns The result of the request.\n\t */\n\tasync delete<T extends ResponseBody = ResponseBody>(path?: string | RequestOptions, options?: RequestOptions): Promise<T | undefined> {\n\t\treturn this.execute<T>(path, options, { method: HttpRequestMethod.DELETE });\n\t}\n\n\t/**\n\t * Returns the response headers of a request to the given path.\n\t *\n\t * @async\n\t * @param path The path to the resource you want to access.\n\t * @param options The options for the request.\n\t * @returns A promise that resolves to the response object.\n\t */\n\tasync head<T extends ResponseBody = ResponseBody>(path?: string | RequestOptions, options?: RequestOptions): Promise<T | undefined> {\n\t\treturn this.execute<T>(path, options, { method: HttpRequestMethod.HEAD });\n\t}\n\n\t/**\n\t * It returns a promise that resolves to the allowed request methods for the given resource path.\n\t *\n\t * @async\n\t * @param path The path to the resource.\n\t * @param options The options for the request.\n\t * @returns A promise that resolves to an array of allowed request methods for this resource.\n\t */\n\tasync options(path?: string | RequestOptions, options: RequestOptions = {}): Promise<string[] | undefined> {\n\t\tif (isObject(path)) { [ path, options ] = [ undefined, path ] }\n\n\t\tconst requestConfig = this.processRequestOptions(options, { method: HttpRequestMethod.OPTIONS });\n\t\tconst { requestOptions } = requestConfig;\n\t\tconst requestHooks = requestOptions.hooks;\n\n\t\t// Run beforeRequest hooks: global \u2192 instance \u2192 per-request\n\t\tlet url = Transportr.createUrl(this._baseUrl, path, requestOptions.searchParams);\n\t\tconst beforeRequestHookSets = [ Transportr.globalHooks.beforeRequest, this.hooks.beforeRequest, requestHooks?.beforeRequest ];\n\t\tfor (const hooks of beforeRequestHookSets) {\n\t\t\tif (!hooks) { continue }\n\t\t\tfor (const hook of hooks) {\n\t\t\t\tconst result = await hook(requestOptions, url);\n\t\t\t\tif (result) {\n\t\t\t\t\tObject.assign(requestOptions, result);\n\t\t\t\t\tif (result.searchParams !== undefined) { url = Transportr.createUrl(this._baseUrl, path, requestOptions.searchParams) }\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet response: Response = await this._request(path, requestConfig);\n\n\t\t// Run afterResponse hooks: global \u2192 instance \u2192 per-request\n\t\tconst afterResponseHookSets = [ Transportr.globalHooks.afterResponse, this.hooks.afterResponse, requestHooks?.afterResponse ];\n\t\tfor (const hooks of afterResponseHookSets) {\n\t\t\tif (!hooks) { continue }\n\t\t\tfor (const hook of hooks) {\n\t\t\t\tconst result = await hook(response, requestOptions);\n\t\t\t\tif (result) { response = result }\n\t\t\t}\n\t\t}\n\n\t\tconst allowedMethods = response.headers.get('allow')?.split(',').map((method: string) => method.trim());\n\n\t\tthis.publish({ name: RequestEvent.SUCCESS, data: allowedMethods, global: options.global });\n\n\t\treturn allowedMethods;\n\t}\n\n\t/**\n\t * It takes a path and options, and makes a request to the server\n\t * @async\n\t * @param path The path to the endpoint you want to hit.\n\t * @param options The options for the request.\n\t * @returns The return value of the function is the return value of the function that is passed to the `then` method of the promise returned by the `fetch` method.\n\t * @throws {HttpError} If an error occurs during the request.\n\t */\n\tasync request<T = unknown>(path?: string | RequestOptions, options: RequestOptions = {}): Promise<TypedResponse<T>> {\n\t\tif (isObject(path)) { [ path, options ] = [ undefined, path ] }\n\n\t\tconst response = await this._request<T>(path, this.processRequestOptions(options, {}));\n\n\t\tthis.publish({ name: RequestEvent.SUCCESS, data: response, global: options.global });\n\n\t\treturn response;\n\t}\n\n\t/**\n\t * It gets the JSON representation of the resource at the given path.\n\t *\n\t * @async\n\t * @template T The expected JSON response type (defaults to JsonObject)\n\t * @param path The path to the resource.\n\t * @param options The options object to pass to the request.\n\t * @returns A promise that resolves to the response body as a typed JSON value.\n\t */\n\tasync getJson(path?: string | RequestOptions, options?: RequestOptions): Promise<Json | undefined> {\n\t\treturn this._get(path, options, { headers: { [HttpRequestHeader.ACCEPT]: `${mediaTypes.JSON}` } }, handleJson);\n\t}\n\n\t/**\n\t * It gets the XML representation of the resource at the given path.\n\t *\n\t * @async\n\t * @param path The path to the resource you want to get.\n\t * @param options The options for the request.\n\t * @returns The result of the function call to #get.\n\t */\n\tasync getXml(path?: string | RequestOptions, options?: RequestOptions): Promise<Document | undefined> {\n\t\treturn this._get(path, options, { headers: { [HttpRequestHeader.ACCEPT]: `${mediaTypes.XML}` } }, handleXml);\n\t}\n\n\t/**\n\t * Get the HTML content of the specified path.\n\t * When a selector is provided, returns only the first matching element from the parsed document.\n\t *\n\t * @async\n\t * @param path The path to the resource.\n\t * @param options The options for the request.\n\t * @param selector An optional CSS selector to extract a specific element from the parsed HTML.\n\t * @returns A promise that resolves to a Document, an Element (if selector matched), or void.\n\t */\n\tasync getHtml(path?: string | RequestOptions, options?: RequestOptions, selector?: string): Promise<Document | Element | null | undefined> {\n\t\tconst doc = await this._get(path, options, { headers: { [HttpRequestHeader.ACCEPT]: `${mediaTypes.HTML}` } }, handleHtml);\n\t\treturn selector && doc ? doc.querySelector(selector) : doc;\n\t}\n\n\t/**\n\t * It returns a promise that resolves to the HTML fragment at the given path.\n\t * When a selector is provided, returns only the first matching element from the parsed fragment.\n\t *\n\t * @async\n\t * @param path The path to the resource.\n\t * @param options The options for the request.\n\t * @param selector An optional CSS selector to extract a specific element from the parsed fragment.\n\t * @returns A promise that resolves to a DocumentFragment, an Element (if selector matched), or void.\n\t */\n\tasync getHtmlFragment(path?: string | RequestOptions, options?: RequestOptions, selector?: string): Promise<DocumentFragment | Element | null | undefined> {\n\t\tconst fragment = await this._get(path, options, { headers: { [HttpRequestHeader.ACCEPT]: `${mediaTypes.HTML}` } }, handleHtmlFragment);\n\t\treturn selector && fragment ? fragment.querySelector(selector) : fragment;\n\t}\n\t/**\n\t * It gets a script from the server, and appends the script to the Document HTMLHeadElement\n\t * @param path The path to the script.\n\t * @param options The options for the request.\n\t * @returns A promise that resolves to void.\n\t */\n\tasync getScript(path?: string | RequestOptions, options?: RequestOptions): Promise<void> {\n\t\treturn this._get(path, options, { headers: { [HttpRequestHeader.ACCEPT]: `${mediaTypes.JAVA_SCRIPT}` } }, handleScript);\n\t}\n\n\t/**\n\t * Gets a stylesheet from the server, and adds it as a Blob URL.\n\t * @param path The path to the stylesheet.\n\t * @param options The options for the request.\n\t * @returns A promise that resolves to void.\n\t */\n\tasync getStylesheet(path?: string | RequestOptions, options?: RequestOptions): Promise<void> {\n\t\treturn this._get(path, options, { headers: { [HttpRequestHeader.ACCEPT]: `${mediaTypes.CSS}` } }, handleCss);\n\t}\n\n\t/**\n\t * It returns a blob from the specified path.\n\t * @param path The path to the resource.\n\t * @param options The options for the request.\n\t * @returns A promise that resolves to a Blob or void.\n\t */\n\tasync getBlob(path?: string | RequestOptions, options?: RequestOptions): Promise<Blob | undefined> {\n\t\treturn this._get(path, options, { headers: { [HttpRequestHeader.ACCEPT]: HttpMediaType.BIN } }, handleBlob);\n\t}\n\n\t/**\n\t * It returns a promise that resolves to an `HTMLImageElement`.\n\t * The object URL created to load the image is automatically revoked to prevent memory leaks.\n\t * Works in both browser and Node.js (via JSDOM) environments.\n\t * @param path The path to the image.\n\t * @param options The options for the request.\n\t * @returns A promise that resolves to an `HTMLImageElement` or `void`.\n\t */\n\tasync getImage(path?: string, options?: RequestOptions): Promise<HTMLImageElement | undefined> {\n\t\treturn this._get(path, options, { headers: { [HttpRequestHeader.ACCEPT]: 'image/*' } }, handleImage);\n\t}\n\n\t/**\n\t * It gets a buffer from the specified path\n\t * @param path The path to the resource.\n\t * @param options The options for the request.\n\t * @returns A promise that resolves to an ArrayBuffer or void.\n\t */\n\tasync getBuffer(path?: string | RequestOptions, options?: RequestOptions): Promise<ArrayBuffer | undefined> {\n\t\treturn this._get(path, options, { headers: { [HttpRequestHeader.ACCEPT]: HttpMediaType.BIN } }, handleBuffer);\n\t}\n\n\t/**\n\t * It returns a readable stream of the response body from the specified path.\n\t * @param path The path to the resource.\n\t * @param options The options for the request.\n\t * @returns A promise that resolves to a ReadableStream, null, or void.\n\t */\n\tasync getStream(path?: string | RequestOptions, options?: RequestOptions): Promise<ReadableStream<Uint8Array> | null | undefined> {\n\t\treturn this._get(path, options, { headers: { [HttpRequestHeader.ACCEPT]: HttpMediaType.BIN } }, handleReadableStream);\n\t}\n\n\t/**\n\t * Handles a GET request.\n\t * @async\n\t * @param path The path to the resource.\n\t * @param userOptions The user options for the request.\n\t * @param options The options for the request.\n\t * @param responseHandler The response handler for the request.\n\t * @returns A promise that resolves to the response body or void.\n\t */\n\tprivate async _get<T extends ResponseBody>(path?: string | RequestOptions, userOptions?: RequestOptions, options: RequestOptions = {}, responseHandler?: ResponseHandler<T>): Promise<T | undefined> {\n\t\treturn this.execute(path, userOptions, { ...options, method: HttpRequestMethod.GET, body: undefined }, responseHandler);\n\t}\n\n\t/**\n\t * It processes the request options and returns a new object with the processed options.\n\t * @param path The path to the resource.\n\t * @param processedRequestOptions The user options for the request.\n\t * @returns A new object with the processed options.\n\t */\n\tprivate async _request<T = unknown>(path: string | undefined, { signalController, requestOptions, global }: RequestConfiguration): Promise<TypedResponse<T>> {\n\t\tTransportr.signalControllers.add(signalController);\n\n\t\tconst retryConfig = Transportr.normalizeRetryOptions(requestOptions.retry);\n\t\tconst method = requestOptions.method ?? 'GET';\n\t\tconst canRetry = retryConfig.limit > 0 && retryConfig.methods.includes(method);\n\t\tconst canDedupe = requestOptions.dedupe === true && (method === 'GET' || method === 'HEAD');\n\t\tlet attempt = 0;\n\t\tconst startTime = performance.now();\n\n\t\t/**\n\t\t * Creates a RequestTiming snapshot from the start time to now.\n\t\t * @returns Timing information for the request.\n\t\t */\n\t\tconst getTiming = (): RequestTiming => {\n\t\t\tconst end = performance.now();\n\t\t\treturn { start: startTime, end, duration: end - startTime };\n\t\t};\n\n\t\ttry {\n\t\t\tconst url = Transportr.createUrl(this._baseUrl, path, requestOptions.searchParams);\n\t\t\tconst dedupeKey = canDedupe ? `${method}:${url.href}` : '';\n\n\t\t\t// If deduplication is enabled and an in-flight request exists, clone its response\n\t\t\tif (canDedupe) {\n\t\t\t\tconst inflight = Transportr.inflightRequests.get(dedupeKey);\n\t\t\t\tif (inflight) { return (await inflight).clone() as TypedResponse<T> }\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Performs the fetch with retry logic.\n\t\t\t * @returns A promise resolving to the typed response.\n\t\t\t */\n\t\t\tconst doFetch = async (): Promise<TypedResponse<T>> => {\n\t\t\t\twhile (true) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst response = await fetch<T>(url, requestOptions);\n\t\t\t\t\t\tif (!response.ok) {\n\t\t\t\t\t\t\tif (canRetry && attempt < retryConfig.limit && retryConfig.statusCodes.includes(response.status)) {\n\t\t\t\t\t\t\t\tattempt++;\n\t\t\t\t\t\t\t\tthis.publish({ name: RequestEvent.RETRY, data: { attempt, status: response.status, method, path, timing: getTiming() }, global });\n\t\t\t\t\t\t\t\tawait Transportr.retryDelay(retryConfig, attempt);\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Capture response body for error diagnostics\n\t\t\t\t\t\t\tlet entity: ResponseBody | undefined;\n\t\t\t\t\t\t\ttry { entity = await response.text() } catch { /* body may be unavailable */ }\n\t\t\t\t\t\t\tthrow await this.handleError(path, response, { entity, url, method, timing: getTiming() }, requestOptions);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn response;\n\t\t\t\t\t} catch (cause) {\n\t\t\t\t\t\tif (cause instanceof HttpError) { throw cause }\n\n\t\t\t\t\t\t// Network error \u2014 retry if allowed\n\t\t\t\t\t\tif (canRetry && attempt < retryConfig.limit) {\n\t\t\t\t\t\t\tattempt++;\n\t\t\t\t\t\t\tthis.publish({ name: RequestEvent.RETRY, data: { attempt, error: (cause as Error).message, method, path, timing: getTiming() }, global });\n\t\t\t\t\t\t\tawait Transportr.retryDelay(retryConfig, attempt);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthrow await this.handleError(path, undefined, { cause: cause as Error, url, method, timing: getTiming() }, requestOptions);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tif (canDedupe) {\n\t\t\t\tconst promise = doFetch();\n\t\t\t\tTransportr.inflightRequests.set(dedupeKey, promise as Promise<Response>);\n\t\t\t\ttry {\n\t\t\t\t\tconst response = await promise;\n\t\t\t\t\treturn response;\n\t\t\t\t} finally {\n\t\t\t\t\tTransportr.inflightRequests.delete(dedupeKey);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn await doFetch();\n\t\t} finally {\n\t\t\tTransportr.signalControllers.delete(signalController.destroy());\n\t\t\tif (!requestOptions.signal?.aborted) {\n\t\t\t\tconst timing = getTiming();\n\t\t\t\tthis.publish({ name: RequestEvent.COMPLETE, data: { timing }, global });\n\t\t\t\tif (Transportr.signalControllers.size === 0) {\n\t\t\t\t\tthis.publish({ name: RequestEvent.ALL_COMPLETE, global });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Normalizes a retry option into a full RetryOptions object.\n\t * @param retry The retry option from request options.\n\t * @returns Normalized retry configuration.\n\t */\n\tprivate static normalizeRetryOptions(retry?: number | RetryOptions): NormalizedRetryOptions {\n\t\tif (retry === undefined) { return { limit: 0, statusCodes: [], methods: [], delay: retryDelay, backoffFactor: retryBackoffFactor } }\n\t\tif (typeof retry === 'number') { return { limit: retry, statusCodes: [ ...retryStatusCodes ], methods: [ ...retryMethods ], delay: retryDelay, backoffFactor: retryBackoffFactor } }\n\n\t\treturn {\n\t\t\tlimit: retry.limit ?? 0,\n\t\t\tstatusCodes: retry.statusCodes ?? [ ...retryStatusCodes ],\n\t\t\tmethods: retry.methods ?? [ ...retryMethods ],\n\t\t\tdelay: retry.delay ?? retryDelay,\n\t\t\tbackoffFactor: retry.backoffFactor ?? retryBackoffFactor\n\t\t};\n\t}\n\n\t/**\n\t * Waits for the appropriate delay before a retry attempt.\n\t * @param config The retry configuration.\n\t * @param attempt The current attempt number (1-based).\n\t * @returns A promise that resolves after the delay.\n\t */\n\tprivate static retryDelay(config: NormalizedRetryOptions, attempt: number): Promise<void> {\n\t\tconst ms = typeof config.delay === 'function' ? config.delay(attempt) : config.delay * (config.backoffFactor ** (attempt - 1));\n\t\treturn new Promise(resolve => setTimeout(resolve, ms));\n\t}\n\n\t/**\n\t * It returns a response handler based on the content type of the response.\n\t * @param path The path to the resource.\n\t * @param userOptions The user options for the request.\n\t * @param options The options for the request.\n\t * @param responseHandler The response handler for the request.\n\t * @returns A response handler function.\n\t */\n\tprivate async execute<T extends ResponseBody>(path?: string | RequestOptions, userOptions: RequestOptions = {}, options: RequestOptions = {}, responseHandler?: ResponseHandler<NoInfer<T>>): Promise<T | undefined> {\n\t\tif (isObject(path)) { [ path, userOptions ] = [ undefined, path ] }\n\n\t\tconst requestConfig = this.processRequestOptions(userOptions, options);\n\t\tconst { requestOptions } = requestConfig;\n\t\tconst requestHooks = requestOptions.hooks;\n\n\t\t// Run beforeRequest hooks: global \u2192 instance \u2192 per-request\n\t\tlet url = Transportr.createUrl(this._baseUrl, path, requestOptions.searchParams);\n\n\t\tconst beforeRequestHookSets = [ Transportr.globalHooks.beforeRequest, this.hooks.beforeRequest, requestHooks?.beforeRequest ];\n\t\tfor (const hooks of beforeRequestHookSets) {\n\t\t\tif (!hooks) { continue }\n\t\t\tfor (const hook of hooks) {\n\t\t\t\tconst result = await hook(requestOptions, url);\n\t\t\t\tif (result) {\n\t\t\t\t\tObject.assign(requestOptions, result);\n\t\t\t\t\tif (result.searchParams !== undefined) { url = Transportr.createUrl(this._baseUrl, path, requestOptions.searchParams) }\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet response = await this._request<T>(path, requestConfig);\n\n\t\t// Run afterResponse hooks: global \u2192 instance \u2192 per-request\n\t\tconst afterResponseHookSets = [ Transportr.globalHooks.afterResponse, this.hooks.afterResponse, requestHooks?.afterResponse ];\n\t\tfor (const hooks of afterResponseHookSets) {\n\t\t\tif (!hooks) { continue }\n\t\t\tfor (const hook of hooks) {\n\t\t\t\tconst result = await hook(response, requestOptions);\n\t\t\t\tif (result) { response = result as TypedResponse<T> }\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\tif (!responseHandler && response.status !== 204) {\n\t\t\t\tresponseHandler = this.getResponseHandler<T>(response.headers.get(HttpResponseHeader.CONTENT_TYPE));\n\t\t\t}\n\n\t\t\tconst data = await responseHandler?.(response);\n\n\t\t\tthis.publish({ name: RequestEvent.SUCCESS, data, global: requestConfig.global });\n\n\t\t\treturn data;\n\t\t} catch (cause) {\n\t\t\tthrow await this.handleError(path as string, response, { cause: cause as Error }, requestOptions);\n\t\t}\n\t}\n\n\t/**\n\t * Creates a new set of options for a request.\n\t * @param options The user options for the request.\n\t * @param userOptions The default options for the request.\n\t * @returns A new set of options for the request.\n\t */\n\tprivate static createOptions({ headers: userHeaders, searchParams: userSearchParams, ...userOptions }: RequestOptions, { headers, searchParams, ...options }: RequestOptions): RequestOptions {\n\t\theaders = Transportr.mergeHeaders(new Headers(), userHeaders, headers);\n\t\tsearchParams = Transportr.mergeSearchParams(new URLSearchParams(), userSearchParams, searchParams);\n\n\t\treturn { ...objectMerge(options, userOptions) ?? {}, headers, searchParams };\n\t}\n\n\t/**\n\t * Merges user and request headers into the target Headers object.\n\t * @param target The target Headers object.\n\t * @param headerSources Variable number of header sources to merge.\n\t * @returns The merged Headers object.\n\t */\n\tprivate static mergeHeaders(target: Headers, ...headerSources: (RequestHeaders | undefined)[]): Headers {\n\t\tfor (const headers of headerSources) {\n\t\t\tif (headers === undefined) { continue }\n\n\t\t\t// Handle different input types\n\t\t\tif (headers instanceof Headers) {\n\t\t\t\t// Use the native forEach method for Headers\n\t\t\t\theaders.forEach((value, name) => target.set(name, value));\n\t\t\t} else if (Array.isArray(headers)) {\n\t\t\t\t// Handle array of tuples format\n\t\t\t\tfor (const [ name, value ] of headers) { target.set(name, value) }\n\t\t\t} else {\n\t\t\t\t// Handle Record<string, string> format - use Object.keys() for better performance\n\t\t\t\tconst record = headers as Record<string, string | undefined>;\n\t\t\t\tconst keys = Object.keys(record);\n\t\t\t\tfor (let i = 0; i < keys.length; i++) {\n\t\t\t\t\tconst name = keys[i]!;\n\t\t\t\t\tconst value = record[name];\n\t\t\t\t\tif (value !== undefined) { target.set(name, String(value)) }\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn target;\n\t}\n\n\t/**\n\t * Merges user and request search parameters into the target URLSearchParams object.\n\t * @param target The target URLSearchParams object.\n\t * @param sources The search parameters to merge.\n\t * @returns The merged URLSearchParams object.\n\t */\n\tprivate static mergeSearchParams(target: URLSearchParams, ...sources: (SearchParameters | undefined)[]): URLSearchParams {\n\t\tfor (const searchParams of sources) {\n\t\t\tif (searchParams === undefined) { continue }\n\n\t\t\t// Handle different input types\n\t\t\tif (searchParams instanceof URLSearchParams) {\n\t\t\t\t// Use the native forEach method for URLSearchParams\n\t\t\t\tsearchParams.forEach((value, name) => target.set(name, value));\n\t\t\t} else if (isString(searchParams) || Array.isArray(searchParams)) {\n\t\t\t\tfor (const [name, value] of new URLSearchParams(searchParams)) { target.set(name, value) }\n\t\t\t} else {\n\t\t\t\t// Handle Record<string, string> format - use Object.keys() for better performance\n\t\t\t\tconst keys = Object.keys(searchParams);\n\t\t\t\tfor (let i = 0; i < keys.length; i++) {\n\t\t\t\t\tconst name = keys[i]!;\n\t\t\t\t\tconst value = searchParams[name];\n\t\t\t\t\tif (value !== undefined) { target.set(name, String(value)) }\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn target;\n\t}\n\n\t/**\n\t * Processes request options by merging user, instance, and method-specific options.\n\t * This method optimizes performance by using cached instance options and performing\n\t * shallow merges where possible instead of deep object cloning.\n\t * @param userOptions The user-provided options for the request.\n\t * @param options Additional method-specific options.\n\t * @returns Processed request options with signal controller and global flag.\n\t */\n\tprivate processRequestOptions({ body: userBody, headers: userHeaders, searchParams: userSearchParams, ...userOptions }: RequestOptions, { headers, searchParams, ...options }: RequestOptions): RequestConfiguration {\n\t\t// Optimize: Use shallow merge for non-nested properties instead of deep objectMerge\n\t\t// The instance _options are already merged with defaults in the constructor\n\t\tconst requestOptions = {\n\t\t\t// Spread instance options (already merged with defaults)\n\t\t\t...this._options,\n\t\t\t// Spread user options (shallow merge, sufficient for flat properties)\n\t\t\t...userOptions,\n\t\t\t// Spread method-specific options (e.g., method: 'POST')\n\t\t\t...options,\n\t\t\t// Deep merge required for headers and searchParams\n\t\t\theaders: Transportr.mergeHeaders(new Headers(), this._options.headers, userHeaders, headers),\n\t\t\tsearchParams: Transportr.mergeSearchParams(new URLSearchParams(), this._options.searchParams, userSearchParams, searchParams)\n\t\t};\n\n\t\tif (isRequestBodyMethod(requestOptions.method)) {\n\t\t\tif (isRawBody(userBody)) {\n\t\t\t\t// Raw BodyInit \u2014 send as-is, delete Content-Type so the runtime sets it automatically\n\t\t\t\trequestOptions.body = userBody;\n\t\t\t\trequestOptions.headers.delete(HttpRequestHeader.CONTENT_TYPE);\n\t\t\t} else {\n\t\t\t\tconst isJson = requestOptions.headers.get(HttpRequestHeader.CONTENT_TYPE)?.includes('json') ?? false;\n\t\t\t\trequestOptions.body = isJson && isObject(userBody) ? serialize(userBody) : userBody;\n\t\t\t}\n\t\t} else {\n\t\t\trequestOptions.headers.delete(HttpRequestHeader.CONTENT_TYPE);\n\t\t\tif (requestOptions.body instanceof URLSearchParams) {\n\t\t\t\tTransportr.mergeSearchParams(requestOptions.searchParams, requestOptions.body);\n\t\t\t}\n\t\t\trequestOptions.body = undefined;\n\t\t}\n\n\t\tconst { signal, timeout, global = false, xsrf } = requestOptions;\n\n\t\t// XSRF/CSRF protection: read token from cookie and set as request header\n\t\tif (xsrf) {\n\t\t\tconst xsrfConfig: XsrfOptions = typeof xsrf === 'object' ? xsrf : {};\n\t\t\tconst token = getCookieValue(xsrfConfig.cookieName ?? XSRF_COOKIE_NAME);\n\t\t\tif (token) { requestOptions.headers.set(xsrfConfig.headerName ?? XSRF_HEADER_NAME, token) }\n\t\t}\n\n\t\tconst signalController = new SignalController({ signal, timeout })\n\t\t\t.onAbort((event) => this.publish({ name: RequestEvent.ABORTED, event, global }))\n\t\t\t.onTimeout((event) => this.publish({ name: RequestEvent.TIMEOUT, event, global }));\n\n\t\trequestOptions.signal = signalController.signal;\n\t\tthis.publish({ name: RequestEvent.CONFIGURED, data: requestOptions, global });\n\n\t\treturn { signalController, requestOptions, global } as RequestConfiguration;\n\t}\n\n\t/**\n\t * Gets the base URL from a URL or string.\n\t * @param url The URL or string to parse.\n\t * @returns The base URL.\n\t */\n\tprivate static getBaseUrl(url: URL | string): URL {\n\t\tif (url instanceof URL) { return url }\n\n\t\tif (!isString(url)) { throw new TypeError('Invalid URL') }\n\n\t\treturn new URL(url, url.startsWith('/') ? globalThis.location.origin : undefined);\n\t}\n\n\t/**\n\t * Parses a content-type string into a MediaType instance with caching.\n\t * This method caches parsed MediaType instances to avoid re-parsing the same content-type strings,\n\t * which significantly improves performance for repeated requests with the same content types.\n\t * @param contentType The content-type string to parse.\n\t * @returns The parsed MediaType instance, or undefined if parsing fails.\n\t */\n\tprivate static getOrParseMediaType(contentType: string | null): MediaType | undefined {\n\t\tif (contentType === null) { return }\n\n\t\t// Check the predefined mediaTypes map first (fastest lookup) or the cache\n\t\tlet mediaType = Transportr.mediaTypeCache.get(contentType);\n\n\t\tif (mediaType !== undefined) { return mediaType }\n\n\t\t// Parse and cache the new MediaType\n\t\tmediaType = MediaType.parse(contentType) ?? undefined;\n\n\t\tif (mediaType !== undefined) {\n\t\t\t// Evict oldest entries when cache exceeds limit to prevent unbounded growth\n\t\t\tif (Transportr.mediaTypeCache.size >= 100) {\n\t\t\t\tconst firstKey = Transportr.mediaTypeCache.keys().next().value;\n\t\t\t\tif (firstKey !== undefined) { Transportr.mediaTypeCache.delete(firstKey) }\n\t\t\t}\n\t\t\tTransportr.mediaTypeCache.set(contentType, mediaType);\n\t\t}\n\n\t\treturn mediaType;\n\t}\n\n\t/**\n\t * Creates a new URL with the given path and search parameters.\n\t * @param url The base URL.\n\t * @param path The path to append to the base URL.\n\t * @param searchParams The search parameters to append to the URL.\n\t * @returns A new URL with the given path and search parameters.\n\t */\n\tprivate static createUrl(url: URL, path?: string, searchParams?: SearchParameters): URL {\n\t\tconst requestUrl = path ? new URL(`${url.pathname.replace(endsWithSlashRegEx, '')}${path}`, url.origin) : new URL(url);\n\n\t\tif (searchParams) {\n\t\t\tTransportr.mergeSearchParams(requestUrl.searchParams, searchParams);\n\t\t}\n\n\t\treturn requestUrl;\n\t}\n\n\t/**\n\t * It generates a ResponseStatus object from an error name and a Response object.\n\t * @param errorName The name of the error.\n\t * @param response The Response object.\n\t * @returns A ResponseStatus object.\n\t */\n\tprivate static generateResponseStatusFromError(errorName?: string, { status, statusText }: Response = new Response()): ResponseStatus {\n\t\tswitch (errorName) {\n\t\t\tcase SignalErrors.ABORT: return aborted;\n\t\t\tcase SignalErrors.TIMEOUT: return timedOut;\n\t\t\tdefault: return status >= 400 ? new ResponseStatus(status, statusText) : internalServerError;\n\t\t}\n\t}\n\n\t/**\n\t * Handles an error that occurs during a request.\n\t * @param path The path of the request.\n\t * @param response The Response object.\n\t * @param options Additional error context including cause, entity, url, method, and timing.\n\t * @param requestOptions The original request options that led to the error, used for hooks context.\n\t * @returns An HttpError object.\n\t */\n\tprivate async handleError(path?: string, response?: Response, { cause, entity, url, method, timing }: Omit<HttpErrorOptions, 'message'> = {}, requestOptions?: RequestOptions): Promise<HttpError> {\n\t\tconst message = method && url\t? `${method} ${url.href} failed${response ? ` with status ${response.status}` : ''}` : `An error has occurred with your request to: '${path}'`;\n\t\tlet error = new HttpError(Transportr.generateResponseStatusFromError(cause?.name, response), { message, cause, entity, url, method, timing });\n\n\t\t// Run beforeError hooks: global \u2192 instance \u2192 per-request\n\t\tconst beforeErrorHookSets = [ Transportr.globalHooks.beforeError, this.hooks.beforeError, requestOptions?.hooks?.beforeError ];\n\t\tfor (const hooks of beforeErrorHookSets) {\n\t\t\tif (!hooks) { continue }\n\t\t\tfor (const hook of hooks) {\n\t\t\t\tconst result = await hook(error);\n\t\t\t\tif (result instanceof HttpError) { error = result }\n\t\t\t}\n\t\t}\n\n\t\tthis.publish({ name: RequestEvent.ERROR, data: error });\n\n\t\treturn error;\n\t}\n\n\t/**\n\t * Publishes an event to the global and instance event handlers.\n\t * @param eventObject The event object to publish.\n\t */\n\tprivate publish({ name, event = new CustomEvent(name), data, global = true }: PublishOptions): void {\n\t\tif (global) { Transportr.globalSubscribr.publish(name, event, data) }\n\t\tthis.subscribr.publish(name, event, data);\n\t}\n\n\t/**\n\t * It returns a response handler based on the content type of the response.\n\t * @param contentType The content type of the response.\n\t * @returns A response handler function.\n\t */\n\tprivate getResponseHandler<T extends ResponseBody>(contentType?: string | null): ResponseHandler<T> | undefined {\n\t\tif (!contentType) { return }\n\n\t\tconst mediaType = Transportr.getOrParseMediaType(contentType);\n\n\t\tif (!mediaType) { return }\n\n\t\tfor (const [ contentType, responseHandler ] of Transportr.contentTypeHandlers) {\n\t\t\tif (mediaType.matches(contentType)) { return responseHandler as ResponseHandler<T> }\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * A string representation of the Transportr instance.\n\t * @returns The string 'Transportr'.\n\t */\n\tget [Symbol.toStringTag](): string {\n\t\treturn 'Transportr';\n\t}\n}\n"],
5
- "mappings": ";AAAO,IAAM,sBAA8B;ACE3C,IAAM,UAAkB;AACxB,IAAM,kCAA0C;AAazC,IAAM,sBAAN,MAAM,6BAA4B,IAAoB;;;;;;EAM5D,YAAYA,WAAsC,CAAC,GAAG;AACrD,UAAMA,QAAO;EACd;;;;;;;;EASA,OAAO,QAAQ,MAAc,OAAwB;AACpD,WAAO,oBAAoB,KAAK,IAAI,KAAK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;AACxBF,kBAAUC,QAAQ,IAAIN,WAAWO,KAAK;MACxC,WACEA,SACA,OAAOA,UAAU,YACjBA,MAAME,gBAAgBzE,QACtB;AACAqE,kBAAUC,QAAQ,IAAIH,MAAMI,KAAK;MACnC,OAAO;AACLF,kBAAUC,QAAQ,IAAIC;MACxB;IACF;EACF;AAEA,SAAOF;AACT;AASA,SAASK,aACPN,QACAO,MAAY;AAEZ,SAAOP,WAAW,MAAM;AACtB,UAAMQ,OAAO7E,yBAAyBqE,QAAQO,IAAI;AAElD,QAAIC,MAAM;AACR,UAAIA,KAAKC,KAAK;AACZ,eAAOzD,QAAQwD,KAAKC,GAAG;MACzB;AAEA,UAAI,OAAOD,KAAKL,UAAU,YAAY;AACpC,eAAOnD,QAAQwD,KAAKL,KAAK;MAC3B;IACF;AAEAH,aAAStE,eAAesE,MAAM;EAChC;AAEA,WAASU,gBAAa;AACpB,WAAO;EACT;AAEA,SAAOA;AACT;ACjNO,IAAMC,SAAO9E,OAAO,CACzB,KACA,QACA,WACA,WACA,QACA,WACA,SACA,SACA,KACA,OACA,OACA,OACA,SACA,cACA,QACA,MACA,UACA,UACA,WACA,UACA,QACA,QACA,OACA,YACA,WACA,QACA,YACA,MACA,aACA,OACA,WACA,OACA,UACA,OACA,OACA,MACA,MACA,WACA,MACA,YACA,cACA,UACA,QACA,UACA,QACA,MACA,MACA,MACA,MACA,MACA,MACA,QACA,UACA,UACA,MACA,QACA,KACA,OACA,SACA,OACA,OACA,SACA,UACA,MACA,QACA,OACA,QACA,WACA,QACA,YACA,SACA,OACA,QACA,MACA,YACA,UACA,UACA,KACA,WACA,OACA,YACA,KACA,MACA,MACA,QACA,KACA,QACA,UACA,WACA,UACA,UACA,QACA,SACA,UACA,UACA,QACA,UACA,UACA,SACA,OACA,WACA,OACA,SACA,SACA,MACA,YACA,YACA,SACA,MACA,SACA,QACA,MACA,SACA,MACA,KACA,MACA,OACA,SACA,KAAK,CACG;AAEH,IAAM+E,QAAM/E,OAAO,CACxB,OACA,KACA,YACA,eACA,gBACA,gBACA,iBACA,oBACA,UACA,YACA,QACA,QACA,WACA,gBACA,eACA,UACA,QACA,KACA,SACA,YACA,SACA,SACA,aACA,QACA,kBACA,UACA,QACA,YACA,SACA,QACA,QACA,WACA,WACA,YACA,kBACA,QACA,QACA,SACA,UACA,UACA,QACA,YACA,SACA,QACA,SACA,QACA,OAAO,CACC;AAEH,IAAMgF,aAAahF,OAAO,CAC/B,WACA,iBACA,uBACA,eACA,oBACA,qBACA,qBACA,kBACA,gBACA,WACA,WACA,WACA,WACA,WACA,kBACA,WACA,WACA,eACA,gBACA,YACA,gBACA,sBACA,eACA,UACA,cAAc,CACN;AAMH,IAAMiF,gBAAgBjF,OAAO,CAClC,WACA,iBACA,UACA,WACA,aACA,oBACA,kBACA,iBACA,iBACA,iBACA,SACA,aACA,QACA,gBACA,aACA,WACA,iBACA,UACA,OACA,cACA,WACA,KAAK,CACG;AAEH,IAAMkF,WAASlF,OAAO,CAC3B,QACA,YACA,UACA,WACA,SACA,UACA,MACA,cACA,iBACA,MACA,MACA,SACA,WACA,YACA,SACA,QACA,MACA,UACA,SACA,UACA,QACA,QACA,WACA,UACA,OACA,SACA,OACA,UACA,cACA,aAAa,CACL;AAIH,IAAMmF,mBAAmBnF,OAAO,CACrC,WACA,eACA,cACA,YACA,aACA,WACA,WACA,UACA,UACA,SACA,aACA,cACA,kBACA,eACA,MAAM,CACE;AAEH,IAAMoF,OAAOpF,OAAO,CAAC,OAAO,CAAU;AC1RtC,IAAM8E,OAAO9E,OAAO,CACzB,UACA,UACA,SACA,OACA,kBACA,gBACA,wBACA,YACA,cACA,WACA,UACA,WACA,eACA,eACA,WACA,QACA,SACA,SACA,SACA,QACA,WACA,YACA,gBACA,UACA,eACA,YACA,YACA,WACA,OACA,YACA,2BACA,yBACA,YACA,aACA,WACA,gBACA,eACA,QACA,OACA,WACA,UACA,UACA,QACA,QACA,YACA,MACA,SACA,aACA,aACA,SACA,QACA,SACA,QACA,QACA,WACA,QACA,OACA,OACA,aACA,SACA,UACA,OACA,aACA,YACA,SACA,QACA,SACA,WACA,cACA,UACA,QACA,WACA,QACA,WACA,eACA,eACA,WACA,iBACA,uBACA,UACA,WACA,WACA,cACA,YACA,OACA,YACA,OACA,YACA,QACA,QACA,WACA,cACA,SACA,YACA,SACA,QACA,SACA,QACA,QACA,WACA,SACA,OACA,UACA,QACA,SACA,WACA,YACA,SACA,aACA,QACA,UACA,UACA,SACA,SACA,QACA,SACA,MAAM,CACE;AAEH,IAAM+E,MAAM/E,OAAO,CACxB,iBACA,cACA,YACA,sBACA,aACA,UACA,iBACA,iBACA,WACA,iBACA,kBACA,SACA,QACA,MACA,SACA,QACA,iBACA,aACA,aACA,SACA,uBACA,+BACA,iBACA,mBACA,MACA,MACA,KACA,MACA,MACA,mBACA,aACA,WACA,WACA,OACA,YACA,aACA,OACA,YACA,QACA,gBACA,aACA,UACA,eACA,eACA,iBACA,eACA,aACA,oBACA,gBACA,cACA,gBACA,eACA,MACA,MACA,MACA,MACA,cACA,YACA,iBACA,qBACA,UACA,QACA,MACA,mBACA,MACA,OACA,aACA,KACA,MACA,MACA,MACA,MACA,WACA,aACA,cACA,YACA,QACA,gBACA,kBACA,gBACA,oBACA,kBACA,SACA,cACA,cACA,gBACA,gBACA,eACA,eACA,oBACA,aACA,OACA,QACA,aACA,SACA,UACA,QACA,OACA,QACA,cACA,UACA,YACA,WACA,SACA,UACA,eACA,UACA,YACA,eACA,QACA,cACA,uBACA,oBACA,gBACA,UACA,iBACA,uBACA,kBACA,KACA,MACA,MACA,UACA,QACA,QACA,eACA,aACA,WACA,UACA,UACA,SACA,QACA,mBACA,SACA,oBACA,oBACA,gBACA,eACA,gBACA,eACA,cACA,gBACA,oBACA,qBACA,kBACA,mBACA,qBACA,kBACA,UACA,gBACA,SACA,gBACA,kBACA,YACA,eACA,WACA,WACA,aACA,oBACA,eACA,mBACA,kBACA,cACA,QACA,MACA,MACA,WACA,UACA,WACA,cACA,WACA,cACA,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AMA,KAAK,OAAO,WAAW,IAAY;AAClC,WAAO;AAAA,EACR;AACD;",
6
- "names": ["entries", "text", "entries", "setPrototypeOf", "isFrozen", "getPrototypeOf", "getOwnPropertyDescriptor", "Object", "freeze", "seal", "create", "apply", "construct", "Reflect", "x", "func", "thisArg", "_len", "arguments", "length", "args", "Array", "_key", "Func", "_len2", "_key2", "arrayForEach", "unapply", "prototype", "forEach", "arrayLastIndexOf", "lastIndexOf", "arrayPop", "pop", "arrayPush", "push", "arraySplice", "splice", "stringToLowerCase", "String", "toLowerCase", "stringToString", "toString", "stringMatch", "match", "stringReplace", "replace", "stringIndexOf", "indexOf", "stringTrim", "trim", "objectHasOwnProperty", "hasOwnProperty", "regExpTest", "RegExp", "test", "typeErrorCreate", "unconstruct", "TypeError", "lastIndex", "_len3", "_key3", "_len4", "_key4", "addToSet", "set", "array", "transformCaseFunc", "l", "element", "lcElement", "cleanArray", "index", "isPropertyExist", "clone", "object", "newObject", "property", "value", "isArray", "constructor", "lookupGetter", "prop", "desc", "get", "fallbackValue", "html", "svg", "svgFilters", "svgDisallowed", "mathMl", "mathMlDisallowed", "text", "xml", "MUSTACHE_EXPR", "ERB_EXPR", "TMPLIT_EXPR", "DATA_ATTR", "ARIA_ATTR", "IS_ALLOWED_URI", "IS_SCRIPT_OR_DATA", "ATTR_WHITESPACE", "DOCTYPE_NAME", "CUSTOM_ELEMENT", "NODE_TYPE", "attribute", "cdataSection", "entityReference", "entityNode", "progressingInstruction", "comment", "document", "documentType", "documentFragment", "notation", "getGlobal", "window", "_createTrustedTypesPolicy", "trustedTypes", "purifyHostElement", "createPolicy", "suffix", "ATTR_NAME", "hasAttribute", "getAttribute", "policyName", "createHTML", "createScriptURL", "scriptUrl", "_", "console", "warn", "_createHooksMap", "afterSanitizeAttributes", "afterSanitizeElements", "afterSanitizeShadowDOM", "beforeSanitizeAttributes", "beforeSanitizeElements", "beforeSanitizeShadowDOM", "uponSanitizeAttribute", "uponSanitizeElement", "uponSanitizeShadowNode", "createDOMPurify", "undefined", "DOMPurify", "root", "version", "VERSION", "removed", "nodeType", "Element", "isSupported", "originalDocument", "currentScript", "DocumentFragment", "HTMLTemplateElement", "Node", "NodeFilter", "NamedNodeMap", "MozNamedAttrMap", "HTMLFormElement", "DOMParser", "ElementPrototype", "cloneNode", "remove", "getNextSibling", "getChildNodes", "getParentNode", "template", "createElement", "content", "ownerDocument", "trustedTypesPolicy", "emptyHTML", "implementation", "createNodeIterator", "createDocumentFragment", "getElementsByTagName", "importNode", "hooks", "createHTMLDocument", "EXPRESSIONS", "ALLOWED_TAGS", "DEFAULT_ALLOWED_TAGS", "TAGS", "ALLOWED_ATTR", "DEFAULT_ALLOWED_ATTR", "ATTRS", "CUSTOM_ELEMENT_HANDLING", "tagNameCheck", "writable", "configurable", "enumerable", "attributeNameCheck", "allowCustomizedBuiltInElements", "FORBID_TAGS", "FORBID_ATTR", "EXTRA_ELEMENT_HANDLING", "tagCheck", "attributeCheck", "ALLOW_ARIA_ATTR", "ALLOW_DATA_ATTR", "ALLOW_UNKNOWN_PROTOCOLS", "ALLOW_SELF_CLOSE_IN_ATTR", "SAFE_FOR_TEMPLATES", "SAFE_FOR_XML", "WHOLE_DOCUMENT", "SET_CONFIG", "FORCE_BODY", "RETURN_DOM", "RETURN_DOM_FRAGMENT", "RETURN_TRUSTED_TYPE", "SANITIZE_DOM", "SANITIZE_NAMED_PROPS", "SANITIZE_NAMED_PROPS_PREFIX", "KEEP_CONTENT", "IN_PLACE", "USE_PROFILES", "FORBID_CONTENTS", "DEFAULT_FORBID_CONTENTS", "DATA_URI_TAGS", "DEFAULT_DATA_URI_TAGS", "URI_SAFE_ATTRIBUTES", "DEFAULT_URI_SAFE_ATTRIBUTES", "MATHML_NAMESPACE", "SVG_NAMESPACE", "HTML_NAMESPACE", "NAMESPACE", "IS_EMPTY_INPUT", "ALLOWED_NAMESPACES", "DEFAULT_ALLOWED_NAMESPACES", "MATHML_TEXT_INTEGRATION_POINTS", "HTML_INTEGRATION_POINTS", "COMMON_SVG_AND_HTML_ELEMENTS", "PARSER_MEDIA_TYPE", "SUPPORTED_PARSER_MEDIA_TYPES", "DEFAULT_PARSER_MEDIA_TYPE", "CONFIG", "formElement", "isRegexOrFunction", "testValue", "Function", "_parseConfig", "cfg", "ADD_URI_SAFE_ATTR", "ADD_DATA_URI_TAGS", "ALLOWED_URI_REGEXP", "ADD_TAGS", "ADD_ATTR", "ADD_FORBID_CONTENTS", "table", "tbody", "TRUSTED_TYPES_POLICY", "ALL_SVG_TAGS", "ALL_MATHML_TAGS", "_checkValidNamespace", "parent", "tagName", "namespaceURI", "parentTagName", "Boolean", "_forceRemove", "node", "removeChild", "_removeAttribute", "name", "getAttributeNode", "from", "removeAttribute", "setAttribute", "_initDocument", "dirty", "doc", "leadingWhitespace", "matches", "dirtyPayload", "parseFromString", "documentElement", "createDocument", "innerHTML", "body", "insertBefore", "createTextNode", "childNodes", "call", "_createNodeIterator", "SHOW_ELEMENT", "SHOW_COMMENT", "SHOW_TEXT", "SHOW_PROCESSING_INSTRUCTION", "SHOW_CDATA_SECTION", "_isClobbered", "nodeName", "textContent", "attributes", "hasChildNodes", "_isNode", "_executeHooks", "currentNode", "data", "hook", "_sanitizeElements", "allowedTags", "firstElementChild", "_isBasicCustomElement", "parentNode", "childCount", "i", "childClone", "__removalCount", "expr", "_isValidAttribute", "lcTag", "lcName", "_sanitizeAttributes", "hookEvent", "attrName", "attrValue", "keepAttr", "allowedAttributes", "forceKeepAttr", "attr", "initValue", "getAttributeType", "setAttributeNS", "_sanitizeShadowDOM", "fragment", "shadowNode", "shadowIterator", "nextNode", "sanitize", "importedNode", "returnNode", "appendChild", "firstChild", "nodeIterator", "shadowroot", "shadowrootmode", "serializedHTML", "outerHTML", "doctype", "setConfig", "clearConfig", "isValidAttribute", "tag", "addHook", "entryPoint", "hookFunction", "removeHook", "removeHooks", "removeAllHooks", "window", "contentType"]
3
+ "sources": ["../node_modules/.pnpm/@d1g1tal+media-type@6.0.4/node_modules/@d1g1tal/media-type/src/utils.ts", "../node_modules/.pnpm/@d1g1tal+media-type@6.0.4/node_modules/@d1g1tal/media-type/src/media-type-parameters.ts", "../node_modules/.pnpm/@d1g1tal+media-type@6.0.4/node_modules/@d1g1tal/media-type/src/media-type-parser.ts", "../node_modules/.pnpm/@d1g1tal+media-type@6.0.4/node_modules/@d1g1tal/media-type/src/media-type.ts", "../node_modules/.pnpm/@d1g1tal+subscribr@4.1.8_typescript@5.9.3/node_modules/@d1g1tal/subscribr/node_modules/.pnpm/@d1g1tal+collections@2.1.1_typescript@5.9.3/node_modules/@d1g1tal/collections/src/set-multi-map.ts", "../node_modules/.pnpm/@d1g1tal+subscribr@4.1.8_typescript@5.9.3/node_modules/@d1g1tal/subscribr/src/context-event-handler.ts", "../node_modules/.pnpm/@d1g1tal+subscribr@4.1.8_typescript@5.9.3/node_modules/@d1g1tal/subscribr/src/subscription.ts", "../node_modules/.pnpm/@d1g1tal+subscribr@4.1.8_typescript@5.9.3/node_modules/@d1g1tal/subscribr/src/subscribr.ts", "../src/http-error.ts", "../src/response-status.ts", "../src/constants.ts", "../src/signal-controller.ts", "../src/response-handlers.ts", "../src/utils.ts", "../src/transportr.ts"],
4
+ "sourcesContent": ["export const httpTokenCodePoints: RegExp = /^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/u;", "import { httpTokenCodePoints } from './utils.js';\n\nconst matcher: RegExp = /([\"\\\\])/ug;\nconst httpQuotedStringTokenCodePoints: RegExp = /^[\\t\\u0020-\\u007E\\u0080-\\u00FF]*$/u;\n\n/**\n * Class representing the parameters for a media type record.\n * This class extends a JavaScript Map<string, string>.\n *\n * However, MediaTypeParameters methods will always interpret their arguments\n * as appropriate for media types, so parameter names will be lowercased,\n * and attempting to set invalid characters will throw an Error.\n *\n * @see https://mimesniff.spec.whatwg.org\n * @author D1g1talEntr0py <jason.dimeo@gmail.com>\n */\nexport class MediaTypeParameters extends Map<string, string> {\n\t/**\n\t * Create a new MediaTypeParameters instance.\n\t *\n\t * @param entries An array of [ name, value ] tuples.\n\t */\n\tconstructor(entries: Iterable<[string, string]> = []) {\n\t\tsuper(entries);\n\t}\n\n\t/**\n\t * Indicates whether the supplied name and value are valid media type parameters.\n\t *\n\t * @param name The name of the media type parameter to validate.\n\t * @param value The media type parameter value to validate.\n\t * @returns true if the media type parameter is valid, false otherwise.\n\t */\n\tstatic isValid(name: string, value: string): boolean {\n\t\treturn httpTokenCodePoints.test(name) && httpQuotedStringTokenCodePoints.test(value);\n\t}\n\n\t/**\n\t * Gets the media type parameter value for the supplied name.\n\t *\n\t * @param name The name of the media type parameter to retrieve.\n\t * @returns The media type parameter value.\n\t */\n\toverride get(name: string): string | undefined {\n\t\treturn super.get(name.toLowerCase());\n\t}\n\n\t/**\n\t * Indicates whether the media type parameter with the specified name exists or not.\n\t *\n\t * @param name The name of the media type parameter to check.\n\t * @returns true if the media type parameter exists, false otherwise.\n\t */\n\toverride has(name: string): boolean {\n\t\treturn super.has(name.toLowerCase());\n\t}\n\n\t/**\n\t * Adds a new media type parameter using the specified name and value to the MediaTypeParameters.\n\t * If an parameter with the same name already exists, the parameter will be updated.\n\t *\n\t * @param name The name of the media type parameter to set.\n\t * @param value The media type parameter value.\n\t * @returns This instance.\n\t */\n\toverride set(name: string, value: string): this {\n\t\tif (!MediaTypeParameters.isValid(name, value)) {\n\t\t\tthrow new Error(`Invalid media type parameter name/value: ${name}/${value}`);\n\t\t}\n\n\t\tsuper.set(name.toLowerCase(), value);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Removes the media type parameter using the specified name.\n\t *\n\t * @param name The name of the media type parameter to delete.\n\t * @returns true if the parameter existed and has been removed, or false if the parameter does not exist.\n\t */\n\toverride delete(name: string): boolean {\n\t\treturn super.delete(name.toLowerCase());\n\t}\n\n\t/**\n\t * Returns a string representation of the media type parameters.\n\t *\n\t * @returns The string representation of the media type parameters.\n\t */\n\toverride toString(): string {\n\t\treturn Array.from(this).map(([ name, value ]) => `;${name}=${!value || !httpTokenCodePoints.test(value) ? `\"${value.replace(matcher, '\\\\$1')}\"` : value}`).join('');\n\t}\n\n\t/**\n\t * Returns the name of this class.\n\t *\n\t * @returns The name of this class.\n\t */\n\toverride get [Symbol.toStringTag](): string {\n\t\treturn 'MediaTypeParameters';\n\t}\n}", "import { MediaTypeParameters } from './media-type-parameters.js';\nimport { httpTokenCodePoints } from './utils.js';\n\nconst whitespaceChars = new Set([' ', '\\t', '\\n', '\\r']);\nconst trailingWhitespace: RegExp = /[ \\t\\n\\r]+$/u;\nconst leadingAndTrailingWhitespace: RegExp = /^[ \\t\\n\\r]+|[ \\t\\n\\r]+$/ug;\n\nexport interface MediaTypeComponent {\n\tposition?: number;\n\tinput: string;\n\tlowerCase?: boolean;\n\ttrim?: boolean;\n}\n\nexport interface ParsedMediaType {\n\ttype: string;\n\tsubtype: string;\n\tparameters: MediaTypeParameters;\n}\n\n/**\n * Parser for media types.\n * @see https://mimesniff.spec.whatwg.org/#parsing-a-mime-type\n * @author D1g1talEntr0py <jason.dimeo@gmail.com>\n */\nexport class MediaTypeParser {\n\t/**\n\t * Function to parse a media type.\n\t * @param input The media type to parse\n\t * @returns An object populated with the parsed media type properties and any parameters.\n\t */\n\tstatic parse(input: string): ParsedMediaType {\n\t\tinput = input.replace(leadingAndTrailingWhitespace, '');\n\n\t\tlet position = 0;\n\t\tconst [ type, typeEnd ] = MediaTypeParser.collect(input, position, ['/']);\n\t\tposition = typeEnd;\n\n\t\tif (!type.length || position >= input.length || !httpTokenCodePoints.test(type)) {\n\t\t\tthrow new TypeError(MediaTypeParser.generateErrorMessage('type', type));\n\t\t}\n\n\t\t++position; // Skip \"/\"\n\t\tconst [ subtype, subtypeEnd ] = MediaTypeParser.collect(input, position, [';'], true, true);\n\t\tposition = subtypeEnd;\n\n\t\tif (!subtype.length || !httpTokenCodePoints.test(subtype)) {\n\t\t\tthrow new TypeError(MediaTypeParser.generateErrorMessage('subtype', subtype));\n\t\t}\n\n\t\tconst parameters = new MediaTypeParameters();\n\n\t\twhile (position < input.length) {\n\t\t\t++position; // Skip \";\"\n\t\t\twhile (whitespaceChars.has(input[position]!)) { ++position }\n\n\t\t\tlet name: string;\n\t\t\t[name, position] = MediaTypeParser.collect(input, position, [';', '='], false);\n\n\t\t\tif (position >= input.length || input[position] === ';') { continue }\n\n\t\t\t++position; // Skip \"=\"\n\n\t\t\tlet value: string;\n\t\t\tif (input[position] === '\"') {\n\t\t\t\t[ value, position ] = MediaTypeParser.collectHttpQuotedString(input, position);\n\t\t\t\twhile (position < input.length && input[position] !== ';') { ++position }\n\t\t\t} else {\n\t\t\t\t[ value, position ] = MediaTypeParser.collect(input, position, [';'], false, true);\n\t\t\t\tif (!value) { continue }\n\t\t\t}\n\n\t\t\tif (name && MediaTypeParameters.isValid(name, value) && !parameters.has(name)) {\n\t\t\t\tparameters.set(name, value);\n\t\t\t}\n\t\t}\n\n\t\treturn { type, subtype, parameters };\n\t}\n\n\t/**\n\t * Gets the name of this class.\n\t * @returns The string tag of this class.\n\t */\n\tget [Symbol.toStringTag](): string {\n\t\treturn 'MediaTypeParser';\n\t}\n\n\t/**\n\t * Collects characters from `input` starting at `pos` until a stop character is found.\n\t * @param input The input string.\n\t * @param pos The starting position.\n\t * @param stopChars Characters that end collection.\n\t * @param lowerCase Whether to ASCII-lowercase the result.\n\t * @param trim Whether to strip trailing HTTP whitespace.\n\t * @returns A tuple of the collected string and the updated position.\n\t */\n\tprivate static collect(input: string, pos: number, stopChars: string[], lowerCase = true, trim = false): [string, number] {\n\t\tlet result = '';\n\t\tfor (const { length } = input; pos < length && !stopChars.includes(input[pos]!); pos++) {\n\t\t\tresult += input[pos];\n\t\t}\n\n\t\tif (lowerCase) { result = result.toLowerCase() }\n\t\tif (trim) { result = result.replace(trailingWhitespace, '') }\n\n\t\treturn [result, pos];\n\t}\n\n\t/**\n\t * Collects all the HTTP quoted strings.\n\t * This variant only implements it with the extract-value flag set.\n\t * @param input The string to process.\n\t * @param position The starting position.\n\t * @returns An array that includes the resulting string and updated position.\n\t */\n\tprivate static collectHttpQuotedString(input: string, position: number): [string, number] {\n\t\tlet value = '';\n\n\t\tfor (let length = input.length, char; ++position < length;) {\n\t\t\tif ((char = input[position]) === '\"') { break }\n\n\t\t\tvalue += char == '\\\\' && ++position < length ? input[position] : char;\n\t\t}\n\n\t\treturn [ value, position ];\n\t}\n\n\t/**\n\t * Generates an error message.\n\t * @param component The component name.\n\t * @param value The component value.\n\t * @returns The error message.\n\t */\n\tprivate static generateErrorMessage(component: string, value: string): string {\n\t\treturn `Invalid ${component} \"${value}\": only HTTP token code points are valid.`;\n\t}\n}", "import { MediaTypeParser } from './media-type-parser.js';\nimport { MediaTypeParameters } from './media-type-parameters.js';\n\n/**\n * Class used to parse media types.\n * @see https://mimesniff.spec.whatwg.org/#understanding-mime-types\n */\nexport class MediaType {\n\tprivate readonly _type: string;\n\tprivate readonly _subtype: string;\n\tprivate readonly _parameters: MediaTypeParameters;\n\n\t/**\n\t * Create a new MediaType instance from a string representation.\n\t * @param mediaType The media type to parse.\n\t * @param parameters Optional parameters.\n\t */\n\tconstructor(mediaType: string, parameters: Record<string, string> = {}) {\n\t\tif (parameters === null || typeof parameters !== 'object' || Array.isArray(parameters)) {\n\t\t\tthrow new TypeError('The parameters argument must be an object');\n\t\t}\n\n\t\t({ type: this._type, subtype: this._subtype, parameters: this._parameters } = MediaTypeParser.parse(mediaType));\n\n\t\tfor (const [ name, value ] of Object.entries(parameters)) { this._parameters.set(name, value) }\n\t}\n\n\t/**\n\t * Parses a media type string.\n\t * @param mediaType The media type to parse.\n\t * @returns The parsed media type or null if the mediaType cannot be parsed.\n\t */\n\tstatic parse(mediaType: string): MediaType | null {\n\t\ttry {\n\t\t\treturn new MediaType(mediaType);\n\t\t} catch {\n\t\t\t// ignore\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Gets the type.\n\t * @returns The type.\n\t */\n\tget type(): string {\n\t\treturn this._type;\n\t}\n\n\t/**\n\t * Gets the subtype.\n\t * @returns The subtype.\n\t */\n\tget subtype(): string {\n\t\treturn this._subtype;\n\t}\n\n\t/**\n\t * Gets the media type essence (type/subtype).\n\t * @returns The media type without any parameters\n\t */\n\tget essence(): string {\n\t\treturn `${this._type}/${this._subtype}`;\n\t}\n\n\t/**\n\t * Gets the parameters.\n\t * @returns The media type parameters.\n\t */\n\tget parameters(): MediaTypeParameters {\n\t\treturn this._parameters;\n\t}\n\n\t/**\n\t * Checks if the media type matches the specified type.\n\t *\n\t * @param mediaType The media type to check.\n\t * @returns true if the media type matches the specified type, false otherwise.\n\t */\n\tmatches(mediaType: MediaType | string): boolean {\n\t\treturn typeof mediaType === 'string' ? this.essence.includes(mediaType) : this._type === mediaType._type && this._subtype === mediaType._subtype;\n\t}\n\n\t/**\n\t * Gets the serialized version of the media type.\n\t *\n\t * @returns The serialized media type.\n\t */\n\ttoString(): string {\n\t\treturn `${this.essence}${this._parameters.toString()}`;\n\t}\n\n\t/**\n\t * Gets the name of the class.\n\t * @returns The class name\n\t */\n\tget [Symbol.toStringTag](): string {\n\t\treturn 'MediaType';\n\t}\n}", "/** A {@link Map} that can contain multiple, unique, values for the same key. */\nexport class SetMultiMap<K, V> extends Map<K, Set<V>>{\n\t/**\n\t * Adds a new element with a specified key and value to the SetMultiMap.\n\t * If an element with the same key already exists, the value will be added to the underlying {@link Set}.\n\t * If the value already exists in the {@link Set}, it will not be added again.\n\t *\n\t * @param key - The key to set.\n\t * @param value - The value to add to the SetMultiMap.\n\t * @returns The SetMultiMap with the updated key and value.\n\t */\n\toverride set(key: K, value: V): this;\n\t/**\n\t * Adds a new Set with a specified key and value to the SetMultiMap.\n\t * If an element with the same key already exists, the value will be added to the underlying {@link Set}.\n\t * If the value already exists in the {@link Set}, it will not be added again.\n\t *\n\t * @param key - The key to set.\n\t * @param value - The set of values to add to the SetMultiMap.\n\t * @returns The SetMultiMap with the updated key and value.\n\t */\n\toverride set(key: K, value: Set<V>): this;\n\t/**\n\t * Adds a new element with a specified key and value to the SetMultiMap.\n\t * If an element with the same key already exists, the value will be added to the underlying {@link Set}.\n\t * If the value already exists in the {@link Set}, it will not be added again.\n\t *\n\t * @param key The key to set.\n\t * @param value The value to add to the SetMultiMap\n\t * @returns The SetMultiMap with the updated key and value.\n\t */\n\toverride set(key: K, value: V | Set<V>): SetMultiMap<K, V> {\n\t\tsuper.set(key, value instanceof Set ? value : (super.get(key) ?? new Set<V>()).add(value));\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Finds a specific value for a specific key using an iterator function.\n\t * @param key The key to find the value for.\n\t * @param iterator The iterator function to use to find the value.\n\t * @returns The value for the specified key\n\t */\n\tfind(key: K, iterator: (value: V) => boolean): V | undefined {\n\t\tconst values = this.get(key);\n\n\t\tif (values !== undefined) {\n\t\t\treturn Array.from(values).find(iterator);\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * Checks if a specific key has a specific value.\n\t *\n\t * @param key The key to check.\n\t * @param value The value to check.\n\t * @returns True if the key has the value, false otherwise.\n\t */\n\thasValue(key: K, value: V): boolean {\n\t\tconst values = super.get(key);\n\n\t\treturn values ? values.has(value) : false;\n\t}\n\n\t/**\n\t * Removes a specific value from a specific key.\n\t * @param key The key to remove the value from.\n\t * @param value The value to remove.\n\t * @returns True if the value was removed, false otherwise.\n\t */\n\tdeleteValue(key: K, value: V | undefined): boolean {\n\t\tif (value === undefined) { return this.delete(key) }\n\n\t\tconst values = super.get(key);\n\t\tif (values) {\n\t\t\tconst deleted = values.delete(value);\n\n\t\t\tif (values.size === 0) {\n\t\t\t\tsuper.delete(key);\n\t\t\t}\n\n\t\t\treturn deleted;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * The string tag of the SetMultiMap.\n\t * @returns The string tag of the SetMultiMap.\n\t */\n\toverride get [Symbol.toStringTag](): string {\n\t\treturn 'SetMultiMap';\n\t}\n}", "import type { EventHandler } from './@types';\n\n/** A wrapper for an event handler that binds a context to the event handler. */\nexport class ContextEventHandler {\n\tprivate readonly context: unknown;\n\tprivate readonly eventHandler: EventHandler;\n\n\t/**\n\t * @param context The context to bind to the event handler.\n\t * @param eventHandler The event handler to call when the event is published.\n\t */\n\tconstructor(context: unknown, eventHandler: EventHandler) {\n\t\tthis.context = context;\n\t\tthis.eventHandler = eventHandler;\n\t}\n\n\t/**\n\t * Call the event handler for the provided event.\n\t *\n\t * @param event The event to handle\n\t * @param data The value to be passed to the event handler as a parameter.\n\t */\n\thandle(event: Event, data?: unknown): void {\n\t\tthis.eventHandler.call(this.context, event, data);\n\t}\n\n\t/**\n\t * A String value that is used in the creation of the default string\n\t * description of an object. Called by the built-in method {@link Object.prototype.toString}.\n\t *\n\t * @returns The default string description of this object.\n\t */\n\tget [Symbol.toStringTag](): string {\n\t\treturn 'ContextEventHandler';\n\t}\n}", "import type { ContextEventHandler } from './context-event-handler';\n\n/** Represents a subscription to an event. */\nexport class Subscription {\n\tprivate readonly _eventName: string;\n\tprivate readonly _contextEventHandler: ContextEventHandler;\n\n\t/**\n\t * @param eventName The event name.\n\t * @param contextEventHandler The context event handler.\n\t */\n\tconstructor(eventName: string, contextEventHandler: ContextEventHandler) {\n\t\tthis._eventName = eventName;\n\t\tthis._contextEventHandler = contextEventHandler;\n\t}\n\n\t/**\n\t * Gets the event name for the subscription.\n\t *\n\t * @returns The event name.\n\t */\n\tget eventName(): string {\n\t\treturn this._eventName;\n\t}\n\n\t/**\n\t * Gets the context event handler.\n\t *\n\t * @returns The context event handler\n\t */\n\tget contextEventHandler(): ContextEventHandler {\n\t\treturn this._contextEventHandler;\n\t}\n\n\t/**\n\t * A String value that is used in the creation of the default string\n\t * description of an object. Called by the built-in method {@link Object.prototype.toString}.\n\t *\n\t * @returns The default string description of this object.\n\t */\n\tget [Symbol.toStringTag](): string {\n\t\treturn 'Subscription';\n\t}\n}", "import { SetMultiMap } from '@d1g1tal/collections/src';\nimport { ContextEventHandler } from './context-event-handler';\nimport { Subscription } from './subscription';\nimport type { EventHandler, ErrorHandler, SubscriptionOptions } from './@types';\n\n/** A class that allows objects to subscribe to events and be notified when the event is published. */\nexport class Subscribr {\n\tprivate readonly subscribers: SetMultiMap<string, ContextEventHandler> = new SetMultiMap();\n\tprivate errorHandler?: ErrorHandler;\n\n\t/**\n\t * Set a custom error handler for handling errors that occur in event listeners.\n\t * If not set, errors will be logged to the console.\n\t *\n\t * @param errorHandler The error handler function to call when an error occurs in an event listener.\n\t */\n\tsetErrorHandler(errorHandler: ErrorHandler): void {\n\t\tthis.errorHandler = errorHandler;\n\t}\n\n\t/**\n\t * Subscribe to an event\n\t *\n\t * @param eventName The event name to subscribe to.\n\t * @param eventHandler The event handler to call when the event is published.\n\t * @param context The context to bind to the event handler.\n\t * @param options Subscription options.\n\t * @returns An object used to check if the subscription still exists and to unsubscribe from the event.\n\t */\n\tsubscribe(eventName: string, eventHandler: EventHandler, context: unknown = eventHandler, options?: SubscriptionOptions): Subscription {\n\t\tthis.validateEventName(eventName);\n\n\t\t// If once option is set, wrap the handler to auto-unsubscribe\n\t\tif (options?.once) {\n\t\t\tconst originalHandler = eventHandler;\n\t\t\teventHandler = (event: Event, data?: unknown) => {\n\t\t\t\toriginalHandler.call(context, event, data);\n\t\t\t\tthis.unsubscribe(subscription);\n\t\t\t};\n\t\t}\n\n\t\tconst contextEventHandler = new ContextEventHandler(context, eventHandler);\n\t\tthis.subscribers.set(eventName, contextEventHandler);\n\n\t\tconst subscription = new Subscription(eventName, contextEventHandler);\n\n\t\treturn subscription;\n\t}\n\n\t/**\n\t * Unsubscribe from the event\n\t *\n\t * @param subscription The subscription to unsubscribe.\n\t * @returns true if eventListener has been removed successfully. false if the value is not found or if the value is not an object.\n\t */\n\tunsubscribe({ eventName, contextEventHandler }: Subscription): boolean {\n\t\tconst contextEventHandlers = this.subscribers.get(eventName) ?? new Set();\n\t\tconst removed = contextEventHandlers.delete(contextEventHandler);\n\n\t\tif (removed && contextEventHandlers.size === 0) {\tthis.subscribers.delete(eventName) }\n\n\t\treturn removed;\n\t}\n\n\t/**\n\t * Publish an event\n\t *\n\t * @template T\n\t * @param eventName The name of the event.\n\t * @param event The event to be handled.\n\t * @param data The value to be passed to the event handler as a parameter.\n\t */\n\tpublish<T>(eventName: string, event: Event = new CustomEvent(eventName), data?: T): void {\n\t\tthis.validateEventName(eventName);\n\t\tthis.subscribers.get(eventName)?.forEach((contextEventHandler: ContextEventHandler) => {\n\t\t\ttry {\n\t\t\t\tcontextEventHandler.handle(event, data);\n\t\t\t} catch (error) {\n\t\t\t\tif (this.errorHandler) {\n\t\t\t\t\tthis.errorHandler(error as Error, eventName, event, data);\n\t\t\t\t} else {\n\t\t\t\t\tconsole.error(`Error in event handler for '${eventName}':`, error);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Check if the event and handler are subscribed.\n\t *\n\t * @param subscription The subscription object.\n\t * @returns true if the event name and handler are subscribed, false otherwise.\n\t */\n\tisSubscribed({ eventName, contextEventHandler }: Subscription): boolean {\n\t\treturn this.subscribers.get(eventName)?.has(contextEventHandler) ?? false;\n\t}\n\n\t/**\n\t * Validate the event name\n\t *\n\t * @param eventName The event name to validate.\n\t * @throws {TypeError} If the event name is not a non-empty string.\n\t * @throws {Error} If the event name has leading or trailing whitespace.\n\t */\n\tprivate validateEventName(eventName: string): void {\n\t\tif (!eventName || typeof eventName !== 'string') {\n\t\t\tthrow new TypeError('Event name must be a non-empty string');\n\t\t}\n\n\t\tif (eventName.trim() !== eventName) {\n\t\t\tthrow new Error('Event name cannot have leading or trailing whitespace');\n\t\t}\n\t}\n\n\t/**\n\t * Clears all subscriptions. The instance should not be used after calling this method.\n\t */\n\tdestroy(): void {\n\t\tthis.subscribers.clear();\n\t}\n\n\t/**\n\t * A String value that is used in the creation of the default string\n\t * description of an object. Called by the built-in method {@link Object.prototype.toString}.\n\t *\n\t * @returns The default string description of this object.\n\t */\n\tget [Symbol.toStringTag](): string {\n\t\treturn 'Subscribr';\n\t}\n}", "import type { ResponseStatus } from '@src/response-status';\nimport type { ResponseBody, RequestTiming, HttpErrorOptions } from '@src/@types/core';\n\n/**\n * An error that represents an HTTP error response.\n * @author D1g1talEntr0py <jason.dimeo@gmail.com>\n */\nclass HttpError extends Error {\n\tprivate readonly _entity: ResponseBody;\n\tprivate readonly responseStatus: ResponseStatus;\n\tprivate readonly _url: URL | undefined;\n\tprivate readonly _method: string | undefined;\n\tprivate readonly _timing: RequestTiming | undefined;\n\n\t/**\n\t * Creates an instance of HttpError.\n\t * @param status The status code and status text of the {@link Response}.\n\t * @param httpErrorOptions The http error options.\n\t */\n\tconstructor(status: ResponseStatus, { message, cause, entity, url, method, timing }: HttpErrorOptions = {}) {\n\t\tsuper(message, { cause });\n\t\tthis._entity = entity;\n\t\tthis.responseStatus = status;\n\t\tthis._url = url;\n\t\tthis._method = method;\n\t\tthis._timing = timing;\n\t}\n\n\t/**\n\t * It returns the value of the private variable #entity.\n\t * @returns The entity property of the class.\n\t */\n\tget entity(): ResponseBody {\n\t\treturn this._entity;\n\t}\n\n\t/**\n\t * It returns the status code of the {@link Response}.\n\t * @returns The status code of the {@link Response}.\n\t */\n\tget statusCode(): number {\n\t\treturn this.responseStatus.code;\n\t}\n\n\t/**\n\t * It returns the status text of the {@link Response}.\n\t * @returns The status code and status text of the {@link Response}.\n\t */\n\tget statusText(): string {\n\t\treturn this.responseStatus?.text;\n\t}\n\n\t/**\n\t * The request URL that caused the error.\n\t * @returns The URL or undefined.\n\t */\n\tget url(): URL | undefined {\n\t\treturn this._url;\n\t}\n\n\t/**\n\t * The HTTP method that was used for the failed request.\n\t * @returns The method string or undefined.\n\t */\n\tget method(): string | undefined {\n\t\treturn this._method;\n\t}\n\n\t/**\n\t * Timing information for the failed request.\n\t * @returns The timing object or undefined.\n\t */\n\tget timing(): RequestTiming | undefined {\n\t\treturn this._timing;\n\t}\n\n\t/**\n\t * A String value representing the name of the error.\n\t * @returns The name of the error.\n\t */\n\toverride get name(): string {\n\t\treturn 'HttpError';\n\t}\n\n\t/**\n\t * A String value that is used in the creation of the default string\n\t * description of an object. Called by the built-in method {@link Object.prototype.toString}.\n\t * @returns The default string description of this object.\n\t */\n\tget [Symbol.toStringTag](): string {\n\t\treturn this.name;\n\t}\n}\n\nexport { HttpError };\nexport type { ResponseBody, RequestTiming, HttpErrorOptions };", "/**\n * A class that holds a status code and a status text, typically from a {@link Response}\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Response/status|Response.status\n * @author D1g1talEntr0py <jason.dimeo@gmail.com>\n */\nexport class ResponseStatus {\n\tprivate readonly _code: number;\n\tprivate readonly _text: string;\n\n\t/**\n\t *\n\t * @param code The status code from the {@link Response}\n\t * @param text The status text from the {@link Response}\n\t */\n\tconstructor(code: number, text: string) {\n\t\tthis._code = code;\n\t\tthis._text = text;\n\t}\n\n\t/**\n\t * Returns the status code from the {@link Response}\n\t *\n\t * @returns The status code.\n\t */\n\tget code(): number {\n\t\treturn this._code;\n\t}\n\n\t/**\n\t * Returns the status text from the {@link Response}.\n\t *\n\t * @returns The status text.\n\t */\n\tget text(): string {\n\t\treturn this._text;\n\t}\n\n\t/**\n\t * A String value that is used in the creation of the default string\n\t * description of an object. Called by the built-in method {@link Object.prototype.toString}.\n\t *\n\t * @returns The default string description of this object.\n\t */\n\tget [Symbol.toStringTag](): string {\n\t\treturn 'ResponseStatus';\n\t}\n\n\t/**\n\t * tostring method for the class.\n\t *\n\t * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toString|Object.prototype.toString}\n\t * @returns The status code and status text.\n\t */\n\ttoString(): string {\n\t\treturn `${this._code} ${this._text}`;\n\t}\n}", "import { MediaType } from '@d1g1tal/media-type';\nimport { ResponseStatus } from './response-status';\nimport type { AbortEvent, TimeoutEvent, RequestMethod } from '@types';\n\nconst charset = { charset: 'utf-8' };\nconst endsWithSlashRegEx: RegExp = /\\/$/;\n/** Default XSRF cookie name */\nconst XSRF_COOKIE_NAME = 'XSRF-TOKEN';\n/** Default XSRF header name */\nconst XSRF_HEADER_NAME = 'X-XSRF-TOKEN';\n\ntype MediaTypeKey = 'PNG' | 'TEXT' | 'JSON' | 'HTML' | 'JAVA_SCRIPT' | 'CSS' | 'XML' | 'BIN';\n\nconst mediaTypes: { [key in MediaTypeKey]: MediaType } = {\n\tPNG: new MediaType('image/png'),\n\tTEXT: new MediaType('text/plain', charset),\n\tJSON: new MediaType('application/json', charset),\n\tHTML: new MediaType('text/html', charset),\n\tJAVA_SCRIPT: new MediaType('text/javascript', charset),\n\tCSS: new MediaType('text/css', charset),\n\tXML: new MediaType('application/xml', charset),\n\tBIN: new MediaType('application/octet-stream')\n} as const;\n\nconst defaultMediaType: string = mediaTypes.JSON.toString();\n\n/** Constant object for caching policies */\nconst RequestCachingPolicy = {\n\tDEFAULT: 'default',\n\tFORCE_CACHE: 'force-cache',\n\tNO_CACHE: 'no-cache',\n\tNO_STORE: 'no-store',\n\tONLY_IF_CACHED: 'only-if-cached',\n\tRELOAD: 'reload'\n} as const;\n\n/** Constant object for request events */\nexport const RequestEvent = {\n\tCONFIGURED: 'configured',\n\tSUCCESS: 'success',\n\tERROR: 'error',\n\tABORTED: 'aborted',\n\tTIMEOUT: 'timeout',\n\tRETRY: 'retry',\n\tCOMPLETE: 'complete',\n\tALL_COMPLETE: 'all-complete'\n} as const;\n\n/** Constant object for signal events */\nconst SignalEvents = {\n\tABORT: 'abort',\n\tTIMEOUT: 'timeout'\n} as const;\n\n/** Constant object for signal errors */\nconst SignalErrors = {\n\tABORT: 'AbortError',\n\tTIMEOUT: 'TimeoutError'\n} as const;\n\n/** Options for adding event listeners */\nconst eventListenerOptions: AddEventListenerOptions = { once: true, passive: true };\n\n/**\n * Creates a new custom abort event.\n * @returns A new AbortEvent instance.\n */\nconst abortEvent = (): AbortEvent => new CustomEvent(SignalEvents.ABORT, { detail: { cause: SignalErrors.ABORT } });\n\n/**\n * Creates a new custom timeout event.\n * @returns A new TimeoutEvent instance.\n */\nconst timeoutEvent = (): TimeoutEvent => new CustomEvent(SignalEvents.TIMEOUT, { detail: { cause: SignalErrors.TIMEOUT } });\n\n/** Array of request body methods */\nconst requestBodyMethods: ReadonlyArray<RequestMethod> = [ 'POST', 'PUT', 'PATCH', 'DELETE' ];\n\n/** Response status for internal server error */\nconst internalServerError: ResponseStatus = new ResponseStatus(500, 'Internal Server Error');\n\n/** Response status for aborted request */\nconst aborted: ResponseStatus = new ResponseStatus(499, 'Aborted');\n\n/** Response status for timed out request */\nconst timedOut: ResponseStatus = new ResponseStatus(504, 'Request Timeout');\n\n/** Default HTTP status codes that trigger a retry */\nconst retryStatusCodes: ReadonlyArray<number> = [ 408, 413, 429, 500, 502, 503, 504 ];\n\n/** Default HTTP methods allowed to retry (idempotent methods only) */\nconst retryMethods: ReadonlyArray<RequestMethod> = [ 'GET', 'PUT', 'HEAD', 'DELETE', 'OPTIONS' ];\n\n/** Default delay in ms before the first retry */\nconst retryDelay: number = 300;\n\n/** Default backoff factor applied after each retry attempt */\nconst retryBackoffFactor: number = 2;\n\nexport { aborted, abortEvent, endsWithSlashRegEx, eventListenerOptions, internalServerError, mediaTypes, defaultMediaType, requestBodyMethods, RequestCachingPolicy, retryBackoffFactor, retryDelay, retryMethods, retryStatusCodes, SignalErrors, SignalEvents, timedOut, timeoutEvent, XSRF_COOKIE_NAME, XSRF_HEADER_NAME };\nexport type RequestEvent = (typeof RequestEvent)[keyof typeof RequestEvent];", "import { SignalErrors, SignalEvents, abortEvent, eventListenerOptions, timeoutEvent } from './constants.js';\nimport type { AbortConfiguration, AbortEvent, AbortSignalEvent } from '@types';\n\n/** Class representing a controller for abort signals, allowing for aborting requests and handling timeout events */\nexport class SignalController {\n\tprivate readonly abortSignal: AbortSignal;\n\tprivate readonly abortController = new AbortController();\n\tprivate readonly events = new Map<EventListener, string>();\n\n\t/**\n\t * Creates a new SignalController instance.\n\t * @param options - The options for the SignalController.\n\t * @param options.signal - The signal to listen for abort events. Defaults to the internal abort signal.\n\t * @param options.timeout - The timeout value in milliseconds. Defaults to Infinity.\n\t * @throws {RangeError} If the timeout value is negative.\n\t */\n\tconstructor({ signal, timeout = Infinity }: AbortConfiguration = {}) {\n\t\tif (timeout < 0) { throw new RangeError('The timeout cannot be negative') }\n\n\t\tconst signals = [ this.abortController.signal ];\n\t\tif (signal != null) { signals.push(signal) }\n\t\tif (timeout !== Infinity) { signals.push(AbortSignal.timeout(timeout)) }\n\n\t\t(this.abortSignal = AbortSignal.any(signals)).addEventListener(SignalEvents.ABORT, this, eventListenerOptions);\n\t}\n\n\t/**\n\t * Handles the 'abort' event. If the event is caused by a timeout, the 'timeout' event is dispatched.\n\t * Guards against a timeout firing after a manual abort to prevent spurious timeout events.\n\t * @param event The event to abort with\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#specifying_this_using_bind\n\t */\n\thandleEvent({ target: { reason } }: AbortSignalEvent): void {\n\t\tif (this.abortController.signal.aborted) { return }\n\t\tif (reason instanceof DOMException && reason.name === SignalErrors.TIMEOUT) { this.abortSignal.dispatchEvent(timeoutEvent()) }\n\t}\n\n\t/**\n\t * Gets the signal. This signal will be able to abort the request, but will not be notified if the request is aborted by the timeout.\n\t * @returns The signal\n\t */\n\tget signal(): AbortSignal {\n\t\treturn this.abortSignal;\n\t}\n\n\t/**\n\t * Adds an event listener for the 'abort' event.\n\t *\n\t * @param eventListener The listener to add\n\t * @returns The SignalController\n\t */\n\tonAbort(eventListener: EventListener): SignalController {\n\t\treturn this.addEventListener(SignalEvents.ABORT, eventListener);\n\t}\n\n\t/**\n\t * Adds an event listener for the 'timeout' event.\n\t *\n\t * @param eventListener The listener to add\n\t * @returns The SignalController\n\t */\n\tonTimeout(eventListener: EventListener): SignalController {\n\t\treturn this.addEventListener(SignalEvents.TIMEOUT, eventListener);\n\t}\n\n\t/**\n\t * Aborts the signal.\n\t *\n\t * @param event The event to abort with\n\t */\n\tabort(event: AbortEvent = abortEvent()): void {\n\t\tthis.abortController.abort(event.detail?.cause);\n\t}\n\n\t/**\n\t * Removes all event listeners from the signal.\n\t *\n\t * @returns The SignalController\n\t */\n\tdestroy(): SignalController {\n\t\tthis.abortSignal.removeEventListener(SignalEvents.ABORT, this, eventListenerOptions);\n\n\t\tfor (const [ eventListener, type ] of this.events) {\n\t\t\tthis.abortSignal.removeEventListener(type, eventListener, eventListenerOptions);\n\t\t}\n\n\t\tthis.events.clear();\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds an event listener for the specified event type.\n\t *\n\t * @param type The event type to listen for\n\t * @param eventListener The listener to add\n\t * @returns The SignalController\n\t */\n\tprivate addEventListener(type: string, eventListener: EventListener): SignalController {\n\t\tthis.abortSignal.addEventListener(type, eventListener, eventListenerOptions);\n\t\tthis.events.set(eventListener, type);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * A String value that is used in the creation of the default string\n\t * description of an object. Called by the built-in method {@link Object.prototype.toString}.\n\t *\n\t * @returns The default string description of this object.\n\t */\n\tget [Symbol.toStringTag](): string {\n\t\treturn 'SignalController';\n\t}\n}", "import type { Json, ResponseHandler } from '@types';\n\n/** Cached promise for lazy jsdom initialization \u2014 resolved once, reused thereafter */\nlet domReady: Promise<void> | undefined;\n\n/** Cached promise for lazy DOMPurify initialization \u2014 resolved once, reused thereafter */\nlet purifyReady: Promise<(dirty: string) => string> | undefined;\n\n/**\n * Returns a bound sanitize function, lazily loading DOMPurify on first invocation.\n * Must be called after ensureDom() to ensure the DOM environment is ready.\n * @returns A Promise resolving to the sanitize function.\n */\nconst getSanitize = (): Promise<(dirty: string) => string> =>\n\tpurifyReady ??= import('dompurify').then(({ default: p }) => (dirty: string): string => p.sanitize(dirty));\n\n/**\n * Ensures a DOM environment is available (document, DOMParser, DocumentFragment).\n * In browser environments this is a no-op. In Node.js it lazily imports jsdom on first call.\n * @returns A Promise that resolves when the DOM environment is ready.\n */\nconst ensureDom = async (): Promise<void> => {\n\tif (typeof document !== 'undefined' && typeof DOMParser !== 'undefined' && typeof DocumentFragment !== 'undefined') { return Promise.resolve() }\n\n\treturn domReady ??= import('jsdom').then(({ JSDOM }) => {\n\t\tconst { window } = new JSDOM('<!DOCTYPE html><html><head></head><body></body></html>', { url: 'http://localhost' });\n\t\tglobalThis.window = window as unknown as Window & typeof globalThis;\n\t\tObject.assign(globalThis, { document: window.document, DOMParser: window.DOMParser, DocumentFragment: window.DocumentFragment });\n\t}).catch(() => {\n\t\tdomReady = undefined;\n\t\tthrow new Error('jsdom is required for HTML/XML/DOM features in Node.js environments. Install it with: npm install jsdom');\n\t});\n};\n\n/**\n * Handles a text response.\n * @param response The response object from the fetch request.\n * @returns A Promise that resolves to a string\n */\nconst handleText: ResponseHandler<string> = async (response) => await response.text();\n\n/**\n * Handles a script response by appending it to the Document HTMLHeadElement\n * Only available in browser environments with DOM support.\n *\n * **Security Warning:** This handler executes arbitrary JavaScript from the server response.\n * Only use with fully trusted content sources. No sanitization is applied to script content.\n * Consider using a Content Security Policy (CSP) nonce for additional protection.\n * @param response The response object from the fetch request.\n * @returns A Promise that resolves to void\n */\nconst handleScript: ResponseHandler<void> = async (response) => {\n\tawait ensureDom();\n\tconst objectURL = URL.createObjectURL(await response.blob());\n\n\treturn new Promise((resolve, reject) => {\n\t\tconst script = document.createElement('script');\n\t\tObject.assign(script, { src: objectURL, type: 'text/javascript', async: true });\n\n\t\t/**\n\t\t * Revoke the object URL and resolve the promise once the script has loaded.\n\t\t */\n\t\tscript.onload = () => {\n\t\t\tURL.revokeObjectURL(objectURL);\n\t\t\tdocument.head.removeChild(script);\n\t\t\tresolve();\n\t\t};\n\n\t\t/**\n\t\t * Revoke the object URL and reject the promise if the script fails to load.\n\t\t */\n\t\tscript.onerror = () => {\n\t\t\tURL.revokeObjectURL(objectURL);\n\t\t\tdocument.head.removeChild(script);\n\t\t\treject(new Error('Script failed to load'));\n\t\t};\n\n\t\tdocument.head.appendChild(script);\n\t});\n};\n\n/**\n * Handles a CSS response by appending it to the Document HTMLHeadElement.\n * Only available in browser environments with DOM support.\n * @param response The response object from the fetch request.\n * @returns A Promise that resolves to void\n */\nconst handleCss: ResponseHandler<void> = async (response) => {\n\tawait ensureDom();\n\tconst objectURL = URL.createObjectURL(await response.blob());\n\n\treturn new Promise((resolve, reject) => {\n\t\tconst link = document.createElement('link');\n\t\tObject.assign(link, { href: objectURL, type: 'text/css', rel: 'stylesheet' });\n\n\t\t/**\n\t\t * Revoke the object URL and resolve the promise once the stylesheet has loaded.\n\t\t * @returns A Promise that resolves to void\n\t\t */\n\t\tlink.onload = () => resolve(URL.revokeObjectURL(objectURL));\n\n\t\t/**\n\t\t * Revoke the object URL, remove the link element, and reject the promise if the stylesheet fails to load.\n\t\t */\n\t\tlink.onerror = () => {\n\t\t\tURL.revokeObjectURL(objectURL);\n\t\t\tdocument.head.removeChild(link);\n\t\t\treject(new Error('Stylesheet load failed'));\n\t\t};\n\n\t\tdocument.head.appendChild(link);\n\t});\n};\n\n/**\n * Handles a JSON response.\n * @param response The response object from the fetch request.\n * @returns A Promise that resolves to a JsonObject\n */\nconst handleJson: ResponseHandler<Json> = async (response) => await response.json() as Json;\n\n/**\n * Handles a Blob response.\n * @param response The response object from the fetch request.\n * @returns A Promise that resolves to a Blob\n */\nconst handleBlob: ResponseHandler<Blob> = async (response) => await response.blob();\n\n/**\n * Handles an image response by creating an object URL and returning an HTMLImageElement.\n * The object URL is revoked once the image is loaded to prevent memory leaks.\n * Works in both browser and Node.js (via JSDOM) environments.\n * @param response The response object from the fetch request.\n * @returns A Promise that resolves to an HTMLImageElement\n */\nconst handleImage: ResponseHandler<HTMLImageElement> = async (response) => {\n\tawait ensureDom();\n\tconst objectURL = URL.createObjectURL(await response.blob());\n\n\treturn new Promise((resolve, reject) => {\n\t\tconst img = new Image();\n\n\t\t/**\n\t\t * Revoke the object URL once the image has loaded to free up memory and resolve with the image.\n\t\t */\n\t\timg.onload = () => {\n\t\t\tURL.revokeObjectURL(objectURL);\n\t\t\tresolve(img);\n\t\t};\n\n\t\t/**\n\t\t * Revoke the object URL and reject the promise if the image fails to load.\n\t\t */\n\t\timg.onerror = () => {\n\t\t\tURL.revokeObjectURL(objectURL);\n\t\t\treject(new Error('Image failed to load'));\n\t\t};\n\n\t\timg.src = objectURL;\n\t});\n};\n\n/**\n * Handles a buffer response.\n * @param response The response object from the fetch request.\n * @returns A Promise that resolves to an ArrayBuffer\n */\nconst handleBuffer: ResponseHandler<ArrayBuffer> = async (response) => await response.arrayBuffer();\n\n/**\n * Handles a ReadableStream response.\n * @param response The response object from the fetch request.\n * @returns A Promise that resolves to a ReadableStream\n */\nconst handleReadableStream: ResponseHandler<ReadableStream<Uint8Array> | null> = async (response) => Promise.resolve(response.body);\n\n/**\n * Handles an XML response.\n * Only available in environments with DOM support.\n * @param response The response object from the fetch request.\n * @returns A Promise that resolves to a Document\n */\nconst handleXml: ResponseHandler<Document> = async (response) => {\n\tawait ensureDom();\n\tconst sanitize = await getSanitize();\n\treturn new DOMParser().parseFromString(sanitize(await response.text()), 'application/xml');\n};\n\n/**\n * Handles an HTML response.\n * Only available in environments with DOM support.\n * @param response The response object from the fetch request.\n * @returns A Promise that resolves to a Document\n */\nconst handleHtml: ResponseHandler<Document> = async (response) => {\n\tawait ensureDom();\n\tconst sanitize = await getSanitize();\n\treturn new DOMParser().parseFromString(sanitize(await response.text()), 'text/html');\n};\n\n/**\n * Handles an HTML fragment response.\n * Only available in environments with DOM support.\n * @param response The response object from the fetch request.\n * @returns A Promise that resolves to a DocumentFragment\n */\nconst handleHtmlFragment: ResponseHandler<DocumentFragment> = async (response) => {\n\tawait ensureDom();\n\tconst sanitize = await getSanitize();\n\treturn document.createRange().createContextualFragment(sanitize(await response.text()));\n};\n\nexport { handleText, handleScript, handleCss, handleJson, handleBlob, handleImage, handleBuffer, handleReadableStream, handleXml, handleHtml, handleHtmlFragment };\n", "import { requestBodyMethods } from './constants';\nimport type { JsonString, JsonValue, RequestBodyMethod, RequestMethod } from '@types';\n\n/**\n * Type guard to check if a request method accepts a body.\n * @param method The request method to check.\n * @returns True if the method accepts a body, false otherwise.\n */\nexport const isRequestBodyMethod = (method: RequestMethod | undefined): method is RequestBodyMethod =>\n\tmethod !== undefined && requestBodyMethods.includes(method);\n\n/**\n * Checks whether a body value is a raw BodyInit type that should be sent as-is\n * (no JSON serialization) and should have its Content-Type deleted so the runtime\n * can set it automatically (e.g. multipart/form-data boundary for FormData).\n * @param body The request body to check.\n * @returns True if the body is a FormData, Blob, ArrayBuffer, TypedArray, DataView, ReadableStream, or URLSearchParams.\n */\nexport const isRawBody = (body: unknown): boolean =>\n\tbody instanceof FormData || body instanceof Blob || body instanceof ArrayBuffer || body instanceof ReadableStream || body instanceof URLSearchParams || ArrayBuffer.isView(body);\n\n/**\n * Reads a cookie value by name from document.cookie.\n * Returns undefined in non-browser environments or when the cookie is not found.\n * @param name The cookie name to look up.\n * @returns The cookie value or undefined.\n */\nexport const getCookieValue = (name: string): string | undefined => {\n\tif (typeof document === 'undefined' || !document.cookie) { return }\n\n\tconst prefix = `${name}=`;\n\tconst cookies = document.cookie.split(';');\n\tfor (let i = 0, length = cookies.length; i < length; i++) {\n\t\tconst cookie = cookies[i]!.trim();\n\t\tif (cookie.startsWith(prefix)) { return decodeURIComponent(cookie.slice(prefix.length)) }\n\t}\n\n\treturn undefined;\n};\n\n/**\n * Serialize an object of type T into a JSON string.\n * The type system ensures only JSON-serializable values can be passed.\n * @template T The type of data to serialize (will be validated for JSON compatibility)\n * @param data The object to serialize - must be JSON-serializable.\n * @returns The serialized JSON string.\n */\nexport const serialize = <const T>(data: JsonValue<T>): JsonString<T> => JSON.stringify(data) as JsonString<T>;\n\n/**\n * Type predicate to check if a value is a string\n * @param value The value to check\n * @returns True if value is a string, with type narrowing\n */\nexport const isString = (value: unknown): value is string => value !== null && typeof value === 'string';\n\n/**\n * Type predicate to check if a value is an object (not array or null)\n * @param value The value to check\n * @returns True if value is an object, with type narrowing\n */\nexport const isObject = <T = object>(value: unknown): value is T extends object ? T : never => value !== null && typeof value === 'object' && !Array.isArray(value) && Object.getPrototypeOf(value) === Object.prototype;\n\n/**\n * Performs a deep merge of multiple objects\n * @param objects The objects to merge\n * @returns The merged object\n */\nexport const objectMerge = (...objects: Record<PropertyKey, unknown>[]): Record<PropertyKey, unknown> | undefined => {\n\t// Early return for empty input\n\tconst length = objects.length;\n\tif (length === 0) { return undefined }\n\n\t// Early return for single object - just clone it\n\tif (length === 1) {\n\t\tconst [ obj ] = objects;\n\t\tif (!isObject(obj)) { return obj }\n\t\treturn deepClone(obj);\n\t}\n\n\tconst target = {} as Record<PropertyKey, unknown>;\n\n\tfor (const source of objects) {\n\t\tif (!isObject(source)) { return undefined }\n\n\t\tfor (const [property, sourceValue] of Object.entries(source)) {\n\t\t\tconst targetValue = target[property];\n\t\t\tif (Array.isArray(sourceValue)) {\n\t\t\t\t// Handle arrays - source values come first, then unique target values\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\ttarget[property] = [ ...sourceValue, ...(Array.isArray(targetValue) ? targetValue.filter((item) => !sourceValue.includes(item)) : []) ];\n\t\t\t} else if (isObject<Record<string, unknown>>(sourceValue)) {\n\t\t\t\t// Handle plain objects using the isObject function | I am already testing that the targetValue is an object\n\t\t\t\ttarget[property] = isObject<Record<string, unknown>>(targetValue) ? objectMerge(targetValue, sourceValue)! : deepClone(sourceValue);\n\t\t\t} else {\n\t\t\t\t// Primitive values and null/undefined\n\t\t\t\ttarget[property] = sourceValue;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn target;\n};\n\n/**\n * Creates a deep clone of an object for better performance than spread operator in merge scenarios\n * @param object The object to clone\n * @returns The cloned object\n */\nfunction deepClone<T = Record<PropertyKey, unknown>>(object: T): T {\n\tif (isObject<Record<PropertyKey, unknown>>(object)) {\n\t\tconst cloned: Record<PropertyKey, unknown> = {};\n\t\tconst keys = Object.keys(object);\n\t\tfor (let i = 0, length = keys.length, key; i < length; i++) {\n\t\t\tkey = keys[i]!;\n\t\t\tcloned[key] = deepClone(object[key]);\n\t\t}\n\n\t\treturn cloned as T;\n\t}\n\n\t// For other object types (Date, RegExp, etc.), return as-is\n\treturn object;\n}", "import { MediaType } from '@d1g1tal/media-type';\nimport { Subscribr } from '@d1g1tal/subscribr';\nimport { HttpError } from './http-error';\nimport { ResponseStatus } from './response-status';\nimport { SignalController } from './signal-controller.js';\nimport { handleText, handleScript, handleCss, handleJson, handleBlob, handleImage, handleBuffer, handleReadableStream, handleXml, handleHtml, handleHtmlFragment } from './response-handlers';\nimport { isRequestBodyMethod, isRawBody, getCookieValue, isString, isObject, objectMerge, serialize } from './utils';\nimport { RequestCachingPolicy, RequestEvent, SignalErrors, XSRF_COOKIE_NAME, XSRF_HEADER_NAME, abortEvent, aborted, defaultMediaType, endsWithSlashRegEx, internalServerError, mediaTypes, retryBackoffFactor, retryDelay, retryMethods, retryStatusCodes, timedOut } from './constants';\nimport type {\tRequestOptions, ResponseBody, RequestEventHandler, SearchParameters, EventRegistration, ResponseHandler, RequestHeaders, TypedResponse, Json, Entries, HookOptions, HttpErrorOptions, NormalizedRetryOptions, PublishOptions, RetryOptions, RequestTiming, XsrfOptions } from '@types';\n\ndeclare function fetch<R = unknown>(input: RequestInfo | URL, requestOptions?: RequestOptions): Promise<TypedResponse<R>>;\n\ntype RequestConfiguration = {\n\tsignalController: NonNullable<SignalController>,\n\trequestOptions: RequestOptions,\n\tglobal: boolean\n};\n\n/**\n * A wrapper around the fetch API that makes it easier to make HTTP requests.\n * @author D1g1talEntr0py <jason.dimeo@gmail.com>\n */\nexport class Transportr {\n\tprivate readonly _baseUrl: URL;\n\tprivate readonly _options: RequestOptions;\n\tprivate readonly subscribr: Subscribr;\n\tprivate readonly hooks: Required<HookOptions> = { beforeRequest: [], afterResponse: [], beforeError: [] };\n\tprivate static globalSubscribr = new Subscribr();\n\tprivate static globalHooks: Required<HookOptions> = { beforeRequest: [], afterResponse: [], beforeError: [] };\n\tprivate static signalControllers = new Set<SignalController>();\n\t/** Map of in-flight deduplicated requests keyed by URL + method */\n\tprivate static inflightRequests = new Map<string, Promise<Response>>();\n\t/** Cache for parsed MediaType instances to avoid re-parsing the same content-type strings */\n\tprivate static mediaTypeCache = new Map(Object.values(mediaTypes).map((mediaType) => [ mediaType.toString(), mediaType ]));\n\tprivate static contentTypeHandlers: Entries<string, ResponseHandler<ResponseBody>> = [\n\t\t[ mediaTypes.TEXT.type, handleText ],\n\t\t[ mediaTypes.JSON.subtype, handleJson ],\n\t\t[ mediaTypes.BIN.subtype, handleReadableStream ],\n\t\t[ mediaTypes.HTML.subtype, handleHtml ],\n\t\t[ mediaTypes.XML.subtype, handleXml ],\n\t\t[ mediaTypes.PNG.type, handleImage as ResponseHandler<ResponseBody> ],\n\t\t[ mediaTypes.JAVA_SCRIPT.subtype, handleScript as ResponseHandler<ResponseBody> ],\n\t\t[ mediaTypes.CSS.subtype, handleCss as ResponseHandler<ResponseBody> ]\n\t];\n\n\t/**\n\t * Create a new Transportr instance with the provided location or origin and context path.\n\t *\n\t * @param url The URL for {@link fetch} requests.\n\t * @param options The default {@link RequestOptions} for this instance.\n\t */\n\tconstructor(url: URL | string | RequestOptions = globalThis.location?.origin ?? 'http://localhost', options: RequestOptions = {}) {\n\t\tif (isObject(url)) { [ url, options ] = [ globalThis.location?.origin ?? 'http://localhost', url ] }\n\n\t\tthis._baseUrl = Transportr.getBaseUrl(url);\n\t\tthis._options = Transportr.createOptions(options, Transportr.defaultRequestOptions);\n\t\tthis.subscribr = new Subscribr();\n\t}\n\n\t/** Credentials Policy */\n\tstatic readonly CredentialsPolicy = {\n\t\tINCLUDE: 'include',\n\t\tOMIT: 'omit',\n\t\tSAME_ORIGIN: 'same-origin'\n\t} as const;\n\n\t/** Request Modes */\n\tstatic readonly RequestModes = {\n\t\tCORS: 'cors',\n\t\tNAVIGATE: 'navigate',\n\t\tNO_CORS: 'no-cors',\n\t\tSAME_ORIGIN: 'same-origin'\n\t} as const;\n\n\t/** Request Priorities */\n\tstatic readonly RequestPriorities = {\n\t\tHIGH: 'high',\n\t\tLOW: 'low',\n\t\tAUTO: 'auto'\n\t} as const;\n\n\t/** Redirect Policies */\n\tstatic readonly RedirectPolicies = {\n\t\tERROR: 'error',\n\t\tFOLLOW: 'follow',\n\t\tMANUAL: 'manual'\n\t} as const;\n\n\t/** Referrer Policies */\n\tstatic readonly ReferrerPolicy = {\n\t\tNO_REFERRER: 'no-referrer',\n\t\tNO_REFERRER_WHEN_DOWNGRADE: 'no-referrer-when-downgrade',\n\t\tORIGIN: 'origin',\n\t\tORIGIN_WHEN_CROSS_ORIGIN: 'origin-when-cross-origin',\n\t\tSAME_ORIGIN: 'same-origin',\n\t\tSTRICT_ORIGIN: 'strict-origin',\n\t\tSTRICT_ORIGIN_WHEN_CROSS_ORIGIN: 'strict-origin-when-cross-origin',\n\t\tUNSAFE_URL: 'unsafe-url'\n\t} as const;\n\n\t/** Request Events\t*/\n\tstatic readonly RequestEvents: typeof RequestEvent = RequestEvent;\n\n\t/** Default Request Options */\n\tprivate static readonly defaultRequestOptions: RequestOptions = {\n\t\tbody: undefined,\n\t\tcache: RequestCachingPolicy.NO_STORE,\n\t\tcredentials: Transportr.CredentialsPolicy.SAME_ORIGIN,\n\t\theaders: new Headers({ 'content-type': defaultMediaType, 'accept': defaultMediaType }),\n\t\tsearchParams: undefined,\n\t\tintegrity: undefined,\n\t\tkeepalive: undefined,\n\t\tmethod: 'GET',\n\t\tmode: Transportr.RequestModes.CORS,\n\t\tpriority: Transportr.RequestPriorities.AUTO,\n\t\tredirect: Transportr.RedirectPolicies.FOLLOW,\n\t\treferrer: 'about:client',\n\t\treferrerPolicy: Transportr.ReferrerPolicy.STRICT_ORIGIN_WHEN_CROSS_ORIGIN,\n\t\tsignal: undefined,\n\t\ttimeout: 30000,\n\t\tglobal: true\n\t};\n\n\t/**\n\t * Returns a {@link EventRegistration} used for subscribing to global events.\n\t *\n\t * @param event The event to subscribe to.\n\t * @param handler The event handler.\n\t * @param context The context to bind the handler to.\n\t * @returns A new {@link EventRegistration} instance.\n\t */\n\tstatic register(event: RequestEvent, handler: RequestEventHandler, context?: unknown): EventRegistration {\n\t\treturn Transportr.globalSubscribr.subscribe(event, handler, context);\n\t}\n\n\t/**\n\t * Removes a {@link EventRegistration} from the global event handler.\n\t *\n\t * @param eventRegistration The {@link EventRegistration} to remove.\n\t * @returns True if the {@link EventRegistration} was removed, false otherwise.\n\t */\n\tstatic unregister(eventRegistration: EventRegistration): boolean {\n\t\treturn Transportr.globalSubscribr.unsubscribe(eventRegistration);\n\t}\n\n\t/**\n\t * Aborts all active requests.\n\t * This is useful for when the user navigates away from the current page.\n\t * This will also clear the {@link Transportr#signalControllers} set.\n\t */\n\tstatic abortAll(): void {\n\t\tfor (const signalController of this.signalControllers) {\n\t\t\tsignalController.abort(abortEvent());\n\t\t}\n\n\t\t// Clear the set after aborting all requests\n\t\tthis.signalControllers.clear();\n\t}\n\n\t/**\n\t * Registers a custom content-type response handler.\n\t * The handler will be matched against response content-type headers using MediaType matching.\n\t * New handlers are prepended so they take priority over built-in handlers.\n\t *\n\t * @param contentType The content-type string to match (e.g. 'application/pdf', 'text', 'csv').\n\t * @param handler The response handler function.\n\t */\n\tstatic registerContentTypeHandler(contentType: string, handler: ResponseHandler): void {\n\t\t// Prepend so custom handlers take priority over built-in ones\n\t\tTransportr.contentTypeHandlers.unshift([ contentType, handler ]);\n\t}\n\n\t/**\n\t * Removes a previously registered content-type response handler.\n\t *\n\t * @param contentType The content-type string to remove.\n\t * @returns True if the handler was found and removed, false otherwise.\n\t */\n\tstatic unregisterContentTypeHandler(contentType: string): boolean {\n\t\tconst index = Transportr.contentTypeHandlers.findIndex(([ type ]) => type === contentType);\n\t\tif (index === -1) { return false }\n\n\t\tTransportr.contentTypeHandlers.splice(index, 1);\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Registers global lifecycle hooks that run on all requests from all instances.\n\t * Global hooks execute before instance and per-request hooks.\n\t *\n\t * @param hooks The hooks to register globally.\n\t */\n\tstatic addHooks(hooks: HookOptions): void {\n\t\tif (hooks.beforeRequest) { Transportr.globalHooks.beforeRequest.push(...hooks.beforeRequest) }\n\t\tif (hooks.afterResponse) { Transportr.globalHooks.afterResponse.push(...hooks.afterResponse) }\n\t\tif (hooks.beforeError) { Transportr.globalHooks.beforeError.push(...hooks.beforeError) }\n\t}\n\n\t/**\n\t * Removes all global lifecycle hooks.\n\t */\n\tstatic clearHooks(): void {\n\t\tTransportr.globalHooks = { beforeRequest: [], afterResponse: [], beforeError: [] };\n\t}\n\n\t/**\n\t * Tears down all global state: aborts in-flight requests, clears global event subscriptions,\n\t * hooks, in-flight deduplication map, and media type cache (retaining built-in entries).\n\t */\n\tstatic unregisterAll(): void {\n\t\tTransportr.abortAll();\n\t\tTransportr.globalSubscribr = new Subscribr();\n\t\tTransportr.clearHooks();\n\t\tTransportr.inflightRequests.clear();\n\t}\n\n\t/**\n\t * It returns the base {@link URL} for the API.\n\t *\n\t * @returns The baseUrl property.\n\t */\n\tget baseUrl(): URL {\n\t\treturn this._baseUrl;\n\t}\n\n\t/**\n\t * Registers an event handler with a {@link Transportr} instance.\n\t *\n\t * @param event The name of the event to listen for.\n\t * @param handler The function to call when the event is triggered.\n\t * @param context The context to bind to the handler.\n\t * @returns An object that can be used to remove the event handler.\n\t */\n\tregister(event: RequestEvent, handler: RequestEventHandler, context?: unknown): EventRegistration {\n\t\treturn this.subscribr.subscribe(event, handler, context);\n\t}\n\n\t/**\n\t * Unregisters an event handler from a {@link Transportr} instance.\n\t *\n\t * @param eventRegistration The event registration to remove.\n\t * @returns True if the {@link EventRegistration} was removed, false otherwise.\n\t */\n\tunregister(eventRegistration: EventRegistration): boolean {\n\t\treturn this.subscribr.unsubscribe(eventRegistration);\n\t}\n\n\t/**\n\t * Registers instance-level lifecycle hooks that run on all requests from this instance.\n\t * Instance hooks execute after global hooks but before per-request hooks.\n\t *\n\t * @param hooks The hooks to register on this instance.\n\t * @returns This instance for method chaining.\n\t */\n\taddHooks(hooks: HookOptions): this {\n\t\tif (hooks.beforeRequest) { this.hooks.beforeRequest.push(...hooks.beforeRequest) }\n\t\tif (hooks.afterResponse) { this.hooks.afterResponse.push(...hooks.afterResponse) }\n\t\tif (hooks.beforeError) { this.hooks.beforeError.push(...hooks.beforeError) }\n\t\treturn this;\n\t}\n\n\t/**\n\t * Removes all instance-level lifecycle hooks.\n\t * @returns This instance for method chaining.\n\t */\n\tclearHooks(): this {\n\t\tthis.hooks.beforeRequest.length = 0;\n\t\tthis.hooks.afterResponse.length = 0;\n\t\tthis.hooks.beforeError.length = 0;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Tears down this instance: clears all instance subscriptions and hooks.\n\t * The instance should not be used after calling this method.\n\t */\n\tdestroy(): void {\n\t\tthis.clearHooks();\n\t\tthis.subscribr.destroy();\n\t}\n\n\t/**\n\t * This function returns a promise that resolves to the result of a request to the specified path with\n\t * the specified options, where the method is GET.\n\t *\n\t * @async\n\t * @param path The path to the resource you want to get.\n\t * @param options The options for the request.\n\t * @returns A promise that resolves to the response of the request.\n\t */\n\tasync get<T extends ResponseBody = ResponseBody>(path?: string | RequestOptions, options?: RequestOptions): Promise<T | undefined> {\n\t\treturn this._get<T>(path, options);\n\t}\n\n\t/**\n\t * This function makes a POST request to the given path with the given body and options.\n\t *\n\t * @async\n\t * @template T The expected response type (defaults to ResponseBody)\n\t * @param path The path to the endpoint you want to call.\n\t * @param options The options for the request.\n\t * @returns A promise that resolves to the response body.\n\t */\n\tasync post<T extends ResponseBody = ResponseBody>(path?: string | RequestOptions, options?: RequestOptions): Promise<T | undefined> {\n\t\tif (typeof(path) !== 'string') { [ path, options ] = [ undefined, path as RequestOptions ] }\n\n\t\treturn this.execute<T>(path, options, { method: 'POST' });\n\t}\n\n\t/**\n\t * This function returns a promise that resolves to the result of a request to the specified path with\n\t * the specified options, where the method is PUT.\n\t *\n\t * @async\n\t * @template T The expected response type (defaults to ResponseBody)\n\t * @param path The path to the endpoint you want to call.\n\t * @param options The options for the request.\n\t * @returns The return value of the #request method.\n\t */\n\tasync put<T extends ResponseBody = ResponseBody>(path?: string | RequestOptions, options?: RequestOptions): Promise<T | undefined> {\n\t\treturn this.execute<T>(path, options, { method: 'PUT' });\n\t}\n\n\t/**\n\t * It takes a path and options, and returns a request with the method set to PATCH.\n\t *\n\t * @async\n\t * @template T The expected response type (defaults to ResponseBody)\n\t * @param path The path to the endpoint you want to hit.\n\t * @param options The options for the request.\n\t * @returns A promise that resolves to the response of the request.\n\t */\n\tasync patch<T extends ResponseBody = ResponseBody>(path?: string | RequestOptions, options?: RequestOptions): Promise<T | undefined> {\n\t\treturn this.execute<T>(path, options, { method: 'PATCH' });\n\t}\n\n\t/**\n\t * It takes a path and options, and returns a request with the method set to DELETE.\n\t *\n\t * @async\n\t * @param path The path to the resource you want to access.\n\t * @param options The options for the request.\n\t * @returns The result of the request.\n\t */\n\tasync delete<T extends ResponseBody = ResponseBody>(path?: string | RequestOptions, options?: RequestOptions): Promise<T | undefined> {\n\t\treturn this.execute<T>(path, options, { method: 'DELETE' });\n\t}\n\n\t/**\n\t * Returns the response headers of a request to the given path.\n\t *\n\t * @async\n\t * @param path The path to the resource you want to access.\n\t * @param options The options for the request.\n\t * @returns A promise that resolves to the response object.\n\t */\n\tasync head<T extends ResponseBody = ResponseBody>(path?: string | RequestOptions, options?: RequestOptions): Promise<T | undefined> {\n\t\treturn this.execute<T>(path, options, { method: 'HEAD' });\n\t}\n\n\t/**\n\t * It returns a promise that resolves to the allowed request methods for the given resource path.\n\t *\n\t * @async\n\t * @param path The path to the resource.\n\t * @param options The options for the request.\n\t * @returns A promise that resolves to an array of allowed request methods for this resource.\n\t */\n\tasync options(path?: string | RequestOptions, options: RequestOptions = {}): Promise<string[] | undefined> {\n\t\tif (isObject(path)) { [ path, options ] = [ undefined, path ] }\n\n\t\tconst requestConfig = this.processRequestOptions(options, { method: 'OPTIONS' });\n\t\tconst { requestOptions } = requestConfig;\n\t\tconst requestHooks = requestOptions.hooks;\n\n\t\t// Run beforeRequest hooks: global \u2192 instance \u2192 per-request\n\t\tlet url = Transportr.createUrl(this._baseUrl, path, requestOptions.searchParams);\n\t\tconst beforeRequestHookSets = [ Transportr.globalHooks.beforeRequest, this.hooks.beforeRequest, requestHooks?.beforeRequest ];\n\t\tfor (const hooks of beforeRequestHookSets) {\n\t\t\tif (!hooks) { continue }\n\t\t\tfor (const hook of hooks) {\n\t\t\t\tconst result = await hook(requestOptions, url);\n\t\t\t\tif (result) {\n\t\t\t\t\tObject.assign(requestOptions, result);\n\t\t\t\t\tif (result.searchParams !== undefined) { url = Transportr.createUrl(this._baseUrl, path, requestOptions.searchParams) }\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet response: Response = await this._request(path, requestConfig);\n\n\t\t// Run afterResponse hooks: global \u2192 instance \u2192 per-request\n\t\tconst afterResponseHookSets = [ Transportr.globalHooks.afterResponse, this.hooks.afterResponse, requestHooks?.afterResponse ];\n\t\tfor (const hooks of afterResponseHookSets) {\n\t\t\tif (!hooks) { continue }\n\t\t\tfor (const hook of hooks) {\n\t\t\t\tconst result = await hook(response, requestOptions);\n\t\t\t\tif (result) { response = result }\n\t\t\t}\n\t\t}\n\n\t\tconst allowedMethods = response.headers.get('allow')?.split(',').map((method: string) => method.trim());\n\n\t\tthis.publish({ name: RequestEvent.SUCCESS, data: allowedMethods, global: options.global });\n\n\t\treturn allowedMethods;\n\t}\n\n\t/**\n\t * It takes a path and options, and makes a request to the server\n\t * @async\n\t * @param path The path to the endpoint you want to hit.\n\t * @param options The options for the request.\n\t * @returns The return value of the function is the return value of the function that is passed to the `then` method of the promise returned by the `fetch` method.\n\t * @throws {HttpError} If an error occurs during the request.\n\t */\n\tasync request<T = unknown>(path?: string | RequestOptions, options: RequestOptions = {}): Promise<TypedResponse<T>> {\n\t\tif (isObject(path)) { [ path, options ] = [ undefined, path ] }\n\n\t\tconst response = await this._request<T>(path, this.processRequestOptions(options, {}));\n\n\t\tthis.publish({ name: RequestEvent.SUCCESS, data: response, global: options.global });\n\n\t\treturn response;\n\t}\n\n\t/**\n\t * It gets the JSON representation of the resource at the given path.\n\t *\n\t * @async\n\t * @template T The expected JSON response type (defaults to JsonObject)\n\t * @param path The path to the resource.\n\t * @param options The options object to pass to the request.\n\t * @returns A promise that resolves to the response body as a typed JSON value.\n\t */\n\tasync getJson(path?: string | RequestOptions, options?: RequestOptions): Promise<Json | undefined> {\n\t\treturn this._get(path, options, { headers: { accept: `${mediaTypes.JSON}` } }, handleJson);\n\t}\n\n\t/**\n\t * It gets the XML representation of the resource at the given path.\n\t *\n\t * @async\n\t * @param path The path to the resource you want to get.\n\t * @param options The options for the request.\n\t * @returns The result of the function call to #get.\n\t */\n\tasync getXml(path?: string | RequestOptions, options?: RequestOptions): Promise<Document | undefined> {\n\t\treturn this._get(path, options, { headers: { accept: `${mediaTypes.XML}` } }, handleXml);\n\t}\n\n\t/**\n\t * Get the HTML content of the specified path.\n\t * When a selector is provided, returns only the first matching element from the parsed document.\n\t *\n\t * @async\n\t * @param path The path to the resource.\n\t * @param options The options for the request.\n\t * @param selector An optional CSS selector to extract a specific element from the parsed HTML.\n\t * @returns A promise that resolves to a Document, an Element (if selector matched), or void.\n\t */\n\tasync getHtml(path?: string | RequestOptions, options?: RequestOptions, selector?: string): Promise<Document | Element | null | undefined> {\n\t\tconst doc = await this._get(path, options, { headers: { accept: `${mediaTypes.HTML}` } }, handleHtml);\n\t\treturn selector && doc ? doc.querySelector(selector) : doc;\n\t}\n\n\t/**\n\t * It returns a promise that resolves to the HTML fragment at the given path.\n\t * When a selector is provided, returns only the first matching element from the parsed fragment.\n\t *\n\t * @async\n\t * @param path The path to the resource.\n\t * @param options The options for the request.\n\t * @param selector An optional CSS selector to extract a specific element from the parsed fragment.\n\t * @returns A promise that resolves to a DocumentFragment, an Element (if selector matched), or void.\n\t */\n\tasync getHtmlFragment(path?: string | RequestOptions, options?: RequestOptions, selector?: string): Promise<DocumentFragment | Element | null | undefined> {\n\t\tconst fragment = await this._get(path, options, { headers: { accept: `${mediaTypes.HTML}` } }, handleHtmlFragment);\n\t\treturn selector && fragment ? fragment.querySelector(selector) : fragment;\n\t}\n\t/**\n\t * It gets a script from the server, and appends the script to the Document HTMLHeadElement\n\t * @param path The path to the script.\n\t * @param options The options for the request.\n\t * @returns A promise that resolves to void.\n\t */\n\tasync getScript(path?: string | RequestOptions, options?: RequestOptions): Promise<void> {\n\t\treturn this._get(path, options, { headers: { accept: `${mediaTypes.JAVA_SCRIPT}` } }, handleScript);\n\t}\n\n\t/**\n\t * Gets a stylesheet from the server, and adds it as a Blob URL.\n\t * @param path The path to the stylesheet.\n\t * @param options The options for the request.\n\t * @returns A promise that resolves to void.\n\t */\n\tasync getStylesheet(path?: string | RequestOptions, options?: RequestOptions): Promise<void> {\n\t\treturn this._get(path, options, { headers: { accept: `${mediaTypes.CSS}` } }, handleCss);\n\t}\n\n\t/**\n\t * It returns a blob from the specified path.\n\t * @param path The path to the resource.\n\t * @param options The options for the request.\n\t * @returns A promise that resolves to a Blob or void.\n\t */\n\tasync getBlob(path?: string | RequestOptions, options?: RequestOptions): Promise<Blob | undefined> {\n\t\treturn this._get(path, options, { headers: { accept: 'application/octet-stream' } }, handleBlob);\n\t}\n\n\t/**\n\t * It returns a promise that resolves to an `HTMLImageElement`.\n\t * The object URL created to load the image is automatically revoked to prevent memory leaks.\n\t * Works in both browser and Node.js (via JSDOM) environments.\n\t * @param path The path to the image.\n\t * @param options The options for the request.\n\t * @returns A promise that resolves to an `HTMLImageElement` or `void`.\n\t */\n\tasync getImage(path?: string, options?: RequestOptions): Promise<HTMLImageElement | undefined> {\n\t\treturn this._get(path, options, { headers: { accept: 'image/*' } }, handleImage);\n\t}\n\n\t/**\n\t * It gets a buffer from the specified path\n\t * @param path The path to the resource.\n\t * @param options The options for the request.\n\t * @returns A promise that resolves to an ArrayBuffer or void.\n\t */\n\tasync getBuffer(path?: string | RequestOptions, options?: RequestOptions): Promise<ArrayBuffer | undefined> {\n\t\treturn this._get(path, options, { headers: { accept: 'application/octet-stream' } }, handleBuffer);\n\t}\n\n\t/**\n\t * It returns a readable stream of the response body from the specified path.\n\t * @param path The path to the resource.\n\t * @param options The options for the request.\n\t * @returns A promise that resolves to a ReadableStream, null, or void.\n\t */\n\tasync getStream(path?: string | RequestOptions, options?: RequestOptions): Promise<ReadableStream<Uint8Array> | null | undefined> {\n\t\treturn this._get(path, options, { headers: { accept: 'application/octet-stream' } }, handleReadableStream);\n\t}\n\n\t/**\n\t * Handles a GET request.\n\t * @async\n\t * @param path The path to the resource.\n\t * @param userOptions The user options for the request.\n\t * @param options The options for the request.\n\t * @param responseHandler The response handler for the request.\n\t * @returns A promise that resolves to the response body or void.\n\t */\n\tprivate async _get<T extends ResponseBody>(path?: string | RequestOptions, userOptions?: RequestOptions, options: RequestOptions = {}, responseHandler?: ResponseHandler<T>): Promise<T | undefined> {\n\t\treturn this.execute(path, userOptions, { ...options, method: 'GET', body: undefined }, responseHandler);\n\t}\n\n\t/**\n\t * It processes the request options and returns a new object with the processed options.\n\t * @param path The path to the resource.\n\t * @param processedRequestOptions The user options for the request.\n\t * @returns A new object with the processed options.\n\t */\n\tprivate async _request<T = unknown>(path: string | undefined, { signalController, requestOptions, global }: RequestConfiguration): Promise<TypedResponse<T>> {\n\t\tTransportr.signalControllers.add(signalController);\n\n\t\tconst retryConfig = Transportr.normalizeRetryOptions(requestOptions.retry);\n\t\tconst method = requestOptions.method ?? 'GET';\n\t\tconst canRetry = retryConfig.limit > 0 && retryConfig.methods.includes(method);\n\t\tconst canDedupe = requestOptions.dedupe === true && (method === 'GET' || method === 'HEAD');\n\t\tlet attempt = 0;\n\t\tconst startTime = performance.now();\n\n\t\t/**\n\t\t * Creates a RequestTiming snapshot from the start time to now.\n\t\t * @returns Timing information for the request.\n\t\t */\n\t\tconst getTiming = (): RequestTiming => {\n\t\t\tconst end = performance.now();\n\t\t\treturn { start: startTime, end, duration: end - startTime };\n\t\t};\n\n\t\ttry {\n\t\t\tconst url = Transportr.createUrl(this._baseUrl, path, requestOptions.searchParams);\n\t\t\tconst dedupeKey = canDedupe ? `${method}:${url.href}` : '';\n\n\t\t\t// If deduplication is enabled and an in-flight request exists, clone its response\n\t\t\tif (canDedupe) {\n\t\t\t\tconst inflight = Transportr.inflightRequests.get(dedupeKey);\n\t\t\t\tif (inflight) { return (await inflight).clone() as TypedResponse<T> }\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Performs the fetch with retry logic.\n\t\t\t * @returns A promise resolving to the typed response.\n\t\t\t */\n\t\t\tconst doFetch = async (): Promise<TypedResponse<T>> => {\n\t\t\t\twhile (true) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst response = await fetch<T>(url, requestOptions);\n\t\t\t\t\t\tif (!response.ok) {\n\t\t\t\t\t\t\tif (canRetry && attempt < retryConfig.limit && retryConfig.statusCodes.includes(response.status)) {\n\t\t\t\t\t\t\t\tattempt++;\n\t\t\t\t\t\t\t\tthis.publish({ name: RequestEvent.RETRY, data: { attempt, status: response.status, method, path, timing: getTiming() }, global });\n\t\t\t\t\t\t\t\tawait Transportr.retryDelay(retryConfig, attempt);\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Capture response body for error diagnostics\n\t\t\t\t\t\t\tlet entity: ResponseBody | undefined;\n\t\t\t\t\t\t\ttry { entity = await response.text() } catch { /* body may be unavailable */ }\n\t\t\t\t\t\t\tthrow await this.handleError(path, response, { entity, url, method, timing: getTiming() }, requestOptions);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn response;\n\t\t\t\t\t} catch (cause) {\n\t\t\t\t\t\tif (cause instanceof HttpError) { throw cause }\n\n\t\t\t\t\t\t// Network error \u2014 retry if allowed\n\t\t\t\t\t\tif (canRetry && attempt < retryConfig.limit) {\n\t\t\t\t\t\t\tattempt++;\n\t\t\t\t\t\t\tthis.publish({ name: RequestEvent.RETRY, data: { attempt, error: (cause as Error).message, method, path, timing: getTiming() }, global });\n\t\t\t\t\t\t\tawait Transportr.retryDelay(retryConfig, attempt);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthrow await this.handleError(path, undefined, { cause: cause as Error, url, method, timing: getTiming() }, requestOptions);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tif (canDedupe) {\n\t\t\t\tconst promise = doFetch();\n\t\t\t\tTransportr.inflightRequests.set(dedupeKey, promise as Promise<Response>);\n\t\t\t\ttry {\n\t\t\t\t\tconst response = await promise;\n\t\t\t\t\treturn response;\n\t\t\t\t} finally {\n\t\t\t\t\tTransportr.inflightRequests.delete(dedupeKey);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn await doFetch();\n\t\t} finally {\n\t\t\tTransportr.signalControllers.delete(signalController.destroy());\n\t\t\tif (!requestOptions.signal?.aborted) {\n\t\t\t\tconst timing = getTiming();\n\t\t\t\tthis.publish({ name: RequestEvent.COMPLETE, data: { timing }, global });\n\t\t\t\tif (Transportr.signalControllers.size === 0) {\n\t\t\t\t\tthis.publish({ name: RequestEvent.ALL_COMPLETE, global });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Normalizes a retry option into a full RetryOptions object.\n\t * @param retry The retry option from request options.\n\t * @returns Normalized retry configuration.\n\t */\n\tprivate static normalizeRetryOptions(retry?: number | RetryOptions): NormalizedRetryOptions {\n\t\tif (retry === undefined) { return { limit: 0, statusCodes: [], methods: [], delay: retryDelay, backoffFactor: retryBackoffFactor } }\n\t\tif (typeof retry === 'number') { return { limit: retry, statusCodes: [ ...retryStatusCodes ], methods: [ ...retryMethods ], delay: retryDelay, backoffFactor: retryBackoffFactor } }\n\n\t\treturn {\n\t\t\tlimit: retry.limit ?? 0,\n\t\t\tstatusCodes: retry.statusCodes ?? [ ...retryStatusCodes ],\n\t\t\tmethods: retry.methods ?? [ ...retryMethods ],\n\t\t\tdelay: retry.delay ?? retryDelay,\n\t\t\tbackoffFactor: retry.backoffFactor ?? retryBackoffFactor\n\t\t};\n\t}\n\n\t/**\n\t * Waits for the appropriate delay before a retry attempt.\n\t * @param config The retry configuration.\n\t * @param attempt The current attempt number (1-based).\n\t * @returns A promise that resolves after the delay.\n\t */\n\tprivate static retryDelay(config: NormalizedRetryOptions, attempt: number): Promise<void> {\n\t\tconst ms = typeof config.delay === 'function' ? config.delay(attempt) : config.delay * (config.backoffFactor ** (attempt - 1));\n\t\treturn new Promise(resolve => setTimeout(resolve, ms));\n\t}\n\n\t/**\n\t * It returns a response handler based on the content type of the response.\n\t * @param path The path to the resource.\n\t * @param userOptions The user options for the request.\n\t * @param options The options for the request.\n\t * @param responseHandler The response handler for the request.\n\t * @returns A response handler function.\n\t */\n\tprivate async execute<T extends ResponseBody>(path?: string | RequestOptions, userOptions: RequestOptions = {}, options: RequestOptions = {}, responseHandler?: ResponseHandler<NoInfer<T>>): Promise<T | undefined> {\n\t\tif (isObject(path)) { [ path, userOptions ] = [ undefined, path ] }\n\n\t\tconst requestConfig = this.processRequestOptions(userOptions, options);\n\t\tconst { requestOptions } = requestConfig;\n\t\tconst requestHooks = requestOptions.hooks;\n\n\t\t// Run beforeRequest hooks: global \u2192 instance \u2192 per-request\n\t\tlet url = Transportr.createUrl(this._baseUrl, path, requestOptions.searchParams);\n\n\t\tconst beforeRequestHookSets = [ Transportr.globalHooks.beforeRequest, this.hooks.beforeRequest, requestHooks?.beforeRequest ];\n\t\tfor (const hooks of beforeRequestHookSets) {\n\t\t\tif (!hooks) { continue }\n\t\t\tfor (const hook of hooks) {\n\t\t\t\tconst result = await hook(requestOptions, url);\n\t\t\t\tif (result) {\n\t\t\t\t\tObject.assign(requestOptions, result);\n\t\t\t\t\tif (result.searchParams !== undefined) { url = Transportr.createUrl(this._baseUrl, path, requestOptions.searchParams) }\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet response = await this._request<T>(path, requestConfig);\n\n\t\t// Run afterResponse hooks: global \u2192 instance \u2192 per-request\n\t\tconst afterResponseHookSets = [ Transportr.globalHooks.afterResponse, this.hooks.afterResponse, requestHooks?.afterResponse ];\n\t\tfor (const hooks of afterResponseHookSets) {\n\t\t\tif (!hooks) { continue }\n\t\t\tfor (const hook of hooks) {\n\t\t\t\tconst result = await hook(response, requestOptions);\n\t\t\t\tif (result) { response = result as TypedResponse<T> }\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\tif (!responseHandler && response.status !== 204) {\n\t\t\t\tresponseHandler = this.getResponseHandler<T>(response.headers.get('content-type'));\n\t\t\t}\n\n\t\t\tconst data = await responseHandler?.(response);\n\n\t\t\tthis.publish({ name: RequestEvent.SUCCESS, data, global: requestConfig.global });\n\n\t\t\treturn data;\n\t\t} catch (cause) {\n\t\t\tthrow await this.handleError(path as string, response, { cause: cause as Error }, requestOptions);\n\t\t}\n\t}\n\n\t/**\n\t * Creates a new set of options for a request.\n\t * @param options The user options for the request.\n\t * @param userOptions The default options for the request.\n\t * @returns A new set of options for the request.\n\t */\n\tprivate static createOptions({ headers: userHeaders, searchParams: userSearchParams, ...userOptions }: RequestOptions, { headers, searchParams, ...options }: RequestOptions): RequestOptions {\n\t\theaders = Transportr.mergeHeaders(new Headers(), userHeaders, headers);\n\t\tsearchParams = Transportr.mergeSearchParams(new URLSearchParams(), userSearchParams, searchParams);\n\n\t\treturn { ...objectMerge(options, userOptions) ?? {}, headers, searchParams };\n\t}\n\n\t/**\n\t * Merges user and request headers into the target Headers object.\n\t * @param target The target Headers object.\n\t * @param headerSources Variable number of header sources to merge.\n\t * @returns The merged Headers object.\n\t */\n\tprivate static mergeHeaders(target: Headers, ...headerSources: (RequestHeaders | undefined)[]): Headers {\n\t\tfor (const headers of headerSources) {\n\t\t\tif (headers === undefined) { continue }\n\n\t\t\t// Handle different input types\n\t\t\tif (headers instanceof Headers) {\n\t\t\t\t// Use the native forEach method for Headers\n\t\t\t\theaders.forEach((value, name) => target.set(name, value));\n\t\t\t} else if (Array.isArray(headers)) {\n\t\t\t\t// Handle array of tuples format\n\t\t\t\tfor (const [ name, value ] of headers) { target.set(name, value) }\n\t\t\t} else {\n\t\t\t\t// Handle Record<string, string> format - use Object.keys() for better performance\n\t\t\t\tconst record = headers as Record<string, string | undefined>;\n\t\t\t\tconst keys = Object.keys(record);\n\t\t\t\tfor (let i = 0; i < keys.length; i++) {\n\t\t\t\t\tconst name = keys[i]!;\n\t\t\t\t\tconst value = record[name];\n\t\t\t\t\tif (value !== undefined) { target.set(name, String(value)) }\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn target;\n\t}\n\n\t/**\n\t * Merges user and request search parameters into the target URLSearchParams object.\n\t * @param target The target URLSearchParams object.\n\t * @param sources The search parameters to merge.\n\t * @returns The merged URLSearchParams object.\n\t */\n\tprivate static mergeSearchParams(target: URLSearchParams, ...sources: (SearchParameters | undefined)[]): URLSearchParams {\n\t\tfor (const searchParams of sources) {\n\t\t\tif (searchParams === undefined) { continue }\n\n\t\t\t// Handle different input types\n\t\t\tif (searchParams instanceof URLSearchParams) {\n\t\t\t\t// Use the native forEach method for URLSearchParams\n\t\t\t\tsearchParams.forEach((value, name) => target.set(name, value));\n\t\t\t} else if (isString(searchParams) || Array.isArray(searchParams)) {\n\t\t\t\tfor (const [name, value] of new URLSearchParams(searchParams)) { target.set(name, value) }\n\t\t\t} else {\n\t\t\t\t// Handle Record<string, string> format - use Object.keys() for better performance\n\t\t\t\tconst keys = Object.keys(searchParams);\n\t\t\t\tfor (let i = 0; i < keys.length; i++) {\n\t\t\t\t\tconst name = keys[i]!;\n\t\t\t\t\tconst value = searchParams[name];\n\t\t\t\t\tif (value !== undefined) { target.set(name, String(value)) }\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn target;\n\t}\n\n\t/**\n\t * Processes request options by merging user, instance, and method-specific options.\n\t * This method optimizes performance by using cached instance options and performing\n\t * shallow merges where possible instead of deep object cloning.\n\t * @param userOptions The user-provided options for the request.\n\t * @param options Additional method-specific options.\n\t * @returns Processed request options with signal controller and global flag.\n\t */\n\tprivate processRequestOptions({ body: userBody, headers: userHeaders, searchParams: userSearchParams, ...userOptions }: RequestOptions, { headers, searchParams, ...options }: RequestOptions): RequestConfiguration {\n\t\t// Optimize: Use shallow merge for non-nested properties instead of deep objectMerge\n\t\t// The instance _options are already merged with defaults in the constructor\n\t\tconst requestOptions = {\n\t\t\t// Spread instance options (already merged with defaults)\n\t\t\t...this._options,\n\t\t\t// Spread user options (shallow merge, sufficient for flat properties)\n\t\t\t...userOptions,\n\t\t\t// Spread method-specific options (e.g., method: 'POST')\n\t\t\t...options,\n\t\t\t// Deep merge required for headers and searchParams\n\t\t\theaders: Transportr.mergeHeaders(new Headers(), this._options.headers, userHeaders, headers),\n\t\t\tsearchParams: Transportr.mergeSearchParams(new URLSearchParams(), this._options.searchParams, userSearchParams, searchParams)\n\t\t};\n\n\t\tif (isRequestBodyMethod(requestOptions.method)) {\n\t\t\tif (isRawBody(userBody)) {\n\t\t\t\t// Raw BodyInit \u2014 send as-is, delete Content-Type so the runtime sets it automatically\n\t\t\t\trequestOptions.body = userBody;\n\t\t\t\trequestOptions.headers.delete('content-type');\n\t\t\t} else {\n\t\t\t\tconst isJson = requestOptions.headers.get('content-type')?.includes('json') ?? false;\n\t\t\t\trequestOptions.body = isJson && isObject(userBody) ? serialize(userBody) : userBody;\n\t\t\t}\n\t\t} else {\n\t\t\trequestOptions.headers.delete('content-type');\n\t\t\tif (requestOptions.body instanceof URLSearchParams) {\n\t\t\t\tTransportr.mergeSearchParams(requestOptions.searchParams, requestOptions.body);\n\t\t\t}\n\t\t\trequestOptions.body = undefined;\n\t\t}\n\n\t\tconst { signal, timeout, global = false, xsrf } = requestOptions;\n\n\t\t// XSRF/CSRF protection: read token from cookie and set as request header\n\t\tif (xsrf) {\n\t\t\tconst xsrfConfig: XsrfOptions = typeof xsrf === 'object' ? xsrf : {};\n\t\t\tconst token = getCookieValue(xsrfConfig.cookieName ?? XSRF_COOKIE_NAME);\n\t\t\tif (token) { requestOptions.headers.set(xsrfConfig.headerName ?? XSRF_HEADER_NAME, token) }\n\t\t}\n\n\t\tconst signalController = new SignalController({ signal, timeout })\n\t\t\t.onAbort((event) => this.publish({ name: RequestEvent.ABORTED, event, global }))\n\t\t\t.onTimeout((event) => this.publish({ name: RequestEvent.TIMEOUT, event, global }));\n\n\t\trequestOptions.signal = signalController.signal;\n\t\tthis.publish({ name: RequestEvent.CONFIGURED, data: requestOptions, global });\n\n\t\treturn { signalController, requestOptions, global } as RequestConfiguration;\n\t}\n\n\t/**\n\t * Gets the base URL from a URL or string.\n\t * @param url The URL or string to parse.\n\t * @returns The base URL.\n\t */\n\tprivate static getBaseUrl(url: URL | string): URL {\n\t\tif (url instanceof URL) { return url }\n\n\t\tif (!isString(url)) { throw new TypeError('Invalid URL') }\n\n\t\treturn new URL(url, url.startsWith('/') ? globalThis.location.origin : undefined);\n\t}\n\n\t/**\n\t * Parses a content-type string into a MediaType instance with caching.\n\t * This method caches parsed MediaType instances to avoid re-parsing the same content-type strings,\n\t * which significantly improves performance for repeated requests with the same content types.\n\t * @param contentType The content-type string to parse.\n\t * @returns The parsed MediaType instance, or undefined if parsing fails.\n\t */\n\tprivate static getOrParseMediaType(contentType: string | null): MediaType | undefined {\n\t\tif (contentType === null) { return }\n\n\t\t// Check the predefined mediaTypes map first (fastest lookup) or the cache\n\t\tlet mediaType = Transportr.mediaTypeCache.get(contentType);\n\n\t\tif (mediaType !== undefined) { return mediaType }\n\n\t\t// Parse and cache the new MediaType\n\t\tmediaType = MediaType.parse(contentType) ?? undefined;\n\n\t\tif (mediaType !== undefined) {\n\t\t\t// Evict oldest entries when cache exceeds limit to prevent unbounded growth\n\t\t\tif (Transportr.mediaTypeCache.size >= 100) {\n\t\t\t\tconst firstKey = Transportr.mediaTypeCache.keys().next().value;\n\t\t\t\tif (firstKey !== undefined) { Transportr.mediaTypeCache.delete(firstKey) }\n\t\t\t}\n\t\t\tTransportr.mediaTypeCache.set(contentType, mediaType);\n\t\t}\n\n\t\treturn mediaType;\n\t}\n\n\t/**\n\t * Creates a new URL with the given path and search parameters.\n\t * @param url The base URL.\n\t * @param path The path to append to the base URL.\n\t * @param searchParams The search parameters to append to the URL.\n\t * @returns A new URL with the given path and search parameters.\n\t */\n\tprivate static createUrl(url: URL, path?: string, searchParams?: SearchParameters): URL {\n\t\tconst requestUrl = path ? new URL(`${url.pathname.replace(endsWithSlashRegEx, '')}${path}`, url.origin) : new URL(url);\n\n\t\tif (searchParams) {\n\t\t\tTransportr.mergeSearchParams(requestUrl.searchParams, searchParams);\n\t\t}\n\n\t\treturn requestUrl;\n\t}\n\n\t/**\n\t * It generates a ResponseStatus object from an error name and a Response object.\n\t * @param errorName The name of the error.\n\t * @param response The Response object.\n\t * @returns A ResponseStatus object.\n\t */\n\tprivate static generateResponseStatusFromError(errorName?: string, { status, statusText }: Response = new Response()): ResponseStatus {\n\t\tswitch (errorName) {\n\t\t\tcase SignalErrors.ABORT: return aborted;\n\t\t\tcase SignalErrors.TIMEOUT: return timedOut;\n\t\t\tdefault: return status >= 400 ? new ResponseStatus(status, statusText) : internalServerError;\n\t\t}\n\t}\n\n\t/**\n\t * Handles an error that occurs during a request.\n\t * @param path The path of the request.\n\t * @param response The Response object.\n\t * @param options Additional error context including cause, entity, url, method, and timing.\n\t * @param requestOptions The original request options that led to the error, used for hooks context.\n\t * @returns An HttpError object.\n\t */\n\tprivate async handleError(path?: string, response?: Response, { cause, entity, url, method, timing }: Omit<HttpErrorOptions, 'message'> = {}, requestOptions?: RequestOptions): Promise<HttpError> {\n\t\tconst message = method && url\t? `${method} ${url.href} failed${response ? ` with status ${response.status}` : ''}` : `An error has occurred with your request to: '${path}'`;\n\t\tlet error = new HttpError(Transportr.generateResponseStatusFromError(cause?.name, response), { message, cause, entity, url, method, timing });\n\n\t\t// Run beforeError hooks: global \u2192 instance \u2192 per-request\n\t\tconst beforeErrorHookSets = [ Transportr.globalHooks.beforeError, this.hooks.beforeError, requestOptions?.hooks?.beforeError ];\n\t\tfor (const hooks of beforeErrorHookSets) {\n\t\t\tif (!hooks) { continue }\n\t\t\tfor (const hook of hooks) {\n\t\t\t\tconst result = await hook(error);\n\t\t\t\tif (result instanceof HttpError) { error = result }\n\t\t\t}\n\t\t}\n\n\t\tthis.publish({ name: RequestEvent.ERROR, data: error });\n\n\t\treturn error;\n\t}\n\n\t/**\n\t * Publishes an event to the global and instance event handlers.\n\t * @param eventObject The event object to publish.\n\t */\n\tprivate publish({ name, event = new CustomEvent(name), data, global = true }: PublishOptions): void {\n\t\tif (global) { Transportr.globalSubscribr.publish(name, event, data) }\n\t\tthis.subscribr.publish(name, event, data);\n\t}\n\n\t/**\n\t * It returns a response handler based on the content type of the response.\n\t * @param contentType The content type of the response.\n\t * @returns A response handler function.\n\t */\n\tprivate getResponseHandler<T extends ResponseBody>(contentType?: string | null): ResponseHandler<T> | undefined {\n\t\tif (!contentType) { return }\n\n\t\tconst mediaType = Transportr.getOrParseMediaType(contentType);\n\n\t\tif (!mediaType) { return }\n\n\t\tfor (const [ contentType, responseHandler ] of Transportr.contentTypeHandlers) {\n\t\t\tif (mediaType.matches(contentType)) { return responseHandler as ResponseHandler<T> }\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * A string representation of the Transportr instance.\n\t * @returns The string 'Transportr'.\n\t */\n\tget [Symbol.toStringTag](): string {\n\t\treturn 'Transportr';\n\t}\n}\n"],
5
+ "mappings": "AAAO,IAAMA,EAA8B,iCCErCC,GAAkB,YAClBC,GAA0C,qCAanCC,EAAN,MAAMC,UAA4B,GAAoB,CAM5D,YAAYC,EAAsC,CAAC,EAAG,CACrD,MAAMA,CAAO,CACd,CASA,OAAO,QAAQC,EAAcC,EAAwB,CACpD,OAAOP,EAAoB,KAAKM,CAAI,GAAKJ,GAAgC,KAAKK,CAAK,CACpF,CAQS,IAAID,EAAkC,CAC9C,OAAO,MAAM,IAAIA,EAAK,YAAY,CAAC,CACpC,CAQS,IAAIA,EAAuB,CACnC,OAAO,MAAM,IAAIA,EAAK,YAAY,CAAC,CACpC,CAUS,IAAIA,EAAcC,EAAqB,CAC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,EAGtIoD,EAAsB,CAAElH,EAAW,YAAY,YAAa,KAAK,MAAM,YAAa8B,GAAgB,OAAO,WAAY,EAC7H,QAAWH,KAASuF,EACnB,GAAKvF,EACL,QAAWM,KAAQN,EAAO,CACzB,IAAMO,EAAS,MAAMD,EAAKgF,CAAK,EAC3B/E,aAAkB0B,IAAaqD,EAAQ/E,EAC5C,CAGD,YAAK,QAAQ,CAAE,KAAMnB,EAAa,MAAO,KAAMkG,CAAM,CAAC,EAE/CA,CACR,CAMQ,QAAQ,CAAE,KAAAjC,EAAM,MAAA9D,EAAQ,IAAI,YAAY8D,CAAI,EAAG,KAAAT,EAAM,OAAAxB,EAAS,EAAK,EAAyB,CAC/FA,GAAU/C,EAAW,gBAAgB,QAAQgF,EAAM9D,EAAOqD,CAAI,EAClE,KAAK,UAAU,QAAQS,EAAM9D,EAAOqD,CAAI,CACzC,CAOQ,mBAA2C/C,EAA6D,CAC/G,GAAI,CAACA,EAAe,OAEpB,IAAMrB,EAAYH,EAAW,oBAAoBwB,CAAW,EAE5D,GAAKrB,GAEL,OAAW,CAAEqB,EAAasB,CAAgB,IAAK9C,EAAW,oBACzD,GAAIG,EAAU,QAAQqB,CAAW,EAAK,OAAOsB,EAI/C,CAMA,IAAK,OAAO,WAAW,GAAY,CAClC,MAAO,YACR,CACD",
6
+ "names": ["httpTokenCodePoints", "matcher", "httpQuotedStringTokenCodePoints", "MediaTypeParameters", "_MediaTypeParameters", "entries", "name", "value", "whitespaceChars", "trailingWhitespace", "leadingAndTrailingWhitespace", "MediaTypeParser", "_MediaTypeParser", "input", "position", "type", "typeEnd", "subtype", "subtypeEnd", "parameters", "pos", "stopChars", "lowerCase", "trim", "result", "length", "char", "component", "MediaType", "_MediaType", "mediaType", "SetMultiMap", "key", "value", "iterator", "values", "deleted", "ContextEventHandler", "context", "eventHandler", "event", "data", "Subscription", "eventName", "contextEventHandler", "Subscribr", "errorHandler", "options", "originalHandler", "subscription", "contextEventHandlers", "removed", "error", "HttpError", "status", "message", "cause", "entity", "url", "method", "timing", "ResponseStatus", "code", "text", "charset", "endsWithSlashRegEx", "XSRF_COOKIE_NAME", "XSRF_HEADER_NAME", "mediaTypes", "MediaType", "defaultMediaType", "RequestCachingPolicy", "RequestEvent", "SignalEvents", "SignalErrors", "eventListenerOptions", "abortEvent", "timeoutEvent", "requestBodyMethods", "internalServerError", "ResponseStatus", "aborted", "timedOut", "retryStatusCodes", "retryMethods", "retryDelay", "retryBackoffFactor", "SignalController", "signal", "timeout", "signals", "SignalEvents", "eventListenerOptions", "reason", "SignalErrors", "timeoutEvent", "eventListener", "event", "abortEvent", "type", "domReady", "purifyReady", "getSanitize", "p", "dirty", "ensureDom", "JSDOM", "window", "handleText", "response", "handleScript", "objectURL", "resolve", "reject", "script", "handleCss", "link", "handleJson", "handleBlob", "handleImage", "img", "handleBuffer", "handleReadableStream", "handleXml", "sanitize", "handleHtml", "handleHtmlFragment", "isRequestBodyMethod", "method", "requestBodyMethods", "isRawBody", "body", "getCookieValue", "name", "prefix", "cookies", "i", "length", "cookie", "serialize", "data", "isString", "value", "isObject", "objectMerge", "objects", "obj", "deepClone", "target", "source", "property", "sourceValue", "targetValue", "item", "object", "cloned", "keys", "key", "Transportr", "_Transportr", "Subscribr", "mediaTypes", "mediaType", "handleText", "handleJson", "handleReadableStream", "handleHtml", "handleXml", "handleImage", "handleScript", "handleCss", "url", "options", "isObject", "RequestEvent", "RequestCachingPolicy", "defaultMediaType", "event", "handler", "context", "eventRegistration", "signalController", "abortEvent", "contentType", "index", "type", "hooks", "path", "requestConfig", "requestOptions", "requestHooks", "beforeRequestHookSets", "hook", "result", "response", "afterResponseHookSets", "allowedMethods", "method", "selector", "doc", "fragment", "handleHtmlFragment", "handleBlob", "handleBuffer", "userOptions", "responseHandler", "global", "retryConfig", "canRetry", "canDedupe", "attempt", "startTime", "getTiming", "end", "dedupeKey", "inflight", "doFetch", "entity", "cause", "HttpError", "promise", "timing", "retry", "retryDelay", "retryBackoffFactor", "retryStatusCodes", "retryMethods", "config", "ms", "resolve", "data", "userHeaders", "userSearchParams", "headers", "searchParams", "objectMerge", "target", "headerSources", "value", "name", "record", "keys", "sources", "isString", "i", "userBody", "isRequestBodyMethod", "isRawBody", "isJson", "serialize", "signal", "timeout", "xsrf", "xsrfConfig", "token", "getCookieValue", "XSRF_COOKIE_NAME", "XSRF_HEADER_NAME", "SignalController", "MediaType", "firstKey", "requestUrl", "endsWithSlashRegEx", "errorName", "status", "statusText", "SignalErrors", "aborted", "timedOut", "ResponseStatus", "internalServerError", "message", "error", "beforeErrorHookSets"]
7
7
  }