@gnai/message-content-renderer 0.0.8 → 0.0.9

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.
@@ -1 +1 @@
1
- .vjs-tree-brackets{cursor:pointer}.vjs-tree-brackets:hover{color:#1890ff}.vjs-check-controller{position:absolute;left:0}.vjs-check-controller.is-checked .vjs-check-controller-inner{background-color:#1890ff;border-color:#0076e4}.vjs-check-controller.is-checked .vjs-check-controller-inner.is-checkbox:after{transform:rotate(45deg) scaleY(1)}.vjs-check-controller.is-checked .vjs-check-controller-inner.is-radio:after{transform:translate(-50%,-50%) scale(1)}.vjs-check-controller .vjs-check-controller-inner{display:inline-block;position:relative;border:1px solid #bfcbd9;border-radius:2px;vertical-align:middle;box-sizing:border-box;width:16px;height:16px;background-color:#fff;z-index:1;cursor:pointer;transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46)}.vjs-check-controller .vjs-check-controller-inner:after{box-sizing:content-box;content:"";border:2px solid #fff;border-left:0;border-top:0;height:8px;left:4px;position:absolute;top:1px;transform:rotate(45deg) scaleY(0);width:4px;transition:transform .15s cubic-bezier(.71,-.46,.88,.6) .05s;transform-origin:center}.vjs-check-controller .vjs-check-controller-inner.is-radio{border-radius:100%}.vjs-check-controller .vjs-check-controller-inner.is-radio:after{border-radius:100%;height:4px;background-color:#fff;left:50%;top:50%}.vjs-check-controller .vjs-check-controller-original{opacity:0;outline:none;position:absolute;z-index:-1;inset:0;margin:0}.vjs-carets{position:absolute;right:0;cursor:pointer}.vjs-carets svg{transition:transform .3s}.vjs-carets:hover{color:#1890ff}.vjs-carets-close{transform:rotate(-90deg)}.vjs-tree-node{display:flex;position:relative;line-height:20px}.vjs-tree-node.has-carets{padding-left:15px}.vjs-tree-node.has-carets.has-selector,.vjs-tree-node.has-selector{padding-left:30px}.vjs-tree-node.is-highlight,.vjs-tree-node:hover{background-color:#e6f7ff;border-radius:4px}.vjs-tree-node.is-highlight .vjs-tree-node-actions,.vjs-tree-node:hover .vjs-tree-node-actions{display:block}.vjs-tree-node .vjs-indent{display:flex;position:relative}.vjs-tree-node .vjs-indent-unit.has-line{border-left:1px dashed #bfcbd9}.vjs-tree-node .vjs-tree-node-actions{display:none;position:absolute;right:0;top:0;padding:0 4px;background-color:#e6f7ff;border-radius:4px}.vjs-tree-node .vjs-tree-node-actions .vjs-tree-node-actions-item{cursor:pointer}.vjs-tree-node .vjs-tree-node-actions .vjs-tree-node-actions-item:hover{color:#1890ff}.vjs-tree-node.dark.is-highlight,.vjs-tree-node.dark .vjs-tree-node-actions,.vjs-tree-node.dark:hover{background-color:#2e4558}.vjs-node-index{position:absolute;right:100%;margin-right:4px;-webkit-user-select:none;user-select:none}.vjs-colon{white-space:pre}.vjs-comment{color:#bfcbd9}.vjs-value{word-break:break-word}.vjs-value-null,.vjs-value-undefined{color:#d55fde}.vjs-value-boolean,.vjs-value-number{color:#1d8ce0}.vjs-value-string{color:#13ce66}.vjs-tree{font-family:Monaco,Menlo,Consolas,Bitstream Vera Sans Mono,monospace;font-size:14px;text-align:left}.vjs-tree.is-virtual{overflow:auto}.vjs-tree.is-virtual .vjs-tree-node{white-space:nowrap}.image-viewer[data-v-89ef4163]{position:fixed;inset:0;background:#000000e6;display:flex;align-items:center;justify-content:center;z-index:2000;padding:32px;cursor:zoom-out}.close-button[data-v-89ef4163]{position:fixed;top:24px;right:24px;width:48px;height:48px;display:flex;align-items:center;justify-content:center;color:#fff;background:#00000080;border-radius:50%;cursor:pointer;transition:all .15s cubic-bezier(.4,0,.2,1);z-index:2001}.close-button[data-v-89ef4163]:hover{background:#000c;transform:scale(1.1)}.close-button svg[data-v-89ef4163]{width:24px;height:24px}.viewer-content[data-v-89ef4163]{max-width:90%;max-height:90%;display:flex;align-items:center;justify-content:center;cursor:default}.viewer-content img[data-v-89ef4163]{max-width:100%;max-height:90vh;object-fit:contain;border-radius:10px;box-shadow:0 8px 32px #00000080}.viewer-enter-active[data-v-89ef4163],.viewer-leave-active[data-v-89ef4163]{transition:opacity .2s cubic-bezier(.4,0,.2,1)}.viewer-enter-from[data-v-89ef4163],.viewer-leave-to[data-v-89ef4163]{opacity:0}@media(max-width:768px){.image-viewer[data-v-89ef4163]{padding:16px}.close-button[data-v-89ef4163]{top:16px;right:16px;width:40px;height:40px}.close-button svg[data-v-89ef4163]{width:20px;height:20px}.viewer-content img[data-v-89ef4163]{border-radius:6px}}.message-content-renderer[data-v-07efc606]{width:100%}.content-user-message[data-v-07efc606]{display:flex;flex-direction:column;gap:16px}.files-grid[data-v-07efc606]{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px}.file-item[data-v-07efc606]{position:relative;overflow:hidden;border-radius:10px;background-color:#fff}.file-item .file-image[data-v-07efc606]{width:100%;height:100%;object-fit:cover;cursor:pointer;transition:transform .2s}.file-item .file-image[data-v-07efc606]:hover{transform:scale(1.05)}.file-item .file-video[data-v-07efc606]{width:100%;display:block}.file-item .file-audio[data-v-07efc606]{width:100%;height:40px}.content-text[data-v-07efc606]{font-size:15px;line-height:1.6;color:#1d1d1f}.content-text[data-v-07efc606] p{margin:0 0 8px;white-space:pre-wrap;word-wrap:break-word}.content-text[data-v-07efc606] p:last-child{margin-bottom:0}.content-text[data-v-07efc606] code{background:#fff;padding:2px 6px;border-radius:4px;font-family:Courier New,monospace;font-size:14px}.content-text[data-v-07efc606] pre{background:#fff;padding:16px;border-radius:10px;overflow-x:auto;margin:8px 0}.content-text[data-v-07efc606] pre code{background:none;padding:0}.content-text[data-v-07efc606] a{color:#007aff;text-decoration:none}.content-text[data-v-07efc606] a:hover{text-decoration:underline}.content-text[data-v-07efc606] ul,.content-text[data-v-07efc606] ol{margin:8px 0;padding-left:32px}.content-text[data-v-07efc606] blockquote{border-left:4px solid #d2d2d7;padding-left:16px;margin:8px 0;color:#6e6e73}.content-file[data-v-07efc606]{display:inline-flex;align-items:center;gap:8px;padding:8px 16px;background:#fff;border:1px solid #d2d2d7;border-radius:10px;cursor:pointer;transition:all .15s cubic-bezier(.4,0,.2,1)}.content-file[data-v-07efc606]:hover{background:#f5f5f7;border-color:#007aff}.content-file .file-icon[data-v-07efc606]{width:20px;height:20px;color:#6e6e73}.content-file .file-name[data-v-07efc606]{font-size:14px;color:#1d1d1f;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.content-file .download-icon[data-v-07efc606]{width:16px;height:16px;color:#007aff}.content-image img[data-v-07efc606]{max-width:300px;max-height:300px;border-radius:10px;cursor:pointer;transition:transform .2s cubic-bezier(.4,0,.2,1)}.content-image img[data-v-07efc606]:hover{transform:scale(1.02)}.content-voice audio[data-v-07efc606]{max-width:100%;height:40px}.content-medialib .medialib-video[data-v-07efc606]{max-width:100%;max-height:400px;border-radius:10px}.content-medialib .medialib-image[data-v-07efc606]{max-width:300px;max-height:300px;border-radius:10px;cursor:pointer;transition:transform .2s cubic-bezier(.4,0,.2,1)}.content-medialib .medialib-image[data-v-07efc606]:hover{transform:scale(1.02)}.content-medialib .medialib-audio[data-v-07efc606]{max-width:100%;height:40px}.content-medialib .json-viewer[data-v-07efc606]{background:#fff;padding:16px;border-radius:10px;font-size:13px;max-height:400px;overflow:auto}@media(max-width:768px){.content-image img[data-v-07efc606],.medialib-image[data-v-07efc606]{max-width:200px;max-height:200px}.content-file .file-name[data-v-07efc606]{max-width:150px}}
1
+ .vjs-tree-brackets{cursor:pointer}.vjs-tree-brackets:hover{color:#1890ff}.vjs-check-controller{position:absolute;left:0}.vjs-check-controller.is-checked .vjs-check-controller-inner{background-color:#1890ff;border-color:#0076e4}.vjs-check-controller.is-checked .vjs-check-controller-inner.is-checkbox:after{transform:rotate(45deg) scaleY(1)}.vjs-check-controller.is-checked .vjs-check-controller-inner.is-radio:after{transform:translate(-50%,-50%) scale(1)}.vjs-check-controller .vjs-check-controller-inner{display:inline-block;position:relative;border:1px solid #bfcbd9;border-radius:2px;vertical-align:middle;box-sizing:border-box;width:16px;height:16px;background-color:#fff;z-index:1;cursor:pointer;transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46)}.vjs-check-controller .vjs-check-controller-inner:after{box-sizing:content-box;content:"";border:2px solid #fff;border-left:0;border-top:0;height:8px;left:4px;position:absolute;top:1px;transform:rotate(45deg) scaleY(0);width:4px;transition:transform .15s cubic-bezier(.71,-.46,.88,.6) .05s;transform-origin:center}.vjs-check-controller .vjs-check-controller-inner.is-radio{border-radius:100%}.vjs-check-controller .vjs-check-controller-inner.is-radio:after{border-radius:100%;height:4px;background-color:#fff;left:50%;top:50%}.vjs-check-controller .vjs-check-controller-original{opacity:0;outline:none;position:absolute;z-index:-1;inset:0;margin:0}.vjs-carets{position:absolute;right:0;cursor:pointer}.vjs-carets svg{transition:transform .3s}.vjs-carets:hover{color:#1890ff}.vjs-carets-close{transform:rotate(-90deg)}.vjs-tree-node{display:flex;position:relative;line-height:20px}.vjs-tree-node.has-carets{padding-left:15px}.vjs-tree-node.has-carets.has-selector,.vjs-tree-node.has-selector{padding-left:30px}.vjs-tree-node.is-highlight,.vjs-tree-node:hover{background-color:#e6f7ff;border-radius:4px}.vjs-tree-node.is-highlight .vjs-tree-node-actions,.vjs-tree-node:hover .vjs-tree-node-actions{display:block}.vjs-tree-node .vjs-indent{display:flex;position:relative}.vjs-tree-node .vjs-indent-unit.has-line{border-left:1px dashed #bfcbd9}.vjs-tree-node .vjs-tree-node-actions{display:none;position:absolute;right:0;top:0;padding:0 4px;background-color:#e6f7ff;border-radius:4px}.vjs-tree-node .vjs-tree-node-actions .vjs-tree-node-actions-item{cursor:pointer}.vjs-tree-node .vjs-tree-node-actions .vjs-tree-node-actions-item:hover{color:#1890ff}.vjs-tree-node.dark.is-highlight,.vjs-tree-node.dark .vjs-tree-node-actions,.vjs-tree-node.dark:hover{background-color:#2e4558}.vjs-node-index{position:absolute;right:100%;margin-right:4px;-webkit-user-select:none;user-select:none}.vjs-colon{white-space:pre}.vjs-comment{color:#bfcbd9}.vjs-value{word-break:break-word}.vjs-value-null,.vjs-value-undefined{color:#d55fde}.vjs-value-boolean,.vjs-value-number{color:#1d8ce0}.vjs-value-string{color:#13ce66}.vjs-tree{font-family:Monaco,Menlo,Consolas,Bitstream Vera Sans Mono,monospace;font-size:14px;text-align:left}.vjs-tree.is-virtual{overflow:auto}.vjs-tree.is-virtual .vjs-tree-node{white-space:nowrap}.image-viewer[data-v-92c159ee]{position:fixed;inset:0;background:#000000e6;display:flex;align-items:center;justify-content:center;z-index:2000;padding:32px;cursor:zoom-out}.close-button[data-v-92c159ee]{position:fixed;top:24px;right:24px;width:48px;height:48px;display:flex;align-items:center;justify-content:center;color:#fff;background:#00000080;border-radius:50%;cursor:pointer;transition:all .15s cubic-bezier(.4,0,.2,1);z-index:2001}.close-button[data-v-92c159ee]:hover{background:#000c;transform:scale(1.1)}.close-button svg[data-v-92c159ee]{width:24px;height:24px}.viewer-content[data-v-92c159ee]{max-width:90%;max-height:90%;display:flex;align-items:center;justify-content:center;cursor:default}.viewer-content img[data-v-92c159ee]{max-width:100%;max-height:90vh;object-fit:contain;border-radius:10px;box-shadow:0 8px 32px #00000080}.viewer-enter-active[data-v-92c159ee],.viewer-leave-active[data-v-92c159ee]{transition:opacity .2s cubic-bezier(.4,0,.2,1)}.viewer-enter-from[data-v-92c159ee],.viewer-leave-to[data-v-92c159ee]{opacity:0}@media(max-width:768px){.image-viewer[data-v-92c159ee]{padding:16px}.close-button[data-v-92c159ee]{top:16px;right:16px;width:40px;height:40px}.close-button svg[data-v-92c159ee]{width:20px;height:20px}.viewer-content img[data-v-92c159ee]{border-radius:6px}}.message-content-renderer[data-v-07efc606]{width:100%}.content-user-message[data-v-07efc606]{display:flex;flex-direction:column;gap:16px}.files-grid[data-v-07efc606]{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px}.file-item[data-v-07efc606]{position:relative;overflow:hidden;border-radius:10px;background-color:#fff}.file-item .file-image[data-v-07efc606]{width:100%;height:100%;object-fit:cover;cursor:pointer;transition:transform .2s}.file-item .file-image[data-v-07efc606]:hover{transform:scale(1.05)}.file-item .file-video[data-v-07efc606]{width:100%;display:block}.file-item .file-audio[data-v-07efc606]{width:100%;height:40px}.content-text[data-v-07efc606]{font-size:15px;line-height:1.6;color:#1d1d1f}.content-text[data-v-07efc606] p{margin:0 0 8px;white-space:pre-wrap;word-wrap:break-word}.content-text[data-v-07efc606] p:last-child{margin-bottom:0}.content-text[data-v-07efc606] code{background:#fff;padding:2px 6px;border-radius:4px;font-family:Courier New,monospace;font-size:14px}.content-text[data-v-07efc606] pre{background:#fff;padding:16px;border-radius:10px;overflow-x:auto;margin:8px 0}.content-text[data-v-07efc606] pre code{background:none;padding:0}.content-text[data-v-07efc606] a{color:#007aff;text-decoration:none}.content-text[data-v-07efc606] a:hover{text-decoration:underline}.content-text[data-v-07efc606] ul,.content-text[data-v-07efc606] ol{margin:8px 0;padding-left:32px}.content-text[data-v-07efc606] blockquote{border-left:4px solid #d2d2d7;padding-left:16px;margin:8px 0;color:#6e6e73}.content-file[data-v-07efc606]{display:inline-flex;align-items:center;gap:8px;padding:8px 16px;background:#fff;border:1px solid #d2d2d7;border-radius:10px;cursor:pointer;transition:all .15s cubic-bezier(.4,0,.2,1)}.content-file[data-v-07efc606]:hover{background:#f5f5f7;border-color:#007aff}.content-file .file-icon[data-v-07efc606]{width:20px;height:20px;color:#6e6e73}.content-file .file-name[data-v-07efc606]{font-size:14px;color:#1d1d1f;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.content-file .download-icon[data-v-07efc606]{width:16px;height:16px;color:#007aff}.content-image img[data-v-07efc606]{max-width:300px;max-height:300px;border-radius:10px;cursor:pointer;transition:transform .2s cubic-bezier(.4,0,.2,1)}.content-image img[data-v-07efc606]:hover{transform:scale(1.02)}.content-voice audio[data-v-07efc606]{max-width:100%;height:40px}.content-medialib .medialib-video[data-v-07efc606]{max-width:100%;max-height:400px;border-radius:10px}.content-medialib .medialib-image[data-v-07efc606]{max-width:300px;max-height:300px;border-radius:10px;cursor:pointer;transition:transform .2s cubic-bezier(.4,0,.2,1)}.content-medialib .medialib-image[data-v-07efc606]:hover{transform:scale(1.02)}.content-medialib .medialib-audio[data-v-07efc606]{max-width:100%;height:40px}.content-medialib .json-viewer[data-v-07efc606]{background:#fff;padding:16px;border-radius:10px;font-size:13px;max-height:400px;overflow:auto}@media(max-width:768px){.content-image img[data-v-07efc606],.medialib-image[data-v-07efc606]{max-width:200px;max-height:200px}.content-file .file-name[data-v-07efc606]{max-width:150px}}
@@ -4912,7 +4912,7 @@ const pc = ["src", "alt"], bc = /* @__PURE__ */ ye({
4912
4912
  class: "image-viewer",
4913
4913
  onClick: t[2] || (t[2] = (n) => e.$emit("close"))
4914
4914
  }, [
4915
- lu("button", {
4915
+ lu("div", {
4916
4916
  class: "close-button",
4917
4917
  onClick: t[0] || (t[0] = Pe((n) => e.$emit("close"), ["stop"]))
4918
4918
  }, [
@@ -4939,7 +4939,7 @@ const pc = ["src", "alt"], bc = /* @__PURE__ */ ye({
4939
4939
  for (const [n, r] of e)
4940
4940
  t[n] = r;
4941
4941
  return t;
4942
- }, mc = /* @__PURE__ */ f0(bc, [["__scopeId", "data-v-89ef4163"]]), xc = { class: "message-content-renderer" }, gc = ["innerHTML"], _c = {
4942
+ }, mc = /* @__PURE__ */ f0(bc, [["__scopeId", "data-v-92c159ee"]]), xc = { class: "message-content-renderer" }, gc = ["innerHTML"], _c = {
4943
4943
  key: 1,
4944
4944
  class: "content-user-message"
4945
4945
  }, kc = ["innerHTML"], yc = { class: "files-grid" }, Cc = ["src", "onClick"], vc = ["src"], Dc = ["src"], Ec = ["onClick"], Fc = { class: "file-name" }, Ac = { class: "file-name" }, wc = {
@@ -15,4 +15,4 @@
15
15
  `),e=e.replace(Hn,"�"),u.src=e}function Zn(u){let e;u.inlineMode?(e=new u.Token("inline","",0),e.content=u.src,e.map=[0,1],e.children=[],u.tokens.push(e)):u.md.block.parse(u.src,u.md,u.env,u.tokens)}function Gn(u){const e=u.tokens;for(let t=0,n=e.length;t<n;t++){const r=e[t];r.type==="inline"&&u.md.inline.parse(r.content,u.md,u.env,r.children)}}function Wn(u){return/^<a[>\s]/i.test(u)}function Qn(u){return/^<\/a\s*>/i.test(u)}function Jn(u){const e=u.tokens;if(u.md.options.linkify)for(let t=0,n=e.length;t<n;t++){if(e[t].type!=="inline"||!u.md.linkify.pretest(e[t].content))continue;let r=e[t].children,o=0;for(let c=r.length-1;c>=0;c--){const i=r[c];if(i.type==="link_close"){for(c--;r[c].level!==i.level&&r[c].type!=="link_open";)c--;continue}if(i.type==="html_inline"&&(Wn(i.content)&&o>0&&o--,Qn(i.content)&&o++),!(o>0)&&i.type==="text"&&u.md.linkify.test(i.content)){const a=i.content;let s=u.md.linkify.match(a);const l=[];let f=i.level,x=0;s.length>0&&s[0].index===0&&c>0&&r[c-1].type==="text_special"&&(s=s.slice(1));for(let b=0;b<s.length;b++){const d=s[b].url,E=u.md.normalizeLink(d);if(!u.md.validateLink(E))continue;let y=s[b].text;s[b].schema?s[b].schema==="mailto:"&&!/^mailto:/i.test(y)?y=u.md.normalizeLinkText("mailto:"+y).replace(/^mailto:/,""):y=u.md.normalizeLinkText(y):y=u.md.normalizeLinkText("http://"+y).replace(/^http:\/\//,"");const A=s[b].index;if(A>x){const _=new u.Token("text","",0);_.content=a.slice(x,A),_.level=f,l.push(_)}const F=new u.Token("link_open","a",1);F.attrs=[["href",E]],F.level=f++,F.markup="linkify",F.info="auto",l.push(F);const C=new u.Token("text","",0);C.content=y,C.level=f,l.push(C);const p=new u.Token("link_close","a",-1);p.level=--f,p.markup="linkify",p.info="auto",l.push(p),x=s[b].lastIndex}if(x<a.length){const b=new u.Token("text","",0);b.content=a.slice(x),b.level=f,l.push(b)}e[t].children=r=at(r,c,l)}}}}const ft=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,Kn=/\((c|tm|r)\)/i,Yn=/\((c|tm|r)\)/ig,Xn={c:"©",r:"®",tm:"™"};function ur(u,e){return Xn[e.toLowerCase()]}function er(u){let e=0;for(let t=u.length-1;t>=0;t--){const n=u[t];n.type==="text"&&!e&&(n.content=n.content.replace(Yn,ur)),n.type==="link_open"&&n.info==="auto"&&e--,n.type==="link_close"&&n.info==="auto"&&e++}}function tr(u){let e=0;for(let t=u.length-1;t>=0;t--){const n=u[t];n.type==="text"&&!e&&ft.test(n.content)&&(n.content=n.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),n.type==="link_open"&&n.info==="auto"&&e--,n.type==="link_close"&&n.info==="auto"&&e++}}function nr(u){let e;if(u.md.options.typographer)for(e=u.tokens.length-1;e>=0;e--)u.tokens[e].type==="inline"&&(Kn.test(u.tokens[e].content)&&er(u.tokens[e].children),ft.test(u.tokens[e].content)&&tr(u.tokens[e].children))}const rr=/['"]/,dt=/['"]/g,ht="’";function Vu(u,e,t){return u.slice(0,e)+t+u.slice(e+1)}function or(u,e){let t;const n=[];for(let r=0;r<u.length;r++){const o=u[r],c=u[r].level;for(t=n.length-1;t>=0&&!(n[t].level<=c);t--);if(n.length=t+1,o.type!=="text")continue;let i=o.content,a=0,s=i.length;u:for(;a<s;){dt.lastIndex=a;const l=dt.exec(i);if(!l)break;let f=!0,x=!0;a=l.index+1;const b=l[0]==="'";let d=32;if(l.index-1>=0)d=i.charCodeAt(l.index-1);else for(t=r-1;t>=0&&!(u[t].type==="softbreak"||u[t].type==="hardbreak");t--)if(u[t].content){d=u[t].content.charCodeAt(u[t].content.length-1);break}let E=32;if(a<s)E=i.charCodeAt(a);else for(t=r+1;t<u.length&&!(u[t].type==="softbreak"||u[t].type==="hardbreak");t++)if(u[t].content){E=u[t].content.charCodeAt(0);break}const y=Fu(d)||Du(String.fromCharCode(d)),A=Fu(E)||Du(String.fromCharCode(E)),F=Eu(d),C=Eu(E);if(C?f=!1:A&&(F||y||(f=!1)),F?x=!1:y&&(C||A||(x=!1)),E===34&&l[0]==='"'&&d>=48&&d<=57&&(x=f=!1),f&&x&&(f=y,x=A),!f&&!x){b&&(o.content=Vu(o.content,l.index,ht));continue}if(x)for(t=n.length-1;t>=0;t--){let p=n[t];if(n[t].level<c)break;if(p.single===b&&n[t].level===c){p=n[t];let _,h;b?(_=e.md.options.quotes[2],h=e.md.options.quotes[3]):(_=e.md.options.quotes[0],h=e.md.options.quotes[1]),o.content=Vu(o.content,l.index,h),u[p.token].content=Vu(u[p.token].content,p.pos,_),a+=h.length-1,p.token===r&&(a+=_.length-1),i=o.content,s=i.length,n.length=t;continue u}}f?n.push({token:r,pos:l.index,single:b,level:c}):x&&b&&(o.content=Vu(o.content,l.index,ht))}}}function cr(u){if(u.md.options.typographer)for(let e=u.tokens.length-1;e>=0;e--)u.tokens[e].type!=="inline"||!rr.test(u.tokens[e].content)||or(u.tokens[e].children,u)}function ir(u){let e,t;const n=u.tokens,r=n.length;for(let o=0;o<r;o++){if(n[o].type!=="inline")continue;const c=n[o].children,i=c.length;for(e=0;e<i;e++)c[e].type==="text_special"&&(c[e].type="text");for(e=t=0;e<i;e++)c[e].type==="text"&&e+1<i&&c[e+1].type==="text"?c[e+1].content=c[e].content+c[e+1].content:(e!==t&&(c[t]=c[e]),t++);e!==t&&(c.length=t)}}const le=[["normalize",Un],["block",Zn],["inline",Gn],["linkify",Jn],["replacements",nr],["smartquotes",cr],["text_join",ir]];function fe(){this.ruler=new H;for(let u=0;u<le.length;u++)this.ruler.push(le[u][0],le[u][1])}fe.prototype.process=function(u){const e=this.ruler.getRules("");for(let t=0,n=e.length;t<n;t++)e[t](u)},fe.prototype.State=lt;function uu(u,e,t,n){this.src=u,this.md=e,this.env=t,this.tokens=n,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const r=this.src;for(let o=0,c=0,i=0,a=0,s=r.length,l=!1;c<s;c++){const f=r.charCodeAt(c);if(!l)if(P(f)){i++,f===9?a+=4-a%4:a++;continue}else l=!0;(f===10||c===s-1)&&(f!==10&&c++,this.bMarks.push(o),this.eMarks.push(c),this.tShift.push(i),this.sCount.push(a),this.bsCount.push(0),l=!1,i=0,a=0,o=c+1)}this.bMarks.push(r.length),this.eMarks.push(r.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}uu.prototype.push=function(u,e,t){const n=new J(u,e,t);return n.block=!0,t<0&&this.level--,n.level=this.level,t>0&&this.level++,this.tokens.push(n),n},uu.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},uu.prototype.skipEmptyLines=function(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},uu.prototype.skipSpaces=function(e){for(let t=this.src.length;e<t;e++){const n=this.src.charCodeAt(e);if(!P(n))break}return e},uu.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!P(this.src.charCodeAt(--e)))return e+1;return e},uu.prototype.skipChars=function(e,t){for(let n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},uu.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},uu.prototype.getLines=function(e,t,n,r){if(e>=t)return"";const o=new Array(t-e);for(let c=0,i=e;i<t;i++,c++){let a=0;const s=this.bMarks[i];let l=s,f;for(i+1<t||r?f=this.eMarks[i]+1:f=this.eMarks[i];l<f&&a<n;){const x=this.src.charCodeAt(l);if(P(x))x===9?a+=4-(a+this.bsCount[i])%4:a++;else if(l-s<this.tShift[i])a++;else break;l++}a>n?o[c]=new Array(a-n+1).join(" ")+this.src.slice(l,f):o[c]=this.src.slice(l,f)}return o.join("")},uu.prototype.Token=J;const ar=65536;function de(u,e){const t=u.bMarks[e]+u.tShift[e],n=u.eMarks[e];return u.src.slice(t,n)}function pt(u){const e=[],t=u.length;let n=0,r=u.charCodeAt(n),o=!1,c=0,i="";for(;n<t;)r===124&&(o?(i+=u.substring(c,n-1),c=n):(e.push(i+u.substring(c,n)),i="",c=n+1)),o=r===92,n++,r=u.charCodeAt(n);return e.push(i+u.substring(c)),e}function sr(u,e,t,n){if(e+2>t)return!1;let r=e+1;if(u.sCount[r]<u.blkIndent||u.sCount[r]-u.blkIndent>=4)return!1;let o=u.bMarks[r]+u.tShift[r];if(o>=u.eMarks[r])return!1;const c=u.src.charCodeAt(o++);if(c!==124&&c!==45&&c!==58||o>=u.eMarks[r])return!1;const i=u.src.charCodeAt(o++);if(i!==124&&i!==45&&i!==58&&!P(i)||c===45&&P(i))return!1;for(;o<u.eMarks[r];){const p=u.src.charCodeAt(o);if(p!==124&&p!==45&&p!==58&&!P(p))return!1;o++}let a=de(u,e+1),s=a.split("|");const l=[];for(let p=0;p<s.length;p++){const _=s[p].trim();if(!_){if(p===0||p===s.length-1)continue;return!1}if(!/^:?-+:?$/.test(_))return!1;_.charCodeAt(_.length-1)===58?l.push(_.charCodeAt(0)===58?"center":"right"):_.charCodeAt(0)===58?l.push("left"):l.push("")}if(a=de(u,e).trim(),a.indexOf("|")===-1||u.sCount[e]-u.blkIndent>=4)return!1;s=pt(a),s.length&&s[0]===""&&s.shift(),s.length&&s[s.length-1]===""&&s.pop();const f=s.length;if(f===0||f!==l.length)return!1;if(n)return!0;const x=u.parentType;u.parentType="table";const b=u.md.block.ruler.getRules("blockquote"),d=u.push("table_open","table",1),E=[e,0];d.map=E;const y=u.push("thead_open","thead",1);y.map=[e,e+1];const A=u.push("tr_open","tr",1);A.map=[e,e+1];for(let p=0;p<s.length;p++){const _=u.push("th_open","th",1);l[p]&&(_.attrs=[["style","text-align:"+l[p]]]);const h=u.push("inline","",0);h.content=s[p].trim(),h.children=[],u.push("th_close","th",-1)}u.push("tr_close","tr",-1),u.push("thead_close","thead",-1);let F,C=0;for(r=e+2;r<t&&!(u.sCount[r]<u.blkIndent);r++){let p=!1;for(let h=0,g=b.length;h<g;h++)if(b[h](u,r,t,!0)){p=!0;break}if(p||(a=de(u,r).trim(),!a)||u.sCount[r]-u.blkIndent>=4||(s=pt(a),s.length&&s[0]===""&&s.shift(),s.length&&s[s.length-1]===""&&s.pop(),C+=f-s.length,C>ar))break;if(r===e+2){const h=u.push("tbody_open","tbody",1);h.map=F=[e+2,0]}const _=u.push("tr_open","tr",1);_.map=[r,r+1];for(let h=0;h<f;h++){const g=u.push("td_open","td",1);l[h]&&(g.attrs=[["style","text-align:"+l[h]]]);const D=u.push("inline","",0);D.content=s[h]?s[h].trim():"",D.children=[],u.push("td_close","td",-1)}u.push("tr_close","tr",-1)}return F&&(u.push("tbody_close","tbody",-1),F[1]=r),u.push("table_close","table",-1),E[1]=r,u.parentType=x,u.line=r,!0}function lr(u,e,t){if(u.sCount[e]-u.blkIndent<4)return!1;let n=e+1,r=n;for(;n<t;){if(u.isEmpty(n)){n++;continue}if(u.sCount[n]-u.blkIndent>=4){n++,r=n;continue}break}u.line=r;const o=u.push("code_block","code",0);return o.content=u.getLines(e,r,4+u.blkIndent,!1)+`
16
16
  `,o.map=[e,u.line],!0}function fr(u,e,t,n){let r=u.bMarks[e]+u.tShift[e],o=u.eMarks[e];if(u.sCount[e]-u.blkIndent>=4||r+3>o)return!1;const c=u.src.charCodeAt(r);if(c!==126&&c!==96)return!1;let i=r;r=u.skipChars(r,c);let a=r-i;if(a<3)return!1;const s=u.src.slice(i,r),l=u.src.slice(r,o);if(c===96&&l.indexOf(String.fromCharCode(c))>=0)return!1;if(n)return!0;let f=e,x=!1;for(;f++,!(f>=t||(r=i=u.bMarks[f]+u.tShift[f],o=u.eMarks[f],r<o&&u.sCount[f]<u.blkIndent));)if(u.src.charCodeAt(r)===c&&!(u.sCount[f]-u.blkIndent>=4)&&(r=u.skipChars(r,c),!(r-i<a)&&(r=u.skipSpaces(r),!(r<o)))){x=!0;break}a=u.sCount[e],u.line=f+(x?1:0);const b=u.push("fence","code",0);return b.info=l,b.content=u.getLines(e+1,f,a,!0),b.markup=s,b.map=[e,u.line],!0}function dr(u,e,t,n){let r=u.bMarks[e]+u.tShift[e],o=u.eMarks[e];const c=u.lineMax;if(u.sCount[e]-u.blkIndent>=4||u.src.charCodeAt(r)!==62)return!1;if(n)return!0;const i=[],a=[],s=[],l=[],f=u.md.block.ruler.getRules("blockquote"),x=u.parentType;u.parentType="blockquote";let b=!1,d;for(d=e;d<t;d++){const C=u.sCount[d]<u.blkIndent;if(r=u.bMarks[d]+u.tShift[d],o=u.eMarks[d],r>=o)break;if(u.src.charCodeAt(r++)===62&&!C){let _=u.sCount[d]+1,h,g;u.src.charCodeAt(r)===32?(r++,_++,g=!1,h=!0):u.src.charCodeAt(r)===9?(h=!0,(u.bsCount[d]+_)%4===3?(r++,_++,g=!1):g=!0):h=!1;let D=_;for(i.push(u.bMarks[d]),u.bMarks[d]=r;r<o;){const I=u.src.charCodeAt(r);if(P(I))I===9?D+=4-(D+u.bsCount[d]+(g?1:0))%4:D++;else break;r++}b=r>=o,a.push(u.bsCount[d]),u.bsCount[d]=u.sCount[d]+1+(h?1:0),s.push(u.sCount[d]),u.sCount[d]=D-_,l.push(u.tShift[d]),u.tShift[d]=r-u.bMarks[d];continue}if(b)break;let p=!1;for(let _=0,h=f.length;_<h;_++)if(f[_](u,d,t,!0)){p=!0;break}if(p){u.lineMax=d,u.blkIndent!==0&&(i.push(u.bMarks[d]),a.push(u.bsCount[d]),l.push(u.tShift[d]),s.push(u.sCount[d]),u.sCount[d]-=u.blkIndent);break}i.push(u.bMarks[d]),a.push(u.bsCount[d]),l.push(u.tShift[d]),s.push(u.sCount[d]),u.sCount[d]=-1}const E=u.blkIndent;u.blkIndent=0;const y=u.push("blockquote_open","blockquote",1);y.markup=">";const A=[e,0];y.map=A,u.md.block.tokenize(u,e,d);const F=u.push("blockquote_close","blockquote",-1);F.markup=">",u.lineMax=c,u.parentType=x,A[1]=u.line;for(let C=0;C<l.length;C++)u.bMarks[C+e]=i[C],u.tShift[C+e]=l[C],u.sCount[C+e]=s[C],u.bsCount[C+e]=a[C];return u.blkIndent=E,!0}function hr(u,e,t,n){const r=u.eMarks[e];if(u.sCount[e]-u.blkIndent>=4)return!1;let o=u.bMarks[e]+u.tShift[e];const c=u.src.charCodeAt(o++);if(c!==42&&c!==45&&c!==95)return!1;let i=1;for(;o<r;){const s=u.src.charCodeAt(o++);if(s!==c&&!P(s))return!1;s===c&&i++}if(i<3)return!1;if(n)return!0;u.line=e+1;const a=u.push("hr","hr",0);return a.map=[e,u.line],a.markup=Array(i+1).join(String.fromCharCode(c)),!0}function bt(u,e){const t=u.eMarks[e];let n=u.bMarks[e]+u.tShift[e];const r=u.src.charCodeAt(n++);if(r!==42&&r!==45&&r!==43)return-1;if(n<t){const o=u.src.charCodeAt(n);if(!P(o))return-1}return n}function mt(u,e){const t=u.bMarks[e]+u.tShift[e],n=u.eMarks[e];let r=t;if(r+1>=n)return-1;let o=u.src.charCodeAt(r++);if(o<48||o>57)return-1;for(;;){if(r>=n)return-1;if(o=u.src.charCodeAt(r++),o>=48&&o<=57){if(r-t>=10)return-1;continue}if(o===41||o===46)break;return-1}return r<n&&(o=u.src.charCodeAt(r),!P(o))?-1:r}function pr(u,e){const t=u.level+2;for(let n=e+2,r=u.tokens.length-2;n<r;n++)u.tokens[n].level===t&&u.tokens[n].type==="paragraph_open"&&(u.tokens[n+2].hidden=!0,u.tokens[n].hidden=!0,n+=2)}function br(u,e,t,n){let r,o,c,i,a=e,s=!0;if(u.sCount[a]-u.blkIndent>=4||u.listIndent>=0&&u.sCount[a]-u.listIndent>=4&&u.sCount[a]<u.blkIndent)return!1;let l=!1;n&&u.parentType==="paragraph"&&u.sCount[a]>=u.blkIndent&&(l=!0);let f,x,b;if((b=mt(u,a))>=0){if(f=!0,c=u.bMarks[a]+u.tShift[a],x=Number(u.src.slice(c,b-1)),l&&x!==1)return!1}else if((b=bt(u,a))>=0)f=!1;else return!1;if(l&&u.skipSpaces(b)>=u.eMarks[a])return!1;if(n)return!0;const d=u.src.charCodeAt(b-1),E=u.tokens.length;f?(i=u.push("ordered_list_open","ol",1),x!==1&&(i.attrs=[["start",x]])):i=u.push("bullet_list_open","ul",1);const y=[a,0];i.map=y,i.markup=String.fromCharCode(d);let A=!1;const F=u.md.block.ruler.getRules("list"),C=u.parentType;for(u.parentType="list";a<t;){o=b,r=u.eMarks[a];const p=u.sCount[a]+b-(u.bMarks[a]+u.tShift[a]);let _=p;for(;o<r;){const M=u.src.charCodeAt(o);if(M===9)_+=4-(_+u.bsCount[a])%4;else if(M===32)_++;else break;o++}const h=o;let g;h>=r?g=1:g=_-p,g>4&&(g=1);const D=p+g;i=u.push("list_item_open","li",1),i.markup=String.fromCharCode(d);const I=[a,0];i.map=I,f&&(i.info=u.src.slice(c,b-1));const B=u.tight,j=u.tShift[a],O=u.sCount[a],q=u.listIndent;if(u.listIndent=u.blkIndent,u.blkIndent=D,u.tight=!0,u.tShift[a]=h-u.bMarks[a],u.sCount[a]=_,h>=r&&u.isEmpty(a+1)?u.line=Math.min(u.line+2,t):u.md.block.tokenize(u,a,t,!0),(!u.tight||A)&&(s=!1),A=u.line-a>1&&u.isEmpty(u.line-1),u.blkIndent=u.listIndent,u.listIndent=q,u.tShift[a]=j,u.sCount[a]=O,u.tight=B,i=u.push("list_item_close","li",-1),i.markup=String.fromCharCode(d),a=u.line,I[1]=a,a>=t||u.sCount[a]<u.blkIndent||u.sCount[a]-u.blkIndent>=4)break;let Q=!1;for(let M=0,nu=F.length;M<nu;M++)if(F[M](u,a,t,!0)){Q=!0;break}if(Q)break;if(f){if(b=mt(u,a),b<0)break;c=u.bMarks[a]+u.tShift[a]}else if(b=bt(u,a),b<0)break;if(d!==u.src.charCodeAt(b-1))break}return f?i=u.push("ordered_list_close","ol",-1):i=u.push("bullet_list_close","ul",-1),i.markup=String.fromCharCode(d),y[1]=a,u.line=a,u.parentType=C,s&&pr(u,E),!0}function mr(u,e,t,n){let r=u.bMarks[e]+u.tShift[e],o=u.eMarks[e],c=e+1;if(u.sCount[e]-u.blkIndent>=4||u.src.charCodeAt(r)!==91)return!1;function i(F){const C=u.lineMax;if(F>=C||u.isEmpty(F))return null;let p=!1;if(u.sCount[F]-u.blkIndent>3&&(p=!0),u.sCount[F]<0&&(p=!0),!p){const g=u.md.block.ruler.getRules("reference"),D=u.parentType;u.parentType="reference";let I=!1;for(let B=0,j=g.length;B<j;B++)if(g[B](u,F,C,!0)){I=!0;break}if(u.parentType=D,I)return null}const _=u.bMarks[F]+u.tShift[F],h=u.eMarks[F];return u.src.slice(_,h+1)}let a=u.src.slice(r,o+1);o=a.length;let s=-1;for(r=1;r<o;r++){const F=a.charCodeAt(r);if(F===91)return!1;if(F===93){s=r;break}else if(F===10){const C=i(c);C!==null&&(a+=C,o=a.length,c++)}else if(F===92&&(r++,r<o&&a.charCodeAt(r)===10)){const C=i(c);C!==null&&(a+=C,o=a.length,c++)}}if(s<0||a.charCodeAt(s+1)!==58)return!1;for(r=s+2;r<o;r++){const F=a.charCodeAt(r);if(F===10){const C=i(c);C!==null&&(a+=C,o=a.length,c++)}else if(!P(F))break}const l=u.md.helpers.parseLinkDestination(a,r,o);if(!l.ok)return!1;const f=u.md.normalizeLink(l.str);if(!u.md.validateLink(f))return!1;r=l.pos;const x=r,b=c,d=r;for(;r<o;r++){const F=a.charCodeAt(r);if(F===10){const C=i(c);C!==null&&(a+=C,o=a.length,c++)}else if(!P(F))break}let E=u.md.helpers.parseLinkTitle(a,r,o);for(;E.can_continue;){const F=i(c);if(F===null)break;a+=F,r=o,o=a.length,c++,E=u.md.helpers.parseLinkTitle(a,r,o,E)}let y;for(r<o&&d!==r&&E.ok?(y=E.str,r=E.pos):(y="",r=x,c=b);r<o;){const F=a.charCodeAt(r);if(!P(F))break;r++}if(r<o&&a.charCodeAt(r)!==10&&y)for(y="",r=x,c=b;r<o;){const F=a.charCodeAt(r);if(!P(F))break;r++}if(r<o&&a.charCodeAt(r)!==10)return!1;const A=qu(a.slice(1,s));return A?(n||(typeof u.env.references>"u"&&(u.env.references={}),typeof u.env.references[A]>"u"&&(u.env.references[A]={title:y,href:f}),u.line=c),!0):!1}const xr=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],gr="[a-zA-Z_:][a-zA-Z0-9:._-]*",_r="(?:"+"[^\"'=<>`\\x00-\\x20]+"+"|"+"'[^']*'"+"|"+'"[^"]*"'+")",xt="<[A-Za-z][A-Za-z0-9\\-]*"+("(?:\\s+"+gr+"(?:\\s*=\\s*"+_r+")?)")+"*\\s*\\/?>",gt="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",kr="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",yr="<[?][\\s\\S]*?[?]>",Cr="<![A-Za-z][^>]*>",vr="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",Er=new RegExp("^(?:"+xt+"|"+gt+"|"+kr+"|"+yr+"|"+Cr+"|"+vr+")"),Dr=new RegExp("^(?:"+xt+"|"+gt+")"),gu=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+xr.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(Dr.source+"\\s*$"),/^$/,!1]];function Fr(u,e,t,n){let r=u.bMarks[e]+u.tShift[e],o=u.eMarks[e];if(u.sCount[e]-u.blkIndent>=4||!u.md.options.html||u.src.charCodeAt(r)!==60)return!1;let c=u.src.slice(r,o),i=0;for(;i<gu.length&&!gu[i][0].test(c);i++);if(i===gu.length)return!1;if(n)return gu[i][2];let a=e+1;if(!gu[i][1].test(c)){for(;a<t&&!(u.sCount[a]<u.blkIndent);a++)if(r=u.bMarks[a]+u.tShift[a],o=u.eMarks[a],c=u.src.slice(r,o),gu[i][1].test(c)){c.length!==0&&a++;break}}u.line=a;const s=u.push("html_block","",0);return s.map=[e,a],s.content=u.getLines(e,a,u.blkIndent,!0),!0}function Ar(u,e,t,n){let r=u.bMarks[e]+u.tShift[e],o=u.eMarks[e];if(u.sCount[e]-u.blkIndent>=4)return!1;let c=u.src.charCodeAt(r);if(c!==35||r>=o)return!1;let i=1;for(c=u.src.charCodeAt(++r);c===35&&r<o&&i<=6;)i++,c=u.src.charCodeAt(++r);if(i>6||r<o&&!P(c))return!1;if(n)return!0;o=u.skipSpacesBack(o,r);const a=u.skipCharsBack(o,35,r);a>r&&P(u.src.charCodeAt(a-1))&&(o=a),u.line=e+1;const s=u.push("heading_open","h"+String(i),1);s.markup="########".slice(0,i),s.map=[e,u.line];const l=u.push("inline","",0);l.content=u.src.slice(r,o).trim(),l.map=[e,u.line],l.children=[];const f=u.push("heading_close","h"+String(i),-1);return f.markup="########".slice(0,i),!0}function wr(u,e,t){const n=u.md.block.ruler.getRules("paragraph");if(u.sCount[e]-u.blkIndent>=4)return!1;const r=u.parentType;u.parentType="paragraph";let o=0,c,i=e+1;for(;i<t&&!u.isEmpty(i);i++){if(u.sCount[i]-u.blkIndent>3)continue;if(u.sCount[i]>=u.blkIndent){let b=u.bMarks[i]+u.tShift[i];const d=u.eMarks[i];if(b<d&&(c=u.src.charCodeAt(b),(c===45||c===61)&&(b=u.skipChars(b,c),b=u.skipSpaces(b),b>=d))){o=c===61?1:2;break}}if(u.sCount[i]<0)continue;let x=!1;for(let b=0,d=n.length;b<d;b++)if(n[b](u,i,t,!0)){x=!0;break}if(x)break}if(!o)return!1;const a=u.getLines(e,i,u.blkIndent,!1).trim();u.line=i+1;const s=u.push("heading_open","h"+String(o),1);s.markup=String.fromCharCode(c),s.map=[e,u.line];const l=u.push("inline","",0);l.content=a,l.map=[e,u.line-1],l.children=[];const f=u.push("heading_close","h"+String(o),-1);return f.markup=String.fromCharCode(c),u.parentType=r,!0}function Sr(u,e,t){const n=u.md.block.ruler.getRules("paragraph"),r=u.parentType;let o=e+1;for(u.parentType="paragraph";o<t&&!u.isEmpty(o);o++){if(u.sCount[o]-u.blkIndent>3||u.sCount[o]<0)continue;let s=!1;for(let l=0,f=n.length;l<f;l++)if(n[l](u,o,t,!0)){s=!0;break}if(s)break}const c=u.getLines(e,o,u.blkIndent,!1).trim();u.line=o;const i=u.push("paragraph_open","p",1);i.map=[e,u.line];const a=u.push("inline","",0);return a.content=c,a.map=[e,u.line],a.children=[],u.push("paragraph_close","p",-1),u.parentType=r,!0}const $u=[["table",sr,["paragraph","reference"]],["code",lr],["fence",fr,["paragraph","reference","blockquote","list"]],["blockquote",dr,["paragraph","reference","blockquote","list"]],["hr",hr,["paragraph","reference","blockquote","list"]],["list",br,["paragraph","reference","blockquote"]],["reference",mr],["html_block",Fr,["paragraph","reference","blockquote"]],["heading",Ar,["paragraph","reference","blockquote"]],["lheading",wr],["paragraph",Sr]];function Hu(){this.ruler=new H;for(let u=0;u<$u.length;u++)this.ruler.push($u[u][0],$u[u][1],{alt:($u[u][2]||[]).slice()})}Hu.prototype.tokenize=function(u,e,t){const n=this.ruler.getRules(""),r=n.length,o=u.md.options.maxNesting;let c=e,i=!1;for(;c<t&&(u.line=c=u.skipEmptyLines(c),!(c>=t||u.sCount[c]<u.blkIndent));){if(u.level>=o){u.line=t;break}const a=u.line;let s=!1;for(let l=0;l<r;l++)if(s=n[l](u,c,t,!1),s){if(a>=u.line)throw new Error("block rule didn't increment state.line");break}if(!s)throw new Error("none of the block rules matched");u.tight=!i,u.isEmpty(u.line-1)&&(i=!0),c=u.line,c<t&&u.isEmpty(c)&&(i=!0,c++,u.line=c)}},Hu.prototype.parse=function(u,e,t,n){if(!u)return;const r=new this.State(u,e,t,n);this.tokenize(r,r.line,r.lineMax)},Hu.prototype.State=uu;function Au(u,e,t,n){this.src=u,this.env=t,this.md=e,this.tokens=n,this.tokens_meta=Array(n.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}Au.prototype.pushPending=function(){const u=new J("text","",0);return u.content=this.pending,u.level=this.pendingLevel,this.tokens.push(u),this.pending="",u},Au.prototype.push=function(u,e,t){this.pending&&this.pushPending();const n=new J(u,e,t);let r=null;return t<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),n.level=this.level,t>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],r={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(r),n},Au.prototype.scanDelims=function(u,e){const t=this.posMax,n=this.src.charCodeAt(u),r=u>0?this.src.charCodeAt(u-1):32;let o=u;for(;o<t&&this.src.charCodeAt(o)===n;)o++;const c=o-u,i=o<t?this.src.charCodeAt(o):32,a=Fu(r)||Du(String.fromCharCode(r)),s=Fu(i)||Du(String.fromCharCode(i)),l=Eu(r),f=Eu(i),x=!f&&(!s||l||a),b=!l&&(!a||f||s);return{can_open:x&&(e||!b||a),can_close:b&&(e||!x||s),length:c}},Au.prototype.Token=J;function Tr(u){switch(u){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function Ir(u,e){let t=u.pos;for(;t<u.posMax&&!Tr(u.src.charCodeAt(t));)t++;return t===u.pos?!1:(e||(u.pending+=u.src.slice(u.pos,t)),u.pos=t,!0)}const Br=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function Nr(u,e){if(!u.md.options.linkify||u.linkLevel>0)return!1;const t=u.pos,n=u.posMax;if(t+3>n||u.src.charCodeAt(t)!==58||u.src.charCodeAt(t+1)!==47||u.src.charCodeAt(t+2)!==47)return!1;const r=u.pending.match(Br);if(!r)return!1;const o=r[1],c=u.md.linkify.matchAtStart(u.src.slice(t-o.length));if(!c)return!1;let i=c.url;if(i.length<=o.length)return!1;i=i.replace(/\*+$/,"");const a=u.md.normalizeLink(i);if(!u.md.validateLink(a))return!1;if(!e){u.pending=u.pending.slice(0,-o.length);const s=u.push("link_open","a",1);s.attrs=[["href",a]],s.markup="linkify",s.info="auto";const l=u.push("text","",0);l.content=u.md.normalizeLinkText(i);const f=u.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return u.pos+=i.length-o.length,!0}function Or(u,e){let t=u.pos;if(u.src.charCodeAt(t)!==10)return!1;const n=u.pending.length-1,r=u.posMax;if(!e)if(n>=0&&u.pending.charCodeAt(n)===32)if(n>=1&&u.pending.charCodeAt(n-1)===32){let o=n-1;for(;o>=1&&u.pending.charCodeAt(o-1)===32;)o--;u.pending=u.pending.slice(0,o),u.push("hardbreak","br",0)}else u.pending=u.pending.slice(0,-1),u.push("softbreak","br",0);else u.push("softbreak","br",0);for(t++;t<r&&P(u.src.charCodeAt(t));)t++;return u.pos=t,!0}const he=[];for(let u=0;u<256;u++)he.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(u){he[u.charCodeAt(0)]=1});function Lr(u,e){let t=u.pos;const n=u.posMax;if(u.src.charCodeAt(t)!==92||(t++,t>=n))return!1;let r=u.src.charCodeAt(t);if(r===10){for(e||u.push("hardbreak","br",0),t++;t<n&&(r=u.src.charCodeAt(t),!!P(r));)t++;return u.pos=t,!0}let o=u.src[t];if(r>=55296&&r<=56319&&t+1<n){const i=u.src.charCodeAt(t+1);i>=56320&&i<=57343&&(o+=u.src[t+1],t++)}const c="\\"+o;if(!e){const i=u.push("text_special","",0);r<256&&he[r]!==0?i.content=o:i.content=c,i.markup=c,i.info="escape"}return u.pos=t+1,!0}function Pr(u,e){let t=u.pos;if(u.src.charCodeAt(t)!==96)return!1;const r=t;t++;const o=u.posMax;for(;t<o&&u.src.charCodeAt(t)===96;)t++;const c=u.src.slice(r,t),i=c.length;if(u.backticksScanned&&(u.backticks[i]||0)<=r)return e||(u.pending+=c),u.pos+=i,!0;let a=t,s;for(;(s=u.src.indexOf("`",a))!==-1;){for(a=s+1;a<o&&u.src.charCodeAt(a)===96;)a++;const l=a-s;if(l===i){if(!e){const f=u.push("code_inline","code",0);f.markup=c,f.content=u.src.slice(t,s).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return u.pos=a,!0}u.backticks[l]=s}return u.backticksScanned=!0,e||(u.pending+=c),u.pos+=i,!0}function Mr(u,e){const t=u.pos,n=u.src.charCodeAt(t);if(e||n!==126)return!1;const r=u.scanDelims(u.pos,!0);let o=r.length;const c=String.fromCharCode(n);if(o<2)return!1;let i;o%2&&(i=u.push("text","",0),i.content=c,o--);for(let a=0;a<o;a+=2)i=u.push("text","",0),i.content=c+c,u.delimiters.push({marker:n,length:0,token:u.tokens.length-1,end:-1,open:r.can_open,close:r.can_close});return u.pos+=r.length,!0}function _t(u,e){let t;const n=[],r=e.length;for(let o=0;o<r;o++){const c=e[o];if(c.marker!==126||c.end===-1)continue;const i=e[c.end];t=u.tokens[c.token],t.type="s_open",t.tag="s",t.nesting=1,t.markup="~~",t.content="",t=u.tokens[i.token],t.type="s_close",t.tag="s",t.nesting=-1,t.markup="~~",t.content="",u.tokens[i.token-1].type==="text"&&u.tokens[i.token-1].content==="~"&&n.push(i.token-1)}for(;n.length;){const o=n.pop();let c=o+1;for(;c<u.tokens.length&&u.tokens[c].type==="s_close";)c++;c--,o!==c&&(t=u.tokens[c],u.tokens[c]=u.tokens[o],u.tokens[o]=t)}}function jr(u){const e=u.tokens_meta,t=u.tokens_meta.length;_t(u,u.delimiters);for(let n=0;n<t;n++)e[n]&&e[n].delimiters&&_t(u,e[n].delimiters)}const kt={tokenize:Mr,postProcess:jr};function zr(u,e){const t=u.pos,n=u.src.charCodeAt(t);if(e||n!==95&&n!==42)return!1;const r=u.scanDelims(u.pos,n===42);for(let o=0;o<r.length;o++){const c=u.push("text","",0);c.content=String.fromCharCode(n),u.delimiters.push({marker:n,length:r.length,token:u.tokens.length-1,end:-1,open:r.can_open,close:r.can_close})}return u.pos+=r.length,!0}function yt(u,e){const t=e.length;for(let n=t-1;n>=0;n--){const r=e[n];if(r.marker!==95&&r.marker!==42||r.end===-1)continue;const o=e[r.end],c=n>0&&e[n-1].end===r.end+1&&e[n-1].marker===r.marker&&e[n-1].token===r.token-1&&e[r.end+1].token===o.token+1,i=String.fromCharCode(r.marker),a=u.tokens[r.token];a.type=c?"strong_open":"em_open",a.tag=c?"strong":"em",a.nesting=1,a.markup=c?i+i:i,a.content="";const s=u.tokens[o.token];s.type=c?"strong_close":"em_close",s.tag=c?"strong":"em",s.nesting=-1,s.markup=c?i+i:i,s.content="",c&&(u.tokens[e[n-1].token].content="",u.tokens[e[r.end+1].token].content="",n--)}}function Rr(u){const e=u.tokens_meta,t=u.tokens_meta.length;yt(u,u.delimiters);for(let n=0;n<t;n++)e[n]&&e[n].delimiters&&yt(u,e[n].delimiters)}const Ct={tokenize:zr,postProcess:Rr};function qr(u,e){let t,n,r,o,c="",i="",a=u.pos,s=!0;if(u.src.charCodeAt(u.pos)!==91)return!1;const l=u.pos,f=u.posMax,x=u.pos+1,b=u.md.helpers.parseLinkLabel(u,u.pos,!0);if(b<0)return!1;let d=b+1;if(d<f&&u.src.charCodeAt(d)===40){for(s=!1,d++;d<f&&(t=u.src.charCodeAt(d),!(!P(t)&&t!==10));d++);if(d>=f)return!1;if(a=d,r=u.md.helpers.parseLinkDestination(u.src,d,u.posMax),r.ok){for(c=u.md.normalizeLink(r.str),u.md.validateLink(c)?d=r.pos:c="",a=d;d<f&&(t=u.src.charCodeAt(d),!(!P(t)&&t!==10));d++);if(r=u.md.helpers.parseLinkTitle(u.src,d,u.posMax),d<f&&a!==d&&r.ok)for(i=r.str,d=r.pos;d<f&&(t=u.src.charCodeAt(d),!(!P(t)&&t!==10));d++);}(d>=f||u.src.charCodeAt(d)!==41)&&(s=!0),d++}if(s){if(typeof u.env.references>"u")return!1;if(d<f&&u.src.charCodeAt(d)===91?(a=d+1,d=u.md.helpers.parseLinkLabel(u,d),d>=0?n=u.src.slice(a,d++):d=b+1):d=b+1,n||(n=u.src.slice(x,b)),o=u.env.references[qu(n)],!o)return u.pos=l,!1;c=o.href,i=o.title}if(!e){u.pos=x,u.posMax=b;const E=u.push("link_open","a",1),y=[["href",c]];E.attrs=y,i&&y.push(["title",i]),u.linkLevel++,u.md.inline.tokenize(u),u.linkLevel--,u.push("link_close","a",-1)}return u.pos=d,u.posMax=f,!0}function Vr(u,e){let t,n,r,o,c,i,a,s,l="";const f=u.pos,x=u.posMax;if(u.src.charCodeAt(u.pos)!==33||u.src.charCodeAt(u.pos+1)!==91)return!1;const b=u.pos+2,d=u.md.helpers.parseLinkLabel(u,u.pos+1,!1);if(d<0)return!1;if(o=d+1,o<x&&u.src.charCodeAt(o)===40){for(o++;o<x&&(t=u.src.charCodeAt(o),!(!P(t)&&t!==10));o++);if(o>=x)return!1;for(s=o,i=u.md.helpers.parseLinkDestination(u.src,o,u.posMax),i.ok&&(l=u.md.normalizeLink(i.str),u.md.validateLink(l)?o=i.pos:l=""),s=o;o<x&&(t=u.src.charCodeAt(o),!(!P(t)&&t!==10));o++);if(i=u.md.helpers.parseLinkTitle(u.src,o,u.posMax),o<x&&s!==o&&i.ok)for(a=i.str,o=i.pos;o<x&&(t=u.src.charCodeAt(o),!(!P(t)&&t!==10));o++);else a="";if(o>=x||u.src.charCodeAt(o)!==41)return u.pos=f,!1;o++}else{if(typeof u.env.references>"u")return!1;if(o<x&&u.src.charCodeAt(o)===91?(s=o+1,o=u.md.helpers.parseLinkLabel(u,o),o>=0?r=u.src.slice(s,o++):o=d+1):o=d+1,r||(r=u.src.slice(b,d)),c=u.env.references[qu(r)],!c)return u.pos=f,!1;l=c.href,a=c.title}if(!e){n=u.src.slice(b,d);const E=[];u.md.inline.parse(n,u.md,u.env,E);const y=u.push("image","img",0),A=[["src",l],["alt",""]];y.attrs=A,y.children=E,y.content=n,a&&A.push(["title",a])}return u.pos=o,u.posMax=x,!0}const $r=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,Hr=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Ur(u,e){let t=u.pos;if(u.src.charCodeAt(t)!==60)return!1;const n=u.pos,r=u.posMax;for(;;){if(++t>=r)return!1;const c=u.src.charCodeAt(t);if(c===60)return!1;if(c===62)break}const o=u.src.slice(n+1,t);if(Hr.test(o)){const c=u.md.normalizeLink(o);if(!u.md.validateLink(c))return!1;if(!e){const i=u.push("link_open","a",1);i.attrs=[["href",c]],i.markup="autolink",i.info="auto";const a=u.push("text","",0);a.content=u.md.normalizeLinkText(o);const s=u.push("link_close","a",-1);s.markup="autolink",s.info="auto"}return u.pos+=o.length+2,!0}if($r.test(o)){const c=u.md.normalizeLink("mailto:"+o);if(!u.md.validateLink(c))return!1;if(!e){const i=u.push("link_open","a",1);i.attrs=[["href",c]],i.markup="autolink",i.info="auto";const a=u.push("text","",0);a.content=u.md.normalizeLinkText(o);const s=u.push("link_close","a",-1);s.markup="autolink",s.info="auto"}return u.pos+=o.length+2,!0}return!1}function Zr(u){return/^<a[>\s]/i.test(u)}function Gr(u){return/^<\/a\s*>/i.test(u)}function Wr(u){const e=u|32;return e>=97&&e<=122}function Qr(u,e){if(!u.md.options.html)return!1;const t=u.posMax,n=u.pos;if(u.src.charCodeAt(n)!==60||n+2>=t)return!1;const r=u.src.charCodeAt(n+1);if(r!==33&&r!==63&&r!==47&&!Wr(r))return!1;const o=u.src.slice(n).match(Er);if(!o)return!1;if(!e){const c=u.push("html_inline","",0);c.content=o[0],Zr(c.content)&&u.linkLevel++,Gr(c.content)&&u.linkLevel--}return u.pos+=o[0].length,!0}const Jr=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Kr=/^&([a-z][a-z0-9]{1,31});/i;function Yr(u,e){const t=u.pos,n=u.posMax;if(u.src.charCodeAt(t)!==38||t+1>=n)return!1;if(u.src.charCodeAt(t+1)===35){const o=u.src.slice(t).match(Jr);if(o){if(!e){const c=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),i=u.push("text_special","",0);i.content=se(c)?Ru(c):Ru(65533),i.markup=o[0],i.info="entity"}return u.pos+=o[0].length,!0}}else{const o=u.src.slice(t).match(Kr);if(o){const c=it(o[0]);if(c!==o[0]){if(!e){const i=u.push("text_special","",0);i.content=c,i.markup=o[0],i.info="entity"}return u.pos+=o[0].length,!0}}}return!1}function vt(u){const e={},t=u.length;if(!t)return;let n=0,r=-2;const o=[];for(let c=0;c<t;c++){const i=u[c];if(o.push(0),(u[n].marker!==i.marker||r!==i.token-1)&&(n=c),r=i.token,i.length=i.length||0,!i.close)continue;e.hasOwnProperty(i.marker)||(e[i.marker]=[-1,-1,-1,-1,-1,-1]);const a=e[i.marker][(i.open?3:0)+i.length%3];let s=n-o[n]-1,l=s;for(;s>a;s-=o[s]+1){const f=u[s];if(f.marker===i.marker&&f.open&&f.end<0){let x=!1;if((f.close||i.open)&&(f.length+i.length)%3===0&&(f.length%3!==0||i.length%3!==0)&&(x=!0),!x){const b=s>0&&!u[s-1].open?o[s-1]+1:0;o[c]=c-s+b,o[s]=b,i.open=!1,f.end=c,f.close=!1,l=-1,r=-2;break}}}l!==-1&&(e[i.marker][(i.open?3:0)+(i.length||0)%3]=l)}}function Xr(u){const e=u.tokens_meta,t=u.tokens_meta.length;vt(u.delimiters);for(let n=0;n<t;n++)e[n]&&e[n].delimiters&&vt(e[n].delimiters)}function uo(u){let e,t,n=0;const r=u.tokens,o=u.tokens.length;for(e=t=0;e<o;e++)r[e].nesting<0&&n--,r[e].level=n,r[e].nesting>0&&n++,r[e].type==="text"&&e+1<o&&r[e+1].type==="text"?r[e+1].content=r[e].content+r[e+1].content:(e!==t&&(r[t]=r[e]),t++);e!==t&&(r.length=t)}const pe=[["text",Ir],["linkify",Nr],["newline",Or],["escape",Lr],["backticks",Pr],["strikethrough",kt.tokenize],["emphasis",Ct.tokenize],["link",qr],["image",Vr],["autolink",Ur],["html_inline",Qr],["entity",Yr]],be=[["balance_pairs",Xr],["strikethrough",kt.postProcess],["emphasis",Ct.postProcess],["fragments_join",uo]];function wu(){this.ruler=new H;for(let u=0;u<pe.length;u++)this.ruler.push(pe[u][0],pe[u][1]);this.ruler2=new H;for(let u=0;u<be.length;u++)this.ruler2.push(be[u][0],be[u][1])}wu.prototype.skipToken=function(u){const e=u.pos,t=this.ruler.getRules(""),n=t.length,r=u.md.options.maxNesting,o=u.cache;if(typeof o[e]<"u"){u.pos=o[e];return}let c=!1;if(u.level<r){for(let i=0;i<n;i++)if(u.level++,c=t[i](u,!0),u.level--,c){if(e>=u.pos)throw new Error("inline rule didn't increment state.pos");break}}else u.pos=u.posMax;c||u.pos++,o[e]=u.pos},wu.prototype.tokenize=function(u){const e=this.ruler.getRules(""),t=e.length,n=u.posMax,r=u.md.options.maxNesting;for(;u.pos<n;){const o=u.pos;let c=!1;if(u.level<r){for(let i=0;i<t;i++)if(c=e[i](u,!1),c){if(o>=u.pos)throw new Error("inline rule didn't increment state.pos");break}}if(c){if(u.pos>=n)break;continue}u.pending+=u.src[u.pos++]}u.pending&&u.pushPending()},wu.prototype.parse=function(u,e,t,n){const r=new this.State(u,e,t,n);this.tokenize(r);const o=this.ruler2.getRules(""),c=o.length;for(let i=0;i<c;i++)o[i](r)},wu.prototype.State=Au;function eo(u){const e={};u=u||{},e.src_Any=tt.source,e.src_Cc=nt.source,e.src_Z=ot.source,e.src_P=oe.source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|");const t="[><|]";return e.src_pseudo_letter="(?:(?!"+t+"|"+e.src_ZPCc+")"+e.src_Any+")",e.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",e.src_auth="(?:(?:(?!"+e.src_ZCc+"|[@/\\[\\]()]).)+@)?",e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",e.src_host_terminator="(?=$|"+t+"|"+e.src_ZPCc+")(?!"+(u["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+e.src_ZPCc+"))",e.src_path="(?:[/?#](?:(?!"+e.src_ZCc+"|"+t+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+e.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+e.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+e.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+e.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+e.src_ZCc+"|[']).)+\\'|\\'(?="+e.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+e.src_ZCc+"|[.]|$)|"+(u["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+e.src_ZCc+"|$)|;(?!"+e.src_ZCc+"|$)|\\!+(?!"+e.src_ZCc+"|[!]|$)|\\?(?!"+e.src_ZCc+"|[?]|$))+|\\/)?",e.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',e.src_xn="xn--[a-z0-9\\-]{1,59}",e.src_domain_root="(?:"+e.src_xn+"|"+e.src_pseudo_letter+"{1,63})",e.src_domain="(?:"+e.src_xn+"|(?:"+e.src_pseudo_letter+")|(?:"+e.src_pseudo_letter+"(?:-|"+e.src_pseudo_letter+"){0,61}"+e.src_pseudo_letter+"))",e.src_host="(?:(?:(?:(?:"+e.src_domain+")\\.)*"+e.src_domain+"))",e.tpl_host_fuzzy="(?:"+e.src_ip4+"|(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%)))",e.tpl_host_no_ip_fuzzy="(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%))",e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+e.src_ZPCc+"|>|$))",e.tpl_email_fuzzy="(^|"+t+'|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}function me(u){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){u[n]=t[n]})}),u}function Uu(u){return Object.prototype.toString.call(u)}function to(u){return Uu(u)==="[object String]"}function no(u){return Uu(u)==="[object Object]"}function ro(u){return Uu(u)==="[object RegExp]"}function Et(u){return Uu(u)==="[object Function]"}function oo(u){return u.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const Dt={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function co(u){return Object.keys(u||{}).reduce(function(e,t){return e||Dt.hasOwnProperty(t)},!1)}const io={"http:":{validate:function(u,e,t){const n=u.slice(e);return t.re.http||(t.re.http=new RegExp("^\\/\\/"+t.re.src_auth+t.re.src_host_port_strict+t.re.src_path,"i")),t.re.http.test(n)?n.match(t.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(u,e,t){const n=u.slice(e);return t.re.no_http||(t.re.no_http=new RegExp("^"+t.re.src_auth+"(?:localhost|(?:(?:"+t.re.src_domain+")\\.)+"+t.re.src_domain_root+")"+t.re.src_port+t.re.src_host_terminator+t.re.src_path,"i")),t.re.no_http.test(n)?e>=3&&u[e-3]===":"||e>=3&&u[e-3]==="/"?0:n.match(t.re.no_http)[0].length:0}},"mailto:":{validate:function(u,e,t){const n=u.slice(e);return t.re.mailto||(t.re.mailto=new RegExp("^"+t.re.src_email_name+"@"+t.re.src_host_strict,"i")),t.re.mailto.test(n)?n.match(t.re.mailto)[0].length:0}}},ao="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",so="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function lo(u){u.__index__=-1,u.__text_cache__=""}function fo(u){return function(e,t){const n=e.slice(t);return u.test(n)?n.match(u)[0].length:0}}function Ft(){return function(u,e){e.normalize(u)}}function Zu(u){const e=u.re=eo(u.__opts__),t=u.__tlds__.slice();u.onCompile(),u.__tlds_replaced__||t.push(ao),t.push(e.src_xn),e.src_tlds=t.join("|");function n(i){return i.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(n(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(n(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(n(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(n(e.tpl_host_fuzzy_test),"i");const r=[];u.__compiled__={};function o(i,a){throw new Error('(LinkifyIt) Invalid schema "'+i+'": '+a)}Object.keys(u.__schemas__).forEach(function(i){const a=u.__schemas__[i];if(a===null)return;const s={validate:null,link:null};if(u.__compiled__[i]=s,no(a)){ro(a.validate)?s.validate=fo(a.validate):Et(a.validate)?s.validate=a.validate:o(i,a),Et(a.normalize)?s.normalize=a.normalize:a.normalize?o(i,a):s.normalize=Ft();return}if(to(a)){r.push(i);return}o(i,a)}),r.forEach(function(i){u.__compiled__[u.__schemas__[i]]&&(u.__compiled__[i].validate=u.__compiled__[u.__schemas__[i]].validate,u.__compiled__[i].normalize=u.__compiled__[u.__schemas__[i]].normalize)}),u.__compiled__[""]={validate:null,normalize:Ft()};const c=Object.keys(u.__compiled__).filter(function(i){return i.length>0&&u.__compiled__[i]}).map(oo).join("|");u.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+c+")","i"),u.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+c+")","ig"),u.re.schema_at_start=RegExp("^"+u.re.schema_search.source,"i"),u.re.pretest=RegExp("("+u.re.schema_test.source+")|("+u.re.host_fuzzy_test.source+")|@","i"),lo(u)}function ho(u,e){const t=u.__index__,n=u.__last_index__,r=u.__text_cache__.slice(t,n);this.schema=u.__schema__.toLowerCase(),this.index=t+e,this.lastIndex=n+e,this.raw=r,this.text=r,this.url=r}function xe(u,e){const t=new ho(u,e);return u.__compiled__[t.schema].normalize(t,u),t}function U(u,e){if(!(this instanceof U))return new U(u,e);e||co(u)&&(e=u,u={}),this.__opts__=me({},Dt,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=me({},io,u),this.__compiled__={},this.__tlds__=so,this.__tlds_replaced__=!1,this.re={},Zu(this)}U.prototype.add=function(e,t){return this.__schemas__[e]=t,Zu(this),this},U.prototype.set=function(e){return this.__opts__=me(this.__opts__,e),this},U.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;let t,n,r,o,c,i,a,s,l;if(this.re.schema_test.test(e)){for(a=this.re.schema_search,a.lastIndex=0;(t=a.exec(e))!==null;)if(o=this.testSchemaAt(e,t[2],a.lastIndex),o){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+o;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(s=e.search(this.re.host_fuzzy_test),s>=0&&(this.__index__<0||s<this.__index__)&&(n=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(c=n.index+n[1].length,(this.__index__<0||c<this.__index__)&&(this.__schema__="",this.__index__=c,this.__last_index__=n.index+n[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(l=e.indexOf("@"),l>=0&&(r=e.match(this.re.email_fuzzy))!==null&&(c=r.index+r[1].length,i=r.index+r[0].length,(this.__index__<0||c<this.__index__||c===this.__index__&&i>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=c,this.__last_index__=i))),this.__index__>=0},U.prototype.pretest=function(e){return this.re.pretest.test(e)},U.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},U.prototype.match=function(e){const t=[];let n=0;this.__index__>=0&&this.__text_cache__===e&&(t.push(xe(this,n)),n=this.__last_index__);let r=n?e.slice(n):e;for(;this.test(r);)t.push(xe(this,n)),r=r.slice(this.__last_index__),n+=this.__last_index__;return t.length?t:null},U.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;const t=this.re.schema_at_start.exec(e);if(!t)return null;const n=this.testSchemaAt(e,t[2],t[0].length);return n?(this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+n,xe(this,0)):null},U.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(n,r,o){return n!==o[r-1]}).reverse(),Zu(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,Zu(this),this)},U.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url="mailto:"+e.url)},U.prototype.onCompile=function(){};const _u=2147483647,eu=36,ge=1,Su=26,po=38,bo=700,At=72,wt=128,St="-",mo=/^xn--/,xo=/[^\0-\x7F]/,go=/[\x2E\u3002\uFF0E\uFF61]/g,_o={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},_e=eu-ge,tu=Math.floor,ke=String.fromCharCode;function fu(u){throw new RangeError(_o[u])}function ko(u,e){const t=[];let n=u.length;for(;n--;)t[n]=e(u[n]);return t}function Tt(u,e){const t=u.split("@");let n="";t.length>1&&(n=t[0]+"@",u=t[1]),u=u.replace(go,".");const r=u.split("."),o=ko(r,e).join(".");return n+o}function It(u){const e=[];let t=0;const n=u.length;for(;t<n;){const r=u.charCodeAt(t++);if(r>=55296&&r<=56319&&t<n){const o=u.charCodeAt(t++);(o&64512)==56320?e.push(((r&1023)<<10)+(o&1023)+65536):(e.push(r),t--)}else e.push(r)}return e}const yo=u=>String.fromCodePoint(...u),Co=function(u){return u>=48&&u<58?26+(u-48):u>=65&&u<91?u-65:u>=97&&u<123?u-97:eu},Bt=function(u,e){return u+22+75*(u<26)-((e!=0)<<5)},Nt=function(u,e,t){let n=0;for(u=t?tu(u/bo):u>>1,u+=tu(u/e);u>_e*Su>>1;n+=eu)u=tu(u/_e);return tu(n+(_e+1)*u/(u+po))},Ot=function(u){const e=[],t=u.length;let n=0,r=wt,o=At,c=u.lastIndexOf(St);c<0&&(c=0);for(let i=0;i<c;++i)u.charCodeAt(i)>=128&&fu("not-basic"),e.push(u.charCodeAt(i));for(let i=c>0?c+1:0;i<t;){const a=n;for(let l=1,f=eu;;f+=eu){i>=t&&fu("invalid-input");const x=Co(u.charCodeAt(i++));x>=eu&&fu("invalid-input"),x>tu((_u-n)/l)&&fu("overflow"),n+=x*l;const b=f<=o?ge:f>=o+Su?Su:f-o;if(x<b)break;const d=eu-b;l>tu(_u/d)&&fu("overflow"),l*=d}const s=e.length+1;o=Nt(n-a,s,a==0),tu(n/s)>_u-r&&fu("overflow"),r+=tu(n/s),n%=s,e.splice(n++,0,r)}return String.fromCodePoint(...e)},Lt=function(u){const e=[];u=It(u);const t=u.length;let n=wt,r=0,o=At;for(const a of u)a<128&&e.push(ke(a));const c=e.length;let i=c;for(c&&e.push(St);i<t;){let a=_u;for(const l of u)l>=n&&l<a&&(a=l);const s=i+1;a-n>tu((_u-r)/s)&&fu("overflow"),r+=(a-n)*s,n=a;for(const l of u)if(l<n&&++r>_u&&fu("overflow"),l===n){let f=r;for(let x=eu;;x+=eu){const b=x<=o?ge:x>=o+Su?Su:x-o;if(f<b)break;const d=f-b,E=eu-b;e.push(ke(Bt(b+d%E,0))),f=tu(d/E)}e.push(ke(Bt(f,0))),o=Nt(r,s,i===c),r=0,++i}++r,++n}return e.join("")},Pt={version:"2.3.1",ucs2:{decode:It,encode:yo},decode:Ot,encode:Lt,toASCII:function(u){return Tt(u,function(e){return xo.test(e)?"xn--"+Lt(e):e})},toUnicode:function(u){return Tt(u,function(e){return mo.test(e)?Ot(e.slice(4).toLowerCase()):e})}},vo={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},Eo=/^(vbscript|javascript|file|data):/,Do=/^data:image\/(gif|png|jpeg|webp);/;function Fo(u){const e=u.trim().toLowerCase();return Eo.test(e)?Do.test(e):!0}const Mt=["http:","https:","mailto:"];function Ao(u){const e=re(u,!0);if(e.hostname&&(!e.protocol||Mt.indexOf(e.protocol)>=0))try{e.hostname=Pt.toASCII(e.hostname)}catch{}return vu(ne(e))}function wo(u){const e=re(u,!0);if(e.hostname&&(!e.protocol||Mt.indexOf(e.protocol)>=0))try{e.hostname=Pt.toUnicode(e.hostname)}catch{}return bu(ne(e),bu.defaultChars+"%")}function W(u,e){if(!(this instanceof W))return new W(u,e);e||ae(u)||(e=u||{},u="default"),this.inline=new wu,this.block=new Hu,this.core=new fe,this.renderer=new xu,this.linkify=new U,this.validateLink=Fo,this.normalizeLink=Ao,this.normalizeLinkText=wo,this.utils=jn,this.helpers=zu({},Vn),this.options={},this.configure(u),e&&this.set(e)}W.prototype.set=function(u){return zu(this.options,u),this},W.prototype.configure=function(u){const e=this;if(ae(u)){const t=u;if(u=vo[t],!u)throw new Error('Wrong `markdown-it` preset "'+t+'", check name')}if(!u)throw new Error("Wrong `markdown-it` preset, can't be empty");return u.options&&e.set(u.options),u.components&&Object.keys(u.components).forEach(function(t){u.components[t].rules&&e[t].ruler.enableOnly(u.components[t].rules),u.components[t].rules2&&e[t].ruler2.enableOnly(u.components[t].rules2)}),this},W.prototype.enable=function(u,e){let t=[];Array.isArray(u)||(u=[u]),["core","block","inline"].forEach(function(r){t=t.concat(this[r].ruler.enable(u,!0))},this),t=t.concat(this.inline.ruler2.enable(u,!0));const n=u.filter(function(r){return t.indexOf(r)<0});if(n.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+n);return this},W.prototype.disable=function(u,e){let t=[];Array.isArray(u)||(u=[u]),["core","block","inline"].forEach(function(r){t=t.concat(this[r].ruler.disable(u,!0))},this),t=t.concat(this.inline.ruler2.disable(u,!0));const n=u.filter(function(r){return t.indexOf(r)<0});if(n.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+n);return this},W.prototype.use=function(u){const e=[this].concat(Array.prototype.slice.call(arguments,1));return u.apply(u,e),this},W.prototype.parse=function(u,e){if(typeof u!="string")throw new Error("Input data should be a String");const t=new this.core.State(u,this,e);return this.core.process(t),t.tokens},W.prototype.render=function(u,e){return e=e||{},this.renderer.render(this.parse(u,e),this.options,e)},W.prototype.parseInline=function(u,e){const t=new this.core.State(u,this,e);return t.inlineMode=!0,this.core.process(t),t.tokens},W.prototype.renderInline=function(u,e){return e=e||{},this.renderer.render(this.parseInline(u,e),this.options,e)};var So={207:(u,e,t)=>{u.exports=t(452)},452:u=>{var e=(function(t){var n,r=Object.prototype,o=r.hasOwnProperty,c=typeof Symbol=="function"?Symbol:{},i=c.iterator||"@@iterator",a=c.asyncIterator||"@@asyncIterator",s=c.toStringTag||"@@toStringTag";function l(v,k,T){return Object.defineProperty(v,k,{value:T,enumerable:!0,configurable:!0,writable:!0}),v[k]}try{l({},"")}catch{l=function(k,T,N){return k[T]=N}}function f(v,k,T,N){var S=k&&k.prototype instanceof F?k:F,V=Object.create(S.prototype),$=new Q(N||[]);return V._invoke=(function(Y,cu,L){var G=b;return function(ru,Yt){if(G===E)throw new Error("Generator is already running");if(G===y){if(ru==="throw")throw Yt;return nu()}for(L.method=ru,L.arg=Yt;;){var Xt=L.delegate;if(Xt){var De=j(Xt,L);if(De){if(De===A)continue;return De}}if(L.method==="next")L.sent=L._sent=L.arg;else if(L.method==="throw"){if(G===b)throw G=y,L.arg;L.dispatchException(L.arg)}else L.method==="return"&&L.abrupt("return",L.arg);G=E;var Iu=x(Y,cu,L);if(Iu.type==="normal"){if(G=L.done?y:d,Iu.arg===A)continue;return{value:Iu.arg,done:L.done}}Iu.type==="throw"&&(G=y,L.method="throw",L.arg=Iu.arg)}}})(v,T,$),V}function x(v,k,T){try{return{type:"normal",arg:v.call(k,T)}}catch(N){return{type:"throw",arg:N}}}t.wrap=f;var b="suspendedStart",d="suspendedYield",E="executing",y="completed",A={};function F(){}function C(){}function p(){}var _={};l(_,i,(function(){return this}));var h=Object.getPrototypeOf,g=h&&h(h(M([])));g&&g!==r&&o.call(g,i)&&(_=g);var D=p.prototype=F.prototype=Object.create(_);function I(v){["next","throw","return"].forEach((function(k){l(v,k,(function(T){return this._invoke(k,T)}))}))}function B(v,k){function T(S,V,$,Y){var cu=x(v[S],v,V);if(cu.type!=="throw"){var L=cu.arg,G=L.value;return G&&typeof G=="object"&&o.call(G,"__await")?k.resolve(G.__await).then((function(ru){T("next",ru,$,Y)}),(function(ru){T("throw",ru,$,Y)})):k.resolve(G).then((function(ru){L.value=ru,$(L)}),(function(ru){return T("throw",ru,$,Y)}))}Y(cu.arg)}var N;this._invoke=function(S,V){function $(){return new k((function(Y,cu){T(S,V,Y,cu)}))}return N=N?N.then($,$):$()}}function j(v,k){var T=v.iterator[k.method];if(T===n){if(k.delegate=null,k.method==="throw"){if(v.iterator.return&&(k.method="return",k.arg=n,j(v,k),k.method==="throw"))return A;k.method="throw",k.arg=new TypeError("The iterator does not provide a 'throw' method")}return A}var N=x(T,v.iterator,k.arg);if(N.type==="throw")return k.method="throw",k.arg=N.arg,k.delegate=null,A;var S=N.arg;return S?S.done?(k[v.resultName]=S.value,k.next=v.nextLoc,k.method!=="return"&&(k.method="next",k.arg=n),k.delegate=null,A):S:(k.method="throw",k.arg=new TypeError("iterator result is not an object"),k.delegate=null,A)}function O(v){var k={tryLoc:v[0]};1 in v&&(k.catchLoc=v[1]),2 in v&&(k.finallyLoc=v[2],k.afterLoc=v[3]),this.tryEntries.push(k)}function q(v){var k=v.completion||{};k.type="normal",delete k.arg,v.completion=k}function Q(v){this.tryEntries=[{tryLoc:"root"}],v.forEach(O,this),this.reset(!0)}function M(v){if(v){var k=v[i];if(k)return k.call(v);if(typeof v.next=="function")return v;if(!isNaN(v.length)){var T=-1,N=function S(){for(;++T<v.length;)if(o.call(v,T))return S.value=v[T],S.done=!1,S;return S.value=n,S.done=!0,S};return N.next=N}}return{next:nu}}function nu(){return{value:n,done:!0}}return C.prototype=p,l(D,"constructor",p),l(p,"constructor",C),C.displayName=l(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(v){var k=typeof v=="function"&&v.constructor;return!!k&&(k===C||(k.displayName||k.name)==="GeneratorFunction")},t.mark=function(v){return Object.setPrototypeOf?Object.setPrototypeOf(v,p):(v.__proto__=p,l(v,s,"GeneratorFunction")),v.prototype=Object.create(D),v},t.awrap=function(v){return{__await:v}},I(B.prototype),l(B.prototype,a,(function(){return this})),t.AsyncIterator=B,t.async=function(v,k,T,N,S){S===void 0&&(S=Promise);var V=new B(f(v,k,T,N),S);return t.isGeneratorFunction(k)?V:V.next().then((function($){return $.done?$.value:V.next()}))},I(D),l(D,s,"Generator"),l(D,i,(function(){return this})),l(D,"toString",(function(){return"[object Generator]"})),t.keys=function(v){var k=[];for(var T in v)k.push(T);return k.reverse(),function N(){for(;k.length;){var S=k.pop();if(S in v)return N.value=S,N.done=!1,N}return N.done=!0,N}},t.values=M,Q.prototype={constructor:Q,reset:function(v){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(q),!v)for(var k in this)k.charAt(0)==="t"&&o.call(this,k)&&!isNaN(+k.slice(1))&&(this[k]=n)},stop:function(){this.done=!0;var v=this.tryEntries[0].completion;if(v.type==="throw")throw v.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var k=this;function T(cu,L){return V.type="throw",V.arg=v,k.next=cu,L&&(k.method="next",k.arg=n),!!L}for(var N=this.tryEntries.length-1;N>=0;--N){var S=this.tryEntries[N],V=S.completion;if(S.tryLoc==="root")return T("end");if(S.tryLoc<=this.prev){var $=o.call(S,"catchLoc"),Y=o.call(S,"finallyLoc");if($&&Y){if(this.prev<S.catchLoc)return T(S.catchLoc,!0);if(this.prev<S.finallyLoc)return T(S.finallyLoc)}else if($){if(this.prev<S.catchLoc)return T(S.catchLoc,!0)}else{if(!Y)throw new Error("try statement without catch or finally");if(this.prev<S.finallyLoc)return T(S.finallyLoc)}}}},abrupt:function(v,k){for(var T=this.tryEntries.length-1;T>=0;--T){var N=this.tryEntries[T];if(N.tryLoc<=this.prev&&o.call(N,"finallyLoc")&&this.prev<N.finallyLoc){var S=N;break}}S&&(v==="break"||v==="continue")&&S.tryLoc<=k&&k<=S.finallyLoc&&(S=null);var V=S?S.completion:{};return V.type=v,V.arg=k,S?(this.method="next",this.next=S.finallyLoc,A):this.complete(V)},complete:function(v,k){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&k&&(this.next=k),A},finish:function(v){for(var k=this.tryEntries.length-1;k>=0;--k){var T=this.tryEntries[k];if(T.finallyLoc===v)return this.complete(T.completion,T.afterLoc),q(T),A}},catch:function(v){for(var k=this.tryEntries.length-1;k>=0;--k){var T=this.tryEntries[k];if(T.tryLoc===v){var N=T.completion;if(N.type==="throw"){var S=N.arg;q(T)}return S}}throw new Error("illegal catch attempt")},delegateYield:function(v,k,T){return this.delegate={iterator:M(v),resultName:k,nextLoc:T},this.method==="next"&&(this.arg=n),A}},t})(u.exports);try{regeneratorRuntime=e}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}}},jt={};function K(u){var e=jt[u];if(e!==void 0)return e.exports;var t=jt[u]={exports:{}};return So[u](t,t.exports,K),t.exports}K.n=u=>{var e=u&&u.__esModule?()=>u.default:()=>u;return K.d(e,{a:e}),e},K.d=(u,e)=>{for(var t in e)K.o(e,t)&&!K.o(u,t)&&Object.defineProperty(u,t,{enumerable:!0,get:e[t]})},K.o=(u,e)=>Object.prototype.hasOwnProperty.call(u,e);var zt={};function ye(u,e){(e==null||e>u.length)&&(e=u.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=u[t];return n}function Rt(u,e){if(u){if(typeof u=="string")return ye(u,e);var t=Object.prototype.toString.call(u).slice(8,-1);return t==="Object"&&u.constructor&&(t=u.constructor.name),t==="Map"||t==="Set"?Array.from(u):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ye(u,e):void 0}}function Gu(u){return(function(e){if(Array.isArray(e))return ye(e)})(u)||(function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)})(u)||Rt(u)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
17
17
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Tu(u,e,t){return e in u?Object.defineProperty(u,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):u[e]=t,u}K.d(zt,{A:()=>Lo});const w=(qt={Fragment:()=>ou.Fragment,computed:()=>ou.computed,createTextVNode:()=>ou.createTextVNode,createVNode:()=>ou.createVNode,defineComponent:()=>ou.defineComponent,reactive:()=>ou.reactive,ref:()=>ou.ref,watch:()=>ou.watch,watchEffect:()=>ou.watchEffect},Ce={},K.d(Ce,qt),Ce),To=(0,w.defineComponent)({props:{data:{required:!0,type:String},onClick:Function},render:function(){var u=this.data,e=this.onClick;return(0,w.createVNode)("span",{class:"vjs-tree-brackets",onClick:e},[u])}}),Io=(0,w.defineComponent)({emits:["change","update:modelValue"],props:{checked:{type:Boolean,default:!1},isMultiple:Boolean,onChange:Function},setup:function(u,e){var t=e.emit;return{uiType:(0,w.computed)((function(){return u.isMultiple?"checkbox":"radio"})),model:(0,w.computed)({get:function(){return u.checked},set:function(n){return t("update:modelValue",n)}})}},render:function(){var u=this.uiType,e=this.model,t=this.$emit;return(0,w.createVNode)("label",{class:["vjs-check-controller",e?"is-checked":""],onClick:function(n){return n.stopPropagation()}},[(0,w.createVNode)("span",{class:"vjs-check-controller-inner is-".concat(u)},null),(0,w.createVNode)("input",{checked:e,class:"vjs-check-controller-original is-".concat(u),type:u,onChange:function(){return t("change",e)}},null)])}}),Bo=(0,w.defineComponent)({props:{nodeType:{required:!0,type:String},onClick:Function},render:function(){var u=this.nodeType,e=this.onClick,t=u==="objectStart"||u==="arrayStart";return t||u==="objectCollapsed"||u==="arrayCollapsed"?(0,w.createVNode)("span",{class:"vjs-carets vjs-carets-".concat(t?"open":"close"),onClick:e},[(0,w.createVNode)("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},[(0,w.createVNode)("path",{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"},null)])]):null}});var qt,Ce;function ve(u){return ve=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ve(u)}function Vt(u){return Object.prototype.toString.call(u).slice(8,-1).toLowerCase()}function hu(u){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"root",t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=(arguments.length>3?arguments[3]:void 0)||{},r=n.key,o=n.index,c=n.type,i=c===void 0?"content":c,a=n.showComma,s=a!==void 0&&a,l=n.length,f=l===void 0?1:l,x=Vt(u);if(x==="array"){var b=$t(u.map((function(y,A,F){return hu(y,"".concat(e,"[").concat(A,"]"),t+1,{index:A,showComma:A!==F.length-1,length:f,type:i})})));return[hu("[",e,t,{showComma:!1,key:r,length:u.length,type:"arrayStart"})[0]].concat(b,hu("]",e,t,{showComma:s,length:u.length,type:"arrayEnd"})[0])}if(x==="object"){var d=Object.keys(u),E=$t(d.map((function(y,A,F){return hu(u[y],/^[a-zA-Z_]\w*$/.test(y)?"".concat(e,".").concat(y):"".concat(e,'["').concat(y,'"]'),t+1,{key:y,showComma:A!==F.length-1,length:f,type:i})})));return[hu("{",e,t,{showComma:!1,key:r,index:o,length:d.length,type:"objectStart"})[0]].concat(E,hu("}",e,t,{showComma:s,length:d.length,type:"objectEnd"})[0])}return[{content:u,level:t,key:r,index:o,path:e,showComma:s,length:f,type:i}]}function $t(u){if(typeof Array.prototype.flat=="function")return u.flat();for(var e=Gu(u),t=[];e.length;){var n=e.shift();Array.isArray(n)?e.unshift.apply(e,Gu(n)):t.push(n)}return t}function Ee(u){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new WeakMap;if(u==null)return u;if(u instanceof Date)return new Date(u);if(u instanceof RegExp)return new RegExp(u);if(ve(u)!=="object")return u;if(e.get(u))return e.get(u);if(Array.isArray(u)){var t=u.map((function(o){return Ee(o,e)}));return e.set(u,t),t}var n={};for(var r in u)n[r]=Ee(u[r],e);return e.set(u,n),n}function Ht(u,e,t,n,r,o,c){try{var i=u[o](c),a=i.value}catch(s){return void t(s)}i.done?e(a):Promise.resolve(a).then(n,r)}var No=K(207),Ut=K.n(No);function Zt(u,e){var t=Object.keys(u);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(u);e&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(u,r).enumerable}))),t.push.apply(t,n)}return t}function Gt(u){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Zt(Object(t),!0).forEach((function(n){Tu(u,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(t)):Zt(Object(t)).forEach((function(n){Object.defineProperty(u,n,Object.getOwnPropertyDescriptor(t,n))}))}return u}var Wt={data:{type:[String,Number,Boolean,Array,Object],default:null},rootPath:{type:String,default:"root"},indent:{type:Number,default:2},showLength:{type:Boolean,default:!1},showDoubleQuotes:{type:Boolean,default:!0},renderNodeKey:Function,renderNodeValue:Function,renderNodeActions:{type:[Boolean,Function],default:void 0},selectableType:String,showSelectController:{type:Boolean,default:!1},showLine:{type:Boolean,default:!0},showLineNumber:{type:Boolean,default:!1},selectOnClickNode:{type:Boolean,default:!0},nodeSelectable:{type:Function,default:function(){return!0}},highlightSelectedNode:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!1},theme:{type:String,default:"light"},showKeyValueSpace:{type:Boolean,default:!0},editable:{type:Boolean,default:!1},editableTrigger:{type:String,default:"click"},onNodeClick:{type:Function},onNodeMouseover:{type:Function},onBracketsClick:{type:Function},onIconClick:{type:Function},onValueChange:{type:Function}};const Oo=(0,w.defineComponent)({name:"TreeNode",props:Gt(Gt({},Wt),{},{node:{type:Object,required:!0},collapsed:Boolean,checked:Boolean,style:Object,onSelectedChange:{type:Function}}),emits:["nodeClick","nodeMouseover","bracketsClick","iconClick","selectedChange","valueChange"],setup:function(u,e){var t=e.emit,n=(0,w.computed)((function(){return Vt(u.node.content)})),r=(0,w.computed)((function(){return"vjs-value vjs-value-".concat(n.value)})),o=(0,w.computed)((function(){return u.showDoubleQuotes?'"'.concat(u.node.key,'"'):u.node.key})),c=(0,w.computed)((function(){return u.selectableType==="multiple"})),i=(0,w.computed)((function(){return u.selectableType==="single"})),a=(0,w.computed)((function(){return u.nodeSelectable(u.node)&&(c.value||i.value)})),s=(0,w.reactive)({editing:!1}),l=function(h){var g,D,I=(D=(g=h.target)===null||g===void 0?void 0:g.value)==="null"?null:D==="undefined"?void 0:D==="true"||D!=="false"&&(D[0]+D[D.length-1]==='""'||D[0]+D[D.length-1]==="''"?D.slice(1,-1):typeof Number(D)=="number"&&!isNaN(Number(D))||D==="NaN"?Number(D):D);t("valueChange",I,u.node.path)},f=(0,w.computed)((function(){var h,g=(h=u.node)===null||h===void 0?void 0:h.content;return g===null?g="null":g===void 0&&(g="undefined"),n.value==="string"?'"'.concat(g,'"'):g+""})),x=function(){var h=u.renderNodeValue;return h?h({node:u.node,defaultValue:f.value}):f.value},b=function(){t("bracketsClick",!u.collapsed,u.node)},d=function(){t("iconClick",!u.collapsed,u.node)},E=function(){t("selectedChange",u.node)},y=function(){t("nodeClick",u.node),a.value&&u.selectOnClickNode&&t("selectedChange",u.node)},A=function(){t("nodeMouseover",u.node)},F=function(h){if(u.editable&&!s.editing){s.editing=!0;var g=function D(I){var B;I.target!==h.target&&((B=I.target)===null||B===void 0?void 0:B.parentElement)!==h.target&&(s.editing=!1,document.removeEventListener("click",D))};document.removeEventListener("click",g),document.addEventListener("click",g)}},C=(function(){var h=(0,w.ref)(!1),g=(function(){var D,I=(D=Ut().mark((function B(j){return Ut().wrap((function(O){for(;;)switch(O.prev=O.next){case 0:return O.prev=0,O.next=3,navigator.clipboard.writeText(j);case 3:h.value=!0,setTimeout((function(){h.value=!1}),300),O.next=10;break;case 7:O.prev=7,O.t0=O.catch(0),console.error("[vue-json-pretty] Copy failed: ",O.t0);case 10:case"end":return O.stop()}}),B,null,[[0,7]])})),function(){var B=this,j=arguments;return new Promise((function(O,q){var Q=D.apply(B,j);function M(v){Ht(Q,O,q,M,nu,"next",v)}function nu(v){Ht(Q,O,q,M,nu,"throw",v)}M(void 0)}))});return function(B){return I.apply(this,arguments)}})();return{copy:g}})().copy,p=function(){var h=u.node,g=h.key,D=h.path,I=u.rootPath,B=new Function("data","return data".concat(D.slice(I.length)))(u.data),j=JSON.stringify(g?Tu({},g,B):B,null,2);C(j)},_=function(){var h=u.renderNodeActions;if(!h)return null;var g={copy:p};return typeof h=="function"?h({node:u.node,defaultActions:g}):(0,w.createVNode)("span",{onClick:p,class:"vjs-tree-node-actions-item"},[(0,w.createTextVNode)("copy")])};return function(){var h,g=u.node;return(0,w.createVNode)("div",{class:{"vjs-tree-node":!0,"has-selector":u.showSelectController,"has-carets":u.showIcon,"is-highlight":u.highlightSelectedNode&&u.checked,dark:u.theme==="dark"},onClick:y,onMouseover:A,style:u.style},[u.showLineNumber&&(0,w.createVNode)("span",{class:"vjs-node-index"},[g.id+1]),u.showSelectController&&a.value&&g.type!=="objectEnd"&&g.type!=="arrayEnd"&&(0,w.createVNode)(Io,{isMultiple:c.value,checked:u.checked,onChange:E},null),(0,w.createVNode)("div",{class:"vjs-indent"},[Array.from(Array(g.level)).map((function(D,I){return(0,w.createVNode)("div",{key:I,class:{"vjs-indent-unit":!0,"has-line":u.showLine}},[Array.from(Array(u.indent)).map((function(){return(0,w.createVNode)(w.Fragment,null,[(0,w.createTextVNode)(" ")])}))])})),u.showIcon&&(0,w.createVNode)(Bo,{nodeType:g.type,onClick:d},null)]),g.key&&(0,w.createVNode)("span",{class:"vjs-key"},[(h=u.renderNodeKey,h?h({node:u.node,defaultKey:o.value||""}):o.value),(0,w.createVNode)("span",{class:"vjs-colon"},[":".concat(u.showKeyValueSpace?" ":"")])]),(0,w.createVNode)("span",null,[g.type!=="content"&&g.content?(0,w.createVNode)(To,{data:g.content.toString(),onClick:b},null):(0,w.createVNode)("span",{class:r.value,onClick:!u.editable||u.editableTrigger&&u.editableTrigger!=="click"?void 0:F,onDblclick:u.editable&&u.editableTrigger==="dblclick"?F:void 0},[u.editable&&s.editing?(0,w.createVNode)("input",{value:f.value,onChange:l,style:{padding:"3px 8px",border:"1px solid #eee",boxShadow:"none",boxSizing:"border-box",borderRadius:5,fontFamily:"inherit"}},null):x()]),g.showComma&&(0,w.createVNode)("span",null,[","]),u.showLength&&u.collapsed&&(0,w.createVNode)("span",{class:"vjs-comment"},[(0,w.createTextVNode)(" // "),g.length,(0,w.createTextVNode)(" items ")])]),u.renderNodeActions&&(0,w.createVNode)("span",{class:"vjs-tree-node-actions"},[_()])])}}});function Qt(u,e){var t=Object.keys(u);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(u);e&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(u,r).enumerable}))),t.push.apply(t,n)}return t}function Z(u){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Qt(Object(t),!0).forEach((function(n){Tu(u,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(t)):Qt(Object(t)).forEach((function(n){Object.defineProperty(u,n,Object.getOwnPropertyDescriptor(t,n))}))}return u}const Lo=(0,w.defineComponent)({name:"Tree",props:Z(Z({},Wt),{},{collapsedNodeLength:{type:Number,default:1/0},deep:{type:Number,default:1/0},pathCollapsible:{type:Function,default:function(){return!1}},virtual:{type:Boolean,default:!1},height:{type:Number,default:400},itemHeight:{type:Number,default:20},selectedValue:{type:[String,Array],default:function(){return""}},collapsedOnClickBrackets:{type:Boolean,default:!0},style:Object,onSelectedChange:{type:Function},theme:{type:String,default:"light"}}),slots:["renderNodeKey","renderNodeValue","renderNodeActions"],emits:["nodeClick","nodeMouseover","bracketsClick","iconClick","selectedChange","update:selectedValue","update:data"],setup:function(u,e){var t=e.emit,n=e.slots,r=(0,w.ref)(),o=(0,w.computed)((function(){return hu(u.data,u.rootPath)})),c=function(p,_){return o.value.reduce((function(h,g){var D,I=g.level>=p||g.length>=_,B=(D=u.pathCollapsible)===null||D===void 0?void 0:D.call(u,g);return g.type!=="objectStart"&&g.type!=="arrayStart"||!I&&!B?h:Z(Z({},h),{},Tu({},g.path,1))}),{})},i=(0,w.reactive)({translateY:0,visibleData:null,hiddenPaths:c(u.deep,u.collapsedNodeLength)}),a=(0,w.computed)((function(){for(var p=null,_=[],h=o.value.length,g=0;g<h;g++){var D=Z(Z({},o.value[g]),{},{id:g}),I=i.hiddenPaths[D.path];if(p&&p.path===D.path){var B=p.type==="objectStart",j=Z(Z(Z({},D),p),{},{showComma:D.showComma,content:B?"{...}":"[...]",type:B?"objectCollapsed":"arrayCollapsed"});p=null,_.push(j)}else{if(I&&!p){p=D;continue}if(p)continue;_.push(D)}}return _})),s=(0,w.computed)((function(){var p=u.selectedValue;return p&&u.selectableType==="multiple"&&Array.isArray(p)?p:[p]})),l=(0,w.computed)((function(){return!u.selectableType||u.selectOnClickNode||u.showSelectController?"":"When selectableType is not null, selectOnClickNode and showSelectController cannot be false at the same time, because this will cause the selection to fail."})),f=function(){var p=a.value;if(u.virtual){var _,h=u.height/u.itemHeight,g=((_=r.value)===null||_===void 0?void 0:_.scrollTop)||0,D=Math.floor(g/u.itemHeight),I=D<0?0:D+h>p.length?p.length-h:D;I<0&&(I=0);var B=I+h;i.translateY=I*u.itemHeight,i.visibleData=p.filter((function(j,O){return O>=I&&O<B}))}else i.visibleData=p},x=function(){f()},b=function(p){var _,h,g=p.path,D=u.selectableType;if(D==="multiple"){var I=s.value.findIndex((function(q){return q===g})),B=Gu(s.value);I!==-1?B.splice(I,1):B.push(g),t("update:selectedValue",B),t("selectedChange",B,Gu(s.value))}else if(D==="single"&&s.value[0]!==g){var j=(_=s.value,h=1,(function(q){if(Array.isArray(q))return q})(_)||(function(q,Q){var M=q==null?null:typeof Symbol<"u"&&q[Symbol.iterator]||q["@@iterator"];if(M!=null){var nu,v,k=[],T=!0,N=!1;try{for(M=M.call(q);!(T=(nu=M.next()).done)&&(k.push(nu.value),!Q||k.length!==Q);T=!0);}catch(S){N=!0,v=S}finally{try{T||M.return==null||M.return()}finally{if(N)throw v}}return k}})(_,h)||Rt(_,h)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
18
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})())[0],O=g;t("update:selectedValue",O),t("selectedChange",O,j)}},d=function(p){t("nodeClick",p)},E=function(p){t("nodeMouseover",p)},y=function(p,_){if(p)i.hiddenPaths=Z(Z({},i.hiddenPaths),{},Tu({},_,1));else{var h=Z({},i.hiddenPaths);delete h[_],i.hiddenPaths=h}},A=function(p,_){u.collapsedOnClickBrackets&&y(p,_.path),t("bracketsClick",p,_)},F=function(p,_){y(p,_.path),t("iconClick",p,_)},C=function(p,_){var h=Ee(u.data),g=u.rootPath;new Function("data","val","data".concat(_.slice(g.length),"=val"))(h,p),t("update:data",h)};return(0,w.watchEffect)((function(){l.value&&(function(p){throw new Error("[VueJSONPretty] ".concat(p))})(l.value)})),(0,w.watchEffect)((function(){a.value&&f()})),(0,w.watch)((function(){return u.deep}),(function(p){p&&(i.hiddenPaths=c(p,u.collapsedNodeLength))})),(0,w.watch)((function(){return u.collapsedNodeLength}),(function(p){p&&(i.hiddenPaths=c(u.deep,p))})),function(){var p,_,h,g,D=(p=u.renderNodeKey)!==null&&p!==void 0?p:n.renderNodeKey,I=(_=u.renderNodeValue)!==null&&_!==void 0?_:n.renderNodeValue,B=(h=(g=u.renderNodeActions)!==null&&g!==void 0?g:n.renderNodeActions)!==null&&h!==void 0&&h,j=i.visibleData&&i.visibleData.map((function(O){return(0,w.createVNode)(Oo,{key:O.id,data:u.data,rootPath:u.rootPath,indent:u.indent,node:O,collapsed:!!i.hiddenPaths[O.path],theme:u.theme,showDoubleQuotes:u.showDoubleQuotes,showLength:u.showLength,checked:s.value.includes(O.path),selectableType:u.selectableType,showLine:u.showLine,showLineNumber:u.showLineNumber,showSelectController:u.showSelectController,selectOnClickNode:u.selectOnClickNode,nodeSelectable:u.nodeSelectable,highlightSelectedNode:u.highlightSelectedNode,editable:u.editable,editableTrigger:u.editableTrigger,showIcon:u.showIcon,showKeyValueSpace:u.showKeyValueSpace,renderNodeKey:D,renderNodeValue:I,renderNodeActions:B,onNodeClick:d,onNodeMouseover:E,onBracketsClick:A,onIconClick:F,onSelectedChange:b,onValueChange:C,style:u.itemHeight&&u.itemHeight!==20?{lineHeight:"".concat(u.itemHeight,"px")}:{}},null)}));return(0,w.createVNode)("div",{ref:r,class:{"vjs-tree":!0,"is-virtual":u.virtual,dark:u.theme==="dark"},onScroll:u.virtual?x:void 0,style:u.showLineNumber?Z({paddingLeft:"".concat(12*Number(o.value.length.toString().length),"px")},u.style):u.style},[u.virtual?(0,w.createVNode)("div",{class:"vjs-tree-list",style:{height:"".concat(u.height,"px")}},[(0,w.createVNode)("div",{class:"vjs-tree-list-holder",style:{height:"".concat(a.value.length*u.itemHeight,"px")}},[(0,w.createVNode)("div",{class:"vjs-tree-list-holder-inner",style:{transform:"translateY(".concat(i.translateY,"px)")}},[j])])]):j])}}});var Po=zt.A;const Mo=["src","alt"],jo=m.defineComponent({__name:"ImageViewer",props:{show:{type:Boolean},imageUrl:{},alt:{}},emits:["close"],setup(u){return(e,t)=>(m.openBlock(),m.createBlock(m.Teleport,{to:"body"},[m.createVNode(m.Transition,{name:"viewer"},{default:m.withCtx(()=>[u.show?(m.openBlock(),m.createElementBlock("div",{key:0,class:"image-viewer",onClick:t[2]||(t[2]=n=>e.$emit("close"))},[m.createElementVNode("button",{class:"close-button",onClick:t[0]||(t[0]=m.withModifiers(n=>e.$emit("close"),["stop"]))},[m.createVNode(m.unref(du),{icon:"mdi:close"})]),m.createElementVNode("div",{class:"viewer-content",onClick:t[1]||(t[1]=m.withModifiers(()=>{},["stop"]))},[m.createElementVNode("img",{src:u.imageUrl,alt:u.alt},null,8,Mo)])])):m.createCommentVNode("",!0)]),_:1})]))}}),Jt=(u,e)=>{const t=u.__vccOpts||u;for(const[n,r]of e)t[n]=r;return t},Kt=Jt(jo,[["__scopeId","data-v-89ef4163"]]),zo={class:"message-content-renderer"},Ro=["innerHTML"],qo={key:1,class:"content-user-message"},Vo=["innerHTML"],$o={class:"files-grid"},Ho=["src","onClick"],Uo=["src"],Zo=["src"],Go=["onClick"],Wo={class:"file-name"},Qo={class:"file-name"},Jo={key:3,class:"content-image"},Ko=["src"],Yo={key:4,class:"content-voice"},Xo=["src"],uc={key:5,class:"content-medialib"},ec=["src"],tc=["src"],nc=["src"],rc={class:"file-name"},oc=Jt(m.defineComponent({__name:"MessageContentRenderer",props:{content:{}},setup(u){const e=u,t=m.computed(()=>{if(typeof e.content=="string"){try{const C=JSON.parse(e.content),p=h=>h&&typeof h=="object"&&!Array.isArray(h)&&("texts"in h||"files"in h)&&!("type"in h),_=h=>{const g=["text","file","image","voice","medialib"];return h&&typeof h=="object"&&!Array.isArray(h)&&typeof h.type=="string"&&g.includes(h.type)&&"content"in h};if(Array.isArray(C)){const h=[],g=[];for(const I of C)p(I)&&(Array.isArray(I.texts)&&h.push(...I.texts.filter(Boolean)),Array.isArray(I.files)&&g.push(...I.files.filter(Boolean)));if(h.length>0||g.length>0)return{texts:h,files:g};const D=C[0];if(p(D)||_(D))return D}if(p(C)||_(C))return C}catch{}return{type:"text",content:e.content}}return e.content});function n(C){return!("type"in C)}const r=new W({html:!0,linkify:!0,typographer:!0}),o=m.computed(()=>!n(t.value)&&t.value.type==="text"?r.render(t.value.content):""),c=m.ref(!1),i=m.ref("");function a(){n(t.value)||(t.value.type==="image"?(i.value=t.value.content,c.value=!0):t.value.type==="medialib"&&A.value==="image"&&(i.value=E.value,c.value=!0))}function s(C){i.value=C,c.value=!0}function l(C){try{const h=new URL(C).pathname.split("/");return h[h.length-1]||"未知文件"}catch{return"未知文件"}}function f(){n(t.value)||window.open(t.value.content,"_blank")}function x(C){window.open(C,"_blank")}function b(C){if(!C)return"file";const p=C.toLowerCase();return p.match(/\.(mp4|webm|ogg|mov|avi|wmv|flv|mkv)$/)?"video":p.match(/\.(jpg|jpeg|png|gif|bmp|webp|svg)$/)?"image":p.match(/\.(mp3|wav|ogg|aac|flac|m4a)$/)?"audio":"file"}const d=m.computed(()=>{if(!n(t.value)&&t.value.type==="medialib")try{return JSON.parse(t.value.content)}catch{return null}return null}),E=m.computed(()=>d.value?.file_url||""),y=m.computed(()=>d.value?.file_name||l(E.value)),A=m.computed(()=>{if(!E.value)return"json";const C=E.value.toLowerCase();return C.match(/\.(mp4|webm|ogg|mov|avi|wmv|flv|mkv)$/)?"video":C.match(/\.(jpg|jpeg|png|gif|bmp|webp|svg)$/)?"image":C.match(/\.(mp3|wav|ogg|aac|flac|m4a)$/)?"audio":"file"});function F(){E.value&&window.open(E.value,"_blank")}return(C,p)=>(m.openBlock(),m.createElementBlock("div",zo,[!n(t.value)&&t.value.type==="text"?(m.openBlock(),m.createElementBlock("div",{key:0,class:"content-text",innerHTML:o.value},null,8,Ro)):n(t.value)?(m.openBlock(),m.createElementBlock("div",qo,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(t.value.texts,(_,h)=>(m.openBlock(),m.createElementBlock("div",{key:`text-${h}`,class:"content-text",innerHTML:m.unref(r).render(_)},null,8,Vo))),128)),m.createElementVNode("div",$o,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(t.value.files,(_,h)=>(m.openBlock(),m.createElementBlock("div",{key:`file-${h}`,class:"file-item"},[b(_)==="image"?(m.openBlock(),m.createElementBlock("img",{key:0,src:_,alt:"图片",class:"file-image",onClick:g=>s(_)},null,8,Ho)):b(_)==="video"?(m.openBlock(),m.createElementBlock("video",{key:1,controls:"",src:_,class:"file-video video"},"您的浏览器不支持视频播放",8,Uo)):b(_)==="audio"?(m.openBlock(),m.createElementBlock("audio",{key:2,controls:"",src:_,class:"file-audio audio"},"您的浏览器不支持音频播放",8,Zo)):(m.openBlock(),m.createElementBlock("div",{key:3,class:"content-file",onClick:g=>x(_)},[m.createVNode(m.unref(du),{icon:"mdi:file-document-outline",class:"file-icon"}),m.createElementVNode("span",Wo,m.toDisplayString(l(_)),1),m.createVNode(m.unref(du),{icon:"mdi:download",class:"download-icon"})],8,Go))]))),128))])])):!n(t.value)&&t.value.type==="file"?(m.openBlock(),m.createElementBlock("div",{key:2,class:"content-file",onClick:f},[m.createVNode(m.unref(du),{icon:"mdi:file-document-outline",class:"file-icon"}),m.createElementVNode("span",Qo,m.toDisplayString(l(t.value.content)),1),m.createVNode(m.unref(du),{icon:"mdi:download",class:"download-icon"})])):!n(t.value)&&t.value.type==="image"?(m.openBlock(),m.createElementBlock("div",Jo,[m.createElementVNode("img",{src:t.value.content,alt:"图片",onClick:a},null,8,Ko)])):!n(t.value)&&t.value.type==="voice"?(m.openBlock(),m.createElementBlock("div",Yo,[m.createElementVNode("audio",{controls:"",src:t.value.content,class:"audio"},"您的浏览器不支持音频播放",8,Xo)])):!n(t.value)&&t.value.type==="medialib"?(m.openBlock(),m.createElementBlock("div",uc,[A.value==="video"?(m.openBlock(),m.createElementBlock("video",{key:0,controls:"",src:E.value,class:"medialib-video video"}," 您的浏览器不支持视频播放 ",8,ec)):A.value==="image"?(m.openBlock(),m.createElementBlock("img",{key:1,src:E.value,alt:"图片",class:"medialib-image",onClick:a},null,8,tc)):A.value==="audio"?(m.openBlock(),m.createElementBlock("audio",{key:2,controls:"",src:E.value,class:"medialib-audio audio"}," 您的浏览器不支持音频播放 ",8,nc)):A.value==="file"?(m.openBlock(),m.createElementBlock("div",{key:3,class:"content-file",onClick:F},[m.createVNode(m.unref(du),{icon:"mdi:file-document-outline",class:"file-icon"}),m.createElementVNode("span",rc,m.toDisplayString(y.value),1),m.createVNode(m.unref(du),{icon:"mdi:download",class:"download-icon"})])):(m.openBlock(),m.createBlock(m.unref(Po),{key:4,data:d.value,deep:3,class:"json-viewer"},null,8,["data"]))])):m.createCommentVNode("",!0),m.createVNode(Kt,{show:c.value,"image-url":i.value,onClose:p[0]||(p[0]=_=>c.value=!1)},null,8,["show","image-url"])]))}}),[["__scopeId","data-v-07efc606"]]);iu.ImageViewer=Kt,iu.MessageContentRenderer=oc,Object.defineProperty(iu,Symbol.toStringTag,{value:"Module"})}));
18
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})())[0],O=g;t("update:selectedValue",O),t("selectedChange",O,j)}},d=function(p){t("nodeClick",p)},E=function(p){t("nodeMouseover",p)},y=function(p,_){if(p)i.hiddenPaths=Z(Z({},i.hiddenPaths),{},Tu({},_,1));else{var h=Z({},i.hiddenPaths);delete h[_],i.hiddenPaths=h}},A=function(p,_){u.collapsedOnClickBrackets&&y(p,_.path),t("bracketsClick",p,_)},F=function(p,_){y(p,_.path),t("iconClick",p,_)},C=function(p,_){var h=Ee(u.data),g=u.rootPath;new Function("data","val","data".concat(_.slice(g.length),"=val"))(h,p),t("update:data",h)};return(0,w.watchEffect)((function(){l.value&&(function(p){throw new Error("[VueJSONPretty] ".concat(p))})(l.value)})),(0,w.watchEffect)((function(){a.value&&f()})),(0,w.watch)((function(){return u.deep}),(function(p){p&&(i.hiddenPaths=c(p,u.collapsedNodeLength))})),(0,w.watch)((function(){return u.collapsedNodeLength}),(function(p){p&&(i.hiddenPaths=c(u.deep,p))})),function(){var p,_,h,g,D=(p=u.renderNodeKey)!==null&&p!==void 0?p:n.renderNodeKey,I=(_=u.renderNodeValue)!==null&&_!==void 0?_:n.renderNodeValue,B=(h=(g=u.renderNodeActions)!==null&&g!==void 0?g:n.renderNodeActions)!==null&&h!==void 0&&h,j=i.visibleData&&i.visibleData.map((function(O){return(0,w.createVNode)(Oo,{key:O.id,data:u.data,rootPath:u.rootPath,indent:u.indent,node:O,collapsed:!!i.hiddenPaths[O.path],theme:u.theme,showDoubleQuotes:u.showDoubleQuotes,showLength:u.showLength,checked:s.value.includes(O.path),selectableType:u.selectableType,showLine:u.showLine,showLineNumber:u.showLineNumber,showSelectController:u.showSelectController,selectOnClickNode:u.selectOnClickNode,nodeSelectable:u.nodeSelectable,highlightSelectedNode:u.highlightSelectedNode,editable:u.editable,editableTrigger:u.editableTrigger,showIcon:u.showIcon,showKeyValueSpace:u.showKeyValueSpace,renderNodeKey:D,renderNodeValue:I,renderNodeActions:B,onNodeClick:d,onNodeMouseover:E,onBracketsClick:A,onIconClick:F,onSelectedChange:b,onValueChange:C,style:u.itemHeight&&u.itemHeight!==20?{lineHeight:"".concat(u.itemHeight,"px")}:{}},null)}));return(0,w.createVNode)("div",{ref:r,class:{"vjs-tree":!0,"is-virtual":u.virtual,dark:u.theme==="dark"},onScroll:u.virtual?x:void 0,style:u.showLineNumber?Z({paddingLeft:"".concat(12*Number(o.value.length.toString().length),"px")},u.style):u.style},[u.virtual?(0,w.createVNode)("div",{class:"vjs-tree-list",style:{height:"".concat(u.height,"px")}},[(0,w.createVNode)("div",{class:"vjs-tree-list-holder",style:{height:"".concat(a.value.length*u.itemHeight,"px")}},[(0,w.createVNode)("div",{class:"vjs-tree-list-holder-inner",style:{transform:"translateY(".concat(i.translateY,"px)")}},[j])])]):j])}}});var Po=zt.A;const Mo=["src","alt"],jo=m.defineComponent({__name:"ImageViewer",props:{show:{type:Boolean},imageUrl:{},alt:{}},emits:["close"],setup(u){return(e,t)=>(m.openBlock(),m.createBlock(m.Teleport,{to:"body"},[m.createVNode(m.Transition,{name:"viewer"},{default:m.withCtx(()=>[u.show?(m.openBlock(),m.createElementBlock("div",{key:0,class:"image-viewer",onClick:t[2]||(t[2]=n=>e.$emit("close"))},[m.createElementVNode("div",{class:"close-button",onClick:t[0]||(t[0]=m.withModifiers(n=>e.$emit("close"),["stop"]))},[m.createVNode(m.unref(du),{icon:"mdi:close"})]),m.createElementVNode("div",{class:"viewer-content",onClick:t[1]||(t[1]=m.withModifiers(()=>{},["stop"]))},[m.createElementVNode("img",{src:u.imageUrl,alt:u.alt},null,8,Mo)])])):m.createCommentVNode("",!0)]),_:1})]))}}),Jt=(u,e)=>{const t=u.__vccOpts||u;for(const[n,r]of e)t[n]=r;return t},Kt=Jt(jo,[["__scopeId","data-v-92c159ee"]]),zo={class:"message-content-renderer"},Ro=["innerHTML"],qo={key:1,class:"content-user-message"},Vo=["innerHTML"],$o={class:"files-grid"},Ho=["src","onClick"],Uo=["src"],Zo=["src"],Go=["onClick"],Wo={class:"file-name"},Qo={class:"file-name"},Jo={key:3,class:"content-image"},Ko=["src"],Yo={key:4,class:"content-voice"},Xo=["src"],uc={key:5,class:"content-medialib"},ec=["src"],tc=["src"],nc=["src"],rc={class:"file-name"},oc=Jt(m.defineComponent({__name:"MessageContentRenderer",props:{content:{}},setup(u){const e=u,t=m.computed(()=>{if(typeof e.content=="string"){try{const C=JSON.parse(e.content),p=h=>h&&typeof h=="object"&&!Array.isArray(h)&&("texts"in h||"files"in h)&&!("type"in h),_=h=>{const g=["text","file","image","voice","medialib"];return h&&typeof h=="object"&&!Array.isArray(h)&&typeof h.type=="string"&&g.includes(h.type)&&"content"in h};if(Array.isArray(C)){const h=[],g=[];for(const I of C)p(I)&&(Array.isArray(I.texts)&&h.push(...I.texts.filter(Boolean)),Array.isArray(I.files)&&g.push(...I.files.filter(Boolean)));if(h.length>0||g.length>0)return{texts:h,files:g};const D=C[0];if(p(D)||_(D))return D}if(p(C)||_(C))return C}catch{}return{type:"text",content:e.content}}return e.content});function n(C){return!("type"in C)}const r=new W({html:!0,linkify:!0,typographer:!0}),o=m.computed(()=>!n(t.value)&&t.value.type==="text"?r.render(t.value.content):""),c=m.ref(!1),i=m.ref("");function a(){n(t.value)||(t.value.type==="image"?(i.value=t.value.content,c.value=!0):t.value.type==="medialib"&&A.value==="image"&&(i.value=E.value,c.value=!0))}function s(C){i.value=C,c.value=!0}function l(C){try{const h=new URL(C).pathname.split("/");return h[h.length-1]||"未知文件"}catch{return"未知文件"}}function f(){n(t.value)||window.open(t.value.content,"_blank")}function x(C){window.open(C,"_blank")}function b(C){if(!C)return"file";const p=C.toLowerCase();return p.match(/\.(mp4|webm|ogg|mov|avi|wmv|flv|mkv)$/)?"video":p.match(/\.(jpg|jpeg|png|gif|bmp|webp|svg)$/)?"image":p.match(/\.(mp3|wav|ogg|aac|flac|m4a)$/)?"audio":"file"}const d=m.computed(()=>{if(!n(t.value)&&t.value.type==="medialib")try{return JSON.parse(t.value.content)}catch{return null}return null}),E=m.computed(()=>d.value?.file_url||""),y=m.computed(()=>d.value?.file_name||l(E.value)),A=m.computed(()=>{if(!E.value)return"json";const C=E.value.toLowerCase();return C.match(/\.(mp4|webm|ogg|mov|avi|wmv|flv|mkv)$/)?"video":C.match(/\.(jpg|jpeg|png|gif|bmp|webp|svg)$/)?"image":C.match(/\.(mp3|wav|ogg|aac|flac|m4a)$/)?"audio":"file"});function F(){E.value&&window.open(E.value,"_blank")}return(C,p)=>(m.openBlock(),m.createElementBlock("div",zo,[!n(t.value)&&t.value.type==="text"?(m.openBlock(),m.createElementBlock("div",{key:0,class:"content-text",innerHTML:o.value},null,8,Ro)):n(t.value)?(m.openBlock(),m.createElementBlock("div",qo,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(t.value.texts,(_,h)=>(m.openBlock(),m.createElementBlock("div",{key:`text-${h}`,class:"content-text",innerHTML:m.unref(r).render(_)},null,8,Vo))),128)),m.createElementVNode("div",$o,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(t.value.files,(_,h)=>(m.openBlock(),m.createElementBlock("div",{key:`file-${h}`,class:"file-item"},[b(_)==="image"?(m.openBlock(),m.createElementBlock("img",{key:0,src:_,alt:"图片",class:"file-image",onClick:g=>s(_)},null,8,Ho)):b(_)==="video"?(m.openBlock(),m.createElementBlock("video",{key:1,controls:"",src:_,class:"file-video video"},"您的浏览器不支持视频播放",8,Uo)):b(_)==="audio"?(m.openBlock(),m.createElementBlock("audio",{key:2,controls:"",src:_,class:"file-audio audio"},"您的浏览器不支持音频播放",8,Zo)):(m.openBlock(),m.createElementBlock("div",{key:3,class:"content-file",onClick:g=>x(_)},[m.createVNode(m.unref(du),{icon:"mdi:file-document-outline",class:"file-icon"}),m.createElementVNode("span",Wo,m.toDisplayString(l(_)),1),m.createVNode(m.unref(du),{icon:"mdi:download",class:"download-icon"})],8,Go))]))),128))])])):!n(t.value)&&t.value.type==="file"?(m.openBlock(),m.createElementBlock("div",{key:2,class:"content-file",onClick:f},[m.createVNode(m.unref(du),{icon:"mdi:file-document-outline",class:"file-icon"}),m.createElementVNode("span",Qo,m.toDisplayString(l(t.value.content)),1),m.createVNode(m.unref(du),{icon:"mdi:download",class:"download-icon"})])):!n(t.value)&&t.value.type==="image"?(m.openBlock(),m.createElementBlock("div",Jo,[m.createElementVNode("img",{src:t.value.content,alt:"图片",onClick:a},null,8,Ko)])):!n(t.value)&&t.value.type==="voice"?(m.openBlock(),m.createElementBlock("div",Yo,[m.createElementVNode("audio",{controls:"",src:t.value.content,class:"audio"},"您的浏览器不支持音频播放",8,Xo)])):!n(t.value)&&t.value.type==="medialib"?(m.openBlock(),m.createElementBlock("div",uc,[A.value==="video"?(m.openBlock(),m.createElementBlock("video",{key:0,controls:"",src:E.value,class:"medialib-video video"}," 您的浏览器不支持视频播放 ",8,ec)):A.value==="image"?(m.openBlock(),m.createElementBlock("img",{key:1,src:E.value,alt:"图片",class:"medialib-image",onClick:a},null,8,tc)):A.value==="audio"?(m.openBlock(),m.createElementBlock("audio",{key:2,controls:"",src:E.value,class:"medialib-audio audio"}," 您的浏览器不支持音频播放 ",8,nc)):A.value==="file"?(m.openBlock(),m.createElementBlock("div",{key:3,class:"content-file",onClick:F},[m.createVNode(m.unref(du),{icon:"mdi:file-document-outline",class:"file-icon"}),m.createElementVNode("span",rc,m.toDisplayString(y.value),1),m.createVNode(m.unref(du),{icon:"mdi:download",class:"download-icon"})])):(m.openBlock(),m.createBlock(m.unref(Po),{key:4,data:d.value,deep:3,class:"json-viewer"},null,8,["data"]))])):m.createCommentVNode("",!0),m.createVNode(Kt,{show:c.value,"image-url":i.value,onClose:p[0]||(p[0]=_=>c.value=!1)},null,8,["show","image-url"])]))}}),[["__scopeId","data-v-07efc606"]]);iu.ImageViewer=Kt,iu.MessageContentRenderer=oc,Object.defineProperty(iu,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gnai/message-content-renderer",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/message-content-renderer.umd.js",