ViewerDocxFromUrl-BeQ_kbOO.js 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pdf.min-Dco1iWct.js","assets/index-DtBOvPnF.js","assets/vue-vendor-BKZgKMlr.js","assets/index-Ept4gIrD.css","assets/docx-preview.min-B5ukwsMu.js","assets/jszip.min-B0E5FbNZ.js","assets/index-EAzENP0_.js","assets/index-Jbu-MxJL.js","assets/index-D7FBKgC3.css","assets/index-CL_1tmCJ.js","assets/index-DJ09e1LN.css","assets/_plugin-vue_export-helper-DlAUqK2U.js","assets/index-B_sgU3NA.css"])))=>i.map(i=>d[i]);
  2. var ht=Object.defineProperty;var pt=(s,e,t)=>e in s?ht(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var m=(s,e,t)=>pt(s,typeof e!="symbol"?e+"":e,t);import{d as ft,m as ne,q as ke,o as S,z as j,T as dt,A as be,p as I,c as P,B as me,C as D,D as Ee,b as N,E as we,a as G,n as gt,l as se,H as U,I as K,s as kt,f as Z,e as re,v as ve,x as Ke,w as bt,J as Ie,K as mt,a2 as We,F as Xe}from"./vue-vendor-BKZgKMlr.js";import{_ as wt,W as xt,X as yt,B as vt,Y as _t,g as $t,Q as Rt,Z as Ct,$ as St,a0 as Tt,b as Oe,j as zt,a1 as W,a2 as Le,R as De,a3 as Pt,k as Bt,s as At,f as Et,a4 as It,a5 as ie,o as Ot,a6 as Ye}from"./index-DtBOvPnF.js";/* empty css */import{R as Je}from"./index-EAzENP0_.js";import{S as et}from"./index-CL_1tmCJ.js";import{_ as tt}from"./_plugin-vue_export-helper-DlAUqK2U.js";var Lt=Object.defineProperty,qe=Object.getOwnPropertySymbols,Dt=Object.prototype.hasOwnProperty,qt=Object.prototype.propertyIsEnumerable,je=(s,e,t)=>e in s?Lt(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,jt=(s,e)=>{for(var t in e||(e={}))Dt.call(e,t)&&je(s,t,e[t]);if(qe)for(var t of qe(e))qt.call(e,t)&&je(s,t,e[t]);return s};const Nt=["top","right","bottom","left"],Zt=ft({name:"Drawer",components:{ClientOnly:_t,ArcoButton:vt,IconHover:yt,IconClose:xt},inheritAttrs:!1,props:{visible:{type:Boolean,default:!1},defaultVisible:{type:Boolean,default:!1},placement:{type:String,default:"right",validator:s=>Nt.includes(s)},title:String,mask:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0},closable:{type:Boolean,default:!0},okText:String,cancelText:String,okLoading:{type:Boolean,default:!1},okButtonProps:{type:Object},cancelButtonProps:{type:Object},unmountOnClose:Boolean,width:{type:[Number,String],default:250},height:{type:[Number,String],default:250},popupContainer:{type:[String,Object],default:"body"},drawerStyle:{type:Object},onBeforeOk:{type:Function},onBeforeCancel:{type:Function},escToClose:{type:Boolean,default:!0},renderToBody:{type:Boolean,default:!0},header:{type:Boolean,default:!0},footer:{type:Boolean,default:!0},hideCancel:{type:Boolean,default:!1}},emits:{"update:visible":s=>!0,ok:s=>!0,cancel:s=>!0,open:()=>!0,close:()=>!0,beforeOpen:()=>!0,beforeClose:()=>!0},setup(s,{emit:e}){const{popupContainer:t}=kt(s),n=$t("drawer"),{t:i}=Rt(),r=Z(s.defaultVisible),o=re(()=>{var v;return(v=s.visible)!=null?v:r.value}),l=Z(!1),u=re(()=>s.okLoading||l.value),{teleportContainer:a,containerRef:c}=Ct({popupContainer:t,visible:o}),p=Z(o.value);let f=!1;const d=v=>{s.escToClose&&v.key===Pt.ESC&&$()&&C(v)},w=()=>{s.escToClose&&!f&&(f=!0,zt(document.documentElement,"keydown",d))},h=()=>{f&&(f=!1,Bt(document.documentElement,"keydown",d))},{zIndex:g,isLastDialog:$}=St("dialog",{visible:o}),_=re(()=>(c==null?void 0:c.value)===document.body);let x=0;const y=()=>{x++,l.value&&(l.value=!1),r.value=!1,e("update:visible",!1)},R=async v=>{const z=x,te=await new Promise(async ge=>{var Be;if(W(s.onBeforeOk)){let q=s.onBeforeOk((Ae=!0)=>ge(Ae));if((Le(q)||!De(q))&&(l.value=!0),Le(q))try{q=(Be=await q)!=null?Be:!0}catch{q=!1}De(q)&&ge(q)}else ge(!0)});z===x&&(te?(e("ok",v),y()):l.value&&(l.value=!1))},C=v=>{var z;let te=!0;W(s.onBeforeCancel)&&(te=(z=s.onBeforeCancel())!=null?z:!1),te&&(e("cancel",v),y())},E=v=>{s.maskClosable&&C(v)},O=()=>{o.value&&e("open")},fe=()=>{o.value||(p.value=!1,ee(),e("close"))},{setOverflowHidden:V,resetOverflow:ee}=Tt(c);ve(()=>{o.value&&(p.value=!0,V(),w())}),Ke(()=>{ee(),h()}),bt(o,v=>{r.value!==v&&(r.value=v),v?(e("beforeOpen"),p.value=!0,V(),w()):(e("beforeClose"),h())});const de=re(()=>{var v;const z=jt({[s.placement]:0},(v=s.drawerStyle)!=null?v:{});return["right","left"].includes(s.placement)?z.width=Oe(s.width)?`${s.width}px`:s.width:z.height=Oe(s.height)?`${s.height}px`:s.height,z});return{prefixCls:n,style:de,t:i,mounted:p,computedVisible:o,mergedOkLoading:u,zIndex:g,handleOk:R,handleCancel:C,handleOpen:O,handleClose:fe,handleMask:E,isFixed:_,teleportContainer:a}}});function Mt(s,e,t,n,i,r){const o=ne("icon-close"),l=ne("icon-hover"),u=ne("arco-button"),a=ne("client-only");return S(),ke(a,null,{default:j(()=>[(S(),ke(dt,{to:s.teleportContainer,disabled:!s.renderToBody},[!s.unmountOnClose||s.computedVisible||s.mounted?be((S(),P("div",me({key:0,class:`${s.prefixCls}-container`,style:s.isFixed?{zIndex:s.zIndex}:{zIndex:"inherit",position:"absolute"}},s.$attrs),[D(Ee,{name:"fade-drawer",appear:""},{default:j(()=>[s.mask?be((S(),P("div",{key:0,class:N(`${s.prefixCls}-mask`),onClick:e[0]||(e[0]=(...c)=>s.handleMask&&s.handleMask(...c))},null,2)),[[we,s.computedVisible]]):I("v-if",!0)]),_:1}),D(Ee,{name:`slide-${s.placement}-drawer`,appear:"",onAfterEnter:s.handleOpen,onAfterLeave:s.handleClose},{default:j(()=>[be(G("div",{class:N(s.prefixCls),style:gt(s.style)},[s.header?(S(),P("div",{key:0,class:N(`${s.prefixCls}-header`)},[se(s.$slots,"header",{},()=>[s.$slots.title||s.title?(S(),P("div",{key:0,class:N(`${s.prefixCls}-title`)},[se(s.$slots,"title",{},()=>[U(K(s.title),1)])],2)):I("v-if",!0),s.closable?(S(),P("div",{key:1,tabindex:"-1",role:"button","aria-label":"Close",class:N(`${s.prefixCls}-close-btn`),onClick:e[1]||(e[1]=(...c)=>s.handleCancel&&s.handleCancel(...c))},[D(l,null,{default:j(()=>[D(o)]),_:1})],2)):I("v-if",!0)])],2)):I("v-if",!0),G("div",{class:N(`${s.prefixCls}-body`)},[se(s.$slots,"default")],2),s.footer?(S(),P("div",{key:1,class:N(`${s.prefixCls}-footer`)},[se(s.$slots,"footer",{},()=>[s.hideCancel?I("v-if",!0):(S(),ke(u,me({key:0},s.cancelButtonProps,{onClick:s.handleCancel}),{default:j(()=>[U(K(s.cancelText||s.t("drawer.cancelText")),1)]),_:1},16,["onClick"])),D(u,me({type:"primary",loading:s.mergedOkLoading},s.okButtonProps,{onClick:s.handleOk}),{default:j(()=>[U(K(s.okText||s.t("drawer.okText")),1)]),_:1},16,["loading","onClick"])])],2)):I("v-if",!0)],6),[[we,s.computedVisible]])]),_:3},8,["name","onAfterEnter","onAfterLeave"])],16)),[[we,s.computedVisible||s.mounted]]):I("v-if",!0)],8,["to","disabled"]))]),_:3})}var le=wt(Zt,[["render",Mt]]),Ft=Object.defineProperty,Ne=Object.getOwnPropertySymbols,Vt=Object.prototype.hasOwnProperty,Gt=Object.prototype.propertyIsEnumerable,Ze=(s,e,t)=>e in s?Ft(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,xe=(s,e)=>{for(var t in e||(e={}))Vt.call(e,t)&&Ze(s,t,e[t]);if(Ne)for(var t of Ne(e))Gt.call(e,t)&&Ze(s,t,e[t]);return s};const Me=(s,e)=>{let t=It("drawer");const n=()=>{a.component&&(a.component.props.visible=!1),W(s.onOk)&&s.onOk()},i=()=>{a.component&&(a.component.props.visible=!1),W(s.onCancel)&&s.onCancel()},r=async()=>{await mt(),t&&(Ie(null,t),document.body.removeChild(t)),t=null,W(s.onClose)&&s.onClose()},o=()=>{a.component&&(a.component.props.visible=!1)},l=c=>{a.component&&Object.entries(c).forEach(([p,f])=>{a.component.props[p]=f})},a=D(le,xe(xe(xe({},{visible:!0,renderToBody:!1,unmountOnClose:!0,onOk:n,onCancel:i,onClose:r}),Ot(s,["content","title","footer","visible","unmountOnClose","onOk","onCancel","onClose"])),{header:typeof s.header=="boolean"?s.header:void 0,footer:typeof s.footer=="boolean"?s.footer:void 0}),{default:ie(s.content),header:typeof s.header!="boolean"?ie(s.header):void 0,title:ie(s.title),footer:typeof s.footer!="boolean"?ie(s.footer):void 0});return(e??Fe._context)&&(a.appContext=e??Fe._context),Ie(a,t),document.body.appendChild(t),{close:o,update:l}},Fe=Object.assign(le,{open:Me,install:(s,e)=>{At(s,e);const t=Et(e);s.component(t+le.name,le);const n={open:(i,r=s._context)=>Me(i,r)};s.config.globalProperties.$drawer=n},_context:null});function _e(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let F=_e();function nt(s){F=s}const X={exec:()=>null};function b(s,e=""){let t=typeof s=="string"?s:s.source;const n={replace:(i,r)=>{let o=typeof r=="string"?r:r.source;return o=o.replace(T.caret,"$1"),t=t.replace(i,o),n},getRegex:()=>new RegExp(t,e)};return n}const T={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:s=>new RegExp(`^( {0,3}${s})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}#`),htmlBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}<(?:[a-z].*>|!--)`,"i")},Ht=/^(?:[ \t]*(?:\n|$))+/,Qt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ut=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,J=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Kt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,st=/(?:[*+-]|\d{1,9}[.)])/,rt=b(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,st).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),$e=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Wt=/^[^\n]+/,Re=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Xt=b(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Re).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Yt=b(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,st).getRegex(),he="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ce=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Jt=b("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ce).replace("tag",he).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),it=b($e).replace("hr",J).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",he).getRegex(),en=b(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",it).getRegex(),Se={blockquote:en,code:Qt,def:Xt,fences:Ut,heading:Kt,hr:J,html:Jt,lheading:rt,list:Yt,newline:Ht,paragraph:it,table:X,text:Wt},Ve=b("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",J).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",he).getRegex(),tn={...Se,table:Ve,paragraph:b($e).replace("hr",J).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ve).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",he).getRegex()},nn={...Se,html:b(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ce).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:X,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:b($e).replace("hr",J).replace("heading",` *#{1,6} *[^
  3. ]`).replace("lheading",rt).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ot=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,sn=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,lt=/^( {2,}|\\)\n(?!\s*$)/,rn=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,pe=/[\p{P}\p{S}]/u,Te=/[\s\p{P}\p{S}]/u,at=/[^\s\p{P}\p{S}]/u,on=b(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Te).getRegex(),ln=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,an=b(/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,"u").replace(/punct/g,pe).getRegex(),cn=b("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,at).replace(/punctSpace/g,Te).replace(/punct/g,pe).getRegex(),un=b("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,at).replace(/punctSpace/g,Te).replace(/punct/g,pe).getRegex(),hn=b(/\\(punct)/,"gu").replace(/punct/g,pe).getRegex(),pn=b(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[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])?)+(?![-_])/).getRegex(),fn=b(Ce).replace("(?:-->|$)","-->").getRegex(),dn=b("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",fn).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ae=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,gn=b(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",ae).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ct=b(/^!?\[(label)\]\[(ref)\]/).replace("label",ae).replace("ref",Re).getRegex(),ut=b(/^!?\[(ref)\](?:\[\])?/).replace("ref",Re).getRegex(),kn=b("reflink|nolink(?!\\()","g").replace("reflink",ct).replace("nolink",ut).getRegex(),ze={_backpedal:X,anyPunctuation:hn,autolink:pn,blockSkip:ln,br:lt,code:sn,del:X,emStrongLDelim:an,emStrongRDelimAst:cn,emStrongRDelimUnd:un,escape:ot,link:gn,nolink:ut,punctuation:on,reflink:ct,reflinkSearch:kn,tag:dn,text:rn,url:X},bn={...ze,link:b(/^!?\[(label)\]\((.*?)\)/).replace("label",ae).getRegex(),reflink:b(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ae).getRegex()},ye={...ze,escape:b(ot).replace("])","~|])").getRegex(),url:b(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},mn={...ye,br:b(lt).replace("{2,}","*").getRegex(),text:b(ye.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},oe={normal:Se,gfm:tn,pedantic:nn},H={normal:ze,gfm:ye,breaks:mn,pedantic:bn},wn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ge=s=>wn[s];function L(s,e){if(e){if(T.escapeTest.test(s))return s.replace(T.escapeReplace,Ge)}else if(T.escapeTestNoEncode.test(s))return s.replace(T.escapeReplaceNoEncode,Ge);return s}function He(s){try{s=encodeURI(s).replace(T.percentDecode,"%")}catch{return null}return s}function Qe(s,e){var r;const t=s.replace(T.findPipe,(o,l,u)=>{let a=!1,c=l;for(;--c>=0&&u[c]==="\\";)a=!a;return a?"|":" |"}),n=t.split(T.splitPipe);let i=0;if(n[0].trim()||n.shift(),n.length>0&&!((r=n.at(-1))!=null&&r.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(T.slashPipe,"|");return n}function Q(s,e,t){const n=s.length;if(n===0)return"";let i=0;for(;i<n&&s.charAt(n-i-1)===e;)i++;return s.slice(0,n-i)}function xn(s,e){if(s.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n<s.length;n++)if(s[n]==="\\")n++;else if(s[n]===e[0])t++;else if(s[n]===e[1]&&(t--,t<0))return n;return-1}function Ue(s,e,t,n,i){const r=e.href,o=e.title||null,l=s[1].replace(i.other.outputLinkReplace,"$1");if(s[0].charAt(0)!=="!"){n.state.inLink=!0;const u={type:"link",raw:t,href:r,title:o,text:l,tokens:n.inlineTokens(l)};return n.state.inLink=!1,u}return{type:"image",raw:t,href:r,title:o,text:l}}function yn(s,e,t){const n=s.match(t.other.indentCodeCompensation);if(n===null)return e;const i=n[1];return e.split(`
  4. `).map(r=>{const o=r.match(t.other.beginningSpace);if(o===null)return r;const[l]=o;return l.length>=i.length?r.slice(i.length):r}).join(`
  5. `)}class ce{constructor(e){m(this,"options");m(this,"rules");m(this,"lexer");this.options=e||F}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Q(n,`
  6. `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],i=yn(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){const i=Q(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Q(t[0],`
  7. `)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let n=Q(t[0],`
  8. `).split(`
  9. `),i="",r="";const o=[];for(;n.length>0;){let l=!1;const u=[];let a;for(a=0;a<n.length;a++)if(this.rules.other.blockquoteStart.test(n[a]))u.push(n[a]),l=!0;else if(!l)u.push(n[a]);else break;n=n.slice(a);const c=u.join(`
  10. `),p=c.replace(this.rules.other.blockquoteSetextReplace,`
  11. $1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
  12. ${c}`:c,r=r?`${r}
  13. ${p}`:p;const f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,o,!0),this.lexer.state.top=f,n.length===0)break;const d=o.at(-1);if((d==null?void 0:d.type)==="code")break;if((d==null?void 0:d.type)==="blockquote"){const w=d,h=w.raw+`
  14. `+n.join(`
  15. `),g=this.blockquote(h);o[o.length-1]=g,i=i.substring(0,i.length-w.raw.length)+g.raw,r=r.substring(0,r.length-w.text.length)+g.text;break}else if((d==null?void 0:d.type)==="list"){const w=d,h=w.raw+`
  16. `+n.join(`
  17. `),g=this.list(h);o[o.length-1]=g,i=i.substring(0,i.length-d.raw.length)+g.raw,r=r.substring(0,r.length-w.raw.length)+g.raw,n=h.substring(o.at(-1).raw.length).split(`
  18. `);continue}}return{type:"blockquote",raw:i,tokens:o,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const i=n.length>1,r={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");const o=this.rules.other.listItemRegex(n);let l=!1;for(;e;){let a=!1,c="",p="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;c=t[0],e=e.substring(c.length);let f=t[2].split(`
  19. `,1)[0].replace(this.rules.other.listReplaceTabs,_=>" ".repeat(3*_.length)),d=e.split(`
  20. `,1)[0],w=!f.trim(),h=0;if(this.options.pedantic?(h=2,p=f.trimStart()):w?h=t[1].length+1:(h=t[2].search(this.rules.other.nonSpaceChar),h=h>4?1:h,p=f.slice(h),h+=t[1].length),w&&this.rules.other.blankLine.test(d)&&(c+=d+`
  21. `,e=e.substring(d.length+1),a=!0),!a){const _=this.rules.other.nextBulletRegex(h),x=this.rules.other.hrRegex(h),y=this.rules.other.fencesBeginRegex(h),R=this.rules.other.headingBeginRegex(h),C=this.rules.other.htmlBeginRegex(h);for(;e;){const E=e.split(`
  22. `,1)[0];let O;if(d=E,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting," "),O=d):O=d.replace(this.rules.other.tabCharGlobal," "),y.test(d)||R.test(d)||C.test(d)||_.test(d)||x.test(d))break;if(O.search(this.rules.other.nonSpaceChar)>=h||!d.trim())p+=`
  23. `+O.slice(h);else{if(w||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||y.test(f)||R.test(f)||x.test(f))break;p+=`
  24. `+d}!w&&!d.trim()&&(w=!0),c+=E+`
  25. `,e=e.substring(E.length+1),f=O.slice(h)}}r.loose||(l?r.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(l=!0));let g=null,$;this.options.gfm&&(g=this.rules.other.listIsTask.exec(p),g&&($=g[0]!=="[ ] ",p=p.replace(this.rules.other.listReplaceTask,""))),r.items.push({type:"list_item",raw:c,task:!!g,checked:$,loose:!1,text:p,tokens:[]}),r.raw+=c}const u=r.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let a=0;a<r.items.length;a++)if(this.lexer.state.top=!1,r.items[a].tokens=this.lexer.blockTokens(r.items[a].text,[]),!r.loose){const c=r.items[a].tokens.filter(f=>f.type==="space"),p=c.length>0&&c.some(f=>this.rules.other.anyLine.test(f.raw));r.loose=p}if(r.loose)for(let a=0;a<r.items.length;a++)r.items[a].loose=!0;return r}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:i,title:r}}}table(e){var l;const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const n=Qe(t[1]),i=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=(l=t[3])!=null&&l.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
  26. `):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===i.length){for(const u of i)this.rules.other.tableAlignRight.test(u)?o.align.push("right"):this.rules.other.tableAlignCenter.test(u)?o.align.push("center"):this.rules.other.tableAlignLeft.test(u)?o.align.push("left"):o.align.push(null);for(let u=0;u<n.length;u++)o.header.push({text:n[u],tokens:this.lexer.inline(n[u]),header:!0,align:o.align[u]});for(const u of r)o.rows.push(Qe(u,o.header.length).map((a,c)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:o.align[c]})));return o}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const n=t[1].charAt(t[1].length-1)===`
  27. `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const o=Q(n.slice(0,-1),"\\");if((n.length-o.length)%2===0)return}else{const o=xn(t[2],"()");if(o>-1){const u=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,u).trim(),t[3]=""}}let i=t[2],r="";if(this.options.pedantic){const o=this.rules.other.pedanticHrefTitle.exec(i);o&&(i=o[1],r=o[3])}else r=t[3]?t[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),Ue(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=t[i.toLowerCase()];if(!r){const o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return Ue(n,r,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!i||i[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(i[1]||i[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const o=[...i[0]].length-1;let l,u,a=o,c=0;const p=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,t=t.slice(-1*e.length+o);(i=p.exec(t))!=null;){if(l=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!l)continue;if(u=[...l].length,i[3]||i[4]){a+=u;continue}else if((i[5]||i[6])&&o%3&&!((o+u)%3)){c+=u;continue}if(a-=u,a>0)continue;u=Math.min(u,u+a+c);const f=[...i[0]][0].length,d=e.slice(0,o+i.index+f+u);if(Math.min(o,u)%2){const h=d.slice(1,-1);return{type:"em",raw:d,text:h,tokens:this.lexer.inlineTokens(h)}}const w=d.slice(2,-2);return{type:"strong",raw:d,text:w,tokens:this.lexer.inlineTokens(w)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," ");const i=this.rules.other.nonSpaceChar.test(n),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&r&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let n,i;return t[2]==="@"?(n=t[1],i="mailto:"+n):(n=t[1],i=n),{type:"link",raw:t[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let i,r;if(t[2]==="@")i=t[0],r="mailto:"+i;else{let o;do o=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(o!==t[0]);i=t[0],t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}}class B{constructor(e){m(this,"tokens");m(this,"options");m(this,"state");m(this,"tokenizer");m(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||F,this.options.tokenizer=this.options.tokenizer||new ce,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={other:T,block:oe.normal,inline:H.normal};this.options.pedantic?(t.block=oe.pedantic,t.inline=H.pedantic):this.options.gfm&&(t.block=oe.gfm,this.options.breaks?t.inline=H.breaks:t.inline=H.gfm),this.tokenizer.rules=t}static get rules(){return{block:oe,inline:H}}static lex(e,t){return new B(t).lex(e)}static lexInline(e,t){return new B(t).inlineTokens(e)}lex(e){e=e.replace(T.carriageReturn,`
  28. `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const n=this.inlineQueue[t];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){var i,r,o;for(this.options.pedantic&&(e=e.replace(T.tabCharGlobal," ").replace(T.spaceLine,""));e;){let l;if((r=(i=this.options.extensions)==null?void 0:i.block)!=null&&r.some(a=>(l=a.call({lexer:this},e,t))?(e=e.substring(l.raw.length),t.push(l),!0):!1))continue;if(l=this.tokenizer.space(e)){e=e.substring(l.raw.length);const a=t.at(-1);l.raw.length===1&&a!==void 0?a.raw+=`
  29. `:t.push(l);continue}if(l=this.tokenizer.code(e)){e=e.substring(l.raw.length);const a=t.at(-1);(a==null?void 0:a.type)==="paragraph"||(a==null?void 0:a.type)==="text"?(a.raw+=`
  30. `+l.raw,a.text+=`
  31. `+l.text,this.inlineQueue.at(-1).src=a.text):t.push(l);continue}if(l=this.tokenizer.fences(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.heading(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.hr(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.blockquote(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.list(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.html(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.def(e)){e=e.substring(l.raw.length);const a=t.at(-1);(a==null?void 0:a.type)==="paragraph"||(a==null?void 0:a.type)==="text"?(a.raw+=`
  32. `+l.raw,a.text+=`
  33. `+l.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title});continue}if(l=this.tokenizer.table(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.lheading(e)){e=e.substring(l.raw.length),t.push(l);continue}let u=e;if((o=this.options.extensions)!=null&&o.startBlock){let a=1/0;const c=e.slice(1);let p;this.options.extensions.startBlock.forEach(f=>{p=f.call({lexer:this},c),typeof p=="number"&&p>=0&&(a=Math.min(a,p))}),a<1/0&&a>=0&&(u=e.substring(0,a+1))}if(this.state.top&&(l=this.tokenizer.paragraph(u))){const a=t.at(-1);n&&(a==null?void 0:a.type)==="paragraph"?(a.raw+=`
  34. `+l.raw,a.text+=`
  35. `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(l),n=u.length!==e.length,e=e.substring(l.raw.length);continue}if(l=this.tokenizer.text(e)){e=e.substring(l.raw.length);const a=t.at(-1);(a==null?void 0:a.type)==="text"?(a.raw+=`
  36. `+l.raw,a.text+=`
  37. `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(l);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var l,u,a;let n=e,i=null;if(this.tokens.links){const c=Object.keys(this.tokens.links);if(c.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)c.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let r=!1,o="";for(;e;){r||(o=""),r=!1;let c;if((u=(l=this.options.extensions)==null?void 0:l.inline)!=null&&u.some(f=>(c=f.call({lexer:this},e,t))?(e=e.substring(c.raw.length),t.push(c),!0):!1))continue;if(c=this.tokenizer.escape(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.tag(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.link(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(c.raw.length);const f=t.at(-1);c.type==="text"&&(f==null?void 0:f.type)==="text"?(f.raw+=c.raw,f.text+=c.text):t.push(c);continue}if(c=this.tokenizer.emStrong(e,n,o)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.codespan(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.br(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.del(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.autolink(e)){e=e.substring(c.raw.length),t.push(c);continue}if(!this.state.inLink&&(c=this.tokenizer.url(e))){e=e.substring(c.raw.length),t.push(c);continue}let p=e;if((a=this.options.extensions)!=null&&a.startInline){let f=1/0;const d=e.slice(1);let w;this.options.extensions.startInline.forEach(h=>{w=h.call({lexer:this},d),typeof w=="number"&&w>=0&&(f=Math.min(f,w))}),f<1/0&&f>=0&&(p=e.substring(0,f+1))}if(c=this.tokenizer.inlineText(p)){e=e.substring(c.raw.length),c.raw.slice(-1)!=="_"&&(o=c.raw.slice(-1)),r=!0;const f=t.at(-1);(f==null?void 0:f.type)==="text"?(f.raw+=c.raw,f.text+=c.text):t.push(c);continue}if(e){const f="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(f);break}else throw new Error(f)}}return t}}class ue{constructor(e){m(this,"options");m(this,"parser");this.options=e||F}space(e){return""}code({text:e,lang:t,escaped:n}){var o;const i=(o=(t||"").match(T.notSpaceStart))==null?void 0:o[0],r=e.replace(T.endingNewline,"")+`
  38. `;return i?'<pre><code class="language-'+L(i)+'">'+(n?r:L(r,!0))+`</code></pre>
  39. `:"<pre><code>"+(n?r:L(r,!0))+`</code></pre>
  40. `}blockquote({tokens:e}){return`<blockquote>
  41. ${this.parser.parse(e)}</blockquote>
  42. `}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
  43. `}hr(e){return`<hr>
  44. `}list(e){const t=e.ordered,n=e.start;let i="";for(let l=0;l<e.items.length;l++){const u=e.items[l];i+=this.listitem(u)}const r=t?"ol":"ul",o=t&&n!==1?' start="'+n+'"':"";return"<"+r+o+`>
  45. `+i+"</"+r+`>
  46. `}listitem(e){var n;let t="";if(e.task){const i=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=i+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=i+" "+L(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):t+=i+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
  47. `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
  48. `}table(e){let t="",n="";for(let r=0;r<e.header.length;r++)n+=this.tablecell(e.header[r]);t+=this.tablerow({text:n});let i="";for(let r=0;r<e.rows.length;r++){const o=e.rows[r];n="";for(let l=0;l<o.length;l++)n+=this.tablecell(o[l]);i+=this.tablerow({text:n})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
  49. <thead>
  50. `+t+`</thead>
  51. `+i+`</table>
  52. `}tablerow({text:e}){return`<tr>
  53. ${e}</tr>
  54. `}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
  55. `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${L(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const i=this.parser.parseInline(n),r=He(e);if(r===null)return i;e=r;let o='<a href="'+e+'"';return t&&(o+=' title="'+L(t)+'"'),o+=">"+i+"</a>",o}image({href:e,title:t,text:n}){const i=He(e);if(i===null)return L(n);e=i;let r=`<img src="${e}" alt="${n}"`;return t&&(r+=` title="${L(t)}"`),r+=">",r}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:L(e.text)}}class Pe{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}}class A{constructor(e){m(this,"options");m(this,"renderer");m(this,"textRenderer");this.options=e||F,this.options.renderer=this.options.renderer||new ue,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Pe}static parse(e,t){return new A(t).parse(e)}static parseInline(e,t){return new A(t).parseInline(e)}parse(e,t=!0){var i,r;let n="";for(let o=0;o<e.length;o++){const l=e[o];if((r=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&r[l.type]){const a=l,c=this.options.extensions.renderers[a.type].call({parser:this},a);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){n+=c||"";continue}}const u=l;switch(u.type){case"space":{n+=this.renderer.space(u);continue}case"hr":{n+=this.renderer.hr(u);continue}case"heading":{n+=this.renderer.heading(u);continue}case"code":{n+=this.renderer.code(u);continue}case"table":{n+=this.renderer.table(u);continue}case"blockquote":{n+=this.renderer.blockquote(u);continue}case"list":{n+=this.renderer.list(u);continue}case"html":{n+=this.renderer.html(u);continue}case"paragraph":{n+=this.renderer.paragraph(u);continue}case"text":{let a=u,c=this.renderer.text(a);for(;o+1<e.length&&e[o+1].type==="text";)a=e[++o],c+=`
  56. `+this.renderer.text(a);t?n+=this.renderer.paragraph({type:"paragraph",raw:c,text:c,tokens:[{type:"text",raw:c,text:c,escaped:!0}]}):n+=c;continue}default:{const a='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}parseInline(e,t=this.renderer){var i,r;let n="";for(let o=0;o<e.length;o++){const l=e[o];if((r=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&r[l.type]){const a=this.options.extensions.renderers[l.type].call({parser:this},l);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){n+=a||"";continue}}const u=l;switch(u.type){case"escape":{n+=t.text(u);break}case"html":{n+=t.html(u);break}case"link":{n+=t.link(u);break}case"image":{n+=t.image(u);break}case"strong":{n+=t.strong(u);break}case"em":{n+=t.em(u);break}case"codespan":{n+=t.codespan(u);break}case"br":{n+=t.br(u);break}case"del":{n+=t.del(u);break}case"text":{n+=t.text(u);break}default:{const a='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}}class Y{constructor(e){m(this,"options");m(this,"block");this.options=e||F}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?B.lex:B.lexInline}provideParser(){return this.block?A.parse:A.parseInline}}m(Y,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class vn{constructor(...e){m(this,"defaults",_e());m(this,"options",this.setOptions);m(this,"parse",this.parseMarkdown(!0));m(this,"parseInline",this.parseMarkdown(!1));m(this,"Parser",A);m(this,"Renderer",ue);m(this,"TextRenderer",Pe);m(this,"Lexer",B);m(this,"Tokenizer",ce);m(this,"Hooks",Y);this.use(...e)}walkTokens(e,t){var i,r;let n=[];for(const o of e)switch(n=n.concat(t.call(this,o)),o.type){case"table":{const l=o;for(const u of l.header)n=n.concat(this.walkTokens(u.tokens,t));for(const u of l.rows)for(const a of u)n=n.concat(this.walkTokens(a.tokens,t));break}case"list":{const l=o;n=n.concat(this.walkTokens(l.items,t));break}default:{const l=o;(r=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&r[l.type]?this.defaults.extensions.childTokens[l.type].forEach(u=>{const a=l[u].flat(1/0);n=n.concat(this.walkTokens(a,t))}):l.tokens&&(n=n.concat(this.walkTokens(l.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){const o=t.renderers[r.name];o?t.renderers[r.name]=function(...l){let u=r.renderer.apply(this,l);return u===!1&&(u=o.apply(this,l)),u}:t.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const o=t[r.level];o?o.unshift(r.tokenizer):t[r.level]=[r.tokenizer],r.start&&(r.level==="block"?t.startBlock?t.startBlock.push(r.start):t.startBlock=[r.start]:r.level==="inline"&&(t.startInline?t.startInline.push(r.start):t.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(t.childTokens[r.name]=r.childTokens)}),i.extensions=t),n.renderer){const r=this.defaults.renderer||new ue(this.defaults);for(const o in n.renderer){if(!(o in r))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;const l=o,u=n.renderer[l],a=r[l];r[l]=(...c)=>{let p=u.apply(r,c);return p===!1&&(p=a.apply(r,c)),p||""}}i.renderer=r}if(n.tokenizer){const r=this.defaults.tokenizer||new ce(this.defaults);for(const o in n.tokenizer){if(!(o in r))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;const l=o,u=n.tokenizer[l],a=r[l];r[l]=(...c)=>{let p=u.apply(r,c);return p===!1&&(p=a.apply(r,c)),p}}i.tokenizer=r}if(n.hooks){const r=this.defaults.hooks||new Y;for(const o in n.hooks){if(!(o in r))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;const l=o,u=n.hooks[l],a=r[l];Y.passThroughHooks.has(o)?r[l]=c=>{if(this.defaults.async)return Promise.resolve(u.call(r,c)).then(f=>a.call(r,f));const p=u.call(r,c);return a.call(r,p)}:r[l]=(...c)=>{let p=u.apply(r,c);return p===!1&&(p=a.apply(r,c)),p}}i.hooks=r}if(n.walkTokens){const r=this.defaults.walkTokens,o=n.walkTokens;i.walkTokens=function(l){let u=[];return u.push(o.call(this,l)),r&&(u=u.concat(r.call(this,l))),u}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return B.lex(e,t??this.defaults)}parser(e,t){return A.parse(e,t??this.defaults)}parseMarkdown(e){return(n,i)=>{const r={...i},o={...this.defaults,...r},l=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&r.async===!1)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=e);const u=o.hooks?o.hooks.provideLexer():e?B.lex:B.lexInline,a=o.hooks?o.hooks.provideParser():e?A.parse:A.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(n):n).then(c=>u(c,o)).then(c=>o.hooks?o.hooks.processAllTokens(c):c).then(c=>o.walkTokens?Promise.all(this.walkTokens(c,o.walkTokens)).then(()=>c):c).then(c=>a(c,o)).then(c=>o.hooks?o.hooks.postprocess(c):c).catch(l);try{o.hooks&&(n=o.hooks.preprocess(n));let c=u(n,o);o.hooks&&(c=o.hooks.processAllTokens(c)),o.walkTokens&&this.walkTokens(c,o.walkTokens);let p=a(c,o);return o.hooks&&(p=o.hooks.postprocess(p)),p}catch(c){return l(c)}}}onError(e,t){return n=>{if(n.message+=`
  57. Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An error occurred:</p><pre>"+L(n.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(n);throw n}}}const M=new vn;function k(s,e){return M.parse(s,e)}k.options=k.setOptions=function(s){return M.setOptions(s),k.defaults=M.defaults,nt(k.defaults),k};k.getDefaults=_e;k.defaults=F;k.use=function(...s){return M.use(...s),k.defaults=M.defaults,nt(k.defaults),k};k.walkTokens=function(s,e){return M.walkTokens(s,e)};k.parseInline=M.parseInline;k.Parser=A;k.parser=A.parse;k.Renderer=ue;k.TextRenderer=Pe;k.Lexer=B;k.lexer=B.lex;k.Tokenizer=ce;k.Hooks=Y;k.parse=k;k.options;k.setOptions;k.use;k.walkTokens;k.parseInline;A.parse;B.lex;function Zn(s){throw new Error('Could not dynamically require "'+s+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}function _n(s){Ye(()=>import("./pdf.min-Dco1iWct.js"),__vite__mapDeps([0,1,2,3])).then(e=>{e.GlobalWorkerOptions.workerSrc="/pdfjs-dist/pdf.worker.min.js",typeof s=="function"&&s(e)}).catch(e=>{console.log(e,"PDF解析库加载错误")})}const $n={key:0,class:"loading-pdf-box"},Rn={class:"loading-spin"},Cn={key:1,class:"loading-pdf-box"},Sn={__name:"ViewerPDFFromUrl",props:{url:String,doc_width:Number,positions:Array},setup(s,{expose:e}){const t=s,n=We("box");let i=null;const r=[];let o=[],l=1,u=[];const a=Z(1),c=Z(""),p=(()=>{const h={};return t.positions.forEach((g,$)=>{const _=g[0],x=g[1],y=g[2],R=g[3],C=g[4];_ in h?h[_].push({x1:x,x2:y,y1:R,y2:C}):h[_]=[{x1:x,x2:y,y1:R,y2:C}]}),h})();function f(h,g,$,_,x){h.fillStyle="rgba(255, 255, 0, 0.5)";const y=$-g,R=x-_;h.fillRect(g,_,y,R)}ve(()=>{a.value=2,c.value="loading",_n(h=>{h.getDocument(t.url).promise.then(async g=>{i=g;const $=g.numPages;let _=-1,x=0;r.length=0,o.length=0;for(let y=1;y<=$;y++){const R=document.createElement("canvas");R.addEventListener("contextmenu",function(v){v.preventDefault()}),o[y]=R.getContext("2d");const C=await g.getPage(y),E=C.getViewport({scale:1}),O=E.width,fe=E.height,V=t.doc_width,ee=V/(O/fe);l=V/O;const de=C.getViewport({scale:l});if(r.push(x),R.width=V,R.height=ee,x=x+R.height,await C.render({viewport:de,canvasContext:o[y]}).promise,y in p){const v=p[y];_===-1&&(_=y),v.forEach(z=>{f(o[y],z.x1*l,z.x2*l,z.y1*l,z.y2*l)})}n.value&&n.value.appendChild(R)}a.value=3,c.value="success",_!==-1&&setTimeout(()=>{n.value&&(n.value.scrollTop=r[_-1])})}).catch(g=>{console.log(g,"PDF加载出错"),a.value=4,c.value=`PDF文档 ${t.url} 加载出错。 ERROR: :${g.message}`})})});const d=h=>{const g={};return Array.isArray(h)&&h.forEach(($,_)=>{const x=$[0],y=$[1],R=$[2],C=$[3],E=$[4];x in g?g[x].push({x1:y,x2:R,y1:C,y2:E}):g[x]=[{x1:y,x2:R,y1:C,y2:E}]}),g},w=async(h,g)=>{var $;i&&(setTimeout(()=>{n.value&&(n.value.scrollTop=r[h-1])}),u.includes(h)||($=d(g)[h])==null||$.forEach(x=>{f(o[h],x.x1*l,x.x2*l,x.y1*l,x.y2*l),u.push(h)}))};return Ke(()=>{o.forEach(h=>{h.clearRect(0,0,h.canvas.width,h.canvas.height)}),o.length=0,r.length=0,i=null}),e({toPageIndex:w}),(h,g)=>{const $=et,_=Je;return S(),P(Xe,null,[G("div",{class:"pdf-container",id:"pdfContainer",ref_key:"box",ref:n},null,512),a.value===2?(S(),P("div",$n,[G("div",Rn,[D($,{size:36})])])):I("",!0),a.value===4?(S(),P("div",Cn,[D(_,{status:"error",title:h.$t("common.doc_error")},{subtitle:j(()=>[U(K(c.value),1)]),_:1},8,["title"])])):I("",!0)],64)}}},Mn=tt(Sn,[["__scopeId","data-v-6b723be0"]]),Tn=(s,e)=>new Promise((t,n)=>{Ye(()=>import("./docx-preview.min-B5ukwsMu.js"),__vite__mapDeps([4,5,1,2,3,6,7,8,9,10,11,12])).then(i=>{const r=i.renderAsync;r(e,s),t()}).catch(i=>{console.log("docx-preview.mjs 加载失败"),n(i)})});async function zn(s){try{const e=await fetch(s);if(!e.ok)throw new Error(`Network response was not ok: ${e.statusText}`);return await e.blob()}catch(e){throw console.error("There was a problem with the fetch operation:",e),e}}const Fn=s=>{if(!s)return"";const e=s.split(".");return e[e.length-1]},Pn={key:0,class:"loading-doc-box"},Bn={class:"loading-spin"},An={key:1,class:"loading-doc-box"},En={__name:"ViewerDocxFromUrl",props:{url:String,doc_width:Number},setup(s){const e=s,t=We("box"),n=Z(1),i=Z("");return ve(()=>{n.value=2,i.value="loading",zn(e.url).then(r=>{Tn(t.value,r).then(o=>{n.value=3,i.value="success"}).catch(o=>{n.value=4,i.value=`文档 ${e.url} 加载出错。 ERROR: :${o.message}`})}).catch(r=>{n.value=4,i.value=`文档 ${e.url} 加载出错。 ERROR: :${r.message}`})}),(r,o)=>{const l=et,u=Je;return S(),P(Xe,null,[G("div",{class:"doc-container",ref_key:"box",ref:t},null,512),n.value===2?(S(),P("div",Pn,[G("div",Bn,[D(l,{size:36})])])):I("",!0),n.value===4?(S(),P("div",An,[D(u,{status:"error",title:r.$t("common.doc_error")},{subtitle:j(()=>[U(K(i.value),1)]),_:1},8,["title"])])):I("",!0)],64)}}},Vn=tt(En,[["__scopeId","data-v-d764e252"]]);export{Fe as D,vn as M,Mn as V,Vn as a,Zn as c,Fn as g,_n as l,k as m,Tn as r};