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AAiB6G,IAAuBA,GL3H3B,oBK4HF7N,KAAKsK,KAAKjF,UAAUuI,GACvC,GC3GJ,SAASE,EAAQ3H,EAAO,GAAIwC,EAAW,CAAC,GACpC,MAAO,IAAK0D,EAAMlG,OAAMwC,WAC5B,CACAmF,EAAiB,QAAIA,EAErBA,EAAQlS,QJgBD,SAAoBA,EAAS6J,GAAU,GAC1CC,EAAO9J,QAAU6J,EAAU7J,EAAUsL,EAAIxB,EAAO9J,QAASA,EAC7D,EIhBAkS,EAAQpG,UJgED,SAAsBA,GACzBhC,EAAOgC,UAAYA,CACvB,EIhEAoG,EAAQnG,UJqCD,SAAsBA,EAAWlC,GAAU,GAC9CC,EAAOiC,UAAYlC,EAAUkC,EAAYT,EAAIxB,EAAOiC,UAAWA,EACnE,EItCAmG,EAAQ1F,YAAcA,EACtB,S","sources":["webpack://silverstripe-base/./themes/app/src/scripts/common/ajax.js","webpack://silverstripe-base/./node_modules/a11y-dialog/dist/a11y-dialog.esm.js","webpack://silverstripe-base/./themes/app/src/scripts/components/modal.js","webpack://silverstripe-base/./node_modules/wretch/dist/addons/queryString.js","webpack://silverstripe-base/./node_modules/wretch/dist/constants.js","webpack://silverstripe-base/./node_modules/wretch/dist/utils.js","webpack://silverstripe-base/./node_modules/wretch/dist/config.js","webpack://silverstripe-base/./node_modules/wretch/dist/resolver.js","webpack://silverstripe-base/./node_modules/wretch/dist/middleware.js","webpack://silverstripe-base/./node_modules/wretch/dist/core.js","webpack://silverstripe-base/./node_modules/wretch/dist/index.js"],"sourcesContent":["import wretch from 'wretch'\nimport QueryStringAddon from 'wretch/addons/queryString'\n\nwretch.options({\n headers: { 'X-Requested-With': 'XMLHttpRequest' },\n})\n\nexport default wretch().addon(QueryStringAddon)\n","const not = {\n inert: ':not([inert]):not([inert] *)',\n negTabIndex: ':not([tabindex^=\"-\"])',\n disabled: ':not(:disabled)',\n};\n\nvar focusableSelectors = [\n `a[href]${not.inert}${not.negTabIndex}`,\n `area[href]${not.inert}${not.negTabIndex}`,\n `input:not([type=\"hidden\"]):not([type=\"radio\"])${not.inert}${not.negTabIndex}${not.disabled}`,\n `input[type=\"radio\"]${not.inert}${not.negTabIndex}${not.disabled}`,\n `select${not.inert}${not.negTabIndex}${not.disabled}`,\n `textarea${not.inert}${not.negTabIndex}${not.disabled}`,\n `button${not.inert}${not.negTabIndex}${not.disabled}`,\n `details${not.inert} > summary:first-of-type${not.negTabIndex}`,\n // Discard until Firefox supports `:has()`\n // See: https://github.com/KittyGiraudel/focusable-selectors/issues/12\n // `details:not(:has(> summary))${not.inert}${not.negTabIndex}`,\n `iframe${not.inert}${not.negTabIndex}`,\n `audio[controls]${not.inert}${not.negTabIndex}`,\n `video[controls]${not.inert}${not.negTabIndex}`,\n `[contenteditable]${not.inert}${not.negTabIndex}`,\n `[tabindex]${not.inert}${not.negTabIndex}`,\n];\n\n/**\n * Set the focus to the first element with `autofocus` with the element or the\n * element itself.\n */\nfunction moveFocusToDialog(el) {\n const focused = (el.querySelector('[autofocus]') || el);\n focused.focus();\n}\n/**\n * Get the first and last focusable elements in a given tree.\n */\nfunction getFocusableEdges(el) {\n // Check for a focusable element within the subtree of `el`.\n const first = findFocusableElement(el, true);\n // Only if we find the first element do we need to look for the last one. If\n // there’s no last element, we set `last` as a reference to `first` so that\n // the returned array is always of length 2.\n const last = first ? findFocusableElement(el, false) || first : null;\n return [first, last];\n}\n/**\n * Find the first focusable element inside the given node if `forward` is truthy\n * or the last focusable element otherwise.\n */\nfunction findFocusableElement(node, forward) {\n // If we’re walking forward, check if this node is focusable, and return it\n // immediately if it is.\n if (forward && isFocusable(node))\n return node;\n // We should only search the subtree of this node if it can have focusable\n // children.\n if (canHaveFocusableChildren(node)) {\n // Start walking the DOM tree, looking for focusable elements.\n // Case 1: If this node has a shadow root, search it recursively.\n if (node.shadowRoot) {\n // Descend into this subtree.\n let next = getNextChildEl(node.shadowRoot, forward);\n // Traverse siblings, searching the subtree of each one\n // for focusable elements.\n while (next) {\n const focusableEl = findFocusableElement(next, forward);\n if (focusableEl)\n return focusableEl;\n next = getNextSiblingEl(next, forward);\n }\n }\n // Case 2: If this node is a slot for a Custom Element, search its assigned\n // nodes recursively.\n else if (node.localName === 'slot') {\n const assignedElements = node.assignedElements({\n flatten: true,\n });\n if (!forward)\n assignedElements.reverse();\n for (const assignedElement of assignedElements) {\n const focusableEl = findFocusableElement(assignedElement, forward);\n if (focusableEl)\n return focusableEl;\n }\n }\n // Case 3: this is a regular Light DOM node. Search its subtree.\n else {\n // Descend into this subtree.\n let next = getNextChildEl(node, forward);\n // Traverse siblings, searching the subtree of each one\n // for focusable elements.\n while (next) {\n const focusableEl = findFocusableElement(next, forward);\n if (focusableEl)\n return focusableEl;\n next = getNextSiblingEl(next, forward);\n }\n }\n }\n // If we’re walking backward, we want to check the node’s entire subtree\n // before checking the node itself. If this node is focusable, return it.\n if (!forward && isFocusable(node))\n return node;\n return null;\n}\nfunction getNextChildEl(node, forward) {\n return forward ? node.firstElementChild : node.lastElementChild;\n}\nfunction getNextSiblingEl(el, forward) {\n return forward ? el.nextElementSibling : el.previousElementSibling;\n}\n/**\n * Determine if an element is hidden from the user.\n */\nconst isHidden = (el) => {\n // Browsers hide all non- descendants of closed
elements\n // from user interaction, but those non- elements may still match our\n // focusable-selectors and may still have dimensions, so we need a special\n // case to ignore them.\n if (el.matches('details:not([open]) *') &&\n !el.matches('details>summary:first-of-type'))\n return true;\n // If this element has no painted dimensions, it's hidden.\n return !(el.offsetWidth || el.offsetHeight || el.getClientRects().length);\n};\n/**\n * Determine if an element is focusable and has user-visible painted dimensions.\n */\nconst isFocusable = (el) => {\n // A shadow host that delegates focus will never directly receive focus,\n // even with `tabindex=0`. Consider our custom element, which\n // delegates focus to its shadow button:\n //\n // \n // #shadow-root\n // \n // \n //\n // The browser acts as as if there is only one focusable element – the shadow\n // button. Our library should behave the same way.\n if (el.shadowRoot?.delegatesFocus)\n return false;\n return el.matches(focusableSelectors.join(',')) && !isHidden(el);\n};\n/**\n * Determine if an element can have focusable children. Useful for bailing out\n * early when walking the DOM tree.\n * @example\n * This div is inert, so none of its children can be focused, even though they\n * meet our criteria for what is focusable. Once we check the div, we can skip\n * the rest of the subtree.\n * ```html\n *
\n * \n * Link\n *
\n * ```\n */\nfunction canHaveFocusableChildren(el) {\n // The browser will never send focus into a Shadow DOM if the host element\n // has a negative tabindex. This applies to both slotted Light DOM Shadow DOM\n // children\n if (el.shadowRoot && el.getAttribute('tabindex') === '-1')\n return false;\n // Elemments matching this selector are either hidden entirely from the user,\n // or are visible but unavailable for interaction. Their descentants can never\n // receive focus.\n return !el.matches(':disabled,[hidden],[inert]');\n}\n/**\n * Get the active element, accounting for Shadow DOM subtrees.\n * @author Cory LaViska\n * @see: https://www.abeautifulsite.net/posts/finding-the-active-element-in-a-shadow-root/\n */\nfunction getActiveElement(root = document) {\n const activeEl = root.activeElement;\n if (!activeEl)\n return null;\n // If there’s a shadow root, recursively find the active element within it.\n // If the recursive call returns null, return the active element\n // of the top-level Document.\n if (activeEl.shadowRoot)\n return getActiveElement(activeEl.shadowRoot) || document.activeElement;\n // If not, we can just return the active element\n return activeEl;\n}\n/**\n * Trap the focus inside the given element\n */\nfunction trapTabKey(el, event) {\n const [firstFocusableChild, lastFocusableChild] = getFocusableEdges(el);\n // If there are no focusable children in the dialog, prevent the user from\n // tabbing out of it\n if (!firstFocusableChild)\n return event.preventDefault();\n const activeElement = getActiveElement();\n // If the SHIFT key is pressed while tabbing (moving backwards) and the\n // currently focused item is the first one, move the focus to the last\n // focusable item from the dialog element\n if (event.shiftKey && activeElement === firstFocusableChild) {\n // @ts-ignore: we know that `lastFocusableChild` is not null here\n lastFocusableChild.focus();\n event.preventDefault();\n }\n // If the SHIFT key is not pressed (moving forwards) and the currently focused\n // item is the last one, move the focus to the first focusable item from the\n // dialog element\n else if (!event.shiftKey && activeElement === lastFocusableChild) {\n firstFocusableChild.focus();\n event.preventDefault();\n }\n}\n\nclass A11yDialog {\n $el;\n id;\n previouslyFocused;\n shown;\n constructor(element) {\n this.$el = element;\n this.id = this.$el.getAttribute('data-a11y-dialog') || this.$el.id;\n this.previouslyFocused = null;\n this.shown = false;\n this.maintainFocus = this.maintainFocus.bind(this);\n this.bindKeypress = this.bindKeypress.bind(this);\n this.handleTriggerClicks = this.handleTriggerClicks.bind(this);\n this.show = this.show.bind(this);\n this.hide = this.hide.bind(this);\n this.$el.setAttribute('aria-hidden', 'true');\n this.$el.setAttribute('aria-modal', 'true');\n this.$el.setAttribute('tabindex', '-1');\n if (!this.$el.hasAttribute('role')) {\n this.$el.setAttribute('role', 'dialog');\n }\n document.addEventListener('click', this.handleTriggerClicks, true);\n }\n /**\n * Destroy the current instance (after making sure the dialog has been hidden)\n * and remove all associated listeners from dialog openers and closers\n */\n destroy() {\n // Hide the dialog to avoid destroying an open instance\n this.hide();\n // Remove the click event delegates for our openers and closers\n document.removeEventListener('click', this.handleTriggerClicks, true);\n // Clone and replace the dialog element to prevent memory leaks caused by\n // event listeners that the author might not have cleaned up.\n this.$el.replaceWith(this.$el.cloneNode(true));\n // Dispatch a `destroy` event\n this.fire('destroy');\n return this;\n }\n /**\n * Show the dialog element, trap the current focus within it, listen for some\n * specific key presses and fire all registered callbacks for `show` event\n */\n show(event) {\n // If the dialog is already open, abort\n if (this.shown)\n return this;\n // Keep a reference to the currently focused element to be able to restore\n // it later\n this.shown = true;\n this.$el.removeAttribute('aria-hidden');\n this.previouslyFocused = getActiveElement();\n // Due to a long lasting bug in Safari, clicking an interactive element\n // (like a '\n : ''\n }\n\n
\n \n \n \n
\n \n `\n\n return html\n}\n\n// Specific functionality for \"Our Partners\" modal\nconst handlePartnerModal = (modalEl) => {\n const video = modalEl.querySelector('.partner-video')\n const videoTrigger = modalEl.querySelector('.partner-video-trigger')\n\n if (video) {\n const iframe = modalEl.querySelector('.partner-video iframe')\n\n if (videoTrigger) {\n videoTrigger.addEventListener('click', () => {\n videoTrigger.remove()\n iframe.src = iframe.dataset.src\n })\n } else {\n iframe.src = iframe.dataset.src\n }\n }\n}\n\nconst populateModal = async (opts = {}, modalEl) => {\n const type = opts.type\n const title = opts.title ?? ''\n const url = opts.url\n\n const defaultClose = modalEl.querySelector(\".modal-close\");\n\n if (defaultClose) {\n defaultClose.classList.add(\"invisible\");\n }\n\n let modalContent = ''\n\n if (type === 'video') {\n modalContent = `\n
\n

