@limetech/lime-elements 39.23.0 → 39.24.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.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/adapt-color-contrast-Beo1IEl_.js +168 -0
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-email-viewer.cjs.entry.js +9 -2
- package/dist/cjs/limel-form.cjs.entry.js +45 -8
- package/dist/cjs/limel-markdown.cjs.entry.js +25 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/email-viewer/email-viewer.js +9 -2
- package/dist/collection/components/form/form.js +39 -2
- package/dist/collection/components/markdown/markdown.js +46 -1
- package/dist/collection/util/adapt-color-contrast.js +164 -0
- package/dist/esm/adapt-color-contrast-Dgcw_h7C.js +166 -0
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/limel-email-viewer.entry.js +9 -2
- package/dist/esm/limel-form.entry.js +45 -8
- package/dist/esm/limel-markdown.entry.js +25 -1
- package/dist/esm/loader.js +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/p-96ee6090.entry.js +1 -0
- package/dist/lime-elements/{p-29a59535.entry.js → p-9758568e.entry.js} +1 -1
- package/dist/lime-elements/p-Dgcw_h7C.js +1 -0
- package/dist/lime-elements/p-c1c635c1.entry.js +1 -0
- package/dist/types/components/email-viewer/email-viewer.d.ts +2 -0
- package/dist/types/components/form/form.d.ts +14 -0
- package/dist/types/components/markdown/markdown.d.ts +16 -0
- package/dist/types/components.d.ts +15 -0
- package/dist/types/util/adapt-color-contrast.d.ts +38 -0
- package/package.json +1 -1
- package/dist/lime-elements/p-5b31c118.entry.js +0 -1
- package/dist/lime-elements/p-70541fe3.entry.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as t,h as a,H as r}from"./p-DBTJNfo7.js";import{t as i}from"./p-Dv3YcsA7.js";function o(e){const t=e.trim().toLowerCase();return t.startsWith("https://")||t.startsWith("http://")}function l(e,t,a){return!!t.escapeNext&&(a(e),t.escapeNext=!1,!0)}function n(e,t,a){return!(!t.inQuotes||"\\"!==e||(a(e),t.escapeNext=!0,0))}function s(e,t,a){return'"'===e&&0===t.angleDepth&&(a(e),t.inQuotes=!t.inQuotes,!0)}function d(e,t,a){return!t.inQuotes&&("<"===e?(a(e),t.angleDepth+=1,!0):">"===e&&0!==t.angleDepth&&(a(e),t.angleDepth-=1,!0))}function m(e,t){return","===e&&!t.inQuotes&&0===t.angleDepth}function c(e,t=1){if(null==e||Number.isNaN(e))return"";if(e<0)return"";if(0===e)return"0 B";const a=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],r=Math.max(0,Math.min(a.length-1,Math.floor(Math.log(e)/Math.log(1024)))),i=e/Math.pow(1024,r),o=Number.isFinite(t)?Math.trunc(t):0,l=i<10?Math.min(100,Math.max(0,o)):0;return`${Number.parseFloat(i.toFixed(l))} ${a[r]}`}const h=class{constructor(r){e(this,r),this.allowRemoteImagesChange=t(this,"allowRemoteImagesChange"),this.language="en",this.allowRemoteImagesState=!1,this.renderAttachment=(e,t)=>{var r,i;const o=(null===(r=e.filename)||void 0===r?void 0:r.trim())||this.getTranslation("file-viewer.email.attachment.unnamed"),l=(null===(i=e.mimeType)||void 0===i?void 0:i.trim())||"";return a("li",{key:`attachment-${t}`},a("span",{class:"attachment-filename"},o),a("span",{class:"attachment-mime-type"}," ",l),this.renderSizeBadge(e.size))},this.renderSizeBadge=e=>{if("number"==typeof e)return a("limel-badge",{class:"attachment-size",label:c(e)})},this.onEnableRemoteImagesClick=e=>{var t;null===(t=null==e?void 0:e.stopPropagation)||void 0===t||t.call(e),this.enableRemoteImages()},this.enableRemoteImages=()=>{void 0===this.allowRemoteImages?this.allowRemoteImagesState=!0:this.allowRemoteImagesChange.emit(!0)}}resetAllowRemoteImages(e,t){e?e.from!==(null==t?void 0:t.from)&&(this.allowRemoteImagesState=!1):this.allowRemoteImagesState=!1}render(){return a(r,{key:"b37cad79c4d85f9cef78ef741d882d5384c039db"},a("div",{key:"89e9fa6c9c39234ec9268d93837f0b27f328d046",class:"email",part:"email"},this.renderHeaders(),this.renderRemoteImageBanner(),a("section",{key:"01f4c97918464218bc0d4ab4e79214027993360d"},this.renderAttachments(),this.renderBody())))}renderHeaders(){return a("div",{class:"email-headers",part:"email-headers"},["subject","from","to","cc","date"].map((e=>{var t;return this.renderEmailHeader(e,this.getTranslation(`file-viewer.email.${e}`),null===(t=this.email)||void 0===t?void 0:t[e])})))}renderBody(){return this.renderBodyHtml()||this.renderBodyText()||this.renderFallbackUrl()||a("slot",{name:"fallback"})}renderBodyHtml(){var e;const t=null===(e=this.email)||void 0===e?void 0:e.bodyHtml;if(!t)return;const r=function(e,t){if(!t)return e;const a=(new DOMParser).parseFromString(e,"text/html"),r=a.querySelectorAll("img[data-remote-src]");for(const e of r){const t=e.dataset.remoteSrc;t&&o(t)?(e.setAttribute("src",t),delete e.dataset.remoteSrc):delete e.dataset.remoteSrc}return`${[...a.head.querySelectorAll("style")].map((e=>e.outerHTML)).join("")}${a.body.innerHTML}`}(t,this.getAllowRemoteImages());return a("div",{class:"body",innerHTML:r,part:"email-body"})}renderBodyText(){var e;const t=null===(e=this.email)||void 0===e?void 0:e.bodyText;if(t)return a("pre",{class:"body plain-text",part:"email-body"},t)}renderFallbackUrl(){if(this.fallbackUrl)return a("object",{data:this.fallbackUrl,type:"text/plain"},a("slot",{name:"fallback"}))}renderEmailHeader(e,t,r){if(!r)return;const i=this.getHeaderValues(e,r);return a("dl",{class:`headers ${e}`},a("dt",null,t),i.map(((t,r)=>a("dd",{key:`${e}-${r}`},t))))}getHeaderValues(e,t){return"to"===e||"cc"===e?function(e){const t=[];let a="";const r={inQuotes:!1,escapeNext:!1,angleDepth:0},i=e=>{a+=e},o=()=>{const e=a.trim();e&&t.push(e),a=""};for(const t of e)l(t,r,i)||n(t,r,i)||s(t,r,i)||d(t,r,i)||(m(t,r)?o():i(t));return o(),t}(t):[t]}renderAttachments(){var e;const t=null===(e=this.email)||void 0===e?void 0:e.attachments;if(!(null==t?void 0:t.length))return;const r=this.getTranslation("file-viewer.email.attachments");return a("div",{class:"attachments"},a("span",null,r),a("ul",null,t.map(((e,t)=>this.renderAttachment(e,t)))))}getTranslation(e){return i.get(e,this.language)}shouldShowRemoteImagesBanner(){var e;const t=null===(e=this.email)||void 0===e?void 0:e.bodyHtml;return!(!t||this.getAllowRemoteImages())&&(a=t,null!==(new DOMParser).parseFromString(a,"text/html").querySelector("img[data-remote-src]"));var a}renderRemoteImageBanner(){if(!this.shouldShowRemoteImagesBanner())return;const e=this.getTranslation("file-viewer.email.remote-images.warning"),t=this.getTranslation("file-viewer.email.remote-images.warning.description"),r=this.getTranslation("file-viewer.email.remote-images.load");return a("limel-collapsible-section",{header:e,icon:{name:"warning_shield",color:"rgb(var(--color-orange-default))"},language:this.language},a("button",{type:"button",class:"load-images",slot:"header",onClick:this.onEnableRemoteImagesClick},r),a("limel-markdown",{value:t}))}getAllowRemoteImages(){var e;return null!==(e=this.allowRemoteImages)&&void 0!==e?e:this.allowRemoteImagesState}static get watchers(){return{email:[{resetAllowRemoteImages:0}]}}};h.style='@charset "UTF-8";:host(limel-email-viewer){display:block;width:100%;height:100%;box-sizing:border-box}*,*::before,*::after{box-sizing:border-box;min-width:0;min-height:0}.email{display:flex;flex-direction:column;width:100%;height:100%;padding-bottom:0.5rem;box-shadow:var(--shadow-depth-8)}.email-headers{position:relative;flex-shrink:0;display:flex;flex-direction:column}.email-headers dl,.email-headers dt,.email-headers dd{margin:0}.email-headers dl{display:flex;flex-wrap:wrap;gap:0 0.5rem;padding:0.5rem 0.75rem;font-size:0.75rem}.email-headers dl:nth-child(even){background-color:rgb(var(--contrast-800), 0.1)}.email-headers dl dt{opacity:0.6;min-width:3rem}.email-headers dl dt::after{content:":"}.email-headers dl dd:not(:last-child)::after{content:",";opacity:0.6}.email-headers dl.subject dd{font-weight:bold}.email-headers dl.date{position:absolute;right:0.25rem;bottom:0;transform:translateY(50%);font-size:0.625rem;border-radius:9rem;padding:0.125rem 0.25rem;background-color:rgb(var(--contrast-100), 0.8);border:rgb(var(--contrast-600)) solid 1px}.email-headers dl.date dt{position:absolute;width:0;height:0;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0, 0, 0, 0);clip-path:inset(50%);white-space:nowrap}.attachments{flex-shrink:0;padding:0.5rem;border-bottom:1px dashed rga(var(--contrast-700))}.attachments span{padding-left:0.25rem;font-size:0.75rem;opacity:0.6}.attachments span:first-child::after{content:":"}.attachments ul{all:unset;display:grid;grid-template-columns:repeat(auto-fill, minmax(8rem, 1fr));gap:0.5rem;padding:0.5rem 0}.attachments li{all:unset;position:relative;display:flex;flex-direction:column;gap:0.25rem;font-size:0.6875rem;line-height:normal;padding:0.5rem 0.5rem 1rem 0.5rem;border-radius:0.5rem;border:1px solid rgba(var(--contrast-600));background-color:rgba(var(--contrast-400))}.attachments .attachment-filename{font-weight:500}.attachments .attachment-mime-type{opacity:0.7}.attachments limel-badge{--badge-max-width:auto;--badge-background-color:rgb(var(--contrast-1000), 0.7);--badge-text-color:rgb(var(--color-white));position:absolute;bottom:0.125rem;right:0.125rem;box-shadow:var(--shadow-brighten-edges-outside)}section{flex-grow:1;display:flex;flex-direction:column;border-top:1px dashed rgba(var(--contrast-700));min-height:2rem;overflow-y:auto}limel-collapsible-section{--closed-header-background-color:var( --lime-elevated-surface-background-color );flex-grow:1;flex-shrink:0;margin:0.5rem;border-radius:0.75rem;box-shadow:var(--shadow-depth-8)}limel-collapsible-section button{appearance:none;background:none;border:none;padding:0;margin:0;font:inherit;color:inherit;text-align:inherit;flex-shrink:0;border-radius:0.375rem;padding:0.25rem 0.5rem;font-size:var(--limel-theme-small-font-size);margin:0 0.5rem}limel-collapsible-section button.load-images{transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--lime-primary-color, var(--limel-theme-primary-color));background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal)}limel-collapsible-section button.load-images:hover,limel-collapsible-section button.load-images:focus,limel-collapsible-section button.load-images:focus-visible{will-change:color, background-color, box-shadow, transform}limel-collapsible-section button.load-images:hover,limel-collapsible-section button.load-images:focus-visible{transform:translate3d(0, -0.04rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}limel-collapsible-section button.load-images:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}limel-collapsible-section button.load-images:hover,limel-collapsible-section button.load-images:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}limel-collapsible-section limel-markdown{padding:0.5rem}.body{flex-grow:1;max-width:100%;padding:0.75rem}.body.plain-text{white-space:pre-wrap;overflow-wrap:anywhere;margin:0;font-family:inherit}.body img{max-width:100% !important}';export{h as limel_email_viewer}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,h as t,H as r}from"./p-DBTJNfo7.js";import{m as o}from"./p-DdYOzHlg.js";import{g as a}from"./p-Dnt5w_Bp.js";import{d as n}from"./p-DJvGLFul.js";import"./p-B85MJLTf.js";class l{constructor(e){this.handleIntersection=e=>{for(const t of e)if(t.isIntersecting){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 i;const s=new Map(Object.entries(null!==(i=n.protocols)&&void 0!==i?i:{}).map((([e,t])=>[e,new Set(t)])));function d(e,t){for(const r of t){const t=e.getAttribute(r);if(!t)continue;const o=m(t);if(void 0!==o){const t=h(o);e[f(r)]=t}}}function m(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(""",'"').replaceAll(""",'"').replaceAll(""",'"').replaceAll("'","'").replaceAll("'","'").replaceAll("'","'").replaceAll("&","&");return JSON.parse(e)}catch(e){return}}}function c(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 h(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(h);const t=Object.assign({},e);for(const e of Object.keys(t)){const r=s.get(e);r&&"string"==typeof t[e]&&!c(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]=h(t[e]))}return t}function f(e){return e.replaceAll(/-([a-z])/g,((e,t)=>t.toUpperCase()))}var b,u="undefined"==typeof document?void 0:document,g=!!u&&"content"in u.createElement("template"),p=!!u&&u.createRange&&"createContextualFragment"in u.createRange();function v(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 w(e,t,r){e[r]!==t[r]&&(e[r]=t[r],e[r]?e.setAttribute(r,""):e.removeAttribute(r))}var k={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)}w(e,t,"selected")},INPUT:function(e,t){w(e,t,"checked"),w(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 y(){}function j(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}var x=function(e,t,r){if(r||(r={}),"string"==typeof t)if("#document"===e.nodeName||"HTML"===e.nodeName){var o=t;(t=u.createElement("html")).innerHTML=o}else if("BODY"===e.nodeName){var a=t;(t=u.createElement("html")).innerHTML=a;var n=t.querySelector("body");n&&(t=n)}else l=(l=t).trim(),t=g?function(e){var t=u.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}(l):p?function(e){return b||(b=u.createRange()).selectNode(u.body),b.createContextualFragment(e).childNodes[0]}(l):function(e){var t=u.createElement("body");return t.innerHTML=e,t.childNodes[0]}(l);else 11===t.nodeType&&(t=t.firstElementChild);var l,i=r.getNodeKey||j,s=r.onBeforeNodeAdded||y,d=r.onNodeAdded||y,m=r.onBeforeElUpdated||y,c=r.onElUpdated||y,h=r.onBeforeNodeDiscarded||y,f=r.onNodeDiscarded||y,w=r.onBeforeElChildrenUpdated||y,x=r.skipFromChildren||y,z=r.addChild||function(e,t){return e.appendChild(t)},O=!0===r.childrenOnly,C=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 E(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&&(C[r]=t),P(t),t=t.nextSibling}}function H(e){d(e);for(var t=e.firstChild;t;){var r=t.nextSibling,o=i(t);if(o){var a=C[o];a&&v(t,a)?(t.parentNode.replaceChild(a,t),L(a,t)):H(t)}else H(t);t=r}}function L(e,t,r){var o=i(t);if(o&&delete C[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===w(e,t))return}"TEXTAREA"!==e.nodeName?function(e,t){var r,o,a,n,l,d=x(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=C[r])?a===l?f=!1:(e.insertBefore(l,c),o?N(o):E(c,e,!0),o=i(c=l)):f=!1):o&&(f=!1),(f=!1!==f&&v(c,m))&&L(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):E(c,e,!0),c=a}if(r&&(l=C[r])&&v(l,m))d||z(e,l),L(l,m);else{var b=s(m);!1!==b&&(b&&(m=b),m.actualize&&(m=m.actualize(e.ownerDocument||u)),z(e,m),H(m))}m=n,c=a}!function(e,t,r){for(;t;){var o=t.nextSibling;(r=i(t))?N(r):E(t,e,!0),t=o}}(e,c,o);var g=k[e.nodeName];g&&g(e,t)}(e,t):k.TEXTAREA(e,t)}P(e);var M,S,I=e,D=I.nodeType,R=t.nodeType;if(!O)if(1===D)1===R?v(e,t)||(f(e),I=function(e,t){for(var r=e.firstChild;r;){var o=r.nextSibling;t.appendChild(r),r=o}return t}(e,(M=t.nodeName,(S=t.namespaceURI)&&"http://www.w3.org/1999/xhtml"!==S?u.createElementNS(S,M):u.createElement(M)))):I=t;else if(3===D||8===D){if(R===D)return I.nodeValue!==t.nodeValue&&(I.nodeValue=t.nodeValue),I;I=t}if(I===t)f(e);else{if(t.isSameNode&&t.isSameNode(I))return;if(L(I,t,O),T)for(var A=0,B=T.length;A<B;A++){var J=C[T[A]];J&&E(J,J.parentNode,!1)}}return!O&&I!==e&&e.parentNode&&(I.actualize&&(I=I.actualize(e.ownerDocument||u)),e.parentNode.replaceChild(I,e)),I};const z=[{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.imageIntersectionObserver=null}async textChanged(){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.entries()].map((([e,t])=>({tagName:e,attributes:[...t]})))}(z,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{x(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)d(e,r.attributes)}}(this.rootElement,e),this.setupImageIntersectionObserver()}catch(e){console.error(e)}}handleWhitelistChange(){return this.textChanged()}handleRemoveEmptyParagraphsChange(){return this.textChanged()}async componentDidLoad(){this.textChanged()}disconnectedCallback(){this.cleanupImageIntersectionObserver()}render(){return t(r,{key:"9d88a42e047b6701215699ab5459af3275e51693"},t("div",{key:"83a5801839318bf47eeacbf53e320e4628559bfa",id:"markdown",ref:e=>this.rootElement=e}))}setupImageIntersectionObserver(){this.lazyLoadImages&&(this.imageIntersectionObserver=new l(this.rootElement))}cleanupImageIntersectionObserver(){this.imageIntersectionObserver&&(this.imageIntersectionObserver.disconnect(),this.imageIntersectionObserver=null)}static get watchers(){return{value:[{textChanged:0}],whitelist:[{handleWhitelistChange:0}],removeEmptyParagraphs:[{handleRemoveEmptyParagraphsChange: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{position:relative;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{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}';export{O as limel_markdown}
|