@limetech/lime-elements 40.6.3 → 40.7.0

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.
Files changed (40) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/cjs/lime-elements.cjs.js +1 -1
  3. package/dist/cjs/limel-file-viewer.cjs.entry.js +71 -30
  4. package/dist/cjs/limel-markdown.cjs.entry.js +2 -2
  5. package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +1 -1
  6. package/dist/cjs/limel-tab-bar.cjs.entry.js +37 -14
  7. package/dist/cjs/limel-tab-panel.cjs.entry.js +7 -2
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/cjs/{markdown-exporter-C-UW43FF.js → markdown-exporter-VtX_2D1d.js} +40 -11
  10. package/dist/cjs/{markdown-parser-ssDij8_l.js → markdown-parser-BYtTHL4W.js} +11 -3
  11. package/dist/collection/components/tab-bar/tab-bar.css +79 -27
  12. package/dist/collection/components/tab-bar/tab-bar.js +60 -15
  13. package/dist/collection/components/tab-panel/tab-panel.css +9 -0
  14. package/dist/collection/components/tab-panel/tab-panel.js +27 -1
  15. package/dist/esm/lime-elements.js +1 -1
  16. package/dist/esm/limel-file-viewer.entry.js +71 -30
  17. package/dist/esm/limel-markdown.entry.js +2 -2
  18. package/dist/esm/limel-prosemirror-adapter.entry.js +1 -1
  19. package/dist/esm/limel-tab-bar.entry.js +37 -14
  20. package/dist/esm/limel-tab-panel.entry.js +7 -2
  21. package/dist/esm/loader.js +1 -1
  22. package/dist/esm/{markdown-exporter-DblYRMhY.js → markdown-exporter-tb8ft8Gq.js} +40 -11
  23. package/dist/esm/{markdown-parser-CAPDx7i8.js → markdown-parser-DFP65EFu.js} +11 -3
  24. package/dist/lime-elements/lime-elements.esm.js +1 -1
  25. package/dist/lime-elements/p-14a28a08.entry.js +1 -0
  26. package/dist/lime-elements/p-1740cb87.entry.js +1 -0
  27. package/dist/lime-elements/{p-22fd1c87.entry.js → p-21ab902a.entry.js} +1 -1
  28. package/dist/lime-elements/{p-05038bbb.entry.js → p-91a572c8.entry.js} +1 -1
  29. package/dist/lime-elements/p-Bgn2bikC.js +1 -0
  30. package/dist/lime-elements/p-C0wwdPYT.js +7 -0
  31. package/dist/lime-elements/p-aa897903.entry.js +1 -0
  32. package/dist/types/components/tab-bar/tab-bar.d.ts +17 -4
  33. package/dist/types/components/tab-panel/tab-panel.d.ts +6 -0
  34. package/dist/types/components.d.ts +48 -10
  35. package/package.json +4 -4
  36. package/dist/lime-elements/p-2e33d2a4.entry.js +0 -1
  37. package/dist/lime-elements/p-Bvyt2bmV.js +0 -1
  38. package/dist/lime-elements/p-I0PrvthC.js +0 -7
  39. package/dist/lime-elements/p-a550ba18.entry.js +0 -1
  40. package/dist/lime-elements/p-b35a912c.entry.js +0 -1
