{"version":3,"file":"footnote.js","names":["define","_exports","_core","_iconLibrary","_pluginApi","inlineFootnotePopper","footnoteEventHandler","event","tooltip","document","getElementById","displayedFootnoteId","dataset","footnoteId","expandableFootnote","target","destroy","removeAttribute","classList","contains","preventDefault","stopPropagation","footnoteContent","querySelector","cooked","closest","refPostId","newContent","innerHTML","show","createPopper","modifiers","name","options","element","altAxis","padding","offset","Object","defineProperty","value","default","initialize","container","lookup","display_footnotes_inline","body","append","template","createElement","trim","content","firstChild","buildTooltip","window","addEventListener","withPluginApi","api","decorateCookedElement","elem","footnoteRefs","querySelectorAll","forEach","footnoteRef","refLink","add","iconHTML","href","role","getAttribute","after","length","applyInlineFootnotes","onlyStream","id","onPageChange","teardown","removeEventListener","remove","setup","helper","registerOptions","opts","siteSettings","features","markdownitFootnote","enable_markdown_footnotes","allowList","custom","tag","match","registerPlugin"],"sources":["discourse/plugins/footnote/initializers/inline-footnotes.js","discourse/plugins/footnote/lib/discourse-markdown/footnotes.js"],"sourcesContent":["define(\"discourse/plugins/footnote/initializers/inline-footnotes\", [\"exports\", \"@popperjs/core\", \"discourse/lib/icon-library\", \"discourse/lib/plugin-api\"], function (_exports, _core, _iconLibrary, _pluginApi) {\n \"use strict\";\n\n Object.defineProperty(_exports, \"__esModule\", {\n value: true\n });\n _exports.default = void 0;\n let inlineFootnotePopper;\n function applyInlineFootnotes(elem) {\n const footnoteRefs = elem.querySelectorAll(\"sup.footnote-ref\");\n footnoteRefs.forEach(footnoteRef => {\n const refLink = footnoteRef.querySelector(\"a\");\n if (!refLink) {\n return;\n }\n const expandableFootnote = document.createElement(\"a\");\n expandableFootnote.classList.add(\"expand-footnote\");\n expandableFootnote.innerHTML = (0, _iconLibrary.iconHTML)(\"ellipsis\");\n expandableFootnote.href = \"\";\n expandableFootnote.role = \"button\";\n expandableFootnote.dataset.footnoteId = refLink.getAttribute(\"href\");\n footnoteRef.after(expandableFootnote);\n });\n if (footnoteRefs.length) {\n elem.classList.add(\"inline-footnotes\");\n }\n }\n function buildTooltip() {\n const template = document.createElement(\"template\");\n template.innerHTML = `\n