mirror of
https://github.com/setube/ogame-vue-ts.git
synced 2026-05-12 07:55:11 +08:00
重构BattleReportDialog和BattleSimulatorView相关静态资源,替换旧版JS/CSS文件,提升界面一致性和交互体验。新增和优化空状态、滚动区域等通用UI组件,移除部分冗余composable,完善多语言内容。引入导弹逻辑,补充版本检测工具,提升整体代码结构和可维护性。
59 lines
90 KiB
JavaScript
59 lines
90 KiB
JavaScript
import{An as e,Bn as t,Cn as n,En as r,Fn as i,Hn as a,In as o,Jn as s,Kn as c,Mn as l,On as u,Qn as d,Rn as f,Sn as p,Vn as m,Wn as h,Yn as g,Zn as _,_n as v,ar as y,cn as b,cr as x,dn as S,fn as C,kn as w,ln as T,mn as E,nr as D,on as O,or as ee,pn as k,qn as A,rn as j,rr as M,sn as N,sr as te,tr as ne,un as P,vn as F,wn as re,xn as ie,yn as I}from"./game-logic-BBFCPVtv.js";function ae(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=ae(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function oe(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ae(e))&&(r&&(r+=` `),r+=t);return r}var se=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e;const ce=oe,le=(e,t)=>n=>{if(t?.variants==null)return ce(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=se(t)||se(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return ce(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};function ue(e){return typeof e==`string`?`'${e}'`:new de().serialize(e)}var de=function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?e.localeCompare(t):n===`number`&&r===`number`?e-t:String.prototype.localeCompare.call(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(e===null)return`null`;switch(typeof e){case`string`:return t?e:`'${e}'`;case`bigint`:return`${e}n`;case`object`:return this.$object(e);case`function`:return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if(t!==`[object Object]`)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||n===void 0?``:n.name;if(r!==``&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if(typeof e.toJSON==`function`){let t=e.toJSON();return r+(typeof t==`object`&&t?this.$object(t):`(${this.serialize(t)})`)}return this.serializeObjectEntries(r,Object.entries(e))}serializeBuiltInType(e,t){let n=this[`$`+e];if(n)return n.call(this,t);if(typeof t?.entries==`function`)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;e<n.length;e++){let[t,i]=n[e];r+=`${this.serialize(t,!0)}:${this.serialize(i)}`,e<n.length-1&&(r+=`,`)}return r+`}`}$object(e){let t=this.#e.get(e);return t===void 0&&(this.#e.set(e,`#${this.#e.size}`),t=this.serializeObject(e),this.#e.set(e,t)),t}$function(e){let t=Function.prototype.toString.call(e);return t.slice(-15)===`[native code] }`?`${e.name||``}()[native]`:`${e.name}(${e.length})${t.replace(/\s*\n\s*/g,``)}`}$Array(e){let t=`[`;for(let n=0;n<e.length;n++)t+=this.serialize(e[n]),n<e.length-1&&(t+=`,`);return t+`]`}$Date(e){try{return`Date(${e.toISOString()})`}catch{return`Date(null)`}}$ArrayBuffer(e){return`ArrayBuffer[${new Uint8Array(e).join(`,`)}]`}$Set(e){return`Set${this.$Array(Array.from(e).sort((e,t)=>this.compare(e,t)))}`}$Map(e){return this.serializeObjectEntries(`Map`,e.entries())}}for(let t of[`Error`,`RegExp`,`URL`])e.prototype[`$`+t]=function(e){return`${t}(${e})`};for(let t of[`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`Float64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`,`)}]`};for(let t of[`BigInt64Array`,`BigUint64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`n,`)}${e.length>0?`n`:``}]`};return e}();function fe(e,t){return e===t||ue(e)===ue(t)}function pe(e,t){let n=d();return o(()=>{n.value=e()},{...t,flush:t?.flush??`sync`}),s(n)}function L(e){return a()?(c(e),!0):!1}function me(){let e=new Set,t=t=>{e.delete(t)};return{on:n=>{e.add(n);let r=()=>t(n);return L(r),{off:r}},off:t,trigger:(...t)=>Promise.all(Array.from(e).map(e=>e(...t))),clear:()=>{e.clear()}}}function he(e){let t=!1,n,r=m(!0);return(...i)=>(t||=(n=r.run(()=>e(...i)),!0),n)}function ge(e){let t=0,n,r,i=()=>{--t,r&&t<=0&&(r.stop(),n=void 0,r=void 0)};return(...a)=>(t+=1,r||(r=m(!0),n=r.run(()=>e(...a))),L(i),n)}function _e(e){return h(e)?A(new Proxy({},{get(t,n,r){return M(Reflect.get(e.value,n,r))},set(t,n,r){return h(e.value[n])&&!h(r)?e.value[n].value=r:e.value[n]=r,!0},deleteProperty(t,n){return Reflect.deleteProperty(e.value,n)},has(t,n){return Reflect.has(e.value,n)},ownKeys(){return Object.keys(e.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}})):A(e)}function ve(e){return _e(O(e))}function ye(e,...t){let n=t.flat(),r=n[0];return ve(()=>typeof r==`function`?Object.fromEntries(Object.entries(ne(e)).filter(([e,t])=>!r(D(t),e))):Object.fromEntries(Object.entries(ne(e)).filter(e=>!n.includes(e[0]))))}var be=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;var xe=e=>e!==void 0,Se=Object.prototype.toString,Ce=e=>Se.call(e)===`[object Object]`,we=Te();function Te(){return be&&(window==null?void 0:window.navigator)?.userAgent&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||(window==null?void 0:window.navigator)?.maxTouchPoints>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function Ee(e){return e||E()}function De(e){return Array.isArray(e)?e:[e]}function Oe(e,n=1e4){return t((t,r)=>{let i=D(e),a,o=()=>setTimeout(()=>{i=D(e),r()},D(n));return L(()=>{clearTimeout(a)}),{get(){return t(),i},set(e){i=e,r(),clearTimeout(a),a=o()}}})}function ke(e,t){Ee(t)&&n(e,t)}function Ae(e,t,n={}){let{immediate:r=!0,immediateCallback:i=!1}=n,a=d(!1),o=null;function c(){o&&=(clearTimeout(o),null)}function l(){a.value=!1,c()}function u(...n){i&&e(),c(),a.value=!0,o=setTimeout(()=>{a.value=!1,o=null,e(...n)},D(t))}return r&&(a.value=!0,be&&u()),L(l),{isPending:s(a),start:u,stop:l}}function je(e,t,n){return i(e,t,{...n,immediate:!0})}function Me(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function Ne(e,t,n=`.`,r){if(!Me(t))return Ne(e,{},n,r);let i=Object.assign({},t);for(let t in e){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(Array.isArray(a)&&Array.isArray(i[t])?i[t]=[...a,...i[t]]:Me(a)&&Me(i[t])?i[t]=Ne(a,i[t],(n?`${n}.`:``)+t.toString(),r):i[t]=a))}return i}function Pe(e){return(...t)=>t.reduce((t,n)=>Ne(t,n,``,e),{})}var Fe=Pe(),Ie=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Le=new WeakMap,Re=new WeakMap,ze={},Be=0,Ve=function(e){return e&&(e.host||Ve(e.parentNode))},He=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Ve(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Ue=function(e,t,n,r){var i=He(t,Array.isArray(e)?e:[e]);ze[n]||(ze[n]=new WeakMap);var a=ze[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Le.get(e)||0)+1,l=(a.get(e)||0)+1;Le.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Re.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Be++,function(){o.forEach(function(e){var t=Le.get(e)-1,i=a.get(e)-1;Le.set(e,t),a.set(e,i),t||(Re.has(e)||e.removeAttribute(r),Re.delete(e)),i||e.removeAttribute(n)}),Be--,Be||(Le=new WeakMap,Le=new WeakMap,Re=new WeakMap,ze={})}},We=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Ie(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Ue(r,i,n,`aria-hidden`)):function(){return null}},Ge=[`top`,`right`,`bottom`,`left`],Ke=Math.min,R=Math.max,qe=Math.round,Je=Math.floor,z=e=>({x:e,y:e}),Ye={left:`right`,right:`left`,bottom:`top`,top:`bottom`},Xe={start:`end`,end:`start`};function Ze(e,t,n){return R(e,Ke(t,n))}function B(e,t){return typeof e==`function`?e(t):e}function V(e){return e.split(`-`)[0]}function Qe(e){return e.split(`-`)[1]}function $e(e){return e===`x`?`y`:`x`}function et(e){return e===`y`?`height`:`width`}var tt=new Set([`top`,`bottom`]);function H(e){return tt.has(V(e))?`y`:`x`}function nt(e){return $e(H(e))}function rt(e,t,n){n===void 0&&(n=!1);let r=Qe(e),i=nt(e),a=et(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ft(o)),[o,ft(o)]}function it(e){let t=ft(e);return[at(e),t,at(t)]}function at(e){return e.replace(/start|end/g,e=>Xe[e])}var ot=[`left`,`right`],st=[`right`,`left`],ct=[`top`,`bottom`],lt=[`bottom`,`top`];function ut(e,t,n){switch(e){case`top`:case`bottom`:return n?t?st:ot:t?ot:st;case`left`:case`right`:return t?ct:lt;default:return[]}}function dt(e,t,n,r){let i=Qe(e),a=ut(V(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(at)))),a}function ft(e){return e.replace(/left|right|bottom|top/g,e=>Ye[e])}function pt(e){return{top:0,right:0,bottom:0,left:0,...e}}function mt(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:pt(e)}function ht(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function gt(e,t,n){let{reference:r,floating:i}=e,a=H(t),o=nt(t),s=et(o),c=V(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Qe(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}var _t=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=gt(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:o,elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=gt(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}};async function vt(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=B(t,e),p=mt(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ht(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=ht(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var yt=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=B(e,t)||{};if(l==null)return{};let d=mt(u),f={x:n,y:r},p=nt(i),m=et(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Ke(d[_],T),D=Ke(d[v],T),O=E,ee=C-h[m]-D,k=C/2-h[m]/2+w,A=Ze(O,k,ee),j=!c.arrow&&Qe(i)!=null&&k!==A&&a.reference[m]/2-(k<O?E:D)-h[m]/2<0,M=j?k<O?k-O:k-ee:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),bt=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=B(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=V(r),_=H(o),v=V(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ft(o)]:it(o)),x=p!==`none`;!d&&x&&b.push(...dt(o,m,p,y));let S=[o,...b],C=await vt(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=rt(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==H(t))||T.every(e=>H(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=H(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function xt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function St(e){return Ge.some(t=>e[t]>=0)}var Ct=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n}=t,{strategy:r=`referenceHidden`,...i}=B(e,t);switch(r){case`referenceHidden`:{let e=xt(await vt(t,{...i,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:St(e)}}}case`escaped`:{let e=xt(await vt(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:St(e)}}}default:return{}}}}},wt=new Set([`left`,`top`]);async function Tt(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=V(n),s=Qe(n),c=H(n)===`y`,l=wt.has(o)?-1:1,u=a&&c?-1:1,d=B(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Et=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Tt(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Dt=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=B(e,t),l={x:n,y:r},u=await vt(t,c),d=H(V(i)),f=$e(d),p=l[f],m=l[d];if(a){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=p+u[e],r=p-u[t];p=Ze(n,p,r)}if(o){let e=d===`y`?`top`:`left`,t=d===`y`?`bottom`:`right`,n=m+u[e],r=m-u[t];m=Ze(n,m,r)}let h=s.fn({...t,[f]:p,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:a,[d]:o}}}}}},Ot=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=B(e,t),u={x:n,y:r},d=H(i),f=$e(d),p=u[f],m=u[d],h=B(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=wt.has(V(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},kt=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=B(e,t),u=await vt(t,l),d=V(i),f=Qe(i),p=H(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=Ke(h-u[g],v),x=Ke(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=R(u.left,0),t=R(u.right,0),n=R(u.top,0),r=R(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:R(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:R(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function At(){return typeof window<`u`}function jt(e){return Mt(e)?(e.nodeName||``).toLowerCase():`#document`}function U(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function W(e){return((Mt(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Mt(e){return At()?e instanceof Node||e instanceof U(e).Node:!1}function G(e){return At()?e instanceof Element||e instanceof U(e).Element:!1}function K(e){return At()?e instanceof HTMLElement||e instanceof U(e).HTMLElement:!1}function Nt(e){return!At()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof U(e).ShadowRoot}var Pt=new Set([`inline`,`contents`]);function Ft(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=q(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Pt.has(i)}var It=new Set([`table`,`td`,`th`]);function Lt(e){return It.has(jt(e))}var Rt=[`:popover-open`,`:modal`];function zt(e){return Rt.some(t=>{try{return e.matches(t)}catch{return!1}})}var Bt=[`transform`,`translate`,`scale`,`rotate`,`perspective`],Vt=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],Ht=[`paint`,`layout`,`strict`,`content`];function Ut(e){let t=Gt(),n=G(e)?q(e):e;return Bt.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||Vt.some(e=>(n.willChange||``).includes(e))||Ht.some(e=>(n.contain||``).includes(e))}function Wt(e){let t=Yt(e);for(;K(t)&&!qt(t);){if(Ut(t))return t;if(zt(t))return null;t=Yt(t)}return null}function Gt(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var Kt=new Set([`html`,`body`,`#document`]);function qt(e){return Kt.has(jt(e))}function q(e){return U(e).getComputedStyle(e)}function Jt(e){return G(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Yt(e){if(jt(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Nt(e)&&e.host||W(e);return Nt(t)?t.host:t}function Xt(e){let t=Yt(e);return qt(t)?e.ownerDocument?e.ownerDocument.body:e.body:K(t)&&Ft(t)?t:Xt(t)}function Zt(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Xt(e),i=r===e.ownerDocument?.body,a=U(r);if(i){let e=Qt(a);return t.concat(a,a.visualViewport||[],Ft(r)?r:[],e&&n?Zt(e):[])}return t.concat(r,Zt(r,[],n))}function Qt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function $t(e){let t=q(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=K(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=qe(n)!==a||qe(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function en(e){return G(e)?e:e.contextElement}function tn(e){let t=en(e);if(!K(t))return z(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=$t(t),o=(a?qe(n.width):n.width)/r,s=(a?qe(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var nn=z(0);function rn(e){let t=U(e);return!Gt()||!t.visualViewport?nn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function an(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==U(e)?!1:t}function on(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=en(e),o=z(1);t&&(r?G(r)&&(o=tn(r)):o=tn(e));let s=an(a,n,r)?rn(a):z(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=U(a),t=r&&G(r)?U(r):r,n=e,i=Qt(n);for(;i&&r&&t!==n;){let e=tn(i),t=i.getBoundingClientRect(),r=q(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=U(i),i=Qt(n)}}return ht({width:u,height:d,x:c,y:l})}function sn(e,t){let n=Jt(e).scrollLeft;return t?t.left+n:on(W(e)).left+n}function cn(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-sn(e,n),y:n.top+t.scrollTop}}function ln(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=W(r),s=t?zt(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=z(1),u=z(0),d=K(r);if((d||!d&&!a)&&((jt(r)!==`body`||Ft(o))&&(c=Jt(r)),K(r))){let e=on(r);l=tn(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?cn(o,c):z(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function un(e){return Array.from(e.getClientRects())}function dn(e){let t=W(e),n=Jt(e),r=e.ownerDocument.body,i=R(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=R(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+sn(e),s=-n.scrollTop;return q(r).direction===`rtl`&&(o+=R(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var fn=25;function pn(e,t){let n=U(e),r=W(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Gt();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=sn(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=fn&&(a-=o)}else l<=fn&&(a+=l);return{width:a,height:o,x:s,y:c}}var mn=new Set([`absolute`,`fixed`]);function hn(e,t){let n=on(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=K(e)?tn(e):z(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function gn(e,t,n){let r;if(t===`viewport`)r=pn(e,n);else if(t===`document`)r=dn(W(e));else if(G(t))r=hn(t,n);else{let n=rn(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ht(r)}function _n(e,t){let n=Yt(e);return n===t||!G(n)||qt(n)?!1:q(n).position===`fixed`||_n(n,t)}function vn(e,t){let n=t.get(e);if(n)return n;let r=Zt(e,[],!1).filter(e=>G(e)&&jt(e)!==`body`),i=null,a=q(e).position===`fixed`,o=a?Yt(e):e;for(;G(o)&&!qt(o);){let t=q(o),n=Ut(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&mn.has(i.position)||Ft(o)&&!n&&_n(e,o))?r=r.filter(e=>e!==o):i=t,o=Yt(o)}return t.set(e,r),r}function yn(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?zt(t)?[]:vn(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=gn(t,n,i);return e.top=R(r.top,e.top),e.right=Ke(r.right,e.right),e.bottom=Ke(r.bottom,e.bottom),e.left=R(r.left,e.left),e},gn(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function bn(e){let{width:t,height:n}=$t(e);return{width:t,height:n}}function xn(e,t,n){let r=K(t),i=W(t),a=n===`fixed`,o=on(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=z(0);function l(){c.x=sn(i)}if(r||!r&&!a)if((jt(t)!==`body`||Ft(i))&&(s=Jt(t)),r){let e=on(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?cn(i,s):z(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Sn(e){return q(e).position===`static`}function Cn(e,t){if(!K(e)||q(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return W(e)===n&&(n=n.ownerDocument.body),n}function wn(e,t){let n=U(e);if(zt(e))return n;if(!K(e)){let t=Yt(e);for(;t&&!qt(t);){if(G(t)&&!Sn(t))return t;t=Yt(t)}return n}let r=Cn(e,t);for(;r&&Lt(r)&&Sn(r);)r=Cn(r,t);return r&&qt(r)&&Sn(r)&&!Ut(r)?n:r||Wt(e)||n}var Tn=async function(e){let t=this.getOffsetParent||wn,n=this.getDimensions,r=await n(e.floating);return{reference:xn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function En(e){return q(e).direction===`rtl`}var Dn={convertOffsetParentRelativeRectToViewportRelativeRect:ln,getDocumentElement:W,getClippingRect:yn,getOffsetParent:wn,getElementRects:Tn,getClientRects:un,getDimensions:bn,getScale:tn,isElement:G,isRTL:En};function On(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function kn(e,t){let n=null,r,i=W(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Je(d),h=Je(i.clientWidth-(u+f)),g=Je(i.clientHeight-(d+p)),_=Je(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:R(0,Ke(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!On(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function An(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=en(e),u=i||a?[...l?Zt(l):[],...Zt(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?kn(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?on(e):null;c&&g();function g(){let t=on(e);h&&!On(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var jn=Et,Mn=Dt,Nn=bt,Pn=kt,Fn=Ct,In=yt,Ln=Ot,Rn=(e,t,n)=>{let r=new Map,i={platform:Dn,...n},a={...i.platform,_c:r};return _t(e,t,{...i,platform:a})};function zn(e){return typeof e==`object`&&!!e&&`$el`in e}function Bn(e){if(zn(e)){let t=e.$el;return Mt(t)&&jt(t)===`#comment`?null:t}return e}function Vn(e){return typeof e==`function`?e():M(e)}function Hn(e){return{name:`arrow`,options:e,fn(t){let n=Bn(Vn(e.element));return n==null?{}:In({element:n,padding:e.padding}).fn(t)}}}function Un(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Wn(e,t){let n=Un(e);return Math.round(t*n)/n}function Gn(e,t,n){n===void 0&&(n={});let r=n.whileElementsMounted,o=O(()=>Vn(n.open)??!0),s=O(()=>Vn(n.middleware)),l=O(()=>Vn(n.placement)??`bottom`),u=O(()=>Vn(n.strategy)??`absolute`),f=O(()=>Vn(n.transform)??!0),p=O(()=>Bn(e.value)),m=O(()=>Bn(t.value)),h=g(0),v=g(0),y=g(u.value),b=g(l.value),x=d({}),S=g(!1),C=O(()=>{let e={position:y.value,left:`0`,top:`0`};if(!m.value)return e;let t=Wn(m.value,h.value),n=Wn(m.value,v.value);return f.value?{...e,transform:`translate(`+t+`px, `+n+`px)`,...Un(m.value)>=1.5&&{willChange:`transform`}}:{position:y.value,left:t+`px`,top:n+`px`}}),w;function T(){if(p.value==null||m.value==null)return;let e=o.value;Rn(p.value,m.value,{middleware:s.value,placement:l.value,strategy:u.value}).then(t=>{h.value=t.x,v.value=t.y,y.value=t.strategy,b.value=t.placement,x.value=t.middlewareData,S.value=e!==!1})}function E(){typeof w==`function`&&(w(),w=void 0)}function D(){if(E(),r===void 0){T();return}if(p.value!=null&&m.value!=null){w=r(p.value,m.value,T);return}}function ee(){o.value||(S.value=!1)}return i([s,l,u,o],T,{flush:`sync`}),i([p,m],D,{flush:`sync`}),i(o,ee,{flush:`sync`}),a()&&c(E),{x:_(h),y:_(v),strategy:_(y),placement:_(b),middlewareData:_(x),isPositioned:_(S),floatingStyles:C,update:T}}var Kn=new WeakMap,qn=(...e)=>{let t=e[0],n=E()?.proxy??a();if(n==null&&!v())throw Error(`injectLocal must be called in setup`);return n&&Kn.has(n)&&t in Kn.get(n)?Kn.get(n)[t]:F(...e)},Jn=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;var Yn=e=>e!==void 0,Xn=Object.prototype.toString,Zn=e=>Xn.call(e)===`[object Object]`;function Qn(e){return e.endsWith(`rem`)?Number.parseFloat(e)*16:Number.parseFloat(e)}function $n(e){return Array.isArray(e)?e:[e]}function er(e){return h(e)?A(new Proxy({},{get(t,n,r){return M(Reflect.get(e.value,n,r))},set(t,n,r){return h(e.value[n])&&!h(r)?e.value[n].value=r:e.value[n]=r,!0},deleteProperty(t,n){return Reflect.deleteProperty(e.value,n)},has(t,n){return Reflect.has(e.value,n)},ownKeys(){return Object.keys(e.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}})):A(e)}function tr(e){return er(O(e))}function nr(e,...t){let n=t.flat(),r=n[0];return tr(()=>typeof r==`function`?Object.fromEntries(Object.entries(ne(e)).filter(([e,t])=>!r(D(t),e))):Object.fromEntries(Object.entries(ne(e)).filter(e=>!n.includes(e[0]))))}function rr(e,t,n){return i(e,t,{...n,immediate:!0})}function ir(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ar=ir();function or(e){ar=e}var sr={exec:()=>null};function J(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(Y.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var cr=(()=>{try{return!0}catch{return!1}})(),Y={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]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ 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+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`)},lr=/^(?:[ \t]*(?:\n|$))+/,ur=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,dr=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,fr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,pr=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,mr=/(?:[*+-]|\d{1,9}[.)])/,hr=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,gr=J(hr).replace(/bull/g,mr).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/).replace(/\|table/g,``).getRegex(),_r=J(hr).replace(/bull/g,mr).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/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),vr=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,yr=/^[^\n]+/,br=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,xr=J(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,br).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Sr=J(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,mr).getRegex(),Cr=`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`,wr=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Tr=J(`^ {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`,wr).replace(`tag`,Cr).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Er=J(vr).replace(`hr`,fr).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`,Cr).getRegex(),Dr={blockquote:J(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,Er).getRegex(),code:ur,def:xr,fences:dr,heading:pr,hr:fr,html:Tr,lheading:gr,list:Sr,newline:lr,paragraph:Er,table:sr,text:yr},Or=J(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,fr).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`,Cr).getRegex(),kr={...Dr,lheading:_r,table:Or,paragraph:J(vr).replace(`hr`,fr).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Or).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`,Cr).getRegex()},Ar={...Dr,html:J(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,wr).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:sr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:J(vr).replace(`hr`,fr).replace(`heading`,` *#{1,6} *[^
|
|
]`).replace(`lheading`,gr).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},jr=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Mr=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Nr=/^( {2,}|\\)\n(?!\s*$)/,Pr=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Fr=/[\p{P}\p{S}]/u,Ir=/[\s\p{P}\p{S}]/u,Lr=/[^\s\p{P}\p{S}]/u,Rr=J(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,Ir).getRegex(),zr=/(?!~)[\p{P}\p{S}]/u,Br=/(?!~)[\s\p{P}\p{S}]/u,Vr=/(?:[^\s\p{P}\p{S}]|~)/u,Hr=J(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,cr?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),Ur=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Wr=J(Ur,`u`).replace(/punct/g,Fr).getRegex(),Gr=J(Ur,`u`).replace(/punct/g,zr).getRegex(),Kr=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,qr=J(Kr,`gu`).replace(/notPunctSpace/g,Lr).replace(/punctSpace/g,Ir).replace(/punct/g,Fr).getRegex(),Jr=J(Kr,`gu`).replace(/notPunctSpace/g,Vr).replace(/punctSpace/g,Br).replace(/punct/g,zr).getRegex(),Yr=J(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,Lr).replace(/punctSpace/g,Ir).replace(/punct/g,Fr).getRegex(),Xr=J(/\\(punct)/,`gu`).replace(/punct/g,Fr).getRegex(),Zr=J(/^<(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(),Qr=J(wr).replace(`(?:-->|$)`,`-->`).getRegex(),$r=J(`^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`,Qr).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ei=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,ti=J(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace(`label`,ei).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ni=J(/^!?\[(label)\]\[(ref)\]/).replace(`label`,ei).replace(`ref`,br).getRegex(),ri=J(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,br).getRegex(),ii=J(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,ni).replace(`nolink`,ri).getRegex(),ai=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,oi={_backpedal:sr,anyPunctuation:Xr,autolink:Zr,blockSkip:Hr,br:Nr,code:Mr,del:sr,emStrongLDelim:Wr,emStrongRDelimAst:qr,emStrongRDelimUnd:Yr,escape:jr,link:ti,nolink:ri,punctuation:Rr,reflink:ni,reflinkSearch:ii,tag:$r,text:Pr,url:sr},si={...oi,link:J(/^!?\[(label)\]\((.*?)\)/).replace(`label`,ei).getRegex(),reflink:J(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,ei).getRegex()},ci={...oi,emStrongRDelimAst:Jr,emStrongLDelim:Gr,url:J(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,ai).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\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:J(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,ai).getRegex()},li={...ci,br:J(Nr).replace(`{2,}`,`*`).getRegex(),text:J(ci.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},ui={normal:Dr,gfm:kr,pedantic:Ar},di={normal:oi,gfm:ci,breaks:li,pedantic:si},fi={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},pi=e=>fi[e];function mi(e,t){if(t){if(Y.escapeTest.test(e))return e.replace(Y.escapeReplace,pi)}else if(Y.escapeTestNoEncode.test(e))return e.replace(Y.escapeReplaceNoEncode,pi);return e}function hi(e){try{e=encodeURI(e).replace(Y.percentDecode,`%`)}catch{return null}return e}function gi(e,t){let n=e.replace(Y.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(Y.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``);for(;r<n.length;r++)n[r]=n[r].trim().replace(Y.slashPipe,`|`);return n}function _i(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function vi(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function yi(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function bi(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
|
|
`)}var xi=class{options;rules;lexer;constructor(e){this.options=e||ar}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:_i(e,`
|
|
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=bi(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=_i(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:_i(t[0],`
|
|
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=_i(t[0],`
|
|
`).split(`
|
|
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
${s}`:s,r=r?`${r}
|
|
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
|
|
`+e.join(`
|
|
`),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}else if(u?.type===`list`){let t=u,a=t.raw+`
|
|
`+e.join(`
|
|
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
|
|
`,1)[0].replace(this.rules.other.listReplaceTabs,e=>` `.repeat(3*e.length)),l=e.split(`
|
|
`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=t[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
|
|
`,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d);for(;e;){let f=e.split(`
|
|
`,1)[0],p;if(l=f,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),p=l):p=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||t.test(l)||n.test(l))break;if(p.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
|
|
`+p.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
|
|
`+l}!u&&!l.trim()&&(u=!0),r+=f+`
|
|
`,e=e.substring(f.length+1),c=p.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,``),e.tokens[0]?.type===`text`||e.tokens[0]?.type===`paragraph`){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,``),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:`checkbox`,raw:t[0]+` `,checked:t[0]!==`[ ]`};e.checked=n.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:`paragraph`,raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let 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){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=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:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=gi(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
`):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(gi(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let 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){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let 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){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let 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){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=_i(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=vi(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),yi(t,{href:n&&n.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))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return yi(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e){let 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){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},X=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ar,this.options.tokenizer=this.options.tokenizer||new xi,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:Y,block:ui.normal,inline:di.normal};this.options.pedantic?(t.block=ui.pedantic,t.inline=di.pedantic):this.options.gfm&&(t.block=ui.gfm,this.options.breaks?t.inline=di.breaks:t.inline=di.gfm),this.tokenizer.rules=t}static get rules(){return{block:ui,inline:di}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(Y.carriageReturn,`
|
|
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace(Y.tabCharGlobal,` `).replace(Y.spaceLine,``));e;){let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
|
|
`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
`)?``:`
|
|
`)+r.raw,n.text+=`
|
|
`+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
`)?``:`
|
|
`)+r.raw,n.text+=`
|
|
`+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);n&&a?.type===`paragraph`?(a.raw+=(a.raw.endsWith(`
|
|
`)?``:`
|
|
`)+r.raw,a.text+=`
|
|
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
`)?``:`
|
|
`)+r.raw,n.text+=`
|
|
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``;for(;e;){a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return t}},Si=class{options;parser;constructor(e){this.options=e||ar}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(Y.notSpaceStart)?.[0],i=e.replace(Y.endingNewline,``)+`
|
|
`;return r?`<pre><code class="language-`+mi(r)+`">`+(n?i:mi(i,!0))+`</code></pre>
|
|
`:`<pre><code>`+(n?i:mi(i,!0))+`</code></pre>
|
|
`}blockquote({tokens:e}){return`<blockquote>
|
|
${this.parser.parse(e)}</blockquote>
|
|
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
`}hr(e){return`<hr>
|
|
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
|
`+r+`</`+i+`>
|
|
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
|
<thead>
|
|
`+t+`</thead>
|
|
`+r+`</table>
|
|
`}tablerow({text:e}){return`<tr>
|
|
${e}</tr>
|
|
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
`}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>${mi(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=hi(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+mi(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=hi(e);if(i===null)return mi(n);e=i;let a=`<img src="${e}" alt="${n}"`;return t&&(a+=` title="${mi(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:mi(e.text)}},Ci=class{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``}checkbox({raw:e}){return e}},Z=class e{options;renderer;textRenderer;constructor(e){this.options=e||ar,this.options.renderer=this.options.renderer||new Si,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ci}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},wi=class{options;block;constructor(e){this.options=e||ar}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?X.lex:X.lexInline}provideParser(){return this.block?Z.parse:Z.parseInline}},Ti=new class{defaults=ir();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Z;Renderer=Si;TextRenderer=Ci;Lexer=X;Tokenizer=xi;Hooks=wi;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Si(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new xi(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new wi;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];wi.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&wi.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return X.lex(e,t??this.defaults)}parser(e,t){return Z.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(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 t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer():e?X.lex:X.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser():e?Z.parse:Z.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer():e?X.lex:X.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser():e?Z.parse:Z.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+mi(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function Q(e,t){return Ti.parse(e,t)}Q.options=Q.setOptions=function(e){return Ti.setOptions(e),Q.defaults=Ti.defaults,or(Q.defaults),Q},Q.getDefaults=ir,Q.defaults=ar,Q.use=function(...e){return Ti.use(...e),Q.defaults=Ti.defaults,or(Q.defaults),Q},Q.walkTokens=function(e,t){return Ti.walkTokens(e,t)},Q.parseInline=Ti.parseInline,Q.Parser=Z,Q.parser=Z.parse,Q.Renderer=Si,Q.TextRenderer=Ci,Q.Lexer=X,Q.lexer=X.lex,Q.Tokenizer=xi,Q.Hooks=wi,Q.parse=Q,Q.options,Q.setOptions,Q.use,Q.walkTokens,Q.parseInline,Z.parse,X.lex;var Ei=1,$=new class{subscribers;toasts;dismissedToasts;constructor(){this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)});publish=e=>{this.subscribers.forEach(t=>t(e))};addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]};create=e=>{let{message:t,...n}=e,r=typeof e.id==`number`||e.id&&e.id?.length>0?e.id:Ei++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r};dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e);message=(e,t)=>this.create({...t,message:e,type:`default`});error=(e,t)=>this.create({...t,type:`error`,message:e});success=(e,t)=>this.create({...t,type:`success`,message:e});info=(e,t)=>this.create({...t,type:`info`,message:e});warning=(e,t)=>this.create({...t,type:`warning`,message:e});loading=(e,t)=>this.create({...t,type:`loading`,message:e});promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],I(e))i=!1,this.create({id:n,type:`default`,message:e});else if(Oi(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!I(r)?r:{message:r||``,id:n||``};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!I(r)?r:{message:r||``,id:n||``};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!I(r)?r:{message:r||``,id:n||``};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!I(r)?r:{message:r||``,id:n||``};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally?.()}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})};custom=(e,t)=>{let n=t?.id||Ei++,r=this.toasts.find(e=>e.id===n),i=t?.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(n)&&this.dismissedToasts.delete(n),r?this.toasts=this.toasts.map(r=>r.id===n?(this.publish({...r,component:e,dismissible:i,id:n,...t}),{...r,component:e,dismissible:i,id:n,...t}):r):this.addToast({component:e,dismissible:i,id:n,...t}),n};getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id))};function Di(e,t){let n=t?.id||Ei++;return $.create({message:e,id:n,type:`default`,...t}),n}var Oi=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,ki=Di,Ai=Object.assign(ki,{success:$.success,info:$.info,warning:$.warning,error:$.error,custom:$.custom,message:$.message,promise:$.promise,dismiss:$.dismiss,loading:$.loading},{getHistory:()=>$.toasts,getToasts:()=>$.getActiveToasts()});function ji(e){return e.label!==void 0}var Mi=3,Ni=`24px`,Pi=`16px`,Fi=4e3,Ii=356,Li=14,Ri=45,zi=200;function Bi(){let e=g(!1);return o(()=>{let t=()=>{e.value=document.hidden};return document.addEventListener(`visibilitychange`,t),()=>window.removeEventListener(`visibilitychange`,t)}),{isDocumentHidden:e}}function Vi(...e){return e.filter(Boolean).join(` `)}function Hi(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}function Ui(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Pi:Ni;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var Wi=[`data-rich-colors`,`data-styled`,`data-mounted`,`data-promise`,`data-swiped`,`data-removed`,`data-visible`,`data-y-position`,`data-x-position`,`data-index`,`data-front`,`data-swiping`,`data-dismissible`,`data-type`,`data-invert`,`data-swipe-out`,`data-swipe-direction`,`data-expanded`,`data-testid`],Gi=[`aria-label`,`data-disabled`,`data-close-button-position`],Ki=k({__name:`Toast`,props:{toast:{},toasts:{},index:{},swipeDirections:{},expanded:{type:Boolean},invert:{type:Boolean},heights:{},gap:{},position:{},closeButtonPosition:{},visibleToasts:{},expandByDefault:{type:Boolean},closeButton:{type:Boolean},interacting:{type:Boolean},style:{},cancelButtonStyle:{},actionButtonStyle:{},duration:{},class:{},unstyled:{type:Boolean},descriptionClass:{},loadingIcon:{},classes:{},icons:{},closeButtonAriaLabel:{},defaultRichColors:{type:Boolean}},emits:[`update:heights`,`update:height`,`removeToast`],setup(t,{emit:a}){let s=t,c=a,l=g(null),u=g(null),d=g(!1),f=g(!1),m=g(!1),h=g(!1),_=g(!1),v=g(0),C=g(0),E=g(s.toast.duration||s.duration||Fi),D=g(null),k=g(null),A=O(()=>s.index===0),ne=O(()=>s.index+1<=s.visibleToasts),F=O(()=>s.toast.type),I=O(()=>s.toast.dismissible!==!1),ae=O(()=>s.toast.class||``),oe=O(()=>s.descriptionClass||``),se=O(()=>{let e=s.toast.position||s.position,t=s.heights.filter(t=>t.position===e).findIndex(e=>e.toastId===s.toast.id);return t>=0?t:0}),ce=O(()=>{let e=s.toast.position||s.position;return s.heights.filter(t=>t.position===e).reduce((e,t,n)=>n>=se.value?e:e+t.height,0)}),le=O(()=>se.value*s.gap+ce.value||0),ue=O(()=>s.toast.closeButton??s.closeButton),de=O(()=>s.toast.duration||s.duration||Fi),fe=g(0),pe=g(0),L=g(null),me=O(()=>s.position.split(`-`)),he=O(()=>me.value[0]),ge=O(()=>me.value[1]),_e=O(()=>typeof s.toast.title!=`string`),ve=O(()=>typeof s.toast.description!=`string`),{isDocumentHidden:ye}=Bi(),be=O(()=>F.value&&F.value===`loading`);re(()=>{d.value=!0,E.value=de.value}),o(async()=>{if(!d.value||!k.value)return;await p();let e=k.value,t=e.style.height;e.style.height=`auto`;let n=e.getBoundingClientRect().height;e.style.height=t,C.value=n,c(`update:height`,{toastId:s.toast.id,height:n,position:s.toast.position||s.position})});function xe(){f.value=!0,v.value=le.value,setTimeout(()=>{c(`removeToast`,s.toast)},zi)}function Se(){if(be.value||!I.value)return{};xe(),s.toast.onDismiss?.(s.toast)}function Ce(e){e.button!==2&&(be.value||!I.value||(D.value=new Date,v.value=le.value,e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(m.value=!0,L.value={x:e.clientX,y:e.clientY})))}function we(){if(h.value||!I.value)return;L.value=null;let e=Number(k.value?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(k.value?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),n=new Date().getTime()-(D.value?.getTime()||0),r=l.value===`x`?e:t,i=Math.abs(r)/n;if(Math.abs(r)>=Ri||i>.11){v.value=le.value,s.toast.onDismiss?.(s.toast),l.value===`x`?u.value=e>0?`right`:`left`:u.value=t>0?`down`:`up`,xe(),h.value=!0;return}else k.value?.style.setProperty(`--swipe-amount-x`,`0px`),k.value?.style.setProperty(`--swipe-amount-y`,`0px`);_.value=!1,m.value=!1,l.value=null}function Te(e){if(!L.value||!I.value||(window?.getSelection()?.toString()?.length??!1))return;let t=e.clientY-L.value.y,n=e.clientX-L.value.x,r=s.swipeDirections??Hi(s.position);!l.value&&(Math.abs(n)>1||Math.abs(t)>1)&&(l.value=Math.abs(n)>Math.abs(t)?`x`:`y`);let i={x:0,y:0},a=e=>1/(1.5+Math.abs(e)/20);if(l.value===`y`){if(r.includes(`top`)||r.includes(`bottom`))if(r.includes(`top`)&&t<0||r.includes(`bottom`)&&t>0)i.y=t;else{let e=t*a(t);i.y=Math.abs(e)<Math.abs(t)?e:t}}else if(l.value===`x`&&(r.includes(`left`)||r.includes(`right`)))if(r.includes(`left`)&&n<0||r.includes(`right`)&&n>0)i.x=n;else{let e=n*a(n);i.x=Math.abs(e)<Math.abs(n)?e:n}(Math.abs(i.x)>0||Math.abs(i.y)>0)&&(_.value=!0),k.value?.style.setProperty(`--swipe-amount-x`,`${i.x}px`),k.value?.style.setProperty(`--swipe-amount-y`,`${i.y}px`)}re(()=>{if(d.value=!0,!k.value)return;let e=k.value.getBoundingClientRect().height;C.value=e,c(`update:heights`,[{toastId:s.toast.id,height:e,position:s.toast.position},...s.heights])}),n(()=>{k.value&&c(`removeToast`,s.toast)}),o(e=>{if(s.toast.promise&&F.value===`loading`||s.toast.duration===1/0||s.toast.type===`loading`)return;let t;s.expanded||s.interacting||ye.value?(()=>{if(pe.value<fe.value){let e=new Date().getTime()-fe.value;E.value-=e}pe.value=new Date().getTime()})():E.value!==1/0&&(fe.value=new Date().getTime(),t=setTimeout(()=>{s.toast.onAutoClose?.(s.toast),xe()},E.value)),e(()=>{clearTimeout(t)})}),i(()=>s.toast.delete,e=>{e!==void 0&&e&&(xe(),s.toast.onDismiss?.(s.toast))},{deep:!0});function Ee(){m.value=!1,l.value=null,L.value=null}return(t,n)=>(r(),P(`li`,{tabindex:`0`,ref_key:`toastRef`,ref:k,class:y(M(Vi)(s.class,ae.value,t.classes?.toast,t.toast.classes?.toast,t.classes?.[F.value],t.toast?.classes?.[F.value])),"data-sonner-toast":``,"data-rich-colors":t.toast.richColors??t.defaultRichColors,"data-styled":!(t.toast.component||t.toast?.unstyled||t.unstyled),"data-mounted":d.value,"data-promise":!!t.toast.promise,"data-swiped":_.value,"data-removed":f.value,"data-visible":ne.value,"data-y-position":he.value,"data-x-position":ge.value,"data-index":t.index,"data-front":A.value,"data-swiping":m.value,"data-dismissible":I.value,"data-type":F.value,"data-invert":t.toast.invert||t.invert,"data-swipe-out":h.value,"data-swipe-direction":u.value,"data-expanded":!!(t.expanded||t.expandByDefault&&d.value),"data-testid":t.toast.testId,style:te({"--index":t.index,"--toasts-before":t.index,"--z-index":t.toasts.length-t.index,"--offset":`${f.value?v.value:le.value}px`,"--initial-height":t.expandByDefault?`auto`:`${C.value}px`,...t.style,...s.toast.style}),onDragend:Ee,onPointerdown:Ce,onPointerup:we,onPointermove:Te},[ue.value&&!t.toast.component&&F.value!==`loading`?(r(),P(`button`,{key:0,"aria-label":t.closeButtonAriaLabel||`Close toast`,"data-disabled":be.value,"data-close-button":`true`,"data-close-button-position":t.closeButtonPosition,class:y(M(Vi)(t.classes?.closeButton,t.toast?.classes?.closeButton)),onClick:Se},[t.icons?.close?(r(),b(e(t.icons?.close),{key:0})):w(t.$slots,`close-icon`,{key:1})],10,Gi)):T(`v-if`,!0),t.toast.component?(r(),b(e(t.toast.component),ie({key:1},t.toast.componentProps,{onCloseToast:Se,isPaused:t.$props.expanded||t.$props.interacting||M(ye)}),null,16,[`isPaused`])):(r(),P(j,{key:2},[F.value!==`default`||t.toast.icon||t.toast.promise?(r(),P(`div`,{key:0,"data-icon":``,class:y(M(Vi)(t.classes?.icon,t.toast?.classes?.icon))},[t.toast.icon?(r(),b(e(t.toast.icon),{key:0})):(r(),P(j,{key:1},[F.value===`loading`?w(t.$slots,`loading-icon`,{key:0}):F.value===`success`?w(t.$slots,`success-icon`,{key:1}):F.value===`error`?w(t.$slots,`error-icon`,{key:2}):F.value===`warning`?w(t.$slots,`warning-icon`,{key:3}):F.value===`info`?w(t.$slots,`info-icon`,{key:4}):T(`v-if`,!0)],64))],2)):T(`v-if`,!0),N(`div`,{"data-content":``,class:y(M(Vi)(t.classes?.content,t.toast?.classes?.content))},[N(`div`,{"data-title":``,class:y(M(Vi)(t.classes?.title,t.toast.classes?.title))},[_e.value?(r(),b(e(t.toast.title),ee(ie({key:0},t.toast.componentProps)),null,16)):(r(),P(j,{key:1},[S(x(t.toast.title),1)],64))],2),t.toast.description?(r(),P(`div`,{key:0,"data-description":``,class:y(M(Vi)(t.descriptionClass,oe.value,t.classes?.description,t.toast.classes?.description))},[ve.value?(r(),b(e(t.toast.description),ee(ie({key:0},t.toast.componentProps)),null,16)):(r(),P(j,{key:1},[S(x(t.toast.description),1)],64))],2)):T(`v-if`,!0)],2),t.toast.cancel?(r(),P(`button`,{key:1,style:te(t.toast.cancelButtonStyle||t.cancelButtonStyle),class:y(M(Vi)(t.classes?.cancelButton,t.toast.classes?.cancelButton)),"data-button":``,"data-cancel":``,onClick:n[0]||=e=>{M(ji)(t.toast.cancel)&&I.value&&(t.toast.cancel.onClick?.(e),xe())}},x(M(ji)(t.toast.cancel)?t.toast.cancel?.label:t.toast.cancel),7)):T(`v-if`,!0),t.toast.action?(r(),P(`button`,{key:2,style:te(t.toast.actionButtonStyle||t.actionButtonStyle),class:y(M(Vi)(t.classes?.actionButton,t.toast.classes?.actionButton)),"data-button":``,"data-action":``,onClick:n[1]||=e=>{M(ji)(t.toast.action)&&(t.toast.action.onClick?.(e),!e.defaultPrevented&&xe())}},x(M(ji)(t.toast.action)?t.toast.action?.label:t.toast.action),7)):T(`v-if`,!0)],64))],46,Wi))}}),qi=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},Ji={},Yi={xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stoke-width":`1.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`};function Xi(e,t){return r(),P(`svg`,Yi,t[0]||=[N(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`},null,-1),N(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`},null,-1)])}var Zi=qi(Ji,[[`render`,Xi]]),Qi=[`data-visible`],$i={class:`sonner-spinner`},ea=k({__name:`Loader`,props:{visible:{type:Boolean}},setup(e){let t=Array(12).fill(0);return(e,n)=>(r(),P(`div`,{class:`sonner-loading-wrapper`,"data-visible":e.visible},[N(`div`,$i,[(r(!0),P(j,null,u(M(t),e=>(r(),P(`div`,{key:`spinner-bar-${e}`,class:`sonner-loading-bar`}))),128))])],8,Qi))}}),ta={},na={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`};function ra(e,t){return r(),P(`svg`,na,t[0]||=[N(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,"clip-rule":`evenodd`},null,-1)])}var ia=qi(ta,[[`render`,ra]]),aa={},oa={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`};function sa(e,t){return r(),P(`svg`,oa,t[0]||=[N(`path`,{"fill-rule":`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,"clip-rule":`evenodd`},null,-1)])}var ca=qi(aa,[[`render`,sa]]),la={},ua={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`};function da(e,t){return r(),P(`svg`,ua,t[0]||=[N(`path`,{"fill-rule":`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,"clip-rule":`evenodd`},null,-1)])}var fa=qi(la,[[`render`,da]]),pa={},ma={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`};function ha(e,t){return r(),P(`svg`,ma,t[0]||=[N(`path`,{"fill-rule":`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,"clip-rule":`evenodd`},null,-1)])}var ga=qi(pa,[[`render`,ha]]),_a=[`aria-label`],va=[`data-sonner-theme`,`dir`,`data-theme`,`data-rich-colors`,`data-y-position`,`data-x-position`],ya=typeof window<`u`&&typeof document<`u`;function ba(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}var xa=k({name:`Toaster`,inheritAttrs:!1,__name:`Toaster`,props:{id:{},invert:{type:Boolean,default:!1},theme:{default:`light`},position:{default:`bottom-right`},closeButtonPosition:{default:`top-left`},hotkey:{default:()=>[`altKey`,`KeyT`]},richColors:{type:Boolean,default:!1},expand:{type:Boolean,default:!1},duration:{},gap:{default:Li},visibleToasts:{default:Mi},closeButton:{type:Boolean,default:!1},toastOptions:{default:()=>({})},class:{default:``},style:{},offset:{default:Ni},mobileOffset:{default:Pi},dir:{default:`auto`},swipeDirections:{},icons:{},containerAriaLabel:{default:`Notifications`}},setup(e){let t=e,n=l(),i=g([]),a=O(()=>t.id?i.value.filter(e=>e.toasterId===t.id):i.value.filter(e=>!e.toasterId));function s(e,t){return a.value.filter(n=>!n.position&&t===0||n.position===e)}let c=O(()=>{let e=a.value.filter(e=>e.position).map(e=>e.position);return e.length>0?Array.from(new Set([t.position].concat(e))):[t.position]}),d=O(()=>{let e={};return c.value.forEach(t=>{e[t]=i.value.filter(e=>e.position===t)}),e}),m=g([]),h=g({}),_=g(!1);o(()=>{c.value.forEach(e=>{e in h.value||(h.value[e]=!1)})});let v=g(t.theme===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:t.theme),x=g(null),S=g(null),E=g(!1),D=t.hotkey.join(`+`).replace(/Key/g,``).replace(/Digit/g,``);function ee(e){i.value.find(t=>t.id===e.id)?.delete||$.dismiss(e.id),i.value=i.value.filter(({id:t})=>t!==e.id),setTimeout(()=>{i.value.find(t=>t.id===e.id)||(m.value=m.value.filter(t=>t.toastId!==e.id))},zi+50)}function k(e){E.value&&!e.currentTarget?.contains?.(e.relatedTarget)&&(E.value=!1,S.value&&=(S.value.focus({preventScroll:!0}),null))}function A(e){e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||E.value||(E.value=!0,S.value=e.relatedTarget)}function ne(e){e.target&&e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||(_.value=!0)}o(e=>{e($.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{i.value=i.value.map(t=>t.id===e.id?{...t,delete:!0}:t)});return}p(()=>{let t=i.value.findIndex(t=>t.id===e.id);t===-1?i.value=[e,...i.value]:i.value=[...i.value.slice(0,t),{...i.value[t],...e},...i.value.slice(t+1)]})}))}),o(e=>{if(typeof window>`u`)return;if(t.theme!==`system`){v.value=t.theme;return}let n=window.matchMedia(`(prefers-color-scheme: dark)`),r=e=>{v.value=e?`dark`:`light`};r(n.matches);let i=e=>{r(e.matches)};try{n.addEventListener(`change`,i)}catch{n.addListener(i)}e(()=>{try{n.removeEventListener(`change`,i)}catch{n.removeListener(i)}})}),o(()=>{x.value&&S.value&&(S.value.focus({preventScroll:!0}),S.value=null,E.value=!1)}),o(()=>{i.value.length<=1&&Object.keys(h.value).forEach(e=>{h.value[e]=!1})}),o(e=>{function n(e){let n=t.hotkey.every(t=>e[t]||e.code===t),r=Array.isArray(x.value)?x.value[0]:x.value;n&&(c.value.forEach(e=>{h.value[e]=!0}),r?.focus());let i=document.activeElement===x.value||r?.contains(document.activeElement);e.code===`Escape`&&i&&c.value.forEach(e=>{h.value[e]=!1})}ya&&(document.addEventListener(`keydown`,n),e(()=>{document.removeEventListener(`keydown`,n)}))});function F(e){let t=e.currentTarget,n=t.getAttribute(`data-y-position`)+`-`+t.getAttribute(`data-x-position`);h.value[n]=!0}function re(e){if(!_.value){let t=e.currentTarget,n=t.getAttribute(`data-y-position`)+`-`+t.getAttribute(`data-x-position`);h.value[n]=!1}}function I(){Object.keys(h.value).forEach(e=>{h.value[e]=!1})}function ae(){_.value=!1}function oe(e){m.value=e}function se(e){let t=m.value.findIndex(t=>t.toastId===e.toastId);if(t!==-1)m.value[t]=e;else{let t=m.value.findIndex(t=>t.position===e.position);t===-1?m.value.unshift(e):m.value.splice(t,0,e)}}return(e,i)=>(r(),P(j,null,[T(` Remove item from normal navigation flow, only available via hotkey `),N(`section`,{"aria-label":`${e.containerAriaLabel} ${M(D)}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`},[(r(!0),P(j,null,u(c.value,(i,a)=>(r(),P(`ol`,ie({key:i,ref_for:!0,ref_key:`listRef`,ref:x,"data-sonner-toaster":``,"data-sonner-theme":v.value,class:t.class,dir:e.dir===`auto`?ba():e.dir,tabIndex:-1,"data-theme":e.theme,"data-rich-colors":e.richColors,"data-y-position":i.split(`-`)[0],"data-x-position":i.split(`-`)[1],style:{"--front-toast-height":`${m.value[0]?.height||0}px`,"--width":`${M(Ii)}px`,"--gap":`${e.gap}px`,...e.style,...M(n).style,...M(Ui)(e.offset,e.mobileOffset)}},{ref_for:!0},e.$attrs,{onBlur:k,onFocus:A,onMouseenter:F,onMousemove:F,onMouseleave:re,onDragend:I,onPointerdown:ne,onPointerup:ae}),[(r(!0),P(j,null,u(s(i,a),(n,a)=>(r(),b(Ki,{key:n.id,heights:m.value,icons:e.icons,index:a,toast:n,defaultRichColors:e.richColors,duration:e.toastOptions?.duration??e.duration,class:y(e.toastOptions?.class??``),descriptionClass:e.toastOptions?.descriptionClass,invert:e.invert,visibleToasts:e.visibleToasts,closeButton:e.toastOptions?.closeButton??e.closeButton,interacting:_.value,position:i,closeButtonPosition:e.toastOptions?.closeButtonPosition??e.closeButtonPosition,style:te(e.toastOptions?.style),unstyled:e.toastOptions?.unstyled,classes:e.toastOptions?.classes,cancelButtonStyle:e.toastOptions?.cancelButtonStyle,actionButtonStyle:e.toastOptions?.actionButtonStyle,"close-button-aria-label":e.toastOptions?.closeButtonAriaLabel,toasts:d.value[i],expandByDefault:e.expand,gap:e.gap,expanded:h.value[i]||!1,swipeDirections:t.swipeDirections,"onUpdate:heights":oe,"onUpdate:height":se,onRemoveToast:ee},{"close-icon":f(()=>[w(e.$slots,`close-icon`,{},()=>[C(Zi)])]),"loading-icon":f(()=>[w(e.$slots,`loading-icon`,{},()=>[C(ea,{visible:n.type===`loading`},null,8,[`visible`])])]),"success-icon":f(()=>[w(e.$slots,`success-icon`,{},()=>[C(ia)])]),"error-icon":f(()=>[w(e.$slots,`error-icon`,{},()=>[C(ga)])]),"warning-icon":f(()=>[w(e.$slots,`warning-icon`,{},()=>[C(fa)])]),"info-icon":f(()=>[w(e.$slots,`info-icon`,{},()=>[C(ca)])]),_:2},1032,[`heights`,`icons`,`index`,`toast`,`defaultRichColors`,`duration`,`class`,`descriptionClass`,`invert`,`visibleToasts`,`closeButton`,`interacting`,`position`,`closeButtonPosition`,`style`,`unstyled`,`classes`,`cancelButtonStyle`,`actionButtonStyle`,`close-button-aria-label`,`toasts`,`expandByDefault`,`gap`,`expanded`,`swipeDirections`]))),128))],16,va))),128))],8,_a)],2112))}});export{Ce as A,oe as B,pe as C,be as D,ge as E,L as F,Ae as I,je as L,Oe as M,De as N,xe as O,ke as P,fe as R,Fe as S,he as T,Ln as _,Jn as a,Pn as b,Qn as c,rr as d,Hn as f,Fn as g,Nn as h,qn as i,ye as j,we as k,nr as l,An as m,Ai as n,Yn as o,Gn as p,Q as r,Zn as s,xa as t,$n as u,jn as v,me as w,We as x,Mn as y,le as z}; |