@@ -1 +1 @@
1
- import{r as e,h as t,H as r}from"./p-BU9IJqli.js";import{m as o}from"./p-I0PrvthC.js";import{g as a}from"./p-Dnt5w_Bp.js";import{d as n}from"./p-_UXAljNc.js";import{a as l}from"./p-BQoih_t0.js";import"./p-B85MJLTf.js";class i{constructor(e){this.handleIntersection=e=>{for(const t of e){if(!t.isIntersecting)continue;const e=t.target,r=e.dataset.src;r&&(e.setAttribute("src",r),delete e.dataset.src),this.observer.unobserve(e)}},this.observer=new IntersectionObserver(this.handleIntersection);const t=e.querySelectorAll("img");for(const e of t)this.observer.observe(e)}disconnect(){this.observer.disconnect()}}var s;const d=new Map(Object.entries(null!==(s=n.protocols)&&void 0!==s?s:{}).map((([e,t])=>[e,new Set(t)])));function m(e,t){for(const r of t){const t=e.getAttribute(r);if(!t)continue;const o=c(t);if(void 0===o)continue;const a=f(o);e[b(r)]=a}}function c(e){const t=e.trim();if(t.startsWith("{")&&t.endsWith("}")||t.startsWith("[")&&t.endsWith("]"))try{return JSON.parse(t)}catch(e){try{const e=t.replaceAll("&#x22;",'"').replaceAll("&#34;",'"').replaceAll("&quot;",'"').replaceAll("&#x27;","'").replaceAll("&#39;","'").replaceAll("&apos;","'").replaceAll("&amp;","&");return JSON.parse(e)}catch(e){return}}}function h(e,t){const r=e.trim(),o=r.indexOf(":");if(-1===o||/[?#/]/.test(r.slice(0,o)))return!0;const a=r.slice(0,o).toLowerCase();return t.has(a)}function f(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(f);const t=Object.assign({},e);for(const e of Object.keys(t)){const r=d.get(e);r&&"string"==typeof t[e]&&!h(t[e],r)?(console.warn(`limel-markdown: Removed unsafe URL from "${e}" during sanitization.`),delete t[e]):"object"==typeof t[e]&&null!==t[e]&&(t[e]=f(t[e]))}return t}function b(e){return e.replaceAll(/-([a-z])/g,((e,t)=>t.toUpperCase()))}var u,g="undefined"==typeof document?void 0:document,p=!!g&&"content"in g.createElement("template"),v=!!g&&g.createRange&&"createContextualFragment"in g.createRange();function w(e,t){var r,o,a=e.nodeName,n=t.nodeName;return a===n||(r=a.charCodeAt(0),o=n.charCodeAt(0),r<=90&&o>=97?a===n.toUpperCase():o<=90&&r>=97&&n===a.toUpperCase())}function k(e,t,r){e[r]!==t[r]&&(e[r]=t[r],e[r]?e.setAttribute(r,""):e.removeAttribute(r))}var y={OPTION:function(e,t){var r=e.parentNode;if(r){var o=r.nodeName.toUpperCase();"OPTGROUP"===o&&(o=(r=r.parentNode)&&r.nodeName.toUpperCase()),"SELECT"!==o||r.hasAttribute("multiple")||(e.hasAttribute("selected")&&!t.selected&&(e.setAttribute("selected","selected"),e.removeAttribute("selected")),r.selectedIndex=-1)}k(e,t,"selected")},INPUT:function(e,t){k(e,t,"checked"),k(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),t.hasAttribute("value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var r=t.value;e.value!==r&&(e.value=r);var o=e.firstChild;if(o){var a=o.nodeValue;if(a==r||!r&&a==e.placeholder)return;o.nodeValue=r}},SELECT:function(e,t){if(!t.hasAttribute("multiple")){for(var r,o,a=-1,n=0,l=e.firstChild;l;)if("OPTGROUP"===(o=l.nodeName&&l.nodeName.toUpperCase()))(l=(r=l).firstChild)||(l=r.nextSibling,r=null);else{if("OPTION"===o){if(l.hasAttribute("selected")){a=n;break}n++}!(l=l.nextSibling)&&r&&(l=r.nextSibling,r=null)}e.selectedIndex=a}}};function j(){}function x(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}var z=function(e,t,r){if(r||(r={}),"string"==typeof t)if("#document"===e.nodeName||"HTML"===e.nodeName){var o=t;(t=g.createElement("html")).innerHTML=o}else if("BODY"===e.nodeName){var a=t;(t=g.createElement("html")).innerHTML=a;var n=t.querySelector("body");n&&(t=n)}else l=(l=t).trim(),t=p?function(e){var t=g.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}(l):v?function(e){return u||(u=g.createRange()).selectNode(g.body),u.createContextualFragment(e).childNodes[0]}(l):function(e){var t=g.createElement("body");return t.innerHTML=e,t.childNodes[0]}(l);else 11===t.nodeType&&(t=t.firstElementChild);var l,i=r.getNodeKey||x,s=r.onBeforeNodeAdded||j,d=r.onNodeAdded||j,m=r.onBeforeElUpdated||j,c=r.onElUpdated||j,h=r.onBeforeNodeDiscarded||j,f=r.onNodeDiscarded||j,b=r.onBeforeElChildrenUpdated||j,k=r.skipFromChildren||j,z=r.addChild||function(e,t){return e.appendChild(t)},C=!0===r.childrenOnly,O=Object.create(null),N=[];function T(e){N.push(e)}function q(e,t){if(1===e.nodeType)for(var r=e.firstChild;r;){var o=void 0;t&&(o=i(r))?T(o):(f(r),r.firstChild&&q(r,t)),r=r.nextSibling}}function M(e,t,r){!1!==h(e)&&(t&&t.removeChild(e),f(e),q(e,r))}function P(e){if(1===e.nodeType||11===e.nodeType)for(var t=e.firstChild;t;){var r=i(t);r&&(O[r]=t),P(t),t=t.nextSibling}}function E(e){d(e);for(var t=e.firstChild;t;){var r=t.nextSibling,o=i(t);if(o){var a=O[o];a&&w(t,a)?(t.parentNode.replaceChild(a,t),H(a,t)):E(t)}else E(t);t=r}}function H(e,t,r){var o=i(t);if(o&&delete O[o],!r){var a=m(e,t);if(!1===a)return;if(a instanceof HTMLElement&&P(e=a),function(e,t){var r,o,a,n,l=t.attributes;if(11!==t.nodeType&&11!==e.nodeType){for(var i=l.length-1;i>=0;i--)o=(r=l[i]).name,n=r.value,(a=r.namespaceURI)?e.getAttributeNS(a,o=r.localName||o)!==n&&("xmlns"===r.prefix&&(o=r.name),e.setAttributeNS(a,o,n)):e.getAttribute(o)!==n&&e.setAttribute(o,n);for(var s=e.attributes,d=s.length-1;d>=0;d--)o=(r=s[d]).name,(a=r.namespaceURI)?t.hasAttributeNS(a,o=r.localName||o)||e.removeAttributeNS(a,o):t.hasAttribute(o)||e.removeAttribute(o)}}(e,t),c(e),!1===b(e,t))return}"TEXTAREA"!==e.nodeName?function(e,t){var r,o,a,n,l,d=k(e,t),m=t.firstChild,c=e.firstChild;e:for(;m;){for(n=m.nextSibling,r=i(m);!d&&c;){if(a=c.nextSibling,m.isSameNode&&m.isSameNode(c)){m=n,c=a;continue e}o=i(c);var h=c.nodeType,f=void 0;if(h===m.nodeType&&(1===h?(r?r!==o&&((l=O[r])?a===l?f=!1:(e.insertBefore(l,c),o?T(o):M(c,e,!0),o=i(c=l)):f=!1):o&&(f=!1),(f=!1!==f&&w(c,m))&&H(c,m)):3!==h&&8!=h||(f=!0,c.nodeValue!==m.nodeValue&&(c.nodeValue=m.nodeValue))),f){m=n,c=a;continue e}o?T(o):M(c,e,!0),c=a}if(r&&(l=O[r])&&w(l,m))d||z(e,l),H(l,m);else{var b=s(m);!1!==b&&(b&&(m=b),m.actualize&&(m=m.actualize(e.ownerDocument||g)),z(e,m),E(m))}m=n,c=a}!function(e,t,r){for(;t;){var o=t.nextSibling;(r=i(t))?T(r):M(t,e,!0),t=o}}(e,c,o);var u=y[e.nodeName];u&&u(e,t)}(e,t):y.TEXTAREA(e,t)}P(e);var I,L,S=e,A=S.nodeType,R=t.nodeType;if(!C)if(1===A)1===R?w(e,t)||(f(e),S=function(e,t){for(var r=e.firstChild;r;){var o=r.nextSibling;t.appendChild(r),r=o}return t}(e,(I=t.nodeName,(L=t.namespaceURI)&&"http://www.w3.org/1999/xhtml"!==L?g.createElementNS(L,I):g.createElement(I)))):S=t;else if(3===A||8===A){if(R===A)return S.nodeValue!==t.nodeValue&&(S.nodeValue=t.nodeValue),S;S=t}if(S===t)f(e);else{if(t.isSameNode&&t.isSameNode(S))return;if(H(S,t,C),N)for(var B=0,U=N.length;B<U;B++){var D=O[N[B]];D&&M(D,D.parentNode,!1)}}return!C&&S!==e&&e.parentNode&&(S.actualize&&(S=S.actualize(e.ownerDocument||g)),e.parentNode.replaceChild(S,e)),S};const C=[{tagName:"limel-chip",attributes:["text","icon","link","badge","disabled","readonly","selected","type","size"]},{tagName:"limel-icon",attributes:["name","size","badge"]},{tagName:"limel-badge",attributes:["label"]},{tagName:"limel-callout",attributes:["heading","icon","type"]},{tagName:"limel-linear-progress",attributes:["value","indeterminate"]},{tagName:"limel-circular-progress",attributes:["value","max-value","prefix","suffix","size","display-percentage-colors"]},{tagName:"limel-spinner",attributes:["size"]},{tagName:"limel-info-tile",attributes:["value","icon","label","prefix","suffix","badge"]}],O=class{constructor(t){e(this,t),this.value="",this.whitelist=a.markdownWhitelist,this.lazyLoadImages=!1,this.removeEmptyParagraphs=!0,this.adaptColorContrast=!1,this.imageIntersectionObserver=null}async toMarkdown(){await this.rendering;const{exportMarkdown:e}=await import("./p-Bvyt2bmV.js");return e(this.rootElement,this.cachedCombinedWhitelist)}textChanged(){return this.rendering=this.renderMarkdown(),this.rendering}async renderMarkdown(){try{this.cleanupImageIntersectionObserver(),this.cachedCombinedWhitelist&&this.whitelist===this.cachedConsumerWhitelist||(this.cachedConsumerWhitelist=this.whitelist,this.cachedCombinedWhitelist=function(e,t){if(!(null==t?void 0:t.length))return e.map((e=>Object.assign(Object.assign({},e),{attributes:[...e.attributes]})));const r=new Map;for(const o of[...e,...t]){const e=r.get(o.tagName);if(e)for(const t of o.attributes)e.add(t);else r.set(o.tagName,new Set(o.attributes))}return[...r].map((([e,t])=>({tagName:e,attributes:[...t]})))}(C,this.whitelist));const e=this.cachedCombinedWhitelist,t=await o(this.value,{forceHardLineBreaks:!0,whitelist:e,lazyLoadImages:this.lazyLoadImages,removeEmptyParagraphs:this.removeEmptyParagraphs});!function(e,t=""){try{z(e,`<div>${t}</div>`,{childrenOnly:!0})}catch(r){console.warn("morphdom failed, falling back to innerHTML:",r),e.innerHTML=t}}(this.rootElement,t),function(e,t){if(e&&(null==t?void 0:t.length))for(const r of t){const t=e.querySelectorAll(r.tagName);for(const e of t)m(e,r.attributes)}}(this.rootElement,e),this.adaptColorContrast&&l(this.rootElement),this.setupImageIntersectionObserver()}catch(e){console.error(e)}}handleWhitelistChange(){return this.textChanged()}handleRemoveEmptyParagraphsChange(){return this.textChanged()}handleAdaptColorContrastChange(){return this.textChanged()}async componentDidLoad(){this.textChanged()}disconnectedCallback(){this.cleanupImageIntersectionObserver()}render(){return t(r,{key:"cb9496c27479dce2acf8005bff7c780190f923ba"},t("div",{key:"a48bd187c4b08db7d7b2e105fe4b1c92089d1a57",id:"markdown",ref:e=>this.rootElement=e}))}setupImageIntersectionObserver(){this.lazyLoadImages&&(this.imageIntersectionObserver=new i(this.rootElement))}cleanupImageIntersectionObserver(){this.imageIntersectionObserver&&(this.imageIntersectionObserver.disconnect(),this.imageIntersectionObserver=null)}static get watchers(){return{value:[{textChanged:0}],whitelist:[{handleWhitelistChange:0}],removeEmptyParagraphs:[{handleRemoveEmptyParagraphsChange:0}],adaptColorContrast:[{handleAdaptColorContrastChange:0}]}}};O.style='@charset "UTF-8";pre,pre p,code{font-family:ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;font-size:0.75rem}pre{max-width:100%;white-space:pre-wrap;word-wrap:break-word}code{letter-spacing:-0.0125rem;color:rgb(var(--contrast-1300));tab-size:4;hyphens:none;display:inline;border-radius:0.25rem;padding:0.03125rem 0.25rem;background-color:rgb(var(--contrast-600))}pre>code{display:block;margin:0.5rem 0;padding:0.5rem 0.75rem}h1{font-size:1.5rem}h2{font-size:1.25rem}h3{font-size:1.125rem}h4{font-size:1rem}h5{font-size:var(--limel-theme-default-font-size)}h6{font-size:0.75rem}h1,h2{margin-top:0.5rem;margin-bottom:0.5rem;letter-spacing:-0.03125rem;font-weight:500}h3,h4{margin-top:0.75rem;margin-bottom:0.25rem;font-weight:600}h5,h6{margin-top:0.5rem;margin-bottom:0.125rem;font-weight:600}h1,h2,h3,h4,h5,h6{word-break:break-word;hyphens:auto;-webkit-hyphens:auto}h1 code,h2 code,h3 code,h4 code,h5 code,h6 code{font-size:inherit}:not([contenteditable=true]) h1,:not([contenteditable=true]) h2,:not([contenteditable=true]) h3,:not([contenteditable=true]) h4,:not([contenteditable=true]) h5,:not([contenteditable=true]) h6{text-wrap:balance}[contenteditable=true] h1,[contenteditable=true] h2,[contenteditable=true] h3,[contenteditable=true] h4,[contenteditable=true] h5,[contenteditable=true] h6{text-wrap:initial}:host(limel-markdown.truncate-paragraphs) p{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}p,li{font-size:var(--limel-theme-default-font-size);word-break:break-word}a{word-break:break-all}p{margin-top:0;margin-bottom:0.5rem}p:last-child{margin-bottom:0}a{transition:color 0.2s ease;color:var(--markdown-hyperlink-color, rgb(var(--color-blue-dark)));text-decoration:none}a:hover{color:var(--markdown-hyperlink-color--hovered, rgb(var(--color-blue-default)))}hr{margin:1.75rem 0 2rem 0;border-width:0;border-top:1px solid rgb(var(--contrast-500))}ul{list-style:none}ul>li{margin-left:0.75rem}ul>li:before{content:"";position:absolute;left:-0.5rem;top:0.5rem;width:0.25rem;height:0.25rem;border-radius:50%;background-color:rgb(var(--contrast-700));display:block}ol{margin-top:0.25rem;padding-left:1rem}ul{margin-top:0.25rem;padding-left:0}ul ul,ul ol,ol ol,ol ul{margin-left:0}li{position:relative;margin-bottom:0.25rem}:host(limel-markdown:not(.no-table-styles)) table{table-layout:auto;min-width:100%;border-collapse:collapse;border-spacing:0;background:transparent;margin:0.75rem 0}:host(limel-markdown:not(.no-table-styles)) tbody{border:1px solid rgb(var(--contrast-400));border-radius:0.25rem}:host(limel-markdown:not(.no-table-styles)) th,:host(limel-markdown:not(.no-table-styles)) td{text-align:left;vertical-align:top;transition:background-color 0.2s ease;font-size:var(--limel-theme-default-font-size)}:host(limel-markdown:not(.no-table-styles)) th p,:host(limel-markdown:not(.no-table-styles)) th li,:host(limel-markdown:not(.no-table-styles)) th a,:host(limel-markdown:not(.no-table-styles)) td p,:host(limel-markdown:not(.no-table-styles)) td li,:host(limel-markdown:not(.no-table-styles)) td a{word-break:normal;overflow-wrap:normal}:host(limel-markdown:not(.no-table-styles)) td{padding:0.5rem 0.375rem 0.75rem 0.375rem}:host(limel-markdown:not(.no-table-styles)) tr th{background-color:rgb(var(--contrast-400));padding:0.25rem 0.375rem;font-weight:normal}:host(limel-markdown:not(.no-table-styles)) tr th:only-child{text-align:center}:host(limel-markdown:not(.no-table-styles)) tbody tr:nth-child(odd) td{background-color:rgb(var(--contrast-200))}:host(limel-markdown:not(.no-table-styles)) tbody tr:hover td{background-color:rgb(var(--contrast-300))}table{display:block;box-sizing:border-box;overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%}blockquote{position:relative;max-width:100%;margin:0.75rem 0;padding:0.5rem;border-left:0.25rem solid rgb(var(--contrast-500));background-color:rgb(var(--contrast-200))}blockquote:before,blockquote:after{position:absolute;line-height:0;font-size:2rem;opacity:0.4}blockquote:before{content:"“";left:-0.5rem;top:0.5rem}blockquote:after{content:"”";right:-0.25rem;bottom:-0.25rem}blockquote blockquote{padding-top:0;padding-right:0;padding-bottom:0;padding-left:0.25rem;border-color:rgb(var(--contrast-700));border-left-width:1px}blockquote blockquote:before,blockquote blockquote:after{display:none}blockquote:has(>blockquote){padding-left:0.25rem;padding-bottom:0}dl{display:grid;grid-template-columns:1fr 2fr;grid-template-rows:1fr;margin-bottom:2rem;border:1px solid rgb(var(--contrast-400));border-radius:0.375rem;background-color:rgb(var(--contrast-200))}dl dt,dl dd{padding:0.375rem 0.5rem;font-size:var(--limel-theme-default-font-size);margin:0}dl dt:nth-of-type(even),dl dd:nth-of-type(even){background-color:rgb(var(--contrast-300))}dl dt:first-child{border-top-left-radius:0.375rem}dl dt:last-child{border-bottom-left-radius:0.375rem}dl dd:first-child{border-top-right-radius:0.375rem}dl dd:last-child{border-bottom-right-radius:0.375rem}img{max-width:100%;border-radius:0.25rem}kbd{display:inline-block;font-family:ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;font-weight:600;color:rgb(var(--contrast-1100));white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:normal;border-radius:0.125rem;border-style:solid;border-color:rgb(var(--contrast-500));border-width:0 1px 0.1875rem 1px;padding:0.0625rem 0.375rem;margin:0 0.25rem;background-color:rgb(var(--contrast-200));box-shadow:var(--button-shadow-normal), 0 0.625rem 0.375rem -0.5rem rgb(var(--color-black), 0.02), 0 0.025rem 0.5rem 0 rgb(var(--contrast-100)) inset}:host(limel-markdown.adjust-for-table-cell) img{max-height:1.25rem;vertical-align:middle}:host(limel-markdown.adjust-for-table-cell) p{display:inline}:host(limel-markdown.adjust-for-table-cell) h1,:host(limel-markdown.adjust-for-table-cell) h2,:host(limel-markdown.adjust-for-table-cell) h3,:host(limel-markdown.adjust-for-table-cell) h4,:host(limel-markdown.adjust-for-table-cell) h5,:host(limel-markdown.adjust-for-table-cell) h6{display:inline-block;vertical-align:bottom;font-size:var(--limel-theme-default-font-size);margin:0 0.25rem 0 0;letter-spacing:normal;font-weight:500}:host(limel-markdown.adjust-for-table-cell) h1:before,:host(limel-markdown.adjust-for-table-cell) h2:before,:host(limel-markdown.adjust-for-table-cell) h3:before,:host(limel-markdown.adjust-for-table-cell) h4:before,:host(limel-markdown.adjust-for-table-cell) h5:before,:host(limel-markdown.adjust-for-table-cell) h6:before{opacity:0.6;vertical-align:middle;font-size:0.5rem;border-radius:0.25rem 0 0 0.25rem;padding:0.25rem;padding-right:2rem;margin-right:-1.75rem;background:linear-gradient(to right, rgb(var(--contrast-800), 0.6), rgb(var(--contrast-800), 0))}:host(limel-markdown.adjust-for-table-cell) h1:before{content:"H1"}:host(limel-markdown.adjust-for-table-cell) h2:before{content:"H2"}:host(limel-markdown.adjust-for-table-cell) h3:before{content:"H3"}:host(limel-markdown.adjust-for-table-cell) h4:before{content:"H4"}:host(limel-markdown.adjust-for-table-cell) h5:before{content:"H5"}:host(limel-markdown.adjust-for-table-cell) h6:before{content:"H6"}:host(limel-markdown.adjust-for-table-cell) pre{margin:0}:host(limel-markdown.adjust-for-table-cell) pre>code{padding:0.125rem;margin:0}:host(limel-markdown.adjust-for-table-cell) dl{margin:0}:host(limel-markdown.adjust-for-table-cell) dl dt,:host(limel-markdown.adjust-for-table-cell) dl dd{padding:0.00625rem 0.125rem}*,*::before,*::after{box-sizing:border-box}* :where(:not(img,video,svg,canvas,iframe)),*::before :where(:not(img,video,svg,canvas,iframe)),*::after :where(:not(img,video,svg,canvas,iframe)){min-width:0;min-height:0}hr{border-top:1px solid rgb(var(--contrast-700))}.MsoNormal{margin:0}:host(limel-markdown.reset-img-height) #markdown img{height:auto !important}';export{O as limel_markdown}
1
+ import{r as e,h as t,H as r}from"./p-BU9IJqli.js";import{m as o}from"./p-C0wwdPYT.js";import{g as a}from"./p-Dnt5w_Bp.js";import{d as n}from"./p-_UXAljNc.js";import{a as l}from"./p-BQoih_t0.js";import"./p-B85MJLTf.js";class i{constructor(e){this.handleIntersection=e=>{for(const t of e){if(!t.isIntersecting)continue;const e=t.target,r=e.dataset.src;r&&(e.setAttribute("src",r),delete e.dataset.src),this.observer.unobserve(e)}},this.observer=new IntersectionObserver(this.handleIntersection);const t=e.querySelectorAll("img");for(const e of t)this.observer.observe(e)}disconnect(){this.observer.disconnect()}}var s;const d=new Map(Object.entries(null!==(s=n.protocols)&&void 0!==s?s:{}).map((([e,t])=>[e,new Set(t)])));function m(e,t){for(const r of t){const t=e.getAttribute(r);if(!t)continue;const o=c(t);if(void 0===o)continue;const a=f(o);e[b(r)]=a}}function c(e){const t=e.trim();if(t.startsWith("{")&&t.endsWith("}")||t.startsWith("[")&&t.endsWith("]"))try{return JSON.parse(t)}catch(e){try{const e=t.replaceAll("&#x22;",'"').replaceAll("&#34;",'"').replaceAll("&quot;",'"').replaceAll("&#x27;","'").replaceAll("&#39;","'").replaceAll("&apos;","'").replaceAll("&amp;","&");return JSON.parse(e)}catch(e){return}}}function h(e,t){const r=e.trim(),o=r.indexOf(":");if(-1===o||/[?#/]/.test(r.slice(0,o)))return!0;const a=r.slice(0,o).toLowerCase();return t.has(a)}function f(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(f);const t=Object.assign({},e);for(const e of Object.keys(t)){const r=d.get(e);r&&"string"==typeof t[e]&&!h(t[e],r)?(console.warn(`limel-markdown: Removed unsafe URL from "${e}" during sanitization.`),delete t[e]):"object"==typeof t[e]&&null!==t[e]&&(t[e]=f(t[e]))}return t}function b(e){return e.replaceAll(/-([a-z])/g,((e,t)=>t.toUpperCase()))}var u,g="undefined"==typeof document?void 0:document,p=!!g&&"content"in g.createElement("template"),v=!!g&&g.createRange&&"createContextualFragment"in g.createRange();function w(e,t){var r,o,a=e.nodeName,n=t.nodeName;return a===n||(r=a.charCodeAt(0),o=n.charCodeAt(0),r<=90&&o>=97?a===n.toUpperCase():o<=90&&r>=97&&n===a.toUpperCase())}function k(e,t,r){e[r]!==t[r]&&(e[r]=t[r],e[r]?e.setAttribute(r,""):e.removeAttribute(r))}var y={OPTION:function(e,t){var r=e.parentNode;if(r){var o=r.nodeName.toUpperCase();"OPTGROUP"===o&&(o=(r=r.parentNode)&&r.nodeName.toUpperCase()),"SELECT"!==o||r.hasAttribute("multiple")||(e.hasAttribute("selected")&&!t.selected&&(e.setAttribute("selected","selected"),e.removeAttribute("selected")),r.selectedIndex=-1)}k(e,t,"selected")},INPUT:function(e,t){k(e,t,"checked"),k(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),t.hasAttribute("value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var r=t.value;e.value!==r&&(e.value=r);var o=e.firstChild;if(o){var a=o.nodeValue;if(a==r||!r&&a==e.placeholder)return;o.nodeValue=r}},SELECT:function(e,t){if(!t.hasAttribute("multiple")){for(var r,o,a=-1,n=0,l=e.firstChild;l;)if("OPTGROUP"===(o=l.nodeName&&l.nodeName.toUpperCase()))(l=(r=l).firstChild)||(l=r.nextSibling,r=null);else{if("OPTION"===o){if(l.hasAttribute("selected")){a=n;break}n++}!(l=l.nextSibling)&&r&&(l=r.nextSibling,r=null)}e.selectedIndex=a}}};function j(){}function x(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}var z=function(e,t,r){if(r||(r={}),"string"==typeof t)if("#document"===e.nodeName||"HTML"===e.nodeName){var o=t;(t=g.createElement("html")).innerHTML=o}else if("BODY"===e.nodeName){var a=t;(t=g.createElement("html")).innerHTML=a;var n=t.querySelector("body");n&&(t=n)}else l=(l=t).trim(),t=p?function(e){var t=g.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}(l):v?function(e){return u||(u=g.createRange()).selectNode(g.body),u.createContextualFragment(e).childNodes[0]}(l):function(e){var t=g.createElement("body");return t.innerHTML=e,t.childNodes[0]}(l);else 11===t.nodeType&&(t=t.firstElementChild);var l,i=r.getNodeKey||x,s=r.onBeforeNodeAdded||j,d=r.onNodeAdded||j,m=r.onBeforeElUpdated||j,c=r.onElUpdated||j,h=r.onBeforeNodeDiscarded||j,f=r.onNodeDiscarded||j,b=r.onBeforeElChildrenUpdated||j,k=r.skipFromChildren||j,z=r.addChild||function(e,t){return e.appendChild(t)},C=!0===r.childrenOnly,O=Object.create(null),T=[];function N(e){T.push(e)}function q(e,t){if(1===e.nodeType)for(var r=e.firstChild;r;){var o=void 0;t&&(o=i(r))?N(o):(f(r),r.firstChild&&q(r,t)),r=r.nextSibling}}function M(e,t,r){!1!==h(e)&&(t&&t.removeChild(e),f(e),q(e,r))}function P(e){if(1===e.nodeType||11===e.nodeType)for(var t=e.firstChild;t;){var r=i(t);r&&(O[r]=t),P(t),t=t.nextSibling}}function E(e){d(e);for(var t=e.firstChild;t;){var r=t.nextSibling,o=i(t);if(o){var a=O[o];a&&w(t,a)?(t.parentNode.replaceChild(a,t),H(a,t)):E(t)}else E(t);t=r}}function H(e,t,r){var o=i(t);if(o&&delete O[o],!r){var a=m(e,t);if(!1===a)return;if(a instanceof HTMLElement&&P(e=a),function(e,t){var r,o,a,n,l=t.attributes;if(11!==t.nodeType&&11!==e.nodeType){for(var i=l.length-1;i>=0;i--)o=(r=l[i]).name,n=r.value,(a=r.namespaceURI)?e.getAttributeNS(a,o=r.localName||o)!==n&&("xmlns"===r.prefix&&(o=r.name),e.setAttributeNS(a,o,n)):e.getAttribute(o)!==n&&e.setAttribute(o,n);for(var s=e.attributes,d=s.length-1;d>=0;d--)o=(r=s[d]).name,(a=r.namespaceURI)?t.hasAttributeNS(a,o=r.localName||o)||e.removeAttributeNS(a,o):t.hasAttribute(o)||e.removeAttribute(o)}}(e,t),c(e),!1===b(e,t))return}"TEXTAREA"!==e.nodeName?function(e,t){var r,o,a,n,l,d=k(e,t),m=t.firstChild,c=e.firstChild;e:for(;m;){for(n=m.nextSibling,r=i(m);!d&&c;){if(a=c.nextSibling,m.isSameNode&&m.isSameNode(c)){m=n,c=a;continue e}o=i(c);var h=c.nodeType,f=void 0;if(h===m.nodeType&&(1===h?(r?r!==o&&((l=O[r])?a===l?f=!1:(e.insertBefore(l,c),o?N(o):M(c,e,!0),o=i(c=l)):f=!1):o&&(f=!1),(f=!1!==f&&w(c,m))&&H(c,m)):3!==h&&8!=h||(f=!0,c.nodeValue!==m.nodeValue&&(c.nodeValue=m.nodeValue))),f){m=n,c=a;continue e}o?N(o):M(c,e,!0),c=a}if(r&&(l=O[r])&&w(l,m))d||z(e,l),H(l,m);else{var b=s(m);!1!==b&&(b&&(m=b),m.actualize&&(m=m.actualize(e.ownerDocument||g)),z(e,m),E(m))}m=n,c=a}!function(e,t,r){for(;t;){var o=t.nextSibling;(r=i(t))?N(r):M(t,e,!0),t=o}}(e,c,o);var u=y[e.nodeName];u&&u(e,t)}(e,t):y.TEXTAREA(e,t)}P(e);var I,L,S=e,A=S.nodeType,R=t.nodeType;if(!C)if(1===A)1===R?w(e,t)||(f(e),S=function(e,t){for(var r=e.firstChild;r;){var o=r.nextSibling;t.appendChild(r),r=o}return t}(e,(I=t.nodeName,(L=t.namespaceURI)&&"http://www.w3.org/1999/xhtml"!==L?g.createElementNS(L,I):g.createElement(I)))):S=t;else if(3===A||8===A){if(R===A)return S.nodeValue!==t.nodeValue&&(S.nodeValue=t.nodeValue),S;S=t}if(S===t)f(e);else{if(t.isSameNode&&t.isSameNode(S))return;if(H(S,t,C),T)for(var B=0,U=T.length;B<U;B++){var D=O[T[B]];D&&M(D,D.parentNode,!1)}}return!C&&S!==e&&e.parentNode&&(S.actualize&&(S=S.actualize(e.ownerDocument||g)),e.parentNode.replaceChild(S,e)),S};const C=[{tagName:"limel-chip",attributes:["text","icon","link","badge","disabled","readonly","selected","type","size"]},{tagName:"limel-icon",attributes:["name","size","badge"]},{tagName:"limel-badge",attributes:["label"]},{tagName:"limel-callout",attributes:["heading","icon","type"]},{tagName:"limel-linear-progress",attributes:["value","indeterminate"]},{tagName:"limel-circular-progress",attributes:["value","max-value","prefix","suffix","size","display-percentage-colors"]},{tagName:"limel-spinner",attributes:["size"]},{tagName:"limel-info-tile",attributes:["value","icon","label","prefix","suffix","badge"]}],O=class{constructor(t){e(this,t),this.value="",this.whitelist=a.markdownWhitelist,this.lazyLoadImages=!1,this.removeEmptyParagraphs=!0,this.adaptColorContrast=!1,this.imageIntersectionObserver=null}async toMarkdown(){await this.rendering;const{exportMarkdown:e}=await import("./p-Bgn2bikC.js");return e(this.rootElement,this.cachedCombinedWhitelist)}textChanged(){return this.rendering=this.renderMarkdown(),this.rendering}async renderMarkdown(){try{this.cleanupImageIntersectionObserver(),this.cachedCombinedWhitelist&&this.whitelist===this.cachedConsumerWhitelist||(this.cachedConsumerWhitelist=this.whitelist,this.cachedCombinedWhitelist=function(e,t){if(!(null==t?void 0:t.length))return e.map((e=>Object.assign(Object.assign({},e),{attributes:[...e.attributes]})));const r=new Map;for(const o of[...e,...t]){const e=r.get(o.tagName);if(e)for(const t of o.attributes)e.add(t);else r.set(o.tagName,new Set(o.attributes))}return[...r].map((([e,t])=>({tagName:e,attributes:[...t]})))}(C,this.whitelist));const e=this.cachedCombinedWhitelist,t=await o(this.value,{forceHardLineBreaks:!0,whitelist:e,lazyLoadImages:this.lazyLoadImages,removeEmptyParagraphs:this.removeEmptyParagraphs});!function(e,t=""){try{z(e,`<div>${t}</div>`,{childrenOnly:!0})}catch(r){console.warn("morphdom failed, falling back to innerHTML:",r),e.innerHTML=t}}(this.rootElement,t),function(e,t){if(e&&(null==t?void 0:t.length))for(const r of t){const t=e.querySelectorAll(r.tagName);for(const e of t)m(e,r.attributes)}}(this.rootElement,e),this.adaptColorContrast&&l(this.rootElement),this.setupImageIntersectionObserver()}catch(e){console.error(e)}}handleWhitelistChange(){return this.textChanged()}handleRemoveEmptyParagraphsChange(){return this.textChanged()}handleAdaptColorContrastChange(){return this.textChanged()}async componentDidLoad(){this.textChanged()}disconnectedCallback(){this.cleanupImageIntersectionObserver()}render(){return t(r,{key:"cb9496c27479dce2acf8005bff7c780190f923ba"},t("div",{key:"a48bd187c4b08db7d7b2e105fe4b1c92089d1a57",id:"markdown",ref:e=>this.rootElement=e}))}setupImageIntersectionObserver(){this.lazyLoadImages&&(this.imageIntersectionObserver=new i(this.rootElement))}cleanupImageIntersectionObserver(){this.imageIntersectionObserver&&(this.imageIntersectionObserver.disconnect(),this.imageIntersectionObserver=null)}static get watchers(){return{value:[{textChanged:0}],whitelist:[{handleWhitelistChange:0}],removeEmptyParagraphs:[{handleRemoveEmptyParagraphsChange:0}],adaptColorContrast:[{handleAdaptColorContrastChange:0}]}}};O.style='@charset "UTF-8";pre,pre p,code{font-family:ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;font-size:0.75rem}pre{max-width:100%;white-space:pre-wrap;word-wrap:break-word}code{letter-spacing:-0.0125rem;color:rgb(var(--contrast-1300));tab-size:4;hyphens:none;display:inline;border-radius:0.25rem;padding:0.03125rem 0.25rem;background-color:rgb(var(--contrast-600))}pre>code{display:block;margin:0.5rem 0;padding:0.5rem 0.75rem}h1{font-size:1.5rem}h2{font-size:1.25rem}h3{font-size:1.125rem}h4{font-size:1rem}h5{font-size:var(--limel-theme-default-font-size)}h6{font-size:0.75rem}h1,h2{margin-top:0.5rem;margin-bottom:0.5rem;letter-spacing:-0.03125rem;font-weight:500}h3,h4{margin-top:0.75rem;margin-bottom:0.25rem;font-weight:600}h5,h6{margin-top:0.5rem;margin-bottom:0.125rem;font-weight:600}h1,h2,h3,h4,h5,h6{word-break:break-word;hyphens:auto;-webkit-hyphens:auto}h1 code,h2 code,h3 code,h4 code,h5 code,h6 code{font-size:inherit}:not([contenteditable=true]) h1,:not([contenteditable=true]) h2,:not([contenteditable=true]) h3,:not([contenteditable=true]) h4,:not([contenteditable=true]) h5,:not([contenteditable=true]) h6{text-wrap:balance}[contenteditable=true] h1,[contenteditable=true] h2,[contenteditable=true] h3,[contenteditable=true] h4,[contenteditable=true] h5,[contenteditable=true] h6{text-wrap:initial}:host(limel-markdown.truncate-paragraphs) p{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}p,li{font-size:var(--limel-theme-default-font-size);word-break:break-word}a{word-break:break-all}p{margin-top:0;margin-bottom:0.5rem}p:last-child{margin-bottom:0}a{transition:color 0.2s ease;color:var(--markdown-hyperlink-color, rgb(var(--color-blue-dark)));text-decoration:none}a:hover{color:var(--markdown-hyperlink-color--hovered, rgb(var(--color-blue-default)))}hr{margin:1.75rem 0 2rem 0;border-width:0;border-top:1px solid rgb(var(--contrast-500))}ul{list-style:none}ul>li{margin-left:0.75rem}ul>li:before{content:"";position:absolute;left:-0.5rem;top:0.5rem;width:0.25rem;height:0.25rem;border-radius:50%;background-color:rgb(var(--contrast-700));display:block}ol{margin-top:0.25rem;padding-left:1rem}ul{margin-top:0.25rem;padding-left:0}ul ul,ul ol,ol ol,ol ul{margin-left:0}li{position:relative;margin-bottom:0.25rem}:host(limel-markdown:not(.no-table-styles)) table{table-layout:auto;min-width:100%;border-collapse:collapse;border-spacing:0;background:transparent;margin:0.75rem 0}:host(limel-markdown:not(.no-table-styles)) tbody{border:1px solid rgb(var(--contrast-400));border-radius:0.25rem}:host(limel-markdown:not(.no-table-styles)) th,:host(limel-markdown:not(.no-table-styles)) td{text-align:left;vertical-align:top;transition:background-color 0.2s ease;font-size:var(--limel-theme-default-font-size)}:host(limel-markdown:not(.no-table-styles)) th p,:host(limel-markdown:not(.no-table-styles)) th li,:host(limel-markdown:not(.no-table-styles)) th a,:host(limel-markdown:not(.no-table-styles)) td p,:host(limel-markdown:not(.no-table-styles)) td li,:host(limel-markdown:not(.no-table-styles)) td a{word-break:normal;overflow-wrap:normal}:host(limel-markdown:not(.no-table-styles)) td{padding:0.5rem 0.375rem 0.75rem 0.375rem}:host(limel-markdown:not(.no-table-styles)) tr th{background-color:rgb(var(--contrast-400));padding:0.25rem 0.375rem;font-weight:normal}:host(limel-markdown:not(.no-table-styles)) tr th:only-child{text-align:center}:host(limel-markdown:not(.no-table-styles)) tbody tr:nth-child(odd) td{background-color:rgb(var(--contrast-200))}:host(limel-markdown:not(.no-table-styles)) tbody tr:hover td{background-color:rgb(var(--contrast-300))}table{display:block;box-sizing:border-box;overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%}blockquote{position:relative;max-width:100%;margin:0.75rem 0;padding:0.5rem;border-left:0.25rem solid rgb(var(--contrast-500));background-color:rgb(var(--contrast-200))}blockquote:before,blockquote:after{position:absolute;line-height:0;font-size:2rem;opacity:0.4}blockquote:before{content:"“";left:-0.5rem;top:0.5rem}blockquote:after{content:"”";right:-0.25rem;bottom:-0.25rem}blockquote blockquote{padding-top:0;padding-right:0;padding-bottom:0;padding-left:0.25rem;border-color:rgb(var(--contrast-700));border-left-width:1px}blockquote blockquote:before,blockquote blockquote:after{display:none}blockquote:has(>blockquote){padding-left:0.25rem;padding-bottom:0}dl{display:grid;grid-template-columns:1fr 2fr;grid-template-rows:1fr;margin-bottom:2rem;border:1px solid rgb(var(--contrast-400));border-radius:0.375rem;background-color:rgb(var(--contrast-200))}dl dt,dl dd{padding:0.375rem 0.5rem;font-size:var(--limel-theme-default-font-size);margin:0}dl dt:nth-of-type(even),dl dd:nth-of-type(even){background-color:rgb(var(--contrast-300))}dl dt:first-child{border-top-left-radius:0.375rem}dl dt:last-child{border-bottom-left-radius:0.375rem}dl dd:first-child{border-top-right-radius:0.375rem}dl dd:last-child{border-bottom-right-radius:0.375rem}img{max-width:100%;border-radius:0.25rem}kbd{display:inline-block;font-family:ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;font-weight:600;color:rgb(var(--contrast-1100));white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:normal;border-radius:0.125rem;border-style:solid;border-color:rgb(var(--contrast-500));border-width:0 1px 0.1875rem 1px;padding:0.0625rem 0.375rem;margin:0 0.25rem;background-color:rgb(var(--contrast-200));box-shadow:var(--button-shadow-normal), 0 0.625rem 0.375rem -0.5rem rgb(var(--color-black), 0.02), 0 0.025rem 0.5rem 0 rgb(var(--contrast-100)) inset}:host(limel-markdown.adjust-for-table-cell) img{max-height:1.25rem;vertical-align:middle}:host(limel-markdown.adjust-for-table-cell) p{display:inline}:host(limel-markdown.adjust-for-table-cell) h1,:host(limel-markdown.adjust-for-table-cell) h2,:host(limel-markdown.adjust-for-table-cell) h3,:host(limel-markdown.adjust-for-table-cell) h4,:host(limel-markdown.adjust-for-table-cell) h5,:host(limel-markdown.adjust-for-table-cell) h6{display:inline-block;vertical-align:bottom;font-size:var(--limel-theme-default-font-size);margin:0 0.25rem 0 0;letter-spacing:normal;font-weight:500}:host(limel-markdown.adjust-for-table-cell) h1:before,:host(limel-markdown.adjust-for-table-cell) h2:before,:host(limel-markdown.adjust-for-table-cell) h3:before,:host(limel-markdown.adjust-for-table-cell) h4:before,:host(limel-markdown.adjust-for-table-cell) h5:before,:host(limel-markdown.adjust-for-table-cell) h6:before{opacity:0.6;vertical-align:middle;font-size:0.5rem;border-radius:0.25rem 0 0 0.25rem;padding:0.25rem;padding-right:2rem;margin-right:-1.75rem;background:linear-gradient(to right, rgb(var(--contrast-800), 0.6), rgb(var(--contrast-800), 0))}:host(limel-markdown.adjust-for-table-cell) h1:before{content:"H1"}:host(limel-markdown.adjust-for-table-cell) h2:before{content:"H2"}:host(limel-markdown.adjust-for-table-cell) h3:before{content:"H3"}:host(limel-markdown.adjust-for-table-cell) h4:before{content:"H4"}:host(limel-markdown.adjust-for-table-cell) h5:before{content:"H5"}:host(limel-markdown.adjust-for-table-cell) h6:before{content:"H6"}:host(limel-markdown.adjust-for-table-cell) pre{margin:0}:host(limel-markdown.adjust-for-table-cell) pre>code{padding:0.125rem;margin:0}:host(limel-markdown.adjust-for-table-cell) dl{margin:0}:host(limel-markdown.adjust-for-table-cell) dl dt,:host(limel-markdown.adjust-for-table-cell) dl dd{padding:0.00625rem 0.125rem}*,*::before,*::after{box-sizing:border-box}* :where(:not(img,video,svg,canvas,iframe)),*::before :where(:not(img,video,svg,canvas,iframe)),*::after :where(:not(img,video,svg,canvas,iframe)){min-width:0;min-height:0}hr{border-top:1px solid rgb(var(--contrast-700))}.MsoNormal{margin:0}:host(limel-markdown.reset-img-height) #markdown img{height:auto !important}';export{O as limel_markdown}
@@ -0,0 +1 @@
1
+ import{z as t,w as n,y as e,A as r,i as o,C as i,g as c,v as a,E as s,S as u,h as l,u as f}from"./p-_UXAljNc.js";import{a as d,b as p,h,c as m,f as g,d as b,e as y,i as v,j as k,k as w,p as x,l as C,n as S,t as B,r as A,o as E}from"./p-C0wwdPYT.js";import"./p-B85MJLTf.js";const F={}.hasOwnProperty;function L(t,n){let e,r=-1;if(n.extensions)for(;++r<n.extensions.length;)L(t,n.extensions[r]);for(e in n)if(F.call(n,e))switch(e){case"extensions":break;case"unsafe":case"join":o=t[e],(i=n[e])&&o.push(...i);break;case"handlers":M(t[e],n[e]);break;default:t.options[e]=n[e]}var o,i;return t}function M(t,n){n&&Object.assign(t,n)}function T(t){if(60!==t.charCodeAt(0))return;const n=t.charCodeAt(1);if(33===n){const n=t.charCodeAt(2);return 45===n?2:91===n?5:d(n)?4:void 0}if(63===n)return 3;const e=47===n,r=e?2:1;let o=r,i=t.charCodeAt(o);if(!d(i))return;for(;45===i||p(i);)i=t.charCodeAt(++o);const c=t.slice(r,o).toLowerCase();return!e&&47!==i&&h.includes(c)?1:m.includes(c)?6:7}const j=[function(t,n,e,r){if("code"===n.type&&g(n,r)&&("list"===t.type||t.type===n.type&&g(t,r)))return!1;if("spread"in e&&"boolean"==typeof e.spread){if("paragraph"===t.type&&(t.type===n.type||"definition"===n.type||"heading"===n.type&&b(n,r)))return;if("html"===t.type){const n=T(t.value);if(void 0===n||6===n||7===n)return 1}if("paragraph"===t.type&&"html"===n.type){const t=T(n.value);if(void 0===t||7===t)return 1}return e.spread?1:0}}],z=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],I=[{character:"\t",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"\t",before:"[\\r\\n]",inConstruct:"phrasing"},{character:"\t",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:"\n",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:"\r",before:"[\\r\\n]",inConstruct:"phrasing"},{character:"\r",after:"\\r",inConstruct:"phrasing"},{character:"\n",before:"\\n",inConstruct:"phrasing"},{character:"\n",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:z},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:"(?:[\r\n]|$)"},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:z},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:"(?:[ \t\r\n*])"},{character:"*",inConstruct:"phrasing",notInConstruct:z},{atBreak:!0,character:"+",after:"(?:[ \t\r\n])"},{atBreak:!0,character:"-",after:"(?:[ \t\r\n-])"},{atBreak:!0,before:"\\d+",character:".",after:"(?:[ \t\r\n]|$)"},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:z},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:z},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:z},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:z},{atBreak:!0,character:"~"},{character:"<",inConstruct:"autolink"},{character:">",inConstruct:"autolink"},{character:"",inConstruct:"autolink"}];let N=-1;for(;++N<33;)I.push({character:String.fromCharCode(N),inConstruct:"autolink"});function R(t){return t.label||!t.identifier?t.label||"":y(t.identifier)}function q(t){if(!t._compiled){const n=(t.atBreak?"[\\r\\n][\\t ]*":"")+(t.before?"(?:"+t.before+")":"");t._compiled=new RegExp((t.beforeNode?"^":n?"("+n+")":"")+(/[$()*+.?[\\\]^{|}]/.test(t.character)?"\\":"")+t.character+(t.afterNode?"$":t.after?"(?:"+t.after+")":""),t.unicode?"gu":"g")}return t._compiled}function _(t){const n=t.codePointAt(0);return void 0===n?"":String.fromCodePoint(n)}function G(t){const n=t.codePointAt(t.length-2);return t.slice(void 0!==n&&n>65535?-2:-1)}function $(t,n,e){const r=v(t),o=v(n);return void 0===r?void 0===o?"_"===e?{inside:!0,outside:!0}:{inside:!1,outside:!1}:1===o?{inside:!0,outside:!0}:{inside:!1,outside:!0}:1===r?void 0===o?{inside:!1,outside:!1}:1===o?{inside:!0,outside:!0}:{inside:!1,outside:!1}:void 0===o?{inside:!1,outside:!1}:1===o?{inside:!0,outside:!1}:{inside:!1,outside:!1}}const U=new Map([["*",!1],["_",!0]]);function P(t,n,e){const r=new Set;for(const o of t){const t=e.get(o);if(t&&o.attention&&n.some((t=>t.attention===o.attention)))for(const n of t.tokens)r.add(n.attention)}const o=[];for(const n of t)n.attention&&r.delete(n.attention)&&o.push(n.attention);return o.reverse(),o}function Z(t,n,e){const r=[],o=new Map,i=new Map;let c=0;for(;c<t.length;){if(!t[c].attention){c++;continue}const a=t[c].value.charAt(0),s=U.get(a);let u=c+1;for(;u<t.length&&t[u].attention&&t[u].value.charAt(0)===a;)u++;const l=c?t[c-1].value:n,f=v(l.charCodeAt(l.length-1)),d=v((u<t.length?t[u].value:e).charCodeAt(0)),p=!d||2===d&&Boolean(f),h=!f||2===f&&Boolean(d),m={tokens:t.slice(c,u),markers:[],start:0,end:0,open:s?p&&(Boolean(f)||!h):p,close:s?h&&(Boolean(d)||!p):h,split:void 0!==s};for(const t of m.tokens){o.set(t,[...m.tokens]),i.set(t,m);let n=t.value.length;for(;n--;)m.markers.push(t)}m.end=m.markers.length,r.push(m),c=u}for(function(t,n){let e=0;for(;e<t.length;){const r=t[e],o=r.tokens[0].value.charAt(0),i=r.end-r.start;let c=r.close&&i?e:0;for(;c--;){const e=t[c],a=e.end-e.start;if(e.tokens[0].value.charAt(0)===o&&e.open&&a&&(r.split?!((e.close||r.open)&&i%3)||(a+i)%3:a===e.markers.length&&a===i)){const t=r.split?a>1&&i>1?2:1:i,o=e.markers.slice(e.end-t,e.end),c=r.markers.slice(r.start,r.start+t),s=o[0],u=c[0];if(s===o[t-1]&&s.value.length===t&&u===c[t-1]&&u.value.length===t&&s.attention===u.attention)n.delete(s),n.delete(u);else{const t=[...new Set([...o,...c])];for(const e of t){const r=n.get(e);r&&r.push(...t)}}e.end-=t,r.start+=t;break}}-1!==c&&r.start!==r.end||e++}}(r,o),c=-1;++c<t.length;){const n=o.get(t[c]);if(n)return{attention:P(t,n,i),index:c}}}function O(t,n,e){return Y(J(t,n,e),e.before,e.after)}function Q(t,n){const e=t[n?0:t.length-1];if(!e||e.attention)return;const r=n?_(e.value):G(e.value),o=w(r.codePointAt(0));e.value=n?o+e.value.slice(r.length):e.value.slice(0,e.value.length-r.length)+o}function D(t,n,e,r,o){for(const i of e.attention){const c=n.get(i)||i.sequences[0];for(const a of i.sequences){if(a===c)continue;const s=new Map(n);s.set(i,a);const u=X(t,s,r,o),l=Z(u,r,o);if(!l||l.index>e.index)return{chosen:s,mistake:l,tokens:u}}}}function H(t,n,e){if(0===n.length)throw new Error("Cannot serialize `"+t+"` as attention without markers, expected one or more markers");if(0===e.length)throw new Error("Cannot serialize `"+t+"` as attention without sizes, expected one or more sizes");for(const n of e)if(!Number.isSafeInteger(n)||n<1)throw new Error("Cannot serialize `"+t+"` as attention with `"+n+"` as size, expected positive integer");const r=[];for(const o of n){if(1!==o.length)throw new Error("Cannot serialize `"+t+"` as attention with `"+o+"` as marker, expected a single ascii character");if(!k(o.charCodeAt(0)))throw new Error("Cannot serialize `"+t+"` as attention with `"+o+"` as marker, expected ascii punctuation");for(const t of e)r.push(o.repeat(t))}return r}function J(t,n,e){const r=n.indexStack,o=t.children||[],i=[];let c=-1,a=e.before;r.push(-1);let s=n.createTracker(e);for(;++c<o.length;){const u=o[c];let l;if(r[r.length-1]=c,c+1<o.length){let e=n.handle.handlers[o[c+1].type];e&&e.peek&&(e=e.peek),l=e?_(e(o[c+1],t,n,{before:"",after:"",...s.current()})):""}else l=e.after;const f=i[i.length-1];"string"!=typeof f||"\r"!==a&&"\n"!==a||"html"!==u.type||7===T(u.value)||(i[i.length-1]=f.replace(/(\r?\n|\r)$/," "),a=" ",s=n.createTracker(e),s.move(Y(i,e.before,e.after)));const d=n.handle.handlers[u.type];if(d&&d.attention){const{construct:t,markers:e,sizes:r}=d.attention(u,n),o=H(u.type,e,r),c=o[0],l=n.enter(t);s.move(c);const f=J(u,n,{...s.current(),before:c,after:c});s.move(Y(f,c,c)),s.move(c),l(),i.push({children:f,sequences:o}),a=c.charAt(c.length-1)}else{const e=n.handle(u,t,n,{...s.current(),after:l,before:a});if(!e)continue;s.move(e),i.push(e),a=G(e)}}return r.pop(),i}function X(t,n,e,r){const o=[];let i,c=G(e),a=-1;for(;++a<t.length;){const e=t[a];if("string"==typeof e){const t={value:e,attention:void 0};i&&i===_(e)&&Q([t],!0),i=void 0,o.push(t),t.value&&(c=G(t.value));continue}const s=n.get(e)||e.sequences[0],u=s.charAt(0),l=t[a+1],f=c,d=_(void 0===l?r:"string"==typeof l?l:n.get(l)||l.sequences[0]),p=X(e.children,n,s,s),h=p.length>0?p[0].value:"",m=$(f.charCodeAt(f.length-1),h.charCodeAt(0),u);m.inside&&Q(p,!0);const g=p.length>0?G(p[p.length-1].value):"",b=$(d.charCodeAt(0),g.charCodeAt(g.length-1),u);b.inside&&Q(p,!1),m.outside&&"\n"!==f&&"\r"!==f&&Q(o,!1),b.outside&&(i=d),o.push({value:s,attention:e},...p,{value:s,attention:e}),c=s.charAt(s.length-1)}return o}function Y(t,n,e){let r=new Map;const o=X(t,r,n,e);let i=o,c=Z(i,n,e);for(;c;){const a=D(t,r,c,n,e);if(!a){i=o;break}r=a.chosen,i=a.tokens,c=a.mistake}let a="";for(const t of i)a+=t.value;return a}function K(t,n,e,r){let o=r.join.length;for(;o--;){const i=r.join[o](t,n,e,r);if(!0===i||1===i)break;if("number"==typeof i)return"\n".repeat(1+i);if(!1===i)return"\n\n\x3c!----\x3e\n\n"}return"\n\n"}const V=/\r?\n|\r/g;function W(t,n){const e=[];let r,o=0,i=0;for(;r=V.exec(t);)c(t.slice(o,r.index)),e.push(r[0]),o=r.index+r[0].length,i++;return c(t.slice(o)),e.join("");function c(t){e.push(n(t,i,!t))}}const tt={}.hasOwnProperty;function nt(t,n){return!t||!!n&&("string"==typeof t?t===n.type:t.includes(n.type))}function et(t,n){return t-n}function rt(t,n){const e=/\\(?=[!-/:-@[-`{-~])/g,r=[],o=[],i=t+n;let c,a=-1,s=0;for(;c=e.exec(i);)r.push(c.index);for(;++a<r.length;)s!==r[a]&&o.push(t.slice(s,r[a])),o.push("\\"),s=r[a];return o.push(t.slice(s)),o.join("")}function ot(t){const n=t||{},e=n.now||{};let r=n.lineShift||0,o=e.line||1,i=e.column||1;return{move:function(t){const n=t||"",e=n.split(/\r?\n|\r/g),c=e[e.length-1];return o+=e.length-1,i=1===e.length?i+c.length:1+c.length+r,n},current:function(){return{now:{line:o,column:i},lineShift:r}},shift:function(t){r+=t}}}function it(n,e){const r=e||{},o={associationId:R,bulletCurrent:void 0,bulletLastUsed:void 0,containerPhrasing:ut,containerFlow:lt,createTracker:ot,compilePattern:q,enter:function(t){return o.stack.push(t),function(){o.stack.pop()}},handlers:{...C},handle:void 0,indentLines:W,indexStack:[],join:[...j],options:{},safe:ft,stack:[],unsafe:[...I]};L(o,r),o.options.tightDefinitions&&o.join.push(st),o.handle=t("type",{invalid:ct,unknown:at,handlers:o.handlers});let i=o.handle(S(n)?{type:"root",children:[n]}:n,void 0,o,{before:"\n",after:"\n",now:{line:1,column:1},lineShift:0});return i&&10!==i.charCodeAt(i.length-1)&&13!==i.charCodeAt(i.length-1)&&(i+="\n"),i}function ct(t){throw new Error("Cannot handle value `"+t+"`, expected node")}function at(t){throw new Error("Cannot handle unknown node `"+t.type+"`")}function st(t,n){if("definition"===t.type&&t.type===n.type)return 0}function ut(t,n){return O(t,this,n)}function lt(t,n){return function(t,n,e){const r=n.indexStack,o=t.children||[],i=n.createTracker(e),c=[];let a=-1;for(r.push(-1);++a<o.length;){const e=o[a];r[r.length-1]=a,c.push(i.move(n.handle(e,t,n,{before:"\n",after:"\n",...i.current()}))),"list"!==e.type&&(n.bulletLastUsed=void 0),a<o.length-1&&c.push(i.move(K(e,o[a+1],t,n)))}return r.pop(),c.join("")}(t,this,n)}function ft(t,n){return function(t,n,e){const r=(e.before||"")+(n||"")+(e.after||""),o=[],i=[],c={},a=t.stack.includes("autolink"),s=e.before?e.before.length:0,u=r.length-(e.after?e.after.length:0);let l=-1;for(;++l<t.unsafe.length;){const n=t.unsafe[l];if(!x(t.stack,n)||!nt(n.beforeNode,e.beforeNode)||!nt(n.afterNode,e.afterNode))continue;const i=t.compilePattern(n),a=n.beforeNode?s:0,f=r.slice(a,n.afterNode?u:void 0);let d;for(;d=i.exec(f);){const t="before"in n||Boolean(n.atBreak),e="after"in n,r=a+d.index+(t?d[1].length:0);tt.call(c,r)?(c[r].before&&!t&&(c[r].before=!1),c[r].after&&!e&&(c[r].after=!1)):(o.push(r),c[r]={before:t,after:e})}}o.sort(et);let f=s;for(l=-1;++l<o.length;){const t=o[l];if(!(t<f||t>=u)){if("_"===r.charAt(t)&&t>0&&void 0===v(r.charCodeAt(t-1))&&!tt.call(c,t-1)&&(t-1!==s||!/[*_]/.test(r.charAt(s-1)))){let n=t+1;for(;n<u&&"_"===r.charAt(n);)n++;const e=n-t-1;if(o[l+e]===n-1&&n<r.length&&void 0===v(r.charCodeAt(n))&&!tt.call(c,n)&&(n!==u-1||!/[*_]/.test(r.charAt(u)))){l+=e;continue}}if(!(t+1<u&&o[l+1]===t+1&&c[t].after&&!c[t+1].before&&!c[t+1].after||o[l-1]===t-1&&c[t].before&&!c[t-1].before&&!c[t-1].after)){if(f!==t){const n=r.slice(f,t);i.push(a?n:rt(n,"\\"))}f=t,a?(i.push("%"+r.charCodeAt(t).toString(16).toUpperCase().padStart(2,"0")),f++):!/[!-/:-@[-`{-~]/.test(r.charAt(t))||e.encode&&e.encode.includes(r.charAt(t))?(i.push(w(r.charCodeAt(t))),f++):i.push("\\")}}}const d=r.slice(f,u);return i.push(a?d:rt(d,e.after)),i.join("")}(this,t,n)}function dt(t,o){const i=function(t,o){switch(t.nodeType){case 1:return function(t,o){const i=t.namespaceURI,c=i===n.svg?e:r,a=i===n.html?t.tagName.toLowerCase():t.tagName,s=i===n.html&&"template"===a?t.content:t,u=t.getAttributeNames(),l={};let f=-1;for(;++f<u.length;)l[u[f]]=t.getAttribute(u[f])||"";return c(a,l,ht(s,o))}(t,o);case 3:return function(t){return{type:"text",value:t.nodeValue||""}}(t);case 8:return function(t){return{type:"comment",value:t.nodeValue||""}}(t);case 9:case 11:return pt(t,o);case 10:return{type:"doctype"};default:return}}(t,o);return i&&o.afterTransform&&o.afterTransform(t,i),i}function pt(t,n){return{type:"root",children:ht(t,n)}}function ht(t,n){const e=t.childNodes,r=[];let o=-1;for(;++o<e.length;){const t=dt(e[o],n);void 0!==t&&r.push(t)}return r}const mt=function(t,n,e,r,o){const i=gt(n);return!!vt(t)&&i.call(o,t,e,r)},gt=function(t){if(null==t)return yt;if("string"==typeof t)return function(t){return bt((function(n){return n.tagName===t}))}(t);if("object"==typeof t)return function(t){const n=[];let e=-1;for(;++e<t.length;)n[e]=gt(t[e]);return bt((function(...t){let e=-1;for(;++e<n.length;)if(n[e].apply(this,t))return!0;return!1}))}(t);if("function"==typeof t)return bt(t);throw new Error("Expected function, string, or array as `test`")};function bt(t){return function(n,e,r){return Boolean(vt(n)&&t.call(this,n,"number"==typeof e?e:void 0,r||void 0))}}function yt(t){return Boolean(t&&"object"==typeof t&&"type"in t&&"element"===t.type&&"tagName"in t&&"string"==typeof t.tagName)}function vt(t){return null!==t&&"object"==typeof t&&"type"in t&&"tagName"in t}const kt=gt((function(t){return"audio"===t.tagName||"canvas"===t.tagName||"embed"===t.tagName||"iframe"===t.tagName||"img"===t.tagName||"math"===t.tagName||"object"===t.tagName||"picture"===t.tagName||"svg"===t.tagName||"video"===t.tagName})),wt=["address","article","aside","blockquote","body","br","caption","center","col","colgroup","dd","dialog","dir","div","dl","dt","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","legend","li","li","listing","main","menu","nav","ol","optgroup","option","p","plaintext","pre","section","summary","table","tbody","td","td","tfoot","th","th","thead","tr","ul","wbr","xmp"],xt=["button","input","select","textarea"],Ct=["area","base","basefont","dialog","datalist","head","link","meta","noembed","noframes","param","rp","script","source","style","template","track","title"],St={},Bt=o(["comment","doctype"]);function At(t,n){if("children"in t){const e={...n};return("root"===t.type||Mt(t))&&(e.before=!0,e.after=!0),e.whitespace=function(t,n){if("tagName"in t&&t.properties)switch(t.tagName){case"listing":case"plaintext":case"script":case"style":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return t.properties.wrap?"pre-wrap":"pre";case"td":case"th":return t.properties.noWrap?"nowrap":n.whitespace;case"textarea":return"pre-wrap"}return n.whitespace}(t,n),function(t,n){let e=n.before;const r=n.after,o=t.children;let i=o.length,c=-1;for(;++c<i;){const t=At(o[c],{...n,after:Et(o,c,r),before:e});t.remove?(o.splice(c,1),c--,i--):t.ignore||(e=t.stripAtStart),Lt(o[c])&&(e=!1)}return{ignore:!1,stripAtStart:Boolean(e||r),remove:!1}}(t,e)}if("text"===t.type){if("normal"===n.whitespace)return function(t,n){const e=n.collapse(t.value),r={ignore:!1,stripAtStart:!1,remove:!1};let o=0,i=e.length;return n.before&&jt(e.charAt(0))&&o++,o!==i&&jt(e.charAt(i-1))&&(n.after?i--:r.stripAtStart=!0),o===i?r.remove=!0:t.value=e.slice(o,i),r}(t,n);"nowrap"===n.whitespace&&(t.value=n.collapse(t.value))}return{ignore:Bt(t),stripAtStart:!1,remove:!1}}function Et(t,n,e){for(;++n<t.length;){const e=t[n];let r=Ft(e);if(void 0===r&&"children"in e&&!Tt(e)&&(r=Et(e.children,-1)),"boolean"==typeof r)return r}return e}function Ft(t){if("element"===t.type){if(Lt(t))return!1;if(Mt(t))return!0}else if("text"===t.type){if(!i(t))return!1}else if(!Bt(t))return!1}function Lt(t){return kt(t)||mt(t,xt)}function Mt(t){return mt(t,wt)}function Tt(t){return Boolean("element"===t.type&&t.properties.hidden)||Bt(t)||mt(t,Ct)}function jt(t){return" "===t||"\n"===t}function zt(t){const n=/\r?\n|\r/.exec(t);return n?n[0]:" "}function It(){return" "}function Nt(t){return function(n){!function(t,n){var e;At(t,{collapse:(e=(n||St).newlines?zt:It,function(t){return String(t).replace(/[\t\n\v\f\r ]+/g,e)}),whitespace:"normal"})}(n,t)}}const Rt=function(t,n,e){const r=o(e);if(!t||!t.type||!t.children)throw new Error("Expected parent node");if("number"==typeof n){if(n<0||n===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if((n=t.children.indexOf(n))<0)throw new Error("Expected child node or index");for(;++n<t.children.length;)if(r(t.children[n],n,t))return t.children[n]},qt=/\n/g,_t=/[\t ]+/g,Gt=gt("br"),$t=gt((function(t){return"td"===t.tagName||"th"===t.tagName})),Ut=gt("p"),Pt=gt("tr"),Zt=gt(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",function(t){return Boolean((t.properties||{}).hidden)},function(t){return"dialog"===t.tagName&&!(t.properties||{}).open}]),Ot=gt(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function Qt(t){const n="children"in t?t.children:[],e=Ot(t),r=Xt(t,{whitespace:{}.whitespace||"normal"}),o=[];"text"!==t.type&&"comment"!==t.type||o.push(...Ht(t,{breakBefore:!0,breakAfter:!0}));let i=-1;for(;++i<n.length;)o.push(...Dt(n[i],t,{whitespace:r,breakBefore:i?void 0:e,breakAfter:i<n.length-1?Gt(n[i+1]):e}));const c=[];let a;for(i=-1;++i<o.length;){const t=o[i];"number"==typeof t?void 0!==a&&t>a&&(a=t):t&&(void 0!==a&&a>-1&&c.push("\n".repeat(a)||" "),a=-1,c.push(t))}return c.join("")}function Dt(t,n,e){return"element"===t.type?function(t,n,e){const r=Xt(t,e),o=t.children||[];let i,c,a=-1,s=[];if(Zt(t))return s;for(Gt(t)||Pt(t)&&Rt(n,t,Pt)?c="\n":Ut(t)?(i=2,c=2):Ot(t)&&(i=1,c=1);++a<o.length;)s=s.concat(Dt(o[a],t,{whitespace:r,breakBefore:a?void 0:i,breakAfter:a<o.length-1?Gt(o[a+1]):c}));return $t(t)&&Rt(n,t,$t)&&s.push("\t"),i&&s.unshift(i),c&&s.push(c),s}(t,n,e):"text"===t.type?"normal"===e.whitespace?Ht(t,e):function(t){return[String(t.value)]}(t):[]}function Ht(t,n){const e=String(t.value),r=[],o=[];let i=0;for(;i<=e.length;){qt.lastIndex=i;const t=qt.exec(e),o=t&&"index"in t?t.index:e.length;r.push(Jt(e.slice(i,o).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),0!==i||n.breakBefore,o!==e.length||n.breakAfter)),i=o+1}let c,a=-1;for(;++a<r.length;)8203===r[a].charCodeAt(r[a].length-1)||a<r.length-1&&8203===r[a+1].charCodeAt(0)?(o.push(r[a]),c=void 0):r[a]?("number"==typeof c&&o.push(c),o.push(r[a]),c=0):0!==a&&a!==r.length-1||o.push(0);return o}function Jt(t,n,e){const r=[];let o,i=0;for(;i<t.length;){_t.lastIndex=i;const e=_t.exec(t);o=e?e.index:t.length,i||o||!e||n||r.push(""),i!==o&&r.push(t.slice(i,o)),i=e?o+e[0].length:o}return i===o||e||r.push(""),r.join(" ")}function Xt(t,n){if("element"===t.type){const e=t.properties||{};switch(t.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return e.wrap?"pre-wrap":"pre";case"td":case"th":return e.noWrap?"nowrap":n.whitespace;case"textarea":return"pre-wrap"}}return n.whitespace}function Yt(t){const n=String(t);let e=n.length;for(;e>0;){const t=n.codePointAt(e-1);if(void 0===t||10!==t&&13!==t)break;e--}return n.slice(0,e)}function Kt(t,n){const e=n.children;let r,o,i=-1;if("pre"===n.tagName)for(;++i<e.length;){const t=e[i];if("element"===t.type&&"code"===t.tagName&&t.properties&&t.properties.className&&Array.isArray(t.properties.className)){r=t.properties.className;break}}if(r)for(i=-1;++i<r.length;)if("language-"===String(r[i]).slice(0,9)){o=String(r[i]).slice(9);break}const c={type:"code",lang:o||null,meta:null,value:Yt(Qt(n))};return t.patch(n,c),c}function Vt(t,n){const e={type:"delete",children:t.all(n)};return t.patch(n,e),e}function Wt(t){let n=-1;if(t.length>1)for(;++n<t.length;)if(t[n].spread)return!0;return!1}function tn(t,n){const e=t.all({type:"root",children:n}),r=t.toSpecificContent(e,nn);return 0===r.length?[]:1===r.length?r[0].children:[{type:"list",ordered:!1,start:null,spread:Wt(r),children:r}]}function nn(){return{type:"listItem",spread:!1,checked:null,children:[]}}function en(t,n){const e={type:"emphasis",children:t.all(n)};return t.patch(n,e),e}function rn(t){let n=0,e=t.length;for(;n<e&&"break"===t[n].type;)n++;for(;e>n&&"break"===t[e-1].type;)e--;return 0===n&&e===t.length?t:t.slice(n,e)}function on(t,n){const e={type:"heading",depth:Number(n.tagName.charAt(1))||1,children:rn(t.all(n))};return t.patch(n,e),e}function cn(t,n){const e=n.properties||{},r={type:"image",url:t.resolve(String(e.src||"")||null),title:e.title?String(e.title):null,alt:e.alt?String(e.alt):""};return t.patch(n,r),r}function an(t,n){const e={type:"inlineCode",value:Qt(n)};return t.patch(n,e),e}function sn(t,n){const e=[],r=[],o=n||t.properties||{},i=un(t),c=Math.min(Number.parseInt(String(o.size),10),0)||(o.multiple?4:1);let a=-1;for(;++a<i.length;){const t=i[a];t&&t.properties&&t.properties.selected&&e.push(t)}const s=e.length>0?e:i,u=Math.min(s.length,c);for(a=-1;++a<u;){const t=s[a],n=t.properties||{},e=Qt(t),o=e||String(n.label||""),i=String(n.value||"")||e;r.push([i,o===i?void 0:o])}return r}function un(t){const n=[];let e=-1;for(;++e<t.children.length;){const r=t.children[e];"children"in r&&Array.isArray(r.children)&&n.push(...un(r)),"element"!==r.type||"option"!==r.tagName||r.properties&&r.properties.disabled||n.push(r)}return n}const ln={}.hasOwnProperty,fn=new Set(["pingback","prefetch","stylesheet"]),dn=gt(["a","abbr","area","b","bdi","bdo","br","button","cite","code","data","datalist","del","dfn","em","i","input","ins","kbd","keygen","label","map","mark","meter","noscript","output","progress","q","ruby","s","samp","script","select","small","span","strong","sub","sup","template","textarea","time","u","var","wbr"]),pn=gt("meta");function hn(t){return Boolean("text"===t.type||dn(t)||kt(t)||function(t){if("element"!==t.type||"link"!==t.tagName)return!1;if(t.properties.itemProp)return!0;const n=t.properties.rel;let e=-1;if(!Array.isArray(n)||0===n.length)return!1;for(;++e<n.length;)if(!fn.has(String(n[e])))return!1;return!0}(t)||pn(t)&&function(t,n){const e="element"===t.type&&ln.call(t.properties,n)&&t.properties[n];return null!=e&&!1!==e}(t,"itemProp"))}function mn(t,n){const{rest:e,checkbox:r}=bn(n),o=r?Boolean(r.properties.checked):null,i={type:"listItem",spread:gn(e),checked:o,children:t.toFlow(t.all(e))};return t.patch(n,i),i}function gn(t){let n=-1,e=!1;for(;++n<t.children.length;){const r=t.children[n];if("element"===r.type){if(hn(r))continue;if("p"===r.tagName||e||gn(r))return!0;e=!0}}return!1}function bn(t){const n=t.children[0];if(n&&"element"===n.type&&"input"===n.tagName&&n.properties&&("checkbox"===n.properties.type||"radio"===n.properties.type))return{checkbox:n,rest:{...t,children:t.children.slice(1)}};if(n&&"element"===n.type&&"p"===n.tagName){const{checkbox:e,rest:r}=bn(n);if(e)return{checkbox:e,rest:{...t,children:[r,...t.children.slice(1)]}}}return{checkbox:void 0,rest:t}}function yn(t,n){const e="ol"===n.tagName,r=t.toSpecificContent(t.all(n),vn);let o=null;e&&(o=n.properties&&n.properties.start?Number.parseInt(String(n.properties.start),10):1);const i={type:"list",ordered:e,start:o,spread:Wt(r),children:r};return t.patch(n,i),i}function vn(){return{type:"listItem",spread:!1,checked:null,children:[]}}function kn(t){let n=-1;for(;++n<t.length;){const e=t[n];if(!Sn(e)||"children"in e&&kn(e.children))return!0}return!1}function wn(t){return Cn(t,(function(t){return t.every((function(t){return"text"===t.type&&i(t.value)}))?[]:[{type:"paragraph",children:rn(t)}]}),(function(t){return t}))}function xn(t){return Cn(t.children,(function(n){const e=Bn(t);return e.children=n,[e]}),(function(n){if("children"in n&&"children"in t){const e=Bn(t),r=Bn(n);return e.children=n.children,r.children.push(e),r}return{...n}}))}function Cn(t,n,e){const r=function(t){const n=[];let e=-1;for(;++e<t.length;){const r=t[e];"delete"!==r.type&&"link"!==r.type||!kn(r.children)?n.push(r):n.push(...xn(r))}return n}(t),o=[];let i=[],c=-1;for(;++c<r.length;){const t=r[c];Sn(t)?i.push(t):(i.length>0&&(o.push(...n(i)),i=[]),o.push(e(t)))}return i.length>0&&(o.push(...n(i)),i=[]),o}function Sn(t){const n=t.data&&t.data.hName;return n?hn({type:"element",tagName:n,properties:{},children:[]}):S(t)}function Bn(t){return c({...t,children:[]})}function An(t,n){const e=n.properties||{},r="video"===n.tagName?String(e.poster||""):"";let o=String(e.src||""),i=-1,c=!1,u=t.all(n);if(a({type:"root",children:u},(function(t){if("link"===t.type)return c=!0,s})),c||kn(u))return u;for(;!o&&++i<n.children.length;){const t=n.children[i];"element"===t.type&&"source"===t.tagName&&t.properties&&(o=String(t.properties.src||""))}if(r){const e={type:"image",title:null,url:t.resolve(r),alt:B(u)};t.patch(n,e),u=[e]}const l=u,f={type:"link",title:e.title?String(e.title):null,url:t.resolve(o),children:l};return t.patch(n,f),f}function En(t,n){const e=rn(t.all(n));if(e.length>0){const r={type:"paragraph",children:e};return t.patch(n,r),r}}const Fn=['"'];function Ln(t,n){const e={type:"strong",children:t.all(n)};return t.patch(n,e),e}function Mn(t,n){const e={type:"tableCell",children:t.all(n)};if(t.patch(n,e),n.properties){const t=n.properties.rowSpan,r=n.properties.colSpan;if(t||r){const n=e.data||(e.data={});t&&(n.hastUtilToMdastTemporaryRowSpan=t),r&&(n.hastUtilToMdastTemporaryColSpan=r)}}return e}function Tn(){return{type:"tableCell",children:[]}}function jn(){return{type:"tableCell",children:[]}}function zn(){return{type:"tableRow",children:[]}}const In={comment:function(t,n){const e={type:"html",value:"\x3c!--"+n.value+"--\x3e"};return t.patch(n,e),e},doctype:_n,root:function(t,n){let e=t.all(n);(t.options.document||kn(e))&&(e=wn(e));const r={type:"root",children:e};return t.patch(n,r),r},text:function(t,n){const e={type:"text",value:n.value};return t.patch(n,e),e}},Nn={applet:_n,area:_n,basefont:_n,bgsound:_n,caption:_n,col:_n,colgroup:_n,command:_n,content:_n,datalist:_n,dialog:_n,element:_n,embed:_n,frame:_n,frameset:_n,isindex:_n,keygen:_n,link:_n,math:_n,menu:_n,menuitem:_n,meta:_n,nextid:_n,noembed:_n,noframes:_n,optgroup:_n,option:_n,param:_n,script:_n,shadow:_n,source:_n,spacer:_n,style:_n,svg:_n,template:_n,title:_n,track:_n,abbr:Rn,acronym:Rn,bdi:Rn,bdo:Rn,big:Rn,blink:Rn,button:Rn,canvas:Rn,cite:Rn,data:Rn,details:Rn,dfn:Rn,font:Rn,ins:Rn,label:Rn,map:Rn,marquee:Rn,meter:Rn,nobr:Rn,noscript:Rn,object:Rn,output:Rn,progress:Rn,rb:Rn,rbc:Rn,rp:Rn,rt:Rn,rtc:Rn,ruby:Rn,slot:Rn,small:Rn,span:Rn,sup:Rn,sub:Rn,tbody:Rn,tfoot:Rn,thead:Rn,time:Rn,address:qn,article:qn,aside:qn,body:qn,center:qn,div:qn,fieldset:qn,figcaption:qn,figure:qn,form:qn,footer:qn,header:qn,hgroup:qn,html:qn,legend:qn,main:qn,multicol:qn,nav:qn,picture:qn,section:qn,a:function(t,n){const e=n.properties||{},r=t.all(n),o={type:"link",url:t.resolve(String(e.href||"")||null),title:e.title?String(e.title):null,children:r};return t.patch(n,o),o},audio:An,b:Ln,base:function(t,n){t.baseFound||(t.frozenBaseUrl=String(n.properties&&n.properties.href||"")||void 0,t.baseFound=!0)},blockquote:function(t,n){const e={type:"blockquote",children:t.toFlow(t.all(n))};return t.patch(n,e),e},br:function(t,n){const e={type:"break"};return t.patch(n,e),e},code:an,dir:yn,dl:function(t,n){const e=[],r=[];let o=-1;for(;++o<n.children.length;){const t=n.children[o];"element"===t.type&&"div"===t.tagName?e.push(...t.children):e.push(t)}let i={definitions:[],titles:[]};for(o=-1;++o<e.length;){const t=e[o];if("element"===t.type&&"dt"===t.tagName){const n=e[o-1];n&&"element"===n.type&&"dd"===n.tagName&&(r.push(i),i={definitions:[],titles:[]}),i.titles.push(t)}else i.definitions.push(t)}r.push(i),o=-1;const c=[];for(;++o<r.length;){const n=[...tn(t,r[o].titles),...tn(t,r[o].definitions)];n.length>0&&c.push({type:"listItem",spread:n.length>1,checked:null,children:n})}if(c.length>0){const e={type:"list",ordered:!1,start:null,spread:Wt(c),children:c};return t.patch(n,e),e}},dt:mn,dd:mn,del:Vt,em:en,h1:on,h2:on,h3:on,h4:on,h5:on,h6:on,hr:function(t,n){const e={type:"thematicBreak"};return t.patch(n,e),e},i:en,iframe:function(t,n){const e=n.properties||{},r=String(e.src||""),o=String(e.title||"");if(r&&o){const e={type:"link",title:null,url:t.resolve(r),children:[{type:"text",value:o}]};return t.patch(n,e),e}},img:cn,image:cn,input:function(t,n){const e=n.properties||{},r=String(e.value||e.placeholder||"");if(e.disabled||"hidden"===e.type||"file"===e.type)return;if("checkbox"===e.type||"radio"===e.type){const r={type:"text",value:e.checked?t.options.checked||"[x]":t.options.unchecked||"[ ]"};return t.patch(n,r),r}if("image"===e.type){const o=e.alt||r;if(o){const r={type:"image",url:t.resolve(String(e.src||"")||null),title:String(e.title||"")||null,alt:String(o)};return t.patch(n,r),r}return}let o=[];if(r)o=[[r,void 0]];else if("button"!==e.type&&"file"!==e.type&&"password"!==e.type&&"reset"!==e.type&&"submit"!==e.type&&e.list){const n=String(e.list),r=t.elementById.get(n);r&&"datalist"===r.tagName&&(o=sn(r,e))}if(0===o.length)return;if("password"===e.type&&(o[0]=["•".repeat(o[0][0].length),void 0]),"email"===e.type||"url"===e.type){const n=[];let r=-1;for(;++r<o.length;){const i=t.resolve(o[r][0]);n.push({type:"link",title:null,url:"email"===e.type?"mailto:"+i:i,children:[{type:"text",value:o[r][1]||i}]}),r!==o.length-1&&n.push({type:"text",value:", "})}return n}const i=[];let c=-1;for(;++c<o.length;)i.push(o[c][1]?o[c][1]+" ("+o[c][0]+")":o[c][0]);const a={type:"text",value:i.join(", ")};return t.patch(n,a),a},kbd:an,li:mn,listing:Kt,mark:en,ol:yn,p:En,plaintext:Kt,pre:Kt,q:function(t,n){const e=t.options.quotes||Fn;t.qNesting++;const r=t.all(n);t.qNesting--;const o=e[t.qNesting%e.length],i=r[0],c=r[r.length-1],a=o.charAt(0),s=o.length>1?o.charAt(1):o;return i&&"text"===i.type?i.value=a+i.value:r.unshift({type:"text",value:a}),c&&"text"===c.type?c.value+=s:r.push({type:"text",value:s}),r},s:Vt,samp:an,select:function(t,n){const e=sn(n);let r=-1;const o=[];for(;++r<e.length;){const t=e[r];o.push(t[1]?t[1]+" ("+t[0]+")":t[0])}if(o.length>0){const e={type:"text",value:o.join(", ")};return t.patch(n,e),e}},strike:Vt,strong:Ln,summary:En,table:function(t,n){if(t.inTable){const e={type:"text",value:Qt(n)};return t.patch(n,e),e}t.inTable=!0;const{align:e,headless:r}=function(t){const n={align:[null],headless:!0};let e=0,r=0;return a(t,(function(o){if("element"===o.type){if("table"===o.tagName&&t!==o)return u;if("th"!==o.tagName&&"td"!==o.tagName||!o.properties)"thead"===o.tagName?n.headless=!1:"tr"===o.tagName&&(e++,r=0);else{if(!n.align[r]){const t=String(o.properties.align||"")||null;"center"!==t&&"left"!==t&&"right"!==t&&null!==t||(n.align[r]=t)}n.headless&&e<2&&"th"===o.tagName&&(n.headless=!1),r++}}})),n}(n),o=t.toSpecificContent(t.all(n),zn);r&&o.unshift({type:"tableRow",children:[]});let i=-1;for(;++i<o.length;){const n=o[i],e=t.toSpecificContent(n.children,jn);n.children=e}let c=1;for(i=-1;++i<o.length;){const t=o[i].children;let n=-1;for(;++n<t.length;){const e=t[n];if(e.data){const t=e.data,r=Number.parseInt(String(t.hastUtilToMdastTemporaryColSpan),10)||1,c=Number.parseInt(String(t.hastUtilToMdastTemporaryRowSpan),10)||1;if(r>1||c>1){let t=i-1;for(;++t<i+c;){let e=n-1;for(;++e<n+r&&o[t];){const r=[];t===i&&e===n||r.push({type:"tableCell",children:[]}),o[t].children.splice(e,0,...r)}}}"hastUtilToMdastTemporaryColSpan"in e.data&&delete e.data.hastUtilToMdastTemporaryColSpan,"hastUtilToMdastTemporaryRowSpan"in e.data&&delete e.data.hastUtilToMdastTemporaryRowSpan,0===Object.keys(e.data).length&&delete e.data}}t.length>c&&(c=t.length)}for(i=-1;++i<o.length;){const t=o[i].children;let n=t.length-1;for(;++n<c;)t.push({type:"tableCell",children:[]})}let s=e.length-1;for(;++s<c;)e.push(null);t.inTable=!1;const l={type:"table",align:e,children:o};return t.patch(n,l),l},td:Mn,textarea:function(t,n){const e={type:"text",value:Qt(n)};return t.patch(n,e),e},th:Mn,tr:function(t,n){const e={type:"tableRow",children:t.toSpecificContent(t.all(n),Tn)};return t.patch(n,e),e},tt:an,u:en,ul:yn,var:an,video:An,wbr:function(t,n){const e={type:"text",value:"​"};return t.patch(n,e),e},xmp:Kt};function Rn(t,n){return t.all(n)}function qn(t,n){return t.toFlow(t.all(n))}function _n(){}const Gn={}.hasOwnProperty;function $n(t){const n=t.children||[],e=[];let r=-1;for(;++r<n.length;){const o=this.one(n[r],t);Array.isArray(o)?e.push(...o):o&&e.push(o)}return e}function Un(t,n){if("element"===t.type){if(t.properties&&"ignore"===t.properties.dataMdast)return;if(Gn.call(this.handlers,t.tagName))return this.handlers[t.tagName](this,t,n)||void 0}else if(Gn.call(this.nodeHandlers,t.type))return this.nodeHandlers[t.type](this,t,n)||void 0;if("value"in t&&"string"==typeof t.value){const n={type:"text",value:t.value};return this.patch(t,n),n}if("children"in t)return this.all(t)}function Pn(t,n){t.position&&(n.position=l(t))}function Zn(t){const n=this.frozenBaseUrl;return null==t?"":n?String(new URL(t,n)):t}function On(t){return wn(t)}function Qn(t,n){const e=n(),r=[];let o=[],i=-1;for(;++i<t.length;){const n=t[i];c(n)?(o.length>0&&(n.children.unshift(...o),o=[]),r.push(n)):o.push(n)}if(o.length>0){let t=r[r.length-1];t||(t=n(),r.push(t)),t.children.push(...o),o=[]}return r;function c(t){return t.type===e.type}}const Dn={};function Hn(t,n){const e=c(t),r=n||Dn,o=Nt({newlines:!0===r.newlines}),i=function(t){return{all:$n,baseFound:!1,elementById:new Map,frozenBaseUrl:void 0,handlers:{...Nn,...t.handlers},inTable:!1,nodeHandlers:{...In,...t.nodeHandlers},one:Un,options:t,patch:Pn,qNesting:0,resolve:Zn,toFlow:On,toSpecificContent:Qn}}(r);let s;o(e),a(e,(function(t){if(t&&"element"===t.type&&t.properties){const n=String(t.properties.id||"")||void 0;n&&!i.elementById.has(n)&&i.elementById.set(n,t)}}));const u=i.one(e,void 0);return s=u?Array.isArray(u)?{type:"root",children:u}:u:{type:"root",children:[]},a(s,(function(t,n,e){if("text"===t.type&&void 0!==n&&e){const r=e.children[n-1];if(r&&r.type===t.type)return r.value+=t.value,e.children.splice(n,1),r.position&&t.position&&(r.position.end=t.position.end),n-1;if(t.value=t.value.replace(/[\t ]*(\r?\n|\r)[\t ]*/,"$1"),!e||"heading"!==e.type&&"paragraph"!==e.type&&"root"!==e.type||(n||(t.value=t.value.replace(/^[\t ]+/,"")),n===e.children.length-1&&(t.value=t.value.replace(/[\t ]+$/,""))),!t.value)return e.children.splice(n,1),n}})),s}const Jn={document:!0};function Xn(t,n){return t&&"run"in t?async function(e,r){const o=Hn(e,{...Jn,...n});await t.run(o,r)}:function(n){return Hn(n,{...Jn,...t})}}function Yn(t){const n=this;n.compiler=function(e){return it(e,{...n.data("settings"),...t,extensions:n.data("toMarkdownExtensions")||[]})}}async function Kn(t,n){const e=new Set(n.map((t=>t.tagName)).filter(re)),r=new Map,o=function(t,n){return dt(t,n||{})||{type:"root",children:[]}}(t,{afterTransform:(t,n)=>{var o;"element"===n.type&&(function(t){const n=t.properties.dataSrc;"img"===t.tagName&&!t.properties.src&&n&&(t.properties.src=n)}(n),"a"===(o=n).tagName&&void 0!==o.properties.dataFootnoteBackref&&(o.properties.dataMdast="ignore"),t instanceof Element&&e.has(t.localName)&&r.set(n,t))}});await async function(t){await Promise.all([...t].map((async([t,n])=>{try{const e=await n.toMarkdown();t.properties.dataMarkdownDescription=e,t.children=[{type:"text",value:e}]}catch(t){console.error("Failed to describe element as markdown",t)}})))}(r);const i={sup:te,section:ne};for(const t of e)i[t]=Vn;const c=f().use(Xn,{handlers:i}).use(A).use(Yn,{bullet:"-",handlers:{break:Wn}}),a=await c.run({type:"root",children:o.children});return c.stringify(a).trimEnd()}const Vn=(t,n)=>{const e=n.properties.dataMarkdownDescription;return"string"==typeof e?function(t){const{children:n}=f().use(E).use(A).parse(t);return 1===n.length&&"paragraph"===n[0].type?n[0].children:n}(e):t.all(n)},Wn=(...t)=>{const n=C.break(...t);return"\\\n"===n?" \n":n},te=(t,n)=>{const e=n.children.find((t=>ee(t,"a")&&void 0!==t.properties.dataFootnoteRef));if(!e)return Nn.sup(t,n);const r=e.children.map((t=>"text"===t.type?t.value:"")).join("");return{type:"footnoteReference",identifier:r,label:r}},ne=(t,n)=>{if(void 0===n.properties.dataFootnotes)return Nn.section(t,n);const e=n.children.find((t=>ee(t,"ol"))),r=null==e?void 0:e.children.filter((t=>ee(t,"li")));return(null!=r?r:[]).map(((n,e)=>{const r=String(e+1);return{type:"footnoteDefinition",identifier:r,label:r,children:t.toFlow(t.all(n))}}))};function ee(t,n){return"element"===t.type&&t.tagName===n}function re(t){var n;const e=null===(n=customElements.get(t))||void 0===n?void 0:n.prototype;return"function"==typeof(null==e?void 0:e.toMarkdown)}export{Kn as exportMarkdown}