Watch ${title}

\n
\n \n
\n
\n `\n\n modalEl.querySelector('.modal-container').innerHTML = modalContent\n }\n\n if (type === 'content') {\n modalContent = await ajax.get(url).text()\n\n modalEl.querySelector('.modal-container').innerHTML = modalContent\n\n if (modalEl.querySelector('.partner-modal')) {\n handlePartnerModal(modalEl)\n }\n\n if (modalEl.querySelector('.mailinglist-modal')) {\n fire(document.documentElement, 'mailinglistmodal:open', { modalEl })\n }\n }\n\n if (type === 'subscribe') {\n modalContent = await ajax.get(url).text()\n\n modalEl.querySelector('.modal-container').innerHTML = modalContent\n }\n\n const content = document.createRange().createContextualFragment(modalContent);\n\n if (defaultClose) {\n if (content.querySelector(\"[data-a11y-dialog-hide]\")) {\n defaultClose.remove();\n } else {\n defaultClose.classList.remove(\"invisible\");\n }\n }\n}\n\nconst handleModal = (e) => {\n e.preventDefault()\n\n const triggerEl = e.target.closest('[data-modal]')\n\n openModal({\n type: triggerEl.dataset.modal,\n title: triggerEl.dataset.modalTitle,\n url: triggerEl.href,\n updateUrl: triggerEl.dataset.modalUpdateUrl ?? false,\n useDefaultClose: triggerEl.dataset.modalDisableDefaultClose === undefined,\n useCustomClose: triggerEl.dataset.modalUseCustomClose !== undefined,\n })\n\n return false\n}\n\nconst openModal = (opts = {}) => {\n const type = opts.type\n const title = opts.title ?? false\n let useCustomClose = opts.useCustomClose ?? false\n let useDefaultClose = opts.useDefaultClose ?? true\n\n if (type === 'video') {\n useDefaultClose = false\n }\n\n if (type === 'subscribe') {\n useDefaultClose = false\n useCustomClose = true\n }\n\n const id = `modal-${Math.floor(Math.random() * Date.now())}`\n const template = generateTemplate(id, useDefaultClose, useCustomClose, title)\n const node = document.createRange().createContextualFragment(template)\n\n document.body.append(node)\n\n const modalEl = document.getElementById(id)\n const modal = new A11yDialog(modalEl)\n\n const hideModal = () => {\n modal.hide()\n }\n\n if (useCustomClose) {\n on('click', '.modal-custom-close', hideModal)\n }\n\n const currentUrl = opts.defaultUrl ?? window.location.href\n\n modal.on('show', () => {\n document.documentElement.classList.add('has-modal-active')\n\n if (opts.updateUrl !== false) {\n window.history.replaceState({}, '', opts.updateUrl)\n }\n })\n\n modal.on('hide', () => {\n document.documentElement.classList.remove('has-modal-active')\n\n modal.destroy()\n\n if (opts.updateUrl !== false) {\n window.history.replaceState({}, '', currentUrl)\n }\n\n if (useCustomClose) {\n off('click', '.modal-custom-close', hideModal)\n }\n })\n\n modal.on('destroy', (e) => {\n if (e.target.querySelector('.mailinglist-modal')) {\n fire(document.documentElement, 'mailinglistmodal:close', { modalEl: e.target })\n }\n\n document.querySelector('.modal-wrapper').remove()\n e.target.remove()\n })\n\n modal.show()\n\n populateModal(\n {\n type: type,\n url: opts.url ?? false,\n updateUrl: opts.updateUrl,\n defaultUrl: opts.defaultUrl,\n },\n modalEl\n )\n}\n\nexport default {\n init: () => {\n const clickArgs = ['click', '[data-modal]', handleModal]\n off(...clickArgs)\n on(...clickArgs)\n\n // If we have video modals, load the YouTube API\n if (document.querySelectorAll('[data-modal=\"video\"]').length) {\n const tag = document.createElement('script')\n tag.src = 'https://www.youtube.com/iframe_api'\n\n const firstScriptTag = document.getElementsByTagName('script')[0]\n\n firstScriptTag.parentNode.insertBefore(tag, firstScriptTag)\n }\n },\n openModal,\n}\n","function stringify(value) {\n return typeof value !== \"undefined\" ? value : \"\";\n}\nconst appendQueryParams = (url, qp, replace, config) => {\n let queryString;\n if (typeof qp === \"string\") {\n queryString = qp;\n }\n else {\n const usp = config.polyfill(\"URLSearchParams\", true, true);\n for (const key in qp) {\n const value = qp[key];\n if (qp[key] instanceof Array) {\n for (const val of value)\n usp.append(key, stringify(val));\n }\n else {\n usp.append(key, stringify(value));\n }\n }\n queryString = usp.toString();\n }\n const split = url.split(\"?\");\n if (!queryString)\n return replace ? split[0] : url;\n if (replace || split.length < 2)\n return split[0] + \"?\" + queryString;\n return url + \"&\" + queryString;\n};\n/**\n * Adds the ability to append query parameters from a javascript object.\n *\n * ```js\n * import QueryAddon from \"wretch/addons/queryString\"\n *\n * wretch().addon(QueryAddon)\n * ```\n */\nconst queryString = {\n wretch: {\n query(qp, replace = false) {\n return { ...this, _url: appendQueryParams(this._url, qp, replace, this._config) };\n }\n }\n};\nexport default queryString;\n//# sourceMappingURL=queryString.js.map","export const JSON_MIME = \"application/json\";\nexport const CONTENT_TYPE_HEADER = \"Content-Type\";\nexport const FETCH_ERROR = Symbol();\nexport const CATCHER_FALLBACK = Symbol();\n//# sourceMappingURL=constants.js.map","import { CONTENT_TYPE_HEADER } from \"./constants.js\";\nexport function extractContentType(headers = {}) {\n var _a;\n return (_a = Object.entries(headers).find(([k]) => k.toLowerCase() === CONTENT_TYPE_HEADER.toLowerCase())) === null || _a === void 0 ? void 0 : _a[1];\n}\nexport function isLikelyJsonMime(value) {\n return /^application\\/.*json.*/.test(value);\n}\nexport const mix = function (one, two, mergeArrays = false) {\n return Object.entries(two).reduce((acc, [key, newValue]) => {\n const value = one[key];\n if (Array.isArray(value) && Array.isArray(newValue)) {\n acc[key] = mergeArrays ? [...value, ...newValue] : newValue;\n }\n else if (typeof value === \"object\" && typeof newValue === \"object\") {\n acc[key] = mix(value, newValue, mergeArrays);\n }\n else {\n acc[key] = newValue;\n }\n return acc;\n }, { ...one });\n};\n//# sourceMappingURL=utils.js.map","import { mix } from \"./utils.js\";\nconst config = {\n // Default options\n options: {},\n // Error type\n errorType: \"text\",\n // Polyfills\n polyfills: {\n // fetch: null,\n // FormData: null,\n // URLSearchParams: null,\n // performance: null,\n // PerformanceObserver: null,\n // AbortController: null\n },\n polyfill(p, doThrow = true, instance = false, ...args) {\n const res = this.polyfills[p] ||\n (typeof self !== \"undefined\" ? self[p] : null) ||\n (typeof global !== \"undefined\" ? global[p] : null);\n if (doThrow && !res)\n throw new Error(p + \" is not defined\");\n return instance && res ? new res(...args) : res;\n }\n};\n/**\n * Sets the default fetch options that will be stored internally when instantiating wretch objects.\n *\n * ```js\n * import wretch from \"wretch\"\n *\n * wretch.options({ headers: { \"Accept\": \"application/json\" } });\n *\n * // The fetch request is sent with both headers.\n * wretch(\"...\", { headers: { \"X-Custom\": \"Header\" } }).get().res();\n * ```\n *\n * @param options Default options\n * @param replace If true, completely replaces the existing options instead of mixing in\n */\nexport function setOptions(options, replace = false) {\n config.options = replace ? options : mix(config.options, options);\n}\n/**\n * Sets the default polyfills that will be stored internally when instantiating wretch objects.\n * Useful for browserless environments like `node.js`.\n *\n * Needed for libraries like [fetch-ponyfill](https://github.com/qubyte/fetch-ponyfill).\n *\n * ```js\n * import wretch from \"wretch\"\n *\n * wretch.polyfills({\n * fetch: require(\"node-fetch\"),\n * FormData: require(\"form-data\"),\n * URLSearchParams: require(\"url\").URLSearchParams,\n * });\n *\n * // Uses the above polyfills.\n * wretch(\"...\").get().res();\n * ```\n *\n * @param polyfills An object containing the polyfills\n * @param replace If true, replaces the current polyfills instead of mixing in\n */\nexport function setPolyfills(polyfills, replace = false) {\n config.polyfills = replace ? polyfills : mix(config.polyfills, polyfills);\n}\n/**\n * Sets the default method (text, json, …) used to parse the data contained in the response body in case of an HTTP error.\n * As with other static methods, it will affect wretch instances created after calling this function.\n *\n * _Note: if the response Content-Type header is set to \"application/json\", the body will be parsed as json regardless of the errorType._\n *\n * ```js\n * import wretch from \"wretch\"\n *\n * wretch.errorType(\"json\")\n *\n * wretch(\"http://server/which/returns/an/error/with/a/json/body\")\n * .get()\n * .res()\n * .catch(error => {\n * // error[errorType] (here, json) contains the parsed body\n * console.log(error.json)\n * })\n * ```\n *\n * If null, defaults to \"text\".\n */\nexport function setErrorType(errorType) {\n config.errorType = errorType;\n}\nexport default config;\n//# sourceMappingURL=config.js.map","import { middlewareHelper } from \"./middleware.js\";\nimport { mix } from \"./utils.js\";\nimport { FETCH_ERROR, CATCHER_FALLBACK } from \"./constants.js\";\n/**\n * This class inheriting from Error is thrown when the fetch response is not \"ok\".\n * It extends Error and adds status, text and body fields.\n */\nexport class WretchError extends Error {\n}\nexport const resolver = (wretch) => {\n const sharedState = Object.create(null);\n wretch = wretch._addons.reduce((w, addon) => addon.beforeRequest &&\n addon.beforeRequest(w, wretch._options, sharedState)\n || w, wretch);\n const { _url: url, _options: opts, _config: config, _catchers: _catchers, _resolvers: resolvers, _middlewares: middlewares, _addons: addons } = wretch;\n const catchers = new Map(_catchers);\n const finalOptions = mix(config.options, opts);\n // The generated fetch request\n let finalUrl = url;\n const _fetchReq = middlewareHelper(middlewares)((url, options) => {\n finalUrl = url;\n return config.polyfill(\"fetch\")(url, options);\n })(url, finalOptions);\n // Throws on an http error\n const referenceError = new Error();\n const throwingPromise = _fetchReq\n .catch(error => {\n throw { [FETCH_ERROR]: error };\n })\n .then(response => {\n if (!response.ok) {\n const err = new WretchError();\n // Enhance the error object\n err[\"cause\"] = referenceError;\n err.stack = err.stack + \"\\nCAUSE: \" + referenceError.stack;\n err.response = response;\n err.url = finalUrl;\n if (response.type === \"opaque\") {\n throw err;\n }\n return response.text().then((body) => {\n var _a;\n err.message = body;\n if (config.errorType === \"json\" || ((_a = response.headers.get(\"Content-Type\")) === null || _a === void 0 ? void 0 : _a.split(\";\")[0]) === \"application/json\") {\n try {\n err.json = JSON.parse(body);\n }\n catch (e) { /* ignore */ }\n }\n err.text = body;\n err[\"status\"] = response.status;\n throw err;\n });\n }\n return response;\n });\n // Wraps the Promise in order to dispatch the error to a matching catcher\n const catchersWrapper = (promise) => {\n return promise.catch(err => {\n const fetchErrorFlag = err.hasOwnProperty(FETCH_ERROR);\n const error = fetchErrorFlag ? err[FETCH_ERROR] : err;\n const catcher = ((error === null || error === void 0 ? void 0 : error.status) && catchers.get(error.status)) ||\n catchers.get(error === null || error === void 0 ? void 0 : error.name) || (fetchErrorFlag && catchers.has(FETCH_ERROR) && catchers.get(FETCH_ERROR));\n if (catcher)\n return catcher(error, wretch);\n const catcherFallback = catchers.get(CATCHER_FALLBACK);\n if (catcherFallback)\n return catcherFallback(error, wretch);\n throw error;\n });\n };\n const bodyParser = funName => cb => funName ?\n // If a callback is provided, then callback with the body result otherwise return the parsed body itself.\n catchersWrapper(throwingPromise.then(_ => _ && _[funName]()).then(_ => cb ? cb(_) : _)) :\n // No body parsing method - return the response\n catchersWrapper(throwingPromise.then(_ => cb ? cb(_) : _));\n const responseChain = {\n _wretchReq: wretch,\n _fetchReq,\n _sharedState: sharedState,\n res: bodyParser(null),\n json: bodyParser(\"json\"),\n blob: bodyParser(\"blob\"),\n formData: bodyParser(\"formData\"),\n arrayBuffer: bodyParser(\"arrayBuffer\"),\n text: bodyParser(\"text\"),\n error(errorId, cb) {\n catchers.set(errorId, cb);\n return this;\n },\n badRequest(cb) { return this.error(400, cb); },\n unauthorized(cb) { return this.error(401, cb); },\n forbidden(cb) { return this.error(403, cb); },\n notFound(cb) { return this.error(404, cb); },\n timeout(cb) { return this.error(408, cb); },\n internalError(cb) { return this.error(500, cb); },\n fetchError(cb) { return this.error(FETCH_ERROR, cb); },\n };\n const enhancedResponseChain = addons.reduce((chain, addon) => ({\n ...chain,\n ...addon.resolver\n }), responseChain);\n return resolvers.reduce((chain, r) => r(chain, wretch), enhancedResponseChain);\n};\n//# sourceMappingURL=resolver.js.map","/**\n * @private @internal\n */\nexport const middlewareHelper = (middlewares) => (fetchFunction) => {\n return middlewares.reduceRight((acc, curr) => curr(acc), fetchFunction) || fetchFunction;\n};\n//# sourceMappingURL=middleware.js.map","import { mix, extractContentType, isLikelyJsonMime } from \"./utils.js\";\nimport { JSON_MIME, CONTENT_TYPE_HEADER, CATCHER_FALLBACK } from \"./constants.js\";\nimport { resolver } from \"./resolver.js\";\nimport config from \"./config.js\";\nexport const core = {\n _url: \"\",\n _options: {},\n _config: config,\n _catchers: new Map(),\n _resolvers: [],\n _deferred: [],\n _middlewares: [],\n _addons: [],\n addon(addon) {\n return { ...this, _addons: [...this._addons, addon], ...addon.wretch };\n },\n errorType(errorType) {\n return {\n ...this,\n _config: {\n ...this._config,\n errorType\n }\n };\n },\n polyfills(polyfills, replace = false) {\n return {\n ...this,\n _config: {\n ...this._config,\n polyfills: replace ? polyfills : mix(this._config.polyfills, polyfills)\n }\n };\n },\n url(_url, replace = false) {\n if (replace)\n return { ...this, _url };\n const split = this._url.split(\"?\");\n return {\n ...this,\n _url: split.length > 1 ?\n split[0] + _url + \"?\" + split[1] :\n this._url + _url\n };\n },\n options(options, replace = false) {\n return { ...this, _options: replace ? options : mix(this._options, options) };\n },\n headers(headerValues) {\n return { ...this, _options: mix(this._options, { headers: headerValues || {} }) };\n },\n accept(headerValue) {\n return this.headers({ Accept: headerValue });\n },\n content(headerValue) {\n return this.headers({ [CONTENT_TYPE_HEADER]: headerValue });\n },\n auth(headerValue) {\n return this.headers({ Authorization: headerValue });\n },\n catcher(errorId, catcher) {\n const newMap = new Map(this._catchers);\n newMap.set(errorId, catcher);\n return { ...this, _catchers: newMap };\n },\n catcherFallback(catcher) {\n return this.catcher(CATCHER_FALLBACK, catcher);\n },\n resolve(resolver, clear = false) {\n return { ...this, _resolvers: clear ? [resolver] : [...this._resolvers, resolver] };\n },\n defer(callback, clear = false) {\n return {\n ...this,\n _deferred: clear ? [callback] : [...this._deferred, callback]\n };\n },\n middlewares(middlewares, clear = false) {\n return {\n ...this,\n _middlewares: clear ? middlewares : [...this._middlewares, ...middlewares]\n };\n },\n fetch(method = this._options.method, url = \"\", body = null) {\n let base = this.url(url).options({ method });\n // \"Jsonify\" the body if it is an object and if it is likely that the content type targets json.\n const contentType = extractContentType(base._options.headers);\n const jsonify = typeof body === \"object\" && (!base._options.headers || !contentType || isLikelyJsonMime(contentType));\n base =\n !body ? base :\n jsonify ? base.json(body, contentType) :\n base.body(body);\n return resolver(base\n ._deferred\n .reduce((acc, curr) => curr(acc, acc._url, acc._options), base));\n },\n get(url = \"\") {\n return this.fetch(\"GET\", url);\n },\n delete(url = \"\") {\n return this.fetch(\"DELETE\", url);\n },\n put(body, url = \"\") {\n return this.fetch(\"PUT\", url, body);\n },\n post(body, url = \"\") {\n return this.fetch(\"POST\", url, body);\n },\n patch(body, url = \"\") {\n return this.fetch(\"PATCH\", url, body);\n },\n head(url = \"\") {\n return this.fetch(\"HEAD\", url);\n },\n opts(url = \"\") {\n return this.fetch(\"OPTIONS\", url);\n },\n body(contents) {\n return { ...this, _options: { ...this._options, body: contents } };\n },\n json(jsObject, contentType) {\n const currentContentType = extractContentType(this._options.headers);\n return this.content(contentType ||\n isLikelyJsonMime(currentContentType) && currentContentType ||\n JSON_MIME).body(JSON.stringify(jsObject));\n }\n};\n//# sourceMappingURL=core.js.map","import { setOptions, setErrorType, setPolyfills } from \"./config.js\";\nimport { core } from \"./core.js\";\nimport { WretchError } from \"./resolver.js\";\n/**\n * Creates a new wretch instance with a base url and base\n * [fetch options](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch).\n *\n * ```ts\n * import wretch from \"wretch\"\n *\n * // Reusable instance\n * const w = wretch(\"https://domain.com\", { mode: \"cors\" })\n * ```\n *\n * @param _url The base url\n * @param _options The base fetch options\n * @returns A fresh wretch instance\n */\nfunction factory(_url = \"\", _options = {}) {\n return { ...core, _url, _options };\n}\nfactory[\"default\"] = factory;\n/** {@inheritDoc setOptions} */\nfactory.options = setOptions;\n/** {@inheritDoc setErrorType} */\nfactory.errorType = setErrorType;\n/** {@inheritDoc setPolyfills} */\nfactory.polyfills = setPolyfills;\nfactory.WretchError = WretchError;\nexport default factory;\n//# sourceMappingURL=index.js.map"],"names":["wretch","options","headers","addon","QueryStringAddon","not","focusableSelectors","moveFocusToDialog","el","querySelector","focus","findFocusableElement","node","forward","isFocusable","shadowRoot","getAttribute","matches","next","getNextChildEl","focusableEl","getNextSiblingEl","localName","assignedElements","flatten","reverse","assignedElement","firstElementChild","lastElementChild","nextElementSibling","previousElementSibling","delegatesFocus","join","offsetWidth","offsetHeight","getClientRects","length","isHidden","getActiveElement","root","document","activeEl","activeElement","A11yDialog","$el","id","previouslyFocused","shown","constructor","element","this","maintainFocus","bind","bindKeypress","handleTriggerClicks","show","hide","setAttribute","hasAttribute","addEventListener","destroy","removeEventListener","replaceWith","cloneNode","fire","event","removeAttribute","tagName","target","body","on","type","handler","off","dispatchEvent","CustomEvent","detail","cancelable","closest","key","preventDefault","firstFocusableChild","lastFocusableChild","first","getFocusableEdges","shiftKey","trapTabKey","instantiateDialogs","querySelectorAll","readyState","handleModal","e","triggerEl","openModal","dataset","modal","title","modalTitle","url","href","updateUrl","modalUpdateUrl","useDefaultClose","undefined","modalDisableDefaultClose","useCustomClose","modalUseCustomClose","opts","arguments","Math","floor","random","Date","now","template","generateTemplate","createRange","createContextualFragment","append","modalEl","getElementById","hideModal","currentUrl","defaultUrl","window","location","documentElement","classList","add","history","replaceState","remove","async","defaultClose","modalContent","innerHTML","ajax","get","text","video","videoTrigger","iframe","src","handlePartnerModal","content","populateModal","init","clickArgs","tag","createElement","firstScriptTag","getElementsByTagName","parentNode","insertBefore","stringify","value","appendQueryParams","qp","replace","config","queryString","usp","polyfill","Array","val","toString","split","query","_url","_config","CONTENT_TYPE_HEADER","FETCH_ERROR","Symbol","CATCHER_FALLBACK","extractContentType","_a","Object","entries","find","k","toLowerCase","isLikelyJsonMime","test","mix","one","two","mergeArrays","reduce","acc","newValue","isArray","errorType","polyfills","p","doThrow","instance","args","res","self","global","Error","WretchError","resolver","sharedState","create","_addons","w","beforeRequest","_options","_catchers","_resolvers","resolvers","_middlewares","middlewares","addons","catchers","Map","finalOptions","finalUrl","_fetchReq","fetchFunction","reduceRight","curr","middlewareHelper","referenceError","throwingPromise","catch","error","then","response","ok","err","stack","message","json","JSON","parse","status","bodyParser","funName","cb","_","fetchErrorFlag","hasOwnProperty","catcher","name","has","catcherFallback","responseChain","_wretchReq","_sharedState","blob","formData","arrayBuffer","errorId","set","badRequest","unauthorized","forbidden","notFound","timeout","internalError","fetchError","enhancedResponseChain","chain","r","core","_deferred","headerValues","accept","headerValue","Accept","auth","Authorization","newMap","resolve","clear","defer","callback","fetch","method","base","contentType","jsonify","put","post","patch","head","contents","jsObject","currentContentType","factory"],"sourceRoot":""}