{ "version": 3, "sources": ["../../../../../../node_modules/htmx.org/dist/htmx.js", "../../../../../../node_modules/htmx.org/dist/ext/class-tools.js", "../../../static-src/webui/ts/main.ts"], "sourcesContent": ["// UMD insanity\n// This code sets up support for (in order) AMD, ES6 modules, and globals.\n(function (root, factory) {\n //@ts-ignore\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n //@ts-ignore\n define([], factory);\n } else if (typeof module === 'object' && module.exports) {\n // Node. Does not work with strict CommonJS, but\n // only CommonJS-like environments that support module.exports,\n // like Node.\n module.exports = factory();\n } else {\n // Browser globals\n root.htmx = root.htmx || factory();\n }\n}(typeof self !== 'undefined' ? self : this, function () {\nreturn (function () {\n 'use strict';\n\n // Public API\n //** @type {import(\"./htmx\").HtmxApi} */\n // TODO: list all methods in public API\n var htmx = {\n onLoad: onLoadHelper,\n process: processNode,\n on: addEventListenerImpl,\n off: removeEventListenerImpl,\n trigger : triggerEvent,\n ajax : ajaxHelper,\n find : find,\n findAll : findAll,\n closest : closest,\n values : function(elt, type){\n var inputValues = getInputValues(elt, type || \"post\");\n return inputValues.values;\n },\n remove : removeElement,\n addClass : addClassToElement,\n removeClass : removeClassFromElement,\n toggleClass : toggleClassOnElement,\n takeClass : takeClassForElement,\n defineExtension : defineExtension,\n removeExtension : removeExtension,\n logAll : logAll,\n logNone : logNone,\n logger : null,\n config : {\n historyEnabled:true,\n historyCacheSize:10,\n refreshOnHistoryMiss:false,\n defaultSwapStyle:'innerHTML',\n defaultSwapDelay:0,\n defaultSettleDelay:20,\n includeIndicatorStyles:true,\n indicatorClass:'htmx-indicator',\n requestClass:'htmx-request',\n addedClass:'htmx-added',\n settlingClass:'htmx-settling',\n swappingClass:'htmx-swapping',\n allowEval:true,\n allowScriptTags:true,\n inlineScriptNonce:'',\n attributesToSettle:[\"class\", \"style\", \"width\", \"height\"],\n withCredentials:false,\n timeout:0,\n wsReconnectDelay: 'full-jitter',\n wsBinaryType: 'blob',\n disableSelector: \"[hx-disable], [data-hx-disable]\",\n useTemplateFragments: false,\n scrollBehavior: 'smooth',\n defaultFocusScroll: false,\n getCacheBusterParam: false,\n globalViewTransitions: false,\n methodsThatUseUrlParams: [\"get\"],\n selfRequestsOnly: false,\n ignoreTitle: false,\n scrollIntoViewOnBoost: true,\n triggerSpecsCache: null,\n },\n parseInterval:parseInterval,\n _:internalEval,\n createEventSource: function(url){\n return new EventSource(url, {withCredentials:true})\n },\n createWebSocket: function(url){\n var sock = new WebSocket(url, []);\n sock.binaryType = htmx.config.wsBinaryType;\n return sock;\n },\n version: \"1.9.12\"\n };\n\n /** @type {import(\"./htmx\").HtmxInternalApi} */\n var internalAPI = {\n addTriggerHandler: addTriggerHandler,\n bodyContains: bodyContains,\n canAccessLocalStorage: canAccessLocalStorage,\n findThisElement: findThisElement,\n filterValues: filterValues,\n hasAttribute: hasAttribute,\n getAttributeValue: getAttributeValue,\n getClosestAttributeValue: getClosestAttributeValue,\n getClosestMatch: getClosestMatch,\n getExpressionVars: getExpressionVars,\n getHeaders: getHeaders,\n getInputValues: getInputValues,\n getInternalData: getInternalData,\n getSwapSpecification: getSwapSpecification,\n getTriggerSpecs: getTriggerSpecs,\n getTarget: getTarget,\n makeFragment: makeFragment,\n mergeObjects: mergeObjects,\n makeSettleInfo: makeSettleInfo,\n oobSwap: oobSwap,\n querySelectorExt: querySelectorExt,\n selectAndSwap: selectAndSwap,\n settleImmediately: settleImmediately,\n shouldCancel: shouldCancel,\n triggerEvent: triggerEvent,\n triggerErrorEvent: triggerErrorEvent,\n withExtensions: withExtensions,\n }\n\n var VERBS = ['get', 'post', 'put', 'delete', 'patch'];\n var VERB_SELECTOR = VERBS.map(function(verb){\n return \"[hx-\" + verb + \"], [data-hx-\" + verb + \"]\"\n }).join(\", \");\n\n var HEAD_TAG_REGEX = makeTagRegEx('head'),\n TITLE_TAG_REGEX = makeTagRegEx('title'),\n SVG_TAGS_REGEX = makeTagRegEx('svg', true);\n\n //====================================================================\n // Utilities\n //====================================================================\n\n /**\n * @param {string} tag\n * @param {boolean} [global]\n * @returns {RegExp}\n */\n function makeTagRegEx(tag, global) {\n return new RegExp('<' + tag + '(\\\\s[^>]*>|>)([\\\\s\\\\S]*?)<\\\\/' + tag + '>',\n !!global ? 'gim' : 'im')\n }\n\n function parseInterval(str) {\n if (str == undefined) {\n return undefined;\n }\n\n let interval = NaN;\n if (str.slice(-2) == \"ms\") {\n interval = parseFloat(str.slice(0, -2));\n } else if (str.slice(-1) == \"s\") {\n interval = parseFloat(str.slice(0, -1)) * 1000;\n } else if (str.slice(-1) == \"m\") {\n interval = parseFloat(str.slice(0, -1)) * 1000 * 60;\n } else {\n interval = parseFloat(str);\n }\n return isNaN(interval) ? undefined : interval;\n }\n\n /**\n * @param {HTMLElement} elt\n * @param {string} name\n * @returns {(string | null)}\n */\n function getRawAttribute(elt, name) {\n return elt.getAttribute && elt.getAttribute(name);\n }\n\n // resolve with both hx and data-hx prefixes\n function hasAttribute(elt, qualifiedName) {\n return elt.hasAttribute && (elt.hasAttribute(qualifiedName) ||\n elt.hasAttribute(\"data-\" + qualifiedName));\n }\n\n /**\n *\n * @param {HTMLElement} elt\n * @param {string} qualifiedName\n * @returns {(string | null)}\n */\n function getAttributeValue(elt, qualifiedName) {\n return getRawAttribute(elt, qualifiedName) || getRawAttribute(elt, \"data-\" + qualifiedName);\n }\n\n /**\n * @param {HTMLElement} elt\n * @returns {HTMLElement | null}\n */\n function parentElt(elt) {\n return elt.parentElement;\n }\n\n /**\n * @returns {Document}\n */\n function getDocument() {\n return document;\n }\n\n /**\n * @param {HTMLElement} elt\n * @param {(e:HTMLElement) => boolean} condition\n * @returns {HTMLElement | null}\n */\n function getClosestMatch(elt, condition) {\n while (elt && !condition(elt)) {\n elt = parentElt(elt);\n }\n\n return elt ? elt : null;\n }\n\n function getAttributeValueWithDisinheritance(initialElement, ancestor, attributeName){\n var attributeValue = getAttributeValue(ancestor, attributeName);\n var disinherit = getAttributeValue(ancestor, \"hx-disinherit\");\n if (initialElement !== ancestor && disinherit && (disinherit === \"*\" || disinherit.split(\" \").indexOf(attributeName) >= 0)) {\n return \"unset\";\n } else {\n return attributeValue\n }\n }\n\n /**\n * @param {HTMLElement} elt\n * @param {string} attributeName\n * @returns {string | null}\n */\n function getClosestAttributeValue(elt, attributeName) {\n var closestAttr = null;\n getClosestMatch(elt, function (e) {\n return closestAttr = getAttributeValueWithDisinheritance(elt, e, attributeName);\n });\n if (closestAttr !== \"unset\") {\n return closestAttr;\n }\n }\n\n /**\n * @param {HTMLElement} elt\n * @param {string} selector\n * @returns {boolean}\n */\n function matches(elt, selector) {\n // @ts-ignore: non-standard properties for browser compatibility\n // noinspection JSUnresolvedVariable\n var matchesFunction = elt.matches || elt.matchesSelector || elt.msMatchesSelector || elt.mozMatchesSelector || elt.webkitMatchesSelector || elt.oMatchesSelector;\n return matchesFunction && matchesFunction.call(elt, selector);\n }\n\n /**\n * @param {string} str\n * @returns {string}\n */\n function getStartTag(str) {\n var tagMatcher = /<([a-z][^\\/\\0>\\x20\\t\\r\\n\\f]*)/i\n var match = tagMatcher.exec( str );\n if (match) {\n return match[1].toLowerCase();\n } else {\n return \"\";\n }\n }\n\n /**\n *\n * @param {string} resp\n * @param {number} depth\n * @returns {Element}\n */\n function parseHTML(resp, depth) {\n var parser = new DOMParser();\n var responseDoc = parser.parseFromString(resp, \"text/html\");\n\n /** @type {Element} */\n var responseNode = responseDoc.body;\n while (depth > 0) {\n depth--;\n // @ts-ignore\n responseNode = responseNode.firstChild;\n }\n if (responseNode == null) {\n // @ts-ignore\n responseNode = getDocument().createDocumentFragment();\n }\n return responseNode;\n }\n\n function aFullPageResponse(resp) {\n return /
\" + content + \"\", 0);\n // @ts-ignore type mismatch between DocumentFragment and Element.\n // TODO: Are these close enough for htmx to use interchangeably?\n var fragmentContent = fragment.querySelector('template').content;\n if (htmx.config.allowScriptTags) {\n // if there is a nonce set up, set it on the new script tags\n forEach(fragmentContent.querySelectorAll(\"script\"), function (script) {\n if (htmx.config.inlineScriptNonce) {\n script.nonce = htmx.config.inlineScriptNonce;\n }\n // mark as executed due to template insertion semantics on all browsers except firefox fml\n script.htmxExecuted = navigator.userAgent.indexOf(\"Firefox\") === -1;\n })\n } else {\n forEach(fragmentContent.querySelectorAll(\"script\"), function (script) {\n // remove all script tags if scripts are disabled\n removeElement(script);\n })\n }\n return fragmentContent;\n }\n switch (startTag) {\n case \"thead\":\n case \"tbody\":\n case \"tfoot\":\n case \"colgroup\":\n case \"caption\":\n return parseHTML(\"